TestBit BUG

Discuss about beta versions of mikroPascal compiler.
Post Reply
Author
Message
yo2lio
Posts: 1878
Joined: 19 Sep 2006 12:57
Location: Romania, Arad City
Contact:

TestBit BUG

#1 Post by yo2lio » 24 Aug 2007 10:14

This program not working when data is declared short and bit is 7. :?

Code: Select all

program test;

var data2 : byte;
    
procedure xxx(data : short; var data1 : byte);
begin
  if Testbit(data,7) = 1 then data1 := 1
  else data1 := 0;
end;

begin
  xxx(-80,data2); // Bit 7 from data is set
end.
Work around :

Code: Select all

program test;

var data2 : byte;
    
procedure xxx(data : short; var data1 : byte);
var buf : byte;
begin
  buf := data;
  if Testbit(buf,7) = 1 then data1 := 1
  else data1 := 0;
end;

begin
  xxx(-80,data2); // Bit 7 from data is set
end.
Best regards, Florin Andrei Medrea.

http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/

mail : florin@microelemente.ro

User avatar
zristic
mikroElektronika team
Posts: 6608
Joined: 03 Aug 2004 12:59
Contact:

Re: TestBit BUG

#2 Post by zristic » 27 Aug 2007 08:21

Thanks, we will check/fix it.

User avatar
zristic
mikroElektronika team
Posts: 6608
Joined: 03 Aug 2004 12:59
Contact:

Re: TestBit BUG

#3 Post by zristic » 24 Mar 2008 18:12

Fixed, thanks.

Post Reply

Return to “mikroPascal Beta testing”