Date : Mon, 10 Apr 2006 02:58:58 +0100
From : Rob <robert@...>
Subject: Re: [Fwd: Re: Contikit anyone?]
At 22:41 09/04/2006, dominic beesley wrote:
>The trouble is getting calling between different ROMS to work. I don't
>think my original posting was clear. I need to call between several
>different roms and each rom needs to call the OS. What is the correct
>way of making sure the OS reselects my ROM? I've tried poking &f4 but
>the OS seems to ignore this and returns back into the ROM I've got
>selected as the language.
OK..
&f4 is (or should be) always a copy of what the OS thinks is the
"current" ROM, i.e. the last value written to ROMSEL (which is
write-only) but only on the B's - I think the Master stores this
elsewhere. You shouldn't manipulate this directly as you can really
confuse things.
I suspect you may have to designate one ROM as the language, which is
the main one to have control, and have the others as service ROMs,
offering subroutines via a service call (called via OSBYTE &8F from
the language). This way you don't actually need to know what socket
a service ROM is in, or even which ROM any particular service is
handled by, either.
Of course, you can also use a service call to tell a ROM to establish
an extended vector pointing into itself for later use by other
routines. (service calls are entered with X containing the current
ROM number, so it's easy.) I've done this in the past, to make a ROM
intercept OSBYTE/OSWORD, etc, so it should work.
Rob