The built-in #defines used to support the #IFDEF command set are as follows. The table also shows which #defines are supported as strings in HSerPrint, SerPrint, and other string-related commands.
| Constants | Type | Usage | Description |
|---|---|---|---|
|
|
Constant |
Conditional compilation or output commands |
The number of A/D inputs on the current chip |
|
|
Constant |
Conditional compilation or output commands |
The selected assembler: GCASM/MPASM/PICAS etc. |
|
|
Constant |
Conditional compilation or output commands |
The number of bytes in EEPROM memory |
|
|
Constant |
Conditional compilation or output commands |
The number of general purpose IO pins |
|
|
Constant |
Conditional compilation or output commands |
The microcontroller clock speed |
|
|
Constant |
Conditional compilation only |
The microcontroller type |
|
|
Constant |
Conditional compilation or output commands |
The microcontroller name |
|
|
Constant |
Conditional compilation or output commands |
The number of microcontroller pins. |
|
|
Constant |
Scripts, Conditional compilation, and output commands |
The value of the words reserved |
|
|
Constant |
Scripts, Conditional compilation, and output commands |
The frequency selected |
|
|
Constant |
Scripts, Conditional compilation, and output commands |
The constant exists if the compiler has determined the program is using the internal oscillator |
|
|
String constant |
Name of the chip type to be used by a programmer |
The pseudo microcontroller type |
|
|
Constant |
Conditional compilation or output commands |
The RAM size |
|
|
Constant |
Conditional compilation or output commands |
The first RAM location |
|
|
Constant |
Conditional compilation or output commands |
See the table below |
|
|
Constant |
Conditional compilation or output commands |
The number of WORDS in Flash memory |
|
|
Constant string |
Conditional compilation or output commands |
The name of the source GCB file |
|
Function |
Type |
Usage |
Description |
|
|
Function |
Conditional compilation only |
True if a register is declared (or false if not declared) in the currently specified microcontroller’s .dat file. Var(register_name) |
|
|
Function |
Conditional compilation only |
True if a register is NOT declared (or false if declared) in the currently specified microcontroller’s .dat file. NoVar(register_name) |
|
|
Function |
Conditional compilation only |
True if a bit is declared (or false if not declared) in the currently specified microcontroller’s .dat file. Bit(bit_name) |
|
|
Function |
Conditional compilation only |
True if a bit is NOT declared (or false if declared) in the currently specified microcontroller’s .dat file. NoBit(bit_name) |
|
|
Function |
Conditional compilation only |
True if all defines are declared:
|
|
|
Function |
Conditional compilation only |
True if one of the defines is declared:
|
The table below shows two special directives that support mapping one variable or bit to another variable or bit. This is
useful when creating portable code or libraries, to ensure GCBASIC can find an equivalent register or bit even when its exact
name differs between microcontrollers.
| Directive | Explanation | Usage |
|---|---|---|
|
#samebit |
The compiler checks each item in the list to see which ones are implemented on the current microcontroller.
|
#samebit PLLEN, SPLLEN, SPLLMULT
|
|
#samevar |
The compiler checks each item in the list to see which ones are implemented on the current microcontroller.
|
#samevar CMCON, CMCON0, CMCONbob |
This table shows the ChipFamily constants mapped to the microcontroller architecture.
| ChipFamily Value | |
|---|---|
|
AVR |
Microcontroller Characteristics |
|
100 |
AVR core version V0E class microcontrollers |
|
110 |
AVR core version V1E class microcontrollers |
|
120 |
AVR core version V2E class microcontrollers |
|
-120 Subtype: 121 |
AVR core version AVR8L, also called AVRrc, reduced core class microcontrollers. ATtiny4-5-9-10 and ATtiny102-104 with only 16 GPRs from r16-r31 and only 54 instructions. |
|
-120 Subtype: 122 |
LGT microcontrollers. |
|
-120 Subtype: 123 |
AVR core version V2E class microcontrollers with one USART, like the mega32u4, mega16u4 - they have different registers for the USART. |
|
121 |
Tiny4-5-9-10 and tiny102-104. Only 16 GPRs from r16-r31 and only 54 instructions. |
|
130 |
AVR core version V3E class microcontrollers, but essentially the mega32u6 only |
|
140 |
AVRDX microcontrollers. Series 0, series 1, series 2, DA series, and DB series. |
|
PIC |
Microcontroller Characteristics |
|
12 |
Baseline devices. 12-bit instruction set |
|
15 |
Mid-range core devices. 14-bit instruction set with enhanced instruction set class |
|
15 plus familyVariant=1 |
Mid-range core devices. 14-bit instruction set with enhanced instruction set and with large memory capability class |
|
16 |
High end core devices. 16-bit instruction set, memory addressing architecture, and an extended instruction set. Chip family 16 also has sub chip family constants. These constants are shown below: ChipFamily18FxxQ10 = 16100 ChipFamily18FxxQ43 = 16101 ChipFamily18FxxQ41 = 16102 ChipFamily18FxxK42 = 16103 ChipFamily18FxxK40 = 16104 ChipFamily18FxxQ40 = 16105 ChipFamily18FxxQ84 = 16106 ChipFamily18FxxK83 = 16107 ChipFamily18FxxQ83 = 16108 ChipFamily18FxxQ71 = 16109 ChipFamily18FxxQ20 = 16110 ChipFamily18FxxQ24 = 16111 |
See Also:

