<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Sun, 30 Oct 2005 09:39:36 +0000
From   : jgh@... (Jonathan Graham Harston)
Subject: Re: BBC using 3.5 high density format

Greg Cook <debounce@...> wrote:
> > disc spins and the density the bits are packed at you end up with
> > about 40us per byte.
> 
> High density may be achievable, if we take a leaf from Opus' book.
> 
> Supposing the HD controller board only raises NMI on a data request (by
> not connecting INTRQ), all the service routine need do is fetch the
> value, store it and increment the address.  To do a disc operation we
> issue a single sector command then poll the status register and the
 
That *is* how the disk I/O works. The code does something like:
 
; foreground program:
; copy required code to NMI space
 
; Decide which code is needed:
; disk->IO, IO->disk, disk->Tube, Tube->disk
 
LDY #23
.CopyNMI
LDA (routine),Y:STA &0D00,Y   ; Copy NMI routine to NMI space
DEY:BMI Copy_NMI
LDA #0:STA foreground_flag    ; Clear foreground completion flag
; Now program the FDC
; Set iostore+1/iostore+2 to initial address
.fdc_loop
BIT &FF:BMI EscapePressed     ; Abort if Esc pressed
LDA foreground_flag:BEQ loop  ; Loop until NMI code signals done
...
 
 
.iord
LDA FDC_Status:Bxx iord_finished  ; No more data
LDA FDC_Data                      ; Get byte from FDC
.iostore
STA &FFFF                         ; This is initialised to dest addr
INC iostore+1:BNE iord_ok         ; Inc low byte of address
INC iostore+2                     ; Inc high byte of address
.iord_ok
RTI                               ; Done this byte
.iord_finished
STA foreground_flag               ; Set flag for foreground loop
RTI
 
.tuberd
LDA FDC_Status:Bxx tuberd_finished  ; No more data
LDA FDC_Data                      ; Get byte from FDC
STA Tube_DATA                     ; Send to Tube
RTI                               ; Done this byte
.tuberd_finished
STA foreground_flag               ; Set flag for foreground loop
RTI
 
.iowr
...etc...
.tubewr
...etc...
 
So, reading to I/O memory takes seven instructions per byte. The
NAUG totals this up to 7+4+2+4+4+6+2+6+6=41 or 7+4+2+4+4+6+3+6=36
cycles. That's 41us or 36us per byte at 1MHz, 21us or 18us per
byte at 2MHz.
 
> > That's not many 6502 instructions, and half as many at HD,
> 
> The nominal data rate at high density is 32 cycles per byte at 2 MHz; a
> minimal NMI routine will keep up with such a controller, or at least
> stay re-entrant under worst case timings.  The routine for reading
> could be, for instance:
 
Somebody earlier said that an HD FDC would spew bytes out every
40us. At 1MHz there's not enough time to process 255 out of every
256 bytes when the branch skips the high byte increment. If
accessing the FDC keeps the CPU running at 2MHz, though, there is
plenty of time, the NMI occupies on average 52.5% of processor
time.
 
-- 
J.G.Harston - jgh@...                - mdfs.net/User/JGH
HADFS System Resources - http://mdfs.net/Software/HADFS
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>