From e626e5c97d66e5d8f79235e5252691b11d4050e3 Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 21 Jun 2017 21:33:03 +0400 Subject: [PATCH] updated 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 | 2 +- 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 | 2 +- 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 | 130 ++++++++++++++++++++++++++- bootstrap/unix-44/Strings.h | 4 +- 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 | 20 +++-- 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 | 2 +- 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 | 2 +- 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 | 130 ++++++++++++++++++++++++++- bootstrap/unix-48/Strings.h | 4 +- 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 | 20 +++-- 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 | 2 +- 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 | 2 +- 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 | 130 ++++++++++++++++++++++++++- bootstrap/unix-88/Strings.h | 4 +- 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 | 20 +++-- 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 | 2 +- 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 | 2 +- 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 | 130 ++++++++++++++++++++++++++- bootstrap/windows-48/Strings.h | 4 +- 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 | 20 +++-- 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 | 2 +- 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 | 2 +- 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 | 130 ++++++++++++++++++++++++++- bootstrap/windows-88/Strings.h | 4 +- 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 | 20 +++-- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 890 insertions(+), 230 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 38c8117f..2e1f73ec 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index a65d07d6..37d129c0 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/06/21]. 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 72e63747..76f70d82 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index d5fd78c7..15f181ca 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 9a0776b1..9825b66f 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 8fc061ff..29215cc6 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 25310ebf..3a5b2ec6 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index fac280fb..8d1f2adc 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 8125a013..510a957f 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 3779058a..4e5d8bb0 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 086dc5f6..23d08ad2 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index e9d9a49e..664d96fb 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index fdcce95f..26ce2529 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index e475406d..77be12d2 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 306f8ede..64e0b231 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index bf3d11d5..09556118 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index ab6ef6cb..dd80e8ba 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index f77716b2..00989b7b 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index f009c3c0..89f48bc6 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 4c2ce30b..795ce5e8 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 305c3ef1..d17422b2 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 51336832..bd91910e 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 60a80fc3..ebff1e8c 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 9d37e527..6ca1811b 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 7d83710b..d2b1d882 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index f5b51345..3adf3084 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 69d52603..975922f3 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index d73aa742..820a2ba7 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 439e5203..9a2fca64 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 34b0450a..925d8de0 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -6,6 +6,7 @@ #define SET UINT32 #include "SYSTEM.h" +#include "Reals.h" @@ -19,6 +20,8 @@ export INT16 Strings_Length (CHAR *s, ADDRESS s__len); export BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); export INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); export void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +export void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r); +export void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r); INT16 Strings_Length (CHAR *s, ADDRESS s__len) @@ -236,10 +239,135 @@ BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS return __retval; } +void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r) +{ + INT16 p, e; + REAL y, g; + BOOLEAN neg, negE; + __DUP(s, s__len, CHAR); + p = 0; + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + if (s[__X(p, s__len)] == '-') { + neg = 1; + p += 1; + } else { + neg = 0; + } + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + y = (REAL)0; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + y = y * (REAL)10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (s[__X(p, s__len)] == '.') { + p += 1; + g = (REAL)1; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + g = g / (REAL)(REAL)10; + y = y + g * ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + } + if (s[__X(p, s__len)] == 'D' || s[__X(p, s__len)] == 'E') { + p += 1; + e = 0; + if (s[__X(p, s__len)] == '-') { + negE = 1; + p += 1; + } else { + negE = 0; + } + while (s[__X(p, s__len)] == '0') { + p += 1; + } + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + e = e * 10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (negE) { + y = y / (REAL)Reals_Ten(e); + } else { + y = y * Reals_Ten(e); + } + } + if (neg) { + y = -y; + } + *r = y; + __DEL(s); +} + +void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r) +{ + INT16 p, e; + LONGREAL y, g; + BOOLEAN neg, negE; + __DUP(s, s__len, CHAR); + p = 0; + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + if (s[__X(p, s__len)] == '-') { + neg = 1; + p += 1; + } else { + neg = 0; + } + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + y = (LONGREAL)0; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + y = y * (LONGREAL)10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (s[__X(p, s__len)] == '.') { + p += 1; + g = (LONGREAL)1; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + g = g / (LONGREAL)(LONGREAL)10; + y = y + g * ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + } + if (s[__X(p, s__len)] == 'D' || s[__X(p, s__len)] == 'E') { + p += 1; + e = 0; + if (s[__X(p, s__len)] == '-') { + negE = 1; + p += 1; + } else { + negE = 0; + } + while (s[__X(p, s__len)] == '0') { + p += 1; + } + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + e = e * 10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (negE) { + y = y / (LONGREAL)Reals_Ten(e); + } else { + y = y * Reals_Ten(e); + } + } + if (neg) { + y = -y; + } + *r = y; + __DEL(s); +} + export void *Strings__init(void) { __DEFMOD; + __MODULE_IMPORT(Reals); __REGMOD("Strings", 0); /* BEGIN */ __ENDMOD; diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 04b06545..f88aeb04 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h @@ -17,6 +17,8 @@ import INT16 Strings_Length (CHAR *s, ADDRESS s__len); import BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); import INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); import void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +import void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r); +import void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r); import void *Strings__init(void); diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index c8d31144..05dd7063 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index ca48a032..965d36bd 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 436790ae..40b79e32 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index d8c8b46f..1e79747a 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index ef4097cd..6bfa4550 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #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("gcc -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); @@ -106,13 +106,15 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); - Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); - Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); - Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); - Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); - Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); - Strings_Append(OPM_Model, 10, (void*)cmd, 4096); - Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + if (!statically || 1) { + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); + Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); + Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); + Strings_Append(OPM_Model, 10, (void*)cmd, 4096); + Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + } extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 4096); __DEL(additionalopts); } diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index f05c741b..6969521d 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 38c8117f..2e1f73ec 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index a65d07d6..37d129c0 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/06/21]. 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 72e63747..76f70d82 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index d5fd78c7..15f181ca 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 9a0776b1..9825b66f 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 8fc061ff..29215cc6 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 25310ebf..3a5b2ec6 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index fac280fb..8d1f2adc 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 8125a013..510a957f 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 3779058a..4e5d8bb0 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 086dc5f6..23d08ad2 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index e9d9a49e..664d96fb 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index fdcce95f..26ce2529 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index e475406d..77be12d2 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 306f8ede..64e0b231 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index bf3d11d5..09556118 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index ab6ef6cb..dd80e8ba 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index f77716b2..00989b7b 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index f009c3c0..89f48bc6 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 1c073903..bade5779 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 305c3ef1..d17422b2 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 51336832..bd91910e 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 60a80fc3..ebff1e8c 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 9d37e527..6ca1811b 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 7d83710b..d2b1d882 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index f5b51345..3adf3084 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 69d52603..975922f3 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index d73aa742..820a2ba7 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 439e5203..9a2fca64 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 34b0450a..925d8de0 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -6,6 +6,7 @@ #define SET UINT32 #include "SYSTEM.h" +#include "Reals.h" @@ -19,6 +20,8 @@ export INT16 Strings_Length (CHAR *s, ADDRESS s__len); export BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); export INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); export void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +export void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r); +export void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r); INT16 Strings_Length (CHAR *s, ADDRESS s__len) @@ -236,10 +239,135 @@ BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS return __retval; } +void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r) +{ + INT16 p, e; + REAL y, g; + BOOLEAN neg, negE; + __DUP(s, s__len, CHAR); + p = 0; + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + if (s[__X(p, s__len)] == '-') { + neg = 1; + p += 1; + } else { + neg = 0; + } + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + y = (REAL)0; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + y = y * (REAL)10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (s[__X(p, s__len)] == '.') { + p += 1; + g = (REAL)1; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + g = g / (REAL)(REAL)10; + y = y + g * ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + } + if (s[__X(p, s__len)] == 'D' || s[__X(p, s__len)] == 'E') { + p += 1; + e = 0; + if (s[__X(p, s__len)] == '-') { + negE = 1; + p += 1; + } else { + negE = 0; + } + while (s[__X(p, s__len)] == '0') { + p += 1; + } + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + e = e * 10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (negE) { + y = y / (REAL)Reals_Ten(e); + } else { + y = y * Reals_Ten(e); + } + } + if (neg) { + y = -y; + } + *r = y; + __DEL(s); +} + +void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r) +{ + INT16 p, e; + LONGREAL y, g; + BOOLEAN neg, negE; + __DUP(s, s__len, CHAR); + p = 0; + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + if (s[__X(p, s__len)] == '-') { + neg = 1; + p += 1; + } else { + neg = 0; + } + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + y = (LONGREAL)0; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + y = y * (LONGREAL)10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (s[__X(p, s__len)] == '.') { + p += 1; + g = (LONGREAL)1; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + g = g / (LONGREAL)(LONGREAL)10; + y = y + g * ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + } + if (s[__X(p, s__len)] == 'D' || s[__X(p, s__len)] == 'E') { + p += 1; + e = 0; + if (s[__X(p, s__len)] == '-') { + negE = 1; + p += 1; + } else { + negE = 0; + } + while (s[__X(p, s__len)] == '0') { + p += 1; + } + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + e = e * 10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (negE) { + y = y / (LONGREAL)Reals_Ten(e); + } else { + y = y * Reals_Ten(e); + } + } + if (neg) { + y = -y; + } + *r = y; + __DEL(s); +} + export void *Strings__init(void) { __DEFMOD; + __MODULE_IMPORT(Reals); __REGMOD("Strings", 0); /* BEGIN */ __ENDMOD; diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 04b06545..f88aeb04 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h @@ -17,6 +17,8 @@ import INT16 Strings_Length (CHAR *s, ADDRESS s__len); import BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); import INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); import void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +import void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r); +import void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r); import void *Strings__init(void); diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index d63c3ed6..b1559a2e 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 7a44b973..bbc925ac 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 436790ae..40b79e32 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index d8c8b46f..1e79747a 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index ef4097cd..6bfa4550 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #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("gcc -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); @@ -106,13 +106,15 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); - Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); - Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); - Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); - Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); - Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); - Strings_Append(OPM_Model, 10, (void*)cmd, 4096); - Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + if (!statically || 1) { + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); + Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); + Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); + Strings_Append(OPM_Model, 10, (void*)cmd, 4096); + Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + } extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 4096); __DEL(additionalopts); } diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index f05c741b..6969521d 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 38c8117f..2e1f73ec 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index a65d07d6..37d129c0 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/06/21]. 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 72e63747..76f70d82 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 4448f8ba..b387e012 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 26195611..c0394624 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 27cb83e1..12ba9904 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index f2ead3af..e7fb51b1 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 9c2d3b1f..a3a7a868 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 100225d5..2a213809 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 3779058a..4e5d8bb0 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 086dc5f6..23d08ad2 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index e9d9a49e..664d96fb 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index fdcce95f..26ce2529 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 664903f4..c439d70d 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 306f8ede..64e0b231 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 8b9269cb..e03ef961 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index ab6ef6cb..dd80e8ba 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index f77716b2..00989b7b 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index f009c3c0..89f48bc6 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 19d654e6..675711ee 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 305c3ef1..d17422b2 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index f4b2f0c9..9255cad8 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 60a80fc3..ebff1e8c 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 9d37e527..6ca1811b 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 7d83710b..d2b1d882 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 344ace71..0100e778 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 833eff32..609b0969 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index d73aa742..820a2ba7 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 439e5203..9a2fca64 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 34b0450a..925d8de0 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -6,6 +6,7 @@ #define SET UINT32 #include "SYSTEM.h" +#include "Reals.h" @@ -19,6 +20,8 @@ export INT16 Strings_Length (CHAR *s, ADDRESS s__len); export BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); export INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); export void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +export void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r); +export void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r); INT16 Strings_Length (CHAR *s, ADDRESS s__len) @@ -236,10 +239,135 @@ BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS return __retval; } +void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r) +{ + INT16 p, e; + REAL y, g; + BOOLEAN neg, negE; + __DUP(s, s__len, CHAR); + p = 0; + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + if (s[__X(p, s__len)] == '-') { + neg = 1; + p += 1; + } else { + neg = 0; + } + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + y = (REAL)0; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + y = y * (REAL)10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (s[__X(p, s__len)] == '.') { + p += 1; + g = (REAL)1; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + g = g / (REAL)(REAL)10; + y = y + g * ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + } + if (s[__X(p, s__len)] == 'D' || s[__X(p, s__len)] == 'E') { + p += 1; + e = 0; + if (s[__X(p, s__len)] == '-') { + negE = 1; + p += 1; + } else { + negE = 0; + } + while (s[__X(p, s__len)] == '0') { + p += 1; + } + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + e = e * 10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (negE) { + y = y / (REAL)Reals_Ten(e); + } else { + y = y * Reals_Ten(e); + } + } + if (neg) { + y = -y; + } + *r = y; + __DEL(s); +} + +void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r) +{ + INT16 p, e; + LONGREAL y, g; + BOOLEAN neg, negE; + __DUP(s, s__len, CHAR); + p = 0; + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + if (s[__X(p, s__len)] == '-') { + neg = 1; + p += 1; + } else { + neg = 0; + } + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + y = (LONGREAL)0; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + y = y * (LONGREAL)10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (s[__X(p, s__len)] == '.') { + p += 1; + g = (LONGREAL)1; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + g = g / (LONGREAL)(LONGREAL)10; + y = y + g * ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + } + if (s[__X(p, s__len)] == 'D' || s[__X(p, s__len)] == 'E') { + p += 1; + e = 0; + if (s[__X(p, s__len)] == '-') { + negE = 1; + p += 1; + } else { + negE = 0; + } + while (s[__X(p, s__len)] == '0') { + p += 1; + } + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + e = e * 10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (negE) { + y = y / (LONGREAL)Reals_Ten(e); + } else { + y = y * Reals_Ten(e); + } + } + if (neg) { + y = -y; + } + *r = y; + __DEL(s); +} + export void *Strings__init(void) { __DEFMOD; + __MODULE_IMPORT(Reals); __REGMOD("Strings", 0); /* BEGIN */ __ENDMOD; diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 04b06545..f88aeb04 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h @@ -17,6 +17,8 @@ import INT16 Strings_Length (CHAR *s, ADDRESS s__len); import BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); import INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); import void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +import void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r); +import void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r); import void *Strings__init(void); diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 51082c36..95b9bc22 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 037beccd..62b8d52e 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 436790ae..40b79e32 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index d8c8b46f..1e79747a 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index ef4097cd..6bfa4550 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #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("gcc -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); @@ -106,13 +106,15 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); - Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); - Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); - Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); - Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); - Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); - Strings_Append(OPM_Model, 10, (void*)cmd, 4096); - Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + if (!statically || 1) { + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); + Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); + Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); + Strings_Append(OPM_Model, 10, (void*)cmd, 4096); + Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + } extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 4096); __DEL(additionalopts); } diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index f05c741b..6969521d 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 38c8117f..2e1f73ec 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index a65d07d6..37d129c0 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/06/21]. 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 72e63747..76f70d82 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index bdbed96c..4dae8e76 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 43167fa5..4a2ce2b4 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 8fc061ff..29215cc6 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 25310ebf..3a5b2ec6 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 60fa4748..8fc501ee 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 8125a013..510a957f 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 3779058a..4e5d8bb0 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 086dc5f6..23d08ad2 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index e9d9a49e..664d96fb 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index fdcce95f..26ce2529 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index e475406d..77be12d2 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 306f8ede..64e0b231 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index bf3d11d5..09556118 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index ab6ef6cb..dd80e8ba 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index f77716b2..00989b7b 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index f009c3c0..89f48bc6 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 1c073903..bade5779 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 305c3ef1..d17422b2 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 51336832..bd91910e 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 60a80fc3..ebff1e8c 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 3950eb59..e7193968 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 7d83710b..d2b1d882 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index bc65bec9..c50aa4c4 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 5e2fda7d..5ecd9242 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index d73aa742..820a2ba7 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 439e5203..9a2fca64 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 34b0450a..925d8de0 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -6,6 +6,7 @@ #define SET UINT32 #include "SYSTEM.h" +#include "Reals.h" @@ -19,6 +20,8 @@ export INT16 Strings_Length (CHAR *s, ADDRESS s__len); export BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); export INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); export void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +export void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r); +export void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r); INT16 Strings_Length (CHAR *s, ADDRESS s__len) @@ -236,10 +239,135 @@ BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS return __retval; } +void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r) +{ + INT16 p, e; + REAL y, g; + BOOLEAN neg, negE; + __DUP(s, s__len, CHAR); + p = 0; + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + if (s[__X(p, s__len)] == '-') { + neg = 1; + p += 1; + } else { + neg = 0; + } + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + y = (REAL)0; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + y = y * (REAL)10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (s[__X(p, s__len)] == '.') { + p += 1; + g = (REAL)1; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + g = g / (REAL)(REAL)10; + y = y + g * ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + } + if (s[__X(p, s__len)] == 'D' || s[__X(p, s__len)] == 'E') { + p += 1; + e = 0; + if (s[__X(p, s__len)] == '-') { + negE = 1; + p += 1; + } else { + negE = 0; + } + while (s[__X(p, s__len)] == '0') { + p += 1; + } + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + e = e * 10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (negE) { + y = y / (REAL)Reals_Ten(e); + } else { + y = y * Reals_Ten(e); + } + } + if (neg) { + y = -y; + } + *r = y; + __DEL(s); +} + +void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r) +{ + INT16 p, e; + LONGREAL y, g; + BOOLEAN neg, negE; + __DUP(s, s__len, CHAR); + p = 0; + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + if (s[__X(p, s__len)] == '-') { + neg = 1; + p += 1; + } else { + neg = 0; + } + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + y = (LONGREAL)0; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + y = y * (LONGREAL)10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (s[__X(p, s__len)] == '.') { + p += 1; + g = (LONGREAL)1; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + g = g / (LONGREAL)(LONGREAL)10; + y = y + g * ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + } + if (s[__X(p, s__len)] == 'D' || s[__X(p, s__len)] == 'E') { + p += 1; + e = 0; + if (s[__X(p, s__len)] == '-') { + negE = 1; + p += 1; + } else { + negE = 0; + } + while (s[__X(p, s__len)] == '0') { + p += 1; + } + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + e = e * 10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (negE) { + y = y / (LONGREAL)Reals_Ten(e); + } else { + y = y * Reals_Ten(e); + } + } + if (neg) { + y = -y; + } + *r = y; + __DEL(s); +} + export void *Strings__init(void) { __DEFMOD; + __MODULE_IMPORT(Reals); __REGMOD("Strings", 0); /* BEGIN */ __ENDMOD; diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 04b06545..f88aeb04 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h @@ -17,6 +17,8 @@ import INT16 Strings_Length (CHAR *s, ADDRESS s__len); import BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); import INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); import void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +import void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r); +import void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r); import void *Strings__init(void); diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index d63c3ed6..b1559a2e 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 7a44b973..bbc925ac 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 436790ae..40b79e32 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index d8c8b46f..1e79747a 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index ef4097cd..6bfa4550 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #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("gcc -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); @@ -106,13 +106,15 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); - Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); - Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); - Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); - Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); - Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); - Strings_Append(OPM_Model, 10, (void*)cmd, 4096); - Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + if (!statically || 1) { + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); + Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); + Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); + Strings_Append(OPM_Model, 10, (void*)cmd, 4096); + Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + } extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 4096); __DEL(additionalopts); } diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index f05c741b..6969521d 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 38c8117f..2e1f73ec 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index a65d07d6..37d129c0 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/06/21]. 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 72e63747..76f70d82 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 032c4afb..e3eae937 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 66abb2c7..036899ba 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 27cb83e1..12ba9904 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index f2ead3af..e7fb51b1 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 2a55e70b..560c3287 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 100225d5..2a213809 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 3779058a..4e5d8bb0 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 086dc5f6..23d08ad2 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index e9d9a49e..664d96fb 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index fdcce95f..26ce2529 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 664903f4..c439d70d 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 306f8ede..64e0b231 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 8b9269cb..e03ef961 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index ab6ef6cb..dd80e8ba 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index f77716b2..00989b7b 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index f009c3c0..89f48bc6 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 19d654e6..675711ee 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 305c3ef1..d17422b2 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index f4b2f0c9..9255cad8 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 60a80fc3..ebff1e8c 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 3950eb59..e7193968 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 7d83710b..d2b1d882 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 3c3b5124..7d755921 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index e210853f..1c658e83 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index d73aa742..820a2ba7 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 439e5203..9a2fca64 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 34b0450a..925d8de0 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -6,6 +6,7 @@ #define SET UINT32 #include "SYSTEM.h" +#include "Reals.h" @@ -19,6 +20,8 @@ export INT16 Strings_Length (CHAR *s, ADDRESS s__len); export BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); export INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); export void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +export void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r); +export void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r); INT16 Strings_Length (CHAR *s, ADDRESS s__len) @@ -236,10 +239,135 @@ BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS return __retval; } +void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r) +{ + INT16 p, e; + REAL y, g; + BOOLEAN neg, negE; + __DUP(s, s__len, CHAR); + p = 0; + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + if (s[__X(p, s__len)] == '-') { + neg = 1; + p += 1; + } else { + neg = 0; + } + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + y = (REAL)0; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + y = y * (REAL)10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (s[__X(p, s__len)] == '.') { + p += 1; + g = (REAL)1; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + g = g / (REAL)(REAL)10; + y = y + g * ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + } + if (s[__X(p, s__len)] == 'D' || s[__X(p, s__len)] == 'E') { + p += 1; + e = 0; + if (s[__X(p, s__len)] == '-') { + negE = 1; + p += 1; + } else { + negE = 0; + } + while (s[__X(p, s__len)] == '0') { + p += 1; + } + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + e = e * 10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (negE) { + y = y / (REAL)Reals_Ten(e); + } else { + y = y * Reals_Ten(e); + } + } + if (neg) { + y = -y; + } + *r = y; + __DEL(s); +} + +void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r) +{ + INT16 p, e; + LONGREAL y, g; + BOOLEAN neg, negE; + __DUP(s, s__len, CHAR); + p = 0; + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + if (s[__X(p, s__len)] == '-') { + neg = 1; + p += 1; + } else { + neg = 0; + } + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + y = (LONGREAL)0; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + y = y * (LONGREAL)10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (s[__X(p, s__len)] == '.') { + p += 1; + g = (LONGREAL)1; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + g = g / (LONGREAL)(LONGREAL)10; + y = y + g * ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + } + if (s[__X(p, s__len)] == 'D' || s[__X(p, s__len)] == 'E') { + p += 1; + e = 0; + if (s[__X(p, s__len)] == '-') { + negE = 1; + p += 1; + } else { + negE = 0; + } + while (s[__X(p, s__len)] == '0') { + p += 1; + } + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + e = e * 10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (negE) { + y = y / (LONGREAL)Reals_Ten(e); + } else { + y = y * Reals_Ten(e); + } + } + if (neg) { + y = -y; + } + *r = y; + __DEL(s); +} + export void *Strings__init(void) { __DEFMOD; + __MODULE_IMPORT(Reals); __REGMOD("Strings", 0); /* BEGIN */ __ENDMOD; diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 04b06545..f88aeb04 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h @@ -17,6 +17,8 @@ import INT16 Strings_Length (CHAR *s, ADDRESS s__len); import BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); import INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); import void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +import void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r); +import void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r); import void *Strings__init(void); diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 51082c36..95b9bc22 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 037beccd..62b8d52e 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 436790ae..40b79e32 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index d8c8b46f..1e79747a 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index ef4097cd..6bfa4550 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #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("gcc -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); @@ -106,13 +106,15 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); - Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); - Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); - Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); - Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); - Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); - Strings_Append(OPM_Model, 10, (void*)cmd, 4096); - Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + if (!statically || 1) { + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); + Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); + Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); + Strings_Append(OPM_Model, 10, (void*)cmd, 4096); + Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + } extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 4096); __DEL(additionalopts); } diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index f05c741b..6969521d 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h