Go Down

Topic: Code size difference (Read 951 times) previous topic - next topic


These 2 bits of code toggles an output, but code 1 is 68 bytes smaller than code 2 when compiled.

Why is there so much difference ?


Code 1 (smaller):
void  HeartBeat(void)  
 static byte state;      // private variable declared
 if (state>0)  {  
   state= 0;
 else  {  
   state= 1;

Code 2 (bigger):
void  HeartBeat(void)  
 static boolean state;      // private variable declared here
 state=!state;                   //toggle output state



Okay, I guess I should look at the assembly listing as well.


Spoke to soon.
When I press shift and click compile, all it does is compile normally.
I cannot see any assembly code

Any suggestions ?

Using Arduino V1 on Ubuntu


Prior to 1.0, holding the shift key triggered verbose output. Now, it is a setting on the preferences panel.
The art of getting good answers lies in asking good questions.


Okay, changed the setting in preferences to show verbose output during compilation.
But I can only see object files, which I cannot read with my editor

Hmm, any suggestions ?



"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.


Aug 26, 2012, 10:40 am Last Edit: Aug 26, 2012, 10:45 am by fiddler Reason: 1
Didn't know that Linux came with a built in disassembler :-)
Command line only, tho. More stuff to remember.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131