接着问,请问怎么对地址做减法

Viskag 2010-07-23 12:00:18
int width = 4*4;
byte* inPtr(该指针前面有48个byte,后面是16个byte)
......
__asm
{
mov esi, inPtr
mov eax, width
movdqu xmm1, [esi-eax]
}
原来的代码是movdqu xmm1,[esi+eax],但是现在inPtr指向的源数据顺序反了,拷贝16byte后,要前移16,于是我就把esi+eax改成了esi-eax,报错error C2425: '-' : non-constant expression in 'second operand',搜索了一下:
The complex addressing modes do not allow the subtraction of the index, its still a BASE address plus the INDEX then any displacement after as a constant. The real problem is there is no opcode to do this task.
这个看不懂,如果我想用减应该怎么写?
...全文
69 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
zara 2010-07-23
  • 打赏
  • 举报
回复
将 eax 先取反下了:(寻址时,地址都是相加的)
__asm
{
mov esi, inPtr
mov eax, width
neg eax
movdqu xmm1, [esi+eax]
}
Viskag 2010-07-23
  • 打赏
  • 举报
回复
厉害~

21,458

社区成员

发帖
与我相关
我的任务
社区描述
汇编语言(Assembly Language)是任何一种用于电子计算机、微处理器、微控制器或其他可编程器件的低级语言,亦称为符号语言。
社区管理员
  • 汇编语言
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