

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. 21, 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. What is in accumulator A and the N, Z, C, V bits in CCR after an LDD #$4001 instruction is executed?
Accumulator A ____________ N _____ Z ______ C ________ V _____
Problem 2 (15 Points):
Write a program segment to reverse the bit order of a 6-bit number. Assume this number is stored in $6000. Store the reversed number to $6001 (i.e., if the original number is 0 0 b 5 b 4 b 3 b 2 b 1 b 0 , after this program, the number in $ will be 0 0 b 0 b 1 b 2 b 3 b 4 b 5 ).
Problem 3 (20 points):
Write a program segment to multiply a 16-bit number in the D register by 10 using arithmetic left shift instead of multiplication instructions.
Problem 4 (20 points):
Write a program to subtract two 24-bit numbers and store the result to memory locations starting at $6000. The two 24-bit numbers are stored in memory locations starting at $5000 and $5010, respectively.
Problem 5 (20 Points):
If A contains $56, what is the result of each of the following instructions? Assume that A is restored to its original value before each instruction.
a) ANDA #$
b) ORAA #$
c) EORA #$
d) BITA #$
Problem 6 (15 Points):
Consider the following program:
LDD #$F00D STD $ BSET $8100, $ BCLR $8101, $
What numbers are in $8100 and $8101 at the end?