PAGE ; Disk Input / Output port assignments. FDPORT EQU 0C0H ;Base port address for Controller FDCS EQU FDPORT ;Status register FDCD EQU FDPORT+1 ;Data register DMA EQU FDPORT+2 ;Dma address (when write) INTS EQU FDPORT+2 ;Status Register (when read) SER EQU FDPORT+3 ;Serial port ; Controller function definitions F.SPEC EQU 03 ;Specify F.DSTS EQU 04 ;Drive status F.WRT EQU 05 ;Write data F.RDAT EQU 06 ;Read data F.RECA EQU 07 ;recalibrate F.RSTS EQU 08 ;Read status F.DRID EQU 10 ;Read ID F.SEEK EQU 15 ;Seek ; Disk drive constants STEPR: EQU 8 ;Shugart SA 800 SRT: EQU 16-STEPR ;Controller value HUT: EQU 240/16 ;Head unload = 240 ms HLT: EQU 35 ;Head load = 35 ms ND: EQU 0B ;Set DMA mode SPACE 4,10 ; 7 6 5 4 3 2 1 0 ; +----+----+----+----+----+----+----+----+ ; ST0 | IC | SE | EC | NR | HD | US | ; +----+----+----+----+----+----+----+----+ ; ST1 | EN | | DE | OR | | ND | NW | MA | ; +----+----+----+----+----+----+----+----+ ; ST2 | | CM | DD | WC | SH | SN | BC | MD | ; +----+----+----+----+----+----+----+----+ ; ST3 | FT | WP | RY | T0 | TS | HD | US | ; +----+----+----+----+----+----+----+----+ ; ; IC - Interrupt code. ; 00 - Normal termination by TC signal. ; 01 - Abnormal termination. ; 10 - Invalid command. ; 11 - Abnormal termination (READY dropped). ; ; SE - Seek end, indicates end of seek. ; ; EC - Equipment Check. ; ; NR - Not ready. ; ; HD - State of the head select. ; ; US - State of the unit select. ; ; ; EN - End of Cylinder, Read EOT sector. ; ; DE - CRC error in ID or data fields. ; ; OR - Over run. ; ; ND - No Data. ; ; NW - Not writable (write protect detected) ; ; MA - Missing address mark. ; ; ; CM - Control Mark (deleted data address mark). ; ; DD - CRC error in data field. ; ; WC - Wrong cylinder. ; ; SH - Scan equal hit. ; ; SN - Scan not satisfied. ; ; BC - Bad cylinder. ; ; MD - Missing data mark. ; ; ; FT - Fault. ; ; WP - Write protect signal. ; ; RY - Ready. ; ; T0 - Track zero. ; ; TS - Two sided disk is inserted. page IF HARD ;**************************************************************** ;* * ;* CompuPro Disk2 equates. * ;* * ;**************************************************************** hdport equ 0c8h ;Base port address hdctl equ hdport ;Control/Status port hddata equ hdport+1 ;Data port ; ; out hdctl 7 6 5 4 3 2 1 0 ; | | | | | | | | ; attn <----------+ | | | | | | | ; run <---------------+ | | | | | | ; opcode <----------------+---+---+ | | | ; fault clear <-----------------------+ | | ; Unit select <---------------------------+---+ ; ; in hdctl 7 6 5 4 3 2 1 0 ; | | | | | | | | ; opdone* <-------+ | | | | | | | ; timeout <-----------+ | | | | | | ; not equal <-------------+ | | | | | ; over run <------------------+ | | | | ; ready* <------------------------+ | | | ; seek complete* <--------------------+ | | ; write fault* <--------------------------+ | ; track 0* <----------------------------------+ ; DISK2 Commands h.red equ 0c8h ;Read data command h.wrt equ 0d0h ;Write data command h.tim equ 6 ;Time out h.dvs equ 80h ;Drive strobe h.hed equ 90h ;Head register h.cyl equ 88h ;Cylinder register h.sec equ 98h ;Sector register h.sin equ 0a0h ;Step in h.sou equ 80h ;Step out ; Selector channel equates selchan equ 0f0h ;Selector channel port pri equ 10 ;Disk priority selbyt equ 0fh-pri+20h ;Selector channel command byte ENDIF ;*************************************************** ; * ; COMPUPRO M-DRIVE/H EQUATES * ; * ;*************************************************** ; HDBASE EQU 0C6H ;Base of M-DRIVE/H board HDATA EQU HDBASE ; DATA port HADDÒ EQÕ HDBASE+1 ; Address counter port PAGE ; Sector Translation Tables. XTABLE: DW XLTS ;Single 128 DW XLTD1 ;Double 256 DW XLTD2 ;Double 512 DW XLTD3 ;Double 1024 XLTS: DB 0,6,12,18,24,4,10,16,22,2,8,14,20 DB 1,7,13,19,25,5,11,17,23,3,9,15,21 XLTD1: DB 0, 1,18,19,36,37, 2, 3,20,21,38,39 DB 4, 5,22,23,40,41, 6, 7,24,25,42,43 DB 8, 9,26,27,44,45,10,11,28,29,46,47 DB 12,13,30,31,48,49,14,15,32,33,50,51 DB 16,17,34,35 XLTD2: DB 0, 1, 2, 3,16,17,18,19 DB 32,33,34,35,48,49,50,51 DB 4, 5, 6, 7,20,21,22,23 DB 36,37,38,39,52,53,54,55 DB 8, 9,10,11,24,25,26,27 DB 40,41,42,43,56,57,58,59 DB 12,13,14,15,28,29,30,31 DB 44,45,46,47 XLTD3: DB 0, 1, 2, 3, 4, 5, 6, 7 DB 24,25,26,27,28,29,30,31 DB 48,49,50,51,52,53,54,55 DB 8, 9,10,11,12,13,14,15 DB 32,33,34,35,36,37,38,39 DB 56,57,58,59,60,61,62,63 DB 16,17,18,19,20,21,22,23 DB 40,41,42,43,44,45,46,47 PAGE ; Initialze for DSKMSK ; DRV1: SET 0 DRV2: SET 0 DRV3: SET 0 DRV4: SET 0 DRV5: SET 0 DRV6: SET 0 DRV7: SET 0 DRV8: SET 0 DRV9: SET 0 DRV10: SET 0 DRV11: SET 0 DRV12: SET 0 DRV13: SET 0 DRV14: SET 0 DRV15: SET 0 DRV16: SET 0 ; Control Blocks for disk drives DPBASE: if @ldr <> 0 if order = 0 DPHGEN 1,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive A: ENDIF if order = 1 IF GBC20 DRVTYP: SET 3 DPHGEN 1,DSK8F1,0,DIRBUF,DPBF81+1 ;Drive A: ENDIF IF GBC10 DRVTYP: SET 2 DPHGEN 1,DSK8M1,0,DIRBUF,DPBM81+1 ;Drive A: ENDIF IF GBC26 DRVTYP: SET 4 DPHGEN 1,DSK4S1,0,DIRBUF,DPBS41+1 ;Drive A: ENDIF ENDIF else if order = 0 DPHGEN 1,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive A: DPHGEN 2,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive B: IF NOT HARD DPHGEN 3,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive C: DPHGEN 4,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive D: ENDIF IF GBC20 DRVTYP: SET 3 DPHGEN 3,DSK8F1,0,DIRBUF,DPBF81+1 ;Drive C: DPHGEN 4,DSK8F2,0,DIRBUF,DPBF82+1 ;Drive D: DPHGEN 5,DSK8F3,0,DIRBUF,DPBF83+1 ;Drive E: ENDIF IF GBC10 DRVTYP: SET 2 DPHGEN 3,DSK8M1,0,DIRBUF,DPBM81+1 ;Drive C: DPHGEN 4,DSK8M2,0,DIRBUF,DPBM82+1 ;Drive D: ENDIF IF GBC26 DRVTYP: SET 4 DPHGEN 3,DSK4S1,0,DIRBUF,DPBS41+1 ;Drive C: DPHGEN 4,DSK4S2,0,DIRBUF,DPBS42+1 ;Drive D: DPHGEN 5,DSK4S3,0,DIRBUF,DPBS43+1 ;Drive E: DPHGEN 6,DSK4S4,0,DIRBUF,DPBS44+1 ;Drive F: ENDIF ENDIF if order = 1 IF GBC20 DRVTYP: SET 3 DPHGEN 1,DSK8F1,0,DIRBUF,DPBF81+1 ;Drive A: DPHGEN 2,DSK8F2,0,DIRBUF,DPBF82+1 ;Drive B: DPHGEN 3,DSK8F3,0,DIRBUF,DPBF83+1 ;Drive C: DPHGEN 4,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive D: (GBC20) DPHGEN 5,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive E: (GBC20) ENDIF IF GBC10 DRVTYP: SET 2 DPHGEN 1,DSK8M1,0,DIRBUF,DPBM81+1 ;Drive A: DPHGEN 2,DSK8M2,0,DIRBUF,DPBM82+1 ;Drive B: DPHGEN 3,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive C: (GBC10) DPHGEN 4,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive D: (GBC10) ENDIF IF GBC26 DRVTYP: SET 4 DPHGEN 1,DSK4S1,0,DIRBUF,DPBS41+1 ;Drive A: DPHGEN 2,DSK4S2,0,DIRBUF,DPBS42+1 ;Drive B: DPHGEN 3,DSK4S3,0,DIRBUF,DPBS43+1 ;Drive C: DPHGEN 4,DSK4S4,0,DIRBUF,DPBS44+1 ;Drive D: DPHGEN 5,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive E: (GBC26) DPHGEN 6,DSKS1,XLTS,DIRBUF,DPBS1+1 ;Drive F: (GBC26) ENDIF ENDIF endif IF HDRIVE DPHGEN 13,HMDTYP,0,DIRBUF,DPBHMD+1 ;Drive M: (M-DRIVE/H) ENDIF space 4,10 ; Disk type definition blocks for each particular mode. DPBS1: ;Single density, single sided. DPBGEN DSKS1,26,3,7,0,S1DSM,64,1100000000000000b,2 DPBS2: ;Single density, double sided. DPBGEN DSKS2,26,4,15,1,S2DSM,128,1100000000000000b,2*2 DPBD1: ;Double density, single sided. ;NOTE: EXM should be 1, however changing now would lose ; compatiblity with older CompuPro systems. se la vi. DPBGEN DSKD1,2*26,4,15,0,D1DSM,128,1100000000000000b,2 DPBD2: ;Double density, double sided. DPBGEN DSKD2,2*26,4,15,0,D2DSM,256,1111000000000000b,2*2 DPBD3: ;Double density, single sided. DPBGEN DSKD3,4*15,4,15,0,D3DSM,128,1100000000000000b,2 DPBD4: ;Double density, double sided. DPBGEN DSKD4,4*15,4,15,0,D4DSM,256,1111000000000000b,2*2 DPBD5: ;Double density, single sided. DPBGEN DSKD5,8*8,4,15,0,D5DSM,128,1100000000000000b,2 DPBD6: ;Double density, double sided. DPBGEN DSKD6,8*8,4,15,0,D6DSM,256,1111000000000000b,2*2 IF GBC20 DPBF81: ;Fujitsu 20 megabyte first 8 megabytes DPBGEN DSK8F1,8*11,5,31,1,F81DSM,1024,1111111111111111b,1*8 DPBF82: ;Fujitsu 20 megabyte second 8 megabytes DPBGEN DSK8F2,8*11,5,31,1,F82DSM,1024,1111111111111111b,94*8 DPBF83: ;Fujitsu 20 megabyte first 8 megabytes DPBGEN DSK8F3,8*11,5,31,1,F83DSM,1024,1111111111111111b,187*8 ENDIF IF GBC10 DPBM81: ;Fujitsu 10 megabyte first 5 megabytes DPBGEN DSK8M1,8*11,5,31,1,M81DSM,1024,1111111111111111b,1*4 DPBM82: ;Fujitsu 10 megabyte second 5 megabytes DPBGEN DSK8M2,8*11,5,31,1,M82DSM,1024,1111111111111111b,123*4 ENDIF IF GBC26 DPBS41: ;Shugart 26 megabyte first 8 megabytes DPBGEN DSK4S1,8*16,5,31,1,S41DSM,1024,1111111111111111b,1*8 DPBS42: ;Shugart 26 megabyte second 8 megabytes DPBGEN DSK4S2,8*16,5,31,1,S42DSM,1024,1111111111111111b,57*8 DPBS43: ;Shugart 26 megabyte third 8 megabytes DPBGEN DSK4S3,8*16,5,31,1,S43DSM,1024,1111111111111111b,113*8 DPBS44: ;Shugart 26 megabyte last 2 megabytes DPBGEN DSK4S4,8*16,5,31,1,S44DSM,1024,1111111111111111b,169*8 ENDIF IF HDRIVE DPBHMD: DPBGEN HMDTYP,8,4,15,1,HMDDSM,128,1100_0000_0000_0000B,4 ENDIF ; Disk selection masks DSKMSK: DB DRV1 ;Drive A: DB DRV2 ;Drive B: DB DRV3 ;Drive C: DB DRV4 ;Drive D: DB DRV5 ;Drive E: DB DRV6 ;Drive F: DB DRV7 ;Drive G: DB DRV8 ;Drive H: DB DRV9 ;Drive I: DB DRV10 ;Drive J: DB DRV11 ;Drive K: DB DRV12 ;Drive L: DB DRV13 ;Drive M: DB DRV14 ;Drive N: DB DRV15 ;Drive O: DB DRV16 ;Drive P: