On Fri, 2013-02-08 at 10:04 -0600, Erik Petrich wrote:
> I'd suggest using :
> 
> #define bd4800 (256 - crystal / (192L * 4800))

This is what I have in the header file now. And I looked at the
.lst file for the results which are as I expect them to be.
(I only needed to add the "L")


> The #define performs no math; it just defines text for substitution.

I know that, just did not know how to correctly express myself when
trying to explain the problem I was facing.


> When 
> the substituted text is evaluated by the next stage of the compiler you 
> need to be aware of the scale of the intermediate results and make sure 
> they will fit within the C specified promoted type (which may not be 
> sufficiently promoted automatically).

And because I did not know the scale (16 bit signed) of the result
I was having problems making things work.

Any way, thank you all for the help.
Much appreciated.

roelof



------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to