home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / Fortran.51 / DISK5 / UNIT.AS$ / UNIT.bin
Text File  |  1991-02-01  |  5KB  |  144 lines

  1.     page    ,132
  2.     title    unit - unit management table
  3. ;***
  4. ;unit.asm - unit management table for FORTRAN
  5. ;
  6. ;    Copyright (c) 1989-91, Microsoft Corporation.  All rights reserved.
  7. ;
  8. ;Purpose:
  9. ;    Declare the FORTRAN unit list data structure.
  10. ;
  11. ;    Increasing the maximum number of open files:
  12. ;    --------------------------------------------
  13. ;    FORTRAN allows you to increase the maximum number of open files
  14. ;    (the default is 20). To use this feature, you MUST be running OS2 or
  15. ;    DOS 3.3 (or later).  Use the following procedure to increase the 
  16. ;    maximum number of open files for a non-Multithread, non-Dynamic Link 
  17. ;    application     (see note 5 below for Multithread or Dynamic Link 
  18. ;    applications) :
  19. ;
  20. ;        1. Increasing file handles: To increase the number of file 
  21. ;           handles, edit the startup source file CRT0DAT.ASM, which 
  22. ;           is provided in this release. Change the line
  23. ;
  24. ;                _NFILE_ = 20
  25. ;
  26. ;           so that _NFILE_ is set to the desired maximum (limit 256).
  27. ;           For example, to set the maximum number of file handles to 40,
  28. ;           change the line as shown here:
  29. ;
  30. ;                _NFILE_ = 40        
  31. ;            
  32. ;        2. Increasing units: Next, you must increase the size of the 
  33. ;           table which FORTRAN uses to manage units. To increase the 
  34. ;           size of the table, edit this source file (UNIT.ASM). Change 
  35. ;           the line
  36. ;    
  37. ;                _NFILE_ = 20
  38. ;
  39. ;           so that _NFILE_ is set to the same value you chose in 
  40. ;           CRT0DAT.ASM. Note that the number of handles must be greater
  41. ;           than or equal to the number of units. Thus if you increase 
  42. ;           the number of units in this file, you must also increase the
  43. ;           value of _NFILE_ in CRT0DAT.ASM.
  44. ;
  45. ;        3. Increasing the System Limit: To use more than 20 files at 
  46. ;           a time, you must increase the file limit imposed on your 
  47. ;           process by the operating system.
  48. ;
  49. ;            A. Increasing the System-Wide Limit: Increase the 
  50. ;               number of files available on your system as a whole 
  51. ;               by editing your system configuration file (for 
  52. ;               instance, CONFIG.SYS). For example, to allow 100 
  53. ;               files open at a time on your system, put this
  54. ;               statement in your configuration file:
  55. ;
  56. ;                    FILES=100
  57. ;
  58. ;            B. Increase the Per Process Limit: You must also 
  59. ;               increase the number of files that the operating 
  60. ;               system makes available to your particular process. 
  61. ;               To do this, edit CRT0DAT.ASM and enable the 
  62. ;               commented-out code that is preceded by the 
  63. ;               appropriate description.
  64. ;    
  65. ;               In the DOS version of CRT0DAT.ASM, for example, 
  66. ;               the commented-out code appears as shown here:
  67. ;
  68. ;                    ;    mov    ah,67H
  69. ;                    ;    mov bx,_NFILE_
  70. ;                    ;    callos
  71. ;
  72. ;               In the OS/2 version of CRT0DAT.ASM, the code appears
  73. ;               as a call to DOSSETMAXFH. Under OS/2, you must also 
  74. ;               enable the 'extrn DOSSETMAXFH:far' declaration that 
  75. ;               appears near the beginning of the file.    
  76. ;
  77. ;               In either case, remove the ';' comment characters.    
  78. ;
  79. ;        4. Using the Modified Startup Files: After you modify 
  80. ;           CRT0DAT.ASM and UNIT.ASM, assemble the files. 
  81. ;
  82. ;           To use the new objects, either explicitly link your program 
  83. ;           with the new CRT0DAT.OBJ and UNIT.OBJ files, or replace the 
  84. ;           CRT0DAT.OBJ and UNIT.OBJ objects in the appropriate model of
  85. ;           the FORTRAN runtime library.    
  86. ;
  87. ;        5. For Multithread and Dynamic Link applications: The default 
  88. ;           number of files which can be opened when linking using the 
  89. ;           Multithread or Dynamic Link Libraries is 40. To increase 
  90. ;           this default, you need only edit the UNIT.ASM file and set 
  91. ;           the _NFILE_ constant defined between the "else" and "endif" 
  92. ;           to the desired number of files, as described in Step 2, 
  93. ;           above. When assembling UNIT.ASM, be sure to define MTHREAD 
  94. ;           on the command line to get the correct definition:
  95. ;            
  96. ;                masm -DMTHREAD unit.asm     
  97. ;
  98. ;           Editing CRT0DAT.ASM is not required. Instead, the user must 
  99. ;           make an explicit call to DOSSETMAXFH in his user code. The 
  100. ;           form of this call is shown in the commented-out sections of 
  101. ;           code in the OS2 version of CRT0DAT.ASM. The user must also 
  102. ;           increase the System-Wide Limit as described in Step 3A, 
  103. ;           above.
  104. ;
  105. ;***
  106.  
  107. ifndef    MTHREAD
  108. _NFILE_        equ 20; change this to the desired number of units
  109.                 ; NOTE: must be =< _NFILE_ in crt0dat.asm !!!
  110. else
  111. _NFILE_        equ 40        ; change this to the desired number of units
  112. endif
  113.  
  114.  
  115.  
  116. AVAILABLE    equ 8000H    ; marks slot in unit list as unused
  117. MAXUNITS    equ _NFILE_+1    ; reserve extra slot for TERMINAL FCB
  118.  
  119. UENTRY    STRUC
  120. unun    DW    AVAILABLE    ; unit number
  121. pfcb    DW    0        ; near pointer to FCB
  122. UENTRY    ENDS
  123.  
  124. _DATA    SEGMENT    WORD PUBLIC 'DATA'
  125. _DATA    ENDS
  126. CONST    SEGMENT    WORD PUBLIC 'CONST'
  127. CONST    ENDS
  128. _BSS    SEGMENT    WORD PUBLIC 'BSS'
  129. _BSS    ENDS
  130. DGROUP    GROUP    CONST, _BSS, _DATA
  131.  
  132. PUBLIC    __FFmaxunits        ; runtime limit
  133. PUBLIC    __FFunit_lst
  134.  
  135. _DATA SEGMENT
  136.     ASSUME  DS:DGROUP
  137.  
  138. __FFmaxunits    DW    MAXUNITS    
  139. __FFunit_lst    UENTRY MAXUNITS DUP (<>)
  140.  
  141. _DATA ENDS
  142.  
  143. END
  144.