Aşağıdaki derlemeyi derlemek için nasm kullanıyorum. Ancak kod, Windows altında konsolda çöker. göre \> ld test.o -o test.exeMerhaba dünya Windows montajında nasm kullanarak
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
:
C: \> nasm -f Win32 test.asm -o test.o
Cı Bu post.
main
işlevi Windows altında kullanılamaz veWinMain
ile değiştirilmelidir. giriş noktası_start
veyamain
iseYani,
[email protected]
değiştirildi veret 16
için prosedürün sonundaret
değiştirmek edilmelidir:Benim çalışma örneği:
section .text global [email protected] [email protected]: mov eax, 0 ret 16
Lütfen başlığı daha sonra ziyaretçilere faydalı olacak şekilde düzenleyin. Aksi takdirde, yerelleştirilmiş olarak da kapanabilir. –
@RaymondChen ne için? – fuzz