home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
pctchnqs
/
1990
/
number5
/
tp6shift.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1990-10-19
|
609b
|
15 lines
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;