0.2.2 Using the OPTION Directive

The OPTION directive can be used with various arguments to control compatibility with MASM 5.1 code. This section explains the differences in MASM 5.1 and MASM 6.0 behavior that can be influenced with the OPTION directive.

Section A.2.2.1 discusses the M510 argument to the OPTION directive, which selects the MASM 5.1 compatibility mode. In this mode, MASM 6.0 implements MASM 5.1 behavior relating to macros, offsets, scope of code labels, structures, identifier names, identifier case, and other behaviors.

Note:

Wherever this appendix suggests using OPTION M510 in your code, you can set the /Zm command-line option instead.

If you prefer to choose specific MASM 5.1 behaviors, rather than all those implemented by the OPTION M510 directive, use the OPTION arguments discussed in Sections A.2.2.2 through A.2.2.9. Each section also explains how to revise your code if you want to remove OPTION directives from your MASM 5.1 code.

If you have used any processor or coprocessor instruction names as label names in your code, you can use the OPTION NOKEYWORD directive to remove them from the reserved word list. See Section A.2.2.9.

0.2.2.1 OPTION M510

Using OPTION M510 is equivalent to adding /Zm to the command line. The OPTION M510 directive automatically sets the following:

OPTION OLDSTRUCTS ; MASM 5.1 structures

; See Section A.2.2.2

OPTION OLDMACROS ; MASM 5.1 macros

; See Section A.2.2.3

OPTION DOTNAME ; Identifiers may begin with a dot (.)

; See Section A.2.2.4

If you do not have a .386, 386P .486, or 486P directive in your module, then OPTION M510 adds:

OPTION EXPR16 ; 16-bit expression precision

; See Section A.2.2.5

If you do not have a .MODEL directive in your module, OPTION M510 adds:

OPTION OFFSET:SEGMENT ; OFFSET operator defaults to

; segment-relative

; See Section A.2.2.6

If you do not have a .MODEL directive with a language specifier in your module, OPTION M510 also adds:

OPTION NOSCOPED ; Code labels are not local inside

; procedures

; See Section A.2.2.7

OPTION PROC:PRIVATE ; Labels defined with PROC are not

; public by default

; See Section A.2.2.8

If you want to remove OPTION M510 from your code (or /Zm from the command line), add the OPTION directive arguments to your module according to the conditions stated above.

There may be compatibility issues affecting your code that are supported under OPTION M510, but are not covered by the other OPTION directive arguments. Once your source code has been modified so it no longer requires behavior supported by OPTION M510, you can replace OPTION M510 with other OPTION directive arguments. These compatibility issues are discussed in Sections A.2.2.2 through A.2.2.9.

Once you have replaced OPTION M510 with other forms of the OPTION directive and your code works correctly, try removing the OPTION directives, one at a time. Make appropriate source modifications as necessary (see Sections A.2.2.2 through A.2.2.9), until your code uses only MASM 6.0 defaults.

Note:

OPTION M510 enables the behaviors discussed below in addition to the behaviors corrected by the OPTION directive arguments described in Sections A.2.2.2 through A.2.2.9.

Reserved Keywords Dependent on CPU Mode with OPTION M510

With OPTION M510, keywords and instructions that are not available in the current CPU mode (such as ENTER under .8086) are not treated as keywords. This also means the USE32, FLAT, FAR32, and NEAR32 segment types and the 80386/486 registers are not keywords with a processor selection less than .386.

If you remove OPTION M510, then any reserved word that you use as an identifier generates a syntax error. You can either rename the identifiers or use OPTION NOKEYWORD. See Section A.2.2.9 for more information on OPTION NOKEYWORD.

Invalid Use of Instruction Prefixes with OPTION M510

Code without OPTION M510 generates errors for all invalid uses of the instruction prefixes. Using OPTION M510 suppresses some of these errors in order to match MASM 5.1 behavior. MASM 5.1 does not check for illegal uses of the instruction prefixes LOCK, REP, REPE, REPZ, REPNE, and REPNZ.

