;############################################################################## ; The following equates are for the Jade system, Inclusive of the BIOS and ; ZCPR2. These equates are used by both during assembly. ; ; Ty Wernet 4/83 ; ;############################################################################## ;jz .xlist ;turn off listing ;jz .sall ;m80 directive to indicate a macro .sfcond ;suppress false conditionalls ;****************************************************** ; Miscellaneous Definitions * ;****************************************************** false equ 0 true equ not false cr equ 0dh ;carriage return lf equ 0ah ;line feed tab equ 09h ;a tab character off equ 0 on equ 1 ; ;****************************************************** trace equ true ; debugging messages * ;****************************************************** ; ;****************************************************** ; disk operating system addresses. * ;****************************************************** msize equ 64 ;size of memory in system biosex equ 4 ;size of extra bios room (5 for hdisk else 4) cpm$nk equ msize-biosex ;system size k bytes. k$b equ 1024 ;1k byte size. hk$b equ 512 ;200 hex bytes cpm$sz equ cpm$nk * k$b ;top system address. cpm$bs equ cpm$sz-(20*k$b) ;cp/m bias value. ccpcold equ cpm$bs+3400h ;address of ccp cold start ccpwarm equ ccpcold+3 ;address of warm start bdos equ cpm$bs+3c00h ;address of bdos. bios equ cpm$bs+4a00h ;address of bios df$loc equ 0004h ;drive assign location. io$loc equ 0003h ;i/o byte location. nfd equ 2 ;number of floppy drives ptrtype defl 3 ;ptr type 0=serial 1=parallel 2=ttl 3=iobyte dblside equ false ;double sided disk flag user0 equ on ;user 0 public flag on or off ; Set conditional to true if owner of a hard disk ; all$sz defl 39 ;allocation vector 801@2K, 851@4K nvhd equ 8 ;number of virtual hard disks Xdisk equ false ;XCOMP/RMS-512 hard disk MS2012 equ false ;ZOBEX/Miniscribe hard disk MS4020 equ false ;ZOBEX/Miniscribe hard disk Zdisk equ MS2012 or MS4020 hdisk equ Xdisk or Zdisk ;have some kind of hard disk if MS4020 HK.MXC equ 523 ; maximum cylinder number for PS-100 HK.MXS equ 23 ; maximum sector no. per track if2 .printx 'HardDisk = PRIAM 3350/ADES CONTROLLER' endif endif if Zdisk HK.MXH equ 4 ; maximum head number ntvhd equ (HK.MXC+1)/nvhd all$sz defl ntvhd*(HK.MXS+1)*(HK.MXH+1)/64+1 ; one bit for each 4K block endif ; Set high order bit of initial i/o byte value to 1 to force lst:device to ; come up with serial driver active. ;iobyte equ 10000000b ;initial iobyte value. iobyte equ 00000000b ;initial iobyte value. fcbsiz equ 36 ;size of a fcb stksiz equ 48 ;recommended size for ccp stack pathsiz equ 16 ;pathsiz/2 is effective number of paths dbne equ 00 ;number of directory buffer entries dbes equ 11 ;size of a directory entry dbsiz equ dbne*dbes ;size of buffer zcprbfr equ 0fa00h ;start of zcpr buffer area zcpravl defl zcprbfr ;available area for zcpr2 buffer use zcprcbs equ 200 ;multiple command buffer size if dblside ;have double sided disks chksz equ 64 ;256 directory entries/4 else chksz equ 32 ;128 directory entries/4 endif ;****************************************************** ; zero fill storage allocation * ;****************************************************** zfill macro nb ;fill nb times rept nb ;repeat nb times db 0 ;assign a zero bit endm ;end rept endm ;end macro ;############################################################################## ; byte allocation for a string without expansion # ; usage: string # ;############################################################################## string macro str irp chr, ;get character db chr ;assign character endm ;end repeat endm ;end macro ;############################################################################## ;Message for displaying at run time and at bootstrap time # ;############################################################################## message macro msg: string db cpm$nk/10+30h ;figure size of bios db (cpm$nk mod 10)+30h string <"k CP/M 1P.00 05/11/84",' '+80h>;rest of message string <"$",1ah> ;for print function and typeing msg$sz equ ($-msg)-2 ;size of msg to move don't endm ;############################################################################## ; Reader handler # ; Punch handler # ;############################################################################## rdrdrvr macro .xlist reader::ld a,1ah ;eof .list endm pundrvr macro .xlist punch:: ret ;return to caller .list endm ;############################################################################## ; Printer equates ; Printer driver code ; Printer Status code ; ;############################################################################## ptrser equ 0 ;serial printer ptrpar equ 1 ;parallel printer ptrttl equ 2 ;TTL printer ptriob equ 3 ;serial/parallel printer using i/o byte if ptrtype eq ptrser ;serial printer definations lst$sp equ 004h ;listing status port lst$sb equ 001h ;listing status bit lst$ob equ 000h ;1 if bit on=>output busy lst$dp equ 005h ;output data port endif; if ptrtype eq ptrpar ;serial printer definations lst$sp equ 070h ;listing status port lst$sb equ 080h ;listing status bit lst$ob equ 001h ;1 if bit on=>output busy lst$dp equ 070h ;output data port endif; if ptrtype eq ptrttl ;ttl printer lst$sp equ 1 ;listing status port lst$sb equ 080h ;listing status bit lst$ob equ 0 ;1 if bit on => output busy endif if ptrtype eq ptriob lst$sp equ 004h ;listing status port lst$sb equ 001h ;listing status bit lst$ob equ 000h ;1 if bit on=>output busy lst$dp equ 005h ;output data port iopasb equ 1 ;status bit I/O byte parallel port a iopa$p equ 0feh ;data port endif ;############################################################################## ; ptrdrvr macro ; ;############################################################################## ;--- Serial printer driver ---------------------------------------------------- ; if ptrtype eq ptrser or ptrtype eq ptrpar ;serial/parallel prt driver if2 .printx 'SERIAL/PARALLEL Printer Driver Selected' endif list: call listst ;test for printer ready jr z,list ;loop if not ld a,c out (lst$dp),a ret ;done endif ;--- TTL printer driver ------------------------------------------------------- ; if ptrtype eq ptrttl if2 .printx 'TTL printer driver selected' endif list: call listst ;get status jr z,list ;wait until printer not busy ;************************************************************************** ; The following routine sends one 8-bit character out the rts* bit on the * ; Big-Z usart using Pluse-width mod. * ;************************************************************************** ld b,08 ;number of data bits ;***( Send each data bit ) *****;( 39 cycle loop ) ********************** ..data: rrc c ;rotate c reg right ld a,27h ;usart background+start out (lst$sp),a ;send bit start jr nc,.short ;zero-bit is low 6-8us ex (sp),hl ;one-bit is low 16-18us ex (sp),hl ;time delay (4 mhz cpu) .short: ld a,07h ;usart background+stop out (lst$sp),a ;send bit stop djnz ..data ;loop over all data bits ret ;done endif ;--- I/O Byte printer driver -------------------------------------------------- ; if ptrtype eq ptriob ;if using io byte if2 if iobyte gt 0 ;if greater than 0 then serial selected .printx 'Serial Printer Driver using I/O byte selected' else .printx 'Parallel Printer Driver using I/O byte selected' endif endif; list: ld a,(io$loc) ;get i/o byte bit 7,a ;see if parallel printer requested jr z,plist ;go process parallel output slist: call slistst ;test for printer ready process serial output jr z,slist ;wait till printer ready ld a,c ;get character into a out (lst$dp),a ;output character to data port ret ;then return plist: call plistst ;get status jr z,plist ;wait until printer ready ld a,c ;get character into c out (iopa$p),a ;output character to data port ret endif endm ;############################################################################## ; ptrstat macro ; ;############################################################################## ;--- Serial or TTL status request --------------------------------------------- ; if ptrtype eq ptrser or ptrtype eq ptrpar or ptrtype eq ptrttl if2 .printx 'SERIAL/PARALLEL/TTL status driver selected' endif listst: in a,(lst$sp) ;read printer status port xor lst$ob*0ffh ;comp stat if high=>not rdy and lst$sb ;leave only ready bit ret z ;done if printer not ready ld a,0ffh ;get ready flag ret ;done endif ;--- I/O Byte printer status driver ------------------------------------------- ; if ptrtype eq ptriob ;I/O byte if2 .printx 'I/O Byte status driver selected' endif listst: ld a,(io$loc) ;get i/o byte bit 7,a ;see which printer selected jr z,plistst ;parallel printer selected slistst:in a,(lst$sp) ;get status of printer and lst$sb ;leave only status bit ret z ;return printer not ready ld a,0ffh ;indicate printer is ready ret ;and return plistst:in a,(iopa$p) ;get status cpl ;complement and iopasb ;leave status bit ret z ;printer busy ld a,0ffh ;printer not busy ret endif endm ;############################################################################## ; The INTSTACK equate is used to specify if the stack is internal or # ; external to ZCPR2. Naturally, quite a bit of space is saved if the # ; stack is placed external to ZCPR2. If such is the case, the user # ; should set the STKBASE equate to the beginning of the stack area # ; (bottom of the stack). NOTE: THIS IS THE BOTTOM OF THE STACK, NOT THE # ; TOP OF THE STACK. # ; # ; If INTSTACK is TRUE, the stack is internal to ZCPR2. If INTSTACK is # ; FALSE, the stack is external to ZCPR2, and the base of the stack # ; (bottom of the stack) is located at STKBASE. # ; # ;############################################################################## intstack equ false ;Enable or Disable Internal Stack stkbase equ zcpravl ;Address of Bottom of External Stack stack equ stkbase+stksiz ;Address of Top of Stack zcpravl defl stack ;next available address ;############################################################################## ; This equate determines if the ZCPR2 FCB is located internal to or external # ; to ZCPR2. If EXTFCB is TRUE, FCBADR defines where it is located. By # ; placing the ZCPR2 FCB external to ZCPR2, more space is freed up for other # ; uses within ZCPR2. # ;############################################################################## extfcb equ true ;Allow External FCB fcbadr equ zcpravl ;Address of External FCB zcpravl defl fcbadr+fcbsiz ;next available address ;############################################################################## ;This is the directory buffer address and reserved area. # ;############################################################################## if dbne zcprdba equ zcpravl ;directory buffer address zcpravl defl zcprdba+dbsiz ;directory buffers reserved endif ;############################################################################## ; The following equate specifies the address of the PATH to be followed # ; for the PATH command-search if the PATH is to be initialized by the BIOS # ; and set by the user via a PATH.COM program. The value of PATH should # ; be the address of the PATH data area in memory. If the internal PATH # ; provided by ZCPR2 is to be used, then INTPATH should be equated to TRUE, # ; which selects the PATH located just after the MEMLOAD routine. If the # ; external PATH is to be used, then INTPATH should be equated to FALSE and # ; and equate for the address of the PATH should be provided. # ; A PATH is a series of byte-pairs, terminated by a binary 0. The first # ; byte of each pair is the disk number (1-16 for disks A-P), and the second # ; byte of each pair is the user number (0-31). The special character '$' # ; indicates the current user or current disk. For example, the path # ; from current disk/current user to current disk/user 0 to disk A/user 0 # ; is selected by the following sequence: # ; DB '$$' ;current disk/user # ; DB '$',0 ;current disk/user 0 # ; DB 1,0 ;disk A/user 0 # ; DB 0 ;end of path # ; NOTE: If DRVPREFIX is TRUE, then current disk/user is automatically # ; searched, and including it in the command search path causes it to be # ; searched twice, wasting time (and space in the path). Since many environs # ; will run with DRVPREFIX = TRUE, then a good command search path would not # ; include the current disk/user. # ; # ;############################################################################## intpath equ true ;internal ZCPR2 PATH SELECTED if not intpath ;External Path Selected ;This equate defines the base address of the external path ; path equ zcpravl ;External ZCPR2 PATH at CBIOS Buffer Area zcpravl defl path+pathsiz ;update new address else ;Internal Path Selected ipath macro ;Macro defines the n-element internal path db '$',0 ;Current Disk, User 0 db 'A'-'@',0 ;Disk A, User 0 db 'A'-'@',0fh db 0 ;End of Path -- MUST be here endm endif ;############################################################################## ; The MULTCMD equate enables the feature of having more than one command on # ; the same line, separated by a separation char which is defined by the CMDSEP# ; equate. If this feature is enabled, the command line buffer and buffer # ; pointers are moved outside of ZCPR2 at the indicated address of CLBASE. # ;############################################################################## multcmd equ true ;Multiple Commands on one line permitted cmdsep equ '&' ;Command Separator clbase equ zcpravl ;Base address of buffer buflen equ zcprcbs ;# Bytes in Input Buffer zcpravl defl clbase+buflen+4 ;update next available address to use ;############################################################################## ;This macro assigns the bytes to the required locations needing setup for the # ;installation of zcpr. # ;############################################################################## setup macro ld hl,zcprbfr ld (hl),0 ld de,zcprbfr+1 ld bc,198 ldir if not intpath ld de,path ;destination address else ld de,clbase endif ld hl,.bufrs ;buffer to move ld bc,.bufrl ;number of bytes to move ldir ;and do it if dbne ;if any directory entries ld de,zcprdba ;address of directory buffers ld hl,.dbuf ;buffer to move ld bc,.dbufl ;length to move ldir endif jr sudone ;and setup is done .bufrs: if not intpath .path: db '$',0 ;Current Disk, User 0 db 'A'-'@',0 ;Disk A, User 0 zfill pathsiz-($-.bufrs);End of Path -- MUST be here endif .mclb: dw clbase+4 ;address of multiple command line buffer db buflen ;length of this buffer db 0 ;no characters in buffer at this time ; db 0 ;string name of file to execute at cold boot ; db 0 .bufrl equ $-.bufrs ;length of this buffer to move if dbne .dbuf: db dbne ;number of directory entries db 0 ;number of entries stored db 0,0,0 ;1st disk#,1st user#,1st directory name .dbufl equ $-.dbuf ;length to move endif sudone: endm ;end the macro .list