Skip to content

Appendices01

Appendix 1 — Directive Reference

The table lists AZM directives and declaration keywords. Dotted directives use canonical lowercase forms and are case-sensitive. See Chapter 7 for the alias layer that normalises legacy undotted forms.

DirectiveSyntaxWhat it doesCh.
.org.org exprSets the assembly address counter to expr; assembly-time only3
.equNAME .equ exprBinds NAME to the constant value of expr; assembly-time only3
.if.if exprAssembles the following branch when expr is non-zero3
.else.elseSelects the alternate branch of a conditional block3
.endif.endifCloses a conditional block3
.db.db expr[,expr…]Emits one or more 8-bit values; accepts string literals4
.dw.dw expr[,expr…]Emits one or more 16-bit little-endian values4
.ds.ds count[,fill]Reserves count bytes; optional fill byte; accepts type expressions4, 5
.include.include "path"Inserts the named source file at this point7
.import.import "path"Loads a source unit and exposes declarations marked with @7
.routine.routine [noreturn] [in ...] [out ...] [maybe-out ...] [clobbers ...] [preserves ...]Starts a routine and declares its register contract6
.contracts`.contracts strictauditoff`
.rcignore.rcignore finding "reason"Suppresses one local finding with required reason text6
.expectout.expectout carriersMarks outputs intentionally consumed from the next emitted instruction in the same file6
.align.align nAdvances the address to the next multiple of n, inserting zero bytes3
.cstr.cstr "text"Emits string bytes followed by a $00 terminator (C-style)4
.pstr.pstr "text"Emits a length byte followed by string bytes (Pascal-style)4
.istr.istr "text"Emits string bytes with bit 7 set on the final byte4
.binfrom.binfrom addrMarks the start address of the flat binary output range3
.binto.binto addrMarks the end address of the flat binary output range3
.end.endMarks the end of source; AZM stops assembling at this point
.typeName .type.endtypeOpens a record layout declaration block5
.endtype.endtypeCloses a .type block5
.unionName .union.endunionOpens a union layout declaration block5
.endunion.endunionCloses a .union block5
.fieldname .field TypeExprDeclares a field of any type inside a .type or .union block5
.bytename .byteDeclares a one-byte scalar field inside a .type or .union block5
.wordname .wordDeclares a two-byte scalar field inside a .type or .union block5
.addrname .addrDeclares a two-byte address field inside a .type or .union block5
.typealiasName .typealias TypeExprTransparent assembler-time alias for a layout type expression5
.enumName .enum Member[,…]Declares a group of integer constants with qualified names (Name.Member)3
op / endop name(params)endDeclares an inline instruction-expansion op7

Directive aliases

Project-specific forms such as DEFB, DEFW and RMB require a project alias file loaded with --aliases. See Chapter 7.

Built-in aliases (normalized before parsing):

AliasCanonical
ORG.org
EQU.equ
DB.db
DW.dw
DS.ds
INCLUDE.include
END.end
ALIGN.align
CSTR.cstr
PSTR.pstr
ISTR.istr
BINFROM.binfrom
BINTO.binto

Register contract carrier notation

Carriers in a .routine directive are comma-separated register names, flag names or register pair names. Register pairs expand to their constituent 8-bit registers during analysis:

Pair notationExpands to
BCB,C
DED,E
HLH,L
IXIXH,IXL
IYIYH,IYL
SPSPH,SPL
AFA,carry,zero,sign,parity,halfCarry
Fcarry,zero,sign,parity,halfCarry

Individual flag names are carry, zero, sign, parity and halfCarry. C names register C. Chapter 6 describes the complete contract format.

The pair and flag-set spellings against the carriers the analyzer tracks