Initial revision

This commit is contained in:
Ben Gras
2005-04-21 14:53:53 +00:00
commit 9865aeaa79
2264 changed files with 411685 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
! _strncpy() Author: Kees J. Bot
! 27 Jan 1994
.sect .text; .sect .rom; .sect .data; .sect .bss
! char *_strncpy(char *s1, const char *s2, size_t cx)
! Copy string s2 to s1.
!
.sect .text
.define __strncpy
__strncpy:
mov di, 6(bp) ! di = string s2
xorb al, al ! Look for a zero byte
mov dx, cx ! Save maximum count
cld
repne scasb ! Look for end of s2
sub dx, cx ! Number of bytes in s2 including null
xchg cx, dx
mov si, 6(bp) ! si = string s2
mov di, 4(bp) ! di = string s1
rep movsb ! Copy bytes
ret