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

  1.     page    66,132
  2. ;******************************** STR27.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. ;----------------------------------------------------------------------------
  13.     extrn    strlen1:far
  14. comment 
  15. ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -( STRING  )
  16. STR_CHAR_DEL - deletes a character from a string
  17. ;
  18. ; inputs:    DS:[SI] points to string
  19. ;            AX = offset from DS:[BX] to character to delete
  20. ;            
  21. ; output:    CX = string length
  22. ;* * * * * * * * * * * * * *
  23. 
  24.     PUBLIC    STR_CHAR_DEL
  25. STR_CHAR_DEL    PROC    FAR
  26.     call    strlen1
  27. STR_CHAR_DEL    ENDP
  28.  
  29. comment 
  30. ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -( STRING  )
  31. STR_CHAR_DELC - deletes a character from a string of n-length
  32. ;
  33. ; inputs:    DS:[SI] pointing to an ASCIIZ string
  34. ;            CX = current string length
  35. ;            AX = offset from DS:[BX] to character to delete
  36. ;            
  37. ; output:    CX = string length
  38. ;* * * * * * * * * * * * * *
  39. 
  40.     PUBLIC    STR_CHAR_DELC
  41. STR_CHAR_DELC    PROC    FAR
  42.     CLD
  43.     CMP     AX,CX
  44.     JAE     scd_exit
  45.     APUSH   DI,SI,ES
  46.     MOV     DI,SI
  47.     PUSH    DS
  48.     POP     ES
  49.     ADD     DI,AX
  50.     MOV     SI,DI
  51.     INC     SI
  52.     PUSH    CX
  53.     SUB     CX,AX
  54.     REPZ    MOVSB
  55.     POP     CX
  56.     DEC     CX
  57.     APOP    ES,SI,DI
  58. scd_exit:
  59.     RETF
  60. STR_CHAR_DELC ENDP
  61.  
  62. LIBSEG    ENDS
  63.     end
  64.