搜索

汇编语言 通过键盘输入0~9数字 按0退出 按1~9用该值乘以100做延时_百度...

发布网友 发布时间:2024-10-23 20:05

我来回答

1个回答

热心网友 时间:2024-10-23 20:03

输入1~9,则延时1~9秒。

        CODE  SEGMENT
              ASSUME    CS:CODE
              ORG       100H
      START:  PUSH      CS
              POP       DS
              PUSH      CS
              POP       ES
         @0:
              MOV       AH,15
              INT       10H
              MOV       AH,0
              INT       10H
              MOV       AH,0CH
              MOV       AL,1
              INT       21H
              CMP       AL,'0'
              JE        @EXIT
              CMP       AL,'0'
              JB        @0
              CMP       AL,'9'
              JA        @0
              AND       AL,0FH
              MOV       AH,0
              MOV       BL,18
              MUL       BL
              ; MOV       AX,18*10    ; 延时 10s
              CALL      DELAY_PROC
              JMP       @0
      @EXIT:
              MOV       AH,4CH
              INT       21H

  DELAY_PROC  PROC      NEAR
              PUSH      ES
              PUSH      DX
              MOV       DX,40H
              MOV       ES,DX
              MOV       DX,ES:[006CH]
              ADD       DX,AX
    DELAY10:
              CMP       ES:[006CH],DX
              JBE       DELAY10
              POP       DX
              POP       ES
              RET
  DELAY_PROC  ENDP
        CODE  ENDS
              END       START
声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。
E-MAIL:11247931@qq.com
Top