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

  1. ;    FILENAME: OLOCASE.ASM
  2. ;    Copyright (c) 1988 by Borland International, Inc.
  3. ;
  4. ;    Description: This module implements the routine LoCase.  The
  5. ;    routine converts a letter to lower 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 olocase
  12.  
  13. include globals.inc
  14.  
  15. _TEXT   segment
  16.  
  17.     LoCase proc
  18.  
  19.     ;    This function returns the corresponding lowercase letter for
  20.     ;    the uppercase letter passed in al.
  21.     ;
  22.     ;    Input
  23.     ;        al - contains the ASCII value for an upppercase letter
  24.     ;    Output
  25.     ;        al - contains the ASCII value for the corresponding lowercase
  26.     ;             letter            
  27.     ;    Registers modified
  28.     ;         al
  29.  
  30. ; Convert the letter in AL to lower case.
  31.  
  32.     cmp     al, 'A'
  33.     jb      locas1
  34.     cmp     al, 'Z'
  35.     ja      locas1
  36.     add     al, 'a'-'A'
  37. locas1:
  38.     ret
  39.     LoCase  endp
  40.  
  41. _TEXT    ends
  42.  
  43. end
  44.