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{s+p+q-*C ͥ!!q#p#w*:BOYG}*MD "ã:֪!Bw!>2ު*C~=2֪u:B2ߪ~2wE:A*Cw>"!""2B!"ڢ!rQQQâ~?©ͦ~?rQ*٪"CQ-Q͜QüQrQ$Q*):B"ڢ*)*)Q;*"E:֪;:A2AQÓQÜQҨ*C}/_|/*W}_*"}o|g":ުʑ*C6:ષʑw:ߪ2֪E**E}DQ>2ժf;TuâåìõûÎȬ aA::OMHH::OM [yH::OM>::OM |N|yH::OMHN> !ͻ>22!"!"2n2b:O:>ޫ>!2G*::1>2 0>2"!"=><<5`!"=2"O!"=DM !N*  ͖ ͖!~# x€ ͖èڬ' ž*`i"f`i"By2i:hƭ~ n& ~ެ/g`i#y2hҷ{ž:ho!"j>2iڷ' !߭_ƭ**#~o&~F_O s#rÞͽy2sa~<žR>P!+|̻P Pƭ ~2~21!  ÿ:ho&)))) ~#foxȰy2Y>2E*f|O|g+|g}o#|g"j!hl,#:f=o&)))))))f!>O((>2b>=>2Y>!72b"ծ :lڃO!3?3:mO! P3! ^3*n|O!03*n|GM!3f!3>7>xx! P3xah!l*:E:Y==ƭ~=!7nw#*7:lyͽy2sR>Pa6Pȯoa^q{?l/  ç,دQ/SS>QدQ!SSSw#Sw#Sw#Sw#ί,دQ*ȯ~S#~S#~S#~S#>Q>7ȯPG>PP7Q7P 7>Ql R:mSa~SP>SxS>P>P*s!w>     %&'()*+, -. /0  12!"34#$!"#$1234%&'(5678 )*+,9:;<  -./0 12345678 !"#$%&'(9:;<=>?@)*+,-./0?4 < 3@+ t4  h@x1@;W@|3b33p;pƷ{pQpܸpƱpֱp汕 Morrow Designs 48K CP/M 2.2, Cbios rev 2.9.20 For a Disk Jockey 2D/B and a Fujitsu M20 hard disk. Multi I/O as console, CTS protocol serial printer as LST: ~#O 122:!3*>2Qͼ!f2h2!"è::OHHMI Y`@:0  >KH_IW>K!a{ #zʸ+## ”*6>KzI{H>KM::O>K*8|I}H>KHIMOVCPM COMhABOOT& ASM] ASM COM@BAD COMhijklmBAUD COM!BAUD DOCBIOS ASM\BOOTHD ASMBOOTHD COM CBIOS& ASM!"#$%&'(CBIOS& ASM)*+,-./0CBIOS& ASM12345678CBIOS& ASM9:;<=>?@CBIOS& ASMABCDEFGHCBIOS& ASM^IJKLMNCBIOS ASMEOPQRSDDT COM&TUVDEBLOCK ASMOWXYZ[DISKDEF LIB1\]^_DUMP ASM!`abDUMP COMcED COM4defgBAD COMEnopqBAD DOC%FORMATHDASMrstuvwxyFORMATHDASMcz{|}~FORMATHDCOM%VITALS BADFORMT# ASMPFORMT# COM MBASIC COMMBASIC COM>1(!w# !".(y2!".A ( QDN͘>Q~دQ*.SSSw#Sw#Sw#Sw#iPG~>PP7Q7P 7>Q>RSS>S>S>P>P\X COPYRIGHT (C) 1979, DIGITAL RESEARCH _͌> ͒> Ò> Ò͘~#͌ì _2<2 !2:2a{_:ʖ:>Ľʖ:=2–!B!6#5ʖ:Ľ!ͬʧ )!F#xʺ~0wëw!" !~6ͽ:ý(!HDFIRM ASM;HTYP ASMHTYP ASMzHTYP PRLLOAD COMINSTALL COM:INSTALL DOC#MAKEPRL COMMAKEPRL COM?MAKEPRL DOCMBASIC COMMBASIC COM>NOTESHD DOCtPIP COM:PRL DOC PUTBAD COMPUTBAD COM,REGEN ASM|REGEN COMSINGLE ASMZSINGLE COMSTAT COM)SUBMIT COM SYSGEN COM XSUB COM,Copyright (C) Digital Research, 1979 1] ʑ?ʑ! __0 r))) O @|r}r.g))å{s Invalid memory size$!$ʡ~/w/wʔ|g*"x|?¸>@G!>0w#w!4~:60+4|s!N#F! x,  # =!v"x!u6!s#+w+wx >j*x# @xG}o|g"z! :m s À!"xʀ ~#s*z!:m ʕ xõ Synchronization error$ {~#o}oÕ:m k! ~#* DM! x w#!N#F! D!]>0w#w/!^4~:60+4*"c>s Ready for "sysgen" or "save 00 cpm00.com"$*z  Constructing 00K CP/M 2.2$#͘*~ ""͌#>?͌͘ =_.:;<> Oo$>!Y2*O"ʉ@G:ʐ:wÖx2p0ʹ#*©6?ëw˜0ï#6 ¹.0#*6?w0#6 #6" #~?  xDIR ERA TYPESAVEREN USER"!yO#< Ty#O 321y_͸2y2ͽ:˜1͘A͌>>͌92^ :¥.!_~#fow]!v"!çREAD ERRORçNO FILE^: ! ~ 3#0 Wx x   G ~ # 3x~#B!Y~ɯ2:=!ý:=!:ý^T!~  6?#ˆ:`O> K{͘A͒>:͒͢>:͒͢xK > K > ͒x  ͢ØÆ^ BRͧ9!5‚#~Y‚#"T<ÆALL (Y/N)?^ Tʧ͘!6!~ڇ w4!Y~ʆ͌†t=ʆf ^ T 2o&)|+!<ͧ'>ͦ!q:_  !p+q.*   !q*&!p+q*2!p+q*2!p+q*22!p+q*!p+q*!p+q*!p+q*2!p+q*ÆNO SPACE^ :Ty!B*O=?_s#"^sG!~Ypsp2mÆÆf ͧÆFILE EXISTS _: É: :ʉ=2)ͽÉ T!@k!}|q=qf^!~2>`~22\!!B!~> >#0~O#Cx2͘1)ͽÂf zͧÆBAD LOADCOMf^: ! Â$$$ SUB""C {2!"E 9" 1A 22!ty)K!G_^#V*C   ~E , &-AGMS  !!ô!ô!Bdos Err On : $Bad Sector$Select$File R/O$ :B A2 ! ~6  O͐  : E  B 2 >: b # : y! 4 5~yy 5 6y Ґ ^H @Oy H  H : – ͬ   #H : !  H ù  H  H $O͐ : 2 *C N# 2>2T *C G ͻ : w ̈́ n> 2;O ^ DM;}H> "*C  ::dd slO s#r:E ͊ :==»y==»*Ww# *" ͸ *:G#š" ͸ :!w4!i w: Z!E ~=26 2*C !!~~#~O~G#n,-.‹! w! yG!x͢.:E <ʄ! q!pQ:E <. ʄ$.:E <ʄ i 6}2E x N! ~态O>G~G!~G} *C !r#r#r ^ ͥ_y#x#{s+p+q-*C  ͥ!!q#p#w*:B O Y G }*MD "ã:!B w!>2*C ~=2u:B 2~2wE:A *C w>" !""2B !" !r QQQâ~?ͦ ~?r Q *"C Q- Q͜QüQr Q$Q*):B  " *)*)Q;*"E :;:A  2A QÓQÜQ*C }/_|/*W}_*"}o|g":ʑ*C 6:ʑw:2E* *E }DQ>2!3>20͛!B2D!22!"è::OHHMI Y`@:0  >KH_IW>K!@{#zʗ+## s*6>KzI{H>KM::O>K*8|I}H>KHI  x : 2 p & x ~+é 7 2 H ! >w _ : ! 5ͤ N k ͱ ¦ ͱ xʊ #N x : ! 2 ͤ ! 5™ #wO ~x½  p H    y< < ʑ  : !qMD # 2E > ! ^#V w#P :B O|^#V#"##"##"##"!O *!O *|!6ʝ 6>*w#w*w#w'û *! J * ""!N#F*^#V*~#foyx *{_zW+ * yx # *DM*s#r*s#ryOxG*0MD!!N: E G>O: \ S *C  :q n& ^#V> O^ "*}:*)= ":O:o"*C  *C !ͮ ~2~2ͦ :2ͮ : O:w:w |g}o *# ) :B O! yoxg*:B O }!N#F "*#*s#r^  ~!J  ! J *:o$*C ~i 6i w**{#z r+s{ozg**͕ **  , w͜ ͸ Ͳ ! !N#F$**O !~#::OM |N|yH::OMHN>  !C>22!"!"2J!2>:O:>>!2G::1>2O!2I>:<2- ʨ$$" ͊/v`i"B!`i"y2E!:D!ڇ͢~o n& ~f/g`i#y2D!ғ{z:D!MO>!>þ“###²!>2>2~ >2!"F!>2E!ړ' !_͢*#~o&~"=bO s#rz͙y2O=~P!+|̗P i,͢ ~2~2 !  Û:D!o&)))) ~#foToy25>2!*B!|O|g+|g}o#|g"F!!D!H!#:B!=o&)))))))B!>+>2>>=>25>!2>" :H!_O!3:I!O! ,! :*J!|O!0c*J!|GM!lB!^>7>xT! ,T=D!!H!:!:5==͢~=!$@B B HH II$@DI ABI$"$H$H@$$I! H*  $H@@A I $D!!$I"BI"I"@$BIIH$$"**#"͕  : 2 Þ y<_WyOxOxG* ~V5dw^  :ʈNÎ N#Fyʝ*}|\#u* #DM*6# x±**s#r͡ *6#6  ^ >:A #~$=2E k͌ : :/GyO>2!q*C " ͡  ʔ*J Ҕ^ :Oyʃ?|x | s-|N-# S:2E !~Яw > T   D ^ 6k -äPYy 5*{zBK5ڋ>*C w~#+w#w+ɯ2E 22 i  ^ *C :~w~͔͔# #  w ~>2!E 5T *C !"C  "C !w# F! w͌ x 2͢ *C  ~<wʃG:!ʎì 4~ʶ ¬:<ʶ$ ʶïZͻ   x >2>2ͻ :!Z2:E w ̈́ ͊ Ͳ  >Jw#:H!y͙y2OR>P=6PȯK=^q{?H/  ÃدQ/SS>QدQ!SSSw#Sw#Sw#Sw#ªدQ*~S#~S#~S#~S#>Q>7ȯPG>PP7Q7P 7>QH R:IS=~S,>SxS>P>P*O!S>     %&'()*+, -. /0  12!"34#$!"#$1234%&'(5678 )*+,9:;<  -./0 12345678 !"#$%&'(9:;<=>?@)*+,-./0?4 < 3@+ t4  h@x1@;W@|3b33L!"!L!#"L!E$#L!$E$L!%$L!%[%L!1&% Morrow Designs 48K CP/M 2.2, Cbios rev 2.9.20 For a Disk Jockey 2D/B and a Fujitsu M20 hard disk. Multi I/O as console, CTS protocol serial printer as LST: ~#O 122:$$BBI$@BI!"$$A DI$@ A$@$$@H! "!$$" @B$!!!DH$$"H @@BHH  !$$A"D@ "A" "BHA " !$ D B I $ !$$ H@BD D$ HI DIA!$$$ $" "$D ! $"  $AB " BDD $$D!"DI$!$BH!"IB I$"D HD" " $"! @H !BI " I  $I$I$DI$ !I$@"$"$! $I$I @ @ "B@"A@" A!@H@  $ @H HH  @ BA$ H$ @"BDD H"$ !H@@@@@@@@@"HI   * * 0 10 d80 9780 15 * * 0 11 e00 9800 5 * * 0 12 e80 9880 16 * * 0 13 f00 9900 6 * * 0 14 f80 9980 17 * * 0 15 1000 9a00 7 * * 0 16 1080 9a80 18 * * 0 17 1100 9b00 8 * * 0 18 1180 9b80 19 * * 0 19 1200 9c00 9 * * 0 20 1280 9c80 20 * * 0 21 1300 9d00 10 BDOS * * 0 22 1380 9d80 21 * * 0 23 1400 9e00 11 * * 0 24 1480 9e80 22 * * 0 25 1500 9f00 12 * * 0 26 1580 9f80 23 * * * * Track 1 is recorded in double density format. There are * * 1024 bytes per sector. * * * * 1 1 1600 a000 4 * * 1 2 1a00 a400 1 * * 1 3 1e00 a800 5 CBIOS (@ ab00h) * * 1 4 2200 ac00 2 * * 1 5 2600 b000 6 * * 1 6 2a00 b400 3 * * 1 7 2e00 b800 7 * * 1 8 3200 bc00 Unused * * * * Note that the interleave sequences for loading tracks 0 and 1 * * are different. This difference was designed so that the * * boot sequence could be done in 4 disk revolutions since the * * 2D Mod. B can not load consecutive sectors of* * ***************************************************************** first equ 1 ;0 = Floppies are A-D drives and ; Hard Disk are E-P ;1 = Hard Disks are A-L drives and ; Floppies are M-P maxhd equ 1 ;Set to number of hard disks maxflop equ 4 ;Set to number of floppies ***************************************************************** * * * The following equates are for the Diskus Hard disk if wanted. * * * ***************************************************************** if (maxhd ne 0) and first ;Want Hard Disk included ? hdorg equ 50h ;Hard Disk Controller hdstat equ hdorg ;Hard Disk Status hdcntl equ hdorg ;Hard Disk Control hddata equ hdorg+3 ;Hard Disk Data hdfunc equ hdorg+2 ;Hard Disk Function hdcmnd equ hdorg+1 ;Hard Disk Command hdreslt equ hdorg+1 ;Hard Disk Result retry equ 2 ;Retry bit of result tkz equ 1 ;Track zero bit of status opdone equ 2 ;Operaction done bit of status complt equ 4 ;Complete bit of status tmout eqf of the disk. * * * * Three spare sectors (track 0, sectors 2 to 4) have been * * provided for a more advanced boot loader at a later date. * * * * * * Hard boot (M10, M20, M26): * * The cold boot loader (track 0, sector 1) is loaded into * * RAM at either 0100h or the 2DB's RAM depending on whether * * this loader is assembled with a 2DB or not. This cold * * boot loader will start loading the CCP from track 0, * * sector 2 and will finish up with the last part of the * * CBIOS on track 0 sector 21. * * * * track sector sysgen load order Name * * 0 1 900 fc00 1 Cold boot * * 0 2 b00 9500 3 CCP * * 0 3 d00 9700 4 * * 0 4 f00 9900 5 * * 0 5 1100 9b00 6 * * 0 6 1300 9d00 7 BDOS * * 0 7 1500 9f00 8 * * 0 8 1700 a100 9 * * 0 9 1900 a300 10 * * 0 10 1b00 a500 11 * * 0 11 1d00 a700 12 * * 0 12 1f00 a900 13 * * 0 13 2100 ab00 14 CBIOS * * 0 14 2300 ad00 15 * * 0 15 2500 af00 16 * * 0 16 2700 b1u 8 ;Time out bit of status wfault equ 10h ;Write fault bit of status drvrdy equ 20h ;Drive ready bit of status indx equ 40h ;Index bit of status pstep equ 4 ;Step bit of function nstep equ 0fbh ;Step bit mask of function hdrlen equ 4 ;Sector header length secln equ 512 ;Sector data length wenabl equ 0fh ;Write enable wreset equ 0bh ;Write reset of function scenbl equ 5 ;Controller control dskclk equ 7 ;Disk clock for control mdir equ 0f7h ;Direction mask for function null equ 0fch ;Null command idbuff equ 0 ;Initialize data command isbuff equ 8 ;Initialize header command rsect equ 1 ;Read sector command wsect equ 5 ;Write sector command endif ***************************************************************** * * * The following equates are for the Disk Jockey 2D/B if wanted. * * * ***************************************************************** if maxflop ne 0 origin equ 0f800h ;Orgin of DJ 2D Mod B PROM djram equ origin+400h ;Disk Jockey ***************************************************************** * * * CP/M vers 2.2 Cold Start Loader. * * * * The following routines will boot CP/M from the Disk * * Jockey 2D Rev. B, or from the Disk Jockey Hard disk * * controller. * * * * Floppy boot: * * The cold boot loader (track 0, sector 1) is loaded into * * RAM on the controller by the cold boot routine in the * * firmware. This cold boot loader will start loading the * * CCP from track 0, sector 5 and will finish up with the * * last part of the CBIOS on track 1 sector 7. * * * * During a warm boot sectors 1, 2, and part of 3 will be * * loaded from track 1. Track 0 loading is unaffected. * * * * track sector sysgen load order Name * * * * 0 1 900 ff00 1 Boot loader * * 0 2 980 Unused * * 0 3 a00 * * 0 4 a80 * * 0 5 b00 9500 2 CCP * * 0 6 b80 9580 13 * * 0 7 c00 9600 3 * * 0 8 c80 9680 14 * * 0 9 d00 9700 400 17 * * 0 17 2900 b300 18 * * 0 18 2b00 b500 19 * * 0 19 2d00 b700 20 * * 0 20 2f00 b900 2 Partial load * * 0 21 3000 Unused * * * * The warm boot load sequence starts at track 0, sector 2 * * and goes straight through to sector 12. There is still * * plenty of room left in this loader for more advanced * * things like sector interleaving although this is hardly * * necessary on a hard disk. * * * ***************************************************************** msize equ 48 ;Memory size of target CP/M bias equ (msize-20)*1024 ;Memory offset from 20k system ccp equ 2500h+bias ;Console command processor bios equ ccp+1600h ;CBIOS address cboot equ bios ;Cold boot address for CP/M loaddr equ ccp ;Load address for floppy retries equ 10 ;Maximum # of disk retries ***************************************************************** * * * The following equates set up the relationship between the * * 2D floppies and the Hard Disk Controllers. * 2D Mod B routines tkzero equ origin+9h ;Track 0 seek trkset equ origin+0ch ;Set track setsec equ origin+0fH ;Set sector setdma equ origin+12h ;Set DMA address dread equ origin+15h ;Read sector dmast equ origin+24h ;Get DMA address status equ origin+27h ;Disk status dskerr equ origin+2ah ;Flash error light setden equ origin+2dh ;Set density endif if first ;Define start address if hard disk if maxflop ne 0 boot equ djram ;If floppy is there then use its RAM else boot equ 0100h ;Otherwise start at 0100h endif else ;Define start address if floppy boot equ djram+0300h ;Upper quarter of floppy RAM endif offset equ 900h-boot ;DDT offset ***************************************************************** * * * Cold Boot loader for Discus M10, M20, or M26. * * * ***************************************************************** if first ;first = 1 is hard disk org boot boothd lxi sp,cstkhd ;Set up stack at end of this sector lxi b,1*100h+20 ;B = secz rtloop ret process in hdstat ;Wait for command to finish mov b,a ani opdone jz process mvi a,dskclk ;Turn on Disk Clock out hdcntl in hdstat ani tmout ;Timed out ? stc rnz in hdreslt ani retry ;Any retries ? stc rnz xra a ;No error exit ret hdprep in hdstat ;Is Drive ready ? ani drvrdy stc rnz mvi a,isbuff ;Initialize pointer to header buffer out hdcmnd mvi a,null out hdfunc ;Select drive A xra a out hddata ;Form head byte out hddata ;Form track byte mvi a,0 ;Form sector byte hdsec equ $-1 out hddata mvi a,80h ;Form Key out hddata mvi a,dskclk ;Turn on Disk clock out hdcntl mvi a,wenabl ;Write enable on out hdcntl ret org boothd+200h-2 cstkhd equ $ dw boothd else ;first = 0 is floppy disk ***************************************************************** * * * Cold boot loader for the Disk Jockey 2D Revision B controller * * * *************************************************************1*" COPYRIGHT(C) 1978, DIGITAL RESEARCH á 4êü /L9ASMPRNHEXtor count, C = sector # call clodhd ;Load sector 20 into CCP lxi h,ccp+1e00h ;Destination of move lxi d,ccp ;Source of move mvi c,0 cmovhd ldax d ;Get a byte of source mov m,a ;Move it inx h ;Bump destination inx d ;Bump source dcr c ;All done with this page ? jnz cmovhd lxi h,ccp-200h ;Initial DMA address shld cdmahd lxi b,18*100h+2 ;B = sector count, C = sector # call clodhd jmp cboot ;Go to CP/M clodhd push b ;Save sector and count mov a,c sta hdsec lxi h,ccp-200h ;Get DMA address (self modifying) cdmahd equ $-2 ;Storage for previous DMA address lxi d,200h ;Offset to new DMA address dad d ;Add in offset, HL = new DMA address shld cdmahd ;Save new DMA address call crdhd ;Attempt a read pop b ;Recover sector number and count ; B = count, C = number dcr b ;Update sector count rz ;All done ? inr c jmp clodhd ;Continue reading ***************************************************************** * * * Rdhd does the actual r**** org boot t0boot mvi a,5-2 ;First sector - 2 newsec equ $-1 inr a ;Update sector # inr a cpi 27 ;Size of track in sectors + 1 trksiz equ $-1 jc nowrap ;Skip if not at end of track jnz t1boot ;Done with this track exit equ $-2 sui 27-6 ;Back up to sector 6 backup equ $-1 lxi h,loaddr-80h ;Memory address of sector - 100h nxtdma equ $-2 shld newdma nowrap sta newsec ;Save the updated sector # mov c,a call setsec ;Set up the sector lxi h,loaddr-100h ;Memory address of sector - 100h newdma equ $-2 lxi d,100h ;Update DMA address secsiz equ $-2 dad d nowrp shld newdma ;Save the updated DMA address mov b,h mov c,l call setdma ;Set up the new DMA address lxi b,retries*100h+0;Maximum # of errors, track # nxtrty equ $-2 fread push b call trkset ;Set up the proper track call dread ;Read the sector pop b jnc t0boot ;Continue if no error dcr b jnz fread ;Keep trying if error jmp dskerr ;Too many errors, flash the light t1boot lxi h,cboead from the controller, the DMA * * address and sector # have already been set up. * * * ***************************************************************** crdhd lxi b,retries*100h+1 ;Maximum # of attempts crhd push b ;Save error count call hdread ;Attempt the read pop b ;Restore the error count rnc ;Return if no error dcr b ;Update error count jnz crhd ;Try again if not to many errors jmp $ ;Dynamic error halt hdread call hdprep ;Prepare the sector header image rc ;Error exit mvi a,rsect ;Read sector command out hdcmnd call process ;Process the read rc ;Error exit xra a ;Pointer to data buffer out hdcmnd mvi b,secln/4 ;Number of bytes to read lhld cdmahd ;Get destination of data in hddata ;Two dummy data bytes in hddata rtloop in hddata ;Move four bytes mov m,a ;Byte one inx h in hddata ;Byte two mov m,a inx h in hddata ;Byte three mov m,a inx h in hddata ;Byte four mov m,a inx h dcr b ;Update byte count jnot ;We jump to cboot next time shld exit mvi c,1 ;Select double density call setden xra a ;First sector - 2 sta newsec mvi a,8 ;Size of (logical) track + 1 sta trksiz dcr a ;Number of sectors to back up sta backup lxi h,loaddr+0700h ;DMA start address for first revolution - 2048 shld newdma lxi h,loaddr+0300h ;DMA start address for second revolution - 2048 shld nxtdma lxi h,2048 ;Difference between DMA addresses shld secsiz lxi h,retries*100h+1;Maximum # of errors, track # shld nxtrty jmp t0boot ;Go load in track 1 endif end !4w_#~ ʸ A:4~~# ¼ > \ ?ʻ w# !ͼ ? !ͼ {zA"*![N![ N#Fr+sq#p/>G=#w#w3#w#w!JSYMBOL TABLE OVERFLOW G*##~w*##~͎*_###s#r^#V`à 4 Wm ()*+,-/ABCDEHLMDBDIDSDWEIIFINORSPACIADCADDADIANAANDANICMACMCCMPCPIDAADADDCRDCXENDEQUHLTINRINXJMPLDALXIMODMOVMVINOPNOTORAORGORIOUTPOPPSWRALRARRETRLCRRCRSTSBBSBISETSHLSHRSTASTCSUBSUIXORXRAXRICALLENDMLDAXLHLDPCHLPUSHSHLDSPHLSTAXXCHGXTHLENDIFMACROTITLE  PF FP! ( 2/?'  v:P@< !  PP27 ( *"  NZZ NCC POPEP M x_BH!œ#¶ ¦{KÈCÈ<:JCR:  !6 s!#  ɯ<:O=_Z!F!V#fjQ̓E!^#Vo&)~#FxGyѯ<àn8!~ڢͅ6~44O! s#r!~ ڿ6ͅ^4!mw!wp!~ͅ!55N! N#fio&)^#fk*͆:5!9N#F#^#V#~#fo"[kb"[i`"[OGVITALS.BAD CP/M bad sector fixer Revision 3 [!g͖!=͖"[[͏"[!͸ywx#w;!~#fo![*]3Ù Your choice: All done. 4) Quit bad sectors out of circulation. To create special CP/M files to take 3) Fixbad To manually add to the bad map. 2) Putbad To read the existing bad map on a drive. 1) Getbad [!͖!͖!|͖!z͖!o͖!K͖!I͖!>͖!͖!͖!͖!͖!͖!͖!͖![*:[2]:]1Q!4MD"[:]2a!0MD"[:]3q!A MD"[:]4»:5ûBADSPOTS [!! !N#F͊6!~#fo6! !!~#fo#ͷ;!~#fo ~w!~#fo ~w"[Error writing directory Error reading directory [!n9!n*] ~#~!!n~#fo ~#~!w#w!w#w!!]  #Ҩ!~#fo*] !N#F!p!^ yʾ!D þ"[!~w#~w^!!p}|!!  !~#fo~OGyx@!~ w#!)ͼ !ͼ :5͡ :6:6͡ :7͡ :\ ʻ 24!dͮ 25ͮ 27ͮ 26!8 ( ʃ !Y 1  :7ʞ !z 8  !"2D2X2#! 8 !ͼ z{* ! !"!8 w#  +6# *#"~!ͼ G:6QxJQS*!w#"! 1 !"!Y~~# …¡z!ͼ wʹ* ! w#" ! 8 !" ! zz_O4:  :6y:! G~#x=2> > ! >x6 #='G! ~ p( O*}O>4?:7w:#ĸ*"!͸* }w>ͪg( ʆ1 Y :7ʗ8 z !<ͼ CP/M ASSEMBLER - VER 2.0 NO SOURCE FILE PRESENT NO DIRECTORY SPACE SOURCE FILE NAME ERROR SOURCE FILE READ ERROR OUTPUT FILE WRITE ERROR CANNOT CLOSE FILES END OF ASSEMBLY G:7xʘ!#~ʄl͸Ä**!O {zʊ͸*"!!#^4!$wͯͯWƐ'@'ê>:ͪ!#^Ww*!{͚|͚}͚͚{!$~#͚͚> ͪ> ͪz'{ͅ>ɯo>g"k!m6ů{_zW5>)D*kOxGd !m?FDM!xGyOڂÃ)sn55)=â|g}o=î--#zg{ozg{ozg{oÓ:: ;,!ɯ22=2l!"]!~H5_!m~0:ą:  *":  :‰:̅ԅ!^#=ʅVq”*qͦ1& O:lµ̅>2ly:_!w~!s!m~ùy !~=w_!m~ ͅͰ>2lyPLnR>UX:l̅2l͓*>E2C!" """ :ʼ:*1 |R|ͦ0FIL: R  R* } *" :¿::¿üX!C^#fk[@ :Œ:=ʌG!ʆF#H vÛc*| EH ͺ,^1 ͦ *""1 EH DH ͺ,1 ͦ :  1:  " > 2 ~w!~w#~w+!n~#fo  #ڮ!w#w!~w#~wî! !N#F!N#Fͷ;!~#fo*] !N#F!p!^ yʏ!D "[Error writing directory Error reading directory [!j9!j*] ~#~!t!j~#fo ~#~!rw#w!pw#w!p!]  #T!r~#fo*] !tN#F!x!^ yg!D g"[!p~w#~w !!x}|!!  ң!~#fo~OGyx!r~w#~w+!j~#fo  #W!rw#w!t~w#~wW!~ w#~wv! !]!N#F#6yI!~#fo6!r~#fo*] !tN#F!x!^ y!D !lw#w!l~#~!~#fo !l~#fo) ~#Ž!l~w#~wQ!~#fo !l~#fo) :]:]#!~#fo !l~#fo) ~#fo"]*]"]*]MD) )*] :]:]~!~#fo !l~#fo) *]####  #/!N#Fr*]}o|g"]%s: File contained bad sectors, probably corrupt [![!N#F#![!@/"[[!N#F>!N#F!F"[[!~#foMD) *] ~OGi`!~#foMD) *] ~OG}o|g"]!]@2 0 0:x0_<2! wI2 2> 2 >2ɯ22 !~@_6^4#: w~$w: 0 q: A: A͋q: a{_2  2 - !ɯ2I:  ;*:  ͭͷ ͭ͋>9q>9: '!2 >9 7:! 6 >2>2: 2 Qͭ:Ğ! :lj<͖<j<|<: OʊQ>ÖH >2 2 û: B­>ôD> ¸!52 !"!N#~#A07O! ~*!) " :  '<ͭ'<>V$>O$:Ğà\ÞØ`rÍÖ![w#w#b!"!F#v2[G*##~w*##~<*}q!~ڬ6![^![^#fk"͎͘!G#*####*^#Vû!^*"*:|: |Ë  |*" ͩ !6="1 :  1}1:n:>BʋSSͦSSxS 1:  1"" ͦ 1 |R >O U!" 1 1!|_!^#fk $8AP`ixH ñññ81Ľ y0îH ñGîG  ñH ñ(Ľ yîH ñîîĽ y0îîH ñG 1: :,; c*| } 8OĽ y0G G t :):,.>C :|: Jü;r :R: ʼʋ!ʼR!ʼʋ>SR{ozg!~4ʧͦ !6 ! **̈́**̈́\iͩ !w#H USE FACTOR !* "z{*"* "I !" :1 R O*UR X* G:xl :  *̩ : l x͖ *#"EH DH 0:~ ! ^4! w͆ Æ *! 6z͖ {͖ 4>R>V>D >P >L >N~# *]MD"[!~#foMD) *] #~OGi`!~#foMD) *] #~OG}o|g"]!]~#` *]MD"[!~#foMD) *] ##~OGi`!~#foMD) *] ##~OG}o|g"]*]MD"[[!~#foMD) *] ~2]!~#foMD) *] #~2]!~#foMD) *] ##~2]!~#foMD) *] !~#foMD) *] ~!~#foMD) *] #!~#foMD) *] #~!~#foMD) *] ##!~#foMD) *] ##~!~#foMD) *] :]w!~#foMD) *] #:]w!~#foMD) *] ##:]w"[Bad sector fixing done No free directory entries left Bad sector in CP/M directory (%u, %u, %u)[!9!*] ~#~!~#fo~#fo"^!!~#fo##~OG! CV"]*]!̀U"^2]2^!~#fo ~2^2^*^))))))))"^!~#fo ~OG:^2^:^2^!^~# *^|/ *]#"]/ 2]2]*]"]*]~OGy x9 *]#"]*]###"] *^)"^ *]! !*]6!*] 2i`"]!]~#n !*]"]*]"]*]MD) *] :]:]ҷ :[ *]##~  *]#5*]#~w *]!]yOx#G! V"]*]"]2^2^*]MD) )*] :]:]"*!!N#F!~w#~wN#Fh4!\F*}o|g!yLx#W!:F** ͳ* y2:OGyˆxʢ*##yOxGyʪ!%F** ͳ!*###ͳ!$0~#~#~#~!02829:2::2;!8!(W##~2#~2*}o|g*ͳ*!s }o|g*#ͳ!*###ͳ! *! *͜! *͜! !  !9! !N#F!R i`! 6! !!N#F!R i`! 6! !~#fo~@!~#fo~OG! !~w#~w  !N#F !C ! ' !~#fo"D!~#fo"@!~#fo"B!>w#w!:Dw:E#w!>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^~%* ^#" ^ö* ^#" cå! ^: c:c#* ^! cyOx#G* c!}|Ø *B!~#) !N#F>O>G0 !N#Fywx#w!@>#? *D~Ae *D>Ze *D~OG! MDm *D~OGylv x? *D#"D? *D~a *D>z !!N#F! N#F !~#fo }|:@2@:A2A*D#"D*D~A *D>Z !*D~A *D>Z *D~OG! MD *D~OG! }|!!   # *D!yOx#G= ' !~#fo"D*D"B!#~ !># !~#fo>o>g"@*B*B#"B6-ì !~#fo"@!~# !> w#w !#~ !!~#fo>o>g}|!:@:A#! !N#F*@!N#F *BR *B "B*B*@!N#F4 0 }*B>9L *B~'w*B!DyOx#G= ' !~#fo"D>2@2A!:@:A# *D*D~A *D>Z *D~OG! MDö *D~OGyw*@#"@*D#"Dw !~#foMD= !,~# ! :, :- *,i`", *. ' *,"D!~#fo",*DMD= !9*D*B*@i`!"@"B"D!9~w#~w#~w#~w+MD!9 _ #Z { !94Z ! 9~ +w>#w! 9N#Fx O>GP O>G! 9q#p! 9~ +w>#w! 9N#Fx O>GP*3 !9N#F#^#V#~#fo"kb"i`"OG!9!>w>#w!>w>#w!:w#w!N#F!N#F_ !~#ʻ!N#F!~w#~w!N#F!~w#~w~!~w#~wq!N#F!~w#~w6!!}|!N#F!~w#~w2ywx#w!>w>#w!~#fo~D!~#fo~|!~#fo> !~#fo~|î!~#fo>w#w!!~#fo!yOxG! !~#fo~!N#F!~w#~w!~#~!N#F!~w#~w6!~#fo> !~#fo~ !~w#~w baud. set to H, Serial port Multi I/O @ Can't find multi I/OBase must be on an 8 byte boundryDevice # out of range.Baud rate must be between 75-38400Usage: baud rate [device #] [base] .BAUD Version !~w#~w! *͜! *͜! !~#~!F!>>#! !!!N#F!~w#~wN#Fhy:K:! 2021:22:23!0+!>>#! !!!N#F!~w#~wN#Fh::)!>>#)!sFÈ!>>#4!!  O>G! 9q#p! 9N#FP ! 9q#p! 9N#FP ! 9q#p!9~_ /<à O!9~#fo) k !9~ /<_ O!9~#fo||g}o  !9~ /<_ O!9~#fo|g}o º MD!9q#p!! 9~+ ~ ! 9N#F ! 9~w#~w! 9~w+~w !9q#p&!!9OG!9N#F!9~#fo ## # +++ #!9MD!9~#~#~#~ !9~w#~w#~w#~w#~w#~w#~w#~w!9MD! 9  # # #x!9MD! 9  # # #!94x!9!9#~#~+++~#~#~#>#>+++>#~#~#~ #~{$>#># >#!9MD!9~#fo! 9MD!9~#foU!9N#F!97!9MD!9~#fo! 9MD!9~#foU!9N#F!97! 9MD!9~#fo#!9MD!9~#fo#U!9N#Fkb9$!9~#foN#F#N#F! 9~#foN#F#N#F!!9~+++ʓ~i!9MD!9  # # #!9~w#~w#~w#~w!9~w+~w+~w+~w:!9N#F!9~#~}|! 9&}!!9!9!9N#F###q#p+++q!9N#F#q#pMo NAME baud - change serial baud rate on multi I/O SYNOPSIS baud baud-rate [device #] [multi I/O base] DESCRIPTION Baud is used to change the baud rate on a multi I/O or Decision I motherboard. Device # is the port number on the Multi I/O or decision motherboard in the range of one to three. Multi I/O base is the base address of the multi I/O. The default device # is one if not specified. The Multi I/O base is assumed to be 48. EXAMPLES To change serial port 1 on a multi I/O with a base of 48H to 9600 baud you would type: baud 9600 1 48 or baud 9600 To change the baud rate of the third serial port on multi I/O with a base of zero to 110 baud: baud 110 3 0 baud.doc 3/17/81 ldk eader paper tape reader in (result to reg-a) ; home move to track 00 ; ; (the following calls set-up the io parameter block for the ; mds, which is used to perform subsequent reads and writes) ; seldsk select disk given by reg-c (0,1,2...) ; settrk set track address (0,...76) for sub r/w ; setsec set sector address (1,...,26) ; setdma set subsequent dma address (initially 80h) ; ; read/write assume previous calls to set i/o parms ; read read track/sector to preset dma address ; write write track/sector from preset dma address ; ; jump vector for indiviual routines jmp boot wboote: jmp wboot jmp const jmp conin jmp conout jmp list jmp punch jmp reader jmp home jmp seldsk jmp settrk jmp setsec jmp setdma jmp read jmp write jmp listst ;list status jmp sectran ; maclib diskdef ;load the disk definition library disks 4 ;four disks diskdef 0,1,26,6,1024,243,64,64,offset diskdef 1,0 diskdef 2,0 diskdef 3,0 ; endef occurs at end of assembly ; ; end of conrror retries lxi b,cpmb ;set dma address to start of disk system call setdma mvi c,0 ;boot from drive 0 call seldsk mvi c,0 call settrk ;start with track 0 mvi c,2 ;start reading sector 2 call setsec ; ; read sectors, count nsects to zero pop b ;10-error count mvi b,nsects rdsec: ;read next sector push b ;save sector count call read jnz booterr ;retry if errors occur lhld iod ;increment dma address lxi d,128 ;sector size dad d ;incremented dma address in hl mov b,h mov c,l ;ready for call to set dma call setdma lda ios ;sector number just read cpi 26 ;read last sector? jc rd1 ; must be sector 26, zero and go to next track lda iot ;get track to register a inr a mov c,a ;ready for call call settrk xra a ;clear sector number rd1: inr a ;to next sector mov c,a ;ready for call call setsec pop b ;recall sector count dcr b ;done? jnz rdsec ; ; done with the load, reset default buffer address gocpm: ;(enter here from cold start boot) ; enable rstroller - independent code, the remaining subroutines ; are tailored to the particular operating environment, and must ; be altered for any system which differs from the intel mds. ; ; the following code assumes the mds monitor exists at 0f800h ; and uses the i/o subroutines within the monitor ; ; we also assume the mds system has four disk drives revrt equ 0fdh ;interrupt revert port intc equ 0fch ;interrupt mask port icon equ 0f3h ;interrupt control port inte equ 0111$1110b;enable rst 0(warm boot),rst 7 (mon) ; ; mds monitor equates mon80 equ 0f800h ;mds monitor rmon80 equ 0ff0fh ;restart mon80 (boot error) ci equ 0f803h ;console character to reg-a ri equ 0f806h ;reader in to reg-a co equ 0f809h ;console char from c to console out po equ 0f80ch ;punch char from c to punch device lo equ 0f80fh ;list from c to list device csts equ 0f812h ;console status 00/ff to register a ; ; disk ports and commands base equ 78h ;base of disk command io ports dstat equ base ;disk status (input) rtypt0 and rst7 di mvi a,12h ;initialize command out revrt xra a out intc ;cleared mvi a,inte ;rst0 and rst7 bits on out intc xra a out icon ;interrupt control ; ; set default buffer address to 80h lxi b,buff call setdma ; ; reset monitor entry points mvi a,jmp sta 0 lxi h,wboote shld 1 ;jmp wboot at location 00 sta 5 lxi h,bdos shld 6 ;jmp bdos at location 5 sta 7*8 ;jmp to mon80 (may have been changed) lxi h,mon80 shld 7*8+1 ; leave iobyte set ; previously selected disk was b, send parameter to cpm lda cdisk ;last logged disk number mov c,a ;send to ccp to log it in ei jmp cpmb ; ; error condition occurred, print message and retry booterr: pop b ;recall counts dcr c jz booter0 ; try again push b jmp wboot0 ; booter0: ; otherwise too many retries lxi h,bootmsg call prmsg jmp rmon80 ;mds hardware monitor ; bootmsg: db '?boot',0 ; ; const: ;console status to reg-a ; (exactly the same as mds call) jmp csts ; conin: ;console c; MDS-800 I/O Drivers for CP/M 2.0 ; (four drive single density version) ; ; Version 2.0 August, 1979 ; vers equ 20 ;version 2.0 ; ; Copyright (c) 1979 ; Digital Research ; Box 579, Pacific Grove ; California, 93950 ; org 4A00h ;base of bios in 20K system cpmb equ 3400h ;base of cpm CCP bdos equ 3C06H ;base of bdos in 20K system cpml equ $-cpmb ;length (in bytes) of cpm system nsects equ cpml/128;number of sectors to load offset equ 2 ;number of disk tracks used by cp/m cdisk equ 0004h ;address of last logged disk buff equ 0080h ;default buffer address retry equ 10 ;max retries on disk i/o before error ; ; perform following functions ; boot cold start ; wboot warm start (save i/o byte) ; (boot and wboot are the same for mds) ; const console status ; reg-a = 00 if no character ready ; reg-a = ff if character ready ; conin console character in (result in reg-a) ; conout console character out (char in reg-c) ; list list out (char in reg-c) ; punch punch out (char in reg-c) ; re equ base+1 ;result type (input) rbyte equ base+3 ;result byte (input) ; ilow equ base+1 ;iopb low address (output) ihigh equ base+2 ;iopb high address (output) ; readf equ 4h ;read function writf equ 6h ;write function recal equ 3h ;recalibrate drive iordy equ 4h ;i/o finished mask cr equ 0dh ;carriage return lf equ 0ah ;line feed ; signon: ;signon message: xxk cp/m vers y.y db cr,lf,lf db '20' ;sample memory size db 'k CP/M vers ' db vers/10+'0','.',vers mod 10+'0' db cr,lf,0 ; boot: ;print signon message and go to ccp ; (note: mds boot initialized iobyte at 0003h) lxi sp,buff+80h lxi h,signon call prmsg ;print message xra a ;clear accumulator sta cdisk ;set initially to disk a jmp gocpm ;go to cp/m ; ; wboot:; loader on track 0, sector 1, which will be skipped for warm ; read cp/m from disk - assuming there is a 128 byte cold start ; start. ; lxi sp,buff ;using dma - thus 80 thru ff ok for stack ; mvi c,retry ;max retries push b wboot0: ;enter here on e haracter to reg-a call ci ani 7fh ;remove parity bit ret ; conout: ;console character from c to console out jmp co ; list: ;list device out ; (exactly the same as mds call) jmp lo ; listst: ;return list status xra a ret ;always not ready ; punch: ;punch device out ; (exactly the same as mds call) jmp po ; reader: ;reader character in to reg-a ; (exactly the same as mds call) jmp ri ; home: ;move to home position ; treat as track 00 seek mvi c,0 jmp settrk ; seldsk: ;select disk given by register c lxi h,0000h ;return 0000 if error mov a,c cpi ndisks ;too large? rnc ;leave HL = 0000 ; ani 10b ;00 00 for drive 0,1 and 10 10 for 2,3 sta dbank ;to select drive bank mov a,c ;00, 01, 10, 11 ani 1b ;mds has 0,1 at 78, 2,3 at 88 ora a ;result 00? jz setdrive mvi a,00110000b ;selects drive 1 in bank setdrive: mov b,a ;save the function lxi h,iof ;io function mov a,m ani 11001111b ;mask out disk number ora b ;mask in new disk number mov m,aontroller mov a,b out ihigh ;high address jmp wait0 ;to wait for complete ; iodr1: ;drive bank 1 out ilow+10h ;88 for drive bank 10 mov a,b out ihigh+10h ; wait0: call instat ;wait for completion ani iordy ;ready? jz wait0 ; ; check io completion ok call intype ;must be io complete (00) unlinked ; 00 unlinked i/o complete, 01 linked i/o complete ; 10 disk status changed 11 (not used) cpi 10b ;ready status change? jz wready ; ; must be 00 in the accumulator ora a jnz werror ;some other condition, retry ; ; check i/o error bits call inbyte ral jc wready ;unit not ready rar ani 11111110b ;any other errors? jnz werror ; ; read or write is ok, accumulator contains zero ret ; wready: ;not ready, treat as error for now call inbyte ;clear result byte jmp trycount ; werror: ;return hardware malfunction (crc, track, seek, etc.) ; the mds controller has returned a bit in each position ; of the accumulator, corresponding to the conditions: ***************************************************************** * * * Hard Disk Boot program. * * For M26, M10, and M20. * * * ***************************************************************** org 100h revnum equ 13 IOADDR EQU 120Q CONTRL EQU IOADDR STATUS EQU IOADDR DATA EQU IOADDR+3 FUNCTN EQU IOADDR+2 COMMD EQU IOADDR+1 DREAD EQU 1 SECTOR EQU 1 OPDONE EQU 2 COMPLT EQU 4 HEADER EQU 10Q DRENBL EQU 5 DSKRUN EQU 7 READY EQU 40Q SYSTEM EQU 200Q STEPO EQU 370Q DRIVEA EQU 374Q jmp start ds 509 ;Room for the boot START MVI A,DRIVEA ;select OUT FUNCTN ; drive A MVI A,DRENBL ;turn on drive OUT CONTRL ; command register RLOOP IN STATUS ;test for ANI READY ;drive A ready JNZ RLOOP MVI A,DSKRUN ;enable the OUT CONTRL ; controller WAITZ IN STATUS ;test for heads RAR ; at track zero JNC SDONE MVI A,STEPO ;execute OUT FUNCTN ; the MVI A,DRIVEA ; step out OUT FUNCTN ; command WAITC IN STATUS ;wait  ;save it in iopb mov l,c mvi h,0 ;HL=disk number dad h ;*2 dad h ;*4 dad h ;*8 dad h ;*16 lxi d,dpbase dad d ;HL=disk header table address ret ; ; settrk: ;set track address given by c lxi h,iot mov m,c ret ; setsec: ;set sector number given by c lxi h,ios mov m,c ret sectran: ;translate sector bc using table at de mvi b,0 ;double precision sector number in BC xchg ;translate table address to HL dad b ;translate(sector) address mov a,m ;translated sector number to A sta ios mov l,a ;return sector number in L ret ; setdma: ;set dma address given by regs b,c mov l,c mov h,b shld iod ret ; read: ;read next disk record (assuming disk/trk/sec/dma set) mvi c,readf ;set to read function call setfunc call waitio ;perform read function ret ;may have error set in reg-a ; ; write: ;disk write function mvi c,writf call setfunc ;set to write function call waitio ret ;may have error set ; ; ; utility subroutines prmsg: ;print messag ; 0 - deleted data (accepted as ok above) ; 1 - crc error ; 2 - seek error ; 3 - address error (hardware malfunction) ; 4 - data over/under flow (hardware malfunction) ; 5 - write protect (treated as not ready) ; 6 - write error (hardware malfunction) ; 7 - not ready ; (accumulator bits are numbered 7 6 5 4 3 2 1 0) ; ; it may be useful to filter out the various conditions, ; but we will get a permanent error message if it is not ; recoverable. in any case, the not ready condition is ; treated as a separate condition for later improvement trycount: ; register c contains retry count, decrement 'til zero dcr c jnz rewait ;for another try ; ; cannot recover from error mvi a,1 ;error code ret ; ; intype, inbyte, instat read drive bank 00 or 10 intype: lda dbank ora a jnz intyp1 ;skip to bank 10 in rtype ret intyp1: in rtype+10h ;78 for 0,1 88 for 2,3 ret ; inbyte: lda dbank ora a jnz inbyt1 in rbyte ret inbyt1: in rbyte+10h ret ; instat: lda dbank ora a for ANI COMPLT ; the seek JZ WAITC ; to complete JMP WAITZ SDONE IN STATUS ;get an image MOV C,A ; of the status reg IWAIT1 IN STATUS ;wait for SUB C ; the index pulse JZ IWAIT1 ; to arrive IWAIT2 IN STATUS ;wait for the SUB C ; next index pulse JNZ IWAIT2 ;test for head settle iwait3 in status sub c jz iwait3 MVI A,HEADER ;reset the OUT COMMD ; buffer pointer XRA A ; to header area OUT DATA ;head 0 OUT DATA ;track 0 MVI A,SECTOR ;1 for CP/M OUT DATA ; or 30 for drivers MVI A,SYSTEM ;system key OUT DATA MVI A,DREAD ;issue a OUT COMMD ; read command WAITD IN STATUS ;wait for command ANI OPDONE ; to complete JZ WAITD IN DATA ;low order byte of MOV L,A ; bootstrap address MOV E,A IN DATA ;high order byte of MOV H,A ; bootstrap address MOV D,A LLOOP IN DATA ;load STAX D ; the INR E ; bootstrap JNZ LLOOP PCHL ;branch there e at h,l to 0 mov a,m ora a ;zero? rz ; more to print push h mov c,a call conout pop h inx h jmp prmsg ; setfunc: ; set function for next i/o (command in reg-c) lxi h,iof ;io function address mov a,m ;get it to accumulator for masking ani 11111000b ;remove previous command ora c ;set to new command mov m,a ;replaced in iopb ; the mds-800 controller req's disk bank bit in sector byte ; mask the bit from the current i/o function ani 00100000b ;mask the disk select bit lxi h,ios ;address the sector select byte ora m ;select proper disk bank mov m,a ;set disk select bit on/off ret ; waitio: mvi c,retry ;max retries before perm error rewait: ; start the i/o function and wait for completion call intype ;in rtype call inbyte ;clears the controller ; lda dbank ;set bank flags ora a ;zero if drive 0,1 and nz if 2,3 mvi a,iopb and 0ffh ;low address for iopb mvi b,iopb shr 8 ;high address for iopb jnz iodr1 ;drive bank 1? out ilow ;low address to c jnz insta1 in dstat ret insta1: in dstat+10h ret ; ; ; ; data areas (must be in ram) dbank: db 0 ;disk bank 00 if drive 0,1 ; 10 if drive 2,3 iopb: ;io parameter block db 80h ;normal i/o operation iof: db readf ;io function, initial read ion: db 1 ;number of sectors to read iot: db offset ;track number ios: db 1 ;sector number iod: dw buff ;io address ; ; ; define ram areas for bdos operation endef end  !4w_#~ ʸ A:4~~# ¼ > \ ?ʻ w# !ͼ ? !ͼ !)ͼ !ͼ :5͡ :6:6͡ :7!4w_#~ ʸ A:4~~# ¼ > \ ?ʻ w# !ͼ ? !ͼ !)ͼ !ͼ :5͡ :6:6͡ :7>R>PP >PP+>R>RP!POP.P4P:>QSS>S>S>QPUSo_SgWSdision number 2.2 ***************************************************************** * The following equates define the console and printer * * environments. * ***************************************************************** ***************************************************************** * * * Define the console driver to be used. * * * * contyp is: 0 Nothing, used for patching to PROM's. * * 1 Provide for 128 bytes of patch space. * * 2 Multi I/O or Decision I driver. * * 3 2D/B driver. * * * ***************************************************************** contyp equ 2 ***************************************************************** * * * Define the printer driver to be used. * * * * lsttyp is: 0 Nothing, used for patching to PROM's. * * 1 Provide for 128 bytes of patch space. * * 2 Multi I/O serial, no protocol. * * 3 Multi I/O serial, CTS protocol. * * 4 Multi I/O serial, DSR protocol. * * 5 Multi I/O serial* splitting a disk to less then 2 or 3 parts would make * * partitions that are greater than 8 megabytes in length. * * * ***************************************************************** stdlog equ 0 ;Set to 0 to use standard logical disks if stdlog ne 0 logdsk equ stdlog ;Set to number of user selected else ; logical disks logdsk equ 3*m26+3*m20+2*m10 ;Default logical disks per drive endif fujitsu equ m20 or m10f mrev equ 26*m26+20*m20+10*m10 ;Hard disk type hdspt equ 32*m26+21*m20+21*m10 ;Sectors per track ***************************************************************** * * * The following equates relate the Morrow Designs 2D * * controller. If the controller is non standard (0F800H) * * only the ORIGIN equate need be changed. * * * ***************************************************************** if maxflop ne 0 ;Include Discus 2D ? origin equ 0F800H djram equ origin+400h ;Disk Jockey 2D RAM address djboot equ origin ;Disk Jockey 2D, Xon / Xoff protocol. * * 6 Multi I/O parallel, Centronics. * * 7 Multi I/O parallel, Diablo HyType II. * * * * Note: The Decision board is functionally identical to the * * Multi I/O board for printer I/O. Selections 2 - 6 * * will work on the Decision I. * * * ***************************************************************** lsttyp equ 3 ***************************************************************** * * * The next equate determines if you have a Multi I/O Rev 3 * * or a Decision I mother board for parallel i/o. If are not * * using either of these boards then you need not worry about * * this equate. If you are using a Multi I/O rev. other than * * 3.x then you should set multr3 to 0. * * * ***************************************************************** multr3 equ 1 ;0 = Decision, 1 = Multi I/O if contyp eq 2 congrp equ 1 ;Cosole port (1 = p1, 2 = p2, 3 = p3) endif if lsttyp ge 2 lstgrp equ 3 ;Printer port (1 = p1, 2 = p initialization djcin equ origin+3h ;Disk Jockey 2D character input routine djcout equ origin+6h ;Disk Jockey 2D character output routine djhome equ origin+9h ;Disk Jockey 2D track zero seek djtrk equ origin+0ch ;Disk Jockey 2D track seek routine djsec equ origin+0fh ;Disk Jockey 2D set sector routine djdma equ origin+012h ;Disk Jockey 2D set DMA address djread equ origin+15h ;Disk Jockey 2D read routine djwrite equ origin+18h ;Disk Jockey 2D write routine djsel equ origin+1bh ;Disk Jockey 2D select drive routine djtstat equ origin+21h ;Disk Jockey 2D terminal status routine djstat equ origin+27h ;Disk Jockey 2D status routine djerr equ origin+2ah ;Disk Jockey 2D error, flash led djden equ origin+2dh ;Disk Jockey 2D set density routine djside equ origin+30h ;Disk Jockey 2D set side routine dblsid equ 8 ;Side bit from controller io equ origin+3f8h ;Start of I/O registers dreg equ io+1 cmdreg equ io+4 clrcmd equ 0d0h endif ********************************************************************************************************************************* * * * Cbios for CP/M Ver 2.2 for Disk Jockey 2D Mod. B * * controller. Handles diskettes with sector sizes of 128 * * bytes single density, 256, 512, 1024 bytes double * * density. There are conditional assemblies for the * * Diskus Hard Disk Controller. * * * * Note: The system diskette (drive A:) has to have 1024 * * byte sectors in order for the cold and warm boot * * loaders to work. Be sure to format all new * * system diskettes with 1024 byte sectors. The * * system diskette can be either single or double * * sided. The sector size on normal (non A: drive) * * diskettes can be 128, 256, or 1024 bytes in * * either single or double density. * * * * Software engineering, Morrow Designs 11/81 * * * ***************************************************************** title '*** Cbios For CP/M Ver. 2.2 ***' revnum equ 29 ;Cbios revision number 2.9 cpmrev equ 22 ;CP/M rev2, 3 = p3) endif ***************************************************************** * * * The following equates set up the relationship between the * * 2D floppies and the Hard Disk Controllers. * * * ***************************************************************** first equ 1 ;0 = Floppies are A,B,C,D drives and ; Hard Disk are E,F,G,H ;1 = Hard Disks are A,B,C,D drives and ; Floppies are E,F,G,H maxhd equ 1 ;Set to number of hard disks maxflop equ 4 ;Set to number of floppies M26 equ 0 ;Set only one of these variables M20 equ 1 M10F equ 0 M10M equ 0 m10 equ m10f or m10m ***************************************************************** * * * The next equate will set the number of logical disks on a * * physical hard disk drive. The user must set stdlog to a * * vaule greater than or equale to 2 for an m10 or 3 for an * * m20 or m26. The reason for this is that CP/M can not * * address more than 8 megabytes per logical disk and *  * * * * The following block will define cerain 2DB entry points in * * case the user is not actually using the 2DB's disks but is * * using the 2DB's console driver PROM. * * * ***************************************************************** if (maxflop eq 0) and (contyp eq 3) origin equ 0F800H djcin equ origin+3h ;Disk Jockey 2D character input routine djcout equ origin+6h ;Disk Jockey 2D character output routine djtstat equ origin+21h ;Disk Jockey 2D terminal status routine endif ***************************************************************** * * * The following equates are for the Diskus Hard disk wanted. * * * ***************************************************************** if maxhd ne 0 ;Want Hard Disk included ? hdorg equ 50h ;Hard Disk Controller origin hdstat equ hdorg ;Hard Disk Status hdcntl equ hdorg ;Hard Disk Control hddata equ hdorg+3 ;Hard Disk Data hdfunc equ hdorg+2 ;Hard Disk Function hdcmnd equ hdorg+1 ;Hard Disk Commddresses for group zero gzero equ 0 daisy0 equ mbase ;Daisy input ports daisy1 equ mbase+1 sensesw equ mbase+1 ;Sense switches if multr3 eq 0 ;Daisy output ports are different daisi0 equ mbase ; for Decision I and Multi I/O. daisi1 equ mbase+1 ;These two are the Decision I ports else daisi0 equ mbase+1 ; and these are the Multi I/O's. daisi1 equ mbase endif ; Define daisy 0 status input bits ribbon equ 01h ;End of ribbon paper equ 02h ;Paper out cover equ 04h ;Cover open pfrdy equ 08h ;Paper feed ready crrdy equ 10h ;Carriage ready pwrdy equ 20h ;Print wheel ready check equ 40h ;Printer check (error) ready equ 80h ;Printer ready ; Define daisy 0 status input bits for Diablo HyType II driver crstrd equ 1020h ;Carriage ready pfstrd equ 810h ;Paper feed ready pwstrd equ 2040h ;Print wheel ready ; Define daisy 0 output bits d9 equ 01h ;Data bit 9 d10 equ 02h ;Data bit 10 d11 equ 04h ;Data bit 11 d12 equ 08h ;Data bit 12 pfstb equ 10h ;Patries on disk i/o before error clear equ 'Z'-64 ;Clear screen on an ADM 3 anul equ 0 ;Null aetx equ 'C'-64 ;ETX character aack equ 'F'-64 ;ACK character abel equ 'G'-64 ;Bell abs equ 'H'-64 ;Back Space aht equ 'I'-64 ;Horizontal tab acr equ 'J'-64 ;Carriage return avt equ 'K'-64 ;Vertical tab aff equ 'L'-64 ;Form Feed alf equ 'M'-64 ;Line feed xon equ 'Q'-64 ;Xon character xoff equ 'S'-64 ;Xoff character aesc equ 1bh ;Escape character ars equ 1eh ;RS character aus equ 1fh ;US character asp equ ' ' ;Space adel equ 7fh ;Delete ***************************************************************** * * * The jump table below must remain in the same order, the * * routines may be changed, but the function executed must be * * the same. * * * ***************************************************************** org bios ;Cbios starting address jmp cboot ;Cold boot entry point wboote jmp wboot ;Warm boot entry point if contyp ne 0 const jmp cand hdreslt equ hdorg+1 ;Hard Disk Result retry equ 2 ;Retry bit of result tkzero equ 1 ;Track zero bit of status opdone equ 2 ;Operaction done bit of status complt equ 4 ;Complete bit of status tmout equ 8 ;Time out bit of status wfault equ 10h ;Write fault bit of status drvrdy equ 20h ;Drive ready bit of status index equ 40h ;Index bit of status pstep equ 4 ;Step bit of function nstep equ 0fbh ;Step bit mask of function hdrlen equ 4 ;Sector header length seclen equ 512 ;Sector data length wenabl equ 0fh ;Write enable wreset equ 0bh ;Write reset of function scenbl equ 5 ;Controller control dskclk equ 7 ;Disk clock for control mdir equ 0f7h ;Direction mask for function null equ 0fch ;Null command idbuff equ 0 ;Initialize data command isbuff equ 8 ;Initialize header command rsect equ 1 ;Read sector command wsect equ 5 ;Write sector command endif ***************************************************************** * * * The folowing equates will define thper feed strobe crstb equ 20h ;Carriage strobe pwstb equ 40h ;Print wheel strobe restore equ 80h ;Printer restore (Ribbon lift on Multi I/O) ; Define clock select bits rlift equ 40h ;Ribbon lift pselect equ 80h ;Select (Not used by Diablo) ; Define group select bits s0 equ 01h ;Group number (0-3) s1 equ 02h smask equ 03h bank equ 04h enint equ 08h restor equ 10h ;Printer restore on Multi I/O denable equ 20h ;Driver enable on Multi I/O ; Define special constants for the HyTyp II driver cperi equ 10 ;Default to 10 characters per inch lperi equ 6 ;Default lines per inch hinc equ 120 ;Horizontal increments per inch vinc equ 48 ;Vertical increments per inch numtabs equ 160 ;Number of horizontal tabs maxchrs equ 1024 ;Maximum number of printer characters to queue maxrgt equ 1584 ;Maximum carriage position dfrmln equ 110 ;Forms length times 10 autolf equ 0 ;Default to no Auto line feed. endif ***************************************************************stty ;Console status routine cin jmp ciflsh ;Console input cout jmp cotty ;Console output else jmp $ ;Console status routine PROM pointer cin jmp $ ;Console input PROM pointer cout jmp $ ;Console output PROM pointer endif if lsttyp ne 0 jmp list ;List device output else jmp cout ;List device output endif jmp punch ;Punch device output jmp reader ;Reader device input jmp home ;Home drive jmp setdrv ;Select disk jmp settrk ;Set track jmp setsec ;Set sector jmp setdma ;Set DMA address jmp read ;Read the disk jmp write ;Write the disk if lsttyp ne 0 jmp listst ;List device status else jmp $ ;List device status endif jmp sectran ;Sector translation if maxflop ne 0 djdrv jmp djsel ;Hookup for SINGLE.COM program else jmp donop endif ***************************************************************** * * * The following two words define the default baud rate for * * the console and the LST: devices. These words must e Decision I mother * * board I/O or the Multi I/O environments if needed. * * * ***************************************************************** multio equ (contyp eq 2) or (lsttyp ge 2) ;Multi I/O board used? if multio ;Define Multi I/O environment mbase equ 48h ;Base address of Multi I/O or Decision I grpsel equ mbase+7 ;Group select port dll equ mbase ;Divisor (lsb) dlm equ mbase+1 ;Divisor (msb) ier equ mbase+1 ;Interupt enable register clk equ mbase+2 ;WB14 printer select port lcr equ mbase+3 ;Line control register lsr equ mbase+5 ;Line status register msr equ mbase+6 rbr equ mbase ;Read data buffer thr equ mbase ;Tranmitter data buffer dlab equ 80h ;Divisor latch access bit thre equ 20h ;Status line THRE bit cts equ 10h ;Clear to send dsr equ 20h ;Data set ready dr equ 1 ;Line status DR bit wls0 equ 1 ;Word length select bit 0 wls1 equ 2 ;Word length select bit 1 for 8 bit word stb equ 4 ;Stop bit count - 2 stop bits ; Define multi I/O ports a** * * * CP/M system equates. If reconfiguration of the CP/M system * * is being done, the changes can be made to the following * * equates. * * * ***************************************************************** msize equ 48 ;Memory size of target CP/M bias equ (msize-20)*1024 ;Memory offset from 20k system ccp equ 2500h+bias ;Console command processor bdos equ ccp+800h ;BDOS address bios equ ccp+1600h ;Cbios address offsetc equ 2100h-bios ;Offset for sysgen cdisk equ 4 ;Address of last logged disk buff equ 80h ;Default buffer address tpa equ 100h ;Transient memory intioby equ 0 ;Initial IOBYTE iobyte equ 3 ;IOBYTE location wbot equ 0 ;Warm boot jump address entry equ 5 ;BDOS entry jump address ***************************************************************** * * * The following are internal Cbios equates. Most are misc. * * constants. * * * ***************************************************************** retries equ 10 ;Max re  * * immediatly follow the Cbios jump table so that the user * * can easly modify them and that they will also be used in * * the future by Morrow Designs software. * * * * The following is a list of possible baud rates and the * * value needed for the defcon or deflst words. * * * * Baud rate defcon Baud rate defcon * * 50 2304 2000 58 * * 75 1536 2400 48 * * 110 1047 3600 32 * * 134.5 857 4800 24 * * 150 768 7200 16 * * 300 384 9600 12 * * 600 192 19200 6 * * 1200 96 38400 3 * * 1800 64 56000 2 * * * ***************************************************************** defcon dw 12 ;Console baud rate deflst dw 12 ;Printer baud rate ***************************************************************** * * * The next byte is to make sure that the group select byte * * on the Mult I/O or Decsion I stays consistant throughout * * the Cbios. Only the group bits the****************** * * * contyp: 2 Multi I/O or Decision I console driver * * * ***************************************************************** if contyp eq 2 ***************************************************************** * * * Thi drive o col boo wil inspec bit 1- o th sens * * switches I th valu foun i i th rang 0- the th * * consol bau rat wil b take fro th rat table * * Otherwis th curren diviso latc valu wil b checked * * I th diviso seem t b o the n actio wil b take * * a fa a th bau rat settin goes I th diviso i no * * o the th bau rat wil b se fro the DEFCON word * * which is found just below the regular Cbios jump table. Th * * standar diviso tabl i give below. * * * * Sense switch: 123 (0 = off, 1 = on) * * 000 = 110 * * 001 = 300 * * 010 = 1200 * * 011 = 2400 * * 100 = 4800 * * 101 = 9600 * * 110 = 19200 * ********************************************************* if contyp eq 3 cotty jmp djcout ;Console output citty jmp djcin ;Console input cstty call djtstat ;Console status mvi a,0ffh rz inr a ret endif ;2DB ***************************************************************** * * * LST: device driver routines. * * * * Routine used depends on the value of lsttyp. Possible * * lsttyp values are listed as follows: * * * * lsttyp is: 0 Nothing, used for patching to PROM's. * * 1 Provide for 128 bytes of patch space. * * 2 Multi I/O serial, no protocol. * * 3 Multi I/O serial, CTS protocol. * * 4 Multi I/O serial, DSR protocol. * * 5 Multi I/O serial, Xon / Xoff protocol. * * 6 Multi I/O parallel, Centronics. * * 7 Multi I/O parallel, Diablo HyType II. * * * ***************************************************************** ***************************************************************** * * * lsttyp: 1 Blank spamselves (bits 0 and 1) * * should be changed as you output to the group port. If * * you modify one of the other bits (such a driver-enable) * * then you should modify the same bit in the group byte * * provided. Example: * * * * ;Select console group * * lda group ;Get group byte * * ori congrp ;Select the console port * * out grpsel ;Select the group * * * * ;Modify a bit in the group byte * * lda group ;Get group byte * * ori bank ;Set the bank bit * * sta group ;Save new group setting * * ori group2 ;Select second serial port * * out grpsel ;Select the desired group * * * * Note: You should not set the group bits themselves in * * the group byte. * * * ***************************************************************** group db 0 ;Group byte ***************************************************************** * * * Console driver routines. * * * * Routine used depends on the value of contyp. Possi defcon = 9600 * * * * Note: If you are compiling with multr3 (a Multi I/O) then * * the switches will not be available so the baud rate * * will be taken from defcon. * * * ***************************************************************** ***************************************************************** * * * Du t it length th tini routine drive i below th * * cboo routine. * * * ***************************************************************** ***************************************************************** * * * Read a character from the serial port. * * * ***************************************************************** citty lda group ;Get group byte ori congrp ;Select console out grpsel conin1 in lsr ;Read status register ani dr ;Wait till character ready jz conin1 in rbr ;Read character ani 7fh ;Strip parity ret ***************************************************************** * ce for printer driver * * * * Note I th use plan t utiliz thi spac the th * * on tim cod suc a lini soul b place jus belo * * th cboo routine Thi spac (below cboot i recyle * * fo us a dis buffe afte cboo i done. * * * ***************************************************************** if lsttyp eq 1 linit equ $ ;Make it easy to find this place list equ $ listst equ $ ret ds 127 endif ;Blank space ***************************************************************** * * * lsttyp: 2 Serial printer, no protocol * * * * lsttyp: 3 Serial printer, CTS protocol * * * * lsttyp: 4 Serial printer, DSR protocol * * * * lsttyp: 5 Serial printer, Xon / Xoff protocol * * * ***************************************************************** if (lsttyp ge 2) and (lsttyp le 5) list lda group ;Get group byte ori lstgrp ;Select list device out grpsel ll in lsr ani thre ;Wait tble * * contyp values are listed as follows: * * * * contyp is: 0 Nothing, used for patching to PROM's. * * 1 Provide for 128 bytes of patch space. * * 2 Multi I/O or Decision I driver. * * 3 2D/B driver. * * * ***************************************************************** ciflsh call flush ;Flush disk buffers on input jmp citty ***************************************************************** * * * contyp: 1 Blank space for console driver * * * * Note I th use plan t utiliz thi spac the th * * on tim cod suc a tini soul b place jus belo * * th cboo routine Thi spac (below cboot i recyle * * fo us a dis buffe afte cboo i done. * * * ***************************************************************** if contyp eq 1 tinit equ $ ;Make it easy to find this place cotty equ $ citty equ $ cstty equ $ ret ds 127 endif ;Blank space *********************************************** * * Output a character to serial port. * * * ***************************************************************** cotty lda group ;Get group byte ori congrp ;Select console out grpsel conout1 in lsr ;Read status ani thre ;Wait till transmitter buffer empty jz conout1 mov a,c ;Character is in (c) out thr ;Output to transmitter buffer ret ***************************************************************** * * * Return serial port status. Returns zero if character is not * * ready to be read. Else returns 255 if ready. * * * ***************************************************************** cstty lda group ;Get group byte ori congrp ;Select console out grpsel in lsr ;Read status register ani dr rz ;No charactter ready mvi a,0ffh ;Character ready ret endif ;Multi I/O or Decision I ***************************************************************** * * * contyp: 3 2DB console driver * * * ********* ill transmitter buffer empty jz ll ***************************************************************** * * * The CTS drive i use fo printe wit hardware * * handshakin (T 810) I shoul b connecte t the CTS * * inpu o th lis devic seria port. * * * ***************************************************************** if lsttyp eq 3 ;CTS protocol in msr ani cts ;Wait till clear to send jz ll endif ***************************************************************** * * * The DSR drive i use fo printe wit hardware * * handshakin (T 810) I shoul b connecte t the DSR * * inpu o th lis devic seria port. * * * ***************************************************************** if lsttyp eq 4 ;DSR protocol in msr ani dsr jz ll ;Wail till DSR comes up endif ***************************************************************** * * * Th Xon/Xof drive i use fo printe wit softwar * * hands * 13 slct -> 4 /ribbon * * 14 /auto feed xt <- 1 /d10 * * 15 NC * * 16 0V <-> 2 GND * * 17 chassis gnd * * 18 NC * * 19 /strobe rtn <-> 8 GND * * 20 data1 rtn <-> 11 GND * * 21 data2 rtn <-> 14 GND * * 22 data3 rtn <-> 16 GND * * 23 data4 rtn <-> 18 GND * * 24 data5 rtn <-> 20 GND * * 25 data6 rtn <-> 22 GND * * 26 data7 rtn <-> 25 GND * * 27 data8 rtn <-> 38 GND * * 28 /acknlg rtn <-> 41 GND * * 29 busy rtn <-> 44 GND * * 30 pe rtn <-> 47 GND * * 31 /init <- 9 /d11 * * 32 /error -> 5 /cover * * 33 GND <-> 35 GND * * 34 NC * * 35 /slct in <- 10 /d12 * * 35 <-> 24 /Select * * * * IMPORTANT: For this interface to work /select (24) on the * * parallel conector must be tied to ground (35). * * * ***************************************************************** list lda group ;Get group byte out grpsel rl in daisy0 ;Wait till printer ready and selected ani ready+paper jz rl pl in daesc ars c set vmi * * aesc aus c set hmi * * * ***************************************************************** list lda group ;Set printer initialized flag ori denable sta group mo a, ;Ge th characte t print ani 7fh ;Strip off parity rz cpi adel ;Ignore delete rz mov c,a ;Save character lda escflg lxi h,level0 ;Level zero characters ana a mov a,c ;Scan for char in A jz lookup ;Look up activity for this character lda escflg lxi h,level1 ;Single character escape sequences cpi aesc mov a,c ;Scan for char in A jz lookup ;Execute single level escape sequence lxi h,level2 ;Two character escape sequence lda escflg ***************************************************************** * Lookup scans the table pointed at by HL looking for a match * * of the character in register A. * ***************************************************************** lookup dcr m ;Test if end of table inr m jz gother ;Execute the default functionhakin (Diabl 630). * * * ***************************************************************** if lsttyp eq 5 ;Xon / Xoff protocol xloop call listst ;Check printer status ora a jz xloop ;Loop if not ready endif mov a,c out thr ret listst lda group ;Get group byte ori lstgrp ;Select list device out grpsel in lsr ;Check if transmitter buffer empty ani thr rz ;Return not ready if lsttyp eq 3 ;CTS protocol in msr ani cts rz ;Return not ready if CTS is false endif if lsttyp eq 4 ;DSR protocol in msr ani dsr rz ;Return not ready if DSR is true endif if lsttyp eq 5 ;Xon / Xoff protocol mvi b,xon ;Last character recieved from printer lstflg equ $-1 in lsr ani dr ;Check for a character jz xskip ;No character present in rbr ;Get character ani 7fh mov b,a ;Save sta lstflg ;Kludge flag (last character recieved) xskip mov a,b sui xoff ;Check for Xoff char (control S) jnz xsdone ;Printer ready ret ;Printer aisy0 ;Test if out of paper ani ribbon jnz pl el in daisy0 ani cover jnz el mov a,c ;Move character into (a) out daisi1 ;Latch data mvi a,d11+d10+d9 ;Make sure strobe is high out daisi0 dcr a ;Pulse strobe low out daisi0 inr a out daisi0 ack in daisy0 ;Wait till ready again ani ready jz ack ret listst lda group ;Get group byte out grpsel ;Select group zero in daisy0 ;Wait till printer ready and selected ani ready+paper rz in daisy0 ;Test if out of paper ani ribbon rz in daisy0 ani cover xri cover rz dcr a ret endif ;Centronics parallel if lsttyp eq 7 ;Diablo HyTyp II ***************************************************************** * Diablo 1610 simulator for the Morrow Designs / Thinker Toys * * Mult I/O board. The simulator makes the parallel Hytyp II * * look like a serial 1610. * ***************************************************************** ***************************************************************** cmp m ;Otherwise test for a match jz gother inx h ;Bump over character inx h ;Bump over function address inx h jmp lookup gother inx h ;Bump over character mov a,m ;Get low byte of function address inx h mov h,m ;Get high byte of function address mov l,a ;Form Address of function pchl ;Execute it ***************************************************************** * Each of the following tables contains entries of the form: * * 1 byte character to match * * 2 bytes of address to execute * * terminated by a first byte of 0. * ***************************************************************** level0 db aesc dw doaesc ;Beginning of an escape sequence db aff dw doaff ;Form feed db aetx dw doaetx db aht dw doaht ;horizontal tab db alf dw doalf ;Line feed db asp dw doasp ;Space db abs dw doabs ;Back space db acr dw doacr ;Carriage return db 0 dw dochar ;Any other character level1 db '1' dw sethtab ;Set horizontal tab not ready xsdone equ $ ;Printer ready for data endif mvi a,0ffh ret ;Printer ready endif ;Multi I/O serial ***************************************************************** * * * lsttyp: 6 Centronics parallel printer driver. * * * ***************************************************************** if lsttyp eq 6 ***************************************************************** * * * Decision I Diablo parallel to Centronics parallel interface. * * * * The following cable must be made from the 50 pin Diablo * * conector to the 35 pin Centronics. * * * * Centronics Multi I/O * * pin signal pin signal * * 1 /strobe <- 46 /d9 * * 2 data1 <- 37 /d1 * * 3 data2 <- 36 /d2 * data3 <- 3 /d3 * * 5 data4 <- 33 /d4 * * 6 data5 <- 40 /d5 * * 7 data6 <- 42 /d6 * * 8 data7 <- 43 /d7 * * 9 data8 <- 45 /d8 * * 10 /acknlg -> 12 /check * * 11 busy -> 28 /printer ready * * 12 pe -> 3 /paper *  * * * Thi routin doe al o th characte decoding escap * * sequence forward backward etc Th lis o escap * * sequences an specia character recognize is: * * * * adel ignored * * anul ignored * * aack ignored (when received) * * abel ignored * * aff form feed * * aetx etx/ack handshake * * aht horizontal tab * * alf line feed * * asp space * * abs backspace * * acr carriage return * * aesc 0 ignored * * aesc 1 set tab stop at current print position * * aesc 2 clear all tab stops * * aesc 3 graphics mode on * * aesc 4 graphics mode off * * aesc 5 forward print * * aesc 6 backward print * * aesc 8 clear tab stop * * aesc 9 set left margin * * aesc A ignored * * aesc B ignored * * aesc D negative half line feed * * aesc U half line feed * * aesc alf negative line feed * * aesc aht c absolute horizontal tab * * aesc avt c absolute vertical tab * * db '2' dw clrall ;Clear all horizontal tabs db '3' dw setgrp ;Graphics mode db '4' dw clrgrp ;Clear graphics mode db '5' dw clrdir ;Forward printing db '6' dw setdir ;Backward printing db '8' dw clrhtab ;Clear horizontal tab db '9' dw setlmar ;Set left margin db '0' dw func1 ;No operation level 1 db 'A' dw func1 db 'B' dw func1 db 'a' dw func1 db 'b' dw func1 db 'D' dw neghlf ;Negative half line feed db 'U' dw poshlf ;Half line feed db alf dw neglf ;Negative line feed db aht dw settwo ;Two character escape sequence db avt dw settwo db ars dw settwo db aus dw settwo db 0 dw func1 level2 db aht dw abshtab ;Absolute horizontal tab db avt dw absvtab ;Absolute vertical tab db ars dw setvmi db aus dw sethmi db 0 dw func2 ***************************************************************** * The following routines execute escape sequences, etc. * ********************************************************Get current position xchg lhld dlhpos ;Get offset dad d shld lmar jmp func1 setvmi mov l,c ;Set the motion index mvi h,0 dcx h shld vmi jmp func2 sethmi mov l,c mvi h,0 dcx h shld hmi jmp func2 poshlf call hlfvmi ;Half line feed vmi call adjvp jmp func1 neghlf call hlfvmi ;Negative half line feed call neghl call adjvp jmp func1 hlfvmi lhld vmi ;Get vmi for full line feed divid2 mov a,h ;High byte ora a ;Clear the carry rar mov h,a mov a,l rar mov l,a ret abshtab mov e,c ;Absolute horizontal tab mvi d,0 dcx d ;Form 16 bit tab column call newdlh jmp func2 newdlh lhld hmi call hltde ;Multiply by hmi xchg lhld hpos ;And subtract current horizontal position xchg call hlmde shld dlhpos ret absvtab mov e,c ;Absolute vertical tab mvi d,0 dcx d lhld vmi call hltde ;Multiply by vmi xchg lhld vpos ;And subtract the current vertical position xchg call hlmde shld dlvpos jmp func2 sethtab ca ***************************************************************** * Hlmde subtracts DE from HL and returns. * ***************************************************************** hlmde xchg call neghl xchg dad d ret ***************************************************************** * Hlcde compares HL with DE. On return the Z flag is set if * * they are equal, the Carry flag is set if HL is less than DE. * ***************************************************************** hlcde mov a,h cmp d rnz mov a,l cmp e ret ***************************************************************** * Divide the number in HL by the number in DE. Return the * * quotient in HL and the remainder in DE. * ***************************************************************** hldde mov a,d ;Start by negating DE and cma ; moving the left operand to BC mov b,a mov a,e cma mov c,a inx b mvi a,16 ;Repeat count in reg A lxi d,0 ;Initial remainder is zero div3 dcr a ;Test if done ********* settwo doaesc mov a,c ;Get the escape character sta escflg func0 ret doaetx ret doalf call lfvmi ;Get line feed vmi adjvp xchg lhld dlvpos ;Get vertical motion displacement dad d shld dlvpos ret lfvmi lda grhflg ana a lxi h,1 ;Only 1/48 if in graphics mode rnz lhld vmi ;Get vertical motion index ret neglf call lfvmi ;Get line feed vmi call neghl call adjvp jmp func1 doasp call sphmi ;Get space horizontal motion spdir lda dirflg ;Forward or backwards ? ana a cnz neghl ;Negate HL adjhp xchg ;Adjust Horizontal position lhld dlhpos ;Get current adjustment dad d ;Update it shld dlhpos ;And save ret sphmi lda grhflg ;In graphics mode ? ana a lxi h,2 ;Only 1/60 if in graphics mode rnz lhld hmi ret doabs call sphmi ;Space increment call neghl ;Negative to start with jmp spdir ;Adjust backwards doacr xra a sta dirflg ;Forward printing sta grhflg ;No graphics mode lhld hpos ;Get current offset xchll tabcol ;Set horizontal tab or ;O i ta stop mov m,a ; and save jmp func1 tabcol lhld hpos ;Compute address of current character col xchg lhld dlhpos dad d ;Get logical position xchg lhld hmi ;And divide by hmi to get character column xchg call hldde mtabp ;Make a tab pointer ;HL -> Tab column desired (1-160) ;HL <- address of tab stop ; A <- bit mask for tab stop lxi d,8 ;Number of stops per byte call hldde ;HL/DE -> HL, HL mod DE -> DE mov c,e ;Save inr c ;Make range (1-8) lxi d,tabstp ;Tab array dad d ;Make array pointer xra a stc mtab0 rar dcr c ;Bump bit counter jnz mtab0 ret clrhtab call tabcol ;Clear horizontal tab cma ana m ;Mask out tab stop mov m,a jmp func1 doaht lhld hpos ;Compute address of current character col xchg lhld dlhpos dad d ;Get logical position xchg lhld hmi ;And divide by hmi to get character column xchg call hldde tablop lxi d,numtabs inx h ;Start with next position cal rm ;All done ? dad h ;Shift right operand to the left xchg push psw ;Save carry dad h ;Shift left operand to the left pop psw jnc div1 ;Does it fit ? inx h div1 push h dad b jnc div2 xchg inx h xthl pop h jmp div3 div2 pop h xchg jmp div3 ***************************************************************** * Multiply the contents of HL by the contents of DE. * ***************************************************************** hltde mov c,l mov b,h lxi h,0 mult mov a,b ora c rz mov a,b ora a rar mov b,a mov a,c rar mov c,a cc dadde xchg dad h xchg jmp mult dadde dad d ret ***************************************************************** * The routines below actually interface to the printer, * * causing paper feed, carriage, and print wheel motion. * ***************************************************************** carrg lhld dlhpos ;Check for any accumulated motion mov a,h ora l rz lhld hpos ;Check for too g lhld lmar ;Get left margin call hlmde shld dlhpos ;Don't move yet though mvi a,autolf ;In Auto line feed mode ? ana a jnz doalf ;Do line feed also ret dochar mov l,c mvi h,0 call wheel ;Print the character in register C lda grhflg ana a lxi h,0 ;Don't move if in graphics mode jnz spdir lhld hmi jmp spdir clrall equ $ ;Clear all horizontal tabs lxi h,tabstp ;Beginning of tab stop array mvi d,tablen ;Size of tab array (bytes) notblp mvi m,80h ;Reset tabs (reset to 0 later) kludge equ $-1 ;Used on first reset (warmboot) inx h ;Next tab stop dcr d ;Update repeat count jnz notblp ;Continue zeroing func2 equ $ func1 xra a ;Clear escape sequence flag sta escflg ret setgrp mvi a,1 ;Set graphics mode on sta grhflg jmp func1 clrgrp xra a ;Turn graphics mode off sta grhflg jmp func1 clrdir xra a ;Forward print mode sta dirflg jmp func1 setdir mvi a,a ;Set backward printing mode sta dirflg jmp func1 setlmar lhld hpos ;l hlcde ;Compare position with number of tabs jnc tofar ;Past last tab push h ;Save col pointer call mtabp ;Generate tab pointer ana m ;Check out tab stop pop h ;Restore col pointer jz tablop ;Loop if stop not set xchg jmp newdlh ;Set new col position and return tofar lhld hpos ;Go all the way to the right xchg lxi h,maxrgt call hlmde shld dlhpos ret doaff lxi h,dfrmln ;Multiply forms length by 48 lxi d,48 call hltde lxi d,10 call hldde ;And divide it by 10 push h ;Save this result lhld vpos ;Get logical vertical position xchg lhld dlvpos dad d pop d push d ;Get copy of forms length call hldde ;HL mod DE xchg pop d xchg call hlmde xchg lhld dlvpos dad d shld dlvpos jmp papr ***************************************************************** * Neghl forms the twos complement of HL. * ***************************************************************** neghl mov a,h cma mov h,a mov a,l cma mov l,a inx h ret much motion xchg lhld dlhpos dad d mov a,h ana a jp lftok lhld hpos call neghl shld dlhpos lftok lhld hpos xchg lhld dlhpos dad d lxi d,maxrgt call hlcde jc rgtok lhld hpos ;Otherwise move only to maxright xchg lxi h,maxrgt call hlmde shld dlhpos rgtok lhld hpos ;Update the horizontal position xchg lhld dlhpos dad d shld hpos lhld dlhpos ;check if required motion is to the left mov a,h ana a mvi c,0 jp posh call neghl mvi c,d11 posh xchg lxi h,0 shld dlhpos ;Reset the horizontal increment xchg mov a,l ani 1 jz nohhlf ;No half spaces mov a,c ori d12 mov c,a nohhlf call divid2 mov a,h ani d9+d10 ora c mov h,a lxi d,crstrd jmp cmnd papr lhld dlvpos ;Check for any paper motion mov a,h ora l rz ;No motion mov a,h ana a mvi c,0 jp posv call neghl mvi c,d11 posv mov a,h ani d9+d10 ora c mov h,a push h ;Save paper motion lhld vpos xchg lhld dlvpos ;Get logical position dad d  flag escflg db 0 ;Escape sequence in progress flag tabstp ds numtabs/8+1 ;Tab stops bit array tablen equ numtabs/8+1 ;Length of tabs array endif ***************************************************************** * * * The following routines are used to make the reader and punch * * devices peform I/O through the console. The user may patch * * here for their particular devices. * * * ***************************************************************** punch jmp cout reader jmp cin ***************************************************************** * * * Gocpm is the entry point from cold boots, and warm boots. It * * initializes some of the locations in page 0, and sets up the * * initial DMA address (80h). * * * ***************************************************************** gocpm lxi h,buff ;Set up initial DMA address call setdma mvi a,(jmp) ;Initialize jump to warm boot sta wbot sta entry ;Initialize jump to BDOS lxi h,wbootcold boots. * * * ***************************************************************** wboot lxi sp,tpa ;Set up stack pointer mvi a,1 sta cwflg ;Set cold/warm boot flag if (maxhd ne 0) and first ;Supply Warm Boot from Hard Disk ? xra a mov c,a lxi h,ccp-200h ;Initial DMA address push h sta head mvi a,1 push psw ;Save first sector - 1 call hddrv ;Select drive A mvi c,0 call hdtrk ;Home the drive warmlod pop psw ;Restore sector pop h ;Restore DMA address inr a sta hdsectr cpi 12 ;Past BDOS ? jz gocpm ;Yes, all done inr h ;Update DMA address inr h shld hdadd push h push psw warmrd lxi b,retries*100h+0 ;Retry counter wrmread push b ;Save the retry count call hdread ;Read the sector pop b jnc warmlod ;Test for error dcr b ;Update the error count jnz wrmread ;Keep trying if not to many errors hlt ;Error halt db 0 ;Try not to screw up Decision CPU's endif *****************************************************************  push h ;Save for now lxi h,dfrmln ;Get default form length lxi d,48 call hltde ;Multiply by 48 lxi d,10 call hldde ;Divide by 10 pop d xchg call hldde ;Compute HL mod DE xchg shld vpos ;Save new vertical position lxi h,0 shld dlvpos ;Reset vertical motion pop h lxi d,pfstrd ;Paper feed strobe jmp cmnd wheel push h call carrg ;Position the carriage first call papr pop h lxi d,pwstrd cmnd lda group ;Get group byte out grpsel ;Select group zero cmnd0 in daisy0 ana d jz cmnd0 mov a,l ;Negate low data bits cma mov l,a mov a,h ani d9+d10+d11+d12 ;Mask in data bits only cma if multr3 ;Mask out ribbon lift bit on Multi I/O ani 0ffh-restore endif mov h,a mov a,l out daisi1 ;Output low bits mov a,h out daisi0 ;Output high bits xra e ;Slap strobe bits in out daisi0 mov a,h ;And drop strobes back down out daisi0 ret ***************************************************************** * New list device status routie ;Address in warm boot jump shld wbot+1 lxi h,bdos+6 ;Address in BDOS jump shld entry+1 xra a ;A <- 0 sta bufsec ;Disk Jockey buffer empty sta bufwrtn ;Set buffer not dirty flag lda cdisk ;Jump to CP/M with currently selected disk in C mov c,a lda cwflg ora a lxi d,coldbeg ;Beginning of initial command mvi a,coldend-coldbeg+1 ;Length of command jz cldcmnd lxi d,warmbeg mvi a,warmend-warmbeg+1 cldcmnd lxi h,ccp+8 ;Command buffer sta ccp+7 mov b,a call movlop lda cwflg ora a lda autoflg jz cldbot rar cldbot rar jc ccp jmp ccp+3 ;Enter CP/M cwflg db 0 ;Cold/warm boot flag ***************************************************************** * * * The following byte determines if an initial command is to be * * given to CP/M on warm or cold boots. The value of the byte is * * used to give the command to CP/M: * * * * 0 = never give command. * * 1 = give command on cold boots only. * * 2 = give the command on warm boots o * * * Floppy disk warm boot loader * * * ***************************************************************** if (maxflop ne 0) and not first ;Supply Warm Boot from 2D ? mvi c,0 call djsel ;Select drive A wrmfail call djhome ;Track 0, single density jc wrmfail ;Loop if error mvi c,0 ;Select side 0 call djside ;The next block of code re-initializes ; the warm boot loader for track 0. mvi a,5-2 ;Initialize the sector to read - 2 sta newsec lxi h,ccp-100h ;First revolution DMA - 100h shld newdma ;Load all of track 0 t0boot mvi a,5-2 ;First sector - 2 newsec equ $-1 inr a ;Update sector # inr a cpi 27 ;Size of track in sectors + 1 jc nowrap ;Skip if not at end of track jnz t1boot ;Done with this track sui 27-6 ;Back up to sector 6 lxi h,ccp-80h ;Memory address of sector - 100h shld newdma nowrap sta newsec ;Save the updated sector # mov c,a call djsec ;Set up the sector lxi h,ccp-100h ;Memory address of sector - 1ne. Returns 0ffh if the printer * * can except another character, otherwise it returns 0. * ***************************************************************** listst lda group ;Check printer initialized flag ani denable rz ;0 = printer not initialized lda group ;Get group byte out grpsel ;Select group zero lxi d,pwstrd in daisy0 ana d xra a rz cma ret ***************************************************************** * Dynamic data locations used by the simulator. * ***************************************************************** hmi dw 0 ;Horizontal motion index. Set by linit ; and escape sequences. vmi dw 0 ;Vertical motion index. Set by linit ; and escape sequences. vpos dw 0 ;Vertical position. Set by platen motion dlvpos dw 0 ;Delta vpos. Set by platen motion hpos dw 0 ;Horizontal position. Set by carriage motion dlhpos dw 0 ;Delta hpos. Set by carriage motion lmar dw 0 ;Left margin dirflg db 0 ;Direction flag grhflg db 0 ;Graphics modenly. * * 3 = give the command on warm and cold boots. * * * ***************************************************************** autoflg db 0 ;Auto command feature ***************************************************************** * * * If there is a command inserted here, it will be given if the * * auto feature is enabled. * * For Example: * * * * coldbeg db 'MBASIC MYPROG' * * coldend db 0 * * * * will execute microsoft basic, and mbasic will execute the * * "MYPROG" basic program. * * * ***************************************************************** coldbeg db '' ;Cold boot command goes here coldend db 0 warmbeg db '' ;Warm boot command goes here warmend db 0 ***************************************************************** * * * Wboot loads in all of CP/M except the Cbios, then initializes * * system parameters as in cold boot. See the Cold Boot Loader * * listing for exactly what happens during warm and 00h newdma equ $-2 lxi d,100h ;Update DMA address dad d nowrp shld newdma ;Save the updated DMA address mov b,h mov c,l call djdma ;Set up the new DMA address lxi b,retries*100h+0;Maximum # of errors, track # wrmfred push b call djtrk ;Set up the proper track call djread ;Read the sector pop b jnc t0boot ;Continue if no error dcr b jnz wrmfred ;Keep trying if error jmp djerr ;To many errors, flash the light ;Load track 1, sector 1, sector 3 (partial), sector 2 (1024 byte sectors) t1boot mvi c,1 ;Track 1 call djtrk lxi b,ccp+0b00h ;Address for sector 1 lxi d,10*100h+1 ;Retry count + sector 1 call wrmread lxi b,ccp+0f00h ;Address for sector 2 lxi d,10*100h+3 ;Retry count + sector 3 call wrmread lxi b,0300h ;Size of partial sector lxi d,ccp+1300h ;Address for sector 3 lxi h,ccp+0f00h ;Address of sector 3 wrmcpy mov a,m ;Get a byte and stax d ; save it. inx d ;Bump pointers inx h dcx b ;Bump counter mov a,b ;Check if done or * * * ***************************************************************** if (maxhd ne 0) and (maxflop ne 0) ;Both types ? sectran lda cpmdrv ;Get the Drive Number if first cpi maxhd*logdsk ;Over the # of hard disks ? jc tranhd else cpi maxflop ;Over the # of floppies ? jnc tranhd endif endif if (maxhd eq 0) or (maxflop eq 0) ;Just one type ? sectran equ $ endif if maxflop ne 0 ;Floppy translation tranfp inx b push d ;Save table address push b ;Save sector # call getdpb ;Get DPB address into HL mov a,m ;Get # of CP/M sectors/track ora a ;Clear cary rar ;Divide by two sub c push psw ;Save adjusted sector jm sidetwo sidea pop psw ;Discard adjusted sector pop b ;Restore sector requested pop d ;Restor address of xlt table sideone xchg ;hl <- &(translation table) dad b ;bc = offset into table mov l,m ;hl <- physical sector mvi h,0 ret sidetwo lxi b,15 ;Offset to side bit dad b mov a,m ani 8 ;Test for double s9, 0ffh, 9, 0ffh db 9, 0ffh, 9, 0ffh, 9, 0, 1, 0, 0, 0, 0, 0, 0, 0 djnext mvi a,1 ;Save 2D initialized flag sta flopflg endif if maxflop ne 0 flopok lxi h,1 ;Select sector 1 of track 1 shld truesec mvi a,1 sta cpmtrk call fill ;Flush buffer and refill jc zret ;Test for error return call djstat ;Get status on current drive ani 0ch ;Strip off unwanted bits push psw ;Used to select a DPB rar lxi h,xlts ;Table of XLT addresses mov e,a mvi d,0 dad d push h ;Save pointer to proper XLT call getdpb ;Get DPH pointer into DE xchg ; pop d mvi b,2 ;Number of bytes to move call movlop ;Move the address of XLT lxi d,8 ;Offset to DPB pointer dad d ;HL <- &DPH.DPB push h lhld origin+7 ;Get address of DJ terminal out routine inx h ;Bump to look at address of ; uart status location mov a,m xri 3 ;Adjust for proper rev DJ mov l,a mvi h,(origin+300h)/100h mov a,m ani dblsid ;Check double sided bit lxi d,dpb128s ;Base for single sidea c jnz wrmcpy ; if not, loop lxi b,ccp+0f00h ;Address for sector 2 lxi d,10*100h+2 ;Retry count + sector 2 call wrmread jmp gocpm ;All done, do last inits... wrmread push d call djdma ;Set DMA address pop b call djsec ;Set sector wrmfrd push b ;Save error count call djread ;Read a sector jc wrmerr ;Do retry stuff on error call djstat ;Sector size must be 1024 bytes ani 0ch ;Mask length bits sui 0ch ;Carry (error) will be set if < 0c0h wrmerr pop b ;Fetch retry count rnc ;Return if no error dcr b ;Bump error count jnz wrmfrd jmp djerr ;Error, flash the light endif ***************************************************************** * * * Setsec just saves the desired sector to seek to until an * * actual read or write is attempted. * * * ***************************************************************** setsec mov h,b mov l,c shld cpmsec donop ret ;Null SINGLE.COM hookup for no floppies **************************ided jz sidea ;Media is only single sided pop psw ;Retrieve adjusted sector pop b cma ;Make sector request positive inr a mov c,a ;Make new sector the requested sector pop d call sideone mvi a,80h ;Side two bit ora h ; and sector mov h,a ret endif if maxhd ne 0 ;Hard Disk translation routine tranhd mov h,b mov l,c inx h ret endif ***************************************************************** * * * Setdrv selects the next drive to be used in read/write * * operations. If the drive has never been selected before, a * * parameter table is created which correctly describes the * * diskette currently in the drive. Diskettes can be of four * * different sector sizes: * * 1) 128 bytes single density. * * 2) 256 bytes double density. * * 3) 512 bytes double density. * * 4) 1024 bytes double density. * * * ***************************************************************** setdrv mov a,c ;Save the drive # sta cpmdrv cpid DPB's jnz sideok lxi d,dpb128d ;Base of double sided DPB's sideok xchg ;HL <- DBP base, DE <- &DPH.DPB pop d ;Restore DE (pointer into DPH) pop psw ;Offset to correct DPB ral ral mov c,a mvi b,0 dad b xchg ;Put DPB address in DPH mov m,e inx h mov m,d endif if (maxhd ne 0) and (maxflop ne 0) jmp setdrv1 ;Skip over the Hard Disk select if not first subfp sui maxflop ;Adjust the drive # endif endif if maxhd ne 0 drvhd call divlog ;Divide by logical disks per drive mov a,c sta hddisk call drvptr mov a,m inr a jnz setdrv1 ori null ;Select drive out hdfunc mvi a,scenbl ;Enable the controller out hdcntl mvi c,239 ;Wait approx 2 minutes for Disk to ready lxi h,0 tdelay dcx h mov a,h ora l cz dcrc rz in hdstat ;Test if ready yet ani drvrdy jnz tdelay if not fujitsu lxi h,0 ;Time one revolution of the drive mvi c,index in hdstat ana c mov b,a ;Save current index level in B indx1 in hdstat ana c cmp b *************************************** * * * Setdma saves the DMA address for the data transfer. * * * ***************************************************************** setdma mov h,b ;hl <- bc mov l,c shld cpmdma ;CP/M dma address ret ***************************************************************** * * * Home is translated into a seek to track zero. * * * ***************************************************************** home mvi c,0 ;Track to seek to ***************************************************************** * * * Settrk saves the track # to seek to. Nothing is done at this * * point, everything is deffered until a read or write. * * * ***************************************************************** settrk mov a,c ;A <- track # sta cpmtrk ;CP/M track # ret ***************************************************************** * * * Sectran translates a logical sector # into a physical sector * * #.  maxflop+(maxhd*logdsk) ;Check for a valid drive # jnc zret ;Illegal drive # mov a,e ;Test if drive ever logged in before ani 1 jnz setdrv1 ;Bit 0 of E = 0 -> Never selected before if (maxhd ne 0) and (maxflop ne 0) ;Both types ? lda cpmdrv ;Get the Drive Number if first cpi maxhd*logdsk ;Over the # of hard disks ? jc drvhd sui maxhd*logdsk else cpi maxflop ;Over the # of floppies ? jnc subfp endif endif if (maxflop ne 0) and first mov c,a ;Save drive # mvi a,0 ;Have the floppies been accessed yet ? flopflg equ $-1 ana a jnz flopok mvi b,17 ;Floppies havn't been accessed lxi h,djboot ;Check if 2D controller is installed mvi a,(jmp) clopp cmp m jnz zret inx h inx h inx h dcr b jnz clopp lxi d,djinit ;Initialization sequence lxi h,origin+7e2h ;Load address mvi b,30 ;Byte count call movlop mvi a,0ffh ;Start 1791 sta dreg mvi a,clrcmd ;1791 reset sta cmdreg jmp djnext djinit db 0, 0, 0, 18h, 0, 0, 8, 0, 7eh, 0, 8, 0,  ;Loop util index level changes jz indx1 indx2 inx h in hdstat ;Start counting until index returns to ana c ; previous state cmp b jnz indx2 if m10 ;Memorex M10's have 40 ms head settle dad h endif if m26 ;Shugart M26's have 30 ms head settle xra a mov a,h rar mov d,a mov a,l rar mov e,a dad d endif shld settle ;Save the Count for timeout delay endif call hdhome endif setdrv1 call getdpb ;Get address of DPB in HL lxi b,15 ;Offset to sector size dad b mov a,m ;Get sector size ani 7h sta secsiz mov a,m rar rar rar rar ani 0fh sta secpsec xchg ;HL <- DPH ret zret lxi h,0 ;Seldrv error exit ret if maxhd ne 0 dcrc dcr c ;Conditional decrement C routine ret divlog mvi c,0 divlogx sui logdsk rc inr c jmp divlogx endif ***************************************************************** * * * Getdpb returns HL pointing to the DPB of the currently * * selected drive, DE pointing to DPH. * he sector from the disk that contains the * * desired CP/M sector. * * * ***************************************************************** read xra a ;Set the command type to read sta rdwr ;Save command type ***************************************************************** * * * Redwrt calculates the physical sector on the disk that * * contains the desired CP/M sector, then checks if it is the * * sector currently in the buffer. If no match is made, the * * buffer is flushed if necessary and the correct sector read * * from the disk. * * * ***************************************************************** redwrt mvi b,0 ;The 0 is modified to contain the log2 secsiz equ $-1 ; of the physical sector size/128 ; on the currently selected disk. lhld cpmsec ;Get the desired CP/M sector # mov a,h ani 80h ;Save only the side bit mov c,a ;Remember the side mov a,h ani 7fh ;Forget the side bit mov h,a dcx h ;Temporary adjustment divloouffer outof call mover xra a ret into xchg ; call mover ;Move the data, HL = destination ; DE = source mvi a,1 sta bufwrtn ;Set buffer written into flag mvi a,0 ;Check for directory write writtyp equ $-1 dcr a mvi a,0 sta writtyp ;Set no directory write rnz ;No error exit ***************************************************************** * * * Flush writes the contents of the buffer out to the disk if * * it has ever been written into. * * * ***************************************************************** flush mvi a,0 ;The 0 is modified to reflect if ; the buffer has been written into bufwrtn equ $-1 ana a ;Test if written into rz ;Not written, all done if (maxhd ne 0) and (maxflop ne 0) lxi h,djwrite ;Write operation for Disk Jockey lxi d,hdwrite ;Write operation for Hard Disk call decide else if maxhd ne 0 lxi h,hdwrite endif if maxflop ne 0 lxi h,djwrite endif endif ******************************** * * ***************************************************************** getdpb lda cpmdrv mov l,a ;Form offset mvi h,0 dad h dad h dad h dad h lxi d,dpbase ;Base of DPH's dad d push h ;Save address of DPH lxi d,10 ;Offset to DPB dad d mov a,m ;Get low byte of DPB address inx h mov h,m ;Get low byte of DPB mov l,a pop d ret ***************************************************************** * * * Xlts is a table of address that point to each of the xlt * * tables for each sector size. * * * ***************************************************************** if maxflop ne 0 xlts dw xlt128 ;Xlt for 128 byte sectors dw xlt256 ;Xlt for 256 byte sectors dw xlt512 ;Xlt for 512 byte sectors dw xlt124 ;Xlt for 1024 byte sectors endif ***************************************************************** * * * Write routine moves data from memory into the buffer. If the * * desired CP/M sector is not contained in the disk bup dcr b ;Update repeat count jz divdone ora a mov a,h rar mov h,a mov a,l rar ;Divide the CP/M sector # by the size ; of the physical sectors mov l,a jmp divloop ; divdone inx h mov a,h ora c ;Restore the side bit mov h,a shld truesec ;Save the physical sector number lxi h,cpmdrv ;Pointer to desired drive,track, and sector lxi d,bufdrv ;Pointer to buffer drive,track, and sector mvi b,5 ;Count loop dtslop dcr b ;Test if done with compare jz move ;Yes, match. Go move the data ldax d ;Get a byte to compare cmp m ;Test for match inx h ;Bump pointers to next data item inx d jz dtslop ;Match, continue testing ***************************************************************** * * * Drive, track, and sector don't match, flush the buffer if * * necessary and then refill. * * * ***************************************************************** call fill ;Fill the buffer with correct physical sector rc ;No good, return with ********************************* * * * Prep prepares to read/write the disk. Retries are attempted. * * Upon entry, H&L must contain the read or write operation * * address. * * * ***************************************************************** prep di ;Reset interrupts xra a ;Reset buffer written flag sta bufwrtn shld retryop ;Set up the read/write operation mvi b,retries ;Maximum number of retries to attempt retrylp push b ;Save the retry count lda bufdrv ;Get drive number involved in the operation if (maxhd ne 0) and (maxflop ne 0) if first cpi maxhd*logdsk jc noadjst sui maxhd*logdsk else cpi maxflop jc noadjst sui maxflop endif noadjst mov c,a lxi h,djdrv ;Select drive lxi d,hddrv call decidgo else mov c,a if maxhd ne 0 call hddrv endif if maxflop ne 0 call djdrv ;Select the drive endif endif lda buftrk ana a ;Test for track zero mov c,a push b if (maxhd ne 0) and (maxflop ne 0) lxi h,djhomffer, the * * buffer is first flushed to the disk if it has ever been * * written into, then a read is performed into the buffer to get * * the desired sector. Once the correct sector is in memory, the * * buffer written indicator is set, so the buffer will be * * flushed, then the data is transferred into the buffer. * * * ***************************************************************** write mov a,c ;Save write command type sta writtyp mvi a,1 ;Set write command db (mvi) or (b*8) ;This "mvi b" instruction causes ; the following "xra a" to ; be skipped over. ***************************************************************** * * * Read routine to buffer data from the disk. If the sector * * requested from CP/M is in the buffer, then the data is simply * * transferre fro th buffe t th desire dma address. If * * the buffer does not contain the desired sector, the buffer is * * flushed to the disk if it has ever been written into, then * * filled with terror indication ***************************************************************** * * * Move has been modified to cause either a transfer into or out * * the buffer. * * * ***************************************************************** move lda cpmsec ;Get the CP/M sector to transfer dcr a ;Adjust to proper sector in buffer ani 0 ;Strip off high ordered bits secpsec equ $-1 ;The 0 is modified to represent the # of ; CP/M sectors per physical sectors mov l,a ;Put into HL mvi h,0 dad h ;Form offset into buffer dad h dad h dad h dad h dad h dad h lxi d,buffer ;Beginning address of buffer dad d ;Form beginning address of sectgr to transfer xchg ;DE = address in buffer lxi h,0 ;Get DMA address, the 0 is modified t/ ; contain the DMA address cpmdma equ $-2 mvi a,0 ;The zero gets modified to contain ; a zero if a read, or a 1 if write rdwr equ $-1 ana a ;Test which kind of operation jnz into ;Transfer data into the be lxi d,hdhome cz decidgo else if maxhd ne 0 cz hdhome endif if maxflop ne 0 cz djhome ;Home the drive if track 0 endif endif pop b ;Restore track # if (maxhd ne 0) and (maxflop ne 0) lxi h,djtrk lxi d,hdtrk call decidgo else if maxhd ne 0 call hdtrk endif if maxflop ne 0 call djtrk ;Seek to proper track endif endif lhld bufsec mov a,h ;Get sector involved in operation rlc ;Bit 0 of A equals side # ani 1 ;Strip off unnecessary bits mov c,a ;C <- side # if (maxhd ne 0) and (maxflop ne 0) lxi h,djside lxi d,hdside call decidgo else if maxhd ne 0 call hdside endif if maxflop ne 0 call djside ;Select the side endif endif lhld bufsec mov a,h ani 7fh ;Strip off side bit mov b,a ;C <- sector # mov c,l if (maxhd ne 0) and (maxflop ne 0) lxi h,djsec lxi d,hdsec call decidgo else if maxhd ne 0 call hdsec endif if maxflop ne 0 call djsec ;Select the side endif endif lxi b,buffer ;vlop ;Continue moving until done ret ***************************************************************** * * * Routines to decide which controller to use. * * * ***************************************************************** if (maxhd ne 0) and (maxflop ne 0) decidgo call decide ;which controller ? pchl endif if (maxhd ne 0) and (maxflop ne 0) decide lda bufdrv ;Get proper routine into H&L, based if first ; on currently selected drive cpi maxhd*logdsk rnc else cpi maxflop rc endif xchg ret endif ***************************************************************** * * * The following is the equivalent of the lowest level drivers * * for the Hard Disk. * * * ***************************************************************** if maxhd ne 0 hddrv mov a,c ;Select Hard Disk drive call divlog ;Get the physical drive # mov a,c sta hddisk ;Select the drive ori null out hdfunc mvi a,wenabl out hdcntl ret hdh rc xra a out hdcmnd lhld hdadd mvi b,seclen/4 wtloop mov a,m ;Move 4 bytes out hddata inx h mov a,m out hddata inx h mov a,m out hddata inx h mov a,m out hddata inx h dcr b jnz wtloop mvi a,wsect ;Issue write sector command out hdcmnd call process rc mvi a,wfault ana b stc rz xra a ret process in hdstat ;Wait for command to finish mov b,a ani opdone jz process mvi a,dskclk out hdcntl in hdstat ani tmout ;Timed out ? stc rnz in hdreslt ani retry ;Any retries ? stc rnz xra a ret hdprep in hdstat ani drvrdy stc rnz mvi a,isbuff ;Initialize pointer out hdcmnd call build ori 0ch out hdfunc lda head out hddata ;Form head byte call drvptr mov a,m ;Form track byte out hddata ana a mvi b,80h jz zkey mvi b,0 zkey mvi a,0 ;Form sector byte hdsectr equ $-1 out hddata mov a,b out hddata mvi a,dskclk out hdcntl mvi a,wenabl out hdcntl xra a ret drvptr lhld hddisk xchSet the DMA address if (maxhd ne 0) and (maxflop ne 0) lxi h,djdma lxi d,hddma call decidgo else if maxhd ne 0 call hddma endif if maxflop ne 0 call djdma ;Select the side endif endif call 0 ;Get operation address retryop equ $-2 pop b ;Restore the retry counter mvi a,0 ;No error exit status rnc ;Return no error dcr b ;Update the retry counter stc ;Assume retry count expired mvi a,0ffh ;Error return rz ;Return sad news mov a,b cpi retries/2 ;reseek after half retries done jnz retrylp ;Try again push b if (maxhd ne 0) and (maxflop ne 0) lxi h,djhome lxi d,hdhome cz decidgo else if maxhd ne 0 cz hdhome endif if maxflop ne 0 cz djhome ;Home the drive if track 0 endif endif pop b jmp retrylp ;Try again ***************************************************************** * * * Fill fills the buffer with a new sector from the disk. * * * **************************************************************ome call drvptr mvi m,0 ;Set track to zero in hdstat ;Test status ani tkzero ;At track zero ? rz ;Yes if not fujitsu stepo in hdstat ;Test status ani tkzero ;At track zero ? jz delay mvi a,1 stc call accok ;Take one step out jmp stepo else xra a jmp accok endif if not fujitsu delay lxi h,0 ;Get delay settle equ $-2 deloop dcx h ;Wait 20ms mov a,h ora l inx h dcx h jnz deloop ret endif hdtrk call drvptr ;Get pointer to current track mov e,m ;Get current track mov m,c ;Update the track mov a,e ;Need to seek at all ? sub c rz cmc ;Get carry into direction jc hdtrk2 cma inr a if fujitsu hdtrk2 jmp accok else hdtrk2 call accok jmp delay endif accok mov b,a ;Prep for build call build sloop ani nstep ;Get step pulse low out hdfunc ;Output low step line ori pstep ;Set step line high out hdfunc ;Output high step line dcr b ;Update repeat count jnz sloop ;Keep going the required # of tracks g mvi d,0 lxi h,drives dad d ret build mvi a,0 head equ $-1 ral ral ral ral ori 0 hddisk equ $-1 xri 0f0h ret drives equ $ rept maxhd db 0ffh endm endif ***************************************************************** * * * Xlt tables (sector skew tables) for CP/M 2.0. These tables * * define the sector translation that occurs when mapping CP/M * * sectors to physical sectors on the disk. There is one skew * * table for each of the possible sector sizes. Currently the * * tables are located on track 0 sectors 6 and 8. They are * * loaded into memory in the Cbios ram by the cold boot routine. * * * ***************************************************************** if maxflop ne 0 xlt128 db 0 db 1,7,13,19,25 db 5,11,17,23 db 3,9,15,21 db 2,8,14,20,26 db 6,12,18,24 db 4,10,16,22 xlt256 db 0 db 1,2,19,20,37,38 db 3,4,21,22,39,40 db 5,6,23,24,41,42 db 7,8,25,26,43,44 db 9,10,27,28,45,46 db 11,12,29,30,47,48 db 13,14,3*** fill call flush ;Flush buffer first rc ;Check for error lxi d,cpmdrv ;Update the drive, track, and sector lxi h,bufdrv mvi b,4 ;Number of bytes to move call movlop ;Copy the data lda rdwr ana a jz fread lda writtyp dcr a dcr a rz call getdpb lxi d,15 dad d mov a,m ani 3 dcr a rz fread equ $ if (maxhd ne 0) and (maxflop ne 0) lxi h,djread lxi d,hdread call decide else if maxhd ne 0 lxi h,hdread endif if maxflop ne 0 lxi h,djread ;Select the side endif endif jmp prep ;Select drive, track, and sector. ; Then read the buffer ***************************************************************** * * * Mover moves 128 bytes of data. Source pointer in DE, Dest * * pointer in HL. * * * ***************************************************************** mover mvi b,128 ;Length of transfer movlop ldax d ;Get a bte of source mov m,a ;Move it inx d ;Bump pointers inx h dcr b ;Update counter jnz mojmp wsdone hddma mov h,b ;Save the DMA address mov l,c shld hdadd hdside equ $ ret wsdone in hdstat ;Wait for seek complete to finish ani complt jz wsdone ret if m26 hdsec mvi a,01fh ;For compatibility with Cbios rev 2.3, 2.4 ana c cz getspt sta hdsectr mvi a,0e0h ana c rlc rlc rlc sta head getspt mvi a,hdspt ret else hdsec mov a,c call divspt adi hdspt ana a cz getspt sta hdsectr mov a,c sta head getspt mvi a,hdspt dcr c ret divspt mvi c,0 divsptx sui hdspt rc inr c jmp divsptx endif hdread call hdprep rc xra a out hdcmnd cma out hddata out hddata mvi a,rsect ;Read sector command out hdcmnd call process rc xra a out hdcmnd mvi b,seclen/4 lxi h,0 hdadd equ $-2 in hddata in hddata rtloop in hddata ;Move four bytes mov m,a inx h in hddata mov m,a inx h in hddata mov m,a inx h in hddata mov m,a inx h dcr b jnz rtloop ret hdwrite call hdprep ;Prepare header 1,32,49,50 db 15,16,33,34,51,52 db 17,18,35,36 xlt512 db 0 db 1,2,3,4,17,18,19,20 db 33,34,35,36,49,50,51,52 db 5,6,7,8,21,22,23,24 db 37,38,39,40,53,54,55,56 db 9,10,11,12,25,26,27,28 db 41,42,43,44,57,58,59,60 db 13,14,15,16,29,30,31,32 db 45,46,47,48 xlt124 db 0 db 1,2,3,4,5,6,7,8 db 25,26,27,28,29,30,31,32 db 49,50,51,52,53,54,55,56 db 9,10,11,12,13,14,15,16 db 33,34,35,36,37,38,39,40 db 57,58,59,60,61,62,63,64 db 17,18,19,20,21,22,23,24 db 41,42,43,44,45,46,47,48 ***************************************************************** * * * Each of the following tables describes a diskette with the * * specified characteristics. * * * ***************************************************************** ***************************************************************** * * * The following DPB defines a diskette for 128 byte sectors, * * single density, and single sided. * * * ************************************************diskette for 128 byte sectors, * * single density, and double sided. * * * ***************************************************************** dpb128d dw 52 ;CP/M sectors/track db 4 ;BSH db 15 ;BLM db 1 ;EXM dw 242 ;DSM dw 127 ;DRM db 0c0h ;AL0 db 0 ;AL1 dw 32 ;CKS dw 2 ;OFF db 9h ***************************************************************** * * * The following DPB defines a diskette as 256 byte sectors, * * double density, and double sided. * * * ***************************************************************** dpb256d dw 104 ;CP/M sectors/track db 4 ;BSH db 15 ;BLM db 0 ;EXM dw 486 ;DSM dw 255 ;DRM db 0f0h ;AL0 db 0 ;AL1 dw 64 ;CKS dw 2 ;OFF db 1ah ***************************************************************** * * * The following DPB defines a diskette as 512 byte sectors, * * double density, and double sided. * * * ************************************************************al sector) -1) + ;log2(#bytes per sector/128) + 1 + ;8 if double sided. dpbhd2 dw 336 ;CP/M sectors/track db 5 ;BSH db 31 ;BLM db 1 ;EXM dw 1280 ;DSM dw 511 ;DRM db 0ffh ;AL0 db 0ffh ;AL1 dw 0 ;CKS dw 122 ;OFF db 33h ;16*((#cpm sectors/physical sector) -1) + ;log2(#bytes per sector/128) + 1 + ;8 if double sided. endif if m20 ne 0 dpbhd1 dw 672 ;CP/M sectors/track db 5 ;BSH db 31 ;BLM db 1 ;EXM dw 2015 ;DSM dw 511 ;DRM db 0ffh ;AL0 db 0ffh ;AL1 dw 0 ;CKS dw 1 ;OFF db 33h ;16*((#cpm sectors/physical sector) -1) + ;log2(#bytes per sector/128) + 1 + ;8 if double sided. dpbhd2 dw 672 ;CP/M sectors/track db 5 ;BSH db 31 ;BLM db 1 ;EXM dw 2015 ;DSM dw 511 ;DRM db 0ffh ;AL0 db 0ffh ;AL1 dw 0 ;CKS dw 98 ;OFF db 33h ;16*((#cpm sectors/physical sector) -1) + ;log2(#bytes per sector/128) + 1 + ;8 if double sided. dpbhd3 dw 672 ;CP/M sectors/track db 5 ;BSH db 31 ;BLM db 1***************** dpb128s dw 26 ;CP/M sectors/track db 3 ;BSH db 7 ;BLM db 0 ;EXM dw 242 ;DSM dw 63 ;DRM db 0c0h ;AL0 db 0 ;AL1 dw 16 ;CKS dw 2 ;OFF db 1h ;16*((#cpm sectors/physical sector) -1) + ;log2(#bytes per sector/128) + 1 + ;8 if double sided. ***************************************************************** * * * The following DPB defines a diskette for 256 byte sectors, * * double density, and single sided. * * * ***************************************************************** dpb256s dw 52 ;CP/M sectors/track db 4 ;BSH db 15 ;BLM db 0 ;EXM dw 242 ;DSM dw 127 ;DRM db 0c0h ;AL0 db 0 ;AL1 dw 32 ;CKS dw 2 ;OFF db 12h ;16*((#cpm sectors/physical sector) -1) + ;log2(#bytes per sector/128) + 1 + ;8 if double sided. ***************************************************************** * * * The following DPB defines a diskette as 512 byte sectors, * * double density, and single sided. ***** dpb512d dw 120 ;CP/M sectors/track db 4 ;BSH db 15 ;BLM db 0 ;EXM dw 561 ;DSM dw 255 ;DRM db 0f0h ;AL0 db 0 ;AL1 dw 64 ;CKS dw 2 ;OFF db 3bh ***************************************************************** * * * The following DPB defines a diskette as 1024 byte sectors, * * double density, and double sided. * * * ***************************************************************** dp1024d dw 128 ;CP/M sectors/track db 4 ;BSH db 15 ;BLM db 0 ;EXM dw 599 ;DSM dw 255 ;DRM db 0f0h ;AL0 db 0 ;AL1 dw 64 ;CKS dw 2 ;OFF db 7ch endif ***************************************************************** * * * The following DPB's are for the standard format to be * * compatable with older versions of the Cbios. * * * ***************************************************************** if stdlog eq 0 ;Use standard format if maxhd ne 0 if m26 ne 0 dpbhd1 dw 1024 ;CP/M sectors/track db 5 ;BSH  ;EXM dw 1028 ;DSM dw 511 ;DRM db 0ffh ;AL0 db 0ffh ;AL1 dw 0 ;CKS dw 195 ;OFF db 33h ;16*((#cpm sectors/physical sector) -1) + ;log2(#bytes per sector/128) + 1 + ;8 if double sided. endif endif endif ***************************************************************** * * Th followin DPB' ar use whe th use selecte th * * numbe o logica drives Thes macro divid evenl th * * spac pe logica driv wher th standar forma trie * * t creat th leas amoun o logica drive wit th * * mos spac pe logica drive. * * * ***************************************************************** if stdlog ne 0 mdpbhd macro l,d dpbhd&l dw secpt db bsh db blm db exm if ldsk ne 0 dw (totbls/logdsk) else dw (totbls/logdsk)-1 ;Reserved cpm track endif dw drm db al0 db al1 dw cks dw (tracks/logdsk)*&d+1 db slog endm if maxhd ne 0 if m10 ne 0 secpt equ 336 ;Sectors per track totbls equ 256 * * * ***************************************************************** dpb512s dw 60 ;CP/M sectors/track db 4 ;BSH db 15 ;BLM db 0 ;EXM dw 280 ;DSM dw 127 ;DRM db 0c0h ;AL0 db 0 ;AL1 dw 32 ;CKS dw 2 ;OFF db 33h ;16*((#cpm sectors/physical sector) -1) + ;log2(#bytes per sector/128) + 1 + ;8 if double sided. ***************************************************************** * * * The following DPB defines a diskette as 1024 byte sectors, * * double density, and single sided. * * * ***************************************************************** dp1024s dw 64 ;CP/M sectors/track db 4 ;BSH db 15 ;BLM db 0 ;EXM dw 299 ;DSM dw 127 ;DRM db 0c0h ;AL0 db 0 ;AL1 dw 32 ;CKS dw 2 ;OFF db 74h ;16*((#cpm sectors/physical sector) -1) + ;log2(#bytes per sector/128) + 1 + ;8 if double sided. ***************************************************************** * * * The following DPB defines a db 31 ;BLM db 1 ;EXM dw 1973 ;DSM dw 511 ;DRM db 0ffh ;AL0 db 0ffh ;AL1 dw 0 ;CKS dw 1 ;OFF db 33h ;16*((#cpm sectors/physical sector) -1) + ;log2(#bytes per sector/128) + 1 + ;8 if double sided. dpbhd2 dw 1024 ;CP/M sectors/track db 5 ;BSH db 31 ;BLM db 1 ;EXM dw 1973 ;DSM dw 511 ;DRM db 0ffh ;AL0 db 0ffh ;AL1 dw 0 ;CKS dw 64 ;OFF db 33h ;16*((#cpm sectors/physical sector) -1) + ;log2(#bytes per sector/128) + 1 + ;8 if double sided. dpbhd3 dw 1024 ;CP/M sectors/track db 5 ;BSH db 31 ;BLM db 1 ;EXM dw 1973 ;DSM dw 511 ;DRM db 0ffh ;AL0 db 0ffh ;AL1 dw 0 ;CKS dw 127 ;OFF db 33h ;16*((#cpm sectors/physical sector) -1) + ;log2(#bytes per sector/128) + 1 + ;8 if double sided. endif if m10 ne 0 dpbhd1 dw 336 ;CP/M sectors/track db 5 ;BSH db 31 ;BLM db 1 ;EXM dw 1269 ;DSM dw 511 ;DRM db 0ffh ;AL0 db 0ffh ;AL1 dw 0 ;CKS dw 1 ;OFF db 33h ;16*((#cpm sectors/physic2 ;Total blocks (4096 byte) tracks equ 244 ;Total tracks endif if m20 ne 0 secpt equ 672 totbls equ 5124 tracks equ 244 endif if m26 ne 0 secpt equ 1024 totbls equ 6464 tracks equ 202 endif bsh equ 5 blm equ 31 exm equ 1 drm equ 511 al0 equ 0ffh al1 equ 0ffh cks equ 0 slog equ 33h ldsk set 0 rept maxhd dpbdrv set 0 rept stdlog mdpbhd %ldsk,%dpbdrv ldsk set ldsk+1 dpbdrv set dpbdrv+1 endm endm endif endif ***************************************************************** * * * CP/M disk parameter headers, unitialized. * * * ***************************************************************** if stdlog eq 0 header macro nd,dpb dw 0 ;Translation table filled in later dw 0,0,0 ;Scratch dw dirbuf ;Directory buffer dw dpb ;DPB filled in later dw csv&nd ;Directory check vector dw alv&nd ;Allocation vector endm else header macro nd,dpb,dpno dw 0 ;Translation table filled in later dw 0,0,0 ;Scradif if (maxhd ne 0) and (maxflop ne 0) db ' and ' else db '.' endif if maxhd ne 0 if maxhd eq 1 db 'a ' endif if maxhd eq 2 db 'two ' endif if maxhd eq 3 db 'three ' endif if maxhd eq 4 db 'four ' endif if mrev eq 10 if fujitsu db 'Fujitsu ' else db 'Memorex ' endif db 'M10 ' endif if mrev eq 20 db 'Fujitsu M20 ' endif if mrev eq 26 db 'Shugart M26 ' endif db 'hard disk' if maxhd ne 1 db 's' endif db '.' endif db acr,alf if (contyp eq 0) or (contyp eq 1) db 'Nothing', acr, alf endif if contyp eq 2 if multr3 db 'Multi I/O' else db 'Decision I' endif endif if contyp eq 3 db '2D/B' endif db ' as console' if lsttyp ge 2 db ', ' if lsttyp eq 2 db 'serial' endif if lsttyp eq 3 db 'CTS protocol serial' endif if lsttyp eq 4 db 'DSR protocol serial' endif if lsttyp eq 5 db 'Xon/Xoff protocol serial' endif if lsttyp eq 6 db 'Centronics parallel' endif if lsttyp e***************** tinit lda group ;Get group byte ori congrp ;Select console device out grpsel in rbr ;Clear reciever buffers in rbr xra a out lsr ;Clear status out ier ;Set no interrupts if not multr3 ;Multi I/O has no sense switches lda group ;Get group byte out grpsel ;Select group zero to read sense switch in sensesw ;Get sense switch. ani 0e0h ;Mask in upper three bits rlc rlc rlc ;Move into lower 3 bits cpi 7 ;check for sense = 7 push psw ;Save value lda group ;Get group byte ori congrp ;Reselect serial port group out grpsel pop psw jz valid ;Do default rate lxi h,btab ;Pointer to baud rate table add a ;Table of words so double mov e,a ;Make a 16 bit number into (de) mvi d,0 dad d ;Get a pointer into baud rate table mov e,m ;Get lower byte of word inx h ;Point to high byte of word mov d,m ;Get upper byte. (de) now has divisor jmp setit ;Set baud rate. btab dw 1047 ;110 Baud 000 dw 384 ;300 001 dw 9tch dw dirbuf ;Directory buffer dw dpb&dpno ;DPB filled in later dw csv&nd ;Directory check vector dw alv&nd ;Allocation vector endm endif dpbase equ $ if stdlog eq 0 dn set 0 if first rept maxhd ;Generate Hard Disk DPH's followed header %dn,dpbhd1 ; by Floppy DPH's dn set dn+1 header %dn,dpbhd2 dn set dn+1 if (m26 ne 0) or (m20 ne 0) header %dn,dpbhd3 dn set dn+1 endif endm rept maxflop header %dn,0 dn set dn+1 endm else rept maxflop ;Generate Floppy DPH's followed by header %dn,0 ; Hard Disk DPH's dn set dn+1 endm rept maxhd header %dn,dpbhd1 dn set dn+1 header %dn,dpbhd2 dn set dn+1 if (m26 ne 0) or (m20 ne 0) header %dn,dpbhd3 dn set dn+1 endif endm endif endif if stdlog ne 0 if first dn set maxflop rept maxhd rept stdlog ;Generate Hard Disk DPH's followed header %dn,dpbhd,%(dn-maxflop) ;by Floppy DPH's dn set dn+1 endm endm dn set 0 ;Floppies always start at zero rept maxflop header %dn,0,0 dn setq 7 db 'Diablo HyType II parallel' endif db ' printer as LST:' else db '.' endif db acr, alf db 0 ;End of message ***************************************************************** * * * Utility routine to output the message pointed at by H&L, * * terminated with a null. * * * ***************************************************************** message mov a,m ;Get a character of the message inx h ;Bump text pointer ora a ;Test for end rz ;Return if done push h ;Save pointer to text mov c,a ;Output character in C call cout ;Output the character pop h ;Restore the pointer jmp message ;Continue until null reached ***************************************************************** * * * Cboot is the cold boot loader. All of CP/M has been loaded in * * when control is passed here. * * * ***************************************************************** cboot lxi sp,tpa ;Set up stack xra a ;Clear cold boot f6 ;1200 010 dw 48 ;2400 011 dw 24 ;4800 100 dw 12 ;9600 101 dw 6 ;19200 110 endif ***************************************************************** * * * Th followin i lis o vali bau rates Th curren * * bau rat i checke o col boot I i i no i th * * vta tabl the th bau rat wil b se fro th defco * wor foun belo th Cbio jum table I th use * * happen t hav weir bau rat tha i no i thi * * tabl o i lookin fo wa t sav spac the entrie * * ca b adde o delete fro th table. * * * ***************************************************************** vtab dw 2304 ;50 baud dw 1536 ;75 dw 1047 ;110 dw 857 ;134.5 dw 768 ;150 dw 384 ;300 dw 192 ;600 dw 96 ;1200 dw 64 ;1800 dw 58 ;2000 dw 48 ;2400 dw 32 ;3600 dw 24 ;4800 dw 16 ;7200 dw 12 ;9600 dw 6 ;19200 svtab equ ($-vtab)/2 ;Length of the vtab table ***************************************** dn+1 endm else ;Generate floppies before hard disk dn set 0 rept maxflop header %dn,0,0 dn set dn+1 endm dn set maxflop rept maxhd rept stdlog header %dn,dpbhd,%(dn-maxflop) dn set dn+1 endm endm endif endif buffer equ $ ***************************************************************** * * * Signon message output during cold boot. * * * ***************************************************************** prompt db 80h, clear ;Clean buffer and screen db acr,alf,acr,alf,acr,alf db 'Morrow Designs ' db '0'+msize/10 ;CP/M memory size db '0'+(msize mod 10) db 'K CP/M ' ;CP/M version number db cpmrev/10+'0' db '.' db (cpmrev mod 10)+'0' db ', Cbios rev ' db revnum/10+'0','.' ;Cbios revision number db revnum mod 10+'0' if maxhd ne 0 db '.' db mrev/10+'0' db mrev mod 10+'0' endif if m10 if fujitsu db 'F' else db 'M' endif endif db acr,alf db 'For ' if maxflop ne 0 db 'a Disk Jockey 2D/B' enlag sta cwflg sta group ;Clear group select byte if maxflop ne 0 ;If 2D/B is there then make RAM copy lxi h,djram ; of the jump table. lxi d,origin mvi b,33h ;Size of jump table call movlop ;Copy table endif mvi a,intioby sta iobyte if contyp ne 0 ;Do not call tinit for PROM's call tinit ;Initialize the terminal endif if lsttyp ne 0 ;Do not call linit for PROM's call linit ;Initialize the list device endif lxi h,prompt ;Prep for sending signon message call message ;Send the prompt xra a ;Select disk A sta cpmdrv sta cdisk if (maxflop ne 0) and first sta flopflg endif lxi h,bios+3 ;Patch cold boot to warm code shld bios+1 jmp gocpm if contyp eq 2 ;Multi I/O, Decision I ***************************************************************** * * * Terminal initilization routine. This routine reads the sense * * switch on the WB-14 and sets the speed accordingly. * * * ************************************************************************ * * * Vali check i th diviso latc i reasonabl value * * I th valu seem of the i wil ge th defaul bau * * rat fro defco an jum t setit. * * * ***************************************************************** valid mvi a,dlab+wls0+wls1+stb out lcr ;Access divisor latch in dll ;Get lower divisor value mov e,a in dlm ;Get upper divisor value mov d,a mvi a,wls1+wls0+stb out lcr lxi h,vtab ;Valid baud rate table mvi c,svtab ;Length of the baud rate table vloop mov a,e cmp m ;Check low byte jnz vskip ;First byte is bad inx h mov a,d cmp m ;Check high byte jz done ;Baud rate is OK... Do cleanup dcx h vskip inx h ;Skip to next entry inx h dcr c ;Bump entry counter jnz vloop nvalid lhld defcon ;Get default baud rate xchg setit mvi a,dlab+wls1+wls0+stb ;Enable divisor access latch out lcr ;Set the baud rate in (de) mov a,d out dlm ;Set upper divisor mov a,e out dll ;Se ;Strobe restore bit low out daisi0 mvi a,10 ;Wait about 50uS dloop dcr a jnz dloop mvi a,0ffh ;Raise restore back up out daisi0 endif xra a out daisi1 ;Clear data buffers if multr3 ;Lift ribbon lda group ori denable out grpsel ;Re-enable the drivers mvi a,0ffh-restore ;Pull -ribbon lift down out daisi0 else mvi a,pselect ;Re-enable drivers and lift ribbon out clk endif linit9 lxi h,hinc/cperi shld hmi ;Save hmi = 120/(characters per inch) lxi h,vinc/lperi shld vmi ;Save vmi = 48/(lines per inch) lxi h,0 ;Other variables default to zero shld vpos shld dlvpos shld hpos shld dlhpos shld lmar call clrall ;Clear the TAB array xra a sta kludge ;Reset TAB clear byte sta dirflg sta grhflg ret endif db 0,0ffh,0 ds 512-($-buffer) ;Maximum size buffer for 512 byte sectors if maxflop ne 0 ds 512 ;Additional space for floppies 1k sectors endif **************************************************************; Skeletal CBIOS for first level of CP/M 2.0 alteration ; msize equ 20 ;cp/m version memory size in kilobytes ; ; "bias" is address offset from 3400H for memory systems ; than 16K (referred to as "b" throughout the text). ; bias equ (msize-20)*1024 ccp equ 3400H+bias ;base of ccp bdos equ ccp+806h ;base of bdos bios equ ccp+1600h ;base of bios cdisk equ 0004H ;current disk number 0=A,...,15=P iobyte equ 0003h ;intel i/o byte ; org bios ;origin of this program nsects equ ($-ccp)/128 ;warm start sector count ; ; jump vector for individual subroutines jmp boot ;cold start wboote: jmp wboot ;warm start jmp const ;console status jmp conin ;console character in jmp conout ;console character out jmp list ;list character out jmp punch ;punch character out jmp reader ;reader character out jmp home ;move head to home position jmp seldsk ;select disk jmp settrk ;set track number jmp setsec ;set sector number jmp setdma ;set dma address jmp read ;read disk jmp t lower divisor mvi a,wls1+wls0+stb out lcr done xra a ;Clear status register out lsr ret endif ;Multi I/O, Decision I if contyp eq 3 ;2D/B console initialization tinit call djtstat ;Clean input buffer rnz ;All empty call djcin jmp tinit endif ;2D/B console if (lsttyp ge 2) and (lsttyp le 5) ;Serial Multi I/O list drivers linit lda group ;Get group byte ori lstgrp ;Select list device out grpsel mvi a,dlab ;Access divisor latch out lcr lhld deflst ;Get LST: baud rate divisor mov a,h out dlm ;Set upper baud rate mov a,l out dll mvi a,stb+wls0+wls1 out lcr in rbr ;Clear input buffer xra a out ier ;No interupts ret endif if lsttyp eq 6 ;Multi I/O parallel, Centronics linit lda group ;Get group byte ori denable ;Set driver enable bit sta group out grpsel ;Select group zero with drivers enabled xra a out daisi1 ;Zero out data mvi a,d9+d10 ;Set strobe high, init low out daisi0 mvi a,10 ;Wait about 50uS*** * * * Cbios ram locations that don't need initialization. * * * ***************************************************************** cpmsec dw 0 ;CP/M sector # cpmdrv db 0 ;CP/M drive # cpmtrk db 0 ;CP/M track # truesec dw 0 ;Disk Jockey sector that contains CP/M sector bufdrv db 0 ;Drive that buffer belongs to buftrk db 0 ;Track that buffer belongs to bufsec dw 0 ;Sector that buffer belongs to dirbuf ds 128 ;Directory buffer alloc macro nd,al,cs alv&nd ds al csv&nd ds cs endm dn set 0 if stdlog eq 0 if not first rept maxflop alloc %dn,75,64 dn set dn+1 endm rept maxhd if m26 ne 0 alloc %dn,247,0 dn set dn+1 alloc %dn,247,0 dn set dn+1 alloc %dn,247,0 dn set dn+1 endif if m10 ne 0 alloc %dn,159,0 dn set dn+1 alloc %dn,161,0 dn set dn+1 endif if m20 ne 0 alloc %dn,252,0 dn set dn+1 alloc %dn,252,0 dn set dn+1 alloc %dn,129,0 dn set dn+1 endif endm else rept maxhd if m26 ne 0 alloc %dn,247,0 dn sewrite ;write disk jmp listst ;return list status jmp sectran ;sector translate ; ; fixed data tables for four-drive standard ; IBM-compatible 8" disks ; disk parameter header for disk 00 dpbase: dw trans,0000H dw 0000H,0000H dw dirbf,dpblk dw chk00,all00 ; disk parameter header for disk 01 dw trans,0000H dw 0000H,0000H dw dirbf,dpblk dw chk01,all01 ; disk parameter header for disk 02 dw trans,0000H dw 0000H,0000H dw dirbf,dpblk dw chk02,all02 ; disk parameter header for disk 03 dw trans,0000H dw 0000H,0000H dw dirbf,dpblk dw chk03,all03 ; ; sector translate vector trans: db 1,7,13,19 ;sectors 1,2,3,4 db 25,5,11,17 ;sectors 5,6,7,8 db 23,3,9,15 ;sectors 9,10,11,12 db 21,2,8,14 ;sectors 13,14,15,16 db 20,26,6,12 ;sectors 17,18,19,20 db 18,24,4,10 ;sectors 21,22,23,24 db 16,22 ;sectors 25,26 ; dpblk: ;disk parameter block, common to all disks dw 26 ;sectors per track db 3 ;block shift factor db 7 ;block mask db 0 ;null mask dw 242 ;dis for printer to initilize dloop dcr a jnz dloop mvi a,d11+d9+d10 out daisi0 ret endif if lsttyp eq 7 ;Diablo HyType II ***************************************************************** * * * Initializ Diabl HyTyp printer I th printe fail * * t initializ the th outpu driver wil b turne of * * an an attempt t prin wil resul i redirectio t * * th console. * * * ***************************************************************** if multr3 ;Multi I/O initialization linit lda group ;Get group byte ori denable ;Add driver enable bit out grpsel ori restore ;Toggle restore high out grpsel mvi a,10 ;Hold line up for 50uS dloop dcr a jnz dloop lda group out grpsel ;Turn denable and restore off els ;Mother board initialization linit lda group ;Get group byte out grpsel ;Select group zero mvi a,pselect+rlift ;Set select line active, rlift not active out clk mvi a,0ffh out daisi0 mvi a,0ffh-restoret dn+1 alloc %dn,247,0 dn set dn+1 alloc %dn,247,0 dn set dn+1 endif if m10 ne 0 alloc %dn,159,0 dn set dn+1 alloc %dn,161,0 dn set dn+1 endif if m20 ne 0 alloc %dn,252,0 dn set dn+1 alloc %dn,252,0 dn set dn+1 alloc %dn,129,0 dn set dn+1 endif endm rept maxflop alloc %dn,75,64 dn set dn+1 endm endif endif if stdlog ne 0 if maxhd ne 0 ;Make up hard disk allocation vectors dn set maxflop ;Hard disks always start after floppies rept maxhd rept stdlog alloc %dn,((totbls/logdsk)/8)+1,0 dn set dn+1 endm endm endif if maxflop ne 0 ;Make up floppy allocation vectors dn set 0 rept maxflop ;Floppies first alloc %dn,75,64 dn set dn+1 endm endif endif end k size-1 dw 63 ;directory max db 192 ;alloc 0 db 0 ;alloc 1 dw 16 ;check size dw 2 ;track offset ; ; end of fixed tables ; ; individual subroutines to perform each function boot: ;simplest case is to just perform parameter initialization xra a ;zero in the accum sta iobyte ;clear the iobyte sta cdisk ;select disk zero jmp gocpm ;initialize and go to cp/m ; wboot: ;simplest case is to read the disk until all sectors loaded lxi sp,80h ;use space below buffer for stack mvi c,0 ;select disk 0 call seldsk call home ;go to track 00 ; mvi b,nsects ;b counts # of sectors to load mvi c,0 ;c has the current track number mvi d,2 ;d has the next sector to read ; note that we begin by reading track 0, sector 2 since sector 1 ; contains the cold start loader, which is skipped in a warm start lxi h,ccp ;base of cp/m (initial load point) load1: ;load one more sector push b ;save sector count, current track push d ;save next sector to read push h ;save dma addrcter output from register c mov a,c ;get to accumulator ds 10h ;space for output routine ret ; list: ;list character from register c mov a,c ;character to register a ret ;null subroutine ; listst: ;return list status (0 if not ready, 1 if ready) xra a ;0 is always ok to return ret ; punch: ;punch character from register c mov a,c ;character to register a ret ;null subroutine ; ; reader: ;read character into register a from reader device mvi a,1ah ;enter end of file for now (replace later) ani 7fh ;remember to strip parity bit ret ; ; ; i/o drivers for the disk follow ; for now, we will simply store the parameters away for use ; in the read and write subroutines ; home: ;move to the track 00 position of current drive ; translate this call into a settrk call with parameter 00 mvi c,0 ;select track 0 call settrk ret ;we will move to 00 on first read/write ; seldsk: ;select disk given by register C lxi h,0000h ;error return code mov a,c sta diskno cpi 4 bytes for expansion dmaad: ds 2 ;direct memory address diskno: ds 1 ;disk number 0-15 ; ; scratch ram area for BDOS use begdat equ $ ;beginning of data area dirbf: ds 128 ;scratch directory area all00: ds 31 ;allocation vector 0 all01: ds 31 ;allocation vector 1 all02: ds 31 ;allocation vector 2 all03: ds 31 ;allocation vector 3 chk00: ds 16 ;check vector 0 chk01: ds 16 ;check vector 1 chk02: ds 16 ;check vector 2 chk03: ds 16 ;check vector 3 ; enddat equ $ ;end of data area datsiz equ $-begdat;size of data area end maad' (0-65535) ds 256 ;space reserved for I/O drivers mvi a,1 ;error condition ret ;replaced when filled-in ; ; the remainder of the CBIOS is reserved uninitialized ; data area, and does not need to be a part of the ; system memory image (the space must be available, ; however, between "begdat" and "enddat"). ; track: ds 2 ;two bytes for expansion sector: ds 2 ;two ess mov c,d ;get sector address to register c call setsec ;set sector address from register c pop b ;recall dma address to b,c push b ;replace on stack for later recall call setdma ;set dma address from b,c ; ; drive set to 0, track set, sector set, dma address set call read cpi 00h ;any errors? jnz wboot ;retry the entire boot if an error occurs ; ; no error, move to next sector pop h ;recall dma address lxi d,128 ;dma=dma+128 dad d ;new dma address is in h,l pop d ;recall sector address pop b ;recall number of sectors remaining, and current trk dcr b ;sectors=sectors-1 jz gocpm ;transfer to cp/m if all have been loaded ; ; more sectors remain to load, check for track change inr d mov a,d ;sector=27?, if so, change tracks cpi 27 jc load1 ;carry generated if sector<27 ; ; end of current track, go to next track mvi d,1 ;begin with first sector of next track inr c ;track=track+1 ; ; save register state, and change tracks push b push d push h call settr;must be between 0 and 3 rnc ;no carry if 4,5,... ; disk number is in the proper range ds 10 ;space for disk select ; compute proper disk parameter header address lda diskno mov l,a ;L=disk number 0,1,2,3 mvi h,0 ;high order zero dad h ;*2 dad h ;*4 dad h ;*8 dad h ;*16 (size of each header) lxi d,dpbase dad d ;HL=.dpbase(diskno*16) ret ; settrk: ;set track given by register c mov a,c sta track ds 10h ;space for track select ret ; setsec: ;set sector given by register c mov a,c sta sector ds 10h ;space for sector select ret ; sectran: ;translate the sector given by BC using the ;translate table given by DE xchg ;HL=.trans dad b ;HL=.trans(sector) mov l,m ;L = trans(sector) mvi h,0 ;HL= trans(sector) ret ;with value in HL ; setdma: ;set dma address given by registers b and c mov l,c ;low order address mov h,b ;high order address shld dmaad ;save the address ds 10h ;space for setting the dma address ret ; read: ;perform read operatiok ;track address set from register c pop h pop d pop b jmp load1 ;for another sector ; ; end of load operation, set parameters and go to cp/m gocpm: mvi a,0c3h ;c3 is a jmp instruction sta 0 ;for jmp to wboot lxi h,wboote ;wboot entry point shld 1 ;set address field for jmp at 0 ; sta 5 ;for jmp to bdos lxi h,bdos ;bdos entry point shld 6 ;address field of jump at 5 to bdos ; lxi b,80h ;default dma address is 80h call setdma ; ei ;enable the interrupt system lda cdisk ;get current disk number mov c,a ;send to the ccp jmp ccp ;go to cp/m for further processing ; ; ; simple i/o handlers (must be filled in by user) ; in each case, the entry point is provided, with space reserved ; to insert your own code ; const: ;console status, return 0ffh if character ready, 00h if not ds 10h ;space for status subroutine mvi a,00h ret ; conin: ;console character into register a ds 10h ;space for input routine ani 7fh ;strip parity bit ret ; conout: ;console charan (usually this is similar to write ; so we will allow space to set up read command, then use ; common code in write) ds 10h ;set up read command jmp waitio ;to perform the actual i/o ; write: ;perform a write operation ds 10h ;set up write command ; waitio: ;enter here from read and write to perform the actual i/o ; operation. return a 00h in register a if the operation completes ; properly, and 01h if an error occurs during the read or write ; ; in this case, we have saved the disk number in 'diskno' (0,1) ; the track number in 'track' (0-76) ; the sector number in 'sector' (1-26) ; the dma address in 'dmaad' (0-65535) ds 256 ;space reserved for I/O drivers mvi a,1 ;error condition ret ;replaced when filled-in ; ; the remainder of the CBIOS is reserved uninitialized ; data area, and does not need to be a part of the ; system memory image (the space must be available, ; however, between "begdat" and "enddat"). ; track: ds 2 ;two bytes for expansion sector: ds 2 ;two =COPYRIGHT (C) 1978, DIGITAL RESEARCH DDT VERS 2.0$10 !~=W!xe ~#Xbxʇ {z~#o}o҃i.*|g> >کÝ!p+q*DM͡:͆ ͆:_2:`!!:*& N͆!4!6ÃO$+q+p+qy͏ , $  ͌ 9!z6 # L!zw͌j# X:z 0 ͘=N#Fy}80*z{¯#z+++ ¥ z#½# · 9!`͠ y9!rͷ y=!z{w# % w!P͠ y͓}*w#"͌ @.@<!Eͷ~P !ͷ’P͌Q!ͷªP}QxQ!ͷ͓G@Q! ͷ y͓Gþ!ͷ ͓Q!ͷ͓Q͌Q!.ͷ6y#G͙Qà!2ͷQ͓͌Q!>ͷq eg͙Q:zJEËC–EQyQxQRQ** {zҷ*~#" <AOGƐ'@'OxƐ'@'ON#  ¥   Ϳ Ͱ ͊ =¥ ` xS |¥ }ҥ gA>M Ag}M M c |¥ }!w s#r:[ʎ _!~ʠ ![4á \͢  2[y 7 >?  _͢!a"]> _͢a_!`~> 5*]~#"] 0 7   > >  ͢| } : >. *Y}o| , 0 å ^#V#!S ))))o J k s#r#!P4 !P6# ,¨ >2Pë g  g  g  ¥ Pʥ ! XN!~  ! _^! ^#V~ x% >= 7 !~ ( !   #x ` F Ϳ F Ϳ ͍ Ҁ *" !6é +"Y*~ #? ک Ϳ ʥ ^#V( é ~ CZMEIABDHSP!"G"+"!91*~!I~6 =G#^#V#~x "#"!N#FW" *D>7Å*G|H+"G H:FBÅ> Å >* *͍ \" ( *"W !)~##{nZ*F#h!Cs!^#V   ##::^#V#þ*^#V>%#x'8_#*;***************************************************** ;* * ;* Sector Deblocking Algorithms for CP/M 2.0 * ;* * ;***************************************************** ; ; utility macro to compute sector mask smask macro hblk ;; compute log2(hblk), return @x as result ;; (2 ** @x = hblk on return) @y set hblk @x set 0 ;; count right shifts of @y until = 1 rept 8 if @y = 1 exitm endif ;; @y is not 1, shift right one position @y set @y shr 1 @x set @x + 1 endm endm ; ;***************************************************** ;* * ;* CP/M to host disk constants * ;* * ;***************************************************** blksiz equ 2048 ;CP/M allocation size hstsiz equ 512 ;host disk sector size hstspt equ 20 ;host disk sectors/trk hstblk equ hstsiz/1z8O!B N#N ¾SP.* |} !9":q!"28!"9:] !ç 1;#ø##>%><7"T6*}^!T42 G Ͱ *hMͽG:ͮ+GGW +GU!ͩ>̀+! @!!BH @@ABH B! "BHI$$BI$BI $ HI D$HD$$ H B!$D$"$B$DA!ABI$H B$I $HI$H$! $I $I$$A !A@$I$"!$H$I$I "! $A$  HHAA"I @$BH! $!D$H$ I$$DH@H"B$HDDH@$""A $@ D$BB H A$$BAB"DH I$I "D H@ @@" @D"II!$I A"UUUI$$ D$$"#"!N#FW" *D>7Å*G|H+"G H:FBÅ> Å >* *͍ \" ( *"W !)~##{nZ*F#h!Cs!^#V   ##::^#V#þ*^#V>%#x'8_#*28 ;CP/M sects/host buff cpmspt equ hstblk * hstspt ;CP/M sectors/track secmsk equ hstblk-1 ;sector mask smask hstblk ;compute sector mask secshf equ @x ;log2(hstblk) ; ;***************************************************** ;* * ;* BDOS constants on entry to write * ;* * ;***************************************************** wrall equ 0 ;write to allocated wrdir equ 1 ;write to directory wrual equ 2 ;write to unallocated ; ;***************************************************** ;* * ;* The BDOS entry points given below show the * ;* code which is relevant to deblocking only. * ;* * ;***************************************************** ; ; DISKDEF macro, or hand coded tables go here dpbase equ $ ;disk param block base ; boot: wboot: ;enter here on system͍ !" >- Ͱ Aڥ ҥ _!7^#V~  \p Z t ů2[\͍͢ ҥ ͊ =¥ ` " ͍ ҥ ͊ ʻ` " =ʻ` "=¥ ý> 2͊ ` "W=` =¥ *W}o"Y  *W"[( Ϳ ~ #? }"W*[Ϳ 0 *W}#|#*W? ͊ ¥ ` ` ` {zA|¥ W}d ͊ ` ` ` DMʡڏ"=ʡͲ=ʡYPͲ1**!I~4#~#F#x~#s#r#w>͊ ¥ ` `  ( Ϳ ᯕo>g( 2|2\  !]w# ʥ .&  0 6 #& .K !e K w# ʥ : U 6 #K 6AW w#] !e~H#~E#~X*}|{ "!{ ͊ !ʦ =¥ ` kʥ j \͢@ w# ͅ ú n ʥ : W _ O { `i"@ w# ͅ ¥ n S n S GтWx ͢!i ~T #H  *( Ϳ *(  NEXT PC͊ =¥ `  ( Ϳ ~ Ϳ Ͱ ʵ .͍ =¥ ` |¥ }w#~ ÿ >2F͊ ! =¥ ` }ʥ +"G> Å >  !  #  boot to initialize xra a ;0 to accumulator sta hstact ;host buffer inactive sta unacnt ;clear unalloc count ret ; seldsk: ;select disk mov a,c ;selected disk number sta sekdsk ;seek disk number mov l,a ;disk number to HL mvi h,0 rept 4 ;multiply by 16 dad h endm lxi d,dpbase ;base of parm block dad d ;hl=.dpb(curdsk) ret ; settrk: ;set track given by registers BC mov h,b mov l,c shld sektrk ;track to seek ret ; setsec: ;set sector given by register c mov a,c sta seksec ;sector to seek ret ; setdma: ;set dma address given by BC mov h,b mov l,c shld dmaadr ret ; sectran: ;translate sector number BC mov h,b mov l,c ret ; ;***************************************************** ;* * ;* The READ entry point takes the place of * ;* the previous BIOS defintion for READ. * ;* * ;*************************************to accum sta unacnt ;unacnt = 0 inr a ;1 to accum sta rsflag ;rsflag = 1 ; ;***************************************************** ;* * ;* Common code for READ and WRITE follows * ;* * ;***************************************************** rwoper: ;enter here to perform the read/write xra a ;zero to accum sta erflag ;no errors (yet) lda seksec ;compute host sector rept secshf ora a ;carry = 0 rar ;shift right endm sta sekhst ;host sector to seek ; ; active host sector? lxi h,hstact ;host active flag mov a,m mvi m,1 ;always becomes 1 ora a ;was it already? jz filhst ;fill host if not ; ; host buffer active, same as seek buffer? lda sekdsk lxi h,hstdsk ;same disk? cmp m ;sekdsk = hstdsk? jnz nomatch ; ; same disk, same track? lxi h,hsttrk call sektrkcmp ;sektrk = hsttrk? jnz nomatch ; ; same disk, same track, same buffer? lda sekh * ;* WRITEHST performs the physical write to * ;* the host disk, READHST reads the physical * ;* disk. * ;* * ;***************************************************** writehst: ;hstdsk = host disk #, hsttrk = host track #, ;hstsec = host sect #. write "hstsiz" bytes ;from hstbuf and return error flag in erflag. ;return erflag non-zero if error ret ; readhst: ;hstdsk = host disk #, hsttrk = host track #, ;hstsec = host sect #. read "hstsiz" bytes ;into hstbuf and return error flag in erflag. ret ; ;***************************************************** ;* * ;* Unitialized RAM data areas * ;* * ;***************************************************** ; sekdsk: ds 1 ;seek disk number sektrk: ds 2 ;seek track number seksec: ds 1 ;seek sector number ; hstdsk: ds 1 ;h**************** read: ;read the selected CP/M sector xra a ;accum = 0 sta unacnt ;unacnt = 0 mvi a,1 sta readop ;read operation sta rsflag ;must read data mvi a,wrual sta wrtype ;treat as unalloc jmp rwoper ;to perform the read ; ;***************************************************** ;* * ;* The WRITE entry point takes the place of * ;* the previous BIOS defintion for WRITE. * ;* * ;***************************************************** write: ;write the selected CP/M sector xra a ;0 to accumulator sta readop ;not a read operation mov a,c ;write type in c sta wrtype cpi wrual ;write unallocated? jnz chkuna ;check for unalloc ; ; write to unallocated, set parameters mvi a,blksiz/128 ;next unalloc recs sta unacnt lda sekdsk ;disk to seek sta unadsk ;unadsk = sekdsk lhld sektrk shld unatrk ;unatrk = sectrk lda seksec sta unasec st lxi h,hstsec ;sekhst = hstsec? cmp m jz match ;skip if match ; nomatch: ;proper disk, but not correct sector lda hstwrt ;host written? ora a cnz writehst ;clear host buff ; filhst: ;may have to fill the host buffer lda sekdsk sta hstdsk lhld sektrk shld hsttrk lda sekhst sta hstsec lda rsflag ;need to read? ora a cnz readhst ;yes, if 1 xra a ;0 to accum sta hstwrt ;no pending write ; match: ;copy data to or from buffer lda seksec ;mask buffer number ani secmsk ;least signif bits mov l,a ;ready to shift mvi h,0 ;double count rept 7 ;shift left 7 dad h endm ; hl has relative host buffer address lxi d,hstbuf dad d ;hl = host address xchg ;now in DE lhld dmaadr ;get/put CP/M data mvi c,128 ;length of move lda readop ;which way? ora a jnz rwmove ;skip if read ; ; write operation, mark and switch direction mvi a,1 sta hstwrt ;hstwrt = 1 xchg ;source/dest swap ; rwmove: ;C initially 128, DE is source, HL ost disk number hsttrk: ds 2 ;host track number hstsec: ds 1 ;host sector number ; sekhst: ds 1 ;seek shr secshf hstact: ds 1 ;host active flag hstwrt: ds 1 ;host written flag ; unacnt: ds 1 ;unalloc rec cnt unadsk: ds 1 ;last unalloc disk unatrk: ds 2 ;last unalloc track unasec: ds 1 ;last unalloc sector ; erflag: ds 1 ;error reporting rsflag: ds 1 ;read sector flag readop: ds 1 ;1 if read operation wrtype: ds 1 ;write operation type dmaadr: ds 2 ;last dma address hstbuf: ds hstsiz ;host buffer ; ;***************************************************** ;* * ;* The ENDEF macro invocation goes here * ;* * ;***************************************************** end  ;unasec = seksec ; chkuna: ;check for write to unallocated sector lda unacnt ;any unalloc remain? ora a jz alloc ;skip if not ; ; more unallocated records remain dcr a ;unacnt = unacnt-1 sta unacnt lda sekdsk ;same disk? lxi h,unadsk cmp m ;sekdsk = unadsk? jnz alloc ;skip if not ; ; disks are the same lxi h,unatrk call sektrkcmp ;sektrk = unatrk? jnz alloc ;skip if not ; ; tracks are the same lda seksec ;same sector? lxi h,unasec cmp m ;seksec = unasec? jnz alloc ;skip if not ; ; match, move to next sector for future ref inr m ;unasec = unasec+1 mov a,m ;end of track? cpi cpmspt ;count CP/M sectors jc noovf ;skip if no overflow ; ; overflow to next track mvi m,0 ;unasec = 0 lhld unatrk inx h shld unatrk ;unatrk = unatrk+1 ; noovf: ;match found, mark as unnecessary read xra a ;0 to accumulator sta rsflag ;rsflag = 0 jmp rwoper ;to perform the write ; alloc: ;not an unallocated record, requires pre-read xra a ;0 is dest ldax d ;source character inx d mov m,a ;to dest inx h dcr c ;loop 128 times jnz rwmove ; ; data has been moved to/from host buffer lda wrtype ;write type cpi wrdir ;to directory? lda erflag ;in case of errors rnz ;no further processing ; ; clear host buffer for directory write ora a ;errors? rnz ;skip if so xra a ;0 to accum sta hstwrt ;buffer written call writehst lda erflag ret ; ;***************************************************** ;* * ;* Utility subroutine for 16-bit compare * ;* * ;***************************************************** sektrkcmp: ;HL = .unatrk or .hsttrk, compare with sektrk xchg lxi h,sektrk ldax d ;low byte compare cmp m ;same? rnz ;return if not ; low bytes equal, test high 1s inx d inx h ldax d cmp m ;sets flags ret ; ;***************************************************** ;* ; CP/M 2.0 disk re-definition library ; ; Copyright (c) 1979 ; Digital Research ; Box 579 ; Pacific Grove, CA ; 93950 ; ; CP/M logical disk drives are defined using the ; macros given below, where the sequence of calls ; is: ; ; disks n ; diskdef parameter-list-0 ; diskdef parameter-list-1 ; ... ; diskdef parameter-list-n ; endef ; ; where n is the number of logical disk drives attached ; to the CP/M system, and parameter-list-i defines the ; characteristics of the ith drive (i=0,1,...,n-1) ; ; each parameter-list-i takes the form ; dn,fsc,lsc,[skf],bls,dks,dir,cks,ofs,[0] ; where ; dn is the disk number 0,1,...,n-1 ; fsc is the first sector number (usually 0 or 1) ; lsc is the last sector number on a track ; skf is optional "skew factor" for sector translate ; bls is the data block size (1024,2048,...,16384) ; dks is the disk size in bls increments (word) ; dir is the number of directory elements (word) ; cks is the number of dir elements to checksum ; ofs is the number of u als&fsc ;same allocation vector size css&dn equ css&fsc ;same checksum vector size xlt&dn equ xlt&fsc ;same translate table else secmax set lsc-(fsc) ;;sectors 0...secmax sectors set secmax+1;;number of sectors als&dn set (dks)/8 ;;size of allocation vector if ((dks) mod 8) ne 0 als&dn set als&dn+1 endif css&dn set (cks)/4 ;;number of checksum elements ;; generate the block shift value blkval set bls/128 ;;number of sectors/block blkshf set 0 ;;counts right 0's in blkval blkmsk set 0 ;;fills with 1's from right rept 16 ;;once for each bit position if blkval=1 exitm endif ;; otherwise, high order 1 not found yet blkshf set blkshf+1 blkmsk set (blkmsk shl 1) or 1 blkval set blkval/2 endm ;; generate the extent mask byte blkval set bls/1024 ;;number of kilobytes/block extmsk set 0 ;;fill from right with 1's rept 16 if blkval=1 exitm endif ;; otherwise more to shift extmsk set (extmsk shl 1) or 1 blkval set blkval/2 endm ;; may be double byte allocation if (dks)nddat equ $ datsiz equ $-begdat ;; db 0 at this point forces hex record endm ; = gcd(sectors,skew) neltst set sectors/gcdn ;; neltst is number of elements to generate ;; before we overlap previous elements nelts set neltst ;;counter xlt&dn equ $ ;translate table rept sectors ;;once for each sector if sectors < 256 ddb %nxtsec+(fsc) else ddw %nxtsec+(fsc) endif nxtsec set nxtsec+(skf) if nxtsec >= sectors nxtsec set nxtsec-sectors endif nelts set nelts-1 if nelts = 0 nxtbas set nxtbas+1 nxtsec set nxtbas nelts set neltst endif endm endif ;;end of nul fac test endif ;;end of nul bls test endm ; defds macro lab,space lab: ds space endm ; lds macro lb,dn,val defds lb&dn,%val&dn endm ; endef macro ;; generate the necessary ram data areas begdat equ $ dirbuf: ds 128 ;directory access buffer dsknxt set 0 rept ndisks ;;once for each disk lds alv,%dsknxt,als lds csv,%dsknxt,css dsknxt set dsknxt+1 endm etracks to skip (word) ; [0] is an optional 0 which forces 16K/directory entry ; ; for convenience, the form ; dn,dm ; defines disk dn as having the same characteristics as ; a previously defined disk dm. ; ; a standard four drive CP/M system is defined by ; disks 4 ; diskdef 0,1,26,6,1024,243,64,64,2 ; dsk set 0 ; rept 3 ; dsk set dsk+1 ; diskdef %dsk,0 ; endm ; endef ; ; the value of "begdat" at the end of assembly defines the ; beginning of the uninitialize ram area above the bios, ; while the value of "enddat" defines the next location ; following the end of the data area. the size of this ; area is given by the value of "datsiz" at the end of the ; assembly. note that the allocation vector will be quite ; large if a large disk size is defined with a small block ; size. ; dskhdr macro dn ;; define a single disk header list dpe&dn: dw xlt&dn,0000h ;translate table dw 0000h,0000h ;scratch area dw dirbuf,dpb&dn ;dir buff,parm block dw csv&dn,alv&dn ;check, alloc vec > 256 extmsk set (extmsk shr 1) endif ;; may be optional [0] in last position if not nul k16 extmsk set k16 endif ;; now generate directory reservation bit vector dirrem set dir ;;# remaining to process dirbks set bls/32 ;;number of entries per block dirblk set 0 ;;fill with 1's on each loop rept 16 if dirrem=0 exitm endif ;; not complete, iterate once again ;; shift right and add 1 high order bit dirblk set (dirblk shr 1) or 8000h if dirrem > dirbks dirrem set dirrem-dirbks else dirrem set 0 endif endm dpbhdr dn ;;generate equ $ ddw %sectors,<;sec per track> ddb %blkshf,<;block shift> ddb %blkmsk,<;block mask> ddb %extmsk,<;extnt mask> ddw %(dks)-1,<;disk size-1> ddw %(dir)-1,<;directory max> ddb %dirblk shr 8,<;alloc0> ddb %dirblk and 0ffh,<;alloc1> ddw %(cks)/4,<;check size> ddw %ofs,<;offset> ;; generate the translate table, if requested if nul skf xlt&dn equ 0 ;no xlate table else if skf = 0 xlt&dn equ 0 ;no xlate table else ;; generators endm ; disks macro nd ;; define nd disks ndisks set nd ;;for later reference dpbase equ $ ;base of disk parameter blocks ;; generate the nd elements dsknxt set 0 rept nd dskhdr %dsknxt dsknxt set dsknxt+1 endm endm ; dpbhdr macro dn dpb&dn equ $ ;disk parm block endm ; ddb macro data,comment ;; define a db statement db data comment endm ; ddw macro data,comment ;; define a dw statement dw data comment endm ; gcd macro m,n ;; greatest common divisor of m,n ;; produces value gcdn as result ;; (used in sector translate table generation) gcdm set m ;;variable for m gcdn set n ;;variable for n gcdr set 0 ;;variable for r rept 65535 gcdx set gcdm/gcdn gcdr set gcdm - gcdx*gcdn if gcdr = 0 exitm endif gcdm set gcdn gcdn set gcdr endm endm ; diskdef macro dn,fsc,lsc,skf,bls,dks,dir,cks,ofs,k16 ;; generate the set statements for later tables if nul lsc ;; current disk dn same as previous fsc dpb&dn equ dpb&fsc ;equivalent parameters als&dn eqte the translate table nxtsec set 0 ;;next sector to fill nxtbas set 0 ;;moves by one on overflow gcd %sectors,skf ;; gcdn = gcd(sectors,skew) neltst set sectors/gcdn ;; neltst is number of elements to generate ;; before we overlap previous elements nelts set neltst ;;counter xlt&dn equ $ ;translate table rept sectors ;;once for each sector if sectors < 256 ddb %nxtsec+(fsc) else ddw %nxtsec+(fsc) endif nxtsec set nxtsec+(skf) if nxtsec >= sectors nxtsec set nxtsec-sectors endif nelts set nelts-1 if nelts = 0 nxtbas set nxtbas+1 nxtsec set nxtbas nelts set neltst endif endm endif ;;end of nul fac test endif ;;end of nul bls test endm ; defds macro lab,space lab: ds space endm ; lds macro lb,dn,val defds lb&dn,%val&dn endm ; endef macro ;; generate the necessary ram data areas begdat equ $ dirbuf: ds 128 ;directory access buffer dsknxt set 0 rept ndisks ;;once for each disk lds alv,%dsknxt,als lds csv,%dsknxt,css dsknxt set dsknxt+1 endm e; FILE DUMP PROGRAM, READS AN INPUT FILE AND PRINTS IN HEX ; ; COPYRIGHT (C) 1975, 1976, 1977, 1978 ; DIGITAL RESEARCH ; BOX 579, PACIFIC GROVE ; CALIFORNIA, 93950 ; ORG 100H BDOS EQU 0005H ;DOS ENTRY POINT CONS EQU 1 ;READ CONSOLE TYPEF EQU 2 ;TYPE FUNCTION PRINTF EQU 9 ;BUFFER PRINT ENTRY BRKF EQU 11 ;BREAK KEY FUNCTION (TRUE IF CHAR READY) OPENF EQU 15 ;FILE OPEN READF EQU 20 ;READ FUNCTION ; FCB EQU 5CH ;FILE CONTROL BLOCK ADDRESS BUFF EQU 80H ;INPUT DISK BUFFER ADDRESS ; ; NON GRAPHIC CHARACTERS CR EQU 0DH ;CARRIAGE RETURN LF EQU 0AH ;LINE FEED ; ; FILE CONTROL BLOCK DEFINITIONS FCBDN EQU FCB+0 ;DISK NAME FCBFN EQU FCB+1 ;FILE NAME FCBFT EQU FCB+9 ;DISK FILE TYPE (3 CHARACTERS) FCBRL EQU FCB+12 ;FILE'S CURRENT REEL NUMBER FCBRC EQU FCB+15 ;FILE'S RECORD COUNT (0 TO 128) FCBCR EQU FCB+32 ;CURRENT (NEXT) RECORD NUMBER (0 TO 127) FCBLN EQU FCB+33 ;FCB LENGTH ; ; SET UP STACK LXI H,0 DAD SP ; ENTRY STACK POINTER IN HL FROM THE CCP SHLD OLDSP ; SET SP TO LOCAL STACK AR ; READ ANOTHER BUFFER ; ; CALL DISKR ORA A ;ZERO VALUE IF READ OK JZ G0 ;FOR ANOTHER BYTE ; END OF DATA, RETURN WITH CARRY SET FOR EOF STC RET ; G0: ;READ THE BYTE AT BUFF+REG A MOV E,A ;LS BYTE OF BUFFER INDEX MVI D,0 ;DOUBLE PRECISION INDEX TO DE INR A ;INDEX=INDEX+1 STA IBP ;BACK TO MEMORY ; POINTER IS INCREMENTED ; SAVE THE CURRENT FILE ADDRESS LXI H,BUFF DAD D ; ABSOLUTE CHARACTER ADDRESS IS IN HL MOV A,M ; BYTE IS IN THE ACCUMULATOR ORA A ;RESET CARRY BIT RET ; SETUP: ;SET UP FILE ; OPEN THE FILE FOR INPUT XRA A ;ZERO TO ACCUM STA FCBCR ;CLEAR CURRENT RECORD ; LXI D,FCB MVI C,OPENF CALL BDOS ; 255 IN ACCUM IF OPEN ERROR RET ; DISKR: ;READ DISK FILE RECORD PUSH H! PUSH D! PUSH B LXI D,FCB MVI C,READF CALL BDOS POP B! POP D! POP H RET ; ; FIXED MESSAGE AREA SIGNON: DB 'FILE DUMP VERSION 1.4$' OPNMSG: DB CR,LF,'NO INPUT FILE PRESENT ON DISK$' ; VARIABLE AREA IBP: DS 2 ;INPUT BUFFER POINTER OLDSP: DS 2 ;ENTRY SP VALUE FROM CCP ;!9"1W͜Q>2!͢QG}DrYQ|͏}͏#> ex͏#r* _> e> e ҉0Ë7e}} :³ʳ7_<2!~ɯ2|\\FILE DUMP VERSION 1.4$ NO INPUT FILE PRESENT ON DISK$!Y , <    *$A!6 # T!w $r# *`: 0 *A*! ~ ʰxkb))))_y‘BK{ͅ*!66!"80*{#z+++ #DDT COM&TUVDEBLOCK ASMOWXYZ[DISKDEF LIB1\]^_DUMP ASM!`abDUMP $$$EA (RESTORED AT FINIS) LXI SP,STKTOP ; READ AND PRINT SUCCESSIVE BUFFERS CALL SETUP ;SET UP INPUT FILE CPI 255 ;255 IF FILE NOT PRESENT JNZ OPENOK ;SKIP IF OPEN IS OK ; ; FILE NOT THERE, GIVE ERROR MESSAGE AND RETURN LXI D,OPNMSG CALL ERR JMP FINIS ;TO RETURN ; OPENOK: ;OPEN OPERATION OK, SET BUFFER INDEX TO END MVI A,80H STA IBP ;SET BUFFER POINTER TO 80H ; HL CONTAINS NEXT ADDRESS TO PRINT LXI H,0 ;START WITH 0000 ; GLOOP: PUSH H ;SAVE LINE POSITION CALL GNB POP H ;RECALL LINE POSITION JC FINIS ;CARRY SET BY GNB IF END FILE MOV B,A ; PRINT HEX VALUES ; CHECK FOR LINE FOLD MOV A,L ANI 0FH ;CHECK LOW 4 BITS JNZ NONUM ; PRINT LINE NUMBER CALL CRLF ; ; CHECK FOR BREAK KEY CALL BREAK ; ACCUM LSB = 1 IF CHARACTER READY RRC ;INTO CARRY JC FINIS ;DON'T PRINT ANY MORE ; MOV A,H CALL PHEX MOV A,L CALL PHEX NONUM: INX H ;TO NEXT LINE NUMBER MVI A,' ' CALL PCHAR MOV A,B CALL PHEX JMP GLOOP ; FINIS: ; END OF DUMP, RETURN TO CCP ; (NOTE  ; STACK AREA DS 64 ;RESERVE 32 LEVEL STACK STKTOP: ; END ARRY SET FOR EOF STC RET ; G0: ;READ THE BYTE AT BUFF+REG A MOV E,A ;LS BYTE OF BUFFER INDEX MVI D,0 ;DOUBLE PRECISION INDEX TO DE INR A ;INDEX=INDEX+1 STA IBP ;BACK TO MEMORY ; POINTER IS INCREMENTED ; SAVE THE CURRENT FILE ADDRESS LXI H,BUFF DAD D ; ABSOLUTE CHARACTER ADDRESS IS IN HL MOV A,M ; BYTE IS IN THE ACCUMULATOR ORA A ;RESET CARRY BIT RET ; SETUP: ;SET UP FILE ; OPEN THE FILE FOR INPUT XRA A ;ZERO TO ACCUM STA FCBCR ;CLEAR CURRENT RECORD ; LXI D,FCB MVI C,OPENF CALL BDOS ; 255 IN ACCUM IF OPEN ERROR RET ; DISKR: ;READ DISK FILE RECORD PUSH H! PUSH D! PUSH B LXI D,FCB MVI C,READF CALL BDOS POP B! POP D! POP H RET ; ; FIXED MESSAGE AREA SIGNON: DB 'FILE DUMP VERSION 1.4$' OPNMSG: DB CR,LF,'NO INPUT FILE PRESENT ON DISK$' ; VARIABLE AREA IBP: DS 2 ;INPUT BUFFER POINTER OLDSP: DS 2 ;ENTRY SP VALUE FROM CCP ;THAT A JMP TO 0000H REBOOTS) CALL CRLF LHLD OLDSP SPHL ; STACK POINTER CONTAINS CCP'S STACK LOCATION RET ;TO THE CCP ; ; ; SUBROUTINES ; BREAK: ;CHECK BREAK KEY (ACTUALLY ANY KEY WILL DO) PUSH H! PUSH D! PUSH B; ENVIRONMENT SAVED MVI C,BRKF CALL BDOS POP B! POP D! POP H; ENVIRONMENT RESTORED RET ; PCHAR: ;PRINT A CHARACTER PUSH H! PUSH D! PUSH B; SAVED MVI C,TYPEF MOV E,A CALL BDOS POP B! POP D! POP H; RESTORED RET ; CRLF: MVI A,CR CALL PCHAR MVI A,LF CALL PCHAR RET ; ; PNIB: ;PRINT NIBBLE IN REG A ANI 0FH ;LOW 4 BITS CPI 10 JNC P10 ; LESS THAN OR EQUAL TO 9 ADI '0' JMP PRN ; ; GREATER OR EQUAL TO 10 P10: ADI 'A' - 10 PRN: CALL PCHAR RET ; PHEX: ;PRINT HEX CHAR IN REG A PUSH PSW RRC RRC RRC RRC CALL PNIB ;PRINT NIBBLE POP PSW CALL PNIB RET ; ERR: ;PRINT ERROR MESSAGE ; D,E ADDRESSES MESSAGE ENDING WITH "$" MVI C,PRINTF ;PRINT BUFFER FUNCTION CALL BDOS RET ; ; GNB: ;GET NEXT BYTE LDA IBP CPI 80H JNZ G0  COPYRIGHT (C) 1979, DIGITAL RESEARCH DISK OR DIRECTORY FULL$FILE EXISTS, ERASE IT$NEW FILE$** FILE IS READ/ONLY **$"SYSTEM" FILE NOT ACCESSIBLE$BAK$$$BAK$$$-(Y/N)?$NO MEMORY$BREAK "$" AT $1mM"m +!8s~1m!f6 *M  *!M 1m! 6!6! 6: 2Ebͽ!e:d\::eH2 H҆ͽ:e2!:d2e:!2dû :!I¬!: :H2 ҮX:h2iҐ:!ʍ:!:!H:!H,!"! 6#~ F)ͷX:! X):i!h)9 e:!:h2jO>F L>!":i!jHҼ*"+M ~ ʼͲ!f6!h6!"! 6F!f6:h2k!iҠ:i2k:j2h:k!hҶ9 æ:h2j!!6:j2he:! >"Ͳ*"M ~2!O :! *+":7 e !p+q*DM  =? ) !p+q.*DMF -L *9"`!"b!h6!j6!|6.!=\ -x !e:dʥ *eM \R :xʥ @ *dM \, :x \͕ :x - V :e _ :f w : =e !e:d*eM =e : =e =͕ !]6:x>- !"!76!6!6!66*dM  *dM !6:8!*`*;DM \u 2xʻ>!xҨ- *`*;6:82*`"`:<2w!"`9`h*`*;~2*`#"`:*eM !b+!s{!f!6:!b*b*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ma2D*!M͒2!:D/!+w!6e2!͢!Eq!E:!:H:H!FqN#F!~#fo![* ^* ^#" ^~(<[* ^~-@!w#w* ^#" ^* ^~0R!60X!6 !w#w* ^~0* ^>9!* ^~OG!~#foMD)) )  }|* ^#" ^`!w#w* ^~. !>w#w* ^#" ^* ^~0* ^>9!* ^~OG!~#foMD)) )  }|* ^#" ^!w#w>2^2^* ^~OG!wZ2^2^! * c##N#F+++N#F![" ^* ^Q=i`" ^!^~#¯* c####" c÷! * cN#F![" ^* ^|i`" ^\* c##" c!~#!: ^:^#!!!N#F!~#fo![!~w#~w! ^>#** ^* ^!N#F!~#fo![!~#!: ^:^#!!!N#F!~#fo![!~w#~w4%5u %5u %5u track head sector : can't write writeenter a file name, otherwise press If you'd like a copy of that in a file, %5u %5u %5u track head sector No bad sectors [!9*]~OGyLxZ!$͖"[!͖!:]w:]#w!~#fo~OGy„x!~#fo##~OG!~#fo#~OG!~#fo~OG!/!~w#~wo!͖!͖![*:["[!!![̈́%D) *]  4!~w#~w4!~w#~wæ!~#fo6"[Badmap written Error writing badmap [!9!:]w:]#w!w#w!!]  #*]!~#fo *]!N#F!^ y!QD !A͖"[!~ƀw#~w!~w#~wÄ[!~w#~w2^2^:]2^:]2^!^2b2b:]2b:]2b!bY!#~2b2b~2b+~2b!b!^Y~2 ^#~2!^#~2"^#~2#^! ^!N#F*]V2b2by2bx2b!b W! ^!#~2b2b~2b+~2b!b W! ^*]! V2b2by2bx2b!bY! ^bmW"[Select error trying to access that drive! CP/M logical drive (a, b, etc.) [!9!͖!*!~2$^:$^A!$^>Z:$^OG!a MD! MDÊ:$^OGy2$^:$^OG4$yC:$^OGi` "]!!! i`"]!*]!S%i`"]*] ~#fo"]!*]!S%!*]! !]~#9 *] ~#fo N#F!̀U"]"[!͖C[!N#F͖!:5"[[!*]!S%!!N#F!S%!! N#F!!S%!!N#F!$S%!~# !!!!'S%ywx#w!!!!!*S%ywx#wfo" c! ~#fo" c!~#fo":^2>^2?^! c:>^:?^#Ҡ)2<^2=^! c:<^:=^#Ҳ)*:^* c ~w#~w+)* cN#F* c~w#~w~OGyOGÉ)* c-yw* c ~#fo}0)ò)*>^MD<[*>^#">^")* c ~#fo}0ʨ)à)*:^#":^*<^#"<^8)&[!~#fo" c!~#fo" c! ~#fo" c!~#fo"@^2D^2E^! c:D^:E^#҆** c ~#fo} †*2B^2C^! c:B^:C^#Ҏ** c ~#fo} Ž** c ~w#~w+** cN#F* c~w#~w*@^~**D^MD<[*D^#"D^ **B^#"B^*@^#"@^4** c*@^~OGyOG͉/*@^~ ˜** c ~#fo}@o|g}ʘ** c!͉/Ø*&[!~#fo" c* c" c:o^2o^:p^2p^3+*m^*m^#"m^~OGyOG;+!m^-i`" c: cM+: cs+: c ]+: cs+* c* c#" c: cw+* c6: c…+: c +! c: c—+: c# +å+* cMD<[&[!~#fo" c!~#fo" c!~#fo" c!: cw:c#w: c2 c: c2 c! c>#r,!* c ~w#~w+2,* cN#F* c~w#~w~OGyOG:,* c-ywx#w+~K,#~r,!N#F!~w#~w!~ +!~#fo6!~Š,#~¨,!! c Ÿ, #¨,í,* cMD<[&[!~#fo" c!}^* c-:^2^:^2^,*}^*}^#"}^6 ,!}^! ͉/*^}ywx#w!~#%!![!Ͱ>!N#F!-!:]w:]#w!~#fo~OGyXxʩ!~#fo##~OG!~#fo#~OG!~#fo~OG!s!N#FQ! 9!~w#~wC!N#FM("[ Another bad sector ? New sector added track %u, head %u, sector %u, OK ? Sector Head: Track: Bad map full [*]*]V! V"^*]"]*]~OGy_xn*]###"]O*^MD) *] :]:]ڤ!"͖:]2]:]2]þ*]!Ͳ"i`"^*]!Ͳ"i`"^*]!Ͳ"i`"^*]:^w*]#:^w*]##:^w*]##~OG*]#~OG*]~OG!/![*:[2^:^AM!^>ZM:^OG!a MD! MDT:^OGy2^:^yq!͖*]###"]![!ͣ$:[2^:^A!^>Z:^OG!a MD! MDò:^OGy2^:^yn*]6g"[spt = %u, dsm = %u Drive type not found M26m26read[!9!*] ~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w: c#w* c w#w* c w#w* c * c~rA(D(ywx#w<[&[!~#fo" c* c!͉/* c N#FK* c ~w#~w* c ~#fo}(* c ~#fo|(* c N#F1* c ~w#~w(<[* c w#w* c ~w#~w(&[!~#fo" c!~#~#F1* c ~#fo}o1* c* c !J^* c ~#fo }| w #w0!* c N#F%?x1* c #~w1* c* c !! 2ywx#w+~#~ i`~#­1* c ~w0* c ~w#~w0!![^##N#F+++N#F* c N#Fl?x1* c ~@w<[[!N#F3"[&[!~#fo" c!~#fo" c* c* cVi`" c* c2i`" c* c" c! c~#W2<[* c: c2 c:c2c}ʂ2* c* c#" c6W2* cMD<[[!c^~#©2!_^"a^*a^"c^2_^2`^*c^MD"[&[!~#fo" c* c ! V#MD<[&[!~#fo" c* cͱ2i`"i^͊2i`"g^*g^##~#fo"e^*e^!i^  #S3*e^!i^ &3 #3*g^##*e^##~#~ð3*e^"g^*e^##~#fo"e^3!c^:e^b3:f^#>3!"Ei`"e^!e^~#3<[*e^!i^  #*e^*e^~#fo)) "e^*e^:i^w:j^#w*g^"c^*e^####MD<[*e^> w>#w*e^####3*c^"e^>3&[!~#fo" c! c~#3<[: c2 c:c2c͊2i`"k^! c:k^:l^#҈4*k^##: c:c#҈4* c~#fo))* c *k^##yR4x#4* c*k^##~#fo  #* c *k^##~#fo##~#~4*k^##:k^:l^#ڹ4! c:k^:l^#34*k^##: c:c#34*k^##~#fo"k^4* c *k^##~#~*k^~#fo))*k^ ! cy4x##5*k^* c " c* c* c(V0 }2_!_>9.=:_'2_* c* c#" c:_w* c!yOx#G<[&[! ~#fo" c!~#fo" c:c=* c>o>g" c!#~=!!bmW!b́Z~#~#~#~* c* c#" c6-!bmW!b:c2c2c:c2c: c2c!cX~2_#~2_#~2_#~2_!_~###2>* c!_##N#F+++N#F* cQ=* c " c!bmW!b:c2c2c:c2c: c2c!c0Y>02c2c2c2c!c W##~2_!_>9ҍ>:_'2_* c* c#" c:_w* c!yOx#G<[&[!" c* c~#>* cN#F>* cN#F!N#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N#FxUO>GDUVO>G! 9q#pg[! 9N#FDU! 9q#pg[! 9N#FDU! 9q#pg[!9~SV/#>+++>#~#~#~ #~{KX>#># >#X!9MD!9~#fo+X! 9MD!9~#fo+X|W!9N#F!9^XXX!9MD!9~#fo+X! 9MD!9~#fo+X|W!9N#F!9^XXX! 9MD!***************************************************************** * * * Formathd formats the Discus M26 or the Discus M10 hard disk * * drive. It write sector header information on the entire disk * * surface. When the formatting has been completed, a map is * * created on track 0, head 0, last two sectors of all the * * encountered bad sectors. Each entry of the map consists of * * the three bytes identifying the track, head, and sector that * * was bad. * * * * Written By Bobby Dale Gifford. * * 5/18/81 * * * ***************************************************************** title '*** Format Program for Discus M26 & M10 under CP/M 2.2 ***' revnum equ 22 ;Revision number x.x hdorg equ 050h ;Hard disk origin status equ hdorg ;Status register cntrol equ hdorg ;Control register data equ hdorg+3 ;Data register functn equ hdorg+2 ;Function register comnd equ hdorg+1 ;Command register result equ hdorg+1 ;Result register retry equ 2 retries e call pbuff call rbuff jz wboot cpi 'Y' jz skiphd cpi 'N' jnz preask call preform jmp skiphd dohead call headmap skiphd mvi a,2 sta phase lda much ani 2 cnz datamap ;Make the bad sector map lda much ani 4 cnz seeks lxi d,donmsg jmp exit continu lxi d,notyet jmp exit howmuch lxi d,muchmsg call pbuff call rbuff cpi acr jz wboot cpi '1' jc howmuch cpi '7'+1 jnc howmuch sui '0' sta much ret getphy lxi d,phnum call pbuff call rbuff cpi acr jz wboot cpi '1' jc getphy cpi '4'+1 jnc getphy sui '1' sta drive gettyp lxi d,drvtyp call pbuff call rbuff cpi acr jz wboot cpi 'A' jc gettyp cpi 'C'+1 jnc gettyp sui 'A' sta disktyp cpi 1 mvi a,hedm10 sta heads jz gtype mvi a,hedm20 sta heads ret gtype xra a sta sdelay lxi d,dtype call pbuff call rbuff cpi acr jz wboot cpi 'F' rz cpi 'M' jnz gtype mvi a,1 sta sdelay ret getlog lxi d,lognum call pbuff call rbuff cpi9~#fo#X!9MD!9~#fo#X|W!9N#Fkb9KXXXX!9~HY/<~Yg[O!9~#fo##~w#~w+++~w#~w UYg[!9~~Y/#w>+++w>#w!9N#F!9~#fo  # # #g[!9N#F!9~#fo ## # +++ #g[~#[#~#foy#[x#[+++~#fo##Z!9!9* c* c* ci`!" c" c" c!9N#F###q#p+++q!9N#F#q#pV2.1: copyright (c) 1979 by Whitesmiths, Ltd.2qu 20 ;Maximum error count tkzero equ 1 ;Track zero flag bit opdone equ 2 ;Operation complete flag bit complt equ 4 ;Complete flag bit tmout equ 8 ;Time out flag bit wfault equ 10h ;Write fault flag bit drvrdy equ 20h ;Drive ready flag bit index equ 40h ;Index hole flag bit halt equ 80h ;Halt flag bit cstrt equ 3 ;Command start drvmsk equ 3 ;Drive bit mask pstep equ 4 ;Positive step bit hdrlen equ 4 ;Header length in bytes seclen equ 512 ;Sector length in bytes wenabl equ 0fh ;Write enable cpuclk equ 0bh ;Cpu clock mask wreset equ 0bh ;Write fault reset mask scenbl equ 5 dskclk equ 7 ;Disk drive clock mask secm26 equ 32 ;Sector count for m26 secm10 equ 21 ;Sector count for m10 trkm26 equ 202 ;Tracks on an M26 trkm10 equ 244 ;Tracks on an M10 hedm26 equ 8 ;Heads on an M26 hedm10 equ 4 ;Heads on an M10 hedm20 equ 8 ;Heads on an M20 wprot equ 80h ;Write protect flag bit mdir equ 0f7h ;Direction mask nstep equ 0fbh ;Negative step mask null equ 0fch ;Null c acr jz wboot cpi '1' jc getlog push psw call phytyp mvi b,'3'+1 jz cmptrk1 lda heads cpi hedm20 mvi b,'2'+1 jnz cmptrk1 mvi b,'3'+1 cmptrk1 pop psw cmp b jnc getlog sui '1' mov e,a mvi d,0 call phytyp lxi h,trksm26 jz trksok lda heads cpi hedm20 lxi h,trksm10 jnz trksok lxi h,trksm20 trksok dad d mov a,m sta frsttrk inx h mov a,m sta lasttrk ret trksm26 db 0,64,127,203 trksm10 db 0,122,244 trksm20 db 0,98,195,244 headata lxi d,hdmsg call pbuff xra a sta nodata call rbuff cpi acr jz wboot cpi 'H' rz cpi 'D' jnz headata mvi a,1 sta nodata ret phytyp lda disktyp ana a ret ***************************************************************** * * * Prep makes sure the drive is up and running. * * * ***************************************************************** prep lda drive ;Select the drive ori null ;Nop sta dfnreg out functn mvi a,scenbl out cntrol mvi c,239 lxi h,0 ***** delay call phytyp cpi 2 rz ;If its an M20 it will do the settle delay cpi 1 jnz dodel lda sdelay ora a rz dodel lhld settle deloop dcx h mov a,h ora l inx h dcx h in status ;Waste a little extra time to get 33 ms jmp $+3 jnz deloop ret ***************************************************************** * * * Headmap scans sector headers, locating bad ones. Each bad * * header is entered into the bad sector map. * * * ***************************************************************** headmap lxi d,headmsg call pbuff call trkzro lxi h,0 shld buffer shld buffer+2 xra a sta head newhed mvi a,1 sta hedbuf1 sta sflg call zers lda head rlc rlc rlc rlc ani 70h cma ani 0fch mov b,a lda drive add b sta dfnreg out functn hedtst lxi h,hedbuf1 mvi a,1 call initfld call panic call indx lxi h,hedbuf1 call phytyp mvi b,secm26 jz wrtloop mvi b,secm10 wrtloop mvi c,hdrlen mvi a,isbuff oujnz zrolook lda errflg ana a mvi a,0 sta errflg lxi d,acralf jnz pbuff ret ***************************************************************** * * * Datamap locates bad sector data fields. * * * ***************************************************************** datamap lxi d,datmsg call pbuff call trkzro lxi h,0 shld buffer shld buffer+2 xra a sta head inr a sta buffer+2 nxthed call makbuf0 lda buffer+1 ana a mvi a,0 jnz zkey mvi a,80h zkey sta buffer+3 mvi a,1 sta datbuf1 sta sflg call zers samhed call panic lxi h,datbuf1 push h call phytyp mvi a,seclen/(secm26*hdrlen) jz goinit mvi a,seclen/(secm10*hdrlen) goinit call initfld pop h wrdlp lda buffer+2 xra m mov m,a mvi c,retries wagan push b push h call preprw pop h push h call wdata jnc wok pop h pop b dcr c jnz wagan push b push h lda buffer+2 ora a ral sui 4 call incerr wok pop h pop b lda buffer+2 xra m mov m,a c in status ani drvrdy jz measure lxi d,rdywait call pbuff tdelay in status ani drvrdy jz measure dcx h mov a,h ora l jnz tdelay dcr c jnz tdelay lxi d,rdymsg jmp exit ***************************************************************** * * * Measure measures the time in machine cycles for one * * revolution of the disk. * * * ***************************************************************** measure lxi h,0 ;Initialize the counter to 0 mvi c,index ;Index flag initialized in status ana c ;Get state of the index line now mov b,a ;Save state in B waitm1 in status ;Get state now ana c ;Mask off the index bit cmp b ;Same state ? jz waitm1 ;Wait for toggle waitm2 inx h ;Increment counter in status ;Wait for another toggle ana c ;Strip off index cmp b ;Has it toggled yet ? jnz waitm2 shld settle ;Save the counter in status ;Test status ani halt ;Test for halted lxi d,hltmsg jz exit mvi a,wenabl ;Write enable tt comnd wrout mov a,m inx h out data dcr c jnz wrout mvi a,whedr out comnd wrwait in status ani opdone jz wrwait dcr b jnz wrtloop lxi h,hedbuf2 call phytyp mvi b,secm26 jz rdloop mvi b,secm10 rdloop mvi a,rhedr out comnd rdwait in status ani opdone jz rdwait mvi a,isbuff out comnd mvi c,hdrlen in data in data rdin in data mov m,a inx h dcr c jnz rdin dcr b jnz rdloop in status ani wfault ;Check for write fault lxi d,wfmsg jz exit lxi h,hedbuf1 lxi d,hedbuf2 call phytyp mvi b,secm26*hdrlen jz comp mvi b,secm10*hdrlen comp ldax d cmp m cnz icheder inx h inx d dcr b jnz comp lxi h,hedbuf1 call newpat jnz hedtst call zrolok call makbuf0 call cformat call inchead jnz newhed call update call inctrk rz jmp newhed icheder push h push d lxi d,-hedbuf1 dad d mov a,l ani 0fch rar call incerr pop d pop h ret zrolok lxi h,errors call phytyp mvi b,secm26 jz zrolook mvi all skew jnz wrdlp rddlp mvi c,retries rdagan push b push h call preprw mvi a,rsect out comnd rddwat in status ani opdone jz rddwat in status ani tmout jnz rderr in result ani retry jnz rderr mvi a,idbuff out comnd in data in data lda buffer+2 mov b,a pop h push h in data xra b cmp m cnz secerr inr l in data cmp m cnz secerr inr l cmpdat in data cmp m cnz secerr inr l in data cmp m cnz secerr inr l jnz cmpdat pop h pop b rdok call skew jnz rddlp lxi h,datbuf1 call newpat jnz samhed call zrolok call inchead jnz nxthed call update call inctrk rz jmp nxthed rderr call secerr pop h pop b dcr c jnz rdagan jmp rdok secerr push h lda buffer+2 ora a ral sui 4 call incerr pop h ret skew lda buffer+2 inr a sta buffer+2 push psw call phytyp mvi b,secm26+1 jz skewsec mvi b,secm10+1 skewsec pop psw cmp b rc sub b inr a sta buffer+2 dcr a ret wdata mvi ahe drive out cntrol mvi a,dskclk out cntrol ;Change to Clock from drive mvi a,wenabl out cntrol ;Finish write enable toggle call delay ;Wait 20 ms in status ani wfault ;Check for write fault lxi d,wfmsg jz exit lxi h,mapbeg shld mappnt lxi b,400h noers mvi m,0ffh inx h dcx b mov a,b ora c jnz noers ***************************************************************** * * * Trkzro moves the disk heads to track 0. * * * ***************************************************************** trkzro in status ;Check for already at track 0 ani tkzero rz hloop lxi b,101h ;Command to mhead call mhead ;Move the head cwait in status ani complt ;Wait for seek complete jz cwait in status ani tkzero ;At track 0 yet ? jnz hloop ***************************************************************** * * * Delay uses the counter created by measure to wait for 20ms. * * * ************************************************************b,secm10 zrolook mov e,m inx h mov d,m inx h mov a,e ora d jz goodsec push b push d push h lxi h,1 call hlcde lxi d,softmsg jnc phs lxi d,hardmsg phs call pbuff lxi d,errmsg call pbuff pop h push h dcx h dcx h lxi d,-errors dad d mov a,l rar ani 1fh inr a inr a push psw call phytyp mvi b,secm26+1 jz maxsec mvi b,secm10+1 maxsec pop psw cmp b jnz nowrp mvi a,1 nowrp sta badsec lda buffer+1 call putadc lxi d,hedmsg call pbuff lda head call putadc lxi d,secmsg call pbuff lda badsec call putadc lxi d,rtymsg call pbuff pop h xthl push h call putdc lxi d,acralf call pbuff pop h push h lxi d,2 call hlcde lhld mappnt lxi d,-mapbeg dad d lxi d,seclen*2-3 call hlcde lxi d,fullmsg jnc exit lhld mappnt lda buffer+1 mov m,a inx h lda head mov m,a inx h lda badsec mov m,a inx h mvi m,0ffh shld mappnt mvi a,1 sta errflg wassft pop d pop h pop b goodsec dcr b  ,idbuff out comnd lxi b,seclen wdat mov a,m out data inx h dcr c jnz wdat dcr b jnz wdat wsame mvi a,wsect out comnd wdwait in status ani opdone jz wdwait in status ani tmout stc rnz in result ani retry stc rnz in status ani wfault stc rz cmc ret preprw mvi a,isbuff out comnd lxi h,buffer mvi b,hdrlen whed mov a,m out data inx h dcr b jnz whed ret ***************************************************************** * * * Update writes the bad sector map onto the drive. * * * ***************************************************************** update lhld mappnt mvi m,0ffh inx h lda buffer+1 mov m,a inx h mvi b,1 mov c,a push b lda tsttyp mov m,a inx h lda phase mov m,a inx h mvi m,0ffh lda buffer+2 push psw xra a sta buffer+1 lda disktyp ana a jz upm26 mvi a,1 upm26 sta head mvi a,80h sta buffer+3 call phytyp mvi a,secm26-1 jz updt1 mvi a,secm10-1 updt1 sta byp mvi b,secm26-1 jz cmp1x mvi b,secm10-1 cmp1x lda buffer+2 cmp b jc fmtskp jz fmtskp pop h fmtdat push h call preprw pop h push h call wsame fmtskp call skew pop h jnz fmttrk call inchead jnz mainl call inctrk lda buffer+1 mov b,a lda lasttrk cmp b jnz mainl ret ***************************************************************** * * * Inchead increments the head. * * * ***************************************************************** inchead lxi h,head ;Increment the head number inr m call phytyp mvi a,hedm26 jz cmphed lda heads ;Test if done with this head cmphed sub m rnz mov m,a ret ***************************************************************** * * * Inctrk increments the track, and then steps the heads out one.* * * ***************************************************************** inctrk lxi h,buffer+1 ;Track # call phytyp mvi a,trkm26 jz cmptrk mvi a,trkm10 cmptrk inr m ;Incra,trkm10-3 sekjrka sta reps sta last inr a inr a sta first mvi a,-1 sta dltalst sta dltafst jmp doseek seekmax xra a sta first sta dltafst sta dltalst sta reps call phytyp mvi a,trkm26-1 jz sekmax mvi a,trkm10-1 sekmax sta last jmp doseek seekfly mvi a,-1 sta dltafst inr a sta first inr a sta dltafst call phytyp mvi a,trkm26-1 jz sekfly mvi a,trkm10-1 sekfly sta last sta reps doseek call sek00 dosek call panic lda first mov c,a lda dltafst add c sta first call seekit lda last mov c,a lda dltalst add c sta last call seekit lda reps dcr a sta reps jnz dosek ret seekit mov b,a lda buffer+1 sub b push psw mov a,b sta buffer+1 pop psw mvi b,0 jc movin mvi b,1 cma inr a movin cma inr a mov c,a call seek mvi a,rhedr out comnd sekwait in status ani opdone jz sekwait mvi a,isbuff out comnd in data in data in data in data mov b,a lda buffer+1 cmp b rz push buffer+2 call seek call makbuf0 call preprw lxi h,mapbeg call wdata cc fail call phytyp mvi a,secm26 jz updt2 mvi a,secm10 updt2 sta buffer+2 call makbuf0 call preprw lxi h,mapbeg+seclen call wdata cc fail pop psw sta buffer+2 xra a sta head sta buffer sta buffer+3 pop b mvi b,0 mov a,c sta buffer+1 seek call mhead seekwt in status ani complt jz seekwt jmp delay fail lxi d,failmsg jmp pbuff ***************************************************************** * * * Indx waits until the index hole just passes by. * * * ***************************************************************** indx mvi c,index in status ana c mov b,a indxwt in status ana c cmp b jz indxwt ret logical call getphy call getlog call headata call prep lxi d,logmsg call pbuff call form lxi d,donmsg jmp exit ***************************************************************** * * * Format routine does the actual sectorement the track # cmp m ;All done ? rz call pdot nocr lxi b,1 ;Move out call seek ori 1 ret pdot lda quiet ana a rnz lxi d,astrk ;Print an astrisk call pbuff lda buffer+1 ani 3fh rnz lxi d,acralf jmp pbuff ***************************************************************** * * * Mhead moves the disk head the desired # of steps. Bit 0 of * * register B determines the directios, 1=out, 0=in. Register C * * determins the # of tracks to step. * * * ***************************************************************** mhead mov a,b ;Test direction ani 1 ral ;Move into direction bit ral ral mov b,a mov a,c ana a rz lda dfnreg ;Get current function register ani mdir ;Mask off the direction bit ora b ;Put in the direction bit mhloop ani nstep ;Mask off the step bit out functn ;Output the step bit low ori pstep ;Change the step bit high out functn ;Output the step bit high dcr c ;Update the # of steps to go jnz mh lxi d,sekmsg1 call pbuff lda buffer+1 call putadc lxi d,sekmsg2 call pbuff pop b mov a,b call putadc lxi d,sekmsg3 call pbuff sek00 call trkzro xra a sta buffer+1 ret ***************************************************************** * * * Cformat formats one track on the current head. * * * ***************************************************************** cformat mvi a,1 ;Initialize the sector count sta buffer+2 lda buffer+1 ana a mvi a,80h jz putkey xra a putkey sta buffer+3 call indx call phytyp mvi b,secm26 lxi d,skewm26 jz floop mvi b,secm10 lxi d,skewm10 floop lxi h,buffer+2 incsec ldax d mov m,a inx d dcx h ;Adjust the pointer to the sector header dcx h mvi a,isbuff ;Initialize the controller pointer out comnd ;Give the command mvi c,hdrlen ;Header length ldloop mov a,m ;Transfer the contents of the buffer to out data ; the controller inx h ;Bump pointer to next byte dcr c ;Update the counter header formatting on * * the entire disk. * * * ***************************************************************** fmtonly call getphy call headata call prep call preform lxi d,donmsg jmp exit preform lxi d,formmsg call pbuff lxi h,0 ;Zero the header information shld buffer shld buffer+2 call phytyp mvi a,trkm26 jz setlst mvi a,trkm10 setlst sta lasttrk xra a sta frsttrk form call trkzro xra a sta head lda frsttrk sta buffer+1 mov c,a mvi b,0 call seek lxi d,acralf call pbuff mvi a,idbuff out comnd mvi b,seclen/4 mvi a,0e5h file5 out data out data out data out data dcr b jnz file5 mainl call makbuf0 call cformat in status ani wfault ;Check for write fault lxi d,wfmsg jz exit fmttrk lda nodata ana a push h jz fmtskp pop h call phytyp jz fmm26 lda buffer cpi 1 jnz fmtdat jmp fmmon fmm26 lda buffer ana a jnz fmtdat fmmon lda buffer+1 ana a jnz fmtdat push h call phytloop ret ***************************************************************** * * * Seeks does track seek tests. * * * ***************************************************************** seeks lxi d,seekmsg call pbuff mvi a,10 sta sekcnt sklopa lda sekcnt dcr a sta sekcnt rz call pdot lxi h,seektbl sklopb mov e,m inx h mov d,m inx h mov a,e ora d jz sklopa push h xchg call dopchl pop h jmp sklopb dopchl pchl seektbl dw seekinc dw seekdec dw seekjrk dw seekfly dw seekmax dw 0 seekinc xra a sta first sta last sta dltafst inr a sta dltalst seekcom call phytyp mvi a,trkm26-1 jz sekcom mvi a,trkm10-1 sekcom sta reps jmp doseek seekdec call phytyp mvi a,trkm26-1 jz sekdec mvi a,trkm10-1 sekdec sta first sta last xra a sta dltafst dcr a sta dltalst jmp seekcom seekjrk xra a sta first inr a sta dltalst sta dltafst inr a sta last call phytyp mvi a,trkm26-3 jz sekjrka mvi ! jnz ldloop mvi a,whedr ;Write header command out comnd ;Issue the write header command bwait in status ;Wait for the write to complete ani opdone jz bwait dcr b ;Test for sector count equal to 0 jnz floop ret skewm26 db 22,12,2,23,13,3,24,14,4,25,15,5,26,16,6 db 27,17,7,28,18,8,29,19,9,30,20,10,31,21,11,32,1 skewm10 db 8,15,2,9,16,3,10,17,4,11 db 18,5,12,19,6,13,20,7,14,21,1 zers lxi h,errors call phytyp lxi b,secm26 jz zersx lxi b,secm10 zersx mvi m,0 inx h mvi m,0 inx h dcx b mov a,b ora c jnz zersx ret initfld sta cnt mov a,m push psw call phytyp mvi b,secm26 jz iniflx mvi b,secm10 iniflx pop psw inilp push psw push h lxi h,cnt mov d,m pop h inilop mvi c,hdrlen iniloop mov m,a inx h cma dcr c jnz iniloop inr a dcr d jnz inilop pop psw inr a dcr b jnz inilp ret makbuf0 lxi h,drive ;Get drive # mov a,m rlc rlc ;Move to left four bits rlc rlc mov b,a ;Save drive # in B lda head mp d rnz mov a,l cmp e ret putadc mov l,a mvi h,0 ***************************************************************** * * * Putdc prints the ascii decimal equivalent of the number in HL * * * ***************************************************************** putdc lxi b,-10 phl push d mov d,b mov e,b phllp dad b inx d jc phllp xthl xchg mov a,h ora l cnz phl pop h mvi a,'0' add l sub c pchar push h push b push d push psw mov e,a mvi c,2 call bdos pop psw pop d pop b pop h ret ***************************************************************** * * * Panic checks if a character has been hit on the console. * * If a character has been pressed, then panic acknowledges the * * fact and asks for an abort. * * * ***************************************************************** panic mvi c,11 call bdos ani 1 rz lxi d,panmsg call pbuff mvi c,1 call bdos call rbuff cpi 'Y' jz wboot lx Track $' sekmsg3 db '.',acr,alf,'$' unknown db acr,alf db 'Unknown Command.$' bdrvmsg db acr,alf db 'Bad Drive Number.$' funcmsg db acr,alf db 'Choose The Desired Function:' db acr,alf,atab db 'L = Format a Logical Drive.' db acr,alf,atab db 'F = Format an Entire Physical Drive.' db acr,alf,atab db 'C = Continue An Interupted Test.' db acr,alf,atab db 'D = Run a Diagnostic Test.' db acr,alf db 'Function (RETURN to Exit): $' notyet db acr,alf db 'Not Yet Implemented.$' drvtyp db acr,alf db 'Select The Drive Type:' db acr,alf,atab db 'A = Discus M26, 26 Megabyte Drive.' db acr,alf,atab db 'B = Discus M10, 10 Megabyte Drive.' db acr,alf,atab db 'C = Discus M20, 20 Megabyte Drive.' db acr,alf db 'Drive type (RETURN to Exit): $' dtype db acr, alf db 'Select drive type:' db acr, alf, atab db 'F = Fujitsu 2301' db acr, alf, atab db 'M = Memorex 101' db acr, alf db 'Type (RETURN to Exit): $' muchmsg db acr,alf db 'How Much of the Dia;Add in the head # sta buffer add b ani 7 ;Strip off the drive # rlc rlc rlc ;Head # in to four significant bits rlc cma ;Head # is negative logic ani 0fch ;Strip off the drive bits add m ;Add in this drive sta dfnreg ;Save the function register out functn ;Output the function ret incerr ani 3fh mov l,a mvi h,0 lxi d,errors dad d mov e,m inx h mov d,m inx d mov m,d dcx h mov m,e ret newpat lda tsttyp ana a mov a,m jz long short lda sflg ana a mvi a,0 sta sflg mov a,m jnz shortx mvi a,1 sta sflg mov a,m cma ral cma shortx cma dcr a long inr a mov m,a ana a ret ***************************************************************** * * * Pbuff is the CP/M print buffer command. * * * ***************************************************************** pbuff lda quiet ana a jz pbuffx push d lxi d,nulls call pbuffx pop d pbuffx mvi c,9 ;Print buffer command jmp bdos ;Go and entei d,acralf jmp pbuff ***************************************************************** * * * Messages output by the program. * * * ***************************************************************** prompt db 'Discus M26 and M10 Hard Disk Format Program Rev. ' db revnum/10+'0' db '.' db (revnum mod 10)+'0' db '$' phnum db acr,alf db 'Enter Physical Drive Number to be Tested or Formated ' db '(1 - 4, RETURN to exit): $' lognum db acr,alf db 'Enter Logical Drive Number to be Formated ' db '(1 - 3, RETURN to exit): $' hdmsg db acr,alf db 'Enter Amount of Formatting Desired:' db acr,alf,atab db 'H = Format Headers Only (Data Remains Intact).' db acr,alf,atab db 'D = Erase Data Field Also.' db acr,alf db 'Function: $' rdymsg db acr,alf db 'Drive is not ready.$' hltmsg db acr,alf db 'Controller not halted.$' wfmsg db acr,alf db 'Write fault on drive.$' astrk db '.$' hardmsg equ $ softmsg equ $ acralf db acr,alf,'$' rdywait dgnostic Do You Want to Run: ' db acr,alf,atab db '1 = Sector Header Field Test Only.' db acr,alf,atab db '2 = Sector Data Field Test Only.' db acr,alf,atab db '4 = Seek Mechanism Test Only.' db acr,alf db 'Choose the Diagnostic by Adding together the ' db 'Desired Options.' db acr,alf db 'Options (RETURN to Exit): $' prefmt db acr,alf db 'Has the Drive Been Preformated ? (Y or N, RETURN to Exit): $' nulls db 0,0,0,0,0,0,0,0,0,0,'$' insmsg db acr,alf db 'Press RETURN to return to CP/M: $' ***************************************************************** * * * Dynamic data locations. * * * ***************************************************************** quiet db 0 sdelay db 0 much db 0 sekcnt db 0 first db 0 last db 0 dltafst db 0 dltalst db 0 reps db 0 disktyp db 0 heads db 0 nodata db 0 frsttrk db 0 lasttrk db 0 settle dw 0 ;20ms time constant buffer ds hdrlen head db 0 dfnreg db 0fch errflg db 0 cnt db 0 badsec db 0 mappnt r the BDOS ***************************************************************** * * * Rbuff is the CP/M read buffer command. * * * ***************************************************************** rbuff lxi d,bufmax ;Beginning of buffer mvi c,10 ;Read console command call bdos ;Read and fill the buffer lda buflen ;Check for zero length ana a ;if zero the return with acr in A mvi a,acr rz lda bufdat ;Otherwise return with the character cpi 'a' ;Fold to upper case rc cpi 'z'+1 rnc sui 20h ;Perform the mapping to upper case ret bufmax db 10 ;Maximum length buflen db 0 ;Current length bufdat ds 10 ;Storage or read in data ***************************************************************** * * * Exit prints a message on the CP/M console then does a warm * * boot. * * * ***************************************************************** exit call pbuff lxi d,insmsg call pbuff call rbuff jmp wboot hlcde mov a,h cb acr,alf db 'Waiting for drive to become ready, could take ' db 'as long as 2 minutes.$' headmsg db acr,alf db 'Testing sector headers, will take about 30 minutes.' db acr,alf,'$' formmsg db acr,alf db 'Formatting the entire physical disk, ' db 'will take about 4 minutes.$' logmsg db acr,alf db 'Formatting a logical drive, will take about 1.5 minutes.$' errmsg db 'Sector Error, Track $' secmsg db ', Sector $' hedmsg db ', Head $' rtymsg db ', Error count $' donmsg db acr,alf db 'All Finished, Returning to CP/M.$' panmsg db acr,alf db 'Want to abort ? (Yes or No): $' datmsg db acr,alf db 'Testing sector data field, will take about 12-14 Hours.' db acr,alf,'$' failmsg db acr,alf db 'Error Writing Sector Map to Track Zero.$' fullmsg db acr,alf db 'Bad Sector Map Overflow.$' seekmsg db acr,alf db 'Testing Track Seek Mechanism, will take about 15 minutes.' db acr,alf,'$' sekmsg1 db acr,alf db 'Seek error, Looking For Track $' sekmsg2 db ', Found"dw 0 ;Pointer into map table drive db 0ffh ;If this location is NOT 0ffh then ; NO prompting will occur sflg db 0 tsttyp db 1 phase db 0 hedbuf1 ds secm26*hdrlen hedbuf2 ds secm10*hdrlen ds 100h-($ mod 100h) datbuf1 ds seclen mapbeg ds seclen*2 errors ds secm26*2 ds 30 stack equ $ end en Preformated ? (Y or N, RETURN to Exit): $' nulls db 0,0,0,0,0,0,0,0,0,0,'$' insmsg db acr,alf db 'Press RETURN to return to CP/M: $' ***************************************************************** * * * Dynamic data locations. * * * ***************************************************************** quiet db 0 sdelay db 0 much db 0 sekcnt db 0 first db 0 last db 0 dltafst db 0 dltalst db 0 reps db 0 disktyp db 0 heads db 0 nodata db 0 frsttrk db 0 lasttrk db 0 settle dw 0 ;20ms time constant buffer ds hdrlen head db 0 dfnreg db 0fch errflg db 0 cnt db 0 badsec db 0 mappnt R:>2%  !""2<2͡ :>?>2>22Y o !͋>^>u :wn<҈ i: :w bn>QPʠPQ>QSS:GS,S,S,S, •! ME1̀%1 —: :<2͋!2ؐ<2=>Q~S# CC>QPSP7Q7P7?>Q!~S#w*6#:w#O:w#:w#6:2:ʬ>2>2͋>ʾ>2͡ n!<͋> >2͡ n!<2222y2XP0 @PGP͢ k͐ rY1 ͢k͐RY1  !""͋>k>222:2O% >Q>SSSS“͡ P 1 :͋:::͋:nO ¯Ÿ%:G:Ÿ!4͋>!:w!͋>2>4A:# :?% xGy:RR h > 2:=2A!^#V#{ʀ͠Î2  222<2͋>>2O ͋>>222=2û2<22<2͋>>20, 20 Megabyte Drive. Drive type (RETURN to Exit): $ Select drive type: F = Fujitsu 2301 M = Memorex 101 Type (RETURN to Exit): $ How Much of the Diagnostic Do You Want to Run: 1 = Sector Header Field Test Only. 2 = Sector Data Field Test Only. 4 = Seek Mechanism Test Only. Choose the Diagnostic by Adding together the Desired Options. Options (RETURN to Exit): $ Has the Drive Been Preformated ? (Y or N, RETURN to Exit): $$ Press RETURN to return to CP/M: $st Ound Track $. $ Unknown Command.$ Bad Drive Number.$ Choose The Desired Function: L = Format a Logical Drive. F = Format an Entire Physical Drive. C = Continue An Interupted Test. D = Run a Diagnostic Test. Function (RETURN to Exit): $ Not Yet Implemented.$ Select The Drive Type: A = Discus M26, 26 Megabyte Drive. B = Discus M10, 10 Megabyte Drive. C = Discus M22<<2>22O 2222͋>, >2O >2<2<2͋>I >22 o :O:2| :O:2| :=2R G:x2ڐ /QPʚ >QSSSSG:[ :F | xF  2>2:> 2͋ $ D !w++>Q~S# >QP            !͋ h 6#6# xh 2~͋ ʄ !Vw#/ Ž <Œ <… !~G:2/2R?o&^#Vr+s:~ :>2~ >2~///= :' a{    |}o&PX O |L >0_ |  Y% Discus M26 and M10 Hard Disk Format Program Rev. 2.2$ Enter Physical Drive Number to be Tested or Formated (1 - 4, RETURN to exit): $ Enter Logical Drive Number to be Formated (1 - 3, RETURN to exit): $ Enter Amount of Formatting Desired: H = Format Headers Only (Data Remains Intact). D = Erase Data Field Also. Function: $ Drive is not ready.$ Controller n1^  C~D.F@L% ̈́͐͢>2:`} YcNDRcQ>2::uY1 w1  1ڄ8҄02 1ڢ5Ң12 AڿDҿA2>2>2ɯ25 FM>2 1 ͋44:344 1_͋!`U:!dU!g~2#~2@zb\ 2 HDk>2::2R>P!P ( P +|° ° 1 !@PGP#P"P 1 >P>P>P0P 1 !"6# xPXP"P͋@:*+|#+PMCn !""2>22Y :p/G:2R!>u o !͋ ʣ>Q~#S ©>QPʵ£!͋ >QP>QSSSw# P 1 !͋T5#! ˆE͡ g̀%g} !͋ R^#V#{!@ % m% # ++}<<͋!ʏ–>2:F B :F 8 :F J I % @ *@ 1 *:w#:w#:w#6">2ot halted.$ Write fault on drive.$.$ $ Waiting for drive to become ready, could take as long as 2 minutes.$ Testing sector headers, will take about 30 minutes. $ Formatting the entire physical disk, will take about 4 minutes.$ Formatting a logical drive, will take about 1.5 minutes.$Sector Error, Track $, Sector $, Head $, Error count $ All Finished, Returning to CP/M.$ Want to abort ? (Yes or No): $ Testing sector data field, will take about 12-14 Hours. $ Error Writing Sector Map to Track Zero.$ Bad Sector Map Overflow.$ Testing Track Seek Mechanism, will take about 15 minutes. $ Seek error, Looking For Track $, Found Track $. $ Unknown Command.$ Bad Drive Number.$ Choose The Desired Function: L = Format a Logical Drive. F = Format an Entire Physical Drive. C = Continue An Interupted Test. D = Run a Diagnostic Test. Function (RETURN to Exit): $ Not Yet Implemented.$ Select The Drive Type: A = Discus M26, 26 Megabyte Drive. B = Discus M10, 10 Megabyte Drive. C = Discus M2#cCCCch line in the vitals file consists of fields describing the type of drive and where the bad map information may be located. The first line of the vitals file is reserved for titling information. The fields are: cpmspt - The number of CP/M sectors per CP/M track cpmdsm - The disk size maximum (see DPH and DPB) mapcyl - The cylinder where the bad map lives maphed - The head where the bad map lives mapsec - The sector where the bad map lives maplen - The number of physical sectors the bad map occupies ncyls - The number of physical cylinders on the drive nheds - The number of physical heads on the drive nsecs - The number of physical sectors on the drive secsize- The physical sector size name - A short english description of the drive Following are more detailed descriptions of the sub-functions of the bad program. get Reads the bad map and displays the contents on the console. The format of the output is: track head sector .. Suppliers of Cpm should arrange for more informative error messages. It is impossible to patch a bad spot which lies in the area of a CP/M directory. The only possible way of dealing with this problem is to have the CP/M CBIOS handle the bad sector sparing. If a bad spot is already allocated to a file there an error message to that effect is issued. This means that the bad spot is still a potential hazard. The best way around this problem is to fix drives with no other files. ad, and then restore the disk. Alternatively, if you know the hard disk track, head, and sector number of the new bad spot, you can run putbad to add the new bad spot to the map and then run fixbad. BUGS It is very difficult to discover the track, head, and sector number of a bad spot when Cpm's only error message is "Bdos error on drive e: bad sector"JMP DMA DREAD JMP READ DWRITE JMP WRITE SELDRV JMP DRIVE TPANIC JMP CPAN TSTAT JMP TMSTAT DMAST JMP DMSTAT STATUS JMP DISKST DSKERR JMP LERROR SETDEN JMP DENFIX SETSID JMP SIDEFX DS 66Q BOOT LXI SP,TRACK+1 ;initialize SP CALL TIMOUT ;poc/reset timeout LXI H,1 PUSH H ;track 0, sector 1 MVI L,DCRINT ;set up the PUSH H ; side select MVI H,377Q ; and initial PUSH H ; drive PUSH H ; parameters PUSH H PUSH H LXI H,10Q ;initialize PUSH H ; tzflag & cdisk MVI L,176Q ;initialize PUSH H ; disk & drvsel MVI L,10Q ;initialize PUSH H ; hdflag & dsflag MVI H,30Q ;initialize PUSH H ; timer constant MVI A,177Q ;start 1791 STA DREG MVI A,CLRCMD ;1791 reset STA CMDREG LDHEAD XRA A ;load the head CALL HDCHK ; and test for JNC DOOROK ; drive ready MVI A,LIGHT ;turn on the STA DCREG ; error LED CALL TIMOUT ;timeout to JMP LDHEAD ; close drive door DOOROK MVI A,NOLITE ;turn off the STA DCREG .. for each entry in the bad map. You are asked if you'd like copy of the bad sectors list in a file. If you enter a file name, a file is produces containing this list. If you simply press return, no file is produced. put You are prompted for track, head, sector triplets in the form: track # head # sector # ... until you answer that you have no more sectors to enter. The updated bad map is then written back on to the disk. fix Reads a bad map from the specified drive and creates CP/M directory entries which effectively allocate the bad spot on the disk to the new file. The file is hidden form the user by placing it in user 15 and making it a system file with write protection. No attempt should be made to read or write the file. All such created files are given the name "BADSPOTS". You will be notified if one of your files contains a bad spot. The proper way to proceed in this case is to save as much of the file as possible ent error DCR A JP ISSUE MVI A,20Q PLEAVE STC ;error flag POP H LEAVE PUSH PSW ;save the status LDA DCREG ;control bits XRI LOAD ;toggle the STA DCMD ; head load bit LDA DRVSEL ;enable access to STA DREG ; the data register POP PSW ;recover the status RET PREP CALL HDLOAD ;load the head RC ;test for drive ready LDA TRKREG ;get old track INR A ;test for head CZ HENTRY ; not calibrated RC ;seek error? LXI H,TRKREG ;old track LDA TRACK ;new track CMP M ;test for head motion INX H ;advance to the INX H ; data register MOV M,A ;save new track MOV A,C ;turn off data reg STA DREG ; access control bit JZ TVERFY ;test for seek XRA A ;force a read STA HDFLAG ; header operation LDA DSTAT ;get the double ANI DSIDE ; sided flag STA DSFLAG ;save for status RAR ;shift for RAR ; 3/6 ms step RAR ; rate constant ADI SKCMD ;do a LXI H,0 ; seek CALL CENTRY ; operation JC SNAME bad -- bad spot utility program SYNOPSIS bad DESCRIPTION The hard disk format program "formathd" has an option to test the disk, leaving a map of any bad spots for future reference. (See formathd for the exact location and format of this map.) "bad" is a menu style utility program for dealing with this map and prohibiting CP/M file systems from accessing the bad locations. There are basically three seperate functions performed by "bad": 1) read and display the bad map contents, 2) add sectors to the bad map 3) read the bad map and write CP/M directory entries to allocate the bad spots to a CP/M file. All three bad functions work on CP/M logical drives, as opposed to physical drive units. When a drive is specified in a command the drive type is determined by examining the file "vitals.bad" on the currently logged drive. If the drive type can not be determined then an error is reported. Eaby copying into another file, then erase the original file, then press ^C to ensure the integrity of the in memery CP/M disk allocation bit-map. The hard disk is shipped from the factory with any necessary badspot files already installed. (Shugart and Memorex do not guarantee freedom from bad spots, although they do guarantee a certain maximum, and an error-free track 0.) So ordinarily, the hard disk user will not need these programs. If a new bad spot developes, there are two ways to proceed. The most time consuming is to back up the disk, run the formathd program, run fixbad, and then restore the disk. Alternatively, if you know the hard disk track, head, and sector number of the new bad spot, you can run putbad to add the new bad spot to the map and then run fixbad. BUGS It is very difficult to discover the track, head, and sector number of a bad spot when Cpm's only error message is "Bdos error on drive e: bad sector"$cpmspt cpmdsm mapcyl maphed mapsec maplen ncyls nheds nsecs secsize name (20) 336 1269 0 1 20 2 244 4 21 512 M10 Drive A 336 1280 0 1 20 2 244 4 21 512 M10 Drive B 672 2015 0 1 20 2 244 8 21 512 M20 Drive A or B 672 1028 0 1 20 2 244 8 21 512 M20 Drive C 672 2036 0 1 20 2 244 8 21 512 M20 Drive A or B 1024 1973 0 0 31 2 202 8 32 512 M26 Drive A, B, or C 1024 2015 0 0 31 2 202 8 32 512 M26 Drive A or B 1024 2047 0 0 31 2 202 8 32 512 M26 Drive C FORMT# ASMPFORMT# COM GETBAD COMGETBAD COM ion callOverflowOut of memoryUndefined line numberSubscript out of rangeDuplicate DefinitionDivision by zeroIllegal directType mismatchOut of string spaceString too longString formula too complexCan't continueUndefined user functionNo RESUMERESUME without errorUnprintable errorMissing operandLine buffer overflow??FOR Without NEXT??WHILE without WENDWEND without WHILEFIELD overflowInternal errorBad file numberFile not foundBad file modeFile already open?Disk I/O errorFile already exists??Disk fullInput past endBad record numberBad file name?Direct statement in fileToo many filespP8`@` :Y! d! ~Y#=%iʎ%à&O[H> K> Yi>: y +=2i ZY#ZEo:ҋ0o.o%~ Ҡ ʠ ʠ> :i <ʩ=m+~ ʬ ʬ ʬ#>d2 ͋9C" :g ͬ! (" !9T  +V+^##* C" B* *Cd Nz)~S ͒(q)ʹ(QZ~>r)ʹ(E(OdG+ $* "* 3àE3\B" !9" ~: #~#ʅ #^#V": >[@1>]@ցLO! N#F#~: ҆ ځ#:l `#2l f>R~#"j &o"n >2m !~##"j +fC͎*j <2m n G("j ! 0?<=:l ҫ ګ*n ¨###^#V,:m 2g *n " *p " !n (E AOGEAGx3Ø(:l  *j #*C > 2 ,$`i P "  "!>:yHG+ȸ#"he sector MOV C,A ; size and setup MVI B,0 ; the table offset LXI H,STABLE ;sector table DAD B ;sector size pntr LDA SECTOR ;get the sector MOV B,A ; and save in B ADD M ;compare w/table MVI A,20Q ;error flag RC ;error return MOV A,B ;initialize 1791 STA SECREG ; sector register MVI A,40Q ;128 byte sector LXi h,505h SHLD ECOUNT SZLOOP DCR C ;reduce size count MOV B,A ;sector size to B RM ;return on minus RAL ;double the count ORA A ;clear the carry JMP SZLOOP STABLE DB 345Q ;26 sector diskettes DB 345Q ;26 sector diskettes DB 360Q ;15 sector diskettes DB 367Q ;8 sector diskettes HDLOAD LXI H,DISK ;new drv ptr MOV C,M ;save new drv in C INX H ;current drv ptr MOV E,M ;save old drv in E MOV M,C ;update current drv INX H ;home cmd flag MOV A,E ;test for CMP C ; drive change MOV A,M ;head load mask MVI M,HEAD ;update the mask JZ HDCHK ;no drive change? INX H ;addr of drive table PUSH H , in Ok Break!9~#b  T N#F#`izv C T  *|<ʗ :  D=96543>7@?2C: * "   *" 2 2 |< "  * <֌W-͋9C" :g G:g x=ͬ:g  H * #^#V*Cs* C{! C{>HͣFH(µC(zʢPY" : {:_ u ~GC+K x),  <2~(z˜<* * "~ #####u   =>C,* =( |" 2 " â ~,dC+͆(~ʕ *n €€l>2á Q+!B>ee,%;d)1F6 * 4TF* ::G<:?=:G<:e ?=!B&Gá(* TF~\:I:G<:\V:G:e \!B\/V tz|TF›:::o<ʛ& ,C)+(* TF~:::e /<!B{= @è2go"C#ʧQHLo͋9;*0KDF>-?Redo from start #~ "4N: !!#G* Q!a ;#YHL">2>2 F~,2 ÓC;&G: ʫ>?@> @0KDů2 6,+>2 ͉:~+[(# "4([])Ì]z))DEc9@gQC}DE CsD +"]D  $ |D}DDD<|""XL{LL{PtM=$$YXTZZSR\SZeXY{TzTSYHIyII|(*g(678&+7y8919JHFIHH"+IFFz)) *m*zQ}QQU@VXVaQdQgQ;LM$Xq"9BLdhiUTϫNBTSLOSONԚLEAҒINSNDBV+V,V-O HRAL̶OMMOθHAIιELETŪATI͆EFSTҭEFINԮEFSNǯEFDB̰EƘLSŢNāRASŦDIԧRROҨRRX O/QO҂IELILERIOTωO TωOSUEEXNPUԅƋNSTNNMNKEYILPRINԞLISԟPOEԈINűOASEISԓO O0EEFTO1ERGOKI2KS3KD4IDEXԃUL̖AMEהOPEοUԝΕCTPTIOκRINԑUOKřOEEETURΎEAćUΊESTORŌE͏ESUMũSEIGHTNENUͬESEANDOMIZŻTOАWAХAVPCTEGQI TRTRINGPACEYSTEͽHEROΣROFƤABA SINSAARPTIDTȡAIԗHILŴENĵRITŷO۾yy||PF<2(z{ *z);*)&,,d-D.s)%%'i')1+%+Q+3)NEXT without FORSyntax errorRETURN without GOSUBOut of DATAIllegal functC{K2* " * |< " " * |! 4 4 5wY2B!{DP 2R U >(_#U * ~?o !P #GC!BʻY|<1>DA2MSB!E :* > @(K 2 Ç 2 *  C " :b ʢ >(Kڢ <=ʢ (ͬ~ ̾(" ҊSe]" ;5$ܢ"ʇ: \*v " * ͶB" t##s#r## w# y}ͯ!6"*" 7C*"* "â *bk~####~ ҷ ڷù#s#rïC *DM~#+##~#foC`i~#fo??2i 2h ;#~=!@}O|G!""y O:h ~ʂ#Y:aJg>2h 2i U%~|*O~#Ym?>HjZEڗ;;>ʸ;>HOZ#þGO TOUBZ!AO ^#V#ZOd#<y(!!!Z.!>dG>Y2i Y%=+ZOiMk֢ύ>2i W„Y>5W>Y{~.ʧ:"0":i ~O.O>Y(ͬ}Y|Y%~.ͬ:g * |>}e. %***************************************************************** * * * Disk format program for Disk Jockey 2D controller. * * 11/16/79 * * * ***************************************************************** title '*** Format Program for CP/M Ver. 2.0 ***' org 100h revnum equ 52 ;Revision # times 10 bdos equ 5 ;CP/M entry point wboot equ 0 origin equ 0F800H DISKIO EQU ORIGIN+3f8h DATREG EQU DISKIO+7 DRVSEL EQU DISKIO+1 CSTALL EQU DISKIO+3 CMDREG EQU DISKIO+4 DSIDE EQU 10Q UNLOADB EQU 17Q WTCMD EQU 364Q SICMD EQU 131Q IMMIRQ EQU 320Q UNLOADA EQU 30Q RESTOR EQU 11Q INDEX EQU 20Q TRKZRO EQU 4 intrqa equ 1 intrqb equ 4 lhsdenb equ 90dh lhddenb equ 80ch lhsdena equ 111h lhddena equ 10h acr equ 0dh alf equ 0ah START lxi sp,stack LHLD ORIGIN+7 ;adjust INX H ; the MOV A,M ; calling LXI H,STDVSL+1 ; routines LXI D,4 ; for MOV M,A ; different XRI 3 ; versions DAD D ; of the MOV M,A ; disk DAD D ; jockey a newsize add a jz findix mov l,a mvi h,0 DAD D MOV C,M INX H MOV B,M LXI H,SLIST CALL OVLAY LXI B,DDLIST LXI H,DLIST CALL OVLAY call model lxi b,lhddena jz loadd lxi b,lhddenb loadd mov a,b call stbits mov a,c call stbits FINDIX CALL INDEXP MVI H,1 TKSTEP mvi a,'*' call pchar LXI D,CMDREG MVI A,SICMD STAX D WSICMS LDAX D RAR JNC WSICMS WSICMD LDAX D RAR JC WSICMD CALL TRACK MOV H,D INR H MVI A,77 CMP H JNZ TKSTEP call unload lxi d,fmessg call pbuff call rbuff cpi 'F' jz crok jmp wboot SENDMP PUSH h ;save second half CALL pbuff ;send first half LDA LETTER ;print the CALL pchar ; letter POP d ;send the second pbuff mvi c,9 jmp bdos rbuff lxi d,inbufx mvi c,10 call bdos lda inbufx+1 ana a mvi a,acr rz lda inbuf cpi 'a' rc cpi 'z'+1 rnc sui 40q ret pchar push h push b push d push psw mov e,a mvi c,2 call bdos pop psw pop d pop b pop h ret inbufx  and data mark WTL9 MVI M,0FBH ;data mark LXI B,0e540H ;data & count OVLS2 EQU $-2 WTL10 MOV M,B ;write first DCR C ; quarter of JNZ WTL10 ; sector data MVI C,40H ;count OVLS3 EQU $-1 WTL11 MOV M,B ;write second DCR C ; quarter of JNZ WTL11 ; sector data MVI C,40H ;count OVLS4 EQU $-1 WTL12 MOV M,B ;write third DCR C ; quarter of JNZ WTL12 ; sector data MVI C,40H ;count OVLS5 EQU $-1 WTL13 MOV M,B ;write fourth DCR C ; quarter of JNZ WTL13 ; sector data MVI M,0F7H ;crc data bytes MVI A,27 ;last sector + 1 OVLS6 EQU $-1 LXI B,4E36H ;count & data OVLS7 EQU $-2 WTL14 MOV M,B ;data DCR C ; postamble JNZ WTL14 ; field CMP E ;last sector test JNZ SLOOP WTL15 MOV M,B ;fill data DCR C ; to index hole JNZ WTL15 WTL16 MOV M,B ;fill data DCR C ; to index hole JNZ WTL16 WTL17 MOV M,B ;fill data DCR C ; to index hole JNZ WTL17 RET OVLAY MOV A,M ;length of list PUSH H ;save list ptr LXI H,WTRACK ;overlay area XTHL ; recoMOV M,A ; controller LXI d,SMESSG ;print the CALL pbuff ; sign on message CROK LXI d,DMESSG ;echo the CR and CALL pbuff ; print drive select CALL rbuff ;wait for response CPI 'N' ; new parameter JZ CROK ; request STA LETTER ;save for exit SUI 'A' ;test for good JP NOTLOW ; drive select INPUTB LXI d,BMESSG ;print the bad CALL pbuff ; input message JMP CROK ; and wait for input NOTLOW CPI 4 ;test for drive JP INPUTB ; select too large STA DRVNO ;save drive no. fmtsiz lxi d,denmsg ;Select the sector size call pbuff call rbuff cpi 'N' jz CROK sui '1' ;Strip off ASCII bias jp sizchk sizerr lxi d,bmessg call pbuff jmp fmtsiz sizchk cpi 4 jnc sizerr sta newsize SENDI LXI d,IMESSG ;send out the LXI h,JMESSG ; diskette insert CALL SENDMP ; message GETIN2 CALL rbuff ;wait for response CPI 'N' ;test for new JZ CROK ; parameter request PROCED lxi d,acralf call pbuff LDA DRVNO ;get the drive no MOdb 10,0 inbuf db 0,0,0,0,0,0,0,0,0,0 STDVSL STA DISKIO+1 RET STBITS STA DISKIO+2 RET GTSTAT LDA DISKIO+2 RET model lda diskio-4 cpi (ret) ret unload call model mvi a,unloada jz stbits mvi a,unloadb jmp stbits gtindx call model mvi b,0 rz mvi b,index ret INDEXP call gtindx windxh call gtstat ANI INDEX xra b JZ windxh windxl call gtstat ani index xra b jnz windxl ret indxw call gtindx jmp windxl TABLE DW L128 DW L256 DW L512 DW L1024 TRACK lda select call stdvsl XRA A STA SIDENO CALL WTRACK call gtstat ANI DSIDE RNZ INR A STA SIDENO LDA SELECT ANI 357Q call stdvsl WIL call indxw XCHG WTRACK LXI D,DATREG ;1791 data reg MVI L,1 ;initialize sector reg LXI B,4e50H ;data & count OVLD1 EQU $-2 MVI A,WTCMD ;issue a write STA CMDREG ; track command XCHG ;adjust the registers WTL1 MOV M,B ;index mark DCR C ; preamble JNZ WTL1 ; field LXI B,0CH ;data & count OVLD2 EQU $-2 WTL2 MOV M,B ver pointer MVI D,0 OVLAY1 INX H ;increment pointer MOV E,M ;get offset XTHL ;exchange pointers DAD D ;add the offset PUSH PSW ;save length count LDAX B ;get replacement data MOV M,A ;do the replacement INX B ;next replacement data POP PSW ;recover length count DCR A ;decrement XTHL ;exchange pointers JNZ OVLAY1 POP H ;adjust stack RET * The lists below represents the distances * between successive locations of the WTRACK * routine that are to be overlaid in order * that the same routine will serve to format * different sized and density diskette * sector formats DLIST DB 18 ;length of list DB OVLD1-WTRACK DB 1 DB OVLD2-OVLD1-1 DB OVLD3-OVLD2 DB 1 DB 1 DB OVLD4-OVLD3-2 DB 1 DB OVLD5-OVLD4-1 DB OVLD6-OVLD5 DB 1 DB 1 DB OVLD7-OVLD6-2 DB 1 DB OVLD8-OVLD7-1 DB OVLD9-OVLD8 DB 1 DB 1 SLIST DB 9 ;list length DB OVLS1-WTRACK DB OVLS2-OVLS1 DB 1 DB OVLS3-OVLS2-1 DB OVLS4-OVLS3 DB OVLS5-OVLS4 DB OVLS6-OVLS5 DB OVLS7-OVLS6 V C,A MVI A,177Q ;drive select bits QLOOP RLC ;rotate select bits DCR C ; to proper drive JP QLOOP ; position ani 3fh STA SELECT ;save for TRACK routine call stdvsl call model lxi b,lhsdena jz prep lxi b,lhsdenb prep mov a,b call stbits mov a,c call stbits lxi h,cmdreg mvi m,immirq mvi a,40h wirqd dcr a jnz wirqd mov a,m rar jc notrdy ral ral jc notrdy lxi d,wmessg ral jc notrdyx LXI D,0 call gtindx IXLOOP call gtstat ani index xra b JNZ dorest DCX D MOV A,D ORA E JNZ IXLOOP NOTRDY LXI d,RMESSG ;not ready message notrdyx xchg LXI d,AMESSG ;drive message CALL SENDMP ;send error message call unload JMP SENDI ;back for more input dorest MVI M,RESTOR wrstrs mov a,m rar jnc wrstrs wrstrd MOV A,M rar jc wrstrd MOV A,M ANI TRKZRO JZ NOTRDY LXI B,SDLIST LXI H,DLIST CALL OVLAY LXI B,L128 LXI H,SLIST CALL OVLAY mvi a,'*' call pchar CALL INDEXP MVI H,0 CALL TRACK LXI D,TABLE ld;index mark DCR C ; zero leader JNZ WTL2 ; field OVLD3 MVI M,0F6H ;special double MVI M,0F6H ; density clock MVI M,0F6H ; and data mark WTL3 MVI M,0FCH ;index mark LXI B,4E32H ;data & count OVLD4 EQU $-2 WTL4 MOV M,B ;sector mark DCR C ; preamble JNZ WTL4 ; field SLOOP LXI B,0CH ;data & count OVLD5 EQU $-2 WTL5 MOV M,B ;sector mark DCR C ; zero leader JNZ WTL5 ; field OVLD6 MVI M,0F5H ;special double MVI M,0F5H ; density clock MVI M,0F5H ; and data mark WTL6 MVI M,0FEH ;sector mark MOV M,D ;track number MVI M,0 ;side number SIDENO EQU $-1 MOV M,E ;sector number MVI M,1 ;sector length OVLS1 EQU $-1 MVI M,0F7H ;crc data bytes INR E ;increment sector LXI B,4E16H ;data & count OVLD7 EQU $-2 WTL7 MOV M,B ;sector mark DCR C ; postamble JNZ WTL7 ; field LXI B,0CH ;data & count OVLD8 EQU $-2 WTL8 MOV M,B ;data mark DCR C ; zero leader JNZ WTL8 ; field OVLD9 MVI M,0F5H ;special double MVI M,0F5H ; density clock MVI M,0F5H ;& DB 1 * Overlay data for single density * formatted diskettes SDLIST DW 0FF28H DB 6 JMP WTL3 DW 0FF1AH DB 6 JMP WTL6 DW 0FF0BH DB 6 JMP WTL9 * Overlay data for double density * formatted diskettes DDLIST DW 4E50H DB 0CH MVI M,0F6H DB 36H DW 4E32H DB 0CH MVI M,0F5H DB 36H DW 4E16H DB 0CH MVI M,0F5H DB 36H * Overlay data for single density * 26 sectors/track 128 byte sectors L128 DB 0 DW 0e520H DB 20H DB 20H DB 20H DB 27 DW 0FF1BH * Overlay data for double density * 26 sectors/track 256 byte sectors L256 DB 1 DW 0e540H DB 40H DB 40H DB 40H DB 27 DW 4E36H * Overlay data for double density * 15 sectors/track 512 byte sectors L512 DB 2 DW 0e580H DB 80H DB 80H DB 80H DB 16 DW 4E6AH * Overlay data for double density * 8 sectors/track 1024 byte sectors L1024 DB 3 DW 0e500H DB 0 DB 0 DB 0 DB 9 DW 4E74H AMESSG db acr,alf db 'Drive $' RMESSG db ' Is Not Ready.$' WMESSG db ' Is Write Prto restart.$ Insert a Write Enabled Diskette in Drive $ Close the Drive Door and then Press RETURN: $ Function Complete. Type RETURN to return to CP/M, or F to Format another: $ Select a sector size: 1) 128 Byte Single density. 2) 256 Byte Double density. 3) 512 Byte Double Density. 4) 1024 Byte Double Density. Sector Size: $ $! _!A!_.!!!/!: -!<-!> >2 { =! ! <~J!#~#X! k*l!~#>l!+!:G@ #T]~u!#y!~v!ʏ!y_¢!: >2 ÷![®!2 !: >2 !> XG{!~#_XG!!2 E0:?+͎ " o6 r6*n )1:l O " H*">&{:m ;"!;"#~ ̾(~#m":m A" ^".h"Dh"EA"A"{v"*j 5$Ҕ"T]C!E #G!* C¦"`i" "\]~"\]C,u "z)d: E()È% PX/#,#BK/#C,/#C,( z`iC[# !C^#Vzn#~#+K#͑#^#Vzʌ##s#r u# 2 *+#~##^#Vʚ#O: y$#¦#¦#3z##£#3 > %$B!$#G11+ã#Undefined line #3###N#F>!#*j +p+q+w: Ò#CBCACSCE: * * C ~0  2 <2 ~̓$#y$\Aʔ$z)ð$!$#G KD#~.~•$z)"j87Random number seed (-32768 to 32767)$*" +%%$otected.$' BMESSG db acr,alf db 'Improper Response.$' DMESSG db acr,alf db 'Select Drive (A,B,C,or D): $' SMESSG db 'Disk Jockey 2D Disk Format program' db ' Revision ' db '0'+revnum/10,'.','0'+(revnum mod 10) db acr,alf db 'Type "^C" to return to CP/M, "N" to restart.$' IMESSG db acr,alf db 'Insert a Write Enabled Diskette in Drive $' JMESSG db acr,alf db 'Close the Drive Door and then Press RETURN: $' FMESSG db acr,alf db 'Function Complete.' db acr,alf db 'Type RETURN to return to CP/M, or F to Format another: $' denmsg db acr,alf db 'Select a sector size:' db acr,alf db ' 1) 128 Byte Single density.' db acr,alf db ' 2) 256 Byte Double density.' db acr,alf db ' 3) 512 Byte Double Density.' db acr,alf db ' 4) 1024 Byte Double Density.' db acr,alf db 'Sector Size: $' acralf db acr,alf,'$' letter db 0 drvno db 0 select db 0 newsize db 0 ds 50 stack equ $ end , ~,B>2 d: =Bd̨H+~,ʿ+N6,E* 2 QC,͋9~,c: 2 TF—Qd¢WG"ʌ: Wʉ:,+FO: y!...+ʽ,G+M: C#~# #^#V" cCC(+B͓2 " * ~" ڎ_4:g {[H !xVzʬQںzʺ! :g  N#F#N#F! N#F#N#FKG* W " Ð)͙(6Çz)uÇxdd!BdX* \FÇy2h :g g+Wx(zOxdz o! N#F* *(" " ͩ( *!:h og~#fox(2g 6" ;)!A͙(*ʹ(" " i*͙(*g' .EJ ]<=ʓ<"FO&i:* ,C(#r PQ͉:C)|)IoBI'UTC)}* k(͋9" d(~a{_&([OʭH¬#~[Eҗ:0ÞG7))))o~ +8  )))0O í)#~ց(7>OyC,;*%#~#Y #^#V" y~.%$$$$$%** "͋9+%c%C,+8%": 2 2 ! 6ͷ(È%ͷ(t(x: ʩ(Ң%/<͙(ͩ((gb&|! %B&#ʈ0.͉&#&G~_#~W#~ON&hcGy&JTeox%2 |&y%O&)zWyO%x\E#&! w%%x! 5&F#~怩Oé( 4Ç0~_#~W#~O! ~/woG}_}W}Oq&CZQd& oz…&y-O{&Ë&-yOzW{_xGÅ&$cCu͍M r5E(&1r'ʹ(>2 ͙(!&ͧ7͙(ͩ(!&ͧ7i'͙(T(È%E(.(y2<'"7'PX!%!%'! ~#Y'Wy='O|g}oxGQ'x Gz/'CZQO͙(!-ͦ(E(ʐ0.(4g04g0+~2'+~2'+~2'AOW_2'}o|gxG>?ұ'2'7y<=':'x'> $&{_zWyO)xG:'2'y”'! 5”'%>.! N#G.x'(}! Gx&(ƀwW'(w+E(/%g0ʹ(xڀ0G͈%! 4À0: : /<! Op#6%͆(d+ ! ~w͆(og)d E(* ||O(* * ͷ(" `i" ! ^#V#N#F# (:g Gw#(! ~7w?##wy7O! ((! ( d1*#~!www͎͎͓N2hA:{͎12i͎͓N1^{͎BU2k !8͓̓Ne͎:iO> ?2jʜ xy!6>@=«~fzWN̓f6 ~~~!*!>*ͮ& :kJo&N#F!!B xy&>*ͮ>YZ_b$>MOg͎͓F͎:hͮ  :> :a{ _ 22::>>*3<E:j2u8<2u:j.PN>2p F p N66662Np ^ p f6666r6s66Np  p ‡6666@p —@p ž@p ¥@p ¬6>6Np ¸cp p p ~!8#^ w=  @ (Yq ÒPN 662N 66N 66 @@@@6N倀jN tN Drive $ Is Not Ready.$ Is Write Protected.$ Improper Response.$ Select Drive (A,B,C,or D): $Disk Jockey 2D Disk Format program Revision 5.2 Type "^C" to return to CP/M, "N" * u )4} )H>2  N#fi-++<(aZz)}/o|/g" :g q7xz)z ,{ʨ+F•{o|P {o|<«{o|2¸{/o|/}//o|//}o|g,::e 2 ͋9:g " " ͬB!9(:g * ~)C,* C,Á2N 2g !9(!9.,:g G:N Od}!P O:* * C)>" : OBO/2 OÐ9~ #~#`J x 2b b + C,u W : u 2_H 2u 2_H 2H /<z)zu 2 2 C,u Y +{>2e]!"N#F#xʇ TFQBN#F#Cچ " 1~ > @ !b !BÑ ~ͥB# b 2 e] #~ ' xE(!N(E(y! y )#x+y+z+{z|O(@)}P(! ( E(!N(E(O! y#)+f)I)N(d* )(! 6(&,)Ü)y%: 2 : B*: ½)))|/g}/o)! : )B*" >2g )aj)d* ʹ(6*x(! F#&* 6*|UY(d *!" " >>)d GOW_ʹ((gf*>b&|5&N&z< dE(*t(̀*k(dҦ* )! ~: ~B*6{y%! ~*O+~+¶*!*) *yʹ((+6+q*: O! >%-,2 Ñ,! ~5#*!x"+>);)+ ;=+|G+y4+|G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~UͱW)9V6Qʦ !&QV! ~+n6Qʦ ! ~*~Ee\DM'~U4N#V pʝVzw w+s#r#6#6DM:V!" s#r#6 W! {zVWw<W<ʻ !! {w:W}W!! ~!) ;WU;W~#>W*~ʖ\( ~hW+~#5O ~+~tWzWJW7>*T]% N#F+q#p###6 ’WͱW: ͞Z>ªW>w+w!(HW7?*' 6#67ͥH~ʲ #^#fk_XN#~:X++@bXy@bXbX #RX~.0X>X7X#X2 z bXbX> >X7X> WX7Xò W<ʣ ! w#…XCACSW:!<¾ ͥH~ʠ #N#F OXIXR  C,#u C,{ʦ _***************************************************************** * * * Low Level Hard Disk Drivers. The following routines are the * * lowest level drivers for the hard disk. * * * * Written By Bobby Dale Gifford. * * 12/8/80 * * * ***************************************************************** hdrev equ 13 ;Revision number maxhd equ 4 ;Maximum # of Hard Disk Drives mrev equ 20 ;Set to the type of hard disk (10, 20, 26) hdorg equ 50h ;Hard Disk Controller origin hdstat equ hdorg ;Hard Disk Status hdcntl equ hdorg ;Hard Disk Control hddata equ hdorg+3 ;Hard Disk Data hdfunc equ hdorg+2 ;Hard Disk Function hdcmnd equ hdorg+1 ;Hard Disk Command hdreslt equ hdorg+1 ;Hard Disk Result retry equ 2 ;Retry bit of result tkzero equ 1 ;Track zero bit of status opdone equ 2 ;Operaction done bit of status complt equ 4 ;Complete bit of status tmout equ 8 ;Time out bit of status wfault equ 10h ;Write fault bit of status drvrdy equ 20h ;Drive re(""  B!9 +" _MC(͋9s#r#~,=M #MC)" >!=_M=_M=_M!9DM!jM* * * à2 2 ~‡M2 #+͔R!" +NC,,ʸM"" +NC,MCACLCLNOC, 2 5$`i" NT]" CNO**+#~#N#^#V"N:N2 ͉:ʢNxG͒;>2 hN~(nNþN~(͉:zNxGN::g W):zBK!N N 2 ~(nN ͖N+"N(NC)"NC,BN"* * C#ON##~w#͚< NO* " N* C Oy_xW `i" * CNO##~w#͚2 : mS:2ùR2 2 * DM* " * #* " CNP `i" * *+zʠ `ià Q+PdP)1F* #^#V ªPr+s+5&G+P;ʿPC,+>,@ÇP>"@&G>"@íP*|Q~Q\}o|gQ> @+|9Q¯ WzZ" 1Y{1Y!~ 1Y6B#6A#6Sz"# w# >YwwͱWoY<ʻ ÅY<…Y£ cY!%w#w#w#w~ʨYCzW* ) p# ®YC T T _W<Yʣ Z!6# ͖ZW2 !͒Z!͒Zʣ O!  ~#@ygZ~ dZ>.@ QZ:e W:ڀZ> @@!BAZ~*6?# –ZO!!4¶Z#4¶Z#4y"Zʻ ><+Z* C! s#r#wZ2u]*Q  ! ^#V~,+ zʵ +s#r! w#w! ~#fo!CT[Ò[BK>!)g[)#h[))v[ u[#=][}_}la)ҍ[#x"o]! "q]!) "s]!}o|gCڼ[bk:u]\C[ \DM*s]*q]X\"q]PY\*o]#"o]}o|g|Ÿ[ \DM*q]*s]X\"q]PY[2*o]! ~#foCs#rG\:T\!T\!& äV~# xY\DM\ʓ\͹\! w!( V6 ʎ\zwø \ʓ\͹\! ~!ô\! ^#V! s#rDMͱ\ͫ\C" ͒#\>;S"]C ** C!X9}o|gady bit of status index equ 40h ;Index bit of status pstep equ 4 ;Step bit of function nstep equ 0fbh ;Step bit mask of function hdrlen equ 4 ;Sector header length seclen equ 512 ;Sector data length wenabl equ 0fh ;Write enable wreset equ 0bh ;Write reset of function scenbl equ 5 ;Controller control dskclk equ 7 ;Disk clock for control mdir equ 0f7h ;Direction mask for function null equ 0fch ;Null command idbuff equ 0 ;Initialize data command isbuff equ 8 ;Initialize header command rsect equ 1 ;Read sector command wsect equ 5 ;Write sector command if mrev ne 26 seccnt equ 21 ;21 sectors per track for M10 and M20 else seccnt equ 32 ;32 for M26 endif org 100h lxi sp,stack mvi c,0 call setdrv call home lxi b,bxx call setdma loop mvi c,0 call settrk mvi c,0 call sethead mvi c,1 call setsec mvi c,80h call setkey call hdread nop mvi c,200 call settrk mvi c,0 call sethead mvi c,1 call setsec mvi c,0 call setkey call hdreadP!B#*QѻQ  C,PY"+#x _:ڦ !N#F :Q!)^Q! >>>ͬ͹F* (H>>>ͥH<2g #~#fo(d ,»QZûQ Q͋9;*W_Wڬ Q¾Q"QG{,xQPXW1R!b Oz"yR QR RO{,yĊRW1R R{ +R,> +R+R1R1R͊RWQ"hV* *CMS~#hVSV:SS=S~,~#u SůSѯ*Qʦ   ! ~#fo" !"o]| G~,r CACS͋9;*O*o] "o]* Cڸ q#s#r9T7͋9;*ͥHF~O#^#VT*CT* CTY* * CUy2!^" :^^<2^!~" ^F#~+w##D^+6" !^/x^+6"" #/x^i^^6ZS^Mʐ^F C:dʯ^z{2ô^"v +^C/}^C:d" ô^+*v +"v +:!]"2<s#r# *  DM=^#"" {ozgB|g}o_|0_!{ozgB"v "" " *B}o|g++!_#G1!_#G!#G" !B! v] Owned by Microsoft Bytes freeBASIC-80 Rev. 5.21 [CP/M Version] Copyright 1977-1981 (C) by Microsoft Created: 28-Jul-81 ) nop jmp loop bxx ds 512 ds 50 stack equ $ setdrv jmp hddrv ;Select disk home jmp hdhome ;Recalibrate settrk jmp hdtrk ;Seek to specified track setsec jmp hdsec ;Prep for sector # setdma jmp hddma ;Prep for DMA address sethead jmp hdhead ;Set head # setkey jmp hdkey ;Set the key in next transfer read jmp hdread ;Read one sector write jmp hdwrite ;Write one sector dmastat jmp dmahd ;Return DMA address getstat jmp stathd ;Get drive status hddrv mvi a,3 ana c sta hddisk ori null ;Select drive out hdfunc mvi a,scenbl ;Enable the controller out hdcntl mvi c,239 ;Wait for Disk to ready ; 2 minutes for M26 ; 30 seconds for M10 & M20 lxi h,0 tdelay dcx h mov a,h ora l cz dcrc stc rz in hdstat ;Test if ready yet ani drvrdy jnz tdelay if mrev ne 20 ;M20 will do settle delay in hardware lhld settle mov a,h ora l rz lxi h,0 ;Time one revolution of the drive mvi c,index in hdstat ana c mov b,a ;Save current indadd ret wsdone in hdstat ;Wait for seek complete to finish ani complt jz wsdone lxi h,drives-1 ;Update all seek in progress flags mvi b,maxhd+1 wsup inx h inx h dcr b rz mov a,m ani 1 mov m,a jmp wsup hdsec xra a ora c stc rz mvi a,seccnt sub c rc mov a,c sta hdsectr ret hdhead mov a,c ani 7 ; 7 for M26 & M20, 3 for M10 sta head ret hdread call hdprep rc xra a out hdcmnd cma out hddata out hddata mvi a,rsect ;Read sector command out hdcmnd call process rc xra a out hdcmnd mvi b,seclen/4 lxi h,0 hdadd equ $-2 in hddata in hddata rtloop in hddata ;Move four bytes mov m,a inx h in hddata mov m,a inx h in hddata mov m,a inx h in hddata mov m,a inx h dcr b jnz rtloop ret hdwrite call hdprep ;Prepare header rc xra a out hdcmnd lhld hdadd mvi b,seclen/4 wtloop mov a,m ;Move 4 bytes out hddata inx h mov a,m out hddata inx h mov a,m out hddata inx h mov a,m ***************************************************************** * Diablo 1610 simulator for the Morrow Designs / Thinker Toys * * Mult I/O board. The simulator makes the parallel Hityp II * * look like a serial 1610. * * This interface is designed to work with the INSTALL.COM * * program which is available from Morrow Designs / Thinker * * Toys. For an explanation of how this works consult the * * INSTALL documentation. * * Bobby Dale Gifford. * * Revised 6/25/81 dmg * ***************************************************************** int equ 1 ; 1 for conditional assembly of interrupt driven code. ***************************************************************** * Special character equates. * ***************************************************************** acr equ 0dh ;Carriage Return alf equ 0ah ;Line feed aetx equ 3 ;ETX character aack equ 6 ;ACK character aesc equ 1bh ;Escape character abs equ 8 ;Back Space aht equ 9 ;Horizontal tab aff equ 0ch ;ex level in B indx1 in hdstat ana c cmp b ;Loop util index level changes jz indx1 indx2 inx h in hdstat ;Start counting until index returns to ana c ; previous state cmp b jnz indx2 shld settle ;Save the Count for timeout delay endif ret dcrc dcr c ;Conditional decrement C routine ret hdkey mov a,c sta nkey ret hdhome call drvptr mvi m,0 ;Set track to zero inx h ;Point to seek flag mvi m,1 ;Set not seeking, but must delay stepo in hdstat ;Test status ani tkzero ;At track zero ? rz if mrev ne 20 mvi a,1 stc call accok ;Take one step out call wsdone ;Wait for previous seek to finish jmp stepo else xra a ;Make (a) into zero will do 255 steps stc ;and on an m20 this will do a recalibrate jmp accok endif delay equ $ if mrev ne 20 lxi h,0 ;Get delay settle equ $-2 deloop dcx h ;Wait 20ms mov a,h ora l inx h dcx h jnz deloop endif lxi h,drives-1 mvi b,maxhd+1 delup inx h inx h dcr b rz movout hddata inx h dcr b jnz wtloop mvi a,wsect ;Issue write sector command out hdcmnd call process rc mvi a,wfault ana b stc rz xra a ret process in hdstat ;Wait for command to finish mov b,a ani opdone jz process mvi a,dskclk out hdcntl in hdstat ani tmout ;Timed out ? stc rnz in hdreslt ani retry ;Any retries ? stc rnz xra a ret hdprep in hdstat ani drvrdy stc rnz mvi a,isbuff ;Initialize pointer out hdcmnd call build ori 0ch out hdfunc lda head out hddata ;Form head byte call drvptr mov a,m ;Form track byte out hddata mvi a,0 ;Form sector byte hdsectr equ $-1 out hddata mvi a,0 nkey equ $-1 out hddata inx h ;Bump to seek flag mov a,m inr a ;Update the seek in progress flag push h cz wsdone pop h mov a,m dcr a ;Test for delay also cz delay mvi a,dskclk out hdcntl mvi a,wenabl out hdcntl xra a ret drvptr lhld hddisk xchg mvi d,0 lxi h,drives dad d dad d ret Form Feed abel equ 7 ;Bell asp equ 20h ;Space anul equ 0 ;Null adel equ 7fh ;Delete ars equ 1eh ;RS character aus equ 1fh ;US character avt equ 0bh ;Vertical tab ***************************************************************** * The following equates are for the Mult I/O board. * ***************************************************************** grp equ 7 ;Group select port offset clk equ 2 ;WB14 printer select port pic0 equ 4 ;Interrupt controller port 0 pic1 equ 5 ;Interrupt controller port 1 daisy0 equ 0 ;Daisy wheel port 0 daisy1 equ 1 ;Daisy wheel port 1 imask equ 40h ;Interrupt enable mask d4 equ 10h ;8259 data bit 4 ltim equ 8 ;Level triggered interrupt mode addi equ 4 ;Address interval sngl equ 2 ;Single 8259 eoi6 equ 66h ;End of interrupt 6 rstbit equ 080h ;Restore Bit data11 equ 4 ;Data bits on daisy port data12 equ 8 data910 equ 3 crstrd equ 1020h ;Carriage ready pfstrd equ 810h ;Paper feed ready pwstrd equ 2040h ;Print wheel ready cp a,m dcr a jnz delup mov m,a jmp delup hdtrk call drvptr ;Get pointer to current track mov e,m ;Get current track push h ;Save pointer to current track inr e ;Ever homed this drive ? cz hdhome pop h ;Restore track pointer mov e,m ;Get current track mov m,c ;Update the track mov a,e ;Need to seek at all ? sub c rz push psw ;Save # of steps inx h ;Point to the seek complete flag mov a,m ;Get current seek progress flag inr a ;Currently seeking ? push h ;Save seek flag pointer cz wsdone ;Wait if currently seeking pop h mvi m,0ffh ;Set seek in progress flag pop psw cmc ;Get carry into direction jc accok cma inr a accok mov b,a ;Prep for build call build sloop ani nstep ;Get step pulse low out hdfunc ;Output low step line ori pstep ;Set step line high out hdfunc ;Output high step line dcr b ;Update repeat count jnz sloop ;Keep going the required # of tracks ret hddma mov h,b ;Save the DMA address mov l,c shld hd build mvi a,0 head equ $-1 ral ral ral ral ori 0 hddisk equ $-1 xri 0f0h ret dmahd push h lhld hdadd mov b,h mov c,l pop h ret stathd in hdreslt ani 3 mov b,a in hdstat xri 31h ret drives dw 0ffffh dw 0ffffh dw 0ffffh dw 0ffffh end *eri equ 10 ;Default to 10 characters per inch lperi equ 6 ;Default lines per inch hinc equ 120 ;Horizontal increments per inch vinc equ 48 ;Vertical increments per inch numtabs equ 160 ;Number of horizontal tabs maxchrs equ 1024 ;Maximum number of printer characters to queue maxrgt equ 1584 ;Maximum carriage position ***************************************************************** * Below is a standard CP/M Cbios jump table as required by * * INSTALL. * ***************************************************************** jmp $ ;No change in the cold boot owboot: jmp nwboot ;New warm boot routine oconst: if int jmp nconst ;New console status else jmp $ ;No change endif oconin: if int jmp nconin ;New console input else jmp $ ;No change endif jmp $ ;No change in the console output olist: jmp nlist ;New list device output jmp $ ;No change in the punch device output jmp $ ;No change in the reader device output jmp $ ;No change in the homSet by platen motion hpos: dw 0 ;Horizontal position. Set by carriage motion dlhpos: dw 0 ;Delta hpos. Set by carriage motion lmar: dw 0 ;Left margin dirflg: db 0 ;Direction flag grhflg: db 0 ;Graphics mode flag escflg: db 0 ;Escape sequence in progress flag scstuf dw 80h ;Scan buffer data tabstp: ds numtabs ;Tab stops array ds 30 ;Stack space stack equ $ if int queue: ds maxchrs ;Circular Queue of printer characters quetop: dw queue ;Queue top pointer quebot: dw queue ;Queue bottom pointer hlsave: dw 0 ;Used by interrupt routine afsave: db 0 ;Used by interrupt routine hndflg: db 0 ;Handshake in progress flag etxflg: db 0 ;Used for ETX/ACK handshake ackxon: db 2 ;Default handshake is XON/XOFF ; Can be changed with -Hx. ; Possible handshakes are: ; 0 = none ; 1 = ETX/ACK ; 2 = XON/XOFF ; 3 = ETX/ACK through console * * The following data only needs to be included if the 8259 * has not been initialized. * dw 0,0,0,0 dw 0s jz nogd ;No digits call ok09 ;Check for 0-9 jc nogd add a ;Multiply by 10 mov b,a add a add a add b mov b,a call scan ;Get next character jz nogd ;No character call ok09 ;Check if 0-9 jc nogd ;No good add b ;Add into result mov l,a mvi h,0 ;Make it a 16 bit number ret nogd: stc ;Error return ret newc: call scan ;Change the default characters per inch rz cpi '1' ;Must be 10 or 12 jnz zret call scan rz ;Only one character cpi '0' mvi l,10 ;It was ten jz newcok cpi '2' mvi l,12 ;It was 12 jnz zret newcok: mvi h,0 ;Make 16 bit integer shld dspace jmp zret newl: call gettwo ;New lines per inch jc zret ;Error reading digits shld dlines jmp zret newa: call scan ;New auto line feed cpi '1' ;Must be 0 or 1 jz newaok cpi '0' jnz zret newaok: sui '0' ;Set the auto flag sta autolf jmp zret okhex: call ok09 ;Check first if 0-9 rnc ;Yes okaf: cpi 'A' ;Check if less than 'A' rc cpi 'F'+1 ;Chece routine osel: if int jmp nsel ;New seldsk routine else jmp $ ;No change endif jmp $ ;No change in the settrk jmp $ ;No change in the setsec jmp $ ;No change in the setdma ord: if int jmp nrd ;New read else jmp $ ;No change endif owr: if int jmp nwr ;New write else jmp $ ;No change endif olstst: jmp nlstst ;New list device status jmp $ ;No change in the sectran ***************************************************************** * The following routines are for handshaking with the printer * * they can be used directly or by the CBIOS of CP/M. * ***************************************************************** nop ;Marker rest: jmp restor ;Initialization procedure if int lst: jmp lstdev ;Printer character output ; character in reg C hndxof: jmp xonoff ;Printer busy test XON/XOFF ; returns with: ; A = 1 queue full ; A = 0 queue not full or empty ; A = 0ffh queue empty hndetx: jmp etxack ;ETX and AC,0,0,0 dw 0,0,0,0 dw 0,0,0,0 table: jmp noint ;No interrupt db 0 jmp noint db 0 jmp noint db 0 jmp noint db 0 jmp noint db 0 jmp noint db 0 jmp pwint db 0 jmp noint db 0 endif ***************************************************************** * New Boot routine, examine the command line put at 80H by * * install. * ***************************************************************** nwboot: mvi a,1 ;Is this a second warm boot ? wbflg equ $-1 ana a mvi a,0 ;Reset the warm boot flag sta wbflg jz owboot ;Don't reset if second warm boot jmp skpdsh cloop: call scan jz nomore cpi '-' ;Check for flag jnz cloop skpdsh: call scan jz nomore if int cpi 'H' ;New handshake routine -Hx cz newh endif cpi 'B' ;New I/O base -Bxx cz newb cpi 'F' ;New forms length -Fxx cz newf cpi 'C' ;New characters per inch -Cxx cz newc cpi 'L' ;New lines per inch -Lxx cz newl cpi 'A' ;New auto line feed -Ax cz newa jmp cloop k if greater than 'F' cmc rc sui 'A'+10 ;Make into binary ret ok09: cpi '0' ;Check for 0-9 rc ;Less than '0' cpi '9'+1 ;Check if greater than '9' cmc rc sui '0' ;Turn into binary ret ***************************************************************** * New select disk routine, disable interrupts. * ***************************************************************** if int nsel: di call osel ;Execute old disk select ei ret nrd: di ;Execute old disk read call ord ei ret nwr: di call owr ;Execute old disk write ei ret ***************************************************************** * New console status routine, used with ETX/ACK handshake. * ***************************************************************** nconst: lda ackxon cpi 3 jnz oconst call oconst ;Check old console status ana a rnz jmp hndetx ;Check ETX handshake ***************************************************************** * New console input routine, used K software handshake ; returns with: ; A = 0 No ACK to transmit ; A = 0ffh ACK transmitted endif ***************************************************************** * Dynamic data locations used by the simulator. * ***************************************************************** ; (made for electric pencil) base: db 48h ;Default Mult I/O board base address ; Can be changed with -bxx. dfrmln: dw 110 ;Default forms length 10 times the forms ; length switch. Can be changed ; with -fxx. dspace: dw cperi ;Default characters per inch. ; Can be changed with -cxx. dlines: dw lperi ;Default lines per inch. ; Can be changed with -lxx. autolf: db 0 ;Default to no Auto line feed. ; Can be changed with -ax. hmi: dw 0 ;Horizontal motion index. Set by RESTORE ; and escape sequences. vmi: dw 0 ;Vertical motion index. Set by RESTORE ; and escape sequences. vpos: dw 0 ;Vertical position. Set by platen motion dlvpos: dw 0 ;Delta vpos.  nomore: call rest ;Reset the printer jmp owboot ;Go to the warm boot scan: push h ;Return the next character in the command lhld scstuf ;Pointer to next char mov a,m ;Get next char ana a ;Test error return jz noupdt ;No update inx h ;Update pointer shld scstuf ;Save new pointer noupdt: pop h ;Restore registers ret if int newh: call scan ;End of command ? rz cpi '1' jc zret ;Invalid ? cpi '3'+1 jnc zret sui '0' sta ackxon ;Set new handshake option endif zret: mvi a,0 ret newb: call scan ;End of command ? rz call okhex ;Valid hex character ? jc zret ral ! ral ! ral ! ral mov b,a call scan rz call okhex ;Valid hex character ? jc zret ora b mov b,a ani 7 ;Check if divisible by 8 jnz zret mov a,b sta base ;New I/O base jmp zret newf: call gettwo ;New default forms length jc zret lxi d,10 ;Set to ten times the forms length call hltde shld dfrmln jmp zret gettwo: call scan ;Get two decimal digit+with ETX/ACK handshake. * ***************************************************************** nconin: lda ackxon ;Determine the type of handshake cpi 3 jnz oconin ;None, do old conin call oconst ana a jnz oconin call hndetx ana a mvi a,aack jz nconin ret endif ***************************************************************** * List is the New list device output. As implemented, it uses * * an XON/XOFF or ETX/ACK protocal. * ***************************************************************** nlist: if not int jmp diablo else lda ackxon dcr a jm lst dcr a jm lstetx dcr a jm lstxon jmp lst lstetx: push b ;Save the character call lst ;Print the character pop b mov a,c ;Check if it was a carriage return cpi acr rnz mvi c,aetx ;Send an ETX call lst wetx: call hndetx ;Check if ACK ana a rnz jmp wetx lstxon: push b ;Save char to print call hndxof ;Check XOFF cpi 1 ;Is it full ? cz wxoff pop b ;Recover char to pharacters in the printer queue. characters * * are removed from the queue by the print wheel interrupt * * service routine. * ***************************************************************** if int lstdev: di ;Disabled while manipulating queue lhld quebot ;Get pointer to next slot mov m,c ;Insert the character inx h ;Point to next slot shld quebot lxi d,queue+maxchrs ;Address of first byte beyond queue call hlcde ;Compare HL with DE jnz lstdon ;No match, don't wrap around lxi h,queue ;First address in queue shld quebot lstdon: call group0 lda base adi pic1 ;8259 mask register call input ;Get current mask contents ani 0ffh-imask ;Turn on print wheel interrupt mov b,a lda base adi pic1 call output ei ret endif ***************************************************************** * Restore routine. Restore should be executed to reset the * * printer into a known state, and initialize all the ram * * dynamic data locations. * ********************************************* notabs: lxi h,tabstp ;Beginning of tab stop array lxi d,numtabs ;Number of tab stops notblp: mvi m,0 ;Reset the tab inx h ;Next tab stop dcx d ;Update repeat count mov a,e ;Test for zero ora d jnz notblp ;Continue zeroing ret ***************************************************************** * Noint should never be executed. If it is then just die. * ***************************************************************** if int noint: jmp noint ;Die in jump self endif ***************************************************************** * Pwint is the interrupt service routine for the Hityp II. * * Remember: interrupts are disabled. * ***************************************************************** pwint: if int sta afsave ;Save the acumulator shld hlsave ;Save HL ral ;Get the carry into register A lxi h,0 dad sp ;Get the Stack pointer lxi sp,stack ;Set up new stack push h ;Save old stack pointer rint jmp lst wxoff: call hndxof ;Check XON cpi 0ffh jnz wxoff ret endif ***************************************************************** * New list device status routine. Returns 0ffh if the printer * * can except another character, otherwise it returns 0. * ***************************************************************** nlstst: if not int call group0 lxi d,pwstrd lda base call input ana d mvi a,0 rz cma ret else call hndxof ;Check # of characters in queue cpi 1 mvi a,0 rz ;Can not except another char cma ret ***************************************************************** * Xonoff status. Checks if there are any characters in the * * printers character queue. Returns with reg A = 1 if the * * character queue is within 10 characters of being full, or * * returns with reg A = 0ffh if the character queue is within * * 10 characters from being empty, otherwise returns 0. * * This can be used to implement the XON and XOFF protocal. * * Restore assumes that the 8259 interrupt controller on the * * Mult I/O board has already been initialized. * ***************************************************************** restor: if int di ;No interrupts lxi d,table lxi h,table mov a,l ani 0e0h ;Form 32 byte boundry mov l,a push h mvi c,32 sloop: ldax d mov m,a inx h inx d dcr c jnz sloop pop h call group0 mov a,l ori d4+ltim+addi+sngl mov b,a lda base adi pic0 call output mov b,h lda base adi pic1 call output mvi b,0ffh lda base adi pic1 call output * * End of 8259 initialization * endif select: call group0 lda base adi clk mvi b,80h ;Set select line active. call output lda base ;Get base I/O port mvi b,0ffh-rstbit ;Low bit on restore, others high call output ;Output data in register B lda base ;Base I/O port mvi b,-1 ;Output Restore bit high call output ;Output data in register B lhld dspace ;Characters per inch xchg ;DE = charactrar ;Restore the carry lda afsave ;Get original contents of acumulator push psw ;Save acc lhld hlsave ;Get original contents of HL push h ;Save HL push b ;Save BC push d ;Save DE call group0 ;Select group 0 lhld quebot ;Get bottom of queue xchg lhld quetop ;Get top of queue call hlcde ;Is there anything in the queue ? jz empty ;No, queue is empty mov c,m ;Get the next character inx h ;Bump queue pointer shld quetop ;Save the adjusted queue top lxi d,queue+maxchrs ;Address of byte past queue call hlcde ;Need to wrap ? jnz pwdon lxi h,queue ;Adjust queue top shld quetop pwdon: call diablo ;Process the character intret: call group0 mvi b,eoi6 ;End of interrupt service routine lda base adi pic0 call output pop d ;Restore DE pop b ;Restore BC pop h ;Get original HL pop psw ;Restore PSW shld hlsave ;Save HL pop h ;Get original SP sphl ;Restore original SP lhld hlsave ;Restore HL ei ;Turn interrupts back on ret  ***************************************************************** xonoff: call quesiz ;Get number of characters in queue xchg lxi h,maxchrs-10 call hlcde mvi a,1 rc lxi h,10 call hlcde mvi a,0 rc cma ret ***************************************************************** * ETX/ACK handshake routine. * ***************************************************************** etxack: di lda etxflg mov b,a xra a sta etxflg ei mov a,b ret ***************************************************************** * Quesiz returns the number of characters in the queue in HL. * ***************************************************************** quesiz: di lhld quetop ;Get pointer to top of queue xchg lhld quebot ;Get pointer to bottom of queue ei call hlcde ;Compare HL with DE jnc hlmde ;Subtract DE from HL xchg call hlmde xchg lxi h,maxchrs jmp hlmde endif ***************************************************************** * Lstdev just puts cers per inch lxi h,hinc ;HL = maximum increments per inch call hldde ;Divide Hl by DE shld hmi ;Save hmi = 120/(characters per inch) lhld dlines ;Lines per inch xchg ;DE = lines per inch lxi h,vinc ;HL = MAximum increments per inch call hldde ;Divide HL by DE shld vmi ;Save vmi = 48/(lines per inch) lxi h,0 ;Other variables default to zero shld vpos shld dlvpos shld hpos shld dlhpos shld lmar xra a sta dirflg sta grhflg if int sta escflg sta hndflg lxi h,queue ;Zero the command queue shld quetop shld quebot mvi b,eoi6 ;Specific end of interrupt 6 lda base adi pic0 call output lda base ;Get the interrupt mask bits adi pic1 call input ani 0ffh-imask ;Enable the daisy port interrupt mov b,a lda base adi pic1 call output ;Output the daisy port interrupt mask low ei ;Ok for interrupts now endif ***************************************************************** * Clear all tab stops. * ********************, ;Go back ***************************************************************** * Empty turns off the print wheel interrupt mask bit if the * * character queue is empty when an interrupt occurs. * ***************************************************************** empty: call paper ;Print any remaining motion call carrg call group0 lda base ;Base of Mult I/O adi pic1 ;Get the interrupt mask register call input ;Read the current mask ori imask ;Turn on the bit mov b,a ;Data into B lda base ;Put the mask back adi pic1 call output jmp intret ret endif ***************************************************************** * Diablo does all of the character decoding, escape sequences * * forward, backward, etc. The list of escape sequences, and * * special characters recognized is: * * adel ignored * * anul ignored * * aack ignored (when received) * * abel ignored * * aff form feed * * aetx etx/ack handshake * * aht horizontal tab * *  byte character to match * * 2 bytes of address to execute * * terminated by a first byte of 0. * ***************************************************************** level0: db aesc dw doaesc ;Beginning of an escape sequence db aff dw doaff ;Form feed db aetx dw doaetx db aht dw doaht ;horizontal tab db alf dw doalf ;Line feed db asp dw doasp ;Space db abs dw doabs ;Back space db acr dw doacr ;Carriage return db 0 dw dochar ;Any other character level1: db '1' dw sethtab ;Set horizontal tab db '2' dw clrall ;Clear all horizontal tabs db '3' dw setgrp ;Graphics mode db '4' dw clrgrp ;Clear graphics mode db '5' dw clrdir ;Forward printing db '6' dw setdir ;Backward printing db '8' dw clrhtab ;Clear horizontal tab db '9' dw setlmar ;Set left margin db '0' dw func1 ;No operation level 1 db 'A' dw func1 db 'B' dw func1 db 'a' dw func1 db 'b' dw func1 db 'D' dw neghlf ;Negative half line feed drizontal tabs func2: func1: xra a ;Clear escape sequence flag sta escflg ret setgrp: mvi a,1 ;Set graphics mode on sta grhflg jmp func1 clrgrp: xra a ;Turn graphics mode off sta grhflg jmp func1 clrdir: xra a ;Forward print mode sta dirflg jmp func1 setdir: mvi a,a ;Set backward printing mode sta dirflg jmp func1 setlmar: lhld hpos ;Get current position xchg lhld dlhpos ;Get offset dad d shld lmar jmp func1 setvmi: mov l,c ;Set the motion index mvi h,0 dcx h shld vmi jmp func2 sethmi: mov l,c mvi h,0 dcx h shld hmi jmp func2 poshlf: call hlfvmi ;Half line feed vmi call adjvp jmp func1 neghlf: call hlfvmi ;Negative half line feed call neghl call adjvp jmp func1 hlfvmi: lhld vmi ;Get vmi for full line feed divid2: mov a,h ;High byte ora a ;Clear the carry rar mov h,a mov a,l rar mov l,a ret abshtab: mov e,c ;Absolute horizontal tab mvi d,0 dcx d ;Form 16 bit tab column call newdlh jmpalf line feed * * asp space * * abs backspace * * acr carriage return * * aesc 0 ignored * * aesc 1 set tab stop at current print position * * aesc 2 clear all tab stops * * aesc 3 graphics mode on * * aesc 4 graphics mode off * * aesc 5 forward print * * aesc 6 backward print * * aesc 8 clear tab stop * * aesc 9 set left margin * * aesc A ignored * * aesc B ignored * * aesc D negative half line feed * * aesc U half line feed * * aesc alf negative line feed * * aesc aht c absolute horizontal tab * * aesc avt c absolute vertical tab * * aesc ars c set vmi * * aesc aus c set hmi * ***************************************************************** diablo: mov a,c ;Get the character to print ani 7fh ;Strip off parity rz cpi adel ;Ignore delete rz mov c,a ;Save character lda escflg lxi h,level0 ;Level zero characters ana a mov a,c ;Scan for char in A jz lookup ;Look up activity for this b 'U' dw poshlf ;Half line feed db alf dw neglf ;Negative line feed db aht dw settwo ;Two character escape sequence db avt dw settwo db ars dw settwo db aus dw settwo db 0 dw func1 level2: db aht dw abshtab ;Absolute horizontal tab db avt dw absvtab ;Absolute vertical tab db ars dw setvmi db aus dw sethmi db 0 dw func2 ***************************************************************** * The following routines execute escape sequences, etc. * ***************************************************************** settwo: doaesc: mov a,c ;Get the escape character sta escflg func0: ret doaetx: if int mvi a,0ffh ;Set the handshake flag sta etxflg endif ret doalf: call lfvmi ;Get line feed vmi adjvp: xchg lhld dlvpos ;Get vertical motion displacement dad d shld dlvpos ret lfvmi: lda grhflg ana a lxi h,1 ;Only 1/48 if in graphics mode rnz lhld vmi ;Get vertical motion index ret neglf: call lfvmi ;Get line feed vm func2 newdlh: lhld hmi call hltde ;Multiply by hmi xchg lhld hpos ;And subtract current horizontal position xchg call hlmde shld dlhpos ret absvtab: mov e,c ;Absolute vertical tab mvi d,0 dcx d lhld vmi call hltde ;Multiply by vmi xchg lhld vpos ;And subtract the current vertical position xchg call hlmde shld dlvpos jmp func2 sethtab: call tabcol ;Set horizontal tab mvi m,1 jmp func1 tabcol: lhld hpos ;Compute address of current character col xchg lhld dlhpos dad d ;Get logical position xchg lhld hmi ;And divide by hmi to get character column xchg call hldde lxi d,tabstp dad d ;Index into the tab stop array ret clrhtab: call tabcol ;Clear horizontal tab mvi m,0 jmp func1 doaht: call tabcol ;Get current tab column lxi d,tabstp+numtabs tablop: inx h ;Start with next position call hlcde jnc tofar ;Past last tab mov a,m ;Get value of current column ana a ;Test if it is set jz tablop lxi d,tabstp ;Subtracharacter lda escflg lxi h,level1 ;Single character escae sequences cpi aesc mov a,c ;Scan for char in A jz lookup ;Execute single level escape sequence lxi h,level2 ;Two character escape sequence lda escflg ***************************************************************** * Lookup scans the table pointed at by HL looking for a match * * of the character in register A. * ***************************************************************** lookup: dcr m ;Test if end of table inr m jz gother ;Execute the default function cmp m ;Otherwise test for a match jz gother inx h ;Bump over character inx h ;Bump over function address inx h jmp lookup gother: inx h ;Bump over character mov a,m ;Get low byte of function address inx h mov h,m ;Get high byte of function address mov l,a ;Form Address of function pchl ;Execute it ***************************************************************** * Each of the following tables contains entries of the form: * * 1i call neghl call adjvp jmp func1 doasp: call sphmi ;Get space horizontal motion spdir: lda dirflg ;Forward or backwards ? ana a cnz neghl ;Negate HL adjhp: xchg ;Adjust Horizontal position lhld dlhpos ;Get current adjustment dad d ;Update it shld dlhpos ;And save ret sphmi: lda grhflg ;In graphics mode ? ana a lxi h,2 ;Only 1/60 if in graphics mode rnz lhld hmi ret doabs: call sphmi ;Space increment call neghl ;Negative to start with jmp spdir ;Adjust backwards doacr: xra a sta dirflg ;Forward printing sta grhflg ;No graphics mode lhld hpos ;Get current offset xchg lhld lmar ;Get left margin call hlmde shld dlhpos ;Don't move yet though lda autolf ;In Auto line feed mode ? ana a jnz doalf ;Do line feed also ret dochar: mov l,c mvi h,0 call wheel ;Print the character in register C lda grhflg ana a lxi h,0 ;Don't move if in graphics mode jnz spdir lhld hmi jmp spdir clrall: call notabs ;Clear all ho-ct off array address call hlmde xchg jmp newdlh tofar: lhld hpos xchg lxi h,maxrgt call hlmde shld dlhpos ret doaff: lhld dfrmln ;Multiply forms length by 48 lxi d,48 call hltde lxi d,10 call hldde ;And divide it by 10 push h ;Save this result lhld vpos ;Get logical vertical position xchg lhld dlvpos dad d pop d push d ;Get copy of forms length call hldde ;HL mod DE xchg pop d xchg call hlmde xchg lhld dlvpos dad d shld dlvpos jmp paper group0: lda base adi grp mvi b,0 ***************************************************************** * Output the data in register B to the port in register A. * ***************************************************************** output: sta outnum ;Put port number in the instruction mov a,b ;Data to register A. out 0 ;Self modified to port number outnum equ $-1 ret ***************************************************************** * Input from the port in register A. * ************ c,a cc dadde xchg dad h xchg jmp mult dadde: dad d ret ***************************************************************** * The routines below actually interface to the printer, * * causing paper feed, carriage, and print wheel motion. * ***************************************************************** carrg: lhld dlhpos ;Check for any accumulated motion mov a,h ora l rz lhld hpos ;Check for to much motion xchg lhld dlhpos dad d mov a,h ana a jp lftok lhld hpos call neghl shld dlhpos lftok: lhld hpos xchg lhld dlhpos dad d lxi d,maxrgt call hlcde jc rgtok lhld hpos ;Otherwise move only to maxright xchg lxi h,maxrgt call hlmde shld dlhpos rgtok: lhld hpos ;Update the horizontal position xchg lhld dlhpos dad d shld hpos lhld dlhpos ;check if required motion is to the left mov a,h ana a mvi c,0 jp posh call neghl mvi c,data11 posh: xchg lxi h,0 shld dlhpos ;Reset the horizontal increment xchg mov a,l > !$'* 02Hn >>2)QK-QKBcF̊CLA4*P~^#"P>Q`GQ`G`x27`͜` *"8`QʿڿGGQʿڿo&7Q1`Q0. 2. `&":`͜`"<`Q10`02>`AG?K0:?0Ù@ :7>/:7:7:7*:!x"?*<!0"A!"C"E"G"I"K2M2N!R6#{ˆ͸DyO:O!yʾ:O!yʾ!-:O54###þ#~#fo< A  B f 1\23456***************************************************** input: sta innum ;Put port number in the instruction in 0 ;Self modified port number innum equ $-1 ret ***************************************************************** * Neghl forms the twos complement of HL. * ***************************************************************** neghl: mov a,h cma mov h,a mov a,l cma mov l,a inx h ret ***************************************************************** * Hlmde subtracts DE from HL and returns. * ***************************************************************** hlmde: xchg call neghl xchg dad d ret ***************************************************************** * Hlcde compares HL with DE. On return the Z flag is set if * * they are equal, the Carry flag is set if HL is less than DE. * ***************************************************************** hlcde: mov a,h cmp d rnz mov a,l cmp e ret *********************************************ani 1 jz nohhlf ;No half spaces mov a,c ori data12 mov c,a nohhlf: call divid2 mov a,h ani data910 ora c mov h,a lxi d,crstrd jmp cmnd paper: lhld dlvpos ;Check for any paper motion mov a,h ora l rz ;No motion mov a,h ana a mvi c,0 jp posv call neghl mvi c,data11 posv: mov a,h ani data910 ora c mov h,a push h ;Save paper motion lhld vpos xchg lhld dlvpos ;Get logical position dad d push h ;Save for now lhld dfrmln ;Get default form length lxi d,48 call hltde ;Multiply by 48 lxi d,10 call hldde ;Divide by 10 pop d xchg call hldde ;Compute HL mod DE xchg shld vpos ;Save new vertical position lxi h,0 shld dlvpos ;Reset vertical motion pop h lxi d,pfstrd ;Paper feed strobe jmp cmnd wheel: push h call carrg ;Position the carriage first call paper pop h lxi d,pwstrd cmnd: call group0 lda base call input ana d jz cmnd mov a,l cma mov l,a mov a,h ani data910+data11+data12 cma mo8y90ABabDU Z < <<< ( Dy2ON*E"E:N!*ANEy:M*I"I:N!*?yi2M2N*G*K"I:>Bi&:N!i*?i͂2O>2N2N2M>2M*G*I"Ki&+"Ai&+"?EE*A|g}oY2*?**G"IY*A**C"Ed6*G*I*?Rd6d#ҝ~ʇR2*G!0"I*80* *C*E*E"Eø:72x2|/g}/o#|}z/G{/O>=))# %#MD!xxGyOB)/*I|*G*I|`*G"I*G*I0~*G!0"I*G*I"G*I|!"I}ʪyO |g  *E|||g*C*E*80* "C!"E D͸@ :7 }/o|/g:7E:7D|G:7D:7$I$I"$!$DH"II@HI!I BB@I"HA$"I$I$I$I$$$IH I" $$$ $II $D!$$DDAD @@BI"$$ "AH******************** * Divide the number in HL by the number in DE. Return the * * quotient in HL and the remainder in DE. * ***************************************************************** hldde: mov a,d ;Start by negating DE and cma ; moving the left operand to BC mov b,a mov a,e cma mov c,a inx b mvi a,16 ;Repeat count in reg A lxi d,0 ;Initial remainder is zero div3: dcr a ;Test if done rm ;All done ? dad h ;Shift right operand to the left xchg push psw ;Save carry dad h ;Shift left operand to the left pop psw jnc div1 ;Does it fit ? inx h div1: push h dad b jnc div2 xchg inx h xthl pop h jmp div3 div2: pop h xchg jmp div3 ***************************************************************** * Multiply the contents of HL by the contents of DE. * ***************************************************************** hltde: mov c,l mov b,h lxi h,0 mult: mov a,b ora c rz mov a,b ora a rar mov b,a mov a,c rar movv h,a lda base adi daisy1 mov b,l call output lda base mov b,h call output mov a,h xra e mov b,a lda base call output mov b,h lda base jmp output end .DD$*?yi2M2N*G*K"I:>Bi&:N!i*?i͂2O>2N2N2M>2M*G*I"Ki&+"Ai&+"?EE*A|g}oY2*?**G"IY*A**C"Ed6*G*I*?Rd6d#ҝ~ʇR2*G!0"I*80* *C*E*E"Eø:72x2|/g}/o#|}z/G{/O>=))# %#MD!xxGyOB)/*I|*G*I|`*G"I*G*I0~*G!0"I*G*I"G*I|!"I}ʪyO |g  *E|||g*C*E*80* "C!"E D͸@ :7 }/o|/g:7E:7D|G:7D:7$I$I"$!$DH"II@HI!I BB@I"HA$"I$I$I$I$$$IH I" $$$ $II $D!$$DDAD @@BI"$$ "AH6Y: !2 6=21 á:1 : r+s#r==_HL"4 " >6 ͪS* "6 =23 :1 =21 v=O* #" Y8  ͝҉* +"8 .!2 ʞR̀* "4 4 = ͝* #" çR*6 DM+R*8 DM+R*: DM+R*< M!? q=  ͝Kd*= ! ͸p!@ 6>!@ X*= }O!< *@ & w*= #"= !@ 4)!< 4\mad* }O!< :? wlR*4 DM+{R* DM+R 4 ͝*4 }¿= 4 ͝< N*4 #"4  å;*4 DM+: Y2A 0O> :A 0:A AO>&R̀:A A H.2B !2 w:B !D s+q*C &͍:D _og_{ozg^#V) _{ozgi`N#Fogo&og_{_z#W#fo !~#fo !~#fo##yx#B !N#F!<! <͢!>w#w!!~#fo!~#fo   !~#fo##~#fo!~#fo !~#fo}o|g}!~#fo##~#fo!~#fo ~OGyOxG!~#fo}o|gy xf !~#fo##~#fo!~#fo !<! <͢f !N#F!~#fo##N#F!~#foN#Fͬ!yD x#v !N#F!;<! <͢v !~w#~wM !>w#w!!  # !!~#fo!yOx#G>>  !N#F!yOx#Gywx#w!!N#F!}|!~#fo}o|g} !~w#~w !~#fo##~#fo!~#fo !~#fo }o|g} !~#fo##~#fo!~#fo !~#fo  }o|gMD!N#F!!~#foN#Fͬ!yª x# !N#F!;<! <͢!!N#F!~#fo##~#fo!~#fo !~#fo##N#FA !~w#~wÁ !~#fo##~#fo!~#fo !~#fo MD!9!!N#F!}!~#ʻ !>w>#w!~#ʾ !~#ʾ ! ~#fo~OG!yOx#Gy !~#fo!  ! ~w#~wa !#~~w+~w!~w#~w!~w#~wv !9* â Memory may be corrupted. Error reading %s. Next Load address: %h. Invalid CBIOS format in %s. Invalid load address %s. Can not open %s. Odd number of arguments. Usage: install [-string] file1.prl address1 [ file2.prl address2 ...] Install Revision %i.%i !9!>w#w!>w#w* ! * ! !<!~#fo##~#fo~-!~#fo##~w#~w!>w>#w!~#fo##~#fo~!!N#F!~w#~w!~#fo##N#F!~#fo##~w#~w~!~#fo6á>2!~#~>!<͢>!~w#~w!~w#~w!~#fo}o|g}^!<͢! ywx#w!>w#w!!  #!~#fo!!!~#fo)!~#fo N#Fzywx#w+#~Z!~#fo)!~#fo N#F!<͢Z!ywx#w!>w#w!!  #!~#fo)!~#fo N#F!N#FH!~w#~w!~w#~w!~#fo##!~#fo)##!~#fo N#Fpywx#w+~#!~#fo##!~#fo~#fo  !~#fo##~#fo}o|g}!~#fo)##!~#fo N#F!<͢!~w#!>w>#w!!}|!~w#~wͩ!N#F!~w#~w6!!N#F!~w#~w~OGyOxGywx#w!># !>#J!~#fo~ J!~w#~w!~w#~w~ !!}|!~w#~w!!~#fo#}|!!  #!!~#fo~!~#fo!~#fo~!~#fo!~!~w#~w!~w#~w !>#!~#fo~ ʦͩ!~#fo!~#fo~!~w#~w!~w#~w!~w#~wJͩ!N#F!~w#~w6q !!~#~!!}|!~w#~w!>w#w!!  #V!~#fo~™ͩͩ!~#fo!~#fo#}|!~w#~w!~w#~wÙͩͩ!~#fo!~#fo#}|!~w#~w!N#F!N#F1!~w#~w;!9!!~#~!N#F!} ~ !!N#F!| }|!!~#fo$ ~#~!>#v!~#›!~#fo& !~!N#F!~y!~#fo!yOx#G!~#fo$ !~#~!~#foMD!!  #!N#F!N#F!~#fo& !!yOx#G ͤ!!  #!>w#@ COPYRIGHT (C) 1978, DIGITAL RESEARCH ERROR: $, LOAD ADDRESS $DISK READ$INVERTED LOAD ADDRESS$DISK WRITE$LOAD ADDRESS $ERROR ADDRESS $BYTES READ:$INVALID HEX DIGIT$CHECK SUM ERROR $FIRST ADDRESS $LAST ADDRESS $BYTES READ $RECORDS WRITTEN $HEXCANNOT OPEN SOURCE$COMNO MORE DIRECTORY SPACE$CANNOT CLOSE FILE$*!9"!e !" !" \!""͊: ƒde"\\\͊: ²d\͝: )d;! q* &f  ! q> ! : A O: 0O! q: O: O! p+q* |O* }O! p+q*  f! p+q* DMB! p+q)R* DMB1B* DM+;! p+q* i2 ! p+q* i2 ! p+q* i2 i2 !" p+q*! f!$ p+q*# i!& p+q*% i!( p+q*' i2 !* p+q*) f!/ s+p+q+p+q:/ =2/ X*+ *- w*+ #"+ *- #"- 1* #" ͖r*   ~!" ! ͸×* " x20 º*   DM":0 Ad*   6!" Ç!" : !"6 "8 ": }2< !"4 "= ! ~w!~w#~wu!!~#fo##N#F! Hywx#w!:w:#w!*3  Ҟ!~#fo~OGyOxGyvx !~#fo##N#F!h<! <͢ !:w:#w!!~#fo~#fo }|!*3  !N#F!N#F1!~w#~w!~w#~w!~w#~wC!N#F!O<!9!!~#fo~!~#fo!~#fo~!~#fo!~!>w#w!~#fo~!~#fo~0!~#fo>9!!~#fo~OG!~#fo))))  }|!~#foMD!~#fo~A!~#fo>Z!~#fo~OG! MD#!~#fo~OGyax!~#fo~A^!~#fo>Z^!~#fo~OG! MDk!~#fo~OG>f>!!~#fo~A!~#fo>Z!~#fo~OG! MDø!~#fo~OG!~#fo))))  }|!~w#~wÂCan not write in location %h. Insufficient memory to read %s. Invalid PRL file format in %s. !9!!!~#foN#Fͬytxʓ!N#F!;<! <͢!~OGyOxGy­x!N#F!'<! <͢!!~#~!!~#~!~#fo##~#fo!~/w!>w>#wÛ!N#F!N#F!~#fo& !!yOx#G ͤ!!  #!!  #!>w#w!9!>w#w!|ywx#w!~#~!~#fo#~ !~#fo~ !~w#~wö!~w#~w!~Ʀw#~wÙ!~#fo~ !~#fo#~:y!~#fo!~#fo~aT!~#fo>zT!~#fo~OG! MDa!~#fo~OG! }!~w#~wÃ!~#fo6!!~#~!!~#fo#}|!!~#fo  !~#fo~ʫ!~#fo~.!~w#~w!!~#fo  ҧ!N#F!~w#~w6 !~#fo !~#fo 6~!~#fo! !~#fo" !~#fo# 6~ w!~#fo$ >w#w!N#F!~y—x/!~#fo#6 !N#F!~w#~w6 ç!N#F!~w#~w!~#fo~a!~#fo>z!~#fo~OG! MD!~#fo~OGyw!~w#~wç!~#foMD!9!!}|!!N#F!~w#~w~ ʖ!~%ʙ!~OG!~S!!N#F!~w#~w~ OG!ï!~#fo#~!-!~!~#fo!~#fo~#fo>o>g}| usOh)odire approximately 3.5K bytes, (see FILES below), so you should construct a 44K Cpm, and type install -C M26.prl B000 (B000 is 44K in hex.) If you don't know how to move your Cpm downward see your system manual. The required program is usually called "movcpm". To install the Disk Jockey as drives L and M in a 44K Cpm (with at least 48K of memory), type install dj.prl B000 djram.prl E400 Here, dj.prl contains the Disk Jockey 2D drivers, B000 is the top of the 44K Cpm (the dj drivers require 3.25K), djram.prl is updated controller firmware to be loaded into the controller ram, and E400 is the address of the controller ram. (If you have a non-standard controller, use the controller address + 400 hex.) To install both the m26 and the Disk Jockey, you could first install one and then install the other on top of it (at the printed "new load address"). This would require 6.75K of memory above Cpm. As a better a! !N#F!~w#~wN#FSS!!N#F!~w#~wN#FS!!N#F!~w#~wN#FS!N#F!~w#~wN#FͯS!~OG!~S!~#fo~!~#fo~ ! !~!N#F!~w#~w~OG!~ò!!  #B!N#F!N#F!N#F!!N#F!N#F}|  ډ!~#foA  !~ß!~#fo0 !~*#~##~#®~®+++~#fo!9N#F#^#V!xxGyO)MD!9q#po!9~o3||g}o'/<3)"MD!9q#poG! 9~#fo!9~o/< !9~o3|g}oa'!9N#F#q#p!9N#F#^#V"""O>/G!9N#F#^#V#~#foͻz w#û!9TT|xTDxTDLL|7xLTD(D|/g}/o#x/Gy/Ox/Gy/O>=))k# w#`` NAME install -- integrate new device drivers into Cpm, Revision 1.3. SYNOPSIS install -string newbios address [ prlfile2 address2 ... ] DESCRIPTION Install integrates new device drivers into an existing Cpm 2 system. "Newbios" is a skeletal Cpm bios module in prl format (see the prl document) containing the new drivers. Install first loads newbios at the given address (usually the top of Cpm), then patches it into the existing bios by exchanging the addresses of the 17 jump vectors that begin each bios. If additional prlfiles are given, they are loaded at the requested addresses with no patching. Finally, install prints (top of newbios) + (newbios buffer size, if any) + 1 as the "new load address". Additional drivers can now be installed at this address. The flagged argument (-string) is copied to 80H and left there for examination by the newely installed "Newbios", or a NULL if no flagged argument is present. The bios modules provilternative, there is a combined driver package that requires only 5K of memory. To use it, configure a 43K Cpm (assuming 48K of memory, or use available memory - 5K), and type install M26+dj.prl AC00 djram.prl E400 FILES The provided files are: install.com Install program. install.doc This document. prl.doc Prl file format. M26.prl M26 drivers, require 3.5K, default to drives N,O, and P. dj.prl Dj drivers, require 3.25K, default to drives L and M. djram.prl Dj ramware. Load at controller address + 400 hex. M26+dj.prl Combined m26 and dj drivers, require 5K, default to drives L and M for the Disk Jockey, and N,O and P for the M26. M26+dj.asm Assembler source for M26.prl, dj.prl, and djram.prl. Requires the Digital Research assembler "mac", or "asm" plus hand editing of the macros. djram.asm Assembler source. BUGS Addresses must be specified in 4-digit hex (with no lead ded here (see below) use this as an initial drive specification. i.e. -c specifies that the newely installed bios should respond to drives C on. The Cpm system must be "standard": its bios must begin with the jump table defined in the "Cpm 2.0 Alteration Guide", and it must store the address of this table at location 1 in memory. A "skeletal" bios module begins with the same jump table, but may leave some of the required functions unimplimemted. The corresponding jump vectors are left as jump selfs. EXAMPLES To install the m26 hard disk as drives C, D, and E in a 48K Cpm (assuming that you have memory above 48K), execute install -C M26.prl C000 Here, M26.prl is the "skeletal bios" (provided with install) containing the m26 drivers, and C000 (hex for 48K) is the top of Cpm. If you only have 48K of memory in your system, you will first have to move your Cpm downward to make room. At this writing, the m26 drivers requi0ing 0 and no trailing H). Install should also accept octal and X-notation. When the DJ drivers are first accessed, they locate the controller by searching memory for a certain pattern in the controller rom. The search is done carefully, but nevertheless might clobber somebody's memory-mapped io. install.doc 8/26/80 bdg  M26.prl M26 drivers, require 3.5K, default to drives N,O, and P. dj.prl Dj drivers, require 3.25K, default to drives L and M. djram.prl Dj ramware. Load at controller address + 400 hex. M26+dj.prl Combined m26 and dj drivers, require 5K, default to drives L and M for the Disk Jockey, and N,O and P for the M26. M26+dj.asm Assembler source for M26.prl, dj.prl, and djram.prl. Requires the Digital Research assembler "mac", or "asm" plus hand editing of the macros. djram.asm Assembler source. BUGS Addresses must be specified in 4-digit hex (with no lead Ä!~w#~w\!D!!"N#FD !4!! N#FD !>w#w!~#~ !!~#fo 6!~w#~wP!!!N#FzEy x«!; !!!!"N#F]yx!T!!! N#F]yx!4!; ! ~w#~w!~w#~w!#X##N#F+++N#F!N#Fr! N#F!!N#F!N#F!N#F!N#Fͣ! 9!"N#F=! N#F=!N#F=!$!]!~#fo!yOx#G!>!!FnV!!  #!; !~#fo!yOx#Gyx(!p; !>w#w!!  #!!~#fo!~#fo }o|g}|!>w>#w!N#F!~w#~wᗕ>!!~#fo||g}o}|x!!~#fo!~#fo !8Q}|!~#fo)!T ~#fo!~#fo)! yOx#Gyx3!!~#fo ! V!!~#fo !~#fo}/o|/g ! !  #y! !~#~!!~#fo!~#fo  !!~#fo!~#fo }|!X##N#F+++N#F!N#F!~#fo)! N#F!~#fo!~#fo !~#fo!yOx#G! ||} !!+X##N#F+++N#F!N#F̈́)xT!; !!!N#FzEytx!~; !!##N#F+++N#F!N#F̈́)x!i; !N#F! N#F!N#FzEyx!R; nVCan't read in seg %iCan't write out seg %igV!9!\~#_!>w#w!~#~!/X!~#fo 6!~w#~w0!!~#fo}o|g!QP}|!!~#fo}o|g}|!!/\ ° #=*/\! ##N#F+++N#F!N#FZyxr*/\!; r!>w#w!~ր#~0!~#fo)1\ >w#w!~w#~w>2\2\_!/X!~#fo !~!:\:\#!!~#fo"\!!~#fo)1\ ~#!N#F! ##N#F+++N#F!N#F'y¶x!N#F!; !~#fo"/\*/\)1\ >w#w=!>w#w!~#~!/X!~#fo 6!~w#~wnVgV!!##N#F+++N#F! N#F!N#F͍! 9nVgV!!##N#F+++N#F! N#F!N#F͍! 9nVgV!9!!N#F!͖Qx2P`2Q`x2S`y2R`!P`!Q~#~#~#~!!##N#F+++N#F!N#F̈́)x 9!~w#~w3gV!~#fo~ʃ !~#fo~. ! ~@ #~ !~#fo~ !N#F!~w#~w!N#F!~w#~w~C !N#F!~w#~w6.!~#fo~, !N#F!~w#~w!N#F!~w#~w~Û !N#F!~w#~w!N#F!~w#~w~ !~#fo6! ~& #~ʃ nV!~#fo6nVgV!!N#F!~w#~w!N#F80yʎ !~#fo ~ ” !~#fo 6nVnV!~#fo ~ < !~w#~w< Error: gV! ! N#F!N#F!N#F!N#F!!FnVUsage: makeprl [-s hex-no] [-o output] hex-file1 [hex-file2]gV! !!FnVgV!~#fo~:y nV!~#fo ~0 !~#fo ~0ʣ nV!!N#F!!~#fo#(y x nV!!N#F!!~#fo###(y x nV!>w#w!!~#fo  #~ !!~#fo)! ~#fo !!~#fo) !~#fo (yu xʣ nV!~#fo#~0³ !~#fo##~0³ nV!~w#~w nVCan't rewind '%p'file '%p' not at correct start addressUnexpected lasnV! >w#w+~#1!!/X!N#FzEnV!!/X!N#F80nVCan't write out memoryFlush can't seekgV!9!*/\!͖Qx2P`2Q`x2S`y2R`!P`!Q~#~#~#~*\#"\!!##N#F+++N#F!N#F̈́)x!a; *\}o|g!/X!N#FzEyx"!J; nVO!~#fo"d`!~#fo"``!~#fo"b`!>w#w!:d`w:e`#w!>w#w!``>#ґ*d`> *d`~!``>#*d`~-n!>w#w*d`#"d`:``2``:a`2a`:``2``:a`2a`*d`#"d`s! ~#~‘:``:a`ڑ*d`~0‘*d` ~A;*d` >Z;*d` ~OG! MDG*d` ~OGyxPx‘*d`##"d`:``2``:a`2a`Ñ*d`~+*d`#"d`:``2``:a`2a`!``>#*d`~0C*d`>9C!*d`~OG! }|X*b`!~#!N#F>O>G!N#Fywx#w!``>#*d`~A%*d`>Z%*d`~OG! MD-*d`~OGyl6x*d`#"d`*d`~a*d`>zÝ!!N#F! N#F͖Q!~#fo }|:``2``:a`2a`*d`#"d`Ñ*d`~A*d`>Z!*d`~A*d`>Z*d`~OG! MD*d`~OG! }|!!   #X**0F!9N#F#^#V#~#fo"Xkb"Xi`"XOGposLoad size is %h hex bytes longOutput file is %p Addresses don't matchSizes don't matchUnexpected last line in %pCan't make room for headerCan't create '%p'prlhx1hx1hx0Bad option -%acprlMAKEPRL Version %i.%i gV!9!>w#w!>w#w!>w#w! >w#w!>w#w!>w#w!>w#w!~w#~w!~w#~w!N#F!N#F!!~#±@ !~#fo~#fo~-!!~#fo~#~!~w#~w+~#fo~OG!2[U!~#~ʽ!~#~ʽ@ ý!!!!~w#~w+~#foN#F(!~w#~w!~w#~w!~w#~wñ!!$!~w#~w+~#foN#F !>w#wF!~#fo~OG!; F!!!D!~#foN#F !~#~!!!4!~#foN#F 3!!!4!~#fo##N#F !~A#~ʄ!!~#fo~#fo~!~#fo~!~#fo~.!~#fo6\!"!Dywx#w! !4ywx#w!!!!$$ywx#w+~#~!$!; !!$!~#foN#Ft line in hex file '%p'File '%p' not in hex formatCan't read '%p'gV!9!!N#F9 yg x{ !N#F!4 ; !!!!!^ ywx#w+~¬ #~ !N#F! ; !~ #~ !N#F! ; !!  # !N#F! ; !!'X##N#F+++N#F!N#F̈́)xB!N#F! ; nVBad line in hex filegV!9!!N#F9 y€x‰nV!! N#F!N#F!N#F!^ ywx#w+~#~!H; !~#~nVnVCan't open '%p'gV!!!!N#F͐ywx#w+~.#~E!N#F!; nV!~#foMDnVCan't write out bitmapSeek error in wrheadCan't write headerCan't rewind filegV!9!>w#w!~#~!!~#fo 6!~w#~wö!!}|!N#F!~w#~w6!N#F!~w#~w!~#fo!yOx#GyOxGyw!N#F!~w#~w!~#fo!yOx#G!8Q}o|g}!N#F!~w#~w6!N#F!~w#~w! ~#fo}o|g}!N#F!~w#~w! N#F!8Q}o|g}!!1d`!yOx#GP can't write can't read O!9!t!}|!"``!*``*``#"``~!>#!>#*``> ,*``~,!>w#w!v/ywx#w!"b`!t:b`:c`#*b`~<!=!!*b` ͐y~!!!*b` !#!! 9!F~!>#CÔ!~w#~w*``#"``r!>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DnVDD^DDO!~#fo"d`!~#fo"b`!>#D! yOxGyD! yCxD!FD*b`!yOx#GP*d` ~1D*d` ~OG!C[U*d` ~#fo"``!*d`VGyUDx¾DP*b`~OG! !~w#~w*b`#"b`ÿC*b`~OG! pD*b`~OG! pD!~#foMDP!>#?E*``! ~?E*``" N#F*``" ~w#~w*b`*b`#"b`#~w M!MD! +&MMGM!MD!  #8M!4! +~w NM!5L!N#F!rV!~ʈM!~#ʈM~w! N#F !#~—MW!9!9! N#F!6 Mƀ4 !]WyN!q#p!N#F!]Wy N! N#F &%NN!~O#~Gyր+wx#w! #w )N>8!w! ~#+~w ?N!~hN!MD!  #^N!#~w oN!56N!N#F!rV!~ʨN!~#ʨN~w! N#F !#~·NW!9~#fo~#N~ƀw!9!9!N#F ! #wN!~ƀw! N#F!̀UW!9N#F!9~#fo~#~4OWMD!9!9!N#F!]WyʨOy֨OxGO!~#+~w|OyrOèOyʨO!#~w›O ÎO! @ON#F!~#~W@ON#F!~+~ +~+~ W@OMDóO!9*d`*b`*``i`!"``"b`"d`!9~w#~w#~w#~w+MD!9 _ #P{ !94P! 9~iP+w>#w! 9N#Fx}PO>GPҍPO>G! 9q#pW! 9~P+w>#w! 9N#FxPO>GPPO>G! 9q#pW! 9N#FP! 9q#pW! 93 have a type extension, '.hx0' and '.hx1' are added respectively. EXAMPLES To create a prl file of the hard disk i/o drivers you would first have to begin with the assembly language source. Assemble it at orgin 0 and rename the hex output (with a .'hx0' extenson say). Then you would have to assemble it again with an orgin of 100 hex (Consult your assembler manual on how to do this. With some assemblers you would have to reedit the source file and change the 'org' statement). After you have assembled the source with an orgin of 100 hex you could rename it with a '.hx1' extension. Now you are ready to use the makeprl program. This is an example of a typical way to do the above described procedure. The example assumes that the source is configured correctly. mac hd+dj ren hd+dj.hx0=hd+dj.hex mac hd+dj $+r ren hd+dj~]y)):DE9WAzD5D9E TCD E"D   < DDDD=9"D"yLLMPM@$$YXTZZSRbSYdXY|T{TSYjIII{(*f(6 88&W7899N9K HFIII"MIFFy))*l*QQQUDV\VgQjQmQ;LM$Xq"9BLdhiNBTSUTϫLOSONԚLEAҒINSNDBV+V,V-O HRAL̶OMMOθHAIιATI͆EFSTҭEFINԮEFSNǯEFDB̰EƘELETŪNāLSŢRASŦDIԧRROҨRRX O/QO҂IELILERIOTωO TωOSUEEXNPUԅƋNSTNNMNKEYILEԈINűOASEPRINԞLISԟPOISԓO O0EEFTO1ERGOKI2KS3KD4IDEXԃUL̖AMEהOUԝΕPEοCTPTIOκUOKřRINԑOEEEAćUΊESTORŌETURΎE͏ESUMũSEIGHTNENUͬESEANDOMIZŻTOАWAХAVPCTEGQI TRTRINGPACEYSTEͽROΣROFƤABHEA SINSAARPTIDTȡAIԗHILŴENĵRITŷO۾yy||PF<2(z{*y):*)%,,c-G.r)%%'n')0+$+P+2)NEXT without FORSyntax errorRETURN without GOSUBOut of DATAIllegal funct975717-7+7)7'7%7#7!77777 7 7 7 7 7 7f`.G $_ @ BCG@M [u+p.hx1=hd+dj.hex makeprl -o hd+dj.prl hd+dj.hx0 hd+dj.hx1 In the makeprl line it would not be required to specify the output or add type extensions because the program uses defaults. The makeprl line could be written. makeprl hd+dj hd+dj This form does the same as the first but is quicker to type. The specification for the -s option must be a four digit hex number. FILES makeprl.com Makeprl program makeprl.doc This document. makeprl.doc 3/17/81 ldk  of a typical way to do the above described procedure. The example assumes that the source is configured correctly. mac hd+dj ren hd+dj.hx0=hd+dj.hex mac hd+dj $+r ren hd+djion callOverflowOut of memoryUndefined line numberSubscript out of rangeDuplicate DefinitionDivision by zeroIllegal directType mismatchOut of string spaceString too longString formula too complexCan't continueUndefined user functionNo RESUMERESUME without errorUnprintable errorMissing operandLine buffer overflow??FOR Without NEXT??WHILE without WENDWEND without WHILEGraphics statement not implementedFIELD overflowInternal errorBad file numberFile not foundBad file modeFile already open?Disk I/O errorFile already exists??Disk fullInput past endBad record numberBad file name?Direct statement in fileToo many filesJJJJJJJJJJpP8`1` : NAME makeprl - make a prl file from absolute hex files SYNOPSIS makeprl [-s hex number] [-o output file] hex1 hex2 DESCRIPTION Makeprl is used to create prl files suitable for loading by the install program (see install.doc). The format for prl files can be found in prl.doc. The -s option is used for entering the reserved buffer space. (The reserved buffer space is entered as a 16 bit number in addresses 4 and 5 of the header, see prl.doc). The -o option is the output file specifier. If no output file is specified the name from hex1 is taken with '.prl' type extension added. If the output file does not have a type exentension, the default '.prl' is added. The next two arguments must be specified. The first argument is the hex file input with an orgin at 0. The second is the second hex file input with an orgin at 100 hex. If the hex files do not 4, in Ok Break!9~#…  w N#F#i`zʙ D w   *|<ʺ :  MD=96543>7@?2C: * "  "  "!>:yHG+2ȸ#"<֌WVͨ9D" : G: xf: ' q# ¨*' #^#V*DҜ* DҤ! DҤ>HFH(2DZzPY" : {:_ ͋ ~GD+K x[,  <2~Zz< 2* * "~5#####͋ J  fOgD,* fZ |J" 2 " ~,2ʍD+ͅ(ʧ2 * 2©©Õ>2Q+2QB"?ʎʎ,O; c1F6 *' 4*|H*' :/:G @22go"D#ʭQiL͙ͨ9:*QKJDF>V?Redo from start #~ "^x: !KDG* Q! R#ʃiL">2>2 F~,¹2 2ýD;GG: >?@> @QKJD6,+>2 2ͨ9~+(#2 2 W]!#~ "! _6![!_.6!!6!I!: G! >2 { W! !!<~d!#~#r! j*!:G@ #T]~ʀ!#!~!ʚ!y_­!: >2 ![¹!2 !: >2 !> yG{!~#_yG!!2 !2E0:?+2͸" ʩ6 ʬ6* c1: O *" H5">&{: F"!F"#~ ̽(~#x": L" i".s"Ds"EL"L"{ʁ"* !8$ҟ"T]DJ!h DG!* D±"`i" "N]~"N]D,͋ y):* :) Í% PX2#,#OBK2#D,O2#D,Z zJ`iDJ^# J!DJ^{#Vq#~#+N#͔#^{#Vʏ##s#r x# 2 *+#~##^#V2ʝ#O: y$#2©#2©#ez#$¦#e > ($DB!$DGT1L1+æ#Undefined line ¦#e###N#F>!#* +p+q+w: Õ#DBDADSDE: * * D ~0  2 <2 2~͆$#|$ÆAʗ$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6QB! ;K ;Kx<9L*|>=L! Z"Îyq#@ ;K2 > @AML ;KÛK: LBw! >2 ;2 2" $2L33L " ** L L M" *" ##^#V#~#fo"ͅ(LA3* "!9~#L LN#F`i U>  U$UxFGT2D$D(͋ ~,OU20Q (QD)}JFʉUBpU%BʂUw# bUG* MDW uUO #~~(PY!' ůw͵W:D͗Z = =Uѯý < !% ^#Vr+s?Q:V PY0V!'V`i>}V!' ~U͵W)=V*T]% N#F+q#p###6 –W͵W:C͗Z>®W>w+w!(LW7?*' 6#67H~ #^#fk_XN#~:X++@ y@  ! #TX~.2X@X7X#X2-z  > @X9X> YX9XW!< !! w#„XDADSW:!!J!< H~ #N#F OXIXR D,#2͋ D,{ _.pl 63 .po 0 .he Notes on CP/M Ver. 2.2 With Discus M26, M10, and M20 .fo Page # Ther ar severa feature o Morro Design versio o CP/ Ver 2. wit whic user accustome t singl densit CP/ o inc drive ma no b familiar I addition som explanatio i require fo certai utilit command provide b Morro Designs Thes specia feature an utilitie ar discusse below. CBIOS Th CBIOS supplie wit CP/ Ver 2. ha som uniqu feature whic allo user t easil us flopp diskette o differen densitie and/o secto sizes Th CBIOS wil rea an writ diskette formate i IB 374 singl densit format an IB syste 3 doubl densit format Th compatibilit wit IB diskette i ONL i th formattin information NO i th fil structure Thi mean tha th Dis Jocke 2Ġ ca rea IB diskettes bu softwar i neede t rea IB files N cD L >2 ͨ9(y)"  B!9 +2" MD(ͨ9s#r#~,]M 2CMD)" >!=M=M=M!9DM!M* * * 2 2 ~§M2 #+2͚R!" +2'ND,,M"" +2'ND,MDADLDL\OD, 2 28$`i"  NT]" DJ\O*+#~#N#^#V"2+N:;NXN2+;N2>N>2 ͨ9ʶNxGͽ;>2 „N~(ŠNN~(Jͨ9z£NxG: WF:zJBK!N N 2 ~(ŠN ͪN+2>N(N2D)>ND,^N* * D2ON##~w#< NO* " N* DOy_xW `i" * D\O##~w#2 : sS:2ÿR2 2 * DM* " * #* " DUP `i" * |*+ `iQ+2PPc1F*' #^#V °Pr+s+5GG+2P;PD,+2>,@ÍP>"@GG>"@óP*| Q~ Qʹ\}o|g Q>?Q zW Z" 2Y{2Y!*~ 2Y6B#6A#6S"#! w# =Y66͵W~nY< ÃY<ƒY bY!%w#w#w#w~ʤYC~W* ) p# ªYCTT _W!<  Z!!6# ͏ZW2-!"͋Z!*͋Z! O!  ~#@y`Z~ ]Z>.@ JZ: W:yZ> @@QB!:Z~*6?# ZO!!4¯Z#4¯Z#4y"Z ><+2ZC* DJ! s#r#wZ2g]0Q ! ^#V~,C+2 { +s#r! w#w! ~#fo!DM[Ë[BK>!)`[)#a[))o[ n[#=V[}_}la)J҆[#xJ"a]! "c]!) "e]!}o|gDڵ[bk:g][D[\DM*e]*c]M\"c]PY\}o|g*a]#"a]˜[\DM*c]*e]M\"c]PY[2*a]! ~#foDs#r<\:I\!I\!& èV~# xN\DMͶ\ ͫ\! w!( V6 ʃ\zwʹ\ ͫ\! ~!æ\! ^#V! s#rDMͣ\͝\D2" ͕#\>S]C ** D!u9}o|g!$9}o|ghang i necessar withi th CBIOS t allo user t rea and/o writ an o th IB standar secto sizes Th CBIOS als support singl an doubl side drives User wit doubl side drive mus us doubl side diskette i orde t tak advantag o th buil i doubl side features I singl side diskette ar use i doubl side drive th singl side parameter o th CBIOS wil tak precedenc ove th doubl side parameter (thre millisecon seek an extende storage) Th CBIOS require approximatel 2ˠ o memor abov th regula CBIOS supplie b Digita Research Th sourc fo th CBIOS i i th fil 'CBIOS&.ASM' an th sourc fo th COL an WAR boot i i th fil 'ABOOT&.ASM' Th dis paramete header an dis paramete block require b CP/ ar han code i th sourc files Th fil 'DISKS.ASM contain macr librar definition whic ca b substitute fo th han code @+|PQB#0Qѻ$Q D,`i"+2#2͎ _: !N#F @Q!)dQ! >>>F* (I>>>HJ<#N#fi2 ( ,QZQQͨ9:*;W_W QQ"QG{,xQPXW7R! Oz"y"R WR "RO{,yĐRW7R "R{ 1R,> 1R1R7R7R͐RWQ"BR jRWjR BR,jR bRWjR jR*( 46! { ~RBF2..ɷw#kRX͚R:2+2RD,DR 22!6"UC:2*""*#|lV* *DSS~#lVS V:SS=S~,2~#2͋ SůSѯ0Q  ! ~#fo" !"a]| G~,͈ DADSͨ9:*O*a] "a]* D q#s#r:T7ͨ9:*HF~O#^#VT*DT* DTY* * DUy]GH#s#r#^#V#^#VyTGO UU~#T ] \ \ ** D!$9}o|g!u9}o|g E] ] ]*|<: J>C*+6*^~ Rê !0`2 "" * ^#V"B"B"##^#V")B##^#V"A##^#V"gA 2B!]!!""C!"22 2 2 2!"!" ! " ! "o *" >2!^"^:^¼^<2^!~"^ʼ^F#~+w##+^+6"^!2ʼ^/_^+6""^#/_^2P^ü^62Sʦ^Mt^F 2D:ʓ^zJ{J2Ø^" +2ʼ^D/d^2D:" Ø^+* +" +:!|]"2<s#r# *  DM=^#"" {ozgC|g}o_|_!{ozgC" "" " *C}o|g++!_DGT1!y_DG!DG" QB! "h] Owned by Microsoft Bytes freeBASIC-80 Rev. 5.2 [CP/M Version] Copyright 1977, 78, 79, 80 (C) by Microsoft Created: 14-Jul-80 7 version i desired. Th tw file 'BIOS.COM an 'CBIOS.COM ar example o dis an termina I/ routine supplie b Digita Reasearch. MOVCPM Th 'MOVCPM.COM featur o CP/ ca b use t directl relocat th COL an WAR boo programs th CBIOS an CP/M I modification ar don t an o th above th 'MOVCPM.COM progra wil relocat al bu th modifie portions Follo th procedure o th nex pag i an o th abov program ar modified. I relocate CP/ progra i create usin th command: movcpm xx th relocate CP/ wil begi executing However th relocate CP/͠ i highl unstable I particular i war boo occurs th syste ma no reboo properly Thi i no bu i th 'MOVCPM.COM program bu rathe functio o th origina an relocate CP/M's I i recommende tha th followin procedur b use instead: movcpm xx * sysgen cold boot ca eras th dat o th har dis an i ca no b recovered I yo hav t forma th dis thin abou wha i o th har dis when you use the 'D' option for formating. Yo shoul tak not tha i you floppie hav bee adde t you syste vi th INSTAL progra o tha the ar drive C: D: o abov the th CP/ driv number hav nothin t d wit FORMT an tha driv wil alway b th firs flopp dis drive. RECONFIGURING A SYSTEM T reconfigur th CP/ syste fo you particula hardwar th 'CBIOS&.ASM an 'ABOOT&.ASM file shoul b modifie t mee you requirements Man parameter o th Cbio ca b modifie b changin th valu o certai ke variable whic ar use durin th assembly Fo exampl th labe MSIZ i use t adjus th memor siz o th reconfigure CP/M th labe FIRS is used to specify the ordering of the disk drives, etc. Onc th 'CBIOS&.ASM an 'ABOOT&.ASM fileH. -Edi th 'ABOOT&.ASM file mak sur th followin label have these values: MSIZE = 48 Specifies 48K of memory. FIRST = 1 Specifies Discus Hard Disk drive precedes the Disk Jockey 2D drives. MAXHD = 1 Specifies one Discus Hard Disk drive. MAXFFLOP 2 Specifies 2 Disk Jockey 2D drives. HDORG = 50H Discus Hard Disk I/O ports begin at 50H. ORIGIN = 0F800H Disk Jockey 2D begins at 0E000H. -Assemble the 'CBIOS&.ASM' file: A>MAC CBIOS& -Assemble the 'ABOOT&.ASM' file: A>MAC ABOOT& -Fin th valu o th labe 'OFFSETB i th 'ABOOT&.PRN file. A>TYPE ABOOT&.PRN Watc fo th labe 'OFFSETB t b printe o th console record the value, 0D00 in this example. -Fin th valu o th labe 'OFFSETC i th 'CBIOS&.PRN file. A>TYPE CBIOS&.P the system. This will insure that the newly relocated CP/M is stable. Fo user wit th Discu Har Dis System th 'MOVCPM.COM progra relocate th CBIOS an BOOT fo th Har Dis version NOT fo th flopp version. ASSIGNING DENSITY User familia wit th Lifeboat/Morro Design 2 CP/ Ver 1. wh ar accustome t usin th 'DENSITY.COM progra wil appreciat th automati determinatio o th densit o diskette Ther i n nee t infor CP/ Ver 2. ahea o tim o th densit o diskette Jus inser th diskette th res i al take car of. Car mus b taken however whe removin o replacin diskett whic ha alread bee accesse b CP/M dis rese operatio shoul b performe b b doin war boot o makin BDOӠ cal t rese th dis syste (se th CP/͠ interfac guide). A thes ne feature hav bee adde th siz o th Cbio ha grow t th poin wher th v hav bee edite an reassembled th followin procedur ma b use䠠 t incorporat th ne driver int CP/M: -Typ "TYP ABOOT&.PRN" watc fo th labe "OFFSETB i th listing an recor it value. -Typ "TYP CBIOS&.PRN" watc fo th labe "OFFSETC i th listing an recor it value. -Typ "MOVCP x *" wher x represent th memor size i kilobytes o th desire system. -Type "SAVE 47 CPMxx.COM", with xx as above. -Type "DDT CPMxx.COM", with xx as above. -Type "IABOOT&.HEX". -Type "ROFFSETB", with OFFSETB value from the step above. -Type "ICBIOS&.HEX" -Type "ROFFSETC"with OFFSETC value from the steps above. -Type control C (^C) to return from DDT to CP/M. -Typ "SYSGEN". CP/ wil reques th nam o th sourc drive Answe b pressin retur (a thi poin th sourc fo th ne syste i i RA memory no o th dis wher yo wan it). -Typ th destinatio drive-- throug RN Watc fo th labe 'OFFSETC t b printe o th console record the value, 7600 in this example. -Relocate the CCP and BDOS parts of CP/M: A>MOVCPM 48 * -Save the system image on the disk: A>SAVE 47 CPM48.COM -Load the system image into memory with DDT: A>DDT CPM48.COM NEXT PC 3000 0100 -IABOOT&.HEX -R0D00 NEXT PC 3000 0000 -ICBIOS&.HEX -R7600 NEXT PC 3000 0000 -^C A> -Now, write the system image out to the disk: A>SYSGEN Answe th firs questio aske wit return th syste imag i i memory Answe th secon questio wit th destinatio drive for the new system. -Reset the system and do a COLD BOOT. SINGLE COMMAND Th progra 'SINGLE.COM i o interes mainl t thos user wh hav onl singl drersio fo th doubl densit controlle ca n longe fi o th firs tw track i formatte i singl density Thi mean tha yo ca onl boo u wit diskett tha ha bee formatte wit 102 byt sectors. FORMATTING A DISKETTE Th comman fil 'FORMT#.COM wil format o initialize flopp diskett i an IB standar format Typin FORMT# wil execut progra tha wil inquir th secto size 128 256 512 o 1024 t b formatted an th drive-- A B C o D-- wher th initializatio wil tak place Th driv specifie reflect th flopp drive only nothin else S formattin driv 'A format th firs flopp connecte t th Dis Jocke 2D Formattin diskett wil automaticall writ secto header fo th selecte secto size I i i desire t forma th har disk th progra 'FORMATHD.COM shoul b used. CAUTION Yo mus us cautio wit th FORMATH progra a thiP B carefu abou whic drive (Har Dis o Floppy ar drive A, B etc a thi step destroys the original CP/M on the destination drive. -Reset the system and do a COLD BOOT. A a exampl o th relocatio procedure th followin i sampl configuratio fo Cbio wit 48 o memory th Dis Jocke 2 a 0F800H th Discu Har Dis a 50H an Dis Jocke 2 I/O. -Edi th 'CBIOS&.ASM file mak sur th followin label have these values: MSIZE = 48 Specifies 48K of memory. FIRST = 1 Specifies Discus Hard Disk drive precedes the Disk Jockey 2D drives. MAXHD = 1 Specifies one Discus Hard Disk drive. MAXFFLOP 2 Specifies 2 Disk Jockey 2D drives. IOTYPE = 3 Specifies Disk Jockey 2D I/O. HDORG = 50H Discus Hard Disk I/O ports begin at 50H. ORIGIN = 0F800H Disk Jockey 2D begins at 0F8008iv system It purpos i t allo thes user t cop CP/ file betwee diskettes User wit dua driv堠 system ca perfor suc copie faste an䠠 mor convenientl simpl b usin PIP. 'SINGLE operate b interceptin CP/ call t dis driv selec routines Rathe tha selectin NEנ drive 'SINGLE prompt th use t plac a "A o "B diskett int Driv A I othe words 'SINGLE turn Driv int logica dua driv system Th user however mus kee trac o whic diskett ha bee designate th "A diskett an whic th "B diskette A a example t cop fil fro driv t driv A giv the command: SINGLE S t begi operatio i singl mod (th "S argumen i fo Start) Th progra wil respon tha 'SINGLE ha bee installed an retur t CP/M An operatio tha involve changin drive wil no resul i promp t plac th "A o "Br ca rea i (th DJ1 doe no utiliz th 179 controlle chip bu th Dis Jocke 2 cannot. Essentially th 'REGEN progra read complet trac o dat an forma informatio int memory filter ou th formatting re-format th trac an the re-write th data Thi proces i repeate unti th whol diskett ha bee regenerated Th origina diskett i bot th sourc an destinatio diskette an mus therefor b writ enabled. Th fina resul shoul b singl densit diskett tha i readabl bot o th machin tha originall produce i a well as on the Disk Jockey 2D controller. Simpl typin 'REGEN wil invok thi program I ha enoug prompt t explai it use. FIRMB Th fil 'FIRMB.ASM contain th firmwar sourc fo Dis Jocke 2Ġ Mode controller BOOTHD Th progra 'BOOTHD.COM contain boo stra loade fo th Discu Har Dis cont(INP:/OUT:SPACE)(INP:/OUT:SPACE)(INP:/OUT:SPACE)(INP:/OUT:SPACE)(INP:/OUT:SPACE)(INP:/OUT:SPACE)(INP:/OUT:SPACE)(INP:/OUT:SPACE)(INP:/OUT:SPACE)(INP:/OUT:SPACE)(INP:/OUT:SPACE)(INP:/OUT:SPACE)(INP:/OUT:SPACE)(INP:/OUT:SPACE)(INP:/OUT:SPACE) COPYRIGHT (C) 1979, DIGITAL RESEARCH, PIP VERS 1.5$$$ SUB =.:,<> _[]INPIRDPTRUR1UR2RDROUTLPTUL1PRNLSTPTPUP1UP2PUNTTYCRTUC1CONNULEOFDISK READ ERROR$DISK WRITE ERROR$VERIFY ERROR$NOT A CHARACTER SINK$READER STOPPING $NOT A CHARACTER SOURCE$ABORTED$BAD PARAMETER$INVALID USER NUMBER$RECORD TOO LONG$INVALID DIGIT$END OF FILE, CTL-Z?$CHECKSUM ERROR$CORRECT ERROR, TYPE RETURN OR CTL-Z$INVALID FORMAT$HEX$$$$NO DIRECTORY SPACE$NO FILE$COM$START NOT FOUND$QUIT NOT FOUND$CANNOT CLOSE DESTINATION FILE$DESTINATION IS R/O, DELETE (Y/N)?$**NOT DELETED**$$$$$$$NOT FOUND$COPYING -$REQUIRES CP/M 2.0 OR NEWER FOR OPERATION.$UNRECOGNIZED DESTINATION$CANNOT WRITE$INVALID PIP FORMAT$CANNOT READ$INVALID SEPARATOR$1 :2L> ̈́M9  diskett int Driv A I ou example th "B diskett woul b th on wit th fil whic w wis t cop ont th syste diskette On coul no type: PIP A:DEST.FILE=B:SOURCE.FILE[V] Dependin upo th lengt o th fil t b transferred fai numbe o request t plac th "A o "B diskett int Driv wil appea unti th cop i completed A entir syste dis coul als b backe u thi way Firs on woul forma th destinatio disk Next th command: PIP A:=B:*.* woul begi th copy Thi proces wil tak man man swap bu wil d th job Th numbe o diskett swap depend o th amoun o memor whic PIP ha t use an o th amoun o dat t b transferred. I general an CP/ comman whic ca b use i regula mod ca b use whil i singl mode Ther ar tw exceptions however Th 'FORMT#.COM program becaus i make direc call t Disroller 'BOOTHD.COM coul b programme int PRO s tha yo coul boo directl ont th har disk withou havin t bothe wit th floppies. HDFIRM Th sourc fo se o lo leve driver fo th Discu Har Dis ma b foun i th fil 'HDFIRM.ASM' Th driver ma b堠 use䠠 b applicatio program whic mus hav堠 direc interactio wit th har disk' hardware.  Th fina resul shoul b singl densit diskett tha i readabl bot o th machin tha originall produce i a well as on the Disk Jockey 2D controller. Simpl typin 'REGEN wil invok thi program I ha enoug prompt t explai it use. FIRMB Th fil 'FIRMB.ASM contain th firmwar sourc fo Dis Jocke 2Ġ Mode controller BOOTHD Th progra 'BOOTHD.COM contain boo stra loade fo th Discu Har Dis cont221@:2!o6+6+6!6#6!6#6:G*o .!N6:^*M^!K6!6!6+6' :$::=2K  :ʤ\:ҷ\x'Ͳ:!\͢  :͈'! Ͳ:$: $͈Ͳ!N6' :!Cwͯ !6:^͢c!6{:/>!/H{ͯ :<2Š ::=HҮͯ !6:Ҿ:2 !6::/H͈;!6:> !/>HHͯ :^!w:<2:0}:@E}:!S!W6: z!]6:cm!c6:_z!_6l ::,: HHҰͯ : 2ó:E:1:2v!q!*8!*6: >ͦ>ͦ!q:_  !p+q.*   !q*&!p+q*2!p+q*2!p+q*22!p+q*!p+q*!p+q*!p+q*2!p+q* Jocke 2 firmware wil no functio properl i singl mode an 'MOVCPM.COM becaus o memor relocatio problems. To exit single mode, type: SINGLE E Thi wil retur th use t th standar CP/ syste (Th "E argumen i fo End) Typin 'SINGL E' whe no i singl mod wil repor a erro an retur withou an chang bein made a wil typin 'SINGL S' i alread i singl mode. REGEN Th 'REGEN.COM comman regenerate CP/͠ singl densit diskette whic hav bee formatte i suc wa s tha i i incompatibl wit th norma operatio o th 179 controlle chi (IMSA diskette i particula hav thi problem). Th 'REGEN progra i designe t b use wit diskette whic hav bee formatte incorrectly-- no wit diskette tha hav bee partiall destroyed Th bes sympto o diskett tha coul b use wit th 'REGEN progra i tha th Dis Jocke 1 boa9!p+q* !q*& *M *M !p+q*!!p+q*"!p+q*$!6  !kp+q*j> >ڪ Þ !qp+q/ *pDM9: :M2r:N!r !:r *r& N!r4 !6:͔: :ͳ.!ws+p+q+p+q:w=2wN *s*u w*s#"s*u#"u' !"*M^7 !x6:!xھ **DM͆ 2yʭ :yʗ ͯ *"*6:2x÷ *"!x4d !"/ !j}=2| !"*KM^'_ !z6:|!z1 * "}*}DM͆ ' ͯ *"!z4 :e !"͆ !z6:|!z '? 2*H#"H!{6:{ր!Ң *{& :{4 2!{4m *":ڹ ͯ !z4I '2!"!q: !4>!S :S! :2*M! ^#V͎ * :w*#" = = = = = ͯ  *M !6q  !6q  !6q  *& !6à  !6 à  !60à  *& !6  !6  !6  *& . 1 4 7 : = F P [ f q  ÷:S:QHI:N<22: H@"2Í202O> c!6Í202O> ڍ*&O*& !sc*&P :w:·>!ұͯ :22:_!6=!6>'!E!4!p+q*0 !r+s+p+q*~$7*>*>H&>*#"*#"> 2:R͎:!6!6=2:ʙ!6:“H9Ž>!6-e!6ͻ2=2ʺ-é:>>"ͻ2:!!5ͻ2ͬ!\-:>>!p+q:,!6*DM9:<!6:z 2W!6D*&L :w:<2Ov*:>=20O> ڒ:0:AO>Ҥ::A }}Hͬ!wͻO`idͻV[2O>2:!X!6:!:=O!L NE!4 E E:/.*&L 6$L9k9.Xͯ *KM^020 :020:121'ͳ':²ͯ !G6!"!"7 *M^n/ :a/:H!6:ͯ !&6NAME prl -- "page reelocatable" format DESCRIPTION Prl ("page relocatable") is a file format for relocatable object code defined in the Mpm users manual. It begins with a 256 byte header: header[0] Octal 375. Not documented by Mpm. header[1 to 2] Program size (low byte first). header[3] Not documented by Mpm. header[4 to 5] Size of any required buffer space (low byte first). header[6 to 255] Currently unused, reserved by Mpm. Next comes "program-size" bytes of binary object code assembled at address 0. Finally comes a "bit map", one bit for each byte of code, beginning with the most significant bit of the map's first byte. A 1 bit indicates that the corresponding byte of code should be relocated by adding to it the most significant byte of the load address. The usual way to make a prl file is to assemble the source code twice, once at 0 and once at 100 hex. Then build the map by comparin :2!q: " *M n :c4 *M n :2!c:Q !c:2: !:cw>!n !5 Y : { !6!q:!lwҙ  â :0O !q:O| :O| !6:]2l:o'2o:n'2n:m'2m*mMͣ *nMͣ *oMͣ :]:   *}2D" * * *&"!q:UY: Y:ҩ: ʩ:_2ʘ:€!6<:<2!ژ!6 >!]Ҥ; !6:Q::H: !6*M : !6!q:a/>z!/H:_2:!q:A/>Z!/H8: 2::=O>m:W!Q} Hmd>9>!6:2*M!E ^#V͎ڗO **~2*#"m2m͖ 2m!6m!6m!6 m2mͯ m!62m!62m!62m!62m'2:2:TҒ:2!6*ME:2::Ҳ:<22ý: 2:} >ͯ :i:2:d*M:[ 2*">!b!ͯ >!`0ͯ !q:E:24J!46*}a!44EJ *KM^'́:‚ͯ !36'n::0:f9OY#9.3'ͳ.:020' 'ͳ'7 6'!j>A+!s!"@͓1!"<**"͓n "Dn"":!Q2҂:X!Wғä:ڤ*MEÓ:ұ@@:O2Mc;!6#6>!)*&P ~"::H:H:H:H"!6!4:_jYO jM*"S*" 3@bl*M1͓!""7 *M^͆ \͔!":͎H*#"ͧÝ/ :>͛9ͯ .*#":_!' !'6!36' :1/!aE*#">z?C9IͲÁ.!6> !ڇ*&' ~2 ʀ: y.*M!4Q>!қ:=2á:2:Ҭ\>!ҿ:=2K:2K!:!:K\: \!p+q͈*g the bytes one-for-one, setting the corresponding bit to the difference. If two bytes differ by more than 1, then some non-relocatable construct has been used. BUGS The load address must be on a page boundry (multiple of 256). prl.doc 8/5/80 gf ruct has been used. BUGS The load address must be on a page boundry (multiple of 256). *M:>!(:=2%> >>!F!5+N! ~2!4<2T>>!b}*bMͭz:b2!b6:<2é>!`ҥ*`MͭҞ!`6!6> :é:(!q:!wO! ~2*& :w>!:!4!6>:N<2N!> *N& N2 !p+q!6!6+6 !6: S: M!6g8:N2M*M8p!6!6!6>!ڕ*&P 6!4z!6!6#6#6!6*M8:ھ:*͇g2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~%ʓ*V#"Vk*V "Ve!V:V:V#*V!VyOx#G*V!N#F!~#fo!O*V*V#"V~öH!>w#w!6 *V~-!!>#"V6.>2V2V!:V:V#ҩ*V*V !yx#*V*V#"V!*V ~*V#"V*V#"V*V*V#"V6e!#~*V*V#"V6-!!~#fo>o>g}|!:V:V#e*V*V#"V60*V#"Vé*V*V#"V6+*V*V#"V!N#F! I0 }*V*V#"V!N#F! LI0 }*V!yOx#GöH͠H!9!~#fo"V!~#fo"V!!lVrD*V*V#"V6-!!vV~#~ˆ!vVzGG!"V!!! >+F+N=¶*V,! 9ywx#w!!~#fo*V }|!>>#!>w#w!!N#F!!ͯ5~w#~w!!  #g!~#fo!yOx#G*V "V!!~#~!>#*V*V#"V60!V>#*V*V#"V6.!>#*V*V#"V*V!yOxGyx*V*V#"V~OG0yw!~w#~wß!#~? !V>#? *V*V#"V60!~w#~w:V2V:V2V!V># *V*V#"V*V!yOxGyx҄ *V*V#"V~OGÇ 0yw:V2V:V2V? *V!yOx#GöHbad getl call ͠H!~#fo"V!~#fo"V!V~# !! !.>!ͮ?>2VK *##~#fo#*N#FJJ))!~#foy0 x#g !~#fo ~#g "O!~#foA !ͧ"O*}o|g"numberbad%p %p %p %i %p? O!~#ʾ !N#F! ͮ!͗!C ywx#w+~ #~ "O!!  # !!  #6 !N#F!x !N#F! ! ͮ! 9!~#œ ͮ?!~#foMD"OO!9!!P!ywx#w!! !N#F!ywx#w!! !N#F!ywx#w!~#µ "O:0 !>9 "O! !!N#F!ͽ !~#foMD"OO!~#fo#~ !~#fo#~: ͌ !~#fo~aJ !~#fo>pJ !~#fo~OG! MD"O!~#fo~A| !~#fo>P| !~#fo~OG! MD"O͌ "O and sector numbers, in that order, one per line. and mapfile [if given] is a file of track, head, (default is e -- any drive on the hard disk will do), where mapdrive [if given] is a single letter a to p Use putbad [mapdrive] [w#w!:Vw:V#w!w#w!*V#"V*V~*V#"VC*V~+C!*V#"V*V~*V#"V! !*V͟i`"V!>w#w*V~.! !*V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#fo"V*V ~#fo"V*V*V~#fo ####!Vy7x#/8*V*V~#fo####  *V *V ~#~öHout of heap space ͠H!N#F!N#F͐8i`"V!V~#s8*VMDöH!!28!.>!ͮ?öH͠H!~#fo"V:V:Vҳ8ø8*VMDi`#}o|g##"V!G!9~#fo^#VzD_>WxƀGzƀWyoxڼDD>D>D! 9N#F!9~#fo# ##D +DDчPڼD÷D!9!9###~w+~w L×P!9~!M/<òLʗPO!9~#fo##+~w+~w###~w+~w /M×P!9~#fo##w>#w>+++w>#wMD!9!9!N#F!>w#w#w##w#w!!&O! N#F !#~¯M×PjMq#px#w#wÎMjMq#p#w#wÎMjM w #w #w #wÎMjM w #w #w #wÎM~#N#~#foy#/Nx#0N+++~#fo##N!9!9!N#F!PyO!q#p! N#F!Py€N!N#FN!yOx#GNyN+~w#~w!íNO>G! ~#+~w³NNw yNîN!MD!  #wN!N#F!&O!MD ! ~#fo+ #w O×P!9!9N#F! ~LOi`+ >#w?OZO+ZONOP! ~O# +~wgO!9~w#~wZO! ~Oi`+ #~wŽO!9~w#~wO Oi`7#~w²OZO!9~Oi`+#wOPOi`>#wO>w! !9z~w+~ w++~ wP!!9N#F!9^#V! #~#~ -P! ~#~WNP+]PTPyP>w+~w}yPi`>#wpPJ!9N#F###q#p+++q!9N#F#q#p* * REGEN.ASM vers 1.1 september 30, 1980 * * By Bryan G. Moore * Design Technology * 4888-H Ronson Court * San Diego, CA 92111 * * Modified for all revision Disk Jockey 2D'S by Bobby Dale Gifford * 9/30/80 * * The program is used to correct the format on Single Density * IBM 3740 compatible diskettes. Attempts to use other diskettes * will probably result in an error message. * * vernum equ 11 ;Version number * 10 origin equ 0F800H bdos equ 5 ;CP/M entry point wboot equ 0 ;Warm boot diskio equ origin+3f8h datreg equ diskio+7 drvsel equ diskio+1 cstall equ diskio+3 cmdreg equ diskio+4 secreg equ diskio+6 trkreg equ diskio+5 sbegin equ origin+3deh ramins equ origin+7e2h dside equ 10Q unloadb equ 17Q sicmd equ 131Q immirq equ 320Q unloada equ 30Q restor equ 11Q rtcmd equ 0e4h wsec equ 0a0h rsec equ 80h index equ 20Q trkzro equ 4 intrqa equ 1 intrqb equ 4 lhsdenb equ 90dh lhddenb equ 80ch lhsdena equ 111h lhddena equ 10h acr equ 0dh alf equ 0ah org 100h !6!N#F!Py>E! N#F > TF!~^E!>#wOE!4!q#p! N#F zE!4 !PyTFy!Ox#Gyƀ+wx#w !#w §E!69!#~w ºE!MD! +EEE!MD!  #E!4! +~w F!5³E!N#F!&O!~8!w! ~#+~w F!~G!MD!  #G!#~w #G!5F!N#F!&O!~\G!~#\G~w! N#F !#~kG×P!9~#fo~#ʍG~ƀw!9!9!N#F ! #w«G!~ƀw! N#F!4N×P!9N#F!9~#fo~#~G×PMD!9!9!N#F!Py\Hy֨OxGBH!~#+~w0Hy&H\Hy\H!#~wOH BH! GN#F!~#~×PGN#F!~+~ +~+~ ×PGMDgH!9*V*V*Vi`!"V"V"V!9~w#~w#~w#~w+MD!9 _ #H{ !///////;CP/M Tpa begin lxi sp,stack ;Stack pointer lxi d,prompt ;Sign-on call pbuff ;To console lhld origin+7 ;Adjust the calling routines for different inx h ; revisions of the Disk Jockey mov a,m lxi h,stdvsl+1 lxi d,4 mov m,a xri 3 dad d mov m,a dad d mov m,a start lxi d,srcmsg ;Prompt the user to select drive call readdrv ;Get a drive designator sta sdisk ;Save source disk lxi d,dstmsg ;Prompt the user to select drive call readdrv ;Get drive designator sta ddisk ;Save destination disk mount lxi d,mntmsg ;Prompt the user to call prbuff ;Read console jnz start ;Ignore anything else regena lxi d,acralf call pbuff xra a ;Select source call select ;Select the drive lxi h,cmdreg mvi m,immirq ;Immediate interupt request mvi a,40h ;Simple delay wirqda dcr a jnz wirqda mov a,m ;Check ready rar jc notrdy ral ral jc notrdy lxi d,0 call gtindx ;Get polarity of index pulse call gtstat ;Test for double sided ani dside jnz ixlo94H! 9~I+w>#w! 9N#Fx1IO>GHAIO>G! 9q#p×P! 9~cI+w>#w! 9N#FxwIO>GH҇IO>G! 9q#p×P! 9N#FH! 9q#p×P! 9N#FH! 9q#p×P!9~I/J!9~I/J!9~'J/#>+++>#~#~#~ #~{ʵK>#># >#mK!9MD!9~#fo͕K! 9MD!9~#fo͕KJ!9N#F!9KzKmK!9MD!9~#fo͕K! 9MD!9~#fo͕KJ!9N#F!9KzKmK! 9MD!9~#fo#̓K!9MD!9~#fo#̓KJ!9N#Fkb9͵KzKmKaL!9~L/ upper nibble mov m,a ;Save in memory cmp c ;Match ? rz ;Yes - Return inx h ;Bump data pointer dcr b ;Hit byte search count jnz searc ;Loop til search complete pop psw ;Clear stack jmp terr ;Go to error routine * * Checksum checker * Adapted from the Disk Jockey I Shugart Firmware * Performs the Cyclic Redundancy Check (CRC) * The polynomial is G(X) = X^16 + X^12 + X^5 + 1. * * Entry SETCRC - Pointer to data block in HL, * Field length (in bytes) - 1 in D,E * Verify checksum at end of block * Return with Z set if match * setcrc push h ;Save start address pointer xchg ;Flip start addr to DE dad d ;HL points to last byte xchg ;Swap back again crech lxi b,-1 ;Initial value per formula crechx push d ;Save terminating pointer mov a,m xra c mov d,a rrc rrc rrc rrc ani 0fh xra d mov e,a rrc rrc rrc mov d,a ani 1fh xra b mov c,a mov a,d ani 0e0h xra e mov b,a ;Update high order CRC word mov a,d rrc ani 0f0h xra c mov c,a ;S readdrv ;Invalid input ret * * Pbuff is the CP/M print buffer function * pbuff mvi c,9 jmp bdos pchar push h push b push d push psw mov e,a mvi c,2 call bdos pop psw pop d pop b pop h ret * * Rbuff is the CP/M read buffer function * prbuff call pbuff rbuff lxi d,inbuff mvi c,10 call bdos lda inbuff+1 ana a rz lda inbuff+2 cpi 'a' rc cpi 'z'+1 rnc sui ' ' ret inbuff db 10,10 ds 10 conin mvi c,1 call bdos ani 7fh cpi 3 jz finish ret stdvsl sta diskio+1 ret stbits sta diskio+2 ret gtstat lda diskio+2 ret unload call model mvi a,unloada jz stbits mvi a,unloadb jmp stbits * * Messages and data * prompt db acr,alf db 'Format correction program, VERS ' DB (VERNUM/10)+'0','.',(VERNUM MOD 10)+'0' DB acr,alf,'by Design Technology, San Diego, CA$' srcmsg db acr,alf db 'Select source drive A,B,C, or D (RETURN to exit): $' dstmsg db acr,alf db 'Select destination drive A,B,C or D (RETURN to exi1H͌*#~!www9v2nv2͌͠!6>@=G~xxgi^{¢ziFU͌::ʐ:A_͌->!6>@=±~xx1{gczx!6 ~~~x2> 2ͧ! >2w,$ !"! >2#5:š#~š#:š#~š###b*s#r#"!4~5*+V+^!ښ>> 22!">2ͧ:2*^#V#"!>2w !4~ڵͧͰ!>2>2~ ͧ:k:<!4~M6͠RF:G:P>*͑Z:=2Z>Y`e!5ªy͌:./, Ҁ:g}0‘. "G-!!5u:§gʳ¼~w#Ú~W_WOzGzO#z {G:Sx2:t/::G:̌O> I?p_ xyp:͌ͣ)Avv _͌ ::a{ ¼~22:p>> Format correctioave low order CRC word inx h ;Bump pointer to next data byte pop d ;Restore terminating pointer mov a,d ;Get high order cmp h ;Test for done CRECH jc crec1 ;Done - Test CRC and set flags jnz crechx ;Continue - next data byte mov a,e ;Get low order and cmp l ; test terminating pointer jnc crechx ;Loop if more bytes to scan crec1 xchg ;Swap CRC word pointer to D,E pop h ;Restore data start address pointer ldax d ;Test low order cmp c ;Clear Z flag if no match inx d ;Next byte rnz ;Done if error ldax d ;High order cmp b ;Set flags and ret ;Return * * Select selects the disk specified by drive A and * loads the head * select mov b,a ;Save in B lda cdisk ;Get currently selected disk cmp b jz loadhd mov a,b ;Recover request sta cdisk ;Update selected drive ana a lda sdisk ;Assume source lxi d,mntsrc ;Mount source message jz sselec ;Source select ? lda ddisk ;Not source, destination lxi d,mntdst ;Mount destination message st): $' mntmsg db acr,alf db 'Press RETURN to correct the format' db acr,alf,'on the above specified diskette: $' fmessg db acr,alf db 'Function Complete' db acr,alf db 'Type R to reformat another, RETURN to exit: $' wmessg db ' is Write Protected.$' rmessg db ' is Not Ready.$' amessg db acr,alf db 'Drive $' sglside db ' is not single sided.$' mntsrc db acr,alf db 'Insert source diskette, then press RETURN: $' mntdst db acr,alf db 'Insert destination diskette, then press RETURN: $' tmessg db acr,alf db 'Track read error' db acr,alf db 'Invalid CRC, Illegal Density, or' db acr,alf db 'Illegal track or sector sequence.$' retmsg db acr,alf db 'Error occured on Track: ' tdsply db ' .' db acr,alf db 'Type R to reformat another, RETURN to exit: $' vmsg db acr,alf db 'Diskette will not accept re-formatting.' db acr,alf db 'Permanent Verification Error and' db acr,alf db 'probable physical damage.$' acralf db acr,alf,'$' * * Data spacen program, VERS 1.1 by Design Technology, San Diego, CA$ Select source drive A,B,C, or D (RETURN to exit): $ Select destination drive A,B,C or D (RETURN to exit): $ Press RETURN to correct the format on the above specified diskette: $ Function Complete Type R to reformat another, RETURN to exit: $ is Write Protected.$ is Not Ready.$ Drive $ is not single sided.$ Insert source diskette, then press RETURN: $ Insert destination diskette, then press RETURN: $ Track read error Invalid CRC, Illegal Density, or Illegal track or sector sequence.$ Error occured on Track: . Type R to reformat another, RETURN to exit: $ Diskette will not accept re-formatting. Permanent Verification Error and probable physical damage.$ $selec push psw ;Save drive to select lda sdisk ;Get source drive mov b,a ;Save in B lda ddisk ;Get destination drive cmp b ;Same ? push psw cz unload pop psw push psw cz pbuff pop psw cz conin ;Print string, and read console pop psw ;Recover drive to select selda mov c,a mvi a,7fh ;Drive select bits qloop rlc ;Rotate select bits dcr c ; to proper drive position jp qloop ani 3fh call stdvsl loadhd call model lxi b,lhsdena jz selprep lxi b,lhsdenb selprep mov a,b call stbits mov a,c jmp stbits * * Get index level * gtindx call model mvi b,0 rz mvi b,index ret * * Get disk Jockey 2D model * model lda diskio-4 cpi (ret) ret * * Prompt the console for a drive, then read and verify the drive * selected * readdrv push d ;Save prompt call pbuff ;Send the prompt call rbuff ;Read the console character pop d ;Recover prompt jz exit sui 'A' ;Subtract ASCII bias jc readdrv ;Invalid input cpi 4 ;Upper limit jp * sdisk db 0ffh ddisk db 0ffh cdisk db 0ffh trcnt DS 1 ;Track read retry counter rwcnt DS 1 ;Re-write counter tkno DS 1 ;Track number secno DS 1 ;Sector number secix DS 2 ;Sector data pointer table pointer sectb ds 2*26 ;Space for sector address table ds 40 stack equ $ org (($+255)shr 8)shl 8 ;Must start on page tkbuf ds 1800H ;Lots of space for track buffer nbuf equ $-1 ;Last byte in track buffer storage area end ? ***************************************************************** * * * Single Drive copy program. This program allows pip (or any * * other program) to copy or move data between diskettes by * * prompting for a disk change operation on drive A. Will allow * * back ups to be made with only one drive. * * * * Written for Thinker Toys by Bobby Dale Gifford. * * 12/17/79 * * * * The program SINGLE tricks CP/M into thinking there are * * two drives when in actuality only one drive is present in the * * system. To execute the program give the command: * * SINGLE S * * followed by a carriage return. The messge: * * SINGLE INSTALLED * * should appear, followed by the CP/M prompt. At this time, * * if an access to drive B is made, a prompt will appear * * requesting you to insert a diskette of the proper density * * into drive A. Type a return. CP/M will now access drive A * * thinking it is actually drive B. When CP/M return to drive * * A, another p * * Exit by printing an error message. No change made. * * * ***************************************************************** exit lxi d,what ;No change message exit1 call list ;Entry point for different message on exit jmp wboot ;Do a warm boot on exit ***************************************************************** * * * List a message on the CP/M console device. * * * ***************************************************************** list mvi c,9 ;Print buffer command jmp entry ;Enter CP/M ***************************************************************** * * * Insert the code for the new selection routine into the ram * * below the ccp. * * * ***************************************************************** insert lhld entry+1 ;Get pointer to base of BDOS lxi d,-(ccpsize+6+100h) dad d push h ;Save pointer to relocated single lxi d,heart ;Pointer to code to relocate lxi b,map ;Pointer to relocation map relrst byte of the jump cpi (jmp) ;Is it a jump opcode ? jnz exit1 ;Error if not inx h mov a,m ;Should point to newsel cpi newsel-heart jnz exit1 ;Error if not inx h ;Point to high byte of address mov d,m mvi e,5 ;Form address to controller page ldax d ;Get the byte of controller address mov m,a ;Reconstruct controller address dcx h mvi m,1bh ;Offset into controller rom to drive select lxi d,remmsg jmp exit1 ***************************************************************** * * * Unknown command error message. * * * ***************************************************************** what db acr,alf db 'Unknown command - NO change made.$' ***************************************************************** * * * Successful insertion message. * * * ***************************************************************** insmsg db acr,alf db 'Single installed.$' ***************************************************************** rompt will be given to you requesting that you * * reinsert the original drive A diskette. This procedure will * * continue until the command: * * SINGLE E * * is given followed by a carriage return. A message should * * appear saying: * * SINGLE REMOVED * * followed by the CP/M prompt. * * The program is intended to allow backing up diskettes * * for those users with only one drive. To back up a diskette * * follow these these procedures. * * * * 1) Execute SINGLE S. * * 2) Use PIP to copy all or a selected group of files * * (actually any program should run). * * 3) Follow the prompts for inserting diskettes ( Suggest * * you write protect the original diskette (Tab OFF)). * * 5) When the CP/M prompt reappears, ececute SINGLE E. * * * ***************************************************************** title '*** Single Drive Utility For CP/M Ver 2.2 ***' acr equ 0ah ;Carriage return alf equ 0dh ;Line feed wboot equ 0 ;CP/Mo ldax b ;Get a relocation byte ana a ;Test if byte needs relocated jm putjmp ;If minus then all done mov m,h ;Assume relocation jnz incre ;Move this byte directly ldax d mov m,a incre inx h ;Bump relocation address inx d ;Bump source inx b ;Bump relocation map jmp relo putjmp lhld wboot+1 ;Get pointer to CBIOS lxi d,seljmp ;Offset to drive select jump dad d ;Form pointer to drive select jump lxi d,badmsg ;Message pointer mov a,m ;Get the jump opcode cpi (jmp) ;Is it a jump instruction ? jnz exit1 ;Exit if not a jump inx h mov a,m ;Get first byte of jump address cpi 1bh ;Is it a jump with correct offset ? jnz exit1 inx h ;Get page address of controller mov a,m pop h ;Restore pointer to relocated code push h push psw ;Save page address of controller inx h lda entry+1 mov m,a ;Insert first byte of new bdos location inx h lda entry+2 mov m,a ;Insert second byte of new bdos location xra a sta entry+1 ;Modify entry to jump to * * * Seccessful removal message. * * * ***************************************************************** remmsg db acr,alf db 'Single removed.$' ***************************************************************** * * * Bad Cbios format message. * * * ***************************************************************** badmsg db acr,alf db 'Bad Cbios format found - NO change made.$' ***************************************************************** * * * Byte for byte map of code to relocate. A zero represents no * * relocation, a 1 represents a relocateable byte, and a 0ff * * represents the end of the map. * * * ***************************************************************** map db 0,0,0 ;jmp db 0,0,0 ;jmp db 0,0,0 ;jmp db 0,0,0 ;jmp db 0,0,0 ;jmp db 0,0,0 ;jmp db 0,0,1 ;lxi db 0,0,0 ;shld db 0,0 ;mvi db 0 ;mov db 0,0,1 ;sta db 0 ;cmp db 0 ;rz db 0,0,1 ;lxi db 0 ;ana db 0,0,1 ;jz  warm boot tpa equ 100h ;CP/M transient program area tbuff equ 80h ;Command line buffer ccpsize equ 800h ;Size of CP/M ccp aspc equ ' ' ;Space entry equ 5 ;CP/M BDOS entry location seljmp equ 30h ;Offset to jump to select drive ***************************************************************** * * * Main reconfiguration program. * * * ***************************************************************** org tpa start lda tbuff ;Check if any command given mov b,a ;Put counter in B lxi h,tbuff+1 ;Beginning of command line loop dcr b ;Check for end of command line jm exit ;If minus then error exit without change mov a,m ;Get charactor typed on command line inx h ;Bump scanning pointer cpi aspc ;Skip spaces jz loop ;Continue if space cpi 'S' ;Check for "Start" command jz insert ;Insert the code if true cpi 'E' ;Check for "End" command jz remove ;Remove the code if true ***************************************************************** * relocated code mov a,h sta entry+2 pop psw ;Restore controller page address lxi d,3 dad d mov m,a ;Form second jump (home) dad d mov m,a ;Form third jump (seek) dad d mov m,a ;Form fourth jump (status) lda wboot+2 ;Get page address of CBIOS dad d mov m,a ;Form fifth jump (oldinp) dad d mov m,a ;Form sixth jump (oldout) lhld wboot+1 ;Get pointer to CBIOS lxi d,seljmp+1 ;Offset to select drive jump dad d pop d ;Restore pointer to relocated code xchg lxi b,newsel-heart dad b xchg mov m,e inx h mov m,d lxi d,insmsg jmp list ***************************************************************** * * * Remove does the opposite of insert. It modifies the address * * to be in the original state. * * * ***************************************************************** remove lhld wboot+1 ;Pointer to CBIOS lxi d,seljmp ;Offset to select drive dad d ;Form offset to select drive lxi d,badmsg ;Assume error mov a,m ;Get the fi@db 0,0,1 ;lxi db 0,0,1 ;call db 0,0,1 ;call db 0,0,1 ;lxi db 0,0,1 ;call db 0,0,1 ;call db 0 ;push db 0,0,1 ;call db 0 ;pop db 0,0,1 ;lda db 0 ;ana db 0,0,1 ;lxi db 0,0,1 ;jz db 0,0,1 ;lxi db 0 ;mov db 0,0,1 ;lda db 0 ;ana db 0,0 ;mvi db 0,0,1 ;jz db 0,0 ;mvi db 0,0,1 ;jmp db 0 ;mov db 0 ;mov db 0 ;ana db 0 ;rz db 0 ;inx db 0 ;push db 0,0,1 ;call db 0 ;pop db 0,0,1 ;jmp db 0,0,0,0,0 db 0,0,0,0,0 db 0,0,0,0,0 db 0,0,0,0,0 db 0,0,0,0,0 db 0,0,0,0,0 db 0,0,0,0,0 db 0,0,0,0,0 db 0,0,0,0,0 db 0,0,0,0,0 db 0,0,0,0,0 db 0ffh ds 100h-($ mod 100h) ***************************************************************** * * * The rest of the program is relocated to execute with the * * current CP/M being executed under. * * * ***************************************************************** heart equ $ ;Beginning of code to relocate diff set tpa-$ oldbdos jmp 0 ;New jump to bd*********************************************** insamsg db acr,alf,acr,alf db 'Insert "A" (return) : ' db 0 insbmsg db acr,alf db 'Insert "B" (return) : ' db 0 crlf db acr,alf,0 end 3 Copyright (c) 1979, Digital Research????????????CON:RDR:PUN:LST:DEV:VAL:USR:DSK:TTY:CRT:BAT:UC1:TTY:PTR:UR1:UR2:TTY:PTP:UP1:UP2:TTY:CRT:LPT:UL1:R/OR/WSYSDIRR/O R/W SYS DIR ** Aborted **Active User :Active Files: Drive Characteristics65536: 128 Byte Record CapacityKilobyte Drive Capacity32 Byte Directory EntriesChecked Directory EntriesRecords/ ExtentRecords/ BlockSectors/ TrackReserved Tracks is Temp R/O Disk: d:=R/OSet Indicator: d:filename.typ $R/O $R/W $SYS $DIRDisk Status : DSK: d:DSK:User Status : USR:Iobyte Assign: =Bad DelimiterInvalid AssignmentBad Delimiter: Bytes Remaining On R/, Space: Invalid File Indicator** Too Many Files **File Not Found Size Recs Bytes Ext Acc65536 set to R/O Invalid Disk AssignmentWrong CP/M Version (Requires 2.0)!9"2!T OË!]6:\:] Hr3 Ë:\ʀË͇ /ҋͺ *2!"q*"&L ͐ ͐ ͐!$p+q*#~*#N͐*##"#÷!&p+q͠*%DMͱ O O!(q*(&os home jmp 09h ;Controller track 0 seek seek jmp 0ch ;Controller seek routine status jmp 27h ;Controller status routine oldinp jmp 09h ;Jump installed oldout jmp 0ch ;Jump installed newsel lxi h,oldbdos+diff ;Insert new bdos jump in case of warm boot shld entry+1 mvi b,0 ;Get last selected drive olddrv equ $-1 mov a,c ;Put new drive into A sta olddrv+diff ;Update last selected drive cmp b ;Check if same drive rz ;Done if same lxi h,insamsg+diff ;Insert A message ana a ;Test for drive A jz next+diff ;Take jump if selecting A lxi h,insbmsg+diff ;Else get insert B message next call mesg+diff ;Print message call oldinp+diff ;Get response lxi h,crlf+diff ;Echo carriage return and line feed call mesg+diff call status+diff ;Get status of currently selected drive push b ;Save track call home+diff ;Home drive pop b ;Restore track lda olddrv+diff ;Get drive to select ana a ;Test for drive A lxi h,trkb+diff ;Point to place to save track for B jz next0+di:G!~# S*Eʟ% *: ItCw#8*0~#~#~#:w#:w2|2www:ww*1 s#r%*0~#~#Vw+6 Unknown command - NO change made.$ Single installed.$ Single removed.$ Bad Cbios format found - NO change made.$NO change made.$ Single installed.$ S ' !"y2!g*!Z !Z :!VK!Qq:Ny#Z Insert "A" (return) : Insert "B" (return) : L!*p+q*)O2'!,p+q*+O2'O2'O!.p+q*-LRRLR\LR" O!/q*/& L!1p+q*0#L~*##N!ͽ͞"T!Vq*VMͳ!Xp+q!W* >Wr#MͲ!_p+q!`6>!`6*`&*^*`&Y />!`4 >*]& ~ O!]49!a6:a*]& ~2bO>z*bM >!b/~,H~:H~*H~.H~>H~<H~=H*]& 6!]4T!]4!cq*a&Y :cw!a4!gr+s+p+q!h6>fr*d*f!is*d́"dPY! "f>!h#~Haͫo!h6:i0O͐!mr+s+p+q*lTZs#r*lڶ*l+s#r*jN#F+q#pÌ!nq!"o"q}2uo&"s* s:n*sDM2u:uqos*s"s*o͊O !v6>!vQ*v&w 6`i+46)A*:'ʓ:'O!) ~2vʍ:vO!w 6,]!v6>!v*v&w ~һ*vM !v4˜8AO͐:͐ͱ*##N!ͽ"* N#F*͠"ff ;Take jump if selecting drive A lxi h,trka+diff ;Place to save track for A next0 mov m,c ;Save track number lda olddrv+diff ;Get drive to select ana a ;Test for drive A trka equ $+1 ;Storage for track on drive A mvi c,0 ;Pick up track for A jz seek+diff ;If selecting A then take the jump trkb equ $+1 ;Pick up track for drive B mvi c,0 jmp seek+diff ;Seek to proper track ***************************************************************** * * * Mesg prints a message on the console. * * * ***************************************************************** mesg mov c,m ;Get char to print mov a,c ;Put copy into A ana a ;Test for end rz ;Return if done inx h ;Bump pointer to message push h ;Save pointer call oldout+diff ;Print the char pop h ;Restore the pointer jmp mesg+diff ;Continue printing ***************************************************************** * * * Messages output by the program. * * * ******************A>!H% - *DM ͱͷDM  ͱ* N#F 9ͱ * ^#V))DM Tͱ* ~ *} *M!+s#r#4 !s+p+q!6!66:!ڄ !6!6>!r *&**&Y i !6!4+4A :} :!4- >!699 2¨ :!4: :2!6+6>! :O!9 DMi ͱ:!O!Y DMi :2:2͠!4 F :® )!6>!ګ ͠:O!9 DMi 8ͱ!6> !ڤ Å :2k ä  ͐:!O!Y DMi w !4C F :¿ >F : F :=229:Y= ;>9*&Y DM =2 I>!6:=28 :2:2 :!!29:Y T >:Y,e \>Ì !p+q*~:ʉ *N͐*#"o :͐!p+q!'"!6> **{2*́"PY! ">!+~H !6:0O͐à k͐COPYRIGHT (C) 1978, DIGITAL RESEARCH   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN~# zo&)))))))a{__> ͜> Ü͢~͜#ñ*'x: O!$'*{#z+| ^#V"'0P0K>N2)>2(9x)x\>2))x9ͽ! "$>2!!!4:(N>2":)!"4!"^!*FNy̓*$DM2&:& !ͱ͎ ͢{<2&:#{ê!"$>42))ͽg1i!ͱ:] T\<!ͬ2|\K ! DM\š3! ͬ!͎ͬ ʚAoTA26A2 ͢!,ͱ͎ ͢2#!ͱ!J͎ͬ AڵÚA2A2 !w͎ͬ ͢!#6!ͱÚ2 ͢!ìSYSGEN VER 2.2SOURCE DRIVE NAME (OR RETURN TO SKIP)SOURCE ON , THEN TYPE RETURNDESTINATION DRIVE NAME (OR RETURN TO REBOOT)DESTINATION ON , THEN TYPE RETURNPERMANENT ERROR, TYPE RETURN TO IGNOREFUNCTION COMPLETEINVALID DRIVE NAME (USE A - P)NO SOURCE FILE͠Q" 8AO͐jͱͷDM͏ m  Z"l"!6>ʥ *}҆ *M ͱ*}x O͐} W͐ͱ !+s#r!+s#r#4D ͠:\ʹ :\=Oͳͩ !6!)6l :) :)=2) :] & !"}2\!h6?!j6?\:'C:'ƀo&")!)6!"):)/)HҘ]!)6> !)ڎ*)&*)*)&*) y!)6 Ä:) 2):)<2)M*)#")/:)ҩ*)+")`*")#"]!*)!/H!")!"]*)) *)s#r!)6> !).*)&*)*)&*) w:)<2)*)) >w#6*)) w#6*)!) w#6*)%) w#6*)) N#F*)) q#p*)%) *) ~e *) * ~o&͞ *)%) q#p!)6* >!)6!)6>!)=:)!)w=*)&*)~2):)*)& *):)2):):*)!) *)) s, >X\:)“>!d!")>!)d!")!")*++!)a*)) ^#V")]*)")*)) ^#V")]!)6> !)T*)&*)~2)*)&*)~2)O;*)) ^#V" copyright(c) 1977, digital research $Error On Line $SUBNo 'SUB' File Present$Disk Write Error$Command Buffer Overflow$Command Too Long$Parameter Error$Invalid Control Character$Directory Full$Cannot Close, Read/Only?$!9"!͇͊!p+q* ͊!p+q*͍2!p+q*͍2!p+q*͊!p+q*͍!p+q*͍!p+q*͍2!s+p+q+p+q:=2ʦ** w*#"*#"!p+q(+*DM*p*& 6:ep\:=ͧ!t6>!t%\= >!t6:t<2t=O! ~2u b:<2O>9b!60+~9b!60+4:uat:u_2u:uMʉSͧ!v6!"v!|6:|Ҁ!x6 2}:} Hk:} h:}$6 2}$*}M3:}02}O> ͧ3!z6ͭ:}"!}5́ͭ́3*yM"h:}^a a2}O>Vͧ^:}>*z& ~ !z4í!{q*v#"v͙dͧ*vv :{w:x<2xO>}|ͧ ON DISKSOURCE FILE INCOMPLETERN TO SKIP)SOURCE ON , ?)*)) *)) N#Fq#p*)) *)s#r*)#")!)6 J:)!)J!)6 :)<2)*)")҈q:tw͠ͱ!"))ҍ*)) ^#V")]͠.*)DM\ -°!\6:\ͣ:ͱ*}DM'ͫ*)%) N#F'ͫ*)!) N#F'k͐ͫ*)) N#FͫR͐/͐ *) ~IO͐NW͐ͫ8AO͐:͐ *) ~2)t(͐:)҃)͐*)#")Ã& \!"))\Ұ*)")]͠*)M! ^#V *) >*) w *) >*) w *) >*) w *) >*) w.*)DM\ -+!\6uͱ:)O! DMͱ*)#")Ù*))))))"):m w>.Yn -:YS:Z Hҧ!6> 2)½>!)6> !)*)&*)>2) :) .͐*)M͐:)<2)99:Y=/9&ͩ c,Hͩ 9 EHͺ i`N#Fog_og_ogDM!>))덑o|gҘ =†DM!>))ҭ =¥~ ³^#V) ½^#V|g}o _{ozgi`N#Fogo&og_{_z#W-!6]:ͧz2~e:~2O! 6*~& 6$>!~_z*~& w!~5Bx:yͧ*v+"vv ~_{ozg001 $$$$ SUBBÉ Extended Submit Vers 2.0, Copyright (c) 1979, Digital Research Extended Submit Already Present$Requires CP/M Version 2.0 or later$:ʜ F  Ұ f!~=ŐW!x ~#bx {~#o}o.6::!"*"!E""1 5!"!E"* (xsub active)$|y ʍ"*`is<̓ :=2s!^#6 #6 #6$ ~O #w# !6:=2s$$$ SUB * !"!4*DM͂e/7 ͫ*"!4 :1 :<2!":ʚ ͂e!:q2q:2e:ր2O:2ä H$! A "!$""XSUB $$$CDEFGHIJKL