im working on NASM and AFD.exe
i have to multiply the contents of 2 arrays of size 10 and store them in an array named result without using the mul operation. i can only use mov add sub jnz jz in this one. ive tried hard and am close to making the right program but all answers i get on the result memory location are not right in the following program. Please tell me the mistakes thank you,
[org 0x0100]
mov bx,0

l1: mov cx,[arr1+bx]
sub word[arr2+bx],1
add cx,[arr2+bx]
add [res+bx],cx
sub word[arr2+bx],1
add word[arr2+bx],1
jnz l1
add bx,2
jnz l1
mov ax,0x4c00
int 0x21
arr1: dw 1,2,3,4,5,6,7,8,9,10
arr2: dw 1,2,3,4,5,6,7,8,9,10
res: dw 0,0,0,0,0,0,0,0,0,0

How exactly is it supposed to get out of that loop?

And use code tags.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.