lecture08

lecture08 - ECE252 Microprocessors Spring 2011 Lecture 08:...

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

View Full Document Right Arrow Icon
Jie Hu, ECE/NJIT, Spring 2011 ECE252 L08-Inst. Set.1 ECE252 Microprocessors Spring 2011 Lecture 08: Program Control Instructions Jie Hu http://web.njit.edu/~jhu/ece252/002
Background image of page 1

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

View Full DocumentRight Arrow Icon
Jie Hu, ECE/NJIT, Spring 2011 ECE252 L08-Inst. Set.2 Review of Last Lecture 68000 Instruction Set: Data transfer Register exchange/swap: EXG, SWAP Memory address: LEA, MOVEA Move data: MOVE, MOVEQ Stack operation: PEA, LINK, UNLK, MOVEM Move peripheral data: MOVEP
Background image of page 2
Jie Hu, ECE/NJIT, Spring 2011 ECE252 L08-Inst. Set.3 Today’s Lecture 68000 Instruction Set (cont’d) Arithmetic Addition, subtraction Extension, negate, clear Comparison Multiplication, division Test & set, test Program control
Background image of page 3

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

View Full DocumentRight Arrow Icon
Jie Hu, ECE/NJIT, Spring 2011 ECE252 L08-Inst. Set.4 68000 Instruction Set: Arithmetic ADD Add binary ADDA Add address ADDI Add immediate ADDQ Add quick ADDX Add extended CLR Clear operand CMP Compare CMPA Compare address CMPI Compare immediate CMPM Compare memory DIVS Divided signed numbers DIVU Divided unsigned numbers
Background image of page 4
Jie Hu, ECE/NJIT, Spring 2011 ECE252 L08-Inst. Set.5 68000 Instruction Set: Arithmetic (cont’d) EXT Extend sign MULS Multiply signed numbers MULU Multiply unsigned numbers NEG Negate NEGX Negate with extend SUB Subtract SUBA Subtract address SUBI Subtract immediate SUBQ Subtract quick SUBX Subtract with extend TAS Test and set TST Test
Background image of page 5

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

View Full DocumentRight Arrow Icon
Jie Hu, ECE/NJIT, Spring 2011 ECE252 L08-Inst. Set.6 Arithmetic: ADD, SUB ADD, ADDA, ADDI, ADDQ, ADDX SUB, SUBA, SUBI, SUBQ, SUBX ADD, SUB, ADDI, SUBI, ADDX, SUBX: support .B, .W, .L ADDA, SUBA: support .W, .L ADDQ, SUBQ: immediate must be from 1 to 8 (000) All condition code affected Assembler syntax ADD <ea>, Dn or <ea> can be anything except immediate. ADD Dn, <ea> (An) can not be used in the destination operand. ADDA <ea>, An ADDI #<data>, <ea> ; <ea> cannot be An ADDQ #<data>, <ea> ;<data> from 1 to 8 ADDX Dy, Dx or ADDX -(Ay), -(Ax) Operation: Source + Destination + X Destination SUBX Dy, Dx or SUBX -(Ay), -(Ax) Operation: Destination – Source – X Destination
Background image of page 6
Jie Hu, ECE/NJIT, Spring 2011 ECE252 L08-Inst. Set.7 Arithmetic: ADD, SUB Examples: ADD.B D2, D3 ;D2.B + D3.B -> D3.B ADDA.W A0, A3 ;A0.W + A3.W -> A3.W ADDI.B #$10, D2 ;$10 + D2.B -> D2.B ADDQ #4, A2 ;$4 + A2.L -> A2.L ADDX.B D2, D3 ;D2.B + D3.B + X -> D3.B ADDX.W -(A0), -(A1) ; ( A1-2) – (A0-2) = (A1-2) SUB.L (A0), D2 ; (D2)-(A0)=D2; (A0) data from memory SUBA.W #7, A3 ;A3.W – 7 -> A3.W SUBI.B #$2C, D2 ;D2.B - $2C -> D2.B SUBX.L -(A0), -(A1) ;( A1-4) – (A0-4)-X = (A1-4)
Background image of page 7

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

View Full DocumentRight Arrow Icon
Jie Hu, ECE/NJIT, Spring 2011 ECE252 L08-Inst. Set.8 Arithmetic: CMP CMP, CMPA, CMPI, CMPM compare is accomplished by subtracting source operand from destination operand, without affecting either operand CMP, CMPI, CMPM: support .B, .W, and .L CMPA only support .W and .L all condition codes except X are affected Assembler syntax CMP <ea>, Dn CMPA <ea>, An CMPI #<data>, <ea> ;<ea> cannot be An, #<data> CMPM (Ay)+, (Ax)+
Background image of page 8
Jie Hu, ECE/NJIT, Spring 2011 ECE252 L08-Inst. Set.9 Arithmetic: CMP Examples CMP.W #$29AF, D6 CMPA.L A2, A3 CMPI.B #5, (A3) CMPM.B (A1)+, (A2)+
Background image of page 9

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

View Full DocumentRight Arrow Icon
Jie Hu, ECE/NJIT, Spring 2011 ECE252 L08-Inst. Set.10
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/29/2012 for the course ECE 252 taught by Professor Rosenstark during the Spring '99 term at NJIT.

Page1 / 29

lecture08 - ECE252 Microprocessors Spring 2011 Lecture 08:...

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

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