Added article

This commit is contained in:
Dmitriy Shishkov 2021-04-22 01:21:29 +05:00
parent de36eb5040
commit f16b3fc389
No known key found for this signature in database
GPG Key ID: 7CAE12ED13853CAC
3 changed files with 34 additions and 2 deletions

View File

@ -0,0 +1,31 @@
The idea of creating my own virtual machine came to my mind a year ago. Then I didn't have enough skills and desire. But now, when I have my final exams in a month and a half, I started working on this project.
## Overview
It is a stack-based virtual machine that runs simple byte-code. Currently, it supports basic stack operations (push, pop), arithmetic operations, input-output, and strings. Assembly language is a sequence of commands with/(or without) parameters. Assembly language compiler and runner are combined to one binary with *build* and *run* commands resp.
Every command is represented as 4 bytes number. It can have arguments each of which is a 4 bytes number.
Every string is initialized with zero number in the stack. Currently, the only command using this structure is *OUTS*. It puts characters from stack to console until it reaches zero — end of the string.
## File structure
### Header
Total number of commands - 4 bytes
### Body
A sequence of command structures:
### Command
Command code - 4 bytes
(Optional) Arguments - 4 bytes per each
## Plans
It is just a test stand. After exams, I'm planning to dramatically refactor VM code, change bytecode structure by decreasing command size, and adding string declaration in the header. I'm also going to add conditions and jumps for loop support.
Also, there are plans for separating compiler and VM core. If I will read find information about bootloader development, I will also try to create a bootloader for this VM to run it natively.

View File

@ -1,2 +1,3 @@
1594048366 My_first_article_on_this_site
1606819380000 Ugra_Hantaton
1606819380000 Ugra_Hantaton
1619034957605 Stack_VM_V1.0

View File

@ -21,7 +21,7 @@ body {
background-color: var(--background);
border-top: solid 5px var(--accent);
padding: 45px;
color: var(--accent)
color: var(--accent);
}
a {