Illegal uses of these prefixes result in error A2068:

instruction prefix not allowed

See Section 5.1.3.1, “Overview of String Operations”, and Section A.2.1.1, “Bug Fixes from MASM 5.1” for more information on these instruction prefixes.

Sizes of Constant Operands with OPTION M510

In MASM 5.1, a constant whose value is so large it can fit only in the CPU's default word (four bytes for .386 and .486, two bytes otherwise) is assigned a size attribute of the default word size. The value of the constant affects the number of bytes changed by the instruction. For example,

; Legal only with OPTION M510

mov [bx], 0100h

is legal in OPTION M510 mode. Since 0100h cannot fit in a byte, it is interpreted as a word.

Without OPTION M510, the assembler never assigns a size automatically. You must state it explicitly. Use OPTION M510 to enable the MASM 5.1 behavior if you do not want to change your MASM 5.1 code.

For code without OPTION M510, the example above could be rewritten as:

; Without OPTION M510

mov ax, WORD PTR 0100h

Code Labels in Data Definition with OPTION M510

MASM 5.1 allows a code label definition in a data definition statement if that statement does not also define a data label. This is also allowed by MASM 6.0 if OPTION M510 is enabled; otherwise it is illegal.

; Legal only with OPTION M510

MyCodeLabel: DW 0

SEG Operator with OPTION M510

In MASM 5.1, the SEG operator returns a label's segment unless the frame is explicitly specified, in which case the frame is returned. A statement such as SEG DGROUP:var always returns DGROUP, whereas SEG var always returns the segment of var. OPTION M510 provides this behavior.

If you do not use OPTION M510, the behavior of the SEG operator is determined by the OPTION OFFSET directive. See Section A.2.2.6.

When you use the SEG operator with a variable that is not external, code without OPTION M510 returns the address of the frame (the segment, group, or the value assumed to the segment register) if one has been explicitly set. Otherwise, it returns the group if one has been specified. In the absence of a defined group, SEG returns the segment where the variable is defined.

Expression Evaluation with OPTION M510

By default, MASM 6.0 changes the way that expressions are evaluated. In MASM 5.1,

var-2[bx]

is parsed as

(var-2)[bx]

Without OPTION M510, you need to rewrite this statement, since it is parsed as

var-(2[bx])

which generates an error. OPTION M510 provides the MASM 5.1 behavior.

Length and Size of Labels with OPTION M510

With OPTION M510, the LENGTH and SIZE operators can be applied to any label. For a code label, SIZE returns 0FFFFh for NEAR and 0FFFEh for FAR, and LENGTH always returns 1. For strings, SIZE and LENGTH return 1.

Without OPTION M510, LENGTH returns 1 except when used with DUP. In this case, the LENGTH operator returns the outermost DUP count. SIZE returns the length multiplied by the size of the type. However, the new LENGTHOF and SIZEOF operators return the number of data items and the number of bytes used by the initializer.

If you specify OPTION M510 and the current word size is 2, NEAR16 and FAR16 correspond to the constants 0FFFFh and 0FFFEh, respectively. When the current word size is 4, NEAR and FAR (mapped to NEAR32 and FAR32, respectively) correspond to 0FFFFh and 0FFFEh.

Without OPTION M510, the distance attributes SHORT, NEAR16, NEAR32, FAR16, and FAR32 correspond to 0FF01h, 0FF02h, 0FF04h, 0FF05h, and 0FF06h, respectively.

The behavior of the new SIZEOF and LENGTHOF operators for labels and strings is discussed in Section 5.1.1, “Declaring and Referencing Arrays”; Section 5.1.2, “Declaring and Initializing Strings”; Section 5.2.2, “Defining Structure and Union Variables”; and Section 5.3.2, “Defining Record Variables.”

Comparing Types Using EQ and NE with OPTION M510

With OPTION M510, types are converted to a constant value equal to the size of the data type before comparisons with EQ and NE. Code types are converted to 0FFFFh (near) and 0FFFEh (far). If OPTION M510 is not enabled, types are converted to constants only when comparing them with constants; two types are equal only if they are equivalent qualified types.

