Pfad: Home ==> Mikrobeginner ==> Instruktionsliste     This page in English (external): Flag EN
ATtiny13

Liste der Instruktionen in AVR-Assembler

Berechnen Sprünge Kopieren Bits Controller

Arithmetische und logische Operationen

MnemonicParameterBeschreibungEnglisch AktionFlaggenClkEinschränkungenWorte
12
ADDRxRyAddiereAdd Rx <= Rx + Ry + CZ,C,N,V,S,H11
ADCRxRyAddiere mit ÜberlaufAdd with Carry Rx <= Rx + Ry + CZ,C,N,V,S,H11
ADIWRdLKAddiere Konstante zu WortAdd Immediate Word RdH:RdL <= RdH:RdL + KZ,C,N,V,S2 RdL=24/26/28/30
K: 0 bis 63
1
SUBRxRySubtrahiereSubtract Rx <= Rx - RyZ,C,N,V,S,H11
SUBI RhKSubtrahiere KonstanteSub Immediate Rh <= Rh - KZ,C,N,V,S,H1R: 16 bis 311
SBCRxRySubtrahiere Register mit ÜberlaufSub with Carry Rx <= Rx - Ry - CZ1,C,N,V,S,H11
SBCIRhKSubtrahiere Konstante mit ÜberlaufSub with Carry Immediate Rh <= Rh - K - CZ1,C,N,V,S,H1R: 16 bis 311
CPRxRyVergleicheCompare Rx - RyZ,C,N,V,S,H11
CPCRxRyVergleiche mit ÜberlaufCompare with Carry Rx - Ry - CZ1,C,N,V,S,H11
CPI RhKVergleiche mit KonstanteCompare Immediate Rx - KZ,C,N,V,S,H1R: 16 bis 31
K: 0 bis 255
1
SBIW RdLKSubtrahiere Konstante von WortSubtract Immediate Word RdH:RdL <= RdH:RdL - KZ,C,N,V,S2RdL=24/26/28/30
K: 0 bis 63
1
ANDRxRyBinäres UNDAnd Rx <= Rx UND RyZ,N,V,S11
ANDI RhKBinäres UND mit KonstanteAnd Immediate Rh <= Rh UND KZ,N,V,S1R: 16 bis 31
K: 0 bis 255
1
OR RxRyBinäres ODEROr Rx <= Rx ODER RyZ,N,V,S11
ORIRhKBinäres ODER mit KonstanteOr Immediate Rh <= Rh ODER KZ,N,V,S1R: 16 bis 31
K: 0 bis 255
1
EOR RxRyExklusiv-ODERExclusive Or Rx <= Rx EXOR RyZ,N,V,S11
COM RxEinerkomplementComplement Rx <= 255 - RxZ,C,N,V,S11
NEGRxZweierkomplementTwo's compleement Rx <= 256 - RxZ,C,N,V,S,H11
SBR RhKSetze Bits in Konstante KSet bits in register Rh <= Rh ODER KZ,N,V,S1R: 16 bis 31
K: 0 bis 255
1
CBR RhKLösche Bits in Konstante KClear bits in register Rh <= Rh UND (NEG K)Z,N,V,S1R: 16 bis 31
K: 0 bis 255
1
INC RxErhöhe um EinsIncrease Rx <= Rx + 1Z,N,V,S11
DEC RxVermindere um EinsDecrease Rx <= Rx - 1Z,N,V,S11
TST RxPrüfe auf NullTest zero Rx <= Rx ODER RxZ,N,V,S11
CLR RxLösche alle BitsClear Rx <= 0Z,N,V,S11
SER RhSetze alle BitsSet register Rh <= 255-1R: 16 bis 311
MULRxRyMultipliziere 8 BitsMultiply R1:R0 <= Rx * RyZ,C21
MULSRxRyMultipliziere mit VorzeichenMultiply signed R1:R0 <= Rx * RyZ,C2Rx,Ry: 16 bis 311
MULSURxRyMultipliziere ohne und mit VorzeichenMultiply signed/unsigned R1:R0 <= Rx * RyZ,C2Rx,Ry: 16 bis 311
FMULRxRyFließkomma-MultiplikationFloat multiply R1:R0 <= Rx * RyZ,C2Rx,Ry: 16 bis 231
FMULSRxRyFließkomma-Multiplikation mit Vorz.Float multiply signed R1:R0 <= Rx * RyZ,C2Rx,Ry: 16 bis 231
FMULSURxRyFließkomma-Multiplikation ohne und mit VorzeichenFloat multiply signed/unsigned R1:R0 <= Rx * RyZ,C2Rx,Ry: 16 bis 231
DESKDatenver- und EntschlüsselungData encryption standard (R7:R0, R15:R8)-1/2(nur MEGA/XMEGA), K<161
1: Z-Flagge bleibt nur gesetzt, wenn das Ergebnis bei der aktuellen Operation Null ist UND bei der vorherigen Operation ebenfalls gesetzt war (ermöglicht 16-Bit-Vergleiche).
Berechnen Sprünge Kopieren Bits Controller

Sprunginstruktionen

MnemonicParameterBeschreibungEnglisch AktionFlaggenClkEinschränkungenWorte
12
RJMP KRelativer SprungRelative jump (PC) <= (PC) +/- K-2K: -2048 bis 20471
IJMP Indirekter SprungIndirect jump (PC) <= Z-21
EIJMPErweiterter Indirekter SprungExtended indirect jump (PC) <= EIND + Z-2(nur XMEGA)1
JMPKWeitsprungWide jump (PC) <= K-3K: 0 bis 655352
RCALL KRelativer AufrufRelative call (Stack) <= (PC)
(PC) <= (PC) +/- K
-2/3/4K: -2048 bis 20471
ICALLIndirekter AufrufIndirect call (Stack) <= (PC)
(PC) <= Z
-2/3/41
EICALLErweiterter Indirekter AufrufExtended indirect call (Stack) <= (PC)
(PC) <= EIND+Z
-3/41
CALLKWeitaufrufWide call (Stack) <= (PC), (PC) <= K-3/4/52
RET Rückkehr vom AufrufReturn (PC) <= (Stack)-41
RETI Rückkehr Interrupt ServiceReturn from interrupt (PC) <= (Stack)
I <= 1
-41
CPSERxRyÜberspringe bei GleichCompare and skip if equal Rx=Ry: (PC) <= (PC + 1)-2/31
SBRC RxBÜberspringe bei Registerbit NullSkip if bit in register is clear (Bit)=0: (PC) <= (PC+1)-2/31
SBRS RxBÜberspringe bei Registerbit EinsSkip if bit in register is set (Bit)=1: (PC) <= (PC+1)-2/31
SBIC PLBÜberspringe bei Portbit NullSkip if I/O bit is clear (Bit)=0: (PC) <= (PC+1)-2/31
SBIS PLBÜberspringe bei Portbit EinsSkip if I/O bit is set (Bit)=1: (PC) <= (PC+1)-2/31
BRBSKBSpringe relativ wenn Bit im SREG EinsBranch if bit in status register is set (SREG-Bit=1): (PC) <= (PC) +/- K-1/2K: -63 bis +641
BRBCKBSpringe relativ wenn Bit im SREG NullBranch if bit in status register is clear (SREG-Bit=0): (PC) <= (PC) +/- K-1/2K: -63 bis + 641
BREQ KSpringe relativ wenn Z-Bit im SREG EinsBranch if eqal (SREG-Z=1): (PC) <= (PC) +/- K-1/2K: -63 bis + 641
BRNEKSpringe relativ wenn Z-Bit im SREG NullBranch if not equal (SREG-Z=0): (PC) <= (PC) +/- K-1/2K: -63 bis + 641
BRCSKSpringe relativ wenn C-Bit im SREG EinsBranch if carry set (SREG-C=1): (PC) <= (PC) +/- K-1/2K: -63 bis + 641
BRCC KSpringe relativ wenn C-Bit im SREG NullBranch if carry clear (SREG-C=0): (PC) <= (PC) +/- K-1/2K: -63 bis + 641
BRSHKSpringe relativ wenn C-Bit im SREG NullBranch if same or higher (SREG-C=0): (PC) <= (PC) +/- K-1/2K: -63 bis + 641
BRLOKSpringe relativ wenn C-Bit im SREG EinsBranch if lower (SREG-C=1): (PC) <= (PC) +/- K-1/2K: -63 bis + 641
BRMIKSpringe relativ wenn N-Bit im SREG EinsBranch if minus (SREG-N=1): (PC) <= (PC) +/- K-1/2K: -63 bis + 641
BRPLKSpringe relativ wenn N-Bit im SREG NullBranch if plus (SREG-N=1): (PC) <= (PC) +/- K-1/2K: -63 bis + 641
BRGEKSpringe relativ wenn S-Bit im SREG NullBranch if greater or equal (SREG-S=0): (PC) <= (PC) +/- K-1/2K: -63 bis + 641
BRLTKSpringe relativ wenn S-Bit im SREG EinsBranch if less than (SREG-S=1): (PC) <= (PC) +/- K-1/2K: -63 bis + 641
BRHSKSpringe relativ wenn H-Bit im SREG EinsBranch if half carry set (SREG-H=1): (PC) <= (PC) +/- K-1/2K: -63 bis + 641
BRHCKSpringe relativ wenn H-Bit im SREG NullBranch if half carry clear (SREG-H=0): (PC) <= (PC) +/- K-1/2K: -63 bis + 641
BRTS KSpringe relativ wenn T-Bit im SREG EinsBranch if T flag set (SREG-T=1): (PC) <= (PC) +/- K-1/2K: -63 bis + 641
BRTCKSpringe relativ wenn T-Bit im SREG NullBranch if T flag clear (SREG-T=0): (PC) <= (PC) +/- K-1/2K: -63 bis + 641
BRVSKSpringe relativ wenn V-Bit im SREG EinsBranch if overflow set (SREG-V=1): (PC) <= (PC) +/- K-1/2K: -63 bis + 641
BRVCKSpringe relativ wenn V-Bit im SREG NullBranch if overflow clear (SREG-V=0): (PC) <= (PC) +/- K-1/2K: -63 bis + 641
BRIEKSpringe relativ wenn I-Bit im SREG EinsBranch if I flag enabled (SREG-I=1): (PC) <= (PC) +/- K-1/2K: -63 bis + 641
BRIDKSpringe relativ wenn I-Bit im SREG NullBranch if I flag disabled (SREG-I=0): (PC) <= (PC) +/- K-1/2K: -63 bis + 641
Berechnen Sprünge Kopieren Bits Controller

