Manual de picbasicide

Solo disponible en BuenasTareas
  • Páginas : 9 (2197 palabras )
  • Descarga(s) : 0
  • Publicado : 29 de abril de 2011
Leer documento completo
Vista previa del texto
PIC Basic Compiler Reference Manual


The list of all Basic compiler keywords:
1WIRE_REG, 1WIRE_BIT, 1WIREINIT, 1WIRESENDBIT, 1WIREGETBIT, 1WIRESENDBYTE, 1WIREGETBYTE, ADCIN, ADC_CLOCK, ADC_SAMPLEUS, ALLDIGITAL, ALLOW_ALL_BAUDRATES, ALLOW_MULTIPLE_HSEROPEN, AND, AS, ASM, BIT, BREAK, BYTE, CALL, CASE, CLOCK_FREQUENCY, CONF_WORD, CONF_WORD_2, CONFIG, CONST, COUNT, COUNT_MODE, CRLF,DEFINE, DIM, DISABLE, DS18S20START, DS18S20READT, EEPROM, ELSE, ENABLE, END, END FUNCTION, END PROC, ENDIF, ENDSELECT, EXIT, FALSE, FOR, FREQOUT, FUNCTION, GLCD_DREG, GLCD_RSREG, GLCD_RSBIT, GLCD_EREG, GLCD_EBIT, GLCD_RWREG, GLCD_RWBIT, GLCD_CS1REG, GLCD_CS1BIT, GLCD_CS2REG, GLCD_CS2BIT, GLCDINIT, GLCDCLEAR, GLCDPSET, GLCDPRESET, GLCDCLEAN, GLCDPOSITION, GLCDWRITE, GLCDOUT, GLCDIN, GLCDCMDOUT, GOSUB,GOTO, HALT, HIGH, HSERGET, HSERIN, HSEROUT, HSEROPEN, I2CWRITE, I2CREAD, I2CREAD_DELAYUS, I2CCLOCK_STRETCH, I2CWRITE1, I2CREAD1, I2CPREPARE, I2CSTART, I2CSTOP, I2CSEND, I2CRECA, I2CRECEIVEACK, I2CRECN, I2CRECEIVENACK, IF, INPUT, LCD_BITS, LCD_DREG, LCD_DBIT, LCD_RSREG, LCD_RSBIT, LCD_EREG, LCD_EBIT, LCD_RWREG, LCD_RWBIT, LCD_COMMANDUS, LCD_DATAUS, LCD_INITMS, LCD_READ_BUSY_FLAG, LCD_LINES,LCD_CHARS, LCDINIT, LCDOUT, LCDCMDOUT, LCDCLEAR, LCDHOME, LCDDISPLAYON, LCDDISPLAYOFF, LCDCUROFF, LCDCURBLINK, LCDCURUNDERLINE, LCDCURBLINKUNDERLINE, LCDLEFT, LCDRIGHT, LCDSHIFTLEFT, LCDSHIFTRIGHT, LCDLINE1HOME, LCDLINE2HOME, LCDLINE3HOME, LCDLINE4HOME, LCDLINE1CLEAR, LCDLINE2CLEAR, LCDLINE3CLEAR, LCDLINE4CLEAR, LCDLINE1POS, LCDLINE2POS, LCDLINE3POS, LCDLINE4POS, LCDDEFCHAR, LF, LONG, LOOKUP, LOW, MOD,NAND, NEXT, NOR, NOT, NXOR, ON INTERRUPT, OR, OUTPUT, POINTER, PROC, PWMON, PWMDUTY, PWMOFF, READ, RESERVE, RESUME, RETURN, SAVE SYSTEM, SELECT CASE, SERIN, SERININV, SEROUT, SEROUTINV, SEROUT_DELAYUS, SERVOIN, SERVOOUT, SHIFTLEFT, SHIFTRIGHT, SIMULATION_WAITMS_VALUE, SPI_CS_REG, SPI_CS_BIT, SPI_SCK_REG, SPI_SCK_BIT, SPI_SDI_REG, SPI_SDI_BIT, SPI_SDO_REG, SPI_SDO_BIT, SPICS_INVERT,SPICLOCK_INVERT, SPICLOCK_STRETCH, SPICSON, SPICSOFF, SPIPREPARE, SPISEND, SPISENDBITS, SPIRECEIVE, SQR, STARTFROMZERO, STEP, STEP_A_REG, STEP_A_BIT, STEP_B_REG, STEP_B_BIT, STEP_C_REG, STEP_C_BIT, STEP_D_REG, STEP_D_BIT, STEP_MODE, STEPHOLD, STEPCW, STEPCCW, SYMBOL, THEN, TO, TOGGLE, TRUE, WAITMS, WAITUS, WEND, WHILE, WORD, WREG, WRITE, XOR.


● Standard Basic language elements

Default extension forbasic source files is BAS. The compiler output is assembler source file (with ASM extension) that can be translated to binary code using integrated assembler. Smart editor marks all reserved keywords in different color, that simplifies debugging process. BASIC compiler's assembler output has all necessary comment lines, that makes it very useful for educational purposes, also.

Four datatypes are supported:
- Bit (1-bit, 0 or 1)
- Byte (1-byte integers in the range 0 to 255)
- Word (2-byte integers in the range 0 to 65,535)
- Long (4-byte integers in the range 0 to 4,294,967,295) - optional module

Declarations may be placed anywhere in the program. All variables are considered global. The total number of variables is limited by the available microcontroller RAM memory.Variables are declared using DIM statement:
DIM A AS BIT
DIM B AS BYTE
DIM X AS WORD
DIM Y AS LONG

If necessary, variable address can be specified during declaration:
DIM X AS BYTE @ 0x050

It is also possible to use one-dimensional arrays. For example:
DIM A(10) AS BYTE
declares an array of 10 Byte variables with array index in the range [0-9].

RESERVE statement allowsadvanced usage by reserving some of the RAM locations to be used by in-code assembler routines or by MPLAB In-Circuit Debugger. For example:
RESERVE 0x70

High and low byte of a word variable can be addressed by .HB and .LB extensions. Individual bits can be addressed by .0, .1, ..., .14 and .15 extensions. It is possible to make conversions between Byte and Word data types using .LB and .HB...
tracking img