For existing MASM 5.1 code, these distinctions affect only the use of the TYPE operator in conjunction with EQ and NE. The following example illustrates this situation:

MYSTRUCT STRUC

f1 DB 0

f2 DB 0

MYSTRUCT ENDS

; With OPTION M510

val = (TYPE MYSTRUCT) EQ WORD ; True: 2 EQ 2

val = 2 EQ WORD ; True: 2 EQ 2

val = WORD EQ WORD ; True: 2 EQ 2

val = SWORD EQ SWORD ; True: 2 EQ 2

; Without OPTION M510

val = (TYPE MYSTRUCT) EQ WORD ; False: MyStruct NE WORD

val = 2 EQ WORD ; True: 2 EQ 2

val = WORD EQ WORD ; True: WORD EQ WORD

val = SWORD EQ SWORD ; False: SWORD NE WORD

Use of Constant and PTR as a Type with OPTION M510

A constant can be used as the left operand to PTR when OPTION M510 is enabled. Otherwise a type expression must be used. With OPTION M510, a constant must have a value of 1 (byte), 2 (word), 4 (dword), 6 (fword), 8 (qword) or 10 (tbyte), and it is treated as if the parenthesized type had been specified instead. Note that the TYPE operator yields a type expression, but the SIZE operator yields a constant.

; With OPTION M510

MyData DW 0

mov WORD PTR [bx], 10 ; Legal

mov (TYPE MyData) PTR [bx], 10 ; Legal

mov (SIZE MyData) PTR [bx], 10 ; Legal

mov 2 ptr [bx], 10 ; Legal

; Without OPTION M510

mov WORD PTR [bx], 10 ; Legal

mov (TYPE MyData) PTR [bx], 10 ; Legal

; mov (SIZE MyData) PTR [bx], 10 ; Illegal

; mov 2 PTR [bx], 10 ; Illegal

Structure Type Cast on Expressions with OPTION M510

As with MASM 5.1, a constant can be type cast with the PTR operator to a structure type. This is most often used in data initializers to affect the CodeView information of the data label being defined. Without OPTION M510, the assembler generates an error.

MYSTRC STRUC

f1 DB 0

MYSTRC ENDS

MyPtr DW MYSTRC PTR 0 ; Illegal without OPTION M510

The type of initializers does not influence CodeView's type information with MASM 6.0.

Hidden Coercion of OFFSET Expression Size with OPTION M510

When programming for the 80386 or 80486, the size of an OFFSET expression may be two bytes (for a symbol in a USE16 segment) or 4 bytes (for a symbol in a USE32 or FLAT segment). However, with OPTION M510, a 32-bit OFFSET expression may be used in a 16-bit context. Without OPTION M510, the LOWWORD operator must be used to convert the offset size.

; With OPTION M510

.386

seg32 SEGMENT USE32

MyLabel WORD 0

seg32 ENDS

seg16 SEGMENT USE16 'code' ; With OPTIONS M510:

mov ax, OFFSET MyLabel ; Legal

mov ax, LOWWORD OFFSET MyLabel ; Legal

mov eax, OFFSET MyLabel ; Legal

seg16 ENDS

; Without OPTION M510

.386

seg32 SEGMENT USE32

MyLabel WORD 0

seg32 ENDS

seg16 SEGMENT USE16 'code' ; Without OPTION M510:

; mov ax, OFFSET MyLabel ; Illegal

mov ax, LOWWORD offset MyLabel ; Legal

mov eax, OFFSET MyLabel ; Legal

seg16 ENDS

Specifying Radixes with OPTION M510

If the current radix in your code (without OPTION M510) is greater than 10, then the radix specifiers B (binary) and D (decimal) are not supported. You will need to change B to Y for binary, and D to T for decimal, since both B and D are legitimate hexadecimal values, making numbers such as 12D ambiguous. See Section 1.2.4, “Integer Constants and Constant Expressions,” for more information.

