home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Guide
/
c-cplusplus-interactive-guide.iso
/
c_ref
/
csource3
/
190_01
/
as68.doc
< prev
next >
Wrap
Text File
|
1985-11-15
|
44KB
|
1,776 lines
as68 - 68000 Assembler, version 1.01
(c) copyright 1982 Steve Passe all rights reserved
Table of Contents
Chapter 1 Introduction 1
Chapter 2 Usage 5
Chapter 3 Pseudo-ops 9
Chapter 4 Mnemonics 12
Chapter 5 Expressions 15
Chapter 6 S File Format 17
Chapter 7 Error Messages 19
Chapter 8 Differences 23
as68 Manual Introduction
Chapter 1
Introduction
The as68 assembler is a disk to disk assembler for the
Motorola 68000 micrprocessor chip. Written in the c
programming language, it may be used as a cross assembler on
any machine supporting c, or as a native assembler if
compiled with a c that produces 68000 output. It's
directives and mnemonic set closely follow that of the
Motorola Resident Structured Assembler.
Source Program
The input to the assembler is an ascii text file,
consisting of a series of statements written in the assembly
language. Each statement consists of one or more fields
within a line.
The assembler is free format within each line, i.e. there
is no need to start a specific field of a statement in a
particular column. Fields are separated from one another
with whitespace (tabs or spaces).
Statements
There are 3 basic statement types. The most common is an
assembly language instruction or mnemonic. It is a command
to the assembler to produce a machine operation code to
carry out a specific action. The second type of statement
is called an assembly directive or pseudo-op. Pseudo-ops
tell the assembler how to assemble the program. The third
statement type is called a comment. It is ignored by the
assembler, it's purpose being to allow the programmer to
insert descriptions of what the code is doing within the
text of the source program. Comments may exist as the final
field of the other two statement types.
-1-
as68 Manual Introduction
Instruction Statements
An instruction statement consists of from one to four
fields:
[label] <mnemonic> [operand] [comment]
Label Field
The first field, the label field, is optional. It is used
to create a symbolic name for the address of the code
generated by the following assembler mnemonic. This label
is stored in the symbol table and any references to it
evaluate to the associated address. The label field may be
the only field of a statement and multiple, label only
fields may follow one another. In all cases the label(s)
will evaluate to the address of the first mnemonic to be
assembled after the label(s) is specified.
Labels are composed of alphanumeric characters and may be
up to 30 characters long. All characters of a label are
significant, as is the case of alphabetic characters (i.e.
"Foo" is different than "foo"). The first character of a
label must be either alphabetic or the character '.'
(period). Following characters may also include the
underscore (_), dollarsign ($), and the digits '0' thru '9'.
Labels starting in any other than the first column must be
terminated with a colon (:). Certain symbols are reserved
for the use of the assembler and thus may not be used as
labels. These include "SP", "USP", "SR", "CCR", "A0"
through "A7" and "D0" through "D7".
Mnemonic Field
The second field is the mnemonic or assembly instruction
field. It will always be present in a statement except in
the case of a label only statement (label only statements
might more properly be described as assembler directives).
If the line is unlabeled the mnemonic field must be
preceeded by whitespace.
A mnemonic will consist of from 3 to 5 ascii characters,
the case of which is not significant. This assembler
recognizes the standard Motorola instruction set. The
-2-
as68 Manual Introduction
complete mnemonic instruction set is described in chapter 4,
"Mnemonics". Many 68000 instructions may work on different
data sizes. The desired data size is specified by appending
a length modifier or data size code to the mnemonic. A '.b'
extension specifies a data size of byte (8 bits) while '.l'
will cause the data size to be a long word (32 bits). No
extension will cause the data size to be a word (16 bits).
A '.w' extension may be used for data sizes of word,
although this size is the default and as such the '.w'
modifier is unnecessary.
Operand Field
The operand field is necessary only for those statements
whose mnemonic requires an operand(s). It will contain one
or two operands. When two operands are present they must be
separated with a comma (no whitespace allowed between
operands). The first of two operands is refered to as the
source operand while the second is the destination operand.
Comment Field
The comment field is optional and consists of all text
following the above fields.
Directives
Label Field
Labels used with directive statements follow the general
rules of those used in assembly statements with one
important exception: they may only be used with the
following directives:
1. EQU
2. SET
3. DC
4. DS
5. MACRO (unimplimented in ver. 1.xx)
Directive Field
The directive field contains an instruction to the
assembler as to how the program should be assembled. This
-3-
as68 Manual Introduction
includes such things as the base address of the program,
setting of symbol values, allocation of program memory
storage, conditional assembly, etc. The complete list of
available assembly directions is given in chapter 3,
"Pseudo-ops".
Operand Field
The operand field of a directive statement will consist of
zero or more operands, as needed by the pseudo-op in
question. Multiple operands are separated with a comma (,).
No whitespace