home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
simtel
/
sigm
/
vols200
/
vol264
/
z3lib.lbr
/
Z3LIB5.HQP
/
Z3LIB5.HLP
Wrap
Text File
|
1986-03-22
|
16KB
|
608 lines
Introduction ZCPR3 Utilities
Named Directory/Disk User Conversion DIRTDU DUTDIR
Resolve Directory References DNSCAN et al
Parse Command Line PARSER
Search for File Along Path PFIND
Program Loader (Chain) PRGLOAD
Output Routines Based on the Quiet Flag Qxxx
Locate ROOT Directory in Path ROOT
Shell Stack Manipulation Routines SHxxx
Delay Routines WAITs
Log into ZCPR3 FCB DU Z3LOG
Return Z3LIB.REL Version Number Z3LVER
Parse Token ZPRSFN ZFNAME
:Introduction to ZCPR3 Utilities
Thesσáá utilitie≤áá providσá ßá numbe≥á oµáá convenien⌠ ì
function≤á fo≥á thσá ZCPR│á Systeφá Programmer«á Acces≤á t∩ ì
directories¼á conversioε froφ tex⌠ strinτ name≤ t∩ director∙ ì
referencσ values¼á commanΣ anΣ commanΣ linσá parsing¼á quie⌠ ì
outpu⌠ routines¼á shel∞ stacδ manipulation¼á dela∙ routines¼ ì
and other ZCPR3-specific functions are provided.
:DIRTDU/DUTDIR
Z3LIB Routine: DIRTDU
Function:
DIRTD╒ convert≤ thσ DI╥ namσ pointeΣ t∩ b∙ H╠ int∩á it≤ ì
D╒á equivalent«á Thσá DI╥ namσ i≤ ß strinτ oµ u≡á t∩á eigh⌠ ì
ASCI╔á characters¼á anΣá it≤ enΣ i≤ denoteΣ b∙á ßá delimite≥ ì
whicΦá i≤á an∙á ASCI╔á characte≥ tha⌠ i≤ no⌠ ßá digi⌠á o≥á ß ì
letter«
Inputs: HL = address of first character of DIR name
Outputs: If match found, BC = DU (disk A = 0) and NZ
If no match, A=0 and Zero Flag Set (Z)
H╠ alway≤ point≤ t∩ thσ delimite≥ a⌠ thσ enΣ of
name
Registers Affected: HL, BC, PSW
Side Effects: None
Special Error Conditions: None
Z3LIB Routine: DUTDIR
Function:
DUTDI╥ searche≤ thσ nameΣ director∙ fo≥ thσ D╒ giveε iε ì
B├ (B=disδ witΦ disδ ┴ ╜ 0¼ C=user)« Iµ aε entr∙ exist≤ fo≥ ì
thσ correspondinτ DU¼á DUTDI╥ return≤ ß pointe≥ iε H╠ t∩ thσ ì
8-characte≥ namσ (followeΣ b∙ aε 8-characte≥ password).
Inputs: BC = DU (disk A = 0)
Outputs: If found, A=0FFH and NZ and HL = pointer to name
If not found, A=0 and Zero Flag is Set
Registers Affected: HL and PSW
Side Effects: None
Special Error Conditions: None
:DNSCAN/DUSCAN/DIRSCAN
Z3LIB Routine: DNSCAN
Function:
DNSCA╬á scan≤á fo≥ ß resolutioε oµ thσá director∙á namσ ì
pteΣá t∩ b∙ HL«á Thσ disδ namσ i≤ a⌠ mos⌠ eigh⌠á character≤ ì
lonτ and¼á iµ les≤ thaε eigh⌠ characters¼ i≤ terminateΣ b∙ ß ì
delimite≥ sucΦ a≤ ß space¼á ß characte≥ les≤ thaεá space¼á ß ì
comma¼á ß period¼ ß dash¼ etc« Iµ found¼ thσ D╒ i≤ returneΣ ì
iε BC. Both DIR and DU forms are resolved by this routine.
Inputs: HL = address of first character of directory name
A = Flag:
A=0 if scan DU before DIR
A<>0 if scan DIR before DU
Outputs: BC = DU (disk A = 0) if found
A = Return Code:
A=░ anΣ Zer∩ Flaτ Se⌠ (Z⌐ iµ no⌠ valid
A=0FFH and NZ if valid and BC=DU
Registers Affected: BC, PSW
Side Effects: None
Special Error Conditions: None
Z3LIB Routine: DUSCAN
Function:
DUSCA╬á resolve≤á thσ D╒ forφ pteΣ t∩ b∙á HL«á Thσá D╒ ì
strinτá i≤ storeΣ iε ß buffe≥ u≡ t∩ eigh⌠á character≤á long¼ ì
anΣ i⌠ i≤ terminateΣ b∙ ß delimiter¼ whicΦ ma∙ bσ an∙ oµ thσ ì
following bytes:
a character of value space or less
an equal sign (=)
an underscore (_)
a period (.)
a colon (:)
a comma (,)
a less-than sign (<)
a greater-than sign (>)
Inputs: HL = address of first char
Outputs: A=0FFH, NZ, and BC=DU (disk A = 0) if valid
A=0 and Zero Flag Set (Z) if not valid
Registers Affected: BC, PSW
Side Effects: None
Special Error Conditions: None
Z3LIB Routine: DIRSCAN
Function:
DIRSCA╬á resolve≤ thσ DI╥ forφ pteΣ t∩ b∙ HL«á Thσ DI╥ ì
strinτá i≤ storeΣ iε ß buffe≥ u≡ t∩ eigh⌠á character≤á long¼ ì
anΣá i⌠á i≤ terminateΣ b∙ ß delimite≥ iµ i⌠ i≤á unde≥á eigh⌠ ì
character≤ long¼ whicΦ ma∙ bσ an∙ oµ thσ followinτ bytes:
a character of value space or less
an equal sign (=)
an underscore (_)
a period (.)
a colon (:)
a comma (,)
a less-than sign (<)
a greater-than sign (>)
Inputs: HL = address of first char
Outputs: A=0FFH, NZ, and BC=DU (disk A = 0) if valid
A=0 and Zero Flag Set (Z) if not valid
Registers Affected: BC, PSW
Side Effects: None
Special Error Conditions: None
:PARSER
Z3LIB Routine: PARSER
Function:
PARSE╥ perform≤ ß completσ parsσ oµ thσ commanΣ pointeΣ ì
t∩á b∙ H╠ (thσ commanΣ i≤ ß strinτ terminateΣ b∙ ß binar∙á ░ ì
o≥ aε MC╠ delimiter¼á ß semicoloε [;])« Al∞ element≤ oµ thσ ì
commanΣ linσ arσ parseΣ a≤ thougΦ thσ ZCPR│ C╨ werσá parsinτ ì
thσ line.
Thσá followinτ buffer≤ arσ initializeΣ a≤ pe≥ thσ ZCPR│ ì
CP conventions:
FCB1 (at 5CH)
FCB2 (at 6CH)
TBUFF (at 80H)
The command name is returned in an FCB pted to by DE.
Inputs: HL = address of command
A = 0 if DIR form scanned before DU
A <> 0 if DU form scanned before DIR
Outputs: HL = address of next command (0 or leading ;)
DE = address of FCB with command name
(verb.COM)
A = Flag:
A=0 and Zero Flag Set (Z) if OK
A=number of question marks and NZ if
verb contains one or more ? chars
Registers Affected: HL, DE, PSW
Side Effects: Buffers Altered
Special Error Conditions: None
:PFIND
Z3LIB Routine: PFIND
Function:
PFIN─ searche≤ fo≥ thσ filσ specifieΣ iε thσ targe⌠ FC┬ ì
alonτ thσ ZCPR│ commanΣ searcΦ path« Iµ found¼ thσ D╒ i⌠ i≤ ì
located in is returned.
Inputs: DE = Address of FCB
A=0 if do not search current directory
A<>0 if search of current directory
Outputs: BC = DU (disk A = 0)
A=0 and Zero Flag Set (Z) if not found
A=0FFH and NZ if found
Registers Affected: BC, PSW
Side Effects: FCB is affected
Special Error Conditions: None
:PRGLOAD
Z3LIB Routine: PRGLOAD
Function:
PRGLOA─á load≤á thσ prograφ indicateΣ b∙ thσá firs⌠á 1▓ ì
byte≤á pointeΣá t∩ b∙ D┼ int∩ memor∙ a⌠ 100╚á anΣá transfer≤ ì
contro∞ t∩ it«á I⌠ i≤ ß chaiε function« Thσ loade≥ anΣ FC┬ ì
useΣá fo≥ thσ loaΣ arσ relocateΣ t∩ jus⌠ unde≥ thσ C╨á afte≥ ì
PRGLOA─á begin≤ execution¼á s∩ thσ TP┴ i≤ freσ fo≥ thσ load« ì
Carσá shoulΣá bσá takeεá t∩ ensurσá tha⌠á thσá systeφá stacδ ì
(locateΣá ou⌠ oµ thσ TP┴ iε ß safσ area⌐ i≤ useΣ insteaΣá oµ ì
somσá stacδ iε thσ TP┴ whicΦ ma∙ bσ overwritteεá durinτá thσ ì
load.
è Iµá PRGLOA─á return≤á froφ beinτ called¼á aεá erro≥á iε ì
loadinτá occurred«á Iµ al∞ goe≤ well¼á thσá loadeΣá prograφ ì
executes successfully.
Inputs: DE pts to first 12 bytes of FCB
Outputs: None
Registers Affected: All (if PRGLOAD returns, load was a
failure)
Side Effects: None
Special Error Conditions: None
:Qxxxx
Thesσá routine≤á outpu⌠ thei≥ value≤ onl∙ iµ thσá Quie⌠ ì
Flaτ i≤ clea≥ (0)«á Iµ thσ Quie⌠ Flaτ i≤ TRU┼ (no⌠ 0)¼ theε ì
no values are output.
This class of routines includes the following:
QCOUT Console Character Output with Control
QCRLF New Line
QOUT Console Character Output
QPRINT String Output (Return Address)
QPSTR String Output (HL)
Z3LIB Routine: QCOUT
Function:
QCOU╘ output≤ thσ characte≥ iε ┴ witΦ contro∞ characte≥ ì
processing (1 outputs as ^A) if the Quiet Flag is OFF (0).
Inputs: A=Character
Outputs: None
Registers Affected: None
Side Effects: Character(s) is printed
Special Error Conditions: None
Z3LIB Routine: QCRLF
Function:
QCRL╞ output≤ ß Ne≈ Linσ (C╥ L╞ pair⌐ iµ thσ Quie⌠ Flaτ ì
is OFF (0).
Inputs: None
Outputs: None
Registers Affected: None
Side Effects: CRLF is Output
Special Error Conditions: None
Z3LIB Routine: QOUT
Function:
QOU╘á output≤á thσá characte≥á iεá ┴á withou⌠áá contro∞ ì
characte≥á processinτ (▒ output≤ a≤ 1⌐ iµ thσ Quie⌠ Flaτá i≤ ì
OFF (0).
Inputs: A=character to output
Outputs: None
Registers Affected: None
Side Effects: Character is output
Special Error Conditions: None
Z3LIB Routine: QPRINT
Function:
QPRIN╘ output≤ thσ string¼ terminateΣ b∙ ß binar∙ 0¼ a⌠ ì
thσ returε addres≤ iµ thσ Quie⌠ Flaτ i≤ OF╞ (0)« Contro∞ i≤ ì
returned to the byte following the string.
Inputs: None (String at Return Address)
Outputs: None
Registers Affected: None
Side Effects: String is output
Special Error Conditions: None
Z3LIB Routine: QPSTR
Function:
QPST╥á output≤á thσ string¼á terminateΣ b∙ ß binar∙á 0¼ ì
pted to by HL if the Quiet Flag is OFF (0).
Inputs: HL = address of first character of the string
Outputs: None
Registers Affected: None
Side Effects: String is output
Special Error Conditions: None
:ROOT
Z3LIB Routine: ROOT
Function:
ROO╘á return≤á thσ D╒ iε B├ (disδ ┴ ╜ 0⌐á oµá thσá las⌠ ì
director∙ iε thσ commanΣ searcΦ path«á N∩ patΦ optimizatioε ì
i≤á performed«á Thi≤á routinσ provide≤ ß convenien⌠ wa∙á t∩ ì
finΣá thσ ROO╘ directory¼á wherσ thi≤ director∙ i≤ thσá las⌠ ì
directory referenced in a path expression.
Thi≤ routinσ i≤ sometime≤ no⌠ consisten⌠ witΦ thσ ZCPR│ ì
C╨á iµá thσá MINPAT╚ (Minimizσ PatΦá Expression⌐á optioεá i≤ ì
selected« ROO╘ advance≤ t∩ thσ las⌠ referenceΣ director∙ iε ì
thσá patΦ withou⌠ minimization¼á whicΦ ZCPR│á minimize≤á thσ ì
searcΦáá anΣáá ma∙á resolvσá ßá patΦá t∩áá terminatσáá (witΦ ì
duplication⌐á a⌠ ß director∙ othe≥ thaε thσ physicall∙á las⌠ ì
directory in the path.
Inputs: None
Outputs: BC = DU (Disk A = 0)
Registers Affected: BC, PSW
Side Effects: None
Special Error Conditions: None
:SHxxx
Thi≤ se⌠ oµ routine≤ support≤ Shel∞ Stacδ manipulation« ì
The following routines are provided:
SHEMPTY - test to see if Shell Stack is empty
SHFULL - test to see if Shell Stack is full
SHPOP - pop top string off of Shell Stack
SHPUSH - push string onto Shell Stack
┴á Shel∞á Stacδ i≤ implementeΣ a≤ ß serie≤á oµá string≤ ì
(recommendeΣ sizσ i≤ 3▓ bytes/string¼á anΣ thσ stacδá shoulΣ ì
contaiε a⌠ leas⌠ fou≥ oµ thesσ strings)« Thσ to≡ elemen⌠ oµ ì
ß Shel∞ Stacδ specifie≤ thσ commanΣ linσ t∩ bσ executeΣ a≤ ß ì
Shel∞ b∙ thσ ZCPR│ CP« Thi≤ commanΣ linσ i≤ copieΣ int∩ thσ ì
Multiple Command Line Buffer for execution.
Z3LIB Routine: SHEMPTY
Function:
SHEMPT┘ determine≤ iµ thσ shel∞ stacδ i≤ empty«á Iµ i⌠ ì
i≤ empt∙ o≥ n∩ shel∞ stacδ i≤ available¼á A=0╗ iµ no⌠ empty¼ ì
A<>0.
Inputs: None
Outputs: A=0 and Zero Flag Set (Z) if empty or none
A<>0 and NZ if not empty
Registers Affected: PSW
Side Effects: None
Special Error Conditions: None
Z3LIB Routine: SHFULL
Function:
SHFUL╠á determine≤ iµ thσ shel∞ stacδ i≤ full«á Iµ thσ ì
stacδ i≤ ful∞ o≥ no⌠ available¼á A=0╗á else¼ iµ thσ stacδ i≤ ì
not full, A<>0.
Inputs: None
Outputs: A=0 and Zero Flag Set (Z) if stack full or none
A<>0 if stack not full
Registers Affected: PSW
Side Effects: None
Special Error Conditions: None
Z3LIB Routine: SHPOP
Function:
SHPO╨á pop≤ thσ to≡ elemen⌠ ofµ oµ thσ Shel∞ Stacδá anΣ ì
discard≤ i⌠ iµ possible«á SHPO╨ return≤ witΦ A=░ iµ po≡ wa≤ ì
successful¼á elsσá A<>0«á Thσá followinτá erro≥á code≤á arσ ì
returned:
A=1 if no Shell Stack available
A=2 if Shell Stack is empty
Inputs: None
Outputs: A=Code:
A=0 if success (and Zero Flag Set - Z)
A=1 if no Shell Stack available (NZ)
A=2 if Shell Stack empty (NZ)
Registers Affected: PSW
Side Effects: String is popped from Shell Stack
Special Error Conditions: None
Z3LIB Routine: SHPUSH
Function:
SHPUS╚ pushe≤ thσ strinτ (includinτ thσ endinτ 0⌐á pteΣ ì
t∩á b∙ H╠ ont∩ thσ Shel∞ Stacδ iµ possible«á SHPUS╚ return≤ ì
with A=0 if successful, else A<>0.
Inputs: HL = string to push onto Shell Stack (end in 0)
Outputs: A=Return Code:
A=0 if successful and no error (Z)
A=1 if no Shell Stack available (NZ)
A=2 if Shell Stack is full (NZ)
A=3 if string is too long for Shell Stack
entry (NZ)
Registers Affected: PSW
Side Effects: String is pushed onto Shell Stack
Special Error Conditions: None
:WAITs
Thσá followinτ routine≤ providσ ß softwarσ dela∙á baseΣ ì
upoεá thσá processo≥á speeΣ valuσ iε thσá ZCPR│á Environmen⌠ ì
Descriptor«á Thesσ routine≤ simpl∙ dela∙ fo≥ thσá indicateΣ ì
perioΣáá oµá timσá (approximately⌐á anΣá theεá return«áá N∩ ì
registers are affected.
The routines are:
WAIT1S - delay for 1 second
WAIT1MS - delay for 0.001 second
WAITP1S - delay for 0.1 second
Z3LIB Routine: WAIT1S
Function:
WAIT1S delays for approximately 1 second.
Inputs: None
Outputs: None
Registers Affected: None
Side Effects: A 1-second delay takes place
Special Error Conditions: None
Z3LIB Routine: WAIT1MS
Function:
WAIT1M╙á delay≤ fo≥ approximatel∙ ▒ milliseconΣá (0.00▒ ì
second).
Inputs: None
Outputs: None
Registers Affected: None
Side Effects: A 1-millisecond delay takes place
Special Error Conditions: None
Z3LIB Routine: WAITP1S
Function:
WAITP1╙á delay≤ fo≥ approximatel∙ onσ tentΦ (0.1⌐ oµá ß ì
second.
Inputs: None
Outputs: None
Registers Affected: None
Side Effects: A 0.1-second delay takes place
Special Error Conditions: None
:Z3LOG
Z3LIB Routine: Z3LOG
Function:
Z3LO╟ log≤ int∩ thσ D╒ containeΣ iε ß ZCPR│ FCB«á Thi≤ ì
FC┬á contain≤ thσ disδ referencσ iε Bytσ ░ anΣ thσ Use≥ Areß ì
iε Bytσ 1│ (S1)«á Thi≤ i≤ thσ standarΣ forma⌠ useΣ b∙ ZCPR│ ì
to store a complete DU reference in an FCB.
Inputs: DE = First Byte of FCB
Outputs: None
Registers Affected: None
Side Effects: Directory is logged into
Special Error Conditions: None
:Z3LVER
Z3LIB Routine: Z3LVER
Function:
Returε Versioε Numbe≥ oµ Z3LIB.REL« H=Majo≥ Version¼ ╠ ì
= Minor Version. Numbers are in pure binary.
Inputs: None
Outputs: HL = Version Number (H=Major, L=Minor)
Registers Affected: HL
Side Effects: None
Special Error Conditions: None
è:ZPRSFN
Z3LIB Routine: ZPRSFN/ZFNAME
Function:
ZPRSF╬á i≤ ß completσ FC┬ tokeε parse≥ iε thσ sensσá oµ ì
thσ ZCPR│ C╨ (seσ PARSER¼á whicΦ i≤ related)«á Oε input¼ H╠ ì
point≤ááá t∩ááá ßááá token¼áááá likσáááá 'dir:filename.typ'¼ ì
'du:filename.typ'¼áá 'filename.typ'¼áá etc¼áá anΣá ßá ZCPR3-ì
identica∞á parsσ i≤ performeΣ oε thσ token«á Thσá resultinτ ì
FC┬ contain≤ thσ filenamσ anΣ ty≡ anΣ ß prope≥ D╒ reference.
ZFNAM┼á i≤ ß litera∞ interpretatioε oµ thσ codσá withiε ì
thσá ZCPR│ CP«á ZPRSF╬ i≤ ß morσ efficien⌠ bod∙ oµ codσ bu⌠ ì
use≤ morσ buffe≥ space.
Inputs: HL = address of first char of token
DE = address of 36-byte FCB
A = Flag:
A = 0 if scan for DIR form before DU
A = 1 if scan for DU form before DIR
Outputs: HL = address of char after token
A = number of question marks in filename.typ
and Zero Flag set accordingly
Registers Affected: HL, PSW
Side Effects: FCB is loaded
Special Error Conditions: None