

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Due Feb. 12, 2007 Justify your answers! Figure 1 shows a part of the memory (both contents and locations). Contents Locations
$20 $ $50 $ $01 $
Figure 1. Problem 1 (10 Points): Consider the memory shown in Figure 1. Write a program to add the two numbers in $4000 and $4001 and store the results in $5002. Problem 2 (10 Points): Consider the memory shown in Figure 1. What is the content in accumulator D after the following lines are executed? LDD $ ADDA $ D: _________________ Problem 3 (30 points): Consider the memory shown in Figure 1. What are the contents in memory location $5002 and accumulator A after the following lines are executed? LDAA $ LDD #$ LDAB $ STD $ Memory location $5002: ___________ A: ___________
Problem 4 (25 points): If A contains $BB, B contains $CD and the carry bit in CCR is 1, what are the results of the following instructions? Assume that A, B, and CCR are restored to their original values before each instruction. a) ASLA, A:______ b) ASRB, B:______ c) LSLD, A:______, B: ______ d) ROLB, D:_____________ Problem 4 (10 Points): Write a program to add two values $20 and $40 and store the result in memory location $8000. Problem 5 (15 Points): Write a program to implement the following 16 bit rotation, i.e., originally, A and B contain a 7 (^) a 6 L a 0 and b 7 (^) b 6 L b 0 , respectively. After the 16 bit rotation, the contents in A and B are a 6 (^) a 5 L a 0 b 7 and b 6 (^) b 5 L b 0 a 7 , respectively. (Note: You can only use the data transfer and manipulation instructions in Section 2.4.1). a 7 a 0 b 7 b 0 accumulator A accumulator B