AZM Book 0 — Assembler Manual
This is the definitive reference for the AZM assembler format and tooling. It documents the source syntax, directives, expressions, layout types, register contracts, op declarations, compatibility features, diagnostics and output formats that define AZM source files.
Read this first when you want the assembler rules directly. If you want a guided introduction to Z80 programming before using the reference, start with AZM Book 1 — Z80 Fundamentals.
Learning arc
- Getting started — what AZM is, how it fits with Debug80, what a small program looks like and how to invoke the CLI.
- Source syntax and symbols — parser rules, labels, the
@entry prefix, forward references, case rules and naming conventions. - Addresses, constants and expressions —
.org,$,.equ, expression operators, range checks and enums. - Raw data, storage and strings —
.db,.dw, little-endian byte order, string directives and.ds. - The layout system — scalar types,
sizeof,offset, records with.type, type aliases with.typealias, unions with.unionand compact cast syntax. - Register care and contracts — a concrete collision example,
@entry labels, AZMDoc;!syntax, conflict checking and the audit-to-error workflow. - Ops and aliases — inline op declarations, operand classes, overloads, directive compatibility and source file inclusion.
- Diagnostics and output — error codes, how to read a failing build, warnings vs errors and output artifacts.
Chapter table
| Ch | File | What it covers |
|---|---|---|
| — | Preface | Audience, assumptions and the purpose of the manual |
| 1 | Getting Started with AZM | Debug80 integration, source extensions, a first program and basic invocation |
| 2 | Source Syntax and Symbols | Line structure, comments, labels, @ entries, naming conventions, case rules and numeric literals |
| 3 | Addresses, Constants and Expressions | .org, $, .equ, expressions, range checks and enums |
| 4 | Raw Data, Storage and Strings | .db, .dw, little-endian byte order, string directives and .ds |
| 5 | The Layout System | Scalar types, sizeof, offset, records, type aliases, unions and compact cast syntax |
| 6 | Register Care and Contracts | Register collisions, @ entry labels, AZMDoc ;! syntax, conflict checking and the audit-to-error workflow |
| 7 | Op Declarations and Aliases | Inline op declarations, operand classes, overloads, directive compatibility and source file inclusion |
| 8 | Diagnostics and Output | Error codes, reading a failing build, warnings vs errors and output artifacts |
Appendices
| Appendix | File | What it covers |
|---|---|---|
| A | Directive Reference | All directives with syntax, purpose and chapter reference; built-in alias table |
| B | Expression Operators | Operator table with precedence and numeric literal formats |
| C | CLI Flag Reference | All command-line flags grouped by category |
| D | Built-in Functions | sizeof, offset, LSB and MSB — syntax, return values and case rules |
The general AZM Books appendices cover number notation, registers, flags, addressing forms and Z80 instruction support.