1. Write an instruction sequence to copy the contents of the program memory location at 0x2010 to data memory location at 0x2000.
2. Write an instruction sequence to copy the contents of the data memory location at 0x2000 to data memory location at 0x2050.
Answer :- 1) The AVR assembly code can be writte as-
LDI R30, 0x10 ;register ZL = 0x10
LDI R30, 0x20 ;register ZH = 0x20
LPM R0, Z ;R0 = value at location 0x2010
STS 0x2000, R0 ;copy value in R0 to location 0x2000 in SRAM i.e. in
data memory
Answer :- 2) The AVR assembly code can be writte as-
LDI R26, 0x00;register XL = 0x00
LDI R27, 0x20 ;register XH = 0x20
LD R0, X ;R0 = value at location 0x2000
STS 0x2050, R0 ;copy value in R0 to location 0x2050 in SRAM i.e. in
data memory
Get Answers For Free
Most questions answered within 1 hours.