Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/18/02 11:42
Read: times


 
#19916 - RE: Adding assembly to C. -- Dan Henry
Global register optimization means recompiling the whole project a few times if required and optimizing the register usage.

This optimization moves signed and unsigned char, int, even long variables and pointers from fixed memory locations to registers, which are not altered by the called subfunctions. The result in tighter and faster code.

If for some reason the compiler failed after 10 retries, the global register optimization is disabled. You can check your intermediate linker file M51 for the status of optimization process.

The register coloring status text file is generated with extension 'ORC' (uVision2) or 'REG' (uVision1). There you can check the binary coded register usage (16bit hex number for R0..R7,A,B,PSW,DPH,DPL) for 8051, for 80251 it is a 32bit hex number. If the register is altered, the bit has a value of 1 and if not the bit value is 0 in this hex number.

If you tell the compiler about your asm register usage like this:

$REGUSE _eeprom_crc (R7,R6,R5,R4,A,B,PSW,DPH,DPL)

Then the compiler will use registers R3,R2,R1 and R0 for variables if possible.

For assembly functions (or #asm ... #endasm) functions it has a value of BFFF - this is the worst case - assumption that all registers are altered by your assembly function.

So you can see that it makes no difference for a single source project because the whole optimization can be done in a single step (only one compilatoin), but for multiple source project it makes a difference. Then the whole project is recompiled at least two or three times.

So I can say that Jon Ward is right and also Dan Henry is right.

It makes no sense to continue with posts under this thread and I suggest to close it.

List of 33 messages in thread
TopicAuthorDate
Adding assembly to C.            01/01/70 00:00      
RE: Adding assembly to C.            01/01/70 00:00      
RE: Adding assembly to C.            01/01/70 00:00      
RE: Adding assembly to C.            01/01/70 00:00      
RE: Adding assembly to C, Oleg T:            01/01/70 00:00      
RE: Adding assembly to C.            01/01/70 00:00      
RE: Adding assembly to C.            01/01/70 00:00      
RE: Adding assembly to C.            01/01/70 00:00      
RE: Adding assembly to C.            01/01/70 00:00      
RE: Adding assembly to C.            01/01/70 00:00      
RE: Adding assembly to C.            01/01/70 00:00      
RE: Adding assembly to C.            01/01/70 00:00      
RE: Adding assembly to C.            01/01/70 00:00      
RE: Adding assembly to C.            01/01/70 00:00      
RE: Adding assembly to C.            01/01/70 00:00      
RE: Adding assembly to C.            01/01/70 00:00      
RE: Adding assembly to C.            01/01/70 00:00      
RE: Adding assembly to C.            01/01/70 00:00      
RE: Adding assembly to C - Andy            01/01/70 00:00      
RE: Adding assembly to C. -- J. Guy            01/01/70 00:00      
RE: Adding assembly to C. -- Dan Henry            01/01/70 00:00      
RE: Adding assembly to C. -- Dan Henry            01/01/70 00:00      
RE: Adding assembly to C. -- J. Guy            01/01/70 00:00      
RE: Adding assembly to C. -- Dan Henry            01/01/70 00:00      
RE: Adding assembly to C. -- Dan Henry            01/01/70 00:00      
RE: Adding assembly to C. SRC D.H.Again            01/01/70 00:00      
RE: Adding assembly to C. SRC D.H.Again            01/01/70 00:00      
RE: Adding assembly to C. -- Dan Henry            01/01/70 00:00      
RE: Adding assembly to C. -- Dan Henry            01/01/70 00:00      
RE: Adding assembly to C. -- Dan Henry            01/01/70 00:00      
and another thing...            01/01/70 00:00      
RE: Adding assembly to C.            01/01/70 00:00      
RE: Adding assembly to C - Gopal            01/01/70 00:00      

Back to Subject List