hex/cond_jumps.fj

———- Conditional Jump

View source on GitHub

Macros

hex

  • hex.if_flags — Jumps to l1 if bit hex of the 16-bit flags constant is set, else l0.

  • hex.if/3 — if hex==0 goto l0, else goto l1.

  • hex.if0/2 — if hex==0 goto l0, else continue.

  • hex.if1/2 — if hex!=0 goto l1, else continue.

  • hex.if/4 — if hex[:n]==0 goto l0, else goto l1.

  • hex.if0/3 — if hex[:n]==0 goto l0, else continue.

  • hex.if1/3 — if hex[:n]!=0 goto l1, else continue.

  • hex.sign — if number[:n] < 0 jump to neg, else jump to zpos (Zero POSitive).

  • hex.cmp/5 — Three-way compare on hex nibbles: jumps to lt if a<b, eq if a==b, gt if a>b. a, b are hexes; lt, eq, gt are addresses.

  • hex.cmp/6 — Three-way compare on n-nibble hex vectors: jumps to lt if a[:n]<b[:n], eq if equal, gt if a[:n]>b[:n].

  • hex.mindst[:n] = min(a[:n], b[:n])   (unsigned)

  • hex.maxdst[:n] = max(a[:n], b[:n])   (unsigned)

  • hex.scmp — Three-way SIGNED compare (two’s complement) on n-nibble hex vectors: jumps to lt if a[:n]<b[:n], eq if equal, gt if a[:n]>b[:n]. …

hex.cmp

  • hex.cmp.cmp_eq_next — 1 step of multi-nibble hex.cmp.

  • hex.cmp.init — Its 8-bits are expected to be {src&lt;<4 | dst} at the jump to it (for the src,dst hexes of the cmp operation).