Guest User

Untitled

a guest
Apr 1st, 2016
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. .CODE
  2.  
  3. MOV AH, 9 ; set print option for int 21h
  4. MOV DX, OFFSET DisplayString ; set DS:DX to point to DisplayStirng
  5. INT 21h
  6.  
  7.  
  8. MOV AH, 1 ; set read option for int 21h
  9. INT 21h ; read
  10. MOV d1 ,AL
  11. MOV DisplayStringResY[2],AL ; Put insert user digit in the original string
  12. SUB d1, '0' ; Ascii to int
  13.  
  14. MOV AH, 1 ; set read option for int 21h
  15. INT 21h ; read
  16. MOV d2 ,AL
  17. MOV DisplayStringResY[3],AL; Put insert user digit in the original string
  18. MOV DisplayStringResY[15],AL
  19. SUB d2, '0' ; Ascii to int
  20.  
  21. MOV AH, 1 ; set read option for int 21h
  22. INT 21h ; read
  23. MOV d3 ,AL
  24. MOV DisplayStringResY[4],AL; Put insert user digit in the original string
  25. MOV DisplayStringResY[16],AL
  26. MOV DisplayStringResY[27],AL
  27. SUB d3, '0'; Ascii to int
  28.  
  29. MOV AH, 9 ; set print option for int 21h
  30. MOV DX, OFFSET DisplayStringDIG ;
  31. INT 21h
  32.  
  33. MOV AH, 1 ; set read option for int 21h
  34. INT 21h ; read
  35. MOV dig ,AL
  36. MOV DisplayStringResY[10],AL; Put insert user digit in the original string
  37. MOV DisplayStringResY[22],AL
  38. MOV DisplayStringResY[33],AL
  39. SUB dig, '0'
  40.  
  41. MOV AL ,d3
  42. MOV AH,0
  43. DIV dig
  44. MOV rem, ah
  45. ADD AH,'0' ; int to Ascii
  46. MOV DisplayStringResY[37],AH; Put insert rem digit in the original string
  47.  
  48.  
  49. mov al,d2
  50. mul ten
  51. add al,d3
  52. MOV NUM,AL
  53.  
  54. MOV AH,0
  55. DIV dig
  56. CMP AH,rem
  57. JNE WorngRES ; Jump and print mess if not Equal
  58.  
  59. MOV AL,d1
  60. mul handret
  61. add AL,NUM
  62.  
  63. MOV AH,0
  64. DIV dig
  65. CMP AH,rem
  66. JNE WorngRES ; Jump and print mess if not Equal
  67.  
  68.  
  69. MOV AH, 9 ; set print option for int 21h
  70. MOV DX, OFFSET DisplayStringResY ; set DS:DX to point to DisplayStirng
  71. INT 21h
  72. JMP EXIT
  73.  
  74. mov ah,4ch
  75. INT 21h ; Return to DOS (terminate program)
  76. END ProgStart
Advertisement
Add Comment
Please, Sign In to add comment