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> CompilerNUM_BYTELoad a constant (NUMBER) into an 8-bit (BYTE) register.Use:NUM_BYTE 23 , VAR1NUM_BITLoad a number into a bit of an 8-bit (BYTE) register. If the constant is larger than 1, thenthe bit will be set.Use:NUM_BIT 1 , VAR1 , BIT1NUM_WORDLoad an 8 or 16-bit constant into a 16-bit (WORD) register.Use:NUM_WORD 2314 , WRD1BIT_WREG (bit into wreg)Load the WREG with the contents of an 8-bit (BYTE) register’s BIT.Use:BIT_WREG VAR1 , BIT1BIT_BYTE (bit into byte)Load an 8-bit (BYTE) register with the contents of another 8-bit (BYTE) register’s BIT.Use:BIT_BYTE VAR1 , BIT1 , VAR2BIT_BIT (bit into bit)Load an 8-bit (BYTE) register’s BIT with another 8-bit (BYTE) register’s BIT.Use:BIT_BIT VAR1 , BIT1 , VAR2 , BIT2BIT_WORD (bit into word)Load a 16-bit (WORD) register with the contents of an 8-bit (BYTE) register’s BIT.Use:BIT_WORD VAR1 , BIT1 , WRD1You may be asking yourself why we require such mnemonics when the BASIC syntaxalready incorporates all the above combinations, such as VAR = VAR or VAR.BIT =VAR.BITHowever, you must remember that these pseudo mnemonics are mainly intended foruse in assembly i.e. between ASM and ENDASM, they can be used as BASIC commandsbut other than the types that load or retrieve the WREG, they are pretty muchredundant. Anyone who has written assembler knows the complexity of manipulatingthe BANK switches for accessing RAM. These pseudo mnemonics do all the bankswitching for you.Because they are primarily assembler macros, they follow the format of assemblermnemonics i.e. VAR and BIT types are separated by a comma, not a point.139Copyright Crownhill 2001

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

Saved successfully!

Ooh no, something went wrong!