共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 跳转至页
回复
| 有奖活动 | |
|---|---|
| 这个春节你犒赏自己什么了?分享你的故事,有奖征集 | |
| 2026年“我要开发板活动”第三季,开始了! | |
| 硬核工程师专属补给计划——填盲盒 | |
| “我踩过的那些坑”主题活动——第002期 | |
| 【EEPW电子工程师创研计划】技术变现通道已开启~ | |
| 发原创文章 【每月瓜分千元赏金 凭实力攒钱买好礼~】 | |
| 【EEPW在线】E起听工程师的声音! | |
| 高校联络员开始招募啦!有惊喜!! | |
我要赚赏金打赏帖 |
|
|---|---|
| Gravity:中英文语音合成模块V2.0及其串口控制被打赏¥24元 | |
| 全彩色度变化图的绘制被打赏¥27元 | |
| 【FreeRtos】FreeRtos任务栈的生长方向管理方式被打赏¥20元 | |
| 【瑞萨RA8D1 LVGL/LWIP评测】LVGL添加输入设备:EC11旋转编码器被打赏¥39元 | |
| 【瑞萨RA8D1 LVGL/LWIP评测】RA8D1部署FreeRTOS+LVGL被打赏¥33元 | |
| 空气质量检测器设计与实现被打赏¥24元 | |
| 【瑞萨RA8D1 LVGL/LWIP评测】LWIP进行UDP、TCP、HTTP、MQTT功能联合测试被打赏¥41元 | |
| 【瑞萨RA8D1 LVGL/LWIP评测】RA8D1部署FreeRTOS+LWIP被打赏¥36元 | |
| RTOS怎么选?让我来给你答案!被打赏¥15元 | |
| 【S32K3XX】Flash驱动使用被打赏¥26元 | |
我要赚赏金
