Click here to Skip to main content
15,879,613 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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

	N		dw	6
	nizA	db	8,6,25,50,3
	nizB db 	8 dup(?)
	nizC db	8 dup(?)


main PROC
	mov	si,0	;I
	mov	di,0	;J
	mov	cx,N
	mov	bh,5
	mov	al,nizA[si]
	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				
	inc	si
	cmp	si,cx
	jl	sledeci

	; povratak u OS
main ENDP

END main
Updated 28-May-19 23:22pm

1 solution

We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.

So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900