FA21 - Lec02-2021-09-16 - AVR Architecture and Programming
FA21 - Lec02-2021-09-16 - AVR Architecture and Programming
and Assembly
Language
Programming
LECTURE# 02
LDS instruction
◦ LoaD direct from data Space
◦ Usage “LDS Rd, K”
◦ Copies one-byte from memory location ‘k’ to GPR
◦ Example, we want to add the numbers
◦ Stored at location 0x300 and 0x302
LDS R0, 0x300
LDS R1, 0x302
ADD R0, R1
How to load 42 in R0, when LDI only allows loading R16 – R31
LDI R16, 42
MOV R0, R16