Bin. Befehl mnem. Op. meaning operation Flags clocks

Similar documents
Instruction Set. Instruction Set Nomenclature: Status Register (SREG) Registers and Operands

Building A RISC Microcontroller in an FPGA

Instruction Set. Instruction Set Nomenclature. Status Register (SREG) Registers and Operands

Atmel AVR 8-bit Instruction Set

Instruction Set. Instruction Set Nomenclature. Status Register (SREG) Registers and Operands

Atmel AVR 8-bit Instruction Set

Programming of Microcontrollers in Assembly Language

8085 INSTRUCTION SET

The AVR Microcontroller and C Compiler Co-Design Dr. Gaute Myklebust ATMEL Corporation ATMEL Development Center, Trondheim, Norway

Z80 Instruction Set. Z80 Assembly Language

THUMB Instruction Set

8-bit Microcontroller. Application Note. AVR410: RC5 IR Remote Control Receiver

8-bit Microcontroller with 1K Bytes In-System Programmable Flash. ATtiny13A. Summary

Chapter 2 Topics. 2.1 Classification of Computers & Instructions 2.2 Classes of Instruction Sets 2.3 Informal Description of Simple RISC Computer, SRC

8-bit Atmel Microcontroller with 128KBytes In-System Programmable Flash. ATmega128 ATmega128L. Summary

COMPUTERS ORGANIZATION 2ND YEAR COMPUTE SCIENCE MANAGEMENT ENGINEERING JOSÉ GARCÍA RODRÍGUEZ JOSÉ ANTONIO SERRA PÉREZ

EECS 427 RISC PROCESSOR

MICROPROCESSOR AND MICROCOMPUTER BASICS

Mixing C and assembly language programs Copyright 2007 William Barnekow <barnekow@msoe.edu> All Rights Reserved

AVR Assembler User Guide

Instruction Set Architecture

8-bit Microcontroller. Application Note. AVR201: Using the AVR Hardware Multiplier

How It All Works. Other M68000 Updates. Basic Control Signals. Basic Control Signals

AVR034: Mixing C and Assembly Code with IAR Embedded Workbench for AVR. 8-bit Microcontroller. Application Note. Features.

1 Classical Universal Computer 3

Z80 Microprocessors Z80 CPU. User Manual UM Copyright 2014 Zilog, Inc. All rights reserved.

Programmer s Model = model of µc useful to view hardware during execution of software instructions

