<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Wed, 27 Oct 2004 09:53:22 +0100
From   : Richard_Talbot-Watkins@...
Subject: Re: &D00

Andrew W wrote on 25/10/2004 20:57:45:

> I read in one book that &D00-DFF was okay for user routines but on
> looking at the advanced user guide it says that the floppy disc
> controller may sometimes make use of it. Can anybody say when the
> floppy disc controller calls this area of memory and if using DFS as
> the filing system is it a safe bet just not to store anything there?

This page of memory has three uses.

&D00-&D9E is reserved for the non-maskable interrupt (NMI) handling code.
An NMI is an interrupt which can't be disabled, and an example of a device
which generates them is the disc controller.  What happens is the DFS ROM
copies the code to handle the NMIs from its own ROM into this place in RAM.
When an NMI is generated on the Beeb, it calls code at &D00, which handles
the interrupt (which might be something like 'data ready') and then returns
back to where it was.

If it is possible to guarantee that no NMIs will be generated (for example,
by 'turning off' the DFS via *TAPE or something), then it's OK to use this
area.  For safety, it's worth putting an RTI assembly instruction at &D00
itself (?&D00 = &40), so that if spurious NMIs are generated, there is a
sensible handler for them.

&D9F-&DEF are the 'extended vectors'.  These allow paged ROMs to hook into
the various 'vectors' (to allow standard OS calls such as writing
characters, reading from keyboard, or error generating, to be
reimplemented).  They contain the address of the vector handling code and
the index of the paged ROM it lives in.  These are primarily used by filing
systems to claim filing system vector entry points (so that things like
*LOAD go off to DFS ROM, instead of the default OS tape filing system).
Again, it's OK to use this space if you can /guarantee/ that these won't be
used, but then who knows which 3rd party ROM is perhaps going to claim one
or more of them?

&DF0-&DFF is used by the paged ROMs to store the location of their private
workspace.  So, once again, use at your peril.

In summary:

If you have a pure machine code program running, which is using few OS
calls, and *TAPE is selected, it is fine to use any of &D00-&DFF (most
games do).  If you are using Basic and/or other paged ROMs from within
Basic, it's probably best to avoid &D9F-&DFF.  &D00-&D9E is probably OK
provided *TAPE is selected.

Sorry for the essay :)

Rich



**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
postmaster@...

This footnote also confirms that this email message has been checked
for all known viruses.

**********************************************************************
Sony Computer Entertainment Europe
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>