restart this course with more detail
This commit is contained in:
parent
ad9f04fcc4
commit
2c7be9b288
|
@ -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
|
Binary file not shown.
|
@ -1,4 +1,9 @@
|
||||||
@echo off
|
@echo off
|
||||||
echo ~~~~ starting build ~~~~
|
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
|
ml64 /nologo /c /Zi /Cp %1.asm
|
||||||
cl /nologo /O2 /Zi /utf-8 /EHa /Fe%1.exe c.cpp %1.obj
|
cl /nologo /O2 /Zi /utf-8 /EHa /Fe%1.exe main.cpp %1.obj
|
17
src/main.cpp
17
src/main.cpp
|
@ -2,12 +2,15 @@
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
|
// Function written in ASM
|
||||||
void asm_func(void);
|
void asm_func(void);
|
||||||
};
|
}
|
||||||
|
|
||||||
int main(void)
|
int main()
|
||||||
{
|
{
|
||||||
printf("calling asm main\n");
|
printf("calling asm function\n");
|
||||||
asm_func();
|
asm_func();
|
||||||
printf("return from asm main\n");
|
printf("returned from asm function\n");
|
||||||
|
|
||||||
|
return(0);
|
||||||
}
|
}
|
Loading…
Reference in New Issue