8086交通灯设计 按照已给的8086仿真电路图编程实现8086控制交通灯。
发布网友
发布时间:2022-05-07 18:26
我来回答
共1个回答
热心网友
时间:2023-11-07 23:44
CODE SEGMENT
FLASHTIME EQU 01H
;黄灯闪烁三次
OUT 00H,AL
MOV 03H,BL
START:
OUT 12h,AL;点亮黄灯
MOV AX,02H
CALL Delay
OUT 00h,AL;熄灭所有灯
MOV AX,02H
CALL Delay
OUT 12h,AL;点亮黄灯
MOV AX,02H
CALL Delay
OUT 00h,AL;熄灭所有灯
MOV AX,02H
CALL Delay
OUT 12h,AL;点亮黄灯
MOV AX,02H
CALL Delay
OUT 00h,AL;熄灭所有灯
MOV AX,02H
CALL Delay
MAIN:
OUT 21h,AL
MOV AX,0AH
CALL Delay
OUT 22H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 20H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 22H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 20H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 22H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 20H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 0CH,AL
MOV AX,10H
CALL Delay
OUT 14H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 04H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 14H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 04H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 14H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 04H,AL
MOV AX,FLASHTIME
CALL Delay
JMP MAIN
CODE ENDS
Delay:
CALL Delay1S
DEC AX
CMP AX,0
JNZ Delay
RET
Delay1S:
MOV CX,04FFFH
Delayloop:
DEC CX
CMP CX,0
JNZ Delayloop
RET
END追问可以对每一小段都解释一下有什么用嘛QAQ
顺便说一下要怎么用啊!
热心网友
时间:2023-11-07 23:44
CODE SEGMENT
FLASHTIME EQU 01H
;黄灯闪烁三次
OUT 00H,AL
MOV 03H,BL
START:
OUT 12h,AL;点亮黄灯
MOV AX,02H
CALL Delay
OUT 00h,AL;熄灭所有灯
MOV AX,02H
CALL Delay
OUT 12h,AL;点亮黄灯
MOV AX,02H
CALL Delay
OUT 00h,AL;熄灭所有灯
MOV AX,02H
CALL Delay
OUT 12h,AL;点亮黄灯
MOV AX,02H
CALL Delay
OUT 00h,AL;熄灭所有灯
MOV AX,02H
CALL Delay
MAIN:
OUT 21h,AL
MOV AX,0AH
CALL Delay
OUT 22H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 20H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 22H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 20H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 22H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 20H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 0CH,AL
MOV AX,10H
CALL Delay
OUT 14H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 04H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 14H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 04H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 14H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 04H,AL
MOV AX,FLASHTIME
CALL Delay
JMP MAIN
CODE ENDS
Delay:
CALL Delay1S
DEC AX
CMP AX,0
JNZ Delay
RET
Delay1S:
MOV CX,04FFFH
Delayloop:
DEC CX
CMP CX,0
JNZ Delayloop
RET
END追问可以对每一小段都解释一下有什么用嘛QAQ
顺便说一下要怎么用啊!
热心网友
时间:2023-11-07 23:44
CODE SEGMENT
FLASHTIME EQU 01H
;黄灯闪烁三次
OUT 00H,AL
MOV 03H,BL
START:
OUT 12h,AL;点亮黄灯
MOV AX,02H
CALL Delay
OUT 00h,AL;熄灭所有灯
MOV AX,02H
CALL Delay
OUT 12h,AL;点亮黄灯
MOV AX,02H
CALL Delay
OUT 00h,AL;熄灭所有灯
MOV AX,02H
CALL Delay
OUT 12h,AL;点亮黄灯
MOV AX,02H
CALL Delay
OUT 00h,AL;熄灭所有灯
MOV AX,02H
CALL Delay
MAIN:
OUT 21h,AL
MOV AX,0AH
CALL Delay
OUT 22H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 20H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 22H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 20H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 22H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 20H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 0CH,AL
MOV AX,10H
CALL Delay
OUT 14H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 04H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 14H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 04H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 14H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 04H,AL
MOV AX,FLASHTIME
CALL Delay
JMP MAIN
CODE ENDS
Delay:
CALL Delay1S
DEC AX
CMP AX,0
JNZ Delay
RET
Delay1S:
MOV CX,04FFFH
Delayloop:
DEC CX
CMP CX,0
JNZ Delayloop
RET
END追问可以对每一小段都解释一下有什么用嘛QAQ
顺便说一下要怎么用啊!
热心网友
时间:2023-11-07 23:44
CODE SEGMENT
FLASHTIME EQU 01H
;黄灯闪烁三次
OUT 00H,AL
MOV 03H,BL
START:
OUT 12h,AL;点亮黄灯
MOV AX,02H
CALL Delay
OUT 00h,AL;熄灭所有灯
MOV AX,02H
CALL Delay
OUT 12h,AL;点亮黄灯
MOV AX,02H
CALL Delay
OUT 00h,AL;熄灭所有灯
MOV AX,02H
CALL Delay
OUT 12h,AL;点亮黄灯
MOV AX,02H
CALL Delay
OUT 00h,AL;熄灭所有灯
MOV AX,02H
CALL Delay
MAIN:
OUT 21h,AL
MOV AX,0AH
CALL Delay
OUT 22H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 20H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 22H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 20H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 22H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 20H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 0CH,AL
MOV AX,10H
CALL Delay
OUT 14H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 04H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 14H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 04H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 14H,AL
MOV AX,FLASHTIME
CALL Delay
OUT 04H,AL
MOV AX,FLASHTIME
CALL Delay
JMP MAIN
CODE ENDS
Delay:
CALL Delay1S
DEC AX
CMP AX,0
JNZ Delay
RET
Delay1S:
MOV CX,04FFFH
Delayloop:
DEC CX
CMP CX,0
JNZ Delayloop
RET
END追问可以对每一小段都解释一下有什么用嘛QAQ
顺便说一下要怎么用啊!