If you don't want to change radix specifiers when the current radix is greater than 10, you need to specify OPTION M510 in your code.

Naming Conventions with OPTION M510

By default in MASM 5.1, specifying a language type of PASCAL, FORTRAN, or BASIC does not cause names to be mapped to uppercase when publicly declared variables are written into the object file.

Unless you use OPTION M510 in your code, these language types map identifier names to uppercase by default in MASM 6.0, even if you assemble with the /Cp or /Cx command-line options. See Section 20.1, “Naming and Calling Conventions.”

When you link with /NOI[[GNORECASE]], case must be matched in the object files to resolve externals.

Length Significance of Symbol Names with OPTION M510

With MASM 5.1, only the first 31 characters of a symbol name are considered significant, and only the first 31 characters of a public or external symbol name are placed in the object file.

Without OPTION M510, the entire name is considered significant. The maximum number of characters placed in the object file is controlled with the /Hnumber command-line option, with a default of 247 (the maximum length of an identifier in MASM 6.0).

String Defaults in Structure Variables with OPTION M510

With OPTION M510, a structure field initialized to a string value can be overridden with a constant. Without OPTION M510, a string can be overridden only with another string or with a list. To update your code, surround the constant override value with angle brackets or curly braces to indicate a list with one element.

MTSTRUCT STRUCT

MyString BTYE "This is a string"

MTSTRUCT ENDS

; With OPTION M510

MyInst MTSTRUCT <0>

; Without OPTION M510, either of these statement is correct

MyInst MTSTRUCT <<0>>

MyInst MTSTRUCT {<0>}

Effects of the ? Initializer in Data Definitions with OPTION M510

When ? is used as a data initializer, it is sometimes treated as a zero and sometimes causes a byte to be left unspecified in the object file. The conditional behavior for MASM 6.0 without OPTION M510 is explained in Section 5.1.2. With OPTION M510, however, the ? initializer is always treated as a zero unless it is used with the DUP operator. This rarely affects program execution.

Current Address Operator with OPTION M510

When OPTION M510 is enabled, the value of the current address operator ($) for a structure instance is the offset of the first byte of the instance. When OPTION M510 is not enabled, the value of $ is the offset of the current field in the instance.

Segment Association for FAR Externals with OPTION M510

With MASM 5.1, a FAR external symbol defined inside a segment is considered to be inside that segment unless a .MODEL directive is used. With MASM 6.0, such a symbol is never considered to be inside that segment unless OPTION M510 is used, in which case the MASM 5.1 behavior is emulated. Segment association for externals affects the frame of fixups generated on references to the symbols.

Defining Aliases Using EQU with OPTION M510

In MASM 5.1, a symbol can be equated to another symbol. These equates are called “aliases” in MASM 5.1. This behavior is simulated with OPTION M510.

If you don't use OPTION M510, aliases cannot be defined using EQU. The right operand of an EQU directive must be an immediate expression or text. Change aliases to use the TEXTEQU directive, which is described in Section 9.1. This change should have no effect on your code but may cause an expression to evaluate differently.

These examples illustrate MASM 5.1 code, MASM 6.0 code with OPTION M510, and MASM 6.0 code without OPTION M510:

; MASM 5.1 code

var1 EQU 3

var2 EQU var1 ; var2 taken as an alias

; var2 references var1 anywhere var2 is

; used as a symbol

; MASM 6.0 with OPTION M510

var1 EQU 3

var2 EQU var1 ; var2 taken as a var2 EQU <var1>

; var2 substituted for var1 whenever

; text macros substituted

; MASM 6.0 without OPTION M510

var1 EQU 3

var2 EQU var1 ; Treated as var2 EQU 3

Difference in Text Macro Expansions with OPTION M510

When the name of a text macro is supplied as a text item, MASM 5.1 replaces the text macro name with its text value. However, if that text value contains other text macro names, no recursive expansion occurs. With MASM 6.0, recursive expansion occurs unless OPTION M510 is enabled, as shown in the following example:

; With OPTION M510

tm1 EQU <contains tm2>

tm2 EQU <value>

