我正在使用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位操作系统 –