更多汇编语言乘法
我对如何处理汇编乘法感到困惑。我正在解决一些如下描述的问题:
Given these hex values for the 8086 registers
AX = E204 BX = 30C2 CX = 5C08 DX = 38F1
What are the hex values in DX and AX after executing this instruction:
mul cl
对于 mul 运算,我们是否只使用 al 和乘数进行相乘?例如,这个乘法是否只是 4 * 8 = 32(十进制),结果存储在 ax 中?
当使用imul时,我们会将ax中的整个值与乘数相乘,然后将结果存储在dx:ax中,对吗?
对于这个问题,如果我确实以正确的方式处理它,al * cl = 4 * 8 = 32。那么:
al = 20
我保留啊吗? > 相同(E2)还是我将其归零以获得答案?
I am confused about how to handle assembly multiplication. I am working on a few problems described like so:
Given these hex values for the 8086 registers
AX = E204 BX = 30C2 CX = 5C08 DX = 38F1
What are the hex values in DX and AX after executing this instruction:
mul cl
For mul operations, are we only multiplying using al and the multiplier? For example, would this multiplication simply be 4 * 8 = 32 (decimal) with the result stored in ax?
When imul is used, then we would multiply the entire value in ax and the multiplier and then store the results in dx:ax, correct?
For this problem, if I am indeed approaching it the right way, al * cl = 4 * 8 = 32. Then:
al = 20
Do I keep ah the same (E2) or do I zero it out for the answer?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请从 此处。
有关这一指令的详细信息,您可以阅读此处。
Please download complete Intel x86 CPU documentation from here.
For details on just this one instruction you can read here.
你为什么不尝试?没关系,我是为你做的:
Why didn't you try? Never mind, I did it for you: