<--  back   Last regenerated: 2021-02-02 18:55:10 kio

zasm - Z80 Assembler – Version 4.4

Assembler directives

#define

#define <name> <value>

Define an alias for a well-known Pseudo instructions
8080 Assembler: 8080 pseudo instructions
pseudo instruction or #define: Define a global label
.globl: Define a global label
define a global label.

#define is used in some sources in three ways:

  1. Define an alias for an instruction name
  2. Define a Pseudo instructions: Label definition
    Numeric expressions: Labels
    8080 Assembler: Labels
    label
  3. Define a preprocessor function with arguments

From that the most common aliases and the definition of Pseudo instructions: Label definition
Numeric expressions: Labels
8080 Assembler: Labels
labels are supported.

Define an alias
#define Pseudo instructions: equ
Types of labels: Named values
Labels: EQU
equ .Pseudo instructions: equ
Types of labels: Named values
Labels: EQU
equ #define defs .Pseudo instructions: defs, ds, .ds, .block, .blkb and data
8080 pseudo instructions: DS
ds

Within the following groups names can be mapped in any direction:

All these mappings are recognized and … ignored.

Other mappings result in an error. (Assembler directives: #if, #elif, #else, #endif
Pseudo instructions: if, endif
if you feel a mapping should be added then send an email.)
zxsp does not support aliases for instruction names, but it already knows about quite a lot of them. Therefore it can ignore these #defines.

Use of this directive is discouraged. It is provided because some sources use it. Just delete it.

Define a global label
#define foo 123
#define bar $ - shelf

#define can be used to #define: Define a global label
.globl: Define a global label
define a global label as with

foo:: Pseudo instructions: equ
Types of labels: Named values
Labels: EQU
equ 123 bar:: Pseudo instructions: equ
Types of labels: Named values
Labels: EQU
equ $ - shelf

Pseudo instructions: Label definition
Numeric expressions: Labels
8080 Assembler: Labels
Labels defined with '#define' are always global, even Assembler directives: #if, #elif, #else, #endif
Pseudo instructions: if, endif
if defined inside a Assembler directives: #local, #endlocal, .local and .endlocal
Pseudo instructions: #local, #endlocal, .local and .endlocal
Including C Source Files: #local, #endlocal, .local and .endlocal
local context.

Use of this directive is discouraged, many assemblers do not understand it. Use the Pseudo instructions
8080 Assembler: 8080 pseudo instructions
pseudo instruction 'Pseudo instructions: equ
Types of labels: Named values
Labels: EQU
equ' instead.

Valid HTML   Valid CSS