From b5600232608d9107a0166aaa8cdf0cd0a620d62d Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Wed, 17 Sep 2014 19:59:22 +0400 Subject: [PATCH] even faster way Former-commit-id: 9892f9205c98579fcad9695dc4007584ace8e6e4 --- src/voc/OPM.cmdln.Mod | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/voc/OPM.cmdln.Mod b/src/voc/OPM.cmdln.Mod index fc50f952..c2da97e3 100644 --- a/src/voc/OPM.cmdln.Mod +++ b/src/voc/OPM.cmdln.Mod @@ -587,6 +587,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE GetProperties(); VAR T: Texts.Text; S: Texts.Scanner; + base : LONGINT; BEGIN (* 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; END; (* if useParFile , noch *) - +(* commenting this by replacing with faster way; -- noch * MinSInt := power0(-2, (SIntSize*8-1)); (* -2^(SIntSize*8-1)*) (*MaxSInt := -(MinSint + 1);; may be optimized?*) MaxSInt := minus(MinSInt + 1); MinInt := power0(-2, (IntSize*8-1)); MaxInt := minus(MinInt + 1); + MinLInt := power0(-2, (LIntSize*8-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;