Git Product home page Git Product logo

assembly-interpreter's Introduction

Assembly-interpreter

This is a 32-bit computer architecture simulator that compiles and runs assembly code defined by the architecture.

Purpose

The intention of the project is to understand how modern computers work.

It's possible to define new microinstructions for the computer following the model in examples/firmware3.hpp, save the microinstruction address in src/assembler/consts.hpp, add them to the array of instructions, and set them into the set_ops(string& line, unsigned long int &oper) function found in src/assembler/assembler.cpp.

Microarchitecture

The model of the microarchitecture is based on the book "Structured Computer Organization" by author Andrew S. Tanenbaum. The instruction set can be found in examples/firmware3.

Microarchitecture diagram

Here is an illustration of the microarchitecture in a diagram.

Usage

Prerequisites

  • GNU C++ Compiler (g++)
  • GNU Make installed

On Debian-based Linux distributions, run sudo apt install make g++

How to run?

  1. Clone the repository:

    git clone https://github.com/WandersonSoares00/Assembly-interpreter
    
  2. Change the directory:

    cd Assembly-interpreter
    
  3. Compile the project:

    make all
    
  4. Generate a binary of a .asm program with the assembler. Take the program questions/fat.asm as an example, run the following command:

    ./assembler questions/fat.asm outBin
    
  5. Copy the binary into memory and run a computer:

    ./comp outBin
    

    By default, the computer prints the words 1 and 2 of memory in the screen to simulate the standard output.

License information

This project is licensed under the GNU General Public License v3.0.

assembly-interpreter's People

Contributors

gaabirel avatar wandersonsoares00 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.