5 ms·
The zero page is very small, I don't think this was done that much. You'd constantly be writing large gobs of stuff into it and that'd be very slow. That said,
by stormbrew 5y ago
The zero page is very small, I don't think this was done that much. You'd constantly be writing large gobs of stuff into it and that'd be very slow.
That said, the stack was used as a fast indirect jump address location pretty frequently, as described here, essentially abusing the fact that PHS and RTS are 1 byte instructions: http://www.6502.org/tutorials/6502opcodes.html#RTS http://www.6502.org/tutorials/6502opcodes.html#RTS
And really since basically all PC-modifying instructions operate on either relative (b*), absolute-indirect (jmp), absolute (jmp, jsr), or stack-indirect (rts, rti) there's no special benefit you get from having code in the zero page anyways afaik.
- a1369209993 5y ago> there's no special benefit you get from having code in the zero page anyways afaik. You save one cycle off each instruction that modifies another instruction, which can important for inner loops. See eg http://www.linusakesson.net/programming/gcr-decoding/index.php http://www.linusakesson.net/programming/gcr-decoding/index.p..., although that's a disk-induced realtime requirement, rather than hblank/beam-induced.
- stormbrew 5y agoah ok yeah that makes sense. If you're directly modifying the instructions then yeah there's a big benefit to the zero page. I think I misread the GP post and missed the self-modifying context somehow. Thanks for clarifying :)
- bonzini 5y agoFor an example, search for 0073 or CHRGET at https://www.pagetable.com/c64ref/c64disasm/ https://www.pagetable.com/c64ref/c64disasm/