1.2.3 Predefined Symbols
Summary: Macros and conditional-assembly blocks often use predefined symbols.
The assembler includes a number of predefined symbols (also called predefined equates). You can use these symbol names at any point in your code to represent the equate value. For example, the predefined equate @FileName represents the base name of the current file. If the current source file is TASK.ASM, the value of @FileName is TASK. The MASM predefined symbols are listed below according to the kinds of information they provide. Case is important only if the /Cp option is used. (See online help on ML command-line options for additional details.)
Predefined Symbols for Segment Information
| @code |
Provides the name of the code segment, except in tiny model when it returns DGROUP. |
| @CodeSize |
Returns an integer representing the default code distance. |
| @CurSeg |
Returns the name of the current segment. |
| @data |
Expands to DGROUP except in flat model. |
| @DataSize |
Returns an integer representing the default data distance. |
| @fardata |
Represents the name of the segment defined by the .FARDATA directive. |
| @fardata? |
Represents the name of the segment defined by the .FARDATA? directive. |
| @Model |
Returns the selected memory model. |
| @stack |
Expands to DGROUP for near stacks or STACK for far stacks. (See Section 2.2.3, “Creating a Stack.”) |
| @WordSize |
Provides the size attribute of the current segment. |
Predefined Symbols for Environment Information
| @Cpu |
Contains a bit mask specifying the processor mode. |
| @Environ |
Returns values of environment variables. |
| @Interface |
Contains information about the language parameters. |
| @Version |
Represents the text equivalent of the MASM version number. In MASM 6.0, this expands to 600. |
Predefined Symbols for Date and Time Information
| @Date |
Supplies the current system date. |
| @Time |
Supplies the current system time. |
Predefined Symbols for File Information
| @FileCur |
Names the current file (base and suffix). |
| @FileName |
Names the base name of the main file being assembled as it appears on the command line. |
| @Line |
Gives the source line number in the current file. |
Predefined Functions for Macro String Manipulation
| @CatStr |
Returns concatenation of two strings. |
| @InStr |
Returns the starting position of a string within another string. |
| @SizeStr |
Returns the length of a given string. |
| @SubStr |
Returns substring from a given string. |