Program Name
Write a Assembly Language Program for Control traffic at form way function . |
Theory
Instruction Mnemonic |
Operand |
Comments |
MVI |
A,80 |
Load accumulator with 80H
to configure Control word register of 8255 |
OUT |
CWR |
Configure CWR to display
output with accumulator value i.e 80 |
LXI |
H, Inputs |
Required to Store the
inputs (8060) |
MVI |
C,05 |
05H is moved to register C
representing 5 states (N,S,W,E, Pedestrians) |
MOV |
A,M |
Copy the contents of memory
to accumulator |
OUT |
PA |
Configure output port A by
sending content of accumulator to port A |
INX |
H |
Increment the value of H to
take input |
MOV |
A,M |
Copy the contents of memory
to accumulator |
OUT |
PB |
Configure output port B by
sending content of accumulator to port B |
INX |
H |
Increment H |
MOV |
A,M |
Move contents of memory to
accumulator |
OUT |
PC |
Configure output port C by
sending content of accumulator to output port C |
INX |
H |
Increment H |
MVI |
B,14 |
Move 14 H to register in
order to give some amount of delay |
CALL |
DLY |
Calling the delay function |
MOV |
A,M |
Load the contents of memory
to accumulator |
OUT |
PA |
Configure output port A by
sending content of accumulator to port A |
INX |
H |
Increment H |
MOV |
A,M |
Load the contents of memory
to accumulator |
OUT |
PB |
Configure output port A by
sending content of accumulator to port B |
INX |
H |
Increment H |
MOV |
A,M |
Load the contents of memory
to accumulator |
OUT |
PC |
Configure output port A by
sending content of accumulator to port C |
INX |
H |
Increment H |
MVI |
B,04 H |
Mentioning time for delay |
CALL |
DLY |
Calling Delay |
DCR |
C |
Decrement value of C which
has number of states |
JNZ |
XX |
Jump if not zero to label
xx |
JMP |
AGAIN |
Jump to label Again |
Delay Code
Instruction Mnemonic |
Operand |
Comments |
LXI |
D,FFFF |
Providing 16-bit of delay |
DCX |
D |
Decrement value of D |
MOV |
A,D |
Move contents of D to
accumulator |
ORA |
E |
Logical OR operation is
performed between accumulator and specified register |
JNZ |
YY |
Jump if not zero to label
yy |
DCR |
B |
Decrement value of B |
JNZ |
DLY |
Jump if not zero and call
16-bit of delay |
RET |
|
Return |
|
Program Code
|
Inputs
8060 - 88,83,F2 8063-88, 84, F0 8066 -38, 88, F4 8069 – 48, 88, F0
806C – 83, 88, F8 806F – 84, 88, F0 8072 – 88, 38, F1 8075 – 88, 48, F0
8078 – 88, 88, 00 807B – 88, 88, 00
|
Online compiler for 8085 Microprocess Compiler
|
|