Microchip
直播中

邓莎

7年用户 186经验值
私信 关注
[问答]

MPASM dt指令似乎不起作用

我为PIC16F870写了一个大约10年前的项目,这是一个完美的工作。当然,我现在使用的是MPASM的最后版本,V5.72与旧的源代码。ASM文件和新的MPASM,我遇到了一个问题:我可以编译,但编程后它已经不工作了。经过几个星期的考验,我是。当我尝试从AdvWF PCL、FDT DEST1、Dest2、Dest3……在Dest1=1,Dest2=4,Dest3=6toADWWF PCL,FRTLW DEST1RESLW DEST2RESLW DEST3……时,改变表读取功能。查看程序内存,我看到“ReLLW DEST1”被正确编译为0x3401,而“DestDest1”被编译为0x001。我弄错了吗?

以上来自于百度翻译


      以下为原文

    I am refreshing a project written about 10 years ago for PIC16F870 and perfectly working.
Of course I am now using the last version of MPASM, v5.72
With old source .asm file and new MPASM I got a problem: I was able to compile, but after programming it did not work anymore.
After weeks of trials, I was going to give up while I tried to change a table read function from
addwf PCL,f
dt dest1, dest2, dest3...
where dest1=1, dest2=4, dest3=6
to
addwf PCL,f
retlw dest1
retlw dest2
retlw dest3...
and it worked!
Looking at the program memory I saw that " retlw dest1" is correctly compiled as 0x3401, while " dt dest1" is compiled as 0x0001. Have I made any mistake?

回帖(13)

王焕树

2019-4-19 12:57:10
这不重要,但是你是使用绝对模式还是链接模式?MPLAB的默认值为绝对值,因为MPLABX正在链接。如果您想继续使用绝对模式,则必须编辑项目属性。

以上来自于百度翻译


      以下为原文

    It shouldn't matter, but are you using absolute, or linking mode?
The default for MPLAB was absolute, for MPLABX it is linking.
You have to edit the project properties if you want to keep using absolute mode.
 
 
 
举报

卢兰凤

2019-4-19 13:08:48
你说得对!我把编辑属性更改为绝对值;所有的东西都编译得很好,程序运行正常。

以上来自于百度翻译


      以下为原文

    You right! I changed edit properties to absolute; everything is compiled well and program runs ok.Smile:
举报

李维兴

2019-4-19 13:21:50
隐马尔可夫模型。。。可重定位模式如何在绝对代码中扰乱DT指令?!

以上来自于百度翻译


      以下为原文

   
Hmm... how can relocatable mode mess up the DT directive in absolute code?!
举报

王焕树

2019-4-19 13:33:06
是的,最奇怪的是,我从DB指令的文档中得到线索,它明确地指出它在链接或绝对模式上的行为不同。

以上来自于百度翻译


      以下为原文

    Yes, most odd.
I got the clue from the documentation for the DB directive, which specifically says it behaves differently in linking or absolute mode.
 
举报

更多回帖

发帖
×
20
完善资料,
赚取积分