minix/lib/libc/arch/i386/string
2010-03-03 14:27:30 +00:00
..
_memmove.S Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
_strncat.S Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
_strncmp.S Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
_strncpy.S Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
_strnlen.S Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
bcmp.S Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
bcopy.S Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
bzero.S Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
index.S Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
Makefile.inc Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
memchr.S Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
memcmp.S Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
memcpy.S Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
memmove.S Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
memset.S Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
README Incorporate bsdmake into buildsystem and reorganize libs 2010-02-16 14:41:33 +00:00
rindex.S Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
strcat.S Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
strchr.S Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
strcmp.S Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
strcpy.S Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
strlen.S Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
strncat.S Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
strncmp.S Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
strncpy.S Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
strnlen.S Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
strrchr.S Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00

Notes on i80386 string assembly routines.		Author: Kees J. Bot
								2 Jan 1994

Remarks.
    All routines set up proper stack frames, so that stack traces can be
    derived from core dumps.  String routines are often the ones that
    get the bad pointer.

    Flags are often not right in boundary cases (zero string length) on
    repeated string scanning or comparing instructions.  This has been
    handled in sometimes nonobvious ways.

    Only the eax, edx, and ecx registers are not preserved, all other
    registers are.  This is what GCC expects.  (ACK sees ebx as scratch
    too.)  The direction byte is assumed to be wrong, and left clear on
    exit.

Assumptions.
    The average string is short, so short strings should not suffer from
    smart tricks to copy, compare, or search large strings fast.  This
    means that the routines are fast on average, but not optimal for
    long strings.

    It doesn't pay to use word or longword operations on strings, the
    setup time hurts the average case.

    Memory blocks are probably large and on word or longword boundaries.

    No unaligned word moves are done.  Again the setup time may hurt the
    average case.  Furthermore, the author likes to enable the alignment
    check on a 486.

String routines.
    They have been implemented using byte string instructions.  The
    length of a string it usually determined first, followed by the
    actual operation.

Strcmp.
    This is the only string routine that uses a loop, and not
    instructions with a repeat prefix.  Problem is that we don't know
    how long the string is.  Scanning for the end costs if the strings
    are unequal in the first few bytes.

Strchr.
    The character we look for is often not there, or at some distance
    from the start.  The string is scanned twice, for the terminating
    zero and the character searched, in chunks of increasing length.

Memory routines.
    Memmove, memcpy, and memset use word or longword instructions if the
    address(es) are at word or longword boundaries.  No tricks to get
    alignment after doing a few bytes.  No unaligned operations.