lc3_ensemble

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§

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

Structs§

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

Enums§

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

Functions§

  • Assembles a assembly source code AST into an object file.
  • Assembles a assembly source code AST into an object file.