Welcome to the SIC Assembler Simulator!
This project is a Python implementation of an assembler for the Simplified Instructional Computer (SIC) architecture. The SIC Assembler consists of two main components: pass_one.py
and pass_two.py
.
The SIC Assembler converts assembly language programs written for the SIC architecture into object code that can be executed on a hypothetical SIC machine. It follows a two-pass assembly process:
-
Pass One (
pass_one.py
): This component reads the assembly source code and generates an intermediate file along with a symbol table. The intermediate file contains the assembly instructions and their corresponding addresses, while the symbol table maintains a mapping of labels to their addresses. -
Pass Two (
pass_two.py
): In this pass, the intermediate file and symbol table generated in Pass One are used to produce the final object code. Pass Two resolves any symbolic addresses, calculates absolute addresses, and generates the object code accordingly.
pass_one.py
: Responsible for the first pass of the assembly process.pass_two.py
: Handles the second pass of the assembly process.
python pass_one.py <source.asm> <init.mdt>
<source_file.asm>
: Path to the assembly source file.<init.mdt>
: Name of the output Intermediate file.
python pass_two.py <intermediate_file.mdt> <ouput.obj>
<intermediate_file.mdt>
: Path to the intermediate file generated by Pass One.<output.obj>
: Name of the output object file.
Here's how you can assemble a sample SIC program:
-
Run Pass One:
python pass_one.py source.asm
This will generate an intermediate file and Display a symbol table. -
Run Pass Two:
python pass_two.py intermediate.mdt
This will produce the final object code.
- Python 3.x
Contributions are welcomed! If you'd like to contribute to the project, feel free to fork the repository, make your changes, and submit a pull request.
π Happy assembling! πβ¨