Changes

Jump to: navigation, search

765 FDC

11,959 bytes added, Wednesday at 01:08
/* FDC Command Table (15 commands) */
<br>
== FDC Command Table (15 commands) ==
Command Parameters Exm Result Description{| class="wikitable" 02|+MF+SK HU TR HD ?? SZ NM GP SL <R> S0 S1 S2 TR HD NM SZ read trackRead Data (06h) 03 XX YY |- specify spd/dma 04 HU ! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|- S3 sense drive state 05+| command byte 0 || MT+|| MF HU TR || SK || 0 || 0 || 1 || 1 || 0|-| command byte 1 || colspan="5" style="text-align: center;" | x || HD SC SZ LS GP SL <W> S0 S1 S2 TR HD LS SZ write sector(s)|| colspan="2" style="text-align: center;" | US 06+MT+MF+SK HU TR HD SC SZ LS GP SL <|-| command byte 2 || colspan="8" | C: cylinder number|-| command byte 3 || colspan="8" | H: head number|-| command byte 4 || colspan="8" | R> S0 S1 S2 TR HD LS SZ read : sectornumber|-| command byte 5 || colspan="8" | N: bytes per sector|-| command byte 6 || colspan="8" | EOT: end of track (sie. last sector in track) 07 HU |- recalib.seek TP| command byte 7 || colspan="8" | GPL: gap 3 length|-| command byte 8 || colspan="8" | DTL: data length (if command byte 5==0) 08 |- | Execution || colspan="8" | Data- S0 TP sense int.statetransfer from the FDD|-| result byte 0 09+MT+MF HU TR HD SC SZ LS GP SL || colspan="8" | ST0: status register 0|-| result byte 1 <W> S0 S1 S2 TR HD LS SZ wr deleted sec(s)|| colspan="8" | ST1: status register 1 0A+MF HU |- S0 S1 S2 TR HD LS SZ | result byte 2 read ID|| colspan="8" | ST2: status register 2|-| result byte 3 0C+MT+MF+SK HU TR HD SC SZ LS GP SL <R> S0 S1 S2 TR HD LS SZ rd deleted sec(s)|| colspan="8" | C: cylinder number|-| result byte 4 0D+MF HU SZ NM GP FB <W> S0 S1 S2 TR HD LS SZ format track|| colspan="8" | H: head number 0F HU TP |- seek track n| result byte 5 11+MT+MF+SK HU TR HD SC SZ LS GP SL <W> S0 S1 S2 TR HD LS SZ scan equal|| colspan="8" | R: sector number|-| result byte 6 19+MT+MF+SK HU TR HD SC SZ LS GP SL <W> S0 S1 S2 TR HD LS SZ scan low or equal|| colspan="8" | N: bytes per sector 1D+MT+MF+SK HU TR HD SC SZ LS GP SL <W> S0 S1 S2 TR HD LS SZ scan high or eq.|}
Parameter bits that can be specified {| class="wikitable"|+ Read Deleted Data (0Ch)|-! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-| command byte 0 || MT || MF || SK || 0 || 1 || 1 || 0 || 0|-| command byte 1 || colspan="5" style="text-align: center;" | x || HD || colspan="2" style="text-align: center;" | US|-| command byte 2 || colspan="8" | C: cylinder number|-| command byte 3 || colspan="8" | H: head number|-| command byte 4 || colspan="8" | R: sector number|-| command byte 5 || colspan="8" | N: bytes per sector|-| command byte 6 || colspan="8" | EOT: end of track (ie. last sector in some Command Bytes aretrack)|-| command byte 7 || colspan="8" | GPL: gap 3 length|-| command byte 8 || colspan="8" | DTL: data length (if command byte 5==0)|-| Execution || colspan="8" | Data-transfer from the FDD|-| result byte 0 || colspan="8" | ST0: status register 0|-| result byte 1 || colspan="8" | ST1: status register 1|-| result byte 2 || colspan="8" | ST2: status register 2|-| result byte 3 || colspan="8" | C: cylinder number|-| result byte 4 || colspan="8" | H: head number|-| result byte 5 || colspan="8" | R: sector number|-| result byte 6 || colspan="8" | N:bytes per sector|}
MT Bit7 Multi Track {| class="wikitable"|+ Write Data (continue multi05h)|-sector! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-function on other | command byte 0 || MT || MF || x || 0 || 0 || 1 || 0 || 1|-| command byte 1 || colspan="5" style="text-align: center;" | x || HD || colspan="2" style="text-align: center;" | US |-| command byte 2 || colspan="8" | C: cylinder number|-| command byte 3 || colspan="8" | H: headnumber|-| command byte 4 || colspan="8" | R: sector number|-| command byte 5 || colspan="8" | N: bytes per sector|-| command byte 6 || colspan="8" | EOT: end of track (ie. last sector in track) MF Bit6 MFM|-Mode| command byte 7 || colspan="8" | GPL: gap 3 length|-Bit | command byte 8 || colspan="8" | DTL: data length (Default 1if command byte 5==Double Density0) SK |-| Execution || colspan="8" | Data-transfer to the FDD|-| result byte 0 Bit5 || colspan="8" | ST0: status register 0|-| result byte 1 Skip|| colspan="8" | ST1: status register 1|-Bit (set if secs with deleted DAM shall be skipped)| result byte 2 || colspan="8" | ST2: status register 2|-| result byte 3 || colspan="8" | C: cylinder number|-| result byte 4 || colspan="8" | H: head number|-| result byte 5 || colspan="8" | R: sector number|-| result byte 6 || colspan="8" | N: bytes per sector|}
Parameter/Result {| class="wikitable"|+ Write Deleted Data (09h)|-! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-| command byte 0 || MT || MF || x || 0 || 1 || 0 || 0 || 1|-| command byte 1 || colspan="5" style="text-align: center;" | x || HD || colspan="2" style="text-align: center;" | US|-| command byte 2 || colspan="8" | C: cylinder number|-| command byte 3 || colspan="8" | H: head number|-| command byte 4 || colspan="8" | R: sector number|-| command byte 5 || colspan="8" | N: bytes areper sector|-| command byte 6 || colspan="8" | EOT:end of track (ie. last sector in track)|-| command byte 7 || colspan="8" | GPL: gap 3 length|-| command byte 8 || colspan="8" | DTL: data length (if command byte 5==0)|-| Execution || colspan="8" | Data-transfer to the FDD|-| result byte 0 || colspan="8" | ST0: status register 0|-| result byte 1 || colspan="8" | ST1: status register 1|-| result byte 2 || colspan="8" | ST2: status register 2|-| result byte 3 || colspan="8" | C: cylinder number|-| result byte 4 || colspan="8" | H: head number|-| result byte 5 || colspan="8" | R: sector number|-| result byte 6 || colspan="8" | N: bytes per sector|}
HU b0,1{| class=Unit/Drive Number, b2=Physical Head Number, other bits zero"wikitable" TP Physical |+ Read Track Number TR Track-ID (usually same value as TP02h) |-! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-| command byte 0 || x || MF || SK || 0 || 0 || 0 || 1 || 0|-| command byte 1 || colspan="5" style="text-align: center;" | x || HD Head|| colspan="2" style="text-IDalign: center;" | US SC First Sector|-ID (| command byte 2 || colspan="8" | C: cylinder number|-| command byte 3 || colspan="8" | H: head number|-| command byte 4 || colspan="8" | R: sector you want to read)number SZ Sector Size (80h shl n) (default|-| command byte 5 || colspan=02h for 200h "8" | N: bytes)per sector LS Last Sector|-ID | command byte 6 || colspan="8" | EOT: end of track (should be same as SC when reading a single ie. last sectorin track) GP Gap (default=2Ah except |-| command 0D: defaultbyte 7 || colspan=52h)"8" | GPL: gap 3 length SL Sectorlen if SZ|-| command byte 8 || colspan=0 "8" | DTL: data length (defaultif command byte 5=FFh=0) Sn |-| Execution || colspan="8" | FDC reads all data fields from index hole to EOT|-| result byte 0 Status Register || colspan="8" | ST0: status register 0..3 FB |-| result byte 1 Fillbyte (for the sector data areas) (default|| colspan=E5h)"8" | ST1: status register 1|- NM | result byte 2 Number of Sectors (default|| colspan=09h)"8" | ST2: status register 2 XX b0..|-| result byte 3 || colspan=headunload n*32ms ("8" only), b4..7| C: cylinder number|-| result byte 4 || colspan=steprate (16"8" | H: head number|-n)*2ms YY | result byte 5 b0|| colspan=DMA_disable, b1"8" | R: sector number|-7| result byte 6 || colspan=headload n*4ms ("8" only)| N: bytes per sector|}
{| class="wikitable"|+ Read ID (0Ah)|-! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-| command byte 0 || x || MF || x || 0 || 1 || 0 || 1 || 0|-| command byte 1 || colspan="5" style="text-align: center;" | x || HD || colspan="2" style="text-align: center;" | US |-| Execution || colspan="8" | The first correct ID information on the cylinder is stored in data register|-| result byte 0 || colspan="8" | ST0: status register 0|-| result byte 1 || colspan="8" | ST1: status register 1|-| result byte 2 || colspan="8" | ST2: status register 2|-| result byte 3 || colspan="8" | C: cylinder number|-| result byte 4 || colspan="8" | H: head number|-| result byte 5 || colspan="8" | R: sector number|-| result byte 6 || colspan="8" | N: bytes per sector|} {| class="wikitable"|+ Format Track(0Dh)|-! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-| command byte 0 || x || MF || x || 0 || 1 || 1 || 0 || 1|-| command byte 1 || colspan="5" style="text-align: output TRcenter;" | x || HD || colspan="2" style="text-align: center;" | US |-| command byte 2 || colspan="8" | N: bytes per sector|-| command byte 3 || colspan="8" | SC: sectors per track|-| command byte 4 || colspan="8" | GPL: gap 3 length|-| command byte 5 || colspan="8" | D: filler pattern to write in each byte|-| Execution || colspan="8" | FDC formats an entire track|-| result byte 0 || colspan="8" | ST0: status register 0|-| result byte 1 || colspan="8" | ST1: status register 1|-| result byte 2 || colspan="8" | ST2: status register 2|-| result byte 3 || colspan="8" | C: cylinder number|-| result byte 4 || colspan="8" | H: head number|-| result byte 5 || colspan="8" | R: sector number|-| result byte 6 || colspan="8" | N: bytes per sector|} {| class="wikitable"|+ Scan Equal (11h)|-! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-| command byte 0 || MT || MF || SK || 1 || 0 || 0 || 0 || 1|-| command byte 1 || colspan="5" style="text-align: center;" | x || HD || colspan="2" style="text-align: center;" | US |-| command byte 2 || colspan="8" | C: cylinder number|-| command byte 3 || colspan="8" | H: head number|-| command byte 4 || colspan="8" | R: sector number|-| command byte 5 || colspan="8" | N: bytes per sector|-| command byte 6 || colspan="8" | EOT: end of track (ie. last sector in track)|-| command byte 7 || colspan="8" | GPL: gap 3 length|-| command byte 8 || colspan="8" | STP: scan test (1=scan contiguous,2=scan alternate)|-| Execution || colspan="8" | Data compared between the FDD and main-system|-| result byte 0 || colspan="8" | ST0: status register 0|-| result byte 1 || colspan="8" | ST1: status register 1|-| result byte 2 || colspan="8" | ST2: status register 2|-| result byte 3 || colspan="8" | C: cylinder number|-| result byte 4 || colspan="8" | H: head number|-| result byte 5 || colspan="8" | R: sector number|-| result byte 6 || colspan="8" | N: bytes per sector|} {| class="wikitable"|+ Scan Low or Equal (19h)|-! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-| command byte 0 || MT || MF || SK || 1 || 1 || 0 || 0 || 1|-| command byte 1 || colspan="5" style="text-align: center;" | x || HD|| colspan="2" style="text-align: center;" | US |-| command byte 2 || colspan="8" | C: cylinder number|-| command byte 3 || colspan="8" | H: head number|-| command byte 4 || colspan="8" | R: sector number|-| command byte 5 || colspan="8" | N: bytes per sector|-| command byte 6 || colspan="8" | EOT: end of track (ie. last sector in track)|-| command byte 7 || colspan="8" | GPL: gap 3 length|-| command byte 8 || colspan="8" | STP: scan test (1=scan contiguous,SC2=scan alternate)|-| Execution || colspan="8" | Data compared between the FDD and main-system|-| result byte 0 || colspan="8" | ST0: status register 0|-| result byte 1 || colspan="8" | ST1: status register 1|-| result byte 2 || colspan="8" | ST2: status register 2|-| result byte 3 || colspan="8" | C: cylinder number|-| result byte 4 || colspan="8" | H: head number|-| result byte 5 || colspan="8" | R: sector number|-| result byte 6 || colspan="8" | N: bytes per sector|} {| class="wikitable"|+ Scan High or Equal (1Dh)|-! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-| command byte 0 || MT || MF || SK || 1 || 1 || 1 || 0 || 1|-| command byte 1 || colspan="5" style="text-align: center;" | x || HD || colspan="2" style="text-align: center;" | US |-| command byte 2 || colspan="8" | C: cylinder number|-| command byte 3 || colspan="8" | H: head number|-| command byte 4 || colspan="8" | R: sector number|-| command byte 5 || colspan="8" | N: bytes per sector|-| command byte 6 || colspan="8" | EOT: end of track (ie. last sector in track)|-| command byte 7 || colspan="8" | GPL: gap 3 length|-| command byte 8 || colspan="8" | STP: scan test (1=scan contiguous,SZ for each 2=scan alternate)|-| Execution || colspan="8" | Data compared between the FDD and main-system|-| result byte 0 || colspan="8" | ST0: status register 0|-| result byte 1 || colspan="8" | ST1: status register 1|-| result byte 2 || colspan="8" | ST2: status register 2|-| result byte 3 || colspan="8" | C: cylinder number|-| result byte 4 || colspan="8" | H: head number|-| result byte 5 || colspan="8" | R: sector during execution phasenumberRead Track|-| result byte 6 || colspan="8" | N: reads NM sectors bytes per sector|} {| class="wikitable"|+ Recalibrate (starting 07h)|-! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-| command byte 0 || colspan="3" style="text-align: center;" | x || 0 || 0 || 1 || 1 || 1|-| command byte 1 || colspan="6" style="text-align: center;" | x || colspan="2" style="text-align: center;" | US|-| Execution || colspan="8" | Head retracted to track 0|} {| class="wikitable"|+ Seek (0Fh)|-! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-| command byte 0 || colspan="3" style="text-align: center;" | x || 0 || 1 || 1 || 1 || 1|-| command byte 1 || colspan="5" style="text-align: center;" | x || HD|| colspan="2" style="text-align: center;" | US|-| command byte 2 || colspan="8" | NCN: new cylinder number|-| Execution || colspan="8" | Head is positioned over proper cylinder|} {| class="wikitable"|+ Sense Interrupt Status (08h)|-! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-| command byte 0 || colspan="3" style="text-align: center;" | x || 0 || 1 || 0 || 0 || 0|-| result byte 0 || colspan="8" | ST0: status register 0|-| result byte 1 || colspan="8" | PCN: present cylinder number|} {| class="wikitable"|+ Sense Drive Status (04h)|-! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-| command byte 0 || colspan="3" style="text-align: center;" | x || 0 || 0 || 1 || 0 || 0|-| command byte 1 || colspan="5" style="text-align: center;" | x || HD || colspan="2" style="text-align: center;" | US |-| result byte 0 || colspan="8" | ST3: status register 3|} {| class="wikitable"|+ Specify (03h)|-! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-| command byte 0 || colspan="3" style="text-align: center;" | x || 0 || 0 || 0 || 1 || 1|-| command byte 1 || colspan="4" style="text-align: center;" | SRT || colspan="4" style="text-align: center;" | HUT|-| command byte 2 || colspan="7" style="text-align: center;" | HLT || ND|} {| class="wikitable"|+ Invalid|-! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-| command byte 0 || colspan="3" style="text-align: center;" | x || colspan="5" style="text-align: center;" | Invalid Codes|-| result byte 0 || colspan="8" | ST0: status register 0|} Abbreviations used: *MT = Multi-track (continue multi-sector function on other head)*MF = MFM mode (1 = Double Density)*SK = Skip deleted-data address mark (set if sectors with first sec past index holedeleted DAM shall be skipped)Read ID*HD = Head number select*US = Unit select (drive select) *HLT = Head Load Time: read ID bytes for current sec2 to 254ms in 2ms increments*HUT = Head Unload Time: 16 to 240ms in 16ms increments*SRT = Step Rate Time: 1 to 16ms in 1ms increments (F = 1ms, repeated/undelayed read lists all IDsE = 2ms, etc.)*ND = Non-DMA mode Notes:* Format Track: The processor must supply C, H, R, N to the FDC for each sector during execution phaseRecalib* Recalibrate: walks Walks up to 77 tracks, 80tr-drives may need second recalib if failed* Seek/RecalibRecalibrate: All read/write commands will be disabled until succesful senseintsense interruptSenseint* Specify: Set's IC if unsuccesful (no int has occured) (until IC=0)All timings will be doubled on CPC because the FDC runs at 4MHz instead of 8MHz for the datasheet
<br>
*[http://quasar.cpcscene.net/doku.php?id=assem:fdc Quasar FDC documentation (in french)]
*[https://64nops.wordpress.com/2021/07/04/a-la-decouverte-du-fdc/ FDC blog articles (in french)]
*[https://info-coach.fr/atari/hardware/FD-Hard.php Atari ST Floppy Disk Drive hardware analysis]
[[Category:CPC Internal Components]][[Category:Programming]][[Category:DATA Storage]][[Category:Electronic Component]]
5,896
edits