Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita078913

Browse files
committed
Added see-also section
1 parent274455b commita078913

File tree

1 file changed

+34
-23
lines changed

1 file changed

+34
-23
lines changed

‎README.md‎

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1+
*[simple.vm](#simplevm)
2+
*[Compilation](#compilation)
3+
*[Implementation Notes](#implementation-notes)
4+
*[Embedding](#embedding)
5+
*[Instructions](#instructions)
6+
*[Simple Example](#simple-example)
7+
*[Fuzz Testing](#fuzz-testing)
8+
*[See Also](#see-also)
19

2-
* Git Repository:
3-
*http://github.com/skx/simple.vm
410

5-
**NOTE**: A golang port of the virtual-machine compiler and interpreter is available from the following repository:
11+
#simple.vm
612

7-
*https://github.com/skx/go.vm
8-
9-
10-
simple.vm
11-
---------
12-
13-
This repository contains the implementation for a simple virtual-machine, along with a driver which will read a program from a file and execute it via that virtual machine.
13+
This repository contains the implementation for a__simple__ virtual-machine, along with a driver which will read a program from a file and execute it via that virtual machine.
1414

1515
In addition to the virtual machine interpreter you'll also find:
1616

@@ -26,22 +26,19 @@ This particular virtual machine is intentionally simple, but despite that it is
2626
This particular virtual machine is register-based, having ten registers which can be used to store strings or integer values.
2727

2828

29-
Compilation
30-
-----------
29+
#Compilation
3130

3231
Because the compiler and decompiler are written in Perl they need no special
3332
treatment.
3433

3534
The interpretter, written in C, can be built like so:
36-
C intepreter:
3735

3836
$ make
3937

4038
This will generate`simple-vm` and`embedded` from the contents of[src/](src/).
4139

4240

43-
Implementation Notes
44-
--------------------
41+
#Implementation Notes
4542

4643
Implementing a basic virtual machine, like this one, is a pretty well-understood problem:
4744

@@ -76,8 +73,7 @@ After compilation is complete all the targets should have been discovered and th
7673
>**NOTE**: The same thing applies for other instructions which handle labels, such as storing the address of a label, making a call, etc.
7774
7875

79-
Embedding
80-
---------
76+
#Embedding
8177

8278
This virtual machine is designed primarily as a learning experience, but it is built with the idea of embedding in mind.
8379

@@ -95,8 +91,7 @@ There is an example of defining a custom opcode in the file `src/embedded.c`. T
9591

9692

9793

98-
Instructions
99-
------------
94+
#Instructions
10095

10196
There are several instruction-types implemented:
10297

@@ -163,8 +158,7 @@ The following are examples of all instructions:
163158
ret # Return from a called-routine.
164159

165160

166-
Simple Example
167-
--------------
161+
##Simple Example
168162

169163
The following program will just endlessly output a string:
170164

@@ -196,8 +190,7 @@ If you wish to debug the execution then run:
196190
There are more examples stored beneath the`examples/` subdirectory in this repository. The file[examples/quine.in](examples/quine.in) provides a good example of various features - it outputs its own opcodes.
197191

198192

199-
Fuzz Testing
200-
------------
193+
#Fuzz Testing
201194

202195
If you wish to fuzz-test with[afl](http://lcamtuf.coredump.cx/afl/) you should find that pretty straight-forward:
203196

@@ -225,6 +218,24 @@ Now you have `./samples/` containing only compiled programs. You can then mutat
225218
226219
We set the environmental variable`FUZZ` to contain`1` solely to disable the use of the`system()` function. Which might accidentally remove your home-directory, format your drive, or[send me a donation](https://steve.fi/donate/)!
227220

221+
#See Also
222+
223+
A golang port of the virtual-machine compiler and interpreter is available from the following repository:
224+
225+
*https://github.com/skx/go.vm
226+
227+
In addition to that you can find a_real_ virtual-machine inside the embedded scripting engine I wrote, also for golang. In that case a scripting language is parsed and converted into a series of bytecode instructions, which are executed by a virtual machine. Similar to this project, but the bytecode operations are more complex and high-level:
228+
229+
*https://github.com/skx/evalfilter
230+
231+
If you're interested in compilers, and interpreters, generally you might enjoy these other projects too:
232+
233+
*https://github.com/skx/gobasic
234+
* A simple BASIC interpreter
235+
*https://github.com/skx/bfcc
236+
* A[brainfuck](https://en.wikipedia.org/wiki/Brainfuck) compiler
237+
*https://github.com/skx/math-compiler
238+
* A simple compiler for mathematical expressions.
228239

229240
Steve
230241
--

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp