发布网友 发布时间: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