| Crates.io | swamp-vm-disasm |
| lib.rs | swamp-vm-disasm |
| version | 0.2.26 |
| created_at | 2025-03-18 10:00:36.645544+00 |
| updated_at | 2025-08-18 11:22:35.698846+00 |
| description | disassembler for the opcodes in the swamp vm |
| homepage | |
| repository | https://github.com/swamp/swamp |
| max_upload_size | |
| id | 1596442 |
| size | 62,965 |
Provides functions to translate Swamp Virtual Machine (VM) bytecode (BinaryInstruction from swamp-vm-types) into a human-readable, assembly-like textual representation. This is primarily useful for debugging the Swamp compiler backend or inspecting generated bytecode.
This crate takes the low-level, packed BinaryInstruction structs used by the Swamp VM and converts them into formatted strings that represent the instruction's opcode and operands in a more understandable way. It interprets the raw operand values based on the specific opcode, identifying them as frame memory addresses, constant addresses, immediate values, instruction pointers, etc.
$001A for frame address, @#00000005 for constant address).disasm_color, disasm_instructions_color) that use ANSI terminal colors (via the yansi crate) to visually distinguish different operand types (e.g., reads vs. writes, frame vs. constant, temporary vs. persistent frame variables).disasm_no_color, disasm_instructions_no_color) for environments where color is not desired or supported.ip_infos) into the output.FrameMemorySize).Add this to your Cargo.toml:
[dependencies]
swamp-vm-disasm = "0.2.26"
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) Peter Bjorklund. All rights reserved. https://github.com/swamp/swamp