ELE 22 MIC Lecture 6 Continuation of Lecture
- Slides: 12
ELE 22 MIC Lecture 6 • Continuation of Lecture 5 • Instruction Set Overview, Part 4 – HC-COM - Lab notes – Stack Pointer, Push, Pull • Call/return • Data – Conditional Jumps – Address Bus – Data Bus
Jump • JUMP address (0. . $FFFF, 0. . $FF) • JMP Jump to Address – Load the specified address, into the program counter. – Functions like GOTO in C/BASIC/PASCAL.
Branch • BRANCH (PC + [-$80. . $7 F]) – Jump relative to current program counter (PC) – Used if the destination is close to the current instruction • Branch • BRA • BRN • BSR Branch Always Branch Never Branch to subroutine
Using Subroutines - JSR • JSR 16 bit address ($0. . $FFFF, 0. . $FF) • JSR Jump to Subroutine – Push next instruction address onto stack – then jump to the specified address • RTS Return from Subroutine – Pul the top item on the stack into the Instruction Pointer - effectively jumps to the address on the top of stack. This address is the value pushed by the JSR (or BSR) instruction.
Using Subroutines - BSR • BSR relative address (PC + [-$80. . +$7 F]) • BSR Branch to Subroutine – Push next instruction address onto stack – then branch to the specified relative address • How it works: – The program counter is incremented by 2. (as usual) – The PC of the next instruction is pushed onto the stack (so the stack contains the return address) – Then the relative displacement is added to the Program counter, and execution continues from there (i. e. within the subroutine).
INTERRUPTs SWI • SWI ; Software Interrupt – Pushes all user registers (not stack pointer) – The interrupt mask bit is set • this prevent furthur interrupts being serviced immediately – Fetches the Vector Address from memory location – Jumps to the vector address from memory at FFF 6. . FFF 7
Stack contents - during interrupt service routine
INTERRUPTs RTI/WAI • RTI • WAI ; Return from Interrupt ; Wait for interrupt
INTERRUPT MASKING: • CLI ; CLear Interrupt Mask • Enable Interrupts on IRQ# line • SEI ; Set interrupt Mask • Disable Servicing of Interrupts on IRQ# line • Interrupt mask does not affect SWI (Software Interrupt) nor XIRQ.
Next Lecture Address Bus Multiplexing / Demultiplexing MCU Reset Data Bus - Tri-state
CLEAR/BIT SET • CLEAR (bit(s) = 0) & SET (bit(s) = 1) • • • CLRA CLRB M=0 A=0 B=0 • Direct bit manipulation: • BCLR Clear Bits (M) – M = M & (mask#) • BSET – M = M | (mask#) Set Bits (M)
- Continuation-passing style
- Continuation project proposal
- Continuation writing
- Narrative continuation
- Linking words continuation
- Zos jcl
- Byzantine empire flocabulary
- Consequence linking words
- Microarchitecture level
- Flocabulary shakespeare is hip hop
- Mic dejun sanatos cu ovaz in 6 variante
- Geofon mic
- Gram negative cell wall