Department of Electrical Engineering and Computer Science 6. (55 Points) For eac
ID: 3729711 • Letter: D
Question
Department of Electrical Engineering and Computer Science 6. (55 Points) For each instruction below assume the initial value of the registers are as below: R0 = 0x00000100 RI = OxAABBCCDD R2 = 0x00000002 Oxo0000 10o 1011 102 33 103 4 104 55 LDR R1,[R0, R2, LSL#1] a. After the execution of the above instruction value of following registers: 106 77 07 88 108 9 R2 = b. RI,[R01.3 LDR RO = 0x00000C00 RI = 0xAABBCCDD R2 = 0x00000002 After the execution of the above instruction Ox 00000e A eol eD C02 ERF Co3 IA value of following registers: eob ID RI = Co8 IF R2 =Explanation / Answer
I suppose that these questions belong to microprocessor. Pardon me if i am wrong
a)
LDR R1,[R0,R2, LSL #1]
LSL #1 - is logical shift left operation
thus u need to left shift the value of R2( the adjacent register or previous register) by 1
so the above operation can be inferred as
R1 = value at the address [R0+(R2*2)] where R0 and R2 value do not change. R1 value changes.
R1=*[0x00000100+(0x00000002 *2)]
R1=*[0x00000100+(0x00000004)]
R1=*[0x00000104]
thus R1= 55, R0=0x00000100, R2=0x00000002
b)
LDR R1,[R0], #3
in this operation first the effective address of the register R0 is loaded to R1 and then the value of R0 is cahnged to R0+3
thus R1=R0 then R0= R0 +3
R1=*R0
R1=*[0x00000C00]
R1=AB and R2=0x00000002, R0=0x00000C03
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.