开发者

Fasm "while" problem

开发者 https://www.devze.com 2023-03-22 22:07 出处:网络
I\'m trying to write a simple \"while\" in fasm that print A into DOS console 4 times. Here the code org 100h

I'm trying to write a simple "while" in fasm that print A into DOS console 4 times. Here the code

org 100h
use16

jnp ciclo

ciclo:
        cmp [c],0
    开发者_如何学C    jle fine

        mov ah,02h
        mov dl,'A'
        int 21h

        dec [c]
        jnp ciclo

fine: ret

c db 5

When i run it it prints only one A on the scren and then exit. Sameone can help? Thanks Gianluca


JNP is a conditional jump if the parity flag is not set. You want the unconditional jump (JMP) instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消