EE 315: Microprocessor Laboratory
Kit Familiarization Experiments (S/W 2)
7.
Write a program to subtract a 16-bit number
stored in locations 2102 &2103 from the one stored in 2100 & 2101.
Write the result in 2104 & 2105 and borrow in 2106. (Is the value of the borrow given by the value of the carry flag?)
8.
Repeat program P7 but store the result in
sign-magnitude form, i.e., 2104 & 2105 contain the magnitude of the result
and 2106 contains the sign (00 for plus and 01 for minus)
9.
Write a program to copy a block of memory
into another. You can assume that the memory blocks don’t overlap. Use register
indirect addressing using register pairs HL and DE
10. Repeat the above program using XTHL and HL to
point to both the source and the destination.
11. Repeat
program 9 but allow the source and destination blocks to overlap in both
directions without
using extra memory.
12. Convert
the program 11 to a subroutine. Write a small program, which places the source
address in HL, the destination address in DE and the number of bytes to be
copied in C and then call the above subroutine.
13. You are
given two arrays of single byte Hexadecimal numbers. Write a program to add
these element by element storing the sums and the carry values in two arrays
retaining the input arrays. The number of elements in each array is made
available in register C.