开发者

Fasm "while" problem

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