EE357 Lecture 5

EE357 Lecture 5 - READING ASSIGNMENT Hamacher 2.5, 2.6,...

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

View Full Document Right Arrow Icon
EE 357 Lecture 5 Instruction Cycle Condition Codes Extended Arithmetic READING ASSIGNMENT • Hamacher 2.5, 2.6, 3.8.2, 3.9, 3.10 • Stenstrom 4.1, 4.5, 4.7, 5.1.1 • PLUS ADD and MOVE instructions in ISA manual Recap:Instruction Format • Instructions can range from 1 to 5 words •1 st word is always the instruction word – Indicates the operation and addressing modes •2 nd –5 th word are extension words – Only used with certain addressing modes Instruction Word Src. Constant Src. Constant (cont.) Dest. Constant Dest. Constant (cont.) 1 2 3 4 5 extension words Recap:Extension Words • Displacement Mode – 16-bit disp. value stored as 1 ext. word • Absolute Addr. Mode – Short Mode stored as 1 ext. word – Long Mode stored as 2 ext. words • Immediate Mode – .B and .W values stored as 1 ext. word – .L stored as 2 ext. words • Index Mode w/ Disp. – 1 ext. word to encode index reg. and disp. value MOVE.W MOVE.W #-1,$7000 FFFF 7000 MOVE.W MOVE.B #$6C,$2A7000 002A 006C 7000 MOVE.W MOVE.W $24(A0),D0 0024 D/A reg W/L 000 8b disp. 13 1 8 3 MOVE.W MOVE.W $24(A0,D1.L),D2 1824 01 Rn
Background image of page 1

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

View Full DocumentRight Arrow Icon
Recap:MOVE Translation • Instruction word format: MOVE.L (A5)+,D2 dest src = 241D opcode 1 51 41 31 21 11 09876543210 0 0 size Reg. Mode Mode Reg. 1 0 0 1 0 0 1 0 0 0 0 0 1 1 1 0 1 Recap: ADD Translation* • ALU instructions like ADD must have one operand as the data register • Instruction word format: ADD.W (A5)+,D2 Dn eff. addr. = D45D opcode 1 1 1 0 1 Reg. OpMode Mode Reg. See ADD in Class Notes 1 1 1 0 1 0 1 0 0 0 1 0 1 1 1 0 1 D2 (An)+, 5 .W & Dn=Dst Recap: A.R.I. w/ Index Index and displacement info is stored as a word after the instruction Before Instruction Fetch (PC)=$8100 After Instruction Fetch: (PC)=$8102 After Execution: (PC)=$8104 2430 1824 next instr. ... 00008100 PC 80FE 8100 8102 8104 MOVE.L $24(A0,D1.L),D2 op. size reg mode mode reg dest src 00 10 010 000 110 000 = 2430 MOVE D/A reg .W/.L 000 8b disp. 0 001 1 000 00100100 Ext. Word = 1824 Short absolute address is always stored as a word after the instruction Before Instruction Fetch: (PC)=8100 After Instruction Fetch: (PC)=8102 After Execution: (PC)=8104 2438 7060 next instr. ... 00008100 PC 80FE 8100 8102 8104 MOVE.L $7060,D2 op. size reg mode mode reg dest src 00 10 010 000 111 000 = 2438 MOVE Short Absolute Address
Background image of page 2
Long Absolute Address Long absolute Address is stored as a longword after instruction Before Instruction Fetch: (PC)=8100 After Instruction Fetch: (PC)=8102 • After Execution: (PC)=8106 2439 0001 ... 00008100 PC 80FE 8100 8102 8104 MOVE.L $18060,D2 op. size reg mode mode reg dest src 00 10 010 000 111 001 = 2439 MOVE next instr. 8106 8060 Immediate Mode Immediate data is stored as longword if size .L is used. It is stored as a word if size is .B or .W Before Instruction Fetch: (PC)=8100 After Instruction Fetch: (PC)=8102 After Execution: (PC)=8106 243C 0000 ... 00008100 PC 80FE 8100 8102 8104 MOVE.L #$7060,D2 op. size reg mode mode reg dest src 00 10 010 000 111 100 = 243C MOVE next instr.
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.

Page1 / 8

EE357 Lecture 5 - READING ASSIGNMENT Hamacher 2.5, 2.6,...

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