home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMIGA PD 1
/
AMIGA-PD-1.iso
/
Programme_zum_Heft
/
Programmieren
/
Kurztests
/
DiceC
/
doc
/
das.doc
< prev
next >
Wrap
Text File
|
1994-02-01
|
5KB
|
154 lines
das/das das/das
DAS ASSEMBLY DOCUMENTATION
Matthew Dillon
891 Regal Rd.
Berkeley, Ca. 94708
USA
uunet.uu.net!overload!dillon
DAS asmfile [-o objectfile] [-E errorfile] [-nu]
DAS is a minimal 68000 assembler designed to assemble the output of DC1
DAS SHOULD NOT BE USED FOR ASSEMBLY PROJECTS, IT IS MEANT SOLELY TO DEAL
WITH THE OUTPUT FROM THE COMPILER.
OPTIONS
-o objfile specify object file, else uses asmfile.o (after
removing any trailer after the .)
-E errorfile specify file for errors, else stderr is used
-nu specify that the HUNK_UNIT have no name (for
libraries, to make the library smaller)
NOTE:
Das cannot handle expressions other than simple +,-,*, and /,
and only one address label is allowed per expression (i.e.
value unknown until link or load)
Das does not understand integral types other than decimal and hex.
Das does not understand strings 'string'.
Das cannot export EQU labels (i.e. ABS references).
Das has no macro facilities
FEATURES
Das includes optimization features used by the compiler. Also, Das can
handle arbitrary forward referenced REG labels for MOVEM which most
assemblers cannot.
Das allows and automatically coagulates multiple occurances of section
directives of the same name and type.
Das automatically pads CODE sections with NOPs instead of 0's. However,
DS.L will always pad with 0.
DAS handles the following directives:
DC declare data
DS declare space / align
SECTION declare a section. Sections may be repeated to flip
back and forth between them. A third argument
may contain a value to be ORd with the hunk
type field, usually used to specify special
hunk flags (i.e. hunk to chip memory, etc...)
XREF import a label
XDEF export a label
EQU declare a constant (must be a numerical constant)
REG declare zero or more registers in register list
PROCSTART used to determine procedure boundries for A5 check/
PROCEND link/unlk removal. Also automatically sets optimization
option to 1 if 0.
DAS handles the following expressions:
+, -, *, /, negation. Only one relocatable label allowed per
expression. Any number of EQU'd labels allowed, forward or reverse
referenced.
Optimization level 0 (default unless PROCSTART exists in file)
* MOVEM's using 'reg' labels are optimized to either a MOVE or by
removing the MOVEM entirely (reg labels that specify no registers).
* BRANCHES to BRAs are optimized (up to 20 hops)
* unsized BRANCHES are optimized to byte branches if possible
* BRANCHES to the next instruction are deleted
Optimization level 1 (automatic if PROCSTART exists in file)
* LINK/UNLK within PROCSTART/PROCEND bounds is removed if the link
register (currently hardwired to be A5) is never referenced AND if
no subroutine calls are made within the procedure (JSR's or BSR's)
This allows support of stack backtraces while optimizing most low
level routines written in C. Removal of LINK/UNLK in routines that
make other subroutine calls does not yield much of an efficiency
boost anyway.
PROBLEMS
DAS Uses an incredible amount of memory due to efficiency considerations
in the optimization and myself wanting to keep it FAST.
When specifying DIFFERENTLY NAMED CODE SECTIONS in the SAME ASSEMBLY FILE,
keep in mind that the code sections are not necessarily near to each other
in the final link and the linker cannot generate a jump table for
PC-Relative inter-module calls. Thus, one section calling another should
not use PC-Relative unless you *know* your final executable is going to
be less than 32K *AND* you do not use the -frag option to dlink.
This is why the startup c.a references the autoinit sections with
absolute calls instead of PC-relative calls.
EFFECTIVE ADDRESS
Dn - data register D0-D7
An - addr register D0-D7
.z - size (.W or .L)
*s - 68020 scale (*1, *2, *4, *8)
bd - base displacement expression, Usually followed by base
displacement size or (A4) to indicate a data-relative
relocation. Example: xx+4.L xx.W 23+xx(A4)
od - outer displacement expression, like bd. Only allowed if an
indirection [] is used.
68000 68020/030
Dn x x
An x x
(An) x x
(An)+ x x
-(An) x x
d16(An) x x
d8(An,Dn.z) x x
d8(An,Dn.z*s) x
(bd.z/(A4),An,Dn.z*s) x all items optional
example: (foo(A4),A4,D0.W*8)
(bar.L,D2.W*8)
([bd.z/(A4),An],Dn.z*s,od) x
([bd.Z/(A4),An,Dn.z*s],od) x