EE357Unit4b_ColdfireISA

EE357Unit4b_ColdfireISA - EE 357 Unit 4b CF Assembly Basics...

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

View Full Document Right Arrow Icon
9/28/10 1 © Mark Redekopp, Al rights reserved EE 357 Unit 4b CF Assembly Basics © Mark Redekopp, Al rights reserved OPERATIONS AND INSTRUCTIONS © Mark Redekopp, Al rights reserved Coldfire Instruction Classes Data Transfer – Move data between processor & memory – 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 – Subroutine Calls Privileged / System Instructions – Instructions that can only be used by OS or other “supervisor” software (e.g. STOP, certain HW access instructions, etc.) © Mark Redekopp, Al rights reserved Operand Locations In almost all instruction sets, operands can be… – A register value (e.g. D0) – A value in a memory location (e.g. value at address 0xC8) – A constant stored in the instruction itself (known as an ‘immediate’ value) [e.g. ADDI #1,D0] Thus, our instructions must be able to specify which of these three locations is where the operand is located Mem. Inst. Proc. A D ... Inst. 00 Data 01 C8 Data Reg. ALU C9 ... Reg.
Background image of page 1

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

View Full DocumentRight Arrow Icon
9/28/10 2 © Mark Redekopp, Al rights reserved 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.) Moves the constant 001C hex to D0 © Mark Redekopp, Al rights reserved Registers & Data Size • Most CF instructions specify what size of data to operate on – MOVE.B – MOVE.W – MOVE.L • Register sizes are right-justified (start at LSB and work left) 31 0 Byte operations only access bits 7-0 of a register (upper bits are left alone) Byte 7 31 Word operations only access bits 15-0 of a register (upper bits are left alone) Word 31 Longword operations use the entire 32-bit value Longword 15 Dx: Ax/Dx: Ax/Dx: © Mark Redekopp, Al rights reserved Examples • Initial Conditions: 1 2 3 4 5 6 7 8 D0: A A A A B B B B D1: A A A A B B 7 8 A A A A F E D C 1 2 3 4 5 6 7 8 immediate (constant) base hex • MOVE.B D0,D1 • MOVE.W #0xFEDC,D1 • MOVE.L D0,D1 © Mark Redekopp, Al rights reserved Memory & Data Size Recall… Memory operands are addressed by their starting address and size Whereas registers operands always start with LSB and get appropriate size data, memory operands get the appropriate sized data from starting address and continuing towards larger addresses This makes it look left justified due to the big-endian ordering Valid words start @ addresses that is multiples of 2 Valid longwords start @ addresses
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 22

EE357Unit4b_ColdfireISA - EE 357 Unit 4b CF Assembly Basics...

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

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