Keil Logo

C51: Get Error A45: Using in-Line Assembler

Information in this article applies to:

  • C51 All Versions


I'm trying to reference a global variable using in-line assembler, but when the project builds I get the following error:

.SRC (line) Error A45: UNDEFINED SYMBOL (PASS-2)

The global variable is defined as extern in my header file. What's wrong?


Your C code does not reference that global variable, so the compiler does not add it to the .SRC file when it is built. In these rare cases, you will have to add the external declaration as in-line assembly code for that module as follows:

#pragma asm
  EXTRN DATA (variable_name)
#pragma endasm



Last Reviewed: Thursday, February 25, 2021

Did this article provide the answer you needed?
Not Sure
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

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.