MOV DX,203H
MOV AL,10010000B ;写控制字
OUT DX,AL;
IN AL,200H ;读A口的开关状态
TEST AL,1010B
JZ RED
TEXT AL,0101B
JZ GREEN
JMP YELLOW
RED: OUT 201H,11111110B ;红灯亮
GREEN: OUT 201H,11111101B ;绿灯亮
YELLOW:OUT 202H,11111110 ;黄灯亮