Professional Documents
Culture Documents
16 9 am Solutions
Questions may not all be graded.
1. Suppose r0 = 0x2000000 and r1 = 0x02468ACE, with all bytes in memory
initialized to 0x00. If the following program is assembled and runs
successfully, what are the changed values in memory, r0, and r1? Use a table
to show the changed memory values. 1*18 = 18
STR r1, [r0], #4
STR r1, [r0, #0x4]!
STR r1, [r0, #0b100]
2. The LSL and LSR instruction components can speed up execution for some
multiplications. Show the use of LSL or LSR in instructions to perform each of
the following actions: 2*3 = 6
a. r3 = 5* r1 ADD r3,r1,r1,LSL#2
b. r2 = (3/4)*r4 SUB r2,r4,r4,LSR#2
c. r5 = 15*r0 RSB r5,r0,r0,LSL#4
x = 2, y = 4;
x = -5, y = -612;
x = 10, y = 2388;
5. Write two assembly programs that reverses the byte order of register r1, first
with and then without using the REV instruction. 20