Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lcc: 4-byte longs #67

Open
kervinck opened this issue May 9, 2019 · 2 comments
Open

lcc: 4-byte longs #67

kervinck opened this issue May 9, 2019 · 2 comments

Comments

@kervinck
Copy link
Owner

kervinck commented May 9, 2019

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

@kervinck
Copy link
Owner Author

kervinck commented Jun 1, 2019

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=

@lb3361
Copy link
Contributor

lb3361 commented Aug 25, 2022

Suggesting to close this issue since glcc does this already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants