SX Embedded Controller Instruction

CALL addr

Description: Call TO address, clear bit 8
Operation: STACK[SP++] = PC; PC = ( page << 9 ) + addr
Flags affected: none
Registers affected: PC
Sources referenced: -
Cycles: 1 *
Opcode:
Details: SX Users Manual page # 76
Microchip PIC syntax:
Notes:

Since the call can only be to an address in the first half of each page of memory, how about defining a macro that compiles a (dual) register load of the address of the routine and then always calls a single subroutine which is placed at a low memory address which then jumps to the address specified in the registers? The return from the subroutine jumped to will be to the original call. This is very slow compaired to the direct subroutine call, but will allow the use of the upper half page of memory in a program with a lot of subroutines.