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

  1.     page    66,132
  2. ;******************************** STR16.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_UPPER - changes string to upper case
  15. ;
  16. ; inputs:    DS:[SI] pointing to string
  17. ; output:    nothing
  18. ;* * * * * * * * * * * * * *
  19. 
  20.     PUBLIC    STR_UPPER
  21. STR_UPPER    PROC    FAR
  22.     apush    ax,si
  23. su_lp1:    lodsb
  24.     cmp    al,0
  25.     je    su_exit            ;jmp if end of string
  26.     cmp    al,'a'
  27.     jb    su_lp1            ;jmp if char out of range
  28.     cmp    al,'z'
  29.     ja    su_lp1            ;jmp if char out of range
  30.     sub    byte ptr [si-1],20h    ;convert to upper case
  31.     jmp    su_lp1
  32. su_exit:apop    si,ax
  33.     retf    
  34. STR_UPPER    ENDP
  35.  
  36. LIBSEG    ENDS
  37.     end
  38.