Collapse OS Documentation Browser


asm/ code/ hw/ algo.txt arch.txt avr.txt blk.txt blksrv.txt bootstrap.txt cross.txt design.txt dict.txt dis.txt drivers.txt ed.txt emul.txt faq.txt grid.txt grok.txt impl.txt intro.txt me.txt mspan.txt ps2.txt rxtx.txt sdcard.txt sega.txt selfhost.txt spi.txt usage.txt wordtbl.txt


Some architectures (6502 and 6809 for now) include a disassemb-
ler in addition to an assembler. The loader word follows the
same pattern as the assemblers: it lives in ARCHM and ends with
"D". Examples: 6502D 6809D

All disassemblers require the corresponding assembler to be
loaded first.

Once loaded, they supply the word "dis ( addr -- )" which prints
DISCNT lines (by default 20) of disassembled memory starting at
"addr". DISCNT is a VALUE, so you can change it with TO.

Disassembly formatting tries to stay close to the "manufacturer
language" rather than the assembler language. For example,
the 6809 disassembly of "$42 X+N ADDA," is "ADDA 42,X".

We lose symmetry with assembler, but we gain general readabili-
ty. During assembly, we are constrained by Forth semantics, but
with disassembly, we aren't. We can afford to make ourselves
closer to manufacturer language.

Numbers are always hexadecimal and width matter. "2a" means that
an 8b literal was extracted from the opcode and "002a" means
that a 16b literal was.

Some opcodes are invalid, so you'll get "???" outputs. From the
first of these that you get, you can consider the rest of the
output to be garbage because opcodes are "out of sync".

Collapse OS and its documentation are created by Virgil Dupras and licensed under the GNU GPL v3.

This documentation browser by James Stanley. Please report bugs on github or to

This page generated at 2023-12-05 21:05:04 from documentation in CollapseOS snapshot 20230427.