第1个回答 2013-06-07
NAME LEDCYCLE
STACK1 SEGMENT
STA DW 100DUP(0)
TOP EQU LENGTH STA
STACK1 ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA,SS:STACK
START:MOV AX,DATA
MOV DS,AX
MOV AX,STACK1
MOV SS,AX
MOV SP,TOP
MOV AL,91H
MOV DX,021BH
OUT DX,AL
MOV CX,9
MOV AL,01H
PUSH AX
TEST1:MOV DX,021AH
IN AL,DX
TEST AL,01H
JNZ TEST1
DEC CX
JZ ALLQUENCH
POP AX
MOV DX,0219H
OUT DX,AL
ROL AL,1
PUSH AX
TEST2:MOV DX,021AH
IN AL,DX
TEST AL,01H
JZ TEST2
JMP TEST1
ALLQUENCH:
MOV DX,0219H
MOV AX, 00H
OUT DX,AX
MOV CX,9
JMP TEST2
MOV AH,4CH
INT 21H
CODE ENDS
END START
已经过试验检测,正确。如要试验,需改变端口地址。