|
[code:1]
section .text
global main
main:
mov ax, 2000h
mov ss, ax ;error
mov sp, 0
add sp, 4
pop ax
pop bx
push ax
push bx
pop ax
pop bx
mov eax, 1
int 0x80
[/code:1]
这个程序用 ald 调试的时候出现下面的错误:
[code:1]
ald> n
eax = 0x00002000 ebx = 0x00000000 ecx = 0x00000000 edx = 0x00000000
esp = 0xBFFFF8A0 ebp = 0x00000000 esi = 0x00000000 edi = 0x00000000
ds = 0x002B es = 0x002B fs = 0x0000 gs = 0x0000
ss = 0x002B cs = 0x0023 eip = 0x08048084 eflags = 0x00200302
Flags: TF IF ID
08048084 8ED8 mov ds, ax
ald> n
Program received signal SIGSEGV (Segmentation fault)
Location: 0x08048084
eax = 0x00002000 ebx = 0x00000000 ecx = 0x00000000 edx = 0x00000000
esp = 0xBFFFF8A0 ebp = 0x00000000 esi = 0x00000000 edi = 0x00000000
ds = 0x002B es = 0x002B fs = 0x0000 gs = 0x0000
ss = 0x002B cs = 0x0023 eip = 0x08048084 eflags = 0x00210302
Flags: TF IF RF ID
08048084 8ED8 mov ds, ax
[/code:1]
刚开始用 nasm, 对其语法不是很了解, 能帮忙看看是什么错误吗? |
|