Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The GNU Assembler Preprocessor - <b>string primitives</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
String primitives
-----------------

   You can use these primitives to manipulate strings (in the argument
field of GASP statements):

`.LEN("STR")'
     Calculate the length of string `"STR"', as an absolute expression.
     For example, `.RES.B .LEN("sample")' reserves six bytes of memory.

`.INSTR("STRING", "SEG", IX)'
     Search for the first occurrence of SEG after position IX of
     STRING.  For example, `.INSTR("ABCDEFG", "CDE", 0)' evaluates to
     the absolute result `2'.

     The result is `-1' if SEG does not occur in STRING after position
     IX.

`.SUBSTR("STRING",START,LEN)'
     The substring of STRING beginning at byte number START and
     extending for LEN bytes.


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson