Giter Club home page Giter Club logo

vm-emulator's Introduction

vm-emulator

This repository contains a virtual machine emulator which was written in C for a school assignment. I received a grade of 20/20 on this assignment.

The emulator, compiled from vm.c as described below, will interpret and execute assembly code written in a simplified subset of the x86 assembly language. The repository contains four sample input files written in this assembly subset: fact.vm, fib.vm, jsr.vm, and loop.vm.

The intent of the project is to demonstrate how an emulator can be used to execute assembly code rather than executing the assembly code natively. There are two main reasons a user would want to use an emulator:

  1. The assembly code is in an assembly language that differs from the user's platform (i.e. if this emulator were compiled and run on an ARM platform, it could be used to execute the sample x86 assembly code input files which could not be executed natively on an ARM platform)
  2. The user wishes gather profiling statistics describing the execution of the input code

The source code of my emulator is in vm.c and can be compiled simply with gcc -Wall -Wextra vm.c -o vm. The usage of the compiled executable is ./vm inputfile.vm.

In addition to interpreting and executing the input assembly code, the emulator will also gather profiling statistics describing the basic blocks of the program represented by the assembly code, and the frequency with which each basic block is executed. Profiling statistics will be written to profile.txt, which will be overwritten if it already exists.

vm-emulator's People

Contributors

charlesdrews avatar

Watchers

James Cloos avatar M. Gonzalez avatar  avatar

Forkers

fabgithub

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.