gigatron-rom
gigatron-rom copied to clipboard
lcc: 4-byte longs
Longs should eventually become 4-byte. (Now they're still int-sized.)
Some code for adding two 32-bit numbers, each composed of a L and H word. In GCL notation:
{ long3 = long1 + long2 }
{ long1: L1 H1 }
{ long2: L2 H2 }
{ long3: L3 H3 }
L1 L2+ L3=
L1 L2^ [if<0 L3^ else L1] { carry in MSB }
[if<0 1 else 0] { transfer carry to LSB }
H1+ H2+ H3=
Suggesting to close this issue since glcc does this already.