🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.forth
Article #230

Re: writing an AVR disassembler

#230
From: albert
Date: Mon, 16 Nov 2026 13:49
34 lines
2305 bytes
In article <UOSz15Vn9V7SG_X-@violet.siamics.net>,
Ivan Shmakov  <ivan@siamics.netREMOVE.invalid> wrote:
>       I've decided to write an AVR disassembler in Forth, and while
>       I'm reasonably confident that I do most of the actual decoding
>       correctly by now, I'm much less confident of my, so to say,
>       "design choices," and would appreciate constructive criticism
>       on that matter.

You may be interested in
https://github.com/albertvanderhorst/ciasdis
(8080 8086 8038 pentium pentium64 dec-alpha riscv 6809)

There I define assembler parts (mnemonics, parameters) in
a table. These objects can be used to assemble as well as disassemble.
The principle is explained in
    https://home.hccnet.nl/a.w.m.van.der.horst/postitfixup.html
The 8080 definition is a mere 30 lines.
A simplification can do only assembling, and result in a
100 line Pentium assembler with floating point instruction but
exclusive all extensions.

See
    https://github.com/albertvanderhorst/ciforth
This assembler is in the file blocks.frt (a regular source file),
ignore everything else.
Try to understand line 2960 and up. This should be perfectly
fit for a minimal implementation of an assembler.
[I never thought of an excerpt of ciasdis to do a disassembler. ]

Groetjes Albert
-- 
The Chinese government is satisfied with its military superiority over USA.
The next 5 year plan has as primary goal to advance life expectancy
over 80 years, like Western Europe.
Technical Details
Message-ID: <nnd$7db92bde$51dc9da3@1be066804088f8e4>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!panix!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!abo003.abavia.com!feed.abavia.com!abr001.abavia.com!abp001.abavia.com!reseller!not-for-mail
References: <UOSz15Vn9V7SG_X-@violet.siamics.net>

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.forth
References: <UOSz15Vn9V7SG_X-@violet.siamics.net>
From: albert@spenarnc.xs4all.nl
Subject: Re: writing an AVR disassembler
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$7db92bde$51dc9da3@1be066804088f8e4>
Organization: www.abavia.com
Date: Mon, 16 Nov 2026 14:49:50 +0100
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!panix!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!abo003.abavia.com!feed.abavia.com!abr001.abavia.com!abp001.abavia.com!reseller!not-for-mail
Lines: 35
Injection-Date: Mon, 16 Nov 2026 14:49:50 +0100
Injection-Info: reseller; mail-complaints-to="abuse@abavia.com"