Optional assembler syntax – Texas Instruments TMS320C3x User Manual

Page 492

Advertising
background image

Individual Instructions

13-34

13.6.2 Optional Assembler Syntax

The assembler allows a relaxed syntax form for some instructions. These
optional forms simplify the assembly language so that special-case syntax
can be ignored. A list of the optional syntax forms follows.

-

You can omit the destination register on unary arithmetic and logical oper-
ations when the same register is used as a source. For example,

ABSI

R0,R0

can be written as

ABSI R0

Instructions affected: ABSI, ABSF, FIX, FLOAT, NEGB, NEGF, NEGI,
NORM, NOT, RND

-

You can write all 3-operand instructions without the 3. For example,

ADDI3 R0,R1,R2

can be written as

ADDI R0,R1,R2

Instructions affected: ADDC3, ADDF3, ADDI3, AND3, ANDN3, ASH3,
LSH3, MPYF3, MPYI3, OR3, SUBB3, SUBF3, SUBI3, XOR3

This also applies to all of the pertinent parallel instructions.

-

You can write all 3-operand comparison instructions without the 3. For
example,

CMPI3 R0,*AR0

can be written as

CMPI R0,*AR0

Instructions affected: CMPI3, CMPF3, TSTB3

-

Indirect operands with an explicit 0 displacement are allowed. In 3-operand
or parallel instructions, operands with 0 displacement are automatically
converted to no-displacement mode. For example:

LDI

*+AR0(0),R1

is legal.

Also

ADDI3 *+AR0(0),R1,R2

is equivalent to

ADDI3 *AR0,R1,R2

-

You can write indirect operands with no displacement, in which case a
displacement of 1 is assumed. For example,

LDI *AR0++(1),R0

can be written as

LDI *AR0++,R0

-

All conditional instructions accept the suffix U to indicate unconditional
operation. Also, you can omit the U from unconditional short branch
instructions. For example:

BU label

can be written as

B label

-

You can write labels with or without a trailing colon. For example:

label0:

NOP

label1

NOP

label2:

label assembles to next source line

Advertising