大家好!所以我决定把这个大的代码块变成一个子程序,我可以在需要的时候调用它,但是现在它不起作用了。最初,当我第一次编写代码时,它在我的启动代码中运行了一次,在0x2f开始。当我把它变成一个子程序时,我把它一直移到我的代码的起点,在0x7d开始。这个问题与这个代码中的一个表有关。表的代码基本上向PCL添加了偏移量,然后跳到RestLW某个值,但现在不这样做。在我的代码开始时,它跳到某个位置。我知道它在做什么和为什么,但是不知道如何补救。ADDWF PCL,F是指令0x11b,但是PCL显示0x1b。跳跃之后它在0x1c。这和PcLaTe有关系吗?我必须用PCL才能到达我需要的地方?我该怎么做?
以上来自于百度翻译
以下为原文
Hello everyone!
So I decided to turn this large block of code I have into a subrou
tine that I can call whenever I need it, but now it's not working. Originally, when I first wrote the code, I had it run once in my Start code where it started at 0x2F. When I made it a subroutine I moved it all the way to the end of my code where is starts at 0x7D.
The problem is related to a table I have in this code. The code for the table basically adds an offset to the PCL and then jumps to RETLW some value, but now it's not doing that. It's jumping to some position way back in the start of my code.
I know what it's doing and why, but don't know how to remedy this.
The ADDWF PCL, F is instruction 0x11B but the PCL is showing 0x1B. After the jump it's at 0x1C.
This has to do with PCLATH right? I have to use it with PCL to get to where I need to be? How do I do that?