Tel: +44 7814 044 754 -  Fax: +44 8715 283 948 -  Skype: warburtech.co.uk

Add to Favourites

PicBasic Instruction Set

ASM..ENDASM Insert assembly language code section.*
BRANCH Computed GOTO (equivalent to ON..GOTO).
BUTTON Debounce and auto-repeat input on specified pin.
CALL Call assembly language subroutine.*
EEPROM Define initial contents of on-chip EEPROM.
END Stop execution and enter low power mode.
FOR..NEXT Repeatedly execute statement(s).
GOSUB Call BASIC subroutine at specified label.
GOTO Continue execution at specified label.
HIGH Make pin output high.
I2CIN Read bytes from I2C device.*
I2COUT Send bytes to I2C device.*
IF..THEN GOTO if specified condition is true.
INPUT Make pin an input.
[LET] Assign result of an expression to a variable.
LOOKDOWN Search table for value.
LOOKUP Fetch value from table.
LOW Make pin output low.
NAP Power down processor for short period of time.
OUTPUT Make pin an output.
PAUSE Delay (1ms resolution).
PEEK Read byte from register.*
POKE Write byte to register.*
POT Read potentiometer on specified pin.
PULSIN Measure pulse width (10us resolution).
PULSOUT Generate pulse (10us resolution).
PWM Output pulse width modulated pulse train to pin.
RANDOM Generate pseudo-random number.
READ Read byte from on-chip EEPROM.
RETURN Continue execution at statement following last executed GOSUB.
REVERSE Make output pin an input or an input pin an output.
SERIN Asynchronous serial input (8N1).
SEROUT Asynchronous serial output (8N1).
SLEEP Power down processor for a period of time (1s resolution).
SOUND Generate tone or white-noise on specified pin.
TOGGLE Make pin output and toggle state.
WRITE Write byte to on-chip EEPROM.

*PicBasic language extension not found on BS1.

Operators:

All math operations are unsigned and performed with 16-bit precision. The operators supported are:

Math Operators Description
+ Addition
- Subtraction
* Multiplication
** MSB of Multiplication
/ Division
// Remainder
MIN Minimum
MAX Maximum
& Bitwise AND
| Bitwise OR
^ Bitwise XOR
&/ Bitwise AND NOT
|/ Bitwise OR NOT
^/ Bitwise XOR NOT

Page Updated:
05/08/10

Tel: +44 7814 044 754 - Fax: +44 8715 283 948 - Skype: warburtech.co.uk

Warburton Technology, 33 Selkirk Close, Wimborne, Dorset, BH21 1TN, United Kingdom

VAT Number: GB 846 917 877