📄 as_en.tex
字号:
\item{Intel 80x86, 80186, Nec V30\&V35 incl. coprocessor 8087}\end{itemize}The switch to a different code generator is allowed even within one file, and as often as one wants!The reason for this flexibility is that AS has a history, which may alsobe recognized by looking at the version number. AS was created as anextension of a macro assembler for the 68000 family. On special request, Iextended the original assembler so that it was able to translate 8051mnemonics. On this way (decline ?!) from the 68000 to 8051, some otherprocessors were created as by-products. All others were added over timedue to user requests. So At least for the processor-independent core ofAS, 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 inpractice (due to lack of appropriate hardware), so surprises are notimpossible when working with new features. You see, the things stated insection \ref{SectLicense} have a reason...This flexibility implies a somewhat exotic code format, therefore Iadded some tools to work with it. Their description can be found inchapter \ref{ChapTools}.AS is a macro assembler, which means that the programmer has thepossibility to define new ''commands'' by means of macros. Additionally it masters conditional assembling. Labels inside macrosare automatically processed as being local.For the assembler, symbols may have either integer, string or floatingpoint values. These will be stored - like interim values in formulas -with a width of 32 bits for integer values, 80 or 64 bits for floatingpoint values, and 255 characters for strings. For a couple of microcontrollers, there is the possibility to classify symbols by segmentation.So the assembler has a (limited) possibility to recognize accesses towrong address spaces.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. From version 1.38 on, AS is a multipass-assembler. This pompous termmeans no more than the fact that the number of passes through thesource code need not be exactly two. If the source code does notcontain any forward references, AS needs only one pass. In case ASrecognizes in the second pass that it must use a shorter or longerinstruction coding, it needs a third (fourth, fifth...) pass toprocess all symbol references correctly. There is nothing more behindthe term ''multipass'', so it will not be used further more in thisdocumentation.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.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 sourcesare 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.%%---------------------------------------------------------------------------\section{Supported Platforms}Though AS started as a pure DOS \marginpar{{\em DOS}} program, there are acouple of versions available that are able to exploit a bit more than theReal Mode of an Intel CPU. Their usage is kept as compatible to the DOSversion as possible, but there are of course differences concerninginstallation and embedding into the operating system in question. Sections in this manual that are only valid for a specific version of ASare marked with a corresponding sidemark (at this paragraph for the DOSversion) aheaded to the paragraph. In detail, the following furtherversions exist (distributed as separate packages):In case you run \marginpar{{\em DPMI}}into memory problems when assemblinglarge and complex programs under DOS, there is a DOS version that runs inprotected mode via a DOS extender and can therefore make use of the wholeextended memory of an AT. The assembly becomes significantly slower bythe extender, but at least it works...There is a native OS/2 \marginpar{{\em OS/2}} version of AS for friends ofIBM's OS/2 operating system. Since version 1.41r8, this is a full 32-bitOS/2 application, which of course means that OS/2 2.x and at least an80386 CPU are mandatory. You can leave \marginpar{{\em UNIX}} the area of PCs-only with the Cversion of AS that was designed to be compilable on a large number of UNIXsystems (this includes OS/2 with the emx compiler) without too much oftweaking. In contrast to the previously mentioned versions, the C versionis delivered in source code, i.e. one has to create the binaries byoneself using a C compiler. This is by far the simpler way (for me) thanproviding a dozen of precompiled binaries for machines I sometimes onlyhave limited access to...People who have read \marginpar{{\em ???}} this enumeration up to thispoint will notice that world's best-selling operating system coming fromRedmont is missing in this enumeration. People who know me personallywill know that I do not regard Windows to be a pat solution (regardless ifits 3.X, 95, or NT). Frankly said, I am a 'windows hater'. A largenumber of people will now regard this to be somewhere between obsolete andridiculous, and they will tell me that I withhold AS from a large part ofpotential users, but they will have to live with it: I primarily continueto improve AS because I have fun doing it; AS is a non-commercial projectand I therefore take the freedom not to look at potential market shares. Iselect platforms for me where I have fun programming, and I definitely donot have any fun when programming for Windows! By the way, there was atime when I had to write Windows programs so I do not simply jabberwithout having an idea what I am talking about. If someone wants to portAS into this direction, I will not stand in his way, but (s)he should notexpect anything more from me than providing sources (which is why (s)hewill have to deal with questions like 'why does AS not work any more afterI changed the JUNK-CAD 18.53 registry entry from upper to lower case?').%%===========================================================================\cleardoublepage\chapter{Assembler Usage}\begin{quote}\begin{raggedright}{\itScotty: Captain, we din\verb!'! can reference it! \\Kirk: Analysis, Mr. Spock? \\Spock: Captain, it doesn\verb!'!t appear in the symbol table. \\Kirk: Then it\verb!'!s of external origin? \\Spock: Affirmative. \\Kirk: Mr. Sulu, go to pass two. \\Sulu: Aye aye, sir, going to pass two. \\}\end{raggedright}\end{quote}%%--------------------------------------------------------------------------- \section{Hardware Requirements}The hardware requirements of AS vary substantially from version toversion:The DOS version \marginpar{{\em DOS}} will principally run on anyIBM-compatible PC, ranging from a PC/XT with 4-dot-little megahertz up toa Pentium. However, similar to other programs, the fun using AS increasesthe better your hardware is. An XT user without a hard drive willprobably have significant trouble placing the overlay file on a floppybecause it is larger than 500 Kbytes...the PC should therefore have atleast a hard drive, allowing acceptable loading times. AS is not veryadvanced in its main memory needs: the program itself allocates less than300 Kbytes main memory, AS should therefore work on machines with at least512 Kbytes of memory.The version of AS \marginpar{{\em DPMI}} compiled for the DOS ProtectedMode Interface (DPMI) requires at least 1 Mbyte of free extended memory. A total memory capacity of at least 2 Mbytes is therefore the absoluteminimum given one does not have other tools in the XMS (like disk caches,RAM disks, or a hi-loaded DOS); the needs will rise then appropriately. If one uses the DPMI version in a DOS box of OS/2, one has to assure thatDPMI has been enabled via the box's DOS settings (set to \tty{on} or\tty{auto}) and that a sufficient amount of XMS memory has been assignedto the box. The virtual memory management of OS/2 will free youfrom thinking about the amount of free real memory.The hardware requirements of the OS/2 \marginpar{{\em OS/2}} versionmainly result from the needs of the underlying operating system, i.e. atminimum an 80386SX processor, 8 Mbytes of RAM (resp. 4 Mbytes without thegraphical user interface) and 100..150 Mbytes of hard disk space. AS2 isonly a 16-bit application and therefore it should also work on older OS/2versions (thereby reducing the processor needs to at least an 80286processor); I had however no chance to test this.The C version of AS \marginpar{{\em UNIX}} is delivered as source code andtherefore requires a UNIX or OS/2 system equipped with a C compiler. Thecompiler has to fulfill the ANSI standard (GNU-C for example isANSI-compliant). You can look up in the \tty{README} file whether yourUNIX system has already been tested so that the necessary definitions havebeen made. You should reserve about 15 Mbytes of free hard disk space forcompilation; this value (and the amount needed after compilation to storethe compiled programs) strongly differs from system to system, so youshould take this value only as a rough approximation.%%---------------------------------------------------------------------------\section{Delivery}Principally, you can obtain AS in one of two forms: as a {\em binary} or a{\em source} distribution. In case of a binary distribution, one gets AS,the accomanying tools and auxiliary files readily compiled, so you canimmediately start to use it after unpacking the archive to the desireddestination on your hard drive.Binary distibutions are made for widespread platforms, where either themajority of users does not have a compiler or the compilation is tricky(currently, this includes DOS and OS/2). A source distribution incontrast contains the complete set of C sources to generate AS; it isultimately a snapshot of the source tree I use for development on AS. Thegeneration of AS from the sources and their structure is described indetail in appendix \ref{ChapSource}, which is why at this place, only thecontents and installation of a binary distribution will be described:The contents of the archive is separated into several subdirectories,therefore you get a directory subtree immediately after unpacking withouthaving to sort out things manually. The individual directories containthe following groups of files:\begin{itemize}\item{{\tt BIN}: executable programs, text resources;}\item{{\tt INCLUDE}: include files for assembler programs, e.g. register definitions or standard macros;}\item{{\tt MAN}: quick references for the individual programs in Unix 'man' format.}\end{itemize}A list of the files found in every binary distribution is given in tables\ref{TabCommonPackageList1} to \ref{TabCommonPackageList3}. In case afile listed in one of these (or the following) tables is missing, someonetook a nap during copying (probably me)...\begin{table*}[htp]\begin{center}\begin{tabular}{|l|l|}\hlineFile & function \\\hline\hline{\bf Directory BIN} & \\\hlineAS.EXE & executable of assembler \\PLIST.EXE & lists contents of code files \\PBIND.EXE & merges code files \\P2HEX.EXE & converts code files to hex files \\P2BIN.EXE & converts code files to binary files \\AS.MSG & text resources for AS \\PLIST.MSG & text resources for PLIST \\PBIND.MSG & text resources for PBIND \\P2HEX.MSG & text resources for P2HEX \\P2BIN.MSG & text resources for P2BIN \\TOOLS.MSG & common text resources for all tools \\CMDARG.MSG & common text resources for all programs \\IOERRS.MSG & \\\hline\hline{\bf Directory DOC} & \\\hlineAS\_DE.DOC & german documentation, ASCII format \\AS\_DE.HTML & german documentation, HTML format \\AS\_DE.TEX & german documentation, LaTeX format \\AS\_EN.DOC & english documentation, ASCII format \\AS\_EN.HTML & english documentation, HTML format \\AS\_EN.TEX & english documentation, LaTeX format \\\hline\hline{\bf Directory INCLUDE} & \\\hlineBITFUNCS.INC & functions for bit manipulation \\CTYPE.INC & functions for classification of \\ & characters \\80C50X.INC & register addresses SAB C50x \\80C552.INC & register addresses 80C552 \\H8\_3048.INC & register addresses H8/3048 \\REG166.INC & addresses and instruction macros 80C166/167 \\REG251.INC & addresses and bits 80C251 \\REG29K.INC & peripheral addresses AMD 2924x \\\hline\end{tabular}\end{center}\caption{Standard Contents of a Binary Distribution - Part 1 \label{TabCommonPackageList1}}\end{table*}\begin{table*}[htp]\begin{center}\begin{tabular}{|l|l|}\hlineFile & Function \\\hline\hline{\bf Directory INCLUDE} & \\\hlineREG53X.INC & register addresses H8/53x \\REG683XX.INC & register addresses 68332/68340/68360 \\REG7000.INC & register addresses TMS70Cxx \\REG78K0.INC & register addresses 78K0 \\REG96.INC & register addresses MCS-96 \\REGACE.INC & register addresses ACE \\REGAVR.INC & register and bit addresses AVR family \\REGCOP8.INC & register addresses COP8 \\REGGP32.INC & register addresses 68HC908GP32 \\REGHC12.INC & register addresses 68HC12 \\REGM16C.INC & register addresses Mitsubishi M16C \\REGMSP.INC & register addresses TI MSP430 \\REGST9.INC & register and Makrodefinitionen ST9 \\REGZ380.INC & register addresses Z380 \\STDDEF04.INC & register addresses 6804 \\STDDEF16.INC & instruction macros and register addresses \\ & PIC16C5x \\STDDEF17.INC & register addresses PIC17C4x \\STDDEF18.INC & register addresses PIC16C8x \\STDDEF2X.INC & register addresses TMS3202x \\STDDEF37.INC & register and bit addresses TMS370xxx \\STDDEF3X.INC & peripheral addresses TMS320C3x \\STDDEF47.INC & instruction macros TLCS-47 \\STDDEF51.INC & definition of SFRs and bits for \\ & 8051/8052/80515 \\STDDEF56K.INC & register addresses DSP56000 \\STDDEF5X.INC & peripheral addresses TMS320C5x \\STDDEF60.INC & instruction macros and register addresses \\ & PowerPC \\
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -