Advertisement
Nahid8195

Tazbid

Nov 3rd, 2021
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. INCLUDE "EMU8086.INC" ; this function is used to take new line
  2. .MODEL SMALL ; IN THIS COURSE ALL MODEL ARE SMALL
  3. .STACK 100H ; WE ALWAYS USE STACK 100H
  4.  
  5.  
  6. .DATA ; DATA SEGMENT
  7.  
  8. SN_NUM1 DB ? ; assign a variable where store first input
  9. SN_NUM2 DB ? ; same second input
  10. SN_NUM3 DB ? ; same third
  11. SN_NUM4 DB ? ; fourth input
  12. SN_NUM5 DB ? ; fifth input
  13.  
  14.  
  15. .CODE
  16.  
  17. MAIN PROC ; MAIN CODE START HERE
  18.  
  19.  
  20.  
  21. MOV AH,1 ; this function is used to take single bit input
  22. MOV SN_NUM1,AL ; we move the input input num1
  23. INT 21H ; this will take input
  24. MOV SN_NUM2,AL
  25. INT 21H
  26. MOV SN_NUM3,AL
  27. INT 21H
  28. MOV SN_NUM4,AL
  29. INT 21H
  30. MOV SN_NUM5,AL ; by the same process we take our 5 input
  31. INT 21H
  32.  
  33. PRINTN "" ; this function is used to give a new line
  34.  
  35. MOV AH,2
  36. MOV DL,AL
  37. INT 21H
  38. ; this ah,2 is used to print signle input
  39. MOV DL,SN_NUM5 ; as we want reverse we first print num5
  40. INT 21H ; this will print number 5
  41. MOV DL,SN_NUM4
  42. INT 21H
  43. MOV DL,SN_NUM3
  44. INT 21H
  45. MOV DL,SN_NUM2
  46. INT 21H
  47. MOV DL,SN_NUM1 ; same process we print all input by reverse num5,num4,num3,num2,num1
  48. INT 21H
  49.  
  50.  
  51.  
  52.  
  53. MOV AX,4CH ; TERMINATED THE CODE AND EXIT
  54. INT 21H
  55. MAIN ENDP
  56. END MAIN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement