Is it safe to use the shorter zero page 6502 instruction from a machine code routine called from BASIC?
I think the C64 has special "bank" treatment with address $00.. Does the Vic?
So say for example, I make a SYS call and jump into my routine, can I safely start writing/reading any addresses from $00-FF or should I be pushing some onto the stack and retrieving them when I'm done? Perhaps there is a safe range I can use?
Zero Page addressing and BASIC
Moderator: Moderators
Re: Zero Page addressing and BASIC
The "bank" behavior you're referring to is a feature of the 6510. There are no software considerations needed on the plain 6502 for the $00-$01 addresses.
Some (most even) of the zero-page is used by the KERNAL and BASIC. A lot of it can nonetheless be used if you know what you're doing and are sure it won't conflict with the BASIC program. The $FB-$FE range is free if you only need a couple pointers.
Some (most even) of the zero-page is used by the KERNAL and BASIC. A lot of it can nonetheless be used if you know what you're doing and are sure it won't conflict with the BASIC program. The $FB-$FE range is free if you only need a couple pointers.
Re: Zero Page addressing and BASIC
Thank you. I'm only using BASIC for the SYS command to start my program to be honest. Seems to be OK so far.. I've worked my way backwards towards $f0Wilson wrote: ↑Fri Sep 29, 2023 7:28 pm The "bank" behavior you're referring to is a feature of the 6510. There are no software considerations needed on the plain 6502 for the $00-$01 addresses.
Some (most even) of the zero-page is used by the KERNAL and BASIC. A lot of it can nonetheless be used if you know what you're doing and are sure it won't conflict with the BASIC program. The $FB-$FE range is free if you only need a couple pointers.
- Mike
- Herr VC
- Posts: 4846
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Re: Zero Page addressing and BASIC
More details about zero page usage to be found in those threads:
Greetings,
Michael
Greetings,
Michael