home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
beehive
/
os
/
z8d24sup.arc
/
BUXZD20.LBR
/
BUXZD20.ZZ0
/
BUXZD20.Z80
Wrap
Text File
|
1991-02-10
|
7KB
|
264 lines
;****************************************************
;
; BUXZD20.Z80
; Eugene Nolan
; 1/4/88
;
;
; This file functions as an RSX that is to be used
; with Z80DOS and BU20.LBR/BUSHBETA.LBR to preserve date stamps
; of the source files on the destination files.
; The companion program BUXREM is used to remove the RSX.
;
; NOTE: BUXZD20 functions differently from BUXZD10 in that
; it is not affected by warm boots. BUXREM MUST be used
; to have it remove itself.
;
;
; The limitations are that only one source and one destination
; drive may be specified for a single execution of BU/BUSH.
; BUSH allows you to specify another source/destination drive
; after the current backup is complete, unfortunatly this feature
; is not useable with BUXZD.
;
; The following are examples of use in different scenarios
;
; In ALIAS.CMD:
;
; BU BUXZD $*;BU20 $*;BUXREM
; or
; BU BUXZD $*;BUSHND;BUXREM
;
; In a ZEX script:
;
; BUXZD $1 $2 BUXZD $1 $2
; BU20 $1 $2 $3 or BUSHND
; BUXREM BUXREM
;
; Stand alone in a multi-command line:
;
; BUXZD A D;BU20 A[:AFN] D [opts]
; or
; BUXZD A D;BUSHND;BUXREM
;
; As a series of single command lines
;
; BUXZD A D
; any other command may be executed here with the stipulation
; of all Make file and writes to drive D will be stamped
; with the date of the last file Opened on Drive A.
;
; BU20 A[:AFN] D [opts] or BUSHND
;
; BUXREM
;
;
; BUXZD expects to find as parameters the source disk( ignores file name
; if present) and destination disk in the command line buffer at 80h.
;
; BUXZD is to assembled with M80 and linked with L80 (M80,L80 tm Microsoft)
; and used with the automated SPR generator RELOC24 (Ashby Method)
;
; Generation instructions:
;
; M80 =BUXZD.Z80 Assemble the file to a .REL
; L80 RELOC,/P:1FE,BUXZD,ORG200/N/E,@@relo Link with RELOC.REL to ORG200.COM
; L80 RELOC.ABS,/P:2FE,BUXZD,ORG300/N/E Link with RELOC.ABS to ORG300.COM
; RELOC24 BUXZD - Run the SPR generator to BUXZD.COM
; ERA ORG*.COM Erase temporary files
;
;
;
JBDOS EQU 6 ; Holds BDOS entry address
CLBUF EQU 80H ; Command line buffer address
GETSTP EQU 54 ; Z80DOS call to get time stamp
USESTP EQU 55 ; Z80DOS call to use time stamp
OPEN EQU 15 ; BDOS call to open file
CLOSE EQU 16 ; " " " close "
MAKE EQU 22 ; " " " make "
WRSEQ EQU 21 ; " " " write sequential
WRRAN EQU 34 ; " " " write random
WRRANF EQU 40 ; " " " write random with zero fill
NORSX EQU 0F8h ; Our extended BDOS call to remove RSX
.z80
CSEG
; The next 3 lines are for RELOC24.COM
$MEMRY:: ; Filled in by L80 with last in last module
DS 2
JP START ; Required by RELOC24
START:
LD HL,(JBDOS) ; Get BDOS entry address
INC HL ; Skip over jump that is there
INC HL
INC HL
LD A,(HL) ; See if were already here( look for 'BU')
CP 'B'
JR NZ,INSTALL ; NZ= not here
INC HL
LD A,(HL)
CP 'U'
JR NZ,INSTALL
LD DE,AINSMESS ; Get to here and found out already loaded
LD C,9
CALL 5
RET
AINSMESS:
DB 13,10,'BU RSX already installed',13,10,'$'
INSTALL:
LD HL,CLBUF ; Point to input line
LD DE,DRVARY ; Point to array of drives
LD A,(HL) ; Get char count
OR A
RET Z ; Z=no input, must want help, don't install
INC HL
LD B,A
SRCH: LD A,(HL) ; Skip all spaces
CP ' '
JR NZ,SRCH1
INC HL
DJNZ SRCH
JR NOINS ; Exausted input and found nothing, so don't
; install
SRCH1: SUB 40H ; Convert to drive number
LD (DE),A ; Save disk to be backed up
INC DE
INC HL
DEC B
JR Z,NOINS ; Exausted input and found nothing, so don't
; install
SRCH2: LD A,(HL) ; Skip all till find next space or exaust input
CP ' '
JR Z,SRCH3 ; Z=is a space, continue
INC HL
DJNZ SRCH2
JR NOINS ; Input all done, don't install
SRCH3: LD A,(HL) ; Skip intervening spaces
CP ' '
JR NZ,SRCH4
INC HL
DJNZ SRCH3
JR NOINS ; Input done, don't install
SRCH4: SUB 40H
LD (DE),A ; Save it in drive array
INC HL
LD A,(HL) ; Input done?
OR A
JR Z,OKINS ; Yes, ok to install
CP ' ' ; A space?
JR NZ,NOINS ; No, don't install
OKINS: LD HL,(JBDOS) ; Get BDOS entry address
LD (MYJUMP+1),HL ; Save it internally
LD HL,MYENTRY ; Put our entry point there
LD (JBDOS),HL
LD HL,(1) ; Get address of BIOS warmboot
INC HL
LD E,(HL)
INC HL
LD D,(HL)
LD (HWB1),DE ; And save it away for BUXREM later
DEC HL
LD DE,BUWBOT ; Overwrite BIOS JP with our warm boot code
LD (HL),E
INC HL
LD (HL),D
DEC HL
LD DE,1604H ; Calculate where the CCP cold entry point is
OR A
SBC HL,DE
LD (BCCP),HL ; And save it away for our warmboots
LD DE,INSMESS
LD C,9
JP MYJUMP
INSMESS:
DB 13,10,'BU RSX installed',13,10,'$'
NOINS: RET
MYENTRY: ; With RSX loaded, all CALL/JUMP 5 will go
JP MYENTRY1 ; thru us here.
DB 'BU' ; Our flag as to already loaded
; Our warm boot entry point
BUWBOT: LD A,(4) ; Get current DU
LD C,A
DB 0C3H ; And go to CCP cold entry point
BCCP: DW 0 ; Filled in above by install
HWB1: DW 0 ; Holds original BIOS warm boot entry point
MYENTRY1:
LD A,C
CP OPEN ; Open file?
JR Z,ISOPEN
CP MAKE ; Make,Wrseq,Wrran,Wrranf,Close all treated same
JR Z,ISMAKE
CP WRSEQ
JR Z,ISMAKE
CP WRRAN
JR Z,ISMAKE
CP WRRANF
JR Z,ISMAKE
CP CLOSE
JR Z,ISMAKE
CP NORSX ; Our extended BDOS call to remove RSX?
JR NZ,MYJUMP
LD HL,(MYJUMP+1) ; Yes, restore original BDOS entry address
LD (JBDOS),HL
LD DE,(HWB1) ; Get original BIOS warmboot entry point
LD HL,(1)
INC HL
LD (HL),E ; And restore it
INC HL
LD (HL),D
LD DE,NORSXX
LD C,9
JP MYJUMP
NORSXX:
DB 13,10,'BU RSX removed',13,10,'$'
ISOPEN:
LD A,(DE) ; Get drive code from FCB
LD HL,DRVARY
CP (HL) ; Is it equal to drive to be backed up?
JR NZ,NOTINP ; NZ=no
CALL MYJUMP ; Do the open
CP 0FFH ; Bad?
JR Z,NOTINP ; Z=yes
PUSH DE
PUSH BC
PUSH AF
LD C,GETSTP ; Get the time stamp for file
CALL MYJUMP ; Z80DOS will keep it for us
POP AF
POP BC
POP DE
RET
NOTINP:
JP MYJUMP
ISMAKE:
PUSH DE
PUSH BC
LD A,(DE) ; Get drive code from FCB
LD HL,DRVARY+1
CP (HL) ; Is it equal to drive to be backed up?
JR NZ,NOTINP1 ; NZ=no, just do it
LD C,USESTP ; Force Z80DOS to use stamp as stored above
CALL MYJUMP
NOTINP1:
POP BC
POP DE ; Go do make,close, or writes
MYJUMP:
JP 0 ; Filled in with BDOS entry address
RET
DRVARY: DB 0,0 ; Holds Source/destination drives of BU
DW 0
END