共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 跳转至页
回复
| 有奖活动 | |
|---|---|
| 硬核工程师专属补给计划——填盲盒 | |
| “我踩过的那些坑”主题活动——第002期 | |
| 【EEPW电子工程师创研计划】技术变现通道已开启~ | |
| 发原创文章 【每月瓜分千元赏金 凭实力攒钱买好礼~】 | |
| 【EEPW在线】E起听工程师的声音! | |
| 高校联络员开始招募啦!有惊喜!! | |
| 【工程师专属福利】每天30秒,积分轻松拿!EEPW宠粉打卡计划启动! | |
| 送您一块开发板,2025年“我要开发板活动”又开始了! | |
我要赚赏金打赏帖 |
|
|---|---|
| 在FireBeetle2ESP32-C5上实现温湿度检测和显示被打赏¥20元 | |
| 在FireBeetle2ESP32-C5上实现光照强度检测及显示被打赏¥21元 | |
| 以FireBeetle2ESP32-C5实现数据识读播报被打赏¥19元 | |
| 【STM32F103ZET6】14:实测STM32F1的串口输出任务的挂起与恢复功能被打赏¥27元 | |
| Chaos-nano在压力容器监控系统中的项目应用被打赏¥23元 | |
| 基于FireBeetle2ESP32-C5的WS2812B彩色灯带控制被打赏¥21元 | |
| SWM221CBT7显示开发板驱动TFT显示屏被打赏¥19元 | |
| SWM221CBT7显示开发板驱动OLED屏显示被打赏¥19元 | |
| SWM221CBT7显示开发板及其使用被打赏¥20元 | |
| 揭秘Chaos-nano:ArduinoProMini轻量级操作系统开发框架深度解析与实战应用被打赏¥19元 | |
我要赚赏金
