GetBit Compile Problem
@Bean,
I have the following piece of code that does not want to compile:
Flags VAR Byte
AdoneX Var Flags.5
DO
tmpw1 = $FFFF
·GetBit Flags,5 ,__param5 'line wont compile
·IF __param5 <> 0 THEN
··AccResult = ACC_RESULT
··ATIme = __wparam34
··tmpW1 = DACC
··TX_BYTE tmpW1_MSB
··TX_BYTE tmpW1_LSB
··TX_STR CRLF
·ENDIF
Loop
I get invalid parameter· __param5
If I change it to GetBit Flags, AdoneX, __Param5 I get same error
if I change it to GetBit Flags,.5,__param5 I get invalid Number of Params
what is wrong with my GETBIT Request?
If i comment out the Getbit, the program compiles/assembles no problem.
I have the following piece of code that does not want to compile:
Flags VAR Byte
AdoneX Var Flags.5
DO
tmpw1 = $FFFF
·GetBit Flags,5 ,__param5 'line wont compile
·IF __param5 <> 0 THEN
··AccResult = ACC_RESULT
··ATIme = __wparam34
··tmpW1 = DACC
··TX_BYTE tmpW1_MSB
··TX_BYTE tmpW1_LSB
··TX_STR CRLF
·ENDIF
Loop
I get invalid parameter· __param5
If I change it to GetBit Flags, AdoneX, __Param5 I get same error
if I change it to GetBit Flags,.5,__param5 I get invalid Number of Params
what is wrong with my GETBIT Request?
If i comment out the Getbit, the program compiles/assembles no problem.
Comments
I guess I need to add to the documentation.
The 3rd parameter must be a bit variable, and the 2nd parameter cannot be a constant. Because then you could just use __PARAM5.0 = flags.5.
I would change your code to:
PARAM5 = flags.5
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Does that byte of memory hold "A", 65, $41 or %01000001 ?
Yes it does...
·
testing to determin if the flag has been set before preforming the next step so a 0/<>0 result is all I care about.
Jim
For zero you would do this:
so if a Have an alias for flags.5 then:
IF adonex = 1 then
'code
ENDIF
or
IF adonex = 0 then
'code
ENDIF
if this works I can do a great thing with my code,
RS_JIM