Kuwait University Cpe-363: Introduction To Embedded Systems: Homework #4
Kuwait University Cpe-363: Introduction To Embedded Systems: Homework #4
Kuwait University Cpe-363: Introduction To Embedded Systems: Homework #4
_________________________________________________________________________________
Kuwait University
Computer Engineering Department
CpE-363: Introduction to Embedded Systems
Homework #4
(10 points)
Due Date: May 10, 2021
1. (5 points) Write a program, that will add two 8-bit packed BCD numbers and
store the result in memory location 40H, assume the original numbers are stored
in R2 and R3.
Example:
If R2=36H, R3=28H
then 40H = 64H
Assume that the resulting BCD number can be correctly represented in 2 BCD
digits only.
Note: Your program should NOT use the DA instruction.
Hint: check the operation of the DA instruction.
2. (3 points) Assume that these registers contain the following: A=F0,B=55, and
R1=90. Perform the following operations. Indicate the result and the register
where it is stored.
a) ANL A,#45H b) XRL A,R1 c) ORL A,#99H
4. (1 point) Find the contents of register A after each of the following is executed
a) MOV A,#55H b) SETB C
SWAP A MOV A,#5AH
RR A SWAP A
RR A RLC A
RLC A
_________________________________________________________________________________