Hello, world

This commit is contained in:
Tyrel Souza 2024-07-12 23:32:09 -04:00
parent 4095bacdf6
commit c7bcd23ce7
4 changed files with 49 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*.exe
*.obj
*.lnk

12
listing1-4.asm Normal file
View File

@ -0,0 +1,12 @@
.code
myProc proc
ret
myProc endp
main PROC
call myProc
ret
main endp
end

22
listing1-5.asm Normal file
View File

@ -0,0 +1,22 @@
option casemap:none
.data
fmtStr byte "Hello, world!", 10, 0
.code
externdef printf:proc
public asmFunc
asmFunc proc
sub rsp, 56
lea rcx, fmtStr
call printf
add rsp, 56
ret
asmFunc endp
end

12
listing1-6.cpp Normal file
View File

@ -0,0 +1,12 @@
#include <stdio.h>
extern "C"
{
void asmFunc(void);
};
int main(void){
printf("Calling asmFunc: \n");
asmFunc();
printf("Returned from asmFunc\n");
}