计算1+2+……n=?,其中n通过键盘输入.要求用汇编语言中的循环程序设计来实现.

计算1+2+……n=?,其中n通过键盘输入.要求用汇编语言中的循环程序设计来实现.

题目
计算1+2+……n=?,其中n通过键盘输入.要求用汇编语言中的循环程序设计来实现.
要求在屏幕上提供如下信息:
Please input a number(1350):100 ;出现此信息后通过
\x05键盘输入一个小于628的无符号整数
The sum is:5050
答案
;1to100
include io32.inc
.data
msg1 byte 'Please input a number(1350):',0
msg2 byte 'This sum is:',0
.code
start:
mov eax,offset msg1
call dispmsg
call readsid
mov ecx,eax
mov eax,0
again:add eax,ecx
loop again
push eax
mov eax,offset msg2
call dispmsg
pop eax
call dispsid
exit 0
end start
举一反三
已知函数f(x)=x,g(x)=alnx,a∈R.若曲线y=f(x)与曲线y=g(x)相交,且在交点处有相同的切线,求a的值和该切线方程.
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
最新试题
热门考点

超级试练试题库

© 2017-2019 超级试练试题库,All Rights Reserved.