<< Chapter < Page | Chapter >> Page > |
Instruction | Description |
---|---|
ABS |
integer absolute value with saturation |
ADD(U) |
signed or unsigned integer addition without saturation |
AND |
bitwise AND |
CMPEQ |
integer compare for equality |
CMPGT(U) |
signed or unsigned integer compare for greater than |
CMPLT(U) |
signed or unsigned integer compare for less than |
LMBD |
leftmost bit detection |
MV |
move from register to register |
NEG |
negate (pseudo-operation) |
NORM |
normalize integer |
NOT |
bitwise NOT |
+OR |
bitwise OR |
SADD |
integer addition with saturation to result size |
SAT |
saturate a 40-bit integer to a 32-bit integer |
SSUB |
integer subtraction with saturation to result size |
SUBC |
conditional integer subtraction and shift - used for division |
XOR |
exclusive OR |
ZERO |
zero a register (pseudo-operation) |
Instruction | Description |
---|---|
ADD(U) |
signed or unsigned integer addition without saturation |
ADDAB (B/H/W) |
integer addition using addressing mode |
LDB (B/H/W) |
load from memory with a 15-bit constant offset |
MV |
move from register to register |
STB (B/H/W) |
store to memory with a register offset or 5-bit unsigned constant offset |
SUB(U) |
signed or unsigned integer subtraction without saturation |
SUBAB (B/H/W) |
integer subtraction using addressing mode |
ZERO |
zero a register (pseudo-operation) |
Instruction | Description |
---|---|
MPY (U/US/SU) |
signed or unsigned integer multiply 16lsb*16lsb |
MPYH (U/US/SU) |
signed or unsigned integer multiply 16msb*16msb |
MPYLH |
signed or unsigned integer multiply 16lsb*16msb |
MPYHL |
signed or unsigned integer multiply 16msb*16lsb |
SMPY (HL/LH/H) |
integer multiply with left shift and saturation |
Other than the CPU instruction set, there are special commands
to the assembler that direct the assembler to do various jobswhen assembling the code. You should learn about some of
these
assembler directives to be able to write an
assembly program. There are useful assembler directives youcan use to let the assembler know various settings, such as
.set, .macro, .endm, .ref, .align, .word, .byte
.include
.,
The
.set
directive defines a symbolic
name. For example, you can have
1 count .set 40
Then, the assembler replaces each occurrence of
count
with
40
.
You have already seen how the
.ref
directive is used to declare symbolic names defined in another
file. It is similar to the
extern
declaration in C.
The
.space
directive reserves a memory
space with specified number of bytes. For example, you canhave
1 buffer .space 128
to define a buffer of size 128 bytes. The symbol
buffer
has the address of the first byte
reserved by
.space
. The
.bes
directive is similar to
.space
, but the label has the address of
the last byte reserved.
To put a constant value in the memory, you can use
.byte
,
.word
,
1 const1 .word 0x1234
the assembler places the word constant
0x1234
at
a memory location and
const1
has the address of
the memory location.
.byte
Sometimes you need to place your data or code at a specific
memory address boundaries such as word, halfword,
.align
directive to do this. For example, if you have
1 .align 4
2 buffer .space 1283 ...
Notification Switch
Would you like to follow the 'Finite impulse response' conversation and receive update notifications?