OBJECT:
The object of this experiment is to introduce to write more flexible and efficient programs by using subroutines.PRELIMINARY and EXPERIMENTAL WORK :
a) Write a DELAY subroutine to maintain 100 ms or 200 ms delay according to the value in E register, 01H or 02H respectively (clock frequency is 3.072 MHz).
b) Write three subroutines named GREAT, LESS and EQUAL that perform the following operations;
GREAT : Displays the following patterns with a delay of 200 ms on the LEDs, using DELAY subroutine written in part a:
00011000-00100100-01000010-10000001
LESS : Displays the following patterns with a delay of 200 ms on the LEDs, using DELAY subroutine written in part a:
10000001-01000010-00100100-00011000
EQUAL : Displays the following patterns with a delay of 100 ms on the LEDs, using DELAY subroutine written in part a:
00011000-00100100-01000010-10000001-10000001-01000010-00100100-00011000
NOTE: In each subroutine display corresponding pattern in a loop, NOT one-by-one. Do NOT use a structure like the following:
MVI A,81HInstead use a loop structure!!!
c) Write an assembly language program that gets the input from the binary dipswitch port and make the following decision according to the content (bit pattern) of the input port:
* If the number of ‘0’ s is greater than number of '1’ s in the bit pattern:
Call GREAT subroutine written in part b and check the dipswitches again.
* If the number of ‘0’ s is less than number of ‘1’ s in the bit pattern:
Call LESS subroutine written in part b and check the dipswitches again.
* If the number of ‘0’ s is equal to number of ‘1’ s in the bit pattern:
Call EQUAL subroutine written in part b and check the dipswitches again.
Use the subroutines written in part a and part b and CONDITIONAL CALLs to these in the main segment of your program. The program must check the dip-switches continuously and display the case.