gigatron-rom icon indicating copy to clipboard operation
gigatron-rom copied to clipboard

lcc: 4-byte longs

Open kervinck opened this issue 5 years ago • 2 comments

Longs should eventually become 4-byte. (Now they're still int-sized.)

kervinck avatar May 09 '19 20:05 kervinck

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=

kervinck avatar Jun 01 '19 22:06 kervinck

Suggesting to close this issue since glcc does this already.

lb3361 avatar Aug 25 '22 13:08 lb3361