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> Compiler5.72. SYMBOLSyntax :Overview :Operators :SYMBOL Name { = } ValueAssign an alias to a register, variable, or constant valueName can be any valid identifier.Value can be any previously declared variable, system register, or aRegister.Bit combination.The equals ‘=’symbol is optional, and may be omitted if desired.When creating a program it can be beneficial to use identifiers forcertain values that don’t change: -SYMBOL Meter = 1SYMBOL Centimeter = 100SYMBOL Millimeter = 1000This way you can keep your program very readable and if for somereason a constant changes later, you only have to make one changeto the program to change all the values. Another good use of the constantis when you have values that are based on other values.SYMBOL Meter = 1SYMBOL Centimeter = Meter / 100SYMBOL Millimeter = Centimeter / 10In the example above you can see how the centimeter and millimeterwere derived from Meter.Another use of the SYMBOL command is for assigning Port.Bit constants:-SYMBOL LED = PORTA.0HIGH LEDIn the above example, whenever the text LED is encountered, Bit-0 ofPortA is actually referenced.Notes :SYMBOL cannot create new variables, it simply aliases an identifierto a previously assigned variable, or assigns a constant to an identifier.131Copyright Crownhill 2001

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

Saved successfully!

Ooh no, something went wrong!