Commit graph

12 commits

Author SHA1 Message Date
0117df02f8 Indentation correction 2025-07-03 16:57:20 +02:00
771748d2c2 Compute addresses for all ASM-OBJECTs 2025-07-03 16:56:49 +02:00
a24c5353a5 Add compilation method for IR-IF 2025-07-03 16:56:32 +02:00
3876801960 Add compilation method for IR-JUMP 2025-07-03 16:56:10 +02:00
f9d8ad13d0 Add compilation method for IR-TEST-EQUAL 2025-07-03 16:55:39 +02:00
dda08e6fe7 Make all ASM-OBJECTs hold an address, not just labels 2025-07-03 16:54:49 +02:00
f38d74db4f Correct byte length of a JSR 2025-07-03 16:54:40 +02:00
d88107a209 Add functions for handling bools during code generation 2025-07-03 16:54:22 +02:00
235ca8c07e Rename EMIT-STORE-RESULT's parameter to match similar functions 2025-07-03 10:54:21 +02:00
4899d888aa Add COMPILE-IR method for IR-RETURN 2025-07-03 10:30:14 +02:00
c41fb46457 Make assembly program representation smarter
Storing assembly instructions in a list felt nice since that lets me
just fire and forget, but if we want to properly optimize short
branches (i.e. branches that do not require a full JMP) we'll need to
be able to rewrite assembly after linking, and I feel that's best done
by making assembly instructions hold a NEXT rather than poking at a
list clumsily.

The first linking pass was also moved out to a separate function since
we may want to run the first pass twice, first after the initial
assembling and second after expanding optimistic short branches (those
that turned out to be longer branches than 127/128 bytes) into a long
branch snippet (branch with inverted condition skipping over a JMP).
2025-07-03 10:30:14 +02:00
7d55bc9ed8 Add extremely unfinished 6502 code generator to user-side compiler 2025-07-01 23:12:20 +02:00