Problem 3 - Addressing Modes and Stack
What value will be in register r4 after the execution of the following instructions? Fill up the given table at points 1, 2, 3, and 4. Show all your work to receive full credit. (15 points)
LDR LDR LDR LDR STR STR STR
sp,=0x10000000 r0, =0x78 r1,=0xAB r2, =0x49 r0, [sp, #-4]! r1, [sp, #-4]! r2, [sp, #-4]! func sp, #12 r4, r4, r0 stop
BL
ADD
SUB stop B
func
STMDB
sp!, {r0-r2, Ir}
LDR LDR LDR ADD RSB
r2, [sp] r1, [sp, #8] r0, [sp, #4] r3, r1, r2 r4, r1, r3
ValueCheck Point 0x10000000
Problem 4 - ARM Assembly Programming
Write an ARM assembly program to isolate the bits between lower (m) and upper (n) indices and return only those bits (from m to n-1). For instance, if the input data is 0x12345678 and the lower and upper indices are 3 and 12, the output data must include bits 3 to 11, which is 0xCF. (15 points)
Note: Assume input data, m, and n are in registers r0, r1, and r2 respectively, and the result must be stored in register r3. Present your flowchart and comment your code.
2 pages