home *** CD-ROM | disk | FTP | other *** search
- Intoduction
- ===========
-
- !AS is a simple assembler. It is designed to be used with the desktop
- development environment supplied with Desktop C, as Desktop C doesn't
- include an assembler. This assembler was at the beginning a backend to
- another compiler and does therefore not contain all the glorious commands in
- Acorn's assembler. The most obvious omissions are macros and debug
- informations. I have included the source in the distribution to compensate
- this: If you want it, add it.
-
- !AS generates aof files, that contain type-2 relocations, so some old
- linkers might not be able to link them. There should not be any problem if
- the linker can handle aof files of version 1.50 or later.
-
- For condition of use read the file Conditions which is included in this
- distribution.
-
- It should be possible to run !AS on a UNIX machine thanks to Andy Duplain.
- Only the command line version are ported (No DDE on UNIX). No UNIX binaries
- are included but 'MakefileU' contains a makefile for UNIX that might work.
- Otherwise it can be done by hand. The only special thing is to compile and
- run mkendian.c before you try to compile the assembler. This creates an
- include file (endiandef.h) with endian information. The version include
- is for a little endian machine, which is correct for Archimedes.
-
- Installation
- ------------
- To install !AS to a hard disc simply copy the !AS directory into the
- DDE directory on your hard disc, and copy/rename AS to your library
- directory.
-
- Copy the following lines to your !Make.choices.tools file in the DDE
- directory.
-
- ------------------------------------
- AS
- s
- -throwback
- as $(asflags) -o $@ $<
- DDE:!AS.desc
- DDE:!AS.!setup
- ------------------------------------
-
- There is a incomplete help file that can be used with SrcEdit. If you
- want to use it then copy/rename the file HelpAs to !SrcEdit.help.AS and copy
- the following lines to your !SrcEdit.choices.languages.
-
- ------------------------------------
- As
- none
- <SrcEdit$dir>.help.AS
- ------------------------------------
-
- Compilation
- -----------
-
- Try the Makefile that is included. If !Make complain then the easiest is
- to make a new Makefile. All c-files, C:o.stubs and C:o.RISC_OSlib is
- needed.
-
- Using !AS
- =========
-
- To start !AS double click on the !AS application. This will place the
- !AS icon on the icon bar.
-
- Click Select on the !AS icon, this will open a setup dialog box
- containing a single writeable icon labelled "Source:", a number
- of option icons and two action icons labelled "Run" and "Cancel".
-
- To assemble a file drag the assembler file to the Source
- icon and click Run. Note that the assembler source must be stored in a
- directory called "s".
-
- The output will be saved with the same tail name as the source file, but in
- a directory called "o" instead of "s".
-
- If errors are encountered in the source then the errors will be listed in a
- window. If you are using the editor !SrcEdit and the "Throwback" option is
- enabled the errors will also be displayed in a "Throwback" window. Double
- clicking on an error in the Throwback will cause !SrcEdit to open the source
- file containing the error at the line which generated the error, this line
- will be highlighted for clarity.
-
- You can only assemble one file at a time, if you drop more than one file on
- the "Source" icon only one will be assembled.
-
-
- Setup dialog box options
- ------------------------
-
- There are only four options.
-
- Pedantic:
-
- The assembler will complain in some places where it otherwise would fix the
- problem silent, e.g., if you add with a negative number which the assembler
- must change to a subtraction, or when it must change the order of the
- operands in a multiplication. It will also tell you if it thinks your code
- are ugly, e.g., compare instructions with an explicit 's' or using a
- coprocessor mnemonic with coprocessor 1. (This is the floating point unit
- which has its own mnemonics.)
-
- Verbose:
-
- The assembler will inform about the progress. Currently messages are given
- about which files that are included.
-
- Throwback:
-
- If this option is enabled and the editor !SrcEdit is loaded errors
- in compilation are listed in a Throwback window. This window can
- be used to rapidly locate and correct errors in your program.
-
- Autocast:
- The assembler converts integers to float if needed by a command or
- mnemonic. Note that no conversion is done inside expressions, it's
- only the result that can be converted.
-
- Only throwback is enabled by default.
-
- Setup menu options
- ------------------
-
- Other less commonly used options may be accessed from the menu
- on the setup dialog box. Only one option is availible here.
-
- Command line:
-
- This option allows you to examine and/or change the command line
- generated by the !AS frontend which is used to run the assembler. When you
- change the command line and wish to execute the changed command click on the
- Run icon in the Command line dialog box. Once you move off the Command line
- dialog box onto the setup menu the changed command line will be forgotten
- and the original command line (as constructed by the !AS tool) will be
- reconstructed.
-
- The command line
- ================
-
- The syntax of the Assembler command line is:
-
- *as [options] [-Idirectory] [-o filename] [filename]
-
- [filename]
-
- This is the optional source file, stdin will be used if it isn't present.
-
- [-o filename]
-
- This is the optional destination file. If no destination file is given and a
- source file is given then its "s"-directory is changed to "o", otherwise
- stdout is used.
-
- [-Idirectory]
-
- Directory to search when executin lnk and get commands. It's possible to give
- more than one directory but there must be '-I' before every directory.
-
- The following options are available
-
- -v
-
- Print version.
-
- -p
-
- Enable pedantic mode.
-
- -h
- -H
- -?
-
- Print command line syntax.
-
- -verbose
-
- Print some information about the progress.
-
- -dde
-
- Replaces '@' in the beginning of filenames with <Prefix$Dir>
-
- -throwback
-
- Enable throwbacks.
-
- -autocast
-
- Enable casting from integer to float.
-
- ==========================================================
- =
- A short description of what is legal in an assembler source
- -----------------------------------------------------------
-
- Max line length is 1024 characters. The following lines are legal:
-
- Label Instruction ;Comment
-
- All fields are optional, but the Instruction-field can not start at the
- first column. The Label-field must however start at the first position of a
- line.
-
- Label Command ;Comment
-
- Some commands make the Label-field compulsary but in most cases all fields
- are optional. The Command-field can not start at the first column. The
- Label-field must however start at the first position of a line.
-
-
- Identifier
- ----------
-
- Identifiers start with a letter or an underscore, and can contain letters,
- digits and underscores. There are no limits on identifier length and all
- characters are significant. It is possible to include any character except
- '|' and newline in an identifier by enclosing it in '|'s:
- |This is a funny label%%^&*(|
- The bars does not belong to the identifier so:
- |abc|
- and
- abc
- are equal. The case of the characters are significant, and it is legal to
- define identifiers with the same name as mnemonics.
-
-
- Label
- -----
-
- A label is an identifier with an optional colon at the end. The label gets
- the value of the next free byte in the current area.
- NOTE:
- This differs from Acorn's assembler as it always word align labels that are
- on the same line as an instruction. This assembler will however generate a
- warning in those cases so it is easy to change the assembler code by
- inserting an explicit align command at the previous line.
-
-
- Instruction
- -----------
-
- The case is not significant for instructions. The assembler knows about the
- following instructions:
-
- adc add and bic rsb rsc sub
- sbc eor orr mov mvn cmn cmp
- teq tst mul mla b bl swi
- ldr str ldm stm
- cdp mcr mrc ldc stc (Coprocessor instructions.)
- swp (Not legal on ARM2.)
- adr (Syntesized instructon.)
- adf muf suf rsf fvf rdf pow (Floating point instructions.)
- rpw rmf fml fdv frd pol exp (Floating point instructions.)
- mvf mnf abs rnd sqt log lgn (Floating point instructions.)
- sin cos tan asn acs atn (Floating point instructions.)
- cmf cmfe cnf cnfe ldf stf (Floating point instructions.)
- fix flt rfs wfs rfc wfc (Floating point instructions.)
-
- A short description of most of the instructions is availible in the file
- HelpAs that is included in this distribution. (If you followed the
- instructions above then this file is moved to !SrcEdit.help.AS. In this case
- select the mnemonic you are interested in and press F1. This will bring up a
- window with a description of the selected mnemonic if you have choosen As as
- language in the option.language menu in !SrcEdit). You can locate the
- mnemonic in the file by seraching after the mnemonic with a %-character in
- front, e.g., %swp.
-
-
- Command
- -------
-
- The case is not significant for commands. The assembler knows about the
- following commands:
-
- dcb = dcw dcd & dcfs dcfd
- area align % ^ #
- globl export import entry ltorg (Normally not used together with a Label-field.)
- rn fn cn equ * (Label-field is compulsary.)
- lnk get
- dcfe dcfp (These commands are not implemented,
- but they are known :-)
-
- A short description of most of the commands is availible in the file
- HelpAs that is included in this distribution. (If you followed the
- instructions above then this file is moved to !SrcEdit.help.AS. In this case
- select the command you are interested in and press F1. This will bring up a
- window with a description of the selected command if you have choosen As as
- language in the option.language menu in !SrcEdit). You can locate the
- command in the file by searching after the mnemonic with a %-character in
- front, e.g., %dcfs.
-