home *** CD-ROM | disk | FTP | other *** search
- The following information is presented for advanced users of Turbo Pascal
- under MS-DOS or PC-DOS.
-
- Turbo Pascal version 3 uses MS-DOS file handles to open files. Function
- call 2DH is used. One of the parameters to this call is the 'open mode',
- which tells DOS information about how you intend to access the file and what
- access to give to other processes (in a networking or future multitasking
- environment). Turbo normally uses an open mode byte of 2, which means
- Compatability Mode with Read/Write Access and Inheritance by child processes.
- By changing the value of this byte to 0, you may open Read-only files. There
- may also be other applications for this, especially in a network.
-
- The open mode byte for overlays, Chain, and Execute is normally 0,
- Compatability Mode with Read Access. The addresses for these mode bytes is
- not given but can be found by searching the runtime library for the bytes 00
- 3D. The first occurrence is the one used for overlays, and the second is used
- for Chain and Execute.
-
- Open mode byte for Reset & Rewrite for Turbo 3.00x (PC-DOS):
- TURBO.COM CSEG:$248D
- TURBO-87.COM CSEG:$1F3C
- TURBOBCD.COM CSEG:$2393
-
- Open mode byte for Reset & Rewrite for Turbo 3.00x (MS-DOS):
- TURBO.COM CSEG:$2182
- TURBO-87.COM CSEG:$1C31
- TURBOBCD.COM CSEG:$2088
-
- Open mode byte for Reset & Rewrite for Turbo 3.01x (PC-DOS):
- TURBO.COM CSEG:$24FC
- TURBO-87.COM CSEG:$1FAB
- TURBOBCD.COM CSEG:$2402
-
- Open mode byte for Reset & Rewrite for Turbo 3.01x (MS-DOS):
- TURBO.COM CSEG:$21D4
- TURBO-87.COM CSEG:$1C83
- TURBOBCD.COM CSEG:$20DA
-
- The best way to use this information is to create an absolute variable
- pointing to the byte:
-
- Var OpenModeByte: Byte Absolute CSeg:$248D; { For TURBO.COM PC-DOS }
-
- Be sure that the version of the compiler that you are using matches the ones
- listed here (PC or MS-DOS version 3.00x or 3.01x. Addresses should not
- change for changes in the version letter, since they are patches rather than
- re-assemblies). For additional safety, check that the value of the byte is
- actually 2 before changing it. And remember to change it back to 2 if you
- intend to do normal file opens intermixed with opens of Read-only or shared
- files.
-
- - Bela Lubkin