In article <UOSz…@violet.siamics.net>,
Ivan Shmakov <iv…@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.