Xilinx MicroBlaze Reference Manual page 235

Embedded development kit edk 14.7
Hide thumbs Also See for MicroBlaze:
Table of Contents

Advertisement

rsub
Arithmetic Reverse Subtract
rsub
rsubc
rsubk
rsubkc
0 0 0 K C 1
0
6
Description
The contents of register rA is subtracted from the contents of register rB and the result is placed into
register rD. Bit 3 of the instruction (labeled as K in the figure) is set to one for the mnemonic rsubk.
Bit 4 of the instruction (labeled as C in the figure) is set to one for the mnemonic rsubc. Both bits are
set to one for the mnemonic rsubkc.
When an rsub instruction has bit 3 set (rsubk, rsubkc), the carry flag will Keep its previous value
regardless of the outcome of the execution of the instruction. If bit 3 is cleared (rsub, rsubc), then the
carry flag will be affected by the execution of the instruction.
When bit 4 of the instruction is set to one (rsubc, rsubkc), the content of the carry flag (MSR[C])
affects the execution of the instruction. When bit 4 is cleared (rsub, rsubk), the content of the carry
flag does not affect the execution of the instruction (providing a normal subtraction).
Pseudocode
Registers Altered
Latency
Notes
In subtractions, Carry = (Borrow). When the Carry is set by a subtraction, it means that there is no
Borrow, and when the Carry is cleared, it means that there is a Borrow.
MicroBlaze Processor Reference Guide
UG081 (v14.7)
rD, rA, rB
rD, rA, rB
rD, rA, rB
rD, rA, rB
rD
rA
1
1
if C = 0 then
(rA) + 1
(rD)
(rB) +
else
(rA)
(rD)
(rB) +
+ MSR[C]
if K = 0 then
MSR[C]
CarryOut
rD
MSR[C]
1 cycle
www.xilinx.com
Subtract
Subtract with Carry
Subtract and Keep Carry
Subtract with Carry and Keep Carry
rB
0 0 0 0 0 0 0 0 0 0 0
1
2
6
1
Instructions
3
1
235
Send Feedback

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the MicroBlaze and is the answer not in the manual?

Table of Contents