11.07.2015 Views

PICBASIC PLUS LITE Manual - Profe Saul

PICBASIC PLUS LITE Manual - Profe Saul

PICBASIC PLUS LITE Manual - Profe Saul

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>PICBASIC</strong> <strong>PLUS</strong> CompilerRAM space for variables is allocated within the PIC in the order thatthey are placed in the BASIC code. For example: -DIM Var1 as BYTEDIM Var2 as BYTEPlaces VAR1 first, then VAR2: -VAR1 EQU nVAR2 EQU nThis means that on a PIC with more than one BANK, the first n variableswill always be in BANK0 (the value of n depends on the specificPICmicro used).The position of the variable within BANKs is usually of little importanceif BASIC code is used, however, if assembler routines are beingimplemented, always assign any variables used within them first.Problems may also arise if a WORD variable crosses a BANK boundary.If this happens, a warning message will be displayed in the errorwindow. Most of the time, this will not cause any problems, however,to err on the side of caution, try and ensure that WORD type variablesare fully inside a BANK. This is easily accomplished by placing adummy BYTE variable before the offending WORD type variable.WORD type variables have a low byte and a high byte. The high bytemay be accessed by simply adding the letter H to the end of the variable’sname. For example: -DIM Wrd as WORDWill produce the assembler code: -WrdWrdHEQU nEQU nTo access the high byte of variable WRD, use: -WrdH = 1This is especially useful when assembler routines are being implemented,such as: -MOVLW 1MOVWF WrdH ; Load the high byte of WRD with 1See Also :SYMBOL56Copyright Crownhill 2001

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!