Coder Social home page Coder Social logo

simple-vm's Introduction

Simple VM

This is a very simple implementation of a computer with the SAP-1 (Simple As Possible) architecture fromDigital Computer Electronics by Albert Paul Malvino.

The direct influence was of course Ben Eater's excellent youtube series building this 8-bit computer on breadboards.

I started this project for two reasons. Firstly, I didn't want to foot the bill for all those breadboards. Secondly, I wanted to learn the C progrmmaing language and the Windows Console API.

Capabilities

The computer currently has 9 machine instructions defined by Ben. These are NOP, LDA, ADD, SUB, STA, LDI, JMP, OPT and HLT. (OPT should really be OUT but for compiler reasons I had to use a different macro name.)

Currently pre-compiled into the binary are three sample programs:

  • 14 + 28
  • Multiples of 3
  • Fibonacci Generator

Preview

Here's a screenshot demonstrating the program running.

8-bit computer screenshot

The computer can be controlled via the keyboard and can be made to step through micro-instructions one-by-one.

Usage

vm [program_file]

The VM can run a binary file of machine instructions provided on the command line. See http://github.com/IJMacD/simple-assembler for an assembler to create the binary file.

If a program file is not provided the three built-in programs can be switched with the number keys.

Components

  • A Register
  • B Register
  • Clock
  • Instruction Register
  • Program Counter
  • RAM
    • Address
    • Contents
  • ALU
  • Output
  • Bus Indicator
  • Control
  • Microcode EEPROM

simple-vm's People

Contributors

ijmacd avatar

Watchers

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