EECE 237
Homework 4
1. What is the 32-bit integer stored at the memory address 0x20000004 if Big Endian is used in the
following memory diagram?
2. What is the 32-bit integer stored at the memory address 0x20000004 if Little Endian is used in
the previous memory diagram?
3. Use the assembly program segment below to answer the following questions. Each statement has
the line number identified on the left for easy reference in the answers.
1 MOV R0, #10
2 MOVS R1, #20
3 B Check
4 LoopYes ADDS R1, R0
5 ADD R0, #1
6 Check CMP R0, #15
7 BLT LoopYes
8 LoopNo B LoopNo
(a) After the program executes the instruction on line 3 for the first time, what is the line number
of the next instruction?
(b) After the program executes the instruction on line 7 for the first time, what is the line number
of the next instruction?
(c) How many times would the program execute the instruction on line 6?
(d) Which lines change the (NZCV) flags?
4. What flag values would cause the processor to take the branch for the instruction BLO?
5. What flag values would cause the processor to take the branch for the instruction BLE?
6. What flag values would cause the processor to take the branch for the instruction BGE?
7. Rewrite the program in Activity 6 to utilize conditional branches to store the values in “Colors” and the
output to the LEDs within the main loop.