Z-code disassemblers

#1

I believe I have read of programs other than TXD that can disassemble Z-code files, but my Google-fu fails me. What other disassemblers exist?

Note: Not really interested in decompilers, which try to produce Inform or ZIL source code.

0 Likes

#2

I released a disassembler several years ago, which is available at http://bocfel.org/zdevtools_downloads/zdevtools-20110529.tar.gz.

It’s source code only, and requires a POSIX environment to build. The output is very similar to TXD, and in most cases it’s a lot more limited than TXD (it doesn’t try to track down things like action routines, etc, which require some knowledge of Inform and Infocom game layouts). It can handle non-Inform/Infocom programs better than TXD, though. The archive above also contains an assembler which can create valid Z-code programs that TXD is unable to disassemble.

I’ve also been working on a new “visual” disassembly mode, which looks like:

┌────────────────────────────────────────────────────────────────────┐
│4f05: call_vs (main routine 4f04)                                   │
└────────────────────────────────────────────────────────────────────┘
 ┌─ Variable form
 │  ┌─ VAR
 │  │     ┌─ @call_vs
┌┴┐ │ ┌───┴───┐
1 1 1 0 0 0 0 0

Operand types:
 ┌─ Large constant
 │   ┌─ Large constant
 │   │   ┌─ Large constant
 │   │   │   ┌─ Omitted
┌┴┐ ┌┴┐ ┌┴┐ ┌┴┐
0 0 0 0 0 0 1 1

Operand 0: 00101010 00111001 (10809)
Operand 1: 10000000 00010000 (32784 / -32752)
Operand 2: 11111111 11111111 (65535 / -1)

Call: 5472

Store: 00000000 (0) -> -(SP)

If there’s any interest in this, maybe I’ll work on getting it into release shape.

0 Likes