From 98cab31fc3659e33aef260efca55bf9f1753164c Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Mon, 11 Feb 2019 11:49:19 +0100 Subject: Add source files from Michael --- app/speedtest/1986/src/convert operation | 396 +++++++++++++++++++++++++++++++ 1 file changed, 396 insertions(+) create mode 100644 app/speedtest/1986/src/convert operation (limited to 'app/speedtest/1986/src/convert operation') diff --git a/app/speedtest/1986/src/convert operation b/app/speedtest/1986/src/convert operation new file mode 100644 index 0000000..903f2e5 --- /dev/null +++ b/app/speedtest/1986/src/convert operation @@ -0,0 +1,396 @@ +PACKET convert DEFINES real to int, + int to real, + text to int, + int to text, + int to text 2, + real to text, + real to text 2, + code int, + code text : + + +(***************************************************************************) +(* *) +(* Autor: A. Steinmann Copyright (C): HRZ - Unibi *) +(* *) +(***************************************************************************) + + +INT VAR index, + first int, + i ; + + +REAL VAR begin, + end, + act result, + first real ; + + +TEXT VAR single text :: "*", + free text ; + + + + +PROC real to int (INT CONST frequency) : + + first real := 1.0 ; + begin := clock (0) ; + FOR index FROM 1 UPTO frequency + REP + i := int (first real) + END REP ; + end := clock (0) ; + + act result := end - begin ; + + real to int s (frequency) + +END PROC real to int ; + + + + +PROC real to int s (INT CONST frequency) : + + first real := 1.0 ; + begin := clock (0) ; + FOR index FROM 1 UPTO frequency + REP + i := int (first real) + END REP ; + end := clock (0) ; + + IF act result > end - begin + THEN act result := end - begin + FI ; + + notice result ("int (REAL)", act result * msec factor (frequency) - for corr) + +END PROC real to int s ; + + + + +PROC int to real (INT CONST frequency) : + + first int := 1 ; + begin := clock (0) ; + FOR index FROM 1 UPTO frequency + REP + first real := real (first int) + END REP ; + end := clock (0) ; + + act result := end - begin ; + + int to real s (frequency) + +END PROC int to real ; + + + + +PROC int to real s (INT CONST frequency) : + + first int := 1 ; + begin := clock (0) ; + FOR index FROM 1 UPTO frequency + REP + first real := real (first int) + END REP ; + end := clock (0) ; + + IF act result > end - begin + THEN act result := end - begin + FI ; + + notice result ("real (INT)", act result * msec factor (frequency) - for corr) + +END PROC int to real s ; + + + + +PROC text to int (INT CONST frequency) : + + free text := "1111" ; + begin := clock (0) ; + FOR index FROM 1 UPTO frequency + REP + first int := int (free text) + END REP ; + end := clock (0) ; + + act result := end - begin ; + + text to int s (frequency) + +END PROC text to int ; + + + + +PROC text to int s (INT CONST frequency) : + + free text := "1111" ; + begin := clock (0) ; + FOR index FROM 1 UPTO frequency + REP + first int := int (free text) + END REP ; + end := clock (0) ; + + IF act result > end - begin + THEN act result := end - begin + FI ; + + notice result ("int (TEXT)", act result * msec factor (frequency) - for corr) + +END PROC text to int s ; + + + + +PROC int to text (INT CONST frequency) : + + first int := 1 ; + begin := clock (0) ; + FOR index FROM 1 UPTO frequency + REP + free text := text (first int) ; + END REP ; + end := clock (0) ; + + act result := end - begin ; + + int to text s (frequency) + +END PROC int to text ; + + + + +PROC int to text s (INT CONST frequency) : + + first int := 1 ; + begin := clock (0) ; + FOR index FROM 1 UPTO frequency + REP + free text := text (first int) ; + END REP ; + end := clock (0) ; + + IF act result > end - begin + THEN act result := end - begin + FI ; + + notice result ("text (INT)", act result * msec factor (frequency) - for corr) + +END PROC int to text s ; + + + + +PROC int to text 2 (INT CONST frequency) : + + first int := 1 ; + i := 3 ; + begin := clock (0) ; + FOR index FROM 1 UPTO frequency + REP + free text := text (first int, i) + END REP ; + end := clock (0) ; + + act result := end - begin ; + + int to text 2 s (frequency) + +END PROC int to text 2 ; + + + + +PROC int to text 2 s (INT CONST frequency) : + + first int := 1 ; + i := 3 ; + begin := clock (0) ; + FOR index FROM 1 UPTO frequency + REP + free text := text (first int, i) + END REP ; + end := clock (0) ; + + IF act result > end - begin + THEN act result := end - begin + FI ; + + notice result ("text (INT, INT)", act result * msec factor (frequency) - for corr) + +END PROC int to text 2 s ; + + + + +PROC real to text (INT CONST frequency) : + + first real := 1.0 ; + begin := clock (0) ; + FOR index FROM 1 UPTO frequency + REP + free text := text (first real) + END REP ; + end := clock (0) ; + + act result := end - begin ; + + real to text s (frequency) + +END PROC real to text ; + + + + +PROC real to text s (INT CONST frequency) : + + first real := 1.0 ; + begin := clock (0) ; + FOR index FROM 1 UPTO frequency + REP + free text := text (first real) + END REP ; + end := clock (0) ; + + IF act result > end - begin + THEN act result := end - begin + FI ; + + notice result ("text (REAL)", act result * msec factor (frequency) - for corr) + +END PROC real to text s ; + + + + +PROC real to text 2 (INT CONST frequency) : + + first real := 1.0 ; + i := 1 ; + begin := clock (0) ; + FOR index FROM 1 UPTO frequency + REP + free text := text (first real, i, i) + END REP ; + end := clock (0) ; + + act result := end - begin ; + + real to text 2 s (frequency) + +END PROC real to text 2 ; + + + + +PROC real to text 2 s (INT CONST frequency) : + + first real := 1.0 ; + i := 1 ; + begin := clock (0) ; + FOR index FROM 1 UPTO frequency + REP + free text := text (first real, i, i) + END REP ; + end := clock (0) ; + + IF act result > end - begin + THEN act result := end - begin + FI ; + + notice result ("text (REAL, INT, INT)", act result * msec factor (frequency) - for corr) + +END PROC real to text 2 s ; + + + + +PROC code int (INT CONST frequency) : + + i := 65 ; + begin := clock (0) ; + FOR index FROM 1 UPTO frequency + REP + free text := code (i) + END REP ; + end := clock (0) ; + + act result := end - begin ; + + code int s (frequency) + +END PROC code int ; + + + + +PROC code int s (INT CONST frequency) : + + i := 65 ; + begin := clock (0) ; + FOR index FROM 1 UPTO frequency + REP + free text := code (i) + END REP ; + end := clock (0) ; + + IF act result > end - begin + THEN act result := end - begin + FI ; + + notice result ("code (INT)", act result * msec factor (frequency) - for corr) + +END PROC code int s ; + + + + +PROC code text (INT CONST frequency) : + + begin := clock (0) ; + FOR index FROM 1 UPTO frequency + REP + first int := code (single text) + END REP ; + end := clock (0) ; + + act result := end - begin ; + + code text s (frequency) + +END PROC code text ; + + + + +PROC code text s (INT CONST frequency) : + + begin := clock (0) ; + FOR index FROM 1 UPTO frequency + REP + first int := code (single text) + END REP ; + end := clock (0) ; + + IF act result > end - begin + THEN act result := end - begin + FI ; + + notice result ("code (TEXT)", act result * msec factor (frequency) - for corr) + +END PROC code text s ; + + +END PACKET convert ; -- cgit v1.2.3