You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Documentation/ReferenceManual/ReferenceManual.md
+35-11Lines changed: 35 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2537,6 +2537,20 @@ The `%DELMACRO` directive can be used from within a macro, however, as with ever
2537
2537
2538
2538
Using the `%DELMACRO` directive with a macro name that does not exist will immediately stop assembly and cause an error to be thrown. This will happen even if the macro *used* to exist, meaning you cannot delete the same macro twice (unless it has been redefined in the meantime).
2539
2539
2540
+
#### Pre-defined Macros
2541
+
2542
+
The assembler automatically defines the following macros:
|`#FILE_PATH`| Contains the full path to the current file being assembled |
2547
+
|`#FILE_NAME`| Contains just the file name of the current file being assembled |
2548
+
|`#FOLDER_PATH`| Contains the full path to the directory that contains the current file being assembled |
2549
+
2550
+
The contents of these macros is already pre-processed to be valid inside an AssEmbly string, though the surrounding quote marks are not included.
2551
+
2552
+
Trying to overwrite or delete these macros will have no effect.
2553
+
2540
2554
### %DEFINE - Assembler Variable Definition
2541
2555
2542
2556
The `%DEFINE` directive creates an **assembler variable**, a named storage location that exists for the duration of the assembly process. The directive takes two operands: the name of the variable to define, and the value to assign to it. You can also assign a new value to an existing variable by giving the existing name as the first operand. Assembler variables are always 64-bit integers, and can be inserted into a program as a literal number by writing their name prefixed with an at sign (`@`) at the desired location in the program. Variable names follow the same restrictions as label names: they are case sensitive, and can only contain letters, numbers, and underscores. Unlike labels, the first character in a variable name *can* be a number.
@@ -2576,17 +2590,27 @@ Assembler constants are special, predefined variables that have values set by th
2576
2590
2577
2591
The following table is a list of all assembler constants and their purpose:
|`@!ASSEMBLER_VERSION_MAJOR`| Yes | The major version of AssEmbly being used to assemble the program (the first number in a version formatted as `x.x.x`) |
2582
-
|`@!ASSEMBLER_VERSION_MINOR`| Yes | The minor version of AssEmbly being used to assemble the program (the second number in a version formatted as `x.x.x`) |
2583
-
|`@!ASSEMBLER_VERSION_PATCH`| Yes | The patch version of AssEmbly being used to assemble the program (the third number in a version formatted as `x.x.x`) |
2584
-
|`@!V1_FORMAT`| Yes | Has a value of `1` if the program is being assembled into the header-less AAP format used by AssEmbly version 1, otherwise has a value of `0`|
2585
-
|`@!V1_CALL_STACK`| Yes | Has a value of `1` if the program will be executed using the "3 registers pushed" calling convention used by AssEmbly version 1, otherwise has a value of `0`|
2586
-
|`@!IMPORT_DEPTH`| No | The current size of the import stack. Starts at `0` when used within the base file, then increments for every import statement, and decrements when an imported file ends |
2587
-
|`@!CURRENT_ADDRESS`| No | The current number of bytes that have been inserted into the program so far. Equivalent to the address that the current instruction will start at when assembled |
2588
-
|`@!OBSOLETE_DIRECTIVES`| Yes | Has a value of `1` if the use of pre-3.2 directives is enabled, otherwise has a value of `0`|
2589
-
|`@!ESCAPE_SEQUENCES`| Yes | Has a value of `1` if post-1.1 string escape sequences are enabled, otherwise has a value of `0`|
|`@!ASSEMBLER_VERSION_MAJOR`| Yes | The major version of AssEmbly being used to assemble the program (the first number in a version formatted as `x.x.x`) |
2596
+
|`@!ASSEMBLER_VERSION_MINOR`| Yes | The minor version of AssEmbly being used to assemble the program (the second number in a version formatted as `x.x.x`) |
2597
+
|`@!ASSEMBLER_VERSION_PATCH`| Yes | The patch version of AssEmbly being used to assemble the program (the third number in a version formatted as `x.x.x`) |
2598
+
|`@!V1_FORMAT`| Yes | Has a value of `1` if the program is being assembled into the header-less AAP format used by AssEmbly version 1, otherwise has a value of `0`|
2599
+
|`@!V1_CALL_STACK`| Yes | Has a value of `1` if the program will be executed using the "3 registers pushed" calling convention used by AssEmbly version 1, otherwise has a value of `0`|
2600
+
|`@!IMPORT_DEPTH`| No | The current size of the import stack. Starts at `0` when used within the base file, then increments for every import statement, and decrements when an imported file ends |
2601
+
|`@!CURRENT_ADDRESS`| No | The current number of bytes that have been inserted into the program so far. Equivalent to the address that the current instruction will start at when assembled |
2602
+
|`@!FULL_BASE_OPCODES`| Yes | Has a value of `1` if instructions from the base instruction set will be assembled with full 3-byte opcodes, otherwise has a value of `0`|
2603
+
|`@!OBSOLETE_DIRECTIVES`| Yes | Has a value of `1` if the use of pre-3.2 directives is enabled, otherwise has a value of `0`|
2604
+
|`@!ESCAPE_SEQUENCES`| Yes | Has a value of `1` if post-1.1 string escape sequences are enabled, otherwise has a value of `0`|
2605
+
|`@!FILE_PATH_MACROS`| Yes | Has a value of `1` if automatically defined file path macros (such as `#FILE_PATH`) are enabled, otherwise has a value of `0`|
2606
+
|`@!EXTENSION_SET_SIGNED_AVAIL`| Yes | Has a value of `1` if the Signed Extension Set is available to be assembled, otherwise has a value of `0`|
2607
+
|`@!EXTENSION_SET_FLOATING_POINT_AVAIL`| Yes | Has a value of `1` if the Floating Point Extension Set is available to be assembled, otherwise has a value of `0`|
2608
+
|`@!EXTENSION_SET_EXTENDED_BASE_AVAIL`| Yes | Has a value of `1` if the Extended Base Set is available to be assembled, otherwise has a value of `0`|
2609
+
|`@!EXTENSION_SET_EXTERNAL_ASM_AVAIL`| Yes | Has a value of `1` if the External Assembly Extension Set is available to be assembled, otherwise has a value of `0`|
2610
+
|`@!EXTENSION_SET_HEAP_ALLOCATE_AVAIL`| Yes | Has a value of `1` if the Memory Allocation Extension Set is available to be assembled, otherwise has a value of `0`|
2611
+
|`@!EXTENSION_SET_FILE_SYSTEM_AVAIL`| Yes | Has a value of `1` if the File System Extension Set is available to be assembled, otherwise has a value of `0`|
2612
+
|`@!EXTENSION_SET_TERMINAL_AVAIL`| Yes | Has a value of `1` if the Terminal Extension Set is available to be assembled, otherwise has a value of `0`|
2613
+
|`@!DISPLACEMENT_AVAIL`| Yes | Has a value of `1` if pointer displacement, label displacement, and explicit pointer read specifiers can be assembled, otherwise has a value of `0`|
2590
2614
2591
2615
"Static" assembler constants will retain the same value throughout the entire assembly process. Other assembler constants may change throughout assembly depending on where they are used.
0 commit comments