Browse Source

Build proccess simplified; VOC bootstrap C-files updated; compile scripts changed

Artur Efimov 7 years ago
parent
commit
df1c60d8e2
100 changed files with 2368 additions and 410 deletions
  1. 9 7
      data/bin/compile.sh
  2. 9 6
      data/bin/compile_no_graph.sh
  3. 1 1
      data/bin/voc/src/bootstrap/unix-44/Compiler.c
  4. 2 2
      data/bin/voc/src/bootstrap/unix-44/Configuration.c
  5. 1 1
      data/bin/voc/src/bootstrap/unix-44/Configuration.h
  6. 197 0
      data/bin/voc/src/bootstrap/unix-44/Errors.Txt
  7. 1 1
      data/bin/voc/src/bootstrap/unix-44/Files.c
  8. 1 1
      data/bin/voc/src/bootstrap/unix-44/Files.h
  9. 1 1
      data/bin/voc/src/bootstrap/unix-44/Heap.c
  10. 1 1
      data/bin/voc/src/bootstrap/unix-44/Heap.h
  11. 1 1
      data/bin/voc/src/bootstrap/unix-44/Modules.c
  12. 1 1
      data/bin/voc/src/bootstrap/unix-44/Modules.h
  13. 51 41
      data/bin/voc/src/bootstrap/unix-44/OPB.c
  14. 1 1
      data/bin/voc/src/bootstrap/unix-44/OPB.h
  15. 1 1
      data/bin/voc/src/bootstrap/unix-44/OPC.c
  16. 1 1
      data/bin/voc/src/bootstrap/unix-44/OPC.h
  17. 12 38
      data/bin/voc/src/bootstrap/unix-44/OPM.c
  18. 1 1
      data/bin/voc/src/bootstrap/unix-44/OPM.h
  19. 3 3
      data/bin/voc/src/bootstrap/unix-44/OPP.c
  20. 1 1
      data/bin/voc/src/bootstrap/unix-44/OPP.h
  21. 1 1
      data/bin/voc/src/bootstrap/unix-44/OPS.c
  22. 1 1
      data/bin/voc/src/bootstrap/unix-44/OPS.h
  23. 23 22
      data/bin/voc/src/bootstrap/unix-44/OPT.c
  24. 1 1
      data/bin/voc/src/bootstrap/unix-44/OPT.h
  25. 27 15
      data/bin/voc/src/bootstrap/unix-44/OPV.c
  26. 1 1
      data/bin/voc/src/bootstrap/unix-44/OPV.h
  27. 136 1
      data/bin/voc/src/bootstrap/unix-44/Out.c
  28. 4 1
      data/bin/voc/src/bootstrap/unix-44/Out.h
  29. 1 1
      data/bin/voc/src/bootstrap/unix-44/Platform.c
  30. 1 1
      data/bin/voc/src/bootstrap/unix-44/Platform.h
  31. 1 1
      data/bin/voc/src/bootstrap/unix-44/Reals.c
  32. 1 1
      data/bin/voc/src/bootstrap/unix-44/Reals.h
  33. 218 0
      data/bin/voc/src/bootstrap/unix-44/SYSTEM.c
  34. 326 0
      data/bin/voc/src/bootstrap/unix-44/SYSTEM.h
  35. 1 1
      data/bin/voc/src/bootstrap/unix-44/Strings.c
  36. 1 1
      data/bin/voc/src/bootstrap/unix-44/Strings.h
  37. 1 1
      data/bin/voc/src/bootstrap/unix-44/Texts.c
  38. 1 1
      data/bin/voc/src/bootstrap/unix-44/Texts.h
  39. 1 1
      data/bin/voc/src/bootstrap/unix-44/VT100.c
  40. 1 1
      data/bin/voc/src/bootstrap/unix-44/VT100.h
  41. 10 0
      data/bin/voc/src/bootstrap/unix-44/WindowsWrapper.h
  42. 1 1
      data/bin/voc/src/bootstrap/unix-44/extTools.c
  43. 1 1
      data/bin/voc/src/bootstrap/unix-44/extTools.h
  44. 1 1
      data/bin/voc/src/bootstrap/unix-48/Compiler.c
  45. 2 2
      data/bin/voc/src/bootstrap/unix-48/Configuration.c
  46. 1 1
      data/bin/voc/src/bootstrap/unix-48/Configuration.h
  47. 197 0
      data/bin/voc/src/bootstrap/unix-48/Errors.Txt
  48. 1 1
      data/bin/voc/src/bootstrap/unix-48/Files.c
  49. 1 1
      data/bin/voc/src/bootstrap/unix-48/Files.h
  50. 1 1
      data/bin/voc/src/bootstrap/unix-48/Heap.c
  51. 1 1
      data/bin/voc/src/bootstrap/unix-48/Heap.h
  52. 1 1
      data/bin/voc/src/bootstrap/unix-48/Modules.c
  53. 1 1
      data/bin/voc/src/bootstrap/unix-48/Modules.h
  54. 51 41
      data/bin/voc/src/bootstrap/unix-48/OPB.c
  55. 1 1
      data/bin/voc/src/bootstrap/unix-48/OPB.h
  56. 1 1
      data/bin/voc/src/bootstrap/unix-48/OPC.c
  57. 1 1
      data/bin/voc/src/bootstrap/unix-48/OPC.h
  58. 12 38
      data/bin/voc/src/bootstrap/unix-48/OPM.c
  59. 1 1
      data/bin/voc/src/bootstrap/unix-48/OPM.h
  60. 3 3
      data/bin/voc/src/bootstrap/unix-48/OPP.c
  61. 1 1
      data/bin/voc/src/bootstrap/unix-48/OPP.h
  62. 1 1
      data/bin/voc/src/bootstrap/unix-48/OPS.c
  63. 1 1
      data/bin/voc/src/bootstrap/unix-48/OPS.h
  64. 23 22
      data/bin/voc/src/bootstrap/unix-48/OPT.c
  65. 1 1
      data/bin/voc/src/bootstrap/unix-48/OPT.h
  66. 27 15
      data/bin/voc/src/bootstrap/unix-48/OPV.c
  67. 1 1
      data/bin/voc/src/bootstrap/unix-48/OPV.h
  68. 136 1
      data/bin/voc/src/bootstrap/unix-48/Out.c
  69. 4 1
      data/bin/voc/src/bootstrap/unix-48/Out.h
  70. 1 1
      data/bin/voc/src/bootstrap/unix-48/Platform.c
  71. 1 1
      data/bin/voc/src/bootstrap/unix-48/Platform.h
  72. 1 1
      data/bin/voc/src/bootstrap/unix-48/Reals.c
  73. 1 1
      data/bin/voc/src/bootstrap/unix-48/Reals.h
  74. 218 0
      data/bin/voc/src/bootstrap/unix-48/SYSTEM.c
  75. 326 0
      data/bin/voc/src/bootstrap/unix-48/SYSTEM.h
  76. 1 1
      data/bin/voc/src/bootstrap/unix-48/Strings.c
  77. 1 1
      data/bin/voc/src/bootstrap/unix-48/Strings.h
  78. 1 1
      data/bin/voc/src/bootstrap/unix-48/Texts.c
  79. 1 1
      data/bin/voc/src/bootstrap/unix-48/Texts.h
  80. 1 1
      data/bin/voc/src/bootstrap/unix-48/VT100.c
  81. 1 1
      data/bin/voc/src/bootstrap/unix-48/VT100.h
  82. 10 0
      data/bin/voc/src/bootstrap/unix-48/WindowsWrapper.h
  83. 1 1
      data/bin/voc/src/bootstrap/unix-48/extTools.c
  84. 1 1
      data/bin/voc/src/bootstrap/unix-48/extTools.h
  85. 1 1
      data/bin/voc/src/bootstrap/unix-88/Compiler.c
  86. 2 2
      data/bin/voc/src/bootstrap/unix-88/Configuration.c
  87. 1 1
      data/bin/voc/src/bootstrap/unix-88/Configuration.h
  88. 197 0
      data/bin/voc/src/bootstrap/unix-88/Errors.Txt
  89. 1 1
      data/bin/voc/src/bootstrap/unix-88/Files.c
  90. 1 1
      data/bin/voc/src/bootstrap/unix-88/Files.h
  91. 1 1
      data/bin/voc/src/bootstrap/unix-88/Heap.c
  92. 1 1
      data/bin/voc/src/bootstrap/unix-88/Heap.h
  93. 1 1
      data/bin/voc/src/bootstrap/unix-88/Modules.c
  94. 1 1
      data/bin/voc/src/bootstrap/unix-88/Modules.h
  95. 51 41
      data/bin/voc/src/bootstrap/unix-88/OPB.c
  96. 1 1
      data/bin/voc/src/bootstrap/unix-88/OPB.h
  97. 1 1
      data/bin/voc/src/bootstrap/unix-88/OPC.c
  98. 1 1
      data/bin/voc/src/bootstrap/unix-88/OPC.h
  99. 12 38
      data/bin/voc/src/bootstrap/unix-88/OPM.c
  100. 1 1
      data/bin/voc/src/bootstrap/unix-88/OPM.h

+ 9 - 7
data/bin/compile.sh

@@ -4,16 +4,18 @@
 # FreeOberon executable is located.
 # This particular script is for graphical programs.
 cd bin
-voc -OC -cfFm ../Programs/$1
+VOCDIR=../data/bin/voc
+VOC=$VOCDIR/bin/voc
+CC=gcc
+$VOC -OC -cfFm ../Programs/$1
 retcode=$?
 if [ "$retcode" -eq "0" ]; then
-  thename="${1%.*}"
-  OBJPATH=../src
+  THENAME="${1%.*}"
   SDL2Opts=`sdl2-config --cflags --libs`
-  gcc -fPIC -g -I "/opt/voc/C/include" \
-    -o $thename $thename.o \
-    "$OBJPATH/Graph.o" "$OBJPATH/SDL2.o" \
-    -L"/opt/voc/lib" -lvoc-OC \
+  $CC -fPIC -g -I $VOCDIR/C/include \
+    -o $THENAME $THENAME.o \
+    $VOCDIR/lib/Graph.o $VOCDIR/lib/SDL2.o \
+    $VOCDIR/lib/libvoc-OC.a \
     $SDL2Opts -lSDL2_image
 fi
 cd ..

+ 9 - 6
data/bin/compile_no_graph.sh

@@ -4,14 +4,17 @@
 # FreeOberon executable is located.
 # This particular script is for console programs.
 cd bin
-voc -OC -cfFm ../Programs/$1
+VOCDIR=../data/bin/voc
+VOC=$VOCDIR/bin/voc
+CC=gcc
+$VOC -OC -cfFm ../Programs/$1
 retcode=$?
 if [ "$retcode" -eq "0" ]; then
-  thename="${1%.*}"
-  OBJPATH=../src
-  gcc -fPIC -g -I "/opt/voc/C/include" \
-    -o $thename $thename.o \
-    -L"/opt/voc/lib" -lvoc-OC
+  THENAME="${1%.*}"
+  $CC -fPIC -g -I $VOCDIR/C/include \
+    -o $THENAME $THENAME.o \
+    $VOCDIR/lib/Graph.o $VOCDIR/lib/SDL2.o \
+    $VOCDIR/lib/libvoc-OC.a
 fi
 cd ..
 exit $retcode

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/Compiler.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 2 - 2
data/bin/voc/src/bootstrap/unix-44/Configuration.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16
@@ -19,6 +19,6 @@ export void *Configuration__init(void)
 	__DEFMOD;
 	__REGMOD("Configuration", 0);
 /* BEGIN */
-	__MOVE("2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76);
+	__MOVE("2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76);
 	__ENDMOD;
 }

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/Configuration.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef Configuration__h
 #define Configuration__h

+ 197 - 0
data/bin/voc/src/bootstrap/unix-44/Errors.Txt

@@ -0,0 +1,197 @@
+The first line of this file is ignored.
+Any line not starting /^ *[0-9]/ is ignored.
+There should be only one space between the number and the message text.
+
+Compiler error messages
+  0 undeclared identifier
+  1 multiply defined identifier
+  2 illegal character in number
+  3 illegal character in string
+  4 identifier does not match procedure name
+  5 comment not closed
+
+  9 '=' expected
+
+ 12 type definition starts with incorrect symbol
+ 13 factor starts with incorrect symbol
+ 14 statement starts with incorrect symbol
+ 15 declaration followed by incorrect symbol
+ 16 MODULE expected
+
+ 18 '.' missing
+ 19 ',' missing
+ 20 ':' missing
+
+ 22 ')' missing
+ 23 ']' missing
+ 24 '}' missing
+ 25 OF missing
+ 26 THEN missing
+ 27 DO missing
+ 28 TO missing
+
+ 30 '(' missing
+
+ 34 ':=' missing
+ 35 ',' or OF expected
+
+ 38 identifier expected
+ 39 ';' missing
+
+ 41 END missing
+
+ 44 UNTIL missing
+
+ 46 EXIT not within loop statement
+ 47 illegally marked identifier
+
+ 50 expression should be constant
+ 51 constant not an integer
+ 52 identifier does not denote a type
+ 53 identifier does not denote a record type
+ 54 result type of procedure is not a basic type
+ 55 procedure call of a function
+ 56 assignment to non-variable
+ 57 pointer not bound to record or array type
+ 58 recursive type definition
+ 59 illegal open array parameter
+ 60 wrong type of case label
+ 61 inadmissible type of case label
+ 62 case label defined more than once
+ 63 illegal value of constant
+ 64 more actual than formal parameters
+ 65 fewer actual than formal parameters
+ 66 element types of actual array and formal open array differ
+ 67 actual parameter corresponding to open array is not an array
+ 68 control variable must be integer
+ 69 parameter must be an integer constant
+ 70 pointer or VAR record required as formal receiver
+ 71 pointer expected as actual receiver
+ 72 procedure must be bound to a record of the same scope
+ 73 procedure must have level 0
+ 74 procedure unknown in base type
+ 75 invalid call of base procedure
+ 76 this variable (field) is read only
+ 77 object is not a record
+ 78 dereferenced object is not a variable
+ 79 indexed object is not a variable
+ 80 index expression is not an integer
+ 81 index out of specified bounds
+ 82 indexed variable is not an array
+ 83 undefined record field
+ 84 dereferenced variable is not a pointer
+ 85 guard or test type is not an extension of variable type
+ 86 guard or testtype is not a pointer
+ 87 guarded or tested variable is neither a pointer nor a VAR-parameter record
+ 88 open array not allowed as variable, record field or array element
+
+ 92 operand of IN not an integer, or not a set
+ 93 set element type is not an integer
+ 94 operand of & is not of type BOOLEAN
+ 95 operand of OR is not of type BOOLEAN
+ 96 operand not applicable to (unary) +
+ 97 operand not applicable to (unary) -
+ 98 operand of ~ is not of type BOOLEAN
+ 99 ASSERT fault
+100 incompatible operands of dyadic operator
+101 operand type inapplicable to *
+102 operand type inapplicable to /
+103 operand type inapplicable to DIV
+104 operand type inapplicable to MOD
+105 operand type inapplicable to +
+106 operand type inapplicable to -
+107 operand type inapplicable to = or #
+108 operand type inapplicable to relation
+109 overriding method must be exported
+110 operand is not a type
+111 operand inapplicable to (this) function
+112 operand is not a variable
+113 incompatible assignment
+114 string too long to be assigned
+115 parameter doesn't match
+116 number of parameters doesn't match
+117 result type doesn't match
+118 export mark doesn't match with forward declaration
+119 redefinition textually precedes procedure bound to base type
+120 type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN
+121 called object is not a procedure (or is an interrupt procedure)
+122 actual VAR-parameter is not a variable
+123 type of actual parameter is not identical with that of formal VAR-parameter
+124 type of result expression differs from that of procedure
+125 type of case expression is neither INTEGER nor CHAR
+126 this expression cannot be a type or a procedure
+127 illegal use of object
+128 unsatisfied forward reference
+129 unsatisfied forward procedure
+130 WITH clause does not specify a variable
+131 LEN not applied to array
+132 dimension in LEN too large or negative
+135 SYSTEM not imported
+150 key inconsistency of imported module
+151 incorrect symbol file
+152 symbol file of imported module not found
+153 object or symbol file not opened (disk full?)
+154 recursive import not allowed
+155 generation of new symbol file not allowed
+156 parameter file not found
+157 syntax error in parameter file
+
+Limitations of implementation
+200 not yet implemented
+201 lower bound of set range greater than higher bound
+202 set element greater than MAX(SET) or less than 0
+203 number too large
+204 product too large
+205 division by zero
+206 sum too large
+207 difference too large
+208 overflow in arithmetic shift
+209 case range too large
+213 too many cases in case statement
+218 illegal value of parameter (0 <= p < 256)
+219 machine registers cannot be accessed
+220 illegal value of parameter
+221 too many pointers in a record
+222 too many global pointers
+223 too many record types
+224 too many pointer types
+225 address of pointer variable too large (move forward in text)
+226 too many exported procedures
+227 too many imported modules
+228 too many exported structures
+229 too many nested records for import
+230 too many constants (strings) in module
+231 too many link table entries (external procedures)
+232 too many commands in module
+233 record extension hierarchy too high
+234 export of recursive type not allowed
+240 identifier too long
+241 string too long
+242 address overflow
+244 cyclic type definition not allowed
+245 guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable
+
+Compiler Warnings
+301 implicit type cast
+306 inappropriate symbol file ignored
+307 no ELSE symbol after CASE statement sequence may lead to trap
+308 SYSTEM.VAL result includes memory past end of source variable; use SYSTEM.GET
+309 you should name this parameter type, or else no actual parameter will match
+310 redefining standard predefined type
+
+Run-time Error Messages
+ -1 assertion failed, cf. SYSTEM_assert
+ -2 invalid array index
+ -3 function procedure without RETURN statement
+ -4 invalid case in CASE statement
+ -5 type guard failed
+ -6 implicit type guard in record assignment failed
+ -7 invalid case in WITH statement
+ -8 value out of range
+ -9 (delayed) interrupt
+-10 NIL access
+-11 alignment error
+-12 zero divide
+-13 arithmetic overflow/underflow
+-14 invalid function argument
+-15 internal error

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/Files.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/Files.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
 
 #ifndef Files__h
 #define Files__h

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/Heap.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/Heap.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
 
 #ifndef Heap__h
 #define Heap__h

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/Modules.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/Modules.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef Modules__h
 #define Modules__h

+ 51 - 41
data/bin/voc/src/bootstrap/unix-44/OPB.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16
@@ -1738,6 +1738,16 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 			}
 			x->typ = OPT_linttyp;
 			break;
