-
-
Intel汇编学习中求助
-
发表于:
2010-8-9 09:15
3767
-
小弟近来在学习Intel汇编程序设计遇见一个问题:考虑之后,没有正确的答案写下来 求教各位大侠,小弟不胜感激:
代码如下:
TITLE Integer Summation Program
INCLUDE Irvine32.inc
EXTREN PromptForInteger@0:PROC
EXTREN ArraySum@0:PROC,Display Sum@0:PROC
ArraySum EQU ArraySum@0
PromptForIntegers EQU PromptForIntegers@0
Display EQU DisplaySum@0
Count=3;
.data
Prompt1 BYTE "Enter a signed integer:",0
Prompt2 BYTE "The sum of the integer",0
array DWORD Count Dup(?)
sum DWORD ?
.code
main PROC
call clrscr
;promptForIntegers(addr prompt1,addr array,Count)
push Count
push OFFSET array
push OFFSET Propt1
call PromptForIntegers
;sum=AaarySum(addr array,Count)
push Count
push OFFSET array
call ArraySum
mov sum, eax
;DisplaySum(addr prompt2,sum)
push sum
push OFFSET Prompt2
call DisplaySum
call crlf
exit
main ENDP
ENDP main
我的问题有两个:
第一:Count 应该是作为输入的整数的个数。但是在上面的代码中我并没有看见有关Count声明为何类型啊,只有Count=3,请教高手们这是什么意思!
第二:EXTREN PromptForInteger@0:PROC中为啥为0,书上在讲述EXTREN中这样说国@n,n为
函数的参数个人*4,显然三个过程模块均不为0,这里为啥为零呢?
小弟的问题可能比较幼稚,希望能得到大家的帮助谢谢!
[课程]Android-CTF解题方法汇总!