Skip to content

Atom Appendices01

Appendix 1 — Directive Reference

Atom has two directive layers. Bare assembler directives run in the native Z80 core. % host directives are consumed during filesystem preparation and never reach the native tokenizer. Both layers are case-insensitive.

Assembler directives

DirectiveSyntaxEffect
EQUNAME EQU EXPR or NAME: EQU EXPRDeclares one resolved constant without changing private scope
ORGORG EXPRSets the logical output cursor; emits no byte
DBDB ITEM[,ITEM…]Emits low bytes from expressions and decoded double-quoted strings
DWDW EXPR[,EXPR…]Emits little-endian words
DSDS COUNTReserves uninitialised bytes and advances the cursor
DSDS COUNT,FILLEmits COUNT initialized fill bytes
ALIGNALIGN BOUNDARYEmits zeros to the next address divisible by a positive boundary
INCBININCBIN "PATH"Emits one complete confined host binary snapshot
CSTRCSTR "TEXT"Emits decoded bytes followed by zero
PSTRPSTR "TEXT"Emits a decoded-byte count followed by the bytes
ISTRISTR "TEXT"Sets bit 7 on the final decoded byte; empty text emits nothing

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.

Host directives

DirectiveSyntaxEffect
%DEFINE%DEFINE NAME VALUEBinds one immutable 16-bit host value in the entry header
%INCLUDE%INCLUDE "PATH"Adds one import-once dependency edge from a leading part header
%IF%IF VALUESelects the following branch when the value is non-zero
%ELSE%ELSESelects the alternate branch
%ENDIF%ENDIFCloses the current host conditional

%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 host masks directive and inactive lines with spaces while preserving CR and LF bytes.