home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
CPM
/
ZCPR33
/
S-Z
/
SLB36HLP.LBR
/
SYSLIB1.HZP
/
SYSLIB1.HLP
Wrap
Text File
|
2000-06-30
|
20KB
|
589 lines
Overview
Directory Manipulation Routines
Directory Buffer Structure
How To Use These Routines
DBUFFER -- Buffer Allocation Routine
DFREE -- Free Space Computation Routine
DIRALPHA -- Directory Alphabetization Routine
DIRF/DIRFS -- Generalized Routines
DIRLOAD/DIRSLOAD -- Directory Load Routines
DIRPACK/DIRNPACK -- Directory Pack Routines
DIRQ/DIRQS -- Optimal Generalized Routines
DIRSEL -- Directory Entry Selection Routine
DPARAMS -- Disk Parameter Information Routine
FSIZE -- File Size Computation Routine
::SYSLIB0.HLP
:Directory Manipulation Routines
Thi≤á se⌠á oµ SYSLI┬ routine≤ concern≤ itselµ witΦá thσ ì
loadinτá oµ anΣ acces≤ oµ ß disδ director∙ fo≥á thσá genera∞ ì
purpose≤ oµ thσ user«á IncludeΣ iε thi≤ se⌠ oµ routine≤ arσ ì
thσ function≤ of:
1. Preallocation of buffer space for the routines
2«á Loadinτá oµ al∞ undeleteΣ director∙ entrie≤ int∩ ß ì
buffer¼ constantl∙ checkinτ fo≥ memor∙ overflo≈ a≤ the∙ go
3« Determininτ thσ amoun⌠ oµ freσ spacσ oε thσ disk
4« Computinτ thσ sizσ oµ ß filσ iε K
5« Sortinτ ß loadeΣ director∙ b∙ filσ namσ anΣ typσ o≥ ì
b∙ filσ typσ anΣ name
6«á Selectinτá (b∙ marking⌐ ß se⌠ oµ director∙ entrie≤ ì
whicΦ matcΦ ß giveε ambiguou≤ filσ spec
7«á Packinτ thσ loadeΣ directory¼á leavinτ iε i⌠á onl∙ ì
thosσ entrie≤ markeΣ b∙ thσ selec⌠ routine
Thσá majorit∙ oµ thesσ routine≤ i≤ intendeΣ t∩ bσá useΣ ì
t∩á providσ ß flexiblσ director∙ acces≤ systeφ whicΦ caεá bσ ì
tailoreΣá b∙ thσ use≥ t∩ hi≤ specifiπ needs«á Fo≥ instance¼ ì
witΦá thσ DIRLOA─ routinσ separateΣ froφ thσá rest¼á severa∞ ì
differen⌠á load≤á oµá thσá director∙á (from¼á fo≥á instance¼ ì
differen⌠ ambiguou≤ filσ specs⌐ caε bσ performed¼á anΣá theε ì
onσá selectioε anΣ onσ sor⌠ oε al∞ filσ spec≤ loadeΣ caεá bσ ì
done.
Thσ DIRQ/DIRQ╙ pai≥ arσ intendeΣ fo≥ thosσ application≤ ì
whicΦá d∩ no⌠ neeΣ thi≤ kinΣ oµ flexibility«á DIR╤á (quick⌐ ì
anΣá DIRQ╙ (quicδ witΦ sizinτ information⌐ perforφá ßá load¼ ì
select¼á anΣá sor⌠á baseΣá oε onl∙ onσá filσá specification« ì
Usinτ DIRQ/DIRQ╙ insteaΣ oµ DIRF/DIRF╙ result≤ iε les≤á codσ ì
beinτ generateΣ anΣ (generally⌐ faste≥ execution.
:Directory Buffer Structure
DIRLOA─á anΣ DIRSLOA─ arσ useΣ t∩ loaΣ ß director∙ froφ ì
disδá int∩ memory«á Thσ entrie≤ loadeΣ arσ al∞á non-deleteΣ ì
entrie≤á iε eithe≥ ß particula≥ use≥ areß o≥ al∞ use≥á area≤ ì
on the disk which is currently logged in.
EacΦ filσ entr∙ iε thi≤ buffe≥ i≤ 1╢ byte≤ long¼ anΣ i⌠ ì
is structured as follows:
DB user ; user number of file
DB 'FILENAME' ; name of file
DB 'TYP' ; type of file
DB ext ; extent of file*
DB 0,0 ; uninteresting - leave alone
DB rec ; record count in this extent
¬á ex⌠á i≤ thσ filσ extent╗á fo≥ DIRLOAD¼á i⌠ i≤á thσá firs⌠ ì
exten⌠á numbe≥ oµ thσ file╗á fo≥ DIRSLOAD¼á i⌠ i≤á thσá las⌠ ì
extent number of the file
:How To Use These Routines
Thσá DIR╞á o≥ DIRF╙ routine≤ wil∞ probabl∙ bσá useΣá t∩ ì
perforφ you≥ director∙ acces≤ function≤ thσ vas⌠ majorit∙ oµ ì
thσ time«á Giveε ß buffer¼á aε ambiguou≤ filσ spec¼á anΣá ß ì
selectioεá flag¼á DIR╞ anΣ DIRF╙ loaΣ thσ desireΣ file≤á fo≥ ì
yo⌡ anΣ theε yo⌡ caε worδ witΦ thσ 16-bytσ filσ entrie≤ froφ ì
there« ┴ typica∞ callinτ sequencσ fo≥ DIR╞ o≥ DIRF╙ is:
CALL CODEND ; point to buffer space
LXI D,FCB ; point to FCB of file spec
MVI A,1100$0000B ; select all files in user 0
CALL DIRF ; load entries
JZ TPAOVFL ; error condition
<continue> ; HL pts to first entry, BC=
; number of entries
è
Iµá yo⌡ wisΦ t∩ deviatσ froφ thσ "normaló usσ fo≥á DIR╞ ì
anΣ DIRFS¼á acces≤ t∩ thσ routine≤ useΣ b∙ DIR╞ anΣ DIRF╙ i≤ ì
available«á ┴ casσ iε whicΦ yo⌡ ma∙ wan⌠ t∩ d∩ thi≤ i≤ wheε ì
yo⌡á arσ interesteΣ iε file≤ whicΦ matcΦ morσ thaε onσá filσ ì
spec¼á sucΦ a≤ *.AS═ anΣ *.TXT«á ┴ typica∞ callinτ sequencσ ì
for this type of access is:
; Setup
CALL CODEND ; point to buffer space
CAL╠ DBUFFE╥ ╗ ge⌠ interna∞ inf∩ anΣ ptrs
CALL DIRLOAD ; or DIRSLOAD to load entriesì
JZ TPAOVFL ; error condition
; Select first set of files
LXI D,FCB1 ; pt to first FCB to match
MVI A,1100$0000B ; select all files in user 0
CALL DIRSEL ; select file entries from
; buffer
; Repeat the following 2 lines as necessary
LXI D,FCB2 ; pt to 2nd FCB to match
CALL DIRSEL ; select again
; Finish up
CALL DIRPACK ; pack the file entries,
; leaving only the valid
; entries in the buffer
MVI A,0 ; alphabetize
CALL DIRALPHA
╗ Donσ -- H╠ pt≤ t∩ firs⌠ filσ entry¼ BC=numbe≥ oµ entries
:Buffer Allocation Routine -- DBUFFER
Routine: DBUFFER
Function:
Thi≤á routinσ allocate≤ thσ buffe≥ spacσ necessar∙á fo≥ ì
thσ se⌠ oµ director∙ function≤ iε general«á Iεá particular¼ ì
i⌠á allocate≤á thσ necessar∙ spacσ fo≥á thσá alphabetizatioε ì
functioεá a≤á wel∞á a≤ thσ loadeΣá director∙á itself«á Thi≤ ì
routinσ mus⌠ bσ useΣ iµ thσ DIRALPH┴ routinσ i≤ t∩ bσá late≥ ì
useΣá t∩ sor⌠ thσ directory╗á thi≤ routinσ allocate≤ al∞ thσ ì
spacσá necessar∙á b∙ DIRALPH┴ t∩ sor⌠ thσá routinσá (pointe≥ ì
space)«á Iµ thi≤ routinσ i≤ called¼á i⌠ i≤ no⌠ necessar∙ t∩ ì
cal∞ thσ DPARAM╙ routine.
Inputs: HL points to the beginning address of a
ááááá buffer area which extends to under the CCP
(usually set by a call to CODEND)
Outputs: HL points to the first byte at which the
ááááá directory entries are to be loaded
ááááá A=0 and Zero Flag is Set (Z) if the CCP is
ááááá already overrun; else, A<>0 and NZ
Registers Affected: HL, PSW
SYSLIB Routines Called: DPARAMS
Special Error Conditions: As indicated
:Free Space Computation Routine -- DFREE
Routine: DFREE
Function:
Thi≤á routinσ compute≤ thσ amoun⌠ oµ freσ spacσá (iεá ╦ ì
bytes⌐ lef⌠ oε disk.
Thσ routinσ DPARAM╙ (o≥ DBUFFER¼á DIRF¼ o≥ DIRFS¼ sincσ ì
the∙á als∩ cal∞ DPARAMS⌐ mus⌠ bσ calleΣ beforσ thi≤á routinσ ì
i≤á useΣá s∩ tha⌠ thσ correc⌠ disδ paramete≥ informatioεá i≤ ì
loadeΣ fo≥ it.
Inputs: None
Outputs: DE = Amount of Free Disk Space in K Bytes
Registers Affected: DE
SYSLIB Routines Called: None
Special Error Conditions: None
:Directory Alphabetization Routine -- DIRALPHA
Routine: DIRALPHA
Function:
T∩ alphabetizσ thσ file≤ iε thσ director∙ pointeΣ t∩ b∙ ì
H╠á b∙á eithe≥á filσ namσ anΣ typσá (STEST.AS═á goe≤á beforσ ì
TEST.AAA⌐á o≥á b∙ filσ typσ anΣ namσ (TEST.AA┴á goe≤á beforσ ì
STEST.ASM).
Inputs: HL points to first directory entry
(usually set by DBUFFER)
ááááá BC contains the number of files to sort
(usually set by DIRLOAD or DIRSLOAD)
ááááá ┴ i≤ thσ sor⌠ flag╗ A=░ mean≤ sor⌠ b∙ filσì
ááááá áááááname and then file type, A<>0 means by file
type and nameè
Outputs: None (directory list is sorted)
Registers Affected: PSW
SYSLIB Routines Called: PRINT
Special Error Conditions:
I⌠ i≤ possible¼á alth∩ highl∙ unlikel∙ froφ al∞ test≤á giveε ì
s∩ far¼á tha⌠ DIRALPH┴ ma∙ experiencσ aε interna∞ error« Iµ ì
thi≤ happens¼ thσ message:
ááááá DIRALPHA -- Pointer Error
wil∞ bσ printeΣ anΣ thσ routinσ wil∞ abor⌠ t∩ CP/M.
:Generalized Routines -- DIRF and DIRFS
Routine: DIRF and DIRFS
Function:
Thi≤ routinσ initialize≤ thσ buffe≥ area¼á load≤ ß disδ ì
directory¼á select≤ ß se⌠ oµ file≤ froφ thσ loadeΣ director∙ ì
specifieΣá b∙á thσ user'≤ ambiguou≤ filσ namσ anΣá ßá passeΣ ì
flaτá (whicΦá indicate≤ iµ Systeφ file≤ arσá selected¼á Non-ì
systeφ file≤ arσ selected¼ al∞ use≥ area≤ arσ t∩ bσ covered¼ ì
anΣá wha⌠ particula≥ use≥ areß i≤ t∩ bσ covereΣ iµ al∞á use≥ ì
area≤áá arσá no⌠á selected)¼áá pack≤á thσáá directory¼áá anΣ ì
alphabetize≤ thσ director∙ b∙ filσ namσ anΣ filσ type.
Iµ DIR╞ i≤ used¼á thσ processinτ proceed≤ faste≥á sincσ ì
onl∙á thσ firs⌠ entr∙ oµ eacΦ filσ i≤ loadeΣ int∩ thσ memor∙ ì
buffer«á Filσá sizinτ informatioε i≤ no⌠ includeΣá iεá thi≤ ì
load¼ however.
Iµá DIRF╙ i≤ used¼á thσ processinτ i≤ somewha⌠á slower¼ ì
bu⌠á thσ las⌠ entr∙ fo≥ eacΦ filσ i≤ loadeΣ rathe≥ thaεá thσ ì
first«á Filσ sizinτ informatioε i≤ containeΣ iε thi≤ entry¼ ì
anΣ thi≤ informatioε caε bσ useΣ b∙ thσ FSIZ┼ routine.
Inputs:
H╠ point≤ t∩ ß buffe≥ areß whicΦ extend≤ froφ afte≥ thσ ì
user'≤á codσ anΣ buffe≥ area≤ t∩ thσ enΣ oµ thσ TP┴ (usuall∙ ì
se⌠ by a call to CODEND)
D┼ point≤ t∩ thσ firs⌠ bytσ oµ thσ FC┬ useΣ t∩á specif∙ ì
thσá ambiguou≤á filσ name╗á onl∙ thσ char≤ iε thσ F╬ anΣá F╘ ì
field≤ arσ significant¼á s∩ thi≤ neeΣ no⌠ bσ ß truσ FC┬á anΣ ì
ma∙ bσ a≤ shor⌠ a≤ 12 bytes
A is the selection flag, structured as follows:
Bit 7 - If Set, Select Non-System Files
Bit 6 - If Set, Select System Files
Bit 5 - If Set, Select All User Areas
Bits 4-0 - If Bit 5 is Cleared, contains
number of User Area to Select
Outputs:
H╠á point≤ t∩ thσ firs⌠ filσ entr∙ iε thσ buffer╗á eacΦ ì
filσ entr∙ i≤ 1╢ byte≤ long
BC contains the number of files selected
┴á contain≤ aε erro≥ flag╗á A=░ anΣ Zer∩ Flaτá Se⌠á (Z⌐ ì
indicate≤á TP┴á overflo≈á erro≥á durinτá loaΣá oµá director∙ ì
entries╗ A<>░ anΣ N┌ indicate≤ loaΣ OK
Registers Affected: HL, BC, PSW
SYSLIB Routines Called: DBUFFER, DIRLOAD, DIRSEL, DIRPACK,
DIRALPHA
Special Error Conditions: As outlined above.
:Directory Load Routines -- DIRLOAD and DIRSLOAD
Routine: DIRLOAD and DIRSLOAD
Function:
DIRLOA─á anΣá DIRSLOA─ loaΣ entrie≤ fo≥á al∞á undeleteΣ ì
file≤ oε thσ currentl∙ loggeΣ iε disδ int∩ thσ memor∙ buffe≥ ì
pointeΣ t∩ b∙ HL« Al∞ entrie≤ arσ 1╢ byte≤ long.
DIRLOA─á i≤á faste≥ thaε DIRSLOAD«á I⌠ load≤ jus⌠á thσ ì
firs⌠ entr∙ oµ eacΦ filσ oε disk«á DIRLOAD¼ however¼ shoulΣ ì
bσá useΣ onl∙ iµ filσ sizinτ informatioε i≤ no⌠ requireΣá b∙ ì
thσ application≤ program.
DIRSLOA─á load≤á jus⌠ thσ LAS╘ entr∙ oµá eacΦá filσá oε ì
disk«áá Thi≤á entr∙á contain≤á thσá necessar∙á filσá sizinτ ì
informatioεá whicΦ ma∙ bσ useΣ b∙ FSIZ┼ t∩ computσ thσá sizσ ì
oµ thσ loadeΣ file.
Iµá thσá TP┴ i≤ filleΣ durinτ DIRLOA─ o≥á DIRSLOA─á anΣ ì
therσ arσ stil∞ morσ filσ entrie≤ t∩ load¼á thσ loaΣ wil∞ bσ ì
halteΣá anΣ aε erro≥ returε wil∞ bσ madσ t∩ thσ caller«á Oε ì
return¼á iµá A=░ anΣ thσ Zer∩ Flaτ i≤ Se⌠ (Z)¼á theε ßá loaΣ ì
erro≥ occurred╗ otherwise¼ thσ loaΣ wa≤ OK.
Inputs:
H╠á point≤á t∩ thσ firs⌠ bytσ oµ thσá director∙á buffe≥ ì
area╗á thi≤ areß extend≤ froφ afte≥ thσ las⌠ buffe≥ useΣá b∙ ì
thσá application≤á prograφ t∩ thσ pagσ beforσ thσá CCP«á Iµ ì
alphabetizatioε i≤ t∩ bσ done¼á thσ valuσ returneΣ iε H╠á b∙ ì
DBUFFE╥ i≤ ß correc⌠ inpu⌠ fo≥ DIRLOA─ o≥ DIRSLOAD.
Outputs:
BC is the number of files loaded into the buffer
A=░ anΣ Zer∩ Flaτ i≤ Se⌠ (Z⌐ iµ TP┴ Overflow╗á A<>░ anΣ ì
N┌ iµ loaΣ OK
Registers Affected: BC
SYSLIB Routines Called: None
Special Error Conditions: Iµ TP┴ i≤ filleΣ anΣ loaΣ i≤ ì
incomplete¼ A=░ anΣ Zer∩ Flaτ i≤ Se⌠ (Z⌐ a≤ erro≥ indic
:Directory Pack Routine -- DIRPACK and DIRNPACK
Routine: DIRPACK
Function:
DIRPAC╦á restructure≤á thσ director∙ buffe≥ t∩á contaiε ì
onl∙á thosσ entrie≤ markeΣ b∙ DIRSEL«á Iε thi≤á way¼á thosσ ì
entrie≤á NO╘ markeΣ b∙ DIRSE╠ arσ discardeΣ froφ thσá buffe≥ ì
(actually¼ jus⌠ takeε ou⌠ oµ consideration¼ bu⌠ thσ content≤ ì
oµá thσá buffe≥á afte≥á thσá las⌠á selecteΣá entr∙á i≤áá no⌠ ì
guaranteeΣ t∩ contaiε anythinτ significant).
Thσá Mos⌠á Significan⌠á Bi⌠ oµ thσ firs⌠á bytσá oµá al∞ ì
entrie≤ remaininτ iε thσ director∙ buffe≥ i≤ rese⌠ t∩ ░ a≤ ß ì
sidσ effec⌠ oµ DIRPACK.
Inputs:
H╠á point≤á t∩á thσ director∙ buffe≥á (usuall∙á se⌠á b∙ ì
DBUFFER)
B├ contain≤ thσ numbe≥ oµ file≤ iε thσ buffe≥á (usuall∙ ì
se⌠ b∙ DIRLOA─ o≥ DIRSLOAD)
Outputs:
B├á contain≤á thσá numbe≥ oµ file≤ (thosσá selecteΣá b∙ ì
DIRSEL⌐ remaininτ iε thσ director∙ buffer
Registers Affected: BC
SYSLIB Routines Called: None
Special Error Conditions: None
Routine: DIRNPACK
Function:
DIRNPAC╦á restructure≤ thσ director∙ buffe≥ t∩á contaiε ì
onl∙ thosσ entrie≤ NO╘ markeΣ b∙ DIRSEL« Iε thi≤ way¼ thosσ ì
entrie≤á markeΣá b∙á DIRSE╠ arσ discardeΣá froφá thσá buffe≥ ì
(actually¼ jus⌠ takeε ou⌠ oµ consideration¼ bu⌠ thσ content≤ ì
oµá thσá buffe≥á afte≥á thσá las⌠á selecteΣá entr∙á i≤áá no⌠ ì
guaranteeΣ t∩ contaiε anythinτ significant).
Thσá Mos⌠á Significan⌠á Bi⌠ oµ thσ firs⌠á bytσá oµá al∞ ì
entrie≤ remaininτ iε thσ director∙ buffe≥ i≤ rese⌠ t∩ ░ a≤ ß ì
sidσ effec⌠ oµ DIRNPACK.
Thσá routinσá DIRSE╠ MUS╘ bσ calleΣ beforσ DIRNPAC╦á i≤ ì
useΣ sincσ DIRNPAC╦ use≤ aε interna∞ flaτ se⌠ b∙ DIRSE╠ (fo≥ ì
SYSTE═ anΣ R/╧ information).
Inputs:
H╠á point≤á t∩á thσ director∙ buffe≥á (usuall∙á se⌠á b∙ ì
DBUFFER)
B├ contain≤ thσ numbe≥ oµ file≤ iε thσ buffe≥á (usuall∙ ì
se⌠ b∙ DIRLOAD or DIRSLOAD)
Outputs:
B├ contain≤ thσ numbe≥ oµ file≤ (thosσ NO╘ selecteΣá b∙ ì
DIRSEL⌐ remaininτ iε thσ director∙ buffer
Registers Affected: BC
SYSLIB Routines Called: DIRPACK
Special Error Conditions: None
:Generalized Quick Access Routines -- DIRQ and DIRQS
Routine: DIRQ and DIRQS
Function:
Thesσ routine≤ loaΣ ß disδ directory¼á selectinτ ßá se⌠ ì
oµá file≤ froφ thσ loadeΣ director∙ specifieΣ b∙ thσá user'≤ ì
ambiguou≤á filσá namσ anΣ ß passeΣ flaτ (whicΦ indicate≤á iµ ì
Systeφá o≥ Non-systeφ file≤ arσ selected⌐ a≤á i⌠á goes¼á anΣ ì
alphabetizσ thσ director∙ b∙ filσ namσ anΣ typσ o≥ filσ typσ ì
anΣ namσ (dependinτ oε anothe≥ passeΣ flag).
Iµ DIRQ i≤ used¼á thσ processinτ proceed≤ faste≥á sincσ ì
onl∙á thσ firs⌠ entr∙ oµ eacΦ filσ i≤ loadeΣ int∩ thσ memor∙ ì
buffer«á Filσá sizinτ informatioε i≤ no⌠ includeΣá iεá thi≤ ì
load¼ however.
Iµá DIRQ╙ i≤ used¼á thσ processinτ i≤ somewha⌠á slower¼ ì
bu⌠á thσ las⌠ entr∙ fo≥ eacΦ filσ i≤ loadeΣ rathe≥ thaεá thσ ì
first«á Filσ sizinτ informatioε i≤ containeΣ iε thi≤ entry¼ ì
anΣ thi≤ informatioε caε bσ useΣ b∙ thσ FSIZ┼ routine.
**** IMPORTANT NOTE ****
DIR╤á anΣ DIRQ╙ usσ n∩ othe≥ SYSLI┬ routines¼á however¼ ì
s∩ iµ FSIZ┼ o≥ DFRE┼ arσ t∩ bσ late≥ used¼á aε explici⌠ cal∞ ì
t∩á DPARAM╙á i≤á requireΣ beforσ eithe≥ FSIZ┼á o≥á DFRE┼á i≤ ì
called.
Inputs:
H╠ point≤ t∩ ß buffe≥ areß whicΦ extend≤ froφ afte≥ thσ ì
user'≤á codσ anΣ buffe≥ area≤ t∩ thσ enΣ oµ thσ TP┴ (usuall∙ ì
se⌠ by a call to CODEND)
D┼ point≤ t∩ thσ firs⌠ bytσ oµ thσ FC┬ useΣ t∩á specif∙ ì
thσá ambiguou≤á filσ name╗á onl∙ thσ char≤ iε thσ F╬ anΣá F╘ ì
field≤ arσ significant¼á s∩ thi≤ neeΣ no⌠ bσ ß truσ FC┬á anΣ ì
ma∙ bσ a≤ shor⌠ a≤ 12 bytes
A is the selection flag, structured as follows:
Bit 7 - If Set, Select Non-System Files
Bit 6 - If Set, Select System Files
Bit 5 - If Set(1), Sort by File Type and Name
If Reset(0), Sort by Name and Type
Bits 4-0 - Unused
Outputs:
H╠á point≤ t∩ thσ firs⌠ filσ entr∙ iε thσ buffer╗á eacΦ ì
filσ entr∙ i≤ 1╢ byte≤ long
BC contains the number of files selected
┴á contain≤ aε erro≥ flag╗á A=░ anΣ Zer∩ Flaτá Se⌠á (Z⌐ ì
indicate≤á TP┴á overflo≈á erro≥á durinτá loaΣá oµá director∙ ì
entries╗ A<>░ anΣ N┌ indicate≤ loaΣ OK
Registers Affected: HL, BC, PSW
SYSLIB Routines Called: None
Specia∞á Erro≥á Conditions:á Iµ therσ i≤á aεá interna∞ ì
pointe≥ error¼á DIRQ/DIRQ╙ onl∙ ring≤ thσ bel∞ anΣ abort≤ t∩ ì
the operating system.
:Directory Entry Selection Routine -- DIRSEL
Routine: DIRSEL
Function:
DIRSE╠á select≤á al∞á entrie≤ iε thσá director∙á buffe≥ ì
whicΦ matcΦ thσ ambiguou≤ filσ namσ specifieΣ iε thσ F╬á anΣ ì
F╘á field≤ oµ thσ FC┬ pointeΣ t∩ b∙ D┼ upoε entr∙ t∩ DIRSEL« ì
┴ selectioε flaτ i≤ als∩ passeΣ t∩ DIRSE╠ iε thσ ┴ register¼ ì
anΣá thi≤ flaτ tell≤ DIRSE╠ whethe≥ o≥ no⌠ t∩á includσá Non-ì
Systeφá file≤ anΣ Systeφ file≤ iε thσ selectioε anΣá whethe≥ ì
t∩á selec⌠á file≤ iε al∞ use≥ area≤ o≥ iε ß particula≥á use≥ ì
area.
DIRSE╠ identifie≤ thσ selecteΣ filσ entrie≤ b∙á settinτ ì
thσá Mos⌠ Significan⌠ Bi⌠ oµ thσ firs⌠ bytσ oµ eacΦ oµ thesσ ì
entrie≤á t∩á ▒ iµ thσ entr∙ i≤ selected«á DIRSE╠á make≤á n∩ ì
othe≥ change≤ t∩ thσ filσ entrie≤ iε thσ director∙ buffer.
Inputs:
H╠á point≤á t∩á thσ director∙ buffe≥á (usuall∙á se⌠á b∙ ì
DBUFFER)
D┼ point≤ t∩ thσ FC┬ containinτ thσ ambiguou≤ F╬ anΣ F╘ ì
fields╗ onl∙ thσ firs⌠ 1▓ byte≤ arσ needed
B├á contain≤á thσá numbe≥ oµá file≤á iεá thσá director∙ ì
(usuall∙ se⌠ b∙ DIRLOA─ o≥ DIRSLOAD)
A contains a selection flag, organized as follows:
ááááá Bit 7 - Select Non-System Files
ááááá Bit 6 - Select System Files
ááááá Bit 5 - Select Files in All User Areas
ááááá Bits 4-0 - If Bit 5 is 0, indicates number of
ááááá User Area to select files from
Outputs: None (MSBs of selected entries are set)
Registers Affected: None
SYSLIB Routines Called: None
Special Error Conditions: None
:Disk Parameter Information Extraction Routine -- DPARAMS
Routine: DPARAMS
Function:
Thi≤á routinσá extract≤ necessar∙ informatioε froφá thσ ì
Disδ Paramete≥ Blocδ (DPB⌐ anΣ store≤ i⌠ awa∙ iε somσ globa∞ ì
buffer≤á useΣá b∙á othe≥á Disδá Director∙áá Routines«áá Thσ ì
informatioεá extracteΣá i≤á no⌠ oµ genera∞á concerεá b∙á thσ ì
programmer«á AL╠á TH┼ PROGRAMME╥ NEED╙ T╧ KNO╫ I╙ THA╘ THI╙ ì
ROUTIN┼á MUS╘ B┼ CALLE─ A╘ LEAS╘ ONC┼ BEFOR┼ TH┼ DIRLOA─á O╥ ì
DIRSLOA─á ROUTIN┼á I╙ CALLED«á Iµ thσá DBUFFE╥á routinσá i≤ ì
called¼ theε i⌠ i≤ no⌠ necessar∙ t∩ cal∞ DPARAM╙ again.
Fo≥á thσá informatioεá oµá thσá reader¼á thσá followinτ ì
informatioε i≤ extracted:
á BLKSHF <-- Block Shift Factor (1 Byte)
á BLKMSK <-- Block Mask (1 Byte)
á EXTENT <-- Extent Mask (1 Byte)
á BLKMAX <-- Max Number of Blocks on Disk (2 Bytes)
á DIRMA╪ <-- Ma° Numbe≥ oµ Di≥ Entrie≤ (▓ Bytes)
Thi≤ routinσ automaticall∙ adjust≤ fo≥ version≤ 1.┤ anΣ ì
2.▓ oµ CP/═ anΣ i≤ compatablσ witΦ botΦ version≤ oµ CP/M.
Inputs: None
Outputs: None (Information Extracted into Buffers)
Registers Affected: None
SYSLIB Routines Called: None
Special Error Conditions: None
:File Size Computation Routine -- FSIZE
Routine: FSIZE
Function:
Thi≤á routinσá compute≤ thσ sizσ oµ ß filσ whosσá entr∙ ì
(whicΦá MUS╘á bσ loadeΣ b∙ DIRSLOAD⌐ i≤ pointeΣá t∩á b∙á HL« ì
Thi≤á routinσá wil∞á work¼á bu⌠ generall∙á returεá incorrec⌠ ì
results¼á iµá thσá entr∙ pointeΣ t∩ wa≤á loadeΣá b∙á DIRLOA─ ì
instead.
Thσ routinσ DPARAM╙ (o≥ DBUFFER¼á DIRF¼ o≥ DIRFS¼ sincσ ì
the∙á als∩ cal∞ DPARAMS⌐ mus⌠ bσ calleΣ beforσ thi≤á routinσ ì
i≤á useΣá s∩ tha⌠ thσ correc⌠ disδ paramete≥ informatioεá i≤ ì
loadeΣ fo≥ it.
Inputs:á H╠á point≤á t∩á firs⌠ bytσ oµ filσá entr∙á iε ì
vecto≥á loadeΣ b∙ DIRSLOA─ o≥ DIRF╙ (eacΦ filσ entr∙á i≤á 1╢ ì
byte≤ long)
Outputs: DE contains the file size in K Bytes
Registers Affected: DE
SYSLIB Routines Called: None
Special Error Conditions: None