Mike wrote:In the end, we still get all our code assembled, no?
That's probably also a matter of programming style.chysn wrote:Although I'm starting to wonder how....
I want most of my programs/tools for the VIC-20 to cooperate with BASIC and KERNAL, therefore I tend to minimize zeropage usage. It is rather unlikely that I would use bigger ranges in the ZP to operate upon array type structures. I declare zeropage addresses explicitly, with the odd "+1" or "-1" as they are used in the code.
In the other thread, I use $0100 as base to address into the stack, which wouldn't be optimized and which is guaranteed to have the same semantics regarding the X-indexed absolute addressing mode as the hypothetical "$0100,S" addressing mode of the stack instructions (or the interrupt behaviour) of the 6502.
When I use a blank address for self-modifying code, I usually take care to make this $FFFF or the like, as in:
Code: Select all
.Store
STA $FFFF
INC Store+1
BNE Store_00
INC Store+2
.Store_00
RTS
About the only time where I explicitly used wraparound in zeropage was for a small memory display program you find here, note the LDA $80,X instruction in the ".Print" subroutine.