home *** CD-ROM | disk | FTP | other *** search
-
-
-
- asm(1.1), an AmigaDOS compatible 68010 assembler
- Deviations from AmigaDOS manual
- Copyright (c) 1986
- Douglas J Leavitt Jr.
- 3005 OFW #2, Venice CA, 90291
- Usenet: sdcrdcf!ism780c!dougl
- Suggested contribution: $25-$50
-
-
-
-
- Intro
-
- This paper describes the functions and capabilities available
- with the asm(1.1) macro assembler. The asm assembler is
- designed to be a 68010 macro assembler that is compatible
- with the assembler described in the AmigaDOS Manual, from
- Commodore-Amiga Inc., and Bantam Computer Books.
-
- Because this assembler tries to be as compatible as possible
- with the AmigaDOS assembler, only the deviations from that
- manual will be discussed here. At some later point in time,
- a totally new manual may be written.
-
- The asm(1.1) assembler was designed with three principles in
- mind.
-
- 1. An assembler that is available to everyone.
-
- 2. An assembler capable of assembling any currently
- available assembly language written for the Amiga.
-
- 3. An assembler with more power than is available
- in the standard AmigaDOS macro assembler.
-
- The first goal of has been met by making this assembler a
- shareware product. By making this assembler shareware product
- it is hoped that it's availability will become widespread,
- providing a general increase in Amiga software, and ultimately
- providing a better Amiga environment for all people. This
- assembler is intended as the first part of an entire C
- compilation system that will eventually be provided as a
- shareware system for all Amiga users.
-
- This paper is organized in the same sections as the AmigaDOS
- assembler manual chapter.
-
- Deviations from The AmigaDOS Manual Chapter 3
-
- 3.1 Introduction to the 68000/68010 Microchip
-
- This assembler is capable of compiling the new instructions
- that are available with the 68010. This means that three new
- registers and three new instructions are available. These are:
-
- 1. sfc, dfc, vbr registers, and
- 2. movec, movec.l
- 3. moves.b, moves.w, moves.l
- 4. rtd instructions
-
- This assembler is also capable of determining whether a branch
- may be generated in the 8 or 16 bit form automatically. The
- way that this is accomplished, is by using a jcc instruction.
- For example, if the assembler encounters a jne instruction, it
- will automatically determine if it can generate a bne.s or if
- must generate a bne instruction.
-
- 3.2 Calling asm(1.1)
-
- For the most part asm(1.1) tries to be as flexible as possible
- whenever possible. The assembler does not require a specific
- command line argument order. The current legal arguments are:
-
- asm [options] assembly_file [options]
-
- options:
- ? - Display command line format
- -q - Silent mode (copyright notice not shown)
- -l file - Generate listing file
- -h file - Include header file
- -o file - Output file name
- -i incl - Add include list to searching
- -v file - Gererate errors to verification file
-
- The -c flag does not currently exist with this release of the
- assembler. These options are expected to appear in a later
- release.
-
- 3.3.2.3
-
- This assembler is capable of accepting either upper case or
- lower case opcodes. Whenever an instruction is encountered
- without a size specifier, word sized opcodes are assumed.
-
- Whenever the opcode field contains a local label that has been
- defined to be an absolute constant, asm(1.1) will generate the
- equivalent of a dc.w whose value is the value of the label.
-
- Opcodes may not currently start in the first character of an
- assembly line. Asm(1.1) is not capable of determining whether
- an opcode starting in the first character position is a label
- or an opcode.
-
- 3.3.2.4
-
- The restriction of not allowing whitespace characters, blanks
- and tabs, between operands has been removed.
-
- 3.3.2.5
-
- If a comment immediately follows a zero operand instruction
- and the comment starts with a word rather than a comment
- delimiter such as ';', the word will be taken as a symbol.
- This is not currently seen as a problem because the comment
- character ';' may always be placed immediately after a zero
- operand instruction.
-
- 3.4.1
-
- All expression calculations are in signed 32 bit calculations
- which are then truncated if necessary.
-
- 3.4.3
-
- A symbol is a string of up to 64 characters. The special
- symbol '.' has the value of the current program counter. This
- symbol is equivalent to '*'. The symbol '*' does exist in this
- assembler. The '.' symbol has been provided because of it's
- significance in many other assembly languages.
-
- 3.4.4
-
- When a hex constant is being parsed, the characters 'a'-'f' as
- well as 'A'-'F' are legal values for the numbers 10-15.
-
- Ascii literals are normally contained in single quotes "'".
-
- Ascii strings are legal operands in many assembler directives.
- An ascii string is very similar to a C type string. An ascii
- string is a sequence of ascii characters contained in double
- quotes. The following sequences exist in strings:
-
- 1. \r - carraige return
- 2. \n - newline
- 3. \t - tab character
- 4. \f - formfeed
- 5. \b - backspace
- 6. \\ - backslash
- 7. \07 - \ followed by 1-3 octal characters generates
- the desired 8 bit character sequence.
-
- Double quoted strings will work with any operand that requires
- a string. Single quoted strings will work for those directives
- that document it as such. These directives, ifc/ifnc, accept
- both singly or doubly quoted strings and treat them the same.
-
- 3.5
-
- Absolute short addresses are denoted by appending a '.w'
- suffix to the address. The '.l' suffix may also be appended
- to a long absolute address.
-
- The REG directive does not currently exist in this assembler,
- however it is possible to specify by name a list of registers
- that will be saved in a movem instruction other than a simple
- immediate value constant. The following operand form is legal
- for the movem instruction:
-
- register_name[|register_name[|register_name...]]
- An example:
- movem.l d7|d6|d5|a4|a3,-(sp)
-
- The asm(1.1) assembler will generate the correct mask for all
- legal addressing modes, predecrement included.
-
- 3.6
-
- The Asm(1.1) release of the assembler has been updated so that
- all "I", "A", and "M" variants now exist.
-
- 3.7
-
- As many directives as possible have been supported in this
- assembler. This section describes the current limitations and
- additions to the existing assembler directives.
-
- The following directives are not currently supported in this
- version of the assembler. They are accepted, however they are
- ignored.
-
- 1. offset
- 2. rorg
- 3. reg
-
- The following directives are supported in this assembler, but
- do not exist in the standard Amiga macro assembler.
-
- 1. text, code, data, bss
- 2. global, globl
- 3. comm
- 4. even, align
- 5. ascii, asciz
- 6. else
-
- Assembler Control Directives
-
- SECTION
-
- The section directive currently supports only 3 sections.
- These sections are one each of CODE, DATA, and BSS. Each of
- these sections may share a common section name, or they may be
- unnamed, which is the default.
-
- TEXT, CODE
-
- These directives change the current section to become the code
- section. Neither directive takes an operand, and the section
- name is assumed to the current section name.
-
- DATA
-
- This directive change the current section to become the data
- section. This directive does not take an operand, and the
- section name is assumed to the current section name.
-
- BSS
-
- This directive change the current section to become the bss
- section. This directive does not take an operand, and the
- section name is assumed to the current section name.
-
- Data Definition Directives
-
- COMM
-
- This directive has the following form:
-
- COMM symbol,N
-
- This directive places the given symbol into the BSS section
- with a size of N. N is a constant expression that defines the
- size of the symbol in byte units.
-
- ASCII
-
- This directive has the following form:
-
- [<label>] ASCII string
-
- This directive generates N bytes of data. The generated data
- is a set of ascii bytes whose values are represented in the
- given string. A NUL ('\0') termination character is NOT
- generated with this directive. N is the number of characters
- that exist in the string.
-
- ASCIZ
-
- This directive has the following form:
-
- [<label>] ASCIZ string
-
- This directive generates N+1 bytes of data. The generated data
- is a set of ascii bytes whose values are represented in the
- given string. A NUL ('\0') termination character is generated
- with this directive. N is the number of characters that exist
- in the string.
-
- Listing Control Directives
-
- LLEN
-
- This directive will accept and check the legal values, however
- the changed value is ignored.
-
- PLEN
-
- This directive now has a default of 66 lines per page.
-
- TTL
-
- The program title may be up to 64 characters long in this
- directive.
-
- Conditional Assembly Directives
-
- ELSE
-
- This directive changes the true/false condition of the
- currently active if directive. This directive does not have
- arguments. Else directives may be nested just like other ifxx
- directives. When else directives are nested, the current else
- pertains to the most recent open if directive.
-
- Alignment Directives
-
- EVEN
-
- This directive aligns the current section on an even boundary
- by generating 0 or 1 zero bytes of data.
-
- ALIGN
-
- This directive has the following form:
-
- ALIGN N
-
- This directive aligns the current section on a mod N boundary.
- 0 to N-1 bytes of zero data will be generated to properly
- change the alignment as requested.
-
- External Symbols
-
- GLOBAL, GLOBL
-
- These directives have the following form:
-
- GLOBAL symbol1[,symbol2[,symbol3...]]
- or
- GLOBL symbol1[,symbol2[,symbol3...]]
-
- These directives take one or more labels, and generate each
- label as an externally defined symbol. These directives
- perform the same functionality as XREF and XDEF, but have
- provided for compatibility with other assemblers.
-
- Other Differences
-
- The following is a list of other known differences between
- this assembler, and the AmigaDOS macro assembler document.
-
- 1. An assembly line may be up to 128 characters in
- length.
-
- 2. There may be up to 8 different levels of nested
- includes.
-
- 3. Macro expansion allows for up to 24 separate
- macro arguments.
-
- 4. Up to 8 different include paths may exist in each
- assembly.
-
- 5. Conditional assemblies may be nested 16 deep.
-
- 6. Macro expansions may be nested 16 deep.
-
- 7. There is currently a maximum limit on the number
- of ifd/ifnd directives. That limit is currently
- a total of 512 ifd and ifnd directives.
-
-
- Acknowledgements
-
- Amiga, AmigaDOS, and Alink
- Are trademarks of Commodore-Amiga, Inc.
-
- The AmigaDOS Manual
- is printed by Bantam computer Book, and is Copyright
- (c) 1986 Commodore Capital, Inc.
-
- 68000/68010/68020/68030/68881/Motorola
- Are trademarks of Motorola Microsystems, Inc.
-
- Unix
- Is a trademark of AT&T.
-