Truncated match.
PICList
Thread
'MPLAB bug? HELP!!!'
1996\05\29@042555
by
Newfound Electronics
Hi all,
I've been trying to use MPLAB and have ended up very confused!
What is the real result of this operation?
MOVLW 01
ADDWF PC,SAME
RETLW 0AH
RETLW 0Eh
MPLAB insists on jumping to the first RETLW 0Ah. I reckon it's wrong
and plug for the second RETLW 0Eh.
A zero offset ends up in an infinite loop!!??
I'm sure I knew how this all worked but after using MPLAB, I am
confused and have a king size headache!
Am I bugged or is it MPLAB?
Also, the RETLW instruction description "example" for all the PICs
I checked appears to describe the table jump operation incorrectly.
TABLE ADDWF PC
RETLW K1
RETLW K2
" "
RETLW Kn
w = 0x07 should return K8 NOT k7, right?
This is just to confuse me more I guess....
Jim
1996\05\29@045128
by
fastfwd
Newfound Electronics <spam_OUTPICLISTTakeThisOuT
MITVMA.MIT.EDU> wrote:
> I've been trying to use MPLAB and have ended up very confused!
> What is the real result of this operation?
>
> MOVLW 01
> ADDWF PC,SAME
> RETLW 0AH
> RETLW 0Eh
>
> MPLAB insists on jumping to the first RETLW 0Ah. I reckon it's wrong
> and plug for the second RETLW 0Eh.
> ....
> Am I bugged or is it MPLAB?
Jim:
Check to make sure that you've defined "SAME" to "1". If so,
the bug is in MPLAB.
> TABLE ADDWF PC
> RETLW K1
> RETLW K2
> " "
> RETLW Kn
>
> w = 0x07 should return K8 NOT k7, right?
Right.
-Andy
Andrew Warren - .....fastfwdKILLspam
@spam@ix.netcom.com
Fast Forward Engineering, Vista, California
http://www.geocities.com/SiliconValley/2499
1996\05\29@095330
by
Mark K Sullivan
This is a known bug in MPLAB. They told us about it at the last seminar. See?
The seminars are good for something. The simulator doesn't add one to the PC
(for the pre-fetch) in operations which modify the PC.
The work around is to add 1 yourself in code which you will run on the simulator
and take it out again when you go to silicon.
- Mark Sullivan -
1996\05\30@091912
by
Newfound Electronics
|
>This is a known bug in MPLAB. They told us about it at the last seminar. See?
>The seminars are good for something. The simulator doesn't add one to the PC
>(for the pre-fetch) in operations which modify the PC.
>
>The work around is to add 1 yourself in code which you will run on the
simulator
>and take it out again when you go to silicon.
>
>- Mark Sullivan -
>
>
Thanks to all who helped with the MPLAB bug, my sanity is restored and my
headache sank into the depths of my pillow.
Mark, I thought of the above too but my application was a delay and the offset
was used as part of the delay like this:
movlw 03
andwf baudrate
xorlw ??
xorlw ??
xorlw ??
movwf dlycnt
decfsz $-1
This obsure method is because I'm using a 16C57 with only 2 levels of stack and
limited literal instructions. Pretty clever huh?
Given 4 such tables for the RS232 TX and RX routines, it sort of gets confusing,
well for me anyway! I think I'll grab the new MPLAB version.
My thanks once again...
Regards,
Jim
More... (looser matching)
- Last day of these posts
- In 1996
, 1997 only
- Today
- New search...