Execution Control

Execution control instructions directly affect the state of the currently running program.

These are native CPU instructions. They may terminate execution, report a fatal program error, or explicitly perform no operation.

For control flow within a running program, including branches and subroutines, see Branching.

Program Termination

HALT — Halt Program

HALT

Immediately terminates the currently running program and returns control to the shell.

Operands

This instruction takes no operands.

Modified locations

Location Description
pc Set to 0.

Examples

Stop execution normally:

HALT

Notes

HALT indicates normal program termination.

No further instructions from the current program are executed.

Control returns to the shell.

ERROR — Abort with Error

ERROR <message>

Immediately terminates the currently running program with an error and returns control to the shell.

HCF is an alias for ERROR.

Operands

Position Name Type Description
1 message String value Error message to report.

Modified locations

Location Description
pc Set to 0.
er Set to the supplied error message.

Examples

Terminate with an error:

ERROR "INVALID INPUT"

Using the HCF alias:

HCF "OH NO"

Notes

ERROR sets er to the supplied message before terminating the program.

No further instructions from the current program are executed.

Control returns to the shell.

The terminated program cannot inspect or handle the resulting error.

HCF behaves identically to ERROR.

No Operation

PASS — No Operation

PASS

Performs no operation and continues execution normally.

NOP is an alias for PASS.

Operands

This instruction takes no operands.

Modified locations

This instruction does not modify any locations.

Examples

Explicitly do nothing:

PASS

Using the NOP alias:

NOP

Notes

PASS has no effect on memory, registers, or program state.

Execution continues normally with the next instruction.

PASS may be useful as a placeholder or as the target of a label that intentionally performs no work.

NOP behaves identically to PASS.