+		case 12: 
+			if (x->class == 8 || x->class == 9) {
+				OPB_err(126);
+			} else if (__IN(f, 0x60, 32)) {
+				OPB_Convert(&x, OPT_inttyp);
+			} else {
+				OPB_err(111);
+			}
+			x->typ = OPT_inttyp;
+			break;
 		case 6: 
 			OPB_MOp(23, &x);
 			break;
@@ -1847,7 +1857,7 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				OPB_err(111);
 			}
 			break;
-		case 13: case 14: 
+		case 14: case 15: 
 			if (OPB_NotVar(x)) {
 				OPB_err(112);
 			} else if (f != 4) {
@@ -1856,7 +1866,7 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				OPB_err(76);
 			}
 			break;
-		case 15: case 16: 
+		case 16: case 17: 
 			if (OPB_NotVar(x)) {
 				OPB_err(112);
 			} else if (x->typ->form != 7) {
@@ -1866,12 +1876,12 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				OPB_err(76);
 			}
 			break;
-		case 17: 
+		case 18: 
 			if (!__IN(x->typ->comp, 0x0c, 32)) {
 				OPB_err(131);
 			}
 			break;
-		case 18: 
+		case 19: 
 			if ((x->class == 7 && f == 3)) {
 				OPB_CharToString(x);
 				f = 8;
@@ -1882,7 +1892,7 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				OPB_err(111);
 			}
 			break;
-		case 19: 
+		case 20: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if (f == 4) {
@@ -1894,11 +1904,11 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				x->typ = OPT_linttyp;
 			}
 			break;
-		case 20: 
+		case 21: 
 			OPB_CheckLeaf(x, 0);
 			OPB_MOp(24, &x);
 			break;
-		case 12: 
+		case 13: 
 			if (x->class != 8) {
 				OPB_err(110);
 				x = OPB_NewIntConst(1);
@@ -1911,17 +1921,17 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				x = OPB_NewIntConst(1);
 			}
 			break;
-		case 21: 
+		case 22: 
 			OPB_MOp(25, &x);
 			break;
-		case 22: case 23: 
+		case 23: case 24: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if (!__IN(f, 0x9a, 32)) {
 				OPB_err(111);
 			}
 			break;
-		case 24: case 25: case 28: case 31: 
+		case 25: case 26: case 29: case 32: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) {
@@ -1931,7 +1941,7 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				x->typ = OPT_adrtyp;
 			}
 			break;
-		case 26: case 27: 
+		case 27: case 28: 
 			if ((f == 4 && x->class == 7)) {
 				if (x->conval->intval < 0 || x->conval->intval > -1) {
 					OPB_err(220);
@@ -1940,14 +1950,14 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				OPB_err(69);
 			}
 			break;
-		case 29: 
+		case 30: 
 			if (x->class != 8) {
 				OPB_err(110);
 			} else if (__IN(f, 0x0501, 32) || x->typ->comp == 3) {
 				OPB_err(111);
 			}
 			break;
-		case 30: 
+		case 31: 
 			if (OPB_NotVar(x)) {
 				OPB_err(112);
 			} else if (f == 11) {
@@ -1955,7 +1965,7 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				OPB_err(111);
 			}
 			break;
-		case 32: 
+		case 33: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 				x = OPB_NewBoolConst(0);
@@ -2002,7 +2012,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 	p = *par0;
 	f = x->typ->form;
 	switch (fctno) {
-		case 13: case 14: 
+		case 14: case 15: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 				p->typ = OPT_notyp;
@@ -2018,7 +2028,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 				p->typ = OPT_notyp;
 			}
 			break;
-		case 15: case 16: 
+		case 16: case 17: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if (f == 4) {
@@ -2031,7 +2041,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 			}
 			p->typ = OPT_notyp;
 			break;
-		case 17: 
+		case 18: 
 			if (!(f == 4) || x->class != 7) {
 				OPB_err(69);
 			} else if (x->typ->size == 1) {
@@ -2062,7 +2072,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 				OPB_err(132);
 			}
 			break;
-		case 18: 
+		case 19: 
 			if (OPB_NotVar(x)) {
 				OPB_err(112);
 			} else if ((__IN(x->typ->comp, 0x0c, 32) && x->typ->BaseTyp->form == 3)) {
@@ -2072,13 +2082,13 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 				t = x;
 				x = p;
 				p = t;
-				p = NewOp__54(19, 18, p, x);
+				p = NewOp__54(19, 19, p, x);
 			} else {
 				OPB_err(111);
 			}
 			p->typ = OPT_notyp;
 			break;
-		case 19: 
+		case 20: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if (f == 4) {
@@ -2122,13 +2132,13 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 				OPB_err(64);
 			}
 			break;
-		case 22: case 23: 
+		case 23: case 24: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if (f != 4) {
 				OPB_err(111);
 			} else {
-				if (fctno == 22) {
+				if (fctno == 23) {
 					p = NewOp__54(12, 27, p, x);
 				} else {
 					p = NewOp__54(12, 28, p, x);
@@ -2136,11 +2146,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 				p->typ = p->left->typ;
 			}
 			break;
-		case 24: case 25: case 26: case 27: 
+		case 25: case 26: case 27: case 28: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if (__IN(f, 0x18ff, 32)) {
-				if (fctno == 24 || fctno == 26) {
+				if (fctno == 25 || fctno == 27) {
 					if (OPB_NotVar(x)) {
 						OPB_err(112);
 					}
@@ -2154,7 +2164,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 			}
 			p->typ = OPT_notyp;
 			break;
-		case 28: 
+		case 29: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if (f == 4) {
@@ -2164,7 +2174,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 			}
 			p->typ = OPT_booltyp;
 			break;
-		case 29: 
+		case 30: 
 			if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 32)) || x->typ->comp == 3) {
 				OPB_err(126);
 			}
@@ -2184,17 +2194,17 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 			}
 			p = x;
 			break;
-		case 30: 
+		case 31: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if (f == 4) {
-				p = NewOp__54(19, 30, p, x);
+				p = NewOp__54(19, 31, p, x);
 			} else {
 				OPB_err(111);
 			}
 			p->typ = OPT_notyp;
 			break;
-		case 31: 
+		case 32: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) {
@@ -2205,7 +2215,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 			}
 			p->link = x;
 			break;
-		case 32: 
+		case 33: 
 			if ((f == 4 && x->class == 7)) {
 				if ((0 <= x->conval->intval && x->conval->intval <= 255)) {
 					OPB_BindNodes(28, OPT_notyp, &x, x);
@@ -2220,7 +2230,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 					} else if (p->class == 28) {
 						OPB_err(99);
 					} else {
-						p->subcl = 32;
+						p->subcl = 33;
 					}
 				} else {
 					OPB_err(218);
@@ -2262,12 +2272,12 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n)
 		} else {
 			OPB_err(111);
 		}
-	} else if ((fctno == 31 && n == 2)) {
+	} else if ((fctno == 32 && n == 2)) {
 		if (x->class == 8 || x->class == 9) {
 			OPB_err(126);
 		} else if (f == 4) {
 			node = OPT_NewNode(19);
-			node->subcl = 31;
+			node->subcl = 32;
 			node->right = p;
 			node->left = p->link;
 			p->link = x;
@@ -2287,22 +2297,22 @@ void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno)
 	INT16 dim;
 	OPT_Node x = NIL, p = NIL;
 	p = *par0;
-	if (fctno <= 19) {
+	if (fctno <= 20) {
 		if ((fctno == 1 && p->typ != OPT_notyp)) {
 			if (p->typ->comp == 3) {
 				OPB_err(65);
 			}
 			p->typ = OPT_notyp;
-		} else if (fctno <= 12) {
+		} else if (fctno <= 13) {
 			if (parno < 1) {
 				OPB_err(65);
 			}
 		} else {
-			if (((fctno == 13 || fctno == 14) && parno == 1)) {
+			if (((fctno == 14 || fctno == 15) && parno == 1)) {
 				OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(1));
 				p->subcl = fctno;
 				p->right->typ = p->left->typ;
-			} else if ((fctno == 17 && parno == 1)) {
+			} else if ((fctno == 18 && parno == 1)) {
 				if (p->typ->comp == 3) {
 					dim = 0;
 					while (p->class == 4) {
@@ -2318,7 +2328,7 @@ void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno)
 				OPB_err(65);
 			}
 		}
-	} else if (fctno == 32) {
+	} else if (fctno == 33) {
 		if (parno == 1) {
 			x = NIL;
 			OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(0));
@@ -2333,13 +2343,13 @@ void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno)
 			} else if (p->class == 28) {
 				OPB_err(99);
 			} else {
-				p->subcl = 32;
+				p->subcl = 33;
 			}
 		} else if (parno < 1) {
 			OPB_err(65);
 		}
 	} else {
-		if ((parno < 1 || (fctno > 21 && parno < 2)) || (fctno == 31 && parno < 3)) {
+		if ((parno < 1 || (fctno > 22 && parno < 2)) || (fctno == 32 && parno < 3)) {
 			OPB_err(65);
 		}
 	}

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/OPB.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef OPB__h
 #define OPB__h

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/OPC.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/OPC.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef OPC__h
 #define OPC__h

+ 12 - 38
data/bin/voc/src/bootstrap/unix-44/OPM.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16
@@ -1050,53 +1050,27 @@ static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len)
 {
 	CHAR testpath[4096];
 	Platform_FileIdentity identity;
+	BOOLEAN result;
 	__DUP(s, s__len, CHAR);
 	__COPY(OPM_InstallDir, testpath, 4096);
-	Strings_Append((CHAR*)"/lib/lib", 9, (void*)testpath, 4096);
-	Strings_Append((CHAR*)"voc", 4, (void*)testpath, 4096);
-	Strings_Append((CHAR*)"-O2.a", 6, (void*)testpath, 4096);
-	if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) {
-		__DEL(s);
-		return 0;
-	}
-	__COPY(OPM_InstallDir, testpath, 4096);
-	Strings_Append((CHAR*)"/2/include/Oberon.h", 20, (void*)testpath, 4096);
-	if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) {
-		__DEL(s);
-		return 0;
-	}
-	__COPY(OPM_InstallDir, testpath, 4096);
-	Strings_Append((CHAR*)"/2/sym/Files.sym", 17, (void*)testpath, 4096);
-	if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) {
-		__DEL(s);
-		return 0;
+	Strings_Append((CHAR*)"/voc.exe", 9, (void*)testpath, 4096);
+	result = Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0;
+	if (!result) {
+		__COPY(OPM_InstallDir, testpath, 4096);
+		Strings_Append((CHAR*)"/voc", 5, (void*)testpath, 4096);
+		result = Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0;
 	}
 	__DEL(s);
-	return 1;
+	return result;
 }
 
 static void OPM_FindInstallDir (void)
 {
-	INT16 i;
-	__COPY(Modules_BinaryDir, OPM_InstallDir, 1024);
-	Strings_Append((CHAR*)"/", 2, (void*)OPM_InstallDir, 1024);
-	Strings_Append((CHAR*)"voc", 4, (void*)OPM_InstallDir, 1024);
-	Strings_Append((CHAR*)".d", 3, (void*)OPM_InstallDir, 1024);
-	if (OPM_IsProbablyInstallDir(OPM_InstallDir, 1024)) {
-		return;
-	}
 	__COPY(Modules_BinaryDir, OPM_InstallDir, 1024);
-	i = Strings_Length(OPM_InstallDir, 1024);
-	while ((i > 0 && OPM_InstallDir[__X(i - 1, 1024)] != '/')) {
-		i -= 1;
-	}
-	if ((i > 0 && OPM_InstallDir[__X(i - 1, 1024)] == '/')) {
-		OPM_InstallDir[__X(i - 1, 1024)] = 0x00;
-		if (OPM_IsProbablyInstallDir(OPM_InstallDir, 1024)) {
-			return;
-		}
+	if (!OPM_IsProbablyInstallDir(OPM_InstallDir, 1024)) {
+		__COPY("../data/bin/voc", OPM_InstallDir, 1024);
 	}
-	__COPY("", OPM_InstallDir, 1024);
+	__COPY("../data/bin/voc", OPM_InstallDir, 1024);
 }
 
 static void EnumPtrs(void (*P)(void*))

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/OPM.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef OPM__h
 #define OPM__h

+ 3 - 3
data/bin/voc/src/bootstrap/unix-44/OPP.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16
@@ -669,7 +669,7 @@ static void OPP_StandProcCall (OPT_Node *x)
 	} else {
 		OPP_err(30);
 	}
-	if ((OPP_level > 0 && (m == 1 || m == 30))) {
+	if ((OPP_level > 0 && (m == 1 || m == 31))) {
 		OPT_topScope->link->leaf = 0;
 	}
 }
@@ -1501,7 +1501,7 @@ static void OPP_StatSeq (OPT_Node *stat)
 				OPP_CheckSym(27);
 				OPP_StatSeq(&s);
 				y = OPB_NewLeaf(id);
-				OPB_StPar1(&y, z, 13);
+				OPB_StPar1(&y, z, 14);
 				SetPos__35(y);
 				if (s == NIL) {
 					s = y;

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/OPP.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef OPP__h
 #define OPP__h

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/OPS.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/OPS.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
 
 #ifndef OPS__h
 #define OPS__h

+ 23 - 22
data/bin/voc/src/bootstrap/unix-44/OPT.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16
@@ -2098,18 +2098,18 @@ export void *OPT__init(void)
 	OPT_EnterTyp((CHAR*)"INT64", 4, 8, &OPT_int64typ);
 	OPT_EnterTyp((CHAR*)"SET32", 7, 4, &OPT_set32typ);
 	OPT_EnterTyp((CHAR*)"SET64", 7, 8, &OPT_set64typ);
-	OPT_EnterProc((CHAR*)"ADR", 20);
-	OPT_EnterProc((CHAR*)"CC", 21);
-	OPT_EnterProc((CHAR*)"LSH", 22);
-	OPT_EnterProc((CHAR*)"ROT", 23);
-	OPT_EnterProc((CHAR*)"GET", 24);
-	OPT_EnterProc((CHAR*)"PUT", 25);
-	OPT_EnterProc((CHAR*)"GETREG", 26);
-	OPT_EnterProc((CHAR*)"PUTREG", 27);
-	OPT_EnterProc((CHAR*)"BIT", 28);
-	OPT_EnterProc((CHAR*)"VAL", 29);
-	OPT_EnterProc((CHAR*)"NEW", 30);
-	OPT_EnterProc((CHAR*)"MOVE", 31);
+	OPT_EnterProc((CHAR*)"ADR", 21);
+	OPT_EnterProc((CHAR*)"CC", 22);
+	OPT_EnterProc((CHAR*)"LSH", 23);
+	OPT_EnterProc((CHAR*)"ROT", 24);
+	OPT_EnterProc((CHAR*)"GET", 25);
+	OPT_EnterProc((CHAR*)"PUT", 26);
+	OPT_EnterProc((CHAR*)"GETREG", 27);
+	OPT_EnterProc((CHAR*)"PUTREG", 28);
+	OPT_EnterProc((CHAR*)"BIT", 29);
+	OPT_EnterProc((CHAR*)"VAL", 30);
+	OPT_EnterProc((CHAR*)"NEW", 31);
+	OPT_EnterProc((CHAR*)"MOVE", 32);
 	OPT_syslink = OPT_topScope->right;
 	OPT_universe = OPT_topScope;
 	OPT_topScope->right = NIL;
@@ -2131,21 +2131,22 @@ export void *OPT__init(void)
 	OPT_EnterProc((CHAR*)"CAP", 3);
 	OPT_EnterProc((CHAR*)"ORD", 4);
 	OPT_EnterProc((CHAR*)"ENTIER", 5);
+	OPT_EnterProc((CHAR*)"FLOOR", 12);
 	OPT_EnterProc((CHAR*)"ODD", 6);
 	OPT_EnterProc((CHAR*)"MIN", 7);
 	OPT_EnterProc((CHAR*)"MAX", 8);
 	OPT_EnterProc((CHAR*)"CHR", 9);
 	OPT_EnterProc((CHAR*)"SHORT", 10);
 	OPT_EnterProc((CHAR*)"LONG", 11);
-	OPT_EnterProc((CHAR*)"SIZE", 12);
-	OPT_EnterProc((CHAR*)"INC", 13);
-	OPT_EnterProc((CHAR*)"DEC", 14);
-	OPT_EnterProc((CHAR*)"INCL", 15);
-	OPT_EnterProc((CHAR*)"EXCL", 16);
-	OPT_EnterProc((CHAR*)"LEN", 17);
-	OPT_EnterProc((CHAR*)"COPY", 18);
-	OPT_EnterProc((CHAR*)"ASH", 19);
-	OPT_EnterProc((CHAR*)"ASSERT", 32);
+	OPT_EnterProc((CHAR*)"SIZE", 13);
+	OPT_EnterProc((CHAR*)"INC", 14);
+	OPT_EnterProc((CHAR*)"DEC", 15);
+	OPT_EnterProc((CHAR*)"INCL", 16);
+	OPT_EnterProc((CHAR*)"EXCL", 17);
+	OPT_EnterProc((CHAR*)"LEN", 18);
+	OPT_EnterProc((CHAR*)"COPY", 19);
+	OPT_EnterProc((CHAR*)"ASH", 20);
+	OPT_EnterProc((CHAR*)"ASSERT", 33);
 	OPT_impCtxt.ref[0] = OPT_undftyp;
 	OPT_impCtxt.ref[1] = OPT_bytetyp;
 	OPT_impCtxt.ref[2] = OPT_booltyp;

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/OPT.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef OPT__h
 #define OPT__h

+ 27 - 15
data/bin/voc/src/bootstrap/unix-44/OPV.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16
@@ -29,6 +29,7 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc);
 static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec);
 static void OPV_DefineTDescs (OPT_Node n);
 static void OPV_Entier (OPT_Node n, INT16 prec);
