CONTENTS | PREV | NEXT
15A. identifier sharing
As you've probably guessed from the example in chapter 5D, assembly
instructions may be freely mixed with E code. The big secret is, that
a complete assembler has been built in to the compiler.
Apart from normal assembly addressing modes, you may use the following
identifiers from E:
LEA mylabel(PC),A1 /* labels */
DEF a /* variables */
MOVE.L (A0)+,a /* note that <var> is <offset>(A4) (or A5) */
MOVE.L dosbase,A6 /* library call identifiers */
MOVEQ #TRUE,D0 /* constants */
EC's assembler supports following constructs,
n = registernum
x = index
lab = label, from: "label:" or "PROC label()"
abs = absolute addressing
s = size. L, W or B where appropriate.
- addressing modes supported by EC:
Dn, An, (An), (An)+, -(An), x(An), x(An,Dn.s),
lab(PC), lab(PC,Dn.s), abs, abs.W
(note: write abs.W in hexadecimal, to not confuse it with a float
value, i.e. write MOVE.L $4.W,A6 )
- supported partially:
- not supported:
lab (same as abs), #lab
use LEA lab(PC),An instead.
- extra modes:
var.s (transfers contents of var. optionally size is ".W" or ".B",
default is ".L")
MOVE.W myvar.W,D0 -> move lowword of 'myvar'
As an extra, E allows to directly return registers from a function:
You may even interpret this as multiple return values, i.e. D0/D1/D2.