Download as pdf
Download as pdf
You are on page 1of 4
-21- SKEE 3223 A(). ATMega32 Instruction Set Summary "clock Mnemonics | Operands | Description ‘Operation Fiogs Note Arithmetic and Logie instructions ADD RARr | Add witout Cary Rd RA+Rr ZONVSH [1 ‘ADC RaRr__| Add with Cary Rae RA+RFeC ZONVSH | 1 ‘ADI RAK | Add immediate to Word RaVERSC REVIRGYK zenvs [20 ‘sua Ra, Rr__| Subtact without Cary Ra~ Rd-Re ZONVSH | 1 ‘suet aK | Subwact mediate Ra— RK ZONNSH [1 ‘SBC Ra. Rr_—_| Subtract wih Cary Rae Rd-Rr-C Zonvsn [1 ‘saci Ra,K | SubtactImmediate wih Garry | Rd Rd-K-C ZONNSH | 1 ‘SW Ra.K | Subtract immediate tom Word | Ravi Rw RévIRA_K zenvs [20 AND Ra Rr__| Logical AND, Raw Rde Re ZNvs [1 ‘ANDI Ra,K | Logical AND with Immediate Rae Rd K znvs [1 OR RaRr__| Logical OR Raw Rd vRr ZNvs [1 ORT Ra.K | Logical OR with immediate Roe RAK ZNvs__|t OR Ra Rr__| Exchsive OR Rd~ Rd Re ZNVS [1 com Ra ‘Ones Complement Ra SFF-Rd ZeNvs [1 NEG: ka |wo's Complement a= $00- Ka ZENVSH | ‘SBR RAK | Set Bi(s)n Register Raw Rav ZNVS [1 CAR aK | ClearBits)in Register Rds Rae (SFFH-K) ZNvs [1 Inc Ra Increment Raw Raed ZNVS [1 DEC Re Decrement Rae Rat ZNVS [1 1st Ra Testor Zero or Minus Rae RARE ZNvS [1 cur Ra ‘Clear Register Ra —RI@RA ZNvs [1 SER Ra Set Resistor Raw FF None 1 MUL Rae | Mutiply Unsigned RIRO WR Rr(UU) ze 2 MULS | RARF | Mutiply Signed RERO— Rd Rr(SS) Ze 207 MULSU | Rar | Mutiply Signed with Unsigned | RTRO— Ra x Rr (SU) Ze 20) FMUL | R&Rr__| Fractonal Multiply Unsigned RERO = (Rd Ret (UU) Ze 20) FMULS | RAR’ | Fractonal Multiply Signed ERO & (Rax Ret (SS) 2c 2m FMULSU [RAAF | Fractonal Multiply Signed with | RURO (Rd Re} (SU) ze 2 Unsigned [Branch Instructions | a Relative ump POR PCrKeT ‘None 2 Me Inaieet Jump © (2) POUts.O)< Z, PORT) 0 None 20) EuMP Extended indirect umpto(Z) | PC(I50)=Z, PCI:16)—EIND | None 2 MP K hump Pook None 3am RCALL | Relative Call Subroutine POR POrket None 3a ALL Indived Cato @) POUSO) 2, PORT16) <0 None 340 EICALL Extended indirect allt 2) POUI50) <2, PCRI16)— EIND | None a ‘CALL * Cal Subroutine Pook None 4150 RET ‘Subroutine Return PC STACK None a5 RET! Interupt Return | FC «STACK ' ro -22- SKEE 3223 aloe Mnemonics | Operands | Description Operation Flags Note PSE Rar | Compare, Skip # Equal WIRE=RNPCH PCr 20rd ‘None 17273 oP. Rane | Compare Ra-Rr Zonvsa [1 CPC Rape | Compare wih Cary Rare Zenvsa [1 PI ax | Compare wih lnmedate Ra-K Zonvsm | + SBRC [RED | Skipif Bin Register Cleared (RIO) PO PO +2 or3 ‘None wars SERS | RED | SkpsT Btn Regeter Set (HON PEK PES Z0rs ‘None wars BIC Ab ‘Skip Bxin UO Register Cleared | MVOIADFOHPCHPC+ 203 | None: 12/3 ‘BIS Ab ‘Skip if Bit in WO Register Set MUOADEIN PCH PCr 203 | None 17273 eres [sk ‘Branch if Status Flag Set then PC PCH +1 | None 12 erec [ak ‘Branch f Status Flag Cleared then PC POH +1 | None 12 ‘REQ K Branch f Equal thenPOAPOrKs1 | None 12 ‘BRNE K Branch f Not Equal yyihen PC PCr ket | None: 12 ‘enoe . Drench f Garry Oot WO= Hens POT Hone we ‘RCC k Branch if Garry Cleared ythenPCPC+K+1 | None: 12 ‘BRSH k Branch i Same or Higher yihhenPC PC r+ | None 172 ‘BRLO K ‘Branch if Lower yywenPC PCr Ket | None 12 ‘BRM K Branch if Minus WINE 1) henPC—PC+KeT | None 12 ‘BRPL K Branch if Pls WIN=O)thenPC APC eK +1 | None 172 BRE K Branch if Greater or Equal, Signed | #(N@V=0)then PCA PC K+ 1 | None: 172 ‘BRUT K Branch Less Than, Saned AIN@V= T)thenPCPC+K+T | None: 12 ‘BRHS K Branch if Half Cary Flag Set A(H=iihenPC PC +R+1 | None 12 RHC K Branchif Half Cary Fag Gleared | #(H=O)thenPO PCR +1 | None: 12 ERTS: k Branch if Flag Set (T= tthenPORPOsks 1 | None 12 RTC K Branch fT Flag Geared (T= Othe PCr ket | None 12 BRVS « ‘Branch if Overow Fag is Set, #(V=ythen PO POrk+ 1 | None 12 ‘RVC k Branchif Overtow Fagis Cleared | #(V=O)thenPO—PO+k+t | None 12 RIE k ‘Branch if nterrupt Enabled (I= t)then PCH PC+R + | None 12 RID. k Branch f Interrupt Disabled (l= oythenPCH PC rks 1 | None 12 ‘Data Transfer Instructions Mov Ra, Rr__| Copy Register Rae Rr None 5 movw | Ra,Rr | Copy Register Pair RavERI RFR None 1 Lor RAK | Load immediate Rook None 1 Los Rak | Load Dect rom data space Ran None 20) rt aX | Loadindvect de®) None 2a wo RdX+ | Load indirect and Postincrement | Rd (X).X—X+4 None 26 rm RIK | toed ineten ReOewenma [XR 1 RU OO ron aoa 1 RAY | Load indirect Rae) None 2a ir RaYe | Loadindrect and Postincrement | Raw (Vj. Ve Yet None 2a 1 Rd,-Y | Load indirect and PreDecrement_ [YY 1, R=) None 2a 00 Rayeq | Load indirect wih Displacement | Rd (¥ +) None 2007 it RAZ | Load indirect Rae @) None Fla wo Ra,Z+ | Load indirect andPostincrement | RA (@,Z2—2+1 None 2a im RAZ | Loadindvect and Pre-Decrement | Z—Z-1,Rd~ @) None 20 Loo Ra,Z+q_| Load ndvect wih Displacement | Ra- +a) None 200) -23- SKEE 3223 rock Mnemonics Deseription Opera Flags Note 100. Load Indvect wih Displacement [Rd Za) None 20) S15, ‘Store Direct to data space WeRs None 200) st ‘Store indirect MR ‘None 23% st ‘Store indirect and Postincrement | (0) Ri Xe X+ 1 None 2009 st ‘Store indirect and Pre-Decrement | X—X- 1, 0 Rr ‘None 200) st ‘Store inirect| Mere None 200) ST ‘Store indrect and Postncrement | (YJ Rn¥e Vet ‘None 200) ST ‘Store indrect and Pre-Decrement[Y=¥- 1, (7 Rr None 2a S10. Year | Store indirect with Displacement | (V+ @) Re None 200) st ZRr__| Store indirect @=Rr None 2) st Z+,Rr__| Store ndvect and Postincrement | ZR, Z—Z+1 ‘None 20% st Z.Rr__| Store ndrectand PreDecement | Z—Z-1,@)—Rr None 208) SID ZegRr | Store indirect with Displacement | @+ ql Rr ‘None 208) LPM Load Program Memory RO-@) None ao) Lem RaZ | Load Program Memory Roe @) None 3° LPM Rd,Z* | Load Program Memory and Post. | Rd (@),Z—Z+1 ‘None 3° LPM Extended Load Program Memory _| RO (RAMPZZ) None ao LPM RdZ___| Extended Load Program Memory | Ri- (RAMPZZ) None am LPM Ra,Z+ | Extended Load Program Memory | RO< (RAMPZZ).Z—Z+1 ‘None 30 _and Post-inerement SPM ‘Store Program Memory @e RERO ‘None a N RGA | InFrom 0 Location Rd< VOIA) None 1 our ALRr | Out To Location WO) = Rr None 1 Push [Rr Push Reger on Stack STACKER ‘None 20 POP Ra op Register rom Stack Rae STACK, ‘None 2m ‘Bit and Biteest Instructions ust Ra Logical Shit Let Rain RaloyRAOH-OCeRAT [ZCNVA [1 SR. Ra Logical Shit Right RalaieRainethRa-oceRam [ZENV | t ROL Rd Rotate Lef Through Cary RAQACRanetjRaMCHRAM [ZONA | ROR Ra Rolate Right Through Cary RATACRaMARaInrnCHRIO) [ZENV | 1 ASR Ra ‘Arithmetic Shit Right Rafa) — Rear), 0.6 Zeny [1 SWAP | Rd ‘Swap Niles Ra(9.0) + RAC4) None 1 ‘SET . Flag Set SREG(s) 1 srEGs) [1 BCLR ® Flag Clear SREG(s) —0 sREGs) [1 sel Ab Set Bt in YO Register VODA None 2 car Ab | Clear Bitin VO Register VOIA, Dy 0 ‘None 2 BST Rrb | BitStore from Register oT Te Reb) 7 1 ‘BLD a,b | Bitlcad fom Tw Register Rate) Rr | ZaNSV) BRUTY | RAS Rr ‘BRGEY ‘Signed RdzRr | WOV)=0 BRGE | RARr BRUT Sioned RaRr ce BRLO™ Unsioned BRLOMAGS | Raz Re e=0 BRSWERCC | Unsigned BROS | Nocany e=0 ‘RCC ‘Simple BRMI__ | Positve N=O ‘BRPL ‘Simple BRVS | No overfow v=0 BRVC ‘Simple BREQ | Not zero Zo ‘BRNE ‘Simple [Note 1 Interchange Ra and Rr the operation before the test, 'e, CP Ra\Rr—> CP RRA

You might also like