;ENHANCED FILE TRANSFER PROGRAM FOR 5/8 AND 8/5 DISCS. ;DEBUGGED AND ENHANCED BY ROD HART WA3MEZ ; AUGUST 14, 1980 ; ; Further debugged and modified by W6BSK: 10 Dec 81 ; ; To use, bring up the destination system first; ; then use DDT (or another method) to call the source system. ; ;The program requires that one system be at some low location ;(such as 20k) and the other be at a high location (such as 48k.) ;Both must be up at the same time. The proper loading procedure ;is to cold boot (or otherwise come up on) the destination system ;first, then use DDT to cold boot the source system.The source ;system will thereby be in the base page and the destination ;system will be called by the program. ; System equates: TRUE EQU 1 FALSE EQU NOT TRUE X5TO8 EQU TRUE ;SET TRUE if 5" to 8" transfer. X8TO5 EQU FALSE ;SET TRUE if 8" to 5" transfer. VT EQU 1AH ;VIO-C CLEAR SCREEN BDOS EQU 5 ; BDOS entry point. IF X8TO5 REBDOS EQU 3506H ;DESTINATION ENTRY POINT. ENDIF ;Current value for 20k system IF X5TO8 REBDOS EQU 0C506H ;Current value for 56k system ENDIF ;Change these values as needed. DEFFCB EQU 5CH ;Default file control block. OPEN EQU 15 ;Open the file. SETBUF EQU 26 ;Set the buffer. DELETE EQU 19 ;Delete the file. MAKE EQU 22 ;Write to directory. READ EQU 20 ;Read the disk. WRITE EQU 21 ;Write the disk. CLOSE EQU 16 ;Close the file. PRINT EQU 9 ;Output a message. FCBCR EQU DEFFCB+32 ;Source file control block. WBOOT EQU 0 ;Warmboot. ORG 100H START LXI H,00 DAD SP SHLD OLDSP LXI SP,STACK MVI B,20H ;Set counter and move LXI D,DEFFCB Š LXI H,NFCB ;Move file name to the new control LOOP1 LDAX D ;block at NFCB MOV M,A INX H INX D DCR B JNZ LOOP1 LXI D,DEFFCB ;Point to the default FCB MVI C,OPEN ;and use this to open the file CALL BDOS ;to be transmitted. CPI 255 JNZ OPNOK CALL ERROR ;Bad file or nonexistent. DB 'File not present on the source disc.$' OPNOK LXI D,MSG1 ;File properly opened. MVI C,PRINT CALL BDOS XRA A STA FCBCR ;Put a zero in the first FCB cells. STA NFCB+32 LXI D,NFCB MVI C,DELETE ;Delete the file if on destination CALL REBDOS ;disc. LXI D,NFCB MVI C,MAKE ;Write a new entry into the directory of CALL REBDOS ;the destination disc. JP OKOPN CALL ERROR DB 'Cannot open the destination file.$' OKOPN LXI D,MSG2 ;Reading a sector from the n" disc. MVI C,PRINT CALL BDOS CALL READIT ;Read the source sector. CPI 0 JZ HERE ;Good read. CPI 1 ;Last sector? JZ DONE ;Yes. CALL ERROR DB 'There was an error in calling BDOS.$' HERE LXI D,MSG3 ;Writing a sector to the n" disc. MVI C,PRINT CALL BDOS CALL WRITIT ;Write the sector to the destination disc. CPI 2 ;Good write? JNZ OKOPN ;Yes, get the next. CALL ERROR ;No- DB 'Disc full; no further transfer possible.$' READIT PUSH B ;Push all. PUSH D PUSH H MVI C,SETBUF ;Set the address to the normal LXI D,0080H ;FCB at 0080. CALL BDOS MVI C,READ LXI D,DEFFCB ;Do a sequential read to the Š CALL BDOS ;default buffer at 005c. POP H POP D POP B ;Restore the registers. RET WRITIT PUSH B ;Push all. PUSH D PUSH H MVI C,SETBUF ;Set the address to LXI D,0080H ;the standard FCB. CALL REBDOS MVI C,WRITE ;Write the buffer to the destination LXI D,NFCB ;disc. CALL REBDOS POP H POP D POP B ;Restore the registers. RET DONE LXI D,MSG4 ;The file is being closed. MVI C,PRINT CALL BDOS MVI C,CLOSE ;Do the actual closing. LXI D,NFCB CALL REBDOS JMP WBOOT ;Now go home ERROR POP D MVI C,PRINT ;Print error routine. CALL BDOS LXI D,ERASE ;Get FCB for $$$.SUB MVI C,DELETE ;and delete it. CALL BDOS JMP WBOOT NFCB DS 32 ;New file control block area. ERASE DB 000H,'$$$ SUB' DS 24 ;ERASE file control block. OLDSP DS 2 MSG1 DB 'File properly opened.' DB 0AH,0DH,'$' MSG2 IF X8TO5 DB '@' ENDIF IF X5TO8 DB '+' ENDIF DB '$' MSG3 IF X5TO8 DB '*' ENDIF IF X8TO5 DB '#' ENDIF DB '$' MSG4 DB 0DH,0AH,'The file is being closed.' DB 0AH,0DH,'$' MSG5 IF X8TO5 Š DB VT,0AH,0DH,'8" to 5" File Transfer Program:' ENDIF IF X5TO8 DB VT,0AH,0DH,'5" to 8" File Transfer Program:' ENDIF DB 0AH,0DH,'$' STACK EQU $+100 END