This is going off the deep end here.
It has nothing to do with what CPU has a carry flag etc...
I guess this subject must be over the general population's heads or I am just taking it for granted that others should know better.
The idea is to shift in a Carry over from the last operation and thus produce a Carry (expended bit) flag in case one got shot out the back when shifting the bits left or right...
When shifting a group of objects that in bit format with each other this is need, you need to record the bit that got lost with one shift so that it can be inserted into the next object in line that belongs to the group.
Code like this is used in shifting 1 bit images , bit stuffing, Serial link compression etc...
The code I posted, which I deleted is used currently now in an application (industrial application) where that code actually compiles down very nicely (efficiently ) in Delphi but will not in fpc. fpc makes a ping out of using common pascal code for doing this where Delphi seems to understand what it is you are doing and generates ASM code that for most part is hard to beat.
Using Intrinsic functions that obviously I see now only little here understand would help the bloat lag...
Anyways... I deleted the code for two reasons, no on seems to understand it or cares and it was part of code that I most likely should not have posted in the first place.