PACKET integer operation DEFINES int assign global, int assign local, int assign param, int equal, int lequal, int abs, int min, int incr, row int, int div, int mod, int add, int mult : (***************************************************************************) (* *) (* Autor: A. Steinmann Copyright (C): HRZ - Unibi *) (* *) (***************************************************************************) ROW 10 INT VAR introw ; REAL VAR begin, end, act result, int assign factor ; INT VAR first int, second int, third int, rest, i , index ; PROC int assign global (INT CONST frequency) : first int := 0 ; second int := 1 ; begin := clock (0) ; FOR index FROM 1 UPTO frequency REP first int := second int END REP ; end := clock (0); act result := end - begin ; int assign global s (frequency) END PROC int assign global ; PROC int assign global s (INT CONST frequency) : first int := 0 ; second int := 1 ; begin := clock (0) ; FOR index FROM 1 UPTO frequency REP first int := second int END REP ; end := clock (0); IF act result > end - begin THEN act result := end - begin FI ; int assign factor := act result * msec factor (frequency) - for corr ; notice result ("INT := (Paketdaten)", int assign factor) ; END PROC int assign global s ; PROC int assign local (INT CONST frequency) : INT VAR number one :: 0, number two :: 1 ; begin := clock (0) ; FOR index FROM 1 UPTO frequency REP number one := number two END REP ; end := clock (0); act result := end - begin ; int assign local s (frequency) END PROC int assign local ; PROC int assign local s (INT CONST frequency) : INT VAR number one :: 0, number two :: 1 ; begin := clock (0) ; FOR index FROM 1 UPTO frequency REP number one := number two END REP ; end := clock (0); IF act result > end - begin THEN act result := end - begin FI ; notice result ("INT := (Prozedurdaten)", act result * msec factor (frequency) - for corr) ; END PROC int assign local s ; PROC int assign param (INT CONST frequency) : first int := 0 ; second int := 1 ; int assign (first int, second int, frequency) ; first int := 0 ; int assign s (first int, second int, frequency) END PROC int assign param ; PROC int assign (INT VAR one, INT CONST two, frequency) : begin := clock (0) ; FOR index FROM 1 UPTO frequency REP one := two END REP ; end := clock (0) ; act result := end - begin ; END PROC int assign ; PROC int assign s (INT VAR one, INT CONST two, frequency) : begin := clock (0) ; FOR index FROM 1 UPTO frequency REP one := two END REP ; end := clock (0) ; IF act result > end - begin THEN act result := end - begin FI ; notice result ("INT := (Parameter)", act result * msec factor (frequency) - for corr) ; END PROC int assign s ; PROC row int (INT CONST frequency) : i := 7 ; int row [i] := 0 ; first int := 10000 ; begin := clock (0) ; FOR index FROM 1 UPTO frequency REP introw [i] := first int END REP ; end := clock (0) ; act result := end - begin ; row int s (frequency) END PROC row int ; PROC row int s (INT CONST frequency) : i := 7 ; int row [i] := 0 ; first int := 10000 ; begin := clock (0) ; FOR index FROM 1 UPTO frequency REP introw [i] := first int END REP ; end := clock (0) ; IF act result > end - begin THEN act result := end - begin FI ; notice result ("ROW INT [i]", act result * msec factor (frequency) - for corr) ; END PROC row int s ; PROC int equal (INT CONST frequency) : first int := 10 ; second int := 10 ; begin := clock (0) ; FOR index FROM 1 UPTO frequency REP IF first int = second int THEN FI END REP ; end := clock (0) ; act result := end - begin ; int equal s (frequency) END PROC int equal ; PROC int equal s (INT CONST frequency) : first int := 10 ; second int := 10 ; begin := clock (0) ; FOR index FROM 1 UPTO frequency REP IF first int = second int THEN FI END REP ; end := clock (0) ; IF act result > end - begin THEN act result := end - begin FI ; notice result ("INT =", act result * msec factor (frequency) - for corr) END PROC int equal s ; PROC int lequal (INT CONST frequency) : first int := 10 ; second int := 11 ; begin := clock(0) ; FOR index FROM 1 UPTO frequency REP IF first int <= second int THEN FI END REP ; end := clock (0) ; act result := end - begin ; int lequal s (frequency) END PROC int lequal ; PROC int lequal s (INT CONST frequency) : first int := 10 ; second int := 11 ; begin := clock(0) ; FOR index FROM 1 UPTO frequency REP IF first int <= second int THEN FI END REP ; end := clock (0) ; IF act result > end - begin THEN act result := end - begin FI ; notice result ("INT <=", act result * msec factor (frequency) - for corr) END PROC int lequal s ; PROC int add (INT CONST frequency) : first int := 0 ; second int := 1 ; third int := 1 ; begin := clock (0) ; FOR index FROM 1 UPTO frequency REP first int := second int + third int END REP ; end := clock (0) ; act result := end - begin ; int add s (frequency) END PROC int add ; PROC int add s (INT CONST frequency) : first int := 0 ; second int := 1 ; third int := 1 ; begin := clock (0) ; FOR index FROM 1 UPTO frequency REP first int := second int + third int END REP ; end := clock (0) ; IF act result > end - begin THEN act result := end - begin FI ; notice result ("INT +", act result * msec factor (frequency) - for corr) END PROC int add s ; PROC int mult (INT CONST frequency) : first int := 0 ; second int := 99 ; third int := 11 ; begin := clock (0) ; FOR index FROM 1 UPTO frequency REP first int := second int * third int END REP ; end := clock (0) ; act result := end - begin ; int mult s (frequency) END PROC int mult ; PROC int mult s (INT CONST frequency) : first int := 0 ; second int := 99 ; third int := 11 ; begin := clock (0) ; FOR index FROM 1 UPTO frequency REP first int := second int * third int END REP ; end := clock (0) ; IF act result > end - begin THEN act result := end - begin FI ; notice result ("INT *", act result * msec factor (frequency) - for corr) END PROC int mult s ; PROC int div (INT CONST frequency) : first int := 0 ; second int := 10001 ; third int := 99 ; begin := clock (0) ; FOR index FROM 1 UPTO frequency REP first int := second int DIV third int END REP ; end := clock (0) ; act result := end - begin ; int div s (frequency) END PROC int div ; PROC int div s (INT CONST frequency) : first int := 0 ; second int := 10001 ; third int := 99 ; begin := clock (0) ; FOR index FROM 1 UPTO frequency REP first int := second int DIV third int END REP ; end := clock (0) ; IF act result > end - begin THEN act result := end - begin FI ; notice result ("DIV", act result * msec factor (frequency) - for corr) END PROC int div s ; PROC int mod (INT CONST frequency) : first int := 9999 ; second int := 55 ; begin := clock (0) ; FOR index FROM 1 UPTO frequency REP rest := first int MOD second int END REP ; end := clock (0) ; act result := end - begin ; int mod s (frequency) END PROC int mod ; PROC int mod s (INT CONST frequency) : first int := 9999 ; second int := 55 ; begin := clock (0) ; FOR index FROM 1 UPTO frequency REP rest := first int MOD second int END REP ; end := clock (0) ; IF act result > end - begin THEN act result := end - begin FI ; notice result ("MOD", act result * msec factor (frequency) - for corr) END PROC int mod s ; PROC int incr (INT CONST frequency) : first int:= 0 ; second int := 1 ; begin := clock (0) ; FOR index FROM 1 UPTO frequency REP first int INCR second int END REP ; end := clock (0) ; act result := end - begin ; int incr s (frequency) END PROC int incr ; PROC int incr s (INT CONST frequency) : first int:= 0 ; second int := 1 ; begin := clock (0) ; FOR index FROM 1 UPTO frequency REP first int INCR second int END REP ; end := clock (0) ; IF act result > end - begin THEN act result := end - begin FI ; notice result ("INCR" , act result * msec factor (frequency) - for corr) ; END PROC int incr s ; PROC int abs (INT CONST frequency) : first int := - 10000 ; second int := 0 ; begin := clock (0) ; FOR index FROM 1 UPTO frequency REP second int := abs (first int) END REP ; end := clock (0) ; act result := end - begin ; int abs s (frequency) END PROC int abs ; PROC int abs s (INT CONST frequency) : first int := - 10000 ; second int := 0 ; begin := clock (0) ; FOR index FROM 1 UPTO frequency REP second int := abs (first int) END REP ; end := clock (0) ; IF act result > end - begin THEN act result := end - begin FI ; notice result ("abs (INT)", act result * msec factor (frequency) - for corr) ; END PROC int abs s ; PROC int min (INT CONST frequency) : i := 0 ; first int := 9999 ; second int := 10000 ; begin := clock (0) ; FOR index FROM 1 UPTO frequency REP i := min (first int, second int) END REP ; end := clock (0) ; act result := end - begin ; int min s (frequency) END PROC int min ; PROC int min s (INT CONST frequency) : i := 0 ; first int := 9999 ; second int := 10000 ; begin := clock (0) ; FOR index FROM 1 UPTO frequency REP i := min (first int, second int) END REP ; end := clock (0) ; IF act result > end - begin THEN act result := end - begin FI ; notice result ("min (INT , INT)", act result * msec factor (frequency) - for corr) ; END PROC int min s ; END PACKET integer operation ;