hex.pointers.ptr_init

One-time initialisation of the pointer dispatch infrastructure: global opcodes, pointer-copies, and the read-byte handling table. Must be called once at program start, immediately after stl.startup so the read-byte table lands at address 256. Bundled into stl.startup_and_init_all.

Signature

def ptr_init @ read_ptr_byte_table > to_flip, to_jump, to_flip_var, to_jump_var, read_byte, ret_after_read_byte, nth_ptr { ... }

Defined in hex/pointers/basic_pointers.fj — lines 17–47 (view on GitHub).

Complexity

  • Time: O(1)

  • Space: 0.75w+261

See the complexity glossary for what @, w, dw, dbit, n mean.

Output labels

This macro exposes labels into the caller’s scope via >:

  • read_byte — hex[:2] variable. You want to zero it before jumping into ptr_jump.

  • ret_after_read_byte — The return address. Jumps to it after finishing reading a byte.

  • to_flip — address of opcode that holds a flipping address in its first word. jumping into it will flip wanted bit.

  • to_flip_var — the hex-vector (pointer) that also holds the flipping address.

  • to_jump — address of opcode that holds a jumping address in its second word. jumping into it will jump to the wanted address.

  • to_jump_var — the hex-vector (pointer) that also holds the jumping address.

Source

Depends on

Used by

Example uses


Next: hex.pointers.set_jump_pointer