mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 06:22:25 +00:00
parent
4a32c7d5c1
commit
b560023260
1 changed files with 17 additions and 1 deletions
|
|
@ -587,6 +587,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
|
||||||
|
|
||||||
PROCEDURE GetProperties();
|
PROCEDURE GetProperties();
|
||||||
VAR T: Texts.Text; S: Texts.Scanner;
|
VAR T: Texts.Text; S: Texts.Scanner;
|
||||||
|
base : LONGINT;
|
||||||
BEGIN
|
BEGIN
|
||||||
|
|
||||||
(* default characteristics *)
|
(* default characteristics *)
|
||||||
|
|
@ -679,14 +680,29 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
|
||||||
ELSE Console.String ("not using voc.par file"); Console.Ln;
|
ELSE Console.String ("not using voc.par file"); Console.Ln;
|
||||||
END; (* if useParFile , noch *)
|
END; (* if useParFile , noch *)
|
||||||
|
|
||||||
|
(* commenting this by replacing with faster way; -- noch *
|
||||||
MinSInt := power0(-2, (SIntSize*8-1)); (* -2^(SIntSize*8-1)*)
|
MinSInt := power0(-2, (SIntSize*8-1)); (* -2^(SIntSize*8-1)*)
|
||||||
(*MaxSInt := -(MinSint + 1);; may be optimized?*)
|
(*MaxSInt := -(MinSint + 1);; may be optimized?*)
|
||||||
MaxSInt := minus(MinSInt + 1);
|
MaxSInt := minus(MinSInt + 1);
|
||||||
MinInt := power0(-2, (IntSize*8-1));
|
MinInt := power0(-2, (IntSize*8-1));
|
||||||
MaxInt := minus(MinInt + 1);
|
MaxInt := minus(MinInt + 1);
|
||||||
|
|
||||||
MinLInt := power0(-2, (LIntSize*8-1));
|
MinLInt := power0(-2, (LIntSize*8-1));
|
||||||
MaxLInt := minus(MinLInt +1);
|
MaxLInt := minus(MinLInt +1);
|
||||||
|
*)
|
||||||
|
(* and I'd like to calculate it, not hardcode constants *)
|
||||||
|
base := -2;
|
||||||
|
(* we can do
|
||||||
|
MinLInt := ASH(-2, LIntSize*8-2);
|
||||||
|
but some compilers may treat -2 as SHORTINT, not LONGINT; -- noch *)
|
||||||
|
MinSInt := ASH(Base, SIntSize*8-2);
|
||||||
|
MaxSInt := minus(MinSInt + 1);
|
||||||
|
|
||||||
|
MinInt := ASH(Base, IntSize*8-2);
|
||||||
|
MaxInt := minus(MinInt + 1);
|
||||||
|
|
||||||
|
MinLInt := ASH(Base, LIntSize*8-2);
|
||||||
|
MaxLInt := minus(MinLInt +1);
|
||||||
|
|
||||||
(*
|
(*
|
||||||
Console.Int(MinSInt, 0); Console.Ln;
|
Console.Int(MinSInt, 0); Console.Ln;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue