简体   繁体   中英

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

LDAA #$3B ______________

and

ORAA #$23 ______________

I understand that the first one says Load in Accumulator A the hex 3B in immediate mode. And the second is to OR in Accumulator A the hex 23 in immediate mode. 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 :

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)".

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 :-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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