We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
In ASM51, the following code is every useful:
-------- file1.asm --------- public MAX MAX EQU 10 -------- file2.asm --------- extrn number(MAX) MOV A,#MAX
-------- file2.C ----------- extern code MAX; #define MAX_NUMBER ((unsigned char)&MAX)
"One year has passed but nobody give me a good answer." Well, I'm sorry - I didn't realise I was supposed to drop everything and concentrate on your problem! Anyway, think about what the Linker does: it deals with addresses - you define a symbol in 'C', and the Linker fixes its address. Therefore, if you want the Linker to give a constant back to 'C', it will be as the address of a 'C' symbol. Your 'C' code will have to take the address of the symbol, and interpret that address value as the required constant (probably via a cast).