“mov (%ebx,%eax,4),%eax"如何处理?工作? [英] How does "mov (%ebx,%eax,4),%eax" work?

查看:31
本文介绍了“mov (%ebx,%eax,4),%eax"如何处理?工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一直从事装配作业,并且在大多数情况下,我对装配非常了解.或者至少对于这项任务来说足够好.但是这个 mov 声明让我很不舒服.如果有人能解释一下这个 mov 语句是如何操作寄存器值的,我将不胜感激.

Been working on an assembly assignment, and for the most part I understand assembly pretty well. Or well at least well enough for this assignment. But this mov statement is tripping me up. I would really appreciate if someone could just explain how this mov statement is manipulating the register values.

mov (%ebx,%eax,4),%eax

mov (%ebx,%eax,4),%eax

附言我无法通过基本搜索找到这种特定类型的 mov 语句,因此如果我错过了它并重新提问,我深表歉意.

P.S. I wasnt able to find this specific type of mov statement by basic searches, so I appologize if I just missed it and am re asking questions.

推荐答案

AT&T程序集中完整的内存寻址模式格式为:

The complete memory addressing mode format in AT&T assembly is:

offset(base, index, width)

所以对于你的情况:

offset = 0
base = ebx
index = eax
width = 4

意思是指令是这样的:

eax = *(uint32_t *)((uint8_t *)ebx + eax * 4 + 0)

在类似 C 的伪代码中.

In a C-like pseudocode.

这篇关于“mov (%ebx,%eax,4),%eax"如何处理?工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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