Share your repls and programming experiences

← Back to all posts
Compiler + Virtual machine
tree5673 (8)

A virtual machine that comes with a basic compiler

There is documentation in the readme.md file.

The compiler can compile files of any length

Usage (Simple)

type in the terminal the following:

"sh quick.sh"
for a quick test

Usage (Advanced)

To assemble a program:
./main asm <input_file> <output_file>

The provided source code file is 'src_code'
and the provided output file is 'bytecode_text'

To execute a program:
./main exec <bytecode> <coming soon: data>

The virtual machine is 32-bit and uses registers.
It reads machine code from a file into a program array and decodes the instruction (splits the instruction into three parts) so that the machine can execute them.

I am working on labels, which can be used to create functions.

I am also adding a data segment which will be used for storing variables.

Commentshotnewtop
tree5673 (8)

If you are interested, you can read this:
https://en.wikibooks.org/wiki/Creating_a_Virtual_Machine/Register_VM_in_C
It has a lot of good information if you want to make a VM and helped my out a lot with the decode function.

StudentFires (286)

Hey @tree5673! We're embarking on a small project, okay, it's not too small, but me and a small group of programmers are creating a language, we have a VM, a Git, a specification, some other stuff.

We've started this week and have already made major progress, would you be interested in joining us?
If this is really your code, then your skill set would be of great use to us.

If you're interested in at least checking it out, please ping me.

tree5673 (8)

@StudentFires I had the intention of making a VM and a compiler/assembler myself, but I can help. Can you send me a link?

tree5673 (8)

@StudentFires I do. Should I send a request?

StudentFires (286)

@tree5673 Where would you send the request? Are you on the Repl.it Discord server?

CodeSalvageON (383)

dude awesome job fake ass langs and os is on repl talk basically all day while this cool stuff is slept on repl.it must change

CSharpIsGud (370)

This is an amazing repl that needs more than 3 upvotes

JuanR4140 (12)

what is your opinion of you not getting as much recognition as 10 year olds that import classes and call them an OS?

StudentFires (286)

(This is a modified version of the repl I posted previously)

What Repl? This is your first apparently. And first post.

tree5673 (8)

@StudentFires I deleted them. I realized they were not worthy of being on repl.it after posting this since others would see my other post.

StudentFires (286)

@tree5673 Really suspicious, but whatever.

StudentFires (286)

As @CSharpIsGud can attest to this, unfortunately, real languages / parsers / compilers don't get any recognition on Repl.it.