Hello,
I want to split my assembler program into two files (main file + function file).
How can I do that?
With:
main.a51 $INCLUDE “func.a51“ END
at the end of the main program, I get the message:
FILE: FUNC.A51
ERROR: FILE DOES NOT EXIT
and without: $INCLUDE “func.a51“ the functions in “func.a51“ are not found in the main program.
KEIL-C Version: 9.60.7.0
Kind Regards
Juergen
You're using a wrong syntax, try $INCLUDE (func.a51) instead, see:https://developer.arm.com/documentation/101655/0961/Ax51-User-s-Guide/Assembling-Programs/Directives/Reference/INCLUDE-Assembler-Directive
BTW: Did you think about adding the file as a separate translation unit instead of including it? If the included file contains real functions that you're CALLing, this is the more correct way.
Hello Rene Koenig,
thank you for the answer.
It works with “$INCLUDE (func.a51)”, but then I have the problem that the hex code is not generated because the code limit is exceeded with my version (*** WARNING L5: CODE SPACE MEMORY OVERLAP).
I was able to generate the hex code with the original program (main + func together).
The reference to the separate translation could help me.
Unfortunately, I don't know how that works at the moment.
Could you give me a hint about that?
I have now created the LIB file “func.LIB” from the file “func.a51”.
How can I now create the hex code from the file “main.a51” and the file “func.liB”?