The largest number that can be loaded into the GPRs is in he

The largest number that can be loaded into the GPRs is in hex. What is the result of the following code and where is it kept? LDI R20, $15 LDI R21, $13 ADD R20, R21 Which of the following (a) LDI R20, 500 (b) LDI R23, 50 (c) LDI R1,00 (d) LDI R16, $255 (e) LDI R42, $25 (f) LDI R23, 0xF5 (g) LDI 123, 0xF5 is (are) illegal? Which of the following is (are) illegal? (a) ADD R20, R11 (b) ADD R16, R1 (c) ADD R52, R16

Solution

4) The largest number that can be loaded into GPRs is $FF, because each GPR in AVR is of 8-bit Size.

5) LDI R20,$15 >>R20 is initialized with $15

LDI R21,$13 >>R21 is initialized with $13

ADD R20,R21 >>contents of both R20 and R21 are added and the

Result is stored in R20.

Result=$15+$13=$28.

6) Instruction g) LDI 123,0x50 is illegal because LDI instruction

is used to initialize the register with the given number but here 123 is not a register.

Instruction e)LDI R42,$25 is also illegal because the GPR registers

Present in AVR are 32(R0-R32) but R42 is not a Register.

7) Instruction C) ADD R52,R16 is illegal because the GPR registers

Present in AVR are 32(R0-R32) but R52 is not a Register.

 The largest number that can be loaded into the GPRs is in hex. What is the result of the following code and where is it kept? LDI R20, $15 LDI R21, $13 ADD R20

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site