共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 跳转至页
回复
打赏帖 | |
---|---|
C语言函数宏的三种封装方式被打赏50分 | |
嵌入式LinuxC语言程序调试和宏使用技巧被打赏50分 | |
让代码中包含最新的编译时间信息被打赏50分 | |
【分享开发笔记,赚取电动螺丝刀】STM32F769LVGL优化显示被打赏26分 | |
rtthread硬件加密--2crc加密分析被打赏10分 | |
【分享开发笔记,赚取电动螺丝刀】STM32F769驱动ST7789以及显示优化被打赏36分 | |
【分享开发笔记,赚取电动螺丝刀】S32K146 PAL模拟I2C驱动适配被打赏23分 | |
我想要一部加热台+电源硬件设计规范被打赏16分 | |
我想要一部加热台+LED背光驱动芯片RT9293知识被打赏18分 | |
【分享开发笔记,赚取电动螺丝刀】S32K146 ADC 模块配置使用被打赏24分 |