tm3 CATSTR tm1 ; == <contains tm2>

; Without OPTION M510

tm3 CATSTR tm1 ; == <contains value>

Conditional Directives and Missing Operands with OPTION M510

MASM 5.1 considers a missing argument to be a zero. MASM 6.0 requires an argument unless OPTION M510 is enabled.

0.2.2.2 OPTION OLDSTRUCTS

Changes made in MASM 6.0 that apply to structures are discussed in this section. With OPTION OLDSTRUCTS or OPTION M510:

The plus operator can be used in structure field references in MASM 6.0. (The dot operator is required with OPTION NOOLDSTRUCTS, the default.)

Labels and structure field names cannot have the same name with OPTION OLDSTRUCTS (but they can with OPTION NOOLDSTRUCTS).

Plus Operator Not Allowed with MASM 6.0 Structures

By default, each reference to structure member names must use the dot (.) operator to separate the structure variable name from the field name. Note that the dot (.) operator cannot be used as the plus (+) operator, nor can the plus operator be used as the dot operator.

To convert your code so that it does not need OPTION OLDSTRUCTS:

Qualify all structure field references

Change all uses of the dot operator (.) that occur outside of structure references to use the plus operator (+)

If you remove OPTION OLDSTRUCTS from your code, the assembler generates errors on all lines needing to be changed. Non-structure uses of the dot operator result in error A2166:

structure field expected

Unqualified structure references result in error A2006:

undefined symbol : identifier

This example shows code that doesn't work under the default, OPTION NOOLDSTRUCTS, and how to change it:

; OPTION OLDSTRUCTS (Does not work with OPTION NOOLDSTRUCTS)

structname STRUC

a BYTE ?

b WORD ?

structname ENDS

structinstance structname <>

mov ax, [bx].b

mov al, structinstance.a

mov ax, [bx].4

; OPTION NOOLDSTRUCTS (the MASM 6.0 default)

structname STRUCT

a BYTE ?

b WORD ?

structname ENDS

structinstance structname <>

mov ax, [bx].structname.b ; Add qualifying type

mov al, structinstance.a ; No change needed

mov ax, [bx]+4 ; Change dot to plus

; Alternative methods in MASM 6.0

ASSUME bx:PTR structname

mov ax, [bx] ; OR:

mov ax, (structname PTR[bx]).b

Non-Unique Structure Field Names Allowed in MASM 6.0

With the default, OPTION NOOLDSTRUCTS, label and structure field names may have the same name. With OPTION OLDSTRUCTS (the MASM 5.1 default), labels and structure fields cannot have the same name. For more information, see Section 5.2, “Structures and Unions.”

0.2.2.3 OPTION OLDMACROS

If you use MASM 6.0 without OPTION OLDMACROS or OPTION M510, the behavior of macros is changed in several ways. If you want the MASM 5.1 macro behavior, add OPTION OLDMACROS or OPTION M510 to your MASM 5.1 code.

Depending on the complexity of your MASM 5.1 macros and your programming style, it may be easy to make the necessary changes to remove OPTION OLDMACROS. This section describes the differences.

Commas Separating Macro Arguments

MASM 5.1 allows white spaces or commas to separate arguments to macros. MASM 6.0 with OPTION NOOLDMACROS (the default), requires commas between arguments. For example, in the macro call

MyMacro var1 var2 var3, var4

OPTION OLDMACROS passes four arguments (separated by spaces), but OPTION NOOLDMACROS passes only two arguments (separated by a comma). To convert your macro code, replace any space delimiters between macro arguments with commas.

New Behavior with Ampersands in Macros

Using the MASM 6.0 assembler default, OPTION NOOLDMACROS, causes ampersands (&) to be interpreted within a macro differently than in MASM 5.1. The number of ampersands and their positions in a statement determine the result of the macro expansion in MASM 5.1. Parameters for use in nested MASM 5.1 macros must be prefixed with several ampersands, since the assembler removes one ampersand for each level of macro expansion. Using OPTION OLDMACROS enables this behavior.

