[fpc-pascal] Reversing bit-order of byte

Koenraad Lelong fpascal at brouwerij.homelinux.net
Fri May 4 14:14:14 CEST 2012

On 03-05-12 13:27, Thomas Schatzl wrote:
> function reverse(b : byte) : byte; assembler; nostackframe;
> asm
>    .long 0xe6ff0f30 // rbit r0, r0
>    lsr r0, r0, #23
> end;


I've been looking a bit further at this.
I disassembled the code and this is the result :

  8000150:       e6ff0f30        rbit    r0, r0
  8000154:       ea4f 50d0       mov.w   r0, r0, lsr #23
  8000158:       46f7            mov     pc, lr

Wouldn't it be possible to do
	rbit	r0, r0, lsr #23
When reading the ARM programming manual I believe it should.

But do I gain something ?


Koenraad Lelong.

More information about the fpc-pascal mailing list