Hi Bas, You are right! The following works: AND r3.b0, r3.b0, (~(1<<3) & 0xff) // Clear bit 3
It's strange that (1<<3) is interpreted as 8-bit, but ~(1<<3) is interpreted as 32-bit. It appears to be an undocumented quirk of using this operator? Thanks for your help! On Monday, June 30, 2014 2:33:51 PM UTC-7, Bas Laarhoven wrote: > > > Hi, > > Have you tested masking the ~(1<<3) to 8-bits ? It's possible that the > assembler sees a 32-bit constant where only an 8-bit value is allowed. > > -- Bas > > > On 30-6-2014 22:04, Michael M wrote: > > Hello, > > I've written a PRU program which manipulates bits in one of the > registers. The program does not compile with PASM when I use the ~ operator. > > Setting multiple bits works: > > or r3.b0, r3.b0, 1<<3 // Set bit 3 > > > but clearing multiple bits does not: > > and r3.b0, r3.b0, ~(1<<3) // Clear bit 3 > > > The exact compiler error is " Error: Syntax error in parameter 3". This > should work since it comes straight from the TI wiki on the PRU: > http://processors.wiki.ti.com/index.php/PRU_Assembly_Instructions#Bitwise_AND_.28AND.29 > > Is this a bug or am I doing something wrong? > > Thanks, > Michael > -- > For more options, visit http://beagleboard.org/discuss > --- > You received this message because you are subscribed to the Google Groups > "BeagleBoard" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] <javascript:>. > For more options, visit https://groups.google.com/d/optout. > > > -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
