hex/math_basic.fj¶
———- Basic Mathematics:
Macros¶
hex¶
hex.add_count_bits—dst[:n] += src.#on-bits (between 0->4)hex.count_bits—dst[:small_n] = x[:n].#on-bitshex.inc1—hex++(if overflows - jump to carry1; else jump to carry0)hex.inc—hex[:n]++hex.dec1—hex--(if underflows - jump to borrow1; else jump to borrow0)hex.dec—hex[:n]--hex.neg—x[:n] = -x[:n]hex.abs—x[:n]= |x[:n]|(two’s complement; the minimal value -2^(4n-1) stays itself)hex.sign_extend—sign-extendshex[:signed_n]intohex[:full_n]
hex.inc¶
hex.inc.step— One nibble of a propagating increment: incrementhexby 1; on overflow continue to the next nibble, else jump toend.
hex.dec¶
hex.dec.step— One nibble of a propagating decrement: decrementhexby 1; on underflow continue to the next nibble, else jump toend.