【发布时间】:2015-03-30 01:56:44
【问题描述】:
当我第二次通过循环并输入 E(打算退出循环)时,我不断收到分段错误。如果我第一次输入 E,它就可以退出。希望我只是在这里愚蠢,有人可以建议一个简单的解决方法!
感谢您的宝贵时间。
声明:
segment .bss
a resd 1
b resd 1
op resb 2
主要:
loop:
call read_int ;read two integers, then a char
mov [a], eax
call read_int
mov [b], eax
call read_char
call read_char ;takes newline input
cmp al, 'E' ;if char is E, then exit
je exit
call loop ;start over
exit:
dump_regs 0 ;completes, but then seg faults if the loop has run more than once
【问题讨论】:
标签: loops assembly segmentation-fault nasm cmp