there is a starting array - 8,6,25,50,3
from that array i need to generate 2 more arrays, one which consist of elements that can be dived by 5, and another array that consist of elements that can be divided by 2.
i need the code for this
What I have tried:
I have to do this for a test, i really need the solution, im short on time, help a friend out :D
.data
N dw 6
nizA db 8,6,25,50,3
nizB db 8 dup(?)
nizC db 8 dup(?)
.code
main PROC
mov si,0 ;I
mov di,0 ;J
mov cx,N
mov bh,5
sledeci:
mov al,nizA[si]
cbw
div bh
cmp ah,0
jne povecajIndeks
; ostatak delenja je 0 pa se element dodaje u niz B
mov al,nizA[si]
mov nizB[di],al
inc di
povecajIndeks:
inc si
cmp si,cx
jl sledeci
; povratak u OS
exit
main ENDP
END main