🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.intel
Article #1666

strcpy() on a 386

#1666
From: m5
Date: Fri, 18 Sep 1987 22:03
20 lines
1308 bytes
How do clever iAPX 386 users (or iAPX *8[68] users for that matter) 
implement C-style string copies?  Seems to me that there are two
approaches:

    ; Set up ES, DS, EI, DI, CX, and the direction flag
loop:
        lodsb
        stosb
        cmp     AL, 0
        loopne  loop        ; or maybe it's loope

The other approach would be to SCASB to the end of the source string,
then move that many bytes with REP MOVSB.  Neither way is particularly
appealing.  So like, how do the pros do it?  What's the deal?

-- 
Mike McNally, mercifully employed at Digital Lynx ---
    Where Plano Road the Mighty Flood of Forest Lane doth meet,
    And Garland fair, whose perfumed air flows soft about my feet...
uucp: {texsun,killer,infotel}!pollux!bobkat!m5 (214) 238-7474
Technical Details
Message-ID: <2804@bobkat.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!rutgers!mtune!codas!killer!pollux!bobkat!m5

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!rutgers!mtune!codas!killer!pollux!bobkat!m5
From: m5@bobkat.UUCP
Newsgroups: comp.sys.intel
Subject: strcpy() on a 386
Message-ID: <2804@bobkat.UUCP>
Date: Fri, 18-Sep-87 18:03:58 EDT
Article-I.D.: bobkat.2804
Posted: Fri Sep 18 18:03:58 1987
Date-Received: Sun, 20-Sep-87 14:17:55 EDT
Reply-To: m5@bobkat.UUCP (Mike McNally (Man from Mars))
Distribution: na
Organization: Digital Lynx, Inc; Dallas, TX
Lines: 20