The goal is to calculate the product of elements in rows using chained commands.
masm model small .data matr dw 1,2,3 dw 4,5,6 dw 7,8,9 n dw 3 comp dw ? .stack 256 .code main proc assume ds:@data,es:@data mov ax,@data mov ds,ax mov es,ax mov cx,n LO: ; установка si на начало текущей строки mov ax,n sub ax,cx mul n mov bx,ax add bx,bx mov si,matr[bx] ; подсчёт произведения push cx mov cx,n cld mov comp,1 LI: lodsw mul comp mov comp,ax loop LI ; вывод результата mov ax,comp mov bx,10 mov cx,0 L1: xor dx,dx div bx push dx inc cx cmp ax,0 jg L1 mov ah,2h L2: pop dx add dl,30h int 21h loop L2 mov dl,' ' int 21h pop cx loop LO mov ax,4C00h int 21h main endp end main The problem is that as a result, incomprehensible values are displayed, in this case "0 60 0". By testing, we managed to find out that the problem lies only in the part of the code under the comment “counting the work”. It seems like I apply the command correctly and I do all the necessary actions before the cycle, but she does not want to work correctly. Maybe here I will point out my mistake.