PAGE ;BIOS1 - Common definitions. DELCNT: EQU 5*1000 ;Delay count for 5 Mhz CPU CR: EQU 0Dh LF: EQU 0Ah BELCHR: EQU 07 EOS: EQU 0 K: EQU 1024 BDOSINT = 224 ;BDOS Interrupt number OPTS = 40h ;board option switches (by Boot) ;RESTART = 0FFFFh ;paragraph of hardware restart ORG 408h TICKH DS 2 ;Banger parameters OPTSH DS 1 ;OPT_SW ALIGN MACRO BITS ORG (*+(%1)-1) / (%1) * (%1) ENDM ; CP/M to host disk constants HSTSIZ: EQU 1024 ;Blocking/Deblocking buffer size CPMSIB: EQU 1024/128 ;Standard sectors in block FPYSIB: EQU 2048/128 ;Sectors in floppy disk block HRDSIB: EQU 4096/128 ;Sectors in hard disk block ; CP/M disk control block equates which define the ; disk types and maximum storage capability of each ; disk type. DSKS1: EQU 0 ;Single density, single sided. DSKS2: EQU 1 ;Single density, double sided. DSKD1: EQU 2 ;Double density, single sided. DSKD2: EQU 3 ;Double density, double sided. DSKD3: EQU 4 ;Double density, single sided DSKD4: EQU 5 ;Double density, double sided DSKD5: EQU 6 ;Double density, single sided DSKD6: EQU 7 ;Double density, double sided MAXFTP: EQU DSKD6 ;Maximum floppy type DSK8S1: EQU 8 ;SA 1002 and first half SA 1004 DSK8S2: EQU 9 ;last half SA 1004. DSK8M1: EQU 10 ;First half of Memorex 8 inch drive DSK8M2: EQU 11 ;Last half of Memorex 8 inch drive S1DSM: EQU ((77-2)*26)/CPMSIB S2DSM: EQU ((77-2)*2*26)/FPYSIB D1DSM: EQU ((77-2)*2*26)/FPYSIB D2DSM: EQU ((77-2)*2*2*26)/FPYSIB D3DSM: EQU ((77-2)*4*15)/FPYSIB D4DSM: EQU ((77-2)*2*4*15)/FPYSIB D5DSM: EQU ((77-2)*8*8)/FPYSIB D6DSM: EQU ((77-2)*2*8*8)/FPYSIB S8DSM: EQU (2*(256-1)*2*32)/HRDSIB M81DSM: EQU (4*(122-1)*4*21)/HRDSIB M82DSM: EQU (4*(122-0)*4*21)/HRDSIB ; BDOS constants on entry to write WRALL: EQU 0 ;write to allocated WRDIR: EQU 1 ;write to directory WRUAL: EQU 2 ;write to unallocated PAGE ; Macro for generating Control Blocks for disk drives ; The format of these disk control blocks are as follows: ; 16 bits = -> translation table. ; 48 bits = Work area for CP/M. ; 16 bits = -> DIRBUF. ; 16 bits = -> Parameter block. ; 16 bits = -> check vector. ; 16 bits = -> allocation vector. NDSK: SET 0 ;Number of disk drives NOHRD: SET 0 ;Number of hard disk drives NOFDD: SET 0 ;Number of floppy disk drives ALVS: SET 0 ;Allocation vector size CSVS: SET 0 ;Check vector size DPHGEN MACRO TYPE,XLATE,DIRBUF,DPBADR NDSK: SET NDSK+1 DW %2 DW 0,0,0 DW %3 DW %4 DW CSV+CSVS DW ALV+ALVS .TYPE IF %1 <= DSKD6 NOFDD: SET NOFDD+1 CSVS: SET CSVS+(256/4) ALVS: SET ALVS+((D6DSM+7)/8) ELSE NOHRD: SET NOHRD+1 .HRD IF %1 <= DSK8S2 ALVS: SET ALVS+((S8DSM+7)/8) ELSE ALVS: SET ALVS+((M81DSM+7)/8) .HRD ENDIF .TYPE ENDIF ENDM SPACE 4,10 ; Macro for generating the Disk Parameter Blocks. ; ; Disk type definition blocks for each particular mode. ; The format of these areas are as follow: ; 8 bit = disk type code ; 16 bit = Sectors per track ; 8 bit = Block shift ; 8 bit = BS mask ; 8 bit = Extent mask ; 16 bit = Disk size/1024 - 1. ; 16 bit = Directory size. ; 16 bit = Allocation for directory. ; 16 bit = check area size. ; 16 bit = offset to first track. DPBGEN MACRO TYPE,SPT,BSH,BSM,EXM,DSM,DIRSIZ,ALVMSK,OFFSET DB %1 DW %2 DB %3,%4,%5 DW %6-1,%7-1,REV (%8) .HRD IF %1 <= DSKD6 DW (%7+3)/4 ELSE DW 0 .HRD ENDIF DW %9 ENDM page ; CP/M86 memory organization: ; ; 0000: 0000 +-----------------------+ Absolute ; | Interrupt vectors | ; 0400 | Transfer area | ; 040F +-----------------------+ ; ; SysSeg: +-----------------------+ 410 nominal ; 0000 | | ; | CCP 88 | ; 0AFF | | ; +-----------------------+ ; 0B00 | | ; | BDOS 88 | ; 24FF | | ; +-----------------------+ ; 2500 | | ; | BIOS 88 | ; | | ; 2E00 +-----------------------+ ; | uninit storage | ; 3400 +-----------------------+ 3810 ; ; ; LdrSeg: +-----------------------+ 4000 normal ; 0000 | | ; | LdCpm | ; 03FF | | ; +-----------------------+ ; 0400 | | ; | LdBdos | ; 11FF | | ; +-----------------------+ ; 1200 | | ; | LdBios | ; | | ; 1B00 +-----------------------+ ; | uninit storage | ; 2200 +-----------------------+ 6200 ; ; ; FFFF: +-----------------------+ ; 0000 | jmpl 0400h,0 | ; +-----------------------+ ORG 0000h ;Zero segment ZSEG: EQU 0000h ; Interrupt 224 -- BDOS call interrupt vector. ORG 4*BDOSINT STRAP: DS 2 ;Offset STRPSG: DS 2 ;Paragraph space 4,10 ORG 0000h ;System segment CCP: DS L$CCP BDOS: DS L$DOS BDOSE: = BDOS+6 ;True entry point space 4,10 ; The following jump vector defines the entry points into ; the CBIOS for use by CP/M86; therefore the order of ; these jumps cannot be modified. BIOS: JMP CBOOT ;Cold boot JMP WBOOT ;Warm boot j.CST: JMP CONST ;Console status (input) j.CIN JMP CONIN ;Console input j.COUT JMP CONOUT ;Console output JMP LIST ;List output JMP PUNCH ;Punch output JMP READER ;Reader input JMP HOME ;Set track to zero JMP SELDSK ;Select disk unit JMP SETTRK ;Set track JMP SETSEC ;Set sector JMP SETDMA ;Set Disk Memory Address JMP READ ;Read from disk JMP WRITE ;Write onto disk J.LST: JMP LISTST ;List status (output) JMP SECTRN ;Translate sector number JMP SETXAD ;Set DMA segment address. JMP GETSGT ;Get segment table address JMP GETIOB ;Get IOBYTE JMP SETIOB ;SET IOBYTE ; What follows is not part of the formal interface ; to CP/m, however various CompuPro/Sorcim utilities ; will not operate properly if arbitrary alterations ; are made. Caveat moderator. j.CPM: JMPL 0,SysSeg ;(reserved) ; Floppy step rate. STEPMS: VFD 4\ SRT, 4\ 0 space 4,10 ; Board option switches. ; Boot stores switch settings into OPTS. ; CBios/CBoot copies into OPT_SW. ; 0= Normal. ; 1= Use BitBanger for console. ; 2= (reserved) ; 3= (available) OPT_SW: DB 0 space 4,10 ; IOBYTE -- not presently used by this CP/M86 BIOS. ; ; 7 6 5 4 3 2 1 0 ; +--------+-------+-------+--------+ ; | List | Punch | Reader| Console| ; +--------+-------+-------+--------+ IOBYTE: DB 0 space 4,10 ; Memory region descriptors. ; ; +---------------+ ; MRT: | region count | ; +---------------+---------------+ ; 0: | region base | ; +---- ----+ ; | region length | ; +-------------------------------+ ; | | ; . . . ; | | ; +---------------+---------------+ ; n: | region base | ; +---- ----+ ; | region length | ; +-------------------------------+ ; ; The region base is a paragraph and the length is ; in paragraphs. HiBase = 0F000h + (1000h - HIMEM) MRT: DB MRTCNT DW SYSEND, LOMEM-SYSEND IF HiMem <> 0 DW HiBase, HiMem-1 endif MRTCNT: = (*-MRT-1)/4 ECHO 8-MRTCNT DW 0, 0 ENDM ; Endx BIOS1