加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

题目:SEED DM642的boot.asm程序

发布时间:2020-12-15 18:41:02 所属栏目:百科 来源:网络整理
导读:题目:SEED DM642的boot.asm程序 楼主位: mvkl??COPY_TABLE,a3? ?; load table pointer ? ?? ???mvkh??COPY_TABLE,a3 ? ?? ???ldw? ?*a3++,b1? ?? ???; Load entry point copy_section_top: ? ?? ???ldw? ?*a3++,b0? ?? ???; byte count ? ?? ???ldw? ?*a3+

题目:SEED DM642的boot.asm程序

楼主位:

mvkl??COPY_TABLE,a3? ?; load table pointer
? ?? ???mvkh??COPY_TABLE,a3

? ?? ???ldw? ?*a3++,b1? ?? ???; Load entry point

copy_section_top:
? ?? ???ldw? ?*a3++,b0? ?? ???; byte count
? ?? ???ldw? ?*a3++,a4? ?? ???; ram start address
? ?? ???nop? ?3

[!b0]??b copy_done? ?? ?? ?? ?; have we copied all sections?
? ?? ???nop? ?5

copy_loop:
? ?? ???ldb? ?*a3++,b5
? ?? ???sub? ?b0,1,b0? ?? ?? ? ; decrement counter
[ b0]??b? ???copy_loop? ?? ???; setup branch if not done
[!b0]??b? ???copy_section_top
? ?? ???zero??a1//######
[!b0]??and? ?3,a3,a1
? ?? ???stb? ?b5,*a4++
[!b0]??and? ?-4,a5? ?? ?? ?; round address up to next multiple of 4
[ a1]??add? ?4,a5,a3? ?? ?? ? ; round address up to next multiple of 4
以上是合众达DM642开发板boot.asm里拷贝代码段的程序,从//######开始以下的几行程序我实在看不明白,请高手执教阿

?

一楼回复:

这段代码是由于DSP的流水线原因产生延迟槽,导致执行的顺序发生变化,所以不好理解。load指令的delay slots是4,branch指令的delay slots是5,所以load执行时,后面的4条指令先执行,branch时后面5条指令先执行。你用这样的顺序在看一下。
? ? 另外,dsp外挂的flash是8位的,而段的起始位置是4字节对齐。所以,拷贝下个段之前要进行4自己对齐的调整。

?

转自:http://www.hellodsp.com/bbs/forum.php?mod=viewthread&tid=21138

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读