Skip to content

DEDSWIN/Architecture-assembler-emulator

Repository files navigation

2-Pass Assembler and Emulator for Simple Accumulator-based Machine

This repository contains a 2-pass assembler implemented in C++ for a simple instruction set architecture (ISA) of an accumulator-based machine, along with an emulator to execute the assembled object code.

Table of Contents

Introduction

This project serves as a CS210 course (assembly language programming and computer architecture) project under Prof. Jimson Matthew. The aim is to design and implement a 2-pass assembler capable of translating assembly language programs written for a simple accumulator-based machine into machine code, and subsequently, an emulator to execute the generated machine code.

Features

  • 2-Pass Assembler: The assembler processes assembly language programs in two passes, handling symbol resolution, generating machine code, and producing an object file and listing file.

  • Emulator: The emulator executes the assembled object code, simulating the behavior of the target accumulator-based machine.

  • Simple Instruction Set: The instruction set of the target machine is intentionally kept simple to facilitate understanding and implementation. See Instruction set in project description pdf.

Usage

  1. Clone the repository:

    git clone https://github.com/your-username/2-pass-assembler.git
    
  2. Navigate to the project directory:

    cd 2-pass-assembler
    
  3. Complie & Run the assembler:

    running scripts are given in Makefile.txt

Assembler Details

The assembler consists of two passes:

  1. Pass 1: In the first pass, the assembler scans the assembly code, building a symbol table and resolving symbolic addresses.

  2. Pass 2: In the second pass, the assembler generates machine code based on the resolved addresses and produces the object code and listing file.

Emulator Details

The emulator reads the object code generated by the assembler and simulates the behavior of the target accumulator-based machine. It executes each instruction sequentially, updating the accumulator and other relevant registers as necessary. Outputs a memory dump.

Contributing

Contributions are welcome! If you find any bugs or have suggestions for improvements, feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published