小编Pro*_*oto的帖子

x86程序集初学者:程序无法正确循环?

以下程序的目标是接受来自用户输入的最多10个带符号的8字节浮点数(-100≤X≤100)并将它们存储到数组中.使用ReadFloat Irvine方法接收用户输入.如果输入该范围之外的数字,则子程序应该停止执行并通过eax返回当前数组中的值的数量.这只是用来描述程序应该做什么的一些上下文.我对此代码的问题是它在接受第一个值后没有正确循环.我进行了设置,以便检查输入数字是否在L1中高于或等于-100,然后在L2中低于或等于100.如果数字超出该范围,则子程序应停止执行,但如果它在该范围内,则应进入L3和R1.在L3和R1中,数字被放入SFPArray中的索引中,如果数组中的值少于10,则程序应无条件地跳回L1以进行进一步的迭代.R1中的JMP命令是问题所在.在输入单个数字后,当前状态的子程序将停止执行,我无法弄清楚原因.有人可以提供帮助吗?

INCLUDE    c:\irvine\irvine32.inc
INCLUDELIB c:\irvine\irvine32.lib
INCLUDELIB c:\masm32\lib\user32.lib
INCLUDELIB c:\masm32\lib\kernel32.lib


.data
theSFPArray REAL8 10 dup(?)             ;an array that can store up to 10 signed floating point numbers
tempStoreFP REAL8 ?                     ;this variable will temporarily store the FP number acquired from user input, and then push it onto the stack
lengthOfSFPArray DWORD ?                ;this variable will store the length of theSFPArray. This value will be used to determine if requestSignedFloats should stop looping.
inputLoopCounter DWORD -1               ;used to determine when the …
Run Code Online (Sandbox Code Playgroud)

x86 assembly masm32 irvine32

3
推荐指数
1
解决办法
156
查看次数

标签 统计

assembly ×1

irvine32 ×1

masm32 ×1

x86 ×1