itszor / gcc-6502-bits

Build tools, tiny C library, etc. for gcc-6502 port.
61 stars 17 forks source link

is there a way to define a pointer to reside fixed in Zeropage? #10

Open physiker66 opened 4 years ago

physiker66 commented 4 years ago

The compiler should then convert access to "indirect" opcodes

Indirect,X LDA ($44,X) $A1 2 6 Indirect,Y LDA ($44),Y $B1 2 5+

itszor commented 4 years ago

Hi! In theory there is, using the address space extension (as supported on AVR). You can define a zero-page pointer like this (at the top-level, i.e. as a global): char * __zp myptr; Read as "zero page pointer to (non-zero page) char". Unfortunately IIRC support is completely broken at the moment. I should try to fix it some time!

physiker66 commented 4 years ago

thank you!

On Thu, Jul 30, 2020 at 3:37 AM itszor notifications@github.com wrote:

Hi! In theory there is, using the address space extension (as supported on AVR). You can define a zero-page pointer like this (at the top-level, i.e. as a global): char * __zp myptr; Read as "zero page pointer to (non-zero page) char". Unfortunately IIRC support is completely broken at the moment. I should try to fix it some time!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/itszor/gcc-6502-bits/issues/10#issuecomment-666261341, or unsubscribe https://github.com/notifications/unsubscribe-auth/APO5OULQKCTRLQKSEESWHVTR6E5MXANCNFSM4PAXG62A .