汇编代码(MASM) - 数组 [英] Assembly code (MASM)- arrays

查看:552
本文介绍了汇编代码(MASM) - 数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个起始数组 - 来自该数组的8,6,25,50,3



我需要再生成2个数组,其中一个由元素组成可以被5个潜入,另一个数组由可以除以2的元素组成。



i需要这个代码



我尝试了什么:



我必须为测试做这个,我真的需要解决方案,我很短的时间,帮助一个朋友:D



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

推荐答案

我们是非常愿意帮助那些陷入困境的人:但这并不意味着我们在这里为你们所做的一切!我们不能做所有的工作,你要么得到报酬,要么是你的成绩的一部分,我们为你做这一切都不公平。



所以我们需要你做这项工作,当你遇到困难时我们会帮助你。这并不意味着我们会为您提供一步一步的解决方案!

首先解释您目前的位置,以及流程的下一步是什么。然后告诉我们你试图让下一步工作,以及你做了什么时发生了什么。
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.


这篇关于汇编代码(MASM) - 数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