Zero Page

Discuss all aspects of programming here. From 8-bit through to modern architectures.
User avatar
MartinB
Posts: 4555
Joined: Mon Mar 31, 2008 9:04 pm
Location: Obscurity

Zero Page

Postby MartinB » Mon May 29, 2017 10:14 pm

Does anyone know what zp locations $60-$6F (any or all of) are used for and by what in the Beeb, Master and Elk? I don't mean 3rd-party stuff but I guess considering just the mainstream Acorn rom suites. Language workspace as an answer isn't really helpful because it looks like BASIC for example doesn't use it..... (I think?)
Ta 8)

User avatar
jgharston
Posts: 2764
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield

Re: Zero Page

Postby jgharston » Mon May 29, 2017 10:36 pm

MartinB wrote:Does anyone know what zp locations $60-$6F (any or all of) are used for and by what in the Beeb, Master and Elk? I don't mean 3rd-party stuff but I guess considering just the mainstream Acorn rom suites. Language workspace as an answer isn't really helpful because it looks like BASIC for example doesn't use it..... (I think?)

It's part of the memory reserved for the currently language. If you're not the current language you must not touch it.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

User avatar
MartinB
Posts: 4555
Joined: Mon Mar 31, 2008 9:04 pm
Location: Obscurity

Re: Zero Page

Postby MartinB » Mon May 29, 2017 10:41 pm

But is it actually used by, for example, BASIC 2 ?

User avatar
sweh
Posts: 1847
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: Zero Page

Postby sweh » Mon May 29, 2017 11:30 pm

MartinB wrote:But is it actually used by, for example, BASIC 2 ?

According to the "BASIC ROM User Guide" (Adder Press), BASIC 2 doesn't use those locations (page 61 says "&4F-&8F (not used)"). That matches what we see at https://acorn.huininga.nl/pub/docs/sour ... 202/Memory as well. But that doesn't mean that other common languages (eg VIEW, VIEWSHEET, EXMON, WORDWISE) don't use them.

The question, really, is how many of the standards are you willing to break? We all break them, 'cos zero page is in short supply!

Anything below &8F is allocated to the language. The Acorn spec for BASIC says that &70-&8F won't be used (hmm, they wrote that for the B, and I assume they didn't break it on the Master), but other languages may use it. So if you're not concerned about being safe with anything except BASIC 2 then you can probably use &50->&8F with impunity. If you care about other languages than you may want to save those values (eg on the stack) and then restore them afterwards.
Rgds
Stephen

User avatar
MartinB
Posts: 4555
Joined: Mon Mar 31, 2008 9:04 pm
Location: Obscurity

Re: Zero Page

Postby MartinB » Tue May 30, 2017 10:30 am

Yeah, thanks Stephen, I'm ok with all that - I just wondered if anyone specifically knew of any users. I'm asking in relation to my I2C rom which is something I use a lot and for which I'll soon be pushing out an update. I designed it to be used in conjunction with BASIC and it can be used stand-alone but there are a majority of other roms and packages (languages or whatever) that you'd never want to use it with anyway. So, unless I can identify actual conflict, there's no way I'm going to avoid using memory that is pointlessly reserved for fictitious products by 30-year old expired guidelines when I'm producing real stuff that real people can use today.... :wink:

User avatar
lurkio
Posts: 1292
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Zero Page

Postby lurkio » Tue May 30, 2017 11:28 am

With the caveat that I don't really know what the heck I'm talking about, this disassembly of BASIC2 does include the line "AND (&63,X)":


Thought I'd mention it, just in case it happens to be relevant.

:?:

User avatar
MartinB
Posts: 4555
Joined: Mon Mar 31, 2008 9:04 pm
Location: Obscurity

Re: Zero Page

Postby MartinB » Tue May 30, 2017 12:49 pm

Thanks, I don't know what format those listings are in but towards the top of the page, it states as I've seen elsewhere that BASIC doesn't use beyond $5F in page zero. That instruction you've highlighted might perhaps be disassembled data but in any case, if I use this area, it would only be $65-$6F.

User avatar
Rich Talbot-Watkins
Posts: 1121
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca

Re: Zero Page

Postby Rich Talbot-Watkins » Tue May 30, 2017 12:55 pm

Yeah, that AND (&63,X) is just data (looks like floating point constants used by the floating point maths routines). Should really be rendered as a bunch of EQUBs rather than assembly instructions.

User avatar
MartinB
Posts: 4555
Joined: Mon Mar 31, 2008 9:04 pm
Location: Obscurity

Re: Zero Page

Postby MartinB » Tue May 30, 2017 1:56 pm

Thanks Rich 8)


Return to “programming”

Who is online

Users browsing this forum: No registered users and 1 guest