Date : Mon, 23 Sep 2002 19:59:38 +0200
From : John Kortink <kortink@...>
Subject: Re: BBC B with edge-connectors instead of IDC connectors?
On Mon, 23 Sep 2002 17:18:56 +0100, you wrote:
>In article <70srouod72qm2vb9lgtlve23g3thdt33q4@...>,
> John Kortink <kortink@...> wrote:
>
>[poking F4 before FE30 with no SEI]
>
>> >> Depends. One possible scenario is that the interrupt handler
>> >> needs to access the ROM that was selected when the interrupt
>> >> occurred and needs to do so by explicitly switching to it at
>> >> some point (which may be, e.g., if executes partially in a
>> >> sideways ROM itself, or if it needs to access other ROMs).
>> >> It will access the wrong ROM since ?&F4 has already been
>> >> updated and no longer corresponds to the actual ROMSEL.
>> >
>> >In this situation it knows which ROM was paged in when the interrupt went
>> >off since it's still selected by virtue of the foreground task not yet
>> >poking FE30.
>
>> No it doesn't. It doesn't know its number without reading ?&F4
>
>I can't imagine a situation where this would be a requirement anyway,but
>I'll agree that having swapped ROMs it no longer knows truly which ROM was
>paged in at the instant of the IRQ.However,the key is that the machine
>wouldn't crash since on exit the ROMSEL is updated with the ROM that
>everyone wanted anyway.
On the contrary. It can crash easily depending on how the
data is used. It's not too hard to construct a situation
where the machine actually jumps into the wrong ROM as
a result of not updating ?&F4 and ROMSEL atomically. The
OS doesn't do it correctly all the time for nothing.
>To sum up,I think I'll carry on doing it the same way the OS does it and not
>bother disabling interrupts,just to update the RAM copy first,
I'm not sure if anybody but yourself will be able to
appreciate the huge savings in terms of two bytes of
code and six keystrokes brought on by leaving out a
SEI and CLI ... But as long as it's not code that you
distribute to others, I suppose it's your own party.
John Kortink