Without OPTION OLDMACROS, ampersands are removed only once no matter how deeply nested the macro. To update your MASM 5.1 macros, a simple rule can be followed: Replace every sequence of ampersands with a single ampersand. The only exception to this is when macro parameters immediately precede and follow the ampersand, and both are to be substituted. In this case, two ampersands are needed. See Section 9.3.3, “Substitution Operator,” for a description of the new rules.

This example shows how to update a MASM 5.1 macro:

; OPTION OLDMACROS (the MASM 5.1 behavior)

createNames macro arg

irp tail, <Next, Last>

irp num, <1, 2>

; Define more names of the form: abcNext1?

arg&&tail&&&num&&&? label BYTE

ENDM

ENDM

ENDM

; OPTION NOOLDMACROS (the MASM 6.0 default)

createNames macro arg

for tail, <Next, Last> ; FOR is the MASM 6.0

for num, <1, 2> ; synonym for irp

; Define more names of the form: abcNext1?

arg&&tail&&num&? label BYTE

ENDM

ENDM

ENDM

0.2.2.4 OPTION DOTNAME

MASM 5.1 allows names of identifiers to begin with a period. The MASM 6.0 default is OPTION NODOTNAME. Adding OPTION DOTNAME to your code provides the MASM 5.1 behavior.

If you don't want to use this directive in your source code, rename the identifiers whose names begin with a period.

0.2.2.5 OPTION EXPR16

The OPTION EXPR16 statement sets the expression word size to 16 bits. If you do not have .386, .386P, .486, or .486P directives in your MASM 5.1 code, OPTION EXPR16 is the default. For MASM 6.0, OPTION EXPR32 (an expression word size of 32 bits) is the default.

It may not be easy to determine the effect of changing from 16-bit internal expression size to 32-bit size. In many cases, the 32-bit word size results in no change to MASM 5.1. code. However, problems may arise due to differences in intermediate values during evaluation of expressions. If you generate a listing file with the /Fl and /Sa command-line options with and without OPTION EXPR16, you can compare the files for differences.

It is illegal to change the expression size once it has been set with the OPTION directive. Changing the CPU type to .386 or .486 also sets OPTION EXPR32.

0.2.2.6 OPTION OFFSET

In MASM 5.1 code, offsets are computed with respect to the segment when the .MODEL is not used. This is equivalent to OPTION OFFSET:SEGMENT. OPTION M510 adds OPTION OFFSET:SEGMENT to your code if there is no .MODEL directive.

When the .MODEL directive is used, offsets are computed with respect to the group. This is equivalent to MASM 6.0's OPTION OFFSET:GROUP (the MASM 6.0 default).

Changing from OPTION OFFSET:SEGMENT to OPTION OFFSET:GROUP usually causes no problems. However, it is not easy to determine if changes are needed.

The behavior of the OFFSET operator depends on the arguments used with OPTION OFFSET. If no GROUP directives are used, no changes are needed. Otherwise, use of the OFFSET operator must be examined to see if the operand is in a grouped segment with no group override. If so, a segment name override must be used. The following example shows equivalent statements for OPTION OFFSET:SEGMENT and OPTION OFFSET:GROUP:

; OPTION OFFSET:SEGMENT

MyGroup GROUP MySeg

MySeg SEGMENT 'data'

MyLabel LABEL BYTE

DW OFFSET MyLabel

DW OFFSET MyGroup:MyLabel

DW OFFSET MySeg:MyLabel

MySeg ENDS

In this example, the first use of OFFSET must be changed to OFFSET MySeg:MyLabel. The second and third uses do not need to be changed:

; OPTION OFFSET:GROUP

MyGroup GROUP MySeg

MySeg SEGMENT 'data'

MyLabel LABEL BYTE

DW OFFSET MySeg:MyLabel

DW OFFSET MyGroup:MyLabel

DW OFFSET MySeg:MyLabel

MySeg ENDS

