|
|||||||||||
Technical Support Support Resources
Product Information |
A51: Error 22 (Expression Type Does Not Match Instruction)Information in this article applies to:
QUESTIONI'm porting an existing assembler program from another vendor's tools to the Keil A51 Assembler. For example, the following instructions:
generate the following error message:
What must I do to port this code? ANSWERThe original Intel 8051 documentation makes a clear distinction between the accumulator register (A) and the accumulator SFR (ACC). Both allow you to change the accumulator, however, only the SFR may be used with some instructions. The instructions you list take a direct memory address (or SFR) as their targets. So, to access the accumulator with these instructions, you must provide the address of the accumulator SFR instead of the A (accumulator) register. ACC is the mnemonic to use for the accumulator SFR. Make the following changes to port your program:
Note that ACC and A both refer to the accumulator, but ACC allows you to supply the SFR address to those assembler instructions that require a direct memory address. MORE INFORMATION
Last Reviewed: Thursday, February 25, 2021 | ||||||||||
|
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.