Date : Mon, 20 May 1996 15:34:53 +0100 (BST)
From : James Bonfield <jkb@...>
Subject: Re: Writing sideways ROM software
Steven Flintham wrote:
>I'm writing a sideways ROM and I'm having trouble with using zero page.
>Inevitably my code needs a few zero page locations to work with and I
>don't know where I can use which is 'safe'. Obviously you can mess
>around stacking the locations you intend to use first, but this is
>extremely messy, especially when you can have more than one exit from a
>routine (such as when an error occurs).
I think it ought to depend on whether or not you wish the information to be
permanently resident or only for the duration of that *COMMAND.
In my rom code I've always made use of &70-&8F for temporary stuff, but never
stored permanent data there as many other people also make use of exactly the
same memory for there own * commands.
You can also consider using the end of the stack - eg &100 onwards or
something. I've seen a number of things do this and infact I've done it
myself. It's a particularly useful place to plonk code for reading from
sideways RAM, which you can't do without an enormous overhead when running
from a sideways RAM bank yourself. Obviously this can only be done when the
stack pointer is in a appropriate location (nearly always).
I guess if you're _really_ paranoid, the stacking and unstacking is the only
way. This is trivial and can be stuck in a routine called by all your
functions if you desire. However you have to consider what happens to those
other interrupt driven chunks of software... ;-)
To summarise: there's no standard way.
Good luck,
James
--
James Bonfield (jkb@... ) Tel: 01223 402499 Fax: 01223 412282
Medical Research Council - Laboratory of Molecular Biology,
Hills Road, Cambridge, CB2 2QH, England.
Also see beeb bits at ftp://ftp.mrc-lmb.cam.ac.uk/jkb/beeb