From 6ae2f96d08a4d60ecfbcb89ca4a2384e2f7ba063 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Thu, 7 Nov 2019 20:20:08 +0400 Subject: [PATCH] Undecl var fix (#74) * fix like https://github.com/jtempl/ofront/commit/78036911d21636514f2ece6d9e9e74ecc8755f1e * OPT.DynArr to be precise * removed PromoteIntConstToLInt() function call * update of bootstrap sources. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 12 +++++++----- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 22 +++++++++++++++++----- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 6 +++--- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 12 +++++++----- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 22 +++++++++++++++++----- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 6 +++--- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 12 +++++++----- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 22 +++++++++++++++++----- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 6 +++--- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 12 +++++++----- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 22 +++++++++++++++++----- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 6 +++--- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 12 +++++++----- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 22 +++++++++++++++++----- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 6 +++--- bootstrap/windows-88/extTools.h | 2 +- src/compiler/OPC.Mod | 5 ++++- src/compiler/OPV.Mod | 10 +++++++++- 187 files changed, 323 insertions(+), 242 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 706e5dac..4f763604 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index af1b360f..646b2242 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 75963938..7b9ae370 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 6b75d2c9..492214b6 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index e01b30c1..08ff9fe0 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 1712292d..a01553d6 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 95defe4d..7eb1fed5 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 7fcd0339..1e66d12e 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 7132d67d..c06e7adf 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index ee9816a3..d716887b 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index eca13e1c..654ea008 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 9d950335..cfc69c4f 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1834,6 +1834,12 @@ void OPC_IntLiteral (INT64 n, INT32 size) void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) { + INT64 d; + d = dim; + while (d > 0) { + array = array->BaseTyp; + d -= 1; + } if (array->comp == 3) { OPC_CompleteIdent(obj); OPM_WriteString((CHAR*)"__len", 6); @@ -1841,10 +1847,6 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) OPM_WriteInt(dim); } } else { - while (dim > 0) { - array = array->BaseTyp; - dim -= 1; - } OPM_WriteInt(array->n); } } diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index ed46a18d..14b85b47 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index c00ef3c0..16996b23 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index ed863d1c..a046228e 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index d6b5b011..df77049f 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index ebe70724..50bb8039 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index e535af0d..67f0d84a 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 0aae61b1..edbf5767 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 6dfd6a9f..1386ae18 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 4bdb3a41..578e9629 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index b6969178..789619eb 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -317,15 +317,27 @@ static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp static void OPV_Len (OPT_Node n, INT64 dim) { + INT64 d; + OPT_Struct array = NIL; while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; n = n->left; } if ((n->class == 3 && n->typ->comp == 3)) { - OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->len[", 7); - OPM_WriteInt(dim); - OPM_Write(']'); + d = dim; + array = n->typ; + while (d > 0) { + array = array->BaseTyp; + d -= 1; + } + if (array->comp == 3) { + OPV_design(n->left, 10); + OPM_WriteString((CHAR*)"->len[", 7); + OPM_WriteInt(dim); + OPM_Write(']'); + } else { + OPM_WriteInt(array->n); + } } else { OPC_Len(n->obj, n->typ, dim); } diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 36e6ffa1..74a49d24 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index b37ac764..7d4c7d72 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index b328aba8..ba654cb8 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 2571cf00..8c32b583 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index cd5f8097..0cecb356 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 61d38fc6..2b8483b4 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index cf6fff34..270f7735 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 7d141b4d..864f4ace 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 7101e619..e3ff12c6 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 98d2ca37..ff6f352e 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index a70ae3ca..0fd08ee2 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 16cd0cf7..84ffc7ab 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index c8271316..3aafef64 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index e091956d..082bedeb 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("tcc -g", s, s__len); + __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -102,7 +102,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096); if (statically) { - Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index ad119444..0bc230e3 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 706e5dac..4f763604 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index af1b360f..646b2242 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 75963938..7b9ae370 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 6b75d2c9..492214b6 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index e01b30c1..08ff9fe0 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 1712292d..a01553d6 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 95defe4d..7eb1fed5 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 7fcd0339..1e66d12e 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 7132d67d..c06e7adf 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index ee9816a3..d716887b 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index eca13e1c..654ea008 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 9d950335..cfc69c4f 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1834,6 +1834,12 @@ void OPC_IntLiteral (INT64 n, INT32 size) void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) { + INT64 d; + d = dim; + while (d > 0) { + array = array->BaseTyp; + d -= 1; + } if (array->comp == 3) { OPC_CompleteIdent(obj); OPM_WriteString((CHAR*)"__len", 6); @@ -1841,10 +1847,6 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) OPM_WriteInt(dim); } } else { - while (dim > 0) { - array = array->BaseTyp; - dim -= 1; - } OPM_WriteInt(array->n); } } diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index ed46a18d..14b85b47 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index c00ef3c0..16996b23 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index ed863d1c..a046228e 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index d6b5b011..df77049f 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index ebe70724..50bb8039 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index e535af0d..67f0d84a 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 0aae61b1..edbf5767 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index cb27a509..cf3ae87d 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 4bdb3a41..578e9629 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index b6969178..789619eb 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -317,15 +317,27 @@ static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp static void OPV_Len (OPT_Node n, INT64 dim) { + INT64 d; + OPT_Struct array = NIL; while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; n = n->left; } if ((n->class == 3 && n->typ->comp == 3)) { - OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->len[", 7); - OPM_WriteInt(dim); - OPM_Write(']'); + d = dim; + array = n->typ; + while (d > 0) { + array = array->BaseTyp; + d -= 1; + } + if (array->comp == 3) { + OPV_design(n->left, 10); + OPM_WriteString((CHAR*)"->len[", 7); + OPM_WriteInt(dim); + OPM_Write(']'); + } else { + OPM_WriteInt(array->n); + } } else { OPC_Len(n->obj, n->typ, dim); } diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 36e6ffa1..74a49d24 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index b37ac764..7d4c7d72 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index b328aba8..ba654cb8 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 2571cf00..8c32b583 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index cd5f8097..0cecb356 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 61d38fc6..2b8483b4 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index cf6fff34..270f7735 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 7d141b4d..864f4ace 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 7101e619..e3ff12c6 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index a43f9e79..628d68a4 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index f8efcd82..02f20def 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 16cd0cf7..84ffc7ab 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index c8271316..3aafef64 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index e091956d..082bedeb 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("tcc -g", s, s__len); + __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -102,7 +102,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096); if (statically) { - Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index ad119444..0bc230e3 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 706e5dac..4f763604 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index af1b360f..646b2242 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 75963938..7b9ae370 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 155e0a04..b07eb5ea 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index e594e82b..2606a167 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index e9555122..6ab94025 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index e09ec7a8..16458b6a 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index b5952131..282588f9 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 3a135985..ee462907 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index ee9816a3..d716887b 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index eca13e1c..654ea008 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 9d950335..cfc69c4f 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1834,6 +1834,12 @@ void OPC_IntLiteral (INT64 n, INT32 size) void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) { + INT64 d; + d = dim; + while (d > 0) { + array = array->BaseTyp; + d -= 1; + } if (array->comp == 3) { OPC_CompleteIdent(obj); OPM_WriteString((CHAR*)"__len", 6); @@ -1841,10 +1847,6 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) OPM_WriteInt(dim); } } else { - while (dim > 0) { - array = array->BaseTyp; - dim -= 1; - } OPM_WriteInt(array->n); } } diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index ed46a18d..14b85b47 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index faa2b9d7..59ad4e17 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index ed863d1c..a046228e 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 814adb3c..79620fe3 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index ebe70724..50bb8039 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index e535af0d..67f0d84a 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 0aae61b1..edbf5767 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index b834bc38..861fad9e 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 4bdb3a41..578e9629 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 2f9f78c6..8681be7b 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -317,15 +317,27 @@ static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp static void OPV_Len (OPT_Node n, INT64 dim) { + INT64 d; + OPT_Struct array = NIL; while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; n = n->left; } if ((n->class == 3 && n->typ->comp == 3)) { - OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->len[", 7); - OPM_WriteInt(dim); - OPM_Write(']'); + d = dim; + array = n->typ; + while (d > 0) { + array = array->BaseTyp; + d -= 1; + } + if (array->comp == 3) { + OPV_design(n->left, 10); + OPM_WriteString((CHAR*)"->len[", 7); + OPM_WriteInt(dim); + OPM_Write(']'); + } else { + OPM_WriteInt(array->n); + } } else { OPC_Len(n->obj, n->typ, dim); } diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 36e6ffa1..74a49d24 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index b37ac764..7d4c7d72 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index b328aba8..ba654cb8 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 99fd71e3..636554ef 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 77e7eabf..efff0062 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 61d38fc6..2b8483b4 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index cf6fff34..270f7735 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 7d141b4d..864f4ace 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 7101e619..e3ff12c6 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index fadb3d3b..fad539ed 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 95d43066..04f1d40e 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 16cd0cf7..84ffc7ab 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index c8271316..3aafef64 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index e091956d..082bedeb 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("tcc -g", s, s__len); + __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -102,7 +102,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096); if (statically) { - Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index ad119444..0bc230e3 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 706e5dac..4f763604 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index af1b360f..646b2242 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 75963938..7b9ae370 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index b7204686..5edba307 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index d4f352c8..2ad2f341 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 1712292d..a01553d6 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 95defe4d..7eb1fed5 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 70e3c600..9708137f 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 7132d67d..c06e7adf 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index ee9816a3..d716887b 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index eca13e1c..654ea008 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 9d950335..cfc69c4f 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1834,6 +1834,12 @@ void OPC_IntLiteral (INT64 n, INT32 size) void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) { + INT64 d; + d = dim; + while (d > 0) { + array = array->BaseTyp; + d -= 1; + } if (array->comp == 3) { OPC_CompleteIdent(obj); OPM_WriteString((CHAR*)"__len", 6); @@ -1841,10 +1847,6 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) OPM_WriteInt(dim); } } else { - while (dim > 0) { - array = array->BaseTyp; - dim -= 1; - } OPM_WriteInt(array->n); } } diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index ed46a18d..14b85b47 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index c00ef3c0..16996b23 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index ed863d1c..a046228e 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index d6b5b011..df77049f 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index ebe70724..50bb8039 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index e535af0d..67f0d84a 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 0aae61b1..edbf5767 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index cb27a509..cf3ae87d 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 4bdb3a41..578e9629 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index b6969178..789619eb 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -317,15 +317,27 @@ static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp static void OPV_Len (OPT_Node n, INT64 dim) { + INT64 d; + OPT_Struct array = NIL; while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; n = n->left; } if ((n->class == 3 && n->typ->comp == 3)) { - OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->len[", 7); - OPM_WriteInt(dim); - OPM_Write(']'); + d = dim; + array = n->typ; + while (d > 0) { + array = array->BaseTyp; + d -= 1; + } + if (array->comp == 3) { + OPV_design(n->left, 10); + OPM_WriteString((CHAR*)"->len[", 7); + OPM_WriteInt(dim); + OPM_Write(']'); + } else { + OPM_WriteInt(array->n); + } } else { OPC_Len(n->obj, n->typ, dim); } diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 36e6ffa1..74a49d24 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index d85cee6b..7fa3733e 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index b328aba8..ba654cb8 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 9de4c27b..f5c9fa99 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 02f3b4e1..c9296c98 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 61d38fc6..2b8483b4 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index cf6fff34..270f7735 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 7d141b4d..864f4ace 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 7101e619..e3ff12c6 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index a43f9e79..628d68a4 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index f8efcd82..02f20def 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 16cd0cf7..84ffc7ab 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index c8271316..3aafef64 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index e091956d..082bedeb 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("tcc -g", s, s__len); + __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -102,7 +102,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096); if (statically) { - Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index ad119444..0bc230e3 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 706e5dac..4f763604 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index af1b360f..646b2242 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 75963938..7b9ae370 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index e3a43ec3..32a88308 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 4f0adc88..3e47427c 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index e9555122..6ab94025 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index e09ec7a8..16458b6a 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 2432e8d7..ccefe599 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 3a135985..ee462907 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index ee9816a3..d716887b 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index eca13e1c..654ea008 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 9d950335..cfc69c4f 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1834,6 +1834,12 @@ void OPC_IntLiteral (INT64 n, INT32 size) void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) { + INT64 d; + d = dim; + while (d > 0) { + array = array->BaseTyp; + d -= 1; + } if (array->comp == 3) { OPC_CompleteIdent(obj); OPM_WriteString((CHAR*)"__len", 6); @@ -1841,10 +1847,6 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) OPM_WriteInt(dim); } } else { - while (dim > 0) { - array = array->BaseTyp; - dim -= 1; - } OPM_WriteInt(array->n); } } diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index ed46a18d..14b85b47 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index faa2b9d7..59ad4e17 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index ed863d1c..a046228e 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 814adb3c..79620fe3 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index ebe70724..50bb8039 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index e535af0d..67f0d84a 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 0aae61b1..edbf5767 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index b834bc38..861fad9e 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 4bdb3a41..578e9629 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 2f9f78c6..8681be7b 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -317,15 +317,27 @@ static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp static void OPV_Len (OPT_Node n, INT64 dim) { + INT64 d; + OPT_Struct array = NIL; while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; n = n->left; } if ((n->class == 3 && n->typ->comp == 3)) { - OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->len[", 7); - OPM_WriteInt(dim); - OPM_Write(']'); + d = dim; + array = n->typ; + while (d > 0) { + array = array->BaseTyp; + d -= 1; + } + if (array->comp == 3) { + OPV_design(n->left, 10); + OPM_WriteString((CHAR*)"->len[", 7); + OPM_WriteInt(dim); + OPM_Write(']'); + } else { + OPM_WriteInt(array->n); + } } else { OPC_Len(n->obj, n->typ, dim); } diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 36e6ffa1..74a49d24 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index d85cee6b..7fa3733e 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index b328aba8..ba654cb8 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index b6b5a74c..23cdc990 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 391a1d4d..75f561f0 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 61d38fc6..2b8483b4 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index cf6fff34..270f7735 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 7d141b4d..864f4ace 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 7101e619..e3ff12c6 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index fadb3d3b..fad539ed 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 95d43066..04f1d40e 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 16cd0cf7..84ffc7ab 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index c8271316..3aafef64 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index e091956d..082bedeb 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("tcc -g", s, s__len); + __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -102,7 +102,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096); if (statically) { - Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index ad119444..0bc230e3 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 43b86251..d1f9027a 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -1215,12 +1215,15 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) END IntLiteral; PROCEDURE Len* (obj: OPT.Object; array: OPT.Struct; dim: SYSTEM.INT64); + VAR + d: SYSTEM.INT64; BEGIN + d := dim; + WHILE d > 0 DO array := array^.BaseTyp; DEC(d) END; IF array^.comp = OPT.DynArr THEN CompleteIdent(obj); OPM.WriteString(LenExt); IF dim # 0 THEN OPM.WriteInt(dim) END ELSE (* array *) - WHILE dim > 0 DO array := array^.BaseTyp; DEC(dim) END; OPM.WriteInt(array.n) END END Len; diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 964f60e1..371d69d3 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -208,10 +208,18 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE^ design(n: OPT.Node; prec: INTEGER); PROCEDURE Len(n: OPT.Node; dim: SYSTEM.INT64); + VAR + d: SYSTEM.INT64; array: OPT.Struct; BEGIN WHILE (n^.class = OPT.Nindex) & (n^.typ^.comp = OPT.DynArr(*26.7.2002*)) DO INC(dim); n := n^.left END ; IF (n^.class = OPT.Nderef) & (n^.typ^.comp = OPT.DynArr) THEN - design(n^.left, 10); OPM.WriteString("->len["); OPM.WriteInt(dim); OPM.Write("]") + d := dim; array := n^.typ; + WHILE d > 0 DO array := array^.BaseTyp; DEC(d) END; + IF array^.comp = OPT.DynArr THEN + design(n^.left, 10); OPM.WriteString("->len["); OPM.WriteInt(dim); OPM.Write("]") + ELSE + OPM.WriteInt(array^.n) + END ELSE OPC.Len(n^.obj, n^.typ, dim) END