Advertisement
shawonrog

A_Z IS Right Others CHARACTER IS WRONG in Assmbly

Oct 9th, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. .MODEL SMALL
  2. .STACK 100H
  3. .DATA
  4.  
  5. MSG1 DW "SAMPLE INPUT: $"
  6. MSG2 DW "YOUR INPUT CHARACTER IS RIGHT. $"
  7. MSG3 DW "YOU INPUT A WRONG CHARACTER. $"
  8.  
  9. .CODE
  10. MAIN PROC
  11.  
  12. MOV AX,@DATA
  13. MOV DS,AX
  14.  
  15. MOV AH,9
  16. LEA DX,MSG1
  17. INT 21H
  18.  
  19. MOV AH,1
  20. INT 21H
  21. MOV BL,AL
  22.  
  23. MOV AH,2
  24. MOV DL,0AH
  25. INT 21H
  26. MOV DL,0DH
  27. INT 21H
  28.  
  29. CMP BL,5AH
  30. JG ERROR
  31. CMP BL,41H
  32. JL ERROR2
  33.  
  34. MOV AH,9
  35. LEA DX,MSG2
  36. INT 21H
  37. JMP END_IF
  38.  
  39. ERROR:
  40. MOV AH,9
  41. LEA DX,MSG3
  42. INT 21H
  43. JMP END_IF
  44.  
  45. ERROR2:
  46. MOV AH,9
  47. LEA DX,MSG3
  48. INT 21H
  49.  
  50. END_IF:
  51. MAIN ENDP
  52. END MAIN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement