Advertisement
shawonrog

write a program to display a "?" LIPU version

Oct 2nd, 2018
140
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 "INPUT:$"
  5. MSG2 DW "OUTPUT:$"
  6. .CODE
  7. MAIN PROC
  8. MOV AX,@DATA
  9. MOV DS,AX
  10.  
  11. ;MSG1
  12. LEA DX,MSG1
  13. MOV AH,9
  14. INT 21H
  15.  
  16. ;PRINT
  17. MOV AH,2
  18. MOV DL,'?'
  19. INT 21H
  20.  
  21. ;SCAN1
  22. MOV AH,1
  23. INT 21H
  24. MOV BL,AL
  25.  
  26. ;SCAN2
  27. MOV AH,1
  28. INT 21H
  29. MOV CL,AL
  30.  
  31. ;NEWLINE
  32. MOV AH,2
  33. MOV DL,0DH
  34. INT 21H
  35. MOV DL,0AH
  36. INT 21H
  37.  
  38. ;MSG2
  39. LEA DX,MSG2
  40. MOV AH,9
  41. INT 21H
  42.  
  43. ;COMPARE
  44. CMP BL,CL
  45. JG G
  46.  
  47. MOV AH,2
  48. MOV DL,BL
  49. INT 21H
  50.  
  51. MOV AH,2
  52. MOV DL,CL
  53. INT 21H
  54.  
  55. JMP END_IF
  56.  
  57. G:
  58.  
  59. MOV AH,2
  60. MOV DL,CL
  61. INT 21H
  62.  
  63. MOV AH,2
  64. MOV DL,BL
  65. INT 21H
  66.  
  67.  
  68.  
  69. END_IF:
  70.  
  71.  
  72. MAIN ENDP
  73. END MAIN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement