home *** CD-ROM | disk | FTP | other *** search
/ AGA Toolkit '97 / The AGA Toolkit '97.iso / text / misc / port / string / stringlib.doc < prev    next >
Encoding:
Text File  |  1996-09-07  |  4.1 KB  |  192 lines

  1.                                  StringLib
  2.                     Copyright © 1995 Henrik Tikanvaara
  3.                             All rights reserved
  4.  
  5.  
  6.                               Introduction
  7.                               Legal
  8.                               Contact
  9.                               Instructions
  10.  
  11.                               Library routines
  12.  
  13.  
  14. NumToStr()
  15. StrCat()
  16. StrChr()
  17. StrCmp()
  18. StrCpy()
  19. StrEnd()
  20. StrFirstNum()
  21. StrLen()
  22. StrLFCat()
  23. StrNCmp()
  24. StrNumCat()
  25. StrToNum()
  26.  
  27.  
  28. Introduction:
  29. ~~~~~~~~~~~~~
  30.   When coding utilities in assembler, string manipulation is something that
  31. you inevitably have to deal with. Routines coded to do the job are also
  32. something, that is needed again and again in new programs. In C, all the
  33. routines are in a link library, but they are not good for using through
  34. assembler. StringLib is a link library that has a number of useful routines
  35. related to string manipulation, and it is designed for use with assembler.
  36.  
  37. Legal:
  38. ~~~~~~
  39.   You are allowed to use StringLib in non-commercial productions.
  40. Redistribution is only allowed if all the files are included in their
  41. unmodified, original form.
  42.  
  43. Instructions:
  44. ~~~~~~~~~~~~~
  45.   To use StringLib, include "StringLib.I" in the beginning of your program.
  46. Then, after compiling your own code, link it with "StringLib.LIB". To be
  47. able to utilize StringLib, you must use an assembler which produces objects
  48. instead of executables. Some examples are PhxAss, SNMA and A68K. You must
  49. also have a linker such as BLink, SLink or PhxLnk. There are two versions
  50. of the library, one for 68000 and up and another for 68020 and up. Some of
  51. the 68020 routines are a bit more compact and faster.
  52.  
  53. Contact Address:
  54. ~~~~~~~~~~~~~~~~
  55. If you have good routines to include with this library, or ideas for
  56. improvement, or if you happen to find bugs, please contact me.
  57.  
  58. Henrik Tikanvaara
  59. Tikasrinne 3A
  60. 02200  Espoo
  61. Finland
  62.  
  63. Internet:
  64. tetsuo@brahman.nullnet.fi
  65.  
  66.  
  67. --- NumToStr()
  68. Convert an integer to string.
  69.  
  70. Arguments:
  71. A0  Pointer to space for the converted ASCII number. (11 bytes)
  72. D0  32 bit unsigned number to convert.
  73.  
  74. Returns:
  75. A0  Pointer to the start of the ASCII number string.
  76. D0  Length of the string.
  77.  
  78. A1 and D1 will be trashed, all other registers are preserved. The ASCII
  79. number is placed in the end of the buffer, remaining bytes are set to ' '
  80. ($20). For a more friendly routine, use StrNumCat().
  81.  
  82.  
  83. --- StrCat()
  84. Add a string in the end of another string.
  85.  
  86. Arguments:
  87. A0  Pointer to the destination string.
  88. A1  Pointer to the source string.
  89.  
  90. D0 is trashed.
  91.  
  92.  
  93. --- StrChr()
  94. Finds the first address for a byte in a string.
  95.  
  96. Arguments:
  97. A0  Pointer to the string.
  98. D0  The byte which location to find.
  99.  
  100. Returns:
  101. D0  Pointer to the equal byte in the string, or 0 if byte was not found.
  102.  
  103.  
  104. --- StrCmp()
  105. Compare two strings.
  106.  
  107. Arguments:
  108. A0  Pointer to first string.
  109. A1  Pointer to second string.
  110.  
  111. Returns:
  112. D0  0 if strings are equal, non-zero otherwise.
  113.  
  114.  
  115. --- StrCpy()
  116. Copy a string.
  117.  
  118. Arguments:
  119. A0  Pointer to the destination space.
  120. A1  Pointer to the string to copy.
  121.  
  122.  
  123. --- StrEnd()
  124. Find the end and length of a string.
  125.  
  126. Arguments:
  127. A0  Pointer to string.
  128.  
  129. Returns:
  130. A0  Pointer to the null end byte of the string.
  131. D0  Length of the string.
  132.  
  133.  
  134. --- StrFirstNum()
  135. Find the first number ("0"-"9") in a string.
  136.  
  137. Arguments:
  138. A0  Pointer to the string.
  139.  
  140. Returns:
  141. D0  The address where the first byte was found, or 0 if not.
  142.  
  143.  
  144. --- StrLen()
  145. Find the length of a string.
  146.  
  147. Arguments:
  148. A0  Pointer to the string.
  149.  
  150. Returns:
  151. D0  The length of the string.
  152.  
  153.  
  154. --- StrLFCat()
  155. Adds a line-feed in the end of a string.
  156.  
  157. Arguments:
  158. A0  Pointer to the string to which add the line-feed.
  159.  
  160. Returns:
  161. A0  Pointer to the string null byte.
  162.  
  163.  
  164. --- StrNCmp()
  165. Compare two strings at certain length.
  166.  
  167. Arguments:
  168. A0  Pointer to first string.
  169. A1  Pointer to second string.
  170. D0  The length at which to compare the strings.
  171.  
  172. Returns:
  173. D0  0 if the strings are equal at the specified length, non-zero otherwise.
  174.  
  175.  
  176. --- StrNumCat()
  177. Adds a number in the end of a string.
  178.  
  179. Arguments:
  180. A0  Pointer to the string.
  181. D0  The unsigned 32-bit number to add.
  182.  
  183.  
  184. --- StrToNum()
  185. Convert a string to a number.
  186.  
  187. Arguments:
  188. A0  Pointer to the number string which to convert. Must be between 0-99999.
  189.  
  190. Returns:
  191. D0  The value of the number.
  192.