博客
关于我
汇编语言程序,求出这两个数组中数据的个数
阅读量:367 次
发布时间:2019-03-04

本文共 681 字,大约阅读时间需要 2 分钟。

问题描述 

试编写一完整的汇编语言程序,将一个包含有10个数据的数组M分成两个数组:正数数组P和负数数组N,并分别求出这两个数组中数据的个数。

 

 源代码

data segment	m dw 1,-3,32,4,31,42,-53,53,-12,34;原数组	p dw 10 dup(?)	;正数数组	n dw 10 dup(?)	;负数数组	countp db 30h	;存放正数个数	countn db 30h	;存放负数个数data ends code segment 	assume cs:code,ds:datastart:        mov ax,data        mov ds,ax        mov cx,10		xor bx,bx			xor si,si		xor di,di	s:	mov ax,m[bx]		cmp ax,0		jge s1		;判断数的正负		mov n[si],ax		add si,2		add countn,1		jmp next	s1:	mov p[di],ax		add di,2		add countp,1	next: add bx,2		loop s				mov ah,2		mov dl,countp	;显示正数个数		int 21h				mov ah,2		mov dl,20h  ;显示空格		int 21h		mov ah,2		mov dl,countn	;显示负数个数		int 21h		mov ax,4c00h		int 21hcode ends        end start

 

转载地址:http://ctyg.baihongyu.com/

你可能感兴趣的文章
NN&DL4.8 What does this have to do with the brain?
查看>>
nnU-Net 终极指南
查看>>
No 'Access-Control-Allow-Origin' header is present on the requested resource.
查看>>
No 'Access-Control-Allow-Origin' header is present on the requested resource.
查看>>
NO 157 去掉禅道访问地址中的zentao
查看>>
no available service ‘default‘ found, please make sure registry config corre seata
查看>>
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
查看>>
no connection could be made because the target machine actively refused it.问题解决
查看>>
No Datastore Session bound to thread, and configuration does not allow creation of non-transactional
查看>>
No fallbackFactory instance of type class com.ruoyi---SpringCloud Alibaba_若依微服务框架改造---工作笔记005
查看>>
No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalanc
查看>>
No mapping found for HTTP request with URI [/...] in DispatcherServlet with name ...的解决方法
查看>>
No mapping found for HTTP request with URI [/logout.do] in DispatcherServlet with name 'springmvc'
查看>>
No module named 'crispy_forms'等使用pycharm开发
查看>>
No module named 'pandads'
查看>>
No module named cv2
查看>>
No module named tensorboard.main在安装tensorboardX的时候遇到的问题
查看>>
No module named ‘MySQLdb‘错误解决No module named ‘MySQLdb‘错误解决
查看>>
No new migrations found. Your system is up-to-date.
查看>>
No qualifying bean of type XXX found for dependency XXX.
查看>>