- Home
- Skills
- APIs & Backend
- tiny-stack-vm
Tiny Stack vm
by Haiyang Lan
Deterministic Node.js interpreter for Tiny Stack ISA v1 bytecode with built-in resource limits and trap codes.
$5
tiny-stack-vm
Example session with this skill installed
Run the program in examples/i001/ using the Tiny Stack VM and report the output and exit status.
- Read your context and instructions
- Compiled the tiny-stack-vm
The interpreter executed the bytecode program located in the examples directory. The process completed within the step limit and generated the following results.
VM Execution Result
| Metric | Value |
|---|---|
| Instance ID | i001 |
| Exit Code | 0 |
| Status | SUCCESS |
| Output Size | 14 bytes |
| Data Stack Usage | 4 / 256 |
| Return Stack Usage | 2 / 64 |
Standard Output (stdout.bin)
Result: 42
Execution Log Summary
- Loaded
program.bin: 128 bytes. - Initialized 256-word memory and stack.
- Executed PUSH and arithmetic instructions.
- Invoked PRINT for decimal output.
- HALT reached at step 842.
Next steps
- Review
out/i001/exit.txtto confirm the return code is exactly 0. - Modify
input/i001/input.binto test the program with different parameters. - Add new PUSH32 operations to the bytecode to test larger integer handling.
Connects securely to your tools. The creator never sees your data.
About this skill
Interpreting custom bytecode for stack machines often requires bulky dependencies or complex virtual machines. This skill provides a lightweight, deterministic interpreter for the Tiny Stack ISA v1, designed for high-performance execution without external libraries.
What it does
- Execute bytecode runs binary programs on a 256-word data stack and 64-deep return stack.
- Manage memory provides a dedicated 256-word address space for data persistence during execution.
- Deterministic execution enforces a 1,000,000-step execution limit and 65,536-byte output limit.
- Trap handling identifies and reports runtime errors including stack overflows, division by zero, and invalid memory access.
- Standard I/O processes raw input bytes and produces binary output via
PUTCandPRINToperations.
How it works
- Prepare instances by placing
program.binandinput.binfiles into specific subdirectories within an input folder. - Execute the VM using a Node.js command that points to your input and output directories.
- Verify results by checking the generated
stdout.binfor output andexit.txtfor the specific exit code status.
Frameworks & tools
Built for Node 22 using only the standard library. No external NPM packages or network access required.
Why this beats prompting it yourself
Writing a stack machine from scratch requires meticulous attention to bitwise arithmetic and stack pointer logic. This skill implements the full ISA v1 spec with hardened trap codes and deterministic limits already configured.
Use cases
- Language development to test compilers targeting stack-based architectures.
- Educational tools for demonstrating low-level CPU operations and stack logic.
- Sandboxed execution of untrusted bytecode with strict resource constraints.
Known limitations
Strict hardware limits of 256 words for data stack and memory. Node 22 or higher is required for execution.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 11 days ago
Permissions
What's inside
Frequently Asked Questions
New in APIs & Backend
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.