XCALL pma,*,ARPn
6-375
XCALL pma,*,ARPn C2 x LP Source-Compatible Function Call
SYNTAX OPTIONS OPCODE OBJMODE RPT CYC
XCALL pma,*,ARPn 0011 1110 0110 1nnn
CCCC CCCC CCCC CCCC
1 − 4
Operands pma 16-bit immediate program-memory address,
can only access high 64K of program space range (0x3F0000 to 0x3FFFFF)
ARPn 3-bit auxiliary register pointer (ARP0 to ARP7)
Description Unconditional call with ARP modification. The lower 16 bits of the return
address are pushed onto the software stack. Then, the lower 16 bits of the
PC are loaded with the 16-bit immediate ”pma” value and the upper 6 bits of
the PC are forced to 0x3F. Then, the 3-bit ARP pointer will be set to the
”ARPn” field value:
temp(21:0) = PC + 1;
[SP] = temp(15:0);
SP = SP + 1;
PC = 0x3F:pma;
ARP = n;
Note: This instruction can only transfer program control to a location located in the upper 64K
range of program space (0x3F0000 to 0x3FFFFF). To return from a call made by
XCALL, the XRETC instruction must be used.
Flags and
Modes
None
Repeat This instruction is not repeatable. If this instruction follows the RPT
instruction, it resets the repeat counter (RPTC) and executes only once.
Example
; Call FuncA and set ARP. Load ACC with pointer pointed to by ARP.
; This example only works for code located in upper 64K of program
; space:
XCALL FuncA,*,ARP1 ; Call FuncA with ARP pointing to XAR1
.
FuncA: ; Function A:
MOVL ACC,* ; Load ACC with contents pointed to
; by XAR(ARP)
XRETC UNC ; Return unconditionally