Micro processor Lab Manual / Interfacing 7 segment display ALP

Program Name

Write a Assembly Language Program for Interfacing 7 segment display .
Theory
Instruction Mnemonic Operand Comments
MVI A,80 Load accumulator with
80H to configure CWR of 8255.
OUT CWR Configure CWR to display output with accumulator value. i.e 80
MVI D,05 Move immediately 05H in reg D as we have five states to be displayed on segments
LXI H,8100 Loading the contents of address 8100 into register pair
MVI B,04 Move immediately 04H in reg B as we have four segments on kit
MVI C,08 Move immediately 08H in reg C as we have 8 bit reg which has to be configured
MOV A,M Move content of memory to accumulator ie first input
INX H Increment the content of HL pair by 1 to fetch next input
RLC Rotate Accumulator left by one bit to configure each segment
MOV E,A Copy the content of accumulator to reg E
OUT PB Configure reg B with value of Accumulator
MVI A,01 Move immediately 01H to accumulator
OUT PC Configure port c and send the value
DCR A Decrement value of Acc by 01
OUT PC Configure port C
MOV A,E Move the content of reg E to acc.
DCR C Decrement the counter by 01 (now remaining 7 bits has to be configured on segments )
JNZ XX Jump back to xx if the result of previous operation is not zero
DCR B Decrement the value of reg B by 1
JNZ YY Jump back to yy if the result of previous operation is not zero
CALL DLY Call delay
CALL DLY Call delay
DCR D Decrement the reg D by 1
JNZ ZZ Jump back to zz if the result of previous operation is not zero
JMP XY Jump back to xy with out any condition


Delay Code
Instruction Mnemonic Operand Comments
LXI B,FFFF Initialize B register with maximum 16 bit value.
DCX B Decrement B
MOV A,B Move the value of B into accumulator.
ORA B Perform OR operation on accumulator and B to decrement A.
JNZ XY Jump to XY if the result if previous operation is not zero.
RET Return back to main routine.
Program Code


Online compiler for 8085 Microprocess Compiler


Home     Back