x86 Assembly Memory-“添加"功能是什么?指令吗? [英] x86 Assembly Memory - What does the "add" instruction do?

查看:80
本文介绍了x86 Assembly Memory-“添加"功能是什么?指令吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面的内存段.

在第一个添加指令(添加eax,3)上,它将eax的指针向右移动3个点.

On the first add instruction (add eax, 3), it moves the pointer for eax 3 spots to the right.

因此,EAX = 12、17,A3、00.(我了解)

Thus, EAX = 12, 17, A3, 00. (This I understand)

但是,在第二个加法指令(add ebx,5)上,它实际上将值5加到ebx,

But, on the second add instruction (add ebx, 5), it actually adds the value 5 to ebx,

使EBX = 12、17,A3, 05 .

making EBX = 12, 17, A3, 05.

那是为什么?

(小尾数法)

推荐答案

'add reg,(something)'将值添加到寄存器句点.您所看到的区别是寄存器的使用方式.

'add reg, (something)' adds that value to the register, period. The difference you are seeing is how you are using the registers.

在执行'mov ebx,[eax]'时,您将eax中的值用作指针,因为您要用方括号取消引用.

As you are doing 'mov ebx,[eax]' you are using the value in eax as a pointer, because you are de-referencing it with the square brackets.

这篇关于x86 Assembly Memory-“添加"功能是什么?指令吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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