summaryrefslogtreecommitdiff
path: root/libc/string/string.c
diff options
context:
space:
mode:
authorRobert de Bath <rdebath@poboxes.com>1999-06-11 14:11:38 +0200
committerLubomir Rintel <lkundrak@v3.sk>2013-10-23 23:41:25 +0200
commit3d4957c86ff239b24b43933924ec72a3fd288518 (patch)
treeda8225a4d7bb2d9123e10d558cdc3eebae6254c8 /libc/string/string.c
parente62b35169cdcd13632ae353b1e5ffde7dec44201 (diff)
downloaddev86-3d4957c86ff239b24b43933924ec72a3fd288518.tar.gz
Import Dev86src-0.14.8.tar.gzv0.14.8
Diffstat (limited to 'libc/string/string.c')
-rw-r--r--libc/string/string.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/libc/string/string.c b/libc/string/string.c
index ffce96c..705ec55 100644
--- a/libc/string/string.c
+++ b/libc/string/string.c
@@ -382,8 +382,9 @@ size_t l;
mov ax,di
#endif
- ; If di is odd mov 1 byte before doing word move
- ; this will speed slightly but
+ ; If di is odd we could mov 1 byte before doing word move
+ ; as this would speed the copy slightly but its probably
+ ; too rare to be worthwhile.
; NB 8086 has no problem with mis-aligned access.
shr cx,#1 ; Do this faster by doing a mov word
@@ -647,8 +648,16 @@ unsigned int srcseg, srcoff, destseg, destoff, len;
mov di,[bp+8]
mov cx,[bp+10]
#endif
+
+ ; Would it me a good idea to normalise the pointers ?
+ ; How about allowing for overlapping moves ?
+
+ shr cx,#1 ; Do this faster by doing a mov word
rep
- movsb
+ movsw
+ adc cx,cx ; Retrieve the leftover 1 bit from cflag.
+ rep
+ movsb
! cli ! Are we _really_ paranoid ?