On Thu, 12 Nov 2009, Gordon Henderson wrote:

> I'll give it a go and let you know :)

So a while back, I asked about interrupts, etc. and now I'm letting you 
know what happened...

I see data corruption )-:

Specifically during compiler generated calls to _mullong although I 
haven't tried any others yet.

If I execute some code during the interrupt that has generated _mullong 
calls in it while doing code that also calls _mullong in the main task, 
then the result of the main task operations is corrupted.

This code fragment: (I've removed the boring printing bits, and it gets 
called with a fixed value of 437, else it gets optimised out!)

void mathTest (uint16_t x)
{
   uint32_t y ;
   uint32_t i = 0 ;

   for (;;)
   {

     y = (uint32_t)x * 9668 + 500 ;
     if (y != 4225416L)
     {
       serialPuts ("Curruption @ ") ;
        ...
     }
     ++i ;

   }

works fine with interrupts off, or with the math code in the interrupt 
routine commented out, but sees random coruptions with them on:

Curruption @     9912:     4744
Curruption @    10761: 07279990 (Don't wory that this starts with 0..
Curruption @    15990:    25649
Curruption @    18438: 03028533 ... the field width isn't big enough)
Curruption @    19994:    17266

and so on.

That's the first I've noticed int and I've not even dived into floating 
point land yet...

So calling functions, manipulating data in my own code, etc. seems 
relatively well behaved, but the internal stuff not so...

Any thoughts, anyone?

Thanks,

Gordon

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to