问题
I am doing a practice exam question.
The Question is
Is there anything wrong in this line of LC3 code? (The starred line)
ADD R3, R3, 0;
**BRNZ ISPOS;**
HALT
.BLKW 250
ISPOS NOT R3, R3 ....
I saw that the starred line is Branch and the condition codes are negative and zero, basically go to label ISPOS if the condition code is negative or zero or halt the program otherwise.
I would say that this line of LC3 code has nothing wrong with it. Does anyone see any problems with it?
回答1:
Yes, there are a couple different errors with this code segment.
Opcodes cannot have anything other than a label preceding them.
**BRNZ ISPOS;**
Must become:
BRNZ ISPOS;**
You cannot have any random characters after operands, unless they are commented out
ISPOS NOT R3, R3 ....
Must change to:
ISPOS NOT R3, R3 ;....
来源:https://stackoverflow.com/questions/30179798/what-is-wrong-with-this-line-of-lc3-code