The task of assembling an assembly language source file into a machine readable output is at the basis of modern computing despite all the modern compilers and interpreted languages that are now built on top of the basic machine language. The Z80/8085 is a basic but complete instruction set that allows conceptual learning and thinking about the topics of assembler without going in depth into special processor features.
Coming soon: A Windows program with editor and dialog (requested in comments), basic simulator for CP/M.
Familiarity with C++, assembly language, Z80/8085, Backus Naur Form (BNF), parsing, tokenizing, semantic and syntactic checking are preferable.
Using the Code
Using the class is as easy as passing in a readable assembler file for input with a writeable listing file and writeable hex format file for output (both in "w" text format).
Assemble(inputFile, listFile, hexFile, fileName);
Points of Interest
Assertions are used for internal errors where execution can continue safely while blind throws are placed in for any critical internal errors generally representing a bug in the code as they should be impossible to reach if the design is correct. Thrown errors for syntactic and semantic errors are used.
Cycle checking is implemented using a form of depth first search algorithm through any symbol table expressions.
The Intel hex format is used. See: http://www.keil.com/support/docs/1584.htm. Opcodes and clock cycle information can be found at http://www.z80.info/z80code.htm and http://www.z80.info/zip/z80-documented.pdf.
Expressions are used extensively and due to the recursive use have allowed a greater set of possibilities in the assembler input than would ordinarily be seen.