Omikron BASIC Disassembly & Decompilation

Omikron BASIC shipped in the box with German Atari STs and powered a huge catalogue of utilities, business software, and games. Compiled Omikron programs either bundle a compact loader stub that calls an external BASLIB, or statically link BASLIB/CUTLIB directly into the .PRG, placing compiled user 68000 code, line tables, INLINE machine-code blocks, and $611A LIBRARY modules inside the .data segment.

In a plain disassembler, compiled Omikron code looks like opaque JSR $1380+4*slot(A5) calls, mysterious inline counted strings after JSR $13EC(A5), and raw data bytes in .data. rg-dis understands both compiled Omikron executables and tokenised Omikron .BAS files:

rg-dis GAME.PRG -o GAME.S                                  # annotated 68000 disassembly
rg-dis --decompile GAME.PRG -o GAME.ASC                    # lift compiled PRG to Omikron BASIC
rg-dis --decompile SOURCE.BAS -o SOURCE.ASC                # detokenise Omikron .BAS → ASCII
rg-dis GEM.LIB -o GEM.S                                    # disassemble $611A LIBRARY module

Jump to Decompilation (--decompile) or 68000 Disassembly.

Decompilation (--decompile)

Pass --decompile to detokenise Omikron BASIC .BAS editor files into clean ASCII listings or lift compiled Omikron executables back into readable BASIC statements and DATA lines.

Before (compiled JSR (A5) calls)

    JSR       $13EC(A5)
    DC.W      14
    DC.B      "RESERVOIR GODS"
    RTS

After (rg-dis --decompile)

10 PRINT "RESERVOIR GODS"
20 END

68000 Disassembly

BASLIB Dispatch & Workspace Equates

Compiled Omikron code dispatches runtime routines through A5-relative jump slots starting at $1380(A5) and stores interpreter state in documented A5 workspace fields ($60(A5)..$1288(A5)). rg-dis resolves both to named comments and equates:

Before

    MOVE.L    $60(A5),D0
    JSR       $13EC(A5)
    DC.W      14
    DC.B      "RESERVOIR GODS"

After

    MOVE.L    $60(A5),D0                  ; str_heap: Omikron string heap cursor
    JSR       $13EC(A5)                   ; om_print_lit: PRINT inline counted string literal ("RESERVOIR GODS")

.data Code, Line Tables, INLINE & $611A Libraries

Unlike standard C binaries, compiled Omikron programs place their 68000 user code inside .data starting at offset $30, followed by the BASIC line-number table, embedded INLINE machine-code blocks, and any linked $611A LIBRARY extension modules (such as GEM.LIB). rg-dis maps each region cleanly, decodes 6-byte (!) and 10-byte (#) Thomas Kemp floating-point constants inline, and disassembles embedded INLINE and LIBRARY code as 68000 instructions instead of raw DC.W data.