home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol293 / turbpc1.lbr / ACMODE.DOC next >
Encoding:
Text File  |  1986-12-17  |  2.4 KB  |  53 lines

  1.   The following information is presented for advanced users of Turbo Pascal
  2. under MS-DOS or PC-DOS.
  3.  
  4.   Turbo Pascal version 3 uses MS-DOS file handles to open files.  Function
  5. call 2DH is used.  One of the parameters to this call is the 'open mode',
  6. which tells DOS information about how you intend to access the file and what
  7. access to give to other processes (in a networking or future multitasking
  8. environment).  Turbo normally uses an open mode byte of 2, which means
  9. Compatability Mode with Read/Write Access and Inheritance by child processes.
  10. By changing the value of this byte to 0, you may open Read-only files.  There
  11. may also be other applications for this, especially in a network.
  12.  
  13.   The open mode byte for overlays, Chain, and Execute is normally 0,
  14. Compatability Mode with Read Access.  The addresses for these mode bytes is
  15. not given but can be found by searching the runtime library for the bytes 00
  16. 3D.  The first occurrence is the one used for overlays, and the second is used
  17. for Chain and Execute.
  18.  
  19.   Open mode byte for Reset & Rewrite for Turbo 3.00x (PC-DOS):
  20.     TURBO.COM    CSEG:$248D
  21.     TURBO-87.COM CSEG:$1F3C
  22.     TURBOBCD.COM CSEG:$2393
  23.  
  24.   Open mode byte for Reset & Rewrite for Turbo 3.00x (MS-DOS):
  25.     TURBO.COM    CSEG:$2182
  26.     TURBO-87.COM CSEG:$1C31
  27.     TURBOBCD.COM CSEG:$2088
  28.  
  29.   Open mode byte for Reset & Rewrite for Turbo 3.01x (PC-DOS):
  30.     TURBO.COM    CSEG:$24FC
  31.     TURBO-87.COM CSEG:$1FAB
  32.     TURBOBCD.COM CSEG:$2402
  33.  
  34.   Open mode byte for Reset & Rewrite for Turbo 3.01x (MS-DOS):
  35.     TURBO.COM    CSEG:$21D4
  36.     TURBO-87.COM CSEG:$1C83
  37.     TURBOBCD.COM CSEG:$20DA
  38.  
  39.   The best way to use this information is to create an absolute variable
  40. pointing to the byte:
  41.  
  42.   Var OpenModeByte: Byte Absolute CSeg:$248D;    { For TURBO.COM PC-DOS }
  43.  
  44.   Be sure that the version of the compiler that you are using matches the ones
  45. listed here (PC or MS-DOS version 3.00x or 3.01x.  Addresses should not
  46. change for changes in the version letter, since they are patches rather than
  47. re-assemblies).  For additional safety, check that the value of the byte is
  48. actually 2 before changing it.  And remember to change it back to 2 if you
  49. intend to do normal file opens intermixed with opens of Read-only or shared
  50. files.
  51.  
  52.   -  Bela Lubkin
  53.