Assembly Language Help (alang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Definition of Qualified Type
                                             Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
     See also: TYPEDEF, PTR, Distance
 
     A qualified type can be any MASM type (such as structure types,
     union types, record types, or an intrinsic type), or it can have the
     form
 
         [distance] PTR [qualifiedtype]
 
     where distance can be any distance (such as NEAR, FAR, or PROC).
     See: distance
 
     A qualified type can also be any type previously defined with TYPEDEF.
     For example, if you use TYPEDEF to create an alias for BYTE, as shown
     below, you can use that CHAR type as a qualified type when defining
     the pointer type PCHAR.
 
         CHAR    TYPEDEF BYTE
         PCHAR   TYPEDEF PTR CHAR
 
     Since distance and qualifiedtype are optional syntax elements, you can
     use variables of type PTR or FAR PTR.
 
     Several rules govern the use of a qualified type:
 
       1. The only component of a qualified type definition that can be
          forward-referenced is a structure or union type identifier.
 
       2. If distance is not specified, the right operand and current
          memory model determine the type of the pointer. If the
          operand following PTR is not a distance or a function
          prototype, the operand is a pointer of the default data
          pointer type in the current mode. Otherwise, the operand is
          the default code pointer type.
 
       3. If .MODEL is not specified, SMALL model (and therefore NEAR
          pointers) is the default.
 
     A qualified type can be used in six places:
 
     Use                            Example
 
     In procedure arguments         proc1 PROC pMsg: PTR BYTE
 
     In prototype arguments         proc2 PROTO pMsg: FAR PTR WORD
 
     With local variables           LOCAL pMsg: PTR
     declared inside procedures
 
     With the LABEL directive       TempMsg LABEL WORD
 
     With the EXTERN and            EXTERN pMsg: FAR PTR PTR BYTE
     EXTERNDEF directives
 
     With the TYPEDEF directive     PPBYTE TYPEDEF PTR PBYTE
                                    -♦-