ver 8.3 constants naming convention change

Beta Testing discussion on mikroPascal.
Post Reply
Author
Message
janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

ver 8.3 constants naming convention change

#1 Post by janni » 11 Jul 2008 13:50

Could be important for those that use some assembly in their programs or plan to do so.

Naming convention of constants in assembly has changed in ver 8.3. In previous versions compiler simply used the constant's name and addressed in assembly constants placed in Flash as

Code: Select all

 #name
 @#name
 @@#name
Now this has changed to

Code: Select all

 #_name
 @#_name
 @@#_name
when the constant has been defined in main or other unit above the implementation section. If defined in the implementation part, constants are named and addressed using the unit name:

Code: Select all

 #_unitname_name
 @#_unitname_name
 @@#_unitname_name
That's a justfied and practical change allowing to use the same name for local constants in different units. Pity it's not fully covered in help (or mentioned in the list of changes).

A warning:
Be aware that the linker does not issue any warning when it ignores a constant that has been used only in assembly. Code is compiled without placing the constant in flash in this case. Fictional address ($FFFFFF) is used in assembly instructions using such constant which may lead to unpredictable program behaviour.

Post Reply

Return to “mikroPascal Beta Testing”