pics in commercial products

Status
Not open for further replies.
Nigel Goodwin said:
Simulators aren't the real world, often simulators run code that doesn't work in reality.

I was referring to the specific case of table crossing page boundary.

So you are saying codes with table crossing page boundary *will* work on simulator, or you don't know but are just making a generalised statement about simulators?
 
eblc1388 said:
I was referring to the specific case of table crossing page boundary.

So you are saying codes with table crossing page boundary *will* work on simulator, or you don't know but are just making a generalised statement about simulators?

I NEVER use simulators, so can't comment on this exact case - but I have a vague recollection that such paging problems work on the simulator.

What we really need is to see his original source code!.
 
OK. Now every things clear.

This is the table

241 00F0 0841 MOVF 0x41, 0
242 00F1 0008 RETURN
243 00F2 0782 ADDWF 0x2, 0x1
244 00F3 3400 RETLW 0
|
255 00FE 3433 RETLW 0x33
256 00FF 3438 RETLW 0x38 < -- end of the table
257 0100 2298 CALL 0x298
258 0101 0847 MOVF 0x47, 0
259 0102 3C02 SUBLW 0x2

It’s on the edge!!. I changed the code by adding some nops like this
And PIC is now dead. (When this happen I usually cry, now I can laugh.)

241 00F0 0841 MOVF 0x41, 0
242 00F1 0000 NOP <-
243 00F2 0000 NOP <-
244 00F3 0000 NOP <-

245 00F4 0008 RETURN
246 00F5 0782 ADDWF 0x2, 0x1
247 00F6 3400 RETLW 0
|
258 0101 3433 RETLW 0x33
259 0102 3438 RETLW 0x38
260 0103 229B CALL 0x29b
261 0104 0847 MOVF 0x47, 0
262 0105 3C02 SUBLW 0x2

Thank u guys for explaining this. I have learned my lesson.

------

8bit = 'b'11111111 = .255 = FFh
You both talking about 0x1ff ??? is it the second page ?

-----

I am using MPLAB version 6. Maybe new versions can detect this error.
 
Has anyone mentioned a computer mouse? I didn't read the whole thread...

I also found two of them in some old network controller.
 
I am using MPLAB version 6. Maybe new versions can detect this error.
If you step through the code and watch the little green arrow you will see the PIC jump into lala land. The assembler will not give you a compiler error unless you add some directives like this:
Code:
Table1: 
        ADDWF   PCL, f   ;jump forward by value of W 
        retlw   'A' 
        retlw   'B' 
        retlw   'C' 
        retlw   'D' 
        retlw   'E' 
        retlw   'F'  ;end of table 
 IF HIGH($)!=HIGH(Table1) 
 ERROR "End of table is not in same page as start of table" 
 ENDIF
 
kchriste said:
If you step through the code and watch the little green arrow you will see the PIC jump into lala land.

Ok. It’s my mistake. Simulator can tell this.
--
And I know how your directive works.

Thanks.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…