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.
I add and call 2 assembler routines defined in C as void rtn (void) to a C program After being surprised I rewrite the assembler routines as rtn: ret I get the following linker error: *** ERROR 107: ADDRESS SPACE OVERFLOW SPACE: DATA SEGMENT: _DATA_GROUP_ LENGTH: 002AH I know what the message means and can possibly salvage some data space elsewhere BUT: what are those data segment bytes and is there any way to get rid of this (non)use of valuable space ? Erik Malund
If a function calls an assembly language routine, the C compiler must assume that all the registers are potentially overwritten. Consequently, in the calling function there will be less fredom to allocate variables to registers - they have to be put into memory instead. That may be why the addition of a zero-functionallity assembler routine causes the overall application to use more data memory that before. If you are using global register optimisation, then I belive that there is a method of telling the compiler about which registers are used by an assembly language routine - see the REGUSE keyword in the A51 Assembler manual. I have never tried this myself.
REGUSE () makes no difference and the assembler code generated by the C compiler is identical, what is going on ? Erik