Without OPTION M510, the OPTION OFFSET directive determines whether SEG is group- or segment-relative. When you don't use OPTION M510, the SEG operator behaves the same as the OFFSET operator does relative to OPTION OFFSET. With OPTION M510, SEG is always segment-relative by default, regardless of the current value of OPTION OFFSET (including the effect on OPTION OFFSET of a .MODEL directive).

To remove OPTION M510 from your code, add OPTION OFFSET:SEGMENT if there is no .MODEL directive in your code.

0.2.2.7 OPTION NOSCOPED

Under MASM 5.1, code labels are scoped (local to the current procedure) if the .MODEL directive specifies a language type.They are not scoped (not local to the current procedure) if a language is not specified. Without OPTION M510 or OPTION NOSCOPED, code labels are always scoped.

If your MASM 5.1 code does not specify a language type and you want to assemble without OPTION M510, add OPTION NOSCOPED to your code.

To determine which labels need to be changed, remove the OPTION NOSCOPED directive and assemble the module. The assembler generates error A2006:

undefined symbol : identifier

for each reference to a non-local symbol.

0.2.2.8 OPTION PROC

By default, MASM 6.0 procedures are public (OPTION PROC:PUBLIC), but you can explicitly specify the default for procedure visibility with OPTION PROC:PRIVATE or OPTION PROC:EXPORT.

If your module does not have a language specifier with the MODEL directive, using OPTION M510 adds OPTION PROC:PRIVATE to the module. If you do not want to use OPTION PROC:PRIVATE, you can add the PRIVATE keyword to each procedure you want to make private. The following example shows how to change MASM 5.1 code to make a procedure private:

; MASM 5.1 (OPTION PROC:PRIVATE)

MyProc PROC NEAR

; MASM 6.0 (OPTION PROC:PUBLIC)

MyProc PROC NEAR PRIVATE

This is necessary only to avoid naming conflicts between public names in multiple modules or libraries. The symbol table in a listing file shows the visibility (public, private, or export) of each procedure.

0.2.2.9 OPTION NOKEYWORD

MASM 5.1 allows you to use reserved words for names of identifiers, macro parameters, and text macros. Several new reserved words have been added to MASM 6.0. If your existing code uses a reserved word as a symbol name, your code generates a syntax error on assembly.

Identifiers and text macros can be keywords if you disable individual keywords with the OPTION NOKEYWORD directive. For example,

OPTION NOKEYWORD:<INVOKE STRUCT>

removes two keywords, INVOKE and STRUCT from the reserved word list.

As an alternative to using OPTION NOKEYWORD, you can rename the offending label. For example, a label named Str could be renamed Str1.

The following list names all the new reserved words in MASM 6.0:

.BREAK.CONTINUE.DOSSEG.ELSE.ELSEIF.ENDIF.ENDW.EXIT.IF.LISTALL.LISTIF.LISTMACRO.LISTMACROALL.NO87.NOCREF.NOLIST.NOLISTIF.NOLISTMACRO.REPEAT.STARTUP.UNTIL.UNTILCXZ.WHILEADDRALIASBSWAPCARRY?CMPXCHGECHOEXTERNEXTERNDEFFAR16FAR32FLATFLDENVDFLDENVWFNSAVEDFNSAVEWFNSTENVDFNSTENVWFORFORCFRSTORDFRSTORWFSAVEDFSAVEWFSTENVDFSTENVWGOTOHIGHWORDINVDINVLPGINVOKEIRETDFIRETFLENGTHOFLOOPDLOOPEDLOOPEWLOOPNEDLOOPNEWLOOPNZDLOOPNZWLOOPWLOOPZWLOWWORDLROFFSETNEAR16NEAR32OPATTROPTIONOVERFLOW?PARITY?POPAWPOPCONTEXTPROTOPUSHAWPUSHCONTEXTPUSHDPUSHWREAL10REAL4REAL8REPEATSBYTESDWORDSIGN?SIZEOFSTDCALLSTRUCTSUBTITLESWORDSYSCALLTEXTEQUTR3TR4TR5TYPEDEFUNIONVARARGWBINVDWHILEXADDZERO?