Instructions
www.ti.com
Example
Calculate Y = M1*X1 + B1. This example assumes that M1, X1, B1 and Y1 are all on the
same data page.
MOVW
DP, #M1
; Load the data page
MOV32
R0H,@M1
; Load R0H with M1
MOV32
R1H,@X1
; Load R1H with X1
MPYF32
R1H,R1H,R0H
; Multiply M1*X1
|| MOV32
R0H,@B1
;
and in parallel load R0H with B1
; <-- MOV32 complete
NOP
; Wait 1 cycle for MPYF32 to complete
; <-- MPYF32 complete
ADDF32
R1H,R1H,R0H
; Add M*X1 to B1 and store in R1H
NOP
; Wait 1 cycle for ADDF32 to complete
; <-- ADDF32 complete
MOV32
@Y1,R1H
; Store the result
Calculate Y = (A * B) * C:
MOVL
XAR4, #A
MOV32
R0H,
*XAR4
; Load ROH with A
MOVL
XAR4, #B
MOV32
R1H,
*XAR4
; Load R1H with B
MOVL
XAR4, #C
MPYF32 R1H,R1H,R0H
; Calculate R1H = A * B
|| MOV32
R0H,
*XAR4
;
and in parallel load R2H with C
; <-- MOV32 complete
MOVL
XAR4, #Y
; <-- MPYF32 complete
MPYF32 R2H,R1H,R0H
; Calculate Y = (A * B) * C
NOP
; Wait 1 cycle for MPYF32 to complete
; MPYF32 complete
MOV32 *XAR4,R2H
See also
MPYF32 RdH, ReH, RfH || MOV32 mem32, RaH
MACF32 R3H, R2H, RdH, ReH, RfH || MOV32 RaH, mem32
MACF32 R7H, R6H, RdH, ReH, RfH || MOV32 RaH, mem32
MACF32 R7H, R3H, mem32, *XAR7++
Instruction Set
108
SPRUEO2A – June 2007 – Revised August 2008
Содержание TMS320C28 series
Страница 2: ...2 SPRUEO2A June 2007 Revised August 2008 Submit Documentation Feedback ...
Страница 12: ...Introduction 12 SPRUEO2A June 2007 Revised August 2008 Submit Documentation Feedback ...
Страница 20: ...CPU Register Set 20 SPRUEO2A June 2007 Revised August 2008 Submit Documentation Feedback ...
Страница 136: ...Instruction Set 136 SPRUEO2A June 2007 Revised August 2008 Submit Documentation Feedback ...