SHARE
TWEET

Untitled

a guest Dec 2nd, 2019 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .MODEL SMALL
  2. .STACK 100H
  3.  
  4. .DATA
  5. ;MSG DB 'PLEASE ENTER A STRING: ', '$'  
  6. X DB 80 DUP (?)
  7.  
  8. .CODE
  9. MAIN PROC
  10.    
  11. MOV AX, @DATA  
  12. MOV DS, AX  
  13.  
  14. ;LEA DX, MSG
  15. ;MOV AH, 09H
  16. ;INT 21H
  17.  
  18. MOV SI, 0
  19. LOOP1:
  20. MOV AH, 1
  21. INT 21H
  22. CMP AL, 0DH
  23. JZ EXIT
  24. MOV X[SI], AL
  25. INC SI
  26. JMP LOOP1
  27.  
  28. EXIT:  
  29. DEC SI
  30.          
  31. MOV AH, 2
  32. MOV DL, 0DH
  33. INT 21H
  34. MOV AH, 2
  35. MOV DL, 0AH
  36. INT 21H
  37.          
  38. LOOP2:      
  39. MOV BL,X[SI]
  40.     ; converting upper to lower and vice-versa
  41.    
  42. CMP BL,'z'
  43.     ; ignoring spacial charecter
  44. JG ignore  
  45. CMP BL,'A'
  46. JL ignore
  47.  
  48. CMP BL,96
  49. JG  upper
  50.  
  51. CMP BL,90
  52. JG  ignore
  53.  
  54. ADD BL,64
  55. upper:
  56. SUB BL,32        
  57. ignore:
  58.  
  59.     ;ADD DL,-10
  60.  
  61.     ; PRINTING NEW LINE (actually printing 80 chars)
  62.  
  63.     ; setting for output request
  64.  
  65. MOV DL,BL
  66. MOV AH,2
  67. INT 21H
  68.  
  69. CMP SI, 0
  70. JZ EXIT2
  71. DEC SI
  72. JMP LOOP2  
  73.  
  74. EXIT2:
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top