[Coco] Direct Page space under rom ...
jdaggett at gate.net
jdaggett at gate.net
Tue Apr 19 12:19:08 EDT 2005
Boisy/Kevin
Yes the IRQ service rou tines can get goofed up if tou alter the DP
register. What will happen is in the ISR, should it use an instruction
that is a direct address mode instruction, LDA opcode 96, you will
have a problem.
Example
The ISR somewhere in its code decides to load avariable that
RSDOS expects to be in address $0024. Lets say you changed the
DP register to $FE. When the ISR does an LDA $24 in direct
address mode, the ISR is expecting the DP register to have $00
stored in it. If it is still $FE from your code then instead of loadig
avariable at $0024, it will load from address $FE24.
What you will have to do in your program is redirect the ISR for IRQ
and FIRQ and NMI to your own program. In the beginning of the
ISR you will have to restore the DP to what the ISR expects to have
in the DP register and then jump to the ISR in basic code.
What you have to do is revector the ISRs so that you can restore
the DP to its correct value before the ISR executes. That is if the
ISR used direct addressing mode on any one instruction. If they do
not then there is no problem.
james
On 19 Apr 2005 at 6:13, Boisy G. Pitre wrote:
From: "Boisy G. Pitre" <boisy at boisypitre.com>
Subject: Re: [Coco] Direct Page space under rom ...
Date sent: Tue, 19 Apr 2005 06:13:48 -0500
To: CoCoList for Color Computer Enthusiasts
<coco at maltedmedia.com>
Send reply to: CoCoList for Color Computer Enthusiasts
<coco at maltedmedia.com>
<mailto:coco-
request at maltedmedia.com?subject=unsubscribe>
<mailto:coco-
request at maltedmedia.com?subject=subscribe>
> Kevin,
>
> Check out the Unravelled Series, it will answer both of your
> questions.
> I am not sure if you can change the DP and not restore it in an M/L
> routine, but the code is probably not written to use the DP. I could
> be wrong.
>
> If there's any free space in the DP area of BASIC, the Unravelled
> Series will tell you that too.
>
> Good luck!
>
> On Apr 18, 2005, at 11:26 PM, Kevin Diggs wrote:
>
> > Hi,
> >
> > I know this is going to shock you Boisy, but I have a CoCo
> > question. Is there any space in the direct page under ROM Basic (the
> > various varieties)? Also can you change the DP in your ML routines
> > under ROM Basic. Put another way will the interrupts go haywire if
> > you change it? I am pretty sure you have to put it back before
> > returning to Basic.
> >
> > kevin
> >
> > --
> > Coco mailing list
> > Coco at maltedmedia.com
> > http://five.pairlist.net/mailman/listinfo/coco
> >
> --
> Boisy G. Pitre
> E-Mail: boisy at boisypitre.com
> Mobile: (337) 781-3997
> Web: www.boisypitre.com
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
More information about the Coco
mailing list