Instructions operate only on registers
If you want to add the values stored in two memory locations, you must
Binary operations take two operands
The result is stored in the destination (Rd) register
Some popular arithmetic instructions:
ADD Rd, Rr
SUB Rd, Rr
ADC Rd, Rr
SBC Rd, Rr
Example of adding two 16-bit numbers:
ADD R0, R2
ADC R1, R3
These instructions modify the program counter.
Jump instructions are sometimes lumped in with the branch instructions since they modify the program counter as well.
RJMP and all of the branch instructions use relative addressing
Relative addressing is faster than direct addressing, but it limits how far you can jump.
The assembler will warn you if you are trying to jump too far (not very common)
JMP does not use relative addressing and can
If you want to add the values stored in two memory locations, you must
Binary operations take two operands
The result is stored in the destination (Rd) register
Some popular arithmetic instructions:
RJMP K
JMP K
BRNE k
BREQ k