Please read this page from the main YASEP interface
version 2013-07-20

HALT : HALT the core

This instruction halts the running program. It is also used in all the code examples to stop the simulator in a graceful way (INV could stop it to signal an error but it is not recommended).

If the current thread has the rights to do so, the processor is halted and hibernates until is is woken up by an external interrupt. Otherwise, control is yielded to the operating system kernel. Execution continues at the instruction that follows the HALT instruction.

No operand is used, the value of any parameter (snd, si4 or imm16) is ignored. Long forms make no sense and conditions are ignored. No data is written to the register set and this instruction can't be aborted by a condition.

The optional Imm4 is only used for reporting purposes, the operating system or the simulator should fetch the provided number explicitly in the instruction (it's more practical and compact than reading in a given register, as was done before).

In particular, two values are recognised by the simulator to check assertion and end a simulation with a "go/no go" information:

; Simulation or test successful
HALT 1

; Simulation, test or assertion failure
HALT -1