Excalibur electronic A-MNL-NIOSPROG-01.1 用户手册
70
Altera Corporation
32-Bit Instruction Set
MSTEP
Multiply-Step
Operation:
If (R0[31] = = 1)
then R0
← (R0 << 1) + RA
else R0
← (R0 << 1)
Assembler Syntax:
MSTEP %rA
Example:
MSTEP %g1 ; accumulate partial-product
Description:
Implements a single step of an unsigned multiply. The multiplier in %r0 and
multiplicand in RA. Result is accumulated into %r0. RA is not affected.
The following code fragment implements a 16-bit
× 16-bit into 32-bit multiply. On
entry, %r0 and %r1 contain the multiplier and multiplicand, respectively. The
result is left in %r0.
SWAP %r0 ; Move multiplier into place
MSTEP %r1
MSTEP %r1
MSTEP %r1
…
A total of 16 MSTEPs …
MSTEP %r1
; 32-bit product left in %r0
Condition Codes:
Flags: Unaffected
Instruction Format:
Rw
Instruction Fields:
A = Register index of operand RA
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
0
1
1
1
1
1
1
0
1
0
0
A
N
V
Z
C
−
−
−
−