+static void OPV_Floor (OPT_Node n, INT16 prec);
 static void OPV_GetTProcNum (OPT_Object obj);
 static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc);
 static BOOLEAN OPV_ImplicitReturn (OPT_Node n);
@@ -352,6 +353,17 @@ static void OPV_Entier (OPT_Node n, INT16 prec)
 	}
 }
 
+static void OPV_Floor (OPT_Node n, INT16 prec)
+{
+	if (__IN(n->typ->form, 0x60, 32)) {
+		OPM_WriteString((CHAR*)"__FLOOR(", 9);
+		OPV_expr(n, -1);
+		OPM_Write(')');
+	} else {
+		OPV_expr(n, prec);
+	}
+}
+
 static void OPV_SizeCast (OPT_Node n, INT32 to)
 {
 	if ((to < n->typ->size && __IN(2, OPM_Options, 32))) {
@@ -455,7 +467,7 @@ static void OPV_design (OPT_Node n, INT16 prec)
 	OPT_Struct typ = NIL;
 	INT16 class, designPrec, comp;
 	OPT_Node d = NIL, x = NIL;
-	INT16 dims, i, _for__26;
+	INT16 dims, i, _for__27;
 	comp = n->typ->comp;
 	obj = n->obj;
 	class = n->class;
@@ -531,9 +543,9 @@ static void OPV_design (OPT_Node n, INT16 prec)
 					}
 					x = x->left;
 				}
-				_for__26 = dims;
+				_for__27 = dims;
 				i = 1;
-				while (i <= _for__26) {
+				while (i <= _for__27) {
 					OPM_Write(')');
 					i += 1;
 				}
@@ -1342,21 +1354,21 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc)
 							OPV_NewArr(n->left, n->right);
 						}
 						break;
-					case 13: case 14: 
+					case 14: case 15: 
 						OPV_expr(n->left, -1);
-						OPC_Increment(n->subcl == 14);
+						OPC_Increment(n->subcl == 15);
 						OPV_expr(n->right, -1);
 						break;
-					case 15: case 16: 
+					case 16: case 17: 
 						OPV_expr(n->left, -1);
-						OPC_SetInclude(n->subcl == 16);
+						OPC_SetInclude(n->subcl == 17);
 						OPM_WriteString((CHAR*)"__SETOF(", 9);
 						OPV_expr(n->right, -1);
 						OPM_WriteString((CHAR*)",", 2);
 						OPM_WriteInt(__ASHL(n->left->typ->size, 3));
 						OPM_Write(')');
 						break;
-					case 18: 
+					case 19: 
 						OPM_WriteString((CHAR*)"__COPY(", 8);
 						OPV_expr(n->right, -1);
 						OPM_WriteString((CHAR*)", ", 3);
@@ -1365,7 +1377,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc)
 						OPV_Len(n->left, 0);
 						OPM_Write(')');
 						break;
-					case 31: 
+					case 32: 
 						OPM_WriteString((CHAR*)"__MOVE(", 8);
 						OPV_expr(n->right, -1);
 						OPM_WriteString((CHAR*)", ", 3);
@@ -1374,7 +1386,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc)
 						OPV_expr(n->right->link, -1);
 						OPM_Write(')');
 						break;
-					case 24: 
+					case 25: 
 						OPM_WriteString((CHAR*)"__GET(", 7);
 						OPV_expr(n->right, -1);
 						OPM_WriteString((CHAR*)", ", 3);
@@ -1383,7 +1395,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc)
 						OPC_Ident(n->left->typ->strobj);
 						OPM_Write(')');
 						break;
-					case 25: 
+					case 26: 
 						OPM_WriteString((CHAR*)"__PUT(", 7);
 						OPV_expr(n->left, -1);
 						OPM_WriteString((CHAR*)", ", 3);
@@ -1392,10 +1404,10 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc)
 						OPC_Ident(n->right->typ->strobj);
 						OPM_Write(')');
 						break;
-					case 26: case 27: 
+					case 27: case 28: 
 						OPM_err(200);
 						break;
-					case 30: 
+					case 31: 
 						OPM_WriteString((CHAR*)"__SYSNEW(", 10);
 						OPV_design(n->left, -1);
 						OPM_WriteString((CHAR*)", ", 3);
@@ -1427,7 +1439,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc)
 				OPV_ActualPar(n->right, n->obj);
 				break;
 			case 20: 
-				if (n->subcl != 32) {
+				if (n->subcl != 33) {
 					OPV_IfStat(n, 0, outerProc);
 				} else if (__IN(7, OPM_Options, 32)) {
 					OPM_WriteString((CHAR*)"__ASSERT(", 10);

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/OPV.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef OPV__h
 #define OPV__h

+ 136 - 1
data/bin/voc/src/bootstrap/unix-44/Out.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16
@@ -16,6 +16,8 @@ static INT16 Out_in;
 
 
 export void Out_Char (CHAR ch);
+export void Out_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len);
+export INT16 Out_Expo (REAL x);
 export void Out_Flush (void);
 export void Out_Hex (INT64 x, INT64 n);
 export void Out_Int (INT64 x, INT64 n);
@@ -24,6 +26,7 @@ export void Out_Ln (void);
 export void Out_LongReal (LONGREAL x, INT16 n);
 export void Out_Open (void);
 export void Out_Real (REAL x, INT16 n);
+export void Out_RealFix (REAL x, INT16 n, INT16 k);
 static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_);
 export void Out_String (CHAR *str, ADDRESS str__len);
 export LONGREAL Out_Ten (INT16 e);
@@ -328,6 +331,138 @@ void Out_LongReal (LONGREAL x, INT16 n)
 	Out_RealP(x, n, 1);
 }
 
+void Out_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len)
+{
+	INT32 i, j, k;
+	if (x < (LONGREAL)0) {
+		x = -x;
+	}
+	k = 0;
+	if (n > 9) {
+		i = (INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000);
+		j = (INT32)__ENTIER(x - i * (LONGREAL)1000000000);
+		if (j < 0) {
+			j = 0;
+		}
+		while (k < 9) {
+			d[__X(k, d__len)] = (CHAR)((int)__MOD(j, 10) + 48);
+			j = __DIV(j, 10);
+			k += 1;
+		}
+	} else {
+		i = (INT32)__ENTIER(x);
+	}
+	while (k < n) {
+		d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48);
+		i = __DIV(i, 10);
+		k += 1;
+	}
+}
+
+INT16 Out_Expo (REAL x)
+{
+	INT16 i;
+	__GET((ADDRESS)&x + 2, i, INT16);
+	return __MASK(__ASHR(i, 7), -256);
+}
+
+static struct RealFix__13 {
+	INT16 *i;
+	CHAR (*d)[9];
+	struct RealFix__13 *lnk;
+} *RealFix__13_s;
+
+static void dig__14 (INT16 n);
+static void seq__16 (CHAR ch, INT16 n);
+
+static void seq__16 (CHAR ch, INT16 n)
+{
+	while (n > 0) {
+		Out_Char(ch);
+		n -= 1;
+	}
+}
+
+static void dig__14 (INT16 n)
+{
+	while (n > 0) {
+		*RealFix__13_s->i -= 1;
+		Out_Char((*RealFix__13_s->d)[__X(*RealFix__13_s->i, 9)]);
+		n -= 1;
+	}
+}
+
+void Out_RealFix (REAL x, INT16 n, INT16 k)
+{
+	INT16 e, i;
+	CHAR sign;
+	REAL x0;
+	CHAR d[9];
+	struct RealFix__13 _s;
+	_s.i = &i;
+	_s.d = (void*)d;
+	_s.lnk = RealFix__13_s;
+	RealFix__13_s = &_s;
+	e = Out_Expo(x);
+	if (k < 0) {
+		k = 0;
+	}
+	if (e == 0) {
+		seq__16(' ', (n - k) - 2);
+		Out_Char('0');
+		seq__16(' ', k + 1);
+	} else if (e == 255) {
+		Out_String((CHAR*)" NaN", 5);
+		seq__16(' ', n - 4);
+	} else {
+		e = __ASHR((e - 127) * 77, 8);
+		if (x < (REAL)0) {
+			sign = '-';
+			x = -x;
+		} else {
+			sign = ' ';
+		}
+		if (e >= 0) {
+			x = (x / (LONGREAL)Out_Ten(e));
+		} else {
+			x = (Out_Ten(-e) * x);
+		}
+		if (x >= (REAL)10) {
+			x =   1.0000000e-001 * x;
+			e += 1;
+		}
+		if (k + e >= 8) {
+			k = 8 - e;
+		} else if (k + e < 0) {
+			k = -e;
+			x = (REAL)0;
+		}
+		x0 = Out_Ten(k + e);
+		x = x0 * x +   5.0000000e-001;
+		if (x >= (REAL)10 * x0) {
+			e += 1;
+		}
+		e += 1;
+		i = k + e;
+		Out_ConvertL(x, i, (void*)d, 9);
+		if (e > 0) {
+			seq__16(' ', ((n - e) - k) - 2);
+			Out_Char(sign);
+			dig__14(e);
+			Out_Char('.');
+			dig__14(k);
+		} else {
+			seq__16(' ', (n - k) - 3);
+			Out_Char(sign);
+			Out_Char('0');
+			Out_Char('.');
+			seq__16('0', -e);
+			dig__14(k + e);
+		}
+	}
+	RealFix__13_s = _s.lnk;
+}
+
 
 export void *Out__init(void)
 {

+ 4 - 1
data/bin/voc/src/bootstrap/unix-44/Out.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef Out__h
 #define Out__h
@@ -10,6 +10,8 @@ import BOOLEAN Out_IsConsole;
 
 
 import void Out_Char (CHAR ch);
+import void Out_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len);
+import INT16 Out_Expo (REAL x);
 import void Out_Flush (void);
 import void Out_Hex (INT64 x, INT64 n);
 import void Out_Int (INT64 x, INT64 n);
@@ -17,6 +19,7 @@ import void Out_Ln (void);
 import void Out_LongReal (LONGREAL x, INT16 n);
 import void Out_Open (void);
 import void Out_Real (REAL x, INT16 n);
+import void Out_RealFix (REAL x, INT16 n, INT16 k);
 import void Out_String (CHAR *str, ADDRESS str__len);
 import LONGREAL Out_Ten (INT16 e);
 import void *Out__init(void);

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/Platform.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/Platform.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef Platform__h
 #define Platform__h

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/Reals.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/Reals.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef Reals__h
 #define Reals__h

+ 218 - 0
data/bin/voc/src/bootstrap/unix-44/SYSTEM.c

@@ -0,0 +1,218 @@
+/*
+*   The body prefix file of the voc(jet backend) runtime system, Version 1.0
+*
+*   Copyright (c) Software Templ, 1994, 1995
+*
+*   Module SYSTEM is subject to change any time without prior notification.
+*   Software Templ disclaims all warranties with regard to module SYSTEM,
+*   in particular shall Software Templ not be liable for any damage resulting
+*   from inappropriate use or modification of module SYSTEM.
+*
+*   Version 1.1  jt, 24.11.95  fixes for correct pointer arithmetic on Cray computers
+*   jt 31.1.2007  ANSI prototypes for malloc and exit in order to avoid cc warnings
+*
+*/
+
+#include "SYSTEM.h"
+#include "stdarg.h"
+#include <signal.h>
+
+
+// Procedure verions of SYSTEM.H versions used when a multiply accessed
+// parameter has side effects.
+
+
+
+
+INT64 SYSTEM_DIV(INT64 x, INT64 y)
+{
+  if (x == 0) return 0;
+  if (x >= 0)
+    if (y >= 0) {return x/y;}
+    else        {return -((x-y-1)/(-y));}
+  else
+    if (y >= 0) {return -((y-x-1)/y);}
+    else        {return (-x)/(-y);}
+}
+
+INT64 SYSTEM_MOD(INT64 x, INT64 y)
+{
+  if (x == 0) return 0;
+  if (x >= 0)
+    if (y >= 0) {return x % y;}
+    else        {return (y+1) + ((x-1) % (-y));}
+  else
+    if (y >= 0) {return (y-1) - ((-x-1) % y);}
+    else        {return -((-x) % (-y));}
+}
+
+INT64 SYSTEM_ENTIER(double x)
+{
+    INT64 y;
+    if (x >= 0)
+        return (INT64)x;
+    else {
+        y = (INT64)x;
+        if (y <= x) return y; else return y - 1;
+    }
+}
+
+
+
+void SYSTEM_INHERIT(ADDRESS *t, ADDRESS *t0)
+{
+    t -= __TPROC0OFF;
+    t0 -= __TPROC0OFF;
+    while (*t0 != __EOM) {*t = *t0; t--; t0--;}
+}
+
+
+void SYSTEM_ENUMP(void *adr, ADDRESS n, void (*P)())
+{
+    while (n > 0) {
+        P((ADDRESS)(*((void**)(adr))));
+        adr = ((void**)adr) + 1;
+        n--;
+    }
+}
+
+void SYSTEM_ENUMR(void *adr, ADDRESS *typ, ADDRESS size, ADDRESS n, void (*P)())
+{
+    ADDRESS *t, off;
+    typ++;
+    while (n > 0) {
+        t = typ;
+        off = *t;
+        while (off >= 0) {P(*(ADDRESS*)((char*)adr+off)); t++; off = *t;}
+        adr = ((char*)adr) + size;
+        n--;
+    }
+}
+
+extern void Heap_Lock();
+extern void Heap_Unlock();
+
+SYSTEM_PTR SYSTEM_NEWARR(ADDRESS *typ, ADDRESS elemsz, int elemalgn, int nofdim, int nofdyn, ...)
+{
+    ADDRESS nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off;
+    va_list ap;
+    va_start(ap, nofdyn);
+    nofelems = 1;
+    while (nofdim > 0) {
+        nofelems = nofelems * va_arg(ap, ADDRESS); nofdim--;
+        if (nofelems <= 0) __HALT(-20);
+    }
+    va_end(ap);
+    dataoff = nofdyn * sizeof(ADDRESS);
+    if (elemalgn > sizeof(ADDRESS)) {
+        n = dataoff % elemalgn;
+        if (n != 0) dataoff += elemalgn - n;
+    }
+    size = dataoff + nofelems * elemsz;
+    Heap_Lock();
+    if (typ == NIL) {
+        /* element typ does not contain pointers */
+        x = Heap_NEWBLK(size);
+    }
+    else if (typ == (ADDRESS*)POINTER__typ) {
+        /* element type is a pointer */
+        x = Heap_NEWBLK(size + nofelems * sizeof(ADDRESS));
+        p = (ADDRESS*)(ADDRESS)x[-1];
+        p[-nofelems] = *p;  /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */
+        p -= nofelems - 1; n = 1;   /* n =1 for skipping the size field */
+        while (n <= nofelems) {*p = n*sizeof(ADDRESS); p++; n++;}
+        *p = - (nofelems + 1) * sizeof(ADDRESS);    /* sentinel */
+        x[-1] -= nofelems * sizeof(ADDRESS);
+    }
+    else {
+        /* element type is a record that contains pointers */
+        ptab = typ + 1; nofptrs = 0;
+        while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */
+        nptr = nofelems * nofptrs;  /* total number of pointers */
+        x = Heap_NEWBLK(size + nptr * sizeof(ADDRESS));
+        p = (ADDRESS*)(ADDRESS)x[- 1];
+        p[-nptr] = *p;  /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */
+        p -= nptr - 1; n = 0; off = dataoff;
+        while (n < nofelems) {i = 0;
+            while (i < nofptrs) {*p = off + ptab[i]; p++; i++;}
+            off += elemsz; n++;
+        }
+        *p = - (nptr + 1) * sizeof(ADDRESS);    /* sentinel */
+        x[-1] -= nptr * sizeof(ADDRESS);
+    }
+    if (nofdyn != 0) {
+        /* setup len vector for index checks */
+        va_start(ap, nofdyn);
+        p = x;
+        while (nofdyn > 0) {*p = va_arg(ap, ADDRESS); p++, nofdyn--;}
+        va_end(ap);
+    }
+    Heap_Unlock();
+    return x;
+}
+
+
+
+
+typedef void (*SystemSignalHandler)(INT32); // = Platform_SignalHandler
+
+#ifndef _WIN32
+
+    SystemSignalHandler handler[3] = {0};
+
+    // Provide signal handling for Unix based systems
+    void signalHandler(int s) {
+        if (s >= 2  &&  s <= 4) handler[s-2](s);
+        // (Ignore other signals)
+    }
+
+    void SystemSetHandler(int s, ADDRESS h) {
+        if (s >= 2 && s <= 4) {
+            int needtosetsystemhandler = handler[s-2] == 0;
+            handler[s-2] = (SystemSignalHandler)h;
+            if (needtosetsystemhandler) {signal(s, signalHandler);}
+        }
+    }
+
+#else
+
+    // Provides Windows callback handlers for signal-like scenarios
+    #include "WindowsWrapper.h"
+
+    SystemSignalHandler SystemInterruptHandler = 0;
+    SystemSignalHandler SystemQuitHandler      = 0;
+    BOOL ConsoleCtrlHandlerSet = FALSE;
+
+    BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) {
+        if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) {
+            if (SystemInterruptHandler) {
+                SystemInterruptHandler(2); // SIGINT
+                return TRUE;
+            }
+        } else { // Close, logoff or shutdown
+            if (SystemQuitHandler) {
+                SystemQuitHandler(3); // SIGQUIT
+                return TRUE;
+            }
+        }
+        return FALSE;
+    }
+
+    void EnsureConsoleCtrlHandler() {
+        if (!ConsoleCtrlHandlerSet) {
+        SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE);
+            ConsoleCtrlHandlerSet = TRUE;
+        }
+    }
+
+    void SystemSetInterruptHandler(ADDRESS h) {
+        EnsureConsoleCtrlHandler();
+        SystemInterruptHandler = (SystemSignalHandler)h;
+    }
+
+    void SystemSetQuitHandler(ADDRESS h) {
+        EnsureConsoleCtrlHandler();
+        SystemQuitHandler = (SystemSignalHandler)h;
+    }
+
+#endif

+ 326 - 0
data/bin/voc/src/bootstrap/unix-44/SYSTEM.h

