home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / tasm / oupcase.asm < prev    next >
Assembly Source File  |  1988-08-28  |  1KB  |  44 lines

  1. ;    FILENAME: OUPCASE.ASM
  2. ;
  3. ;    Copyright (c) 1988 by Borland International, Inc.
  4. ;    Description: This module implements the routine UpCase.  The
  5. ;    routine converts a letter to upper-case.
  6. ;    This module uses MASM mode syntax and standard segment directives.
  7. ;
  8. ;    ASSEMBLY INSTRUCTIONS: To assemble this module use the following
  9. ;    TASM command line.
  10. ;
  11. ;        TASM oupcase
  12.  
  13. include globals.inc
  14.  
  15. _TEXT   segment
  16.  
  17.     UpCase proc
  18.  
  19.     ;    This function returns the corresponding upper-case letter for
  20.     ;    the lower-case letter passed in al.
  21.     ;
  22.     ;    Input
  23.     ;        al - contains the ASCII value for an lower-case letter
  24.     ;    Output
  25.     ;        al - contains the ASCII value for the corresponding upper-case
  26.     ;             letter            
  27.     ;    Registers modified
  28.     ;         al
  29.  
  30. ; Convert the letter in AL to upper-case.
  31.  
  32.     cmp     al, 'a'
  33.     jb      upcas1
  34.     cmp     al, 'z'
  35.     ja      upcas1
  36.     sub     al, 'a'-'A'
  37. upcas1:
  38.     ret
  39.     UpCase  endp
  40.  
  41. _TEXT    ends
  42.  
  43. end
  44.