Hi!
I'm new here and I want to learn ASM but first, I need to write a program in assembler that calculates the product of two square matrices with n rows and columns with elements defined by one word and values in the field [-88.87].
Can you help me ?
Posted on 2010-01-19 11:05:48 by jmk
Maybe you should write this program in a higher level language first.
Posted on 2010-01-19 12:01:56 by r22

values in the field [-88.87].


I don't even understand what that means.  Well if you are using word values you may use something similar to mov edx, dword ptr   provided that a word size is two bytes, ebx holds some base pointer and ecx holds the index count.  It may also be easier to do it by hand a few times to work out an algorithm first.  That's what I usually do in programming exercises
Posted on 2010-01-19 19:19:05 by GoldStar611
GoldStar611,

Probably he means that matrices' elements belong to range -8887? If he's talking about finite field, more information needed.

_____________
jmk,

Prove that you're serious about learning Asm. Post the code you've written for this program thus far.
Posted on 2010-01-20 00:51:01 by baldr
Yes, matrices' elements belong to range -8887. I need the code that multiply two square matrices, and the elements to belong to range -88...87
Posted on 2010-01-20 03:59:07 by jmk
jmk,

Prove that you're serious about learning Asm. Post the code you've written for this program thus far.
Seconded - the alternative is to pay better attention in class so you can do your homework yourself :)
Posted on 2010-01-20 06:13:26 by f0dder
jmk,

Is this the only restriction? Dot product in matrix multiplication follows ordinary (integer) rules for multiplication and addition (i.e. product matrix elements can be outside that range)? Results can overflow 16-bit signed range (-32,76832,767) even for 55 matrices.

Don't expect much help if you don't cooperate (show your efforts so far).
Posted on 2010-01-20 06:37:31 by baldr
include io.h
.model small
.stack 128h
.data
m dw ?
n dw ?
mat1 dw 100 dup(100 dup(?))
mat2 dw 100 dup(100 dup(?))
.code
  mov Ax, @data
  mov DS, Ax
putsi <Number of lines and columns '>
  geti
  mov m,ax
 
  xor ax,ax
  xor si,si
  xor bx,bx
  mov cx,m
et1:
  push cx
    mov cx,m
    xor bx,bx
      et2:
        putsi <'Numbers for matrix1['>
        puti si
        putsi <']['
        puti bx
        putsi <']='>
       
        geti
        mov mat1,ax
        add bx,2
    loop et2
  pop cx
  add si,2
loop et1
moc cx,m
et3:
  push cx
    mov cx,m
    xor bx,bx
      et4:
        putsi <'Numbers for matrix2['>
        puti si
        putsi <']['
        puti bx
        putsi <']='>
       
        geti
        mov mat2,ax
        add bx,2
    loop et3
  pop cx
  add si,2
loop et4
Posted on 2010-01-20 11:07:23 by jmk
jmk,

Are you sure something can compile that?
include io.h hmm, why not? Probably it contains those putsi/puti/geti things.
putsi <Number of lines and columns '> looks like compiler is not MASM, unmatched single quote not inside double quotes.
putsi <'][' another strange parameter.
moc cx,m I think, enough already.

Mock-up won't help you. Show something real. Or ask relevant questions about implementation details.
Posted on 2010-01-20 13:59:21 by baldr