System Keyword

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

Post Reply
rvctx
Posts: 2
Joined: Wed Dec 23, 2009 9:16 pm
Location: France, South of Paris

System Keyword

Post by rvctx » Wed Dec 23, 2009 9:56 pm

Hello,

does anyone know the meaning of System keyword ?
It highlights in the editor, but I haven't seen any information about this word (may be I'm blind tonight ).

Regards,

Herve

User avatar
octal
Registered User
Registered User
Posts: 586
Joined: Thu Jan 11, 2007 12:49 pm
Location: Paris IDF
Contact:

Post by octal » Wed Dec 23, 2009 10:54 pm

It's used to declare aliases to special file/function registers. You can find it in the modules containing the definitions of PICs (include module for each microcontroller).

As for its meaning, I dont realy know about it as it's not documented. But I think that it's mainly a hint to the compiler to treat the variables of type system differently than other vars:
for example if an instruction like x = x + 1 is translated for NRORMAL vars to " INC f " the compiler will not do that for a Portx variable (alias) because of the RMW behaviour..

I think this keyword mainly gives to the system SFRs aliases some of the properties of VOLATILE like vars (in "C" language).

But sincerly I'm not aware of the real meaning, all that is a simple guess (as I dont see how the compiler can do to make the diff between (hard related and maped) SFRs and normal vars.
Regards

rvctx
Posts: 2
Joined: Wed Dec 23, 2009 9:16 pm
Location: France, South of Paris

Post by rvctx » Wed Dec 23, 2009 11:46 pm

Hi Octal,

thanks a lot for your detailed explanation. I know now enough about it.
Kind Regards,

Herve

Post Reply