📄 as_en.html
字号:
<P><H2><A HREF="#sect_I_">I. Hints for the AS Source Code</A></H2>
<P><H3><A HREF="#sect_I_1_">I.1. Language Preliminaries</A></H3>
<P><H3><A HREF="#sect_I_2_">I.2. Capsuling System dependencies</A></H3>
<P><H3><A HREF="#sect_I_3_">I.3. System-Independent Files</A></H3>
<P><H4><A HREF="#sect_I_3_1_">I.3.1. Modules Used by AS</A></H4>
<P><H4><A HREF="#sect_I_3_2_">I.3.2. Additional Modules for the Tools</A></H4>
<P><H3><A HREF="#sect_I_4_">I.4. Modules Needed During the Build of AS</A></H3>
<P><H3><A HREF="#sect_I_5_">I.5. Generation of Message Files</A></H3>
<P><H4><A HREF="#sect_I_5_1_">I.5.1. Format of the Source Files</A></H4>
<P><H3><A HREF="#sect_I_6_">I.6. Creation of Documentation</A></H3>
<P><H3><A HREF="#sect_I_7_">I.7. Test Suite</A></H3>
<P><H3><A HREF="#sect_I_8_">I.8. Adding a New Target Processor</A></H3>
<P><H3><A HREF="#sect_I_9_">I.9. Localization to a New Language</A></H3>
<P><H1><A HREF="#sect_bib">Bibliography
</A></H1>
<P><H1><A HREF="#sect_index">Index
</A></H1>
<P>
<H1><A NAME="sect_1_">1. Introduction</A></H1>
<P>
This instruction is meant for those people who are already very
familiar with Assembler and who like to know how to work with AS. It
is rather a reference than a user's manual and so it neither tries to
explain the ''language assembler'' nor the processors. I have listed
further literature in the bibliography which was substantial in the
implementation of the different code generators. There is no book I
know where you can learn Assembler from the start, so I generally
learned this by ''trial and error''.
<P>
<H2><A NAME="sect_1_1_">1.1. License Agreement</A></H2>
<A NAME="ref_SectLicense"></A>
<P>
Before we can go ''in medias res'', first of all the inevitable
prologue:
<P>
As in the present version is licensed according to the Gnu General
Public License (GPL); the details of the GPL may be read in the file
COPYING bundled with this distribution. If you did not get it with
AS, complain to the one you got AS from!
<P>
Shortly said, the GPL covers the following points:
<UL>
<LI> Programs based upon AS must also be licensed according to the
GPL;</LI>
<LI> distribution is explicitly allowed;</LI>
<LI> explicit disclaiming of all warranties for damages resulting from
usage of this program.</LI>
</UL>
...however, I really urge you to read the file COPYING for the
details!
<P>
To accelerate the error diagnose and correction, please add the
following details to the bug report:
<UL>
<LI> hardware:
<UL>
<LI> processor type (with/without coprocessor)</LI>
<LI> amount of memory installed</LI>
<LI> video card</LI>
<LI> hard-disk type(s) and their interface(s)</LI>
</UL>
</LI>
<LI> software:
<UL>
<LI> operating system (MS-DOS, Novell-DOS, DR-DOS, OS/2, Windows) and
version</LI>
<LI> resident (TSR) programs installed</LI>
<LI> version of AS including dates of the<TT> EXE</TT>-files</LI>
</UL>
</LI>
<LI> if possible, the source file, in which the bug occurs</LI>
</UL>
You can contact me as follows:
<UL>
<LI> by Surface Mail:
<DL COMPACT>
<DD> Alfred Arnold</DD>
<DD> Hirschgraben 29</DD>
<DD> D-52062 Aachen</DD>
<DD> Germany</DD>
</DL>
</LI>
<LI> by E-Mail:<TT> alfred@ccac.rwth-aachen.de</TT></LI>
</UL>
If someone likes to meet me personally to ask questions and lives
near Aachen (= Aix-la-Chapelle), you will be able to meet me there.
You can do this most probably on thursdays from 8pm to 9pm at the
computerclub inside the RWTH Aachen (Eilfschornsteinstrasse 16,
cellar of philosophers' building, backdoor entry).
<P>
Please don't call me by phone. First, complex relations are extremely
hard to discuss at phone. Secondly, the telephone companies are
already rich enough...
<P>
The latest version of AS (DOS, DPMI, OS/2, C) is available from the
following Server:
<PRE>
http://john.ccac.rwth-aachen.de:8000/as
</PRE>
or shortly
<PRE>
http://www.alfsembler.de
</PRE>
The sources of the C version may also be fetched from the following
server:
<PRE>
sunsite.unc.edu, directory
pub/Linux/devel/lang/assemblers/asl-<version>.tar.gz
</PRE>
..and of course thereby from every Sunsite mirror in the world!
<P>
Whoever has no access to an FTP-Server can ask me to send the
assembler by mail. Only requests containing a blank CD-R and a
self-addressed, (correctly) stamped envelope will be answered. Don't
send any money!
<P>
Now, after this inevitable introduction we can turn to the actual
documentation:
<P>
<H2><A NAME="sect_1_2_">1.2. General Capabilities of the Assembler</A></H2>
<P>
In contrast to ordinary assemblers, AS offers the possibility to
generate code for totally different processors. At the moment, the
following processor families have been implemented:
<UL>
<LI> Motorola 68000..68040,683xx incl. coprocessor and MMU</LI>
<LI> Motorola ColdFire</LI>
<LI> Motorola DSP5600x,DSP56300</LI>
<LI> Motorola M-Core</LI>
<LI> Motorola/IBM MPC601/MPC505/PPC403</LI>
<LI> Motorola 6800, 6805, 68HC08, 6809, 68(HC)11(K4) 68HC12, 68HC16, and
Hitachi 6301</LI>
<LI> Hitachi 6309</LI>
<LI> Hitachi H8/300(H)</LI>
<LI> Hitachi H8/500</LI>
<LI> Hitachi SH7000/7600/7700</LI>
<LI> Rockwell 6502 and 65(S)C02</LI>
<LI> CMD 65816</LI>
<LI> Mitsubishi MELPS-740</LI>
<LI> Mitsubishi MELPS-7700</LI>
<LI> Mitsubishi MELPS-4500</LI>
<LI> Mitsubishi M16</LI>
<LI> Mitsubishi M16C</LI>
<LI> Intel 4004/4040</LI>
<LI> Intel MCS-48/41</LI>
<LI> Intel MCS-51/251, Dallas DS80C390</LI>
<LI> Intel MCS-96/196(Nx)/296</LI>
<LI> Intel 8080/8085</LI>
<LI> Intel i960</LI>
<LI> Signetics 8X30x</LI>
<LI> Philips XA</LI>
<LI> Atmel (Mega-)AVR</LI>
<LI> AMD 29K</LI>
<LI> Siemens 80C166/167</LI>
<LI> Zilog Z80, Z180, Z380</LI>
<LI> Zilog Z8, eZ8</LI>
<LI> Xilinx KCPSM ('PicoBlaze')</LI>
<LI> Toshiba TLCS-900(L)</LI>
<LI> Toshiba TLCS-90</LI>
<LI> Toshiba TLCS-870</LI>
<LI> Toshiba TLCS-47</LI>
<LI> Toshiba TLCS-9000</LI>
<LI> Microchip PIC16C54..16C57</LI>
<LI> Microchip PIC16C84/PIC16C64</LI>
<LI> Microchip PIC17C42</LI>
<LI> SGS-Thomson ST6</LI>
<LI> SGS-Thomson ST7</LI>
<LI> SGS-Thomson ST9</LI>
<LI> SGS-Thomson 6804</LI>
<LI> Texas Instruments TMS32010/32015</LI>
<LI> Texas Instruments TMS3202x</LI>
<LI> Texas Instruments TMS320C3x</LI>
<LI> Texas Instruments TMS320C20x/TMS320C5x</LI>
<LI> Texas Instruments TMS320C54x</LI>
<LI> Texas Instruments TMS320C6x</LI>
<LI> Texas Instruments TMS9900</LI>
<LI> Texas Instruments TMS7000</LI>
<LI> Texas Instruments TMS370xxx</LI>
<LI> Texas Instruments MSP430</LI>
<LI> National Semiconductor SC/MP</LI>
<LI> National Semiconductor INS807x</LI>
<LI> National Semiconductor COP8</LI>
<LI> National Semiconductor SC144xx</LI>
<LI> Fairchild ACE</LI>
<LI> NEC µPD 78(C)1x</LI>
<LI> NEC µPD 75xxx (alias 75K0)</LI>
<LI> NEC µPD 78xxx (alias 78K0)</LI>
<LI> NEC µPD7720/7725</LI>
<LI> NEC µPD77230</LI>
<LI> Symbios Logic SYM53C8xx (yes, they are programmable!)</LI>
<LI> Fujitsu F²MC8L</LI>
<LI> Fujitsu F²MC16L</LI>
<LI> Intersil CDP1802/1805</LI>
</UL>
under work / planned / in consideration :
<UL>
<LI> NEC 78K4</LI>
<LI> Intel 8008</LI>
<LI> Texas Instruments TMS320C54x</LI>
<LI> Analog Devices ADSP21xx</LI>
<LI> SGS-Thomson ST20</LI>
<LI> Texas Instruments TMS320C4x</LI>
<LI> Texas Instruments TMS320C8x</LI>
<LI> Toshiba TC9331</LI>
</UL>
I'm currently searching for documentation about the following
families:
<UL>
<LI> the complete set of OKI controllers</LI>
</UL>
unloved, but now, however, present :
<UL>
<LI> Intel 80x86, 80186, Nec V30&V35 incl. coprocessor 8087</LI>
</UL>
The switch to a different code generator is allowed even within one
file, and as often as one wants!
<P>
The reason for this flexibility is that AS has a history, which may
also be recognized by looking at the version number. AS was created
as an extension of a macro assembler for the 68000 family. On special
request, I extended the original assembler so that it was able to
translate 8051 mnemonics. On this way (decline ?!) from the 68000 to
8051, some other processors were created as by-products. All others
were added over time due to user requests. So At least for the
processor-independent core of AS, one may assume that it is
well-tested and free of obvious bugs. However, I often do not have
the chance to test a new code generator in practice (due to lack of
appropriate hardware), so surprises are not impossible when working
with new features. You see, the things stated in section <A
HREF="#ref_SectLicense">1.1</A> have a reason...
<P>
This flexibility implies a somewhat exotic code format, therefore I
added some tools to work with it. Their description can be found in
chapter <A HREF="#ref_ChapTools">6</A>.
<P>
AS is a macro assembler, which means that the programmer has the
possibility to define new ''commands'' by means of macros.
Additionally it masters conditional assembling. Labels inside macros
are automatically processed as being local.
<P>
For the assembler, symbols may have either integer, string or
floating point values. These will be stored - like interim values in
formulas - with a width of 32 bits for integer values, 80 or 64 bits
for floating point values, and 255 characters for strings. For a
couple of micro controllers, there is the possibility to classify
symbols by segmentation. So the assembler has a (limited) possibility
to recognize accesses to wrong address spaces.
<P>
The assembler does not know explicit limits in the nesting depth of
include files or macros; a limit is only given by the program stack
restricting the recursion depth. Nor is there a limit for the symbol
length, which is only restricted by the maximum line length.
<P>
From version 1.38 on, AS is a multipass-assembler. This pompous term
means no more than the fact that the number of passes through the
source code need not be exactly two. If the source code does not
contain any forward references, AS needs only one pass. In case AS
recognizes in the second pass that it must use a shorter or longer
instruction coding, it needs a third (fourth, fifth...) pass to
process all symbol references correctly. There is nothing more behind
the term ''multipass'', so it will not be used further more in this
documentation.
<P>
After so much praise a bitter pill: AS cannot generate linkable code.
An extension with a linker needs considerable effort and is not
planned at the moment.
<P>
Those who want to take a look at the sources of AS can simply get the
Unix version of AS, which comes as source for self-compiling. The
sources are definitely not in a format that is targeted at easy
understanding - the original Pascal version still raises its head at
a couple of places, and I do not share a couple of common opinions
about 'good' C coding.
<P>
<H2><A NAME="sect_1_3_">1.3. Supported Platforms</A></H2>
<P>
Though AS started as a pure DOS program, there are a couple of
versions available that are able to exploit a bit more than the Real
Mode of an Intel CPU. Their usage is kept as compatible to the DOS
version as possible, but there are of course differences concerning
installation and embedding into the operating system in question.
Sections in this manual that are only valid for a specific version of
AS are marked with a corresponding sidemark (at this paragraph for
the DOS version) aheaded to the paragraph. In detail, the following
further versions exist (distributed as separate packages):
<P>
In case you runinto memory problems when assembling large and complex
programs under DOS, there is a DOS version that runs in protected
mode via a DOS extender and can therefore make use of the whole
extended memory of an AT. The assembly becomes significantly slower
by the extender, but at least it works...
<P>
There is a native OS/2 version of AS for friends of IBM's OS/2
operating system. Since version 1.41r8, this is a full 32-bit OS/2
application, which of course means that OS/2 2.x and at least an
80386 CPU are mandatory.
<P>
You can leave the area of PCs-only with the C version of AS that was
designed to be compilable on a large number of UNIX systems (this
includes OS/2 with the emx compiler) without too much of tweaking. In
contrast to the previously mentioned versions, the C version is
delivered in source code, i.e. one has to create the binaries by
oneself using a C compiler. This is by far the simpler way (for me)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -