Microsoft KB Archive/69793

From BetaArchive Wiki

Explanation of .R and .S Fields of Pascal Address Types PSS ID Number: Q69793 Article last modified on 03-07-1991 PSS database name: S_PasCal

3.20 3.30 3.31 3.32 4.00 | 4.00

MS-DOS | OS/2

Summary:

The address data types, ADR and ADS, of the Microsoft Pascal Compiler are an alternative to using the pointer data type. Pointers, along with their associated memory-management functions NEW and DISPOSE, are limited to accessing the default data segment. If you want to allocate data on the far (or long) heap, you must use the address data types. For an example of using the address data types to perform dynamic memory management on the far heap, please query on the following words:

Pascal and example and allocating and far and heap and memory and allmqq and .R and .S

The ADR and ADS data types correspond to near and far pointers, respectively. The ADR data type, or “relative” address type, corresponds to a near pointer. The ADR type has a .R field, which represents the “relative” or offset address in the default data segment.

The ADS type, or “segmented” address type, corresponds to a far pointer. The ADS data type has both .R and .S fields. The .S field is the segment address, while the .R field is the relative offset within that segment.

For more information on the address data types, see the “Microsoft Pascal 4.0: Reference Manual” pages 104-110. This information applies to Microsoft Pascal Compiler versions 3.20, 3.30, 3.31, and 3.32 for MS-DOS, and to Microsoft Pascal Compiler version 4.00 for MS-DOS and MS OS/2.

Copyright Microsoft Corporation 1991.