Datenkopier-Instruktionen

MnemonicParameterBeschreibungEnglisch AktionFlaggenClkEinschränkungenWorte
12
MOV RxRyRegister KopierenMove register Rx <= Ry-11
MOVWRxRyRegisterpaar kopierenMove word Rx+1:Rx <= Ry+1:Ry-1Rx, Ry: gerade1
LDIRhKKonstante in RegisterLoad immediate Rh <= K-1R: 16 bis 31
K: 0 bis 255
1
LDSRhASRAM in RegisterLoad direct from data space Rx <= (SRAM-A)-2/3/4R: 16 bis 312
LDRxXSRAM Adresse X in RegisterLoad indirect from address X Rx <= (X)-2/3/41
LDRxX+SRAM Adresse X in Register mit InkrementLoad indirect from address X and increment Rx <= (X)
X = X + 1
-2/31
LDRx-XDekrement X und SRAM X in RegisterDecrement and load from address X X = X - 1
Rx <= (X)
-2/3/41
LDRxYSRAM Adresse Y in RegisterLoad indirect from address Y Rx <= (Y)-2/3/41
LDRxY+SRAM Adresse Y in Register mit InkrementLoad indirect from address Y and increment Rx <= (Y)
Y = Y + 1
-2/31
LDRx-YDekrement Y und SRAM Y in RegisterDecrement and load from address Y Y = Y - 1
Rx <= (Y)
-2/3/41
LDDRxY+KSRAM Adresse (Y+K) in RegisterLoad indirect from address Y with displacement Rx <= (Y+K)-2/3K: 0 bis 631
LDRxZSRAM Adresse Z in RegisterLoad indirect from address Z Rx <= (Z)-2/3/41
LDRxZ+SRAM Adresse Z in Register mit InkrementLoad indirect from address Z and increment Rx <= (Z), Z = Z + 1-2/31
LDRx-ZDekrement Z und SRAM Z in RegisterDecrement and load indirect from address Z Z = Z - 1, Rx <= (Z)-2/3/41
LDDRxZ+KSRAM Adresse Z+K in RegisterLoad indirect from address Z with displcement Rx <= (Z+K)-2/3K: 0 bis 631
STS ARhRegister in SRAMStore direct in data space (SRAM-A) <= Rx-2/3/4R: 16 bis 312
STXRxRegister in SRAM Adresse XStore indircet at address X (X) <= Rx-2/3/41
STX+RxRegister in SRAM Adresse X mit InkrementStore indirect at address X and increment (X) <= Rx
X = X + 1
-2/31
ST-XRxDekrement X und Register in SRAM XDecrement and store indirect at address X X = X - 1
(X) <= Rx
-2/3/41
STYRxRegister in SRAM Adresse YStore indirect at address Y (Y) <= Rx-2/3/41
STRxY+Register in SRAM Adresse Y mit InkrementStore indirect at address Y and increment (Y) <= Rx
Y = Y + 1
-2/31
STRx-YDekrement Y und Register in SRAM YDecrement and store indirect at address Y Y = Y - 1
(Y) <= Rx
-2/3/41
STD Y+KRxRegister in SRAM Adresse Y+KStore indirect at address Y with displacement (Y+K) <= Rx-2/3K: 0 bis 631
STZRxRegister in SRAM Adresse ZStore indirect at address Z (Z) <= Rx-2/3/41
ST Z+RxRegister in SRAM Adresse Z mit InkrementStore indirect at address Z and increment (Z) <= Rx
Z = Z + 1
-2/31
ST -ZRxDekrement Z und Register in SRAM ZDecrement and store indirect at address Z Z = Z - 1
(Z) <= Rx
-2/3/41
STDZ+KRxRegister in SRAM Adresse Z+KStore indirect at address Z with displacement (Z+K) <= Rx-2/3K: 0 bis 631
LPMFlashspeicher Adresse (Z) in Register R0Load from program memory R0 <= (Flash Z)-31
LPMRxZFlashspeicher Adresse (Z) in RegisterLoad register from program memory Rx <= (Flash Z)-31
LPMRxZ+Flashspeicher Adresse (Z) in Register, InkrementLoad register from program memory and increment Rx <= (Flash Z)
Z = Z + 1
-31
ELPMErweiterte Flash-Adresse (Z) in Register R0Extended load from program memory R0 <= (Flash Z)-31
ELPMRxZErweiterte Flash-Adresse (Z) in RegisterExtended load register from program memory Rx <= (Flash Z)-31
ELPMRxZ+Erw. Flash-Adresse (Z) in Register, InkrementExtended load register from program memory and increment Rx <= (Flash Z)
Z = Z + 1
-31
SPMWort R1:R0 in Flashspeicher ZStore in program memory (Flash Z) <= R1:R0-N1
SPMZ+Wort R1:R0 in Flashspeicher (Z), InkrementStore in program memory at address Z and increment (Flash Z) <= R1:R0
Z = Z + 1
-N1
IN RxPPort in RegisterLoad register from port Rx <= P-11
OUT PRxRegister in PortStore register in port P <= Rx-1P: 0..631
PUSH RxRegister auf StapelPush register to stack (Stack) <= Rx
SP = SP - 1
-2P: 0..631
POP RxStapel in RegisterPop register from stack Rx <= (Stack)
SP = SP + 1
-21
XCHZRxTausche Inhalt Register und SRAM ZExchange register and data storage at Z Rx <=> (Z)-11
LASZRxODER Register mit SRAM (Z) und tauscheLoad and set Rx <= Rx ODER (Z)
(Z) <=> Rx
-11
LACZRxUND Komplement Register mit SRAM (Z) nach SRAM (Z)Load and clear Rx <= (255-Rx) UND (Z)
(Z) <=> Rx
-11
LATZRdXOR Register mit SRAM (Z) und tauscheLoad and toggle Rx EXOR (Z)
Rx <=> (Z)
-11
Berechnen Sprünge Kopieren Bits Controller

