(完整版)基于CCS的软件仿真正弦三角余弦任意波形汇编语言.pdf

上传人:wj151****6093 文档编号:73826161 上传时间:2023-02-22 格式:PDF 页数:6 大小:75.30KB
返回 下载 相关 举报
(完整版)基于CCS的软件仿真正弦三角余弦任意波形汇编语言.pdf_第1页
第1页 / 共6页
(完整版)基于CCS的软件仿真正弦三角余弦任意波形汇编语言.pdf_第2页
第2页 / 共6页
点击查看更多>>
资源描述

《(完整版)基于CCS的软件仿真正弦三角余弦任意波形汇编语言.pdf》由会员分享,可在线阅读,更多相关《(完整版)基于CCS的软件仿真正弦三角余弦任意波形汇编语言.pdf(6页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、.title fountionout.asm .mmregs .def _c_int00 .global sinx,d_xs,d_sinx,cosx,d_xc,d_cosx,sinx_out,rect_out,tria_out sin_x:.usect sin_x,360 STACK:.usect STACK,10 interval.set 1 .bss count,1 .bss output,1800 _c_int00:ST#0,*(count)STM#STACK+10,SP STM#2,AR7 CMPM AR7,#3 ;#3 产生方波 BC rect_sub,TC CMPM AR7,#2

2、;#2 产生三角波 BC tria_sub,TC CMPM AR7,#1 ;1 产生正弦信号 BC sin_sub,TC;CMPM AR7,#4;BC rand_sub,TC ;4 产生随机信号;nop nop end:b end sin_sub:nop nop CALL sinx_out B con rect_sub:nop nop CALL rect_out nop nop B con tria_sub:nop nop CALL tria_out nop nop B con;rand_sub:nop;nop;call rand;nop nop con:STM#sin_x,AR5 STM i

3、nterval,AR0 STM#360,BK STM#output,AR2 loop4:MVDD *AR5+0%,*AR2+ADDM#1,*(count)CMPM*(count),1800 NOP NOP BC done,tc b loop4 done:b done*产生 sin 函数 sinx_out:k_stheta.set 286 ;theta=pi/360(0.5deg.).text STM k_stheta,AR0 ;AR0-k_stheta STM 0,AR1 ;AR1=x STM#sin_x,AR6 STM#90,BRC ;from sin0-sin90(deg)RPTB loo

4、p1-1 LDM AR1,A LD#d_xs,DP STL A,d_xs STL A,d_xc CALL sinx ;(d_sinx)=sin(x)CALL cosx ;(d_cosx)=cos(x)LD#d_sinx,DP LD d_sinx,16,A ;A=sin(x)MPYA d_cosx ;B=sin(x)*cos(x)STH B,1,*AR6+;AR6-2*sin(x)*cos(x)MAR *AR1+0 ;每次增加 0.5 loop1:STM#sin_x+89,AR7;sin(91)-sin(179)STM#88,BRC RPTB loop2-1 LD *AR7-,A STL A,*

5、AR6+loop2:STM#179,BRC ;sin(180)-sin(359)STM#sin_x,AR7 RPTB loop3-1 LD *AR7+,A NEG A STL A,*AR6+loop3:RET *sin(theta)=x(1-x2/2*3(1-x2/4*5(1-x2/6*7(1-x2/8*9)sinx:.def d_xs,d_sinx .data table_s .word 01c7h ;1/(8*9).word 030bh ;1/(6*7).word 0666h ;1/(4*5).word 1556h ;1/(2*3)d_coef_s.usect coef_s,4 d_xs

6、.usect sin_vars,1 d_squr_xs.usect sin_vars,1 d_temp_s.usect sin_vars,1 d_sinx .usect sin_vars,1 c_1_s .usect sin_vars,1 .text SSBX FRCT STM#d_coef_s,AR5 RPT#3 MVPD#table_s,*AR5+STM#d_coef_s,AR3 STM#d_xs,AR2 STM#c_1_s,AR4 ST#7FFFh,c_1_s ;7fffh=1 SQUR *AR2+,A ST A,*AR2|LD *AR4,B MASR *AR2+,*AR3+,B,A M

7、PYA A STH A,*AR2;AR2-d_temp_s MASR *AR2-,*AR3+,B,A MPYA *AR2+ST B,*AR2|LD *AR4,B MASR *AR2-,*AR3+,B,A MPYA *AR2+ST B,*AR2|LD *AR4,B MASR *AR2-,*AR3+,B,A MPYA d_xs STH B,d_sinx RET*cos(theta)=1-x2/2(1-x2/3*4(1-x2/5*6(1-x2/7*8)cosx:.def d_xc,d_cosx d_coef_c.usect coef_c,4 .data table_c .word 0249h ;1/

8、(7*8).word 0444h ;1/(5*6).word 0aabh ;1/(3*4).word 4000h ;1/2 d_xc .usect cos_vars,1 d_squr_xc.usect cos_vars,1 d_temp_c.usect cos_vars,1 d_cosx .usect cos_vars,1 c_1_c .usect cos_vars,1 .text SSBX FRCT STM#d_coef_c,AR5 RPT#3 MVPD#table_c,*AR5+STM#d_coef_c,AR3 STM#d_xc,AR2 STM#c_1_c,AR4 ST#7FFFh,c_1

9、_c SQUR *AR2+,A ST A,*AR2|LD *AR4,B MASR *AR2+,*AR3+,B,A MPYA A STH A,*AR2 MASR *AR2-,*AR3+,B,A MPYA *AR2+ST B,*AR2|LD *AR4,B MASR *AR2-,*AR3+,B,A SFTA A,-1,A NEG A MPYA *AR2+MAR *AR2+RETD ADD *AR4,16,B STH B,*AR2 RET rect_out:k_rtheta.set 7FFFh ;theta=pi/180(1deg.).text LD#7FFFh,A ;LD#4000h,A STM#s

10、in_x,AR6 STM#180,BRC RPTB loopr1-1 STL A,*AR6+loopr1:STM#180,BRC RPTB loopr3-1 LD#0h,A ;LD#0C000h,A STL A,*AR6+loopr3:RET tria_out:k_ttheta.set 364 ;theta=1/90(0.5deg.).text ssbx frct ST#0,*(count)*LD#-1,A LD#0,A STM#STACK+10,SP STM k_ttheta,AR0 STM 0,AR1 STM#sin_x,AR6 STL A,*AR6+STM#89,BRC RPTB loo

11、pt1-1 ADD AR0,A STL A,*AR6+loopt1:STM#sin_x+89,AR7 STM#89,BRC RPTB loopt2-1 LD *AR7-,A STL A,*AR6+loopt2:STM#178,BRC STM#sin_x+1,AR7 RPTB loopt3-1 LD *AR7+,A NEG A STL A,*AR6+loopt3:STM#sin_x,AR5 STM interval,AR0 STM#360,BK STM#output,AR2 loopt4:MVDD *AR5+0%,*AR2+ADDM#1,*(count)CMPM*(count),1800 BC donet,tc b loopt4 donet:b donet RET ;rand:;.bss k,1;.text;NOP;NOP;在这里加探针,导入数据,数据文件为 wgn.dat;NOP;NOP;ret .end

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 应用文书 > 工作报告

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