@@ -0,0 +1,326 @@
+#ifndef SYSTEM__h
+#define SYSTEM__h
+
+
+// 64 bit system detection
+
+#if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64)
+  #define o__64
+#endif
+
+
+// Declare memcpy in a way compatible with C compilers intrinsic
+// built in implementations.
+
+#if defined (o__64)
+  #if defined(_WIN64)
+    typedef unsigned long long size_t;
+  #else
+    typedef unsigned long      size_t;
+  #endif
+#else
+  typedef unsigned int         size_t;
+#endif
+
+#define _SIZE_T_DECLARED // For FreeBSD
+#define _SIZE_T_DEFINED_ // For OpenBSD
+
+void *memcpy(void *dest, const void *source, size_t size);
+#if defined _MSC_VER
+#define alloca _alloca
+#endif
+void *alloca(size_t size);
+
+
+// Declare fixed size versions of basic intger types
+
+#if defined (o__64) && !defined(_WIN64)
+  // LP64
+  typedef long               INT64;
+  typedef unsigned long      UINT64;
+#else
+  // ILP32 or LLP64
+  typedef long long          INT64;
+  typedef unsigned long long UINT64;
+#endif
+
+typedef int                  INT32;
+typedef unsigned int         UINT32;
+
+typedef short int            INT16;
+typedef unsigned short int   UINT16;
+
+typedef signed char          INT8;
+typedef unsigned char        UINT8;
+
+
+// The compiler uses 'import' and 'export' which translate to 'extern' and
+// nothing respectively.
+
+#define import extern
+#define export
+
+
+
+// Known constants
+
+#define NIL          ((void*)0)
+#define __MAXEXT     16
+#define POINTER__typ ((ADDRESS*)(1))  // not NIL and not a valid type
+
+
+// Oberon types
+
+typedef INT8   BOOLEAN;
+typedef INT8   SYSTEM_BYTE;
+typedef UINT8  CHAR;
+typedef float  REAL;
+typedef double LONGREAL;
+typedef void*  SYSTEM_PTR;
+
+
+
+// 'ADDRESS' is a synonym for an integer of pointer size
+
+#if defined (o__64)
+  #define ADDRESS INT64
+#else
+  #define ADDRESS INT32
+#endif
+
+
+
+// ----------------------------------------------------------------------
+// ----------------------------------------------------------------------
+
+
+
+// OS Memory allocation interfaces are in PlatformXXX.Mod
+
+extern ADDRESS Platform_OSAllocate (ADDRESS size);
+extern void    Platform_OSFree     (ADDRESS addr);
+
+
+// Assertions and Halts
+
+extern void Modules_Halt(INT32 x);
+extern void Modules_AssertFail(INT32 x);
+
+#define __HALT(x)         Modules_Halt((INT32)(x))
+#define __ASSERT(cond, x) if (!(cond)) Modules_AssertFail((INT32)(x))
+
+
+// Index checking
+
+static inline INT64 __XF(UINT64 i, UINT64 ub) {if (i >= ub) {__HALT(-2);} return i;}
+#define __X(i, ub) (((i)<(ub))?i:(__HALT(-2),0))
+
+
+// Range checking, and checked SHORT and CHR functions
+
+static inline INT64 __RF(UINT64 i, UINT64 ub) {if (i >= ub) {__HALT(-8);} return i;}
+#define __R(i, ub)      (((i)<(ub))?i:(__HALT(-8),0))
+#define __SHORT(x, ub)  ((int)((UINT64)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0)))
+#define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub)))
+#define __CHR(x)        ((CHAR)__R(x, 256))
+#define __CHRF(x)       ((CHAR)__RF(x, 256))
+
+
+
+// Signal handling in SYSTEM.c
+
+#ifndef _WIN32
+  extern void SystemSetHandler(int s, ADDRESS h);
+#else
+  extern void SystemSetInterruptHandler(ADDRESS h);
+  extern void SystemSetQuitHandler     (ADDRESS h);
+#endif
+
+
+
+// String comparison
+
+static inline int __str_cmp(CHAR *x, CHAR *y){
+  INT64 i = 0;
+  CHAR ch1, ch2;
+  do {ch1 = x[i]; ch2 = y[i]; i++;
+    if (!ch1) return -(int)ch2;
+  } while (ch1==ch2);
+  return (int)ch1 - (int)ch2;
+}
+#define __STRCMP(a,b) __str_cmp((CHAR*)(a), (CHAR*)(b))
+
+
+
+// Inline string, record and array copy
+
+#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \
+                         while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;}
+#define __DUPARR(v, t)  v=(void*)memcpy(v##__copy,v,sizeof(t))
+#define __DUP(x, l, t)  x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t))
+#define __DEL(x)
+
+
+/* SYSTEM ops */
+
+#define __VAL(t, x)     (*(t*)&(x))
+
+#define __GET(a, x, t)  x=*(t*)(ADDRESS)(a)
+#define __PUT(a, x, t)  *(t*)(ADDRESS)(a)=x
+
+#define __LSHL(x, n, s) ((INT##s)((UINT##s)(x)<<(n)))
+#define __LSHR(x, n, s) ((INT##s)((UINT##s)(x)>>(n)))
+#define __LSH(x, n, s)  ((n)>=0? __LSHL(x, n, s): __LSHR(x, -(n), s))
+
+#define __ROTL(x, n, s) ((INT##s)((UINT##s)(x)<<(n)|(UINT##s)(x)>>(s-(n))))
+#define __ROTR(x, n, s) ((INT##s)((UINT##s)(x)>>(n)|(UINT##s)(x)<<(s-(n))))
+#define __ROT(x, n, s)  ((n)>=0? __ROTL(x, n, s): __ROTR(x, -(n), s))
+
+#define __ASHL(x, n)    ((INT64)(x)<<(n))
+#define __ASHR(x, n)    ((INT64)(x)>>(n))
+#define __ASH(x, n)     ((n)>=0?__ASHL(x,n):__ASHR(x,-(n)))
+static inline INT64 SYSTEM_ASH(INT64 x, INT64 n) {return __ASH(x,n);}
+#define __ASHF(x, n)    SYSTEM_ASH((INT64)(x), (INT64)(n))
+
+#define __MOVE(s, d, n) memcpy((char*)(ADDRESS)(d),(char*)(ADDRESS)(s),n)
+
+
+extern INT64 SYSTEM_DIV(INT64 x, INT64 y);
+#define __DIVF(x, y) SYSTEM_DIV(x, y)
+#define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y))
+
+
+extern INT64 SYSTEM_MOD(INT64 x, INT64 y);
+#define __MODF(x, y) SYSTEM_MOD(x, y)
+#define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y))
+
+
+extern INT64 SYSTEM_ENTIER (double x);
+#define __ENTIER(x) SYSTEM_ENTIER(x)
+
+
+#define __ABS(x) (((x)<0)?-(x):(x))
+
+static inline INT32 SYSTEM_ABS64(INT64 i) {return i >= 0 ? i : -i;}
+static inline INT64 SYSTEM_ABS32(INT32 i) {return i >= 0 ? i : -i;}
+#define __ABSF(x) ((sizeof(x) <= 4) ? SYSTEM_ABS32(x) : SYSTEM_ABS64(x))
+
+static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;}
+#define __ABSFD(x) SYSTEM_ABSD(x)
+
+#define __CAP(ch)       ((CHAR)((ch)&0x5f))
+#define __ODD(x)        ((x)&1)
+
+#define __IN(x, s, size)     (((unsigned int)(x))<size && ((((UINT##size)(s))>>(x))&1))
+// todo tested versions of SETOF and SETRNG: check that x, l and h fit size
+#define __SETOF(x, size)     ((UINT##size)1<<(x))
+#define __SETRNG(l, h, size) ((~(UINT##size)0<<(l))&~(UINT##size)0>>(size-1-(h)))
+
+#define __MASK(x, m) ((x)&~(m))
+#define __BIT(x, n)  (*(UINT64*)(x)>>(n)&1)
+
+
+
+// Runtime checks
+
+#define __RETCHK     __retchk: __HALT(-3); return 0;
+#define __CASECHK    __HALT(-4)
+#define __WITHCHK    __HALT(-7)
+
+
+#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(ADDRESS)typ##__typ)
+#define  __TYPEOF(p)          (*(((ADDRESS**)(p))-1))
+#define __ISP(p, typ, level)  __IS(__TYPEOF(p),typ,level)
+
+
+#define __GUARDP(p, typ, level)    ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p)))
+#define __GUARDR(r, typ, level)    (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r))))
+#define __GUARDA(p, typ, level)    ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p)))
+#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p)
+#define __GUARDEQP(p, typ)         if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*((typ*)p)
+
+
+
+// Module entry/registration/exit
+
+extern void       Heap_REGCMD();
+extern SYSTEM_PTR Heap_REGMOD();
+extern void       Heap_REGTYP();
+extern void       Heap_INCREF();
+
+#define __DEFMOD              static void *m; if (m!=0) {return m;}
+#define __REGCMD(name, cmd)   Heap_REGCMD(m, (CHAR*)name, cmd)
+#define __REGMOD(name, enum)  if (m==0) {m = Heap_REGMOD((CHAR*)name,enum);}
+#define __ENDMOD              return m
+#define __MODULE_IMPORT(name) Heap_INCREF(name##__init())
+
+
+
+// Main module initialisation, registration and finalisation
+
+extern void Modules_Init(INT32 argc, ADDRESS argv);
+extern void Heap_FINALL();
+
+#define __INIT(argc, argv)    static void *m; Modules_Init(argc, (ADDRESS)&argv);
+#define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum)
+#define __FINI                Heap_FINALL(); return 0
+
+
+// Memory allocation
+
+extern SYSTEM_PTR Heap_NEWBLK (ADDRESS size);
+extern SYSTEM_PTR Heap_NEWREC (ADDRESS tag);
+extern SYSTEM_PTR SYSTEM_NEWARR(ADDRESS*, ADDRESS, int, int, int, ...);
+
+#define __SYSNEW(p, len) p = Heap_NEWBLK((ADDRESS)(len))
+#define __NEW(p, t)      p = Heap_NEWREC((ADDRESS)t##__typ)
+#define __NEWARR         SYSTEM_NEWARR
+
+
+
+/* Type handling */
+
+extern void SYSTEM_INHERIT(ADDRESS *t, ADDRESS *t0);
+extern void SYSTEM_ENUMP  (void *adr, ADDRESS n, void (*P)());
+extern void SYSTEM_ENUMR  (void *adr, ADDRESS *typ, ADDRESS size, ADDRESS n, void (*P)());
+
+
+#define __TDESC(t, m, n)                                                \
+  static struct t##__desc {                                             \
+    ADDRESS  tproc[m];         /* Proc for each ptr field            */ \
+    ADDRESS  tag;                                                       \
+    ADDRESS  next;             /* Module table type list points here */ \
+    ADDRESS  level;                                                     \
+    ADDRESS  module;                                                    \
+    char     name[24];                                                  \
+    ADDRESS  basep[__MAXEXT];  /* List of bases this extends         */ \
+    ADDRESS  reserved;                                                  \
+    ADDRESS  blksz;            /* xxx_typ points here                */ \
+    ADDRESS  ptr[n+1];         /* Offsets of ptrs up to -ve sentinel */ \
+  } t##__desc
+
+#define __BASEOFF   (__MAXEXT+1)                           // blksz as index to base.
+#define __TPROC0OFF (__BASEOFF+24/sizeof(ADDRESS)+5)       // blksz as index to tproc IFF m=1.
+#define __EOM 1
+#define __TDFLDS(name, size)          {__EOM}, 1, 0, 0, 0, name, {0}, 0, size
+#define __ENUMP(adr, n, P)            SYSTEM_ENUMP(adr, (ADDRESS)(n), P)
+#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (ADDRESS)(size), (ADDRESS)(n), P)
+
+#define __INITYP(t, t0, level) \
+  t##__typ               = (ADDRESS*)&t##__desc.blksz;                                                    \
+  memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(ADDRESS));                                  \
+  t##__desc.basep[level] = (ADDRESS)t##__typ;                                                             \
+  t##__desc.module       = (ADDRESS)m;                                                                    \
+  if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15);                                                      \
+  t##__desc.blksz        = (t##__desc.blksz+5*sizeof(ADDRESS)-1)/(4*sizeof(ADDRESS))*(4*sizeof(ADDRESS)); \
+  Heap_REGTYP(m, (ADDRESS)&t##__desc.next);                                                               \
+  SYSTEM_INHERIT(t##__typ, t0##__typ)
+
+// Oberon-2 type bound procedures support
+#define __INITBP(t, proc, num)            *(t##__typ-(__TPROC0OFF+num))=(ADDRESS)proc
+#define __SEND(typ, num, funtyp, parlist) ((funtyp)((ADDRESS)*(typ-(__TPROC0OFF+num))))parlist
+
+
+
+
+#endif

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/Strings.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/Strings.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef Strings__h
 #define Strings__h

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/Texts.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/Texts.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef Texts__h
 #define Texts__h

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/VT100.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/VT100.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef VT100__h
 #define VT100__h

+ 10 - 0
data/bin/voc/src/bootstrap/unix-44/WindowsWrapper.h

@@ -0,0 +1,10 @@
+// WindowsWrapper.h
+//
+// Includes Windows.h while avoiding conflicts with Oberon types.
+
+
+#define BOOLEAN _BOOLEAN
+#define CHAR    _CHAR
+#include <windows.h>
+#undef BOOLEAN
+#undef CHAR

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/extTools.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-44/extTools.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef extTools__h
 #define extTools__h

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/Compiler.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 2 - 2
data/bin/voc/src/bootstrap/unix-48/Configuration.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16
@@ -19,6 +19,6 @@ export void *Configuration__init(void)
 	__DEFMOD;
 	__REGMOD("Configuration", 0);
 /* BEGIN */
-	__MOVE("2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76);
+	__MOVE("2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76);
 	__ENDMOD;
 }

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/Configuration.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef Configuration__h
 #define Configuration__h

+ 197 - 0
data/bin/voc/src/bootstrap/unix-48/Errors.Txt

@@ -0,0 +1,197 @@
+The first line of this file is ignored.
+Any line not starting /^ *[0-9]/ is ignored.
+There should be only one space between the number and the message text.
+
+Compiler error messages
+  0 undeclared identifier
+  1 multiply defined identifier
+  2 illegal character in number
+  3 illegal character in string
+  4 identifier does not match procedure name
+  5 comment not closed
+
+  9 '=' expected
+
+ 12 type definition starts with incorrect symbol
+ 13 factor starts with incorrect symbol
+ 14 statement starts with incorrect symbol
+ 15 declaration followed by incorrect symbol
+ 16 MODULE expected
+
+ 18 '.' missing
+ 19 ',' missing
+ 20 ':' missing
+
+ 22 ')' missing
+ 23 ']' missing
+ 24 '}' missing
+ 25 OF missing
+ 26 THEN missing
+ 27 DO missing
+ 28 TO missing
+
+ 30 '(' missing
+
+ 34 ':=' missing
+ 35 ',' or OF expected
+
+ 38 identifier expected
+ 39 ';' missing
+
+ 41 END missing
+
+ 44 UNTIL missing
+
+ 46 EXIT not within loop statement
+ 47 illegally marked identifier
+
+ 50 expression should be constant
+ 51 constant not an integer
+ 52 identifier does not denote a type
+ 53 identifier does not denote a record type
+ 54 result type of procedure is not a basic type
+ 55 procedure call of a function
+ 56 assignment to non-variable
+ 57 pointer not bound to record or array type
+ 58 recursive type definition
+ 59 illegal open array parameter
+ 60 wrong type of case label
+ 61 inadmissible type of case label
+ 62 case label defined more than once
+ 63 illegal value of constant
+ 64 more actual than formal parameters
+ 65 fewer actual than formal parameters
+ 66 element types of actual array and formal open array differ
+ 67 actual parameter corresponding to open array is not an array
+ 68 control variable must be integer
+ 69 parameter must be an integer constant
+ 70 pointer or VAR record required as formal receiver
+ 71 pointer expected as actual receiver
+ 72 procedure must be bound to a record of the same scope
+ 73 procedure must have level 0
+ 74 procedure unknown in base type
+ 75 invalid call of base procedure
+ 76 this variable (field) is read only
+ 77 object is not a record
+ 78 dereferenced object is not a variable
+ 79 indexed object is not a variable
+ 80 index expression is not an integer
+ 81 index out of specified bounds
+ 82 indexed variable is not an array
+ 83 undefined record field
+ 84 dereferenced variable is not a pointer
+ 85 guard or test type is not an extension of variable type
+ 86 guard or testtype is not a pointer
+ 87 guarded or tested variable is neither a pointer nor a VAR-parameter record
+ 88 open array not allowed as variable, record field or array element
+
+ 92 operand of IN not an integer, or not a set
+ 93 set element type is not an integer
+ 94 operand of & is not of type BOOLEAN
+ 95 operand of OR is not of type BOOLEAN
+ 96 operand not applicable to (unary) +
+ 97 operand not applicable to (unary) -
+ 98 operand of ~ is not of type BOOLEAN
+ 99 ASSERT fault
+100 incompatible operands of dyadic operator
+101 operand type inapplicable to *
+102 operand type inapplicable to /
+103 operand type inapplicable to DIV
+104 operand type inapplicable to MOD
+105 operand type inapplicable to +
+106 operand type inapplicable to -
+107 operand type inapplicable to = or #
+108 operand type inapplicable to relation
+109 overriding method must be exported
+110 operand is not a type
+111 operand inapplicable to (this) function
+112 operand is not a variable
+113 incompatible assignment
+114 string too long to be assigned
+115 parameter doesn't match
+116 number of parameters doesn't match
+117 result type doesn't match
+118 export mark doesn't match with forward declaration
+119 redefinition textually precedes procedure bound to base type
+120 type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN
+121 called object is not a procedure (or is an interrupt procedure)
+122 actual VAR-parameter is not a variable
+123 type of actual parameter is not identical with that of formal VAR-parameter
+124 type of result expression differs from that of procedure
+125 type of case expression is neither INTEGER nor CHAR
+126 this expression cannot be a type or a procedure
+127 illegal use of object
+128 unsatisfied forward reference
+129 unsatisfied forward procedure
+130 WITH clause does not specify a variable
+131 LEN not applied to array
+132 dimension in LEN too large or negative
+135 SYSTEM not imported
+150 key inconsistency of imported module
+151 incorrect symbol file
+152 symbol file of imported module not found
+153 object or symbol file not opened (disk full?)
+154 recursive import not allowed
+155 generation of new symbol file not allowed
+156 parameter file not found
+157 syntax error in parameter file
+
+Limitations of implementation
+200 not yet implemented
+201 lower bound of set range greater than higher bound
+202 set element greater than MAX(SET) or less than 0
+203 number too large
+204 product too large
+205 division by zero
+206 sum too large
+207 difference too large
+208 overflow in arithmetic shift
+209 case range too large
+213 too many cases in case statement
+218 illegal value of parameter (0 <= p < 256)
+219 machine registers cannot be accessed
+220 illegal value of parameter
+221 too many pointers in a record
+222 too many global pointers
+223 too many record types
+224 too many pointer types
+225 address of pointer variable too large (move forward in text)
+226 too many exported procedures
+227 too many imported modules
+228 too many exported structures
+229 too many nested records for import
+230 too many constants (strings) in module
+231 too many link table entries (external procedures)
+232 too many commands in module
+233 record extension hierarchy too high
+234 export of recursive type not allowed
+240 identifier too long
+241 string too long
+242 address overflow
+244 cyclic type definition not allowed
+245 guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable
+
+Compiler Warnings
+301 implicit type cast
+306 inappropriate symbol file ignored
+307 no ELSE symbol after CASE statement sequence may lead to trap
+308 SYSTEM.VAL result includes memory past end of source variable; use SYSTEM.GET
+309 you should name this parameter type, or else no actual parameter will match
+310 redefining standard predefined type
+
+Run-time Error Messages
+ -1 assertion failed, cf. SYSTEM_assert
+ -2 invalid array index
+ -3 function procedure without RETURN statement
+ -4 invalid case in CASE statement
+ -5 type guard failed
+ -6 implicit type guard in record assignment failed
+ -7 invalid case in WITH statement
+ -8 value out of range
+ -9 (delayed) interrupt
+-10 NIL access
+-11 alignment error
+-12 zero divide
+-13 arithmetic overflow/underflow
+-14 invalid function argument
+-15 internal error

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/Files.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/Files.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
 
 #ifndef Files__h
 #define Files__h

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/Heap.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/Heap.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
 
 #ifndef Heap__h
 #define Heap__h

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/Modules.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/Modules.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef Modules__h
 #define Modules__h

+ 51 - 41
data/bin/voc/src/bootstrap/unix-48/OPB.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16
@@ -1738,6 +1738,16 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 			}
 			x->typ = OPT_linttyp;
 			break;
+		case 12: 
+			if (x->class == 8 || x->class == 9) {
+				OPB_err(126);
+			} else if (__IN(f, 0x60, 32)) {
+				OPB_Convert(&x, OPT_inttyp);
+			} else {
+				OPB_err(111);
+			}
+			x->typ = OPT_inttyp;
+			break;
 		case 6: 
 			OPB_MOp(23, &x);
 			break;
@@ -1847,7 +1857,7 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				OPB_err(111);
 			}
 			break;
-		case 13: case 14: 
+		case 14: case 15: 
 			if (OPB_NotVar(x)) {
 				OPB_err(112);
 			} else if (f != 4) {
@@ -1856,7 +1866,7 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				OPB_err(76);
 			}
 			break;
-		case 15: case 16: 
+		case 16: case 17: 
 			if (OPB_NotVar(x)) {
 				OPB_err(112);
 			} else if (x->typ->form != 7) {
@@ -1866,12 +1876,12 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				OPB_err(76);
 			}
 			break;
-		case 17: 
+		case 18: 
 			if (!__IN(x->typ->comp, 0x0c, 32)) {
 				OPB_err(131);
 			}
 			break;
-		case 18: 
+		case 19: 
 			if ((x->class == 7 && f == 3)) {
 				OPB_CharToString(x);
 				f = 8;
@@ -1882,7 +1892,7 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				OPB_err(111);
 			}
 			break;
-		case 19: 
+		case 20: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if (f == 4) {
@@ -1894,11 +1904,11 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				x->typ = OPT_linttyp;
 			}
 			break;
-		case 20: 
+		case 21: 
 			OPB_CheckLeaf(x, 0);
 			OPB_MOp(24, &x);
 			break;
-		case 12: 
+		case 13: 
 			if (x->class != 8) {
 				OPB_err(110);
 				x = OPB_NewIntConst(1);
@@ -1911,17 +1921,17 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				x = OPB_NewIntConst(1);
 			}
 			break;
-		case 21: 
+		case 22: 
 			OPB_MOp(25, &x);
 			break;
-		case 22: case 23: 
+		case 23: case 24: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if (!__IN(f, 0x9a, 32)) {
 				OPB_err(111);
 			}
 			break;
-		case 24: case 25: case 28: case 31: 
+		case 25: case 26: case 29: case 32: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) {
@@ -1931,7 +1941,7 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				x->typ = OPT_adrtyp;
 			}
 			break;
