This is G o o g l e's cache of http://211.92.88.40/~minus273/page.php/KauyokVM as retrieved on 9 Aug 2005 05:00:42 GMT.
G o o g l e's cache is the snapshot that we took of the page as we crawled the web.
The page may have changed since that time. Click here for the current page without highlighting.
This cached page may reference images which are no longer available. Click here for the cached text only.
To link to or bookmark this page, use the following url: http://www.google.com/u/KennedySchool?q=cache:bUMqsPbkengJ:211.92.88.40/~minus273/page.php/KauyokVM+site:211.92.88.40&hl=en&ct=clnk&cd=42&ie=UTF-8


Google is neither affiliated with the authors of this page nor responsible for its content.

KauyokVM -- Minus273's Homepage

Minus273's Homepage -> KauyokVM

Name/名字

KauyokVM, "Kauyok" means "Education".
KauyokVM,“Kauyok”意为“教育”。

Structure/结构

Much simplier than NMachine. Only a stack and a memory.
比NMachine简单多了。只有一个堆栈和一块内存。
The stack is composed of DATA ELEMENTS(an integer, a single), not bytes. So does the memory, but the memory also supports strings.
堆栈是由“数据元素”(一个整数或单精度小数)构成的,不是字节。内存也一样,但是支持字符串。

Premature Specification

Introduction and Notes

All integers are in network byte order.

The Structure of a Data File

The first four bytes of the file is "kyvm",
The next two bytes are the version of the machine, currently 00 00.
The next two bytes are the number of segments.
The next contents are divided to several segments.
Segment 1:

Opcodes

pxpy means pops x elements off the stack and pushes y elements on the stack
The poped elements are called a, b, c... The pushed elements are called p, q, r... All in pushing order.
00 nop: Does nothing
01 call [byte A]: Call routine A
02 jmp [word A]: Jump to byte A
03 if [word A]: p1p0, Jump to byte A if a is non-zero
04 lod [4bytes A]: Load a constant to the top of the stack
05 add: p2p1, p=a+b
06 sub: p2p1, p=a-b
07 mul: p2p1, p=ab signed
08 div: p2p1, p=a/b signed
09 umul: p2p1, p=ab unsigned
0a udiv: p2p1, p=a/b unsigned
0b mod: p2p1, p=a MOD b signed
0c and: p2p1, p=a AND b
0d or: p2p1, p=a OR b
0e xor: p2p1, p=a XOR b
0f not: p1p1, p=NOT a
10 log: p1p1, p=(0: a==0, 1: a!=0)
11 ugt: p2p1, p=(a>b unsigned)
12 uge: p2p1, p=(a>=b unsigned)
13 sgt: p2p1, p=(a>b signed)
14 sge: p2p1, p=(a>=b signed)
15 fadd
16 fsub
17 fmul
18 fdiv
19 fgt
1a fge: Like add sub mul div sgt sge, but operates on signed single float
1b dup: p1p2, p=a, q=a
1c swp: p2p2, p=b, q=a
1d equ: p2p1, p=(a=b signed)
1e lda [word A]: p0p1, p=mem[(A)]
1f sta [word A]: p1p0, mem[(A)]=a
20 wlda [word A]: p1p1, p=mem[(A+a)]
21 wsta [word A]: p2p0, mem[(A+b)]=a
21 iinc [byte a]: p1p0, increases the value of address specified, by signed byte a
30

81 print_str [string a]: prints content of UTF-8 string a
82 wprint: p1p0, prints content of address specified (if integer, signed)
82 newline: prints a new line
83 getstring: p1p0, get a string from somewhere and store at address specified}
5 Newest Blogs
Aug 8 2005 TsinghuaMormons: Mormons dominating Tsinghua foreign language department?/摩门教统治清华外语系?
Aug 6 2005 WanderersNachtlied: A translation of Wanderers Nachtlied/《流浪者之夜歌》的翻译
Aug 5 2005 DieSont: The Song of Counter-revolutionaries in Cultural Revolution/文革的嚎歌zz
Jul 29 2005 HavaMal: Havamal Translation/翻译:高话
Jul 28 2005 CoolCursing: Cool cursing/骂人到了这境界

Back to FrontPage | Edit this page