;store number of accounts to add
mov eax, SYS_READ
mov ebx, STDIN
mov ecx, nums
mov edx, 2
int 0x80
_storeLoop:
dec byte [nums]
;display nums
mov eax, SYS_WRITE
mov ebx, STDOUT
mov ecx, nums
mov edx, 1
int 0x80
mov eax, [nums]
cmp eax, 1
jnz _storeLoop
section.bss
nums resb 1
為什么我被困在這個回圈中。我可以看到 nums 最終等于零。我試過使用不同的比較,比如 jg。
uj5u.com熱心網友回復:
正如上面的評論所說,mov eax, [nums]將從保存 1 位元組計數器的記憶體位置讀取 4 位元組。如果此回圈開始時其他 3 個位元組沒有全部歸零,則它將永遠不會終止。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/395668.html
