Skip to content

Atom and Z80 Reference01

Appendix 1 — Directive Reference

Atom has two directive groups. Bare assembler directives control assembly. % directives control source preparation and are removed before assembly. Both groups are case-insensitive.

Assembler directives

DirectiveSyntaxEffectHosts
EQUNAME EQU EXPR or NAME: EQU EXPRDeclares one resolved constant without changing private scopeDesktop, CP/M
ORGORG EXPRSets the logical output cursor; emits no byteDesktop, CP/M
DBDB ITEM[,ITEM…]Emits low bytes from expressions and decoded double-quoted stringsDesktop, CP/M
DWDW EXPR[,EXPR…]Emits little-endian wordsDesktop, CP/M
DSDS COUNTReserves uninitialised bytes and advances the cursorDesktop, CP/M
DSDS COUNT,FILLEmits COUNT initialized fill bytesDesktop, CP/M
ALIGNALIGN BOUNDARYEmits zeros to the next address divisible by a positive boundaryDesktop, CP/M
INCBININCBIN "PATH"Emits one complete confined host binary snapshotDesktop
CSTRCSTR "TEXT"Emits decoded bytes followed by zeroDesktop, CP/M
PSTRPSTR "TEXT"Emits a decoded-byte count followed by the bytesDesktop, CP/M
ISTRISTR "TEXT"Sets bit 7 on the final decoded byte; empty text emits nothingDesktop, CP/M

Dotted directive aliases are invalid. A leading period begins a private symbol:

asm
ORG 4000H       ; ASSEMBLER DIRECTIVE
.ORG:           ; PRIVATE LABEL

EQU, ORG, DS, and ALIGN require already resolved expressions. DB and DW accept Atom's restricted forward affine form.

Preprocessor directives

DirectiveSyntaxEffectHosts
%DEFINE%DEFINE NAME VALUEBinds one immutable 16-bit host value in the entry headerDesktop
%INCLUDE%INCLUDE "PATH"Adds one import-once dependency edge from a leading part headerDesktop, CP/M
%IF%IF VALUESelects the following branch when the value is non-zeroDesktop
%ELSE%ELSESelects the alternate branchDesktop
%ENDIF%ENDIFCloses the current host conditionalDesktop

%DEFINE performs no source substitution and declares no assembler symbol. Dependencies may test entry definitions but may not add definitions. Body conditionals may select ordinary source but cannot add includes or definitions.

The desktop preprocessor replaces directive and inactive lines with spaces while preserving CR and LF bytes. The CP/M provider validates leading %INCLUDE directives and turns them into assembler comments. Both retain the original line and byte positions for diagnostics.