Infinite LOOP - Assembly 8086

旧城冷巷雨未停 提交于 2019-12-11 05:49:11

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!