Download
ece 447 lecture 14 n.
Skip this Video
Loading SlideShow in 5 Seconds..
ECE 447: Lecture 14 PowerPoint Presentation
Download Presentation
ECE 447: Lecture 14

ECE 447: Lecture 14

196 Vues Download Presentation
Télécharger la présentation

ECE 447: Lecture 14

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. ECE 447: Lecture 14 The 68HC11 Instruction Set

  2. ECE 447: Instruction Types 1. Data handling instructions a. Move instructions (e.g., load, store, exchange) b. Alter data instructions (e.g., clear, increment, decrement) c. Edit instructions (e.g., shift, rotate) 2. Arithmetic instructions (e.g., add, subtract, multiply, divide, negate) 3. Logic instructions (e.g., and, or, xor) 4. Data test instructions (e.g. compare, test, bit test)

  3. ECE 447: Instruction Types (con’t) 5. Control instructions (e.g., jump, branch) 6. Condition code instructions (e.g., set carry, clear overflow flag) 7. Stack operations (e.g. push, pull) 8. Subroutine-related instructions (e.g. jump to subroutine, return from subroutine) 9. Interrupt-related instructions (e.g. software interrupt, return from interrupt)

  4. ECE 447: Move Instructions 1. memory  register LDA [A, B] LD [D, X, Y, S] 2. register  memory STA [A, B] ST [D, X, Y, S] 3. register  register TAB, TBA 4. memory  memory IMM, DIR, EXT, IND 0 – 0 – DIR, EXT, IND 0 – INH

  5. ECE 447: Move Instructions N Z V C 5. register  register XGD [X, Y] – – – – INH

  6. ECE447: Alter Data Instructions N Z V C 1. 0  register CLR [A, B] 2. 0  memory CLR 0 1 0 0 INH EXT, IND 0 1 0 0 3. increment X++ INC [A, B] INC IN [X, Y] 4. decrement X-- DEC [A, B] DEC DE [X, Y] INH EXT, IND INH – – – – INH EXT, IND INH – – – –

  7. ECE447: Edit Instructions - Shifts N Z V C . . . 1. logical shift right LSR [A, B, D] LSR 2. arithmetic shift right ASR [A, B, D] ASR 3. arithmetic/logical shift left ASL [A, B, D], LSL [A, B, D] ASL, LSL 0 C 0 n-1 INH EXT, IND 0 . . . C 0 n-1 INH EXT, IND . . . C 0 0 n-1 INH EXT, IND

  8. ECE447: Edit Instructions-Rotations N Z V C . . . 1. rotation right ROR [A, B] ROR 2. rotation left ROL [A, B] ROL 0 7 C INH EXT, IND . . . 0 7 0 C INH EXT, IND

  9. ECE 447: Arithmetic Instructions N Z V C 1. addition Reg + B  Reg ABA AB [X, Y] 2. subtraction A – B  A SBA INH – – – – INH 3. negation -X NEG [A, B] NEG INH EXT, IND

  10. ECE 447: Arithmetic Instructions N Z V C 1. addition Reg + B  Reg ABA AB [X, Y] 2. subtraction A – B  A SBA INH – – – – INH

  11. ECE 447: Arithmetic Instructions N Z V C 1. unsigned multiplication A x B  D MUL 2. unsigned division D/IX  IX D mod IX  D IDIV 3. unsigned fractional division D < IX (scaled by 216) D/ IX  IX (scaled by 216) D mod IX  D 4. decimal adjustment DAA – – – INH – 0 INH – FDIV INH ? INH

  12. ECE 447: Logical Instructions N Z V C 1. AND Acc & M  Acc AND [A, B] 2. OR Acc | M  Acc ORA [A, B] 3. XOR Acc  M  Acc EOR [A, B] 0 – IMM, DIR, EXT, IND 0 – IMM, DIR, EXT, IND 0 – IMM, DIR, EXT, IND

  13. ECE 447: Logical Instructions N Z V C 1. complement X  X COM [A, B] COM 2. bit set M | mask  M BSET 3. bit clear M & mask  M BCLR INH EXT, IND 0 1 0 – DIR, IND 0 – DIR, IND

  14. ECE 447: Data Test Instructions N Z V C 1. comparison R - M CMP [A, B] CP [D, X, Y] IMM, DIR, EXT, IND 2. comparison A – B CBA INH 3. test register TST [A, B] 0 0 INH

  15. ECE 447: Data Test Instructions N Z V C 4. test memory TST 5. Bit test Acc & memory BIT [A, B] 0 0 EXT, IND IMM, DIR, EXT, IND 0 –

  16. ECE 447: Branch Instructions N Z V C – – – – REL after comparison register vs. memory unsigned numbers signed numbers BHI higher > BLO lower < BHS higher or same  BLS lower or same  BGT greater than > BLT less than < BGE greater than or equal  BLE less than or equal  BEQ equal = BNE not equal 

  17. ECE 447: Brach Instructions after arithmetic operations (testing for overflow) unsigned numbers signed numbers BCS carry set BCC carry clear BVS overflow set BVC overflow clear after testing register or memory BPL plus  0 BMI minus < 0 unconditional BRA always BRN never

  18. ECE 447: Condition Code Instructions 1. set a flag 1  flag SE [C, V, I] 2. clear a flag 0  flag CL [C, V, I] 3. change all flags A  CC TAP 4. read all flags CC  A TPA