Date : Fri, 04 Nov 2005 21:37:37 +0000 (GMT)
From : Greg Cook <debounce@...>
Subject: Re: BBC using 3.5 high density format
On 04 Nov 2005 00:20:34 +0000, Jonathan Graham Harston
<jgh@...> wrote:
> Yes, I calculated a 1MHz access to the FDC, and for some reason my
> mind continued to calculate the rest of the NMI routine at 1MHz!
> With the FDC accessed at 2MHz the NMI code would take 21us or
> 18us. So, SD with one byte every 64us leaves 43us between NMIs. DD
> with one byte every 32us leaves 11us between NMIs, but HD with one
> byte every 16us results in the NMI code being hit by the next NMI
> call.
By which time, if carefully optimised, it will have started everything
it needs to do (nearly all instructions are atomic.) The only penalty
is three more bytes on the stack. On the next 255 calls such code is
bound to complete in under 16us, so the extra NMI state will be popped
soon after.
> Getting rid of the checking of FDC_Status saves 6 cycles, dropping
> the code to 17.5us, still not quite enough to collect a byte every
> 16us.
As I wrote on 30/Oct (in reply to Tom Seddon), replacing STA &FFFF with
STA &FF00,X will take no extra time. INC iostore+1 can then be changed
to INX, saving 2us.
Once the instruction after BNE iord_ok has started, a further NMI will
not harm the correctness of the result. Whether the branch is BEQ or
BNE, the interrupt should not come less than 1.5us after the start of
the branch instruction. But by making the test BEQ, it will take 1us
most of the time, and so the mean time to re-entrancy is kept as small
as possible.
At this point the code should match the fragment I previously outlined.
The relevant statistics are 13.5us / 17us. My outline proofs had the
lengths of the load and store the other way round, but the effect is
the same. I still believe that high density disc access is possible on
the BBC Micro and a turbo Electron as well.
Greg
___________________________________________________________
How much free photo storage do you get? Store your holiday
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com