On 6/20/2014 8:28 PM, Manuel Berro Madero wrote:
> I think that the work arround to get the bit what i am looking for is to
> MOV into the register r3 the register r31 with all states then doing right
> and left shifting to get that bit.
> 
> Is it r32 a 32 bits?
> 
> I am in the right way?

There is no r32, but all registers (including r31) are 32-bits.  But r31
does not have all 32-bits hooked to direct I/O pins, so some bits may
always be zero.

If you want bit 16 of r31 to be place in r3.t0, with all other bits
cleared, you can do this with a couple instructions.  I'd probably do
something like:

Shifts, taking advantage of the PRU's unsigned zero-extend
=========

  // Put r31 bit 16 in r3 bit 15
  LSR  R3, R31, 1

  // Zero extend r3 word 0, and shift right so bit 15 is bit 0
  LSR  R3, R3.w0, 15


Shift and mask
=========

  // Put r31 bit 16 in r3 bit 1
  LSR  R3, R31, 16

  // Mask r3 (only works with 8-bit or shorter masks)
  AND  R3, R3, 0x01

-- 
Charles Steinkuehler
[email protected]

-- 
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.

Reply via email to