NOT and XOR functions with bit variables

Beta Testing discussion on mikroPascal PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
pulfer0b
Posts: 2
Joined: 04 Apr 2011 11:24

NOT and XOR functions with bit variables

#1 Post by pulfer0b » 04 Apr 2011 12:34

Stranges values returned by the following code under V4.6o and V4.80 beta
Wrong use of the not and xor functions with bit variables ?

Code: Select all

{*
 * Project name: Ess
 * Target Platform: PIC24FJ256GB110
    Compiler: mikroPascal Pro for dsPIC30/33 and PIC24 v4.6 and V4.8 beta
*}

program Test;

var
  Bit_1 : bit;
  Bit_2 : bit;
  Bit_in_word : word;
  Full_word_1 : word;
  Full_word_2 : word;

begin // Program
  //Code to check the displayed values in the watch windows
  Bit_1 := False;
  Bit_2 := False;
  Bit_in_word.0 := False;
  Bit_in_word.1 := False;
  Full_word_1 := False;
  Full_word_2 := False;
  Bit_1 := True;
  Bit_2 := True;
  Bit_in_word.0 := True;
  Bit_in_word.1 := True;
  Full_word_1 := True;
  Full_word_2 := True;
  Bit_1 := False;
  Bit_2 := False;
  Bit_in_word.0 := False;
  Bit_in_word.1 := False;
  Full_word_1 := False;
  Full_word_2 := False;
  while TRUE do // Main loop
    begin
       //Code to test the NOT and XOR problem
       //The result is depanding of the order of the lines
       Bit_1 := not Bit_1; //Bit is only be set
       Bit_in_word.0 := not Bit_in_word.0; //Bit is only be set
       Full_word_1 := not Full_word_1; //OK
       Bit_2 := True xor Bit_2; //Bit do not change
       Bit_in_word.1 := True xor Bit_in_word.1; //Bit do not change
       Full_word_2 := True xor Full_word_2; //OK
    end; //Main loop
end. // Program

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: NOT and XOR functions with bit variables

#2 Post by filip » 05 Apr 2011 12:34

Hi,

I have reproduced the issue you were talking about and reported it to our developers.
I apologize for the inconvenience.

Regards,
Filip.

Post Reply

Return to “mikroPascal PRO for dsPIC30/33 and PIC24 Beta Testing”