无限循环-组装8086

时间:2019-04-26 15:48:28

标签: assembly x86-16

程序返回无穷多个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

0 个答案:

没有答案