MPI Lab 10
MPI Lab 10
Lab 10
Program to Control Traffic Light System
• Control word can be provided using 8086 to change the signal color.
1: LED is turned on
0: LED is turned off
2
Control Words
F E D C B A 9 8 7 6 5 4 3 2 1 0
× × × × 1 0 0 0 0 1 1 0 0 0 0 1 Default
× × × × 0 0 1 0 0 1 0 0 1 0 0 1 All red
× × × × 0 0 1 1 0 0 0 0 1 1 0 0
× × × × 0 1 1 0 1 0 0 1 1 0 1 0
× × × × 1 0 0 0 0 1 1 0 0 0 0 1
× × × × 1 0 0 0 0 1 1 0 0 0 0 1
× × × × 0 1 0 0 1 1 0 1 0 0 1 1
3
Traffic Light in Emulator
4
int 15h, AH=86h
5
ALP for Traffic Signal
#start=Traffic_Lights.exe# Initializes the virtual traffic signal
name "traffic"
mov ax, all_red Closes all traffic
out 4, ax