|
1 | 1 | --- |
2 | 2 | title: "Microsoft Macro Assembler BNF Grammar" |
3 | | -description: "Formal BNF description of MASM for x64." |
| 3 | +description: "BNF description of MASM for x64." |
4 | 4 | ms.date: "12/17/2019" |
5 | 5 | helpviewer_keywords: ["MASM (Microsoft Macro Assembler), BNF reference"] |
6 | 6 | --- |
7 | 7 |
|
8 | 8 | # Microsoft Macro Assembler BNF Grammar |
9 | 9 |
|
10 | | -To illustrate the use of the BNF, Figure B.1 diagrams the definition of the TYPEDEF directive, starting |
11 | | -with the nonterminal typedefDir. |
| 10 | +This page contains a BNF description of the MASM grammar. It is provided for illustrative purposes and is not guaranteed to be complete. Please consult the reference topics for full information on keywords, parameters, operations and so on. |
12 | 11 |
|
13 | | -The entries under each horizontal brace in Figure B.1 are terminals (such as NEAR16, NEAR32, |
14 | | -FAR16, and FAR32) or nonterminals (such as qualifier, qualifiedType, distance, and protoSpec) that |
15 | | -can be further defined. Each italicized nonterminal in the typedefDir definition is also an entry in the |
16 | | -BNF. Three vertical dots indicate a branching definition for a nonterminal that, for the sake of |
17 | | -simplicity, this figure does not illustrate. |
| 12 | +To illustrate the use of the BNF, the following diagram shows the definition of the TYPEDEF directive, starting with the nonterminal *typedefDir*. |
18 | 13 |
|
19 | | -The BNF grammar allows recursive definitions. For example, the grammar uses qualifiedType as a |
20 | | -possible definition for qualifiedType, which is also a component of the definition for qualifier. |
| 14 | + |
| 15 | + |
| 16 | +The entries under each horizontal brace are terminals (such as **NEAR16**, **NEAR32**, **FAR16**, and **FAR32**) or nonterminals (such as *qualifier*, *qualifiedType*, *distance*, and *protoSpec*) that can be further defined. Each italicized nonterminal in the *typedefDir* definition is also an entry in the BNF. Three vertical dots indicate a branching definition for a nonterminal that, for the sake of simplicity, this figure does not illustrate. |
| 17 | + |
| 18 | +The BNF grammar allows recursive definitions. For example, the grammar uses qualifiedType as a possible definition for qualifiedType, which is also a component of the definition for qualifier. The "|" symbol specifies alternate expressions, for example *endOfLine* | *comment*. Double braces specify an optional parameter, for example ⟦ *macroParmList* ⟧. |
21 | 19 |
|
22 | 20 | ## MASM Nonterminals |
23 | 21 |
|
@@ -572,7 +570,7 @@ possible definition for qualifiedType, which is also a component of the definiti |
572 | 570 |
|
573 | 571 | *macroArg*\ |
574 | 572 | % *constExpr*\ |
575 | | - | % *textMacroId*\ |
| 573 | + | %*textMacroId*\ |
576 | 574 | | %*macroFuncId* ( *macroArgList* )\ |
577 | 575 | | *string*\ |
578 | 576 | | *arbitraryText*\ |
@@ -767,11 +765,8 @@ possible definition for qualifiedType, which is also a component of the definiti |
767 | 765 | ⟦ *usesRegs* ⟧ ⟦ *procParmList* ⟧ |
768 | 766 |
|
769 | 767 | *processor*\ |
770 | | - .8086\ |
771 | | - | .186\ |
772 | | - | .286 | .286C | .286P\ |
773 | | - | .386 | .386C | .386P\ |
774 | | - | .486 | .486P |
| 768 | + | .386 | .386p | .486 | .486P\ |
| 769 | + | .586 | .586P | .686 | .686P | .387 |
775 | 770 |
|
776 | 771 | *processorDir*\ |
777 | 772 | *processor* ;;\ |
|
0 commit comments