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

  1.     page    66,132
  2. ;******************************** STR20.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_LOWERC -  changes n bytes of a string to lower case
  15. ;
  16. ; inputs:    DS:[SI] = address of an ASCIIZ string
  17. ;            CX = number of bytes
  18. ;            
  19. ; output:    nothing
  20. ;* * * * * * * * * * * * * *
  21. 
  22.     PUBLIC    STR_LOWERC
  23. STR_LOWERC    PROC    FAR
  24.     apush    ax,cx,si
  25.     jcxz    stlc_exit    ;jmp if null string
  26.     cld
  27. stlc_lp:lodsb
  28.     cmp    al,'A'
  29.     jb    stlc_next
  30.     cmp    al,'Z'
  31.     ja    stlc_next
  32.     add    byte ptr ds:[si-1],20h    ;convert to lower case
  33. stlc_next:
  34.     loop    stlc_lp
  35. stlc_exit:
  36.     apop    si,cx,ax
  37.     retf        
  38. STR_LOWERC ENDP
  39.  
  40. LIBSEG    ENDS
  41.     end
  42.