Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Comment &
- Atrast katra kolonna videjo aritmetisko para skaitliem
- &
- .model tiny
- .code
- .startup
- Org 100h
- Jmp Short Start
- N Equ 2
- M Equ 3
- Matrix Dw 1, 2, 4
- Dw 4, 5, 6
- Vector DW M Dup (?)
- S Equ Type Matrix
- FormVector Proc
- Push Bp
- Mov Bp, Sp
- Push Cx
- Push Bx
- Push Dx
- Push Di
- Push Ax
- Mov Ax, S
- Mul Word Ptr [Bp+6]
- Mov Si, Ax
- Mov Cx, [Bp + 6]
- Mov Bx, [Bp + 8]
- Mov Di, [Bp + 10]
- Rows: Push Cx
- Mov Cx, [Bp + 4]
- Xor Ax, Ax
- Xor Dl, Dl
- Push Bx ;my
- Cols:
- Test [Bx], Word Ptr 00000001B ;Test Ax, 1
- Jnz False ;if odd
- ;if even
- Inc Dl
- Add Ax, [Bx] ;Ax = Ax + Bx
- False:
- Add Bx, Si ;original
- Loop Cols
- Pop Bx ;my
- Add Bx, S ;my
- Div Dl ;Ax = Ax/Dl
- Mov [Di], Ax
- Pop Cx
- Add Di, S
- Loop Rows
- Pop Ax
- Pop Di
- Pop Dx
- Pop Bx
- Pop Cx
- Pop Bp
- Ret 2*4
- FormVector EndP
- Print Proc
- Push Bp
- Mov Bp, Sp
- Push Cx
- Push Bx
- Push Ax
- Mov Cx, [Bp + 4]
- Mov Bx, [Bp + 6]
- Pr: Mov Ax, [Bx]
- Add Bx, S
- Loop Pr
- Pop Ax
- Pop Bx
- Pop Cx
- Pop Bp
- Ret 2*2
- Print EndP
- Start:
- Lea Ax, Vector
- Push Ax
- Lea Ax, Matrix
- Push Ax
- Mov Ax, M
- Push Ax
- Mov Ax, N
- Push Ax
- Call FormVector
- Lea Ax, Vector
- Push Ax
- Mov Ax, M
- Push Ax
- Call Print
- ;.exit 0
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement