The Design and Implementation of the Yasm Assembler

Peter Johnson


Revision History
Revision 1222 2005-08-31 PJ


This document describes the internals of the yasm assembler. It is written by and for the developers of yasm, not for the users. It is not necessary to read or understand any part of this document unless you are working with yasm's source code or are just plain curious how yasm works internally.

Note that this design document may not always be in sync with the source code, although we try to do our best to update this document when changes are made to the source. If you notice any discrepencies, please feel free to fix them (or at least notify the development group about it).

Table of Contents

1. Material Covered in this Book
1. Goals
1.1. Key Internal Features
2. Architecture
3. Data Structures
3.1. Bytecodes
3.1.1. Bytecode Design Goals
3.1.2. Bytecode Data
3.2. Sections
4. Parsing
5. Coding Style
5.1. Portability
5.2. Formatting and Indentation

List of Figures

2.1. Pipeline Architecture of Yasm
2.2. Modular Architecture of Yasm
2.3. Yasm Support Modules
2.4. Built-out Yasm (example)