9/20/6Lecture 3 - Instruction Set - Al1 68000 Instruction Set.

Slides:



Advertisements
Similar presentations
H. Huang Transparency No.1-1 The HCS12/MC9S12 Microcontroller Copyright © 2010 Delmar Cengage Learning HCS12 Instruction Examples The LOAD and STORE Instructions.
Advertisements

Chapter 3 Introduction to the 68000
May 12 th, 2002 Microprocessors. Introduction Motorola controls roughly 40% of the 32-bit embedded processor market ColdFire is the next generation 68K.
Instructor: Dr Aleksandar Milenkovic Lecture Notes
EECC250 - Shaaban #1 Lec # 2 Winter Addressing Modes  Addressing modes are concerned with the way data is accessed  Addressing can be.
The family.
680XX Program Examples Outline –Binary to BCD –Matrix Addition –Ones Count –String Compare –Sector Map –Raster Graphics –Subroutine Calls Goal –Understand.
Machine Instructions Operations
Chapter 5 The LC-3 Instruction Set Architecture l ISA Overview l Operate instructions l Data Movement instructions l Control Instructions l LC-3 data path.
2.3) Example of program execution 1. instruction  B25 8 Op-code B means to change the value of the program counter if the contents of the indicated register.
EECC250 - Shaaban #1 lec #14 Winter Binary Coded Decimal (BCD) Arithmetic Binary Coded Decimal (BCD) is a way to store decimal numbers.
EECC250 - Shaaban #1 Lec # 6 Winter Stack-Related Instructions PEA Push Effective Address Calculates an effective address and pushes it.
9/20/6Lecture 3 - Instruction Set - Al1 Exception Handling (2)
Gursharan Singh Tatla 21-Nov-20101www.eazynotes.com.
Data Transfer Group ECE 511: Digital System & Microprocessor.
Architecture of the 680XX Outline Goal Reading 680XX Family
TK 2633 Microprocessor & Interfacing Lecture 3: Introduction to 8085 Assembly Language Programming (2) 1 Prepared By: Associate Prof. Dr Masri Ayob.
EECC250 - Shaaban #1 lec #16 Winter Estimation of Assembly Programs Execution Time For a CPU running at a constant clock rate: clock rate =
EET 2261 Unit 2 HCS12 Architecture
Chapters 4 & 5: LC-3 Computer Architecture Machine Instructions Assembly language Programming in Machine and Assembly Language.
Computer Architecture
ECE 265 – LECTURE 4 The M68HC11 Address Modes 8/14/ ECE265.
MICROCONTROLLER INSTRUCTION SET
The M68HC11 Basic Instruction Set Basic Arithmetic Instructions
ECE 447 Fall 2009 Lecture 5: TI MSP430 Software Development in C and Assembly pt. 2.
Assembly Programming on the TI-89 Created By: Adrian Anderson Trevor Swanson.
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose:  This course provides an overview of the SH-2 32-bit RISC.
Khaled A. Al-Utaibi  Introduction  Arithmetic Instructions  Basic Logical Instructions  Shift Instructions  Rotate Instructions.
Machine Instruction Characteristics
9/20/6Lecture 3 - Instruction Set - Al Instruction Set (2)
Registers and MAL Lecture 12. The MAL Architecture MAL is a load/store architecture. MAL supports only those addressing modes supported by the MIPS RISC.
Microprocessor Dr. Rabie A. Ramadan Al-Azhar University Lecture 7.
Chapter 10 The Assembly Process. What Assemblers Do Translates assembly language into machine code. Assigns addresses to all symbolic labels (variables.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
9/20/6Lecture 2 - Prog Model Architecture, Data Types and Addressing Modes.
ECE 265 – LECTURE 5 The M68HC11 Basic Instruction Set 12/8/ ECE265.
ECE 447 Fall 2009 Lecture 4: TI MSP430 Architecture and Instruction Set.
ECE 447: Lecture 11 Introduction to Programming in Assembly Language.
Microprocessor & Assembly Language Arithmetic and logical Instructions.
M68k Arithmetic Instructions ECE 511: Digital System & Microprocessor.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
Microprocessor & Assembly Language
“ INSTRUCTIONS SET OF AVR MICROCONTROLLER ” SIGMA INSTITUTE OF ENGINEERING Prepared By: SR.NO NAME OF STUDENT ENROLLMENT 1 Abhishek Lakhara
Figure 8.1 of course package
Format of Assembly language
Status Register Status = system byte (supervisor only) + user byte = system status + condition code register usually, it is not important to know.
Classification of Instruction Set of 8051
ECE 3430 – Intro to Microcomputer Systems
8086 Microprocessor.
Lecture Set 5 The 8051 Instruction Set.
Overview Introduction General Register Organization Stack Organization
68000 Arithmetic Instructions
The LC-3 Instruction Set Architecture Data Movement instructions
Lecture 3 - Instruction Set - Al
Chapter 11 © 2011, The McGraw-Hill Companies, Inc.
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Symbolic Instruction and Addressing
The University of Adelaide, School of Computer Science
68000 Architecture, Data Types and Addressing Modes
ECEG-3202 Computer Architecture and Organization
Symbolic Instruction and Addressing
M68k Arithmetic Instructions
Lecture 06 Programming language.
ECEG-3202 Computer Architecture and Organization
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
Chapter 6 –Symbolic Instruction and Addressing
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
Part I Data Representation and 8086 Microprocessors
Presentation transcript:

9/20/6Lecture 3 - Instruction Set - Al Instruction Set

9/20/6Lecture 3 - Instruction Set - Al2 Lecture Overview  The Instruction Set  The understand and effectively use an architecture must understand the register set and the instruction set.

9/20/6Lecture 3 - Instruction Set - Al3 Instruction Grouping  Instructions can be grouped into classes Data movement Arithmetic operations Logical operations Shift operations Bit manipulations Program control

9/20/6Lecture 3 - Instruction Set - Al4 Condition Code Register  Execution of the various instructions will set different bits in the condition code register  A table is provided to show which instructions affect which status bits  For the 68000, Table 2.2 of the text gives this information (pages 47-49) – Legend is at the end of the table.

9/20/6Lecture 3 - Instruction Set - Al5 Data Movement  General form: MOVE source,destination  MOVE MOVE #$ , D7 Source operand – any addressing mode – Data in register, or memory location Destination – use any addressing mode except immediate addressing, program counter relative V & C bits of CCR are cleared, N & Z updated  MOVEA – Move address Destination must be an address register (does not affect CCR)

9/20/6Lecture 3 - Instruction Set - Al6 DATA Movement (2)  MOVE to CCR Move data into the CCR MOVE, CCR  Copies the low order byte at to the low order byte of the status register.  High order byte (status register) unaffected

9/20/6Lecture 3 - Instruction Set - Al7 MOVE to SR  MOVE to or from SR TO the status register is a privledged instruction – only when in supervisor mode. FROM can be done in either mode on the but only supervisor mode on the 68010, 68020, or Form  MOVE,SR  MOVE SR,

9/20/6Lecture 3 - Instruction Set - Al8 MOVE USP  There are actually two A7 registers, one for the user and one that is used in supervisor mode (USP and SSP)  MOVE.L USP,An or MOVE.L An,USP copy USP value to/from address register An  Register other than the USP must be another address register.  User cannot see system stack pointer, SSP

9/20/6Lecture 3 - Instruction Set - Al9 MOVEM  Move multiple registers – allows movement of multiple register to/from memory MOVEM,  Example MOVEM.L D0-D7/A0-A6, -(SP)  Pushes all data and all address except A7 onto stack  When would this be useful?

9/20/6Lecture 3 - Instruction Set - Al10 MOVEQ  Move quick Load a value in the range -128 to +127 into a data register Loaded as a 32 bit value  The value is sign extended to a 32-bit value MOVEQ #-3, D2  Loads $FFFF FFFD into D2

9/20/6Lecture 3 - Instruction Set - Al11 MOVEP  Move peripheral instruction  Copies words or longwords to an 8 bit peripheral  Byte orientated peripheral interfaced such that they map to odd or even byte addresses.  MOVEP.L D2,0(A0) Copies contents of D2 to [A0+0], [A0+2], [A0+4], [A0+6]

9/20/6Lecture 3 - Instruction Set - Al12 LEA  Load Effective Address Calculate and effective address and then load it into an address register  LEA $0010FFFF,A6  LEA $12(A0,D4.L), A5

9/20/6Lecture 3 - Instruction Set - Al13 Position independent destinations  PC relative only allowed for source operands  Consider LEA TABLE(PC),A0 MOVE.B D0,(A0) Loads the position independent address of TABLE into address register A0 Then the least significant byte of D0 is stored at the address indicated by A0

9/20/6Lecture 3 - Instruction Set - Al14 PEA  Push effective address  Calculates the effective address and pushes it to the stack  Useful to put calling routines address on stack so subroutine can access actual data.

Example of PEA  Main routine (calling routine) P1DS.W1Parameter P1 … PEAP1Push addr of P1 on stack BSRABCJump to subroutine ABC LEA4(A7),A7Incr stack ptr back ABCLEA4(A7),A0Load addr on stack of of P1 into A0 MOVEA.L(A0),A0Put P1 addr into A0 MOVE.W(A0),D0Get data at P1 9/20/6Lecture 3 - Instruction Set - Al15

9/20/6Lecture 3 - Instruction Set - Al16 EXG & SWAP  EXG Exchange the contents of two registers Exchanges the entire 32-bit contents  SWAP Exchange the high and low order words of a data register.

9/20/6Lecture 3 - Instruction Set - Al17 Integer Arithmetic Operations  Conventional set of integer arithmetic ops  Act on 8, 16, or 32 bit operands  ADD - add source and destination and place result in destination Both can be data registers OR At least one must be a data register

9/20/6Lecture 3 - Instruction Set - Al18 Arithmetic  ADDA – destination of add is an address register  ADDQ – add a literal value in the range 1 to 8 to the contents of a memory location or register. ADDQ #4, D1 Speed is faster than ADD #4, D1

9/20/6Lecture 3 - Instruction Set - Al19 Arithmetic  ADDI - Add immediate – adds a literal value of a byte, word, or longword to the contents of a destination operand and then stores the result in the destination. ADDI.W #1234,(A0) Cannot be done using ADD as one operand must be a data register. Here can do without a data register.  ADDX – Add extended Add source and destination plus contents of the X bit of the condition code register Both source and destination must be data registers Carry out of msb is stored in X from operations so this allows mutiprecision data.

9/20/6Lecture 3 - Instruction Set - Al20 ARITHMETIC  CLR – Loads the target with 0  DIVS, DIVU – Integer division, signed or unsigned DIVU,Dn -32-bit longword in Dn is divided by the low order 16 bits at. Quotient is 16-bits and depostied in low-order word of destination

9/20/6Lecture 3 - Instruction Set - Al21 ARITHMETIC  MULS, MULU – multiply signed or unsigned  SUB, SUBA, SUBQ, SUBL, SUBX – the subtractions equivalents of ADD  NEG – Take the 2’s complement of target  NEGX – Two’s complement with X bit  EXT – sign extend low-order byte for word, or word for longword of destination – valid for.W and.L DIVXD0,D1 Divide 32 bit val in D1 by D0 EXT.LD1

Lecture Summary  Have looked at data movement and arithmetic instructions of the /20/6Lecture 3 - Instruction Set - Al22