-		case 26: case 27: 
+		case 27: case 28: 
 			if ((f == 4 && x->class == 7)) {
 				if (x->conval->intval < 0 || x->conval->intval > -1) {
 					OPB_err(220);
@@ -1940,14 +1950,14 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				OPB_err(69);
 			}
 			break;
-		case 29: 
+		case 30: 
 			if (x->class != 8) {
 				OPB_err(110);
 			} else if (__IN(f, 0x0501, 32) || x->typ->comp == 3) {
 				OPB_err(111);
 			}
 			break;
-		case 30: 
+		case 31: 
 			if (OPB_NotVar(x)) {
 				OPB_err(112);
 			} else if (f == 11) {
@@ -1955,7 +1965,7 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				OPB_err(111);
 			}
 			break;
-		case 32: 
+		case 33: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 				x = OPB_NewBoolConst(0);
@@ -2002,7 +2012,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 	p = *par0;
 	f = x->typ->form;
 	switch (fctno) {
-		case 13: case 14: 
+		case 14: case 15: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 				p->typ = OPT_notyp;
@@ -2018,7 +2028,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 				p->typ = OPT_notyp;
 			}
 			break;
-		case 15: case 16: 
+		case 16: case 17: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if (f == 4) {
@@ -2031,7 +2041,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 			}
 			p->typ = OPT_notyp;
 			break;
-		case 17: 
+		case 18: 
 			if (!(f == 4) || x->class != 7) {
 				OPB_err(69);
 			} else if (x->typ->size == 1) {
@@ -2062,7 +2072,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 				OPB_err(132);
 			}
 			break;
-		case 18: 
+		case 19: 
 			if (OPB_NotVar(x)) {
 				OPB_err(112);
 			} else if ((__IN(x->typ->comp, 0x0c, 32) && x->typ->BaseTyp->form == 3)) {
@@ -2072,13 +2082,13 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 				t = x;
 				x = p;
 				p = t;
-				p = NewOp__54(19, 18, p, x);
+				p = NewOp__54(19, 19, p, x);
 			} else {
 				OPB_err(111);
 			}
 			p->typ = OPT_notyp;
 			break;
-		case 19: 
+		case 20: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if (f == 4) {
@@ -2122,13 +2132,13 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 				OPB_err(64);
 			}
 			break;
-		case 22: case 23: 
+		case 23: case 24: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if (f != 4) {
 				OPB_err(111);
 			} else {
-				if (fctno == 22) {
+				if (fctno == 23) {
 					p = NewOp__54(12, 27, p, x);
 				} else {
 					p = NewOp__54(12, 28, p, x);
@@ -2136,11 +2146,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 				p->typ = p->left->typ;
 			}
 			break;
-		case 24: case 25: case 26: case 27: 
+		case 25: case 26: case 27: case 28: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if (__IN(f, 0x18ff, 32)) {
-				if (fctno == 24 || fctno == 26) {
+				if (fctno == 25 || fctno == 27) {
 					if (OPB_NotVar(x)) {
 						OPB_err(112);
 					}
@@ -2154,7 +2164,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 			}
 			p->typ = OPT_notyp;
 			break;
-		case 28: 
+		case 29: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if (f == 4) {
@@ -2164,7 +2174,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 			}
 			p->typ = OPT_booltyp;
 			break;
-		case 29: 
+		case 30: 
 			if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 32)) || x->typ->comp == 3) {
 				OPB_err(126);
 			}
@@ -2184,17 +2194,17 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 			}
 			p = x;
 			break;
-		case 30: 
+		case 31: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if (f == 4) {
-				p = NewOp__54(19, 30, p, x);
+				p = NewOp__54(19, 31, p, x);
 			} else {
 				OPB_err(111);
 			}
 			p->typ = OPT_notyp;
 			break;
-		case 31: 
+		case 32: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) {
@@ -2205,7 +2215,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 			}
 			p->link = x;
 			break;
-		case 32: 
+		case 33: 
 			if ((f == 4 && x->class == 7)) {
 				if ((0 <= x->conval->intval && x->conval->intval <= 255)) {
 					OPB_BindNodes(28, OPT_notyp, &x, x);
@@ -2220,7 +2230,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 					} else if (p->class == 28) {
 						OPB_err(99);
 					} else {
-						p->subcl = 32;
+						p->subcl = 33;
 					}
 				} else {
 					OPB_err(218);
@@ -2262,12 +2272,12 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n)
 		} else {
 			OPB_err(111);
 		}
-	} else if ((fctno == 31 && n == 2)) {
+	} else if ((fctno == 32 && n == 2)) {
 		if (x->class == 8 || x->class == 9) {
 			OPB_err(126);
 		} else if (f == 4) {
 			node = OPT_NewNode(19);
-			node->subcl = 31;
+			node->subcl = 32;
 			node->right = p;
 			node->left = p->link;
 			p->link = x;
@@ -2287,22 +2297,22 @@ void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno)
 	INT16 dim;
 	OPT_Node x = NIL, p = NIL;
 	p = *par0;
-	if (fctno <= 19) {
+	if (fctno <= 20) {
 		if ((fctno == 1 && p->typ != OPT_notyp)) {
 			if (p->typ->comp == 3) {
 				OPB_err(65);
 			}
 			p->typ = OPT_notyp;
-		} else if (fctno <= 12) {
+		} else if (fctno <= 13) {
 			if (parno < 1) {
 				OPB_err(65);
 			}
 		} else {
-			if (((fctno == 13 || fctno == 14) && parno == 1)) {
+			if (((fctno == 14 || fctno == 15) && parno == 1)) {
 				OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(1));
 				p->subcl = fctno;
 				p->right->typ = p->left->typ;
-			} else if ((fctno == 17 && parno == 1)) {
+			} else if ((fctno == 18 && parno == 1)) {
 				if (p->typ->comp == 3) {
 					dim = 0;
 					while (p->class == 4) {
@@ -2318,7 +2328,7 @@ void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno)
 				OPB_err(65);
 			}
 		}
-	} else if (fctno == 32) {
+	} else if (fctno == 33) {
 		if (parno == 1) {
 			x = NIL;
 			OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(0));
@@ -2333,13 +2343,13 @@ void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno)
 			} else if (p->class == 28) {
 				OPB_err(99);
 			} else {
-				p->subcl = 32;
+				p->subcl = 33;
 			}
 		} else if (parno < 1) {
 			OPB_err(65);
 		}
 	} else {
-		if ((parno < 1 || (fctno > 21 && parno < 2)) || (fctno == 31 && parno < 3)) {
+		if ((parno < 1 || (fctno > 22 && parno < 2)) || (fctno == 32 && parno < 3)) {
 			OPB_err(65);
 		}
 	}

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/OPB.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef OPB__h
 #define OPB__h

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/OPC.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/OPC.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef OPC__h
 #define OPC__h

+ 12 - 38
data/bin/voc/src/bootstrap/unix-48/OPM.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16
@@ -1050,53 +1050,27 @@ static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len)
 {
 	CHAR testpath[4096];
 	Platform_FileIdentity identity;
+	BOOLEAN result;
 	__DUP(s, s__len, CHAR);
 	__COPY(OPM_InstallDir, testpath, 4096);
-	Strings_Append((CHAR*)"/lib/lib", 9, (void*)testpath, 4096);
-	Strings_Append((CHAR*)"voc", 4, (void*)testpath, 4096);
-	Strings_Append((CHAR*)"-O2.a", 6, (void*)testpath, 4096);
-	if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) {
-		__DEL(s);
-		return 0;
-	}
-	__COPY(OPM_InstallDir, testpath, 4096);
-	Strings_Append((CHAR*)"/2/include/Oberon.h", 20, (void*)testpath, 4096);
-	if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) {
-		__DEL(s);
-		return 0;
-	}
-	__COPY(OPM_InstallDir, testpath, 4096);
-	Strings_Append((CHAR*)"/2/sym/Files.sym", 17, (void*)testpath, 4096);
-	if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) {
-		__DEL(s);
-		return 0;
+	Strings_Append((CHAR*)"/voc.exe", 9, (void*)testpath, 4096);
+	result = Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0;
+	if (!result) {
+		__COPY(OPM_InstallDir, testpath, 4096);
+		Strings_Append((CHAR*)"/voc", 5, (void*)testpath, 4096);
+		result = Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0;
 	}
 	__DEL(s);
-	return 1;
+	return result;
 }
 
 static void OPM_FindInstallDir (void)
 {
-	INT16 i;
-	__COPY(Modules_BinaryDir, OPM_InstallDir, 1024);
-	Strings_Append((CHAR*)"/", 2, (void*)OPM_InstallDir, 1024);
-	Strings_Append((CHAR*)"voc", 4, (void*)OPM_InstallDir, 1024);
-	Strings_Append((CHAR*)".d", 3, (void*)OPM_InstallDir, 1024);
-	if (OPM_IsProbablyInstallDir(OPM_InstallDir, 1024)) {
-		return;
-	}
 	__COPY(Modules_BinaryDir, OPM_InstallDir, 1024);
-	i = Strings_Length(OPM_InstallDir, 1024);
-	while ((i > 0 && OPM_InstallDir[__X(i - 1, 1024)] != '/')) {
-		i -= 1;
-	}
-	if ((i > 0 && OPM_InstallDir[__X(i - 1, 1024)] == '/')) {
-		OPM_InstallDir[__X(i - 1, 1024)] = 0x00;
-		if (OPM_IsProbablyInstallDir(OPM_InstallDir, 1024)) {
-			return;
-		}
+	if (!OPM_IsProbablyInstallDir(OPM_InstallDir, 1024)) {
+		__COPY("../data/bin/voc", OPM_InstallDir, 1024);
 	}
-	__COPY("", OPM_InstallDir, 1024);
+	__COPY("../data/bin/voc", OPM_InstallDir, 1024);
 }
 
 static void EnumPtrs(void (*P)(void*))

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/OPM.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef OPM__h
 #define OPM__h

+ 3 - 3
data/bin/voc/src/bootstrap/unix-48/OPP.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16
@@ -669,7 +669,7 @@ static void OPP_StandProcCall (OPT_Node *x)
 	} else {
 		OPP_err(30);
 	}
-	if ((OPP_level > 0 && (m == 1 || m == 30))) {
+	if ((OPP_level > 0 && (m == 1 || m == 31))) {
 		OPT_topScope->link->leaf = 0;
 	}
 }
@@ -1501,7 +1501,7 @@ static void OPP_StatSeq (OPT_Node *stat)
 				OPP_CheckSym(27);
 				OPP_StatSeq(&s);
 				y = OPB_NewLeaf(id);
-				OPB_StPar1(&y, z, 13);
+				OPB_StPar1(&y, z, 14);
 				SetPos__35(y);
 				if (s == NIL) {
 					s = y;

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/OPP.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef OPP__h
 #define OPP__h

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/OPS.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/OPS.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
 
 #ifndef OPS__h
 #define OPS__h

+ 23 - 22
data/bin/voc/src/bootstrap/unix-48/OPT.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16
@@ -2098,18 +2098,18 @@ export void *OPT__init(void)
 	OPT_EnterTyp((CHAR*)"INT64", 4, 8, &OPT_int64typ);
 	OPT_EnterTyp((CHAR*)"SET32", 7, 4, &OPT_set32typ);
 	OPT_EnterTyp((CHAR*)"SET64", 7, 8, &OPT_set64typ);
-	OPT_EnterProc((CHAR*)"ADR", 20);
-	OPT_EnterProc((CHAR*)"CC", 21);
-	OPT_EnterProc((CHAR*)"LSH", 22);
-	OPT_EnterProc((CHAR*)"ROT", 23);
-	OPT_EnterProc((CHAR*)"GET", 24);
-	OPT_EnterProc((CHAR*)"PUT", 25);
-	OPT_EnterProc((CHAR*)"GETREG", 26);
-	OPT_EnterProc((CHAR*)"PUTREG", 27);
-	OPT_EnterProc((CHAR*)"BIT", 28);
-	OPT_EnterProc((CHAR*)"VAL", 29);
-	OPT_EnterProc((CHAR*)"NEW", 30);
-	OPT_EnterProc((CHAR*)"MOVE", 31);
+	OPT_EnterProc((CHAR*)"ADR", 21);
+	OPT_EnterProc((CHAR*)"CC", 22);
+	OPT_EnterProc((CHAR*)"LSH", 23);
+	OPT_EnterProc((CHAR*)"ROT", 24);
+	OPT_EnterProc((CHAR*)"GET", 25);
+	OPT_EnterProc((CHAR*)"PUT", 26);
+	OPT_EnterProc((CHAR*)"GETREG", 27);
+	OPT_EnterProc((CHAR*)"PUTREG", 28);
+	OPT_EnterProc((CHAR*)"BIT", 29);
+	OPT_EnterProc((CHAR*)"VAL", 30);
+	OPT_EnterProc((CHAR*)"NEW", 31);
+	OPT_EnterProc((CHAR*)"MOVE", 32);
 	OPT_syslink = OPT_topScope->right;
 	OPT_universe = OPT_topScope;
 	OPT_topScope->right = NIL;
@@ -2131,21 +2131,22 @@ export void *OPT__init(void)
 	OPT_EnterProc((CHAR*)"CAP", 3);
 	OPT_EnterProc((CHAR*)"ORD", 4);
 	OPT_EnterProc((CHAR*)"ENTIER", 5);
+	OPT_EnterProc((CHAR*)"FLOOR", 12);
 	OPT_EnterProc((CHAR*)"ODD", 6);
 	OPT_EnterProc((CHAR*)"MIN", 7);
 	OPT_EnterProc((CHAR*)"MAX", 8);
 	OPT_EnterProc((CHAR*)"CHR", 9);
 	OPT_EnterProc((CHAR*)"SHORT", 10);
 	OPT_EnterProc((CHAR*)"LONG", 11);
-	OPT_EnterProc((CHAR*)"SIZE", 12);
-	OPT_EnterProc((CHAR*)"INC", 13);
-	OPT_EnterProc((CHAR*)"DEC", 14);
-	OPT_EnterProc((CHAR*)"INCL", 15);
-	OPT_EnterProc((CHAR*)"EXCL", 16);
-	OPT_EnterProc((CHAR*)"LEN", 17);
-	OPT_EnterProc((CHAR*)"COPY", 18);
-	OPT_EnterProc((CHAR*)"ASH", 19);
-	OPT_EnterProc((CHAR*)"ASSERT", 32);
+	OPT_EnterProc((CHAR*)"SIZE", 13);
+	OPT_EnterProc((CHAR*)"INC", 14);
+	OPT_EnterProc((CHAR*)"DEC", 15);
+	OPT_EnterProc((CHAR*)"INCL", 16);
+	OPT_EnterProc((CHAR*)"EXCL", 17);
+	OPT_EnterProc((CHAR*)"LEN", 18);
+	OPT_EnterProc((CHAR*)"COPY", 19);
+	OPT_EnterProc((CHAR*)"ASH", 20);
+	OPT_EnterProc((CHAR*)"ASSERT", 33);
 	OPT_impCtxt.ref[0] = OPT_undftyp;
 	OPT_impCtxt.ref[1] = OPT_bytetyp;
 	OPT_impCtxt.ref[2] = OPT_booltyp;

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/OPT.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef OPT__h
 #define OPT__h

+ 27 - 15
data/bin/voc/src/bootstrap/unix-48/OPV.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16
@@ -29,6 +29,7 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc);
 static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec);
 static void OPV_DefineTDescs (OPT_Node n);
 static void OPV_Entier (OPT_Node n, INT16 prec);
