page 0 ; ; cp/m coldstart loader ; ; ; this program is loaded at location zero ; by the bootstrap program, and executed. ; its purpose is to load and execute the ; cp/m disk operating system at the top ; of the memory in use. ; false set 0 ;define value of false. true set not false ;define value of true. ; ; msize equ 62 ;memory size in decimal kb. disk equ 0e8h ;disk port base address adm3a equ false ;true for adm3a term. hazltn equ true ;true for hazltn term. netvdb equ false ;true for netronics term. vers equ 22 ;cp/m version number bvers equ 21 ;bios version number ; .18 release of sept 80 ; .19 fixed 4 drv problem ; added usr #'s in cmd prompt ; made usr #0 public to all ; (19-Apr-81) ; .20 added support for patch 3 ; (19-May-81) ; .21 added support for mixed drvs ; (09-Jun-81) ; if hazltn formfd equ 28 endif if adm3a or netvdb formfd equ 12 endif ; dcom equ disk ;command port dstat equ disk ;status port track equ disk+1 ;track port sect equ disk+2 ;sector port data equ disk+3 ;data port wait equ disk+4 ;wait port dcont equ disk+4 ;control port spt equ 26 ;number of sectors/track ; stat51 equ 0e1h cntl51 equ 0e1h rxd51 equ 0e0h mode51 equ 0ceh cmd51 equ 27h ; cbase equ (msize-20)*1024 cpmb equ cbase+3400h ;start of cp/m boote: equ cpmb+1600h ;cold boot entry point nsects equ 51 ;sectors of cp/m rtcnt set 10 ;number of retrys smsg: if hazltn db 126 endif db formfd db 'Netroincs ' db msize/10+'0',msize mod 10+'0' db 'k CP/M v',vers/10+'0','.',vers mod 10+'0' db bvers/10+'0',bvers mod 10+'0' db ' (C) 1980' db 13,10,0 boot: mvi e,rtcnt ;get retry count bloop: lxi h,cpmb ;cp/m starts here mvi d,nsects ;no. of sectors to read mvi c,2 ;sector no. rntrk: mvi b,4 ;for head load mov a,c ;sector in a rnsec: read: out sect ;set sector reg. mvi a,88h ;command for read ora b ;get head load bit out dcom ;issue command rloop: in wait ora a jp check in data mov m,a inx h jmp rloop check: in dstat ;read status ani 9dh ;look at error bits jnz bad ;not ok dcr d ;if done jz setio ;set i/o before going mvi b,0 ;for no head load inr c ;increment track count mov a,c ;done with cpi spt+1 ;this track? jc rnsec ;if not, read next sector mvi a,52h ;step command out dcom ;issue command in wait ;wait for intrq mvi c,1 ;sector no. jmp rntrk ;read next track. bad: dcr e ;decrement retry count jnz bloop ;try again if not zero sta ec ;save error code hlt ; ; setup serial i/o before going to cp/m ; setio: jmp boote org 7dh ;put jump here jmp boot ;jump into boot ec: end ;end of boot