Module asm

Module asm 

Source
Expand description

This module holds the AST for statements from assembly source code.

For instructions that map to bytecode instructions (i.e., the hex representation of assembly instructions), see sim::SimInstr.

Useful structs in this module include:

  • AsmInstr: An enum of all possible assembly source code instructions
  • Directive: An enum of all possible assembly source code directives
  • Stmt: The format for a single “statement” in assembly source code

Structs§

Stmt
A “statement” in LC-3 assembly.

Enums§

AsmInstr
An enum representing all of the possible instructions in LC-3 assembly code.
Directive
An enum representing all the possible directives in LC-3 assembly code.
StmtKind
Either an instruction or a directive.

Functions§

disassemble
Attempts to disassemble bytecode back into assembly instructions.
disassemble_line
Attempts to disassemble a line of bytecode back into an assembly instruction, returning a .fill directive if not possible.
try_disassemble_line
Attempts to disassemble a line of bytecode back into an assembly instruction, returning None if it cannot be disassembled.