汇编语言编程内存分配EAX VS AX,AH,AL [英] Assembly programming memory Allocating EAX vs Ax, AH, AL

查看:540
本文介绍了汇编语言编程内存分配EAX VS AX,AH,AL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的组装寄存器的理解说,每个寄存器可以通过整个32位code进行访问,它被分成多个访问寄存器。在这个例子中 EAX 是一个32位的寄存器,如果我们调用 AX 它应该返回的前16位,如果我们称之为 AH AL 应该在16位和 AL后返回接下来的8位应返回的最后8位。

My understanding of assembly registers say that each register can be accessed by the entire 32 bit code and it is broken into multiple accessible registers. In this example EAX being a 32 bit register, if we call AX it should return the first 16 bits, and if we call AH or AL it should return the next 8 bits after the 16 bits and AL should return the last 8 bits.

所以我的问题,因为我不真的相信这是它是如何运作的。如果我们存储七个32位值...又名 EAX 存储

So my question, because I don't truly believe is this is how it operates. If we store a 32 bit value of seven... aka EAX storing

0000 0000 0000 0000 0000 0000 0000 0111

所以,如果我们称之为 AX 它应该返回

0000 0000 0000 0000

如果我们称之为 AH 它应该返回

if we call AH it should return

0000 0000

当我们调用 AL 它应该返回

0000 0111

这是正确的?如果它是什么样的价值呢调用 AH 真正为?

推荐答案

没有,这是不完全正确。

No, that's not quite right.

EAX is the full 32-bit value
AX is the lower 16-bits
AL is the lower 8 bits
AH is the bits 8 through 15 (zero-based)

这篇关于汇编语言编程内存分配EAX VS AX,AH,AL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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