I am doing Narue's Introduction to Assembly, and when I run my program, nothing happens.
This is my code:
[section .data]
hello: db 'Hello, world!', 10, 0 ;15 bytes
nl: db ' ', 10, 0 ;3 bytes
[section .text]
global _main, _print_nl, _print_msg, _return
extern _printf
_print_nl:
push nl
call _printf
add esp, 4
_print_msg:
push hello
call _printf
add esp, 4
_return:
mov eax, 0
ret
_main:
call _print_msg
call _print_nl
call _print_msg
call _return
This is what happened in my command window:
C:\Documents and Settings\tom\Desktop\Assembly>nasm -f win32 First.asm -o First.obj
C:\Documents and Settings\tom\Desktop\Assembly>gcc First.obj -o prog.exe
C:\Documents and Settings\tom\Desktop\Assembly>prog.exe
C:\Documents and Settings\tom\Desktop\Assembly>
Any help would be appreciated