Mejores Practicas
Mejores Practicas
y Microcontroladores
Instrucciones AVR
Instrucciones AVR
Arithmetic and Logic instructions
Branch instructions
Bit and Bit-Test instructions
Data Transfer instructions
MCU Control instructions
SUB
AND
SUB Rd, Rr
SUBI Rd, K
SBC Rd, Rr
SBCI Rd, K
SBIW Rdl,K
AND Rd, Rr
ANDI Rd, K
OR Rd, Rr
ORI Rd, K
Logical OR Registers
Logical OR Register and Constant
EOR Rd, Rr
COM Rd
NEG Rd
SBR Rd,K
CBR Rd,K
TST Rd
CLR Rd
SER Rd
Exclusive OR Registers
Ones Complement
Twos Complement
Set Bit(s) in Register (OR)
Clear Bit(s) in Register (AND)
Test for Zero or Minus
Clear Register
Set Register
MUL
MUL Rd, Rr
MULS Rd, Rr
MULSU Rd, Rr
FMUL Rd, Rr
FMULS Rd, Rr
FMULSU Rd, Rr
Multiply Unsigned
Multiply Signed
Multiply Signed with Unsigned
Fractional Multiply Unsigned
Fractional Multiply Signed
Fractional Multiply Signed with Unsigned
Branch instructions
JMPs
RJMP k
IJMP
JMP
Relative Jump
PC PC + k + 1
Indirect Jump to (Z) PC Z
k Direct Jump
PC k
CALLs
RCALL k
ICALL
CALL k
RETs
RET
RETI
Subroutine Return
Interrupt Return
PC STACK
PC STACK
Branch instructions
CMP
CPSE Rd,Rr
CP Rd,Rr
CPC Rd,Rr
CPI Rd,K
Skips
SBRC Rr, b
SBRS Rr, b
SBIC P, b
SBIS P, b
Branch instructions
BRANCH
BRBS s, k
BRBC s, k
BREQ k
BRNE k
BRCS k
BRCC k
BRSH k
BRLO k
BRMI k
BRPL k
BRGE k
BRLT k
Branch instructions
BRANCH
BRHS
BRHC
BRTS
BRTC
BRVS
BRVC
BRIE
BRID
k
k
k
k
k
k
k
k
10
Flag Set
Flag Clear
Bit Store from Register to T
Bit load from T to Register
Set Carry
Clear Carry
Set Negative Flag
Clear Negative Flag
Set Zero Flag
Clear Zero Flag
11
12
MOVs
MOV Rd, Rr
MOVW Rd, Rr
13
LDs
LDI Rd, K
LD Rd, X
LD Rd, X+
LD Rd, - X
LD Rd, Y
LD Rd, Y+
LD Rd, - Y
LDD Rd,Y+q
LD Rd, Z
LD Rd, Z+
LD Rd, -Z
LDD Rd, Z+q
LDS Rd, k
Load Immediate
Load Indirect
Load Indirect and Post-Inc.
Load Indirect and Pre-Dec.
Load Indirect
Load Indirect and Post-Inc.
Load Indirect and Pre-Dec.
Load Indirect with Displacement
Load Indirect
Load Indirect and Post-Inc.
Load Indirect and Pre-Dec.
Load Indirect with Displacement
Load Direct from SRAM
14
STs
ST X, Rr
ST X+, Rr
ST - X, Rr
ST Y, Rr
ST Y+, Rr
ST - Y, Rr
STD Y+q,Rr
ST Z, Rr
ST Z+, Rr
ST -Z, Rr
STD Z+q,Rr
STS k, Rr
Store Indirect
Store Indirect and Post-Inc.
Store Indirect and Pre-Dec.
Store Indirect
Store Indirect and Post-Inc.
Store Indirect and Pre-Dec.
Store Indirect with Displacement
Store Indirect
Store Indirect and Post-Inc.
Store Indirect and Pre-Dec.
Store Indirect with Displacement
Store Direct to SRAM
15
LPM
LPM Rd, Z
LPM Rd, Z+
SPM
I/O
IN Rd, P
OUT P, Rr
In Port
Out Port
Stack
PUSH Rr
POP Rd
16
MCU
NOP
SLEEP
WDR
BREAK
No Operation
Sleep
Watchdog Reset
Break (For On-chip Debug Only)
17