CODE SEGMENT ;
ASSUME CS:CODE
IOCON EQU 8006H
IOA EQU 8000H
IOB EQU 8002H
IOC EQU 8004H
START: MOV AL,80H
MOV DX,IOCON
OUT DX,AL
MOV DX,IOB
MOV AL,0F0H
OUT DX,AL
MOV DX,IOC
MOV AL,0F0H
;MOV AL,0FH
OUT DX,AL
CALL DELAY1
IOLED0: MOV AL,10100101B;
MOV DX,IOC
OUT DX,AL
CALL DELAY1
CALL DELAY1
OR AL,0F0H ;
;AND AL,10101111B;
OUT DX,AL
MOV CX,8
IOLED1: MOV DX,IOB
MOV AL,10101111B;
OUT DX,AL
CALL DELAY2
OR AL,01010000B;
OUT DX,AL
CALL DELAY2
LOOP IOLED1
MOV DX,IOC
MOV AL,0F0H ;
OUT DX,AL
CALL DELAY2
MOV AL,01011010B;
OUT DX,AL
CALL DELAY1
CALL DELAY1
OR AL,0F0H;
OUT DX,AL
MOV CX,8
IOLED2: MOV DX,IOB
AND AL,01011111B;
OUT DX,AL
CALL DELAY2
OR AL,10100000B;
OUT DX,AL
CALL DELAY2
LOOP IOLED2
MOV DX,IOC
MOV AL,0F0H ;
OUT DX,AL
CALL DELAY2
JMP IOLED0
DELAY1: PUSH AX
PUSH CX
MOV CX,0030H
DELY2: CALL DELAY2
LOOP DELY2
POP CX
POP AX
RET
DELAY2: PUSH CX
MOV CX,8000H
DELA1: LOOP DELA1
POP CX
RET
CODE ENDS
END START
|