Commit Graph

6 Commits

Author SHA1 Message Date
Paul Mathieu
2ab6b4a5a9 cc: add += and function pointers 2021-04-17 23:04:30 -07:00
Paul Mathieu
eb303641d9 cc: fix typo 2021-03-20 21:25:01 -07:00
Paul Mathieu
b70cdd13c4 Add partial support for 8-bit loads
We're big-endian.
when we have this in memory:

00 01 02 03

And we need the first byte, we load the first 16-bit word:

0x0001

The first byte is then in the upper part of the word, and requires
a right shift by 8.
So any load into an 8-bit typed container needs to shift stuff.

So far, stores from/to the stack are exempted, they always load/store
full 16-bit words.

And a few othe rminor things. Like string null terminators.
And escaped characters in character literals.

Can you believe it's spelled 'literal', with a single t?
Me neither.
2021-03-18 08:35:23 -07:00
Paul Mathieu
a3a67105eb cc: add support for structs
- now we keep track of expression type
- added '|' and '|=' operators
- implemented '->' operator
- minor cleanups
2021-03-13 15:42:39 -08:00
Paul Mathieu
0157e235e4 Add support for char litterals and <<
Also streamline cc.py to do it all:
- cpp
- cc
- as

LD is still a separate step
2021-02-18 21:20:35 -08:00
Paul Mathieu
363944d417 Initial commit 2021-02-17 13:20:30 -08:00