Advertisement
Nahid8195

problem 4

Dec 13th, 2021
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. .MODEL SMALL
  2. .STACK 100H
  3. .DATA
  4.  
  5.  
  6. MSG1 DB 0AH,0DH,'Please enter anything: $'
  7. MSG2 DB 0AH,0DH,'You have entered: $'
  8. MSG3 DB 0AH,0DH,'Thank you. Program ends here.$'
  9.  
  10.  
  11.  
  12. .CODE
  13.  
  14. MAIN PROC
  15.  
  16. MOV AX,@DATA
  17. MOV DS,AX
  18.  
  19. L1:
  20. LEA DX,MSG1
  21. MOV AH,9
  22. INT 21H
  23.  
  24. MOV AH,1
  25. INT 21H
  26. MOV BL,AL
  27.  
  28. LEA DX,MSG2
  29. MOV AH,9
  30. INT 21H
  31.  
  32. MOV AH,2
  33. MOV DL,BL
  34. INT 21H
  35. JMP L2
  36.  
  37. L2:
  38. LEA DX,MSG1
  39. MOV AH,9
  40. INT 21H
  41.  
  42. MOV AH,1
  43. INT 21H
  44. MOV CL,AL
  45.  
  46.  
  47.  
  48. LEA DX,MSG2
  49. MOV AH,9
  50. INT 21H
  51.  
  52. MOV AH,2
  53. MOV DL,CL
  54. INT 21H
  55.  
  56. JMP L3
  57.  
  58. L3:
  59. LEA DX,MSG1
  60. MOV AH,9
  61. INT 21H
  62.  
  63. MOV AH,1
  64. INT 21H
  65. MOV BH,AL
  66.  
  67. LEA DX,MSG2
  68. MOV AH,9
  69. INT 21H
  70.  
  71. MOV AH,2
  72. MOV DL,BH
  73. INT 21H
  74.  
  75. CMP BL,CL,BH
  76. JE L4
  77. JMP L1
  78.  
  79.  
  80.  
  81. L4:
  82. LEA DX,MSG3
  83. MOV AH,9
  84. INT 21H
  85. JMP EXIT
  86.  
  87. EXIT:
  88. MOV AH,04H
  89. INT 21H
  90.  
  91. MAIN ENDP
  92. END MAIN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement