0% found this document useful (0 votes)
108 views1 page

Kuwait University Cpe-363: Introduction To Embedded Systems: Homework #4

This document provides details for Homework #4 in an Introduction to Embedded Systems course. It includes 4 questions: 1) Write a program to add two 8-bit packed BCD numbers without using the DA instruction; 2) Perform bitwise operations on registers A, B, and R1 and indicate the results; 3) Determine the CY and AC flags for addition operations; 4) Find the result in register A after a series of bit manipulation instructions. The homework is due on May 10, 2021 and is worth 10 total points.

Uploaded by

Hazem Almasry
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
108 views1 page

Kuwait University Cpe-363: Introduction To Embedded Systems: Homework #4

This document provides details for Homework #4 in an Introduction to Embedded Systems course. It includes 4 questions: 1) Write a program to add two 8-bit packed BCD numbers without using the DA instruction; 2) Perform bitwise operations on registers A, B, and R1 and indicate the results; 3) Determine the CY and AC flags for addition operations; 4) Find the result in register A after a series of bit manipulation instructions. The homework is due on May 10, 2021 and is worth 10 total points.

Uploaded by

Hazem Almasry
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Spring 2021 CpE-363/06

_________________________________________________________________________________

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

3. (1 point) Find the CY and AC flags for each of the following:


a) MOV A,#3FH b) MOV A,#0FEH
ADD A,#45H SETB C
ADDC A,#01

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

_________________________________________________________________________________

You might also like