The first and second operands can be any of the 32 general-purpose registers.
Constants cannot be directly encoded in the instructions.
Opcode 0 is a special case and is used for four different instructions. Depending
on the format, it can indicate a STOP, a NOP, a debug TRACE or RETI, which is
used to exit an interrupt handler.
Another special case is the instruction LDA, which loads a constant to the
specified register. The constant is loaded from the next aligned 32 bits after the
active program counter. The program counter then skips the constant and continues
the program execution directly after the constant.
In general, placing two instructions into one 32-bit word increases code density
and performance. The processor executes the left instruction first and can then,
without accessing the memory, directly execute the second one.
Note that the program counter has the same value for both of these instructions.
This can be a problem because it is obviously not possible to jump to an instruction
on the right side, as it has no unique address and is not 32-bit aligned.
A compiler has to make sure that NOPs are inserted at the correct places to
prevent these cases if instruction reordering fails to fill the gap.
All arithmetic operations treat the value in the operand as signed values. There is
no method to execute unsigned operations. Except for the conditional jump
instruction, every operation accepts the same register for both arguments.
Table 14.1 lists all available instructions together with a short description of
their effect. It also shows the assembler representation used throughout this report.
While most entries are self-explanatory, the result of the compare instruction
CND requires more information. Similar to other platforms, it checks for three
conditions and saves them as flags in the first three bits of the result register:
Bit 0 : R1 [ R2
Bit 1 : R1\R2
Bit 2 : R1 ¼ R2
Using an appropriate constant mask and the bit instructions, the result for every
possible comparison operation can be extracted from the flags and saved as a
Boolean value, or used as an argument in a conditional jump:
15 14 13
10
9
5
4
0
Instruction
Operand1
Operand2
Format
Fig. 14.5 Instruction format
14.2 Instruction Set
203
Précédent

- 214/315

Suivant