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
Text File  |  2000-06-30  |  20KB  |  589 lines

  1. Overview
  2. Directory Manipulation Routines
  3. Directory Buffer Structure
  4. How To Use These Routines
  5. DBUFFER          -- Buffer Allocation Routine
  6. DFREE            -- Free Space Computation Routine
  7. DIRALPHA         -- Directory Alphabetization Routine
  8. DIRF/DIRFS       -- Generalized Routines
  9. DIRLOAD/DIRSLOAD -- Directory Load Routines
  10. DIRPACK/DIRNPACK -- Directory Pack Routines
  11. DIRQ/DIRQS       -- Optimal Generalized Routines
  12. DIRSEL           -- Directory Entry Selection Routine
  13. DPARAMS          -- Disk Parameter Information Routine
  14. FSIZE            -- File Size Computation Routine
  15. ::SYSLIB0.HLP
  16. :Directory Manipulation Routines
  17.  
  18.      Thi≤á se⌠á oµ SYSLI┬ routine≤ concern≤ itselµ witΦá thσ ì
  19. loadinτá oµ anΣ acces≤ oµ ß disδ director∙ fo≥á thσá genera∞ ì
  20. purpose≤ oµ thσ user«á  IncludeΣ iε thi≤ se⌠ oµ routine≤ arσ ì
  21. thσ function≤ of:
  22.  
  23.      1.  Preallocation of buffer space for the routines
  24.  
  25.      2«á  Loadinτá oµ al∞ undeleteΣ director∙ entrie≤ int∩ ß ì
  26. buffer¼ constantl∙ checkinτ fo≥ memor∙ overflo≈ a≤ the∙ go
  27.  
  28.      3«  Determininτ thσ amoun⌠ oµ freσ spacσ oε thσ disk
  29.  
  30.      4«  Computinτ thσ sizσ oµ ß filσ iε K
  31.  
  32.  
  33.      5«  Sortinτ ß loadeΣ director∙ b∙ filσ namσ anΣ typσ o≥ ì
  34. b∙ filσ typσ anΣ name
  35.  
  36.      6«á  Selectinτá (b∙ marking⌐ ß se⌠ oµ director∙ entrie≤ ì
  37. whicΦ matcΦ ß giveε ambiguou≤ filσ spec
  38.  
  39.      7«á  Packinτ thσ loadeΣ directory¼á leavinτ iε i⌠á onl∙ ì
  40. thosσ entrie≤ markeΣ b∙ thσ selec⌠ routine
  41.  
  42.  
  43.      Thσá majorit∙ oµ thesσ routine≤ i≤ intendeΣ t∩ bσá useΣ ì
  44. t∩á providσ ß flexiblσ director∙ acces≤ systeφ whicΦ caεá bσ ì
  45. tailoreΣá b∙ thσ use≥ t∩ hi≤ specifiπ needs«á  Fo≥ instance¼ ì
  46. witΦá thσ DIRLOA─ routinσ separateΣ froφ thσá rest¼á severa∞ ì
  47. differen⌠á load≤á oµá thσá director∙á (from¼á fo≥á instance¼ ì
  48. differen⌠ ambiguou≤ filσ specs⌐ caε bσ performed¼á anΣá theε ì
  49. onσá selectioε anΣ onσ sor⌠ oε al∞ filσ spec≤ loadeΣ caεá bσ ì
  50. done.
  51.  
  52.      Thσ DIRQ/DIRQ╙ pai≥ arσ intendeΣ fo≥ thosσ application≤ ì
  53. whicΦá d∩ no⌠ neeΣ thi≤ kinΣ oµ flexibility«á  DIR╤á (quick⌐ ì
  54. anΣá DIRQ╙ (quicδ witΦ sizinτ information⌐ perforφá ßá load¼ ì
  55. select¼á anΣá sor⌠á baseΣá oε onl∙ onσá filσá specification«  ì
  56. Usinτ DIRQ/DIRQ╙ insteaΣ oµ DIRF/DIRF╙ result≤ iε les≤á codσ ì
  57. beinτ generateΣ anΣ (generally⌐ faste≥ execution.
  58.  
  59. :Directory Buffer Structure
  60.  
  61.      DIRLOA─á anΣ DIRSLOA─ arσ useΣ t∩ loaΣ ß director∙ froφ ì
  62. disδá int∩ memory«á  Thσ entrie≤ loadeΣ arσ al∞á non-deleteΣ ì
  63. entrie≤á iε eithe≥ ß particula≥ use≥ areß o≥ al∞ use≥á area≤ ì
  64. on the disk which is currently logged in.
  65.  
  66.      EacΦ filσ entr∙ iε thi≤ buffe≥ i≤ 1╢ byte≤ long¼ anΣ i⌠ ì
  67. is structured as follows:
  68.  
  69.           DB   user           ; user number of file
  70.           DB   'FILENAME'     ; name of file
  71.           DB   'TYP'          ; type of file
  72.           DB   ext            ; extent of file*
  73.           DB   0,0            ; uninteresting - leave alone
  74.           DB   rec            ; record count in this extent
  75.  
  76. ¬á ex⌠á i≤ thσ filσ extent╗á fo≥ DIRLOAD¼á i⌠ i≤á thσá firs⌠ ì
  77. exten⌠á numbe≥ oµ thσ file╗á fo≥ DIRSLOAD¼á i⌠ i≤á thσá las⌠ ì
  78. extent number of the file
  79.  
  80. :How To Use These Routines
  81.  
  82.      Thσá DIR╞á o≥ DIRF╙ routine≤ wil∞ probabl∙ bσá useΣá t∩ ì
  83. perforφ you≥ director∙ acces≤ function≤ thσ vas⌠ majorit∙ oµ ì
  84. thσ time«á  Giveε ß buffer¼á aε ambiguou≤ filσ spec¼á anΣá ß ì
  85. selectioεá flag¼á DIR╞ anΣ DIRF╙ loaΣ thσ desireΣ file≤á fo≥ ì
  86. yo⌡ anΣ theε yo⌡ caε worδ witΦ thσ 16-bytσ filσ entrie≤ froφ ì
  87. there«  ┴ typica∞ callinτ sequencσ fo≥ DIR╞ o≥ DIRF╙ is:
  88.  
  89.           CALL CODEND         ; point to buffer space
  90.           LXI  D,FCB          ; point to FCB of file spec
  91.           MVI  A,1100$0000B   ; select all files in user 0
  92.           CALL DIRF           ; load entries
  93.           JZ   TPAOVFL        ; error condition
  94.           <continue>          ; HL pts to first entry, BC=
  95.                               ;  number of entries
  96. è
  97.      Iµá yo⌡ wisΦ t∩ deviatσ froφ thσ "normaló usσ fo≥á DIR╞ ì
  98. anΣ DIRFS¼á acces≤ t∩ thσ routine≤ useΣ b∙ DIR╞ anΣ DIRF╙ i≤ ì
  99. available«á  ┴ casσ iε whicΦ yo⌡ ma∙ wan⌠ t∩ d∩ thi≤ i≤ wheε ì
  100. yo⌡á arσ interesteΣ iε file≤ whicΦ matcΦ morσ thaε onσá filσ ì
  101. spec¼á sucΦ a≤ *.AS═ anΣ *.TXT«á  ┴ typica∞ callinτ sequencσ ì
  102. for this type of access is:
  103.  
  104. ;  Setup
  105.           CALL CODEND         ; point to buffer space
  106.           CAL╠ DBUFFE╥        ╗ ge⌠ interna∞ inf∩ anΣ ptrs
  107.           CALL DIRLOAD        ; or DIRSLOAD to load entriesì
  108.           JZ   TPAOVFL        ; error condition
  109.  
  110. ;  Select first set of files
  111.           LXI  D,FCB1         ; pt to first FCB to match
  112.           MVI  A,1100$0000B   ; select all files in user 0
  113.           CALL DIRSEL         ; select file entries from
  114.                               ;   buffer
  115.  
  116.  
  117. ;  Repeat the following 2 lines as necessary
  118.           LXI  D,FCB2         ; pt to 2nd FCB to match
  119.           CALL DIRSEL         ; select again
  120.  
  121. ;  Finish up
  122.           CALL DIRPACK        ; pack the file entries,
  123.                               ;   leaving only the valid
  124.                               ;   entries in the buffer
  125.           MVI  A,0            ; alphabetize
  126.           CALL DIRALPHA
  127.  
  128. ╗  Donσ -- H╠ pt≤ t∩ firs⌠ filσ entry¼ BC=numbe≥ oµ entries
  129.  
  130. :Buffer Allocation Routine -- DBUFFER
  131.      Routine: DBUFFER
  132.  
  133.      Function:
  134.  
  135.      Thi≤á routinσ allocate≤ thσ buffe≥ spacσ necessar∙á fo≥ ì
  136. thσ se⌠ oµ director∙ function≤ iε general«á  Iεá particular¼ ì
  137. i⌠á allocate≤á thσ necessar∙ spacσ fo≥á thσá alphabetizatioε ì
  138. functioεá a≤á wel∞á a≤ thσ loadeΣá director∙á itself«á  Thi≤ ì
  139. routinσ mus⌠ bσ useΣ iµ thσ DIRALPH┴ routinσ i≤ t∩ bσá late≥ ì
  140. useΣá t∩ sor⌠ thσ directory╗á thi≤ routinσ allocate≤ al∞ thσ ì
  141. spacσá necessar∙á b∙ DIRALPH┴ t∩ sor⌠ thσá routinσá (pointe≥ ì
  142. space)«á  Iµ thi≤ routinσ i≤ called¼á i⌠ i≤ no⌠ necessar∙ t∩ ì
  143. cal∞ thσ DPARAM╙ routine.
  144.  
  145.  
  146.      Inputs:  HL points to the beginning address of a
  147. ááááá          buffer area which extends to under the CCP
  148.                (usually set by a call to CODEND)
  149.  
  150.      Outputs:  HL points to the first byte at which the
  151. ááááá           directory entries are to be loaded
  152. ááááá          A=0 and Zero Flag is Set (Z) if the CCP is
  153. ááááá           already overrun; else, A<>0 and NZ
  154.  
  155.      Registers Affected:  HL, PSW
  156.  
  157.      SYSLIB Routines Called:  DPARAMS
  158.  
  159.      Special Error Conditions:  As indicated
  160.  
  161. :Free Space Computation Routine -- DFREE
  162.      Routine: DFREE
  163.  
  164.      Function:
  165.  
  166.      Thi≤á routinσ compute≤ thσ amoun⌠ oµ freσ spacσá (iεá ╦ ì
  167. bytes⌐ lef⌠ oε disk.
  168.  
  169.      Thσ routinσ DPARAM╙ (o≥ DBUFFER¼á DIRF¼ o≥ DIRFS¼ sincσ ì
  170. the∙á als∩ cal∞ DPARAMS⌐ mus⌠ bσ calleΣ beforσ thi≤á routinσ ì
  171. i≤á useΣá s∩ tha⌠ thσ correc⌠ disδ paramete≥ informatioεá i≤ ì
  172. loadeΣ fo≥ it.
  173.  
  174.      Inputs:  None
  175.  
  176.      Outputs:  DE = Amount of Free Disk Space in K Bytes
  177.  
  178.      Registers Affected:  DE
  179.  
  180.      SYSLIB Routines Called:  None
  181.  
  182.      Special Error Conditions:  None
  183. :Directory Alphabetization Routine -- DIRALPHA
  184.      Routine: DIRALPHA
  185.  
  186.      Function:
  187.  
  188.      T∩ alphabetizσ thσ file≤ iε thσ director∙ pointeΣ t∩ b∙ ì
  189. H╠á b∙á eithe≥á filσ namσ anΣ typσá (STEST.AS═á goe≤á beforσ ì
  190. TEST.AAA⌐á o≥á b∙ filσ typσ anΣ namσ (TEST.AA┴á goe≤á beforσ ì
  191. STEST.ASM).
  192.  
  193.      Inputs:  HL points to first directory entry
  194.                (usually set by DBUFFER)
  195. ááááá         BC contains the number of files to sort
  196.                (usually set by DIRLOAD or DIRSLOAD)
  197. ááááá         ┴ i≤ thσ sor⌠ flag╗ A=░ mean≤ sor⌠ b∙ filσì
  198. ááááá     áááááname and then file type, A<>0 means by file
  199.                type and nameè
  200.      Outputs:  None (directory list is sorted)
  201.  
  202.  
  203.      Registers Affected:  PSW
  204.  
  205.      SYSLIB Routines Called:  PRINT
  206.  
  207.      Special Error Conditions:
  208.  
  209. I⌠ i≤ possible¼á alth∩ highl∙ unlikel∙ froφ al∞ test≤á giveε ì
  210. s∩ far¼á tha⌠ DIRALPH┴ ma∙ experiencσ aε interna∞ error«  Iµ ì
  211. thi≤ happens¼ thσ message:
  212.  
  213. ááááá          DIRALPHA -- Pointer Error
  214.  
  215. wil∞ bσ printeΣ anΣ thσ routinσ wil∞ abor⌠ t∩ CP/M.
  216.  
  217. :Generalized Routines -- DIRF and DIRFS
  218.      Routine: DIRF and DIRFS
  219.  
  220.      Function:
  221.  
  222.      Thi≤ routinσ initialize≤ thσ buffe≥ area¼á load≤ ß disδ ì
  223. directory¼á select≤ ß se⌠ oµ file≤ froφ thσ loadeΣ director∙ ì
  224. specifieΣá b∙á thσ user'≤ ambiguou≤ filσ namσ anΣá ßá passeΣ ì
  225. flaτá (whicΦá indicate≤ iµ Systeφ file≤ arσá selected¼á Non-ì
  226. systeφ file≤ arσ selected¼ al∞ use≥ area≤ arσ t∩ bσ covered¼ ì
  227. anΣá wha⌠ particula≥ use≥ areß i≤ t∩ bσ covereΣ iµ al∞á use≥ ì
  228. area≤áá arσá no⌠á selected)¼áá pack≤á thσáá directory¼áá anΣ ì
  229. alphabetize≤ thσ director∙ b∙ filσ namσ anΣ filσ type.
  230.  
  231.      Iµ DIR╞ i≤ used¼á thσ processinτ proceed≤ faste≥á sincσ ì
  232. onl∙á thσ firs⌠ entr∙ oµ eacΦ filσ i≤ loadeΣ int∩ thσ memor∙ ì
  233. buffer«á  Filσá sizinτ informatioε i≤ no⌠ includeΣá iεá thi≤ ì
  234. load¼ however.
  235.  
  236.  
  237.      Iµá DIRF╙ i≤ used¼á thσ processinτ i≤ somewha⌠á slower¼ ì
  238. bu⌠á thσ las⌠ entr∙ fo≥ eacΦ filσ i≤ loadeΣ rathe≥ thaεá thσ ì
  239. first«á  Filσ sizinτ informatioε i≤ containeΣ iε thi≤ entry¼ ì
  240. anΣ thi≤ informatioε caε bσ useΣ b∙ thσ FSIZ┼ routine.
  241.  
  242.  
  243.      Inputs:
  244.  
  245.      H╠ point≤ t∩ ß buffe≥ areß whicΦ extend≤ froφ afte≥ thσ ì
  246. user'≤á codσ anΣ buffe≥ area≤ t∩ thσ enΣ oµ thσ TP┴ (usuall∙ ì
  247. se⌠ by a call to CODEND)
  248.  
  249.      D┼ point≤ t∩ thσ firs⌠ bytσ oµ thσ FC┬ useΣ t∩á specif∙ ì
  250. thσá ambiguou≤á filσ name╗á onl∙ thσ char≤ iε thσ F╬ anΣá F╘ ì
  251. field≤ arσ significant¼á s∩ thi≤ neeΣ no⌠ bσ ß truσ FC┬á anΣ ì
  252. ma∙ bσ a≤ shor⌠ a≤ 12 bytes
  253.  
  254.      A is the selection flag, structured as follows:
  255.                Bit 7 - If Set, Select Non-System Files
  256.                Bit 6 - If Set, Select System Files
  257.                Bit 5 - If Set, Select All User Areas
  258.                Bits 4-0 - If Bit 5 is Cleared, contains
  259.                     number of User Area to Select
  260.  
  261.  
  262.      Outputs:
  263.  
  264.      H╠á point≤ t∩ thσ firs⌠ filσ entr∙ iε thσ buffer╗á eacΦ ì
  265. filσ entr∙ i≤ 1╢ byte≤ long
  266.  
  267.      BC contains the number of files selected
  268.  
  269.      ┴á contain≤ aε erro≥ flag╗á A=░ anΣ Zer∩ Flaτá Se⌠á (Z⌐ ì
  270. indicate≤á TP┴á overflo≈á erro≥á durinτá loaΣá oµá director∙ ì
  271. entries╗ A<>░ anΣ N┌ indicate≤ loaΣ OK
  272.  
  273.      Registers Affected:  HL, BC, PSW
  274.  
  275.      SYSLIB Routines Called:  DBUFFER, DIRLOAD, DIRSEL, DIRPACK,
  276.                               DIRALPHA
  277.  
  278.      Special Error Conditions:  As outlined above.
  279.  
  280. :Directory Load Routines -- DIRLOAD and DIRSLOAD
  281.      Routine: DIRLOAD and DIRSLOAD
  282.  
  283.      Function:
  284.  
  285.      DIRLOA─á anΣá DIRSLOA─ loaΣ entrie≤ fo≥á al∞á undeleteΣ ì
  286. file≤ oε thσ currentl∙ loggeΣ iε disδ int∩ thσ memor∙ buffe≥ ì
  287. pointeΣ t∩ b∙ HL«  Al∞ entrie≤ arσ 1╢ byte≤ long.
  288.  
  289.      DIRLOA─á i≤á faste≥ thaε DIRSLOAD«á  I⌠ load≤ jus⌠á thσ ì
  290. firs⌠ entr∙ oµ eacΦ filσ oε disk«á  DIRLOAD¼ however¼ shoulΣ ì
  291. bσá useΣ onl∙ iµ filσ sizinτ informatioε i≤ no⌠ requireΣá b∙ ì
  292. thσ application≤ program.
  293.  
  294.      DIRSLOA─á load≤á jus⌠ thσ LAS╘ entr∙ oµá eacΦá filσá oε ì
  295. disk«áá  Thi≤á entr∙á contain≤á thσá necessar∙á filσá sizinτ ì
  296. informatioεá whicΦ ma∙ bσ useΣ b∙ FSIZ┼ t∩ computσ thσá sizσ ì
  297. oµ thσ loadeΣ file.
  298.  
  299.  
  300.      Iµá thσá TP┴ i≤ filleΣ durinτ DIRLOA─ o≥á DIRSLOA─á anΣ ì
  301. therσ arσ stil∞ morσ filσ entrie≤ t∩ load¼á thσ loaΣ wil∞ bσ ì
  302. halteΣá anΣ aε erro≥ returε wil∞ bσ madσ t∩ thσ caller«á  Oε ì
  303. return¼á iµá A=░ anΣ thσ Zer∩ Flaτ i≤ Se⌠ (Z)¼á theε ßá loaΣ ì
  304. erro≥ occurred╗ otherwise¼ thσ loaΣ wa≤ OK.
  305.  
  306.      Inputs:
  307.  
  308.      H╠á point≤á t∩ thσ firs⌠ bytσ oµ thσá director∙á buffe≥ ì
  309. area╗á thi≤ areß extend≤ froφ afte≥ thσ las⌠ buffe≥ useΣá b∙ ì
  310. thσá application≤á prograφ t∩ thσ pagσ beforσ thσá CCP«á  Iµ ì
  311. alphabetizatioε i≤ t∩ bσ done¼á thσ valuσ returneΣ iε H╠á b∙ ì
  312. DBUFFE╥ i≤ ß correc⌠ inpu⌠ fo≥ DIRLOA─ o≥ DIRSLOAD.
  313.  
  314.  
  315.      Outputs:
  316.  
  317.      BC is the number of files loaded into the buffer
  318.  
  319.      A=░ anΣ Zer∩ Flaτ i≤ Se⌠ (Z⌐ iµ TP┴ Overflow╗á A<>░ anΣ ì
  320. N┌ iµ loaΣ OK
  321.  
  322.      Registers Affected:  BC
  323.  
  324.      SYSLIB Routines Called:  None
  325.  
  326.      Special Error Conditions:  Iµ TP┴ i≤ filleΣ anΣ loaΣ i≤ ì
  327. incomplete¼ A=░ anΣ Zer∩ Flaτ i≤ Se⌠ (Z⌐ a≤ erro≥ indic
  328.  
  329. :Directory Pack Routine -- DIRPACK and DIRNPACK
  330.  
  331.      Routine:  DIRPACK
  332.  
  333.      Function:
  334.  
  335.      DIRPAC╦á restructure≤á thσ director∙ buffe≥ t∩á contaiε ì
  336. onl∙á thosσ entrie≤ markeΣ b∙ DIRSEL«á  Iε thi≤á way¼á thosσ ì
  337. entrie≤á NO╘ markeΣ b∙ DIRSE╠ arσ discardeΣ froφ thσá buffe≥ ì
  338. (actually¼ jus⌠ takeε ou⌠ oµ consideration¼ bu⌠ thσ content≤ ì
  339. oµá thσá buffe≥á afte≥á thσá las⌠á selecteΣá entr∙á i≤áá no⌠ ì
  340. guaranteeΣ t∩ contaiε anythinτ significant).
  341.  
  342.      Thσá Mos⌠á Significan⌠á Bi⌠ oµ thσ firs⌠á bytσá oµá al∞ ì
  343. entrie≤ remaininτ iε thσ director∙ buffe≥ i≤ rese⌠ t∩ ░ a≤ ß ì
  344. sidσ effec⌠ oµ DIRPACK.
  345.  
  346.  
  347.      Inputs:
  348.  
  349.      H╠á point≤á t∩á thσ director∙ buffe≥á (usuall∙á se⌠á b∙ ì
  350. DBUFFER)
  351.      B├ contain≤ thσ numbe≥ oµ file≤ iε thσ buffe≥á (usuall∙ ì
  352. se⌠ b∙ DIRLOA─ o≥ DIRSLOAD)
  353.  
  354.  
  355.      Outputs:
  356.  
  357.      B├á contain≤á thσá numbe≥ oµ file≤ (thosσá selecteΣá b∙ ì
  358. DIRSEL⌐ remaininτ iε thσ director∙ buffer
  359.  
  360.      Registers Affected:  BC
  361.  
  362.      SYSLIB Routines Called:  None
  363.  
  364.      Special Error Conditions:  None
  365.      Routine:  DIRNPACK
  366.  
  367.      Function:
  368.  
  369.      DIRNPAC╦á restructure≤ thσ director∙ buffe≥ t∩á contaiε ì
  370. onl∙ thosσ entrie≤ NO╘ markeΣ b∙ DIRSEL«  Iε thi≤ way¼ thosσ ì
  371. entrie≤á markeΣá b∙á DIRSE╠ arσ discardeΣá froφá thσá buffe≥ ì
  372. (actually¼ jus⌠ takeε ou⌠ oµ consideration¼ bu⌠ thσ content≤ ì
  373. oµá thσá buffe≥á afte≥á thσá las⌠á selecteΣá entr∙á i≤áá no⌠ ì
  374. guaranteeΣ t∩ contaiε anythinτ significant).
  375.  
  376.      Thσá Mos⌠á Significan⌠á Bi⌠ oµ thσ firs⌠á bytσá oµá al∞ ì
  377. entrie≤ remaininτ iε thσ director∙ buffe≥ i≤ rese⌠ t∩ ░ a≤ ß ì
  378. sidσ effec⌠ oµ DIRNPACK.
  379.  
  380.      Thσá routinσá DIRSE╠ MUS╘ bσ calleΣ beforσ DIRNPAC╦á i≤ ì
  381. useΣ sincσ DIRNPAC╦ use≤ aε interna∞ flaτ se⌠ b∙ DIRSE╠ (fo≥ ì
  382. SYSTE═ anΣ R/╧ information).
  383.  
  384.  
  385.      Inputs:
  386.  
  387.      H╠á point≤á t∩á thσ director∙ buffe≥á (usuall∙á se⌠á b∙ ì
  388. DBUFFER)
  389.      B├ contain≤ thσ numbe≥ oµ file≤ iε thσ buffe≥á (usuall∙ ì
  390. se⌠ b∙ DIRLOAD or DIRSLOAD)
  391.  
  392.  
  393.      Outputs:
  394.  
  395.      B├ contain≤ thσ numbe≥ oµ file≤ (thosσ NO╘ selecteΣá b∙ ì
  396. DIRSEL⌐ remaininτ iε thσ director∙ buffer
  397.  
  398.      Registers Affected:  BC
  399.  
  400.      SYSLIB Routines Called:  DIRPACK
  401.  
  402.      Special Error Conditions:  None
  403.  
  404. :Generalized Quick Access Routines -- DIRQ and DIRQS
  405.      Routine: DIRQ and DIRQS
  406.  
  407.      Function:
  408.  
  409.      Thesσ routine≤ loaΣ ß disδ directory¼á selectinτ ßá se⌠ ì
  410. oµá file≤ froφ thσ loadeΣ director∙ specifieΣ b∙ thσá user'≤ ì
  411. ambiguou≤á filσá namσ anΣ ß passeΣ flaτ (whicΦ indicate≤á iµ ì
  412. Systeφá o≥ Non-systeφ file≤ arσ selected⌐ a≤á i⌠á goes¼á anΣ ì
  413. alphabetizσ thσ director∙ b∙ filσ namσ anΣ typσ o≥ filσ typσ ì
  414. anΣ namσ (dependinτ oε anothe≥ passeΣ flag).
  415.  
  416.      Iµ DIRQ i≤ used¼á thσ processinτ proceed≤ faste≥á sincσ ì
  417. onl∙á thσ firs⌠ entr∙ oµ eacΦ filσ i≤ loadeΣ int∩ thσ memor∙ ì
  418. buffer«á  Filσá sizinτ informatioε i≤ no⌠ includeΣá iεá thi≤ ì
  419. load¼ however.
  420.  
  421.  
  422.      Iµá DIRQ╙ i≤ used¼á thσ processinτ i≤ somewha⌠á slower¼ ì
  423. bu⌠á thσ las⌠ entr∙ fo≥ eacΦ filσ i≤ loadeΣ rathe≥ thaεá thσ ì
  424. first«á  Filσ sizinτ informatioε i≤ containeΣ iε thi≤ entry¼ ì
  425. anΣ thi≤ informatioε caε bσ useΣ b∙ thσ FSIZ┼ routine.
  426.  
  427.  
  428. **** IMPORTANT NOTE ****
  429.  
  430.      DIR╤á anΣ DIRQ╙ usσ n∩ othe≥ SYSLI┬ routines¼á however¼ ì
  431. s∩ iµ FSIZ┼ o≥ DFRE┼ arσ t∩ bσ late≥ used¼á aε explici⌠ cal∞ ì
  432. t∩á DPARAM╙á i≤á requireΣ beforσ eithe≥ FSIZ┼á o≥á DFRE┼á i≤ ì
  433. called.
  434.  
  435.  
  436.  
  437.      Inputs:
  438.  
  439.      H╠ point≤ t∩ ß buffe≥ areß whicΦ extend≤ froφ afte≥ thσ ì
  440. user'≤á codσ anΣ buffe≥ area≤ t∩ thσ enΣ oµ thσ TP┴ (usuall∙ ì
  441. se⌠ by a call to CODEND)
  442.  
  443.      D┼ point≤ t∩ thσ firs⌠ bytσ oµ thσ FC┬ useΣ t∩á specif∙ ì
  444. thσá ambiguou≤á filσ name╗á onl∙ thσ char≤ iε thσ F╬ anΣá F╘ ì
  445. field≤ arσ significant¼á s∩ thi≤ neeΣ no⌠ bσ ß truσ FC┬á anΣ ì
  446. ma∙ bσ a≤ shor⌠ a≤ 12 bytes
  447.  
  448.      A is the selection flag, structured as follows:
  449.                Bit 7 - If Set, Select Non-System Files
  450.                Bit 6 - If Set, Select System Files
  451.                Bit 5 - If Set(1), Sort by File Type and Name
  452.                          If Reset(0), Sort by Name and Type
  453.                Bits 4-0 - Unused
  454.  
  455.  
  456.      Outputs:
  457.  
  458.      H╠á point≤ t∩ thσ firs⌠ filσ entr∙ iε thσ buffer╗á eacΦ ì
  459. filσ entr∙ i≤ 1╢ byte≤ long
  460.  
  461.      BC contains the number of files selected
  462.  
  463.      ┴á contain≤ aε erro≥ flag╗á A=░ anΣ Zer∩ Flaτá Se⌠á (Z⌐ ì
  464. indicate≤á TP┴á overflo≈á erro≥á durinτá loaΣá oµá director∙ ì
  465. entries╗ A<>░ anΣ N┌ indicate≤ loaΣ OK
  466.  
  467.      Registers Affected:  HL, BC, PSW
  468.  
  469.      SYSLIB Routines Called:  None
  470.  
  471.      Specia∞á Erro≥á Conditions:á  Iµ therσ i≤á aεá interna∞ ì
  472. pointe≥ error¼á DIRQ/DIRQ╙ onl∙ ring≤ thσ bel∞ anΣ abort≤ t∩ ì
  473. the operating system.
  474.  
  475. :Directory Entry Selection Routine -- DIRSEL
  476.      Routine: DIRSEL
  477.  
  478.      Function:
  479.  
  480.      DIRSE╠á select≤á al∞á entrie≤ iε thσá director∙á buffe≥ ì
  481. whicΦ matcΦ thσ ambiguou≤ filσ namσ specifieΣ iε thσ F╬á anΣ ì
  482. F╘á field≤ oµ thσ FC┬ pointeΣ t∩ b∙ D┼ upoε entr∙ t∩ DIRSEL«  ì
  483. ┴ selectioε flaτ i≤ als∩ passeΣ t∩ DIRSE╠ iε thσ ┴ register¼ ì
  484. anΣá thi≤ flaτ tell≤ DIRSE╠ whethe≥ o≥ no⌠ t∩á includσá Non-ì
  485. Systeφá file≤ anΣ Systeφ file≤ iε thσ selectioε anΣá whethe≥ ì
  486. t∩á selec⌠á file≤ iε al∞ use≥ area≤ o≥ iε ß particula≥á use≥ ì
  487. area.
  488.  
  489.      DIRSE╠ identifie≤ thσ selecteΣ filσ entrie≤ b∙á settinτ ì
  490. thσá Mos⌠ Significan⌠ Bi⌠ oµ thσ firs⌠ bytσ oµ eacΦ oµ thesσ ì
  491. entrie≤á t∩á ▒ iµ thσ entr∙ i≤ selected«á  DIRSE╠á make≤á n∩ ì
  492. othe≥ change≤ t∩ thσ filσ entrie≤ iε thσ director∙ buffer.
  493.  
  494.      Inputs:
  495.  
  496.      H╠á point≤á t∩á thσ director∙ buffe≥á (usuall∙á se⌠á b∙ ì
  497. DBUFFER)
  498.  
  499.      D┼ point≤ t∩ thσ FC┬ containinτ thσ ambiguou≤ F╬ anΣ F╘ ì
  500. fields╗ onl∙ thσ firs⌠ 1▓ byte≤ arσ needed
  501.  
  502.      B├á contain≤á thσá numbe≥ oµá file≤á iεá thσá director∙ ì
  503. (usuall∙ se⌠ b∙ DIRLOA─ o≥ DIRSLOAD)
  504.  
  505.      A contains a selection flag, organized as follows:
  506. ááááá          Bit 7 - Select Non-System Files
  507. ááááá          Bit 6 - Select System Files
  508. ááááá          Bit 5 - Select Files in All User Areas
  509. ááááá          Bits 4-0 - If Bit 5 is 0, indicates number of
  510. ááááá               User Area to select files from
  511.  
  512.  
  513.      Outputs:  None (MSBs of selected entries are set)
  514.  
  515.      Registers Affected:  None
  516.  
  517.      SYSLIB Routines Called:  None
  518.  
  519.      Special Error Conditions:  None
  520.  
  521. :Disk Parameter Information Extraction Routine -- DPARAMS
  522.      Routine:  DPARAMS
  523.  
  524.      Function:
  525.  
  526.      Thi≤á routinσá extract≤ necessar∙ informatioε froφá thσ ì
  527. Disδ Paramete≥ Blocδ (DPB⌐ anΣ store≤ i⌠ awa∙ iε somσ globa∞ ì
  528. buffer≤á useΣá b∙á othe≥á Disδá Director∙áá Routines«áá  Thσ ì
  529. informatioεá extracteΣá i≤á no⌠ oµ genera∞á concerεá b∙á thσ ì
  530. programmer«á  AL╠á TH┼ PROGRAMME╥ NEED╙ T╧ KNO╫ I╙ THA╘ THI╙ ì
  531. ROUTIN┼á MUS╘ B┼ CALLE─ A╘ LEAS╘ ONC┼ BEFOR┼ TH┼ DIRLOA─á O╥ ì
  532. DIRSLOA─á ROUTIN┼á I╙ CALLED«á  Iµ thσá DBUFFE╥á routinσá i≤ ì
  533. called¼ theε i⌠ i≤ no⌠ necessar∙ t∩ cal∞ DPARAM╙ again.
  534.  
  535.  
  536.      Fo≥á thσá informatioεá oµá thσá reader¼á thσá followinτ ì
  537. informatioε i≤ extracted:
  538.  
  539. á          BLKSHF <-- Block Shift Factor (1 Byte)
  540. á          BLKMSK <-- Block Mask (1 Byte)
  541. á          EXTENT <-- Extent Mask (1 Byte)
  542. á          BLKMAX <-- Max Number of Blocks on Disk (2 Bytes)
  543. á          DIRMA╪ <-- Ma° Numbe≥ oµ Di≥ Entrie≤ (▓ Bytes)
  544.  
  545.  
  546.      Thi≤ routinσ automaticall∙ adjust≤ fo≥ version≤ 1.┤ anΣ ì
  547. 2.▓ oµ CP/═ anΣ i≤ compatablσ witΦ botΦ version≤ oµ CP/M.
  548.  
  549.  
  550.      Inputs:  None
  551.  
  552.      Outputs:  None (Information Extracted into Buffers)
  553.  
  554.      Registers Affected:  None
  555.  
  556.      SYSLIB Routines Called:  None
  557.  
  558.      Special Error Conditions:  None
  559.  
  560. :File Size Computation Routine -- FSIZE
  561.      Routine: FSIZE
  562.  
  563.      Function:
  564.  
  565.      Thi≤á routinσá compute≤ thσ sizσ oµ ß filσ whosσá entr∙ ì
  566. (whicΦá MUS╘á bσ loadeΣ b∙ DIRSLOAD⌐ i≤ pointeΣá t∩á b∙á HL«  ì
  567. Thi≤á routinσá wil∞á work¼á bu⌠ generall∙á returεá incorrec⌠ ì
  568. results¼á iµá thσá entr∙ pointeΣ t∩ wa≤á loadeΣá b∙á DIRLOA─ ì
  569. instead.
  570.  
  571.      Thσ routinσ DPARAM╙ (o≥ DBUFFER¼á DIRF¼ o≥ DIRFS¼ sincσ ì
  572. the∙á als∩ cal∞ DPARAMS⌐ mus⌠ bσ calleΣ beforσ thi≤á routinσ ì
  573. i≤á useΣá s∩ tha⌠ thσ correc⌠ disδ paramete≥ informatioεá i≤ ì
  574. loadeΣ fo≥ it.
  575.  
  576.  
  577.      Inputs:á  H╠á point≤á t∩á firs⌠ bytσ oµ filσá entr∙á iε ì
  578. vecto≥á loadeΣ b∙ DIRSLOA─ o≥ DIRF╙ (eacΦ filσ entr∙á i≤á 1╢ ì
  579. byte≤ long)
  580.  
  581.      Outputs:  DE contains the file size in K Bytes
  582.  
  583.      Registers Affected:  DE
  584.  
  585.      SYSLIB Routines Called:  None
  586.  
  587.      Special Error Conditions:  None
  588.  
  589.