9/20/6Lecture 2 - Prog Model1 68000 Architecture, Data Types and Addressing Modes.

Slides:



Advertisements
Similar presentations
The family.
Advertisements

There are two types of addressing schemes:
Address Indirect Addressing with Index and Displacement – Mode 6 Opcode - 4dRn - 3dmd - 3sMS - 6 rt - 1xm - 3s -1und - 3 displacement - 8 rt – type of.
Instruction Set Architecture Classification According to the type of internal storage in a processor the basic types are Stack Accumulator General Purpose.
9/20/6Lecture 3 - Instruction Set - Al Instruction Set.
Introduction to 8086 Microprocessor
Instruction Set Architecture & Design
Execution of an instruction
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 # 5 Winter Stacks A stack is a First In Last Out (FILO) buffer containing a number of data items usually implemented.
CSCE 121, Sec 200, 507, 508 Fall 2010 Prof. Jennifer L. Welch.
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
8051 ASSEMBLY LANGUAGE PROGRAMMING
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
Architecture of the MSP430 Processor. Central Processing Unit Program Counter (PC) - Contains the address of the next instruction to be executed. The.
Part II: Addressing Modes
ECE 265 – LECTURE 9 PROGRAM DESIGN 8/12/ ECE265.
ECE 265 – LECTURE 4 The M68HC11 Address Modes 8/14/ ECE265.
Lecture 18 Last Lecture Today’s Topic Instruction formats
CEG 320/520: Computer Organization and Assembly Language ProgrammingIntel Assembly 1 Intel IA-32 vs Motorola
An Introduction to 8086 Microprocessor.
A Simple Two-Pass Assembler
CoE3DJ4 Digital Systems Design
1 Programming in Machine Language SCSC 311 Spring 2011.
MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR1 Addressing Mode.
CSC 3210 Computer Organization and Programming Chapter 1 THE COMPUTER D.M. Rasanjalee Himali.
Microprocessor Dr. Rabie A. Ramadan Al-Azhar University Lecture 7.
5-1 Chapter 5 - Languages and the Machine Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles.
Execution of an instruction
Addressing Modes1 Addressing modes are concerned with how the CPU accesses the operands used by its instructions.
Addressing Modes MTT CPU08 Core Motorola CPU08 ADDRESSING MODES.
Topics covered: Instruction Set Architecture CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE Lecture 21 & 22 Processor Organization Register Organization Course Instructor: Engr. Aisha Danish.
Computer Organization Instructions Language of The Computer (MIPS) 2.
8085 INTERNAL ARCHITECTURE.  Upon completing this topic, you should be able to: State all the register available in the 8085 microprocessor and explain.
ECE 511: Digital System & Microprocessor
Instruction set Architecture
Machine Code typically: word 1 words 2-3 words 4-5
ECE 3430 – Intro to Microcomputer Systems
Figure 8.1 of course package
Addressing Modes in Microprocessors
MIPS Instruction Set Advantages
CC410: System Programming
Programming in Machine Language
Assembly Language Programming of 8085
System Programming and administration
Introduction to 8086 Microprocessor
Chapter 3 Machine Language and Assembly Language.
Chapter 3 Machine Language and Assembly Language.
Chapter 4 Addressing modes
RISC Concepts, MIPS ISA Logic Design Tutorial 8.
Addressing Modes Immediate #<data> or Imm
8051 Addressing Modes The way, using which the data source or destination addresses are specified in the instruction mnemonic for moving the data, is.
Microcomputer Programming
William Stallings Computer Organization and Architecture 8th Edition
Assembly Lang. – Intel 8086 Addressing modes – 1
Computer Organization and Assembly Language (COAL)
EECE-276 Fall 2003 Microprocessors & Microcontrollers II
Lecture 3 - Instruction Set - Al
CSCE Fall 2013 Prof. Jennifer L. Welch.
Chapter 8 Central Processing Unit
68000 Architecture, Data Types and Addressing Modes
Figure 8.1 of course package
Introduction to Micro Controllers & Embedded System Design
A Simple Two-Pass Assembler
CSCE Fall 2012 Prof. Jennifer L. Welch.
8051 ASSEMBLY LANGUAGE PROGRAMMING
Part I Data Representation and 8086 Microprocessors
Location Counter (LC) = 0 while line of code <> END if ORG
Presentation transcript:

9/20/6Lecture 2 - Prog Model Architecture, Data Types and Addressing Modes

9/20/6Lecture 2 - Prog Model2 Lecture Overview  Assembler Language  Programmers Model Registers  Addressing Modes

9/20/6Lecture 2 - Prog Model3 Assembler Language  Programming language very close to the machine code for a language Can be considered a native language for the architecture targeted. Assembler languages have a 1-to-1 translation to machine code  All assemblers have two types of statements Executable instructions Assembler directives

9/20/6Lecture 2 - Prog Model4 Assembler Directives  TTL “Title” – gives the program a user-defined name  EQU **Links a pneumonic name to a value. Very valuable in making the program “readable”. Example to reserve 128 bytes for a stack. STACK_FRAME EQU 128 Define a stack frame of 128 bytes *** LINK A1,# -STACK_FRAME

9/20/6Lecture 2 - Prog Model5 Assembler Directives (2)  ORG – sets the location counter (address)  DC Define constant. Allows the programmer to set memory locations to specific values. Qualifier specifies data type:.B,.W,.L ORG $ FST DC.B 10, 66 Set constants of 10 and 66 at memory location $1000 DC.L $0A1234 Store $000A1234 in memory STR DC.B ‘April’ Store ASCII values

