Accessing Individual Bits ERROR

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:

Accessing Individual Bits ERROR

#1 Post by yo2lio » 11 Mar 2007 13:33

Hello All

I have folowing situation :

Code: Select all

var ExpanderMode : array[8] of byte;
      buf : byte;

function Test(ModuleAddress : byte) : byte;
Begin
  result := TestBit(ExpanderMode[ModuleAddress],7); // work
end;

function Test1(ModuleAddress : byte) : byte;
Begin
  result := ExpanderMode[ModuleAddress].7;  // BUG
end;

begin
  ExpanderMode[5] := $80;
//...
  buf := Test(5); // work, buf = 1;
  buf := Test1(5);  // BUG buf = 0;
end.
If i try : result := ExpanderMode[5].7, work fine ....

Conclusion : Accessing Individual Bits in array byte variable "Simply use the dot (.) with a variable, followed by a number" don't work.

If you take a look in asm will found the diference beetwen Test and Test1 functions.

Best regards Florin Medrea.

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

Re: Accessing Individual Bits ERROR

#2 Post by zristic » 11 Mar 2007 18:37

We will fix it, thanks for reporting.

Post Reply

Return to “mikroPascal Beta testing”