i will test a bit in a variable.
DATZ2 equ 13 ( 0 < DATZ2 < 7 can I define this array ?)
DATB1 equ 14
the compiler output a warning (least significant...) it's ok.
when I disasemble the prg then...
btfss 14,03 this is not ok !!! ???
03 this was the least significant... from 13 ?
How I can make this better ? With "OR" or other ?
Hmm. It seems to me, and I've only worked with 8 bit microcontrollers, that
the compiler truncated the 13 (hex) to 03 (hex). What kind of Pic are you
Programmer and Sound Engineer
|_ _||_ . _ _ _ _
|_)(_)(_|| )| . (_ (_)( | )
BTFSS is BIT test file skip if set. This means you are trying to test bit 13 of an 8 bit register. The assembler decides you meant bit 3 for some reason.
>How I can make this better ? With "OR" or other ?
<mathias.kuester%kids.netzservice.de> wrote: p3.f1800.n100.z55
> i will test a bit in a variable.
> DATZ2 equ 13 ( 0 < DATZ2 < 7 can I define this array ?)
> DATB1 equ 14
> BTFSS DATB1,DATZ2
> the compiler output a warning (least significant...) it's ok.
> when I disasemble the prg then...
> btfss 14,03 this is not ok !!! ???
> 03 this was the least significant... from 13 ?
> How I can make this better ? With "OR" or other ?
If you look at the PIC instruction-set documentation, you'll see that
the BTFSS instruction can't be used the way you want... The second
operand must be a LITERAL value between 0 and 7.
If I were in your situation, I'd reorganize my data structures so
that this operation was no longer required. If you can't do that,
you might want to try one of these methods, instead:
Note that you'll have to ensure that DATZ2 is in the range [0-7] at
the start of both of these routines, and that "Solution #2" will
have problems if the "ADDLW" table crosses page boundaries.
=== Andrew Warren - ix.netcom.comfastfwd
=== Fast Forward Engineering - Vista, California
=== Did the information in this post help you? Consider
=== contributing to the PICLIST Fund. Details are at:
More... (looser matching)
- Last day of these posts
- In 1997
, 1998 only
- New search...