I remember seeing that the "zero page" instructions were all significantly faster and thinking "This Changes EVERYTHING!"
As if I could rewrite my code to run in only 256 bytes of working memory.
As if I could rewrite my code to run in only 256 bytes of working memory.
You would save a byte every time you had to load/save a value from zero page into/from a register.
BBC Basic puts the work area for maths functions in the zero page.
In particular, Basic puts the whole "get next byte" routine there at $0073. It is self-modifying code where the address of the next program byte is the operand of an LDA instruction. Placing the whole routine in zero page saves enough cycles on incrementing the next program byte that it's worth spending 5% of the whole zero page on it.