home *** CD-ROM | disk | FTP | other *** search
- FUNCTION ShiftDWordRight(Target : LongInt;
- ShiftBy : Integer) : LongInt;
- ASSEMBLER;
-
- ASM
- MOV DX, Target+2.WORD { Move high order word into DX }
- MOV AX, Target.WORD { Move low-order word into AX }
- MOV CX, ShiftBy { Move shift count into CX }
- CLC { Clear the carry flag }
- @Shift: { Local label! }
- SHR DX,1 { Shift DX rightward }
- RCR AX,1 { Shift AX rightward with carry }
- LOOP @Shift { Loop back to @Shift if CX <> 0 }
- END;