+static void OPV_Floor (OPT_Node n, INT16 prec);
 static void OPV_GetTProcNum (OPT_Object obj);
 static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc);
 static BOOLEAN OPV_ImplicitReturn (OPT_Node n);
@@ -352,6 +353,17 @@ static void OPV_Entier (OPT_Node n, INT16 prec)
 	}
 }
 
+static void OPV_Floor (OPT_Node n, INT16 prec)
+{
+	if (__IN(n->typ->form, 0x60, 32)) {
+		OPM_WriteString((CHAR*)"__FLOOR(", 9);
+		OPV_expr(n, -1);
+		OPM_Write(')');
+	} else {
+		OPV_expr(n, prec);
+	}
+}
+
 static void OPV_SizeCast (OPT_Node n, INT32 to)
 {
 	if ((to < n->typ->size && __IN(2, OPM_Options, 32))) {
@@ -455,7 +467,7 @@ static void OPV_design (OPT_Node n, INT16 prec)
 	OPT_Struct typ = NIL;
 	INT16 class, designPrec, comp;
 	OPT_Node d = NIL, x = NIL;
-	INT16 dims, i, _for__26;
+	INT16 dims, i, _for__27;
 	comp = n->typ->comp;
 	obj = n->obj;
 	class = n->class;
@@ -531,9 +543,9 @@ static void OPV_design (OPT_Node n, INT16 prec)
 					}
 					x = x->left;
 				}
-				_for__26 = dims;
+				_for__27 = dims;
 				i = 1;
-				while (i <= _for__26) {
+				while (i <= _for__27) {
 					OPM_Write(')');
 					i += 1;
 				}
@@ -1342,21 +1354,21 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc)
 							OPV_NewArr(n->left, n->right);
 						}
 						break;
-					case 13: case 14: 
+					case 14: case 15: 
 						OPV_expr(n->left, -1);
-						OPC_Increment(n->subcl == 14);
+						OPC_Increment(n->subcl == 15);
 						OPV_expr(n->right, -1);
 						break;
-					case 15: case 16: 
+					case 16: case 17: 
 						OPV_expr(n->left, -1);
-						OPC_SetInclude(n->subcl == 16);
+						OPC_SetInclude(n->subcl == 17);
 						OPM_WriteString((CHAR*)"__SETOF(", 9);
 						OPV_expr(n->right, -1);
 						OPM_WriteString((CHAR*)",", 2);
 						OPM_WriteInt(__ASHL(n->left->typ->size, 3));
 						OPM_Write(')');
 						break;
-					case 18: 
+					case 19: 
 						OPM_WriteString((CHAR*)"__COPY(", 8);
 						OPV_expr(n->right, -1);
 						OPM_WriteString((CHAR*)", ", 3);
@@ -1365,7 +1377,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc)
 						OPV_Len(n->left, 0);
 						OPM_Write(')');
 						break;
-					case 31: 
+					case 32: 
 						OPM_WriteString((CHAR*)"__MOVE(", 8);
 						OPV_expr(n->right, -1);
 						OPM_WriteString((CHAR*)", ", 3);
@@ -1374,7 +1386,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc)
 						OPV_expr(n->right->link, -1);
 						OPM_Write(')');
 						break;
-					case 24: 
+					case 25: 
 						OPM_WriteString((CHAR*)"__GET(", 7);
 						OPV_expr(n->right, -1);
 						OPM_WriteString((CHAR*)", ", 3);
@@ -1383,7 +1395,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc)
 						OPC_Ident(n->left->typ->strobj);
 						OPM_Write(')');
 						break;
-					case 25: 
+					case 26: 
 						OPM_WriteString((CHAR*)"__PUT(", 7);
 						OPV_expr(n->left, -1);
 						OPM_WriteString((CHAR*)", ", 3);
@@ -1392,10 +1404,10 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc)
 						OPC_Ident(n->right->typ->strobj);
 						OPM_Write(')');
 						break;
-					case 26: case 27: 
+					case 27: case 28: 
 						OPM_err(200);
 						break;
-					case 30: 
+					case 31: 
 						OPM_WriteString((CHAR*)"__SYSNEW(", 10);
 						OPV_design(n->left, -1);
 						OPM_WriteString((CHAR*)", ", 3);
@@ -1427,7 +1439,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc)
 				OPV_ActualPar(n->right, n->obj);
 				break;
 			case 20: 
-				if (n->subcl != 32) {
+				if (n->subcl != 33) {
 					OPV_IfStat(n, 0, outerProc);
 				} else if (__IN(7, OPM_Options, 32)) {
 					OPM_WriteString((CHAR*)"__ASSERT(", 10);

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/OPV.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef OPV__h
 #define OPV__h

+ 136 - 1
data/bin/voc/src/bootstrap/unix-48/Out.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16
@@ -16,6 +16,8 @@ static INT16 Out_in;
 
 
 export void Out_Char (CHAR ch);
+export void Out_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len);
+export INT16 Out_Expo (REAL x);
 export void Out_Flush (void);
 export void Out_Hex (INT64 x, INT64 n);
 export void Out_Int (INT64 x, INT64 n);
@@ -24,6 +26,7 @@ export void Out_Ln (void);
 export void Out_LongReal (LONGREAL x, INT16 n);
 export void Out_Open (void);
 export void Out_Real (REAL x, INT16 n);
+export void Out_RealFix (REAL x, INT16 n, INT16 k);
 static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_);
 export void Out_String (CHAR *str, ADDRESS str__len);
 export LONGREAL Out_Ten (INT16 e);
@@ -328,6 +331,138 @@ void Out_LongReal (LONGREAL x, INT16 n)
 	Out_RealP(x, n, 1);
 }
 
+void Out_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len)
+{
+	INT32 i, j, k;
+	if (x < (LONGREAL)0) {
+		x = -x;
+	}
+	k = 0;
+	if (n > 9) {
+		i = (INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000);
+		j = (INT32)__ENTIER(x - i * (LONGREAL)1000000000);
+		if (j < 0) {
+			j = 0;
+		}
+		while (k < 9) {
+			d[__X(k, d__len)] = (CHAR)((int)__MOD(j, 10) + 48);
+			j = __DIV(j, 10);
+			k += 1;
+		}
+	} else {
+		i = (INT32)__ENTIER(x);
+	}
+	while (k < n) {
+		d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48);
+		i = __DIV(i, 10);
+		k += 1;
+	}
+}
+
+INT16 Out_Expo (REAL x)
+{
+	INT16 i;
+	__GET((ADDRESS)&x + 2, i, INT16);
+	return __MASK(__ASHR(i, 7), -256);
+}
+
+static struct RealFix__13 {
+	INT16 *i;
+	CHAR (*d)[9];
+	struct RealFix__13 *lnk;
+} *RealFix__13_s;
+
+static void dig__14 (INT16 n);
+static void seq__16 (CHAR ch, INT16 n);
+
+static void seq__16 (CHAR ch, INT16 n)
+{
+	while (n > 0) {
+		Out_Char(ch);
+		n -= 1;
+	}
+}
+
+static void dig__14 (INT16 n)
+{
+	while (n > 0) {
+		*RealFix__13_s->i -= 1;
+		Out_Char((*RealFix__13_s->d)[__X(*RealFix__13_s->i, 9)]);
+		n -= 1;
+	}
+}
+
+void Out_RealFix (REAL x, INT16 n, INT16 k)
+{
+	INT16 e, i;
+	CHAR sign;
+	REAL x0;
+	CHAR d[9];
+	struct RealFix__13 _s;
+	_s.i = &i;
+	_s.d = (void*)d;
+	_s.lnk = RealFix__13_s;
+	RealFix__13_s = &_s;
+	e = Out_Expo(x);
+	if (k < 0) {
+		k = 0;
+	}
+	if (e == 0) {
+		seq__16(' ', (n - k) - 2);
+		Out_Char('0');
+		seq__16(' ', k + 1);
+	} else if (e == 255) {
+		Out_String((CHAR*)" NaN", 5);
+		seq__16(' ', n - 4);
+	} else {
+		e = __ASHR((e - 127) * 77, 8);
+		if (x < (REAL)0) {
+			sign = '-';
+			x = -x;
+		} else {
+			sign = ' ';
+		}
+		if (e >= 0) {
+			x = (x / (LONGREAL)Out_Ten(e));
+		} else {
+			x = (Out_Ten(-e) * x);
+		}
+		if (x >= (REAL)10) {
+			x =   1.0000000e-001 * x;
+			e += 1;
+		}
+		if (k + e >= 8) {
+			k = 8 - e;
+		} else if (k + e < 0) {
+			k = -e;
+			x = (REAL)0;
+		}
+		x0 = Out_Ten(k + e);
+		x = x0 * x +   5.0000000e-001;
+		if (x >= (REAL)10 * x0) {
+			e += 1;
+		}
+		e += 1;
+		i = k + e;
+		Out_ConvertL(x, i, (void*)d, 9);
+		if (e > 0) {
+			seq__16(' ', ((n - e) - k) - 2);
+			Out_Char(sign);
+			dig__14(e);
+			Out_Char('.');
+			dig__14(k);
+		} else {
+			seq__16(' ', (n - k) - 3);
+			Out_Char(sign);
+			Out_Char('0');
+			Out_Char('.');
+			seq__16('0', -e);
+			dig__14(k + e);
+		}
+	}
+	RealFix__13_s = _s.lnk;
+}
+
 
 export void *Out__init(void)
 {

+ 4 - 1
data/bin/voc/src/bootstrap/unix-48/Out.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef Out__h
 #define Out__h
@@ -10,6 +10,8 @@ import BOOLEAN Out_IsConsole;
 
 
 import void Out_Char (CHAR ch);
+import void Out_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len);
+import INT16 Out_Expo (REAL x);
 import void Out_Flush (void);
 import void Out_Hex (INT64 x, INT64 n);
 import void Out_Int (INT64 x, INT64 n);
@@ -17,6 +19,7 @@ import void Out_Ln (void);
 import void Out_LongReal (LONGREAL x, INT16 n);
 import void Out_Open (void);
 import void Out_Real (REAL x, INT16 n);
+import void Out_RealFix (REAL x, INT16 n, INT16 k);
 import void Out_String (CHAR *str, ADDRESS str__len);
 import LONGREAL Out_Ten (INT16 e);
 import void *Out__init(void);

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/Platform.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/Platform.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef Platform__h
 #define Platform__h

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/Reals.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/Reals.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef Reals__h
 #define Reals__h

+ 218 - 0
data/bin/voc/src/bootstrap/unix-48/SYSTEM.c

@@ -0,0 +1,218 @@
+/*
+*   The body prefix file of the voc(jet backend) runtime system, Version 1.0
+*
+*   Copyright (c) Software Templ, 1994, 1995
+*
+*   Module SYSTEM is subject to change any time without prior notification.
+*   Software Templ disclaims all warranties with regard to module SYSTEM,
+*   in particular shall Software Templ not be liable for any damage resulting
+*   from inappropriate use or modification of module SYSTEM.
+*
+*   Version 1.1  jt, 24.11.95  fixes for correct pointer arithmetic on Cray computers
+*   jt 31.1.2007  ANSI prototypes for malloc and exit in order to avoid cc warnings
+*
+*/
+
+#include "SYSTEM.h"
+#include "stdarg.h"
+#include <signal.h>
+
+
+// Procedure verions of SYSTEM.H versions used when a multiply accessed
+// parameter has side effects.
+
+
+
+
+INT64 SYSTEM_DIV(INT64 x, INT64 y)
+{
+  if (x == 0) return 0;
+  if (x >= 0)
+    if (y >= 0) {return x/y;}
+    else        {return -((x-y-1)/(-y));}
+  else
+    if (y >= 0) {return -((y-x-1)/y);}
+    else        {return (-x)/(-y);}
+}
+
+INT64 SYSTEM_MOD(INT64 x, INT64 y)
+{
+  if (x == 0) return 0;
+  if (x >= 0)
+    if (y >= 0) {return x % y;}
+    else        {return (y+1) + ((x-1) % (-y));}
+  else
+    if (y >= 0) {return (y-1) - ((-x-1) % y);}
+    else        {return -((-x) % (-y));}
+}
+
+INT64 SYSTEM_ENTIER(double x)
+{
+    INT64 y;
+    if (x >= 0)
+        return (INT64)x;
+    else {
+        y = (INT64)x;
+        if (y <= x) return y; else return y - 1;
+    }
+}
+
+
+
+void SYSTEM_INHERIT(ADDRESS *t, ADDRESS *t0)
+{
+    t -= __TPROC0OFF;
+    t0 -= __TPROC0OFF;
+    while (*t0 != __EOM) {*t = *t0; t--; t0--;}
+}
+
+
+void SYSTEM_ENUMP(void *adr, ADDRESS n, void (*P)())
+{
+    while (n > 0) {
+        P((ADDRESS)(*((void**)(adr))));
+        adr = ((void**)adr) + 1;
+        n--;
+    }
+}
+
+void SYSTEM_ENUMR(void *adr, ADDRESS *typ, ADDRESS size, ADDRESS n, void (*P)())
+{
+    ADDRESS *t, off;
+    typ++;
+    while (n > 0) {
+        t = typ;
+        off = *t;
+        while (off >= 0) {P(*(ADDRESS*)((char*)adr+off)); t++; off = *t;}
+        adr = ((char*)adr) + size;
+        n--;
+    }
+}
+
+extern void Heap_Lock();
+extern void Heap_Unlock();
+
+SYSTEM_PTR SYSTEM_NEWARR(ADDRESS *typ, ADDRESS elemsz, int elemalgn, int nofdim, int nofdyn, ...)
+{
+    ADDRESS nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off;
+    va_list ap;
+    va_start(ap, nofdyn);
+    nofelems = 1;
+    while (nofdim > 0) {
+        nofelems = nofelems * va_arg(ap, ADDRESS); nofdim--;
+        if (nofelems <= 0) __HALT(-20);
+    }
+    va_end(ap);
+    dataoff = nofdyn * sizeof(ADDRESS);
+    if (elemalgn > sizeof(ADDRESS)) {
+        n = dataoff % elemalgn;
+        if (n != 0) dataoff += elemalgn - n;
+    }
+    size = dataoff + nofelems * elemsz;
+    Heap_Lock();
+    if (typ == NIL) {
+        /* element typ does not contain pointers */
+        x = Heap_NEWBLK(size);
+    }
+    else if (typ == (ADDRESS*)POINTER__typ) {
+        /* element type is a pointer */
+        x = Heap_NEWBLK(size + nofelems * sizeof(ADDRESS));
+        p = (ADDRESS*)(ADDRESS)x[-1];
+        p[-nofelems] = *p;  /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */
+        p -= nofelems - 1; n = 1;   /* n =1 for skipping the size field */
+        while (n <= nofelems) {*p = n*sizeof(ADDRESS); p++; n++;}
+        *p = - (nofelems + 1) * sizeof(ADDRESS);    /* sentinel */
+        x[-1] -= nofelems * sizeof(ADDRESS);
+    }
+    else {
+        /* element type is a record that contains pointers */
+        ptab = typ + 1; nofptrs = 0;
+        while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */
+        nptr = nofelems * nofptrs;  /* total number of pointers */
+        x = Heap_NEWBLK(size + nptr * sizeof(ADDRESS));
+        p = (ADDRESS*)(ADDRESS)x[- 1];
+        p[-nptr] = *p;  /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */
+        p -= nptr - 1; n = 0; off = dataoff;
+        while (n < nofelems) {i = 0;
+            while (i < nofptrs) {*p = off + ptab[i]; p++; i++;}
+            off += elemsz; n++;
+        }
+        *p = - (nptr + 1) * sizeof(ADDRESS);    /* sentinel */
+        x[-1] -= nptr * sizeof(ADDRESS);
+    }
+    if (nofdyn != 0) {
+        /* setup len vector for index checks */
+        va_start(ap, nofdyn);
+        p = x;
+        while (nofdyn > 0) {*p = va_arg(ap, ADDRESS); p++, nofdyn--;}
+        va_end(ap);
+    }
+    Heap_Unlock();
+    return x;
+}
+
+
+
+
+typedef void (*SystemSignalHandler)(INT32); // = Platform_SignalHandler
+
+#ifndef _WIN32
+
+    SystemSignalHandler handler[3] = {0};
+
+    // Provide signal handling for Unix based systems
+    void signalHandler(int s) {
+        if (s >= 2  &&  s <= 4) handler[s-2](s);
+        // (Ignore other signals)
+    }
+
+    void SystemSetHandler(int s, ADDRESS h) {
+        if (s >= 2 && s <= 4) {
+            int needtosetsystemhandler = handler[s-2] == 0;
+            handler[s-2] = (SystemSignalHandler)h;
+            if (needtosetsystemhandler) {signal(s, signalHandler);}
+        }
+    }
+
+#else
+
+    // Provides Windows callback handlers for signal-like scenarios
+    #include "WindowsWrapper.h"
+
+    SystemSignalHandler SystemInterruptHandler = 0;
+    SystemSignalHandler SystemQuitHandler      = 0;
+    BOOL ConsoleCtrlHandlerSet = FALSE;
+
+    BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) {
+        if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) {
+            if (SystemInterruptHandler) {
+                SystemInterruptHandler(2); // SIGINT
+                return TRUE;
+            }
+        } else { // Close, logoff or shutdown
+            if (SystemQuitHandler) {
+                SystemQuitHandler(3); // SIGQUIT
+                return TRUE;
+            }
+        }
+        return FALSE;
+    }
+
+    void EnsureConsoleCtrlHandler() {
+        if (!ConsoleCtrlHandlerSet) {
+        SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE);
+            ConsoleCtrlHandlerSet = TRUE;
+        }
+    }
+
+    void SystemSetInterruptHandler(ADDRESS h) {
+        EnsureConsoleCtrlHandler();
+        SystemInterruptHandler = (SystemSignalHandler)h;
+    }
+
+    void SystemSetQuitHandler(ADDRESS h) {
+        EnsureConsoleCtrlHandler();
+        SystemQuitHandler = (SystemSignalHandler)h;
+    }
+
+#endif

