https://github.com/lnsp/jame
A machine emulator for learning purposes.
https://github.com/lnsp/jame
javascript machine virtual
Last synced: 12 days ago
JSON representation
A machine emulator for learning purposes.
- Host: GitHub
- URL: https://github.com/lnsp/jame
- Owner: lnsp
- License: mit
- Created: 2014-10-11T21:35:10.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-07-29T16:39:06.000Z (almost 9 years ago)
- Last Synced: 2025-07-27T17:04:54.019Z (11 months ago)
- Topics: javascript, machine, virtual
- Language: JavaScript
- Homepage: https://lnsp.github.io/jame
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
jame
====
A JavaScript machine emulator.
## Opcodes
| Opcode | Description |
|--------|-------------|
| `ADD x y ` | Add, stores result in x |
| `SUB x y ` | Subtration, stores result in x |
| `MUL x y ` | Multiplication, stores result in x |
| `DIV x y ` | Division, stores result in x
| `MOD x y ` | Modulo, stores result in x
| `CMP x y ` | Compares the values, stores result in x (0 -> x smaller, 1 -> equal, 2 -> x greater)
| `MRK x ` | Marks the line with the marker adress stored in x
| `JMP x ` | Jumps to the marker adress stored in x
| `JIF x y ` | Jumps to the marker adress stored in x, when y equals 1
| `LDM x y ` | Loads data from volatile memory into register
| `STM x y ` | Stores data from register in volatile memory
| `CPY x y ` | Copies the value from y to x
| `MOV imm x` | Moves the value into register x
| `OUT imm x` | Sends data from the register to the device
| `IN imm x` | Receives data from the device stack (-1 -> no data available) (not implemented)
| `TIM x ` | Stores the value of milliseconds since 1.1.1970 in the register