Hi
I have very simple assembly code in NASM:
section .text
global main ;must be declared for linker (ld)
main: ;tells linker entry point
mov edx,len ;message length
mov ecx,msg ;message to write
mov ebx,1 ;file descriptor (stdout)
mov eax,4 ;system call number (sys_write)
int 0x80 ;call kernel
mov eax,1 ;system call number (sys_exit)
int 0x80 ;call kernel
section .data
msg db 'Hello, world!', 0xa ;our dear string
len equ $ - msg ;length of our dear string
To compile, I have:
nasm -f win32 test.asm -o test.o
ld test.o -o test.exe
By now, there is no problem. But as long as I run:
test or test.exe
A new window opens which says:
A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.
./test, /test does not work at all.
I'm working on win32.
Thanks,