hex/math_basic.fjΒΆ

β€”β€”β€”- Basic Mathmatics:

View source on GitHub

MacrosΒΆ

hexΒΆ

  • hex.add_count_bits β€” (n=2 when operating on 16-255 bit-numbers)

  • hex.count_bits β€” dst[:small_n] = x[:n].#on-bits

  • hex.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.sign_extend β€” sign-extends hex[:signed_n] into hex[:full_n]

hex.incΒΆ

hex.decΒΆ