Go to the first, previous, next, last section, table of contents.
The Mitsubishi D30V version of as
has a few machine
dependent options.
as
will attempt to optimize its output by detecting when
instructions can be executed in parallel.
as
will issue a warning every
time it adds a nop instruction.
as
will issue a warning if it
needs to insert a nop after a 32-bit multiply before a load or 16-bit
multiply instruction.
The D30V syntax is based on the syntax in Mitsubishi's D30V architecture manual. The differences are detailed below.
The D30V version of as
uses the instruction names in the D30V
Architecture Manual. However, the names in the manual are sometimes ambiguous.
There are instruction names that can assemble to a short or long form opcode.
How does the assembler pick the correct form? as
will always pick the
smallest form if it can. When dealing with a symbol that is not defined yet when a
line is being assembled, it will always use the long form. If you need to force the
assembler to use either the short or long form of the instruction, you can append
either `.s' (short) or `.l' (long) to it. For example, if you are writing
an assembly program and you want to do a branch to a symbol that is defined later
in your program, you can write `bra.s foo'.
Objdump and GDB will always append `.s' or `.l' to instructions which
have both short and long forms.
The D30V assembler takes as input a series of instructions, either one-per-line, or in the special two-per-line format described in the next section. Some of these instructions will be short-form or sub-instructions. These sub-instructions can be packed into a single instruction. The assembler will do this automatically. It will also detect when it should not pack instructions. For example, when a label is defined, the next instruction will never be packaged with the previous one. Whenever a branch and link instruction is called, it will not be packaged with the next instruction so the return address will be valid. Nops are automatically inserted when necessary.
If you do not want the assembler automatically making these decisions, you can control the packaging and execution type (parallel or sequential) with the special execution symbols described in the next section.
`;' and `#' are the line comment characters. Sub-instructions may be executed in order, in reverse-order, or in parallel. Instructions listed in the standard one-per-line format will be executed sequentially unless you use the `-O' option.
To specify the executing order, use the following symbols:
The D30V syntax allows either one instruction per line, one instruction per line with the execution symbol, or two instructions per line. For example
abs r2,r3 -> abs r4,r5
abs r2,r3 <- abs r4,r5
abs r2,r3 || abs r4,r5
ldw r2,@(r3,r4) ||
mulx r6,r8,r9
mulx a0,r8,r9
stw r2,@(r3,r4)
stw r2,@(r3,r4) ->
mulx a0,r8,r9
stw r2,@(r3,r4) <-
mulx a0,r8,r9
Since `$' has no special meaning, you may use it in symbol names.
as
supports the full range of guarded execution
directives for each instruction. Just append the directive after the
instruction proper. The directives are:
You can use the predefined symbols `r0' through `r63' to refer to the D30V registers. You can also use `sp' as an alias for `r63' and `link' as an alias for `r62'. The accumulators are `a0' and `a1'.
The D30V also has predefined symbols for these control registers and status bits:
psw
bpsw
pc
bpc
rpt_c
rpt_s
rpt_e
mod_s
mod_e
iba
f0
f1
f2
f3
f4
f5
f6
f7
s
v
va
c
b
as
understands the following addressing modes for the D30V.
Rn
in the following refers to any of the numbered
registers, but not the control registers.
Rn
@Rn
@Rn+
@Rn-
@-SP
@(disp, Rn)
addr
#imm
The D30V has no hardware floating point, but the .float
and .double
directives generates IEEE floating-point numbers for compatibility
with other development tools.
For detailed information on the D30V machine instruction set, see
D30V Architecture: A VLIW Microprocessor for Multimedia Applications
(Mitsubishi Electric Corp.).
as
implements all the standard D30V opcodes. The only changes are those
described in the section on size modifiers
Go to the first, previous, next, last section, table of contents.