I wrote a small code in NASM:
section .data
msg db 'Hello', 0
section .text
global main
main:
mov eax, 4
mov ebx, 1
mov ecx, msg
mov edx, 5
int 80h
mov eax, 1
mov ebx, 0
int 80h
Then I compiled it with NASM
and LD
:
nasm -f win32 main.asm
ld main.asm -o main.obj
But it said this:
C:\Users\Bogdan\AppData\Local\bin\NASM>ld: i386 architecture of input file 'main .obj' is incompatible with i386:x86-64
I also tried this:
C:\Users\Bogdan\AppData\Local\bin\NASM>ld -m i386pe -s -o main.exe main.obj
Using this, an EXE file makes, but it is not running at all. What is causing this problem, and how can I fix it?