Click here to Skip to main content
13,048,027 members (73,117 online)
Click here to Skip to main content
Add your own
alternative version


11 bookmarked
Posted 14 May 2014

A Full-Featured Z80/8085 Assembler in C++

, 14 May 2014
Rate this:
Please Sign up or sign in to vote.
A full-featured Z80/8085 assembler in C++


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: Opcodes and clock cycle information can be found at and

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.


  • Initial version


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Gregory Morse
Software Developer (Senior)
United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionGreat Pin
Manikandan1018-May-14 3:12
memberManikandan1018-May-14 3:12 
Generalmy vote of 5 Pin
Southmountain15-May-14 6:01
memberSouthmountain15-May-14 6:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170713.1 | Last Updated 14 May 2014
Article Copyright 2014 by Gregory Morse
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid