// Effectus auto-generated Mad Pascal source code listing
program bitwisePrg;

uses
  Crt, StringUtils, SySutils, CIO;

var
  strBuffer : string;
var
  eff_loop_var : byte;
  eff_cnt : byte;
  eff_string : string;
// Effectus example:
// Logical (bitwise) manipulation demo
var
  key : byte;  // key_byte_array
  n : byte;  // n_byte_array
  a : byte;  // a_byte_array
  b : byte;  // b_byte_array

procedure MAINProc;
begin
  Write(Chr(125));
  eff_string := '';
  Write('Logical(bitwise) operators demo');  // Print 1
  Writeln;
  Writeln('');
  eff_string := '';
  Write('n=');  // Print 1

  n := 2;
  n := n+2;
  eff_string := '';
  Write(n);  // Print 2
  Writeln;
  Writeln('');
  eff_string := '';
  Write('n==&2 Result: ');  // Print 1

  n := n AND 2;
  eff_string := '';
  Write(n);  // Print 2
  Writeln;
  Writeln('');
  eff_string := '';
  Write('n=n&40 Result: ');  // Print 1

  n := n AND 40;
  eff_string := '';
  Write(n);  // Print 2
  Writeln;
  Writeln('');
  eff_string := '';
  Write('n=');  // Print 1

  n := 2;
  eff_string := '';
  Write(n);  // Print 2
  Writeln;
  Writeln('');
  eff_string := '';
  Write('n==!2 Result: ');  // Print 1

  n := n XOR 2;
  eff_string := '';
  Write(n);  // Print 2
  Writeln;
  Writeln('');
  eff_string := '';
  Write('n==XOR 2 Result: ');  // Print 1

  n := n XOR 2;
  eff_string := '';
  Write(n);  // Print 2
  Writeln;
  Writeln('');
  eff_string := '';
  Write('n==!n Result: ');  // Print 1

  n := n XOR n;
  eff_string := '';
  Write(n);  // Print 2
  Writeln;
  Writeln('');
  eff_string := '';
  Write('a=40');  // Print 1
  Writeln;
  eff_string := '';
  Write('b=a LSH 1 Result: ');  // Print 1

  a := 40;
  b := a SHL 1;
  eff_string := '';
  Write(b);  // Print 2
  Writeln;
  Writeln('');
  eff_string := '';
  Write('b=a RSH 1 Result: ');  // Print 1

  b := a SHR 1;
  eff_string := '';
  Write(b);  // Print 2
  Writeln;
  key := Get(7);
  ReadKey;
end;

begin
  MAINProc;
end.
