home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / desklib / Libraries / Str / s / strcatcr next >
Encoding:
Text File  |  1994-03-05  |  1.4 KB  |  44 lines

  1. ;   ####             #    #     # #
  2. ;   #   #            #    #       #          The FreeWare C library for
  3. ;   #   #  ##   ###  #  # #     # ###             RISC OS machines
  4. ;   #   # #  # #     # #  #     # #  #   ___________________________________
  5. ;   #   # ####  ###  ##   #     # #  #
  6. ;   #   # #        # # #  #     # #  #    Please refer to the accompanying
  7. ;   ####   ### ####  #  # ##### # ###    documentation for conditions of use
  8. ;   ________________________________________________________________________
  9. ;
  10. ;   File:    Str.strcatcr.s
  11. ;   Author:  Copyright © 1993 Ainsley Pereira
  12. ;   Version: 1.01 (05 Mar 1994)
  13. ;   Purpose: Concatenate two CR/NUL terminated strings - note that this will
  14. ;            change the terminator of the result to a NUL (0).
  15.  
  16.  
  17.         GET     h.regdefs
  18.         GET     h.swinos
  19.         GET     h.macros
  20.  
  21.         PREAMBLE
  22.         STARTCODE strcatcr
  23.  
  24.         STMFD     sp!,{v1,v2,lr}
  25.         MOV       v1,#0
  26.         MOV       v2,#0
  27. strcatcr_00
  28.         LDRB      ip,[a1,v1]
  29.         CMP       ip,#31
  30.         ADDGT     v1,v1,#1
  31.         BGT       strcatcr_00
  32. strcatcr_01
  33.         LDRB      ip,[a2,v2]
  34.         CMP       ip,#31
  35.         STRGT     ip,[a1,v1]
  36.         ADDGT     v1,v1,#1
  37.         ADDGT     v2,v2,#1
  38.         BGT       strcatcr_01
  39.         MOV       ip,#0
  40.         STRB      ip,[a1,v1]
  41.         LDMFD     sp!, {v1,v2, pc}^
  42. ;
  43.         END
  44.