assambly matrix program - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

assambly matrix program

huhzhuhz Posts: 2Member
Hello. I had a task to write a program which finds minimal elements in each matrix column. I kinda wrote program, but when i check results they are kinda different.

[code].model tiny
Org 100h
Jmp Short Start
N Equ 2
M Equ 3
Matrix DW 1, 7, 3 ; 2 elementi diapazon? [Min, Max]
DW 4, 5, 6 ; 3 elementi diapazon? [Min, Max]
Vector DW M Dup (?)
S Equ Type Matrix
Xor Bx, Bx
Mov Cx, M
Lea Di, Vector
Cols: Push Cx
Mov Cx, N
Xor Si, Si
Xor Ax, Ax
Xor Dx, Dx
Mov Ax , Matrix[Bx][Si]

Cmp Matrix[Bx][Si], Ax
Jg False
Mov Ax, Matrix[Bx][Si]

Add Si, S*M
Loop Rows
Mov [Di], Ax
Add Bx, S
Add Di, S
Pop Cx
Loop Cols
Xor Bx, Bx
Mov Cx, M
Print: Mov Ax, Vector[Bx]
Add Bx, S
Loop Print

.exit 0

Could someone point out or help me correct my mistakes?
Sign In or Register to comment.