我正在使用Windows 7學習彙編語言。我使用NASM創建目標文件和mingw以創建可執行文件。無法在Windows 7中運行由nasm生成的可執行文件
我使用的編譯下面的命令,並運行可執行文件
del hello.o
del hello.exe
nasm -f elf hello.asm
ld hello.o -o hello.exe
hello
在運行用hello.exe文件,顯示「用hello.exe已採空的工作」
在使用的錯誤信息以下命令
nasm -f bin hello.asm -o program.exe
我有下面
所示的錯誤3210我的程序代碼
global _start ; global entry point export for ld
section .text
_start:
; sys_write(stdout, message, length)
mov eax, 4 ; sys_write syscall
mov ebx, 1 ; stdout
mov ecx, message ; message address
mov edx, length ; message string length
int 80h
; sys_exit(return_code)
mov eax, 1 ; sys_exit syscall
mov ebx, 0 ; return 0 (success)
int 80h
section .data
message: db 'Hello, world!',0x0A ; message and newline
length: equ $-message ; NASM definition pseudo-instruction
向我們展示代碼。 – paxdiablo
我的系統類型:32位操作系統 –