home *** CD-ROM | disk | FTP | other *** search
-
- DAS ASSEMBLY DOCUMENTATION
-
-
- Matthew Dillon
- 891 Regal Rd.
- Berkeley, Ca. 94708
- USA
-
- uunet.uu.net!overload!dillon
-
-
-
- DAS asmfile [-o objectfile]
-
- 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.
-
- NOTE: Das does not implement all instructions and doesn't do the right
- thing with MOVEM sea,regs when sea required a word or more of
- extension.
-
- Das cannot handle expressions other than simple + and - where
- only one label in the expression is allowed to be an external
- reference.
-
- 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).
-
- 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.
-
-