title: 8086 program for calculating multiplication of two matrices doesn't work
body: <p>i think my code has to be run correctly (it seems logical), but in the last loop the decrement instruction doesn't work and the program enters into a infinite loop.
  here is my code:</p>
  
  <pre><code>; multi-segment executable file template.
  
  data segment
  matrix1 db 1,2,3,4,5,6,7,8,9
  matrix2 db 1,2,3,4,5,6,7,8,9
  n dw 3
  row db 3
  column dw 3
  n2 db 9
  result db 100 dup(0)
  counter dw 3
  
  
  ends
  
  stack segment
  dw   128  dup(0)
  ends
  
  code segment
  start:
  ; set segment registers:
  mov ax, data
  mov ds, ax
  mov es, ax
  
  
  mov bx,offset matrix1
  mov bp,offset result
  
  
  sub bx,n
  dec bx    
  push bx
  
  
  new_row:
  
  mov di,offset matrix2 
  dec di 
  pop bx   
  add bx,n
  inc bx
  dec bp    
  mov cx,n
  mov counter,cx    ;counter checks if th columns are over for a raw
  
  
  each_row:
  inc bp
  push bx
  
  inc di
  dec counter 
  je -1,new_row
  
  col:    
  mov ah,[bx]
  mov al,[di]
  mul ah
  
  add [bp],al       
  inc bx
  add di,n    
  dec column  ;this is where the dec instruction stops working       
  jnz col    
  mov cx,n
  mov column,cx   
  pop bx    
  dec row
  jnz each_row
  
  
  mov ax, 4c00h ; exit to operating system.
  int 21h    
  ends
  
  end start ; set entry point and stop the assembler.
  </code></pre>