avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] big .hex file - explanation please?


From: Kelly McDonald
Subject: [avr-gcc-list] big .hex file - explanation please?
Date: Wed, 11 Aug 2004 21:08:05 -0400

Hello list,

I made a mistake in the code below, which generated a rather large (16k)
hex file. I fixed the problem (x++ instead of a++) and the size of the
hex file went back to about 1.6k which is what I expected.

I"m linking in lcd.o and -lm and it's an atmega8.

I'm guessing that much of the libm.a stuff didn't get weeded out in the
link, but I'm at a loss for why. Any good explanations?

btw I am a n00b w/ avr, but have done a few PIC projects.  (these AVR's
rock especially w/ gcc!!)

Thanks,
Kelly

#include <math.h>
#include "lcd.h"


int main(void) {
  uint64_t outcode;
  uint64_t z; 
  uint64_t y;
  uint64_t x;
  uint64_t fout;
  int a;
  int me;
  fout = 7040000;
  y = 100000000;
  z = pow(2,32);
  x = z*fout;
  outcode = x/y;
  for (a=0; a< 32; x++)
   {
      me  = outcode && 0x1;
      outcode = outcode >> 1;
   }
  return 0;
}

-- 
Kelly McDonald <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]