FLUX Disassembler — Turns silicon back into words
A C11 disassembler that converts FLUX bytecode (binary or hex) into human-readable assembly listings.
flux-disasm reads FLUX bytecode produced by flux-asm and displays it as labeled, indented assembly text. Supports both binary files and hex input from stdin.
# Clone
git clone https://github.com/Lucineer/flux-disasm.git
cd flux-disasm
# Compile
gcc -Wall -Wextra -std=c11 -Werror -O2 -o flux-disasm src/flux-disasm.c
# Disassemble a binary file
./flux-disasm program.bin
# Disassemble hex from stdin
echo "04 2A 00 05 00 0B" | ./flux-disasm
# Roundtrip with assembler
./flux-asm test.asm | ./flux-disasmaarch64-linux-gnu-gcc -Wall -Wextra -std=c11 -Werror -O2 -o flux-disasm src/flux-disasm.c; flux-disasm: 29 bytes
0000: PUSH 0x2A
0003: POP r0
0005: PUSH 0x3A
0008: POP r1
000A: CADD r2 r0 r1
000E: MOV r3 r2
0011: CONF_SET r3 0x5F
0015: TELL r0 r1
0018: ATP_GEN r4
001A: ATP_USE r4
001C: HALT
The disassembler understands all FLUX operand formats:
| Mode | Description | Size | Example |
|---|---|---|---|
| OP_NONE | No operands | 0 bytes | HALT |
| OP_R | Single register | 1 byte | POP r0 |
| OP_RR | Two registers | 2 bytes | MOV r3 r2 |
| OP_RR_RI | Three registers | 3 bytes | CADD r2 r0 r1 |
| OP_R_RI16 | Register + u16 immediate | 3 bytes | JZ r3 0x5F |
| OP_I16 | Single u16 immediate | 2 bytes | PUSH 0x2A |
| Category | Opcodes |
|---|---|
| Control | NOP, MOV, LOAD, STORE, PUSH, POP, JMP, JZ, JNZ, CALL, RET, HALT |
| Arithmetic | CADD, CSUB, CMUL, CDIV |
| Confidence | CONF_FUSE, CONF_CHAIN, CONF_SET, CONF_THRESH |
| Compare | CMP_EQ, CMP_NE, CMP_LT, CMP_GT |
| A2A | TELL, ASK, DELEGATE, BROADCAST, REDUCE |
| Trust | TRUST_CHECK, TRUST_UPDATE, TRUST_QUERY |
| Instinct | INSTINCT_ACT, INSTINCT_QRY |
| Energy | ATP_GEN, ATP_USE, ATP_QRY, ATP_XFER, APOPTOSIS |
| System | DBG_PRINT, BARRIER, RESOURCE |
./flux-disasm program.binReads raw bytes from a file.
echo "04 2A 00 0B" | ./flux-disasmPairs of hex digits (space, newline, or tab separated).
./flux-asm test.asm | xxd -r -p | ./flux-disasm# Assemble → disassemble → should match original
echo 'PUSH 42
POP r0
HALT' | flux-asm | flux-disasm
# Output: PUSH 0x2A / POP r0 / HALT ✓Verified with flux-asm: 29-byte program, all opcodes roundtrip correctly.
| Tool | Repo | Description |
|---|---|---|
| flux-runtime-c | C11 | Execute FLUX bytecode |
| flux-asm | C11 | Assemble text to bytecode |
flux-disasm is the lightweight C disassembler in the fleet toolchain — perfect for embedded environments and cross-compilation where Python runtimes aren't available. It pairs with the Python-based flux-decompiler which adds jump resolution, control flow annotation, and labeled output.
Fleet toolchain flow:
flux-asm → [bytecode] → flux-disasm (C, lightweight)
↘ flux-decompiler (Python, annotated)
↘ flux-timeline (tracing)
↘ flux-profiler (profiling)
↘ flux-debugger (debugging)
flux-decompiler— Python decompiler with annotationsflux-signatures— Pattern detection in bytecodeflux-timeline— Execution tracingflux-profiler— Performance profilingflux-debugger— Step debugger
MIT
Built by JetsonClaw1 — verified on Jetson Super Orin Nano 8GB, ARM64 Part of the SuperInstance FLUX fleet.