JSR

JSR - Jump to Subroutine ;flags()

The return address is the address of the next instruction after the JSR. The return address if first pushed on the stack, LOW byte then HIGH byte.

;push PCL ;SP <= SP - 1

;push PCH ;SP <= SP - 1

The following then happens depending upon the addressing mode:

JSR opr ;PC <= opr ;(DIR) 8 bit direct

JSR opr ;PC <= opr ;(EXT) 16 bit extended

JSR ,X ;PC <= X ;(IX) indexed no offset

JSR opr,X ;PC <= X + opr ;(IX1) indexed w/8 bit offset

JSR opr,X ;PC <= X + opr ;(IX2) indexed w/16 bit offset