diff --git a/static/articles/Stack_VM_V1.0/Stack_VM_V1.0.md b/static/articles/Stack_VM_V1.0/Stack_VM_V1.0.md new file mode 100644 index 0000000..503f4cf --- /dev/null +++ b/static/articles/Stack_VM_V1.0/Stack_VM_V1.0.md @@ -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. diff --git a/static/articles/list.db b/static/articles/list.db index 0ee42ff..33fd5b7 100644 --- a/static/articles/list.db +++ b/static/articles/list.db @@ -1,2 +1,3 @@ 1594048366 My_first_article_on_this_site -1606819380000 Ugra_Hantaton \ No newline at end of file +1606819380000 Ugra_Hantaton +1619034957605 Stack_VM_V1.0 \ No newline at end of file diff --git a/static/style.css b/static/style.css index c956d9a..96a6853 100644 --- a/static/style.css +++ b/static/style.css @@ -21,7 +21,7 @@ body { background-color: var(--background); border-top: solid 5px var(--accent); padding: 45px; - color: var(--accent) + color: var(--accent); } a {