Coder Social home page Coder Social logo

8086-sim's Introduction

8086 Sim

A simulation of a basic 8086 processor written in Go, implementing a subset of the processor's features.

Written for fun and practice learning go.

Current state of the project

Currently, this project is only capable of decoding and outputting a disassembly of a binary containing a limited subset of the instructions supported by the 8086, and it does not support execution of any.

Supported Instructions

Instruction Decoding Disassembly Execution Description
MOV y y n Transfer a byte or word from source to destination.
PUSH n n n Decrements the stack pointer and transfers a word from the source to the stack.

Current TODO list

  • implement disassembly for push
    • disambiguate properly between operations with the same first byte
      • need to implement a peak function in DataStream

Future Plans

This is very much in a proof of concept phase at the moment. I may eventually have the time to implement support for the full 8086 instruction set but for now I am happy to have written a framework that would make it relatively simple (if time consuming) to do so.

Requirements

  • Go
  • Make

Building

  1. Clone this repository
  2. Run make in the root directory to build the project.
  3. The binary is in the bin directory

Running the project

There are a few sample 8086 binaries in the data folder along with their source code. They were assembled with NASM.

To run the binary you will need to provide a path to the binary to run. For example you could run this from the root directory:

./bin/8086-sim -disassemble -in data/many_mov

To access the help run the binary with the argument -h.

Credits

8086-sim's People

Contributors

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