Advertisement
shawonrog

FIND GREATER VALUE USE if else in asm LIPU VERSION

Sep 25th, 2018
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. .MODEL SMALL
  2. .STACK 100H
  3. .DATA
  4.  
  5. MSG1 DW 'SCAN VALUE1- $'
  6. MSG2 DW 'SCAN VALUE 2- $'
  7. MSG3 DW 'GREATER VALUE -$'
  8.  
  9. .CODE
  10. MAIN PROC
  11.  
  12. MOV AX,@DATA
  13. MOV DS,AX
  14.  
  15. ;FRST MSG
  16. MOV AH,9
  17. LEA DX,MSG1
  18. INT 21H
  19.  
  20. ;FRST SCAN
  21. MOV AH,1
  22. INT 21H
  23. MOV BL,AL
  24.  
  25. ;NEW LINE
  26. MOV AH,2
  27. MOV DL,0AH
  28. INT 21H
  29. MOV DL,0DH
  30. INT 21H
  31.  
  32. ;SCND MSG
  33. MOV AH,9
  34. LEA DX,MSG2
  35. INT 21H
  36.  
  37. ;SCND SCAN
  38. MOV AH,1
  39. INT 21H
  40. MOV BH,AL
  41.  
  42. ;SCND NEWLINE
  43. MOV AH,2
  44. MOV DL,0AH
  45. INT 21H
  46. MOV DL,0DH
  47. INT 21H
  48.  
  49. ;COMPARE
  50. CMP BL,BH
  51. JG GRT
  52. MOV AH,2
  53. MOV DL,0AH
  54. INT 21H
  55. MOV DL,0DH
  56. INT 21H
  57.  
  58. MOV AH,9
  59. LEA DX,MSG3
  60. INT 21H
  61.  
  62. MOV AH,2
  63. MOV DL,BH
  64. INT 21H
  65. JMP END_IF
  66.  
  67.  
  68.  
  69. GRT:
  70. MOV AH,2
  71. MOV DL,0AH
  72. INT 21H
  73. MOV DL,0DH
  74. INT 21H
  75. MOV AH,9
  76. LEA DX,MSG3
  77. INT 21H
  78. MOV AH,2
  79. MOV DL,BL
  80. INT 21H
  81.  
  82. END_IF:
  83.  
  84.  
  85.  
  86. MAIN ENDP
  87. END MAIN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement