EE357 Lecture 4

EE357 Lecture 4 - Recap: Register Transfer Language (RTL)...

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

View Full Document Right Arrow Icon
EE 357 Lecture 4 More Addressing Modes Machine Code Translation and Instruction Format Recap: Register Transfer Language (RTL) • Shorthand notation for describing processor / memory operations • Every RTL expression takes the form: A ĺ B • A is always a value, B is a location • “Put VALUE into location” Register Transfer Language (RTL) • Suppose we want to take the address in A0, get the data at that address and place that in D1: ((A0)) ĺ D1 – (A0) evaluates to the address in A0, but we need to get the data at that address so we use another set of parentheses Data Transfer Instructions C operator Assembly Notes = MOVE.s src,dst = 0 CLR.s dst CLR executes faster than MOVE.s #0,dst
Background image of page 1

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

View Full DocumentRight Arrow Icon
Arithmetic and Logic Instructions C operator Assembly Notes + ADD.s src1,src2/dst - SUB.s src1,src2/dst Order: src2 – src1 & AND.s src1,src2/dst | OR.s src1,src2/dst ^ EOR.s src1,src2/dst ~ NOT.s src/dst - NEG.s src/dst Performs 2’s complementation * (signed) MULS src1,src2/dst Implied size .W * (unsigned) MULU src1, src2/dst Implied size .W / (signed) DIVS src1,src2/dst Implied size .W / (unsigned) DIVU src1, src2/dst Implied size .W << (signed) ASL.s cnt, src/dst << (unsigned) LSL.s cnt, src/dst >> (signed) ASR.s cnt, src/dst >> (unsigned) LSR.s cnt, src/dst ==, <, >, <=, >=, != (src2 ? src1) CMP.s src1, src2 Order: src2 – src1 Addressing Modes and Operands • Operands of an instruction can be in one of 3 locations – Register –Memory – Immediate (constant) value stored in memory but as part of the instruction • Addressing modes refer to the methods an instruction can use to specify the location of an operand Overview Location of Operand Addressing Modes Effective Address <ea> Assembly Notation Register Contents Data Register Direct - D0 Address Register Direct - A1 Memory Location Address Register Indirect (A.R.I.) <ea> = contents of A2 (A2) A.R.I. w/ postincrement <ea> = contents of A2 (A2)+ A.R.I. w/ predecrement <ea> = contents of A2 – {1,2,4} -(A2) A.R.I. w/ displacement <ea> = contents of A2 + displacement $24(A2) A.R.I. w/ index & displacement <ea> = contents of (A2 + disp. + D0.L) $24(A2,D0.L) Absolute Addressing Short <ea> = $7060 $7060 Absolute Addressing Long <ea> = $18000 $18000 Immediate Immediate - #$7800 Address Register Indirect w/ Index • Specifies a memory location •U s e A n as base address and adds a displacement value and the contents of another Data or Address register to come up w/ effective address (<EA>) • Displacement limited to 8-bit signed number •A n not affected (maintains original address) Example : MOVE.L $24 (A0,D1.L),D2 Displacement Value Addr. Reg. Indirect w/ Index Mode
Background image of page 2
Address Register Indirect w/ Index Example : 1234 ABCD 6789 EF50 MM 7864 7862 7860 785E 0000703C 00000800 + 00000024 00007860 = (A0) = (D1) = Disp.
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/11/2009 for the course EE 357 taught by Professor Mayeda during the Fall '08 term at USC.

Page1 / 10

EE357 Lecture 4 - Recap: Register Transfer Language (RTL)...

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

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