beautypg.com

Maxim Integrated DS4830 Optical Microcontroller User Manual

Page 198

background image

DS4830 User’s Guide

198

{L/S} JUMP src

Unconditional {Long/Short} Jump


Description:

Performs an unconditional jump as determined by the src specifier. The JUMP instruction uses an
8-bit immediate src to perform a relative jump (IP +127/-128 words). The JUMP instruction uses a
16-bit immediate src to perform an absolute JUMP 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 JUMP.
Using the optional ‘L’ prefix (i.e. LJUMP) will result in an absolute long jump and use of the
PFX[0] register. Using the optional ‘S’ prefix (i.e. SJUMP) will attempt to generate a relative short
jump, but will be flagged by the assembler if the destination is out or range. Specifying an
internal register src (no matter whether 8-bit or 16-bit) always produces an absolute JUMP to a
16-bit address, thus

the ‘L’ and ‘S’ prefixes should not be used. The PFX[n] register value is used

to supply the high address byte when an 8-bit register src is specified.


Status Flags:

None


Operation:

IP  src

Absolute JUMP

IP  IP + src

Relative JUMP


Encoding:

15

0

f000

1100

ssss

ssss


Example(s):

JUMP label1

; relative jump to label1 (must be within range

;

IP +127/-128 words)

JUMP label1

; absolute jump to label1= 0400h
; MOVE PFX[0], #04h

; JUMP #00h

JUMP DP[0]

; absolute jump to addr16 DP[0]

JUMP M0[0]

; assume M0[0] is an 8-bit register

; absolute jump to addr16

; high(addr16)=00h (PFX[0])

; low (addr16)=M0[0]


LJUMP label1

; label=0120h and is relative to this instruction

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

; MOVE PFX[0], #01h

; JUMP #20h

SJUMP label1

; relative offset for label1 calculated and used

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

SJUMP #10h

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