SPRUIZ1B July 2023 – August 2024 TMS320F28P650DH , TMS320F28P650DK , TMS320F28P650SH , TMS320F28P650SK , TMS320F28P659DH-Q1 , TMS320F28P659DK-Q1 , TMS320F28P659SH-Q1
32-Bit Integer Subtraction
MRa | CLA floating-point destination register (MR0 to MR3) |
MRb | CLA floating-point destination register (MR0 to MR3) |
MRc | CLA floating-point destination register (MR0 to MR3) |
LSW: 0000 0000 00cc bbaa
MSW: 0111 1100 1110 0000
32-bit integer addition of MRb and MRc.
MARa(31:0) = MARb(31:0) - MRc(31:0);
This instruction modifies the following flags in the MSTF register:
Flag | TF | ZF | NF | LUF | LVF |
---|---|---|---|---|---|
Modified | No | Yes | Yes | No | No |
The MSTF register flags are modified as follows:
NF = MRa(31);
ZF = 0;
if(MRa(31:0) == 0) { ZF = 1; }
This is a single-cycle instruction.
; Given A = (int32)1
; B = (int32)2
; C = (int32)-7
;
;
Calculate Y2 = A - B - C
;
_Cla1Task3:
MMOV32 MR0, @_A ; MR0 = 1 (0x00000001)
MMOV32 MR1, @_B ; MR1 = 2 (0x00000002)
MMOV32 MR2, @_C ; MR2 = -7 (0xFFFFFFF9)
MSUB32 MR3, MR0, MR1 ; A + B
MSUB32 MR3, MR3, MR2 ; A + B + C = 6 (0x0000006)
MMOV32 @_y2, MR3 ; Store y2
MSTOP ; End of task