Program Control Instructions


 

The execution of a PL/B program begins at the first executable instruction. It continues sequentially until a Program Control Instruction alters the sequence, the program terminates or it is interrupted to execute another program.

 

Exceptions

Describes program exception handling.

FUNCTIONs

Provides an overview of functions.

Trappable Events

Describes trappable events.

BRANCH

GOTO one of several execution labels based on an index.

BRANCHF

GOTO one of several execution labels based on a function key.

BREAK/CONTINUE

Exit the inner most LOOP/REPEAT structure.

CACHELIST/CACHELISTEND

Control caching of PLFORMs.

CALL/CALLS

Save current execution address and call an execution label.

CHAIN

Terminate currently executing program and start another program.

CLEAREVENT

Discard the next event on the event queue.

DEBUG

Enter the debugger if debugging is active.

DSCNCT

Perform a CHAIN to the ANSWER program.

ENTRY

Designate the end of function parameters.

EVENTCHECK

Check to determine if any objects have been acted upon.

EVENTCLEAR

Clear an event from the event queue.

EVENTCOUNT

Retrieve the number of events currently on the event queue.

EVENTINFO

Retrieve information regardig an event on the event queue.

EVENTQUEUE

Manipulate the event queue.

EVENTWAIT

Wait on an object event to occur.

EXCEPTCHECK

Test for an exising exception handler.

EXCEPTCLEAR

Clear an exception handler.

EXCEPTDISABLE

Suspend an exception handler.

EXCEPTDO

Trigger an exception handler.

EXCEPTENABLE

Restore an exception handler.

EXCEPTSET

Set an exception handler.

FLAGRESTORE

Restore the flags from a variable.

FLAGSAVE

Save the flags in a variable.

FOR

Structured logic for looping.

FRESTORE

Restore the flags from an internal flag stack.

FSAVE

Save the flags in an internal flag stack.

FUNCTION

Defines a function.

FUNCTIONEND

End a function definition.

GOTO

Go to an execution label.

IF/ENDIF

Structured logic for testing that also allows ELSE and ELSE IF instructions.

LFUNCTION

Defines a local function.

LOADMOD

Load separately compiled subroutine.

LOOP/UNTIL/WHILE/REPEAT

Structured logic for looping that also allows UNTIL and WHILE instructions.

LROUTINE

Local routine that may be called with parameters.

NOBREAK

Continue execution into next CASE, WHEN, or DEFAULT statement.

NORETURN

Discard return address from last CALL, TRAP, or EVENTWAIT instruction.

PAUSE

Wait for a period.

PERFORM

CALL one of several execution labels based on an index.

PERFORMF

CALL one of several execution labels based on a function key.

PROCEDURE

External routine that may be called with parameters.

RETCOUNT

Retrieve the number of return address on the return stack.

RETURN

Return execution to the next address on the return stack.

ROUTINE

External routine that may be called with parameters.

SELECT

Define a multi-way branch.

SETFLAG

Set the state of the condition code and function key flags.

STOP/DETACH

Stop program execution. Return to MASTER program or to the OS.

SWITCH

Define a multi-way branch.

TRAP

Set an event trap to an address. Call the address if the event occurs.

TRAPCLR

Clear one or more event traps.

TRAPRESTORE

Clear and restore saved traps.

TRAPSAVE

Save all traps that are set.

TRAPSIZE

Returns the size of the variable required for the TRAPSAVE instruction.

 

Some Program Control Instructions have the ability to alter the flow conditionally based upon Flags. These flags are set to TRUE or FALSE and are checked as follows:

 

 

GOTO

LABEL IF OVER

 

GOTO

LABELX IF NOT EOS

 

PL/B supports the conventional method of program control, (GOTO, CALL, RETURN) and structured code (IF, ELSE, ENDIF, LOOP, REPEAT, etc.). These two types may be intermixed within the same program.

 



PL/B Language Reference Exceptions