+ 326 - 0
data/bin/voc/src/bootstrap/unix-48/SYSTEM.h

@@ -0,0 +1,326 @@
+#ifndef SYSTEM__h
+#define SYSTEM__h
+
+
+// 64 bit system detection
+
+#if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64)
+  #define o__64
+#endif
+
+
+// Declare memcpy in a way compatible with C compilers intrinsic
+// built in implementations.
+
+#if defined (o__64)
+  #if defined(_WIN64)
+    typedef unsigned long long size_t;
+  #else
+    typedef unsigned long      size_t;
+  #endif
+#else
+  typedef unsigned int         size_t;
+#endif
+
+#define _SIZE_T_DECLARED // For FreeBSD
+#define _SIZE_T_DEFINED_ // For OpenBSD
+
+void *memcpy(void *dest, const void *source, size_t size);
+#if defined _MSC_VER
+#define alloca _alloca
+#endif
+void *alloca(size_t size);
+
+
+// Declare fixed size versions of basic intger types
+
+#if defined (o__64) && !defined(_WIN64)
+  // LP64
+  typedef long               INT64;
+  typedef unsigned long      UINT64;
+#else
+  // ILP32 or LLP64
+  typedef long long          INT64;
+  typedef unsigned long long UINT64;
+#endif
+
+typedef int                  INT32;
+typedef unsigned int         UINT32;
+
+typedef short int            INT16;
+typedef unsigned short int   UINT16;
+
+typedef signed char          INT8;
+typedef unsigned char        UINT8;
+
+
+// The compiler uses 'import' and 'export' which translate to 'extern' and
+// nothing respectively.
+
+#define import extern
+#define export
+
+
+
+// Known constants
+
+#define NIL          ((void*)0)
+#define __MAXEXT     16
+#define POINTER__typ ((ADDRESS*)(1))  // not NIL and not a valid type
+
+
+// Oberon types
+
+typedef INT8   BOOLEAN;
+typedef INT8   SYSTEM_BYTE;
+typedef UINT8  CHAR;
+typedef float  REAL;
+typedef double LONGREAL;
+typedef void*  SYSTEM_PTR;
+
+
+
+// 'ADDRESS' is a synonym for an integer of pointer size
+
+#if defined (o__64)
+  #define ADDRESS INT64
+#else
+  #define ADDRESS INT32
+#endif
+
+
+
+// ----------------------------------------------------------------------
+// ----------------------------------------------------------------------
+
+
+
+// OS Memory allocation interfaces are in PlatformXXX.Mod
+
+extern ADDRESS Platform_OSAllocate (ADDRESS size);
+extern void    Platform_OSFree     (ADDRESS addr);
+
+
+// Assertions and Halts
+
+extern void Modules_Halt(INT32 x);
+extern void Modules_AssertFail(INT32 x);
+
+#define __HALT(x)         Modules_Halt((INT32)(x))
+#define __ASSERT(cond, x) if (!(cond)) Modules_AssertFail((INT32)(x))
+
+
+// Index checking
+
+static inline INT64 __XF(UINT64 i, UINT64 ub) {if (i >= ub) {__HALT(-2);} return i;}
+#define __X(i, ub) (((i)<(ub))?i:(__HALT(-2),0))
+
+
+// Range checking, and checked SHORT and CHR functions
+
+static inline INT64 __RF(UINT64 i, UINT64 ub) {if (i >= ub) {__HALT(-8);} return i;}
+#define __R(i, ub)      (((i)<(ub))?i:(__HALT(-8),0))
+#define __SHORT(x, ub)  ((int)((UINT64)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0)))
+#define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub)))
+#define __CHR(x)        ((CHAR)__R(x, 256))
+#define __CHRF(x)       ((CHAR)__RF(x, 256))
+
+
+
+// Signal handling in SYSTEM.c
+
+#ifndef _WIN32
+  extern void SystemSetHandler(int s, ADDRESS h);
+#else
+  extern void SystemSetInterruptHandler(ADDRESS h);
+  extern void SystemSetQuitHandler     (ADDRESS h);
+#endif
+
+
+
+// String comparison
+
+static inline int __str_cmp(CHAR *x, CHAR *y){
+  INT64 i = 0;
+  CHAR ch1, ch2;
+  do {ch1 = x[i]; ch2 = y[i]; i++;
+    if (!ch1) return -(int)ch2;
+  } while (ch1==ch2);
+  return (int)ch1 - (int)ch2;
+}
+#define __STRCMP(a,b) __str_cmp((CHAR*)(a), (CHAR*)(b))
+
+
+
+// Inline string, record and array copy
+
+#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \
+                         while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;}
+#define __DUPARR(v, t)  v=(void*)memcpy(v##__copy,v,sizeof(t))
+#define __DUP(x, l, t)  x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t))
+#define __DEL(x)
+
+
+/* SYSTEM ops */
+
+#define __VAL(t, x)     (*(t*)&(x))
+
+#define __GET(a, x, t)  x=*(t*)(ADDRESS)(a)
+#define __PUT(a, x, t)  *(t*)(ADDRESS)(a)=x
+
+#define __LSHL(x, n, s) ((INT##s)((UINT##s)(x)<<(n)))
+#define __LSHR(x, n, s) ((INT##s)((UINT##s)(x)>>(n)))
+#define __LSH(x, n, s)  ((n)>=0? __LSHL(x, n, s): __LSHR(x, -(n), s))
+
+#define __ROTL(x, n, s) ((INT##s)((UINT##s)(x)<<(n)|(UINT##s)(x)>>(s-(n))))
+#define __ROTR(x, n, s) ((INT##s)((UINT##s)(x)>>(n)|(UINT##s)(x)<<(s-(n))))
+#define __ROT(x, n, s)  ((n)>=0? __ROTL(x, n, s): __ROTR(x, -(n), s))
+
+#define __ASHL(x, n)    ((INT64)(x)<<(n))
+#define __ASHR(x, n)    ((INT64)(x)>>(n))
+#define __ASH(x, n)     ((n)>=0?__ASHL(x,n):__ASHR(x,-(n)))
+static inline INT64 SYSTEM_ASH(INT64 x, INT64 n) {return __ASH(x,n);}
+#define __ASHF(x, n)    SYSTEM_ASH((INT64)(x), (INT64)(n))
+
+#define __MOVE(s, d, n) memcpy((char*)(ADDRESS)(d),(char*)(ADDRESS)(s),n)
+
+
+extern INT64 SYSTEM_DIV(INT64 x, INT64 y);
+#define __DIVF(x, y) SYSTEM_DIV(x, y)
+#define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y))
+
+
+extern INT64 SYSTEM_MOD(INT64 x, INT64 y);
+#define __MODF(x, y) SYSTEM_MOD(x, y)
+#define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y))
+
+
+extern INT64 SYSTEM_ENTIER (double x);
+#define __ENTIER(x) SYSTEM_ENTIER(x)
+
+
+#define __ABS(x) (((x)<0)?-(x):(x))
+
+static inline INT32 SYSTEM_ABS64(INT64 i) {return i >= 0 ? i : -i;}
+static inline INT64 SYSTEM_ABS32(INT32 i) {return i >= 0 ? i : -i;}
+#define __ABSF(x) ((sizeof(x) <= 4) ? SYSTEM_ABS32(x) : SYSTEM_ABS64(x))
+
+static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;}
+#define __ABSFD(x) SYSTEM_ABSD(x)
+
+#define __CAP(ch)       ((CHAR)((ch)&0x5f))
+#define __ODD(x)        ((x)&1)
+
+#define __IN(x, s, size)     (((unsigned int)(x))<size && ((((UINT##size)(s))>>(x))&1))
+// todo tested versions of SETOF and SETRNG: check that x, l and h fit size
+#define __SETOF(x, size)     ((UINT##size)1<<(x))
+#define __SETRNG(l, h, size) ((~(UINT##size)0<<(l))&~(UINT##size)0>>(size-1-(h)))
+
+#define __MASK(x, m) ((x)&~(m))
+#define __BIT(x, n)  (*(UINT64*)(x)>>(n)&1)
+
+
+
+// Runtime checks
+
+#define __RETCHK     __retchk: __HALT(-3); return 0;
+#define __CASECHK    __HALT(-4)
+#define __WITHCHK    __HALT(-7)
+
+
+#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(ADDRESS)typ##__typ)
+#define  __TYPEOF(p)          (*(((ADDRESS**)(p))-1))
+#define __ISP(p, typ, level)  __IS(__TYPEOF(p),typ,level)
+
+
+#define __GUARDP(p, typ, level)    ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p)))
+#define __GUARDR(r, typ, level)    (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r))))
+#define __GUARDA(p, typ, level)    ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p)))
+#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p)
+#define __GUARDEQP(p, typ)         if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*((typ*)p)
+
+
+
+// Module entry/registration/exit
+
+extern void       Heap_REGCMD();
+extern SYSTEM_PTR Heap_REGMOD();
+extern void       Heap_REGTYP();
+extern void       Heap_INCREF();
+
+#define __DEFMOD              static void *m; if (m!=0) {return m;}
+#define __REGCMD(name, cmd)   Heap_REGCMD(m, (CHAR*)name, cmd)
+#define __REGMOD(name, enum)  if (m==0) {m = Heap_REGMOD((CHAR*)name,enum);}
+#define __ENDMOD              return m
+#define __MODULE_IMPORT(name) Heap_INCREF(name##__init())
+
+
+
+// Main module initialisation, registration and finalisation
+
+extern void Modules_Init(INT32 argc, ADDRESS argv);
+extern void Heap_FINALL();
+
+#define __INIT(argc, argv)    static void *m; Modules_Init(argc, (ADDRESS)&argv);
+#define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum)
+#define __FINI                Heap_FINALL(); return 0
+
+
+// Memory allocation
+
+extern SYSTEM_PTR Heap_NEWBLK (ADDRESS size);
+extern SYSTEM_PTR Heap_NEWREC (ADDRESS tag);
+extern SYSTEM_PTR SYSTEM_NEWARR(ADDRESS*, ADDRESS, int, int, int, ...);
+
+#define __SYSNEW(p, len) p = Heap_NEWBLK((ADDRESS)(len))
+#define __NEW(p, t)      p = Heap_NEWREC((ADDRESS)t##__typ)
+#define __NEWARR         SYSTEM_NEWARR
+
+
+
+/* Type handling */
+
+extern void SYSTEM_INHERIT(ADDRESS *t, ADDRESS *t0);
+extern void SYSTEM_ENUMP  (void *adr, ADDRESS n, void (*P)());
+extern void SYSTEM_ENUMR  (void *adr, ADDRESS *typ, ADDRESS size, ADDRESS n, void (*P)());
+
+
+#define __TDESC(t, m, n)                                                \
+  static struct t##__desc {                                             \
+    ADDRESS  tproc[m];         /* Proc for each ptr field            */ \
+    ADDRESS  tag;                                                       \
+    ADDRESS  next;             /* Module table type list points here */ \
+    ADDRESS  level;                                                     \
+    ADDRESS  module;                                                    \
+    char     name[24];                                                  \
+    ADDRESS  basep[__MAXEXT];  /* List of bases this extends         */ \
+    ADDRESS  reserved;                                                  \
+    ADDRESS  blksz;            /* xxx_typ points here                */ \
+    ADDRESS  ptr[n+1];         /* Offsets of ptrs up to -ve sentinel */ \
+  } t##__desc
+
+#define __BASEOFF   (__MAXEXT+1)                           // blksz as index to base.
+#define __TPROC0OFF (__BASEOFF+24/sizeof(ADDRESS)+5)       // blksz as index to tproc IFF m=1.
+#define __EOM 1
+#define __TDFLDS(name, size)          {__EOM}, 1, 0, 0, 0, name, {0}, 0, size
+#define __ENUMP(adr, n, P)            SYSTEM_ENUMP(adr, (ADDRESS)(n), P)
+#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (ADDRESS)(size), (ADDRESS)(n), P)
+
+#define __INITYP(t, t0, level) \
+  t##__typ               = (ADDRESS*)&t##__desc.blksz;                                                    \
+  memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(ADDRESS));                                  \
+  t##__desc.basep[level] = (ADDRESS)t##__typ;                                                             \
+  t##__desc.module       = (ADDRESS)m;                                                                    \
+  if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15);                                                      \
+  t##__desc.blksz        = (t##__desc.blksz+5*sizeof(ADDRESS)-1)/(4*sizeof(ADDRESS))*(4*sizeof(ADDRESS)); \
+  Heap_REGTYP(m, (ADDRESS)&t##__desc.next);                                                               \
+  SYSTEM_INHERIT(t##__typ, t0##__typ)
+
+// Oberon-2 type bound procedures support
+#define __INITBP(t, proc, num)            *(t##__typ-(__TPROC0OFF+num))=(ADDRESS)proc
+#define __SEND(typ, num, funtyp, parlist) ((funtyp)((ADDRESS)*(typ-(__TPROC0OFF+num))))parlist
+
+
+
+
+#endif

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/Strings.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/Strings.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef Strings__h
 #define Strings__h

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/Texts.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/Texts.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef Texts__h
 #define Texts__h

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/VT100.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/VT100.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef VT100__h
 #define VT100__h

+ 10 - 0
data/bin/voc/src/bootstrap/unix-48/WindowsWrapper.h

@@ -0,0 +1,10 @@
+// WindowsWrapper.h
+//
+// Includes Windows.h while avoiding conflicts with Oberon types.
+
+
+#define BOOLEAN _BOOLEAN
+#define CHAR    _CHAR
+#include <windows.h>
+#undef BOOLEAN
+#undef CHAR

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/extTools.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-48/extTools.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef extTools__h
 #define extTools__h

+ 1 - 1
data/bin/voc/src/bootstrap/unix-88/Compiler.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 2 - 2
data/bin/voc/src/bootstrap/unix-88/Configuration.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16
@@ -19,6 +19,6 @@ export void *Configuration__init(void)
 	__DEFMOD;
 	__REGMOD("Configuration", 0);
 /* BEGIN */
-	__MOVE("2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76);
+	__MOVE("2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76);
 	__ENDMOD;
 }

+ 1 - 1
data/bin/voc/src/bootstrap/unix-88/Configuration.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef Configuration__h
 #define Configuration__h

+ 197 - 0
data/bin/voc/src/bootstrap/unix-88/Errors.Txt

@@ -0,0 +1,197 @@
+The first line of this file is ignored.
+Any line not starting /^ *[0-9]/ is ignored.
+There should be only one space between the number and the message text.
+
+Compiler error messages
+  0 undeclared identifier
+  1 multiply defined identifier
+  2 illegal character in number
+  3 illegal character in string
+  4 identifier does not match procedure name
+  5 comment not closed
+
+  9 '=' expected
+
+ 12 type definition starts with incorrect symbol
+ 13 factor starts with incorrect symbol
+ 14 statement starts with incorrect symbol
+ 15 declaration followed by incorrect symbol
+ 16 MODULE expected
+
+ 18 '.' missing
+ 19 ',' missing
+ 20 ':' missing
+
+ 22 ')' missing
+ 23 ']' missing
+ 24 '}' missing
+ 25 OF missing
+ 26 THEN missing
+ 27 DO missing
+ 28 TO missing
+
+ 30 '(' missing
+
+ 34 ':=' missing
+ 35 ',' or OF expected
+
+ 38 identifier expected
+ 39 ';' missing
+
+ 41 END missing
+
+ 44 UNTIL missing
+
+ 46 EXIT not within loop statement
+ 47 illegally marked identifier
+
+ 50 expression should be constant
+ 51 constant not an integer
+ 52 identifier does not denote a type
+ 53 identifier does not denote a record type
+ 54 result type of procedure is not a basic type
+ 55 procedure call of a function
+ 56 assignment to non-variable
+ 57 pointer not bound to record or array type
+ 58 recursive type definition
+ 59 illegal open array parameter
+ 60 wrong type of case label
+ 61 inadmissible type of case label
+ 62 case label defined more than once
+ 63 illegal value of constant
+ 64 more actual than formal parameters
+ 65 fewer actual than formal parameters
+ 66 element types of actual array and formal open array differ
+ 67 actual parameter corresponding to open array is not an array
+ 68 control variable must be integer
+ 69 parameter must be an integer constant
+ 70 pointer or VAR record required as formal receiver
+ 71 pointer expected as actual receiver
+ 72 procedure must be bound to a record of the same scope
+ 73 procedure must have level 0
+ 74 procedure unknown in base type
+ 75 invalid call of base procedure
+ 76 this variable (field) is read only
+ 77 object is not a record
+ 78 dereferenced object is not a variable
+ 79 indexed object is not a variable
+ 80 index expression is not an integer
+ 81 index out of specified bounds
+ 82 indexed variable is not an array
+ 83 undefined record field
+ 84 dereferenced variable is not a pointer
+ 85 guard or test type is not an extension of variable type
+ 86 guard or testtype is not a pointer
+ 87 guarded or tested variable is neither a pointer nor a VAR-parameter record
+ 88 open array not allowed as variable, record field or array element
+
+ 92 operand of IN not an integer, or not a set
+ 93 set element type is not an integer
+ 94 operand of & is not of type BOOLEAN
+ 95 operand of OR is not of type BOOLEAN
+ 96 operand not applicable to (unary) +
+ 97 operand not applicable to (unary) -
+ 98 operand of ~ is not of type BOOLEAN
+ 99 ASSERT fault
+100 incompatible operands of dyadic operator
+101 operand type inapplicable to *
+102 operand type inapplicable to /
+103 operand type inapplicable to DIV
+104 operand type inapplicable to MOD
+105 operand type inapplicable to +
+106 operand type inapplicable to -
+107 operand type inapplicable to = or #
+108 operand type inapplicable to relation
+109 overriding method must be exported
+110 operand is not a type
+111 operand inapplicable to (this) function
+112 operand is not a variable
+113 incompatible assignment
+114 string too long to be assigned
+115 parameter doesn't match
+116 number of parameters doesn't match
+117 result type doesn't match
+118 export mark doesn't match with forward declaration
+119 redefinition textually precedes procedure bound to base type
+120 type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN
+121 called object is not a procedure (or is an interrupt procedure)
+122 actual VAR-parameter is not a variable
+123 type of actual parameter is not identical with that of formal VAR-parameter
+124 type of result expression differs from that of procedure
+125 type of case expression is neither INTEGER nor CHAR
+126 this expression cannot be a type or a procedure
+127 illegal use of object
+128 unsatisfied forward reference
+129 unsatisfied forward procedure
+130 WITH clause does not specify a variable
+131 LEN not applied to array
+132 dimension in LEN too large or negative
+135 SYSTEM not imported
+150 key inconsistency of imported module
+151 incorrect symbol file
+152 symbol file of imported module not found
+153 object or symbol file not opened (disk full?)
+154 recursive import not allowed
+155 generation of new symbol file not allowed
+156 parameter file not found
+157 syntax error in parameter file
+
+Limitations of implementation
+200 not yet implemented
+201 lower bound of set range greater than higher bound
+202 set element greater than MAX(SET) or less than 0
+203 number too large
+204 product too large
+205 division by zero
+206 sum too large
+207 difference too large
+208 overflow in arithmetic shift
+209 case range too large
+213 too many cases in case statement
+218 illegal value of parameter (0 <= p < 256)
+219 machine registers cannot be accessed
+220 illegal value of parameter
+221 too many pointers in a record
+222 too many global pointers
+223 too many record types
+224 too many pointer types
+225 address of pointer variable too large (move forward in text)
+226 too many exported procedures
+227 too many imported modules
+228 too many exported structures
+229 too many nested records for import
+230 too many constants (strings) in module
+231 too many link table entries (external procedures)
+232 too many commands in module
+233 record extension hierarchy too high
+234 export of recursive type not allowed
+240 identifier too long
+241 string too long
+242 address overflow
+244 cyclic type definition not allowed
+245 guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable
+
+Compiler Warnings
+301 implicit type cast
+306 inappropriate symbol file ignored
+307 no ELSE symbol after CASE statement sequence may lead to trap
+308 SYSTEM.VAL result includes memory past end of source variable; use SYSTEM.GET
+309 you should name this parameter type, or else no actual parameter will match
+310 redefining standard predefined type
+
+Run-time Error Messages
+ -1 assertion failed, cf. SYSTEM_assert
+ -2 invalid array index
+ -3 function procedure without RETURN statement
+ -4 invalid case in CASE statement
+ -5 type guard failed
+ -6 implicit type guard in record assignment failed
+ -7 invalid case in WITH statement
+ -8 value out of range
+ -9 (delayed) interrupt
+-10 NIL access
+-11 alignment error
+-12 zero divide
+-13 arithmetic overflow/underflow
+-14 invalid function argument
+-15 internal error

+ 1 - 1
data/bin/voc/src/bootstrap/unix-88/Files.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-88/Files.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
 
 #ifndef Files__h
 #define Files__h

+ 1 - 1
data/bin/voc/src/bootstrap/unix-88/Heap.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-88/Heap.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
 
 #ifndef Heap__h
 #define Heap__h

+ 1 - 1
data/bin/voc/src/bootstrap/unix-88/Modules.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-88/Modules.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef Modules__h
 #define Modules__h

+ 51 - 41
data/bin/voc/src/bootstrap/unix-88/OPB.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16
@@ -1738,6 +1738,16 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 			}
 			x->typ = OPT_linttyp;
 			break;
+		case 12: 
+			if (x->class == 8 || x->class == 9) {
+				OPB_err(126);
+			} else if (__IN(f, 0x60, 32)) {
+				OPB_Convert(&x, OPT_inttyp);
+			} else {
+				OPB_err(111);
+			}
+			x->typ = OPT_inttyp;
+			break;
 		case 6: 
 			OPB_MOp(23, &x);
 			break;
@@ -1847,7 +1857,7 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				OPB_err(111);
 			}
 			break;
-		case 13: case 14: 
+		case 14: case 15: 
 			if (OPB_NotVar(x)) {
 				OPB_err(112);
 			} else if (f != 4) {
@@ -1856,7 +1866,7 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				OPB_err(76);
 			}
 			break;
-		case 15: case 16: 
+		case 16: case 17: 
 			if (OPB_NotVar(x)) {
 				OPB_err(112);
 			} else if (x->typ->form != 7) {
@@ -1866,12 +1876,12 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				OPB_err(76);
 			}
 			break;
-		case 17: 
+		case 18: 
 			if (!__IN(x->typ->comp, 0x0c, 32)) {
 				OPB_err(131);
 			}
 			break;
-		case 18: 
+		case 19: 
 			if ((x->class == 7 && f == 3)) {
 				OPB_CharToString(x);
 				f = 8;
@@ -1882,7 +1892,7 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				OPB_err(111);
 			}
 			break;
-		case 19: 
+		case 20: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if (f == 4) {
@@ -1894,11 +1904,11 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				x->typ = OPT_linttyp;
 			}
 			break;
-		case 20: 
+		case 21: 
 			OPB_CheckLeaf(x, 0);
 			OPB_MOp(24, &x);
 			break;
-		case 12: 
+		case 13: 
 			if (x->class != 8) {
 				OPB_err(110);
 				x = OPB_NewIntConst(1);
@@ -1911,17 +1921,17 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				x = OPB_NewIntConst(1);
 			}
 			break;
-		case 21: 
+		case 22: 
 			OPB_MOp(25, &x);
 			break;
-		case 22: case 23: 
+		case 23: case 24: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if (!__IN(f, 0x9a, 32)) {
 				OPB_err(111);
 			}
 			break;
-		case 24: case 25: case 28: case 31: 
+		case 25: case 26: case 29: case 32: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) {
@@ -1931,7 +1941,7 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				x->typ = OPT_adrtyp;
 			}
 			break;
