Safe page zero addresses

Basic and Machine Language

Moderator: Moderators

Post Reply
Vic40
Vic 20 Newbie
Posts: 18
Joined: Fri Jan 04, 2008 8:13 am

Safe page zero addresses

Post by Vic40 »

By it's good to have the forum back - been a bit lost over the last week without being able to call upon help.

Just wondering if there are any further page zero addresses that can safely be used apart from the two ($fb and $fd) which are listed as free in the Vic20 Programmers Reference Guide. I will be calling machine code routines from a Basic program which I guess will restrict the options just a little.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Actually those are four bytes: $FB, $FC, $FD, $FE. In theory $FF is also available, although some routines from Basic may use it.

I don't know for sure, but you could try to use the bytes för RS232 data transfer: $F7, $F8, $F9, $FA.

I'd avoid messing with FAC, AFAC, temporary storage for those and other utility/index locations in case Basic uses them.
Anders Carlsson

Image Image Image Image Image
User avatar
Mike
Herr VC
Posts: 4853
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

There some ZP addresses shared between Tape/RS232 operations.

These are: $A7 - $AB, $B4 - $B6, $BD.

They are re-initialised (and thus overwritten) when you start a tape operation (like LOAD, SAVE, or OPEN) or a RS232 transfer. BASIC doesn't rely upon finding old values there, so they're free as long as there are no active Tape/RS232 operations.

Greetings,

Michael
Vic40
Vic 20 Newbie
Posts: 18
Joined: Fri Jan 04, 2008 8:13 am

Post by Vic40 »

Thanks to both of you for the "pointers".

My program won't be using any tape/RS232 operations so I should be safe to use them.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

In the sticky ROM calls thread, there was some discussion about ZP addresses too, but it was based upon pure machine language programs, which addresses would be possible to reuse and possibly exit to Basic afterwards. In your case it is a little more restricted.
Anders Carlsson

Image Image Image Image Image
Post Reply