Hello,
I am having a little problem with the consistency with the results of the table calling. As the size of the code gets bigger (I am using assembly language), I was getting unexpected results as I was changing the absolute location of the table (where it is stored in the physical memory). I cannot figure out why the table calling result changes as the location of the table changes. They were all located on the same page, thus I thought the it would be the same as long as they are located on the same page.
Here is the sample code I was using and having a problem with...
movlw 0 ; Table address of start of message
movwf TEMP1 ; TEMP1 holds start of message address
movlw HIGH Table
movwf PCLATH
movf TEMP1, W
call Table
.
.
.
Table:
addwf PCL, F
retlw 'A'
retlw 'B'
retlw 'C'
retlw 'D'
.
.
.
As I move the table around (before the calling instruction or after.. or change in its absolute address due to other part of the code) it is returning this really funny results.
Can anyone take a look at my case and give me a suggestion?
Thank you.
I am having a little problem with the consistency with the results of the table calling. As the size of the code gets bigger (I am using assembly language), I was getting unexpected results as I was changing the absolute location of the table (where it is stored in the physical memory). I cannot figure out why the table calling result changes as the location of the table changes. They were all located on the same page, thus I thought the it would be the same as long as they are located on the same page.
Here is the sample code I was using and having a problem with...
movlw 0 ; Table address of start of message
movwf TEMP1 ; TEMP1 holds start of message address
movlw HIGH Table
movwf PCLATH
movf TEMP1, W
call Table
.
.
.
Table:
addwf PCL, F
retlw 'A'
retlw 'B'
retlw 'C'
retlw 'D'
.
.
.
As I move the table around (before the calling instruction or after.. or change in its absolute address due to other part of the code) it is returning this really funny results.
Can anyone take a look at my case and give me a suggestion?
Thank you.