home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 January / Chip_2001-01_cd1.bin / tema / mysql / mysql-3.23.28g-win-source.exe / strings / bmove_upp.c < prev    next >
C/C++ Source or Header  |  2000-08-31  |  2KB  |  52 lines

  1. /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
  2.    
  3.    This library is free software; you can redistribute it and/or
  4.    modify it under the terms of the GNU Library General Public
  5.    License as published by the Free Software Foundation; either
  6.    version 2 of the License, or (at your option) any later version.
  7.    
  8.    This library is distributed in the hope that it will be useful,
  9.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  11.    Library General Public License for more details.
  12.    
  13.    You should have received a copy of the GNU Library General Public
  14.    License along with this library; if not, write to the Free
  15.    Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
  16.    MA 02111-1307, USA */
  17.  
  18. /*  File   : bmove.c
  19.     Author : Michael widenius
  20.     Updated: 1987-03-20
  21.     Defines: bmove_upp()
  22.  
  23.     bmove_upp(dst, src, len) moves exactly "len" bytes from the source
  24.     "src-len" to the destination "dst-len" counting downwards.
  25. */
  26.  
  27. #include <global.h>
  28. #include "m_string.h"
  29.  
  30. #if defined(MC68000) && defined(DS90)
  31.  
  32. /* 0 <= len <= 65535 */
  33. void bmove_upp(byte *dst, const byte *src,uint len)
  34. {
  35. asm("        movl    12(a7),d0    ");
  36. asm("        subql    #1,d0        ");
  37. asm("        blt    .L5        ");
  38. asm("        movl    4(a7),a1    ");
  39. asm("        movl    8(a7),a0    ");
  40. asm(".L4:    movb    -(a0),-(a1)    ");
  41. asm("        dbf    d0,.L4        ");
  42. asm(".L5:                ");
  43. }
  44. #else
  45.  
  46. void bmove_upp(register char *dst, register const char *src, register uint len)
  47. {
  48.   while (len-- != 0) *--dst = *--src;
  49. }
  50.  
  51. #endif
  52.