FPU problem urgent

Khairul Nizam <[email protected]>
Newsgroups gmane.comp.hardware.motorola.microcontrollers
Message-ID <[email protected]>
hi there
 
I am very new with MPC555 and now I am trying to use the FPU to perform some simple arithmaatic operation....,now I am having problem with it,I have stuck with it for 1 week......please help me...
 
 the problem is...
1.the debugger hang/cannot step over to the next instruction,it stop at the last floating point operation.
2.if I remove the other floating point operation,meaning that only 1 floating point operation done,the debugger runs ok.
3.If i check the mixed assembler and source created by CW...they show me this(the insructions below)...it seems to me that the invalid opcode have been included by the compiler....
 
 
please,hope someone can help me with this,because I am planning to use FPU for bigger task.I am using CW6.6 and Abaltron BDI2000 debugger.Thanks
 
 ordinate=(AtoD*table_x)/(float)max_AtoD; //even spacing between adc value:need further study
003FA004: 00000000  dc.l     0x00000000               ; Invalid opcode '....'
003FA008: 3C800040  lis      r4,64
003FA00C: DBE10028  stfd     fp31,40(SP)
003FA010: 38A4A2A0  subi     r5,r4,23904
003FA014: C8650000  lfd      fp3,0(r5)
003FA018: 93E10024  stw      r31,36(SP)
003FA01C: 3BE00000  li       r31,0
003FA020: 93C10020  stw      r30,32(SP)
003FA024: 3BC00068  li       r30,104
003FA028: 93A1001C  stw      r29,28(SP)
003FA02C: 3BA0000A  li       r29,10
003FA030: 7C1EE9D6  mullw    r0,r30,r29
003FA034: 93810018  stw      r28,24(SP)
003FA038: 90610008  stw      r3,8(SP)
003FA03C: 9001000C  stw      r0,12(SP)
003FA040: 3B800400  li       r28,1024
 
///////////////////////////////////////////////the real code////////////////////////////////////////
 void main()
{
 
 float ordinate;
 unsigned int AtoD,i=0;
 unsigned int table_x;
 unsigned int max_AtoD;
 //unsigned int ordinate_less;
 
 
 AtoD=104;
 table_x=10;
 max_AtoD=1024;
 
  
 ordinate=(AtoD*table_x)/(float)max_AtoD; 
  
if (ordinate>(float)0) 
i=1;
else
i=0;
 
 while (1) { i++; }   // loop forever
}




		
---------------------------------
Yahoo! Mail
 Stay connected, organized, and protected. Take the tour

[Non-text portions of this message have been removed]



-----------------------------------------------------------
To learn more about Freescale Microcontrollers, please visit
http://www.freescale.com/mcu


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/MPC500/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.