Press enter to see results or esc to cancel.

System Function Odd

This procedure processes system function Odd.

Procedure Func_Odd; Far;
begin
  Expression^.ExpectIntegerExpressionInParentheses;
  With Expression^ do
    begin
      DataType := [];
      If Location = elConstant then
        begin
          Value.LongInt := Value.LongInt and $00000001;
          TypeDefPtr := Ptr (SystemUnitSegment, Boolean_TypeOffset);
          Exit;
        end;
      Expression^.Calculate;
      Expression^.LoadExpressionToRegisters (urAX);
      GenerateInstruction_TwoBytes ($D0, $E8);      { SHR   AL, 1 }
      Expression^.EndIntermediateCodeSubroutine;
      Expression^.SetExpressionToBooleanJump (JB);
    end;
end;