-		case 26: case 27: 
+		case 27: case 28: 
 			if ((f == 4 && x->class == 7)) {
 				if (x->conval->intval < 0 || x->conval->intval > -1) {
 					OPB_err(220);
@@ -1940,14 +1950,14 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				OPB_err(69);
 			}
 			break;
-		case 29: 
+		case 30: 
 			if (x->class != 8) {
 				OPB_err(110);
 			} else if (__IN(f, 0x0501, 32) || x->typ->comp == 3) {
 				OPB_err(111);
 			}
 			break;
-		case 30: 
+		case 31: 
 			if (OPB_NotVar(x)) {
 				OPB_err(112);
 			} else if (f == 11) {
@@ -1955,7 +1965,7 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
 				OPB_err(111);
 			}
 			break;
-		case 32: 
+		case 33: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 				x = OPB_NewBoolConst(0);
@@ -2002,7 +2012,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 	p = *par0;
 	f = x->typ->form;
 	switch (fctno) {
-		case 13: case 14: 
+		case 14: case 15: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 				p->typ = OPT_notyp;
@@ -2018,7 +2028,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 				p->typ = OPT_notyp;
 			}
 			break;
-		case 15: case 16: 
+		case 16: case 17: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if (f == 4) {
@@ -2031,7 +2041,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 			}
 			p->typ = OPT_notyp;
 			break;
-		case 17: 
+		case 18: 
 			if (!(f == 4) || x->class != 7) {
 				OPB_err(69);
 			} else if (x->typ->size == 1) {
@@ -2062,7 +2072,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 				OPB_err(132);
 			}
 			break;
-		case 18: 
+		case 19: 
 			if (OPB_NotVar(x)) {
 				OPB_err(112);
 			} else if ((__IN(x->typ->comp, 0x0c, 32) && x->typ->BaseTyp->form == 3)) {
@@ -2072,13 +2082,13 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 				t = x;
 				x = p;
 				p = t;
-				p = NewOp__54(19, 18, p, x);
+				p = NewOp__54(19, 19, p, x);
 			} else {
 				OPB_err(111);
 			}
 			p->typ = OPT_notyp;
 			break;
-		case 19: 
+		case 20: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if (f == 4) {
@@ -2122,13 +2132,13 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 				OPB_err(64);
 			}
 			break;
-		case 22: case 23: 
+		case 23: case 24: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if (f != 4) {
 				OPB_err(111);
 			} else {
-				if (fctno == 22) {
+				if (fctno == 23) {
 					p = NewOp__54(12, 27, p, x);
 				} else {
 					p = NewOp__54(12, 28, p, x);
@@ -2136,11 +2146,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 				p->typ = p->left->typ;
 			}
 			break;
-		case 24: case 25: case 26: case 27: 
+		case 25: case 26: case 27: case 28: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if (__IN(f, 0x18ff, 32)) {
-				if (fctno == 24 || fctno == 26) {
+				if (fctno == 25 || fctno == 27) {
 					if (OPB_NotVar(x)) {
 						OPB_err(112);
 					}
@@ -2154,7 +2164,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 			}
 			p->typ = OPT_notyp;
 			break;
-		case 28: 
+		case 29: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if (f == 4) {
@@ -2164,7 +2174,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 			}
 			p->typ = OPT_booltyp;
 			break;
-		case 29: 
+		case 30: 
 			if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 32)) || x->typ->comp == 3) {
 				OPB_err(126);
 			}
@@ -2184,17 +2194,17 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 			}
 			p = x;
 			break;
-		case 30: 
+		case 31: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if (f == 4) {
-				p = NewOp__54(19, 30, p, x);
+				p = NewOp__54(19, 31, p, x);
 			} else {
 				OPB_err(111);
 			}
 			p->typ = OPT_notyp;
 			break;
-		case 31: 
+		case 32: 
 			if (x->class == 8 || x->class == 9) {
 				OPB_err(126);
 			} else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) {
@@ -2205,7 +2215,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 			}
 			p->link = x;
 			break;
-		case 32: 
+		case 33: 
 			if ((f == 4 && x->class == 7)) {
 				if ((0 <= x->conval->intval && x->conval->intval <= 255)) {
 					OPB_BindNodes(28, OPT_notyp, &x, x);
@@ -2220,7 +2230,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
 					} else if (p->class == 28) {
 						OPB_err(99);
 					} else {
-						p->subcl = 32;
+						p->subcl = 33;
 					}
 				} else {
 					OPB_err(218);
@@ -2262,12 +2272,12 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n)
 		} else {
 			OPB_err(111);
 		}
-	} else if ((fctno == 31 && n == 2)) {
+	} else if ((fctno == 32 && n == 2)) {
 		if (x->class == 8 || x->class == 9) {
 			OPB_err(126);
 		} else if (f == 4) {
 			node = OPT_NewNode(19);
-			node->subcl = 31;
+			node->subcl = 32;
 			node->right = p;
 			node->left = p->link;
 			p->link = x;
@@ -2287,22 +2297,22 @@ void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno)
 	INT16 dim;
 	OPT_Node x = NIL, p = NIL;
 	p = *par0;
-	if (fctno <= 19) {
+	if (fctno <= 20) {
 		if ((fctno == 1 && p->typ != OPT_notyp)) {
 			if (p->typ->comp == 3) {
 				OPB_err(65);
 			}
 			p->typ = OPT_notyp;
-		} else if (fctno <= 12) {
+		} else if (fctno <= 13) {
 			if (parno < 1) {
 				OPB_err(65);
 			}
 		} else {
-			if (((fctno == 13 || fctno == 14) && parno == 1)) {
+			if (((fctno == 14 || fctno == 15) && parno == 1)) {
 				OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(1));
 				p->subcl = fctno;
 				p->right->typ = p->left->typ;
-			} else if ((fctno == 17 && parno == 1)) {
+			} else if ((fctno == 18 && parno == 1)) {
 				if (p->typ->comp == 3) {
 					dim = 0;
 					while (p->class == 4) {
@@ -2318,7 +2328,7 @@ void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno)
 				OPB_err(65);
 			}
 		}
-	} else if (fctno == 32) {
+	} else if (fctno == 33) {
 		if (parno == 1) {
 			x = NIL;
 			OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(0));
@@ -2333,13 +2343,13 @@ void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno)
 			} else if (p->class == 28) {
 				OPB_err(99);
 			} else {
-				p->subcl = 32;
+				p->subcl = 33;
 			}
 		} else if (parno < 1) {
 			OPB_err(65);
 		}
 	} else {
-		if ((parno < 1 || (fctno > 21 && parno < 2)) || (fctno == 31 && parno < 3)) {
+		if ((parno < 1 || (fctno > 22 && parno < 2)) || (fctno == 32 && parno < 3)) {
 			OPB_err(65);
 		}
 	}

+ 1 - 1
data/bin/voc/src/bootstrap/unix-88/OPB.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef OPB__h
 #define OPB__h

+ 1 - 1
data/bin/voc/src/bootstrap/unix-88/OPC.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16

+ 1 - 1
data/bin/voc/src/bootstrap/unix-88/OPC.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef OPC__h
 #define OPC__h

+ 12 - 38
data/bin/voc/src/bootstrap/unix-88/OPM.c

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #define SHORTINT INT8
 #define INTEGER  INT16
@@ -1050,53 +1050,27 @@ static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len)
 {
 	CHAR testpath[4096];
 	Platform_FileIdentity identity;
+	BOOLEAN result;
 	__DUP(s, s__len, CHAR);
 	__COPY(OPM_InstallDir, testpath, 4096);
-	Strings_Append((CHAR*)"/lib/lib", 9, (void*)testpath, 4096);
-	Strings_Append((CHAR*)"voc", 4, (void*)testpath, 4096);
-	Strings_Append((CHAR*)"-O2.a", 6, (void*)testpath, 4096);
-	if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) {
-		__DEL(s);
-		return 0;
-	}
-	__COPY(OPM_InstallDir, testpath, 4096);
-	Strings_Append((CHAR*)"/2/include/Oberon.h", 20, (void*)testpath, 4096);
-	if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) {
-		__DEL(s);
-		return 0;
-	}
-	__COPY(OPM_InstallDir, testpath, 4096);
-	Strings_Append((CHAR*)"/2/sym/Files.sym", 17, (void*)testpath, 4096);
-	if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) {
-		__DEL(s);
-		return 0;
+	Strings_Append((CHAR*)"/voc.exe", 9, (void*)testpath, 4096);
+	result = Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0;
+	if (!result) {
+		__COPY(OPM_InstallDir, testpath, 4096);
+		Strings_Append((CHAR*)"/voc", 5, (void*)testpath, 4096);
+		result = Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0;
 	}
 	__DEL(s);
-	return 1;
+	return result;
 }
 
 static void OPM_FindInstallDir (void)
 {
-	INT16 i;
-	__COPY(Modules_BinaryDir, OPM_InstallDir, 1024);
-	Strings_Append((CHAR*)"/", 2, (void*)OPM_InstallDir, 1024);
-	Strings_Append((CHAR*)"voc", 4, (void*)OPM_InstallDir, 1024);
-	Strings_Append((CHAR*)".d", 3, (void*)OPM_InstallDir, 1024);
-	if (OPM_IsProbablyInstallDir(OPM_InstallDir, 1024)) {
-		return;
-	}
 	__COPY(Modules_BinaryDir, OPM_InstallDir, 1024);
-	i = Strings_Length(OPM_InstallDir, 1024);
-	while ((i > 0 && OPM_InstallDir[__X(i - 1, 1024)] != '/')) {
-		i -= 1;
-	}
-	if ((i > 0 && OPM_InstallDir[__X(i - 1, 1024)] == '/')) {
-		OPM_InstallDir[__X(i - 1, 1024)] = 0x00;
-		if (OPM_IsProbablyInstallDir(OPM_InstallDir, 1024)) {
-			return;
-		}
+	if (!OPM_IsProbablyInstallDir(OPM_InstallDir, 1024)) {
+		__COPY("../data/bin/voc", OPM_InstallDir, 1024);
 	}
-	__COPY("", OPM_InstallDir, 1024);
+	__COPY("../data/bin/voc", OPM_InstallDir, 1024);
 }
 
 static void EnumPtrs(void (*P)(void*))

+ 1 - 1
data/bin/voc/src/bootstrap/unix-88/OPM.h

@@ -1,4 +1,4 @@
-/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
+/* voc 2.1.0 [2017/07/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
 
 #ifndef OPM__h
 #define OPM__h

Some files were not shown because too many files changed in this diff