9/20/6Lecture 2 - Prog Model6 Assembler Directives (3)  DS Reserve bytes, words, or longwords of storage  ORG Define the value of the location counter. Sets the memory address where the code is placed.  SECTION Set the address counter to zero for position independent code.  END

9/20/6Lecture 2 - Prog Model7 Assembler Code Example

9/20/6Lecture 2 - Prog Model8 Programmers Model  When looking at any architecture what does the programmer see? REGISTERS (General purpose) ADDRESS REGISTERS SPECIAL PURPOSE REGISTERS MEMORY Allowable operations and data transfers supported

9/20/6Lecture 2 - Prog Model9 DATA REGISTERS  A 32-bit machine  8 general purpose  Called D0 to D7  Any operation permitted on Di can also be done on Dj  Data access 8,16,32 bits

9/20/6Lecture 2 - Prog Model10 Address Registers  8 Address Regs  Labeled A0 to A7  Entire 32 bits is single entity value  Any operation permitted on Ai is also allowed on Aj  2’s complement value treatment  Used in instructions to address memory

9/20/6Lecture 2 - Prog Model11 Special Purpose Registers  2 such registers PC – Program Counter  Contains the address of the next instruction to be executed. SR – Status Register  16 bits divided into two bytes  MSB – System byte – control operation mode  LSB – Condition codes

9/20/6Lecture 2 - Prog Model12 Status Word

9/20/6Lecture 2 - Prog Model13 Addressing Modes  Modes supported are reflective of even the most modern architecture  Some Notation [Dx] means the “contents of” % num means binary $ num means hexadecimal  indicates transfer of information  Table on page 27 lists meaning of symbols and notation

9/20/6Lecture 2 - Prog Model14 Immediate Addressing  ACTION: The value of the operand (data) is loaded into the specified register at the time the program runs.  The value of the operand is used in the operation  Note that general form of instructions is Operation #Source, Destination MOVE.W #$8123,D3 [D3(0:15)]  $8123  Fill the low order bytes of De MOVE.L #$8123,D3 [D3(0:31)]  $  Fills all 32 bits of register D3

9/20/6Lecture 2 - Prog Model15 Absolute Addressing  Sometimes called “Direct Addressing”  The address in memory being referenced by the instruction is given in the instruction. Used when the address of the operand is known when the program is written.  The instruction contains the operand’s address FORM Operation source,destination MOVE.L D3,$1234 [M($1234)]  [D3(16:31)] [M($1236)]  [D3(0:15)] MOVE.W $1234,D3 [D3(0:15)]  [M($1234)]

9/20/6Lecture 2 - Prog Model16 Register Direct Addressing  Register to register operation  The assembler instruction lists both register which will be used for operand of the operation to be performed  The 2 nd register listed is both the 2 nd operand of the operation and gets the results of the operation.  Example: MOVE.L D0,D3 Effect: [D3]  [D0]

9/20/6Lecture 2 - Prog Model17 Address Register Indirect  Register Indirect means that the address of the operand is in a register, the address registers.  Ex:

9/20/6Lecture 2 - Prog Model18 Forms of Address Reg. Indirect  Address Register Indirect with postincrement The contents of the address register are incremented by the appropriate amount after use That is, the data is referenced with the value currently in the address register. Then the contents of the register are incremented by the size referenced.  Address Register Indirect with predecrement Contents are decremented and then used What use may these have?

Forms of Address Reg. Indirect (2)  Address Register Indirect with displacement A 16-bit displacement is specified in instruction Displacement added to address register to obtain the effective address of the operand  Register Indirect with Index Addressing Effective address is calculated by adding the address register + 8-bit signed displacement + contents of general purpose register Ref fig 2.15 of text, pg.39 9/20/6Lecture 2 - Prog Model19

9/20/6Lecture 2 - Prog Model20 PC Relative  Similar to register indirect except that the address of the operand is specified with respect to the PC contents.  Allows data to be located relative to the location of the program in memory, i.e., relative to the Program Counter – allows WHAT????  Restricted to only the source operand

9/20/6Lecture 2 - Prog Model21 PC Relative  Allows data to be located relative to the location of the program in memory, i.e., relative to the Program Counter – allows position-independent code.  What is position-independent code?

9/20/6Lecture 2 - Prog Model22 PC Relative  Allows data to be located relative to the location of the program in memory, i.e., relative to the Program Counter – allows position-independent code.  What is position-independent code? Code that can be located anywhere (some caveats) in memory and executes the same.

9/20/6Lecture 2 - Prog Model23 The Stack  With autoincrementing/autodecrementing of address register you have essentially 8 stacks. In this way register A0 through A7 can become user defined stacks  For Jump to Subroutine, register A7 is used So you may not want to use address register A7 for programs that calls to subroutines  The stack grows down and the register points to the TOS element and has valid contents.

Stack Operations  PUSH data onto stack Stack grows down. TOS has valid data. Use the predecrement form  MOVE.W $4234, -(A7)  POP data from stack Use the postincrement form  MOVE.W (A7)+,D4 9/20/6Lecture 2 - Prog Model24

Assignment  From Text HW1 Problem 2-1 parts a,b,d,g Problem 2-5 Problem 2-6 BE READY TO DISCUSS these in class next week. 9/20/6Lecture 2 - Prog Model25

 You can get a free 68K assembler/simulator 9/20/6Lecture 2 - Prog Model26