Strange link error

General discussion on mikroPascal for dsPIC30/33 and PIC24.
Post Reply
Author
Message
Skydec
Posts: 39
Joined: 30 Jan 2009 12:38

Strange link error

#1 Post by Skydec » 03 Mar 2009 11:18

Strange compiler error

I found a strange compiler error.

I was writing some floating point conversion program and I get a really strange error

First I''l post the code

Code: Select all

function Decode_DEC_spfp(W1,W2:word):real;
var tmpreal: real;
    Expo: dword;
begin
  // Mantissa
  tmpreal := ((((W1 and $007F) shl 16) + W2) / 8388608)+1;
  // Exp
  Expo := (Hi(W1) shl 1)-129;
  //tmpreal := ldexp(tmpreal,(Expo - 129));
  tmpreal := tmpreal * pow (2,Expo);
  // Sign
  if (W1 and $8000) = $8000 then tmpreal := tmpreal * -1;
  result := tmpreal;
end;
It's about this part:

Code: Select all

  
  //tmpreal := ldexp(tmpreal,(Expo - 129));
  tmpreal := tmpreal * pow (2,Expo);

When I use the ldexp line there is no problem.
When I use the pow line I get an error:
0:0 E-0 Linker error: ?9999: label not found

Is this a known problem?

Thanks in advance

Skydec
Posts: 39
Joined: 30 Jan 2009 12:38

#2 Post by Skydec » 03 Mar 2009 12:37

Update:

I managed to get this problem even more easier.

This gets the same error:

Code: Select all


procedure someprocedure;
var a: dword;
      b: real;

begin
  b:=a;
end;

FRM
Posts: 381
Joined: 20 May 2005 18:58
Location: UK

#3 Post by FRM » 04 Mar 2009 16:58


Skydec
Posts: 39
Joined: 30 Jan 2009 12:38

#4 Post by Skydec » 06 Mar 2009 12:32

Ok thanks, I couldn't find this report.

Post Reply

Return to “mikroPascal for dsPIC30/33 and PIC24 General”