68HC05 Instruction Set — Part 8
JMP jump to specified address JSR jump to subroutine and save return address on stack RTS pull address from stack and return from subroutine RTI pull registers from stack and return from interrupt
CLC clear the condition code register carry bit SEC set the condition code register carry bit CLI clear the condition code register interrupt mask bit SEI set the condition code register interrupt mask bit SWI software initiated interrupt RSP reset the stack pointer to $00FF NOP no operation WAIT enable interrupts and halt the CPU STOP enable interrupts and stop the oscillator
Notes:
JMP and JSR are analogous to BRA and BSR and allow changes in program flow to be made with 16-bit addresses or index register offsets.
RTS is used to return from a BSR or JSR subroutine call. It pulls only a return address from the stack. RTI is used to return from an interrupt service routine and pulls the condition code register, accumulator, and index register, as well as a return address, from the stack.
The SWI instruction allows an interrupt to be taken under software control, regardless of the state of the condition code register interrupt mask (I) bit. SWI stacks a return address and all of the CPU registers, and jumps to an address specified by its own interrupt vector.
WAIT and STOP allow a 68HC05 device two enter one of two low power modes. WAIT clears the interrupt mask bit (I = 0) and halts the CPU. This allows interrupts from on-chip peripherals or external interrupt pins (e.g. IRQ) to re-start execution.
STOP also clears the I bit, but it halts the entire MCU by stopping the clock oscillator. This is the lowest power mode available on a 68HC05 and only interrupts from dedicated external interrupt pins, like IRQ, can re-start execution.