简体   繁体   English

汇编语言:累加器中的结果

[英]Assembly Language: Result in accumulator

Can someone help me understand this question that I have on a handout. 有人可以帮助我理解我在讲义中遇到的这个问题。 What is the result in Accumulator A of the following code 以下代码在累加器A中的结果是什么

LDAA #$3B ______________

and

ORAA #$23 ______________

I understand that the first one says Load in Accumulator A the hex 3B in immediate mode. 我知道第一个说立即模式下在累加器A中加载十六进制3B。 And the second is to OR in Accumulator A the hex 23 in immediate mode. 第二个是在累加器A中以立即模式对十六进制23进行或运算。 The second one is more confusing because I don't know what to OR it with. 第二个更令人困惑,因为我不知道该如何处理。

Any help would be appreciated! 任何帮助,将不胜感激!

Well, assuming they're sequential instructions, you know what the value of A is before the OR : 好吧,假设它们是顺序指令,那么您知道 A的值在OR之前是什么:

LDAA #$3B --> 3b
ORAA #$23 --> 3b or'ed with 23

If they're not sequential, the answer is simply "whatever A was before but with bits five, one and zero set to 1 (counting bits starting at zero from the least significant end)". 如果它们不是顺序的,则答案很简单:“无论A之前是什么,但将位5,一和零设置为1 (从最低有效端开始,从零开始计数)”。

I think it's probably the former, simply because that voluminous essay I had to write above for the alternative possibility, won't easily fit into the answer area provided :-) 我认为它可能是前者,只是因为大量的文章,我不得不上述写的另一种可能性,不会轻易融入答复区提供:-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM