Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PIC] Weird link behavior: 2 variables in same memory position??

2 views
Skip to first unread message

Jasinski

unread,
Jul 15, 2004, 6:01:31 PM7/15/04
to
Fellows,

anyone faced a problem like this using MPASM and MPLINK? I have two
variables (SinalIn_currentQuadrant and Vadc_totalQuadrantsCount),
which are defined like this:

------- file 'Vadc.asm' --------------
(...)
Vadc_SharedVars UDATA_SHR
Vadc_totalQuadrantsCount res 1
global Vadc_totalQuadrantsCount
(...)
------- file 'SinalIn.asm' -----------
(...)
SinalIn_SharedVars UDATA_SHR
SinalIn_currentQuadrant res 1
global SinalIn_currentQuadrant
(...)
--------------------------------------

Out of nowhere, in a certain stage of the development, everything
ceases to work and the firmware exhibits strange behavior. A lot of
effort latter, I track the cause down to this:

------ linker map file-------------
MPLINK 3.80, Linker
Linker Map File - Created Thu Jul 15 18:38:21 2004
(...)
SinalIn_currentQuadrant 0x000070 data extern (...)
Vadc_totalQuadrantsCount 0x0000f0 data extern (...)
(...)
-----------------------------------

Am I interpreting this the right way? Did the linker put two distinct
variables in the same shared memory position? (I forgot to mention
that I am using the 16F819, in which positions 70~7F = F0~FF = 170~17F
= 1F0~1FF, according to the datasheet).

I'm not totally innocent in this whole story, since the problem
started when I
unadvisedly defined more variables than the shared memory could hold.
But shouldn't the linker give me a warning of some kind, instead of
doing this mess and ruining my project?

Thanks for any insight on this subject,

Ricardo Jasinski.

(btw, I'm using MPLAB 6.60.00.0

0 new messages