Control Lab
Control Lab
a.
int r3 = r1;
int r3 = `LdPfpPrgmStrmSelect(r0);
r3 = r1;
The code above loads the value in register r1 into register r3, then shifts the value in register r3 right by
0x1e8 bits. It stores the result in register r10, and compares the value in register r10 to 0x5. If they are
equal, it sets the value in register r4 to 1. Otherwise, it sets the value in register r4 to 0.
Next, the code loads the value in register `LdPfpPrgmStrmSelect(r0) into register r3, then shifts the value
in register r3 right by 0x3c bits. It stores the result in register r2. Finally, it loads the value in register r1
into register r3.
b.
r2 = 0
The value in register r2 will be 0 because the value in register `LdPfpPrgmStrmSelect(r0) is 1, and when
this value is shifted right by 0x3c bits, the result is 0.
r3 = 0x0fe00504
The value in register r3 will be 0x0fe00504 because this is the value that was loaded into the register
from the FIFO.
r4 = 0
The value in register r4 will be 0 because the value in register r10 (0x00000500) is not equal to 0x5.
r10 = 0x00000500
The value in register r10 will be 0x00000500 because this is the value that was loaded into the register
from the FIFO.