Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /****************************************************************************
  2. *
  3. *                            Open Watcom Project
  4. *
  5. *    Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
  6. *
  7. *  ========================================================================
  8. *
  9. *    This file contains Original Code and/or Modifications of Original
  10. *    Code as defined in and that are subject to the Sybase Open Watcom
  11. *    Public License version 1.0 (the 'License'). You may not use this file
  12. *    except in compliance with the License. BY USING THIS FILE YOU AGREE TO
  13. *    ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
  14. *    provided with the Original Code and Modifications, and is also
  15. *    available at www.sybase.com/developer/opensource.
  16. *
  17. *    The Original Code and all software distributed under the License are
  18. *    distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  19. *    EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
  20. *    ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
  21. *    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
  22. *    NON-INFRINGEMENT. Please see the License for the specific language
  23. *    governing rights and limitations under the License.
  24. *
  25. *  ========================================================================
  26. *
  27. * Description:  WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE
  28. *               DESCRIBE IT HERE!
  29. *
  30. ****************************************************************************/
  31.  
  32.  
  33. #include "variety.h"
  34. #include <string.h>
  35.  
  36. #ifdef M_I86
  37.  
  38. extern char _WCFAR *fast_strset( char _WCFAR *, char );
  39.  
  40. #pragma aux fast_strset = \
  41.         0x1e            /* push ds */\
  42.         0x56            /* push si */\
  43.         0x50            /* push ax */\
  44.         0x8e 0xda       /* mov ds,dx */\
  45.         0x89 0xc6       /* mov si,ax */\
  46.         0x88 0xdf       /* mov bh,bl */\
  47.         0xad            /* L1:lodsw */\
  48.         0x84 0xc0       /* test al,al */\
  49.         0x74 0x0c       /* je L3 */\
  50.         0x84 0xe4       /* test ah,ah */\
  51.         0x74 0x05       /* je L2 */\
  52.         0x89 0x5c 0xfe  /* mov -2[si],bx */\
  53.         0xeb 0xf2       /* jmp L1 */\
  54.         0x88 0x5c 0xfe  /* L2:mov -2[si],bl */\
  55.         0x58            /* L3:pop ax */\
  56.         0x5e            /* pop si */\
  57.         0x1f            /* pop ds */\
  58.         parm caller     [dx ax] [bl] \
  59.         value           [dx ax] \
  60.         modify exact    [bh];
  61. #endif
  62.  
  63. _WCRTLINK char _WCFAR *_fstrset( char _WCFAR *s, int c )
  64.     {
  65. //#ifdef M_I86
  66.         //return( fast_strset( s, c ) );
  67. //#else
  68.         char _WCFAR *p;
  69.  
  70.         for( p = s; *p; ++p ) {
  71.             *p = c;
  72.         }
  73.         return( s );
  74. //#endif
  75.     }
  76.