Compiler commands and directives — quick reference
Peripheral and Interfacing Commands
| ADin | Read the on-board Analogue to Digital Converter (ADC) peripheral. |
| Bstart | Send a Start condition to the I2C bus. |
| Bstop | Send a Stop condition to the I2C bus. |
| Brestart | Send a Restart condition to the I2C bus. |
| BusAck | Send an Acknowledge condition to the I2C bus. |
| BusNack | Send an Not Acknowledge condition to the I2C bus. |
| Busin | Read bytes from an I2C device. |
| Busout | Write bytes to an I2C device. |
| Button | Detect and debounce a key press. |
| Counter | Count the number of pulses occurring on a pin. |
| DTMFout | Produce a DTMF Touch Tone note. |
| Freqout | Generate one or two tones, of differing or the same frequencies. |
| HbStart | Send a Start condition to the I2C bus using the MSSP module. |
| HbStop | Send a Stop condition to the I2C bus using the MSSP module. |
| HbRestart | Send a Restart condition to the I2C bus using the MSSP module. |
| HbusAck | Send an Ack condition to the I2C bus using the MSSP module. |
| HbusNack | Send a Not Ack condition to the I2C bus using the MSSP module. |
| Hbusin | Read from an I2C device using the MSSP module. |
| Hbusout | Write to an I2C device using the MSSP module. |
| High (PinHigh) | Make a pin or port high. |
| HPWM | Generate PWM signals using the device’s CCP peripherals. |
| I2Cin | Read bytes from an I2C device with user definable SDA\SCL lines. |
| I2Cout | Write bytes to an I2C device with user definable SDA\SCL lines. |
| Inkey | Scan a matrix keypad. |
| Input (PinInput) | Make a pin or port an input. |
Output (PinOutput) Make a pin or port an output.
| Oread | Receive data from a device using the Dallas 1-wire protocol. |
| Owrite | Send data to a device using the Dallas 1-wire protocol. |
| Low (PinLow) | Make a pin or port low. |
| Pot | Read a potentiometer on specified pin using an RC method. |
| PinClear | Clear a pin of a port using a variable as the pin number. |
| PinGet | Read a pin from a port using a variable as the index |
| PinMode | Make a specified Pin an input, output, or enable internal pull-up resistors. |
| PinPullup | Enable or disable a specified Port or Pin internal pull-up resistor or resistors. |
| PinSet | Set a pin of a port using a variable as the pin number. |
| PulseIn | Measure the pulse width on a pin. |
| PulseOut | Generate a pulse from a pin. |
| PWM | Output a Pulse Width Modulated signal from an I/O pin. |
| RCin | Measure a pulse width on a pin. |
| Servo | Control a servo motor. |
| Shin | Synchronous serial input. i.e. SPI |
| Shout | Synchronous serial output. i.e. SPI |
| Sound | Generate a tone or white-noise from a specified pin. |
| Sound2 | Generate 2 tones from 2 separate pins. |
| Toggle | Reverse the state of a port's pin. |
| USBinit | Initialise the USB on devices that contain a USB peripheral. |
| USBin | Receive data via a USB endpoint on devices that contain a USB peripheral. |
| USBout | Transmit data via a USB endpoint on devices that contain a USB peripheral. |
| Xin | Receive data using the X10 protocol. |
| Xout | Transmit data using the X10 protocol. |
LCD Commands
| Box | Draw a square on a graphic LCD. |
| Circle | Draw a circle on a graphic LCD. |
| Cls | Clear the LCD. |
| Cursor | Position the cursor on the LCD. |
| LCDread | Read a single byte from a Graphic LCD. |
| LCDwrite | Write bytes to a Graphic LCD. |
| Line | Draw a line in any direction on a graphic LCD. |
| LineTo | Draw a straight line in any direction on a graphic LCD, starting from the |
previous Line command's end position.
| Pixel | Read a single pixel from a Graphic LCD. |
| Plot | Set a single pixel on a Graphic LCD. |
| Display characters on an LCD. | |
| Toshiba_Command | Send a command to a Toshiba T6963 graphic LCD. |
| Toshiba_UDG | Create User Defined Graphics for Toshiba T6963 graphic LCD. |
| UnPlot | Clear a single pixel on a Graphic LCD. |
Async Serial Commands
| HRsin | Receive data from the serial port on devices that contain a USART. |
| HRsout | Transmit data from the serial port on devices that contain a USART. |
| HRsoutLn | Transmit data from the serial port on devices that contain a USART |
and transmit a terminator value or values.
| HSerin | Receive data from the serial port on devices that contain a USART. |
| HSerout | Transmit data from the serial port on devices that contain a USART. |
| HSeroutLn | Transmit data from the serial port on devices that contain a USART |
and transmit a terminator value or values.
| HRsin2 | Same as HRsin but using a 2nd USART if available. |
| HRsout2 | Same as HRsout but using a 2nd USART if available. |
| HRsout2Ln | Same as HRsoutLn but using a 2nd USART if available. |
| HSerin2 | Same as HSerin but using a 2nd USART if available. |
| HSerout2 | Same as HSerout but using a 2nd USART if available. |
| HSerout2Ln | Same as HSeroutLn but using a 2nd USART if available. |
| HRsin3 | Same as HRsin but using a 3rd USART if available. |
| HRsout3 | Same as HRsout but using a 3rd USART if available. |
| HRsout3Ln | Same as HRsoutLn but using a 3rd USART if available. |
| HSerin3 | Same as HSerin but using a 3rd USART if available. |
| HSerout3 | Same as HSerout but using a 3rd USART if available. |
| HSerout3Ln | Same as HSeroutLn but using a 3rd USART if available. |
| HRsin4 | Same as HRsin but using a 4th USART if available. |
| HRsout4 | Same as HRsout but using a 4th USART if available. |
| HRsout4Ln | Same as HRsoutLn but using a 4th USART if available. |
| HSerin4 | Same as HSerin but using a 4th USART if available. |
| HSerout4 | Same as HSerout but using a 4th USART if available. |
| HSerout4Ln | Same as HSeroutLn but using a 4th USART if available. |
| Rsin | Asynchronous serial input from a fixed pin and Baud rate. |
| Rsout | Asynchronous serial output to a fixed pin and Baud rate. |
| RsoutLn | Asynchronous serial output to a fixed pin and Baud rate, |
and transmit a terminator value or values.
Comparison and Loop Commands
| Bound | Returns the element size of an array – 1 element. For use in Loops. |
| Branch | Computed GoTo (equiv. to On..GoTo). |
| BranchL | Branch out of page (long Branch). |
| Break | Exit a loop prematurely. |
| Continue | Cause the next iteration of the enclosing loop to begin. |
| Do...Loop | Execute a block of instructions until a condition is true or an infinite loop. |
For…To…Next…Step Repeatedly execute statements.
| If..Then..ElseIf..Else..EndIf | Conditionally execute statements. |
| On GoSub | Call a Subroutine based on an Index value. For 18F devices only. |
| On GoTo | Jump to an address in code memory based on an Index value. |
(Primarily for smaller devices)
On GoToL Jump to an address in code memory based on an Index value.
(Primarily for larger devices)
Tern A form of Ternary Operator and has the same mechanism as a
C compiler's '?' directive.
| Repeat...Until | Execute a block of instructions until a condition is true. |
| Select..Case..EndSelect | Conditionally run blocks of code. |
| SizeOf | Returns the size of a variable, in bytes |
or the amount of elements in an array
While…Wend Execute statements while condition is true.
General BASIC Commands
| AddressOf | Get the address of a variable or label. |
| Call | Call an assembly language subroutine. |
| Clear | Place a variable or bit in a low state, or clear all RAM area. |
| ClearBit | Clear a bit of a variable, using a variable index. |
| Dec | Decrement a variable. |
| DelayCs | Delay with a 1 instruction cycle resolution. |
| DelayMs | Delay milliseconds. |
| DelayUs | Delay microseconds. |
| Dig | Return the value of a decimal digit. |
| GetBit | Examine a bit of a variable, using a variable index. |
| GoSub | Call a BASIC subroutine at a specified label. |
| GoTo | Continue execution at a specified label. |
| Inc | Increment a variable. |
| LoadBit | Set or Clear a bit of a variable, using a variable index. |
| Random | Generate a pseudo-random number. |
| Return | Continue at the statement following the last GoSub. |
| Rol | Rotate a variable left, with or without the microcontroller’s Carry flag. |
| Ror | Rotate a variable right, with or without the microcontroller’s Carry flag. |
| Seed | Seed the random number generator, to obtain a more random result. |
| Set | Place a variable or bit in a high state. |
| SetBit | Set a bit of a variable, using a variable index. |
| Sleep | Power down the processor for a period of time. |
| Snooze | Power down the processor for short period of time. |
| Stop | Stop program execution. |
| Swap | Exchange the values of two variables. |
RAM String Variable Commands
| Len | Find the length of a String variable. |
| Left$ | Extract n amount of characters from the left of a String. |
| Mid$ | Extract characters from a String beginning at n characters from the left. |
| Right$ | Extract n amount of characters from the right of a String. |
| Str | Load a Byte array with values. |
| Strn | Create a null terminated Byte array. |
| Str$ | Convert the contents of a variable to a null terminated String. |
| ToLower | Convert the characters in a String to lower case. |
| ToUpper | Convert the characters in a String to upper case. |
| Val | Convert a null terminated String to an integer value. |
Flash memory and EEPROM Commands
cPtr8, cPtr16, cPtr24, cPtr32 Indirectly read flash memory using a variable as the address.
Cread8, Cread16, Cread24, Cread32 Read a single or multi-byte value from a flash memory table with more efficiency than Cread.
| Cwrite | Write data to flash memory. |
| Edata | Define initial contents of on-board EEPROM. |
| Eread | Read a value from on-board EEPROM. |
| Ewrite | Write a value to on-board EEPROM. |
| LookDown | Search a constant lookdown table for a value. |
| LookDownL | Search constant or variable lookdown table for a value. |
| LookUp | Fetch a constant value from a lookup table. |
| LookUpL | Fetch a constant or variable value from lookup table. |
Directives
| Asm-EndAsm | Insert assembly language code section. |
| Config | Set or Reset programming fuse configurations. |
| Declare | Adjust library routine parameters. |
| Device | Choose the type of PICmicro™ to compile for. |
| Dim | Create a RAM variable or a Flash memory table. |
| End | Stop execution of the BASIC program. |
| Include | Load a file into the source code. |
On_Hardware_Interrupt Point to the subroutine that a hardware interrupt will jump too.
| On_Low_Interrupt | Point to a subroutine for a Low Priority interrupt on an 18F device. |
| Set_OSCCAL | Calibrate the internal oscillator found on some PICmicro™ devices. |
| Sub-EndSub | Create a subroutine unit. |
| Symbol | Create a constant or an alias. |



