home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / dpl.zip / UPRCS.D < prev    next >
Text File  |  1988-07-11  |  1KB  |  54 lines

  1. ; Doug's Programming Language  -- DPL, Version 2.22
  2. ; Copyright (c) 1988 Douglas S. Cody, All rights reserved.
  3. ;--------------------------------
  4. ; UPRCS  --  Convert all ASCIIZ string characters to uppercase
  5. ;
  6. ; Entry Conditions:
  7. ;    AX holds the string offset
  8. ; Exit conditions:
  9. ;    Assume all working registers modified
  10. ;
  11. ; Calling Example:
  12. ;
  13. ;    DEFINE    M00,'this is a test...'
  14. ;    ;
  15. ;    CALL    UPRCS M00
  16. ;
  17. ; Calling results:
  18. ;
  19. ;    M00 = 'THIS IS A TEST...'
  20. ;    
  21. SUBPGM    UPRCS
  22. BEGIN    UPRCS
  23.     PUSH    ES
  24.     PUSH    DS
  25.     POP    ES
  26.     PUSH    SI
  27.     PUSH    DI
  28.     MOV    SI,AX        ; SI WILL LEAD 
  29.     MOV    DI,AX        ; DI WILL FOLLOW UP
  30.     MOV    BX,07A61H    ; BH='z', BL='a'
  31. ;
  32. U05:
  33.     LODSB            ; FETCH THE BYTE
  34.     OR    AL,AL        ; EOL?
  35.     JZ    U15        ; YES, EXIT NOW...
  36.     CMP    AL,BL        ; IS IT LESS THAN 'a'?
  37.     JB    U10        ; YES, SKIP CONVERSION
  38.     CMP    AL,BH        ; GREATER THAN 'z'?
  39.     JA    U10        ; YES, SKIP CONVERSION
  40.     AND    AL,5FH        ; CLEAR THE LOWERCASE BIT
  41. ;
  42. U10:
  43.     STOSB            ; SAVE THE CHARACTER
  44.     JMP    SHORT U05    ; CONTINUE TILL DONE...
  45. ;
  46. U15:
  47.     POP    DI
  48.     POP    SI
  49.     POP    ES
  50.     RET
  51. ;
  52. ENDPGM    UPRCS
  53. ;
  54.