Ich verwende nasm, um die folgende Baugruppe zu kompilieren. Der Code stürzt jedoch in der Konsole unter Windows ab.Hallo Welt mit Nasm in Windows-Assembly
C: \> nasm -f win32 test.asm -o test.o
C: \> ld test.o -o test.exe
section .data
msg db 'Hello world!', 0AH
len equ $-msg
section .text
global [email protected]
[email protected]:
mov edx, len
mov ecx, msg
mov ebx, 1
mov eax, 4
int 80h
mov ebx, 0
mov eax, 1
int 80h
Nach dies post. Die Funktion main
ist unter Windows nicht verfügbar und muss durch WinMain
ersetzt werden.
Mein Arbeitsbeispiel:
section .text
global [email protected]
[email protected]:
mov eax, 0
ret 16
Bitte bearbeiten Sie den Titel, so dass es für zukünftige Besucher nützlich sein wird. Sonst kann es als zu lokalisiert geschlossen werden. –
@ RaymondChen zu was? – fuzz