home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
simtel
/
sigm
/
vols000
/
vol092
/
a68k.doc
< prev
next >
Wrap
Text File
|
1984-04-29
|
8KB
|
265 lines
A68K - 68000 Cross Assembler Notes
11/09/82
Command line to invoke the assembler:
A68K <filename> ; short form
A68K <object>,<listing>=<source> ; full form
----------------- Equivalence ----------------
XYZ XYZ.HEX,XYZ.PRN=XYZ.ASM
,CON:=XYZ NUL:,CON:=XYZ.ASM
XYZ,=XYZ XYZ.HEX,NUL:=XYZ.ASM
XYZ.OBJ=XYZ.SRC XYZ.OBJ,XYZ.PRN=XYZ.SRC
,CON:=CON: NUL:,CON:=CON:
Object file may be in Motorola S-record (default)
or Intel HEX format.
<symbol> SET <expression> ; temp val
<symbol> EQU <expression> ; perm val
<symbol> REG <register expression> ; perm val
Note that a size attribute may be tacked onto
SET or EQU to govern the way string constants
appearing in the expression are handled. The
default size is long. String constants are
left justified according to size and zero
filled.
<register expression> for use in MOVEM
<Rn> <next reg>
<next reg>
- <Rn> <next reg>
/ <register expression>
<Rn>
A <rnum>
D <rnum>
Labels are symbols which receive the current value of
the program counter.
For labels beginning in column 1, colon is optional.
For labels preceded by blanks, colon is required.
OPT <option>,<option>,.....
<option>
BRL ; long branch forward ref. - default
BRS ; short branch forward ref.
FRL ; long absolute fwd. ref. - default
FRS ; short absolute fwd. ref.
OBJ-S ; hex file Motorola style - default
OBJ-H ; hex file Intel style (16 bit address limit)
NOP1L ; no pass 1 listing - default
P1L ; pass 1 listing
* <comment>
.S & .L may be appended to BRA, BSR, Bcc, JMP and JSR
to override automatic size determination.
They may also be appended to absolute address
operands in other instructions. But, it is necessary
to isolate the period from a symbol by enclosing
the symbol in parentheses. This is due to the fact
that period is a valid character in symbols.
<symbol>
Symbols begin with a letter or period. Additional
characters may be letters, digits, periods, dollar
signs and underscores.
* represents the program counter
Symbols may have up to 31 significant characters.
The symbol table is currently of fixed size:
500 Symbols max
2000 Characters max
Constants begin with:
char - '
hex - $
octal - @
binary - %
decimal - 0 thru 9
Strings:
Delimited by '
'' represents '
Expressions and symbols are classified as constants
or addresses.
Operators for expressions (in precedence group order):
+ -
* / only implemented for 16 bits now
\ mod - only 16 bits for now
& AND
! | both allowed for OR
^ exclusive OR
<< shift left
>> shift right
- unary minus
~ unary NOT
Except for + and -, only expressions which evaluate
constants are allowed as operands to operators. For
+ and -, (a + a) and (c - a) produce errors. Embedded
spaces are not allowed in expressions (spaces serve as
field delimiters).
Automatic conversions:
ADD #e ,<ea> ADDQ or ADDI when possible
<ea> ,An ADDA
SUB #e ,<ea> SUBQ or SUBI when possible
<ea> ,An ADDA
CMP #e ,<ea> CMPI when possible
(An)+,(An)+ CMPM
<ea> ,An CMPA
AND #e ,<ea> ANDI when possible
OR #e ,<ea> ORI when possible
EOR #e ,<ea> EORI when possible
Addressing Mode Syntax Interpretation:
c expression must evaluate to constant
a expression must evaluate to address
b expression may evaluate to either
Syntax used Interpreted as Mode,reg
# e #c 7,4
D n Dn 0
A n An 1
- ( A n ) -(An) 4
( A n ) + (An)+ 3
( A n ) (An) 2
( A n , R i )
( A n , R i . W ) 0(An,Ri.s) 6
( A n , R i . L )
e ( A n , R i )
e ( A n , R i . W ) c(An,Ri.s) 6
e ( A n , R i . L )
e ( A n ) c(An) 5
e ( D i )
e ( R i . W ) a(PC,Ri.s) 7,3
e ( R i . L )
e ( PC , R i )
e ( PC , R i . W ) a(PC,Ri.s) 7,3
e ( PC , R i . L )
e ( PC ) a(PC) 7,2
e . L b.L 7,1 **
e . S b.S 7,0 **
e b 7,0 or 7,1 **
**** SP may be used for A7 anywhere An appears, but not
where Ri appears for index specification.
** Explicit range specification via (.S or .L)
overrides the automatic range selection for absolute
addressing. For auto, if the expression contains forward
references, the range is determined by the "FR" option
currently in effect (FRL default). If the expression
contains no forward references, the range is made short
if the expression lies between -32768 and +32767.