Previous Topic

Next Topic

Book Contents

Book Index

GoTo, GoSub and related instructions

There are a number of instructions for making program flow break off and jump to another part of your program. Nearly all of them are conditional, meaning you can test some condition and jump one way or another depending on the outcome.

There is also a rich set of conditional subroutine call (GoSub) and Return instructions. A GoSub instruction differs from a GoTo in that it saves away the address that it comes from, so it is possible to later do a Return and get back again. Subroutines can be nested to a depth that depends on the language dialect, meaning there is a limit to how far you can go having one subroutine call another, because there is a limit to how much memory is dedicated to remembering return addresses.

In This Section

Branch

BranchJ [D>=16]

BranchM mm+

BranchR

DecMGoIfNZ mm*+,LLLL

DecMRetIfNZ mm+

DecMRetIfZ mm+

fGoIfNeg LLLL

fGoIfNZ LLLL

fGoIfPos LLLL

fGoIfWGEQ LLLL [D>=23]

fGoIfWGTQ LLLL [D>=23]

fGoIfWLEQ LLLL [D>=23]

fGoIfWLTQ LLLL [D>=23]

fGoIfZ LLLL

GoIfF LLLL

GoIfInK ii,LLLL

GoIfInOff ii,LLLL

GoIfInOn ii,LLLL

GoIfINZ LLLL

GoIfIZ LLLL

GoIfMEQ mm+,nn,LLLL

GoIfMGE mm+,nn,LLLL

GoIfMGT mm+,nn,LLLL

GoIfMLE mm+,nn,LLLL

GoIfMLT mm+,nn,LLLL

GoIfMNE mm+,nn,LLLL

GoIfMNZ mm+,LLLL

GoIfMZ mm+,LLLL

GoIfNZ LLLL

GoIfT LLLL

GoIfUF n,m,line

GoIfUT n,m,line

GoIfXEQ nn,LLLL

GoIfXGE nn,LLLL

GoIfXGT nn,LLLL

GoIfXLE nn,LLLL

GoIfXLT nn,LLLL

GoIfXNE nn,LLLL

GoIfZ LLLL

GoSub LLLL

GoSubIfF LLLL

GoSubIfMNZ mm+,LLLL

GoSubIfMZ mm+,LLLL

GoSubIfNZ LLLL

GoSubIfT LLLL

GoSubIfXEQ nn,LLLL

GoSubIfXGE nn,LLLL

GoSubIfXGT nn,LLLL

GoSubIfXLE nn,LLLL

GoSubIfXLT nn,LLLL

GoSubIfXNE nn,LLLL

GoSubIfZ LLLL

GoTo LLLL

OBCA_GoIfNoRdg line

OBCA_GoIfRdg line

OBCA_GoSubIfRdg line

OBLCD_GoIfBusy line

OBLCD_GoIfIdle line

RetIfF

RetIfMNZ mm+

RetIfMZ mm+

RetIfNZ

RetIfT

RetIfZ

Return

GoIfRTCEvent e+,LLLL [D>=16]

Suspend mm*+ [D>=12/15]