程序返回无穷多个r(它们应该仅为6),所以我认为问题出在LOOP指令上,但我不知道如何解决。
section .text
global _start
_start:
mov ecx, [x] ;x is a constant (5)
_cicloStampa:
push ecx
call _outputsingolocarattere
pop ecx
LOOP _cicloStampa
jmp _esci
_outputsingolocarattere:
mov ecx, stringa
mov edx, 1
mov ebx, 1
mov eax, 4
int 0x80
ret
_esci:
mov eax, 1
mov ebx, 0
int 0x80
section .data
x db 6
stringa dw "r"
len equ $ - stringa