Compiling a CCS (ver 4.099) project for 18F85J90 and looking into the MPLAB disassembly listings shows that printf (and other functions) code appears as many times as it's called in the code. This occupies a lot of code space.
Is there anyway to avoid this (just call the function address in the code-space)?
Regards,
Gil _________________ Gil F.
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
Posted: Thu Dec 27, 2012 1:20 pm
You are most likely seeing CCS automatic #inline optimization based on your program having an overall small amount of object code.
This is normal behavior and makes your program execution be as fast as possible - since remote function/procedure calls take many more machine cycles than this in lining, and WORSE potentially cause excessive stack nesting failure in runtime. ( newer compiler versions I think do profile for this last problem in the call tree - but not dead sure ).
I urge you to read the CCS manual re:
#INLINE and
#SEPARATE
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum