diff --git a/src/1_3.asm b/src/1_3.asm new file mode 100644 index 0000000..5425e79 --- /dev/null +++ b/src/1_3.asm @@ -0,0 +1,13 @@ + .CODE + + option casemap:none ; make all symbols case sensitive (like C) + + public asm_func ; make this visible outside of this source + +asm_func PROC ; start procedure + + ret + +asm_func ENDP ; end procedure + + END \ No newline at end of file diff --git a/src/1_3.exe b/src/1_3.exe new file mode 100644 index 0000000..b64044c Binary files /dev/null and b/src/1_3.exe differ diff --git a/src/build.bat b/src/build.bat index f618919..b97e77f 100644 --- a/src/build.bat +++ b/src/build.bat @@ -1,4 +1,9 @@ @echo off echo ~~~~ starting build ~~~~ + +REM /nolog is dont show MS info at run +REM /c is compile dont link +REM /Zi is debug info +REM /Cp is preserve cases ml64 /nologo /c /Zi /Cp %1.asm -cl /nologo /O2 /Zi /utf-8 /EHa /Fe%1.exe c.cpp %1.obj \ No newline at end of file +cl /nologo /O2 /Zi /utf-8 /EHa /Fe%1.exe main.cpp %1.obj \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 51dad6d..976d773 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,12 +2,15 @@ extern "C" { - void asm_func(void); -}; + // Function written in ASM + void asm_func(void); +} -int main(void) +int main() { - printf("calling asm main\n"); + printf("calling asm function\n"); asm_func(); - printf("return from asm main\n"); + printf("returned from asm function\n"); + + return(0); } \ No newline at end of file