Advertisement
Guest User

Untitled

a guest
Dec 13th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. .model tiny
  2. .code
  3. .startup
  4. Org 100h
  5. Jmp Short Start
  6. N Equ 3
  7. M Equ 2
  8. Matrix Dw 9, 0, 3
  9. Dw 0, 0, 6
  10. Vector DW N Dup (?)
  11. S Equ Type Matrix
  12.  
  13. Vert Equ 0
  14.  
  15. FormVector Proc
  16. Push Bp
  17. Mov Bp, Sp
  18.  
  19. Push Cx
  20. Push Bx
  21. Push Dx
  22. Push Di
  23. Push Ax
  24.  
  25. Mov Cx, [Bp + 4]
  26. Mov Bx, [Bp + 8]
  27. Mov Di, [Bp + 10]
  28.  
  29. Mov Ax, S
  30. Mul Word Ptr [Bp + 4] ; 4 = ?? + ??
  31. Mov Si, Ax
  32.  
  33. Rows: Xor Ax, Ax
  34. Push Cx
  35. Push Bx
  36. Mov Cx, [Bp + 6]
  37.  
  38.  
  39. Cols: Cmp [Bx], Word Ptr Vert
  40. Jne False
  41. Inc Ax
  42.  
  43. False:
  44. Add Bx, Si
  45. Loop Cols
  46. Pop Bx
  47. Add Bx, S
  48.  
  49.  
  50. Mov [Di], Ax
  51. Pop Cx
  52. Add Di, S
  53. Loop Rows
  54.  
  55. Pop Ax
  56. Pop Di
  57. Pop Dx
  58. Pop Bx
  59. Pop Cx
  60.  
  61. Pop Bp
  62. Ret 2*4
  63. FormVector EndP
  64.  
  65. Print Proc
  66. Push Bp
  67. Mov Bp, Sp
  68.  
  69. Push Cx
  70. Push Bx
  71. Push Ax
  72.  
  73. Mov Cx, [Bp + 4]
  74. Mov Bx, [Bp + 6]
  75. Pr: Mov Ax, [Bx]
  76. Add Bx, S
  77. Loop Pr
  78.  
  79. Pop Ax
  80. Pop Bx
  81. Pop Cx
  82.  
  83. Pop Bp
  84. Ret 2*2
  85. Print EndP
  86.  
  87. Start:
  88. Lea Ax, Vector
  89. Push Ax
  90. Lea Ax, Matrix
  91. Push Ax
  92. Mov Ax, M
  93. Push Ax
  94. Mov Ax, N
  95. Push Ax
  96. Call FormVector
  97.  
  98. Lea Ax, Vector
  99. Push Ax
  100. Mov Ax, N
  101. Push Ax
  102. Call Print
  103. .exit 0
  104. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement