x86汇编极限新手查询:“无效指令操作数"? [英] x86 assembly extreme novice inquiry: "invalid instruction operands"?

查看:33
本文介绍了x86汇编极限新手查询:“无效指令操作数"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面的代码只是我目前正在尝试编写的程序的一小部分,但程序的其他部分没有相关性,所以我只粘贴了必要的部分.无论如何,我想要做的是将 inputLoopCounter 中存储的值移动到 ecx 中,以确定循环应该执行多少次.但是,当我尝试组装这个程序时,我收到了问题标题中提到的错误.有人能解释一下原因吗?

.datainputLoopCounter BYTE -1.代码mov ecx,inputLoopCounter

解决方案

一种可能的解决方案是将 inputLoopCounter BYTE -1 替换为 inputLoopCounter DWORD -1.>

The code below is only a small fraction of the program I am currently attempting to write, but no other parts of the program are relevant, so I only pasted what was necessary. Anyway, what I am trying to do is move the value stored within inputLoopCounter into ecx in order to determine how many times a loop should execute. However, when I attempt to assemble this program, I get the error mentioned in the question title. Can anybody explain the reason for this?

.data
inputLoopCounter BYTE -1

.code
mov   ecx,inputLoopCounter

解决方案

One possible solution would be to replace inputLoopCounter BYTE -1 by inputLoopCounter DWORD -1.

这篇关于x86汇编极限新手查询:“无效指令操作数"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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