Skip to content

πŸ’½ 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.

Notifications You must be signed in to change notification settings

Mhijazi16/SIC-Assembler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

33 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SIC Assembler

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.

Overview πŸ“œ

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:

  1. 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.

  2. 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.

Files πŸ“‹

  • pass_one.py: Responsible for the first pass of the assembly process.
  • pass_two.py: Handles the second pass of the assembly process.

Usage πŸš€

Pass One

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.

Pass Two

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.

Example πŸ—Ώ

Here's how you can assemble a sample SIC program:

  1. Run Pass One: python pass_one.py source.asm This will generate an intermediate file and Display a symbol table.

  2. Run Pass Two: python pass_two.py intermediate.mdt This will produce the final object code.

Requirements πŸ› οΈ

  • Python 3.x

Contributions 🀝🧢

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! πŸš€βœ¨

About

πŸ’½ 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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published