您的当前位置:首页正文

双色灯实验

2022-07-15 来源:V品旅游网
D1 EQU 10H D2 EQU 200H DATAS SEGMENT PB DB ? DATAS ENDS

STACKS SEGMENT STA DW 50 DUP(?)

TOP EQU LENGTH STA STACKS ENDS

CODES SEGMENT

ASSUME CS:CODES,DS:DATAS,SS:STACKS START:

PUSH CS POP DS

MOV DX,203H ;设置为全输出 MOV AL,80H OUT DX,AL MOV DX,202H MOV AL,00

OUT DX,AL ;清LED MOV DX,202H ;全红 MOV AL,0F0H OUT DX,AL MOV BX,7fH CALL DLY

BG: MOV AL,01101001B ;南北绿,东西红 OUT DX,AL MOV BX,D2 CALL DLY MOV CX,03H

XH1: AND AL,0F6H ;绿灭 OUT DX,AL MOV BX,D1 CALL DLY

OR AL,09H ;绿亮 OUT DX,AL MOV BX,D1 CALL DLY LOOP XH1

OR AL,90H ;南北黄 OUT DX,AL MOV BX,D1 CALL DLY MOV BX,D1 CALL DLY

MOV AL,10010110B ;南北红,东西绿 OUT DX,AL MOV BX,D2 CALL DLY MOV CX,03 XH2: AND AL,0F9H OUT DX,AL MOV BX,D1 CALL DLY OR AL,06H OUT DX,AL MOV BX,D1 CALL DLY LOOP XH2 OR AL,60H OUT DX,AL MOV BX,D1 CALL DLY MOV BX,D1 CALL DLY JMP BG DLY PROC NEAR PUSH CX

DDD: MOV CX,0FFFH CCC: LOOP CCC DEC BX CMP BX,0 JNE DDD POP CX RET

DLY ENDP CODES ENDS END START

因篇幅问题不能全部显示,请点此查看更多更全内容