hex.mul.init¶

This is where the add_mul “truth” tables are.
dst[1] is zeroed after finishing this multiplication.

Signature¶

def init @ add_res, after_add, end, switch_small_table, add_carry_small_table, set_carry_small_table, clean_small_table, switch, set_carry_0, set_carry_1, clean, add_carry, clean_add, clean_carry < ..add.dst, ..tables.ret > ret, dst, add_carry_dst { ... }

Defined in hex/mul.fj — lines 94–168 (view on GitHub).

Complexity¶

  • Time: @+24 (when jumping to dst, until finished)

  • Space: 1620+@

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

Requires init¶

The following must be initialised before this macro is invoked:

  • hex.tables.init_shared & hex.add.init (or hex.init)

Output labels¶

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

  • ret — The return address. Jumps to it after finishing the add_mul flow.

  • dst — hex[:2] variable. The code calculates dst[0]*dst[1] + add_carry_dst.

  • add_carry_dst — hex variable. It’s value is added to dst[0]*dst[1], and the carry is written back to it.

Used by¶