SPRUII0F May 2019 – June 2024 TMS320F28384D , TMS320F28384D-Q1 , TMS320F28384S , TMS320F28384S-Q1 , TMS320F28386D , TMS320F28386D-Q1 , TMS320F28386S , TMS320F28386S-Q1 , TMS320F28388D , TMS320F28388S
Stop Task
none | This instruction does not have any operands |
LSW: 0000 0000 0000 0000
MSW: 0111 1111 1000 0000
The MSTOP instruction must be placed to indicate the end of each task. In addition, placing MSTOP in unused memory locations within the CLA program RAM can be useful for debugging and preventing run away CLA code. When MSTOP enters the D2 phase of the pipeline, the MIRUN flag for the task is cleared and the associated interrupt is flagged in the PIE vector table.
There are three special cases that can occur when single-stepping a task such that the MPC reaches the MSTOP instruction.
The MSTOP instruction cannot be placed 3 instructions before or after a MBCNDD, MCCNDD, or MRCNDD instruction.
This instruction does not modify flags in the MSTF register.
Flag | TF | ZF | NF | LUF | LVF |
---|---|---|---|---|---|
Modified | No | No | No | No | No |
This is a single-cycle instruction. Table 8-21 shows the pipeline behavior of the MSTOP instruction. The MSTOP instruction cannot be placed with 3 instructions of a MBCNDD, MCCNDD, or MRCNDD instruction.
Instruction | F1 | F2 | D1 | D2 | R1 | R2 | E | W |
---|---|---|---|---|---|---|---|---|
I1 | I1 | |||||||
I2 | I2 | I1 | ||||||
I3 | I3 | I2 | I1 | |||||
MSTOP | MSTOP | I3 | I2 | I1 | ||||
I4 | I4 | MSTOP | I3 | I2 | I1 | |||
I5 | I5 | I4 | MSTOP | I3 | I2 | I1 | ||
I6 | I6 | I5 | I4 | MSTOP | I3 | I2 | I1 | |
New Task Arbitrated and Prioritized | - | - | - | - | - | I3 | I2 | |
New Task Arbitrated and Prioritized | - | - | - | - | - | - | I3 | |
I1 | I1 | - | - | - | - | - | - | |
I2 | I2 | I1 | - | - | - | - | - | |
I3 | I3 | I2 | I1 | - | - | - | - | |
I4 | I4 | I3 | I2 | I1 | - | - | - | |
I5 | I5 | I4 | I3 | I2 | I1 | - | - | |
I6 | I6 | I5 | I4 | I3 | I2 | I1 | - | |
I7 | I7 | I6 | I5 | I4 | I3 | I2 | I1 | |
.... |
; 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