Implemented HLT instruction
- Instructions are now detected automatically based on context - Since MIPs can't decide if it wants to be open or not, Corten will be aiming to be more of a RISC-V VM in the long term.
This commit is contained in:
parent
76af517a49
commit
86f060e0f5
10 changed files with 120 additions and 31 deletions
|
@ -1,6 +1,6 @@
|
|||
# Welcome
|
||||
|
||||
Corten is a [MIPS64 Release 6](https://en.wikipedia.org/wiki/MIPS_architecture#MIPS32/MIPS64_Release_6) virtual machine written in Rust as a hobby and based on Fletcher Haynes's [So you want to build a language VM](https://blog.subnetzero.io/post/building-language-vm-part-01/) tutorial.
|
||||
Corten is a [RISC-V](https://rv8.io/isa.html) virtual machine written in Rust as a hobby and based on Fletcher Haynes's [So you want to build a language VM](https://blog.subnetzero.io/post/building-language-vm-part-01/) tutorial.
|
||||
|
||||
## Specifications
|
||||
|
||||
|
|
14
docs/spec.md
14
docs/spec.md
|
@ -1,14 +1,14 @@
|
|||
# Specifications
|
||||
|
||||
## Instruction Set
|
||||
## Instruction Set
|
||||
|
||||
| Opcode | Function | Comment |
|
||||
| Code | Operation | Comment |
|
||||
| --- | --- | --- |
|
||||
| 0 | LOAD | Load program |
|
||||
| 1 | ADD |
|
||||
| 2 | SUB |
|
||||
| 3 | MUL |
|
||||
| 4 | DIV |
|
||||
| 1 | ADD | Add |
|
||||
| 2 | SUB | Subtract
|
||||
| 3 | MUL | Multiply |
|
||||
| 4 | DIV | Division |
|
||||
| 5 | HLT | Halt |
|
||||
| 6 | JMP | Jump |
|
||||
| 7 | JMPF | Jump forward |
|
||||
|
@ -20,5 +20,5 @@
|
|||
| 13 | LTE | Less then or equal to |
|
||||
| 14 | LT | Less then |
|
||||
| 15 | JMPE | Jump if equal |
|
||||
| 16 | NOP |
|
||||
| 16 | NOP | No Operation |
|
||||
| _ | IGL | Illegal action |
|
Reference in a new issue