hello,
I am using EVM8367 now, can somebody tell me how to declare a global variable in assembly code with 56f8367 and this variable can also be used in C ? thank you very much.
Hello
Assembler directives that can be used to create global variables are described in the 56800x_Assembler.pdf manual.
For instance you can define a buffer as follows:
org x: GLOBAL F_S_BUF F_S_BUF DS 12 ; 12-byte buffer
The GLOBAL directive instruct the assembler that the symbol needs to be visible from outside of the assembler module where it is declared. The F prefix is added in front of each global symbol by the compiler and is needed here as you intend to access the variable from ANSI C.
ANSI C declaration and access can be done as follows:
extern char _S_BUF[12]; int main(void) { _S_BUF[1] = 1; /* Your code here */ }
CrasyCat