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

Commit7ee4fe7

Browse files
committed
Updated text a little - in the golang-port area
1 parent3b4dfeb commit7ee4fe7

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

‎README.md‎

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ In addition to the virtual machine itself you'll also find:
1616
* Several[example programs](examples/).
1717
* An example of[embedding](embedded.c) the virtual machine in a C host program.
1818
* Along with the definition of a custom-opcode handler.
19+
* A golang-interpreter for our bytecode.
1920

2021
This particular virtual machine is intentionally simple, but despite that it is hopefully implemented in a readable fashion. ("Simplicity" here means that we support only a small number of instructions, and the registers the virtual CPU possesses can store strings and integers, but not floating-point values.)
2122
This particular virtual machine is register-based, having ten registers which can be used to store strings or integer values.
@@ -180,12 +181,14 @@ There are more examples stored beneath the `examples/` subdirectory in this repo
180181
Golang Port
181182
-----------
182183

183-
The virtual-machine which executes the bytecode is written in C,so for fun
184+
The virtual-machine which executes the bytecode is written in C,but for fun
184185
I thought it would be interesting to port it to golang.
185186

186-
The result is`main.go` which executes some of the programs, it will terminate
187-
when it reaches an instruction which hasn't been implemented. For the moment
188-
it runs a few of the examples:
187+
The result is`main.go` which executes most of the sample programs, for those
188+
that it cannot execute it will cleanly terminate when it reaches a bytecode
189+
instruction which hasn't been implemented.
190+
191+
Sample usage:
189192

190193
$ ./compiler examples/jump.in
191194
$ go run main.go examples/jump.raw
@@ -202,20 +205,15 @@ Similarly you can run the looping example:
202205
Counting from ten to zero
203206
10
204207
9
205-
8
206-
7
207-
6
208-
5
209-
4
210-
3
211-
2
212-
1
208+
..
209+
..
213210
0
214211
Done
215212

216213
If you wish to submit a pull request implementing the missing opcodes I'd
217214
be happy to accept it :)
218215

216+
219217
Fuzz Testing
220218
------------
221219

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp