问题
The program returns an infinite number of r (they should be just 6), so I think the problem is the LOOP istruction, but I don't know how to solve it.
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
来源:https://stackoverflow.com/questions/55871038/infinite-loop-assembly-8086