shawonrog

Compare with Number and Print adult , young

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