Maxim Integrated MAX31782 User Manual

Page 188

Advertising
background image





MaximIntegrated  20-5

MAX31782 User’s Guide

Revision 0; 8/11

{L/S}CALLsrc

{Long/Short}CalltoSubroutine

Description:

Performs a call to the subroutine destination specified by src . The CALL instruction uses an 8-bit
immediate src to perform a relative short call (IP +127/-128 words) . The CALL instruction uses a
16-bit immediate src to perform an absolute long CALL to the specified 16-bit address . The PFX[0]
register is used to supply the high byte of a 16-bit immediate address for the absolute long CALL .
Using the optional ‘L’ prefix (i .e ., LCALL) results in an absolute long call and use of the PFX[0]
register . Using the optional ‘S’ prefix (i .e ., SCALL) attempts to generate a relative short call, but is
flagged by the assembler if the destination is out of range . Specifying an internal register src always
produces an absolute CALL to a 16-bit address, thus the ‘L’ and ‘S’ prefixes should not be used .

StatusFlags:

None

Operation:

@++SP

← IP + 1

PUSH

IP

← src

Absolute CALL

IP

← IP + src

Relative CALL

Encoding:

15

0

f011

1101

ssss

ssss

Example(s):

CALL label1

; relative call to label1 (must be within IP +127/ -

; 128 address range)

CALL label1

; absolute call to label1 = 0120h

; MOVE PFX[0], #01h

; CALL #20h .

CALL DP[0]

; DP[0] holds 16-bit address of subroutine

LCALL label1

; label=0120h and is relative to this instruction

; absolute call is forced by use of ‘L’ prefix

; MOVE PFX[0], #01h

; CALL #20h

SCALL label1

; relative offset for label1 calculated and used

; if label1 is not relative, assembler will generate an error

SCALL #10h

; relative offset of #10h is used directly by the CALL

Advertising