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...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>PICBASIC</strong> <strong>PLUS</strong> Compiler5.4. BRANCHLSyntax : BRANCHL Index, [Label1 {,...Labeln }]Overview :Operators :Cause the program to jump to different locations based on a variableindex. On a PIC device with more than one page of memory.Index is a constant, variable, or expression, that specifies the addressto branch to.Label1,...Labeln are valid labels that specify where to branch to.Example : DEVICE 16F877DIM index as BYTEStart: index = 2 ‘assigned index a value of 2‘jump to label 2 (Lab2) because index = 2BRANCHL index , [Lab0, Lab1, Lab2]Lab1: index = 2 ‘index now equals 2GOTO StartLab2: index = 0 ‘index now equals 0GOTO StartLab3: index = 1 ‘index now equals 1GOTO StartThe above example we first assign the index variable a value of 2,then we define our labels. Since the first position is considered 0 andthe variable index equals 2 the BRANCHL command will cause theprogram to jump to the third label in the brackets [Lab2].Notes :See also :The BRANCHL command is mainly for use with PIC devices thathave more than one page of memory (greater than 2048). It may alsobe used on any PIC device, but does produce code that is larger thanBRANCH.BRANCH26Copyright Crownhill 2001

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

Saved successfully!

Ooh no, something went wrong!