Hello Kusti,

Though I have no problem with your proposed change, it's probably not
exactly as you expect here. Like the manual says, when a variable has an
absolute location but no initializer it is not allocated by the
compiler/linker. This is due to backward compatibility. I haven't checked
for the pic code, but this how SDCC works in general and I assume the pic
target to be no different.

Maarten

> Hi
>
> I noticed one of projects has (for some historical reason) a few
> definitions
> like this:
>
>
> typedef struct _BDT
> {
>     unsigned char STAT;
>     unsigned char CNT;
>     unsigned int ADDR;
> } BDT;
>
>
> volatile BDT __at (0x0400+0*8) ep0_o;
> ...etc...
>
>
>
> (These define a USB end points at the given addresses).
>
> Now this won't work if I include this header in several places in my
> project,
> so I'm planning to change this definition into declaration
>
> volatile BDT ep0_o;
>
> and move the definition to .c file of its own.
>
> Now my questions is if this is going to change the generated code,
> especially
> if it incurs performance or code size penalty as I'm running on the edge
> on both.
>
> br Kusti


------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to