Z80 directives

Directives are not executed by the CPU: they tell the assembler where to put the code, what data to emit, which names stand for which values, and when to expand a macro. Most of them have several accepted spellings, so sources written for other Z80 assemblers usually assemble unchanged.

.title

Set the title of the program, as a string.

error

Force an error.

defb

Define a sequence of bytes, text, or strings.

Also written as db.db.bytedefmdm.dm.text.ascii.asciz

defw

Define a sequence of 16-bit words.

Also written as dw.dw.word

.long

Define a sequence of 32-bit longs.

equ

Assign a value to a symbol.

Also written as .equdefl=

org

Specify address of next instruction.

Also written as .org.loc

align

Add fill bytes until address is multiple of specified value.

Also written as .align

defs

Fill memory with repeated bytes.

Also written as ds.ds.block.blkbdatadc

macro

Start a macro definition.

Also written as .macro

endm

End a macro definition.

Also written as .endm

if

If conditional.

Also written as cond

else

Else conditional.

endif

End of if conditional.

Also written as endc

end

End of file, optionally followed by entry address or label.

#target

Specify whether targeting bin or rom.

#code

Start a new code segment.

#include

Include an assembly file or library directory.

#local

Start a local scope.

#endlocal

End a local scope.

#insert

Insert a binary file.