Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [virtual-machine]

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

2
votes
1answer
301 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 ...
2
votes
1answer
69 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 ...
8
votes
1answer
355 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'...
8
votes
1answer
316 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. ...
2
votes
2answers
86 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 ...
3
votes
1answer
145 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, ...
6
votes
1answer
308 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 ...
4
votes
1answer
472 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. ...
6
votes
0answers
708 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 ...
3
votes
1answer
154 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 ...
2
votes
2answers
111 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,...
6
votes
1answer
149 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 ...
7
votes
2answers
797 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 ...
2
votes
0answers
73 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 ...
2
votes
1answer
128 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 ...
3
votes
1answer
1k 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 ...
4
votes
1answer
209 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 ...
7
votes
2answers
287 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 ...
1
vote
0answers
226 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 ...
6
votes
1answer
657 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 ...
4
votes
1answer
629 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 ...
4
votes
2answers
122 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 ...
11
votes
1answer
2k 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: ...
9
votes
2answers
256 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:...