An assembler for the Intel 80386
Post-It Fix-Up in Perl
This page is about how the
Post-It Fix-Up principle
works
out in practical program code for Perl.
DESCRIPTION
Contrary to the Forth version the
80386 assembler written in Perl has no comprehensive error
checking and no disassembly facilities.
So on incorrect input they will just assemble garbage.
Neither has it (as yet)
a classical two-pass assembler that would allow labels.
The assembler is split over a small interpreter,
that is quite general.
The tables with the 80386 information are in fact almost the same
than those used in the Forth assemblers.
That information is interpreted, and the resulting tables could
be burned into a Perl program.
The mnemonic names, that were stored in a vocabulary in Forth
are stored in hashes in Perl.
Once the tables with mnemonics are present the assembler is
ready to interpret assembler files,
that are in the exact same format than the Forth assemblers.
For a description of the format, consult the assembler section in
the ciforth, e.g. lina documentation.
The Perl version
can be used to assemble swiftly sources that have been
debugged,
up to 20 times faster than the Forth version.
All tables from the
Forth assemblers can be adapted to Perl,
but this has only been done for the 80386.
This is mainly needed for the commaers and
exceptional
situations such as the SIB byte in Intel.
DOWNLOAD
This system can be downloaded as a
distribution for Linux.
Go to the home page of Albert van der Horst