Module asm

Source
Expand description

Assembling assembly source ASTs into object files.

This module is used to convert source ASTs (Vec<Stmt>) into object files that can be executed by the simulator.

The assembler module notably consists of:

  • assemble and assemble_debug: The main functions which assemble the statements into an object file.
  • SymbolTable: a struct holding the symbol table, which stores location information for labels after the first assembler pass
  • ObjectFile: a struct holding the object file, which can be loaded into the simulator and executed

Modules§

encoding
Formatters which can read and write memory object files into disk.

Structs§

AsmErr
Error from assembling given assembly code.
ObjectFile
An object file.
SourceInfo
Struct holding the source string and contains helpers to index lines and to query position information from a source string.
SymbolTable
The symbol table created in the first assembler pass that encodes source code mappings to memory addresses in the object file.

Enums§

AsmErrKind
Kinds of errors that can occur from assembling given assembly code.

Functions§

assemble
Assembles a assembly source code AST into an object file.
assemble_debug
Assembles a assembly source code AST into an object file.