SkillAgentSearch skills...

JSVM

Javascript virtual machine is one instruction set machine to parse and execute an assembly like code.

Install / Use

/learn @jawb/JSVM
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

JSVM

Javascript virtual machine is one instruction set machine to parse and execute an assembly like code. This machine is written to be used by students studying compilers and willing to test and debug generated byte code in a simple manner.

1. Instruction set

| Instruction | Argument | Description | | ------------|:--------:| :----------------------------------------------| | #String: | - | Define label | | PUSH | #Number | Push a number to the stack (32bit) | | POP | - | Pop from stack | | DATA | #String | Define variable with name | | STORE | #String | Put head in variable | | LOAD | #String | Push variable's value to stack | | ADD | - | Addition | | SUB | - | Substruction | | MULT | - | Multiplication | | DIV | - | Division | | MOD | - | Remainder | | AND | - | And | | OR | - | Or | | XOR | - | Exclusive or | | Not | - | Ones' complement | | RAS |#Number<32| Right arithmetic shift | | RBS |#Number<32| Right binary shift | | LS |#Number<32| Left shift | | LT | - | Lower than | | LE | - | Lower or equal to | | JMP | #Label | Unconditional jump to label | | BEQ | #Label | Branch to label if equal | | BNE | #Label | Branch to label if not equal | | PRINT | - | Print integers in stack as characters until \0 | | PRINTN | - | Print number head of stack | | READ | - | Read string and push it to stack | | READN | - | Read number (32bit) and push it to stack |

2. Features

  • Drag and drop byte code file
  • Step by step execution
  • Full code execution
  • GUI: Stack, Symbol table and Program counter

3. Todo

  • Tests and fixes
  • Add more instructions
  • Add a framebuffer
  • Better strings support
  • Older browsers support

Enjoy !

View on GitHub
GitHub Stars167
CategoryDevelopment
Updated17d ago
Forks5

Languages

CSS

Security Score

95/100

Audited on Mar 15, 2026

No findings