by devit · 5y ago · 0 comments
If you want more than 256 bytes of local variables you will have to setup more offset copies of the stack pointer in the zero page first.
Also most variables can be stored in the zeropage as caller-saved pseudo-registers and only spilled on the stack as needed.
If you don't have threads or recursion then assigning fixed addresses is even better.
It may however overall be much more space-efficient to implement a bytecode emulator for a proper 32/64-bit instruction set instead of trying to generate 6502 code.