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

  1.     page    66,132
  2. ;******************************** STR17.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_UPPERC:  changes n-length string to upper case
  15. ;
  16. ; inputs:    DS:[SI] pointing to string
  17. ;            CX = number of bytes in string
  18. ;            
  19. ; output:    nothing
  20. ;* * * * * * * * * * * * * *
  21. 
  22.     PUBLIC    STR_UPPERC
  23. STR_UPPERC    PROC    FAR
  24.     apush    ax,cx,si
  25.     jcxz    stu_exit        ;jmp if null string
  26. stu_lp:    lodsb
  27.     cmp    al,'a'
  28.     jb    stu_next        ;jmp if char out of range
  29.     cmp    al,'z'
  30.     ja    stu_next
  31.     sub    byte ptr [si-1],20h    ;convert to upper case
  32. stu_next:
  33.     loop    stu_lp
  34. stu_exit:    
  35.     apop    si,cx,ax
  36.     retf
  37. STR_UPPERC ENDP
  38.  
  39. LIBSEG    ENDS
  40.     end
  41.