Predefined Globals and Constants

To facilitate 8051 programming, mikroBasic PRO for 8051 implements a number of predefined globals and constants.

All 8051 SFRs are implicitly declared as global variables of volatile word type. These identifiers have an external linkage, and are visible in the entire project. When creating a project, the mikroBasic PRO for 8051 will include an appropriate (*.mbas) file from defs folder, containing declarations of available SFRs and constants.

For a complete set of predefined globals and constants, look for “Defs” in the mikroBasic PRO for 8051 installation folder, or probe the Code Assistant for specific letters (Ctrl+Space in the Code Editor).

Predefined project level defines

mikroBasic PRO for 8051 provides several predefined project level defines that you can use in your project :

First one is equal to the name of selected device for the project.
If AT89S8253 is selected device, then AT89S8253 token will be defined as 1, so it can be used for conditional compilation:

#IFDEF AT89S8253
...
#ENDIF

Other predefined project level defines are :

#IFDEF 8051...#ENDIF
#IFDEF ATMEL...#ENDIF
#IFDEF SILABS...#ENDIF

In some future releases of the compiler, the JTAG redefined project level define will be added also.

Copyright (c) 2002-2013 mikroElektronika. All rights reserved.
What do you think about this topic ? Send us feedback!
Want more examples and libraries? 
Find them on LibStock - A place for the code