用汇编语言编写8255a控制一组发光二极管的亮灭

2025-01-05 16:33:04
推荐回答(1个)
回答1:

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 ;黄灯亮