home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 8
/
CDASC08.ISO
/
NEWS
/
554
/
JUILLET
/
FASTCOPY.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-10-07
|
1KB
|
45 lines
{─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
Msg : 215 of 320
From : Bart Vanhauwaert 2:292/807.0 05 Jul 93 02:07
To : JUSTIN TAWIL
Subj : Help in quick moves
────────────────────────────────────────────────────────────────────────────────
Hi Justin,
On 06-27-93 JUSTIN TAWIL wrote to ALL...
JT> Does anyone have an Inline source for moving bytes a word or a double
JT> word at a time..I need to copy data in and out of buffer very
JT> quickly..Thanks..
For a 8086,80186,80286.}
asm
mov cx , Count { In words, in bytes if you use movsb }
push ds
les DI , P2
lds SI , P1
cld
rep movsw { for words, replace by : movsb for bytes }
pop ds
end;
For a 80386,80486 & probably a Pentium
asm
mov cx , Count
push ds
les DI , P2
lds SI , P1
@L1:
mov ax , es:[di] { use al for bytes }
mov [si] , ax { use al for bytes }
loop @L1
pop ds
end
Both solutions will run on all processors, but will be faster on the
dedicated CPU. Btw P1 and P2 are pointers to the buffers.
There is no range checking. And the buffers may not be at the same piece
of memory.