STM
#d_coff,AR3
STM
#d_x,AR2
STM
#C_1,AR4
LD
#d_x, DP
ST
#06487h,d_x
; input x = PI/4
ST
#7fffh,C_1
SQUR
*AR2+,A
; A = x^2
ST
A,*AR2
; AR2 = x^2
|| LD
*AR4,B
; B = C_1
MASR
*AR2+,*AR3+,B,A
; A = (1-x^2/72), T = x^2
MPYA
A
; A = T*A = x^2*(1-x^2/72)
STH
A,*AR2
; d_temp = A = x^2*(1-x^2/72)
MASR
*AR2-,*AR3+,B,A
; A = 1-x^2/42(1-x^2/72),
; T = x^2(1-x^2/72)
MPYA
*AR2+
; B = x^2*(1-x^2/42(1-x^2/72))
ST
B,*AR2
|| LD
*AR4,B
MASR
*AR2-,*AR3+,B,A
; A = 1-x^2/20(1-x^2/42(1-x^2/72)
MPYA
*AR2+
; B = x^2*(1-x^2/20(1-x^2/42(1-x^2/72))
MASR
*AR2-,*AR3+,B,A
; A = 1-x^2/6(1-x^2/20(1-x^2/42(1-x^2/72))
MPYA
d_x
; B = x(1-x^2/6(1-x^2/20(1-x^2/42(1-x^2/72)))
STH
B, d_sinx
; d_sinx = sin(x)
RET
.end
;;;;;;;;;;;;;;;;;.text段结束;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4)算法分析
l
运算速度:CCS主界面选择
Profile->Enable Clock,启动时钟分析
Profile->View Clock,观察分析结果
C语言执行时间(见图4)
汇编语言执行时间(见图5)
l
代码长度:Profile->Start New Sessions
输入name_profile ,--〉Range
分析程序代码长度。
(见图6、7) |