Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. .286
  2. .model small
  3. .stack 100h
  4. .data
  5. podajn db "n=$"
  6. n dw 0
  7. .code
  8. start: mov dx, seg @data
  9. mov ds,dx
  10.  
  11. mov dx,offset podajn
  12. mov ah,09h
  13. int 21h
  14.  
  15. call wczytaj
  16. mov n,ax
  17.  
  18. call nowalinia
  19.  
  20. mov si,1
  21. petz: cmp si,n
  22. ja koniec
  23.  
  24. mov di,1
  25. petw: cmp di,n
  26. ja dalej
  27.  
  28. cmp si,1
  29. je gwiazd
  30. cmp si,n
  31. je gwiazd
  32. cmp di,1
  33. je gwiazd
  34. cmp di,n
  35. je gwiazd
  36. mov ah,2
  37. mov dl,' '
  38. int 21h
  39. jmp siup
  40. gwiazd: mov ah,2
  41. mov dl,'*'
  42. int 21h
  43.  
  44. siup: inc di
  45. jmp petw
  46.  
  47. dalej: call nowalinia
  48. inc si
  49. jmp petz
  50.  
  51. koniec: mov ax,4c00h
  52. int 21h
  53.  
  54. wczytaj proc
  55. mov ax,0
  56. mov cx,0ah
  57. @@pet: xchg ax,bx
  58. mov ah,01h
  59. int 21h
  60. xchg ax,bx
  61. cmp bl,'0'
  62. jb @@kon
  63. cmp bl,'9'
  64. ja @@kon
  65. mul cx
  66. and bx,0fh
  67. add ax,bx
  68. jmp @@pet
  69. @@kon: ret
  70. wczytaj endp
  71.  
  72. nowalinia proc
  73. mov ah,02h
  74. mov dl,0ah
  75. int 21h
  76. ret
  77. nowalinia endp
  78.  
  79. wypisz proc
  80. mov cx,0ah
  81. mov dx,0
  82. div cx
  83. cmp ax,0
  84. je @@kon
  85. push dx
  86. call wypisz
  87. pop dx
  88. @@kon: mov ah,02h
  89. add dl,'0'
  90. int 21h
  91. ret
  92. wypisz endp
  93.  
  94. end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement