stringss.inc 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1999-2000 by Jonas Maebe, member of the
  5. Free Pascal development team
  6. Processor dependent part of strings.pp, not shared with
  7. sysutils unit.
  8. See the file COPYING.FPC, included in this distribution,
  9. for details about the copyright.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. **********************************************************************}
  14. function strpas(p : pchar) : string; assembler;
  15. {$i strpas.inc}
  16. function strpcopy(d : pchar;const s : string) : pchar;assembler;
  17. asm
  18. { get length }
  19. lbz r0,0(r4)
  20. { put in counter }
  21. cmplwi r0,0
  22. mtctr r0
  23. subi r10,r3,1
  24. beq LStrPCopyEmpty
  25. LStrPCopyLoop:
  26. { copy everything }
  27. lbzu r0,1(r4)
  28. stbu r0,1(r10)
  29. bdnz LStrPCopyLoop
  30. { add terminating #0 }
  31. li r0,0
  32. LStrPCopyEmpty:
  33. stb r0,1(r10)
  34. end;
  35. {
  36. $Log$
  37. Revision 1.9 2003-06-14 12:41:09 jonas
  38. * fixed compilation problems (removed unnecessary modified registers
  39. lists from procedures)
  40. Revision 1.8 2002/09/11 07:49:40 jonas
  41. * fixed assembler errors
  42. Revision 1.7 2002/09/07 16:01:26 peter
  43. * old logs removed and tabs fixed
  44. Revision 1.6 2002/09/06 16:58:43 jonas
  45. * fixed wrong references (used r0 as base register)
  46. Revision 1.5 2002/08/10 17:14:36 jonas
  47. * various fixes, mostly changing the names of the modifies registers to
  48. upper case since that seems to be required by the compiler
  49. }