How To Write A Microsoft Microsoft 8D (Droid) (Program) (Powerbook) (I386) (Microsoft) (Donga) (Opera) And (Dungeo) (Dugeo

8-bit Microcontroller with 1K Bytes In-System Programmable Flash. ATtiny13V ATtiny13

Voltage boost and buck circuits using Atmel AVR Tiny13V for driving a white LED.

Complete 8086 instruction set

PART B QUESTIONS AND ANSWERS UNIT I

Microcontroller Basics A microcontroller is a small, low-cost computer-on-a-chip which usually includes:

ARM Instruction Set. ARM7TDMI-S Data Sheet. Final - Open Access

Instruction Set Architecture. or How to talk to computers if you aren t in Star Trek

8051 hardware summary

Reduced Instruction Set Computer (RISC)

Computer Organization and Architecture

HC12 Assembly Language Programming

UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering. EEC180B Lab 7: MISP Processor Design Spring 1995

ATtiny4 / ATtiny5 / ATtiny9 / ATtiny10. Introduction. Feature. Atmel 8-bit AVR Microcontroller with 512/1024 Bytes In-System Programmable Flash

M6800. Assembly Language Programming

Lecture 3 Addressing Modes, Instruction Samples, Machine Code, Instruction Execution Cycle

Instruction Set. Microcontroller Instruction Set. Instructions that Affect Flag Settings (1) The Instruction Set and Addressing Modes

Z80 Family. CPU User Manual

Graded ARM assembly language Examples

Microprocessor & Assembly Language

AVR1321: Using the Atmel AVR XMEGA 32-bit Real Time Counter and Battery Backup System. 8-bit Microcontrollers. Application Note.

Interrupts and the Timer Overflow Interrupts Huang Sections What Happens When You Reset the HCS12?

Section 44. CPU with Extended Data Space (EDS)

M A S S A C H U S E T T S I N S T I T U T E O F T E C H N O L O G Y DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE

CHAPTER 7: The CPU and Memory

Chapter 9 Computer Design Basics!

8-bit Microcontroller with 1K Bytes In-System Programmable Flash. ATtiny13A

Computer organization

MACHINE ARCHITECTURE & LANGUAGE

Systems I: Computer Organization and Architecture

Step Motor Controller. Application Note. AVR360: Step Motor Controller. Theory of Operation. Features. Introduction

8-bit Microcontroller with 16K Bytes In-System Programmable Flash. ATmega162 ATmega162V. Features

8-bit Microcontroller with 2/4/8K Bytes In-System Programmable Flash. ATtiny24 ATtiny44 ATtiny84

An Introduction to the ARM 7 Architecture

ARM Cortex-M3 Assembly Language

Faculty of Engineering Student Number:

U:\montages\dominique\servo\moteur_AV_AR\program\moteur_AV_AR.asm jeudi 28 avril :32

Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash. ATtiny25/V / ATtiny45/V / ATtiny85/V. Features

Flash Microcontroller. Architectural Overview. Features. Block Diagram. Figure 1. Block Diagram of the AT89C core

Introduction to Microcontrollers

Microprocessor/Microcontroller. Introduction

Instruction Set Design

CPU Organization and Assembly Language

ARCompact Instruction Set Architecture. Programmer's Reference

Call Subroutine (PC<15:0>) TOS, (W15)+2 W15 (PC<23:16>) TOS, Process data. Write to PC NOP NOP NOP NOP

8-bit Microcontroller with 2K Bytes In-System Programmable Flash. ATtiny2313/V. Preliminary

MICROPROCESSOR. Exclusive for IACE Students iacehyd.blogspot.in Ph: /422 Page 1

Comp 255Q - 1M: Computer Organization Lab #3 - Machine Language Programs for the PDP-8

Pipeline Hazards. Structure hazard Data hazard. ComputerArchitecture_PipelineHazard1

l C-Programming l A real computer language l Data Representation l Everything goes down to bits and bytes l Machine representation Language

Assembly Language Programming

X86-64 Architecture Guide

8-bit Microcontroller with 32K/64K/128K Bytes of ISP Flash and CAN Controller AT90CAN32 AT90CAN64 AT90CAN128

How to use AVR Studio for Assembler Programming

Chapter 7D The Java Virtual Machine

8-bit Microcontroller with 8K Bytes In-System Programmable Flash. ATmega8515 ATmega8515L

BASIC COMPUTER ORGANIZATION AND DESIGN

ATmega8A. Introduction. Features. 8-bit AVR Microcontroller DATASHEET COMPLETE

ATmega16U4/ATmega32U4

CPU Performance Equation

Central Processing Unit (CPU)

8-bit Microcontroller with 2K Bytes Flash. ATtiny26 ATtiny26L

8-bit Microcontroller with 4/8/16/32K Bytes In-System Programmable Flash. ATmega48PA ATmega88PA ATmega168PA ATmega328P

8-bit RISC Microcontroller. Application Note. AVR236: CRC Check of Program Memory

BCD (ASCII) Arithmetic. Where and Why is BCD used? Packed BCD, ASCII, Unpacked BCD. BCD Adjustment Instructions AAA. Example

6800 Basics. By Ruben Gonzalez

8-bit Microcontroller with 2/4/8K Bytes In-System Programmable Flash. ATtiny261/V* ATtiny461/V ATtiny861/V. *Mature

Instruction Set Reference

Q. Consider a dynamic instruction execution (an execution trace, in other words) that consists of repeats of code in this pattern:

Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2

Poor Man s A/D Converter By Dave Wissel at Wave Technology

Transcription:

Bin. Befehl mnem. Op. meaning operation Flags clocks 0000000000000000 nop no operation 00000001ddddrrrr movw v,v copy register word Rd+1:Rd Rr+1:Rr 1 00000010ddddrrrr muls d,d multiply signed R1:R0 Rd*Rr ZC 2 000000110ddd0rrr mulsu a,a multiply signed with unsigned R1:R0 Rd*Rr ZC 2 000000110ddd1rrr fmul a,a fractional multiply unsigned R1:R0 (Rd*Rr)<<1 ZC 2 000000111ddd0rrr fmuls a,a fractional multiply signed R1:R0 (Rd*Rr)<<1 ZC 2 000000111ddd1rrr fmulsu a,a fr. multiply signed with unsigned R1:R0 (Rd*Rr)<<1 ZC 2 000001rdddddrrrr cpc r,r compare with carry Rd Rr ZCNVH 1 000010rdddddrrrr sbc r,r subtract with carry Rd Rd - Rr - C ZCNVH 1 000011rdddddrrrr lsl r logical shift left Rd (n+1) Rd (n),rd (0) 0 ZCNV 1 000011rdddddrrrr add r,r add two registers Rd Rd + Rr ZCNVH 1 000100rdddddrrrr cpse r,r compare, skip if equal if (Rd==Rr) PC+=2 or 3 1/2/3 000101rdddddrrrr cp r,r compare Rd Rr ZCNVH 1 000110rdddddrrrr sub r,r subtract two registers Rd Rd Rr ZCNVH 1 000111rdddddrrrr rol r rotate left through carry Rd (0) C,Rd (n+1) Rd (n),c Rd (7) ZCNV 1 000111rdddddrrrr adc r,r add with carry Rd Rd + Rr + C ZCNVH 1 001000rdddddrrrr and r,r logical AND Rd Rd & Rr ZNV 1 001000rdddddrrrr tst r test for zero or minus Rd Rd and Rd ZNV 1 001001rdddddrrrr eor r,r exclusiv or Rd Rd xor Rr ZNV 1 001001rdddddrrrr clr r clear register Rd Rd xor Rd ZNV 1 001010rdddddrrrr or r,r logical OR Rd Rd Rr ZNV 1 001011rdddddrrrr mov r,r move between registers Rd Rr 1 0011KKKKddddKKKK cpi d,m compare reg with constant Rd K ZNVCH 1 0100KKKKddddKKKK sbci d,m subtract with carry const from reg Rd Rd -C -K ZNVCH 1 0101KKKKddddKKKK subi d,m subtract constant from register Rd Rd -K ZNVCH 1 0110KKKKddddKKKK ori d,m logical OR with constant Rd Rd K ZNV 1 Seite 1

0110KKKKddddKKKK sbr d,m set bits in register Rd Rd K ZNV 1 0111KKKKddddKKKK andi d,m logical and with immidiate Rd Rd and K ZNV 1 0111KKKKddddKKKK cbr d,n clear bits in register Rd Rd and (0xFF K) ZNV 1 100!000dddddee-+ ld r,e load from X,Y,Z Rd [X],[Y],[Z],/++/--, pre/post 2 100!001rrrrree-+ st e,r store into X,Y,Z [X],[Y],[Z],/++/--, pre/post Rr 2 1001000ddddd0000 lds r,i load direct fvrom SRAM Rd [16 Bit Constant] 2 1001000ddddd010+ lpm r,z load program memory Rd [Z], ev. Z++ 3 1001000ddddd011+ elpm r,z 1001000rrrrr1111 pop r pop register from stack Rd Stack 2 1001001ddddd0000 sts i,r store direct to SRAM [16 Bit Constant] Rr 1001001rrrrr1111 push r push register into stack Stack Rr 2 1001010000001000 sec set carry C 1 C 1 1001010000001001 ijmp indirect jump to Z PC Z 2 1001010000011000 sez set zero flag Z 0 Z 1 1001010000101000 sen set negative flag N 1 N 1 1001010000111000 sev set Two complents overflow V 1 V 1 1001010001001000 ses set signed test flag S 1 S 1 1001010001011000 seh set half carry flag H 1 H 1 1001010001101000 set set T in SREG T 1 T 1 1001010001111000 sei set global Interrupt (enable Int) I 1 I 1 100101000SSS1000 bset S set flag SREG[s]=1 S 1 1001010010001000 clc clear carry C 0 C 1 1001010010011000 clz clear zero flag Z 0 Z 1 1001010010101000 cln clear negative flag N 0 N 1 1001010010111000 clv clear two complents overflow V 0 V 1 1001010011001000 cls clear signed test flag S 0 S 1 1001010011011000 clh clear half carry flag H 0 H 1 1001010011101000 clt clear T in SREG T 0 T 1 Seite 2

1001010011111000 cli clear global Interrupt (disable Int) I 0 I 1 100101001SSS1000 bclr S clear flag SREG[s]=0 S 1 1001010100001000 ret return PC Stack 4 1001010100001001 icall indirect call to Z PC Z 3 1001010100011000 reti return from Int PC Stack I 4 1001010100011001 eicall 1001010110001000 sleep sleep 1 1001010110011000 break 1001010110101000 wdr watch dog reset 1 1001010111001000 lpm? load program memory R0 [Z] 3 1001010111011000 elpm? 1001010111101000 spm store into program memory [Z] R1:R0 0 1001010hhhhh110h jmp h 1001010hhhhh111h call h 1001010rrrrr0000 com r one's complement Rd 0xFF - Rd ZCNV 1 1001010rrrrr0001 neg r two's complement Rd 0x00 - Rd ZCNV 1 1001010rrrrr0010 swap r swap nibbles Rd (0..3) Rd (4..7) 1 1001010rrrrr0011 inc r increment register Rd++ ZNV 1 1001010rrrrr0101 asr r arithmetic shift right Rd (n) Rd (n+1),n=0..6 ZCNV 1 1001010rrrrr0110 lsr r logical shift right Rd (n+1) Rd (n), Rd 0 (0) 1001010rrrrr0111 ror r rotation rignt over carry Rd (7) C, Rd (n) Rd (n+1),c Rd (0) ZCNV 1 1001010rrrrr1010 dec r decrement register Rd-- ZNV 1 10010110KKddKKKK adiw w,k add immediate to word Rdh:Rdl Rdh:Rdl + Constant CZHVS 2 10010111KKddKKKK sbiw w,k subtract constant from wordreg. Rdh:Rdl Rdh:Rdl - Constant CZHVS 2 10011000pppppsss cbi p,s clear bit in I/O register I/O(P,b) 0 2 10011001pppppsss sbic p,s skip, if Bit in I/O reg. Is clear If P(b) ==0 PC PC+ 2, 3 1/2/3 10011010pppppsss sbi p,s set bit in I/O register I/O(P,b) 1 2 10011011pppppsss sbis p,s skip, if bit in I/O reg. Is set If P(b) ==1 PC PC+ 2, 3 1/2/3 Seite 3

100111rdddddrrrr mul r,r multiply unsigned R1:R0 RD*Rr ZC 2 10110PPdddddPPPP in r,p in port Rd Port 1 10111PPrrrrrPPPP out P,r out to port Port Rr 1 10o0oo0dddddbooo ldd r,b load indirect with displacement Rd [Y+disp], Rd [Z+disp] 2 10o0oo1rrrrrbooo std b,r store indirect with displacement [Y+disp] Rd, [Z+disp] Rd 2 1100LLLLLLLLLLLL rjmp L relative jump PC PC + k +1 2 1101LLLLLLLLLLLL rcall L relative call PC PC + k +1 3 11101111dddd1111 ser d set register Rd 0xFF 1 1110KKKKddddKKKK ldi d,m load immidiate Rd K 1 111100lllllll000 brcs l branch, if C ist set if (C==1) PC PC + k + 1 1/ 2 111100lllllll000 brlo l branch, if lower if (C==1) PC PC + k + 1 1/ 2 111100lllllll001 breq l branch, if equal if (Z==1) PC PC + k + 1 1/ 2 111100lllllll010 brmi l branch, if minus if (N==1) PC PC + k + 1 1/ 2 111100lllllll011 brvs l branch, if overflow is set if (V==1) PC PC + k + 1 1/ 2 111100lllllll100 brlt l branch, if less then zero signed if ((N xor V)==1) PC PC + k + 1 1/ 2 111100lllllll101 brhs l branch, if halfcarry if (H==1) PC PC + k + 1 1/ 2 111100lllllll110 brts l branch, if T is set if (T==1) PC PC + k + 1 1/ 2 111100lllllll111 brie l branch, if interrupt enabled if (I==1) PC PC + k + 1 1/ 2 111100lllllllsss brbs s,l branch, if status flag set if (SREG(s)==1) PC PC + k + 1 1/ 2 111101lllllll000 brsh l branch, if same or higher if (C==0) PC PC + k + 1 1/ 2 111101lllllll000 brcc l branch, if carry cleared if (C==0) PC PC + k + 1 1/ 2 111101lllllll001 brne l branch, if not equal if (Z==0) PC PC + k + 1 1/ 2 111101lllllll010 brpl l branch, if plus if (N==0) PC PC + k + 1 1/ 2 111101lllllll011 brvc l branch, if overflow is clear if (V==0) PC PC + k + 1 1/ 2 111101lllllll100 brge l branch, if geater oder equal, signed if ((N xor V) ==0) PC PC + k + 1 1/ 2 111101lllllll101 brhc l branch, if halfcarry clear if (H==0) PC PC + k + 1 1/ 2 111101lllllll110 brtc l branch, if T claer if (T==0) PC PC + k + 1 1/ 2 111101lllllll111 brid l branch, if interrupt disabled if (I==0) PC PC + k + 1 1/ 2 Seite 4

111101lllllllsss brbc s,l branch, if status flag clear if (SREG(s)==0) PC PC + k + 1 1/ 2 1111100ddddd0sss bld r,s bit load from T to register Rd(s) T 1 1111101ddddd0sss bst r,s bit store from register to T T Rd(s) 1 1111110rrrrr0sss sbrc r,s skip, if bit in reg. Is clear If R(b) ==0 PC PC+ 2, 3 1/2/3 1111111rrrrr0sss sbrs r,s skip, if bit in reg. Is set If R(b) ==1 PC PC+ 2, 3 1/2/3 1001010000011001 eijmp Legend: r any register d `ldi' register (r16-r31) v `movw' even register (r0, r2,..., r28, r30) a `fmul' register (r16-r23) w `adiw' register (r24,r26,r28,r30) e pointer registers (X,Y,Z) b base pointer register and displacement ([YZ]+disp) z Z pointer register (for [e]lpm Rd,Z[+]) M immediate value from 0 to 255 n immediate value from 0 to 255 ( n = ~M ). s immediate value from 0 to 7 P Port address value from 0 to 63. (in, out) p Port address value from 0 to??? (cbi, sbi, sbic, sbis) K immediate value from 0 to 63 (used in `adiw', `sbiw') i immediate value l signed pc relative offset from -64 to 63 L signed pc relative offset from -2048 to 2047 h absolute code address (call, jmp) S immediate value from 0 to 7 (S = s << 4)? use this opcode entry if no parameters, else use next opcode entry Seite 5

Zusammengestellt aus: http://sourceware.org/binutils/docs-2.20/as/avr-opcodes.html#avr-opcodes Manual Atmega8, instruction summery A. Beck, 2010 Atmega8 Maschinenbefehle A. Beck, 04/2010 Seite 6

Seite 7

T ist ein Bitspeicher für 1 Bit Seite 8

Seite 9

Seite 10

Seite 11

Seite 12