Bit-Operationen

MnemonicParameterBeschreibungEnglisch AktionFlaggenClkEinschränkungenWorte
12
LSL RxLogisches LinksschiebenLogical shift left Rx <= Rx * 2Z,C,N,V,H11
LSR RxLogisches RechtsschiebenLogical shift right Rx <= Rx / 2Z,C,N,V11
ROL RxBinäres Linksrotieren über CRotate left Rx <= Rx * 2 mit Bit 0 = C/C = Bit 7Z,C,N,V,H11
RORRxBinäres Rechtsrotieren über CRotate right Rx <= Rx / 2 mit Bit 7 = C/C = Bit 0Z,C,N,V11
ASRRxArithmetisches RechtsschiebenArithmetical shift right Rx <= Rx(6:0) / 2, Bit 6 = 0Z,C,N,V11
SWAP RxVertausche oberes und unteres NibbleSwap nibbles Rx <= (7:4) <=> (3:0)-11
BSETBSetze Bit im SREGSet bit in status register SREG <= SREG ODER (1<<B)-1B: 0 bis 71
BCLRBLösche Bit im SREGClear bit in register SREG <= SREG UND (255-(1<<B))-1B: 0 bis 71
SBI PLBSetze Bit im PortSet bit I/O PL <= PL ODER (1<<B)-21
CBI PLBLösche Bit im PortClear bit I/O PL <= PL UND (255-(1<<B))-21
BSTRxBRegisterbit in TBit store in T flag SREG-T <= Rx-Bit BT1B: 0 bis 71
BLDRxBT in RegisterbitBit load from T flag Rx-Bit B <= T-1B: 0 bis 71
SECSREG C setzenSet flag C in status register SREG-Bit C <= 1C11
CLCSREG C löschenClear flag C in status register SREG-Bit C <= 0C11
SENSREG N setzenSet flag N in status register SREG-Bit N <= 1N11
CLNSREG N löschenClear flag N in status register SREG-Bit N <= 0N11
SEZSREG Z setzenSet flag Z in status register SREG-Bit Z <= 1Z11
CLZSREG Z löschenClear flag Z in status register SREG-Bit Z <= 0Z11
SEI SREG I setzenSet flag I in status register SREG-Bit I <= 1I11
CLI SREG I löschenClear flag I in status register SREG-Bit I <= 0I11
SESSREG S setzenSet flag S in status register SREG-Bit S <= 1S11
CLSSREG S löschenClear flag S in status register SREG-Bit S <= 0S11
SEVSREG V setzenSet flag V in status register SREG-Bit V <= 1V11
CLVSREG V löschenClear flag V in status register SREG-Bit V <= 0V11
SET SREG T setzenSet flag T in status register SREG-Bit T <= 1T11
CLT SREG T löschenClear flag T in status register SREG-Bit T <= 0T11
SEHSREG H setzenSet flag H in status register SREG-Bit H <= 1H11
CLHSREG H löschenClear flag H in status register SREG-Bit H <= 0H11
Berechnen Sprünge Kopieren Bits Controller

Controller-Instruktionen

MnemonicParameterBeschreibungEnglisch AktionFlaggenClkEinschränkungenWorte
12
BREAKAusführung stoppen, Kontrolle an DebuggerBreak execution -11
NOP Nichts tunNo operation -11
SLEEP SchlafenSleep -11
WDRWatchdog rücksetzenWatch dog reset WDR-Zähler <= 0-11
©2016 by www.gsc-elektronic.net