home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / CPM68K / SD68K.LBR / CAPS.S next >
Text File  |  2000-06-30  |  768b  |  26 lines

  1. ****    CAPS -- Capitalize Character
  2. **
  3. **    Function:
  4. **        Capitalize the ASCII character in D1.b if it is a
  5. **        lower-case alphabetic (a-z); otherwise return unchanged.
  6. **        Only the lower 7 bits are considered.  The most
  7. **        significant bit is cleared.
  8. **    Inputs:  D1.b == character to capitalize
  9. **    Outputs: D1.b == capitalized character
  10. **    Registers affected:  D1.b
  11. **    Routines called: -none-
  12. **    Special error conditions: -none-
  13. *
  14.     .globl    caps
  15.     .text
  16. caps:
  17.     andi.b    #$7f,d1        * mask off sign bit
  18.     cmpi.b    #'a',d1
  19.     blt    capsx        * not a-z
  20.     cmpi.b    #'z',d1
  21.     bgt    capsx        * not a-z
  22.     andi.b    #$5f,d1        * a-z ==> A-Z
  23. *
  24. capsx:    rts
  25.     .end
  26.