Skip to main content

WITH

Enable a special behavior for the subsequent instruction.

OpcodeBytesCyclesForm
$0111with carry
$0111with euclid
Control flagOutput
with (WF)This flag is always 1.

Notes

  • Sets the with flag (WF) for the next instruction only. It will be automatically cleared afterwards.

  • For clarity, the assembly syntax uses with carry or with euclid according to the subsequent instruction, even though they share the same opcode.

  • If the subsequent instruction is add, subtract, or compare: with carry includes the carry flag (CF) in the calculation. See the instruction documentation for details.

  • If the subsequent instruction is a divide: with euclid requests Euclidean integer division instead of truncated division. See the instruction documentation for details.

  • If the subsequent instruction is not one of the documented forms, the behavior is undefined apart from clearing the with flag (WF). Generally it has no effect; however, future versions may introduce additional behavior.

  • Unlike all other instructions, with does not clear the skip flag (SF). This allows the pair of instructions to be skipped, for example:

    compare i:0, 3
    if zero # divide only if i:0 equals 3
    with euclid
    divide i:4, i:8