Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Assembly 模拟十进制递增计数器的汇编语言程序_Assembly_X86_Dos - Fatal编程技术网

Assembly 模拟十进制递增计数器的汇编语言程序

Assembly 模拟十进制递增计数器的汇编语言程序,assembly,x86,dos,Assembly,X86,Dos,这是一个模拟十进制递增计数器的汇编语言程序。但是输出被固定在00。为什么? .model small .code call cls mov ch,30h mov cl,30h next: mov dh,12 mov dl,38 mov bx,00 mov ah,2 int 10h mov dl,ch mov ah,2 int

这是一个模拟十进制递增计数器的汇编语言程序。但是输出被固定在00。为什么?

.model small


.code
        call cls

        mov ch,30h
        mov cl,30h

  next: mov dh,12
        mov dl,38
        mov bx,00
        mov ah,2
        int 10h

        mov dl,ch
        mov ah,2
        int 21h

        mov dl,cl
        mov ah,2
        int 21h

        inc cl

        call dely

        cmp cl,39h
        jbe next

        mov cl,30h
        inc ch
        cmp ch,39h
        jbe next

        mov ah,4ch
        int 21h

   cls  proc near
        mov cx,55
        mov dl,13
    nl: mov ah,2
        int 21h
        loop nl
        ret
        cls endp

  dely proc near
        mov SI,05fffh
     L1:mov DI,05fffh
     L2:dec DI
        jnz L2
        dec SI
        jnz L1
        ret
        dely endp

        end

代码的唯一问题是
dely
过程等待时间太长,因此您认为它卡住了。尝试用更少的东西加载
SI
,10左右的值在这里似乎可以正常工作。

int 10h
可能会破坏您的
CX
寄存器。