[fpc-pascal] rotating bits

Bisma Jayadi bisma at brawijaya.ac.id
Sat May 27 05:33:37 CEST 2006

>> a := b ror c;
>> x := y rol z;
> It would wreck havoc with typing. What should the result be of "1 ror  
> 1"? $80? $8000? $80000000? $8000000000000000? $80000000 on 32 bit and  
> $8000000000000000 on 64 bit cpus?

I believe the compiler knows the datatype and make an appropriate rotate action 
based on it. And knowing what the datatype is -I pressume- the programmer's 
responsibility. I think that's why we have bror (byte ror), wror (word ror), and 
lror (longint ror) functions within the sample code attached in this thread. :)


has Bee.ography at

More information about the fpc-pascal mailing list