lecture09

lecture09 - ECE252 Microprocessors Spring 2011 Lecture 09:...

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

View Full Document Right Arrow Icon
Jie Hu, ECE/NJIT, Spring 2011 ECE252 L16-Data&Prog. Struct. .1 ECE252 Microprocessors Spring 2011 Lecture 09: Basic Program Structures & Data Structures 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 L16-Data&Prog. Struct. .2 Block Diagram of Macintosh 512K Motherboard Processor 68000 I/O Interface 6522 Real- time clock Serial I/O 8530 Floppy disk controller System ROM RAM buffers and Mux PAL decoders Dynamic RAM 512KB Sound logic Video logic Speaker Video display Control signals Modem Printer Mouse Keyboard System bus Disk drive
Background image of page 2
Jie Hu, ECE/NJIT, Spring 2011 ECE252 L16-Data&Prog. Struct. .3 Review of Last Lecture 68000 Instruction Set (cont’d) Arithmetic Addition, subtraction Extension, negate, clear Comparison Multiplication, division Test & set, test
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 L16-Data&Prog. Struct. .4 Today’s Lecture 68000 Instruction Set Program control Program basic structures Data structures
Background image of page 4
Jie Hu, ECE/NJIT, Spring 2011 ECE252 L16-Data&Prog. Struct. .5 68000 Programming Model: Status Register T - S - - I 2 I 1 I 0 X N Z V C 0 4 8 9 10 13 15 System Byte User Byte (Condition Code Register) Trace bit Supervisor state Interrupt mask Extend Negative zero Overflow Carry Condition Codes
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 L16-Data&Prog. Struct. .6 68000 Instruction Set: Program Control B cc * Conditional branch DB cc * Decrement and branch S cc * Conditional set BRA Branch always BSR Branch to subroutine JMP Jump JSR Jump to subroutine RTR Return and restore cc RTS Return from subroutine *Note: cc stands for condition code
Background image of page 6
Jie Hu, ECE/NJIT, Spring 2011 Condition Code Tests: cc Condition Meaning Flag(s) tested T True None F False None PL Plus N=0 MI Minus N=1 VC Overflow clear V=0 VS Overflow set V=1 NE Not equal Z=0 EQ Equal Z=1 GE Greater than or equal N xor V=0 LT Less than N xor V=1 GT Greater than Z+(N xor V)=0 LE Less than or equal Z+(N xor V)=1 HI High C+Z=0 LS Lower or same C+Z=1 CC Carry clear (Higher or same) C=0 CS Carry set (Lower) C=1
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 L16-Data&Prog. Struct. .8 Conditional Branch: B cc Conditional branch Meaning BPL Branch if Plus BMI Branch if Minus BVC Branch if Overflow clear BVS Branch if Overflow set BNE Branch if Not equal BEQ Branch if Equal BGE Branch if Greater than or equal BLT Branch if Less than BGT Branch if Greater than BLE Branch if Less than or equal BHI Branch if High BLS Branch if Lower or same BCC Branch if Carry clear (Higher or same) BCS Branch if Carry set (Lower)
Background image of page 8
Jie Hu, ECE/NJIT, Spring 2011 ECE252 L16-Data&Prog. Struct. .9 Conditional Branch: B cc Assembler syntax: Bcc <label> Size = {Byte, Word} Signed comparison: CMP.WD1, D0 D0 > D1 BGT will be taken D0 >= D1 BGE will be taken D0 = D1 BEQ will be taken D0 ≠ D1 BNE will be taken D0 <= D1 BLE will be taken D0 < D1 BLT will be taken Unsigned comparison: CMP.WD1, D0 D0 > D1 BHI (higher) will be taken D0 >= D1 BCC (carry clear / higher or same) will be taken D0 = D1 BEQ will be taken D0 ≠ D1 BNE will be taken D0 <= D1 BLS (lower or same) will be taken D0 < D1 BCS (carry set / lower) will be taken
Background image of page 9

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

View Full DocumentRight Arrow Icon
Image of page 10
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 / 41

lecture09 - ECE252 Microprocessors Spring 2011 Lecture 09:...

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

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