Title Foreign Drives for the MD-11 Copyright 1984 Morrow Designs (23_Apr_84) ; ; Copyright 1982,1983,1984 ; Morrow Designs, Inc. ; San Leandro, Ca ; John Zalabak, Howard Fullmer ; .z80 aseg org 100h ; Disclaimer: ; ; Morrow Designs Inc. takes no responsibility for and damage ; to disk drives or data loss due to the use (or mis-use) of this ; program. ; ; ; Adding foreign drives: ; ; 1) Add a new foreign drive code to the translation ID ; code definitions (in local equates). Note: we intend ; to integrate the format program with the foreign drive ; program so that the information required to format a ; drive will be aquired by using the format type byte ; (which is set using the format code); Consequently, ; you may have to modify your code number at some point ; in the future to take advantage of this capability. ; ; 2) Add a new entry to the selection prompt menu (medmsg). ; If there are any selections following the new entry then ; add one to their selection numbers. ; ; 3) If there's no media parameter table currently installed ; which exactly matches the media you want to add then ; you'll have to creat a new one. To do this you'll ; probably want to copy and then modify the closest ; existing media parameter table. ; ; 4) Enter the starting address and length of the media ; parameter table into the media parameter lookup table ; (medtbl). You should enter this information into the ; the lookup table in the same relative position as it ; appears in the selection prompt menu (e.g. xerox double ; density immediatly follows xerox single density in both ; the selection menu and the lookup table). ; ; ; Limitations: ; ; 1) Currently we assume that double sided drives have all ; even numbered tracks on side one and all odd numbered ; tracks on side two. page 64 ; Index: Foreign (8_Jan_84) ;-------------------------- ; ; START Main Line of Foreign Drive Routine ; ; CCLCHK Check the Cbios Compatibility Level ; GETDRV Get the drive number ; VALID Validate the current drive ; GETDEF Get the Media Definiton Table ; SETXLT SetUp the translate table for this drive ; NEWENT Enter a new translation table into the free space ; SETDPH Install the Xlt pointer in the Dph ; SETDPB OverLay the current drive's Dpb ; GETPNT Get a Pointer into the current data structure ; SETMTB Update the drive's MTAB ; ; GETBUF Move system memory into the local buffer ; PUTBUF Put the Local Buffer into System Memory ; DOCOLD Call the Bios Cold Boot Entry Point ; ; Message Strings ; Data Areas ; Media Parameter tables page ;---------------------------------------------------------------------- ; Local Equates (30_Jan_84) ;-------------------------- ; ;Revision Numbers CpmVer equ 30h ;Cpm Version Number ccl equ 0 ;Cbios Compatibility Level frev equ 12h ;Foreign Drive Program Revision Number ;Ascii Character Equates cntrlC equ 03 ;Control C (Cp/m warm boot) cr equ 0dh ;Carriage Return lf equ 0ah ;Line Feed ;Bdos Functions ConIn equ 1 ;Console input Character ConOut equ 2 ;Console output Character PrnFun equ 9 ;Print a String GetRev equ 12 ;Get the revision number of this cpm system DbiosC equ 50 ;Direct bios call under Cpm 3 ;Address and Length Definitions Wbadd equ 1 ;Warm Boot address in page zero Bdos equ 5 ;Loction of the service jump to the bdos Bdadd equ 6 ;Starting Address of the Bdos InBuf equ 80h ;Starting address of the command line buffer DpbLen equ 15 ;Define the length of a DPB ;Offset Definitions SelOff equ 18h ;Offset to select jump from wboot jump CclOff equ 7h ;Offset to Clevel from start of char. struct. MftOff equ 14 ;Offset to format type in MTAB from dskdef1 ;MTAB's Dskdef0 Mask Bytes $DEF0 equ 11111111b xor ($FRGN or $SECZRO or $DBLMED) $FRGN equ 01000000b ;Drive is Foreign (Not Morrow) $SECZRO equ 00100000b ;Sector Numbering Starts with Sector Zero (not 1) $DBLMED equ 00000100b ;Double Sided Media ;MTAB's Dskdef1 Mask Bytes $DEF1 equ 11111111b xor ($DRVDEN or $128 or $256 or $512 or $1024) $DRVDEN equ 00100000b ;Double Density Media $128 equ 00000000b ;128 Bytes per Sector $256 equ 00000001b ;256 Bytes per Sector $512 equ 00000010b ;512 Bytes per Sector $1024 equ 00000011b ;1024 Bytes per Sector ;Translation ID Codes morcod equ 0 ;Morrow DS-DD ibmcod equ 1 ;IBM SS-DD os1cod equ 2 ;Osborn SS-SD os2cod equ 3 ;Osborn SS-DD xr1cod equ 4 ;Xerox SS-SD xr2cod equ 5 ;Xerox SS-DD kaycod equ 6 ;Kaypro SS-DD hp1cod equ 7 ;Hewlett Packard DS-DD telcod equ 8 ;Televideo SS-DD page ;---------------------------------------------------------------------- ; START - Main Line of Foreign Drive Routine (4_Jan_84) ;------------------------------------------------------ ; Start: ld sp,LocStk ;(local stack's at the end of the local buffer) ld de,OpnMsg ;DE:= Pointer to the sign-on message ld c,PrnFun ;C:= Print string function number call Bdos ;Print the Sign-on Message call CclChk ;Check Cpm version and Cbios compatibity level or a ;If (Cpm or Cbios is wrong revision) jp nz,error ; GOTO error GetLp1: call GetDrv ;Repeat Get the drive number or a jp nz,GetLp1 call Valid ; Validate the drive number and get DPH or a jp nz,GetLp1 ;Until (the drive number is valid) GetLp2: call GetDef ;Get the Media Definition Table call SetXlt ;Get the translate table for this drive or a ;If (error eq false) jr nz,error call SetDph ; Install the xlt pointer in the dph call SetDpb ; Overlay the Dpb call SetMtb ; Update the drive's MTAB Error: jp 0 ;Warm Boot page ;---------------------------------------------------------------------- ; CCLCHK - Check the Cbios Compatibility Level (4_Jan_84) ;-------------------------------------------------------- ; ;Check the Cpm Version Number CclChk: ld c,GetRev ;C:= Bdos get cpm version number call Bdos ;Get version number in L ld a,l ;A:= Cpm Version 14, 22 or 31 and 0F0h ;Mask off the minor revision number cp CpmVer ;If (version doesn't match expected version) jr nz,CclErr ; Goto Error return ;Check the Cbios Compatibility Level ld a,6 ;A:= Function_6 (Return Character table) ld de,LocBuf ;DE:= Pointer to the local buffer call DoCold ;Move the character table into the local buffer ld hl,CclOff ;HL:= offset to Cbios compatiblity level add hl,de ;HL:= Pointer to Cbios compatibility level ld a,(hl) ;If (current compatibility levle ne Cbios Ccl) cp Ccl jp nz,CclErr ; Goto Error return Cclok: ld a,0 ;A:= Successful Completion return status ret ;Return CclErr: ld de,vmesg ; DE:= revision error ld c,prnfun ; C:= Print string function number call Bdos ; Print the Input Drive number string ld a,0FFh ; A:= error return status ret page ;---------------------------------------------------------------------- ; GETDRV - Get the drive number (30_Jan_84) ;------------------------------------------ ; 1) This routine gets the number of the drive that will contain ; the foreign media. ; 2) If the drive letter is A then an error message is issued and ; this routine is restarted. ; 3) The drive letter is translated to a zero based number (0-15) ; and stored at the location labeled savdrv. ; ;Print the prompt string GetDrv: ld de,drvmsg ;DE:= Pointer to the drive message ld c,prnfun ;C:= Print string function number call Bdos ;Print the Input Drive number string ;Get the user response ld c,conin ;C:= Console input function number call Bdos ;Get a character from the console cp cntrlC ;If (returned character is a control C) jp z,0 ; Goto Warm Boot ;Translate drive number and check for drive A (its illegal) and 5Fh ;Convert drive letter to upper case sub 'A' ;Convert drive letter to drive Number ld c,a ;BC:= Drive Number ld b,0 ld (savdrv),bc ;Save the Drive Number cp 1 ;If (drive eq 0) [i.e. drive A:] ld a,0 ; (0=valid drive) jr nc,GetEnd ld c,PrnFun ; C:= Print Function ld de,bdrv ; DE:= invalid drive mesg. call bdos ; Print the error string ld a,0FFh ; (FF=invalid drive) Getend: ret ;Return page ;---------------------------------------------------------------------- ; VALID - Validate the current drive (5_Jan_84) ;---------------------------------------------- ; 1) This routine validates the drive number selected to recieve the ; foreign media. ; 2) If the drive is geater than 15, flagged as invalid by seldsk or ; a hard disk, then an error message is put on the screen and an ; error return is made (accm=NON-zero). ; ;Check if the drive is greater than 15 (max allowed by the cbios) valid: ld bc,(savdrv) ;BC:= Current drive number ld a,15 ;If (Current drive is greater than 15) cp c ld de,bdrv ; DE:= Invalid drive message jr c,valerr ; GOTO Error Return ;Do a Seldsk ld a,9 ;A:= Function Number 9 (seldsk) ld (SaveFN),a ld bc,(savdrv) ;C:= current drive number ld (SaveBC),bc ld de,1 ;E:= NOT a first time select ld (SaveDE),de ld c,50 ;C:= Bdos function 50 (direct bios call) ld de,SaveFN ;DE:= Pointer to function 50 parameter block call Bdos ;call seldsk via function 50 ;Error if drive is invalid ld a,h ;If (hl eq 0) [the drive is invalid] or l ld de,bdrv ; DE:= invalid drive message jr z,valerr ; GOTO bad drive error ;Error if drive is a hard disk ld a,3 ;A:= Function_3 (get mtabs) call GetBuf ;HL:= Start of Mtabs ld bc,(savdrv) ;BC:= Drive Number (0-15) rlc c ;multiply drive number by 16 (length of 1 mtab) rlc c rlc c rlc c ld b,0 ;BC:= drive number * single mtab length add hl,bc ;HL:= pointer to start of current mtab ld de,hdmsg ;If (drive is a hard disk) bit 1,(hl) ; DE:= Hard disk illegal message jr nz,valerr ; GOTO error ld a,0 ;A:= Successful Completion return status ret ;Return valerr: ld c,prnfun ;C:= Print string function number call Bdos ;Print the Error Message ld a,0FFh ;A:= Error return status ret ;Return hljmp: jp (hl) ;Jump indirect HL to the seldsk function page ;---------------------------------------------------------------------- ; GETDEF - Get the Media Definiton Table (30_Jan_84) ;--------------------------------------------------- ; 1) This routine gets the media definition table ; ;Print the prompt string GetDef: ld de,medmsg ;DE:= Pointer to the Media message ld c,PrnFun ;C:= Print string function number call Bdos ;Print the Input Media number string ;Get the user response ld c,ConIn ;C:= Console input function number call Bdos ;Get a character from the console cp cntrlC ;If (returned character is a control C) jp z,0 ; Goto Warm Boot ;Validate the user response sub '1' ;Set number to zero based offset ld c,a ld a,(maxtbl) ;If (number exceeds the last table entry) cp c jr nc,GetSk1 ; GOTO error return ld de,Btbl ; DE:= Bad Table number message ld c,PrnFun ; C:= Print string function number call Bdos ; Print the Error Message jr GetDef ; GOTO Beginning of the routine GetSk1: ld a,c sla a sla a ;Input_Number:= Input_Number * 4 ld c,a ld b,0 ;BC:= Offset to the entry ld hl,medtbl ;HL:= Base of Media Table add hl,bc ;HL:= Start of the desired table ld e,(hl) inc hl ld d,(hl) ;DE:= Starting Address of Media Table inc hl ld c,(hl) inc hl ld b,(hl) ;BC:= Length of table ex de,hl ;HL:= Starting Address of Media Table ld de,dsk0 ;DE:= Start of the Media Table Template ldir ret page ;---------------------------------------------------------------------- ; SETXLT - SetUp the translate table for this drive (4_Jan_84) ;------------------------------------------------------------- ; 1) Drives with no translation tables return Immediately (with accm=0). ; 2) If the table was found or successfully installed then the accm is ; returned equal to zero. ; 3) If there was insufficient room in the table for the new translate ; table or the program failed to find a native drive then the accm ; is returned non-zero. ; 4) Register Usage: ; A -> General Purpose ; BC -> Length for moves ; DE -> Pointer to Xtl - 1 ; HL -> Pointer into free space ; SetXlt: ld de,(xltlen) ;If (the drive has a NO translate table) ld a,d or e ret z ; Return (status in accm = 0 = ok) ld a,8 ; A:= Function_8 (get free space) call GetBuf ; HL:= Pointer to Start of Free Space ;Search for a matching xlt or the end of the free space nomtch: ld a,(xlt) ;Loop A:= xlt code in template cp (hl) ; If (table header MATCHES xlt code) jp nz,skip1 ex de,hl ; DE:= Start of Xtl inc de inc de ; (use the matching xlt table) jr SXout ; Goto get xtl address skip1: ld a,0FFh ; A:= End of Table code cp (hl) ; If (entry type eq EOT) jr nz,skip3 ld a,(dsk0) ; If (drive type ne foreign) and $FRGN jr nz,skip2 ld de,MisTbl ; DE:= error message ld c,PrnFun ; (bdos print string function) call Bdos ; BDOS Print String Function Fatalº jð Fataì » Hang: Fataì Error ;Enter the Translate table into the free space pool skip2: call newent ; enter the new xlt table or a ; If (entry could not be made) ret nz ; Return (error) ;Generate the System's address for the new translate table SXout: inc de ex de,hl ; HL:= Start of Xtl in loc buf ld de,LocBuf ; DE:= Start of Local Buffer or a ; (clear the carry) sbc hl,de ; HL:= Offset from start Loc Buf ld de,(saveDE) ; DE:= Start of system free space add hl,de ; HL:= Pointer to xtl in free space ld (SavDph),hl ; Save Xlt Pointer call PutBuf ; ReWrite free space to sys mem ld a,0 ret ; Return (no error) ;Move the pointer to the start of the next entry skip3: inc hl ; get length of this xlt table ld e,(hl) ; and add it to the pointer. inc hl ld d,(hl) inc hl add hl,de jp nomtch ; (look at next xlt) page ;---------------------------------------------------------------------- ; NEWENT - Enter a new translation table into the free space (7_Nov_83) ;---------------------------------------------------------------------- ; 1) This routine is only used by the getxlt routine. ; 2) If the table was successfully installed then the DE register ; pair is returned pointing to the start of the table - 1 and the ; accm is returned zero. ; 3) If there wasn't enough room in the table then the DE register ; pair is returned pointing to the start of the error message and ; accm is returned non-zero. ; 4) Register Usage: ; A -> General Purpose, returned non-zero for error ; BC -> Used to hold offsets ; DE -> Temp data storage, returned with pointer to xlt or error ; HL -> Data pointer, enter with HL pointing at type byte ;Get the space remaining NewEnt: inc hl ld e,(hl) inc hl ld d,(hl) ex de,hl ;HL:= Space Remaining push de ;DE:= Start of Xtl Pointer - 1 ;Check if the xlt will fit ld bc,(xltlen) ;BC:= length of table inc bc inc bc inc bc ;(include type byte and length word) xor a ;(clear carry) sbc hl,bc ;If (space insufficient) jr nc,NewSkp ld c,PrnFun ; (bdos print string function) ld de,Nosp ; DE:= out of space message call Bdos ; BDOS Print String Function ld a,0FFh ; A:= error return status jr NewErr ; GOTO error return ;Copy the new xlt into the free space (type, leng-lo, leng-hi, table..) NewSkp: push hl ;(save space remaining) ld hl,xlt ;HL:= new xlt table pntr. dec de ;(DE overlays the current end of table entry) dec de ;DE:= Pointer to start of Xtl in free space ldir ;move xlt pop hl ;(hl=space remaining) ;Setup new EOT entry (type, space_remaining-lo, space_remaining-hi) ex de,hl ;DE:= remaining space ld (hl),0FFh ;put eot code at end of table inc hl ld (hl),e ;put space left at end of table inc hl ld (hl),d ld a,0 ;A:= Successful Completion NewErr: pop de ;DE:= xlt-1 pointer ret ;Return page ;---------------------------------------------------------------------- ; SETDPH - Install the Xlt pointer in the Dph (5_Jan_84) ;------------------------------------------------------- ; SetDph: ld a,4 ;A:= Function_4 (Read Dph's) call GetPnt ;HL:= Pointer to start of Dph ld de,(xltlen) ;If (the drive has a translate table) ld a,e or e jr z,setsk1 ld de,(SavDph) ;DE:= Xtl Pointer SetSk1: ld (hl),e inc hl ld (hl),d call PutBuf ;Restore the Dph Buffer ret ;---------------------------------------------------------------------- ; SETDPB - OverLay the current drive's Dpb (5_Jan_84) ;---------------------------------------------------- ; SetDpb: ld a,5 ;A:= Function_5 (Read Dpb's) call GetPnt ;HL:= Pointer to start of Dpb ex de,hl ;DE:= Start of Current Dph ld hl,dpb ;HL:= pointer to new Dpb ld bc,dpblen ;BC:= length of Dpb ldir ;replace Dpb call PutBuf ;ReWrite the Dpb Buffer ret ;---------------------------------------------------------------------- ; GETPNT - Get a Pointer into the current data structure (5_Jan_84) ;------------------------------------------------------------------ ; 1) This routine (used only by GetDph and GetDpb) returns the ; HL register pair pointing to the start of the current Dpb/Dph ; in the local buffer ; 2) Notice that the function number is passed in the accm (4 or 5) ; GetPnt: call GetBuf ;Fill the Local Buffer (function 4 or 5) ld hl,LocBuf ld de,(savdrv) ;DE:= Drive Number (0-15) rlc e ld d,0 ;multiply drive number by 2 add hl,de ;HL:= Pointer to pointer to Dpb/Dph in loc buf ld e,(hl) inc hl ld d,(hl) ex de,hl ;HL:= Pointer to start of Dpb/Dph in sys mem ld de,(saveDE) ;DE:= Start of system buffer xor a ;(Clear the carry) sbc hl,de ;HL:= Offset to start of Dpb/Dph ld de,LocBuf add hl,de ;HL:= Pointer to start of Dpb/Dph in loc buf ret page ;---------------------------------------------------------------------- ; SETMTB - Update the drive's MTAB (4_Jan_83) ;-------------------------------------------- ; 1) This routine updates the disk definition bytes in the current ; drive's MTAB. ; 2) The first byte of the MTAB is dskdef0. It contains flags for ; 1) Foreign Drive ($FRGN bit 6) ; 2) Sector Numbering Starting with Sector 0 (SECZRO bit 5) ; 3) Double Sided Media (DBLMED bit 2) ; 3) The second byte of the MTAB is dskdef1. It contains flags for ; 1) Double Density Media (DRVDEN bit 5) ; 2) Sector Size Code ($128, $256, $512 and $1024 in bits 0 & 1) ; 4) Register Usage: ; A -> General Purpose ; BC -> General Purpose ; HL -> Pointer ; ;Get pointer to the drive's mtab (in HL) SetMtb: ld a,3 ;A:= Function_3 (get mtabs) call GetBuf ;HL:= Start of Mtabs ld bc,(savdrv) ;BC:= Drive Number (0-15) rlc c ;multiply drive number by 16 (length of 1 mtab) rlc c rlc c rlc c ld b,0 ;BC:= drive number * single mtab length add hl,bc ;HL:= pointer to start of current mtab ;Update dskdef0 ld a,(hl) ;A:= dskdef0 for this drive and $DEF0 ;Remove all bits that can potentially be set ld b,a ld a,(dsk0) ;B:= dskdef0 Flag Definitions for this media or b ld (hl),a ;set dskdef0 ;Update dskdef1 inc hl ;HL:= dskdef1 for this drive ld a,(hl) ;A:= dskdef1 for this drive and $DEF1 ;Remove all bits that can potentially be set ld b,a ld a,(dsk1) ;B:= dskdef1 Flag Definitions for this media or b ld (hl),a ;set dskdef1 ;Update the format type byte ld bc,mftoff ;BC:= Offset to format type byte from dskdef1 add hl,bc ;HL:= Pointer to format byte in MTAB ld a,(xlt) ld (hl),a ;Format type:= current media's format code call PutBuf ;Write the Mtabs back into system memory ret ;Return page ;---------------------------------------------------------------------- ; GETBUF - Move system memory into the local buffer (4_Jan_84) ;------------------------------------------------------------- ; 1) This routine forces the destination to be the local buffer, calls ; the cold start (extended bios functions) entry point, and then saves ; the registers after swapping hl and de. ; GetBuf: ld de,LocBuf ;DE:= Pointer to Local Buffer call DoCold ;Move System Memory into the local buffer ld (saveBC),bc ;Save the returned registers ex de,hl ;HL:= Pointer to first xlt ld (saveDE),de ld (saveHL),hl ret ;Return ;---------------------------------------------------------------------- ; PUTBUF - Put the Local Buffer into System Memory (4_Jan_84) ;------------------------------------------------------------ ; 1) This is the inverse of GetBuf; It replaces the system's memory ; with the contents of the local buffer. ; 2) GetBuf MUST be called before entering this routine. ; PutBuf: ld a,1 ;Function_1:= Write to system memory ld bc,(SaveBC) ld de,(SaveDE) ld hl,(SaveHL) ;Restore the Returned Registers call DoCold ;Write the Mtabs back into system memory ret ;---------------------------------------------------------------------- ; DOCOLD - Call the Bios Cold Boot Entry Point (4_Jan_84) ;-------------------------------------------------------- ; 1) The Cold Boot Entry point to the bios (1st entry in the bios ; jump table) is located by looking at locations 1 & 2 which ; point to the warm boot address (the desired address + 3). ; DoCold: push hl ;Save the HL Register Pair ld hl,(Wbadd) ;HL:= Warm Boot Address ld l,0 ;HL:= Cold Boot Address ex (sp),hl ;Restore the HL Register Pair ret ;Goto The Cold Boot entry page ;---------------------------------------------------------------------- ; Message Strings (4_Jan_84) ;--------------------------- ; ; Title Block ;------------ ; opnmsg: db 1Ah,'MD-11 Foreign Drive Program Rev ' db ((frev and 0f0h) shr 4) + '0', '.', (frev and 0fh) + '0' db 9,9,9,9,' Copyright 1984' db cr,lf,'Morrow Designs Inc.' db 9,9,9,9,9,9,'San Leandro, Ca' db cr,lf,'$' ; Error Messages ;--------------- ; vmesg: db cr,lf,'Wrong Version of Cbios' db cr,lf,'This version of Foreign Requires CP/M vers 3.0 Cbios rev ' db ccl shr 4 + 30h,'$' bdrv: db cr,lf,'Invalid drive specified (valid drives are: B,C,D or E)$' hdmsg: db cr,lf,'Hard disk drive specified (only floppy drives are valid)$' btbl: db cr,lf,'Invalid media format selection$' mistbl: db cr,lf,'Portions of CP/M are missing from memory.' db cr,lf,'Push reset to re-boot CP/M.$' nosp: db cr,lf,'Too many foreign drives are defined.' db cr,lf,'Push reset to clear all foreign drives.$' ; Prompts ;-------- ; 1) The medmsg table must be ammended when installing a new drive. ; 2) To enter a new drive: ; - Put the message string in the table. ; - Increment any choice numbers that follow by one. ; - Note: To enable a new foreign drive format the media ; parameter lookup table (medtbl) must be updated and ; probably a new media parameter table will have to be entered. ; drvmsg: db cr,lf db cr,lf,'Disk drive to be used (B-E) $' medmsg: db cr,lf db cr,lf,' Vendor Density Sides' db cr,lf db cr,lf,' 1 Morrow Double One or Two' db cr,lf,' 2 IBM (Cp/m_86).....Double One' db cr,lf,' 3 Osborne Single One' db cr,lf,' 4 Osborne...........Double One' db cr,lf,' 5 Xerox-I Single One' db cr,lf,' 6 Xerox-II..........Double One' db cr,lf,' 7 KayPro Double One' db cr,lf,' 8 Hewlett Packard...Double Two' db cr,lf,' 9 Televideo Double Two' db cr,lf db cr,lf,'Enter the Number of the media format you wish to use $' page ;---------------------------------------------------------------------- ; Data Areas (4_Jan_84) ;---------------------- ; ; Lookup table for media tables (17_Nov_83) ;------------------------------------------ ; 1) The derived value maxtbl represents the number of entries in ; medtbl - 1. ; 2) The medtbl is used to find the selected media parameter table ; and then use it to overlay the media parameter template. ; 3) The medtbl must be updated when adding a new foreign drive to ; this program. Any entry consists of the starting address ; of the new media parameter table followed by its length. It ; is placed in the same relative position as it appears in the ; selection prompt text (medmsg). ; maxtbl: db ( (medend - medtbl) / 4) - 1 medtbl: dw morbeg ;Start address of the Morrow Parameter Block dw morend-morbeg ;Length of the Morrow Parameter Block dw ibmbeg ;Start address of the IBM Parameter Block dw ibmend-ibmbeg ;Length of the IBM Parameter Block dw os1beg ;Start address of Osborne S.D. Parameter Block dw os1end-os1beg ;Length of the Osborne S.D. Parameter Block dw os2beg ;Start address of D.D. Osborne Parameter Block dw os2end-os2beg ;Length of the Osborne D.D. Parameter Block dw xr1beg ;Start address of Xerox S.D. Parameter Block dw xr1end-xr1beg ;Length of the Xerox S.D. Parameter Block dw xr2beg ;Start address of Xerox D.D. Parameter Block dw xr2end-xr2beg ;Length of the Xerox D.D. Parameter Block dw kaybeg ;Start address of KayPro D.D. Parameter Block dw kayend-kaybeg ;Length of the KayPro D.D. Parameter Block dw hp1beg ;Start address of Hewlett Packard D.D. Parameter Block dw hp1end-hp1beg ;Length of the Hewlett Packard D.D. Parameter Block dw telbeg ;Start address of Televideo D.D. Parameter Block dw telend-telbeg ;Length of the Televideo D.D. Parameter Block medend: page ; Media Parameter Template (17_Nov_83) ;------------------------------------- ; 1) The selected Media Parameter Table is copied into this area ; for processing. ; 2) When adding a new foreign drive, if none of the existing tables ; exactly match the desired table, then you'll have to build a ; media paramter table to fit by using the closest existing table. ; dsk0: db 0 ;value to be ored into dskdef0 dsk1: db 0 ;value to be ored into dskdef1 dpb: dw 0 ;secs per track db 0 ;block shift db 0 ;block mask db 0 ;extnt mask dw 0 ;disk size-1 dw 0 ;directory max db 0 ;alloc0 db 0 ;alloc1 dw 0 ;check size dw 0 ;offset xlt: db 0 ;xlt code xltlen: dw 0 ;xlt length ds 128 ;Translation Table ;Local Buffers ;------------- ; LocBuf: ds 600h ;Local Buffer for system data LocStk: dw 0 ;Local Stack Area builds down ;General Parameters ;------------------ ; 1) The save locations are used for saving the register pairs after ; extended bios call (function 0) and for the Bdos 50 (direct bios ; call) instruction. ; SaveFN: db 0 ;Function Number SaveA: db 0 ;Save of the Accm SaveBC: dw 0 ;Save of the BC registers after bios_0 call SaveDE: dw 0 ;Save of the DE registers after bios_0 call SaveHL: dw 0 ;Save of the HL registers after bios_0 call Savdrv: dw 0 ;Save Location for the drive number Savdph: dw 0 ;Save Location for replacement Dph Xlt pointer page ;---------------------------------------------------------------------- ; Morrow: D.S. - D.D. Media Characteristics (4_Jan_84) ;----------------------------------------------------- ; Physical Media Characteristics: ; Double Sided ; Sector numbering starts with sector 1 ; Double Density ; 1024 bytes per sector ; 5 sectors per track ; morbeg: db $DBLMED ;(dsk0) value to be ored into dskdef0 db $DRVDEN or $1024 ;(dsk1) value to be ored into dskdef1 ;DPB Definition dw 40 ;secs per track db 4 ;block shift db 15 ;block mask db 1 ;extnt mask dw 94 ;disk size-1 dw 127 ;directory max db 0c0h ;alloc0 db 0 ;alloc1 dw 32 ;check size dw 2 ;offset ;XLT Table Definition db morcod ;format code for Morrow Drive dw 5 ;Translate table length db 1,4,2,5,3 morend: page ;---------------------------------------------------------------------- ; IBM: S.S. - D.D. Media Characteristics (7_Nov_83) ;-------------------------------------------------- ; Physical Media Characteristics: ; Single Sided ; Sector numbering starts with sector 1 ; Double Density ; 512 bytes per sector ; 8 sectors per track ; ibmbeg: db $FRGN ;(dsk0) value to be ored into dskdef0 db $DRVDEN or $512 ;(dsk1) value to be ored into dskdef1 ;DPB Definiton dw 32 ;secs per track db 3 ;block shift db 7 ;block mask db 0 ;extnt mask dw 155 ;disk size-1 dw 63 ;directory max db 0c0h ;alloc0 db 0 ;alloc1 dw 16 ;check size dw 1 ;offset ;XLT Table Definition db ibmcod ;format code for IBM Drives dw 0 ;Translation table length ibmend: page ;---------------------------------------------------------------------- ; Osborne: S.S. - S.D. Media Characteristics (4_Jan_84) ;------------------------------------------------------ ; Physical Media Characteristics: ; Single Sided ; Sector numbering starts with sector 1 ; Single Density ; 256 bytes per sector ; 10 sectors per track ; os1beg: db $FRGN ;(dsk0) value to be ored into dskdef0 db $256 ;(dsk1) value to be ored into dskdef1 ;DPB Definiton dw 20 ;secs per track db 4 ;block shift db 15 ;block mask db 1 ;extnt mask dw 45 ;disk size-1 dw 63 ;directory max db 128 ;alloc0 db 0 ;alloc1 dw 16 ;check size dw 3 ;offset ;XLT Table Definition db os1cod ;xlt code dw 10 ;xlt length db 1,3,5,7,9,2,4,6,8,10 os1end: page ;---------------------------------------------------------------------- ; Osborne: S.S. - D.D. Media Characteristics (17_Nov_83) ;------------------------------------------------------- ; Physical Media Characteristics: ; Single Sided ; Sector numbering starts with sector 1 ; Double Density ; 1024 bytes per sector ; 5 sectors per track ; os2beg: db $FRGN ;(dsk0) value to be ored into dskdef0 db $DRVDEN or $1024 ;(dsk1) value to be ored into dskdef1 ;DPB Definiton dw 40 ;secs per track db 3 ;block shift db 7 ;block mask db 0 ;extnt mask dw 184 ;disk size-1 dw 63 ;directory max db 0C0h ;alloc0 db 0 ;alloc1 dw 16 ;check size dw 3 ;offset ;XLT Table Definition db os2cod ;xlt code dw 0 ;xlt length os2end: page ;---------------------------------------------------------------------- ; Xerox: S.S. - S.D. Media Characteristics (7_Nov_83) ;---------------------------------------------------- ; Physical Media Characteristics: ; Single Sided ; Sector numbering starts with sector 1 ; Single Density ; 128 bytes per sector ; 18 sectors per track ; xr1beg: db $FRGN ;(dsk0) value ored into dskdef0 db $128 ;(dsk1) value ored into dskdef1 ;DPB Definition dw 18 ;sectors per track db 3 ;block shift db 7 ;block mask db 0 ;extnt mask dw 82 ;disk size-1 dw 31 ;directory max db 128 ;alloc0 db 0 ;alloc1 dw 8 ;check size dw 3 ;offset ;XLT Table Definition db xr1cod ;xlt code dw 18 ;xlt length db 1,6,11 ;Translation Table db 16,3,8 db 13,18,5 db 10,15,2 db 7,12,17 db 4,9,14 xr1end: page ;---------------------------------------------------------------------- ; Xerox: S.S. - D.D. Media Characteristics (17_Nov_83) ;----------------------------------------------------- ; Physical Media Characteristics: ; Single Sided ; Sector numbering starts with sector 1 ; Double Density ; 256 bytes per sector ; 17 sectors per track ; xr2beg: db $FRGN ;(dsk0) value to be ored into dskdef0 db $DRVDEN or $256 ;(dsk1) value to be ored into dskdef1 ;DPB Definition dw 34 ;sectors per track db 3 ;block shift db 7 ;block mask db 0 ;extnt mask dw 156 ;disk size-1 dw 63 ;directory max db 0C0h ;alloc0 db 0 ;alloc1 dw 16 ;check size dw 3 ;offset ;XLT Table Definition db xr2cod ;xlt code dw 0 ;xlt length xr2end: page ;---------------------------------------------------------------------- ; KayPro: S.S. - D.D. Media Characteristics (17_Nov_83) ;------------------------------------------------------ ; 1) Physical Media Characteristics: ; Single Sided ; Sector numbering starts with sector 0 ; Double Density ; 512 bytes per sector ; 10 sectors per track ; kaybeg: db $FRGN or $SECZRO ;(dsk0) value ored into dskdef0 db $DRVDEN or $512 ;(dsk1) value to be ored into dskdef1 ;DPB Definiton dw 40 ;secs per track db 3 ;block shift db 7 ;block mask db 0 ;extnt mask dw 194 ;disk size-1 dw 63 ;directory max db 0C0h ;alloc0 db 0 ;alloc1 dw 16 ;check size dw 1 ;offset ;XLT Table Definition db kaycod ;format code for KayPro Drives dw 0 ;Translation table length kayend: page ;---------------------------------------------------------------------- ; Hewlett-Packard: D.S. - D.D. Media Characteristics (17_Nov_83) ;--------------------------------------------------------------- ; 1) Physical Media Characteristics: ; Double Sided ; Sector numbering starts with sector 0 ; Double Density ; 256 bytes per sector ; 16 sectors per track ; hp1beg: db $FRGN or $SECZRO or $DBLMED ;(dsk0) value ored into dskdef0 db $DRVDEN or $256 ;(dsk1) value ored into dskdef1 ;DPB Definiton dw 32 ;secs per track db 3 ;block shift db 7 ;block mask db 0 ;extnt mask dw 255 ;disk size-1 dw 127 ;directory max db 0F0h ;alloc0 db 0 ;alloc1 dw 32 ;check size dw 3 ;offset ;XLT Table Definition db hp1cod ;format code for Hewlett Packard Drives dw 0 ;Translation table length hp1end: page ;---------------------------------------------------------------------- ; Televideo: D.S. - D.D. Media Characteristics (23_Apr_84) ;--------------------------------------------------------- ; 1) The value of 0 for the extent mask will cause only 1/2 of the ; allocation block area for a given directory entry to be used. ; This may be odd but that's the way it is. ; 2) Physical Media Characteristics: ; Double Sided ; Sector numbering starts with sector 1 ; Double Density ; 256 bytes per sector ; 18 sectors per track ; telbeg: db $FRGN or $DBLMED ;(dsk0) value ored into dskdef0 db $DRVDEN or $256 ;(dsk1) value ored into dskdef1 ;DPB Definiton dw 36 ;secs per track db 4 ;block shift db 15 ;block mask db 0 ;extnt mask dw 170 ;disk size-1 dw 63 ;directory max db 80h ;alloc0 db 0 ;alloc1 dw 16 ;check size dw 4 ;offset ;XLT Table Definition db telcod ;format code for Televideo Drives dw 0 ;Translation table length telend: end