AnsweredAssumed Answered

float point type cast. JSR   _PACK_K_to_k_Unary; hangs

Question asked by Vlad Patoka on Apr 18, 2012
Latest reply on Apr 19, 2012 by Vlad Patoka

Hello,

 

I am using CW 10.2 to program JM60. In my project I need operations with float points.

For some uncertain reason, the type cast operation with float point types hangs within _FSFLOAT subrotine. Its works smooth till it reach JSR   _PACK_K_to_k_Unary; instruction. As far as I understood its exit from that subrotine.

 

Here is part of my code (functional):

 

double si_c11x1;

signed int TempCntdec, PressCntdec;

 

main ()

{

// This type cast works perfectly fine

PressCntdec = (signed int) (out[0] <<8 | out[1]);

TempCntdec = (signed int) (out[2] <<8 | out[3]);

 

// This type cast hangs

si_c11x1 = ((double) PressCntdec);

/-------------------------------------------------------

}

 

s1_c11x1 and PressCntdec declared as external variables with type "double". I even put them to MY_ZEROPAGE segment using #pragma.

But still no luck with this. Same behaviour if I am try to do any operations like multiplication or division. Example:

s1_c11x1 = PressCntdec/64.0;

 

Doesn anybody have a clue what is wrong with it ? I am using Small memory model. I tried to play with stack size (no luck). I diid check and ansifs.lib has assigned to the project.

 

Regards,

Vlad

Outcomes