[fpc-pascal] Question about ror / rordword...

Florian Klaempfl florian at freepascal.org
Mon Oct 5 20:20:38 CEST 2009


Michael Green schrieb:
> Quick question: Is there any particular reason why the system function
> ror() (in /fpc/rtl/inc/systemh.inc) has been divided up into rorbyte,
> rordword and rorqword (and respectively for rol() ) instead of being
> overloaded?

Ror/rol are very sensitive against data type changes so this ensures you
get always the desired result. While x shr 1 has the same result if the
value fits in x, ror(x,1) has different results if x is a byte, word or
dword even if it's value is e.g. 1.



More information about the fpc-pascal mailing list