Unit5-CFAssembly-EE357-Nazarian-Fall09

Unit5-CFAssembly-EE357-Nazarian-Fall09 - University...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
University of Southern California Viterbi School of Engineering EE357 asic Organization of Computer Systems Basic Organization of Computer Systems F Assembly Basics CF Assembly Basics References: 1) Textbook 2) Mark Redekopp’s slide series Shahin Nazarian Fall 2009 3) Freescale documents on CF
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Coldfire Instruction Classes Data Transfer Move data between processor & memory ove data between re isters w/in processor Move data between registers w/in processor Can specify .B, .W, .L size ALU Performs arithmetic and logic operations Only .L size => Ops. must be on a full 32-bit longword contents Control / Program Flow Unconditional/Conditional Branch ubroutine Calls Subroutine Calls Privileged / System Instructions Instructions that can only be used by OS or other “ upervisor” software (e g STOP certain HW access Shahin Nazarian/EE357/Fall 2009 2 supervisor software (e.g. STOP, certain HW access instructions, etc.)
Background image of page 2
OPERATIONS AND INSTRUCTIONS Shahin Nazarian/EE357/Fall 2009 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Operand Locations In almost all instruction sets, operands can be… register value (e g D A register value (e.g. D0) A value in a memory location (e.g. value at ddress C Mem. Proc. address 0xC8) A constant stored in the instruction itself (known as Inst. A D ... Inst. 00 Data 01 C8 Reg. LU Reg. an ‘immediate’ value) [e.g. ADDI #1,D0] Thus, our instructions must be Data ALU C9 ... able to specify which of these three locations is where the operand is located Shahin Nazarian/EE357/Fall 2009 4
Background image of page 4
Data Transfer Instruction MOVE.s src,dst .s = .B, .W, .L Copies src operand to dst operand SRC operand specifies data in a: Reg. (e.g. D0 or A4) Mem. = Specified with the address of desired source location Immediate = Constant (preceded w/ ‘#’ sign in assembly instruc.) DST operand specifies a location to put the source data & can be a: Reg. Mem. = Specified with the address of desired destination location Examples MOVE.B D0,0x1C ; 0x = hex modifier Moves the byte from reg. D0 to memory byte @ address 0x1c MOVE.W #0x1C,D0 ; # = Immediate (no # = address/mem. oprnd.) Shahin Nazarian/EE357/Fall 2009 5 Moves the constant 001C hex to D0
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Registers & Data Size MOVE instructions specify what size 1 of data to operate on MOVE.B 31 0 Byte operations only access bits 7-0 of Byte 7 Dx: MOVE.W MOVE.L a register (upper bits are left alone) 31 0 Word 15 Ax/Dx: Register sizes are right-justified tart at LSB and Word operations only access bits 15-0 of a register (upper bits are left alone) (start at LSB and work left) 31 0 Longword Ax/Dx: Shahin Nazarian/EE357/Fall 2009 6 Longword operations use the entire 32-bit value
Background image of page 6
Examples Initial Conditions: 1 2 3 4 5 6 7 8 D0: A A A A B B B B D1: AAABB 8 • MOVE.B D0,D1 A A A A B B 7 8 D1: A A A A F E D C D1: • MOVE.W #0xFEDC,D1 1 2 3 4 5 6 7 8 D1: immediate (constant) base hex • MOVE.L D0,D1 Shahin Nazarian/EE357/Fall 2009 7
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Memory & Data Size Recall… Memory operands are addressed by their starting address and size Address Registers operands always
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/14/2010 for the course EE 357 at USC.

Page1 / 86

Unit5-CFAssembly-EE357-Nazarian-Fall09 - University...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online