实现功能,从IRO引脚引入中断请求,实现每按动一次,LED灯移动一次,最终实现LED灯L1—L8—L1顺序点亮。
CODE SEGMENT
ASSUME CS:CODE
ORG 1000H
START:
MOV DX,0FF90H
MOV AL,0FFH
OUT DX,AL
MOV DX,0FF80H
MOV AL,13H
OUT DX,AL
MOV DX,0FF81H
MOV AL,08H
OUT DX,AL
MOV AL,O1H
OUT DX,AL
MOV AL,0FEH
OUT DX,AL
MOV SI,0020H
LEA AX,ROUND
MOV [SI],AX
MOV AX,0
MOV [SI+2],AX
MOV BL,7FH
MOV BH,0
STI
JMP $
ROUND PROC NEAR
CLI
NEXT: CMP BH,0
JNZ NEXT1
ROL BL,1
CMP BL,7FH
JNZ NEXT2
MOV BH,1
JMP NEXT2
NEXT1:ROR BL,1
CMP BL,0FEH
JNZ NEXT2
MOV BH,0
NEXT2: MOV DX,0FF90H
MOV AL,BL
OUT DX,AL
MOV DX,0FF80H
MOV AL,20H
OUT DX,AL
STI
IRET
ROUND ENDP
CODE ENDS
END START
|