EXPERIMENT 5 : BCD Arithmetic Operations, Memory Allocation and Built-in Services

OBJECT:

The object of this experiment is to investigate BCD arithmetic operations, memory allocation and built-in services.

REFERENCE:

Gaonkar, R.S., Microprocessor Architecture, Programming and Applications with the

8085/8080A. Chapter 10.

PRELIMINARY WORK :

a) Write a subroutine called FILL that fills memory range starting from E000H with BCD packed numbers from 0 to 99.

b) Write a subroutine called SUM that sums only two BCD packed numbers and stores the result in DE (MSB-LSB) register pair.

c) Write a main program, that uses FILL and SUM subroutines written in part a and part b, to fill memory range starting from E000H with BCD packed numbers from 0 to 99 and to sum the numbers written into the address range starting from E000H and show the result in seven segment display. Initialize stack pointer to E080H.

d) Insert a label BACK into the statement just after line CALL SUM in main program and use JMP BACK instead of RET (replace RET with JMP BACK, without any extra POP) in the SUM subroutine. Comment on the effects of these changes.

- Seven Segment Display Service:

There is a built-in service in experiment set to use seven segment display as the following:

MVI C,12H

CALL 1000H

This service shows DE register pair contents on the seven segment display.

EXPERIMENTAL WORK :

Execute the main program written in preliminary work.