共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 跳转至页
回复
我要赚赏金打赏帖 |
|
|---|---|
| 设备功耗web监控界面(ESP32C5)被打赏¥28元 | |
| OrangePiZero2W系统被打赏¥33元 | |
| Linux环境下以模拟方式快速实现出入管理功能测试被打赏¥24元 | |
| 树莓派3+Klipper,老3D打印机满血升级被打赏¥33元 | |
| OK1126B-S开发板下串口屏及其应用被打赏¥21元 | |
| 低功耗超声波液位测距仪(ESP32S3)被打赏¥27元 | |
| 在K230DBOX上实现多时段语音提示功能被打赏¥14元 | |
| 使K230DBOX实现相机持续拍照功能被打赏¥12元 | |
| 基于K230DBOX的文本管理器设计被打赏¥14元 | |
| 基于K230DBOX的彩色画板功能实现被打赏¥15元 | |
我要赚赏金
