共2条
1/1 1 跳转至页
dsp55xx dsp55xx编程的一起来交流!
问
我现在正用DSP55xx汇编编程,很多人都说容易,可给我感觉可真累,谁有好的编程方法与技巧,大家一起交流学习一下!
谢谢!
答 1: DSP55xx汇编编程是比6000的 答 2: 为什么不用c,然后再局部优化?而且55x还有流水线保护,多好 答 3: DSP55xx编程的一起来交流!1用汇编作实时处理比用c好得多,并且编实时算法时还要用汇编!
2用汇编可以更深刻理解DSP调用过程,硬件结构等而用C也只是编完并不明其理
! 答 4: DSP55xx编程的一起来交流!看看下面这个例子:汇编也不是很难.即使不懂汇编也能看懂一些。
* Step 1: Section allocation
* −−−−−−
.def x,y,init
x .usect ”vars”,4 ; reserve 4 uninitalized 16-bit locations for x
y .usect ”vars”,1 ; reserve 1 uninitialized 16-bit location for y
.sect ”table” ; create initialized section ”table” to
init .int 1,2,3,4 ; contain initialization values for x
.text ; create code section (default is .text)
.def start ; define label to the start of the code
start
* Step 2: Processor mode initialization
* −−−−−−
BCLR C54CM ; set processor to ’55x native mode instead of
; ’54x compatibility mode (reset value)
BCLR AR0LC ; set AR0 register in linear mode
BCLR AR6LC ; set AR6 register in linear mode
* Step 3a: Copy initialization values to vector x using indirect addressing
* −−−−−−−
copy
AMOV #x, XAR0 ; XAR0 pointing to variable x
AMOV #init, XAR6 ; XAR6 pointing to initialization table
MOV *AR6+, *AR0+ ; copy starts from ”init” to ”x”
MOV *AR6+, *AR0+
MOV *AR6+, *AR0+
MOV *AR6, *AR0
* Step 3b: Add values of vector x elements using direct addressing
* −−−−−−−
add
AMOV #x, XDP ; XDP pointing to variable x
.dp x ; and the assembler is notified
MOV @x, AC0
ADD @(x+3), AC0
ADD @(x+1), AC0
ADD @(x+2), AC0
* Step 3c. Write the result to y using absolute addressing
* −−−−−−−
MOV AC0, *(#y)
end
NOP
B end
谢谢!
答 1: DSP55xx汇编编程是比6000的 答 2: 为什么不用c,然后再局部优化?而且55x还有流水线保护,多好 答 3: DSP55xx编程的一起来交流!1用汇编作实时处理比用c好得多,并且编实时算法时还要用汇编!
2用汇编可以更深刻理解DSP调用过程,硬件结构等而用C也只是编完并不明其理
! 答 4: DSP55xx编程的一起来交流!看看下面这个例子:汇编也不是很难.即使不懂汇编也能看懂一些。
* Step 1: Section allocation
* −−−−−−
.def x,y,init
x .usect ”vars”,4 ; reserve 4 uninitalized 16-bit locations for x
y .usect ”vars”,1 ; reserve 1 uninitialized 16-bit location for y
.sect ”table” ; create initialized section ”table” to
init .int 1,2,3,4 ; contain initialization values for x
.text ; create code section (default is .text)
.def start ; define label to the start of the code
start
* Step 2: Processor mode initialization
* −−−−−−
BCLR C54CM ; set processor to ’55x native mode instead of
; ’54x compatibility mode (reset value)
BCLR AR0LC ; set AR0 register in linear mode
BCLR AR6LC ; set AR6 register in linear mode
* Step 3a: Copy initialization values to vector x using indirect addressing
* −−−−−−−
copy
AMOV #x, XAR0 ; XAR0 pointing to variable x
AMOV #init, XAR6 ; XAR6 pointing to initialization table
MOV *AR6+, *AR0+ ; copy starts from ”init” to ”x”
MOV *AR6+, *AR0+
MOV *AR6+, *AR0+
MOV *AR6, *AR0
* Step 3b: Add values of vector x elements using direct addressing
* −−−−−−−
add
AMOV #x, XDP ; XDP pointing to variable x
.dp x ; and the assembler is notified
MOV @x, AC0
ADD @(x+3), AC0
ADD @(x+1), AC0
ADD @(x+2), AC0
* Step 3c. Write the result to y using absolute addressing
* −−−−−−−
MOV AC0, *(#y)
end
NOP
B end
共2条
1/1 1 跳转至页
回复
我要赚赏金打赏帖 |
|
|---|---|
| 28BYJ-48机械臂实现人脸跟随被打赏¥24元 | |
| 基于RK3506B的片温识读功能的实现被打赏¥25元 | |
| 【瑞萨RA8D1测评】基于FreeRTOS的lvgl移植教程被打赏¥29元 | |
| 电子价签墨水屏开发被打赏¥35元 | |
| 【Ozone】RTT 打印终端使用被打赏¥29元 | |
| BMS保护板绝缘检测功能-不平衡电桥技术绝缘电阻检测设计与实现被打赏¥34元 | |
| 给28BYJ-48三自由度机械臂加一个网页控制台被打赏¥32元 | |
| 用28BYJ-48电机从零搭一台三自由度机械臂被打赏¥33元 | |
| 【英飞凌开发经验】ModusToolbox配置EdgeTalk外设被打赏¥27元 | |
| 基于BQ76952PFBR的BMS保护板热插拔损坏的原因和处理措施被打赏¥32元 | |
我要赚赏金
