lecture08 - ECE252 Microprocessors Spring 2011 Lecture 08...

Info icon This 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
Image of page 1

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

View Full Document Right 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
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
Image of page 3

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

View Full Document Right 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
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
Image of page 5

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

View Full Document Right 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
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)
Image of page 7

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

View Full Document Right 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)+
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)+
Image of page 9

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern