Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [virtual-machine]

A Virtual Machine is a software based emulation of computer hardware.

Filter by
Sorted by
Tagged with
3 votes
2 answers
369 views

Extremely simple virtual machine in Rust

I wrote a very simple VM to get a bit more familiar with Rust. The VM architecture was not the focus, so that I think that can safely ignored. Is my code idiomatic and clean? I felt that I was very ...
xilpex's user avatar
  • 289
3 votes
1 answer
205 views

Simple stack based interpreter

This was inspired by the question Passing Programs To A Stack Machine Implemented In C++. I wanted to make it a bit smarter by adding control functions: instruction op1 op2 op3 description ...
jdt's user avatar
  • 2,362
2 votes
0 answers
81 views

Small language, compiles to register VM bytecode

I am trying to implement a small programming language, in Nim, as a way of improving my (close to non-existent) programming skills. The programming language is intended to have IF-GOTO, variables, and ...
LearningPython's user avatar
2 votes
1 answer
64 views

Tiny attempt at a register machine in Nim

I am attempting to learn the Nim language by making a small and simplistic register machine. It is intended to interpret some basic instructions. The entire parsing lexing process consists of ...
LearningPython's user avatar
3 votes
1 answer
380 views

Node backend to run user-submitted code in a virtual machine

As per the title, I'm making a webapp that is intended to use as a JS exercise platform. Problems are shown to users, they submit code, that code is run against a few test cases, and a report of the ...
Samuele B.'s user avatar
10 votes
2 answers
643 views

An attempt at a toy Vm

I usually use c++ so it may not be best practice for c. This is a stack based toy vm and as a result it is very primitive, and it has no bitwise instructions 64k might be a bit overkill for a toy vm. ...
SomeDude's user avatar
  • 109
8 votes
2 answers
2k views

Simpletron simulator in C

I implemented a Simpletron simulator in C for learning C. Simpletron is a virtual machine invented by Deitel for his books. Simpletron runs programs written in the Simpletron Machine Language, an ...
phillbush's user avatar
  • 864
3 votes
0 answers
97 views

PowerShell script to execute Docker maintenance, optionally non-interactively

Problem Developers in my team are new to Docker. I wanted to provide a way to accomplish general Docker housekeeping tasks (like pruning unused images and compacting the Hyper-V volume) largely ...
msanford's user avatar
  • 391
3 votes
1 answer
456 views

Simpletron in C without initial storing [closed]

I'm studying C with a Deitel's book. The book asks me to write a program that simulates a virtual PC (with virtual memory in an array called memory[100]). Then the ...
Alex's user avatar
  • 81
2 votes
1 answer
291 views

C++ class for a flag register in a Chip8 emulator

In order to learn C++ I decided to code a Chip8 emulator following a tutorial. When I came across the idea of a flag register and decided it would be fun to implement in order to get familiar with ...
HermanTheGermanHesse's user avatar
10 votes
1 answer
1k views

Gameboy emulator in C

I've been coding a Gameboy emulator in C for some time(seems like a common project for people). It's reasonably functional and has some MBC1 support, but has some minor graphical glitches still. I'...
Benjamin Crew's user avatar
7 votes
1 answer
678 views

Chip 8 Emulator in JavaScript

Lately I've had interest in an emulation. During my free time I worked in this chip 8 emulator. I believe I have a good chip 8 implementation but my canvas use and draw functions may need a review. ...
Angel's user avatar
  • 73
2 votes
2 answers
143 views

Process a list of instructions and output the max value reached

Inputs looks like this b inc 5 if a > 1 a inc 1 if b < 5 c dec -10 if a >= 1 c inc -20 if c == 10 I am concerned that I need to declare ...
Poutrathor's user avatar
3 votes
1 answer
594 views

Virtual Machine in C to run C

Basically ANOTHER follow up to this review here but I've set about in completing the software project. Changes from the previous review is that I've added a complete script format with embedding API, ...
Nergal's user avatar
  • 513
6 votes
1 answer
1k views

Bitfield class and Register depiction

For a few months now I have been working with an ARM CPU. To be specific an ARM Cortex M3 from STM (STM32107VC). Complete example So far I am using the StdPeriphal library, and will continue to do so ...
ExOfDe's user avatar
  • 553
5 votes
1 answer
2k views

CPU emulator in Java

I recently started new project - a CPU emulator in Java. Base code is written, now I can start to slowly implement new things, but I want code review to be done, to reformat code before it messes up. ...
Jump3r's user avatar
  • 175
8 votes
0 answers
2k views

Small Virtual Machine executing its own byte-code

I want present to you my little Virtual Machine. It nothing really sophisticated. It is an stack only virtual machine with the exception for some 'global' variables which i would count as registers ...
ExOfDe's user avatar
  • 553
3 votes
1 answer
250 views

C virtual machine 3rd follow up

coming again from previous questions on this, I've expanded the virtual machine a little bit in terms of a direct API to read and write data to the VM. I've attempted to add a callback system so that ...
Nergal's user avatar
  • 513
2 votes
2 answers
188 views

C virtual machine V2

This is another follow up from my previous follow up and this time I segmented the stack and memory into bytes so that it follows more closely to most machines. As I stated on my previous peer reviews,...
Nergal's user avatar
  • 513
6 votes
1 answer
318 views

Simple virtual machine in C - follow-up

I've previously put my virtual machine for review and I've applied the changes and more to the code. This is iteration 2 and I'd like to remind the reviewers that this virtual machine is meant to be ...
Nergal's user avatar
  • 513
7 votes
2 answers
5k views

Simple virtual machine in C

I've been learning about compiled and interpreted languages. I decided to start somewhere by writing a virtual machine designed for a C-like language. I already plan to add other features like a ...
Nergal's user avatar
  • 513
2 votes
0 answers
145 views

Chip-8 Emulator in Zsh

I've spent the last few weeks writing a Chip-8 emulator in zsh. It doesn't run in bash but the syntax is nearly identical. I have it on a GitHub repo here: https://github.com/hcorion/chipzsh a ...
hcorion's user avatar
  • 21
2 votes
1 answer
810 views

Op-code decoding in an emulator

I've written the larger part of an emulator for a 6502 CPU but my method of op-code decoding is giving me concern, mainly because of how long the method is getting but also because I need a variable ...
Ross Drew's user avatar
  • 309
3 votes
1 answer
2k views

Chip 8 Emulator

I've recently started learning OpenGL and thought that a great way to start using it in its simplest form would be to create a Chip8 emulator using the keyboard callbacks and graphics that GLFW and ...
user avatar
4 votes
1 answer
903 views

Decoding 32-bit MIPS instructions

For a homework assignment I've been given the task of parsing out information from an 32-bit MIPS instruction. (For more information on the instruction formats, see here). The instructor has provided ...
kylemart's user avatar
  • 153
7 votes
2 answers
739 views

6502 CPU emulator in Java

I want to make sure I won't have to go back and redo large chunks of code. I have each opcode as a value in an enum that implements Runnable. Is there a more ...
Codeblox's user avatar
2 votes
0 answers
353 views

Interpreter for an assembly language with variadic instructions

I am currently implementing a virtual machine that runs a programming language similar to assembly. The difference is that an instruction in this language can have any number of operands. and the ...
user avatar
7 votes
1 answer
1k views

A simple register VM written in Rust

I'm teaching myself Rust, and to do this I've written a toy register based virtual machine. I hope the code is easy to follow - I just want to know if there are any mistakes I am making with the ...
Leigh Shepperson's user avatar
6 votes
1 answer
1k views

Simple virtual machine in Rust

About I'm trying to implement a simple virtual machine. Now it supports only three operations: ADD(reg0, reg1, reg2) -> reg0 = reg1 + reg2 ...
KolesnichenkoDS's user avatar
4 votes
2 answers
151 views

FizzBuzz in ToyVM

Since I have my own virtual machine and an assembler for it, I decided to test it with a FizzBuzz implementation. I have this: fizzbuzz.toy ...
coderodde's user avatar
  • 28.4k
11 votes
1 answer
3k views

ToyVM - a small and simple virtual machine in C - follow-up

(See the previous and initial iteration) Now I have refactored the code in order to conform to the suggestions made in the answers to the first iteration. I have this: toyvm.h: ...
coderodde's user avatar
  • 28.4k
9 votes
2 answers
392 views

ToyVM - a small and simple virtual machine in C + FizzBuzz demonstration

(See also the next iteration.) I have this small virtual machine. What is there: Stack and, thus, recursion. Conditional and unconditional jumps and, thus, choice and iteration. What is not there:...
coderodde's user avatar
  • 28.4k