Index | PAL Intro | Commands | Registers | Indices | Stack | Macros | Classes | Attributes | Errors


Manual Reference Pages  - reg_jmpeq (5)

NAME

reg/jmpeq - Register comparison and branching

CONTENTS

Synopsis
Description
Error Handling
Examples
See Also
Author

SYNOPSIS

reg/jmpeq &[.codeptr], read1, read2
reg/jmpne &[.codeptr], read1, read2
reg/jmplt &[.codeptr], read1, read2
reg/jmple &[.codeptr], read1, read2
reg/jmpgt &[.codeptr], read1, read2
reg/jmpge &[.codeptr], read1, read2

reg/jsreq &[.codeptr], read1, read2
reg/jsrne &[.codeptr], read1, read2
reg/jsrlt &[.codeptr], read1, read2
reg/jsrle &[.codeptr], read1, read2
reg/jsrgt &[.codeptr], read1, read2
reg/jsrge &[.codeptr], read1, read2

reg/jmpeq &[.codeptr]
reg/jmpne &[.codeptr]
reg/jmplt &[.codeptr]
reg/jmple &[.codeptr]
reg/jmpgt &[.codeptr]
reg/jmpge &[.codeptr]

reg/jsreq &[.codeptr]
reg/jsrne &[.codeptr]
reg/jsrlt &[.codeptr]
reg/jsrle &[.codeptr]
reg/jsrgt &[.codeptr]
reg/jsrge &[.codeptr]

DESCRIPTION

In the three-argument form, compares the arguments read1 and read2 according to the same testing rules as the reg/cmp instruction, and jumps (jmp) or branches (jsr) to codeptr if the arguments are equal (eq), not equal (ne), less than (lt), less than or equal to (le), greater than (gt), or greater than or equal to (ge). Does not change the SCMP or SFLG registers.

While read1 and read2 can be any type of argument, codeptr is a read argument that must point to a code label.

In the single argument form, tests the current value of the SCMP register and branches accordingly.

When an instruction from the jmp family is used, if the condition is met the result is the same as with local/jmp. When an instruction from the jsr family is used, if the condition is met the result is the same as with local/jsr.

ERROR HANDLING

A runtime error occurs if the first argument is not a code pointer, or if an object referenced in one of the comparison arguments does not exist.

EXAMPLES

reg/jsreq &[.true], P0, P1
  Branches to .true if registers P0 and P1 are equal.
reg/jmpne &[.loop], PEEK, LOCK
  Jumps to .loop if next item on program stack is not a lock.
reg/jmpgt P10, A, #255
  Jumps to the code pointer in register P10 if the Accumulator holds a value greater than 255.
reg/jmpeq &[.next]
  Jumps to .next if the result of the last test was equal according to the current value of the SCMP register.

SEE ALSO

pal_commands(5), pal_registers(5), pal_indices(5), local_jmp(5), local_jsr(5), reg_cmp(5),
PROSE Assembly Language at prose.sourceforge.net.

AUTHOR

Copyright (c) 2002-2018 Mark R. Bannister <cambridge@users.sourceforge.net>.

This is free software and can be downloaded from prose.sourceforge.net; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


PAL 1.0 reg_jmpeq (5) 16 January 2018
Generated by manServer 1.07 from man5/reg_jmpeq.5 using man macros.