This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

data group use with no reason ?

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

Parents
  • 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.

Reply
  • 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.

Children