home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / PROGRAM / ASM / ALIB30B / STR31.ASM < prev    next >
Assembly Source File  |  1994-10-15  |  1KB  |  42 lines

  1.     page    66,132
  2. ;******************************** STR31.ASM  *********************************
  3.  
  4. LIBSEG           segment byte public "LIB"
  5.         assume cs:LIBSEG , ds:nothing
  6.  
  7. ;----------------------------------------------------------------------------
  8. .xlist
  9.     include  mac.inc
  10.     include  common.inc
  11. .list
  12. comment 
  13. ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -( STRING  )
  14. STR_JOIN -  appends string2 at end of string1
  15. ;
  16. ; inputs:    es:[dI] = address of first string
  17. ;                bx  = length of string 1
  18. ;          ds:si  = address of second string
  19. ;                dx  = length of string 2     
  20. ;                
  21. ; output:  es:di = new string ptr (unchanged from input es:di)
  22. ;             cx = length of joined string at es:di
  23. ;* * * * * * * * * * * * * *
  24. 
  25.     PUBLIC    STR_JOIN
  26. STR_JOIN    PROC    FAR
  27.     APUSH   AX,BX,DX,SI,DI
  28.     cld
  29.     add    di,bx
  30.     mov    cx,dx
  31.     rep    movsb
  32.     movsb            ;pick up zero byte at end
  33.     add    bx,dx
  34.     mov    cx,bx
  35. STR_JOIN_end:
  36.     APOP    DI,SI,DX,BX,AX
  37.     RETF
  38. STR_JOIN    ENDP
  39.  
  40. LIBSEG    ENDS
  41.     end
  42.