home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 8
/
CDASC08.ISO
/
NEWS
/
554
/
JUILLET
/
ROLLBITS.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-10-07
|
712b
|
17 lines
{─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
Msg : 347 of 454
From : Leon Deboer 3:690/101.0 08 Jul 93 01:51
To : Ferenc Molnar
Subj : Shr, Bits and ???
────────────────────────────────────────────────────────────────────────────────
Here is code to roll bits of a byte in Bp 7 assembler high bit first}
FUNCTION RollOfBits (Value, RollCount: Byte): Byte; ASSEMBLER;
ASM
XOR AX, AX;
XOR CX, CX; { Clear registers }
MOV AL, [Value];
MOV CL, [RollCount]; { Load values }
SHR AX, CL;
XCHG AH, AL; { Flip registers }
END;