Gyo is a single-cycle Forth virtual machine.
This virtual machine was created as a result of experimenting with stack-effect checking and so was designed around the idea that each opcode is encoded with its own stack effect. The layout of the opcodes is inspired by Koopman's Stack Computer: The New Wave.
More details shortly.
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| 1 | Literal | ||||||||||||||
| 0 | 1 | Call | |||||||||||||
| 0 | 0 | 1 | Conditional Call | ||||||||||||
| 0 | 0 | 0 | ALU | WSD | RSD | IO(N,T) | [T]=N | R=T | PC=R | ||||||
Assembly
The programming of this computer is akin to writing Forth programs. At the assembly level, opcodes are made from various mnemonics:
| ALU | WSD | RSD | Flags | ||||||||||
| t | T | n | N | m | [T] | r | R | a | +1 | e | +1 | d | IO(N,T) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| & | N&T | ^ | N^T | | | N|T | i | 1+T | U | -2 | V | -2 | w | [T]=N |
| = | N==T | > | N>=T | \ | N>>T | / | N<<T | u | -1 | v | -1 | x | R=T |
| + | N+T | - | N-T | ; | PC=R | ||||||||
14R10— Gyo Release