I want to sum all diagonal items in answer property, but each current moving item to edx is wrong as it moves not the right one, I assume it's because of 32 bit addressing. I debugged with turbo debugger. Any help will be appreciated.
.386
.model small
.stack 16h
.data
matrix dd 1, 2, 3
dd 4, 5, 6
dd 7, 8, 9
n equ 3
m equ 3
answer dd 0
.code
start:
mov ax, @data
mov ds, ax
mov cx, n
mov ebx, 16
mov esi, 0
zrtik:
mov edx, matrix [esi]
add answer, edx
add esi, ebx
loop zrtik
mov edx, answer
mov ah, 4ch
int 21h
end start