Commit graph

2 commits

Author SHA1 Message Date
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