hex.pointers.ptr_init¶
NOTE: must be placed just after the startup, so that the read_ptr_byte_table will be in address 256.
Initializes the global opcodes and pointer-copies required for the pointers macros.
Initializes the read-byte-handling table and the result/return variables to the read-byte table.
`After jumping into ptr_jump, it's xored with the read byte.`
@output_param ret_after_read_byte: The return address. Jumps to it after finishing reading a byte.
Signature¶
def ptr_init @ read_ptr_byte_table > to_flip, to_jump, to_flip_var, to_jump_var, read_byte, ret_after_read_byte { ... }
Defined in hex/pointers/basic_pointers.fj — lines 17–43 (view on GitHub).
Complexity¶
Space:
w/2+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.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.