Kroc / v80

A minimal Z80 assembler, running on Z80. Useful for bootstrapping bigger projects.
MIT License
22 stars 2 forks source link

Reduce heap usage #11

Open Kroc opened 5 days ago

Kroc commented 5 days ago

Both in general, and specifically when assembling v80, which uses roughly 25KB of heap space. This would make assembling v80 a major squeeze on even a 48K system, if even possible. v80 is 8KB + 256B buffers, + 256B stack. v80's heap usage whilst assembling itself needs to be reduced to at least 20KB. There are general strategies, such as just using less labels, but this issue will focus on code changes that can help.

Kroc commented 3 days ago

Not heap related, but I don't have a good place to put this idea yet -- there's a lot of once-off initialisation routines we could move into the code-segment, so that they get overwritten when assembly begins. Things like parameter parsing, the no-parameters help message. The most difficult part is simply deciding how best to split the files and include them in such a way that's going to scale for multiple supported platforms/OSes besides just CP/M.