use16 org 100h jmp start ;----------------------------------------------------- n db 4 m db 5 table: dw 12,45, 0,82,34 dw 46,-5,87,11,56 dw 35,21,77,90,-9 dw 44,13,-1,99,32 sum rw 4 ;----------------------------------------------------- start: movzx dx,[n] mov dx,table mov dx,sum xor dx,dx rows: xor ax,ax push cx movzx cx,[m] calc_sum add ax,[bx+si] add dx,2 loop calc_sum pop cx mov [cs],ax add dx,2 loop rows mov ax,4C00h int 21h