这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 嵌入式开发 » FPGA » 初学者请教DSP中的直接寻址问题

共3条 1/1 1 跳转至

初学者请教DSP中的直接寻址问题

菜鸟
2007-05-28 06:18:08     打赏

我是一个DSP初学者,想请教一些非常初级的问题

以下为一直接寻址的汇编源程序
.title "lab2d.asm"
.def start
.bss x,1
.bss y,1
.data
.text
start: ST #0001,*(0180h)
ST #1000,*(01ffh)
ST #500,*(0200h)
LD #x,DP
LD @x,A
; LD #y,DP
ADD @y,A
here: B here
.end

CMD源代码为
MEMORY
{
PAGE 0:
EPROM : org=0E000h, len=100h
PAGE 1:
DARAM : org=01ffh, len=10h
}
SECTIONS
{
.text : >EPROM PAGE 0
.bss : >DARAM PAGE 1
.data : >EPROM PAGE 0
}
把上面的程序经过编译和连接
得到的反汇编代码为
0000:E000 76F8 ST #1h,*(180h)
0000:E003 76F8 ST #3e8h,*(x)
0000:E006 76F8 ST #1f4h,*(y)
0000:E009 EA03 LD #3h,DP
0000:E00A 107F LD 7fh,A
0000:E00B 0000 ADD IMR,A
0000:E00C here
0000:E00C F073 B here

我的问题如下
1 在上面的LD #x,DP
中#x到底代表着什么,他为什么编译为LD #3h,DP

2 在上面的 ADD @y,A为什么编译为了ADD IMR,A

我的理解应该为
x中的低九位传给DP,但为什么是#3呢?
其次上面的@y应该是DP构成地址的低九位加上y的低七位得出地址,
但为什么是IMR呢?

务请高手详细指点,能否把过程解释清楚。




关键词: 初学者     请教     中的     直接     寻址     问题    

院士
2007-05-28 16:12:00     打赏
2楼
我帮你问问啊~~

菜鸟
2007-06-05 01:49:00     打赏
3楼

哎,这么多高手怎么就不随便指教一下呢,我好伤心哦
费了好大的劲,通过别的路径,终于找到我认为可以是满意解释问题1的答案,现抄录如下:

;when we want to use directing addresing
;we may write down as following
;ld #x,dp
;~~~~~~~~~~~~~
;st a,@x
;then the addres of transformation is the address of x
;that equal as transform a to at x
;That is very important in the directing addresing.
;********************************************************************************************************
;*****that instruction la #x,dp is means that sent the number of page of x in data memory to dp
;*****and the caculation of page number is devided by 128 words from 0x0000 to 0xfff
;***** so every page is 128 words
;***** the page is devided as flowing:
;*****0x0000~0x007f
;*****0x0080~0x00ff
;*****0x0100~0x017f
;*****0x0180~0x01ff
;*****0x0200~0x027f
;*****~~~~~~~~~~~~~~~~~~~~~~~~~
;*****for example:
;*****if x was devote to the addres of 0x0fff,so the x is in NO. 3 page in data memory
;*****and then the instruction la #x,dp is sent 3 to dp,and equal to 0x0180
;*****but notice the next address is derived by the NO.4 page in data memory
;*****@x is the address of x

问题2还请高手不吝赐教
还有你们有没有可以交流的好论坛呀


共3条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]