shawonrog

CHEAK GREATER, SMALL , EQUAL ASSEMBLY LIPU VERSION

Sep 25th, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. .STACK 100H
  2. .MODEL SMALL
  3. .DATA
  4. MSG1 DW 'PLEASE SCAN A DIGIT (0-9): $'
  5. MSG2 DW 'YOUR VALUE IS EQUIVALENT 5 $'
  6. MSG3 DW 'YOUR VALUE IS GREATER THAN 5$'
  7. MSG4 DW 'YOUR VALUE IS LESS THAN 5$'
  8. .CODE
  9. MAIN PROC
  10.  
  11. MOV AX,@DATA
  12. MOV DS,AX
  13.  
  14. ;FRST MSG
  15. MOV AH,9
  16. LEA DX,MSG1
  17. INT 21H
  18.  
  19. ;FRST SCAN
  20. MOV AH,1
  21. INT 21H
  22. MOV BL,AL
  23.  
  24. ;NEW LINE
  25. MOV AH,2
  26. MOV DL,0AH
  27. INT 21H
  28. MOV DL,0DH
  29. INT 21H
  30.  
  31. CMP BL,'5'
  32. JG GARTER
  33. JL LESS
  34.  
  35. LEA DX,MSG2
  36. MOV AH,9
  37. INT 21H
  38. JMP END_IF
  39.  
  40. GARTER:
  41. LEA DX,MSG3
  42. MOV AH,9
  43. INT 21H
  44. JMP END_IF
  45.  
  46. LESS:
  47. LEA DX,MSG4
  48. MOV AH,9
  49. INT 21H
  50.  
  51.  
  52. END_IF:
  53.  
  54.  
  55.  
  56. MAIN ENDP
  57. END MAIN
Add Comment
Please, Sign In to add comment