Can I reduce the float point precision in Keil to reduce my code size? Thank you.
If you want to reduce code size, don't use floating point! Try fixed-point instead!
I'm using AT89S8252 with 2K of EEPROM and would like to know if I can use it in my program and Can I reduce the float point precision in Keil to reduce my code size? You ask very basic questions, I think it is time for you to go through the "getting started" manual. Also, you need to study "the bible", that will answer the EEPROM question. This is not an attempt to avoid answering, it is a favour, reading both will be of immense value to you. One final note: FORGET what you have learned about C "practice". Based on your questions I almost suspect the next one will be on malloc. The '51 is NOT a PC, and different techniques apply. Erik here are the links to "the bible" Chapter 1 http://www.semiconductors.philips.com/acrobat/various/80C51_FAM_ARCH_1.pdf chapter 2 http://www.semiconductors.philips.com/acrobat/various/80C51_FAM_PROG_GUIDE_1.pdf chapter 3 http://www.semiconductors.philips.com/acrobat/various/80C51_FAM_HARDWARE_1.pdf
Is there a fixed-point type? Sorry for thebasic question but I searched and didn't find any topic about this. I tried to work with float because I need to calculate trigonometris functions. Thank you.
Is there a fixed-point type I desperately hope that this is a language problem (with english NOT with C) a = b*c; //fixed point multuplication Erik
And I less desperately hope that you aren't so impolite in your social live. If you can't answear as a normal person you better stay quite.
fixed point is a concept not a type. example instead of 1.00 dollars use 100 cents as an unsigend int 25.0 degres would be 250 as an int. To answer your 1st question. yes you can change the rounding. No that will not save a single byte of RAM or ROM.
Yes, you can save program space and time by using fixed point variables and by using approximations that are just good enough for what you want to achieve. See this PDF: http://www.ganssle.com/approx/approx.pdf And these sites: http://www2.norwich.edu/frey/TaylorPolynomials/ http://www.math.wpi.edu/Course_Materials/Calc3/Labs/node3.html http://math.fullerton.edu/mathews/a2001/Animations/Interpolation/Pade/Pade.html http://www.dspguru.com/comp.dsp/tricks/alg/sincos.htm And you will probably find more if you go searching. The problem with fixed point and approximations is that a good deal more thought and care is required. There is a lot more to go wrong! HOwever, this approach can pay handsome dividends.
"The problem with fixed point and approximations is that a good deal more thought and care is required" Actually, that's a general principle of writing high-performance and/or compact code! Any fool can just jump in and lash-up something, but it takes thought and care to get optimum results! An essential part of that thought and care is, of course, gaining a thorough understanding of the language, the tools, and the processor architecture - none of which is possible without reading the Manuals and the Datasheets!