5 ms·
It'd be nice if compilers were smarter about using the stack (looking at you, cc65) -- you could have "big" stack frames and little stack frames, pass variables
by sehugg 8y ago
It'd be nice if compilers were smarter about using the stack (looking at you, cc65) -- you could have "big" stack frames and little stack frames, pass variables in registers, push values as 8-bit instead of upcast to 16-bit, convert locals to static, etc.
I'm going to take a look at yet another alternative 6502 language called C02 now: https://github.com/RevCurtisP/C02 https://github.com/RevCurtisP/C02
- classichasclass 8y agoThe big problem with passing in registers is you only have three, and only one of them can do most of the work. Maybe zero page could help there for a fast call convention, but either way you're probably going to have to spill to memory, which fortunately is not a big deal on the 65xx.