IMD 1.16: 13/08/2007 18:13:48 occ utility programs copy format sysgen 4d2004-00 4d2005-00 4d2006-00 1d2004-00 1d2005-00 1d2006-00 4d1004-00 4d1005-00 4d1006-00 9/8/81  OCCCOPYAASM OCCCOPYAASM OCCCOPYAPRN OCCCOPYAPRNOCCCOPYAPRN !"#OCCCOPYAPRN$%OCCCOPYACOM&OCCRAMA ASM"'()OCCTXTA ASTI*+,-.OCCFMTA ASMB/0123OCCFMTA COM 4OCCFMTA PRN56789:;<OCCFMTA PRN=>?@ABCDOCCFMTA PRNEFOCCFMT1 ASMGGHIJKOCCFMT1 PRNLMNOPQRSOCCFMT1 PRNTUVWXYZ[OCCFMT1 PRN\]OCCFMT1 COM ^OCCRAM1 ASM_`OCCSYSGAASM7abcdOCCSYSGAPRNefghijklOCCSYSGAPRN{mnopqrstOCCSYSGACOMuZ COPY2 ;If no HELP requested LDK DE,HELPM CALL PRINT JMP BOOT HELPM: DB cr,lf,'Copy will copy disks on the OCC-1' DB cr,lf,'disk subsystem. To start, type:' DB cr,lf,' COPY ' DB cr,lf,'Where is Carriage Return' DB cr,lf,'and is S=system, D=data or' DB cr,lf,'A=all. If not entered, a prompting' DB cr,lf,'message will be output.' DB cr,lf,'The source and destination drive' DB cr,lf,'prompts occur.$' COPY2: LDK DE,LOGON CALL PRINT ;Display signon message :2: CALL GETARG ;Determine amount of disk to copy CALL GETSRC ;Get the source drive CALL GETOBJ ;Get the destination drive LDK DE,GOMSG CALL PRINT ;Prompt USER to load diskettes :4 CALL CONIN CPI CR ;wait for JNZ :4 CALL GETDEN ;Check for compatible media JZ :6 ;If media compatible LDK DE,DENMSG ;Display incompatibility message CALL PRINT JMP :12 :6: LDK DE,CRLF CALL PRINT CALL CALBUF ;Compute buffer address :8: ;Main loop for copying disket;OCCCOPYA.ASM TITLE 'Disk Copy program.' ; COPY, disk copy utility. * 4D2004-00 MASTER (.ASM) * 2D2004-00 ASSY (.ASM) * 1D2004-00 LISTING (.PRN) * 4D1004-00 MASTER (.CON) * 2D1004-00 ASSY (.CON) ; +-----------------------+ ; | | ; | Disk Copy | ; | | ; +-----------------------+ ; ; Disk copy routine to be used with any standard ; CBIOS implementation on CPM 2.x. VER = '2' LEVEL = '4' ; Updates ; 2-3, 12-28-80 Fixed recovery in RD/WRTSEG to continue ; upon finding error. (rhf) ; 2-4, 2-25-80 Added to code to adjust number of tracks ; to copy for double sided floppies disks. List -F ;skip listing IFfed-out code Link OCCRAMA.asm ;Osborne high-ram definitions BOOT = 0000h ;Warm start address BIOSLOC = BOOT+1 ;BIOS vector start FSELDSK = 27 ;Offset for SELDSK function FSTRK = 30 ;Offset for SETTRK function FSEC = 33 ;Offset for SETSEC function FSDMA = 36 ;Offset for SETDMA function READF = 39 ;Offset for READ SECTOR function WRITEF = 42 ;Offset for WRITE tes CALL CPYTRK ;Copy one track LDK HL,TRACK INC [hl] ;next track LD A,LTRK ;get last trk to copy CMP [hl] JNC :8 ;if not last track ; See if user wants to copy another disk LDK DE,CPLMSG CALL PRINT ;indicate to user we are done :10: LDK DE,RPTMSG CALL PRINT ;ask for another disk copy CALL CONIN ;Get answer CPI 'Y' JZ :2 ;If yes, perform again CPI 'N' JZ :12 ;If NO, exit CPI CR JNZ :10 ;If no valid answer, try again COPYX: ;Exit copy routine :12: LDK DE,RMOUNT ;Display remount message CALL PRINT CALL CONIN JMP BOOT page GETARG: proc ;Get type of copy to perform. LDK HL,TBUFF MOV A,M ;Get # byte on command line ORA A JZ :4 ;If no command line data MOV C,A ;save # bytes :2 INC HL ;Get next byte MOV A,M CALL VCPYT ;validate parameter RZ ;If valid, return DCR C ;If NO, dec # bytes JNZ :2 ;if not end, continue :4 LDK DE,CPYMSG CALL PRINT ;Request parameter input CALL CONIN CALL VCPYT ;validate parameter JNZ :4 SECTOR function SYSSEC = 10 ;ditto for OCC1 SYSTART = 0 ;First system track number BUFF = 4000h ;OCC1 FWA of ROM-accessible memory SCTLN = 256 ;OCC1 hardware-fixed sector length page ORG 100h COPY: JMP COPY1 ;initializer NAME: DB 'COPY .com' DB CR,LF IF * <> 0111h .9 ERR Wrong length of filename and type. ENDIF DB 'Copyright SORCIM Corp. 1981',CR,LF DB 'S/N-' SN: DB '123456' DB ',Ver ' CPSV: DB 'All' DB ' ' MESV: VFD 16\VER,8\'.',16\LEVEL RELTYP: DB 'ST' ;Release type - EV,UD,DP,etc. DB CR,LF,'Z'-40h ;ascii EOF mark ; Distributor is a fixed value in COPYPROG.com DIST: DB 'OSB ' ;Distributor - DGM,OURS,LBA,etc. OPTYP: DB 'Z80 ' ;Type - Z80,8080,8086,NS,VG,etc. ; Total bytes used to here = 83 decimal. IF * <> 0153h .9 ERR Copyright notice section wrong length. ENDIF COPY1: proc ;Main loop for Disk copy routine LXI SP,100h ;Initialize the stack pointer ;Check if help wanted. LD A,TBUFF OR A JZ COPY2 ;If no arguments LD A,TBUFF+2 CMP '?' JN ;If invalid input RET space 4,10 VCPYT: proc ;Validate copy type request and STO A,CFLAG ;Save for latter test CMP 'A' RZ CMP 'S' RZ CMP 'D' RZ CMP 'X' JZ COPYX ;if request to abort RET space 4,10 GETSRC: proc ;Find source drive number LDK DE,SDMSG CALL GDISK ;Get drive number in ASCII STO A,ASCISRC MOV A,C STO A,SOURCE RET space 4,10 GETOBJ proc ;Find destination drive number LDK DE,OBJMSG CALL GDISK ;Get drive number in ASCII STO A,ASCIOBJ LD A,SOURCE CMP C JZ GETOBJ ;If source = destination drive MOV A,C STO A,OBJECT RET space 4,10 GDISK proc ;Get a drive from user PUSH D ;Save message address CALL PRINT CALL CONIN ;Get user's input SUI 'A' POP D JM GDISK ;If invalid CPI 'P'-'A'+1 JP GDISK ;If invalid MOV C,A MVI B,0 PUSH D PUSH B LDK DE,1 ;Only do drive validation CALL SELDSK MOV A,H ORA L POP B POP D JZ GDISK ;If invalid drive MOV A,C ADI 'A' RET space 4,10 GETDEN: proc ;CheGDPB2: ORI 0FFh ;Force non-zero RET .occ1 ENDIF space 4,10 ; Calculate the number of available pages for disk ; buffering. CALBUF: LD HL,SYS+1 ;Find bottom of BDOS MVI L,0 ;force page boundary LDK DE,-BUFF ;Subtract address for start of buffer ADD HL,DE MOV A,H ;H now has # PAGES in buffer STO A,BLEN ;save length ORA A RAR ;divide by 2 MOV H,A MOV A,L RAR MOV L,A LDK DE,BUFF ;Compute address of second buffer ADD HL,DE STO HL,BUFF2 RET space 4,10 ; COPY a track of data from source drive to ; desination drive. ; ; ENTRY B = next sector to copy. ; C = number of sectors to copy. CPYTRK: proc LDK HL,ERRFLG MOV A,M ;Get ERROR FLAG MVI M,0 ;clear it ORA A LDK DE,CRLF ;new line CNZ PRINT LDK DE,TRACKM CALL PRINT ;output track LD A,TRACK CALL ODEC ;output track # ; Start the copy MVI B,0 ;sec = 0 LD A,TRACK ;Get TRACK number OR A LD A,SPT LD HL,SKEWPTR JNZ :4 ;If not the first cylinder LDK A,SYSSEC LDK HL,T128 :PUSH BC ;save sector info LK DE,SCTLN ;DE = length of a sector LD HL,DMMA ;HL = DMA-addr for 1st sector :loop: DEC B ;B = #sectors xferred so far JRZ :2 ;if HL-> next DMA-addr ADD HL,DE ;...else step HL to next sector addr JR :loop ;and repeat :2: MOV B,H ! MOV C,L ;BC = HL CALL SETDMA POP BC ! PUSH BC ;retrieve sector info CALL SETSEC ;set sector to begin xfer POP BC ! PUSH BC ;retrieve sector info CALL XFER ;do disk operation OR A ;ck for error POP BC ;restore stack RZ ;if no error, finished ; D = #of sectors awaiting xfer (from ROM-routine) LK A,MSEC+1 SUB D ;A = #of flawed sector MOV B,A ;...will be 1st sector to xfer MOV C,D ;C = #of sectors to xfer PUSH BC ;save info for next xfer CALL RWERR ;notify user POP BC LK HL,RRTRY ;retry counter DEC [hl] JRNZ :retry ;if going to retry @this sector INC B ! DEC C ;...else give up on this sector RZ ;if flawed sector is last sector ;on this track, no others need be copied ck disks for compatible DPBs .occ1 IF FALSE LD A,SOURCE ;Get source drive CALL GETDPB ;Get disk parameter block RNZ ;If select error PUSH DE ;save pointer to DPB STO HL,SKEWPTR ;save pointer to skew table LD A,[de] ;Get number of SECTORS PER TRACK STO A,SPT LXI H,13 DAD D ;HL -> # of reserved tracks LD A,[hl] ;Get number of reserved tracks MVI C,77-1 CMP 2 JZ :1 ;If single sided MVI C,77*2-1 .occ1 ELSE LK A,10 ;10 sectors/track STO A,SPT LK C,39 ;tracks per disk .occ1 ENDIF :1 MVI B,SYSTART LD A,CFLAG CPI 'A' JZ :2 ;If entire disk ;occ1 LD B,[hl] ;B = first data track LK B,3 ;3rd track is data on OCC1 CPI 'D' JZ :2 ;If data only MOV C,B DCR C MVI B,SYSTART :2: MOV A,C STO A,LTRK MOV A,B STO A,TRACK .occ1 IF FALSE LD A,OBJECT CALL GETDPB ;Get disk PARAMETER BLOCK POP HL ;Restore DPB pointer RNZ ;If select error MVI C,15 ;Compare DPBs :3: LD A,[de] ;Get DPB byte CMP M RNZ ;If not identical INX D INC HL 4: STO A,TSECS ;Store # of secs to copy STO HL,SKEWT :6: LDK A,3 STO A,TRYS ;Set retry counter LDK HL,TSECS MOV C,M ;Get number of sectors left to copy MVI M,0 LD A,BLEN CMP C JNC :8 ;If buffer for sectors left MOV D,A MOV A,C SUB D ;TSECS - BLEN MOV M,A ;TSECS = TSECS - BLEN MOV C,D ;# SECTORS = BLEN :8: PUSH BC ;Save sector information LD A,SOURCE ;Get source drive STO A,DISK LDK DE,1 MOV C,A CALL SELDSK ;Select source drive LD A,TRACK CALL SETTRK ;Set track number POP BC ;Restore sector information PUSH BC ;and save it LDK HL,BUFF CALL RDSEG ;Read the "track" LD A,OBJECT ;Get destination drive STO A,DISK MOV C,A LDK DE,1 CALL SELDSK ;Select destination drive LD A,TRACK CALL SETTRK ;Set track number POP BC ;Restore sector information PUSH BC ;and save it LDK HL,BUFF CALL WRTSEG ;Write the track POP BC ;Restore sector information PUSH BC ;and save it LD HL,BUFF2 CALL RDSEG ;Read the written "track" POP  STO 3,[hl] ;RRTRY := 3 JR :retry ;ignore bad sector, continue .occ1 IF FALSE PUSH BC ;Save sector information MOV B,H MOV C,L CALL SETDMA ;SET DMA address .occ1 IF FALSE LD HL,SKEWT ;Get pointer to skew table POP BC ;Restore sector information MOV E,B ;Compute skewed sector number MVI D,0 ADD HL,DE PUSH BC LD A,FUDGE ADD A,M .occ1 ELSE POP BC PUSH BC ;get & save sector info LD A,FUDGE ADD B ;A = 1st sector # .occ1 ENDIF STO A,SECTOR CALL SETSEC ;Select sector LK B,10 ;#tracks to xfer CALL XFER ;Perform disk transfer ORA A CNZ RWERR ;if transfer error (read or write) .occ1 IF FALSE LD HL,DMA LD HL,DMMA ;OCC1 systext-compatible name LDK DE,SCTLN ADD HL,DE ;Compute new DMA address POP BC ;Restore sector information INC B ;Increment sector DCR C ;decrement sector count JNZ RWSEC .occ1 ELSE POP BC ;restore sector info .occ1 ENDIF RET .occ1 ENDIF space 4,10 RWERR: ;Read or Write error processing routin DCR C JNZ :3 ;If all bytes not checked .occ1 ELSE LK HL,TOCC ;skew table for OCC1 STO HL,SKEWPTR LK A,1 STO A,FUDGE ;no fudging on OCC1 .occ1 ENDIF RET .occ1 IF FALSE space 4,10 ; Get disk parameters. ; Entry A= drive. ; Exit HL= FWA for slew table. ; DE-?DPB GETDPB: MOV C,A ;PUT disk number in C reg LDK DE,0 ;disk off-line (bios will check den) CALL SELDSK ;Select disk MOV A,H ;Check for valid disk ORA L JZ GDPB2 ;If invalid selection MOV C,M ;Get translation table address INX H MOV B,M MOV A,B ORA C JZ GDPB1 ;If no translation table LDAX B ;get first sector translation GDPB1: STO A,FUDGE ;Save for fudge factor LDK BC,5*2-1 ADD HL,BC ;-> DPB LD A,[hl] INC HL LD H,[hl] MOV L,A EX DE,HL ;DE -> DPB LD A,[de] LDK HL,T128 CMP 26*128/128 RZ ;if single density LDK HL,T256 CMP 26*256/128 RZ ;If double density (256) LDK HL,T512 CMP 15*512/128 RZ ;If double density (512) LDK HL,T1024 CMP 8*1024/128 RET BC ;Restore sector information LD A,ERRFLG ORA A CZ COMPSEG ;Verify the "track" JZ :10 ;If compare was good ; Here if possible hard error, update retry ; count and try until found to be permament. LDK HL,TRYS DEC [hl] JNZ :8 ;If retries not exhausted ; Here if hard error, output message and continue ; copying. PUSH BC ;save regs LDK DE,PERMMSG CALL PRINT ;Display permanent error XRA A STO A,ERRFLG ;Clear error flag POP BC ;restore counters :10: MOV A,B ADD C ;SECTOR = SECTOR + # SECTORS MOV B,A LD A,TSECS ORA A JNZ :6 ;If track complete RET page ; Read a segment of a track ; Entry HL -> FWA of buffer ; Internal usages: ; B = 1st sector to read ; C = Number of sectors to read RDSEG: XRA A ;READ FLAG JMP RWSEG WRTSEG: ;Entry same as RDSEG ORI 0FFH ;WRITE FLAG RWSEG: STO A,RDWRTF ;Store flag STO HL,DMMA ;OCC1 systext-compatible name LK BC, (1 shl 8) + (MSEC) ;B = 1st sector, C = #sectors LK A,3 STO A,RRTRY :retry: e. ; ; Entry CBIOS indicated hard error, output info. ; Used only from RD/WRT_SEG. ; B = bad sector ; Caller must perserve registers. proc MOV A,B ;get sector # STO A,SECTOR LD A,RDWRTF LDK DE,READMSG ORA A JZ :2 ;If sector read LDK DE,WRTMSG :2: CALL PRINT LD A,DISK ;Get disk number ADI 'A' MOV E,A CALL CONOUT ;Display drive LDK DE,TRKMSG CALL PRINT ;Display track LD A,TRACK CALL ODEC LDK DE,SECMSG CALL PRINT ;Display sector LD A,SECTOR CALL ODEC ;output 179x status LK DE,STSMSG CALL PRINT LK DE,4 LK HL,R179x ;179x register save area :loop: PUSH DE ! PUSH HL CALL OSP POP HL ! PUSH HL LD A,[hl] ;get "register" to output CALL OHEX POP HL ! POP DE INC HL ;point @ next "reg" DEC DE ;decrement count MOV A,D OR E JRNZ :loop ;repeat 4 times ORI 0FFh ;Set error idicator STO A,ERRFLG RET space 4,10 ; Compare the data in the two buffers. ; ; B = SECTOR number, C = # SECTORS COMPSEG: PUSH BC ;Save sectOUT ;PRINT IT POP BC ;RESTORE BCD digits :6: MOV A,C ;MOVE BCD digits into A JMP OHEX ;output page PRINT MVI C,9 JMP SYS CONIN MVI C,1 CALL SYS CMP 'a' RC ;if not lower case CMP 'z'+1 RNC ;if not lower case SUI 'a'-'A' RET OHEX: ;PRINT number in ACCUMULATOR in HEX proc PUSH PSW ;save IT RRC ;Get HIGH NIBBLE RRC RRC RRC CALL :2 ;PRINT HIGH NIBBLE POP PSW ;RESTORE number :2: ;output nib in 4 lsbs of A ANI 0FH ;MASK for NIBBLE CPI 10 JC :4 ;if decimal ADI 'A'-'9'-1 ;If NO, add offset for A-F :4: ADI '0' ;make it ascii MOV E,A ;to E for conout ; JMP CONOUT CONOUT MVI C,2 ;CONOUT function JMP SYS O2SP: CALL OSP OSP: LK E,' ' JR CONOUT SELDSK: MOV A,C STO A,SDISK ;set ROM-referenced cell RET SETTRK: MOV C,A LDK B,0 ;BC = track # LK DE,BSTTRK+100h JMP GOROM SETSEC: MOV C,B LDK B,0 ;BC = sector # LK DE,BSTSEC+100h JMP GOROM SETDMA: LK DE,BSTDMA+100h JMP GOROM XFER: LK DE,BREAD+100h ;ROM12,13,14,15 DB 20,21,22,23,28,29,30,31 DB 36,37,38,39,44,45,46,47 DB 52,53,54,55 T1024: DB 0, 1, 2, 3, 4, 5, 6, 7 DB 16,17,18,19,20,21,22,23 DB 32,33,34,35,36,37,38,39 DB 48,49,50,51,52,53,54,55 DB 8, 9,10,11,12,13,14,15 DB 24,25,26,27,28,29,30,31 DB 40,41,42,43,44,45,46,47 DB 56,57,58,59,60,61,62,63 .occ1 ENDIF RRTRY: DS 1 ;ReTRY counter for R/WSEG ERRFLG: DB 0 ;Error on last track SOURCE: DS 1 ;source drive OBJECT: DS 1 ;destination drive SKEWPTR DS 2 ;Skew table pointer SKEWT: DS 2 FUDGE: DS 1 ;Skew fudge factor CFLAG: DS 1 ;Copy flag TRACK DS 1 ;Track LTRK DS 1 ;Ending track DISK DS 1 ;Disk number SPT DS 1 ;Sectors per track TSECS DS 1 ;Sectors left to copy from this track ;DMA DS 2 ;DMA address DMMA DS 2 ;OCC1 systext-compatible name BLEN: DS 1 ;Length of the Read/Write buffer (pages) BUFF2: DS 2 ;Address of second buffer SECTOR: DS 1 ;Sector SBYTE: DS 1 DBYTE: DS 1 TRYS: DS 1 ;Number of retries RDWRTF: DS 1 ;Read/Write flag ;BUFF = $ ;see 1st por information LD HL,BUFF2 LDK DE,BUFF COMP1: MVI B,low SCTLN ;Length of sector COMP2: LD A,[de] ;Get source byte XOR M JNZ CMPERR ;If source <> destination byte INX D INC HL DCR B JNZ COMP2 ;If end of a sector DCR C ;Decrement # of sectors JNZ COMP1 POP BC RET space 4,10 ; Display compare error message. CMPERR: LD A,[hl] ;Get destination byte STO A,DBYTE LD A,[de] ;Get source byte STO A,SBYTE POP HL ;Get sector information PUSH HL ;and save it back PUSH BC ;Save buffer information PUSH HL LDK DE,CMSG1 CALL PRINT ;Display 1st portion of message LD A,TRACK CALL ODEC ;Display track LDK DE,CMSG2 CALL PRINT ;Display next part POP HL ;Compute bad sector POP BC PUSH BC MOV A,L SUB C ADD A,H MOV E,A ;Compute skewed sector number MVI D,0 LDK HL,SKEWT ADD HL,DE LD A,FUDGE ADD A,M CALL ODEC ;Output sector number LDK DE,CMSG3 CALL PRINT ;Display byte in sector MOV A,B CALL ODEC ;Display byte MVI E,' ' CALL C 256-byte Read utility MOV B,C ;B = #sectors to xfer LD A,RDWRTF ORA A JZ GOROM ;if read operation LK DE,BWRITE+100h ;ROM write routine ; JMP GOROM GOROM: LD HL,BIOSLOC LK L,BROMJP ;call ROM resident routine JMP [hl] page LOGON DB CR,LF,'OSBORNE COPY Utility Program Version ' DB VER,'.' DW rev (LEVEL) DB '.$' CPYMSG: DB CR,LF,LF,'Do you want to ',ESC,'l','copy',ESC,'m:' DB CR,LF,' SYSTEM tracks only? (type S)' DB CR,LF,' DATA tracks only? (type D)' DB CR,LF,' ALL of the disk? (type A)' DB CR,LF,' Exit back to System (type X) $' SDMSG: DB CR,LF,LF,'Source drive? (A, B ) $' OBJMSG DB CR,LF,'Destination drive? (A, B ) $' GOMSG DB CR,LF,LF,'Put source disk on ' ASCISRC DB 'A' DB CR,LF,'Put destination disk on ' ASCIOBJ DB 'B' DB CR,LF,'Then type $' CRLF DB CR,LF,'$' TRACKM DB CR,'Track $' DENMSG DB CR,LF,LF,'Disk have incompatible formats.$' CPLMSG DB CR,LF,'COPY complete.$' RPTMSG DB CR,LF,LF,'Do you want to COPY agage ; Endx OCOPY.asm DB 16,17,18,19,20,21,22,23 DB 32,33,34,35,36,37,38,39 DB 48,49,50,51,52,53,54,55 DB 8, 9,10,11,12,13,14,15 DB 24,25,26,27,28,29,30,31 DB 40,41,42,43,44,45,46,47 DB 56,57,58,59,60,61,62,63 .occ1 ENDIF RRTRY: DS 1 ;ReTRY counter for R/WSEG ERRFLG: DB 0 ;Error on last track SOURCE: DS 1 ;source drive OBJECT: DS 1 ;destination drive SKEWPTR DS 2 ;Skew table pointer SKEWT: DS 2 FUDGE: DS 1 ;Skew fudge factor CFLAG: DS 1 ;Copy flag TRACK DS 1 ;Track LTRK DS 1 ;Ending track DISK DS 1 ;Disk number SPT DS 1 ;Sectors per track TSECS DS 1 ;Sectors left to copy from this track ;DMA DS 2 ;DMA address DMMA DS 2 ;OCC1 systext-compatible name BLEN: DS 1 ;Length of the Read/Write buffer (pages) BUFF2: DS 2 ;Address of second buffer SECTOR: DS 1 ;Sector SBYTE: DS 1 DBYTE: DS 1 TRYS: DS 1 ;Number of retries RDWRTF: DS 1 ;Read/Write flag ;BUFF = $ ;see 1st pONOUT LD A,SBYTE CALL OHEX ;Output source byte MVI E,' ' CALL CONOUT LD A,DBYTE CALL OHEX POP BC ;Restore sector information ORI 0FFh ;Set error indicator STO A,ERRFLG RET ODEC: ;Output number in decimal ; Entry A= number to convert proc LDK BC,0 ;init dec number :2 SUI 10h ;high nibble JC :4 ;If yes, CARRY is set, output low only MOV D,A ;save HEX number MOV A,C ;Get 2 least SIGNIF. BCD digits ADI 16H ;ADD 16 DAA ;DECIMAL ADJUST MOV C,A ;STORE THEM MOV A,B ;Get OVERFLOW digit ACI 0 ;ADD CARRY (OVERFLOW) MOV B,A ;STORE OVERFLOW digit MOV A,D ;RESTORE HEX number JMP :2 :4 ADI 10H ;RESTORE HEX number to RANGE of 0-0FH ORA A DAA ;MAKE it DECIMAL ADD C ;ADD BCD digits to LOW NIBBLE DAA ;DECIMAL ADJUST MOV C,A ;STORE BACK in C MOV A,B ;Get OVERFLOW digit ACI 0 ;ADD in CARRY (OVERFLOW) JZ :6 ;DON'T PRINT LEADING 0 from OVERFLOW PUSH BC ;save BCD digits ADI '0' ;MAKE OVERFLOW digit into ASCII MOV E,A CALL CONain? (Y/N) $' READMSG DB CR,LF,'Read error on drive $' WRTMSG DB CR,LF,'Write error on drive $' TRKMSG DB ' track $' SECMSG DB ' sector $' STSMSG DB ' stat=$' CMSG1 DB CR,LF,'Compare error Track $' CMSG2 DB ' Sector $' CMSG3 DB ' Byte $' PERMMSG DB CR,LF,BELCHR,'Permanent error.',LF,CR,'$' RMOUNT: DB CR,LF,LF,'Remount system disk on A: and type' DB ' RETURN.$' page ; Data is read and written on the disks sequentially ; but to speed the processing up the actual transfers ; are performed with a skewing factor of two. TOCC: T128: DB 0, 2, 4, 6, 8 ; ,10,12,14,16,18,20,22,24 DB 1, 3, 5, 7, 9 ; ,11,13,15,17,19,21,23,25 .occ1 IF FALSE T256: DB 0, 1, 4, 5, 8, 9 DB 12,13,16,17,20,21 DB 24,25,28,29,32,33 DB 36,37,40,41,44,45 DB 48,49 DB 2, 3, 6, 7,10,11 DB 14,15,18,19,22,23 DB 26,27,30,31,34,35 DB 38,39,42,43,46,47 DB 50,51 T512: DB 0, 1, 2, 3, 8, 9,10,11 DB 16,17,18,19,24,25,26,27 DB 32,33,34,35,40,41,42,43 DB 48,49,50,51,56,57,58,59 DB 4, 5, 6, 7, SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 1 Disk Copy program. D:OCCRAMA .ASM *ABS 0000 EFEF *CODE EFEF 0000 *DATA EFEF 0000 ;OCCCOPYA.ASM ; COPY, disk copy utility. * 4D2004-00 MASTER (.ASM) * 2D2004-00 ASSY (.ASM) * 1D2004-00 LISTING (.PRN) * 4D1004-00 MASTER (.CON) * 2D1004-00 ASSY (.CON) ; +-----------------------+ ; | | ; | Disk Copy | ; | | ; +-----------------------+ ; ; Disk copy routine to be used with any standard ; CBIOS implementation on CPM 2.x. D,DP,etc. 0148 0D0A1A DB CR,LF,'Z'-40h ;ascii EOF mark ; Distributor is a fixed value in COPYPROG.com 014B 4F534220 DIST: DB 'OSB ' ;Distributor - DGM,OURS,LBA,etc. 014F 5A383020 OPTYP: DB 'Z80 ' ;Type - Z80,8080,8086,NS,VG,etc. ; Total bytes used to here = 83 decimal. = 0000 IF * <> 0153h ENDIF 0153 COPY1: proc ;Main loop for Disk copy routine 0153 310001 LXI SP,100h ;Initialize the stack pointer ;Check if help wanted. 0156 3A8000 LD A,TBUFF 0159 B7 OR A 015A CA8102 JZ COPY2 ;If no arguments 015D 3A8200 LD A,TBUFF+2 0160 FE3F CMP '?' 0162 C28102 JNZ COPY2 ;If no HELP requested 0165 116E01 LDK DE,HELPM 0168 CDB105 CALL PRINT 016B C30000 JMP BOOT 016E 0D0A436F70 HELPM: DB cr wants to copy another disk 02C4 11A507 LDK DE,CPLMSG 02C7 CDB105 CALL PRINT ;indicate to user we are done 02CA 11B607 :10: LDK DE,RPTMSG 02CD CDB105 CALL PRINT ;ask for another disk copy 02D0 CDB605 CALL CONIN ;Get answer 02D3 FE59 CPI 'Y' 02D5 CA8702 JZ :2 ;If yes, perform again 02D8 FE4E CPI 'N' 02DA CAE202 JZ :12 ;If NO, exit 02DD FE0D CPI CR 02DF C2CA02 JNZ :10 ;If no valid answer, try again 02E2 COPYX: ;Exit copy routine 02E2 116008 :12: LDK DE,RMOUNT ;Display remount message 02E5 CDB105 CALL PRINT 02E8 CDB605 CALL CONIN 02EB C30000 JMP BOOT SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 4 Disk Copy program. D:OCCCOPYA.ASM 02EE GETARG: proc ;Get type of copy to perform. 02EE 218000 LDK HL,TBUFF 02 = 0032 VER = '2' = 0034 LEVEL = '4' ; Updates ; 2-3, 12-28-80 Fixed recovery in RD/WRTSEG to continue ; upon finding error. (rhf) ; 2-4, 2-25-80 Added to code to adjust number of tracks ; to copy for double sided floppies disks. List -F ;skip listing IFfed-out code Link OCCRAMA.asm ;Osborne high-ram definitions = 0000 BOOT = 0000h ;Warm start address = 0001 BIOSLOC = BOOT+1 ;BIOS vector start = 001B FSELDSK = 27 ;Offset for SELDSK function = 001E FSTRK = 30 ;Offset for SETTRK function = 0021 FSEC = 33 ;Offset for SETSEC function = 0024 FSDMA = 36 ;Offset for SETDMA function = 0027 READF = 39 ;Offset for READ SECTOR function = 002A WRITEF = 42 ;Offset for WRITE SECTOR funcr,lf,'Copy will copy disks on the OCC-1' 0191 0D0A646973 DB cr,lf,'disk subsystem. To start, type:' 01B2 0D0A202020 DB cr,lf,' COPY ' 01CC 0D0A576865 DB cr,lf,'Where is Carriage Return' 01EB 0D0A616E64 DB cr,lf,'and is S=system, D=data or' 0211 0D0A413D61 DB cr,lf,'A=all. If not entered, a prompting' 0235 0D0A6D6573 DB cr,lf,'message will be output.' 024E 0D0A546865 DB cr,lf,'The source and destination drive' 0270 0D0A70726F DB cr,lf,'prompts occur.$' 0281 111606 COPY2: LDK DE,LOGON 0284 CDB105 CALL PRINT ;Display signon message 0287 CDEE02 :2: CALL GETARG ;Determine amount of disk to copy 028A CD2303 CALL GETSRC ;Get the source drive 028D CD3103 CALL GETOBJ ;Get the destination drive 0290 113007 LDK DE,GOMSG 0293 CDB105 CALL PRINT ;Prompt USER to load diskettes 0296 CDB605 :4 CALL CONIN 0299 FE0D F1 7E MOV A,M ;Get # byte on command line 02F2 B7 ORA A 02F3 CA0103 JZ :4 ;If no command line data 02F6 4F MOV C,A ;save # bytes 02F7 23 :2 INC HL ;Get next byte 02F8 7E MOV A,M 02F9 CD1103 CALL VCPYT ;validate parameter 02FC C8 RZ ;If valid, return 02FD 0D DCR C ;If NO, dec # bytes 02FE C2F702 JNZ :2 ;if not end, continue 0301 114306 :4 LDK DE,CPYMSG 0304 CDB105 CALL PRINT ;Request parameter input 0307 CDB605 CALL CONIN 030A CD1103 CALL VCPYT ;validate parameter 030D C20103 JNZ :4 ;If invalid input 0310 C9 RET 0311 VCPYT: proc ;Validate copy type request and 0311 32A108 STO A,CFLAG ;Save for latter test 0314 FE41 CMP 'A' 0316 C8 RZ 0317 FE53 CMP 'S' 0319 C8 RZ 031A FE44 tion = 000A SYSSEC = 10 ;ditto for OCC1 = 0000 SYSTART = 0 ;First system track number = 4000 BUFF = 4000h ;OCC1 FWA of ROM-accessible memory = 0100 SCTLN = 256 ;OCC1 hardware-fixed sector length SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 2 Disk Copy program. D:OCCCOPYA.ASM 0000 = 0100 ORG 100h 0100 C35301 COPY: JMP COPY1 ;initializer 0103 434F505920 NAME: DB 'COPY .com' 010F 0D0A DB CR,LF = 0000 IF * <> 0111h ENDIF 0111 436F707972 DB 'Copyright SORCIM Corp. 1981',CR,LF 012E 532F4E2D DB 'S/N-' 0132 3132333435 SN: DB '123456' 0138 2C56657220 DB ',Ver ' 013D 416C6C CPSV: DB 'All' 0140 20 DB ' ' 0141 00322E0034 MESV: VFD 16\VER,8\'.',16\LEVEL 0146 5354 RELTYP: DB 'ST' ;Release type - EV,U CPI CR ;wait for SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 3 Disk Copy program. D:OCCCOPYA.ASM 029B C29602 JNZ :4 029E CD6E03 CALL GETDEN ;Check for compatible media 02A1 CAAD02 JZ :6 ;If media compatible 02A4 118207 LDK DE,DENMSG ;Display incompatibility message 02A7 CDB105 CALL PRINT 02AA C3E202 JMP :12 02AD 117707 :6: LDK DE,CRLF 02B0 CDB105 CALL PRINT 02B3 CD9E03 CALL CALBUF ;Compute buffer address 02B6 :8: ;Main loop for copying diskettes 02B6 CDB903 CALL CPYTRK ;Copy one track 02B9 21A208 LDK HL,TRACK 02BC 34 INC [hl] ;next track 02BD 3AA308 LD A,LTRK ;get last trk to copy 02C0 BE CMP [hl] 02C1 D2B602 JNC :8 ;if not last track ; See if useCMP 'D' 031C C8 RZ 031D FE58 CMP 'X' 031F CAE202 JZ COPYX ;if request to abort 0322 C9 RET 0323 GETSRC: proc ;Find source drive number 0323 11F806 LDK DE,SDMSG 0326 CD4603 CALL GDISK ;Get drive number in ASCII 0329 324607 STO A,ASCISRC 032C 79 MOV A,C 032D 329A08 STO A,SOURCE 0330 C9 RET SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 5 Disk Copy program. D:OCCCOPYA.ASM 0331 GETOBJ proc ;Find destination drive number 0331 111207 LDK DE,OBJMSG 0334 CD4603 CALL GDISK ;Get drive number in ASCII 0337 326107 STO A,ASCIOBJ 033A 3A9A08 LD A,SOURCE 033D B9 CMP C 033E CA3103 JZ GETOBJ ;If source = destination drive 0341 79 MOV A,C 0342 329B08 STO A,OBJECT 0345 C9 RET C08 STO HL,SKEWPTR 0398 3E01 LK A,1 039A 32A008 STO A,FUDGE ;no fudging on OCC1 .occ1 ENDIF 039D C9 RET = 0000 .occ1 IF FALSE .occ1 ENDIF ; Calculate the number of available pages for disk ; buffering. 039E 2A0600 CALBUF: LD HL,SYS+1 ;Find bottom of BDOS 03A1 2E00 MVI L,0 ;force page boundary 03A3 1100C0 LDK DE,-BUFF ;Subtract address for start of buffer 03A6 19 ADD HL,DE 03A7 7C MOV A,H ;H now has # PAGES in buffer 03A8 32A908 STO A,BLEN ;save length 03AB B7 ORA A 03AC 1F RAR ;divide by 2 03AD 67 MOV H,A 03AE 7D MOV A,L 03AF 1F RAR 03B0 6F MOV L,A 03B1 110040 LDK DE,BUFF ;Compute address of second buffer 03B4 19 ADD HL,DE 03B5 22AA08 STO HL,BUFF2 0SOURCE ;Get source drive 0407 32A408 STO A,DISK 040A 110100 LDK DE,1 040D 4F MOV C,A 040E CDE505 CALL SELDSK ;Select source drive 0411 3AA208 LD A,TRACK 0414 CDEA05 CALL SETTRK ;Set track number 0417 C1 POP BC ;Restore sector information 0418 C5 PUSH BC ;and save it 0419 210040 LDK HL,BUFF 041C CD6B04 CALL RDSEG ;Read the "track" 041F 3A9B08 LD A,OBJECT ;Get destination drive 0422 32A408 STO A,DISK 0425 4F MOV C,A 0426 110100 LDK DE,1 0429 CDE505 CALL SELDSK ;Select destination drive 042C 3AA208 LD A,TRACK 042F CDEA05 CALL SETTRK ;Set track number 0432 C1 POP BC ;Restore sector information 0433 C5 PUSH BC ;and save it 0434 210040 LDK HL,BUFF 0437 CD6F04 CALL WRTSEG ;Write the track 043A C1 POP BC ;Restore sector information SORCIM  0346 GDISK proc ;Get a drive from user 0346 D5 PUSH D ;Save message address 0347 CDB105 CALL PRINT 034A CDB605 CALL CONIN ;Get user's input 034D D641 SUI 'A' 034F D1 POP D 0350 FA4603 JM GDISK ;If invalid 0353 FE10 CPI 'P'-'A'+1 0355 F24603 JP GDISK ;If invalid 0358 4F MOV C,A 0359 0600 MVI B,0 035B D5 PUSH D 035C C5 PUSH B 035D 110100 LDK DE,1 ;Only do drive validation 0360 CDE505 CALL SELDSK 0363 7C MOV A,H 0364 B5 ORA L 0365 C1 POP B 0366 D1 POP D 0367 CA4603 JZ GDISK ;If invalid drive 036A 79 MOV A,C 036B C641 ADI 'A' 036D C9 RET 036E GETDEN: proc ;Check disks for compatible DPBs = 0000 .occ1 IF FALSE .occ1 ELSE 036E 3E0A LK A,10 ;10 sectors/3B8 C9 RET ; COPY a track of data from source drive to ; desination drive. ; ; ENTRY B = next sector to copy. ; C = number of sectors to copy. 03B9 CPYTRK: proc 03B9 219908 LDK HL,ERRFLG 03BC 7E MOV A,M ;Get ERROR FLAG 03BD 3600 MVI M,0 ;clear it 03BF B7 ORA A 03C0 117707 LDK DE,CRLF ;new line SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 7 Disk Copy program. D:OCCCOPYA.ASM 03C3 C4B105 CNZ PRINT 03C6 117A07 LDK DE,TRACKM 03C9 CDB105 CALL PRINT ;output track 03CC 3AA208 LD A,TRACK 03CF CD8205 CALL ODEC ;output track # ; Start the copy 03D2 0600 MVI B,0 ;sec = 0 03D4 3AA208 LD A,TRACK ;Get 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 8 Disk Copy program. D:OCCCOPYA.ASM 043B C5 PUSH BC ;and save it 043C 2AAA08 LD HL,BUFF2 043F CD6B04 CALL RDSEG ;Read the written "track" 0442 C1 POP BC ;Restore sector information 0443 3A9908 LD A,ERRFLG 0446 B7 ORA A 0447 CC0F05 CZ COMPSEG ;Verify the "track" 044A CA6004 JZ :10 ;If compare was good ; Here if possible hard error, update retry ; count and try until found to be permament. 044D 21AF08 LDK HL,TRYS 0450 35 DEC [hl] 0451 C20304 JNZ :8 ;If retries not exhausted ; Here if hard error, output message and continue ; copying. 0454 C5 PUSH BC ;save regs 0455 114A08 LDK DE,PERMMSG 0458 CDB105 CALL PRINT ;Display permatrack 0370 32A508 STO A,SPT 0373 0E27 LK C,39 ;tracks per disk .occ1 ENDIF 0375 0600 :1 MVI B,SYSTART 0377 3AA108 LD A,CFLAG 037A FE41 CPI 'A' 037C CA8A03 JZ :2 ;If entire disk ;occ1 LD B,[hl] ;B = first data track 037F 0603 LK B,3 ;3rd track is data on OCC1 0381 FE44 CPI 'D' 0383 CA8A03 JZ :2 ;If data only 0386 48 MOV C,B SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 6 Disk Copy program. D:OCCCOPYA.ASM 0387 0D DCR C 0388 0600 MVI B,SYSTART 038A 79 :2: MOV A,C 038B 32A308 STO A,LTRK 038E 78 MOV A,B 038F 32A208 STO A,TRACK = 0000 .occ1 IF FALSE .occ1 ELSE 0392 218E08 LK HL,TOCC ;skew table for OCC1 0395 229TRACK number 03D7 B7 OR A 03D8 3AA508 LD A,SPT 03DB 2A9C08 LD HL,SKEWPTR 03DE C2E603 JNZ :4 ;If not the first cylinder 03E1 3E0A LDK A,SYSSEC 03E3 218E08 LDK HL,T128 03E6 32A608 :4: STO A,TSECS ;Store # of secs to copy 03E9 229E08 STO HL,SKEWT 03EC 3E03 :6: LDK A,3 03EE 32AF08 STO A,TRYS ;Set retry counter 03F1 21A608 LDK HL,TSECS 03F4 4E MOV C,M ;Get number of sectors left to copy 03F5 3600 MVI M,0 03F7 3AA908 LD A,BLEN 03FA B9 CMP C 03FB D20304 JNC :8 ;If buffer for sectors left 03FE 57 MOV D,A 03FF 79 MOV A,C 0400 92 SUB D ;TSECS - BLEN 0401 77 MOV M,A ;TSECS = TSECS - BLEN 0402 4A MOV C,D ;# SECTORS = BLEN 0403 C5 :8: PUSH BC ;Save sector information 0404 3A9A08 LD A,nent error 045B AF XRA A 045C 329908 STO A,ERRFLG ;Clear error flag 045F C1 POP BC ;restore counters 0460 78 :10: MOV A,B 0461 81 ADD C ;SECTOR = SECTOR + # SECTORS 0462 47 MOV B,A 0463 3AA608 LD A,TSECS 0466 B7 ORA A 0467 C2EC03 JNZ :6 ;If track complete 046A C9 RET SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 9 Disk Copy program. D:OCCCOPYA.ASM ; Read a segment of a track ; Entry HL -> FWA of buffer ; Internal usages: ; B = 1st sector to read ; C = Number of sectors to read 046B AF RDSEG: XRA A ;READ FLAG 046C C37104 JMP RWSEG 046F WRTSEG: ;Entry same as RDSEG 046F F6FF ORI 0FFH ;WRITE FLA ;on this track, no others need be copied 04B1 3603 STO 3,[hl] ;RRTRY := 3 SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 10 Disk Copy program. D:OCCCOPYA.ASM 04B3 18CA ^047F$ JR :retry ;ignore bad sector, continue = 0000 .occ1 IF FALSE .occ1 ENDIF 04B5 RWERR: ;Read or Write error processing routine. ; ; Entry CBIOS indicated hard error, output info. ; Used only from RD/WRT_SEG. ; B = bad sector ; Caller must perserve registers. 04B5 proc 04B5 78 MOV A,B ;get sector # 04B6 32AC08 STO A,SECTOR 04B9 3AB008 LD A,RDWRTF 04BC 11DB07 LDK DE,READMSG 04BF B7 ORA A 04C0 CAC604 JZ :2 ;If sector read 04C3 11F207 destination byte 051D 13 INX D 051E 23 INC HL 051F 05 DCR B 0520 C21805 JNZ COMP2 ;If end of a sector 0523 0D DCR C ;Decrement # of sectors 0524 C21605 JNZ COMP1 0527 C1 POP BC 0528 C9 RET ; Display compare error message. 0529 7E CMPERR: LD A,[hl] ;Get destination byte 052A 32AE08 STO A,DBYTE 052D 1A LD A,[de] ;Get source byte 052E 32AD08 STO A,SBYTE 0531 E1 POP HL ;Get sector information 0532 E5 PUSH HL ;and save it back 0533 C5 PUSH BC ;Save buffer information 0534 E5 PUSH HL 0535 112208 LDK DE,CMSG1 0538 CDB105 CALL PRINT ;Display 1st portion of message 053B 3AA208 LD A,TRACK 053E CD8205 CALL ODEC ;Display track 0541 113A08 LDK DE,CMSG2 0544 CDB105 CALL PRINT ;Display next part 054G 0471 32B008 RWSEG: STO A,RDWRTF ;Store flag 0474 22A708 STO HL,DMMA ;OCC1 systext-compatible name 0477 010A01 LK BC, (1 shl 8) + (MSEC) ;B = 1st sector, C = #sectors 047A 3E03 LK A,3 047C 329808 STO A,RRTRY 047F C5 :retry: PUSH BC ;save sector info 0480 110001 LK DE,SCTLN ;DE = length of a sector 0483 2AA708 LD HL,DMMA ;HL = DMA-addr for 1st sector 0486 05 :loop: DEC B ;B = #sectors xferred so far 0487 2803 ^048C$ JRZ :2 ;if HL-> next DMA-addr 0489 19 ADD HL,DE ;...else step HL to next sector addr 048A 18FA ^0486$ JR :loop ;and repeat 048C 44 :2: MOV B,H ! MOV C,L ;BC = HL 048E CDFC05 CALL SETDMA 0491 C1 POP BC ! PUSH BC ;retrieve sector info 0493 CDF305 CALL SETSEC ;set sector to begin xfer 0496 C1  LDK DE,WRTMSG 04C6 CDB105 :2: CALL PRINT 04C9 3AA408 LD A,DISK ;Get disk number 04CC C641 ADI 'A' 04CE 5F MOV E,A 04CF CDD905 CALL CONOUT ;Display drive 04D2 110A08 LDK DE,TRKMSG 04D5 CDB105 CALL PRINT ;Display track 04D8 3AA208 LD A,TRACK 04DB CD8205 CALL ODEC 04DE 111208 LDK DE,SECMSG 04E1 CDB105 CALL PRINT ;Display sector 04E4 3AAC08 LD A,SECTOR 04E7 CD8205 CALL ODEC ;output 179x status 04EA 111B08 LK DE,STSMSG 04ED CDB105 CALL PRINT 04F0 110400 LK DE,4 04F3 21C2EF LK HL,R179x ;179x register save area 04F6 D5 :loop: PUSH DE ! PUSH HL 04F8 CDE105 CALL OSP 04FB E1 POP HL ! PUSH HL 04FD 7E LD A,[hl] ;get "register" to output 04FE CDC405 CALL OHEX 0501 E1 POP HL ! POP DE7 E1 POP HL ;Compute bad sector 0548 C1 POP BC 0549 C5 PUSH BC 054A 7D MOV A,L 054B 91 SUB C 054C 84 ADD A,H 054D 5F MOV E,A ;Compute skewed sector number 054E 1600 MVI D,0 0550 219E08 LDK HL,SKEWT 0553 19 ADD HL,DE 0554 3AA008 LD A,FUDGE 0557 86 ADD A,M SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 12 Disk Copy program. D:OCCCOPYA.ASM 0558 CD8205 CALL ODEC ;Output sector number 055B 114308 LDK DE,CMSG3 055E CDB105 CALL PRINT ;Display byte in sector 0561 78 MOV A,B 0562 CD8205 CALL ODEC ;Display byte 0565 1E20 MVI E,' ' 0567 CDD905 CALL CONOUT 056A 3AAD08 LD A,SBYTE 056D CDC405 CALL OHEX ;Output source byte 0570 1E20 MVI E,' ' 0572 CDD905 CALL CONOUT  POP BC ! PUSH BC ;retrieve sector info 0498 CD0206 CALL XFER ;do disk operation 049B B7 OR A ;ck for error 049C C1 POP BC ;restore stack 049D C8 RZ ;if no error, finished ; D = #of sectors awaiting xfer (from ROM-routine) 049E 3E0B LK A,MSEC+1 04A0 92 SUB D ;A = #of flawed sector 04A1 47 MOV B,A ;...will be 1st sector to xfer 04A2 4A MOV C,D ;C = #of sectors to xfer 04A3 C5 PUSH BC ;save info for next xfer 04A4 CDB504 CALL RWERR ;notify user 04A7 C1 POP BC 04A8 219808 LK HL,RRTRY ;retry counter 04AB 35 DEC [hl] 04AC 20D1 ^047F$ JRNZ :retry ;if going to retry @this sector 04AE 04 INC B ! DEC C ;...else give up on this sector 04B0 C8 RZ ;if flawed sector is last sector  0503 23 INC HL ;point @ next "reg" 0504 1B DEC DE ;decrement count 0505 7A MOV A,D 0506 B3 OR E 0507 20ED ^04F6$ JRNZ :loop ;repeat 4 times 0509 F6FF ORI 0FFh ;Set error idicator 050B 329908 STO A,ERRFLG SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 11 Disk Copy program. D:OCCCOPYA.ASM 050E C9 RET ; Compare the data in the two buffers. ; ; B = SECTOR number, C = # SECTORS 050F COMPSEG: 050F C5 PUSH BC ;Save sector information 0510 2AAA08 LD HL,BUFF2 0513 110040 LDK DE,BUFF 0516 0600 COMP1: MVI B,low SCTLN ;Length of sector 0518 1A COMP2: LD A,[de] ;Get source byte 0519 AE XOR M 051A C22905 JNZ CMPERR ;If source <> 0575 3AAE08 LD A,DBYTE 0578 CDC405 CALL OHEX 057B C1 POP BC ;Restore sector information 057C F6FF ORI 0FFh ;Set error indicator 057E 329908 STO A,ERRFLG 0581 C9 RET 0582 ODEC: ;Output number in decimal ; Entry A= number to convert 0582 proc 0582 010000 LDK BC,0 ;init dec number 0585 D610 :2 SUI 10h ;high nibble 0587 DA9805 JC :4 ;If yes, CARRY is set, output low only 058A 57 MOV D,A ;save HEX number 058B 79 MOV A,C ;Get 2 least SIGNIF. BCD digits 058C C616 ADI 16H ;ADD 16 058E 27 DAA ;DECIMAL ADJUST 058F 4F MOV C,A ;STORE THEM 0590 78 MOV A,B ;Get OVERFLOW digit 0591 CE00 ACI 0 ;ADD CARRY (OVERFLOW) 0593 47 MOV B,A ;STORE OVERFLOW digit 0594 7A MOV A,D ;RESTORE HEX number 0595  MOV E,A ;to E for conout ; JMP CONOUT 05D9 0E02 CONOUT MVI C,2 ;CONOUT function 05DB C30500 JMP SYS 05DE CDE105 O2SP: CALL OSP 05E1 1E20 OSP: LK E,' ' 05E3 18F4 ^05D9$ JR CONOUT 05E5 79 SELDSK: MOV A,C 05E6 3217EF STO A,SDISK ;set ROM-referenced cell 05E9 C9 RET 05EA 4F SETTRK: MOV C,A 05EB 0600 LDK B,0 ;BC = track # 05ED 111E01 LK DE,BSTTRK+100h 05F0 C31006 JMP GOROM 05F3 48 SETSEC: MOV C,B 05F4 0600 LDK B,0 ;BC = sector # 05F6 112101 LK DE,BSTSEC+100h 05F9 C31006 JMP GOROM 05FC 112401 SETDMA: LK DE,BSTDMA+100h 05FF C31006 JMP GOROM SORCIM 808x As6561 READMSG DB CR,LF,'Read error on drive $' 07F2 0D0A577269 WRTMSG DB CR,LF,'Write error on drive $' 080A 2074726163 TRKMSG DB ' track $' 0812 2073656374 SECMSG DB ' sector $' 081B 2073746174 STSMSG DB ' stat=$' 0822 0D0A436F6D CMSG1 DB CR,LF,'Compare error Track $' 083A 2053656374 CMSG2 DB ' Sector $' 0843 2042797465 CMSG3 DB ' Byte $' 084A 0D0A075065 PERMMSG DB CR,LF,BELCHR,'Permanent error.',LF,CR,'$' 0860 0D0A0A5265 RMOUNT: DB CR,LF,LF,'Remount system disk on A: and type' 0885 2052455455 DB ' RETURN.$' SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 16 Disk Copy program. D:OCCCOPYA.ASM ; Data is read and written on the disks sequentially ; but to speed the processing up the actual transfers ; are performed with a skewing factor of two. 088E TOCC: 0C38505 JMP :2 0598 C610 :4 ADI 10H ;RESTORE HEX number to RANGE of 0-0FH 059A B7 ORA A 059B 27 DAA ;MAKE it DECIMAL 059C 81 ADD C ;ADD BCD digits to LOW NIBBLE 059D 27 DAA ;DECIMAL ADJUST 059E 4F MOV C,A ;STORE BACK in C 059F 78 MOV A,B ;Get OVERFLOW digit 05A0 CE00 ACI 0 ;ADD in CARRY (OVERFLOW) 05A2 CAAD05 JZ :6 ;DON'T PRINT LEADING 0 from OVERFLOW 05A5 C5 PUSH BC ;save BCD digits 05A6 C630 ADI '0' ;MAKE OVERFLOW digit into ASCII 05A8 5F MOV E,A 05A9 CDD905 CALL CONOUT ;PRINT IT 05AC C1 POP BC ;RESTORE BCD digits 05AD 79 :6: MOV A,C ;MOVE BCD digits into A 05AE C3C405 JMP OHEX ;output SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 13 Disk Copy program. D:OCCCOPYA.ASM 05B1 0E09 sembler ver 3.5E 5=/00/;1 1<:03 Page 14 Disk Copy program. D:OCCCOPYA.ASM 0602 112701 XFER: LK DE,BREAD+100h ;ROM 256-byte Read utility 0605 41 MOV B,C ;B = #sectors to xfer 0606 3AB008 LD A,RDWRTF 0609 B7 ORA A 060A CA1006 JZ GOROM ;if read operation 060D 112A01 LK DE,BWRITE+100h ;ROM write routine ; JMP GOROM 0610 2A0100 GOROM: LD HL,BIOSLOC 0613 2E36 LK L,BROMJP ;call ROM resident routine 0615 E9 JMP [hl] SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 15 Disk Copy program. D:OCCCOPYA.ASM 0616 0D0A4F5342 LOGON DB CR,LF,'OSBORNE COPY Utility Program Version ' 063D 322E DB VER,'.' 063F 0034 DW rev (LEVEL) 0641 2E24 DB '.$' 0643 0D0A0A446F CPYMSG: DB CR,LF,LF,'Do y88E 0002040608 T128: DB 0, 2, 4, 6, 8 ; ,10,12,14,16,18,20,22,24 0893 0103050709 DB 1, 3, 5, 7, 9 ; ,11,13,15,17,19,21,23,25 = 0000 .occ1 IF FALSE .occ1 ENDIF 0898 = 0001 RRTRY: DS 1 ;ReTRY counter for R/WSEG 0899 00 ERRFLG: DB 0 ;Error on last track 089A = 0001 SOURCE: DS 1 ;source drive 089B = 0001 OBJECT: DS 1 ;destination drive 089C = 0002 SKEWPTR DS 2 ;Skew table pointer 089E = 0002 SKEWT: DS 2 08A0 = 0001 FUDGE: DS 1 ;Skew fudge factor 08A1 = 0001 CFLAG: DS 1 ;Copy flag 08A2 = 0001 TRACK DS 1 ;Track 08A3 = 0001 LTRK DS 1 ;Ending track 08A4 = 0001 DISK DS 1 ;Disk number 08A5 = 0001 SPT DS 1 ;Sectors per track 08A6 = 0001 TSECS DS 1 ;Sectors left to copy from this track ;DMA DS 2 ;DMA address 08A7 = 0002 DMMA DS 2 ;OCC1 systext-compatible name  PRINT MVI C,9 05B3 C30500 JMP SYS 05B6 0E01 CONIN MVI C,1 05B8 CD0500 CALL SYS 05BB FE61 CMP 'a' 05BD D8 RC ;if not lower case 05BE FE7B CMP 'z'+1 05C0 D0 RNC ;if not lower case 05C1 D620 SUI 'a'-'A' 05C3 C9 RET 05C4 OHEX: ;PRINT number in ACCUMULATOR in HEX 05C4 proc 05C4 F5 PUSH PSW ;save IT 05C5 0F RRC ;Get HIGH NIBBLE 05C6 0F RRC 05C7 0F RRC 05C8 0F RRC 05C9 CDCD05 CALL :2 ;PRINT HIGH NIBBLE 05CC F1 POP PSW ;RESTORE number 05CD :2: ;output nib in 4 lsbs of A 05CD E60F ANI 0FH ;MASK for NIBBLE 05CF FE0A CPI 10 05D1 DAD605 JC :4 ;if decimal 05D4 C607 ADI 'A'-'9'-1 ;If NO, add offset for A-F 05D6 C630 :4: ADI '0' ;make it ascii 05D8 5F ou want to ',ESC,'l','copy',ESC,'m:' 065E 0D0A202020 DB CR,LF,' SYSTEM tracks only? (type S)' 0684 0D0A202020 DB CR,LF,' DATA tracks only? (type D)' 06AA 0D0A202020 DB CR,LF,' ALL of the disk? (type A)' 06D0 0D0A202020 DB CR,LF,' Exit back to System (type X) $' 06F8 0D0A0A536F SDMSG: DB CR,LF,LF,'Source drive? (A, B ) $' 0712 0D0A446573 OBJMSG DB CR,LF,'Destination drive? (A, B ) $' 0730 0D0A0A5075 GOMSG DB CR,LF,LF,'Put source disk on ' 0746 41 ASCISRC DB 'A' 0747 0D0A507574 DB CR,LF,'Put destination disk on ' 0761 42 ASCIOBJ DB 'B' 0762 0D0A546865 DB CR,LF,'Then type $' 0777 0D0A24 CRLF DB CR,LF,'$' 077A 0D54726163 TRACKM DB CR,'Track $' 0782 0D0A0A4469 DENMSG DB CR,LF,LF,'Disk have incompatible formats.$' 07A5 0D0A434F50 CPLMSG DB CR,LF,'COPY complete.$' 07B6 0D0A0A446F RPTMSG DB CR,LF,LF,'Do you want to COPY again? (Y/N) $' 07DB 0D0A52  08A9 = 0001 BLEN: DS 1 ;Length of the Read/Write buffer (pages) 08AA = 0002 BUFF2: DS 2 ;Address of second buffer 08AC = 0001 SECTOR: DS 1 ;Sector 08AD = 0001 SBYTE: DS 1 08AE = 0001 DBYTE: DS 1 08AF = 0001 TRYS: DS 1 ;Number of retries 08B0 = 0001 RDWRTF: DS 1 ;Read/Write flag ;BUFF = $ ;see 1st page ; Endx OCOPY.asm SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 17 BMRAM - Debug Monitor RAM Storage. D:OCCRAMA .ASM ;MRAM - Debug Monitor RAM Storage. ; Used to assembly ROM resident and CBIOS 08B1 = ED80 ORG MRAM ; Host disk xfer buffer and... ebug Monitor RAM Storage. D:OCCRAMA .ASM EF20 = 0001 TEMSEC DS 1 ;Used in bios only EF21 = 0001 RDFLAG DS 1 ;Read flag EF22 = 0001 ERFLAG DS 1 ;Error reporting EF23 = 0001 WRTYPE DS 1 ;Write operation type EF24 = 000C ALV: DS ALVS EF30 = 0020 CSV: DS CSVS ; BIOS blocking-deblocking flags EF50 = 0001 HSTACT: DS 1 ;host active flag EF51 = 0001 HSTWRT: DS 1 ;Host written flag EF52 = 0001 UNACNT: DS 1 ;Unalloc rec count EF53 = 0002 UNATRK: DS 2 ;Track EF55 = 0001 UNASEC: DS 1 ;Sector EF56 = 0001 LOGSEC: DS 1 ;Logical sector EF57 = 0002 LDADR DS 2 EF59 = 0001 KEYLCK DS 1 ;Zero if locked keyboard EF5A = 0002 CURS DS 2 ;current cursor position ; Keyboard scan temporaries EF5C = 0001 TKEY DS 1 ;T = 0028 DS 20*2 EFC1 BIOSTK: EFC1 = 0000 ROMSTK: DS 0 EFC1 = 0001 ACIAD: DS 1 ;last command byte written to ACIA EFC2 = 0004 R179x: DS 4 ;179x register save area EFC6 = 0001 KBDLY: DS 1 ;keyboard debounce-delay cell ;since CP/M CANNOT boot off B:, this cell is used ;to invert the names of the 2 drives: ; =0, all normal, A=A:, B=B: ; =1, all inverted, A=B:, B=A: EFC7 = 0001 DSKSWP DS 1 ; Z80 Alternate Register Set EFC8 ALIGN 10h EFD0 RAGS: EFD0 = 0002 DESAX: DS 2 ;DE` EFD2 = 0002 BCSAX: DS 2 ;BC` EFD4 = 0002 AFSAX: DS 2 ;AF` EFD6 = 0002 HLSAX: DS 2 ;HL` EFD8 = 0002 IXSAX: DS 2 ;IX EFDA = 0002 IYSAX: DS 2 ;IY EFDC = 0002  ; Format track template holding buffer ED80 HSTBUF: = 0000 IF DEF FMTDAT ELSE ED80 = 0180 DS 256+128 ENDIF ; Directory Buffer = EE80 DIRBUF: = HSTBUF+256 EF00 = 0006 TEM DS 6 = EF01 RNDV = TEM+1 ;random number seed = EF02 ERCNT = RNDV+1 ;DW ERCNT = EF04 RTRC = ERCNT+2 ;retry count = EF05 RTRY = RTRC+1 EF06 = 0001 MPCHR DS 1 ;prompt character EF07 = 0001 ECHOP DS 1 ;=0, list ehco off EF08 = 0001 ROMRAM DS 1 ;0= RAM, 1= ROM *********REDEFINED************* EF09 = 0000 MSECB DS 0 ;MULTI SECTOR BYTES FOR R/W **********not used************* EF09 = 0006 DSTSB DS 6 ;Disk status bytes ; Disk operation temps and control EF0F = 0002 DMADR DS 2 ;Addreem holding key EF5D = 0001 HKCNT DS 1 ;Debounce key EF5E = 0001 LKEY DS 1 ;Last valid keystroke EF5F = 0001 CKEY DS 1 ;Last control key EF60 = 0001 ESCH DS 1 ;ESC holding flag ;PIAAD and PIABD must be kept sequential, PIAAD first ;dependency in VC_HOME of BMKEY.asm EF61 = 0001 PIAAD: DS 1 ;Holds last PIA-A data EF62 = 0001 PIABD: DS 1 ;Holds last PIA-B data ; Calendar month, day year EF63 = 0003 IDAY DS 3 = EF64 IMONTH = IDAY+1 = EF65 IYR = IDAY+2 ; Wall clock time cells and disk active ; see UPTIM: in BMKEY.asm EF66 = 0006 HOURS: DS 6 = EF67 MINS: = HOURS+1 = EF68 SECS: = HOURS+2 = EF69 SEC6: = HOURS+3 ; Used to deselect drive when there is NO activity  IVSAX: DS 2 ;Interrupt page register ; 8080 Register Save Area. EFDE ALIGN 10h EFE0 REGS: EFE0 = 0001 ESAVE: DS 1 ;E Register save location EFE1 = 0001 DSAVE: DS 1 ;D Register save location EFE2 = 0001 CSAVE: DS 1 ;C Register save location EFE3 = 0001 BSAVE: DS 1 ;B Register save location EFE4 = 0001 FSAVE: DS 1 ;FLAGS save location EFE5 = 0001 ASAVE: DS 1 ;A Register save location EFE6 = 0001 LSAVE: DS 1 ;L Register save location EFE7 = 0001 HSAVE: DS 1 ;H Register save location EFE8 = 0002 PSAVE: DS 2 ;PGM COUNTER save location EFEA = 0002 SSAVE: DS 2 ;USER STACK pointer save location = 0000 IF (high *) <> (high ROMSTK) ENDIF ;TEMP: DS 1 ;TEMPORARY MONITOR CELL SORCIM 808x Assembler vess for read/write Disk EF11 = 0002 DMAADR DS 2 ;CBIOS, users DMA ; Note order of xxxSEC,xxxTRK,xxxDSK must be maintained ; along with length (1,2,1). EF13 = 0001 SEKDEL: DS 1 ;Set for seek-restore command in ROM ;depends on disk type. Siemens = 3h, MPI = 0h EF14 = 0001 SAVSEC DS 1 ;last sector requested EF15 = 0002 SAVTRK DS 2 ;last track requested EF17 = 0001 SDISK DS 1 ;Selected disk drive (0,1) = EF14 ACTSEC = SAVSEC = EF15 ACTTRK = SAVTRK = EF17 ACTDSK = SDISK EF18 = 0001 SEKSEC DS 1 EF19 = 0002 SEKTRK DS 2 EF1B = 0001 SEKDSK DS 1 EF1C = 0001 HSTSEC DS 1 EF1D = 0002 HSTTRK DS 2 EF1F = 0001 HSTDSK DS 1 SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 18 BMRAM - D ; on drive for n seconds. See FDSK routine = EF6A DACTVE: = HOURS+4 ;=0 by FDSK, Used by UPTIM = EF6B BELCNT: = HOURS+5 ;^G bell timer cell EF6C = 0001 LLIMIT DS 1 ;max #columns in a logical line ; MSG 'LLIMIT = ',LLIMIT,'h.' ; Disk drive current positions EF6D = 0002 LDSEL: DS 2 ;Last selected drive SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 19 BMRAM - Debug Monitor RAM Storage. D:OCCRAMA .ASM = EF6E LDTRK = LDSEL+1 ;Last track used for non-selected drive EF6F = 0002 IESTK: DS 2 ;save current stk ptr ; Interrupt stack EF71 = 0028 DS 20*2 EF99 = 0000 ISTK: DS 0 ; Stack entry EF99  r 3.5E 5=/00/;1 1<:03 Page 20 BMRAM - Debug Monitor RAM Storage. D:OCCRAMA .ASM EFEC = 0002 BKPA: DS 2 ;last breakpoint address EFEE = 0001 BKPC: DS 1 ;Contents of bkp = 0000 IF * >= LWAMEM ENDIF = 0000 IF * > INTBL ENDIF ; Interrupt Jump Vector is between EFFO, EFFF. SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 21 BMRAM - Debug Monitor RAM Storage. D:OCCRAMA .ASM ; Endx MRAM no ERRORs, 411 Labels, 7000h bytes not used. Program LWA = EFEFh.  s @FREQ 0FA0 n ACIAD EFC1 19#15 n ACTDSK EF17 17#48 n ACTSEC EF14 17#46 n ACTTRK EF15 17#47 n AFSAX EFD4 19#32 s ALIGN mac 19/29 19/42 8 15/ 9 15/10 15/12 15/13 15/14 15/16 15/18 15/19 15/20 15/21 15/22 15/23 15/24 15/25 15/29 15/32 15/32 15/33 CRLF 0777 3/ 8 6/57 15#19 n CSAVE EFE2 19#45 n CSV EF30 18# 7 s CSVS 0020 18/ 7 n CURS EF5A 18#20 n DACTVE EF6A 18#48 DBYTE 08AE 11/33 12/12 16#32 DENMSG 0782 3/ 4 15#21 n DESAX EFD0 19#30 n DIRBUF EE80 17#19 DISK 08A4 7/36 7/47 10/24 16#23 n DIST 014B 2#17 s DMA 0080 n DMAADR EF11 17#36 n DMADR EF0F 17#35 DMMA 08A7 9/13 9/20 16#27 n DSAVE EFE1 19#44 n DSKSWP EFC7 19#24 n DSTSB EF09 17#32 n ECHOP EF07 17#27 ERCNT EF02 17#23 17/24 n ERFLAG EF22 18# 3 ERRFLG 0899 6/53 8/ 5 8/22 10/57 12/16 16#14 / 6 15/ 7 15/ 8 15/ 9 15/10 15/12 15/12 15/13 15/14 15/14 15/16 15/18 15/19 15/21 15/21 15/22 15/23 15/23 15/24 15/25 15/29 15/32 15/32 15/33 15/33 n LKEY EF5E 18#25 n LLIMIT EF6C 18#53 LOGON 0616 2/49 14#12 n LOGSEC EF56 18#15 n LSAVE EFE6 19#49 LTRK 08A3 3/16 6/ 5 16#22 s LVMEM 1000 s LWAMEM FFFF 20/ 4 n MESV 0141 2#13 n MINS EF67 18#42 n MPCHR EF06 17#26 s MRAM ED80 17/ 4 s MSEC 000A 9/14 9/40 n MSECB EF09 17#30 s MSIZE 003C n NAME 0103 2# 3 s NVDL 0018 n O2SP 05DE 13#34 OBJECT 089B 5/ 9 7/46 16#16 OBJMSG 0712 5/ 2 15#13 ODEC 0582 7/ 5 10/31 10/35 11/43 11/58 12/ 5 12#20 OHEX 05C4 10/48 12/ 9 12/13 12/5 n ALV EF24 18# 6 s ALVS 000C 18/ 6 n ASAVE EFE5 19#48 ASCIOB 0761 5/ 4 15#17 ASCISR 0746 4/43 15#15 n BCSAX EFD2 19#31 s BELCHR 0007 15/32 n BELCNT EF6B 18#50 s BIOS EA00 BIOSLO 0001 1#33 14/ 9 n BIOSTK EFC1 19#12 n BKPA EFEC 19#58 n BKPC EFEE 20# 2 BLEN 08A9 6/31 7/25 16#28 BOOT 0000 1#31 1/33 2/36 3/37 s BREAD 0027 13/58 s BROMJP 0036 14/10 n BSAVE EFE3 19#46 s BSTDMA 0024 13/55 s BSTSEC 0021 13/52 s BSTTRK 001E 13/47 BUFF 4000 1#44 6/28 6/38 7/44 7/55 11/13 BUFF2 08AA 6/40 8/ 2 11/12 16#29 s BWRITE 002A 14/ 6 CALBUF 039E 3/10 6#26 s CDISK 0004 CFLAG 08A1 4/26 5/50 16#20 n CKEY EF5F 18#26 CMPERR 0529 11/17 11#32 CMSG1  n ESAVE EFE0 19#43 s ESC 001B 15/ 6 15/ 6 n ESCH EF60 18#27 s FALSE 0000 5/43 6/ 9 6/17 10/ 3 16/10 s FCB 005C U FMTDAT ED80 17/13 n FSAVE EFE4 19#47 n FSDMA 0024 1#37 n FSEC 0021 1#36 n FSELDS 001B 1#34 n FSTRK 001E 1#35 FUDGE 08A0 6/14 11/56 16#19 s FWAVM F000 GDISK 0346 4/42 5/ 3 5#15 5/21 5/23 5/34 GETARG 02EE 2/51 3#38 GETDEN 036E 3/ 2 5#42 GETOBJ 0331 2/53 4#47 5/ 7 GETSRC 0323 2/52 4#40 GOMSG 0730 2/54 15#14 GOROM 0610 13/48 13/53 13/56 14/ 5 14# 9 s H.IEEE 2900 s H.SIO 2A00 HELPM 016E 2/34 2#38 n HKCNT EF5D 18#24 SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 23 Disk Copy program. D:OC2 13#13 n OPTYP 014F 2#18 OSP 05E1 10/45 13/34 13#36 PERMMS 084A 8/19 15#32 n PIAAD EF61 18#31 SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 24 Disk Copy program. D:OCCRAMA .ASM n PIABD EF62 18#32 PRINT 05B1 2/35 2/50 2/55 3/ 5 3/ 9 3/22 3/24 3/35 4/16 5/17 6/58 7/ 3 8/20 10/23 10/29 10/33 10/39 11/41 11/45 12/ 3 12#53 n PSAVE EFE8 19#51 R179X EFC2 10/42 19#17 n RAGS EFD0 19#29 n RDFLAG EF21 18# 2 RDSEG 046B 7/45 8/ 3 9# 6 RDWRTF 08B0 9/12 10/18 14/ 3 16#34 n READF 0027 1#38 READMS 07DB 10/19 15#24 n REGS EFE0 19#42 n RELTYP 0146 2#14 RMOUNT 0860 3/34 15#33 RNDV EF01 17#22 17/23 n  0822 11/40 15#29 CMSG2 083A 11/44 15#30 CMSG3 0843 12/ 2 15#31 COMP1 0516 11#14 11/23 COMP2 0518 11#15 11/21 COMPSE 050F 8/ 7 11#10 CONIN 05B6 2/56 3/25 3/36 4/17 5/18 13# 4 CONOUT 05D9 10/27 12/ 7 12/11 12/49 13#31 13/37 n COPY 0100 2# 2 COPY1 0153 2/ 2 2#23 COPY2 0281 2/29 2/32 2#49 COPYX 02E2 3#33 4/34 SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 22 Disk Copy program. D:OCCRAMA .ASM CPLMSG 07A5 3/21 15#22 n CPSV 013D 2#11 CPYMSG 0643 4/15 15# 6 CPYTRK 03B9 3/13 6#52 s CR 000D 2/ 4 2/ 7 2/15 2/38 2/39 2/40 2/41 2/42 2/43 2/44 2/45 2/46 2/57 3/30 14/12 15/ 6 15/ 7 15/ CRAMA .ASM n HLSAX EFD6 19#33 HOURS EF66 18#41 18/42 18/43 18/44 18/48 18/50 n HSAVE EFE7 19#50 n HSTACT EF50 18#10 HSTBUF ED80 17#12 17/19 n HSTDSK EF1F 17#56 n HSTSEC EF1C 17#54 n HSTTRK EF1D 17#55 n HSTWRT EF51 18#11 IDAY EF63 18#35 18/36 18/37 n IESTK EF6F 19# 3 n IMONTH EF64 18#36 s INTBL EFF0 20/ 7 n ISTK EF99 19# 8 n IVSAX EFDC 19#37 n IXSAX EFD8 19#35 n IYR EF65 18#37 n IYSAX EFDA 19#36 s K 0400 n KBDLY EFC6 19#18 n KEYLCK EF59 18#19 n LDADR EF57 18#18 LDSEL EF6D 18#57 18/58 n LDTRK EF6E 18#58 LEVEL 0034 1#22 2/13 15/ 3 s LF 000A 2/ 4 2/ 7 2/15 2/38 2/39 2/40 2/41 2/42 2/43 2/44 2/45 2/46 14/12 15/ 6 15 ROMRAM EF08 17#28 ROMSTK EFC1 19#13 19/54 RPTMSG 07B6 3/23 15#23 RRTRY 0898 9/16 9/49 16#13 s RSIZE 0040 RTRC EF04 17#24 17/25 n RTRY EF05 17#25 RWERR 04B5 9/46 10# 9 RWSEG 0471 9/ 7 9#12 SAVSEC EF14 17#42 17/46 SAVTRK EF15 17#43 17/47 SBYTE 08AD 11/35 12/ 8 16#31 SCTLN 0100 1#45 9/19 11/14 SDISK EF17 13/42 17#44 17/48 SDMSG 06F8 4/41 15#12 n SEC6 EF69 18#44 SECMSG 0812 10/32 15#27 n SECS EF68 18#43 SECTOR 08AC 10/17 10/34 16#30 n SEKDEL EF13 17#40 n SEKDSK EF1B 17#52 n SEKSEC EF18 17#50 n SEKTRK EF19 17#51 SELDSK 05E5 5/29 7/39 7/50 13#41 SETDMA 05FC 9/28 13#55 SETSEC 05F3 9/31 13#50 SETTRK 05EA 7/41 7/52 13#45 s SI.S16 0055  TITLE 'BMRAM - Debug Monitor RAM Storage.' ;MRAM - Debug Monitor RAM Storage. ; Used to assembly ROM resident and CBIOS ORG MRAM ; Host disk xfer buffer and... ; Format track template holding buffer HSTBUF: IF DEF FMTDAT RMTDAT DS 0 DS (FMTSD-FMTDAT) RFMTSD DS 0 DS (FTRKN-FMTSD) RFTRKN DS 0 DS (FSECN-FTRKN) RFSECN DS 0 DS (FDAM-FSECN) RDAM DS 0 DS LSECB+1 RCRC2 DS 0 DS FMTEND-FCRC2 DS (256+128)-(*-HSTBUF) ELSE DS 256+128 ENDIF ; Directory Buffer DIRBUF: = HSTBUF+256 TEM DS 6 RNDV = TEM+1 ;random number seed ERCNT = RNDV+1 ;DW ERCNT RTRC = ERCNT+2 ;retry count RTRY = RTRC+1 MPCHR DS 1 ;prompt character ECHOP DS 1 ;=0, list ehco off ROMRAM DS 1 ;0= RAM, 1= ROM *********REDEFINED************* MSECB DS 0 ;MULTI SECTOR BYTES FOR R/W **********not used************* DSTSB DS 6 ;Disk status bytes ; Disk operation temps and control DMADR DS 2 ;Address for read/write Disk DMAADR DS 2 ;CBIOS, users DMA ; Note order of xxxSEC,xxxTRK,xxxDSK must be  s SI.S64 0056 SKEWPT 089C 6/12 7/12 16#17 SKEWT 089E 7/18 11/54 16#18 n SN 0132 2# 9 SOURCE 089A 4/45 5/ 5 7/35 16#15 SPT 08A5 5/46 7/11 16#24 n SSAVE EFEA 19#52 STSMSG 081B 10/38 15#28 s SVER 0001 s SYS 0005 6/26 13/ 2 13/ 5 13/32 s SYSDAT 0010 s SYSL 0006 SYSSEC 000A 1#41 7/14 SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 25 Disk Copy program. D:OCCRAMA .ASM SYSTAR 0000 1#42 5/49 6/ 2 T128 088E 7/15 16# 6 s TBUFF 0080 2/27 2/30 4/ 2 TEM EF00 17#21 17/22 n TEMSEC EF20 17#58 n TKEY EF5C 18#23 TOCC 088E 6/11 16# 5 TRACK 08A2 3/14 6/ 7 7/ 4 7/ 9 7/40 7/51 10/30 11/42 16#21 SCOPY .com Copyright SORCIM Corp. 1981 S/N-123456,Ver All 2.4ST OSB Z80 1:ʁ:?nͱ Copy will copy disks on the OCC-1 disk subsystem. To start, type: COPY Where is Carriage Return and is S=system, D=data or A=all. If not entered, a prompting message will be output. The source and destination drive prompts occur.$ͱ#10ͱͶ –nʭͱwͱ͞͹!4:ҶͱͱͶYʇN `ͱͶ!~O#~ CͱͶ2ASDXF2Fy2F2a:1y2ͱͶAFFO|FyA> 2':AʊDʊH y2x2!">2*.|2g}o@"!~6wızͱ:͂::*> !2">2!N6:WywJ:2O:!@k:2O:!@o*k:`!5Jͱ2xG:ɯq2" >2*(DM> GJ͵!5  6x2:ͱ:A_ ͱ:͂ͱ:͂ͱ!~maintained ; along with length (1,2,1). SEKDEL: DS 1 ;Set for seek-restore command in ROM ;depends on disk type. Siemens = 3h, MPI = 0h SAVSEC DS 1 ;last sector requested SAVTRK DS 2 ;last track requested SDISK DS 1 ;Selected disk drive (0,1) ACTSEC = SAVSEC ACTTRK = SAVTRK ACTDSK = SDISK SEKSEC DS 1 SEKTRK DS 2 SEKDSK DS 1 HSTSEC DS 1 HSTTRK DS 2 HSTDSK DS 1 TEMSEC DS 1 ;Used in bios only RDFLAG DS 1 ;Read flag ERFLAG DS 1 ;Error reporting WRTYPE DS 1 ;Write operation type ALV: DS ALVS CSV: DS CSVS ; BIOS blocking-deblocking flags HSTACT: DS 1 ;host active flag HSTWRT: DS 1 ;Host written flag UNACNT: DS 1 ;Unalloc rec count UNATRK: DS 2 ;Track UNASEC: DS 1 ;Sector LOGSEC: DS 1 ;Logical sector LDADR DS 2 KEYLCK DS 1 ;Zero if locked keyboard CURS DS 2 ;current cursor position ; Keyboard scan temporaries TKEY DS 1 ;Tem holding key HKCNT DS 1 ;Debounce key LKEY DS 1 ;Last valid keystroke CKEY DS 1 ;Last control key ESCH DS 1 ;ESC holding flag ;PIAAD an TRACKM 077A 7/ 2 15#20 TRKMSG 080A 10/28 15#26 s TRUE FFFF TRYS 08AF 7/21 8/12 16#33 TSECS 08A6 7/17 7/22 8/28 16#25 n UNACNT EF52 18#12 n UNASEC EF55 18#14 n UNATRK EF53 18#13 VCPYT 0311 4/10 4/18 4#25 VER 0032 1#21 2/13 15/ 2 s VLDL 0034 n WRITEF 002A 1#39 WRTMSG 07F2 10/22 15#25 WRTSEG 046F 7/56 9# 9 n WRTYPE EF23 18# 4 XFER 0602 9/34 13#58  10/22 15#25 WRTSEG 046F 7/56 9# 9 n WR SYSTAR 0000 1#42 5/49 6/ 2 T128 088E 7/15 16# 6 s TBUFF 0080 2/27 2/30 4/ 2 TEM EF00 17#21 17/22 n TEMSEC EF20 17#58 n TKEY EF5C 18#23 TOCC 088E 6/11 16# 5 TRACK 08A2 3/14 6/ 7 7/ 4 7/ 9 7/40 7/51 10/30 11/42 16#21 #z 2*@)# ~22"ͱ:͂:ͱ}_!:͂Cͱx͂ : :2ژWy'OxGzÅ''Oxʭ0_y a{  0_ y2OH!$'A:**.6 OSBORNE COPY Utility Program Version 2.4.$ Do you want to lcopym: SYSTEM tracks only? (type S) DATA tracks only? (type D) ALL of the disk? (type A) Exit back to System (type X) $ Source drive? (A, B ) $ Destination drive? (A, B ) $ Put source disk on A Put destination disk on B Then type $ $ Track $ Disk have incompatible formats.$ COPY complete.$ Do you want to COPY again? (Y/N) $ Read error on drive $ Write error on drive $ track $ sector $ stat=$ Compare error Track $ Sector $ Byte $ Permanent error. $ Remount system disk on A: and type RETURN.$ b d PIABD must be kept sequential, PIAAD first ;dependency in VC_HOME of BMKEY.asm PIAAD: DS 1 ;Holds last PIA-A data PIABD: DS 1 ;Holds last PIA-B data ; Calendar month, day year IDAY DS 3 IMONTH = IDAY+1 IYR = IDAY+2 ; Wall clock time cells and disk active ; see UPTIM: in BMKEY.asm HOURS: DS 6 MINS: = HOURS+1 SECS: = HOURS+2 SEC6: = HOURS+3 ; Used to deselect drive when there is NO activity ; on drive for n seconds. See FDSK routine DACTVE: = HOURS+4 ;=0 by FDSK, Used by UPTIM BELCNT: = HOURS+5 ;^G bell timer cell LLIMIT DS 1 ;max #columns in a logical line ; MSG 'LLIMIT = ',LLIMIT,'h.' ; Disk drive current positions LDSEL: DS 2 ;Last selected drive LDTRK = LDSEL+1 ;Last track used for non-selected drive IESTK: DS 2 ;save current stk ptr ; Interrupt stack DS 20*2 ISTK: DS 0 ; Stack entry DS 20*2 BIOSTK: ROMSTK: DS 0 ACIAD: DS 1 ;last command byte written to ACIA R179x: DS 4 ;179x register save area KBDLY: DS 1 ;keyboard debounce-delay cell ;sin CCRA EQU H.IEEE+1 ;Control register A CPDRB EQU H.IEEE+2 ;Peripheral/Direction register B CCRB EQU H.IEEE+3 ;Control register B ROMVEC = 100h ;Start of rom vector BKPI = 0CFh ;Breakpoint interrupt = 1 NMIA = 66h ;NMI address LCMDP = 4*1024 ;L command prom .siz IF RSIZE = 48 MSG 'Assembly for 48 k Mode 1 system' MRAM = 0AD80h ;FWA for Monitor ram FWAVM = 0B000h ;FWA of video memory NVDL = 24 .siz ELSE MSG 'Assembly for 64k Mode 2 system' MRAM = 0ED80h FWAVM = 0F000h NVDL = 24 INTBL = 0EFF0h ;interrupt vector table .siz ENDIF LVMEM = 128*32 ;Length of video memory LVDIS = 128*NVDL ;Length of Display memory VFLO = -22 ;First line video offset VLL = 128 ;Length of one video line VLDL = 52 ;Length of displayed char/line FWASM = FWAVM+VLDL ;Status info LWAMEM = FWAVM+LVMEM-1 @FREQ = 4000 ;freq of processor SCLFRE = @FREQ/25 ;for DELAY routine ; Define Ascii Control Codes. ; Value ;^Control Meaning in Phoenix EOS = 0 ;^@, NUL = End of String TBFCHR =ce CP/M CANNOT boot off B:, this cell is used ;to invert the names of the 2 drives: ; =0, all normal, A=A:, B=B: ; =1, all inverted, A=B:, B=A: DSKSWP DS 1 ; Z80 Alternate Register Set ALIGN 10h RAGS: DESAX: DS 2 ;DE` BCSAX: DS 2 ;BC` AFSAX: DS 2 ;AF` HLSAX: DS 2 ;HL` IXSAX: DS 2 ;IX IYSAX: DS 2 ;IY IVSAX: DS 2 ;Interrupt page register ; 8080 Register Save Area. ALIGN 10h REGS: ESAVE: DS 1 ;E Register save location DSAVE: DS 1 ;D Register save location CSAVE: DS 1 ;C Register save location BSAVE: DS 1 ;B Register save location FSAVE: DS 1 ;FLAGS save location ASAVE: DS 1 ;A Register save location LSAVE: DS 1 ;L Register save location HSAVE: DS 1 ;H Register save location PSAVE: DS 2 ;PGM COUNTER save location SSAVE: DS 2 ;USER STACK pointer save location IF (high *) <> (high ROMSTK) .9 DW *, STK, must be equal ENDIF ;TEMP: DS 1 ;TEMPORARY MONITOR CELL BKPA: DS 2 ;last breakpoint address BKPC: DS 1 ;Contents of bkp IF * >= LWAMEM MSG 'RAM tempo TITLE 'OCCTXT.AST - Osborne Computer Corp System Text.' SVER = 1 ; Legal values for RSIZE are 48 and 64 ; entered from command line IF *o = 0 ; user forgot 'o=64' parameter RSIZE = 64 ; default = 64k version ELSE RSIZE = *o ;get machine size ENDIF ;SYSTEXT.AST - Installation Parameter Configuration. ; This Systext provides definitions of system configuration, ; and Ascii control characters for the DigiCon Phoenix ; product set. ; ; This text is configured for CP/m. Another text must be ; used to assemble routines for Phoenix. Both are derived ; from IPARAMS.ACD. space 4,10 ; True/False definitions FALSE = 0 TRUE = not FALSE space 4,10 ODEBUG = FALSE ;True for activating debug code SYcpm20 = 4 ;=cpm 2.0 SYcpm14 = 0 SYmpm10 = 5 SYcdos = 3 @CPM SET TRUE space 4,10 ; List output page/line/column definitions MLPP = 66 ;Number of lines per physical page LLP = 60 ;NUMBER OF LINES TO PRINT PER PAGN ; Disk type and speed constants SEEKTM = 2 ;if MPI, 0 ;if Sieme 'A'-40h ;^A, SOH = Tab with fill BTBCHR = 02h ;^B, STX = BACK TAB CHARACTER ABTCHR = 03h ;^C, ETX = ABORT CHARACTER BELCHR = 07h ;^G, BEL = Audible Alarm BKSCHR = 08h ;^H, BS = PHYSICAL BACKSPACE CHARACTER TABCHR = 09h ;^I, HT = Tab LF = 0Ah ;^J, LF = Line Feed VTAB = 0Bh ;^K, VT = Vertical Tab FMFD = 0Ch ;^L, FF = Form Feed CR = 0Dh ;^M, CR = Carriage Return LITCHR = 0Eh ;^N, SO = Literal next character SUSCHR = 0Fh ;^O, SI = SUSPEND CHARACTER RTYCHR = 12h ;^R, DC2 = RE-TYPE LINE CHARACTER CTRU = 15h ;^U, NAK = Cancel Line char BWDCHR = 17h ;^W, ETB = Backspace ONE word CANCHR = 18h ;^X, CAN = CANCEL LINE CHARACTER ESC = 1Bh ;^[, ESC = Escape RUBOUT = 7Fh ; DEL = Rubout (accepted as Backspace) ERC = 7Fh ;illegal key REP = 02 ;repeat key CAPS = 03 ;repeat SHTK = 04 ;Shift key CTRL = 05 ;Control key CLRSRN = 'Z'-40h ;Clear screen MCR = 'L'-40h ;Form Feed (move cursor right) PMCHR = '>' ;Prompt character ERCHR = '?' ;Error character BKS = 08h EOFC = 'Z'-40h rary area too large ',* .9 ERROR ENDIF IF * > INTBL .9 ERROR MSG 'RAM overflow into Int Vector ', * ENDIF ; Interrupt Jump Vector is between EFFO, EFFF. PAGE ; Endx MRAM  DS 2 ;AF` HLSAX: DS 2 ;HL` IXSAX: DS 2 ;IX IYSAX: DS 2 ;IY IVSAX: DS 2 ;Interrupt page register ; 8080 Register Save Area. ALIGN 10h REGS: ESAVE: DS 1 ;E Register save location DSAVE: DS 1 ;D Register save location CSAVE: DS 1 ;C Register save location BSAVE: DS 1 ;B Register save location FSAVE: DS 1 ;FLAGS save location ASAVE: DS 1 ;A Register save location LSAVE: DS 1 ;L Register save location HSAVE: DS 1 ;H Register save location PSAVE: DS 2 ;PGM COUNTER save location SSAVE: DS 2 ;USER STACK pointer save location IF (high *) <> (high ROMSTK) .9 DW *, STK, must be equal ENDIF ;TEMP: DS 1 ;TEMPORARY MONITOR CELL BKPA: DS 2 ;last breakpoint address BKPC: DS 1 ;Contents of bkp IF * >= LWAMEM MSG 'RAM tempoms then 2 ; Keyboard debounce KBDTM = 1 ;WAIT 1 MILLISECOND FOR DEBOUNCE ; Assembly Constants ; Port definitions (Memory mapped) H.FDC = 2100h ;Floppy disk H.KEY = 2200h ;Keyboard H.SIO = 2A00h ;Serial I/O H.VIO = 2C00h ;Video memory controls SEKTMO = 0FEh ;Seek Time Out error status ; SIO Interface and definitions H.SXMT = H.SIO+1 ;Transmit address H.SREC = H.SIO+1 ;Receive (read from address) H.SCTRL = H.SIO ;Set control reg (write) H.SSTS = H.SIO ;Status reg (read) ; Defined function codes SI.MRST = 0_10_101_11b ;Master reset SI.S16 = 0_10_101_01b ;Select 16x clock, xmit/rec ;8 data, 1 stop bit ;RTS high (no request) SI.S64 = 0_10_101_10b ;Select 64x clock ;...all else identical to SI.S16 SI.1200 = SI.S16 SI.300 = SI.S64 SI.RRDY = 01 ;Receiver ready SI.TRDY = 02 ;Transmit ready SI.NCTS = 0000_1000b ; ~CTS SI.RERR = 0111_0000b ;Rcvr err: PE, OVRN, FE H.IEEE = 2900h ;IEEE interface CPDRA EQU H.IEEE+0 ;Peripheral/Direction register A   ;Eof character (same as cpm) TAB = 09h INVV = 80h ;Inverse video bit GESC = 'a' ;Graphics escape toggle char ; CP/m definitions CVER = 22 ;CPM version number CBIOSV = SVER ;cbios version NDSKS = 2 K = 1024 MSIZE = RSIZE-(LVMEM/K) BIOS = MSIZE*k-0600h ;Start of CPM jump table BDOS = BIOS-0E00h+6 ;BDOS entry pt CCP = BIOS-1600h ;CCP entry ABTC = 'C'-40h ;Abort character ALVS: = 0Ch ;*** must be validated with CBIOS *** CSVS: = 20h ;*** --------------------------- *** LSECB = 256 ;Length of a sector MTRK = 40 ;Maximum tracks MSEC = 10 ;Maximum Sectors FMTCHR = 0E5h ;Data format char space 4,10 ; Set CP/M symbols. IOBYTE = 3 CDISK = 4 ;Current logged-in CPM disk SYS = 5 ;CPM Monitor call address SYSL = SYS+1 ;(lwa of CP/m) TIMPTR = 40h ;points to where time kept DBUF = 80h ;Default disk buffer OM#LRAM = SYSL SYSR = 0 ;return to system SYSDSK = CDISK ;Contains current system disk # SYSDAT = 10h ;Date in ddmmyy SYSTIM = SYSDAT+3 ;Time in hhmm BIO call definitions BCONST = 2*3 ;Console status BCONIN SET 3*3 BCOUT = 4*3 ;Console output BLIST = 5*3 ;List output BPUNCH = 6*3 ;Punch output BRDR = 7*3 ;Reader input BHOME = 8*3 ;Home disk drive BSDSK = 9*3 ;Select Disk drive BSTTRK = 10*3 ;Set track BSTSEC = 11*3 ;Set sector BSTDMA = 12*3 ;Set DMA BREAD = 13*3 ;READ disk pru BWRITE = 14*3 ;WRITE disk pru BLSTS = 15*3 ;List LST: device status BSECTR = 16*3 ;Sector translate routine ; Extensions added by SORCIM BRRXT = 17*3 ;Ram-Rom exit BROMJP = 18*3 ;Rom jump entry BFMTJP = 19*3 ;Format Track BSBAUD = 20*3 ;Set Serial Port Baud Rate ;BRDXY = 21*3 ;Read XY ;BWTXY = 22*3 ;Write XY ; IEEE-488 calls BIECO = 21*3 ;Control Out BIESI = 22*3 ;Status In BIEGTS = 23*3 ;Go To Standby BIETC = 24*3 ;Take Control BIEOIM = 25*3 ;Output Interface Message BIEODM = 26*3 ;Output Device Message BIEIDM = 27*3 ;Input Device Message BIEPP = 28*3 ;Parallel Poll ;BIOCAL Used to make calls directly to BIO BIOCAL MACRO NAME LXI HL,L%K ;OCCFMTA.ASM TITLE 'Format program for OCC - One.' * 4D2005-00 MASTER .ASM * 2D2005-00 ASSY .ASM * 1D2005-00 LISTING .PRN * 4D1005-00 MASTER .COM * 2D1005-00 ASSY .COM ; +-----------------------+ ; | | ; | F O R M A T | ; | | ; +-----------------------+ ;REV = A ;DATE = 251 ;DEB ;RELEASED VER = '01' LEVEL = '00' ; Assembly Constants CTRM = 'M'-40h RBUF = 4000h ;Ram buffer containing format ; ;template data for ROM routine ; ;to use for formatting each track BIOSLOC EQU 1 ;get FWA(bios) from here ORG ORGP LINK OCCRAMA.ASM page ; Main loop FMT: LDK SP,STK LDK DE,PRMT CALL ESTR ;Output initial prompt :1: CALL GCHR ;Get response CMP ABTC JZ SYSR ;if ABORT RLC STO A,DRV1 ;set ascii drive RRC SUB 'A' JRC FMT ;if illegal request JRZ :2 ;if A drive CMP 1 JRNZ FMT ;if illegal (A,B only) ; A= drive to function :2: STO A,DRV ;save drive STO A,SDISK CALL FMTDSK ;Format one disk CALL VERIFY ;verify proper formattss ORGP = 100h ;Transient program origin ;EOL does not exist in CP/M EOM = '$' ;End of Message (for system function) EOF = 'Z'-40h ;End of File L$PRU = 128 ;Bytes per floppy sector FCB = 5Ch ;SYSTEM DEFAULT FILE CONTROL BLOCK FCB_NR = FCB+32 ;Next Record = LRN F_EX = 12 ;Extend field F_S2 = 14 ;CPM system usage **used with 2.0 SIZ funct** F_RC = 15 ;Record count (0 to 128) F_NR = 32 ;Next record ordinal in FCB F_RRF = 33 ;r0,r1,r2 (random field) in FCB L_FILEN = 8 ;length of File name L_FILEX = 3 ;length of filename suffix L_FCB = 36 ;length of entire FCB (comp with 2.0) DMA = 80h ;WHERE SECTORS ARE READ TBUFF = DMA ;where CCP puts command line OS#RCO = 1 ;Read character from CRT: OS#WCO = 2 ;Write character to CRT: device OS#RRO = 3 ;Read from reader OS#WPO = 4 ;Write to punch OS#WLO = 5 ;Write character to LST: device OS#OST = 9 ;Write string on CRT: OS#RCB = 10 ;Read Console Buffer OS#CABT = 11 ;Get Console status OS#VER = 12 ;Return version in HL ;H= 0, L=0 if 1.4 PUSH HL ;return LHLD SYSR+1 MVI L,%1 PCHL L%K: ENDM space 4,10 ;SYSCAL ; This macro is to be used when the common deck ; SYS.ACD is used to make file action ; requests. SYSCAL MACRO NAME,ARG .1 IF ' %2' <> ' ' LXI DE,%2 .1 ENDIF CALL %1 ENDM space 4,10 ; SYSTEM This macro provides a mechanism to call the ; system directly. SYSTEM MACRO FUN,ARG .2 IF DEF OS#%1 MVI C,OS#%1 .1 IF ' %2' <> ' ' LXI DE,%2 .1 ENDIF CALL SYS .2 ELSE CALL %1 .2 ENDIF ENDM ; ALIGN Set origin to even boundary. ALIGN MACRO SIZ,O DS (*%2+(%1)-1)/(%1)*(%1)-*%2 ENDM ; DI and EI are macros so all usages can be accounted ; for in the cr. DI MACRO DB 0F3h ENDM EI MACRO DB 0FBh ENDM ; Macros to enable ROM, RAM and DIM code ENAROM MACRO OUT 0 LDK A,0 STO A,ROMRAM ENDM DISROM MACRO OUT 1 LDK A,1 STO A,ROMRAM ENDM BRTBIT: = 80h ;set brt/dim memory BRIGHT DIMBIT: = 00h ;set brt/dim memory DIM ENADIM MACRO OUT 2 ENDM DISDIM MACRO ing CALL RDRV ;reset the drive LDK DE,PNEXT CALL ESTR ;Prompt for more CALL GCHR ;get response CMP 'Y' JNZ SYSR ;if wants to quit LDK DE,PRMT1 CALL ESTR ;request drive once again JR :1 ;enter requesting drive DTRKM: DBE cr DBE lf,lf,' ' DBE ESC,'l' DBE 'T r a c k s' DBE ESC,'m' DBE cr,lf,'0 1 2 3' DBE cr,lf,'0123456789012345678901234567890123456789',cr DCE lf RDYMS: DBE cr,lf,lf,' Press ' DBE ESC,'l','RETURN',ESC,'m' DBE ' when your disk is ready' DCE '.' PNEXT: DBE cr,lf DCE 'Do you want to format another disk (y/n) ? ' PRMT: DBE cr DBE lf,lf,lf DBE ESC,'g' DBE ' ',CTRM,CTRM,CTRM,CTRM,CTRM,' FORMAT Disk Program ' DBE CTRM,CTRM,CTRM,CTRM,CTRM DBE ESC,'G' DBE cr,lf,lf DBE 'Please Select the drive to format (A or B)' DBE cr,lf, ' (Drive "A" is left drive, "B" is right)' PRMT1: DBE cr,lf, ' Your ' DBE ESC,')','Selection',ESC,'(' DBE ' is : ' DCE ' ' DRV: DB 0 page FMTDSK: ;H= 0, L=xx if 2.0 or > ;H= 1, L=0 if MPM 1.0 OS#IND = 13 ;Initialize/Reset Disk system OS#DSEL = 14 ;Select disk unit OS#OPEN = 15 ;Open file OS#CLOS = 16 ;Close file OS#SDIR = 17 ;Search directory OS#NDIR = 18 ;next entry in directory OS#DEL = 19 ;Delete a file OS#READ = 20 ;READ next pru from file OS#WRT = 21 ;Write one PRU to file OS#CRE = 22 ;Create a file OS#REN = 23 ;rename a file OS#RLV = 24 ;Return login vector OS#RCD = 25 ;Return current disk OS#SDMA = 26 ;Set DMA address ; CPM 2.x functions OS#DIO = 6 ;Console direct I/O OS#GAA = 27 ;Get adr (alloc) OS#SWP = 28 ;Set write protect for disk OS#GRO = 29 ;Get r/o vector OS#SFA = 30 ;Set File attributes OS#GAD = 31 ;Get disk parms address OS#USC = 32 ;Get/set user code OS#RRD = 33 ;Read random OS#WRD = 34 ;Write random OS#FIZ = 35 ;Get file size in records OS#SRD = 36 ;Set random record OS#RDRV = 37 ;Reset drive OS#ADR = 38 ;Access drive OS#FDR = 39 ;Free drive OS#WRZ = 40 ;Write random with zero fill ; DirectOUT 3 ENDM ; Endx SYSTEXT eck ; SYS.ACD is used to make file action ; requests. SYSCAL MACRO NAME,ARG .1 IF ' %2' <> ' ' LXI DE,%2 .1 ENDIF CALL %1 ENDM space 4,10 ; SYSTEM This macro provides a mechanism to call the ; system directly. SYSTEM MACRO FUN,ARG .2 IF DEF OS#%1 MVI C,OS#%1 .1 IF ' %2' <> ' ' LXI DE,%2 .1 ENDIF CALL SYS .2 ELSE CALL %1 .2 ENDIF ENDM ; ALIGN Set origin to even boundary. ALIGN MACRO SIZ,O DS (*%2+(%1)-1)/(%1)*(%1)-*%2 ENDM ; DI and EI are macros so all usages can be accounted ; for in the cr. DI MACRO DB 0F3h ENDM EI MACRO DB 0FBh ENDM ; Macros to enable ROM, RAM and DIM code ENAROM MACRO OUT 0 LDK A,0 STO A,ROMRAM ENDM DISROM MACRO OUT 1 LDK A,1 STO A,ROMRAM ENDM BRTBIT: = 80h ;set brt/dim memory BRIGHT DIMBIT: = 00h ;set brt/dim memory DIM ENADIM MACRO OUT 2 ENDM DISDIM MACRO  ;Format entire disk ; Entry SDISK set to drive ; Exit all tracks formatted. proc LDK DE,RDYMS CALL ESTR ;output new line CALL GCHR CMP CR JNZ FMT ;if not ready, start again LDK HL,0 STO HL,SAVTRK ;set track to home ; Move format data to high RAM buffer LDK DE,RBUF+2 ;Fwa of data LDK HL,FORDAT LDK BC,LIFMT LDIR ;copy 1st sector LDK A,1 STO A,SECN ;set sector ECHO MSEC-1 ;copy other 9 sectors PUSH DE POP IY LDK HL,FMTSD LDK BC,LISEC LDIR LD A,SECN INC A STO A,SECN STO A,[IY+(FSECN-FMTSD)] ENDM EX DE,HL LDK BC,RBUF+2 SBC HL,BC ;get length STO HL,RBUF ;set length into buffer CALL RDRV ;reset drive ; Display track indicator line LDK DE,DTRKM CALL ESTR ;Display track numbers ; Format entire disk :2: CALL STRK ;Set new track into data LDK BC,RBUF ;point to FWA of buffer CALL BIOS+BFMTJP ;Issue format command LDK C,'F' CMP -1 JNZ :4 ;if drive ready LDK DE,DNRMS CALL ESTR ;indicate drive NOT ready JMP FMT: RET ;return with Z=True space 4,10 FILLC: ;fill with character: ; C= chr to broadcast ; DE= #characters to broadcast ; HL= FWA to start broadcast MOV A,E OR D RZ ;if broadcast 0 bytes STO C,[hl] ;1st byte DEC DE MOV A,E OR D RZ ;if broadcast 1 byte MOV B,D ! MOV C,E ;BC := DE (count) MOV D,H ! MOV E,L ;DE := HL (FWA) INC DE ;DE := HL + 1 LDIR ;overlapping move RET page TRAK: DS 1 ;current TRACK SECN: DB 0 DNRMS: DBE cr,lf,'Disk drive ' DRV1: DBE 0 DBE ': is NOT ready' DCE '.' DNRMS1: DBE cr,lf,' Is a disk installed in drive ? ' DBE ESC,'l','(y/n)',ESC,'m' DCE ' ' space 4,10 STRK: ;Set track numbers into data proc LDK HL,RBUF+1+TRKOFS LDK B,MSEC LDK DE,LISEC LD A,SAVTRK :2: STO A,[hl] ;update track cell ADD HL,DE ;point to next DJNZ :2 ;if not done LDK A,1 STO A,SAVSEC ;set sector to 1st RET space 4,10 RDRV: ;Reset requested disk drive proc LDK A,10 :2: STO A,RTST ;update retries LDK E,0 LD A,DRV MOV C,A 4: POP DE ! POP HL RET DS 30*2 STK: DS 0 ORG RBUF ;FWA of format image DS MTRK*LIFMT ;length of format image BUFFR: DS 0 ;Verify data area ; Endx OFORMAT OD verify ERSTR: DCE 'E','H'-40h ! DCE 'H'-40h ;BAD verify ;LFSTR: DBE 'H'-40h ! DCE LF ;^H,LF CR2LF DBE lf CRLF: DBE cr ! DCE lf ESTR: ;Output encoded data to console ; Entry DE= FWA of code ; Entry DE=FWA of source OR A ;clear cbit LD A,[de] RRC ;normalize char PUSH AF AND 07Fh MOV C,A CALL CO ;output it INC DE POP AF JRNC ESTR ;if not done RET CO: ;Output one char to screen ; Entry C= char PUSH HL ! PUSH DE ! PUSH BC MOV E,C SYSTEM WCO ;output to console POP BC ! POP DE ! POP HL RET space 4,10 GCHR: ;Get character NORMALIZED from console ; Exit A=C= char proc PUSH HL ! PUSH DE SYSTEM RCO MOV A,C CMP 'a' JC :4 ;if not lower case CMP 'z'+1 JNC :4 ;if not lower case SUI 'a'-'A' : ;start again :4: OR A JZ :6 ;if no error LDK C,'E' :6: CALL CO ;output indicator LD A,SAVTRK INC A STO A,SAVTRK ;update track number CMP MTRK JRNZ :2 ;continue till all tracks ; CALL RDRV ;reset drive RET page VERIFY: ;Verify that format worked correctly - ;read in disk 1 track @ a time to ck for errors ;Uses All. Proc LK DE,MSEC*LSECB ;length of 1 track LK HL,BUFFR ;FWA of track buffer LK C, not FMTCHR ;chr to broadcast CALL FILLC ;fill BUFFR with DB chrs LK DE,CRLF CALL ESTR LK A,0 STO A,TRAK ;start @ OUTSIDE track CALL RDRV ;reset the disk... :hang: :loop: LK BC,BUFFR ;verify free-core area CALL SETDMA LK BC,1 ;start @ sector #1 CALL SETSEC LD A,TRAK LK B,0 ! MOV C,A ;BC = trk# CALL SETTRK LK B,MSEC ;read in MSEC sectors CALL XFER ;read in 1 track @ RBUF OR A JRNZ :serr ;if seek-type error CALL COMPAR ;compare with expected JRNZ :err :good: LK DE,VSTR ;if OK JR :2 :serr: ;Seek type error- ckCALL BIOS+BSDSK ;issue SELDSK CMP -1 RNZ ;if drive ready LD A,RTST CMP 10 JNZ :3 ;if NOT first time LDK DE,DNRMS1 CALL ESTR ;ask if drive ready CALL GCHR CMP 'Y' RZ ;if drive ready confirmation JMP SYSR ;else exit :3: LDK DE,DNRMS CALL ESTR ;indicate drive NOT ready LD A,RTST DEC A JNZ :2 ;if not n tries JMP FMT ;start again RTST: DB 0 page FORDAT: ;Format data for IBM 3740. ; **** Gap 5 **** ECHO 40 ! DB 0FFh ENDM ECHO 6 ! DB 0 ENDM DB 0FCh ;Index mark ; **** Gap 1 **** FMTSD: ECHO 16 ! DB 0FFh ENDM DB 0,0,0,0,0,0 DB 0FEh ;Id address mark FTRKN: DB 0 ;track TRKOFS = *-FORDAT DB 0 ;side FSECN: DB 1 ;sector IF LSECB = 128 DB 0 ENDIF IF LSECB = 256 DB 1 ENDIF IF LSECB > 256 .9 DW LSECB, Error unknown sector length ENDIF DB 0F7h ;CRC ; **** Gap 2 **** ECHO 11 ! DB 0FFh ENDM ECHO 6 ! DB 0 ENDM FDAM: DB 0FBh ;Data address mark :noref: EQU FMTCHR ;...this symbol won't create ;180 for time-out err & hang if so: CMP SEKTMO ;ck for Seek Time Out error JRZ :hang ;if disk not in drive (?) :err: LK DE,ERSTR ;if NOT ok :2: CALL ESTR ;notify user LK HL,TRAK INC [hl] ;step IN one track LD A,[hl] ;A=next track CMP MTRK ;verify up thru MTRK-1 JRNZ :loop :exit: LK DE,CR2LF ;cr,lf,lf JMP ESTR page ;Misc useful procs Proc SETDMA: LK DE,BSTDMA+100h ;addr of DMA-setter within ROM JR GOROM SETSEC: LK DE,BSTSEC+100h ;addr of sector-setter within ROM JR GOROM SETTRK: LK DE,BSTTRK+100h ;addr of track-setter JR GOROM XFER: LK DE,BREAD+100h ;multi-sector read ;JR GOROM GOROM: LD HL,BIOSLOC LK L,BROMJP ;do ROM jump JMP [hl] space 4,10 COMPAR: ;compare data from disk with expected data ;Entry track image @ BUFFR ;Exit Z=TRUE => good compare LK BC,MSEC*LSECB ;#bytes to compare LK HL,BUFFR ;FWA of data LK A,FMTCHR ;format character :loop: CPI# ;magic Zilog instruction RNZ ;if bad compare JPE :loop ;if not finished :good useless xrefs... ; **** Data **** ECHO 128 DB :noref ENDM IF LSECB > 128 ECHO 128 DB :noref ENDM ENDIF FCRC2: DB 0F7h ;CRC FMTEND = * LIFMT = *-FORDAT LISEC = *-FMTSD page VSTR: DCE 'V','H'-40h ! DCE 'H'-40h ;used for GOOD verify ERSTR: DCE 'E','H'-40h ! DCE 'H'-40h ;BAD verify ;LFSTR: DBE 'H'-40h ! DCE LF ;^H,LF CR2LF DBE lf CRLF: DBE cr ! DCE lf ESTR: ;Output encoded data to console ; Entry DE= FWA of code ; Entry DE=FWA of source OR A ;clear cbit LD A,[de] RRC ;normalize char PUSH AF AND 07Fh MOV C,A CALL CO ;output it INC DE POP AF JRNC ESTR ;if not done RET CO: ;Output one char to screen ; Entry C= char PUSH HL ! PUSH DE ! PUSH BC MOV E,C SYSTEM WCO ;output to console POP BC ! POP DE ! POP HL RET space 4,10 GCHR: ;Get character NORMALIZED from console ; Exit A=C= char proc PUSH HL ! PUSH DE SYSTEM RCO MOV A,C CMP 'a' JC :4 ;if not lower case CMP 'z'+1 JNC :4 ;if not lower case SUI 'a'-'A' :1iͅ2wA8( 22ͷiͅYi@@@@@@@@@@@@@@@6ب@@@@@6`@@@@@@@@@b@@@@@@@@@d@@@@@@@@@f`bdfhjlnpr`bdfhjlnpr`bdfhjlnpr`bdfhjlnpr@@@6ؤ6@@@@@]@@@@@@@P^R@~A6@@@@@@@@@6@@@@@@P@@R@@@P@DD@@@X@DD@@R@@@@@@@@@6R6P@@t@Aiͅ !"@!^>2i!1/:i<2iw!1/:i<2iw!1/:i<2iw!1/:i<2iw!1/:i<2iw!1/:i<2iw!1/:i<2iw!1/:i<2iw!1/:i<2iw@B"@Eiʹ@9FjiEx:<2(  !vXgi>2hv16:hO; @ I `(ci!h4~( fi$ !'*.6 !v>Q{q{BKT]2@@t@@@]@@@@@@@@~@6P^R6A!H@ /:w>2> 2:O: iͅYji:=ER = '01' = 3030 LEVEL = '00' ; Assembly Constants = 000D CTRM = 'M'-40h = 4000 RBUF = 4000h ;Ram buffer containing format ; ;template data for ROM routine ; ;to use for formatting each track = 0001 BIOSLOC EQU 1 ;get FWA(bios) from here 0000 = 0100 ORG ORGP LINK OCCRAMA.ASM SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 2 Format program for OCC - One. D:OCCFMTA .ASM ; Main loop 0100 31D806 FMT: LDK SP,STK 0103 110E02 LDK DE,PRMT 0106 CD6906 CALL ESTR ;Output initial prompt 0109 CD8506 :1: CALL GCHR ;Get response 010C FE03 CMP ABTC 010E CA0000 JZ SYSR ;if ABORT 0111 DBE 'Please Select the drive to format (A or B)' SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 3 Format program for OCC - One. D:OCCFMTA .ASM 0267 1A14404040 DBE cr,lf, ' (Drive "A" is left drive, "B" is right)' 0293 1A14404040 PRMT1: DBE cr,lf, ' Your ' 02A2 3652A6CAD8 DBE ESC,')','Selection',ESC,'(' 02AF 40D2E64074 DBE ' is : ' 02B5 41 DCE ' ' 02B6 00 DRV: DB 0 SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 4 Format program for OCC - One. D:OCCFMTA .ASM 02B7 FMTDSK: ;Format entire disk ; Entry SDISK set to drive ; Exit all tracks formatted. 02B7 proc 02B7 11B301 LDK DE,RDYMS 02BA CD6906 CALL ESTR ;output new line 02BD CD8506 CALL GCHR Ox0Yyaڙ{ҙ iw!1/:i<2iw!1/:i<2iw!1/:i<2iw!1/:i<2iw!1/:i<2iw!1/:i<2iw!1/:i<2iw@B"@Eiʹ@9FjiEx:<2(  !vXgi>2hv16:hO; @ I `(ci!h4~( fi$ !'*.6 !v>Q{q{BKT]2@@t@@@]@@@@@@@@~@6P^R6A!H@ /:w>2> 2:O: iͅYji:=07 RLC 0112 327704 STO A,DRV1 ;set ascii drive 0115 0F RRC 0116 D641 SUB 'A' 0118 38E6 ^0100$ JRC FMT ;if illegal request 011A 2804 ^0120$ JRZ :2 ;if A drive 011C FE01 CMP 1 011E 20E0 ^0100$ JRNZ FMT ;if illegal (A,B only) ; A= drive to function 0120 32B602 :2: STO A,DRV ;save drive 0123 3217EF STO A,SDISK 0126 CDB702 CALL FMTDSK ;Format one disk 0129 CDD803 CALL VERIFY ;verify proper formatting 012C CDC904 CALL RDRV ;reset the drive 012F 11E101 LDK DE,PNEXT 0132 CD6906 CALL ESTR ;Prompt for more 0135 CD8506 CALL GCHR ;get response 0138 FE59 CMP 'Y' 013A C20000 JNZ SYSR ;if wants to quit 013D 119302 LDK DE,PRMT1 0140 CD6906 CALL ESTR ;request drive once again 0143 18C4 ^0109$ JR :1 ;enter requesting drive 0145 1A DTRKM: DBE  02C0 FE0D CMP CR 02C2 C20001 JNZ FMT ;if not ready, start again 02C5 210000 LDK HL,0 02C8 2215EF STO HL,SAVTRK ;set track to home ; Move format data to high RAM buffer 02CB 110240 LDK DE,RBUF+2 ;Fwa of data 02CE 210205 LDK HL,FORDAT 02D1 015E01 LDK BC,LIFMT 02D4 EDB0 $ LDIR ;copy 1st sector 02D6 3E01 LDK A,1 02D8 326904 STO A,SECN ;set sector ECHO MSEC-1 ;copy other 9 sectors PUSH DE POP IY LDK HL,FMTSD LDK BC,LISEC LDIR LD A,SECN INC A STO A,SECN STO A,[IY+(FSECN-FMTSD)] ENDM 0398 EB EX DE,HL 0399 010240 LDK BC,RBUF+2 039C ED42  SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 1 Format program for OCC - One. D:OCCRAMA .ASM *ABS 0000 EFEF *CODE EFEF 0000 *DATA EFEF 0000 ;OCCFMTA.ASM * 4D2005-00 MASTER .ASM * 2D2005-00 ASSY .ASM * 1D2005-00 LISTING .PRN * 4D1005-00 MASTER .COM * 2D1005-00 ASSY .COM ; +-----------------------+ ; | | ; | F O R M A T | ; | | ; +-----------------------+ ;REV = A ;DATE = 251 ;DEB ;RELEASED = 3031 Vcr 0146 1414404040 DBE lf,lf,' ' 0157 36D8 DBE ESC,'l' 0159 A840E440C2 DBE 'T r a c k s' 0164 36DA DBE ESC,'m' 0166 1A14604040 DBE cr,lf,'0 1 2 3' 0187 1A14606264 DBE cr,lf,'0123456789012345678901234567890123456789',cr 01B2 15 DCE lf 01B3 1A14144040 RDYMS: DBE cr,lf,lf,' Press ' 01BE 36D8A48AA8 DBE ESC,'l','RETURN',ESC,'m' 01C8 40EED0CADC DBE ' when your disk is ready' 01E0 5D DCE '.' 01E1 1A14 PNEXT: DBE cr,lf 01E3 88DE40F2DE DCE 'Do you want to format another disk (y/n) ? ' 020E 1A PRMT: DBE cr 020F 141414 DBE lf,lf,lf 0212 36CE DBE ESC,'g' 0214 4040404040 DBE ' ',CTRM,CTRM,CTRM,CTRM,CTRM,' FORMAT Disk Program ' 0233 1A1A1A1A1A DBE CTRM,CTRM,CTRM,CTRM,CTRM 0238 368E DBE ESC,'G' 023A 1A1414 DBE cr,lf,lf 023D A0D8CAC2E6  $ SBC HL,BC ;get length 039E 220040 STO HL,RBUF ;set length into buffer 03A1 CDC904 CALL RDRV ;reset drive ; Display track indicator line 03A4 114501 LDK DE,DTRKM 03A7 CD6906 CALL ESTR ;Display track numbers ; Format entire disk 03AA CDB404 :2: CALL STRK ;Set new track into data 03AD 010040 LDK BC,RBUF ;point to FWA of buffer 03B0 CD39EA CALL BIOS+BFMTJP ;Issue format command 03B3 0E46 LDK C,'F' 03B5 FEFF CMP -1 03B7 C2C303 JNZ :4 ;if drive ready 03BA 116A04 LDK DE,DNRMS 03BD CD6906 CALL ESTR ;indicate drive NOT ready 03C0 C30001 JMP FMT ;start again 03C3 B7 :4: OR A SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 5 Format program for OCC - One. D:OCCFMTA .ASM 0413 116006 :good: LK DE,VSTR ;if OK 0416 1807 ^041F$ JR :2 0418 :serr: ;Seek type error- ck for time-out err & hang if so: 0418 FEFE CMP SEKTMO ;ck for Seek Time Out error 041A 28D5 ^03F1$ JRZ :hang ;if disk not in drive (?) 041C 116306 :err: LK DE,ERSTR ;if NOT ok 041F CD6906 :2: CALL ESTR ;notify user 0422 216804 LK HL,TRAK 0425 34 INC [hl] ;step IN one track 0426 7E LD A,[hl] ;A=next track 0427 FE28 CMP MTRK ;verify up thru MTRK-1 0429 20C6 ^03F1$ JRNZ :loop 042B 116606 :exit: LK DE,CR2LF ;cr,lf,lf 042E C36906 JMP ESTR SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 7 Format program for OCC - One. D:OCCFMTA .ASM ;Misc useful procs 0431 Proc 0431 112401  D:OCCFMTA .ASM 0468 = 0001 TRAK: DS 1 ;current TRACK 0469 00 SECN: DB 0 046A 1A1488D2E6 DNRMS: DBE cr,lf,'Disk drive ' 0477 00 DRV1: DBE 0 0478 7440D2E640 DBE ': is NOT ready' 0486 5D DCE '.' 0487 1A14404092 DNRMS1: DBE cr,lf,' Is a disk installed in drive ? ' 04AA 36D850F25E DBE ESC,'l','(y/n)',ESC,'m' 04B3 41 DCE ' ' 04B4 STRK: ;Set track numbers into data 04B4 proc 04B4 214840 LDK HL,RBUF+1+TRKOFS 04B7 060A LDK B,MSEC 04B9 112F01 LDK DE,LISEC 04BC 3A15EF LD A,SAVTRK 04BF 77 :2: STO A,[hl] ;update track cell 04C0 19 ADD HL,DE ;point to next 04C1 10FC ^04BF$ DJNZ :2 ;if not done 04C3 3E01 LDK A,1 04C5 3214EF STO A,SAVSEC ;set sector to 1st 04C8 C9 RET 04C9 RDRV: ;Reset requested disk drive  03C4 CAC903 JZ :6 ;if no error 03C7 0E45 LDK C,'E' 03C9 CD7806 :6: CALL CO ;output indicator 03CC 3A15EF LD A,SAVTRK 03CF 3C INC A 03D0 3215EF STO A,SAVTRK ;update track number 03D3 FE28 CMP MTRK 03D5 20D3 ^03AA$ JRNZ :2 ;continue till all tracks ; CALL RDRV ;reset drive 03D7 C9 RET SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 6 Format program for OCC - One. D:OCCFMTA .ASM 03D8 VERIFY: ;Verify that format worked correctly - ;read in disk 1 track @ a time to ck for errors ;Uses All. 03D8 Proc 03D8 11000A LK DE,MSEC*LSECB ;length of 1 track 03DB 21B076 LK HL,BUFFR ;FWA of track buffer 03DE 0E1A LK C, not FMTCHR ;chr to broadcast 03E0 CD5804 CALL FILLC ;fill BUFFR with DB chrs SETDMA: LK DE,BSTDMA+100h ;addr of DMA-setter within ROM 0434 180D ^0443$ JR GOROM 0436 112101 SETSEC: LK DE,BSTSEC+100h ;addr of sector-setter within ROM 0439 1808 ^0443$ JR GOROM 043B 111E01 SETTRK: LK DE,BSTTRK+100h ;addr of track-setter 043E 1803 ^0443$ JR GOROM 0440 112701 XFER: LK DE,BREAD+100h ;multi-sector read ;JR GOROM 0443 2A0100 GOROM: LD HL,BIOSLOC 0446 2E36 LK L,BROMJP ;do ROM jump 0448 E9 JMP [hl] 0449 COMPAR: ;compare data from disk with expected data ;Entry track image @ BUFFR ;Exit Z=TRUE => good compare 0449 01000A LK BC,MSEC*LSECB ;#bytes to compare 044C 21B076 LK HL,BUFFR ;FWA of data 044F 3EE5 LK A,FMTCHR ;format character 0451 EDA1 $ :loop: CPI# ;magi 04C9 proc 04C9 3E0A LDK A,10 04CB 320105 :2: STO A,RTST ;update retries 04CE 1E00 LDK E,0 04D0 3AB602 LD A,DRV 04D3 4F MOV C,A 04D4 CD1BEA CALL BIOS+BSDSK ;issue SELDSK 04D7 FEFF CMP -1 04D9 C0 RNZ ;if drive ready 04DA 3A0105 LD A,RTST 04DD FE0A CMP 10 04DF C2F104 JNZ :3 ;if NOT first time 04E2 118704 LDK DE,DNRMS1 04E5 CD6906 CALL ESTR ;ask if drive ready 04E8 CD8506 CALL GCHR 04EB FE59 CMP 'Y' 04ED C8 RZ ;if drive ready confirmation 04EE C30000 JMP SYSR ;else exit 04F1 116A04 :3: LDK DE,DNRMS 04F4 CD6906 CALL ESTR ;indicate drive NOT ready 04F7 3A0105 LD A,RTST 04FA 3D DEC A 04FB C2CB04 JNZ :2 ;if not n tries 04FE C30001 JMP FMT ;start again SORCIM 808x Assembler ve 03E3 116706 LK DE,CRLF 03E6 CD6906 CALL ESTR 03E9 3E00 LK A,0 03EB 326804 STO A,TRAK ;start @ OUTSIDE track 03EE CDC904 CALL RDRV ;reset the disk... 03F1 :hang: 03F1 01B076 :loop: LK BC,BUFFR ;verify free-core area 03F4 CD3104 CALL SETDMA 03F7 010100 LK BC,1 ;start @ sector #1 03FA CD3604 CALL SETSEC 03FD 3A6804 LD A,TRAK 0400 0600 LK B,0 ! MOV C,A ;BC = trk# 0403 CD3B04 CALL SETTRK 0406 060A LK B,MSEC ;read in MSEC sectors 0408 CD4004 CALL XFER ;read in 1 track @ RBUF 040B B7 OR A 040C 200A ^0418$ JRNZ :serr ;if seek-type error 040E CD4904 CALL COMPAR ;compare with expected 0411 2009 ^041C$ JRNZ :err c Zilog instruction 0453 C0 RNZ ;if bad compare 0454 EA5104 JPE :loop ;if not finished 0457 C9 :good: RET ;return with Z=True 0458 FILLC: ;fill with character: ; C= chr to broadcast ; DE= #characters to broadcast ; HL= FWA to start broadcast 0458 7B MOV A,E 0459 B2 OR D 045A C8 RZ ;if broadcast 0 bytes 045B 71 STO C,[hl] ;1st byte 045C 1B DEC DE 045D 7B MOV A,E 045E B2 OR D 045F C8 RZ ;if broadcast 1 byte 0460 42 MOV B,D ! MOV C,E ;BC := DE (count) 0462 54 MOV D,H ! MOV E,L ;DE := HL (FWA) 0464 13 INC DE ;DE := HL + 1 0465 EDB0 $ LDIR ;overlapping move 0467 C9 RET SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 8 Format program for OCC - One. r 3.5E 5=/00/;1 1<:03 Page 9 Format program for OCC - One. D:OCCFMTA .ASM 0501 00 RTST: DB 0 SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 10 Format program for OCC - One. D:OCCFMTA .ASM 0502 FORDAT: ;Format data for IBM 3740. ; **** Gap 5 **** ECHO 40 ! DB 0FFh ENDM ECHO 6 ! DB 0 ENDM 0530 FC DB 0FCh ;Index mark ; **** Gap 1 **** 0531 FMTSD: ECHO 16 ! DB 0FFh ENDM 0541 0000000000 DB 0,0,0,0,0,0 0547 FE DB 0FEh ;Id address mark 0548 00 FTRKN: DB 0 ;track = 0047 TRKOFS = *-FORDAT 0549 00 DB 0 ;s ; Entry DE= FWA of code ; Entry DE=FWA of source 0669 B7 OR A ;clear cbit 066A 1A LD A,[de] 066B 0F RRC ;normalize char 066C F5 PUSH AF 066D E67F AND 07Fh 066F 4F MOV C,A 0670 CD7806 CALL CO ;output it 0673 13 INC DE 0674 F1 POP AF 0675 30F2 ^0669$ JRNC ESTR ;if not done 0677 C9 RET 0678 CO: ;Output one char to screen ; Entry C= char 0678 E5 PUSH HL ! PUSH DE ! PUSH BC 067B 59 MOV E,C 067C SYSTEM WCO ;output to console 0681 C1 POP BC ! POP DE ! POP HL 0684 C9 RET 0685 GCHR: ;Get character NORMALIZED from console ; Exit A=C= char 0685 proc 0685 E5 PUSH HL ! PUSH DE 0687 SYSTEM RCO 068C 79 MOV A,C T = RNDV+1 ;DW ERCNT = EF04 RTRC = ERCNT+2 ;retry count = EF05 RTRY = RTRC+1 EF06 = 0001 MPCHR DS 1 ;prompt character EF07 = 0001 ECHOP DS 1 ;=0, list ehco off EF08 = 0001 ROMRAM DS 1 ;0= RAM, 1= ROM *********REDEFINED************* EF09 = 0000 MSECB DS 0 ;MULTI SECTOR BYTES FOR R/W **********not used************* EF09 = 0006 DSTSB DS 6 ;Disk status bytes ; Disk operation temps and control EF0F = 0002 DMADR DS 2 ;Address for read/write Disk EF11 = 0002 DMAADR DS 2 ;CBIOS, users DMA ; Note order of xxxSEC,xxxTRK,xxxDSK must be maintained ; along with length (1,2,1). EF13 = 0001 SEKDEL: DS 1 ;Set for seek-restore command in ROM ;depends on disk type. Siemens = 3h, MPI = 0h EF14 = 0001 SAVSEC DS 1 ;last sector requested EF15 = 0002 ide 054A 01 FSECN: DB 1 ;sector = 0000 IF LSECB = 128 - DB 0 ENDIF = FFFF IF LSECB = 256 054B 01 DB 1 ENDIF = 0000 IF LSECB > 256 - .9 DW LSECB, Error unknown sector length ENDIF 054C F7 DB 0F7h ;CRC ; **** Gap 2 **** ECHO 11 ! DB 0FFh ENDM ECHO 6 ! DB 0 ENDM 055E FB FDAM: DB 0FBh ;Data address mark = 00E5 :noref: EQU FMTCHR ;...this symbol won't create ;180 useless xrefs... ; **** Data **** ECHO 128 DB :noref ENDM = FFFF IF LSECB > 128 ECHO 128  068D FE61 CMP 'a' 068F DA9906 JC :4 ;if not lower case 0692 FE7B CMP 'z'+1 0694 D29906 JNC :4 ;if not lower case 0697 D620 SUI 'a'-'A' 0699 D1 :4: POP DE ! POP HL 069B C9 RET 069C = 003C DS 30*2 06D8 = 0000 STK: DS 0 06D8 = 4000 ORG RBUF ;FWA of format image 4000 = 36B0 DS MTRK*LIFMT ;length of format image 76B0 = 0000 BUFFR: DS 0 ;Verify data area ; Endx OFORMAT SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 13 BMRAM - Debug Monitor RAM Storage. D:OCCRAMA .ASM ;MRAM - Debug Monitor RAM Storage. ; Used to assembly ROM resident and CBIOS 76B0 = ED80 ORG MRAM  SAVTRK DS 2 ;last track requested EF17 = 0001 SDISK DS 1 ;Selected disk drive (0,1) SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 14 BMRAM - Debug Monitor RAM Storage. D:OCCRAMA .ASM = EF14 ACTSEC = SAVSEC = EF15 ACTTRK = SAVTRK = EF17 ACTDSK = SDISK EF18 = 0001 SEKSEC DS 1 EF19 = 0002 SEKTRK DS 2 EF1B = 0001 SEKDSK DS 1 EF1C = 0001 HSTSEC DS 1 EF1D = 0002 HSTTRK DS 2 EF1F = 0001 HSTDSK DS 1 EF20 = 0001 TEMSEC DS 1 ;Used in bios only EF21 = 0001 RDFLAG DS 1 ;Read flag EF22 = 0001 ERFLAG DS 1 ;Error reporting EF23 = 0001 WRTYPE DS 1 ;Write operation type EF24 = 000C ALV: DS ALVS EF30 = 0020 CSV: DS CSVS ; BIOS blocking-deblocking fla DB :noref ENDM ENDIF 065F F7 FCRC2: DB 0F7h ;CRC = 0660 FMTEND = * SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 11 Format program for OCC - One. D:OCCFMTA .ASM = 015E LIFMT = *-FORDAT = 012F LISEC = *-FMTSD SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 12 Format program for OCC - One. D:OCCFMTA .ASM 0660 AD11 VSTR: DCE 'V','H'-40h ! DCE 'H'-40h ;used for GOOD verify 0663 8B11 ERSTR: DCE 'E','H'-40h ! DCE 'H'-40h ;BAD verify ;LFSTR: DBE 'H'-40h ! DCE LF ;^H,LF 0666 14 CR2LF DBE lf 0667 1A CRLF: DBE cr ! DCE lf 0669 ESTR: ;Output encoded data to console  ; Host disk xfer buffer and... ; Format track template holding buffer ED80 HSTBUF: = 0000 IF DEF FMTDAT - RMTDAT DS 0 - DS (FMTSD-FMTDAT) - RFMTSD DS 0 - DS (FTRKN-FMTSD) - RFTRKN DS 0 - DS (FSECN-FTRKN) - RFSECN DS 0 - DS (FDAM-FSECN) - RDAM DS 0 - DS LSECB+1 - RCRC2 DS 0 - DS FMTEND-FCRC2 - DS (256+128)-(*-HSTBUF) ELSE ED80 = 0180 DS 256+128 ENDIF ; Directory Buffer = EE80 DIRBUF: = HSTBUF+256 EF00 = 0006 TEM DS 6 = EF01 RNDV = TEM+1 ;random number seed = EF02 ERCNgs EF50 = 0001 HSTACT: DS 1 ;host active flag EF51 = 0001 HSTWRT: DS 1 ;Host written flag EF52 = 0001 UNACNT: DS 1 ;Unalloc rec count EF53 = 0002 UNATRK: DS 2 ;Track EF55 = 0001 UNASEC: DS 1 ;Sector EF56 = 0001 LOGSEC: DS 1 ;Logical sector EF57 = 0002 LDADR DS 2 EF59 = 0001 KEYLCK DS 1 ;Zero if locked keyboard EF5A = 0002 CURS DS 2 ;current cursor position ; Keyboard scan temporaries EF5C = 0001 TKEY DS 1 ;Tem holding key EF5D = 0001 HKCNT DS 1 ;Debounce key EF5E = 0001 LKEY DS 1 ;Last valid keystroke EF5F = 0001 CKEY DS 1 ;Last control key EF60 = 0001 ESCH DS 1 ;ESC holding flag ;PIAAD and PIABD must be kept sequential, PIAAD first ;dependency in VC_HOME of BMKEY.asm EF61 = 0001 PIAAD: DS 1 ;Holds last PIA-A data EF62 = 000 invert the names of the 2 drives: ; =0, all normal, A=A:, B=B: ; =1, all inverted, A=B:, B=A: EFC7 = 0001 DSKSWP DS 1 ; Z80 Alternate Register Set EFC8 ALIGN 10h EFD0 RAGS: EFD0 = 0002 DESAX: DS 2 ;DE` EFD2 = 0002 BCSAX: DS 2 ;BC` EFD4 = 0002 AFSAX: DS 2 ;AF` EFD6 = 0002 HLSAX: DS 2 ;HL` EFD8 = 0002 IXSAX: DS 2 ;IX EFDA = 0002 IYSAX: DS 2 ;IY EFDC = 0002 IVSAX: DS 2 ;Interrupt page register ; 8080 Register Save Area. EFDE ALIGN 10h EFE0 REGS: EFE0 = 0001 ESAVE: DS 1 ;E Register save location EFE1 = 0001 DSAVE: DS 1 ;D Register save location SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 16 BMRAM - Debug Monitor RAM Storage.  s BIOS EA00 4/49 8/38 BIOSLO 0001 1#33 7/15 n BIOSTK EFC1 15#25 n BKPA EFEC 16#15 n BKPC EFEE 16#16 s BREAD 0027 7/12 s BROMJP 0036 7/16 n BSAVE EFE3 16# 2 s BSDSK 001B 8/38 s BSTDMA 0024 7/ 3 s BSTSEC 0021 7/ 6 s BSTTRK 001E 7/ 9 BUFFR 76B0 6/ 7 6/20 7/27 12#53 s CDISK 0004 n CKEY EF5F 14#39 CO 0678 5/ 3 12/17 12#23 COMPAR 0449 6/36 7#22 s CR 000D 2/33 2/38 2/39 2/39 2/42 2/47 2/50 2/56 2/58 3/ 2 4/ 9 8/ 3 8/ 8 12/ 6 CR2LF 0666 6/55 12# 5 CRLF 0667 6/11 12# 6 n CSAVE EFE2 15#58 n CSV EF30 14#20 s CSVS 0020 14/20 CTRM 000D 1#28 2/53 2/53 2/53 2/53 2/53 2/54 2/54 2/54 2/54 2/54 1 PIABD: DS 1 ;Holds last PIA-B data ; Calendar month, day year EF63 = 0003 IDAY DS 3 = EF64 IMONTH = IDAY+1 = EF65 IYR = IDAY+2 ; Wall clock time cells and disk active ; see UPTIM: in BMKEY.asm EF66 = 0006 HOURS: DS 6 = EF67 MINS: = HOURS+1 = EF68 SECS: = HOURS+2 = EF69 SEC6: = HOURS+3 SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 15 BMRAM - Debug Monitor RAM Storage. D:OCCRAMA .ASM ; Used to deselect drive when there is NO activity ; on drive for n seconds. See FDSK routine = EF6A DACTVE: = HOURS+4 ;=0 by FDSK, Used by UPTIM = EF6B BELCNT: = HOURS+5 ;^G bell timer cell EF6C = 0001  D:OCCRAMA .ASM EFE2 = 0001 CSAVE: DS 1 ;C Register save location EFE3 = 0001 BSAVE: DS 1 ;B Register save location EFE4 = 0001 FSAVE: DS 1 ;FLAGS save location EFE5 = 0001 ASAVE: DS 1 ;A Register save location EFE6 = 0001 LSAVE: DS 1 ;L Register save location EFE7 = 0001 HSAVE: DS 1 ;H Register save location EFE8 = 0002 PSAVE: DS 2 ;PGM COUNTER save location EFEA = 0002 SSAVE: DS 2 ;USER STACK pointer save location = 0000 IF (high *) <> (high ROMSTK) - .9 DW *, STK, must be equal ENDIF ;TEMP: DS 1 ;TEMPORARY MONITOR CELL EFEC = 0002 BKPA: DS 2 ;last breakpoint address EFEE = 0001 BKPC: DS 1 ;Contents of bkp = 0000 IF * >= LWAMEM - MSG 'RAM temporary area too large ',* - .9 ERROR  n CURS EF5A 14#33 n DACTVE EF6A 15# 4 n DESAX EFD0 15#43 n DIRBUF EE80 13#32 s DMA 0080 n DMAADR EF11 13#49 n DMADR EF0F 13#48 DNRMS 046A 4/53 8# 3 8/52 SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 18 Format program for OCC - One. D:OCCRAMA .ASM DNRMS1 0487 8# 8 8/44 DRV 02B6 2/19 3# 8 8/36 DRV1 0477 2/10 8# 4 n DSAVE EFE1 15#57 n DSKSWP EFC7 15#37 n DSTSB EF09 13#45 DTRKM 0145 2#33 4/43 n ECHOP EF07 13#40 ERCNT EF02 13#36 13/37 n ERFLAG EF22 14#16 ERSTR 0663 6/46 12# 3 n ESAVE EFE0 15#56 s ESC 001B 2/35 2/37 2/43 2/43 2/52 2/55 3/ 3 3/ 3 8/ 9 8/ 9 n ESCH EF60 14#40 ESTR 0669 2/ 5 2/25 2/3 LLIMIT DS 1 ;max #columns in a logical line ; MSG 'LLIMIT = ',LLIMIT,'h.' ; Disk drive current positions EF6D = 0002 LDSEL: DS 2 ;Last selected drive = EF6E LDTRK = LDSEL+1 ;Last track used for non-selected drive EF6F = 0002 IESTK: DS 2 ;save current stk ptr ; Interrupt stack EF71 = 0028 DS 20*2 EF99 = 0000 ISTK: DS 0 ; Stack entry EF99 = 0028 DS 20*2 EFC1 BIOSTK: EFC1 = 0000 ROMSTK: DS 0 EFC1 = 0001 ACIAD: DS 1 ;last command byte written to ACIA EFC2 = 0004 R179x: DS 4 ;179x register save area EFC6 = 0001 KBDLY: DS 1 ;keyboard debounce-delay cell ;since CP/M CANNOT boot off B:, this cell is used ;to ENDIF = 0000 IF * > INTBL - .9 ERROR - MSG 'RAM overflow into Int Vector ', * ENDIF ; Interrupt Jump Vector is between EFFO, EFFF. SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 17 BMRAM - Debug Monitor RAM Storage. D:OCCRAMA .ASM ; Endx MRAM no ERRORs, 354 Labels, 74D4h bytes not used. Program LWA = EFEFh.  s @FREQ 0FA0 s ABTC 0003 2/ 7 n ACIAD EFC1 15#28 n ACTDSK EF17 14# 4 n ACTSEC EF14 14# 2 n ACTTRK EF15 14# 3 n AFSAX EFD4 15#45 s ALIGN mac 15/42 15/55 n ALV EF24 14#19 s ALVS 000C 14/19 n ASAVE EFE5 16# 4 n BCSAX EFD2 15#44 n BELCNT EF6B 15# 6 s BFMTJP 0039 4/49 0 4/ 7 4/44 4/54 6/12 6/47 6/56 8/45 8/53 12# 8 12/20 s FALSE 0000 s FCB 005C n FCRC2 065F 10#54 n FDAM 055E 10#39 FILLC 0458 6/ 9 7#39 FMT 0100 2# 3 2/13 2/16 4/10 4/55 8/57 s FMTCHR 00E5 6/ 8 7/28 10/41 U FMTDAT ED80 13/13 FMTDSK 02B7 2/21 4# 2 n FMTEND 0660 10#57 FMTSD 0531 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 10#11 11/ 2 FORDAT 0502 4/17 9# 3 10/19 10/58 n FSAVE EFE4 16# 3 FSECN 054A 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 10#21 n FTRKN 0548 10#18 s FWAVM F000 GCHR 0685 2/ 6 2/26 4/ 8 8/46 12#34 GOROM 0001 12/39 12/39 s OS#WCO 0002 12/28 12/28 n PIAAD EF61 14#44 n PIABD EF62 14#45 PNEXT 01E1 2/24 2#47 PRMT 020E 2/ 4 2#50 PRMT1 0293 2/29 3# 2 n PSAVE EFE8 16# 7 n R179X EFC2 15#30 n RAGS EFD0 15#42 RBUF 4000 1#29 4/16 4/36 4/38 4/48 8/17 12/51 n RDFLAG EF21 14#15 RDRV 04C9 2/23 4/40 6/17 8#31 RDYMS 01B3 2#42 4/ 6 n REGS EFE0 15#55 RNDV EF01 13#35 13/36 n ROMRAM EF08 13#41 ROMSTK EFC1 15#26 16/10 s RSIZE 0040 RTRC EF04 13#37 13/38 n RTRY EF05 13#38 RTST 0501 8/34 8/41 8/54 9# 2 SAVSEC EF14 8/25 13#55 14/ 2 SAVTRK EF15 4/13 5/ 4 5/ 6 8/20 13#56 14/ 3 SDISK EF17 2/20 13#57 14/ 4 n SEC6 EF69 14#57 SO;OCCFMT1.ASM TITLE 'FORMAT PROGRAM FOR OCC - ONE.' * 4D2005-00 MASTER .ASM * 2D2005-00 ASSY .ASM * 1D2005-00 LISTING .PRN * 4D1005-00 MASTER .COM * 2D1005-00 ASSY .COM ; +-----------------------+ ; | | ; | F O R M A T | ; | | ; +-----------------------+ ;REV = A1 ;DATE = 251 ;DEB ; ADDED RETRY TO VERIFY VER = '01' LEVEL = '00' ; ASSEMBLY CONSTANTS CTRM = 'M'-40H RBUF = 4000H ;RAM BUFFER CONTAINING FORMAT ; ;TEMPLATE DATA FOR ROM ROUTINE ; ;TO USE FOR FORMATTING EACH TRACK BIOSLOC = 1 ;GET FWA(BIOS) FROM HERE ORG ORGP LINK OCCRAM1.ASM page ; Main loop FMT: LDK SP,STK LDK DE,PRMT CALL ESTR ;Output initial prompt :1: CALL GCHR ;Get response CMP ABTC JZ SYSR ;if ABORT RLC STO A,DRV1 ;set ascii drive RRC SUB 'A' JRC FMT ;if illegal request JRZ :2 ;if A drive CMP 1 JRNZ FMT ;if illegal (A,B only) ; A= drive to function :2: STO A,DRV ;save drive STO A,SDISK CALL FMTDSK ;Format one disk CALL VERIFY ;verify p443 7/ 4 7/ 7 7/10 7#15 s H.IEEE 2900 s H.SIO 2A00 n HKCNT EF5D 14#37 n HLSAX EFD6 15#46 HOURS EF66 14#54 14/55 14/56 14/57 15/ 4 15/ 6 n HSAVE EFE7 16# 6 n HSTACT EF50 14#23 HSTBUF ED80 13#12 13/32 n HSTDSK EF1F 14#12 n HSTSEC EF1C 14#10 n HSTTRK EF1D 14#11 n HSTWRT EF51 14#24 IDAY EF63 14#48 14/49 14/50 n IESTK EF6F 15#16 n IMONTH EF64 14#49 s INTBL EFF0 16/23 n ISTK EF99 15#21 n IVSAX EFDC 15#50 n IXSAX EFD8 15#48 SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 19 Format program for OCC - One. D:OCCRAMA .ASM n IYR EF65 14#50 n IYSAX EFDA 15#49 s K 0400 n KBDLY EFC6 15#31 n KEYLCK EF59 14#32 n LDADR EF57 14#31 LDSEL EF6D 15#13 RCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 20 Format program for OCC - One. D:OCCRAMA .ASM SECN 0469 4/21 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 8# 2 n SECS EF68 14#56 n SEKDEL EF13 13#53 n SEKDSK EF1B 14# 8 n SEKSEC EF18 14# 6 s SEKTMO 00FE 6/43 n SEKTRK EF19 14# 7 SETDMA 0431 6/21 7# 3 SETSEC 0436 6/24 7# 6 SETTRK 043B 6/29 7# 9 s SI.S16 0055 s SI.S64 0056 n SSAVE EFEA 16# 8 STK 06D8 2/ 3 12#49 STRK 04B4 4/47 8#15 s SVER 0001 s SYS 0005 12/28 12/39 s SYSDAT 0010 s SYSL 0006 s SYSR 0000 2/ 8 2/28 8/49 s SYSTEM mac 12/28 12/39 TEM EF00 13#3roper formatting CALL RDRV ;reset the drive CALL RDRV LDK DE,PNEXT CALL ESTR ;Prompt for more CALL GCHR ;get response CMP 'Y' JNZ SYSR ;if wants to quit LDK DE,PRMT1 CALL ESTR ;request drive once again JR :1 ;enter requesting drive DTRKM: DBE cr DBE lf,lf,' ' DBE ESC,'l' DBE 'T r a c k s' DBE ESC,'m' DBE cr,lf,'0 1 2 3' DBE cr,lf,'0123456789012345678901234567890123456789',cr DCE lf RDYMS: DBE cr,lf,lf,' Press ' DBE ESC,'l','RETURN',ESC,'m' DBE ' when your disk is ready' DCE '.' PNEXT: DBE cr,lf DCE 'Do you want to format another disk (y/n) ? ' PRMT: DBE cr DBE lf,lf,lf DBE ESC,'g' DBE ' ',CTRM,CTRM,CTRM,CTRM,CTRM,' FORMAT Disk Program ' DBE CTRM,CTRM,CTRM,CTRM,CTRM DBE ESC,'G' DBE cr,lf,lf DBE 'Please Select the drive to format (A or B)' DBE cr,lf, ' (Drive "A" is left drive, "B" is right)' PRMT1: DBE cr,lf, ' Your ' DBE ESC,')','Selection',ESC,'(' DBE ' is : ' DCE ' ' D 15/14 n LDTRK EF6E 15#14 n LEVEL 3030 1#25 s LF 000A 2/34 2/34 2/38 2/39 2/40 2/42 2/42 2/47 2/51 2/51 2/51 2/56 2/56 2/58 3/ 2 8/ 3 8/ 8 12/ 5 12/ 7 LIFMT 015E 4/18 10#58 12/52 LISEC 012F 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 8/19 11# 2 n LKEY EF5E 14#38 n LLIMIT EF6C 15# 9 n LOGSEC EF56 14#28 n LSAVE EFE6 16# 5 s LSECB 0100 6/ 6 7/26 10/22 10/25 10/28 10/48 s LVMEM 1000 s LWAMEM FFFF 16/18 n MINS EF67 14#55 n MPCHR EF06 13#39 s MRAM ED80 13/ 4 s MSEC 000A 4/23 6/ 6 6/31 7/26 8/18 n MSECB EF09 13#43 s MSIZE 003C s MTRK 0028 5/ 7 6/52 12/52 s NVDL 0018 s ORGP 0100 1/36 s OS#RCO 04 13/35 n TEMSEC EF20 14#14 n TKEY EF5C 14#36 TRAK 0468 6/15 6/26 6/49 7#56 TRKOFS 0047 8/17 10#19 s TRUE FFFF n UNACNT EF52 14#25 n UNASEC EF55 14#27 n UNATRK EF53 14#26 n VER 3031 1#24 VERIFY 03D8 2/22 5#11 s VLDL 0034 VSTR 0660 6/39 12# 2 n WRTYPE EF23 14#17 XFER 0440 6/32 7#12  s VLDL 0034 VSTR 0660 3 n SEKTRK EF19 14# 7 SETDMA 0431 6/21 7# 3 SETSEC 0436 6/24 7# 6 SETTRK 043B 6/29 7# 9 s SI.S16 0055 s SI.S64 0056 n SSAVE EFEA 16# 8 STK 06D8 2/ 3 12#49 STRK 04B4 4/47 8#15 s SVER 0001 s SYS 0005 12/28 12/39 s SYSDAT 0010 s SYSL 0006 s SYSR 0000 2/ 8 2/28 8/49 s SYSTEM mac 12/28 12/39 TEM EF00 13#3RV: DB 0 page FMTDSK: ;Format entire disk ; Entry SDISK set to drive ; Exit all tracks formatted. proc LDK DE,RDYMS CALL ESTR ;output new line CALL GCHR CMP CR JNZ FMT ;if not ready, start again LDK HL,0 STO HL,SAVTRK ;set track to home ; Move format data to high RAM buffer LDK DE,RBUF+2 ;Fwa of data LDK HL,FORDAT LDK BC,LIFMT LDIR ;copy 1st sector LDK A,1 STO A,SECN ;set sector ECHO MSEC-1 ;copy other 9 sectors PUSH DE POP IY LDK HL,FMTSD LDK BC,LISEC LDIR LD A,SECN INC A STO A,SECN STO A,[IY+(FSECN-FMTSD)] ENDM EX DE,HL LDK BC,RBUF+2 SBC HL,BC ;get length STO HL,RBUF ;set length into buffer CALL RDRV ;reset drive CALL RDRV ; Display track indicator line LDK DE,DTRKM CALL ESTR ;Display track numbers ; Format entire disk :2: CALL STRK ;Set new track into data LDK BC,RBUF ;point to FWA of buffer CALL BIOS+BFMTJP ;Issue format command LDK C,'F' CMP -1 JNZ :4 ;if drive ready LDK DE,DNRMS CALL ESTR within ROM JR GOROM SETSEC: LK DE,BSTSEC+100h ;addr of sector-setter within ROM JR GOROM SETTRK: LK DE,BSTTRK+100h ;addr of track-setter JR GOROM XFER: LK DE,BREAD+100h ;multi-sector read ;JR GOROM GOROM: LD HL,BIOSLOC LK L,BROMJP ;do ROM jump JMP [hl] space 4,10 COMPAR: ;compare data from disk with expected data ;Entry track image @ BUFFR ;Exit Z=TRUE => good compare LK BC,MSEC*LSECB ;#bytes to compare LK HL,BUFFR ;FWA of data LK A,FMTCHR ;format character :loop: CPI# ;magic Zilog instruction RNZ ;if bad compare JPE :loop ;if not finished :good: RET ;return with Z=True space 4,10 FILLC: ;fill with character: ; C= chr to broadcast ; DE= #characters to broadcast ; HL= FWA to start broadcast MOV A,E OR D RZ ;if broadcast 0 bytes STO C,[hl] ;1st byte DEC DE MOV A,E OR D RZ ;if broadcast 1 byte MOV B,D ! MOV C,E ;BC := DE (count) MOV D,H ! MOV E,L ;DE := HL (FWA) INC DE ;DE := HL + 1 LDIR ;overlapping move RET page encoded data to console ; Entry DE= FWA of code ; Entry DE=FWA of source OR A ;clear cbit LD A,[de] RRC ;normalize char PUSH AF AND 07Fh MOV C,A CALL CO ;output it INC DE POP AF JRNC ESTR ;if not done RET CO: ;Output one char to screen ; Entry C= char PUSH HL ! PUSH DE ! PUSH BC MOV E,C SYSTEM WCO ;output to console POP BC ! POP DE ! POP HL RET space 4,10 GCHR: ;Get character NORMALIZED from console ; Exit A=C= char proc PUSH HL ! PUSH DE SYSTEM RCO MOV A,C CMP 'a' JC :4 ;if not lower case CMP 'z'+1 JNC :4 ;if not lower case SUI 'a'-'A' :4: POP DE ! POP HL RET DS 30*2 STK: DS 0 ORG RBUF ;FWA of format image DS MTRK*LIFMT ;length of format image BUFFR: DS 0 ;Verify data area ; Endx OFORMAT DCE 'H'-40h ;BAD verify ;LFSTR: DBE 'H'-40h ! DCE LF ;^H,LF CR2LF DBE lf CRLF: DBE cr ! DCE lf RETRY DB 0 ESTR: ;Output  ;indicate drive NOT ready JMP FMT ;start again :4: OR A JZ :6 ;if no error LDK C,'E' :6: CALL CO ;output indicator LD A,SAVTRK INC A STO A,SAVTRK ;update track number CMP MTRK JRNZ :2 ;continue till all tracks CALL RDRV ;reset drive CALL RDRV RET page VERIFY: ;Verify that format worked correctly - ;read in disk 1 track @ a time to ck for errors ;Uses All. Proc LK DE,MSEC*LSECB ;length of 1 track LK HL,BUFFR ;FWA of track buffer LK C, not FMTCHR ;chr to broadcast CALL FILLC ;fill BUFFR with DB chrs LK DE,CRLF CALL ESTR LK A,0 STO A,TRAK ;start @ OUTSIDE track CALL RDRV ;reset the disk... CALL RDRV ;SET RETRY COUNT LDK A,5 ;FIVE READ RETRYS STO A,RETRY :hang: :loop: LK DE,MSEC*LSECB ;length of 1 track LK HL,BUFFR ;FWA of track buffer LDK C,0 ;ZERO BUFFER CALL FILLC ;fill BUFFR with DB chrs LDK BC,BUFFR CALL SETDMA LK BC,1 ;start @ sector #1 CALL SETSEC LD A,TRAK LK B,0 ! MOV C,A ;BC = trk# CAL TRAK: DS 1 ;current TRACK SECN: DB 0 DNRMS: DBE cr,lf,'Disk drive ' DRV1: DBE 0 DBE ': is NOT ready' DCE '.' DNRMS1: DBE cr,lf,' Is a disk installed in drive ? ' DBE ESC,'l','(y/n)',ESC,'m' DCE ' ' space 4,10 STRK: ;Set track numbers into data proc LDK HL,RBUF+1+TRKOFS LDK B,MSEC LDK DE,LISEC LD A,SAVTRK :2: STO A,[hl] ;update track cell ADD HL,DE ;point to next DJNZ :2 ;if not done LDK A,1 STO A,SAVSEC ;set sector to 1st RET space 4,10 RDRV: ;Reset requested disk drive proc LDK A,10 :2: STO A,RTST ;update retries LDK E,0 LD A,DRV MOV C,A CALL BIOS+BSDSK ;issue SELDSK CMP -1 RNZ ;if drive ready LD A,RTST CMP 10 JNZ :3 ;if NOT first time LDK DE,DNRMS1 CALL ESTR ;ask if drive ready CALL GCHR CMP 'Y' RZ ;if drive ready confirmation JMP SYSR ;else exit :3: LDK DE,DNRMS CALL ESTR ;indicate drive NOT ready LD A,RTST DEC A JNZ :2 ;if not n tries JMP FMT ;start again RTST: DB 0 page FORDAT: ;Format data fL SETTRK ;OUTPUT RETRY COUNT LD A,RETRY ;LOAD A WITH COUNT ADD A,30H ;MAKE ASCI MOV C,A ;MOVE TO C CALL CO ;OUTPUT NUMBER LDK C,08H ;BACK SPACE CALL CO LK B,MSEC ;read in MSEC sectors CALL XFER ;read in 1 track @ RBUF OR A JRNZ :serr ;if seek-type error CALL COMPAR ;compare with expected JRNZ :err :GOOD: LDK A,5 STO A,RETRY ;RESET RETRYS LK DE,VSTR ;if OK JR :2 :serr: ;Seek type error- ck for time-out err & hang if so: CMP SEKTMO ;ck for Seek Time Out error JRZ :hang ;if disk not in drive (?) :err: LD A,RETRY ;CHECK FOR RETRY SUB 1 ;DECREMENT BY ONE STO A,RETRY ;SAVE NEW COUNT JNZ :loop ;loop LDK A,5 ;RESET RETRYS TO FIVE STO A,RETRY LK DE,ERSTR ;if NOT ok :2: CALL ESTR ;notify user LK HL,TRAK INC [hl] ;step IN one track LD A,[hl] ;A=next track CMP MTRK ;verify up thru MTRK-1 JRNZ :loop :exit: LK DE,CR2LF ;cr,lf,lf JMP ESTR page ;Misc useful procs Proc SETDMA: LK DE,BSTDMA+100h ;addr of DMA-setteror IBM 3740. ; **** Gap 5 **** ECHO 40 ! DB 0FFh ENDM ECHO 6 ! DB 0 ENDM DB 0FCh ;Index mark ; **** Gap 1 **** FMTSD: ECHO 16 ! DB 0FFh ENDM DB 0,0,0,0,0,0 DB 0FEh ;Id address mark FTRKN: DB 0 ;track TRKOFS = *-FORDAT DB 0 ;side FSECN: DB 1 ;sector IF LSECB = 128 DB 0 ENDIF IF LSECB = 256 DB 1 ENDIF IF LSECB > 256 .9 DW LSECB, Error unknown sector length ENDIF DB 0F7h ;CRC ; **** Gap 2 **** ECHO 11 ! DB 0FFh ENDM ECHO 6 ! DB 0 ENDM FDAM: DB 0FBh ;Data address mark :noref: = FMTCHR ;...this symbol won't create ;180 useless xrefs... ; **** Data **** ECHO 128 DB :noref ENDM IF LSECB > 128 ECHO 128 DB :noref ENDM ENDIF FCRC2: DB 0F7h ;CRC FMTEND = * LIFMT = *-FORDAT LISEC = *-FMTSD page VSTR: DCE 'V','H'-40h ! DCE 'H'-40h ;used for GOOD verify ERSTR: DCE 'E','H'-40h ! DCE 'H'-40h ;BAD verify ;LFSTR: DBE 'H'-40h ! DCE LF ;^H,LF CR2LF DBE lf CRLF: DBE cr ! DCE lf RETRY DB 0 ESTR: ;Output  SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 1 FORMAT PROGRAM FOR OCC - ONE. D:OCCRAM1 .ASM *ABS 0000 EFF0 *CODE EFF0 0000 *DATA EFF0 0000 ;OCCFMT1.ASM * 4D2005-00 MASTER .ASM * 2D2005-00 ASSY .ASM * 1D2005-00 LISTING .PRN * 4D1005-00 MASTER .COM * 2D1005-00 ASSY .COM ; +-----------------------+ ; | | ; | F O R M A T | ; | | ; +-----------------------+ ;REV = A1 ;DATE = 251 ;DEB ; ADDED RETRY TO VERIFY  0148 1A DTRKM: DBE cr 0149 1414404040 DBE lf,lf,' ' 015A 36D8 DBE ESC,'l' 015C A840E440C2 DBE 'T r a c k s' 0167 36DA DBE ESC,'m' 0169 1A14604040 DBE cr,lf,'0 1 2 3' 018A 1A14606264 DBE cr,lf,'0123456789012345678901234567890123456789',cr 01B5 15 DCE lf 01B6 1A14144040 RDYMS: DBE cr,lf,lf,' Press ' 01C1 36D8A48AA8 DBE ESC,'l','RETURN',ESC,'m' 01CB 40EED0CADC DBE ' when your disk is ready' 01E3 5D DCE '.' 01E4 1A14 PNEXT: DBE cr,lf 01E6 88DE40F2DE DCE 'Do you want to format another disk (y/n) ? ' 0211 1A PRMT: DBE cr 0212 141414 DBE lf,lf,lf 0215 36CE DBE ESC,'g' 0217 4040404040 DBE ' ',CTRM,CTRM,CTRM,CTRM,CTRM,' FORMAT Disk Program ' 0236 1A1A1A1A1A DBE CTRM,CTRM,CTRM,CTRM,CTRM 023B 368E DBE ESC,'G' 023D 1A1 010240 LDK BC,RBUF+2 039F ED42 $ SBC HL,BC ;get length 03A1 220040 STO HL,RBUF ;set length into buffer 03A4 CD0B05 CALL RDRV ;reset drive 03A7 CD0B05 CALL RDRV ; Display track indicator line 03AA 114801 LDK DE,DTRKM 03AD CDAC06 CALL ESTR ;Display track numbers ; Format entire disk 03B0 CDF604 :2: CALL STRK ;Set new track into data 03B3 010040 LDK BC,RBUF ;point to FWA of buffer 03B6 CD39EA CALL BIOS+BFMTJP ;Issue format command 03B9 0E46 LDK C,'F' 03BB FEFF CMP -1 03BD C2C903 JNZ :4 ;if drive ready 03C0 11AC04 LDK DE,DNRMS 03C3 CDAC06 CALL ESTR ;indicate drive NOT ready 03C6 C30001 JMP FMT ;start again SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 5 FORMAT PROGRAM FOR OCC - ONE.  = 3031 VER = '01' = 3030 LEVEL = '00' ; ASSEMBLY CONSTANTS = 000D CTRM = 'M'-40H = 4000 RBUF = 4000H ;RAM BUFFER CONTAINING FORMAT ; ;TEMPLATE DATA FOR ROM ROUTINE ; ;TO USE FOR FORMATTING EACH TRACK = 0001 BIOSLOC = 1 ;GET FWA(BIOS) FROM HERE 0000 = 0100 ORG ORGP LINK OCCRAM1.ASM SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 2 FORMAT PROGRAM FOR OCC - ONE. D:OCCFMT1 .ASM ; Main loop 0100 311B07 FMT: LDK SP,STK 0103 111102 LDK DE,PRMT 0106 CDAC06 CALL ESTR ;Output initial prompt 0109 CDC806 :1: CALL GCHR ;Get response 010C FE03 CMP ABTC 010E CA0000 JZ SYSR ;if AB414 DBE cr,lf,lf SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 3 FORMAT PROGRAM FOR OCC - ONE. D:OCCFMT1 .ASM 0240 A0D8CAC2E6 DBE 'Please Select the drive to format (A or B)' 026A 1A14404040 DBE cr,lf, ' (Drive "A" is left drive, "B" is right)' 0296 1A14404040 PRMT1: DBE cr,lf, ' Your ' 02A5 3652A6CAD8 DBE ESC,')','Selection',ESC,'(' 02B2 40D2E64074 DBE ' is : ' 02B8 41 DCE ' ' 02B9 00 DRV: DB 0 SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 4 FORMAT PROGRAM FOR OCC - ONE. D:OCCFMT1 .ASM 02BA FMTDSK: ;Format entire disk ; Entry SDISK set to drive ; Exit all tracks formatted. 02BA proc 02BA 11B601 LDK DE,RDYMS 02BD CDAC06 CALL ESTR ;outpu D:OCCFMT1 .ASM 03C9 B7 :4: OR A 03CA CACF03 JZ :6 ;if no error 03CD 0E45 LDK C,'E' 03CF CDBB06 :6: CALL CO ;output indicator 03D2 3A15EF LD A,SAVTRK 03D5 3C INC A 03D6 3215EF STO A,SAVTRK ;update track number 03D9 FE28 CMP MTRK 03DB 20D3 ^03B0$ JRNZ :2 ;continue till all tracks 03DD CD0B05 CALL RDRV ;reset drive 03E0 CD0B05 CALL RDRV 03E3 C9 RET SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 6 FORMAT PROGRAM FOR OCC - ONE. D:OCCFMT1 .ASM 03E4 VERIFY: ;Verify that format worked correctly - ;read in disk 1 track @ a time to ck for errors ;Uses All. 03E4 Proc 03E4 11000A LK DE,MSEC*LSECB ;length of 1 track 03E7 21B076 LK HL,BUFFR ;FWA of track buffer 03EA ORT 0111 07 RLC 0112 32B904 STO A,DRV1 ;set ascii drive 0115 0F RRC 0116 D641 SUB 'A' 0118 38E6 ^0100$ JRC FMT ;if illegal request 011A 2804 ^0120$ JRZ :2 ;if A drive 011C FE01 CMP 1 011E 20E0 ^0100$ JRNZ FMT ;if illegal (A,B only) ; A= drive to function 0120 32B902 :2: STO A,DRV ;save drive 0123 3217EF STO A,SDISK 0126 CDBA02 CALL FMTDSK ;Format one disk 0129 CDE403 CALL VERIFY ;verify proper formatting 012C CD0B05 CALL RDRV ;reset the drive 012F CD0B05 CALL RDRV 0132 11E401 LDK DE,PNEXT 0135 CDAC06 CALL ESTR ;Prompt for more 0138 CDC806 CALL GCHR ;get response 013B FE59 CMP 'Y' 013D C20000 JNZ SYSR ;if wants to quit 0140 119602 LDK DE,PRMT1 0143 CDAC06 CALL ESTR ;request drive once again 0146 18C1 ^0109$ JR :1 ;enter requesting drive t new line 02C0 CDC806 CALL GCHR 02C3 FE0D CMP CR 02C5 C20001 JNZ FMT ;if not ready, start again 02C8 210000 LDK HL,0 02CB 2215EF STO HL,SAVTRK ;set track to home ; Move format data to high RAM buffer 02CE 110240 LDK DE,RBUF+2 ;Fwa of data 02D1 214405 LDK HL,FORDAT 02D4 015E01 LDK BC,LIFMT 02D7 EDB0 $ LDIR ;copy 1st sector 02D9 3E01 LDK A,1 02DB 32AB04 STO A,SECN ;set sector ECHO MSEC-1 ;copy other 9 sectors PUSH DE POP IY LDK HL,FMTSD LDK BC,LISEC LDIR LD A,SECN INC A STO A,SECN STO A,[IY+(FSECN-FMTSD)] ENDM 039B EB EX DE,HL 039C  0E1A LK C, not FMTCHR ;chr to broadcast 03EC CD9A04 CALL FILLC ;fill BUFFR with DB chrs 03EF 11A906 LK DE,CRLF 03F2 CDAC06 CALL ESTR 03F5 3E00 LK A,0 03F7 32AA04 STO A,TRAK ;start @ OUTSIDE track 03FA CD0B05 CALL RDRV ;reset the disk... 03FD CD0B05 CALL RDRV ;SET RETRY COUNT 0400 3E05 LDK A,5 ;FIVE READ RETRYS 0402 32AB06 STO A,RETRY 0405 :hang: 0405 :loop: 0405 11000A LK DE,MSEC*LSECB ;length of 1 track 0408 21B076 LK HL,BUFFR ;FWA of track buffer 040B 0E00 LDK C,0 ;ZERO BUFFER 040D CD9A04 CALL FILLC ;fill BUFFR with DB chrs 0410 01B076 LDK BC,BUFFR 0413 CD7304 CALL SETDMA 0416 010100 LK BC,1 ;start @ sec CMP MTRK ;verify up thru MTRK-1 046B 2098 ^0405$ JRNZ :loop 046D 11A806 :exit: LK DE,CR2LF ;cr,lf,lf 0470 C3AC06 JMP ESTR SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 8 FORMAT PROGRAM FOR OCC - ONE. D:OCCFMT1 .ASM ;Misc useful procs 0473 Proc 0473 112401 SETDMA: LK DE,BSTDMA+100h ;addr of DMA-setter within ROM 0476 180D ^0485$ JR GOROM 0478 112101 SETSEC: LK DE,BSTSEC+100h ;addr of sector-setter within ROM 047B 1808 ^0485$ JR GOROM 047D 111E01 SETTRK: LK DE,BSTTRK+100h ;addr of track-setter 0480 1803 ^0485$ JR GOROM 0482 112701 XFER: LK DE,BREAD+100h ;multi-sector read ;JR GOROM 0485 2A0100 GOROM: LD HL,BIOSLOC 0488 2E36 LK L,BROMJP ;do ROM jump 048A E9 JMFS 04F9 060A LDK B,MSEC 04FB 112F01 LDK DE,LISEC 04FE 3A15EF LD A,SAVTRK 0501 77 :2: STO A,[hl] ;update track cell 0502 19 ADD HL,DE ;point to next 0503 10FC ^0501$ DJNZ :2 ;if not done 0505 3E01 LDK A,1 0507 3214EF STO A,SAVSEC ;set sector to 1st 050A C9 RET 050B RDRV: ;Reset requested disk drive 050B proc 050B 3E0A LDK A,10 050D 324305 :2: STO A,RTST ;update retries 0510 1E00 LDK E,0 0512 3AB902 LD A,DRV 0515 4F MOV C,A 0516 CD1BEA CALL BIOS+BSDSK ;issue SELDSK 0519 FEFF CMP -1 051B C0 RNZ ;if drive ready 051C 3A4305 LD A,RTST 051F FE0A CMP 10 0521 C23305 JNZ :3 ;if NOT first time 0524 11C904 LDK DE,DNRMS1 0527 CDAC06 CALL ESTR ;ask if drive ready 052A CDC806 CALL GCHR 052D FE59 CMP 'Y' 052F Ctor #1 0419 CD7804 CALL SETSEC 041C 3AAA04 LD A,TRAK 041F 0600 LK B,0 ! MOV C,A ;BC = trk# 0422 CD7D04 CALL SETTRK ;OUTPUT RETRY COUNT 0425 3AAB06 LD A,RETRY ;LOAD A WITH COUNT 0428 C630 ADD A,30H ;MAKE ASCI 042A 4F MOV C,A ;MOVE TO C 042B CDBB06 CALL CO ;OUTPUT NUMBER 042E 0E08 LDK C,08H ;BACK SPACE 0430 CDBB06 CALL CO 0433 060A LK B,MSEC ;read in MSEC sectors 0435 CD8204 CALL XFER ;read in 1 track @ RBUF 0438 B7 OR A 0439 200F ^044A$ JRNZ :serr ;if seek-type error 043B CD8B04 CALL COMPAR ;compare with expected SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 7 FORMAT PROGRAM FOR OCC - ONE. D:OCCFMT1 .ASM 043E 200E ^04P [hl] 048B COMPAR: ;compare data from disk with expected data ;Entry track image @ BUFFR ;Exit Z=TRUE => good compare 048B 01000A LK BC,MSEC*LSECB ;#bytes to compare 048E 21B076 LK HL,BUFFR ;FWA of data 0491 3EE5 LK A,FMTCHR ;format character 0493 EDA1 $ :loop: CPI# ;magic Zilog instruction 0495 C0 RNZ ;if bad compare 0496 EA9304 JPE :loop ;if not finished 0499 C9 :good: RET ;return with Z=True 049A FILLC: ;fill with character: ; C= chr to broadcast ; DE= #characters to broadcast ; HL= FWA to start broadcast 049A 7B MOV A,E 049B B2 OR D 049C C8 RZ ;if broadcast 0 bytes 049D 71 STO C,[hl] ;1st byte 049E 1B DEC DE 049F 7B MO8 RZ ;if drive ready confirmation 0530 C30000 JMP SYSR ;else exit 0533 11AC04 :3: LDK DE,DNRMS 0536 CDAC06 CALL ESTR ;indicate drive NOT ready 0539 3A4305 LD A,RTST 053C 3D DEC A 053D C20D05 JNZ :2 ;if not n tries 0540 C30001 JMP FMT ;start again SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 10 FORMAT PROGRAM FOR OCC - ONE. D:OCCFMT1 .ASM 0543 00 RTST: DB 0 SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 11 FORMAT PROGRAM FOR OCC - ONE. D:OCCFMT1 .ASM 0544 FORDAT: ;Format data for IBM 3740. ; **** Gap 5 **** ECHO 40 ! DB 0FFh ENDM ECHO 6 ! DB 0 ENDM 0572 F4E$ JRNZ :err 0440 :GOOD: 0440 3E05 LDK A,5 0442 32AB06 STO A,RETRY ;RESET RETRYS 0445 11A206 LK DE,VSTR ;if OK 0448 1817 ^0461$ JR :2 044A :serr: ;Seek type error- ck for time-out err & hang if so: 044A FEFE CMP SEKTMO ;ck for Seek Time Out error 044C 28B7 ^0405$ JRZ :hang ;if disk not in drive (?) 044E 3AAB06 :err: LD A,RETRY ;CHECK FOR RETRY 0451 D601 SUB 1 ;DECREMENT BY ONE 0453 32AB06 STO A,RETRY ;SAVE NEW COUNT 0456 C20504 JNZ :loop ;loop 0459 3E05 LDK A,5 ;RESET RETRYS TO FIVE 045B 32AB06 STO A,RETRY 045E 11A506 LK DE,ERSTR ;if NOT ok 0461 CDAC06 :2: CALL ESTR ;notify user 0464 21AA04 LK HL,TRAK 0467 34 INC [hl] ;step IN one track 0468 7E LD A,[hl] ;A=next track 0469 FE28 V A,E 04A0 B2 OR D 04A1 C8 RZ ;if broadcast 1 byte 04A2 42 MOV B,D ! MOV C,E ;BC := DE (count) 04A4 54 MOV D,H ! MOV E,L ;DE := HL (FWA) 04A6 13 INC DE ;DE := HL + 1 04A7 EDB0 $ LDIR ;overlapping move 04A9 C9 RET SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 9 FORMAT PROGRAM FOR OCC - ONE. D:OCCFMT1 .ASM 04AA = 0001 TRAK: DS 1 ;current TRACK 04AB 00 SECN: DB 0 04AC 1A1488D2E6 DNRMS: DBE cr,lf,'Disk drive ' 04B9 00 DRV1: DBE 0 04BA 7440D2E640 DBE ': is NOT ready' 04C8 5D DCE '.' 04C9 1A14404092 DNRMS1: DBE cr,lf,' Is a disk installed in drive ? ' 04EC 36D850F25E DBE ESC,'l','(y/n)',ESC,'m' 04F5 41 DCE ' ' 04F6 STRK: ;Set track numbers into data 04F6 proc 04F6 214840 LDK HL,RBUF+1+TRKOC DB 0FCh ;Index mark ; **** Gap 1 **** 0573 FMTSD: ECHO 16 ! DB 0FFh ENDM 0583 0000000000 DB 0,0,0,0,0,0 0589 FE DB 0FEh ;Id address mark 058A 00 FTRKN: DB 0 ;track = 0047 TRKOFS = *-FORDAT 058B 00 DB 0 ;side 058C 01 FSECN: DB 1 ;sector = 0000 IF LSECB = 128 - DB 0 ENDIF = FFFF IF LSECB = 256 058D 01 DB 1 ENDIF = 0000 IF LSECB > 256 - .9 DW LSECB, Error unknown sector length ENDIF 058E F7 DB 0F7h ;CRC ; **** Gap 2 **** ECHO 11 ! DB 0FFh ENDM ECHO 6 ! DB 0 ENDM = char 06BB E5 PUSH HL ! PUSH DE ! PUSH BC 06BE 59 MOV E,C 06BF SYSTEM WCO ;output to console 06C4 C1 POP BC ! POP DE ! POP HL 06C7 C9 RET 06C8 GCHR: ;Get character NORMALIZED from console ; Exit A=C= char 06C8 proc 06C8 E5 PUSH HL ! PUSH DE 06CA SYSTEM RCO 06CF 79 MOV A,C 06D0 FE61 CMP 'a' 06D2 DADC06 JC :4 ;if not lower case 06D5 FE7B CMP 'z'+1 06D7 D2DC06 JNC :4 ;if not lower case 06DA D620 SUI 'a'-'A' 06DC D1 :4: POP DE ! POP HL 06DE C9 RET 06DF = 003C DS 30*2 071B = 0000 STK: DS 0 071B = 4000 ORG RBUF ;FWA of format image 4000 = 36B0 DS MTRK*LIFMT ;length of format image 76B0 = 0000 BUFFR: DS 0 ;Verify data area  = EF14 ACTSEC = SAVSEC = EF15 ACTTRK = SAVTRK = EF17 ACTDSK = SDISK EF18 = 0001 SEKSEC DS 1 EF19 = 0002 SEKTRK DS 2 EF1B = 0001 SEKDSK DS 1 EF1C = 0001 HSTSEC DS 1 EF1D = 0002 HSTTRK DS 2 EF1F = 0001 HSTDSK DS 1 EF20 = 0001 TEMSEC DS 1 ;Used in bios only EF21 = 0001 RDFLAG DS 1 ;Read flag EF22 = 0001 ERFLAG DS 1 ;Error reporting EF23 = 0001 WRTYPE DS 1 ;Write operation type EF24 = 000C ALV: DS ALVS SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 16 BMRAM - Debug Monitor RAM Storage. D:OCCRAM1 .ASM EF30 = 0020 CSV: DS CSVS ; BIOS blocking-deblocking flags EF50 = 0001 HSTACT: DS 1 ;host active flag EF51 = 0001 HSTWRT: DS 1 ;Host writte 05A0 FB FDAM: DB 0FBh ;Data address mark = 00E5 :noref: = FMTCHR ;...this symbol won't create ;180 useless xrefs... ; **** Data **** ECHO 128 DB :noref ENDM = FFFF IF LSECB > 128 ECHO 128 DB :noref ENDM ENDIF 06A1 F7 FCRC2: DB 0F7h ;CRC = 06A2 FMTEND = * SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 12 FORMAT PROGRAM FOR OCC - ONE. D:OCCFMT1 .ASM = 015E LIFMT = *-FORDAT = 012F LISEC = *-FMTSD SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 13 FORMAT PROGRAM FOR OCC - ONE.  ; Endx OFORMAT SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 14 FORMAT PROGRAM FOR OCC - ONE. D:OCCFMT1 .ASM SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 15 BMRAM - Debug Monitor RAM Storage. D:OCCRAM1 .ASM ;MRAM - Debug Monitor RAM Storage. ; Used to assembly ROM resident and CBIOS 76B0 = ED80 ORG MRAM ; Host disk xfer buffer and... ; Format track template holding buffer ED80 HSTBUF: ED80 = 0180 DS 256+128 ; Directory Buffer = EE80 DIRBUF: = HSTBUF+256 EF00 = 0006 TEM DS 6 = EF0n flag EF52 = 0001 UNACNT: DS 1 ;Unalloc rec count EF53 = 0002 UNATRK: DS 2 ;Track EF55 = 0001 UNASEC: DS 1 ;Sector EF56 = 0001 LOGSEC: DS 1 ;Logical sector EF57 = 0002 LDADR DS 2 EF59 = 0001 KEYLCK DS 1 ;Zero if locked keyboard EF5A = 0002 CURS DS 2 ;current cursor position ; Keyboard scan temporaries EF5C = 0001 TKEY DS 1 ;Tem holding key EF5D = 0001 HKCNT DS 1 ;Debounce key EF5E = 0001 LKEY DS 1 ;Last valid keystroke EF5F = 0001 CKEY DS 1 ;Last control key EF60 = 0001 ESCH DS 1 ;ESC holding flag ;PIAAD and PIABD must be kept sequential, PIAAD first ;dependency in VC_HOME of BMKEY.asm EF61 = 0001 PIAAD: DS 1 ;Holds last PIA-A data EF62 = 0001 PIABD: DS 1 ;Holds last PIA-B data ; Calendar month D:OCCFMT1 .ASM 06A2 AD11 VSTR: DCE 'V','H'-40h ! DCE 'H'-40h ;used for GOOD verify 06A5 8B11 ERSTR: DCE 'E','H'-40h ! DCE 'H'-40h ;BAD verify ;LFSTR: DBE 'H'-40h ! DCE LF ;^H,LF 06A8 14 CR2LF DBE lf 06A9 1A CRLF: DBE cr ! DCE lf 06AB 00 RETRY DB 0 06AC ESTR: ;Output encoded data to console ; Entry DE= FWA of code ; Entry DE=FWA of source 06AC B7 OR A ;clear cbit 06AD 1A LD A,[de] 06AE 0F RRC ;normalize char 06AF F5 PUSH AF 06B0 E67F AND 07Fh 06B2 4F MOV C,A 06B3 CDBB06 CALL CO ;output it 06B6 13 INC DE 06B7 F1 POP AF 06B8 30F2 ^06AC$ JRNC ESTR ;if not done 06BA C9 RET 06BB CO: ;Output one char to screen ; Entry C1 RNDV = TEM+1 ;random number seed = EF02 ERCNT = RNDV+1 ;DW ERCNT = EF04 RTRC = ERCNT+2 ;retry count = EF05 RTRY = RTRC+1 EF06 = 0001 MPCHR DS 1 ;prompt character EF07 = 0001 ECHOP DS 1 ;=0, list ehco off EF08 = 0001 ROMRAM DS 1 ;0= RAM, 1= ROM EF09 = 0006 DSTSB DS 6 ;Disk status bytes ; Disk operation temps and control EF0F = 0002 DMADR DS 2 ;Address for read/write Disk EF11 = 0002 DMAADR DS 2 ;CBIOS, users DMA ; Note order of xxxSEC,xxxTRK,xxxDSK must be maintained ; along with length (1,2,1). EF13 = 0001 SEKDEL: DS 1 ;Set for seek-restore command in ROM ;depends on disk type. Siemens = 3h, MPI = 0h EF14 = 0001 SAVSEC DS 1 ;last sector requested EF15 = 0002 SAVTRK DS 2 ;last track requested EF17 = 0001 SDISK DS 1 ;Selected disk drive (0,1) , day year EF63 = 0003 IDAY DS 3 = EF64 IMONTH = IDAY+1 = EF65 IYR = IDAY+2 ; Wall clock time cells and disk active ; see UPTIM: in BMKEY.asm EF66 = 0006 HOURS: DS 6 = EF67 MINS: = HOURS+1 = EF68 SECS: = HOURS+2 = EF69 SEC6: = HOURS+3 ; Used to deselect drive when there is NO activity ; on drive for n seconds. See FDSK routine = EF6A DACTVE: = HOURS+4 ;=0 by FDSK, Used by UPTIM = EF6B BELCNT: = HOURS+5 ;^G bell timer cell EF6C = 0001 LLIMIT DS 1 ;max #columns in a logical line ; MSG 'LLIMIT = ',LLIMIT,'h.' ; Disk drive current positions EF6D = 0002 LDSEL: DS 2 ;Last selected drive = EF6E LDTRK = LDSEL+1 ;Last  location EFE6 = 0001 LSAVE: DS 1 ;L Register save location EFE7 = 0001 HSAVE: DS 1 ;H Register save location EFE8 = 0002 PSAVE: DS 2 ;PGM COUNTER save location EFEA = 0002 SSAVE: DS 2 ;USER STACK pointer save location EFEC = 0002 BKPA: DS 2 ;last breakpoint address EFEE = 0001 BKPC: DS 1 ;Contents of bkp ; Interrupt Jump Vector is between EFFO, EFFF. EFEF = 0001 VRTOFF DS 1 ;LAST VERTICAL OFFSET TAKEN FROM COUT SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 18 BMRAM - Debug Monitor RAM Storage. D:OCCRAM1 .ASM ; Endx MRAM no ERRORs, 354 Labels, 749Ch bytes not used. Program LWA = EFF0h.  s @FREQ 0FA0 s ABTC 0003 2/ 7 n ACIAD EFC1 17# 9 n ACTDSK EF17 15#42 n ACTSEC EF14 15#40 n AC n ERFLAG EF22 15#54 ERSTR 06A5 7/20 13# 3 n ESAVE EFE0 17#37 s ESC 001B 2/36 2/38 2/44 2/44 2/53 2/56 3/ 4 3/ 4 9/ 9 9/ 9 n ESCH EF60 16#21 ESTR 06AC 2/ 5 2/26 2/31 4/ 7 4/45 4/55 6/12 7/21 7/30 9/45 9/53 13# 9 13/21 s FALSE 0000 s FCB 005C n FCRC2 06A1 11#54 n FDAM 05A0 11#39 FILLC 049A 6/ 9 6/30 8#39 FMT 0100 2# 3 2/13 2/16 4/10 4/56 9/57 s FMTCHR 00E5 6/ 8 8/28 11/41 FMTDSK 02BA 2/21 4# 2 n FMTEND 06A2 11#57 FMTSD 0573 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 11#11 12/ 2 FORDAT 0544 4/17 10# 3 11/19 11/58 n FSAVE track used for non-selected drive EF6F = 0002 IESTK: DS 2 ;save current stk ptr ; Interrupt stack SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 17 BMRAM - Debug Monitor RAM Storage. D:OCCRAM1 .ASM EF71 = 0028 DS 20*2 EF99 = 0000 ISTK: DS 0 ; Stack entry EF99 = 0028 DS 20*2 EFC1 BIOSTK: EFC1 = 0000 ROMSTK: DS 0 EFC1 = 0001 ACIAD: DS 1 ;last command byte written to ACIA EFC2 = 0004 R179x: DS 4 ;179x register save area EFC6 = 0001 KBDLY: DS 1 ;keyboard debounce-delay cell ;since CP/M CANNOT boot off B:, this cell is used ;to invert the names of the 2 drives: ; =0, all normal, A=A:, B=B: TTRK EF15 15#41 n AFSAX EFD4 17#26 s ALIGN mac 17/23 17/36 n ALV EF24 15#57 s ALVS 000C 15/57 n ASAVE EFE5 17#42 n BCSAX EFD2 17#25 n BELCNT EF6B 16#44 s BFMTJP 0039 4/50 s BIOS EA00 4/50 9/38 BIOSLO 0001 1#33 8/15 n BIOSTK EFC1 17# 6 n BKPA EFEC 17#48 n BKPC EFEE 17#49 s BREAD 0027 8/12 s BROMJP 0036 8/16 n BSAVE EFE3 17#40 s BSDSK 001B 9/38 s BSTDMA 0024 8/ 3 s BSTSEC 0021 8/ 6 s BSTTRK 001E 8/ 9 BUFFR 76B0 6/ 7 6/28 6/32 8/27 13#54 s CDISK 0004 n CKEY EF5F 16#20 CO 06BB 5/ 4 6/48 6/50 13/18 13#24 COMPAR 048B 6/57 8#22 s CR 000D 2/34 2/39 2/40 2/40 2/43 2/48 2/51 2/57 3/ 2 3/ 3 4/ 9 9/ 3 9/ 8 13/ 6 CR EFE4 17#41 FSECN 058C 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 11#21 n FTRKN 058A 11#18 s FWAVM F000 GCHR 06C8 2/ 6 2/27 4/ 8 9/46 13#35 GOROM 0485 8/ 4 8/ 7 8/10 8#15 s H.IEEE 2900 s H.SIO 2A00 n HKCNT EF5D 16#18 n HLSAX EFD6 17#27 HOURS EF66 16#35 16/36 16/37 16/38 16/42 16/44 n HSAVE EFE7 17#44 n HSTACT EF50 16# 4 HSTBUF ED80 15#12 15/16 n HSTDSK EF1F 15#50 n HSTSEC EF1C 15#48 n HSTTRK EF1D 15#49 n HSTWRT EF51 16# 5 IDAY EF63 16#29 16/30 16/31 n IESTK EF6F 16#54 n IMONTH EF64 16#30 n ISTK EF99 17# 2 n IVSAX EFDC 17#31 n IXSAX EFD8 17#29 n IYR EF65 16#31 n IYSAX EFDA 17#30 SORCIM 808x Assembler ver 3.5E 5=/00/;1  ; =1, all inverted, A=B:, B=A: EFC7 = 0001 DSKSWP DS 1 ; Z80 Alternate Register Set EFC8 ALIGN 10h EFD0 RAGS: EFD0 = 0002 DESAX: DS 2 ;DE` EFD2 = 0002 BCSAX: DS 2 ;BC` EFD4 = 0002 AFSAX: DS 2 ;AF` EFD6 = 0002 HLSAX: DS 2 ;HL` EFD8 = 0002 IXSAX: DS 2 ;IX EFDA = 0002 IYSAX: DS 2 ;IY EFDC = 0002 IVSAX: DS 2 ;Interrupt page register ; 8080 Register Save Area. EFDE ALIGN 10h EFE0 REGS: EFE0 = 0001 ESAVE: DS 1 ;E Register save location EFE1 = 0001 DSAVE: DS 1 ;D Register save location EFE2 = 0001 CSAVE: DS 1 ;C Register save location EFE3 = 0001 BSAVE: DS 1 ;B Register save location EFE4 = 0001 FSAVE: DS 1 ;FLAGS save location EFE5 = 0001 ASAVE: DS 1 ;A Register save2LF 06A8 7/29 13# 5 CRLF 06A9 6/11 13# 6 n CSAVE EFE2 17#39 n CSV EF30 15#58 s CSVS 0020 15/58 CTRM 000D 1#28 2/54 2/54 2/54 2/54 2/54 2/55 2/55 2/55 2/55 2/55 n CURS EF5A 16#14 n DACTVE EF6A 16#42 n DESAX EFD0 17#24 n DIRBUF EE80 15#16 s DMA 0080 n DMAADR EF11 15#30 n DMADR EF0F 15#29 DNRMS 04AC 4/54 9# 3 9/52 SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 19 FORMAT PROGRAM FOR OCC - ONE. D:OCCRAM1 .ASM DNRMS1 04C9 9# 8 9/44 DRV 02B9 2/19 3# 9 9/36 DRV1 04B9 2/10 9# 4 n DSAVE EFE1 17#38 n DSKSWP EFC7 17#18 n DSTSB EF09 15#26 DTRKM 0148 2#34 4/44 n ECHOP EF07 15#24 ERCNT EF02 15#20 15/21 1<:03 Page 20 FORMAT PROGRAM FOR OCC - ONE. D:OCCRAM1 .ASM s K 0400 n KBDLY EFC6 17#12 n KEYLCK EF59 16#13 n LDADR EF57 16#12 LDSEL EF6D 16#51 16/52 n LDTRK EF6E 16#52 n LEVEL 3030 1#25 s LF 000A 2/35 2/35 2/39 2/40 2/41 2/43 2/43 2/48 2/52 2/52 2/52 2/57 2/57 3/ 2 3/ 3 9/ 3 9/ 8 13/ 5 13/ 7 LIFMT 015E 4/18 11#58 13/53 LISEC 012F 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 9/19 12# 2 n LKEY EF5E 16#19 n LLIMIT EF6C 16#47 n LOGSEC EF56 16# 9 n LSAVE EFE6 17#43 s LSECB 0100 6/ 6 6/27 8/26 11/22 11/25 11/28 11/48 s LVMEM 1000 n MINS EF67 16#36 n MPCHR EF06 15#23 s MRAM ED80 15/ 4 s MS056 n SSAVE EFEA 17#46 STK 071B 2/ 3 13#50 STRK 04F6 4/48 9#15 s SVER 0001 s SYS 0005 13/29 13/40 s SYSDAT 0010 s SYSL 0006 s SYSR 0000 2/ 8 2/29 9/49 s SYSTEM mac 13/29 13/40 TEM EF00 15#18 15/19 n TEMSEC EF20 15#52 n TKEY EF5C 16#17 TRAK 04AA 6/15 6/38 7/23 8#56 TRKOFS 0047 9/17 11#19 s TRUE FFFF n UNACNT EF52 16# 6 n UNASEC EF55 16# 8 n UNATRK EF53 16# 7 n VER 3031 1#24 VERIFY 03E4 2/22 5#13 s VLDL 0034 n VRTOFF EFEF 17#53 VSTR 06A2 7/ 6 13# 2 n WRTYPE EF23 15#55 XFER 0482 6/53 8#12 FF EFEF 17#53 VSTR 06A2 7/ 6 13# 2 n 6/33 8# 3 SETSEC 0478 6/36 8# 6 SETTRK 047D 6/41 8# 9 s SI.S16 0055 s SI.S64 0 TITLE 'BMRAM - Debug Monitor RAM Storage.' ;MRAM - Debug Monitor RAM Storage. ; Used to assembly ROM resident and CBIOS ORG MRAM ; Host disk xfer buffer and... ; Format track template holding buffer HSTBUF: DS 256+128 ; Directory Buffer DIRBUF: = HSTBUF+256 TEM DS 6 RNDV = TEM+1 ;random number seed ERCNT = RNDV+1 ;DW ERCNT RTRC = ERCNT+2 ;retry count RTRY = RTRC+1 MPCHR DS 1 ;prompt character ECHOP DS 1 ;=0, list ehco off ROMRAM DS 1 ;0= RAM, 1= ROM DSTSB DS 6 ;Disk status bytes ; Disk operation temps and control DMADR DS 2 ;Address for read/write Disk DMAADR DS 2 ;CBIOS, users DMA ; Note order of xxxSEC,xxxTRK,xxxDSK must be maintained ; along with length (1,2,1). SEKDEL: DS 1 ;Set for seek-restore command in ROM ;depends on disk type. Siemens = 3h, MPI = 0h SAVSEC DS 1 ;last sector requested SAVTRK DS 2 ;last track requested SDISK DS 1 ;Selected disk drive (0,1) ACTSEC = SAVSEC ACTTRK = SAVTRK ACTDSK = SDISK SEKSEC DS 1 SEKTRK DS 2 SEKDSK DS 1 EC 000A 4/23 6/ 6 6/27 6/52 8/26 9/18 s MSIZE 003C s MTRK 0028 5/ 8 7/26 13/53 s NVDL 0018 s ORGP 0100 1/36 s OS#RCO 0001 13/40 13/40 s OS#WCO 0002 13/29 13/29 n PIAAD EF61 16#25 n PIABD EF62 16#26 PNEXT 01E4 2/25 2#48 PRMT 0211 2/ 4 2#51 PRMT1 0296 2/30 3# 3 n PSAVE EFE8 17#45 n R179X EFC2 17#11 n RAGS EFD0 17#23 RBUF 4000 1#29 4/16 4/36 4/38 4/49 9/17 13/52 n RDFLAG EF21 15#53 RDRV 050B 2/23 2/24 4/40 4/41 5/10 5/11 6/17 6/18 9#31 RDYMS 01B6 2#43 4/ 6 n REGS EFE0 17#36 RETRY 06AB 6/23 6/45 7/ 5 7/13 7/15 7/18 13# 7 RNDV EF01 15#19 15/20 n ROMRAM EF08 15#25 n ROMSTK EFC1 17# 7 s RSIZE 0040 RTRC 1ͬ2A8( 22ͺ  ͬYͬ@@@@@@@@@@@@@@@6ب@@@@@6`@@@@@@@@@b@@@@@@@@@d@@@@@@@@@f`bdfhjlnpr`bdfhjlnpr`bdfhjlnpr`bdfhjlnpr@@@6ؤ6@@@@@]@@@@@@@P^R@~A6@@@@@@@@@6@@@@@@P@@R@@@P@DD@@@X@DD@@R@@@@@@@@@6R6P@@t@Aͬ !"@!D^>2!s/:<2w!s/:<2w!s/:<2w!s/:<2w!s/:<2w!s/:<2w!s/:<2w!s/:<2w!s/:<2w@B"@  Hͬ@9FͬEͻ:<2(   !v͚ͬ>2  >2 !v͚vsx:O}:0Oͻͻ ͂ ͋ >2(:2>2ͬ!4~( ì$ !'*.6 !v>{q{BKT]@@t@@@]@@@@@@@@~@6P^R6A!H@ /: HSTSEC DS 1 HSTTRK DS 2 HSTDSK DS 1 TEMSEC DS 1 ;Used in bios only RDFLAG DS 1 ;Read flag ERFLAG DS 1 ;Error reporting WRTYPE DS 1 ;Write operation type ALV: DS ALVS CSV: DS CSVS ; BIOS blocking-deblocking flags HSTACT: DS 1 ;host active flag HSTWRT: DS 1 ;Host written flag UNACNT: DS 1 ;Unalloc rec count UNATRK: DS 2 ;Track UNASEC: DS 1 ;Sector LOGSEC: DS 1 ;Logical sector LDADR DS 2 KEYLCK DS 1 ;Zero if locked keyboard CURS DS 2 ;current cursor position ; Keyboard scan temporaries TKEY DS 1 ;Tem holding key HKCNT DS 1 ;Debounce key LKEY DS 1 ;Last valid keystroke CKEY DS 1 ;Last control key ESCH DS 1 ;ESC holding flag ;PIAAD and PIABD must be kept sequential, PIAAD first ;dependency in VC_HOME of BMKEY.asm PIAAD: DS 1 ;Holds last PIA-A data PIABD: DS 1 ;Holds last PIA-B data ; Calendar month, day year IDAY DS 3 IMONTH = IDAY+1 IYR = IDAY+2 ; Wall clock time cells and disk active ; see UPTIM: in BMKEY.asm HOURS: DS 6 MINS: = HOURS+1 SECS: = HOURS+2 S EF04 15#21 15/22 n RTRY EF05 15#22 RTST 0543 9/34 9/41 9/54 10# 2 SAVSEC EF14 9/25 15#36 15/40 SAVTRK EF15 4/13 5/ 5 5/ 7 9/20 15#37 15/41 SDISK EF17 2/20 15#38 15/42 n SEC6 EF69 16#38 SECN 04AB 4/21 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 4/34 SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 21 FORMAT PROGRAM FOR OCC - ONE. D:OCCRAM1 .ASM 4/34 4/34 4/34 4/34 4/34 9# 2 n SECS EF68 16#37 n SEKDEL EF13 15#34 n SEKDSK EF1B 15#46 n SEKSEC EF18 15#44 s SEKTMO 00FE 7/10 n SEKTRK EF19 15#45 SETDMA 0473 6/33 8# 3 SETSEC 0478 6/36 8# 6 SETTRK 047D 6/41 8# 9 s SI.S16 0055 s SI.S64 0w>2> 2C:O:C 3ͬYͬ:C= Oͻ0Yya{ <2w!s/:<2w!s/:<2w!s/:<2w!s/:<2w!s/:<2w!s/:<2w!s/:<2w@B"@  Hͬ@9FͬEͻ:<2(   !v͚ͬ>2  >2 !v͚vsx:O}:0Oͻͻ ͂ ͋ >2(:2>2ͬ!4~( ì$ !'*.6 !v>{q{BKT]@@t@@@]@@@@@@@@~@6P^R6A!H@ /:EC6: = HOURS+3 ; Used to deselect drive when there is NO activity ; on drive for n seconds. See FDSK routine DACTVE: = HOURS+4 ;=0 by FDSK, Used by UPTIM BELCNT: = HOURS+5 ;^G bell timer cell LLIMIT DS 1 ;max #columns in a logical line ; MSG 'LLIMIT = ',LLIMIT,'h.' ; Disk drive current positions LDSEL: DS 2 ;Last selected drive LDTRK = LDSEL+1 ;Last track used for non-selected drive IESTK: DS 2 ;save current stk ptr ; Interrupt stack DS 20*2 ISTK: DS 0 ; Stack entry DS 20*2 BIOSTK: ROMSTK: DS 0 ACIAD: DS 1 ;last command byte written to ACIA R179x: DS 4 ;179x register save area KBDLY: DS 1 ;keyboard debounce-delay cell ;since CP/M CANNOT boot off B:, this cell is used ;to invert the names of the 2 drives: ; =0, all normal, A=A:, B=B: ; =1, all inverted, A=B:, B=A: DSKSWP DS 1 ; Z80 Alternate Register Set ALIGN 10h RAGS: DESAX: DS 2 ;DE` BCSAX: DS 2 ;BC` AFSAX: DS 2 ;AF` HLSAX: DS 2 ;HL` IXSAX: DS 2 ;IX IYSAX: DS 2 ;IY IVSAX: DS 2 ;Interrupt RACK FUNCTION SETSEC = 100h+33 ;ROMVEC+30 FOR SET SECTOR FUNCTION SETDMA = 100h+36 ;ROMVEC+33 FOR SET DMA ADDRESS READF = 100h+39 ;ROMVEC+36 FOR READ FUNCTION WRITF = 100h+42 ;ROMVEC+39 FOR WRITE FUNCTION ORG ORGP page JMP START DB 'Osborne One SYSGEN program.',cr,lf DB ' V e r s i o n 1.00',cr,lf DB 'COPYRIGHT (C) 1978, DIGITAL RESEARCH',cr,lf DB 1 ;left shift back for JMP inst DB 'Z'-40h page ; UTILITY SUBROUTINES GCHR: ;READ CONSOLE CHARACTER TO REGISTER A LDK C,CONI CALL SYS ;get char ; Normalize char to UPPER case CMP 'A' or 20h RC ;if below lower case CMP ('Z' or 20h)+1 RNC ;if above 'z' AND 5Fh RET OCHR: ;Output character to console ; Entry A= char MOV E,A LDK C,CONO JMP SYS CRLF: ;SEND CARRIAGE RETURN, LINE FEED LDK A,CR CALL OCHR LDK A,LF JMP OCHR OLSTR: ;Output string to console with leading CR,LF ; Entry HL-> Fwa of message proc PUSH HL CALL CRLF ;new line POP HL ; Output string OSTR: LD A,[hl] OR A ? CALL OLSTR CALL GCHR CMP ABTC JZ SYSR ;if request to quit SUI 'A' ;NORMALIZE DRIVE NUMBER CPI NDISKS JC GETC ;IF valid drive CALL BADSK ;indicate invalid drive JMP GETSYS ;try again GETC: ;SELECT DISK GIVEN BY REGISTER A ADI 'A' STO A,GDISK ;TO SET MESSAGE SUI 'A' CALL SEL ;TO SELECT THE DRIVE ; GETSYS, SET RW TO READ AND GET THE SYSTEM CALL CRLF LDK HL,GETMSG CALL OSTR CALL GCHR CPI CR JNZ RESYSR ;if request to quit CALL CRLF ;confirm XRA A STO A,RW ;set flag for READ CALL GETPUT ;Get system into memory LD A,LDBUF CMP 0C3h JZ :12 ;if 1st byte is JMP LDK HL,BSYSD CALL OSTR ;indicate ill-formed disk JMP SYSR ;exit via abort :12: LDK HL,RDONE CALL OSTR ;complete message to user PUTSYS: ;Now put the system on user requested disk LDK HL,ASKPUT CALL OLSTR CALL GCHR CPI CR JZ RESYSR SUI 'A' CPI NDISKS JC PUTC ;if valid drive ; INVALID DRIVE NAME CALL BADSK JMP PUTSYS ;TO TRY AGAIN PUTC: ;SET DISK FROpage register ; 8080 Register Save Area. ALIGN 10h REGS: ESAVE: DS 1 ;E Register save location DSAVE: DS 1 ;D Register save location CSAVE: DS 1 ;C Register save location BSAVE: DS 1 ;B Register save location FSAVE: DS 1 ;FLAGS save location ASAVE: DS 1 ;A Register save location LSAVE: DS 1 ;L Register save location HSAVE: DS 1 ;H Register save location PSAVE: DS 2 ;PGM COUNTER save location SSAVE: DS 2 ;USER STACK pointer save location BKPA: DS 2 ;last breakpoint address BKPC: DS 1 ;Contents of bkp ; Interrupt Jump Vector is between EFFO, EFFF. VRTOFF DS 1 ;LAST VERTICAL OFFSET TAKEN FROM COUT PAGE ; Endx MRAM 0, all normal, A=A:, B=B: ; =1, all inverted, A=B:, B=A: DSKSWP DS 1 ; Z80 Alternate Register Set ALIGN 10h RAGS: DESAX: DS 2 ;DE` BCSAX: DS 2 ;BC` AFSAX: DS 2 ;AF` HLSAX: DS 2 ;HL` IXSAX: DS 2 ;IX IYSAX: DS 2 ;IY IVSAX: DS 2 ;Interrupt  RZ ;if end PUSH HL CALL OCHR POP HL INC HL JMP OSTR SEL: ;SELECT DISK GIVEN BY REGISTER A STO A,SDISK ;set for rom MOV C,A LDK DE,SELDSK JMP ROMJMP TRK: ;SET UP TRACK LDK B,0 ;upper half always 0 LDK DE,SETTRK ;OFFSET FOR SETTRK ENTRY JMP ROMJMP SEC: ;SET UP SECTOR NUMBER LDK DE,SETSEC JMP ROMJMP SDMA: ;SET DMA ADDRESS TO VALUE OF B,C LDK DE,SETDMA JMP ROMJMP READ: ;PERFORM READ OPERATION LDK DE,READF LDK B,MSEC JMP ROMJMP WRITE: ;PERFORM WRITE OPERATON LDK DE,WRITF LDK B,MSEC JMP ROMJMP page GETPUT: ;Get or PUT cpm onto disk requested ; ENTRY RW= 0, if read ; RW= 1, if WRITE proc LDK HL,LDBUF ;where CP/M is left after movcpm STO HL,LDMA LDK A,-1 ;TRK=-1 STO A,TRACK :2: ;Main loop for reading or writing next Track LDK HL,TRACK INC [hl] ;TRACK = TRACK + 1 LD A,OST CMP [hl] JZ :14 ;if all OS tracks, then done ; Reset to next track to sector LD C,[hl] CALL TRK ;set next track LDK C,1 CALL SEC ;setM REGISTER C ADI 'A' STO A,PDISK ;MESSAGE SET SUI 'A' CALL SEL ;SELECT DEST DRIVE ; PUT SYSTEM, SET RW TO WRITE LDK HL,PUTMSG CALL OLSTR ;confirm prompt CALL GCHR CPI CR JNZ RESYSR ;if abort CALL CRLF LDK HL,RW MVI M,1 CALL GETPUT ;TO PUT SYSTEM BACK ON DISKETTE LDK HL,DONE CALL OSTR JMP PUTSYS ;FOR ANOTHER PUT OPERATION RESYSR: LDK A,0 CALL SEL CALL CRLF JMP SYSR BADSK: ;BAD DISK NAME LDK HL,QDISK CALL OSTR ;indicate invalid RET page ; Data and all message constants SIGNON: DB cr,lf,lf,' ' DB ESC,'l','SYSGEN',ESC,'m' DB ' Operating System Duplication Program.' DB cr,lf DB ESC,')',' OSBORNE COMPUTER SYSTEM ONE',ESC,'(' DB 0 ASKGET: DB ' ',ESC,'l','Source',ESC,'m' DB ' Drive (',ESC,'lA or B',ESC,'m', ') ', 0 GETMSG: DB ' ',ESC,'l','Source',ESC,'m' DB ' is on drive ' GDISK: DB ' ' ;drive name DB ', Then type ',ESC,'l','RETURN',ESC,'m',0 ASKPUT: DB ' ------------------------------------------------' DB cr,lf,';OCCSYSGA.ASM TITLE 'SYSGEN - SYSTEM GENERATION PROGRAM 8/79' * 4D2006-00 MASTER .ASM * 2D2006-00 ASSY .ASM * 1D2006-00 LISTING .PRN * 4D1006-00 MASTER .COM * 2D1006-00 ASSY .COM ; +---------------+ ; | | ; | SYSGEN | ; | | ; +---------------+ ;REV = A ;DATE = 251 ;DEB ;RELEASED VERS = 22 ;X.X ; COPYRIGHT (C) DIGITAL RESEARCH ; 1976, 1977, 1978, 1979, 1980, 1981 ; Modified for OSBORNE One machine by ; R.H. Frank ; 3-23-81 LINK OCCRAMA.ASM ; Assembly Constants and definitions. NTRKS = 3 ;No. of OS reserved tracks NDISKS = 2 ;Maximum supported disk drives ; WARNING: This buffer (LDBUF) must be above ROM space ; MINIMUM address is 4000h LDBUF = 4000h ;Disk xfer buffer CONI = 1 ;CONSOLE INPUT FUNCTION CONO = 2 ;CONSOLE OUTPUT FUNCTION SELF = 14 ;SELECT DISK MAXTRY = 10 ;MAXIMUM NUMBER OF RETRIES ON EACH READ/WRITE ROMJMP = 0EA36h ;64k machine vector address SELDSK = 100h+27 ;ROMVEC+24 FOR DISK SELECT SETTRK = 100h+30 ;ROMVEC+27 FOR SET T to 1st sector :4: ;Perform read or write LD HL,LDMA MOV B,H MOV C,L CALL SDMA ;Set new DMA XRA A STO A,RETRY ;clear retries :6: ;try read or write LD A,RETRY CPI MAXTRY JC :8 ;if NOT at limit of retries LDK HL,ERRMSG CALL OSTR ;indicate error CALL GCHR CMP CR JNZ RESYSR ;if wants to exit CALL CRLF ;confirm ok to process JMP :4 :8: ;check for read or write and execute INR A STO A,RETRY ;RETRY=RETRY+1 LD A,RW ;READ OR WRITE? ORA A JZ :9 ;if read CALL WRITE ;write next track OR A JNZ SYSR ;if error JMP :11 ;next :9: CALL READ ;read next track :10: ORA A JZ :11 ;if no error JMP :6 ; Update track dma and continue :11: LD HL,LDMA LDK DE,MSEC*LSECB ADD HL,DE STO HL,LDMA JMP :2 ;next :14: ;End of read of writing entire system tracks RET page START: proc LDK SP,STK ;set local stk LDK HL,SIGNON CALL OSTR ;initial sign on LDK A,3 STO A,OST ;number of system tracks GETSYS: LDK HL,ASKGET ;GET SYSTEM ' DB ESC,'l','DESTINATION',ESC,'m' DB ' (A,B or RETURN to exit) ',0 PUTMSG: DB ' ' DB ESC,'lDESTINATION',ESC,'m' DB ' is on drive ' PDISK: DS 1 ;FILLED IN AT PUT FUNCTION DB ', Then type ',ESC,'lRETURN',ESC,'m',0 ERRMSG: DB 'PERMANENT ERROR, TYPE RETURN TO IGNORE',0 RDONE: DB ' Read of SYSTEM is ',ESC,'lcomplete',ESC,'m.' DB cr,lf,lf,0 DONE: DB ' System has been copied successfully.',0 QDISK: DB ' ',ESC,')INVALID',ESC,'(',0 BSYSD: DB ' System Disk is ',ESC,'lunauthorized',ESC,'m, ABORT.' DB 0 space 4,10 ; Variables OST: DS 1 ;number of system tracks TRACK: DS 1 ;CURRENT TRACK SECTOR: DS 1 ;CURRENT SECTOR RW: DS 1 ;READ IF 0, WRITE IF 1 LDMA: DS 2 ;CURRENT DMA ADDRESS RETRY: DS 1 ;NUMBER OF TRIES ON THIS SECTOR DS 30*2 STK: DS 0 IF * > LDBUF .err MSG 'Error SYSGEN too large ', * ENDIF ; ENDx SYSGEN me DB ', Then type ',ESC,'l','RETURN',ESC,'m',0 ASKPUT: DB ' ------------------------------------------------' DB cr,lf,' ; COPYRIGHT (C) DIGITAL RESEARCH ; 1976, 1977, 1978, 1979, 1980, 1981 ; Modified for OSBORNE One machine by ; R.H. Frank ; 3-23-81 LINK OCCRAMA.ASM ; Assembly Constants and definitions. = 0003 NTRKS = 3 ;No. of OS reserved tracks = 0002 NDISKS = 2 ;Maximum supported disk drives ; WARNING: This buffer (LDBUF) must be above ROM space ; MINIMUM address is 4000h = 4000 LDBUF = 4000h ;Disk xfer buffer = 0001 CONI = 1 ;CONSOLE INPUT FUNCTION = 0002 CONO = 2 ;CONSOLE OUTPUT FUNCTION = 000E SELF = 14 ;SELECT DISK = 000A MAXTRY = 10 ;MAXIMUM NUMBER OF RETRIES ON EACH READ/WRITE = EA36 ROMJMP = 0EA36h ;64 LDK A,LF 017B C36E01 JMP OCHR 017E OLSTR: ;Output string to console with leading CR,LF ; Entry HL-> Fwa of message 017E proc 017E E5 PUSH HL 017F CD7401 CALL CRLF ;new line 0182 E1 POP HL ; Output string 0183 7E OSTR: LD A,[hl] 0184 B7 OR A 0185 C8 RZ ;if end 0186 E5 PUSH HL 0187 CD6E01 CALL OCHR 018A E1 POP HL 018B 23 INC HL 018C C38301 JMP OSTR 018F SEL: ;SELECT DISK GIVEN BY REGISTER A 018F 3217EF STO A,SDISK ;set for rom 0192 4F MOV C,A 0193 111B01 LDK DE,SELDSK 0196 C336EA JMP ROMJMP 0199 TRK: ;SET UP TRACK 0199 0600 LDK B,0 ;upper half always 0 019B 111E01 LDK DE,SETk machine vector address = 011B SELDSK = 100h+27 ;ROMVEC+24 FOR DISK SELECT = 011E SETTRK = 100h+30 ;ROMVEC+27 FOR SET TRACK FUNCTION = 0121 SETSEC = 100h+33 ;ROMVEC+30 FOR SET SECTOR FUNCTION = 0124 SETDMA = 100h+36 ;ROMVEC+33 FOR SET DMA ADDRESS = 0127 READF = 100h+39 ;ROMVEC+36 FOR READ FUNCTION = 012A WRITF = 100h+42 ;ROMVEC+39 FOR WRITE FUNCTION 0000 = 0100 ORG ORGP SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 2 SYSGEN - SYSTEM GENERATION PROGRAM 8/79 D:OCCSYSGA.ASM 0100 C33102 JMP START 0103 4F73626F72 DB 'Osborne One SYSGEN program.',cr,lf 0120 2020205620 DB ' V e r s i o n 1.00',cr,lf 0138 434F505952 DB 'COPYRIGHT (C) 1978, DIGITAL RESEARCH',cr,lf 015E 01 DB 1 ;left shift back for JMP inst 015F 1A DB 'Z'-40h SORCIM 808x TRK ;OFFSET FOR SETTRK ENTRY 019E C336EA JMP ROMJMP 01A1 SEC: ;SET UP SECTOR NUMBER SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 4 SYSGEN - SYSTEM GENERATION PROGRAM 8/79 D:OCCSYSGA.ASM 01A1 112101 LDK DE,SETSEC 01A4 C336EA JMP ROMJMP 01A7 SDMA: ;SET DMA ADDRESS TO VALUE OF B,C 01A7 112401 LDK DE,SETDMA 01AA C336EA JMP ROMJMP 01AD READ: ;PERFORM READ OPERATION 01AD 112701 LDK DE,READF 01B0 060A LDK B,MSEC 01B2 C336EA JMP ROMJMP 01B5 WRITE: ;PERFORM WRITE OPERATON 01B5 112A01 LDK DE,WRITF 01B8 060A LDK B,MSEC 01BA C336EA JMP ROMJMP SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 5 SYSGEN - SYSTEM GENERATION PROGRAM 8/79 D:OCCSYSG SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 1 SYSGEN - SYSTEM GENERATION PROGRAM 8/79 D:OCCRAMA .ASM *ABS 0000 EFEF *CODE EFEF 0000 *DATA EFEF 0000 ;OCCSYSGA.ASM * 4D2006-00 MASTER .ASM * 2D2006-00 ASSY .ASM * 1D2006-00 LISTING .PRN * 4D1006-00 MASTER .COM * 2D1006-00 ASSY .COM ; +---------------+ ; | | ; | SYSGEN | ; | | ; +---------------+ ;REV = A ;DATE = 251 ;DEB ;RELEASED = 0016 VERS = 22 ;X.X Assembler ver 3.5E 5=/00/;1 1<:03 Page 3 SYSGEN - SYSTEM GENERATION PROGRAM 8/79 D:OCCSYSGA.ASM ; UTILITY SUBROUTINES 0160 GCHR: ;READ CONSOLE CHARACTER TO REGISTER A 0160 0E01 LDK C,CONI 0162 CD0500 CALL SYS ;get char ; Normalize char to UPPER case 0165 FE61 CMP 'A' or 20h 0167 D8 RC ;if below lower case 0168 FE7B CMP ('Z' or 20h)+1 016A D0 RNC ;if above 'z' 016B E65F AND 5Fh 016D C9 RET 016E OCHR: ;Output character to console ; Entry A= char 016E 5F MOV E,A 016F 0E02 LDK C,CONO 0171 C30500 JMP SYS 0174 CRLF: ;SEND CARRIAGE RETURN, LINE FEED 0174 3E0D LDK A,CR 0176 CD6E01 CALL OCHR 0179 3E0A A.ASM 01BD GETPUT: ;Get or PUT cpm onto disk requested ; ENTRY RW= 0, if read ; RW= 1, if WRITE 01BD proc 01BD 210040 LDK HL,LDBUF ;where CP/M is left after movcpm 01C0 22EA04 STO HL,LDMA 01C3 3EFF LDK A,-1 ;TRK=-1 01C5 32E704 STO A,TRACK 01C8 :2: ;Main loop for reading or writing next Track 01C8 21E704 LDK HL,TRACK 01CB 34 INC [hl] ;TRACK = TRACK + 1 01CC 3AE604 LD A,OST 01CF BE CMP [hl] 01D0 CA3002 JZ :14 ;if all OS tracks, then done ; Reset to next track to sector 01D3 4E LD C,[hl] 01D4 CD9901 CALL TRK ;set next track 01D7 0E01 LDK C,1 01D9 CDA101 CALL SEC ;set to 1st sector 01DC :4: ;Perform read or write 01DC 2AEA04 LD HL,LDMA GA.ASM 0231 START: proc 0231 312905 LDK SP,STK ;set local stk 0234 21EF02 LDK HL,SIGNON 0237 CD8301 CALL OSTR ;initial sign on 023A 3E03 LDK A,3 023C 32E604 STO A,OST ;number of system tracks 023F 214E03 GETSYS: LDK HL,ASKGET ;GET SYSTEM? 0242 CD7E01 CALL OLSTR 0245 CD6001 CALL GCHR 0248 FE03 CMP ABTC 024A CA0000 JZ SYSR ;if request to quit 024D D641 SUI 'A' ;NORMALIZE DRIVE NUMBER 024F FE02 CPI NDISKS 0251 DA5A02 JC GETC ;IF valid drive 0254 CDE802 CALL BADSK ;indicate invalid drive 0257 C33F02 JMP GETSYS ;try again 025A GETC: ;SELECT DISK GIVEN BY REGISTER A 025A C641 ADI 'A' 025C 328703 STO A,GDISK ;TO SET MESSAGE 025F D641 SUI 'A' 0261 CD8F01 CALL SEL ;TO SELECT THE DRIVE ; GETSYS, SET RW TO READ AND 02CF 3601 MVI M,1 02D1 CDBD01 CALL GETPUT ;TO PUT SYSTEM BACK ON DISKETTE 02D4 218404 LDK HL,DONE 02D7 CD8301 CALL OSTR 02DA C39602 JMP PUTSYS ;FOR ANOTHER PUT OPERATION 02DD 3E00 RESYSR: LDK A,0 02DF CD8F01 CALL SEL 02E2 CD7401 CALL CRLF 02E5 C30000 JMP SYSR 02E8 BADSK: ;BAD DISK NAME 02E8 21AE04 LDK HL,QDISK 02EB CD8301 CALL OSTR ;indicate invalid 02EE C9 RET SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 9 SYSGEN - SYSTEM GENERATION PROGRAM 8/79 D:OCCSYSGA.ASM ; Data and all message constants 02EF 0D0A0A20 SIGNON: DB cr,lf,lf,' ' 02F3 1B6C535953 DB ESC,'l','SYSGEN',ESC,'m' 02FD 204F706572 DB ' Operating System Duplication Program.' 0323 0D0A DB cr,lf 0325 1B29202020 DB ESC,')',' OSBORNE COMPUTE01DF 44 MOV B,H 01E0 4D MOV C,L 01E1 CDA701 CALL SDMA ;Set new DMA 01E4 AF XRA A 01E5 32EC04 STO A,RETRY ;clear retries 01E8 :6: ;try read or write 01E8 3AEC04 LD A,RETRY 01EB FE0A CPI MAXTRY 01ED DA0402 JC :8 ;if NOT at limit of retries 01F0 213304 LDK HL,ERRMSG 01F3 CD8301 CALL OSTR ;indicate error 01F6 CD6001 CALL GCHR 01F9 FE0D CMP CR 01FB C2DD02 JNZ RESYSR ;if wants to exit 01FE CD7401 CALL CRLF ;confirm ok to process 0201 C3DC01 JMP :4 0204 :8: ;check for read or write and execute 0204 3C INR A 0205 32EC04 STO A,RETRY ;RETRY=RETRY+1 0208 3AE904 LD A,RW ;READ OR WRITE? 020B B7 ORA A 020C CA1902 JZ :9 ;if read 020F CDB501 CALL WRI GET THE SYSTEM 0264 CD7401 CALL CRLF 0267 216F03 LDK HL,GETMSG 026A CD8301 CALL OSTR 026D CD6001 CALL GCHR 0270 FE0D CPI CR 0272 C2DD02 JNZ RESYSR ;if request to quit 0275 CD7401 CALL CRLF ;confirm 0278 AF XRA A 0279 32E904 STO A,RW ;set flag for READ 027C CDBD01 CALL GETPUT ;Get system into memory 027F 3A0040 LD A,LDBUF 0282 FEC3 CMP 0C3h 0284 CA9002 JZ :12 ;if 1st byte is JMP 0287 21BD04 LDK HL,BSYSD 028A CD8301 CALL OSTR ;indicate ill-formed disk 028D C30000 JMP SYSR ;exit via abort 0290 215A04 :12: LDK HL,RDONE 0293 CD8301 CALL OSTR ;complete message to user 0296 PUTSYS: ;Now put the system on user requested disk 0296 219F03 LDK HL,ASKPUT 0299 CD7E01 CALL OLSTR 029C CD6001 CALL GCHR 029F FE0D CPI CR 02A1 CADDR SYSTEM ONE',ESC,'(' 034D 00 DB 0 034E 201B6C536F ASKGET: DB ' ',ESC,'l','Source',ESC,'m' 0359 2044726976 DB ' Drive (',ESC,'lA or B',ESC,'m', ') ', 0 036F 201B6C536F GETMSG: DB ' ',ESC,'l','Source',ESC,'m' 037A 206973206F DB ' is on drive ' 0387 20 GDISK: DB ' ' ;drive name 0388 2C20546865 DB ', Then type ',ESC,'l','RETURN',ESC,'m',0 039F 202D2D2D2D ASKPUT: DB ' ------------------------------------------------' 03D0 0D0A20 DB cr,lf,' ' 03D3 1B6C444553 DB ESC,'l','DESTINATION',ESC,'m' 03E2 2028412C42 DB ' (A,B or RETURN to exit) ',0 03FE 20 PUTMSG: DB ' ' 03FF 1B6C444553 DB ESC,'lDESTINATION',ESC,'m' 040E 206973206F DB ' is on drive ' 041B = 0001 PDISK: DS 1 ;FILLED IN AT PUT FUNCTION 041C 2C20546865 DB ', Then type ',ESC,'lRETURN',ESC,'m',0 0433 5045524D41 ERRMSG: DB 'PETE ;write next track 0212 B7 OR A 0213 C20000 JNZ SYSR ;if error 0216 C32302 JMP :11 ;next SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 6 SYSGEN - SYSTEM GENERATION PROGRAM 8/79 D:OCCSYSGA.ASM 0219 CDAD01 :9: CALL READ ;read next track 021C B7 :10: ORA A 021D CA2302 JZ :11 ;if no error 0220 C3E801 JMP :6 ; Update track dma and continue 0223 2AEA04 :11: LD HL,LDMA 0226 11000A LDK DE,MSEC*LSECB 0229 19 ADD HL,DE 022A 22EA04 STO HL,LDMA 022D C3C801 JMP :2 ;next 0230 :14: ;End of read of writing entire system tracks 0230 C9 RET SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 7 SYSGEN - SYSTEM GENERATION PROGRAM 8/79 D:OCCSYS02 JZ RESYSR 02A4 D641 SUI 'A' 02A6 FE02 CPI NDISKS 02A8 DAB102 JC PUTC ;if valid drive ; INVALID DRIVE NAME 02AB CDE802 CALL BADSK 02AE C39602 JMP PUTSYS ;TO TRY AGAIN SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 8 SYSGEN - SYSTEM GENERATION PROGRAM 8/79 D:OCCSYSGA.ASM 02B1 PUTC: ;SET DISK FROM REGISTER C 02B1 C641 ADI 'A' 02B3 321B04 STO A,PDISK ;MESSAGE SET 02B6 D641 SUI 'A' 02B8 CD8F01 CALL SEL ;SELECT DEST DRIVE ; PUT SYSTEM, SET RW TO WRITE 02BB 21FE03 LDK HL,PUTMSG 02BE CD7E01 CALL OLSTR ;confirm prompt 02C1 CD6001 CALL GCHR 02C4 FE0D CPI CR 02C6 C2DD02 JNZ RESYSR ;if abort 02C9 CD7401 CALL CRLF 02CC 21E904 LDK HL,RW RMANENT ERROR, TYPE RETURN TO IGNORE',0 045A 2020202020 RDONE: DB ' Read of SYSTEM is ',ESC,'lcomplete',ESC,'m.' 0480 0D0A0A00 DB cr,lf,lf,0 0484 2020202020 DONE: DB ' System has been copied successfully.',0 04AE 2020201B29 QDISK: DB ' ',ESC,')INVALID',ESC,'(',0 04BD 2053797374 BSYSD: DB ' System Disk is ',ESC,'lunauthorized',ESC,'m, ABORT.' 04E5 00 DB 0 ; Variables 04E6 = 0001 OST: DS 1 ;number of system tracks 04E7 = 0001 TRACK: DS 1 ;CURRENT TRACK 04E8 = 0001 SECTOR: DS 1 ;CURRENT SECTOR 04E9 = 0001 RW: DS 1 ;READ IF 0, WRITE IF 1 04EA = 0002 LDMA: DS 2 ;CURRENT DMA ADDRESS 04EC = 0001 RETRY: DS 1 ;NUMBER OF TRIES ON THIS SECTOR 04ED = 003C DS 30*2 0529 = 0000 STK: DS 0 = 0000 IF * > LDBUF - MULTI SECTOR BYTES FOR R/W **********not used************* EF09 = 0006 DSTSB DS 6 ;Disk status bytes ; Disk operation temps and control EF0F = 0002 DMADR DS 2 ;Address for read/write Disk EF11 = 0002 DMAADR DS 2 ;CBIOS, users DMA ; Note order of xxxSEC,xxxTRK,xxxDSK must be maintained ; along with length (1,2,1). EF13 = 0001 SEKDEL: DS 1 ;Set for seek-restore command in ROM ;depends on disk type. Siemens = 3h, MPI = 0h EF14 = 0001 SAVSEC DS 1 ;last sector requested EF15 = 0002 SAVTRK DS 2 ;last track requested EF17 = 0001 SDISK DS 1 ;Selected disk drive (0,1) SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 12 BMRAM - Debug Monitor RAM Storage. D:OCCRAMA .ASM = EF14 ACTSEC = SAVSEC = EF15 sm EF66 = 0006 HOURS: DS 6 = EF67 MINS: = HOURS+1 = EF68 SECS: = HOURS+2 = EF69 SEC6: = HOURS+3 SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 13 BMRAM - Debug Monitor RAM Storage. D:OCCRAMA .ASM ; Used to deselect drive when there is NO activity ; on drive for n seconds. See FDSK routine = EF6A DACTVE: = HOURS+4 ;=0 by FDSK, Used by UPTIM = EF6B BELCNT: = HOURS+5 ;^G bell timer cell EF6C = 0001 LLIMIT DS 1 ;max #columns in a logical line ; MSG 'LLIMIT = ',LLIMIT,'h.' ; Disk drive current positions EF6D = 0002 LDSEL: DS 2 ;Last selected drive = EF6E LDTRK = LDSEL+1 ;Last track used for non-selected drive EF6F = 0002  .err MSG 'Error SYSGEN too large ', * ENDIF SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 10 SYSGEN - SYSTEM GENERATION PROGRAM 8/79 D:OCCSYSGA.ASM ; ENDx SYSGEN SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 11 BMRAM - Debug Monitor RAM Storage. D:OCCRAMA .ASM ;MRAM - Debug Monitor RAM Storage. ; Used to assembly ROM resident and CBIOS 0529 = ED80 ORG MRAM ; Host disk xfer buffer and... ; Format track template holding buffer ED80 HSTBUF: = 0000 IF DEF FMTDAT - RMTDAT DS 0 - DS (FMTSD-FMTDAT) - RFMTSD DS 0  ACTTRK = SAVTRK = EF17 ACTDSK = SDISK EF18 = 0001 SEKSEC DS 1 EF19 = 0002 SEKTRK DS 2 EF1B = 0001 SEKDSK DS 1 EF1C = 0001 HSTSEC DS 1 EF1D = 0002 HSTTRK DS 2 EF1F = 0001 HSTDSK DS 1 EF20 = 0001 TEMSEC DS 1 ;Used in bios only EF21 = 0001 RDFLAG DS 1 ;Read flag EF22 = 0001 ERFLAG DS 1 ;Error reporting EF23 = 0001 WRTYPE DS 1 ;Write operation type EF24 = 000C ALV: DS ALVS EF30 = 0020 CSV: DS CSVS ; BIOS blocking-deblocking flags EF50 = 0001 HSTACT: DS 1 ;host active flag EF51 = 0001 HSTWRT: DS 1 ;Host written flag EF52 = 0001 UNACNT: DS 1 ;Unalloc rec count EF53 = 0002 UNATRK: DS 2 ;Track EF55 = 0001 UNASEC: DS 1 ;Sector EF56 = 0001 LOGSEC: DS 1 ;Logical sector  IESTK: DS 2 ;save current stk ptr ; Interrupt stack EF71 = 0028 DS 20*2 EF99 = 0000 ISTK: DS 0 ; Stack entry EF99 = 0028 DS 20*2 EFC1 BIOSTK: EFC1 = 0000 ROMSTK: DS 0 EFC1 = 0001 ACIAD: DS 1 ;last command byte written to ACIA EFC2 = 0004 R179x: DS 4 ;179x register save area EFC6 = 0001 KBDLY: DS 1 ;keyboard debounce-delay cell ;since CP/M CANNOT boot off B:, this cell is used ;to invert the names of the 2 drives: ; =0, all normal, A=A:, B=B: ; =1, all inverted, A=B:, B=A: EFC7 = 0001 DSKSWP DS 1 ; Z80 Alternate Register Set EFC8 ALIGN 10h EFD0 RAGS: EFD0 = 0002  - DS (FTRKN-FMTSD) - RFTRKN DS 0 - DS (FSECN-FTRKN) - RFSECN DS 0 - DS (FDAM-FSECN) - RDAM DS 0 - DS LSECB+1 - RCRC2 DS 0 - DS FMTEND-FCRC2 - DS (256+128)-(*-HSTBUF) ELSE ED80 = 0180 DS 256+128 ENDIF ; Directory Buffer = EE80 DIRBUF: = HSTBUF+256 EF00 = 0006 TEM DS 6 = EF01 RNDV = TEM+1 ;random number seed = EF02 ERCNT = RNDV+1 ;DW ERCNT = EF04 RTRC = ERCNT+2 ;retry count = EF05 RTRY = RTRC+1 EF06 = 0001 MPCHR DS 1 ;prompt character EF07 = 0001 ECHOP DS 1 ;=0, list ehco off EF08 = 0001 ROMRAM DS 1 ;0= RAM, 1= ROM *********REDEFINED************* EF09 = 0000 MSECB DS 0 ;EF57 = 0002 LDADR DS 2 EF59 = 0001 KEYLCK DS 1 ;Zero if locked keyboard EF5A = 0002 CURS DS 2 ;current cursor position ; Keyboard scan temporaries EF5C = 0001 TKEY DS 1 ;Tem holding key EF5D = 0001 HKCNT DS 1 ;Debounce key EF5E = 0001 LKEY DS 1 ;Last valid keystroke EF5F = 0001 CKEY DS 1 ;Last control key EF60 = 0001 ESCH DS 1 ;ESC holding flag ;PIAAD and PIABD must be kept sequential, PIAAD first ;dependency in VC_HOME of BMKEY.asm EF61 = 0001 PIAAD: DS 1 ;Holds last PIA-A data EF62 = 0001 PIABD: DS 1 ;Holds last PIA-B data ; Calendar month, day year EF63 = 0003 IDAY DS 3 = EF64 IMONTH = IDAY+1 = EF65 IYR = IDAY+2 ; Wall clock time cells and disk active ; see UPTIM: in BMKEY.a DESAX: DS 2 ;DE` EFD2 = 0002 BCSAX: DS 2 ;BC` EFD4 = 0002 AFSAX: DS 2 ;AF` EFD6 = 0002 HLSAX: DS 2 ;HL` EFD8 = 0002 IXSAX: DS 2 ;IX EFDA = 0002 IYSAX: DS 2 ;IY EFDC = 0002 IVSAX: DS 2 ;Interrupt page register ; 8080 Register Save Area. EFDE ALIGN 10h EFE0 REGS: EFE0 = 0001 ESAVE: DS 1 ;E Register save location EFE1 = 0001 DSAVE: DS 1 ;D Register save location SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 14 BMRAM - Debug Monitor RAM Storage. D:OCCRAMA .ASM EFE2 = 0001 CSAVE: DS 1 ;C Register save location EFE3 = 0001 BSAVE: DS 1 ;B Register save location EFE4 = 0001 FSAVE: DS 1 ;FLAGS save location EFE5 = 0001 ASAVE: DS 1 ;A Register save location EFE6 = 0001 LSAVE: DS 1 ;L Register save location E01 1#40 3/ 5 CONO 0002 1#41 3/19 s CR 000D 2/ 2 2/ 3 2/ 4 3/23 5/40 7/29 7/49 8/12 9/ 2 9/ 5 9/18 9/31 CRLF 0174 3#22 3/32 5/43 7/25 7/31 8/14 8/25 n CSAVE EFE2 13#58 n CSV EF30 12#20 s CSVS 0020 12/20 n CURS EF5A 12#33 n DACTVE EF6A 13# 4 n DESAX EFD0 13#43 n DIRBUF EE80 11#32 s DMA 0080 n DMAADR EF11 11#49 n DMADR EF0F 11#48 DONE 0484 8/19 9#32 n DSAVE EFE1 13#57 n DSKSWP EFC7 13#37 n DSTSB EF09 11#45 n ECHOP EF07 11#40 ERCNT EF02 11#36 11/37 n ERFLAG EF22 12#16 ERRMSG 0433 5/37 9#28 n ESAVE EFE0 13#56 SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 16 SYSGEN - SYSTEM GENERATION PROGRAM 8/79 D:OCCRAMA . n MINS EF67 12#55 n MPCHR EF06 11#39 SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 17 SYSGEN - SYSTEM GENERATION PROGRAM 8/79 D:OCCRAMA .ASM s MRAM ED80 11/ 4 s MSEC 000A 4/10 4/15 6/ 9 n MSECB EF09 11#43 s MSIZE 003C NDISKS 0002 1#35 7/13 7/52 n NTRKS 0003 1#34 s NVDL 0018 OCHR 016E 3#16 3/24 3/26 3/40 OLSTR 017E 3#28 7/ 8 7/47 8/10 s ORGP 0100 1/55 OST 04E6 5/14 7/ 6 9#43 OSTR 0183 3#36 3/43 5/38 7/ 4 7/27 7/39 7/43 8/20 8/30 PDISK 041B 8/ 4 9#25 n PIAAD EF61 12#44 n PIABD EF62 12#45 n PSAVE EFE8 14# 7 PUTC 02B1 7/53 8# 2 PUTMSG 03FE 8/ 9 9#22 PUTSYS 0296 7#45 7/57 8/21 QDISK 04AE FE7 = 0001 HSAVE: DS 1 ;H Register save location EFE8 = 0002 PSAVE: DS 2 ;PGM COUNTER save location EFEA = 0002 SSAVE: DS 2 ;USER STACK pointer save location = 0000 IF (high *) <> (high ROMSTK) - .9 DW *, STK, must be equal ENDIF ;TEMP: DS 1 ;TEMPORARY MONITOR CELL EFEC = 0002 BKPA: DS 2 ;last breakpoint address EFEE = 0001 BKPC: DS 1 ;Contents of bkp = 0000 IF * >= LWAMEM - MSG 'RAM temporary area too large ',* - .9 ERROR ENDIF = 0000 IF * > INTBL - .9 ERROR - MSG 'RAM overflow into Int Vector ', * ENDIF ; Interrupt Jump Vector is between EFFO, EFFF. SORCIM 808x AssASM s ESC 001B 9/ 3 9/ 3 9/ 6 9/ 6 9/ 9 9/ 9 9/10 9/10 9/12 9/12 9/15 9/15 9/19 9/19 9/23 9/23 9/26 9/26 9/30 9/30 9/34 9/34 9/36 9/36 n ESCH EF60 12#40 s FALSE 0000 s FCB 005C U FMTDAT ED80 11/13 n FSAVE EFE4 14# 3 s FWAVM F000 GCHR 0160 3# 4 5/39 7/ 9 7/28 7/48 8/11 GDISK 0387 7/20 9#14 GETC 025A 7/14 7#18 GETMSG 036F 7/26 9#12 GETPUT 01BD 4#17 7/34 8/18 GETSYS 023F 7# 7 7/16 s H.IEEE 2900 s H.SIO 2A00 n HKCNT EF5D 12#37 n HLSAX EFD6 13#46 HOURS EF66 12#54 12/55 12/56 12/57 13/ 4 13/ 6 n HSAVE EFE7 14# 6 n HSTACT EF50 12#23 HSTBUF ED80 11#12 11/32 n HSTDSK EF1F 12#12 n HSTSE 8/29 9#34 n R179X EFC2 13#30 n RAGS EFD0 13#42 n RDFLAG EF21 12#15 RDONE 045A 7/42 9#30 READ 01AD 4# 8 5/58 READF 0127 1#51 4/ 9 n REGS EFE0 13#55 RESYSR 02DD 5/41 7/30 7/50 8/13 8#23 RETRY 04EC 5/30 5/33 5/48 9#48 RNDV EF01 11#35 11/36 ROMJMP EA36 1#46 3/50 3/55 4/ 2 4/ 6 4/11 4/16 n ROMRAM EF08 11#41 ROMSTK EFC1 13#26 14/10 s RSIZE 0040 RTRC EF04 11#37 11/38 n RTRY EF05 11#38 RW 04E9 5/49 7/33 8/16 9#46 SAVSEC EF14 11#55 12/ 2 SAVTRK EF15 11#56 12/ 3 SDISK EF17 3/47 11#57 12/ 4 SDMA 01A7 4# 4 5/28 SEC 01A1 3#57 5/22 n SEC6 EF69 12#57 n SECS EF68 12#56 n SECTOR 04E8 9#45 n SEKDEL EF13 11#53 n SEKDSembler ver 3.5E 5=/00/;1 1<:03 Page 15 BMRAM - Debug Monitor RAM Storage. D:OCCRAMA .ASM ; Endx MRAM no ERRORs, 349 Labels, 7638h bytes not used. Program LWA = EFEFh.  s @FREQ 0FA0 s ABTC 0003 7/10 n ACIAD EFC1 13#28 n ACTDSK EF17 12# 4 n ACTSEC EF14 12# 2 n ACTTRK EF15 12# 3 n AFSAX EFD4 13#45 s ALIGN mac 13/42 13/55 n ALV EF24 12#19 s ALVS 000C 12/19 n ASAVE EFE5 14# 4 ASKGET 034E 7/ 7 9# 9 ASKPUT 039F 7/46 9#17 BADSK 02E8 7/15 7/56 8#28 n BCSAX EFD2 13#44 n BELCNT EF6B 13# 6 s BIOS EA00 n BIOSTK EFC1 13#25 n BKPA EFEC 14#15 n BKPC EFEE 14#16 n BSAVE EFE3 14# 2 BSYSD 04BD 7/38 9#36 s CDISK 0004 n CKEY EF5F 12#39 CONI 00C EF1C 12#10 n HSTTRK EF1D 12#11 n HSTWRT EF51 12#24 IDAY EF63 12#48 12/49 12/50 n IESTK EF6F 13#16 n IMONTH EF64 12#49 s INTBL EFF0 14/23 n ISTK EF99 13#21 n IVSAX EFDC 13#50 n IXSAX EFD8 13#48 n IYR EF65 12#50 n IYSAX EFDA 13#49 s K 0400 n KBDLY EFC6 13#31 n KEYLCK EF59 12#32 n LDADR EF57 12#31 LDBUF 4000 1#39 5/ 6 7/35 9/54 LDMA 04EA 5/ 7 5/25 6/ 8 6/11 9#47 LDSEL EF6D 13#13 13/14 n LDTRK EF6E 13#14 s LF 000A 2/ 2 2/ 3 2/ 4 3/25 9/ 2 9/ 2 9/ 5 9/18 9/31 9/31 n LKEY EF5E 12#38 n LLIMIT EF6C 13# 9 n LOGSEC EF56 12#28 n LSAVE EFE6 14# 5 s LSECB 0100 6/ 9 s LVMEM 1000 s LWAMEM FFFF 14/18 MAXTRY 000A 1#44 5/34 K EF1B 12# 8 n SEKSEC EF18 12# 6 n SEKTRK EF19 12# 7 SEL 018F 3#46 7/22 8/ 6 8/24 SELDSK 011B 1#47 3/49 n SELF 000E 1#42 SETDMA 0124 1#50 4/ 5 SETSEC 0121 1#49 3/58 SETTRK 011E 1#48 3/54 s SI.S16 0055 SORCIM 808x Assembler ver 3.5E 5=/00/;1 1<:03 Page 18 SYSGEN - SYSTEM GENERATION PROGRAM 8/79 D:OCCRAMA .ASM s SI.S64 0056 SIGNON 02EF 7/ 3 9# 2 n SSAVE EFEA 14# 8 START 0231 1/56 6#16 STK 0529 7/ 2 9#52 s SVER 0001 s SYS 0005 3/ 6 3/20 s SYSDAT 0010 s SYSL 0006 s SYSR 0000 5/55 7/11 7/40 8/26 TEM EF00 11#34 11/35 n TEMSEC EF20 12#14 n TKEY EF5C 12#36 TRACK 04E7 5/ 9 5/12 9#44 TRK 0199 3#52 5/20 s TRUE FFFF n UNACNT EF52 12#25 n UNASEC EF55 12#27 n UNATRK EF53 12#26 n VERS 0016 1#23 s VLDL 0034 WRITE 01B5 4#13 5/53 WRITF 012A 1#52 4/14 n WRTYPE EF23 12#17  s VLDL 0034 WRITE 01B5 4#13 5/53 WRITF 012A 1#52 4/14 n WRTYPE EF23 12#17 er 3.5E 5=/00/;1 1<:03 Page 18 SYSGEN - SYSTEM GENERATION PROGRAM 8/79 D:OCCRAMA .ASM s SI.S64 0056 SIGNON 02EF 7/ 3 9# 2 n SSAVE EFEA 14# 8 START 0231 1/56 6#16 STK 0529 7/ 2 9#52 s SVER 0001 s SYS 0005 3/ 6 3/20 s SYSDAT 0010 s SYSL 0006 s SYSR 0000 5/55 7/11 7/40 8/26 TEM EF00 11#34 11/35 n TEMSEC EF20 12#14 n TKEY EF5C 12#36 TRACK 04E7 5/ 9 5/12 9#44 TRK 0199 3#52 5/20 s TRUE FF1Osborne One SYSGEN program. V e r s i o n 1.00 COPYRIGHT (C) 1978, DIGITAL RESEARCH a{__> n> nt~n#Ã2O66!6$6' 6* 6!@">2!4:0N͙͡*DMͧ2: !3̓` t<2:͵#ͭ#* "1)!̓>2!N~`AZ?A2A͏t!o̓` t2ͽ:@ʐ!̓!Z̓!~` AڱÖA2A͏!~` t!6ͽ!̓Ö>͏t!̓ lSYSGENm Operating System Duplication Program. ) OSBORNE COMPUTER SYSTEM ONE( lSourcem Drive (lA or Bm) lSourcem is on drive , Then type lRETURNm ------------------------------------------------ lDESTINATIONm (A,B or RETURN to exit) lDESTINATIONm is on drive P, Then type lRETURNmPERMANENT ERROR, TYPE RETURN TO IGNORE Read of SYSTEM is lcompletem. System has been copied successfully. )INVALID( System Disk is lunauthorizedm, ABORT. !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKL