|
|||||||||||
|
Technical Support On-Line Manuals Cx51 User's Guide |
Global VariablesGlobal variables you create in your C programs are stored in the memory area specified or in the default memory area implied by the memory model. The assembly label for the variable is the variable name. For example, for the following global variables: unsigned int bob; unsigned char jim; the compiler generates the following assembler code:
?DT?MAIN SEGMENT DATA
PUBLIC jim
PUBLIC bob
RSEG ?DT?MAIN
bob: DS 2
jim: DS 1
; unsigned int bob;
; unsigned char jim;
To access these variables in assembler, you must create an extern declaration that matches the original declaration. For example: EXTERN DATA(jim) If you use in-line assembler, you may simply use C extern variable declarations to generate the assembler EXTERN declarations. You may access global variables in assembler using their label names. For example: MOV A,jim Note
| ||||||||||
|
|||||||||||
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.