Guest User

Untitled

a guest
Jan 21st, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. .model small
  2. .stack 100h
  3. .data
  4. s1 db 13,10,"Input limit: ","$"
  5. s2 db 13,10,"Sum series: ","$"
  6. .code
  7. main proc
  8. mov ax,@data
  9. mov dx,ax
  10. mov ah,09h
  11. lea dx,s1
  12. int 21h
  13. mobv bx,0
  14. read:
  15. mov ah,01h
  16. int 21h
  17. cmp al,0dh
  18. je next
  19.  
  20. mov ah,0
  21. sub al,30h
  22. push ax
  23. mov ax,10d
  24. mul bx
  25. pop bx
  26. add bx,ax
  27. jmp read
  28. next:
  29. mov ax,bx
  30. mov cx,ax
  31. mov ax,0
  32.  
  33. again:
  34. add ax,cx
  35. loop again
  36. push ax
  37. mov cx,0
  38. mov ah,09h
  39. lea dx,s2
  40. int 21h
  41.  
  42. mov dx,0
  43. mob bx,10d
  44. pop ax
  45.  
  46. displayed:
  47. mov dx,0
  48. div bx
  49. push dx
  50. inc cx
  51. or ax,ax
  52. jnz displayed
  53.  
  54. print:
  55. mov dx,0
  56. mov ah,02h
  57. int 21h
  58. pop dx
  59. add dl,30h
  60. int 21h
  61. loop print
  62. mov ah,4ch
  63. int 21h
  64. main endp
  65. end main
Add Comment
Please, Sign In to add comment