From 1c94abedc67621675b1cd8fffa5cf41ed9724158 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 21 Sep 2016 14:28:53 +0100 Subject: [PATCH] Simplify parameterisable memory model variables. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.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 | 6 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 6 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 85 ++++++++++----------------- bootstrap/unix-44/OPM.h | 4 +- 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 | 28 ++++----- bootstrap/unix-44/OPT.h | 4 +- bootstrap/unix-44/OPV.c | 17 +++--- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 22 ++----- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.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 | 6 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 6 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 85 ++++++++++----------------- bootstrap/unix-48/OPM.h | 4 +- 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 | 28 ++++----- bootstrap/unix-48/OPT.h | 4 +- bootstrap/unix-48/OPV.c | 17 +++--- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 22 ++----- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.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 | 6 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 6 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 85 ++++++++++----------------- bootstrap/unix-88/OPM.h | 4 +- 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 | 28 ++++----- bootstrap/unix-88/OPT.h | 4 +- bootstrap/unix-88/OPV.c | 17 +++--- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 22 ++----- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.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 | 6 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 6 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 85 ++++++++++----------------- bootstrap/windows-48/OPM.h | 4 +- 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 | 28 ++++----- bootstrap/windows-48/OPT.h | 4 +- bootstrap/windows-48/OPV.c | 17 +++--- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 22 ++----- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.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 | 6 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 6 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 85 ++++++++++----------------- bootstrap/windows-88/OPM.h | 4 +- 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 | 28 ++++----- bootstrap/windows-88/OPT.h | 4 +- bootstrap/windows-88/OPV.c | 17 +++--- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 22 ++----- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPB.Mod | 4 +- src/compiler/OPC.Mod | 4 +- src/compiler/OPM.cmdln.Mod | 86 +++++++++++++++------------- src/compiler/OPT.Mod | 53 ++++++++--------- src/compiler/OPV.Mod | 22 +++---- src/compiler/Vishap.Mod | 21 ++----- 201 files changed, 607 insertions(+), 763 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 4ea29c15..6db18d8a 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 6b8f5d99..831281d6 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index a3acbd98..dea5d7a8 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 8f5a2a2a..b18bf88a 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 32971286..3a826a34 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 2dfc3018..17077aa8 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 08a21c58..63b8e488 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 65b6b0b1..d150f1cf 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index f61acc40..a74b13a3 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 6841c244..d570a488 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 3ec5dfc2..a4070347 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1940,7 +1940,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2213,7 +2213,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index a57ace75..a39fd352 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 9923ccbc..f3b40759 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -839,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_PointerSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_AddressSize)); OPC_EndStat(); } @@ -1966,7 +1966,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) if (OPC_ansi) { OPM_WriteInt(array->n); } else { - OPC_IntLiteral(array->n, OPM_PointerSize); + OPC_IntLiteral(array->n, OPM_AddressSize); } } } diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 83153512..1ac87c2d 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 775776f4..e5b7fc83 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -177,19 +177,26 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (int16)s[__X(i, s__len)] - 48; + OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (int16)s[__X(i, s__len)] - 48; + OPM_AddressSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; OPM_Alignment = (int16)s[__X(i, s__len)] - 48; } - __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); - __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); + __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); + __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); + if (OPM_IntegerSize == 2) { + OPM_LongintSize = 4; + OPM_SetSize = 4; + } else { + OPM_LongintSize = 8; + OPM_SetSize = 8; + } Files_SetSearchPath((CHAR*)"", 1); break; case 'F': @@ -627,41 +634,26 @@ static int32 OPM_power0 (int32 i, int32 j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", 29); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", 14); - OPM_LogWNum(OPM_CharSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", 14); - OPM_LogWNum(OPM_BoolSize, 4); + OPM_LogWStr((CHAR*)"Type Size", 17); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SHORTINT ", 14); - OPM_LogWNum(OPM_SIntSize, 4); + OPM_LogWNum(OPM_ShortintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"INTEGER ", 14); - OPM_LogWNum(OPM_IntSize, 4); + OPM_LogWNum(OPM_IntegerSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"LONGINT ", 14); - OPM_LogWNum(OPM_LIntSize, 4); + OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", 14); OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", 14); - OPM_LogWNum(OPM_RealSize, 4); + OPM_LogWStr((CHAR*)"ADDRESS ", 14); + OPM_LogWNum(OPM_AddressSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", 14); - OPM_LogWNum(OPM_LRealSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", 14); - OPM_LogWNum(OPM_PointerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", 14); - OPM_LogWNum(OPM_ProcSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", 14); - OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Alignment: ", 12); + OPM_LogWNum(OPM_Alignment, 4); OPM_LogWLn(); } @@ -684,23 +676,12 @@ int64 OPM_SignedMinimum (int32 bytecount) static void OPM_GetProperties (void) { - OPM_ProcSize = OPM_PointerSize; - OPM_LIntSize = __ASHL(OPM_IntSize, 1); - OPM_SetSize = OPM_LIntSize; - if (OPM_RealSize == 4) { - OPM_MaxReal = 3.40282346000000e+038; - } else if (OPM_RealSize == 8) { - OPM_MaxReal = 1.79769296342094e+308; - } - if (OPM_LRealSize == 4) { - OPM_MaxLReal = 3.40282346000000e+038; - } else if (OPM_LRealSize == 8) { - OPM_MaxLReal = 1.79769296342094e+308; - } + OPM_MaxReal = 3.40282346000000e+038; + OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_SignedMaximum(OPM_PointerSize); + OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); if (OPM_Verbose) { OPM_VerboseListSizes(); } @@ -871,7 +852,7 @@ void OPM_WriteInt (int64 i) { CHAR s[24]; int64 i1, k; - if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { + if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); @@ -904,7 +885,7 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; int16 i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int32)__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { @@ -1073,15 +1054,11 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); - OPM_CharSize = 1; - OPM_BoolSize = 1; - OPM_SIntSize = 1; - OPM_RecSize = 1; - OPM_ByteSize = 1; - OPM_RealSize = 4; - OPM_LRealSize = 8; - OPM_PointerSize = 8; + OPM_AddressSize = 8; OPM_Alignment = 8; - OPM_IntSize = 4; + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; __ENDMOD; } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 9d7661c6..1835a2b8 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 86101b2b..f62551cc 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 7cbdb873..9ae7712a 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 67bca013..f04f47ad 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 3f106d0c..3ff9b0b3 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index a18e6768..693eb714 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,7 +89,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; @@ -1110,7 +1110,7 @@ static void OPT_InStruct (OPT_Struct *typ) switch (tag) { case 36: (*typ)->form = 11; - (*typ)->size = OPM_PointerSize; + (*typ)->size = OPM_AddressSize; (*typ)->n = 0; OPT_InStruct(&(*typ)->BaseTyp); break; @@ -1168,7 +1168,7 @@ static void OPT_InStruct (OPT_Struct *typ) break; case 40: (*typ)->form = 12; - (*typ)->size = OPM_ProcSize; + (*typ)->size = OPM_AddressSize; OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: @@ -1756,7 +1756,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; - (*typ)->size = OPM_ByteSize; + (*typ)->size = 1; (*typ)->allocated = 1; (*typ)->strobj = OPT_NewObj(); (*typ)->pbfp = form; @@ -1834,6 +1834,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_hinttyp); P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); @@ -1916,9 +1917,9 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_notyp, 10); OPT_InitStruct(&OPT_stringtyp, 8); OPT_InitStruct(&OPT_niltyp, 9); - OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); - OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); + OPT_EnterTyp((CHAR*)"BYTE", 1, 1, &OPT_bytetyp); + OPT_EnterTyp((CHAR*)"PTR", 11, -1, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, -1, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); @@ -1938,11 +1939,12 @@ export void *OPT__init(void) OPT_syslink = OPT_topScope->right; OPT_universe = OPT_topScope; OPT_topScope->right = NIL; - OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); - OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); - OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp); + OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp); + OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index fd0a538e..9ee5643f 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index ffe3eb71..2146d7c2 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -69,7 +69,7 @@ void OPV_TypSize (OPT_Struct typ) btyp = typ->BaseTyp; if (btyp == NIL) { offset = 0; - base = OPC_SizeAlignment(OPM_RecSize); + base = 1; } else { OPV_TypSize(btyp); offset = btyp->size - __ASHR(btyp->sysflag, 8); @@ -105,14 +105,14 @@ void OPV_TypSize (OPT_Struct typ) OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; } else if (f == 11) { - typ->size = OPM_PointerSize; + typ->size = OPM_AddressSize; if (typ->BaseTyp == OPT_undftyp) { OPM_Mark(128, typ->n); } else { OPV_TypSize(typ->BaseTyp); } } else if (f == 12) { - typ->size = OPM_ProcSize; + typ->size = OPM_AddressSize; } else if (c == 3) { btyp = typ->BaseTyp; OPV_TypSize(btyp); @@ -273,6 +273,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; + OPT_hinttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; @@ -790,7 +791,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } else if (comp == 3) { if (n->class == 7) { OPM_WriteString((CHAR*)", ", 3); - OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); + OPV_ParIntLiteral(n->conval->intval2, OPM_AddressSize); } else { aptyp = n->typ; dim = 0; @@ -809,7 +810,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) dim += 1; aptyp = aptyp->BaseTyp; } - OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); + OPV_ParIntLiteral(aptyp->size, OPM_AddressSize); } } } @@ -1314,7 +1315,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPC_IntLiteral(x->conval->intval, OPM_PointerSize); + OPC_IntLiteral(x->conval->intval, OPM_AddressSize); } else { OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); @@ -1322,7 +1323,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) } x = x->link; } else { - OPC_IntLiteral(typ->n, OPM_PointerSize); + OPC_IntLiteral(typ->n, OPM_AddressSize); } typ = typ->BaseTyp; } diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 33c1eeeb..f78267d0 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 10d2ba41..a42034f5 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 57c87f55..99b78a56 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 6982b582..c032a4a5 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index e79f35d7..b4469c3a 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index b2d5f19a..db9dbf02 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index ea987a3e..9d2d3b44 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 0339cbdb..faa47731 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 6d3f7c1e..e0fc1bc4 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 2d0b9dee..c3405c16 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 @@ -79,22 +79,12 @@ void Vishap_Module (BOOLEAN *done) static void Vishap_PropagateElementaryTypeSizes (void) { - OPT_bytetyp->size = OPM_ByteSize; - OPT_sysptrtyp->size = OPM_PointerSize; - OPT_chartyp->size = OPM_CharSize; + OPT_sysptrtyp->size = OPM_AddressSize; + OPT_adrtyp->size = OPM_AddressSize; OPT_settyp->size = OPM_SetSize; - OPT_realtyp->size = OPM_RealSize; - OPT_adrtyp->size = OPM_PointerSize; - OPT_lrltyp->size = OPM_LRealSize; - OPT_booltyp->size = OPM_BoolSize; - OPT_sinttyp = OPT_int8typ; - if (OPM_IntSize == 2) { - OPT_inttyp = OPT_int16typ; - OPT_linttyp = OPT_int32typ; - } else { - OPT_inttyp = OPT_int32typ; - OPT_linttyp = OPT_int64typ; - } + OPT_sinttyp = OPT_IntType(OPM_ShortintSize); + OPT_inttyp = OPT_IntType(OPM_IntegerSize); + OPT_linttyp = OPT_IntType(OPM_LongintSize); OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 2bdf2af6..2e61c724 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index b3535e92..99f4c6b0 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 5245f35d..8838dd7b 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 414a05f0..d4f0c474 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 4d312413..5d050112 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 1ecf99b1..11aabb2a 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 4ea29c15..6db18d8a 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 6b8f5d99..831281d6 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index a3acbd98..dea5d7a8 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 8f5a2a2a..b18bf88a 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 32971286..3a826a34 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 2dfc3018..17077aa8 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 08a21c58..63b8e488 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 65b6b0b1..d150f1cf 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index f61acc40..a74b13a3 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 6841c244..d570a488 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 3ec5dfc2..a4070347 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1940,7 +1940,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2213,7 +2213,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index a57ace75..a39fd352 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 9923ccbc..f3b40759 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -839,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_PointerSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_AddressSize)); OPC_EndStat(); } @@ -1966,7 +1966,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) if (OPC_ansi) { OPM_WriteInt(array->n); } else { - OPC_IntLiteral(array->n, OPM_PointerSize); + OPC_IntLiteral(array->n, OPM_AddressSize); } } } diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 83153512..1ac87c2d 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 775776f4..e5b7fc83 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -177,19 +177,26 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (int16)s[__X(i, s__len)] - 48; + OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (int16)s[__X(i, s__len)] - 48; + OPM_AddressSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; OPM_Alignment = (int16)s[__X(i, s__len)] - 48; } - __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); - __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); + __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); + __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); + if (OPM_IntegerSize == 2) { + OPM_LongintSize = 4; + OPM_SetSize = 4; + } else { + OPM_LongintSize = 8; + OPM_SetSize = 8; + } Files_SetSearchPath((CHAR*)"", 1); break; case 'F': @@ -627,41 +634,26 @@ static int32 OPM_power0 (int32 i, int32 j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", 29); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", 14); - OPM_LogWNum(OPM_CharSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", 14); - OPM_LogWNum(OPM_BoolSize, 4); + OPM_LogWStr((CHAR*)"Type Size", 17); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SHORTINT ", 14); - OPM_LogWNum(OPM_SIntSize, 4); + OPM_LogWNum(OPM_ShortintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"INTEGER ", 14); - OPM_LogWNum(OPM_IntSize, 4); + OPM_LogWNum(OPM_IntegerSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"LONGINT ", 14); - OPM_LogWNum(OPM_LIntSize, 4); + OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", 14); OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", 14); - OPM_LogWNum(OPM_RealSize, 4); + OPM_LogWStr((CHAR*)"ADDRESS ", 14); + OPM_LogWNum(OPM_AddressSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", 14); - OPM_LogWNum(OPM_LRealSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", 14); - OPM_LogWNum(OPM_PointerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", 14); - OPM_LogWNum(OPM_ProcSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", 14); - OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Alignment: ", 12); + OPM_LogWNum(OPM_Alignment, 4); OPM_LogWLn(); } @@ -684,23 +676,12 @@ int64 OPM_SignedMinimum (int32 bytecount) static void OPM_GetProperties (void) { - OPM_ProcSize = OPM_PointerSize; - OPM_LIntSize = __ASHL(OPM_IntSize, 1); - OPM_SetSize = OPM_LIntSize; - if (OPM_RealSize == 4) { - OPM_MaxReal = 3.40282346000000e+038; - } else if (OPM_RealSize == 8) { - OPM_MaxReal = 1.79769296342094e+308; - } - if (OPM_LRealSize == 4) { - OPM_MaxLReal = 3.40282346000000e+038; - } else if (OPM_LRealSize == 8) { - OPM_MaxLReal = 1.79769296342094e+308; - } + OPM_MaxReal = 3.40282346000000e+038; + OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_SignedMaximum(OPM_PointerSize); + OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); if (OPM_Verbose) { OPM_VerboseListSizes(); } @@ -871,7 +852,7 @@ void OPM_WriteInt (int64 i) { CHAR s[24]; int64 i1, k; - if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { + if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); @@ -904,7 +885,7 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; int16 i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int32)__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { @@ -1073,15 +1054,11 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); - OPM_CharSize = 1; - OPM_BoolSize = 1; - OPM_SIntSize = 1; - OPM_RecSize = 1; - OPM_ByteSize = 1; - OPM_RealSize = 4; - OPM_LRealSize = 8; - OPM_PointerSize = 8; + OPM_AddressSize = 8; OPM_Alignment = 8; - OPM_IntSize = 4; + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; __ENDMOD; } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 9d7661c6..1835a2b8 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 86101b2b..f62551cc 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 7cbdb873..9ae7712a 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 67bca013..f04f47ad 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 3f106d0c..3ff9b0b3 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index c1bc93b1..acdca9f2 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,7 +89,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; @@ -1110,7 +1110,7 @@ static void OPT_InStruct (OPT_Struct *typ) switch (tag) { case 36: (*typ)->form = 11; - (*typ)->size = OPM_PointerSize; + (*typ)->size = OPM_AddressSize; (*typ)->n = 0; OPT_InStruct(&(*typ)->BaseTyp); break; @@ -1168,7 +1168,7 @@ static void OPT_InStruct (OPT_Struct *typ) break; case 40: (*typ)->form = 12; - (*typ)->size = OPM_ProcSize; + (*typ)->size = OPM_AddressSize; OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: @@ -1756,7 +1756,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; - (*typ)->size = OPM_ByteSize; + (*typ)->size = 1; (*typ)->allocated = 1; (*typ)->strobj = OPT_NewObj(); (*typ)->pbfp = form; @@ -1834,6 +1834,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_hinttyp); P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); @@ -1916,9 +1917,9 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_notyp, 10); OPT_InitStruct(&OPT_stringtyp, 8); OPT_InitStruct(&OPT_niltyp, 9); - OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); - OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); + OPT_EnterTyp((CHAR*)"BYTE", 1, 1, &OPT_bytetyp); + OPT_EnterTyp((CHAR*)"PTR", 11, -1, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, -1, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); @@ -1938,11 +1939,12 @@ export void *OPT__init(void) OPT_syslink = OPT_topScope->right; OPT_universe = OPT_topScope; OPT_topScope->right = NIL; - OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); - OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); - OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp); + OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp); + OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index fd0a538e..9ee5643f 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index ffe3eb71..2146d7c2 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -69,7 +69,7 @@ void OPV_TypSize (OPT_Struct typ) btyp = typ->BaseTyp; if (btyp == NIL) { offset = 0; - base = OPC_SizeAlignment(OPM_RecSize); + base = 1; } else { OPV_TypSize(btyp); offset = btyp->size - __ASHR(btyp->sysflag, 8); @@ -105,14 +105,14 @@ void OPV_TypSize (OPT_Struct typ) OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; } else if (f == 11) { - typ->size = OPM_PointerSize; + typ->size = OPM_AddressSize; if (typ->BaseTyp == OPT_undftyp) { OPM_Mark(128, typ->n); } else { OPV_TypSize(typ->BaseTyp); } } else if (f == 12) { - typ->size = OPM_ProcSize; + typ->size = OPM_AddressSize; } else if (c == 3) { btyp = typ->BaseTyp; OPV_TypSize(btyp); @@ -273,6 +273,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; + OPT_hinttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; @@ -790,7 +791,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } else if (comp == 3) { if (n->class == 7) { OPM_WriteString((CHAR*)", ", 3); - OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); + OPV_ParIntLiteral(n->conval->intval2, OPM_AddressSize); } else { aptyp = n->typ; dim = 0; @@ -809,7 +810,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) dim += 1; aptyp = aptyp->BaseTyp; } - OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); + OPV_ParIntLiteral(aptyp->size, OPM_AddressSize); } } } @@ -1314,7 +1315,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPC_IntLiteral(x->conval->intval, OPM_PointerSize); + OPC_IntLiteral(x->conval->intval, OPM_AddressSize); } else { OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); @@ -1322,7 +1323,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) } x = x->link; } else { - OPC_IntLiteral(typ->n, OPM_PointerSize); + OPC_IntLiteral(typ->n, OPM_AddressSize); } typ = typ->BaseTyp; } diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 33c1eeeb..f78267d0 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 10d2ba41..a42034f5 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 57c87f55..99b78a56 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 6982b582..c032a4a5 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index e79f35d7..b4469c3a 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index b2d5f19a..db9dbf02 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index ea987a3e..9d2d3b44 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index f277a856..5ae009bd 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index b2a965f8..299cfde9 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 2d0b9dee..c3405c16 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 @@ -79,22 +79,12 @@ void Vishap_Module (BOOLEAN *done) static void Vishap_PropagateElementaryTypeSizes (void) { - OPT_bytetyp->size = OPM_ByteSize; - OPT_sysptrtyp->size = OPM_PointerSize; - OPT_chartyp->size = OPM_CharSize; + OPT_sysptrtyp->size = OPM_AddressSize; + OPT_adrtyp->size = OPM_AddressSize; OPT_settyp->size = OPM_SetSize; - OPT_realtyp->size = OPM_RealSize; - OPT_adrtyp->size = OPM_PointerSize; - OPT_lrltyp->size = OPM_LRealSize; - OPT_booltyp->size = OPM_BoolSize; - OPT_sinttyp = OPT_int8typ; - if (OPM_IntSize == 2) { - OPT_inttyp = OPT_int16typ; - OPT_linttyp = OPT_int32typ; - } else { - OPT_inttyp = OPT_int32typ; - OPT_linttyp = OPT_int64typ; - } + OPT_sinttyp = OPT_IntType(OPM_ShortintSize); + OPT_inttyp = OPT_IntType(OPM_IntegerSize); + OPT_linttyp = OPT_IntType(OPM_LongintSize); OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 2bdf2af6..2e61c724 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index b3535e92..99f4c6b0 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 5245f35d..8838dd7b 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 414a05f0..d4f0c474 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 4d312413..5d050112 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 1ecf99b1..11aabb2a 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index a5c4087d..9db9e691 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 6b8f5d99..831281d6 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index dea88004..7e051e81 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index a1322efe..be8ab870 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 7ace9c7c..efed2605 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 2040560d..64f39a5b 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 02dc0bbd..68a02b24 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index aa22df29..04b1a4f9 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 60382d3c..0e60d59f 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 4ef50204..5fec9a72 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index bd641a09..fedc1751 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1940,7 +1940,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2213,7 +2213,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 1330baf1..72ea3c62 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index b33dc59f..2c8127e1 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -839,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_PointerSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_AddressSize)); OPC_EndStat(); } @@ -1966,7 +1966,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) if (OPC_ansi) { OPM_WriteInt(array->n); } else { - OPC_IntLiteral(array->n, OPM_PointerSize); + OPC_IntLiteral(array->n, OPM_AddressSize); } } } diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index e749f6b6..30f3fd48 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 39c62389..391613fb 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int32 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export int32 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -176,19 +176,26 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = s[__X(i, s__len)] - 48; + OPM_IntegerSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = s[__X(i, s__len)] - 48; + OPM_AddressSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; OPM_Alignment = s[__X(i, s__len)] - 48; } - __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); - __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); + __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); + __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); + if (OPM_IntegerSize == 2) { + OPM_LongintSize = 4; + OPM_SetSize = 4; + } else { + OPM_LongintSize = 8; + OPM_SetSize = 8; + } Files_SetSearchPath((CHAR*)"", 1); break; case 'F': @@ -624,41 +631,26 @@ static int64 OPM_power0 (int64 i, int64 j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", 29); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", 14); - OPM_LogWNum(OPM_CharSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", 14); - OPM_LogWNum(OPM_BoolSize, 4); + OPM_LogWStr((CHAR*)"Type Size", 17); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SHORTINT ", 14); - OPM_LogWNum(OPM_SIntSize, 4); + OPM_LogWNum(OPM_ShortintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"INTEGER ", 14); - OPM_LogWNum(OPM_IntSize, 4); + OPM_LogWNum(OPM_IntegerSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"LONGINT ", 14); - OPM_LogWNum(OPM_LIntSize, 4); + OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", 14); OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", 14); - OPM_LogWNum(OPM_RealSize, 4); + OPM_LogWStr((CHAR*)"ADDRESS ", 14); + OPM_LogWNum(OPM_AddressSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", 14); - OPM_LogWNum(OPM_LRealSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", 14); - OPM_LogWNum(OPM_PointerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", 14); - OPM_LogWNum(OPM_ProcSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", 14); - OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Alignment: ", 12); + OPM_LogWNum(OPM_Alignment, 4); OPM_LogWLn(); } @@ -681,23 +673,12 @@ int64 OPM_SignedMinimum (int64 bytecount) static void OPM_GetProperties (void) { - OPM_ProcSize = OPM_PointerSize; - OPM_LIntSize = __ASHL(OPM_IntSize, 1); - OPM_SetSize = OPM_LIntSize; - if (OPM_RealSize == 4) { - OPM_MaxReal = 3.40282346000000e+038; - } else if (OPM_RealSize == 8) { - OPM_MaxReal = 1.79769296342094e+308; - } - if (OPM_LRealSize == 4) { - OPM_MaxLReal = 3.40282346000000e+038; - } else if (OPM_LRealSize == 8) { - OPM_MaxLReal = 1.79769296342094e+308; - } + OPM_MaxReal = 3.40282346000000e+038; + OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_SignedMaximum(OPM_PointerSize); + OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); if (OPM_Verbose) { OPM_VerboseListSizes(); } @@ -868,7 +849,7 @@ void OPM_WriteInt (int64 i) { CHAR s[24]; int64 i1, k; - if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { + if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); @@ -901,7 +882,7 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; int32 i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == (__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == (__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { @@ -1070,15 +1051,11 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); - OPM_CharSize = 1; - OPM_BoolSize = 1; - OPM_SIntSize = 1; - OPM_RecSize = 1; - OPM_ByteSize = 1; - OPM_RealSize = 4; - OPM_LRealSize = 8; - OPM_PointerSize = 8; + OPM_AddressSize = 8; OPM_Alignment = 8; - OPM_IntSize = 4; + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; __ENDMOD; } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 908a80ad..4a9253cf 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int32 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import int32 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 8573d6b1..ff86118c 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 7cbdb873..9ae7712a 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index a92e1feb..c811b3cc 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index d7c08330..1c9ae6a4 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 6928030e..5fbe3b87 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -88,7 +88,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; @@ -1109,7 +1109,7 @@ static void OPT_InStruct (OPT_Struct *typ) switch (tag) { case 36: (*typ)->form = 11; - (*typ)->size = OPM_PointerSize; + (*typ)->size = OPM_AddressSize; (*typ)->n = 0; OPT_InStruct(&(*typ)->BaseTyp); break; @@ -1167,7 +1167,7 @@ static void OPT_InStruct (OPT_Struct *typ) break; case 40: (*typ)->form = 12; - (*typ)->size = OPM_ProcSize; + (*typ)->size = OPM_AddressSize; OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: @@ -1755,7 +1755,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; - (*typ)->size = OPM_ByteSize; + (*typ)->size = 1; (*typ)->allocated = 1; (*typ)->strobj = OPT_NewObj(); (*typ)->pbfp = form; @@ -1833,6 +1833,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_hinttyp); P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); @@ -1915,9 +1916,9 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_notyp, 10); OPT_InitStruct(&OPT_stringtyp, 8); OPT_InitStruct(&OPT_niltyp, 9); - OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); - OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); + OPT_EnterTyp((CHAR*)"BYTE", 1, 1, &OPT_bytetyp); + OPT_EnterTyp((CHAR*)"PTR", 11, -1, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, -1, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); @@ -1937,11 +1938,12 @@ export void *OPT__init(void) OPT_syslink = OPT_topScope->right; OPT_universe = OPT_topScope; OPT_topScope->right = NIL; - OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); - OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); - OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp); + OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp); + OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index abb49dda..66686a2c 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 48080e50..965f7b61 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -69,7 +69,7 @@ void OPV_TypSize (OPT_Struct typ) btyp = typ->BaseTyp; if (btyp == NIL) { offset = 0; - base = OPC_SizeAlignment(OPM_RecSize); + base = 1; } else { OPV_TypSize(btyp); offset = btyp->size - (int64)__ASHR(btyp->sysflag, 8); @@ -105,14 +105,14 @@ void OPV_TypSize (OPT_Struct typ) OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; } else if (f == 11) { - typ->size = OPM_PointerSize; + typ->size = OPM_AddressSize; if (typ->BaseTyp == OPT_undftyp) { OPM_Mark(128, typ->n); } else { OPV_TypSize(typ->BaseTyp); } } else if (f == 12) { - typ->size = OPM_ProcSize; + typ->size = OPM_AddressSize; } else if (c == 3) { btyp = typ->BaseTyp; OPV_TypSize(btyp); @@ -273,6 +273,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; + OPT_hinttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; @@ -790,7 +791,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } else if (comp == 3) { if (n->class == 7) { OPM_WriteString((CHAR*)", ", 3); - OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); + OPV_ParIntLiteral(n->conval->intval2, OPM_AddressSize); } else { aptyp = n->typ; dim = 0; @@ -809,7 +810,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) dim += 1; aptyp = aptyp->BaseTyp; } - OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); + OPV_ParIntLiteral(aptyp->size, OPM_AddressSize); } } } @@ -1314,7 +1315,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPC_IntLiteral(x->conval->intval, OPM_PointerSize); + OPC_IntLiteral(x->conval->intval, OPM_AddressSize); } else { OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); @@ -1322,7 +1323,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) } x = x->link; } else { - OPC_IntLiteral(typ->n, OPM_PointerSize); + OPC_IntLiteral(typ->n, OPM_AddressSize); } typ = typ->BaseTyp; } diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 33c1eeeb..f78267d0 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 55230bcc..e2180e5d 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index d5e89ca2..6a8cce4b 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index e81db820..e9e84723 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index dec142cf..116d9c93 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 6aa3846a..8dc35935 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index d1c9f056..0487b70c 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 37fac00b..54254c51 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 0f195ce8..40d02918 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 00f0ac1a..7cd188f2 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 @@ -79,22 +79,12 @@ void Vishap_Module (BOOLEAN *done) static void Vishap_PropagateElementaryTypeSizes (void) { - OPT_bytetyp->size = OPM_ByteSize; - OPT_sysptrtyp->size = OPM_PointerSize; - OPT_chartyp->size = OPM_CharSize; + OPT_sysptrtyp->size = OPM_AddressSize; + OPT_adrtyp->size = OPM_AddressSize; OPT_settyp->size = OPM_SetSize; - OPT_realtyp->size = OPM_RealSize; - OPT_adrtyp->size = OPM_PointerSize; - OPT_lrltyp->size = OPM_LRealSize; - OPT_booltyp->size = OPM_BoolSize; - OPT_sinttyp = OPT_int8typ; - if (OPM_IntSize == 2) { - OPT_inttyp = OPT_int16typ; - OPT_linttyp = OPT_int32typ; - } else { - OPT_inttyp = OPT_int32typ; - OPT_linttyp = OPT_int64typ; - } + OPT_sinttyp = OPT_IntType(OPM_ShortintSize); + OPT_inttyp = OPT_IntType(OPM_IntegerSize); + OPT_linttyp = OPT_IntType(OPM_LongintSize); OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 8396896b..04b9504d 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index b3535e92..99f4c6b0 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index a4fbedda..2eef1f18 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 414a05f0..d4f0c474 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 04503b55..3b56b4b1 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index c27f0ae1..b574976e 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 4ea29c15..6db18d8a 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 6b8f5d99..831281d6 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 6409cfb5..94c1e086 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 8f5a2a2a..b18bf88a 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index d55dffcd..0c320187 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 8b2d7bab..febb2814 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 08a21c58..63b8e488 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 65b6b0b1..d150f1cf 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index f61acc40..a74b13a3 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 6841c244..d570a488 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 3ec5dfc2..a4070347 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1940,7 +1940,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2213,7 +2213,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index a57ace75..a39fd352 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 9923ccbc..f3b40759 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -839,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_PointerSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_AddressSize)); OPC_EndStat(); } @@ -1966,7 +1966,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) if (OPC_ansi) { OPM_WriteInt(array->n); } else { - OPC_IntLiteral(array->n, OPM_PointerSize); + OPC_IntLiteral(array->n, OPM_AddressSize); } } } diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 83153512..1ac87c2d 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 775776f4..e5b7fc83 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -177,19 +177,26 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (int16)s[__X(i, s__len)] - 48; + OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (int16)s[__X(i, s__len)] - 48; + OPM_AddressSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; OPM_Alignment = (int16)s[__X(i, s__len)] - 48; } - __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); - __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); + __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); + __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); + if (OPM_IntegerSize == 2) { + OPM_LongintSize = 4; + OPM_SetSize = 4; + } else { + OPM_LongintSize = 8; + OPM_SetSize = 8; + } Files_SetSearchPath((CHAR*)"", 1); break; case 'F': @@ -627,41 +634,26 @@ static int32 OPM_power0 (int32 i, int32 j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", 29); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", 14); - OPM_LogWNum(OPM_CharSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", 14); - OPM_LogWNum(OPM_BoolSize, 4); + OPM_LogWStr((CHAR*)"Type Size", 17); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SHORTINT ", 14); - OPM_LogWNum(OPM_SIntSize, 4); + OPM_LogWNum(OPM_ShortintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"INTEGER ", 14); - OPM_LogWNum(OPM_IntSize, 4); + OPM_LogWNum(OPM_IntegerSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"LONGINT ", 14); - OPM_LogWNum(OPM_LIntSize, 4); + OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", 14); OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", 14); - OPM_LogWNum(OPM_RealSize, 4); + OPM_LogWStr((CHAR*)"ADDRESS ", 14); + OPM_LogWNum(OPM_AddressSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", 14); - OPM_LogWNum(OPM_LRealSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", 14); - OPM_LogWNum(OPM_PointerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", 14); - OPM_LogWNum(OPM_ProcSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", 14); - OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Alignment: ", 12); + OPM_LogWNum(OPM_Alignment, 4); OPM_LogWLn(); } @@ -684,23 +676,12 @@ int64 OPM_SignedMinimum (int32 bytecount) static void OPM_GetProperties (void) { - OPM_ProcSize = OPM_PointerSize; - OPM_LIntSize = __ASHL(OPM_IntSize, 1); - OPM_SetSize = OPM_LIntSize; - if (OPM_RealSize == 4) { - OPM_MaxReal = 3.40282346000000e+038; - } else if (OPM_RealSize == 8) { - OPM_MaxReal = 1.79769296342094e+308; - } - if (OPM_LRealSize == 4) { - OPM_MaxLReal = 3.40282346000000e+038; - } else if (OPM_LRealSize == 8) { - OPM_MaxLReal = 1.79769296342094e+308; - } + OPM_MaxReal = 3.40282346000000e+038; + OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_SignedMaximum(OPM_PointerSize); + OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); if (OPM_Verbose) { OPM_VerboseListSizes(); } @@ -871,7 +852,7 @@ void OPM_WriteInt (int64 i) { CHAR s[24]; int64 i1, k; - if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { + if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); @@ -904,7 +885,7 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; int16 i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int32)__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { @@ -1073,15 +1054,11 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); - OPM_CharSize = 1; - OPM_BoolSize = 1; - OPM_SIntSize = 1; - OPM_RecSize = 1; - OPM_ByteSize = 1; - OPM_RealSize = 4; - OPM_LRealSize = 8; - OPM_PointerSize = 8; + OPM_AddressSize = 8; OPM_Alignment = 8; - OPM_IntSize = 4; + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; __ENDMOD; } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 9d7661c6..1835a2b8 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 86101b2b..f62551cc 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 7cbdb873..9ae7712a 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 67bca013..f04f47ad 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 3f106d0c..3ff9b0b3 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index c1bc93b1..acdca9f2 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,7 +89,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; @@ -1110,7 +1110,7 @@ static void OPT_InStruct (OPT_Struct *typ) switch (tag) { case 36: (*typ)->form = 11; - (*typ)->size = OPM_PointerSize; + (*typ)->size = OPM_AddressSize; (*typ)->n = 0; OPT_InStruct(&(*typ)->BaseTyp); break; @@ -1168,7 +1168,7 @@ static void OPT_InStruct (OPT_Struct *typ) break; case 40: (*typ)->form = 12; - (*typ)->size = OPM_ProcSize; + (*typ)->size = OPM_AddressSize; OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: @@ -1756,7 +1756,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; - (*typ)->size = OPM_ByteSize; + (*typ)->size = 1; (*typ)->allocated = 1; (*typ)->strobj = OPT_NewObj(); (*typ)->pbfp = form; @@ -1834,6 +1834,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_hinttyp); P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); @@ -1916,9 +1917,9 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_notyp, 10); OPT_InitStruct(&OPT_stringtyp, 8); OPT_InitStruct(&OPT_niltyp, 9); - OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); - OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); + OPT_EnterTyp((CHAR*)"BYTE", 1, 1, &OPT_bytetyp); + OPT_EnterTyp((CHAR*)"PTR", 11, -1, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, -1, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); @@ -1938,11 +1939,12 @@ export void *OPT__init(void) OPT_syslink = OPT_topScope->right; OPT_universe = OPT_topScope; OPT_topScope->right = NIL; - OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); - OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); - OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp); + OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp); + OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index fd0a538e..9ee5643f 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index ffe3eb71..2146d7c2 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -69,7 +69,7 @@ void OPV_TypSize (OPT_Struct typ) btyp = typ->BaseTyp; if (btyp == NIL) { offset = 0; - base = OPC_SizeAlignment(OPM_RecSize); + base = 1; } else { OPV_TypSize(btyp); offset = btyp->size - __ASHR(btyp->sysflag, 8); @@ -105,14 +105,14 @@ void OPV_TypSize (OPT_Struct typ) OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; } else if (f == 11) { - typ->size = OPM_PointerSize; + typ->size = OPM_AddressSize; if (typ->BaseTyp == OPT_undftyp) { OPM_Mark(128, typ->n); } else { OPV_TypSize(typ->BaseTyp); } } else if (f == 12) { - typ->size = OPM_ProcSize; + typ->size = OPM_AddressSize; } else if (c == 3) { btyp = typ->BaseTyp; OPV_TypSize(btyp); @@ -273,6 +273,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; + OPT_hinttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; @@ -790,7 +791,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } else if (comp == 3) { if (n->class == 7) { OPM_WriteString((CHAR*)", ", 3); - OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); + OPV_ParIntLiteral(n->conval->intval2, OPM_AddressSize); } else { aptyp = n->typ; dim = 0; @@ -809,7 +810,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) dim += 1; aptyp = aptyp->BaseTyp; } - OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); + OPV_ParIntLiteral(aptyp->size, OPM_AddressSize); } } } @@ -1314,7 +1315,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPC_IntLiteral(x->conval->intval, OPM_PointerSize); + OPC_IntLiteral(x->conval->intval, OPM_AddressSize); } else { OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); @@ -1322,7 +1323,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) } x = x->link; } else { - OPC_IntLiteral(typ->n, OPM_PointerSize); + OPC_IntLiteral(typ->n, OPM_AddressSize); } typ = typ->BaseTyp; } diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 33c1eeeb..f78267d0 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 35849e85..89bc758a 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 84dc9bd1..9a1147dc 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 6982b582..c032a4a5 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index e79f35d7..b4469c3a 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index b2d5f19a..db9dbf02 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index ea987a3e..9d2d3b44 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index f277a856..5ae009bd 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index b2a965f8..299cfde9 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 2d0b9dee..c3405c16 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 @@ -79,22 +79,12 @@ void Vishap_Module (BOOLEAN *done) static void Vishap_PropagateElementaryTypeSizes (void) { - OPT_bytetyp->size = OPM_ByteSize; - OPT_sysptrtyp->size = OPM_PointerSize; - OPT_chartyp->size = OPM_CharSize; + OPT_sysptrtyp->size = OPM_AddressSize; + OPT_adrtyp->size = OPM_AddressSize; OPT_settyp->size = OPM_SetSize; - OPT_realtyp->size = OPM_RealSize; - OPT_adrtyp->size = OPM_PointerSize; - OPT_lrltyp->size = OPM_LRealSize; - OPT_booltyp->size = OPM_BoolSize; - OPT_sinttyp = OPT_int8typ; - if (OPM_IntSize == 2) { - OPT_inttyp = OPT_int16typ; - OPT_linttyp = OPT_int32typ; - } else { - OPT_inttyp = OPT_int32typ; - OPT_linttyp = OPT_int64typ; - } + OPT_sinttyp = OPT_IntType(OPM_ShortintSize); + OPT_inttyp = OPT_IntType(OPM_IntegerSize); + OPT_linttyp = OPT_IntType(OPM_LongintSize); OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 2bdf2af6..2e61c724 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index b3535e92..99f4c6b0 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 5245f35d..8838dd7b 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 414a05f0..d4f0c474 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 4d312413..5d050112 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 1ecf99b1..11aabb2a 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index a5c4087d..9db9e691 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 6b8f5d99..831281d6 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index a18275f8..b0a79723 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index a1322efe..be8ab870 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index ead58244..de0e2164 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 94cf47a0..f0ec05c1 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 02dc0bbd..68a02b24 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index aa22df29..04b1a4f9 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 60382d3c..0e60d59f 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 4ef50204..5fec9a72 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index bd641a09..fedc1751 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1940,7 +1940,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2213,7 +2213,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 1330baf1..72ea3c62 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index b33dc59f..2c8127e1 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -839,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_PointerSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_AddressSize)); OPC_EndStat(); } @@ -1966,7 +1966,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) if (OPC_ansi) { OPM_WriteInt(array->n); } else { - OPC_IntLiteral(array->n, OPM_PointerSize); + OPC_IntLiteral(array->n, OPM_AddressSize); } } } diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index e749f6b6..30f3fd48 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 39c62389..391613fb 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int32 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export int32 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -176,19 +176,26 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = s[__X(i, s__len)] - 48; + OPM_IntegerSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = s[__X(i, s__len)] - 48; + OPM_AddressSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; OPM_Alignment = s[__X(i, s__len)] - 48; } - __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); - __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); + __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); + __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); + if (OPM_IntegerSize == 2) { + OPM_LongintSize = 4; + OPM_SetSize = 4; + } else { + OPM_LongintSize = 8; + OPM_SetSize = 8; + } Files_SetSearchPath((CHAR*)"", 1); break; case 'F': @@ -624,41 +631,26 @@ static int64 OPM_power0 (int64 i, int64 j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", 29); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", 14); - OPM_LogWNum(OPM_CharSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", 14); - OPM_LogWNum(OPM_BoolSize, 4); + OPM_LogWStr((CHAR*)"Type Size", 17); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SHORTINT ", 14); - OPM_LogWNum(OPM_SIntSize, 4); + OPM_LogWNum(OPM_ShortintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"INTEGER ", 14); - OPM_LogWNum(OPM_IntSize, 4); + OPM_LogWNum(OPM_IntegerSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"LONGINT ", 14); - OPM_LogWNum(OPM_LIntSize, 4); + OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", 14); OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", 14); - OPM_LogWNum(OPM_RealSize, 4); + OPM_LogWStr((CHAR*)"ADDRESS ", 14); + OPM_LogWNum(OPM_AddressSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", 14); - OPM_LogWNum(OPM_LRealSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", 14); - OPM_LogWNum(OPM_PointerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", 14); - OPM_LogWNum(OPM_ProcSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", 14); - OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Alignment: ", 12); + OPM_LogWNum(OPM_Alignment, 4); OPM_LogWLn(); } @@ -681,23 +673,12 @@ int64 OPM_SignedMinimum (int64 bytecount) static void OPM_GetProperties (void) { - OPM_ProcSize = OPM_PointerSize; - OPM_LIntSize = __ASHL(OPM_IntSize, 1); - OPM_SetSize = OPM_LIntSize; - if (OPM_RealSize == 4) { - OPM_MaxReal = 3.40282346000000e+038; - } else if (OPM_RealSize == 8) { - OPM_MaxReal = 1.79769296342094e+308; - } - if (OPM_LRealSize == 4) { - OPM_MaxLReal = 3.40282346000000e+038; - } else if (OPM_LRealSize == 8) { - OPM_MaxLReal = 1.79769296342094e+308; - } + OPM_MaxReal = 3.40282346000000e+038; + OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_SignedMaximum(OPM_PointerSize); + OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); if (OPM_Verbose) { OPM_VerboseListSizes(); } @@ -868,7 +849,7 @@ void OPM_WriteInt (int64 i) { CHAR s[24]; int64 i1, k; - if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { + if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); @@ -901,7 +882,7 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; int32 i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == (__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == (__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { @@ -1070,15 +1051,11 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); - OPM_CharSize = 1; - OPM_BoolSize = 1; - OPM_SIntSize = 1; - OPM_RecSize = 1; - OPM_ByteSize = 1; - OPM_RealSize = 4; - OPM_LRealSize = 8; - OPM_PointerSize = 8; + OPM_AddressSize = 8; OPM_Alignment = 8; - OPM_IntSize = 4; + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; __ENDMOD; } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 908a80ad..4a9253cf 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int32 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import int32 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 8573d6b1..ff86118c 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 7cbdb873..9ae7712a 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index a92e1feb..c811b3cc 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index d7c08330..1c9ae6a4 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 6928030e..5fbe3b87 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -88,7 +88,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; @@ -1109,7 +1109,7 @@ static void OPT_InStruct (OPT_Struct *typ) switch (tag) { case 36: (*typ)->form = 11; - (*typ)->size = OPM_PointerSize; + (*typ)->size = OPM_AddressSize; (*typ)->n = 0; OPT_InStruct(&(*typ)->BaseTyp); break; @@ -1167,7 +1167,7 @@ static void OPT_InStruct (OPT_Struct *typ) break; case 40: (*typ)->form = 12; - (*typ)->size = OPM_ProcSize; + (*typ)->size = OPM_AddressSize; OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: @@ -1755,7 +1755,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; - (*typ)->size = OPM_ByteSize; + (*typ)->size = 1; (*typ)->allocated = 1; (*typ)->strobj = OPT_NewObj(); (*typ)->pbfp = form; @@ -1833,6 +1833,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_hinttyp); P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); @@ -1915,9 +1916,9 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_notyp, 10); OPT_InitStruct(&OPT_stringtyp, 8); OPT_InitStruct(&OPT_niltyp, 9); - OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); - OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); + OPT_EnterTyp((CHAR*)"BYTE", 1, 1, &OPT_bytetyp); + OPT_EnterTyp((CHAR*)"PTR", 11, -1, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, -1, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); @@ -1937,11 +1938,12 @@ export void *OPT__init(void) OPT_syslink = OPT_topScope->right; OPT_universe = OPT_topScope; OPT_topScope->right = NIL; - OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); - OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); - OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp); + OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp); + OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index abb49dda..66686a2c 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 48080e50..965f7b61 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -69,7 +69,7 @@ void OPV_TypSize (OPT_Struct typ) btyp = typ->BaseTyp; if (btyp == NIL) { offset = 0; - base = OPC_SizeAlignment(OPM_RecSize); + base = 1; } else { OPV_TypSize(btyp); offset = btyp->size - (int64)__ASHR(btyp->sysflag, 8); @@ -105,14 +105,14 @@ void OPV_TypSize (OPT_Struct typ) OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; } else if (f == 11) { - typ->size = OPM_PointerSize; + typ->size = OPM_AddressSize; if (typ->BaseTyp == OPT_undftyp) { OPM_Mark(128, typ->n); } else { OPV_TypSize(typ->BaseTyp); } } else if (f == 12) { - typ->size = OPM_ProcSize; + typ->size = OPM_AddressSize; } else if (c == 3) { btyp = typ->BaseTyp; OPV_TypSize(btyp); @@ -273,6 +273,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; + OPT_hinttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; @@ -790,7 +791,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } else if (comp == 3) { if (n->class == 7) { OPM_WriteString((CHAR*)", ", 3); - OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); + OPV_ParIntLiteral(n->conval->intval2, OPM_AddressSize); } else { aptyp = n->typ; dim = 0; @@ -809,7 +810,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) dim += 1; aptyp = aptyp->BaseTyp; } - OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); + OPV_ParIntLiteral(aptyp->size, OPM_AddressSize); } } } @@ -1314,7 +1315,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPC_IntLiteral(x->conval->intval, OPM_PointerSize); + OPC_IntLiteral(x->conval->intval, OPM_AddressSize); } else { OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); @@ -1322,7 +1323,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) } x = x->link; } else { - OPC_IntLiteral(typ->n, OPM_PointerSize); + OPC_IntLiteral(typ->n, OPM_AddressSize); } typ = typ->BaseTyp; } diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 33c1eeeb..f78267d0 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index a576c90e..0093f826 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 7832ec0f..7faaa2a6 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index e81db820..e9e84723 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index dec142cf..116d9c93 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 6aa3846a..8dc35935 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index d1c9f056..0487b70c 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 37fac00b..54254c51 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 0f195ce8..40d02918 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 00f0ac1a..7cd188f2 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 @@ -79,22 +79,12 @@ void Vishap_Module (BOOLEAN *done) static void Vishap_PropagateElementaryTypeSizes (void) { - OPT_bytetyp->size = OPM_ByteSize; - OPT_sysptrtyp->size = OPM_PointerSize; - OPT_chartyp->size = OPM_CharSize; + OPT_sysptrtyp->size = OPM_AddressSize; + OPT_adrtyp->size = OPM_AddressSize; OPT_settyp->size = OPM_SetSize; - OPT_realtyp->size = OPM_RealSize; - OPT_adrtyp->size = OPM_PointerSize; - OPT_lrltyp->size = OPM_LRealSize; - OPT_booltyp->size = OPM_BoolSize; - OPT_sinttyp = OPT_int8typ; - if (OPM_IntSize == 2) { - OPT_inttyp = OPT_int16typ; - OPT_linttyp = OPT_int32typ; - } else { - OPT_inttyp = OPT_int32typ; - OPT_linttyp = OPT_int64typ; - } + OPT_sinttyp = OPT_IntType(OPM_ShortintSize); + OPT_inttyp = OPT_IntType(OPM_IntegerSize); + OPT_linttyp = OPT_IntType(OPM_LongintSize); OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 8396896b..04b9504d 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index b3535e92..99f4c6b0 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index a4fbedda..2eef1f18 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 414a05f0..d4f0c474 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 04503b55..3b56b4b1 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index c27f0ae1..b574976e 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 0d840821..6fc81fe1 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -1053,7 +1053,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) OPT.movefn: (*SYSTEM.GET, SYSTEM.PUT, SYSTEM.BIT, SYSTEM.MOVE*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF (x^.class = OPT.Nconst) & (f = OPT.Int) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) - ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp + ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.AddressSize)) THEN err(111); x^.typ := OPT.linttyp END |OPT.getrfn, OPT.putrfn: (*SYSTEM.GETREG, SYSTEM.PUTREG*) @@ -1230,7 +1230,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.movefn: (*SYSTEM.MOVE*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF (x^.class = OPT.Nconst) & (f = OPT.Int) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) - ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp + ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.AddressSize)) THEN err(111); x^.typ := OPT.linttyp END; p^.link := x |OPT.assertfn: (*ASSERT*) diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 9febea62..bc84b8ad 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -552,7 +552,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF typ^.strobj # NIL THEN OPM.WriteStringVar(typ^.strobj^.name) END ; OPM.Write(DoubleQuote); Str1(', #), {', typ^.size); - nofptrs := 0; PutPtrOffsets(typ, 0, nofptrs); Str1("#}}", -(nofptrs + 1) * OPM.PointerSize); + nofptrs := 0; PutPtrOffsets(typ, 0, nofptrs); Str1("#}}", -(nofptrs + 1) * OPM.AddressSize); EndStat END TDescDecl; @@ -1303,7 +1303,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF dim # 0 THEN OPM.WriteInt(dim) END ELSE (* array *) WHILE dim > 0 DO array := array^.BaseTyp; DEC(dim) END; - IF ansi THEN OPM.WriteInt(array.n) ELSE IntLiteral(array.n, OPM.PointerSize) END + IF ansi THEN OPM.WriteInt(array.n) ELSE IntLiteral(array.n, OPM.AddressSize) END END END Len; diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index b70b8474..952ea9e5 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -88,10 +88,11 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) VAR SourceFileName : ARRAY 256 OF CHAR; - Alignment*: INTEGER; + (* Parameter selectable sizes *) + Alignment*, + AddressSize*, SetSize*, + ShortintSize*, IntegerSize*, LongintSize*: INTEGER; - ByteSize*, CharSize*, BoolSize*, SIntSize*, IntSize*, - LIntSize*, SetSize*, RealSize*, LRealSize*, PointerSize*, ProcSize*, RecSize*, MaxSet*: INTEGER; MaxIndex*: SYSTEM.INT64; @@ -161,13 +162,21 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) | "t": opt := opt / {typchk} | "x": opt := opt / {inxchk} - | "B": IF s[i+1] # 0X THEN INC(i); IntSize := ORD(s[i]) - ORD('0') END; - IF s[i+1] # 0X THEN INC(i); PointerSize := ORD(s[i]) - ORD('0') END; + | "B": IF s[i+1] # 0X THEN INC(i); IntegerSize := ORD(s[i]) - ORD('0') END; + IF s[i+1] # 0X THEN INC(i); AddressSize := ORD(s[i]) - ORD('0') END; IF s[i+1] # 0X THEN INC(i); Alignment := ORD(s[i]) - ORD('0') END; - ASSERT((IntSize = 2) OR (IntSize = 4)); - ASSERT((PointerSize = 4) OR (PointerSize = 8)); + ASSERT((IntegerSize = 2) OR (IntegerSize = 4)); + ASSERT((AddressSize = 4) OR (AddressSize = 8)); ASSERT((Alignment = 4) OR (Alignment = 8)); + IF IntegerSize = 2 THEN + LongintSize := 4; + SetSize := 4; + ELSE + LongintSize := 8; + SetSize := 8; + END; Files.SetSearchPath("") + | "F": opt := opt / {forcenewsym} | "M": opt := opt / {mainlinkstat} | "S": opt := opt / {dontasm} @@ -529,20 +538,24 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE VerboseListSizes; BEGIN LogWLn; - LogWStr("Type Size Alignement"); LogWLn; + (*LogWStr("Type Size Alignement"); LogWLn;*) + LogWStr("Type Size"); LogWLn; + (* LogWStr("CHAR "); LogWNum(CharSize, 4); (* LogWNum(CharAlign, 5); *) LogWLn; LogWStr("BOOLEAN "); LogWNum(BoolSize, 4); (* LogWNum(BoolAlign, 5); *) LogWLn; - LogWStr("SHORTINT "); LogWNum(SIntSize, 4); (* LogWNum(SIntAlign, 5); *) LogWLn; - LogWStr("INTEGER "); LogWNum(IntSize, 4); (* LogWNum(IntAlign, 5); *) LogWLn; - LogWStr("LONGINT "); LogWNum(LIntSize, 4); (* LogWNum(LIntAlign, 5); *) LogWLn; - LogWStr("SET "); LogWNum(SetSize, 4); (* LogWNum(SetAlign, 5); *) LogWLn; LogWStr("REAL "); LogWNum(RealSize, 4); (* LogWNum(RealAlign, 5); *) LogWLn; LogWStr("LONGREAL "); LogWNum(LRealSize, 4); (* LogWNum(LRealAlign, 5); *) LogWLn; - LogWStr("PTR "); LogWNum(PointerSize, 4); (* LogWNum(PointerAlign, 5); *) LogWLn; - LogWStr("PROC "); LogWNum(ProcSize, 4); (* LogWNum(ProcAlign, 5); *) LogWLn; LogWStr("RECORD "); LogWNum(RecSize, 4); (* LogWNum(RecAlign, 5); *) LogWLn; - (*LogWStr("ENDIAN "); LogWNum(ByteOrder, 4); LogWNum(BitOrder, 5); LogWLn;*) + LogWStr("PROC "); LogWNum(ProcSize, 4); (* LogWNum(ProcAlign, 5); *) LogWLn; + LogWStr("ENDIAN "); LogWNum(ByteOrder, 4); LogWNum(BitOrder, 5); LogWLn; + *) + LogWStr("SHORTINT "); LogWNum(ShortintSize, 4); (* LogWNum(SIntAlign, 5); *) LogWLn; + LogWStr("INTEGER "); LogWNum(IntegerSize, 4); (* LogWNum(IntAlign, 5); *) LogWLn; + LogWStr("LONGINT "); LogWNum(LongintSize, 4); (* LogWNum(LIntAlign, 5); *) LogWLn; + LogWStr("SET "); LogWNum(SetSize, 4); (* LogWNum(SetAlign, 5); *) LogWLn; + LogWStr("ADDRESS "); LogWNum(AddressSize, 4); (* LogWNum(PointerAlign, 5); *) LogWLn; LogWLn; + LogWStr("Alignment: "); LogWNum(Alignment, 4); LogWLn; (* LogWStr("Min shortint "); LogWNum(MinSInt, 4); LogWLn; LogWStr("Max shortint "); LogWNum(MaxSInt, 4); LogWLn; @@ -582,25 +595,14 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) the module startup code, and maybe overridden by the -Bnnn bootstrap parameter *) - (* Derived sizes *) - ProcSize := PointerSize; - LIntSize := IntSize * 2; - SetSize := LIntSize; - - IF RealSize = 4 THEN MaxReal := 3.40282346D38 - ELSIF RealSize = 8 THEN MaxReal := 1.7976931348623157D307 * 9.999999 + MaxReal := 3.40282346D38; (* REAL is 4 bytes *) + MaxLReal := 1.7976931348623157D307 * 9.999999; (* LONGREAL is 8 bytes *) (*should be 1.7976931348623157D308 *) - END ; - - IF LRealSize = 4 THEN MaxLReal := 3.40282346D38 - ELSIF LRealSize = 8 THEN MaxLReal := 1.7976931348623157D307 * 9.999999 - (*should be 1.7976931348623157D308 *) - END ; MinReal := -MaxReal; MinLReal := -MaxLReal; MaxSet := SetSize * 8 - 1; - MaxIndex := SignedMaximum(PointerSize); + MaxIndex := SignedMaximum(AddressSize); IF Verbose THEN VerboseListSizes END; END GetProperties; @@ -734,9 +736,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE WriteInt* (i: SYSTEM.INT64); VAR s: ARRAY 24 OF CHAR; i1, k: SYSTEM.INT64; BEGIN - IF (i = SignedMinimum(IntSize)) - OR (i = SignedMinimum(LIntSize)) - OR (i = SignedMinimum(8)) THEN + IF (i = SignedMinimum(2)) OR (i = SignedMinimum(4)) OR (i = SignedMinimum(8)) THEN (* abs(minint) is one more than maxint, causing problems representing the value as a minus sign followed by absoute value. Therefore represent as -maxint - 1. For INTEGER this avoids a compiler warning 'this decimal constant is unsigned only in ISO C90', for LONGINT it is the @@ -754,7 +754,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) VAR W: Texts.Writer; T: Texts.Text; R: Texts.Reader; s: ARRAY 32 OF CHAR; ch: CHAR; i: INTEGER; BEGIN (*should be improved *) - IF (r < SignedMaximum(LIntSize)) & (r > SignedMinimum(LIntSize)) & (r = ENTIER(r)) THEN + IF (r < SignedMaximum(LongintSize)) & (r > SignedMinimum(LongintSize)) & (r = ENTIER(r)) THEN IF suffx = "f" THEN WriteString("(REAL)") ELSE WriteString("(LONGREAL)") END ; WriteInt(ENTIER(r)) ELSE @@ -839,13 +839,19 @@ BEGIN Files.SetSearchPath(OBERON); - (* Fixed type sizes *) - CharSize := 1; BoolSize := 1; SIntSize := 1; RecSize := 1; ByteSize := 1; - RealSize := 4; LRealSize := 8; - (* type sizes with configuration based defaults *) - PointerSize := Configuration.addressSize; - Alignment := Configuration.alignment; - IntSize := Configuration.intsize; + AddressSize := Configuration.addressSize; + Alignment := Configuration.alignment; + ShortintSize := 1; + + IF Configuration.intsize = 2 THEN + IntegerSize := 2; + LongintSize := 4; + SetSize := 4; + ELSE + IntegerSize := 4; + LongintSize := 8; + SetSize := 8; + END; END OPM. diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 7d67c2b5..6793a233 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -154,7 +154,7 @@ VAR undftyp*, bytetyp*, booltyp*, chartyp*, - sinttyp*, inttyp*, linttyp*, + sinttyp*, inttyp*, linttyp*, hinttyp*, adrtyp*, int8typ*, int16typ*, int32typ*, int64typ*, realtyp*, lrltyp*, settyp*, stringtyp*, @@ -762,7 +762,7 @@ BEGIN tag := OPM.SymRInt(); IF tag = Ssys THEN typ^.sysflag := SHORT(OPM.SymRInt()); tag := OPM.SymRInt() END; CASE tag OF - | Sptr: typ^.form := Pointer; typ^.size := OPM.PointerSize; + | Sptr: typ^.form := Pointer; typ^.size := OPM.AddressSize; typ^.n := 0; InStruct(typ^.BaseTyp) | Sarr: typ^.form := Comp; typ^.comp := Array; InStruct(typ^.BaseTyp); typ^.n := OPM.SymRInt(); @@ -796,7 +796,7 @@ BEGIN InsertImport(fld, typ^.link, dummy); impCtxt.nextTag := OPM.SymRInt() END - | Spro: typ^.form := ProcTyp; typ^.size := OPM.ProcSize; + | Spro: typ^.form := ProcTyp; typ^.size := OPM.AddressSize; InSign(mno, typ^.BaseTyp, typ^.link) ELSE OPM.LogWStr("unhandled case at InStruct, tag = "); OPM.LogWNum(tag, 0); OPM.LogWLn; END; @@ -1163,7 +1163,7 @@ END Import; PROCEDURE InitStruct(VAR typ: Struct; form: SHORTINT); BEGIN - typ := NewStr(form, Basic); typ^.ref := form; typ^.size := OPM.ByteSize; typ^.allocated := TRUE; + typ := NewStr(form, Basic); typ^.ref := form; typ^.size := 1; typ^.allocated := TRUE; typ^.strobj := NewObj(); typ^.pbfp := form; typ^.pvfp := form; typ^.fpdone := TRUE; typ^.idfp := form; typ^.idfpdone := TRUE END InitStruct; @@ -1207,36 +1207,37 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; InitStruct(niltyp, NilTyp); (*initialization of module SYSTEM*) - EnterTyp("BYTE", Byte, OPM.ByteSize, bytetyp); - EnterTyp("PTR", Pointer, OPM.PointerSize, sysptrtyp); - EnterTyp("ADDRESS", Int, OPM.PointerSize, adrtyp); - EnterTyp("INT8", Int, 1, int8typ); - EnterTyp("INT16", Int, 2, int16typ); - EnterTyp("INT32", Int, 4, int32typ); - EnterTyp("INT64", Int, 8, int64typ); + EnterTyp("BYTE", Byte, 1, bytetyp); + EnterTyp("PTR", Pointer, -1, sysptrtyp); (* Size set in Vishap.PropagateElementaryTypeSize *) + EnterTyp("ADDRESS", Int, -1, adrtyp); (* Size set in Vishap.PropagateElementaryTypeSize *) + EnterTyp("INT8", Int, 1, int8typ); + EnterTyp("INT16", Int, 2, int16typ); + EnterTyp("INT32", Int, 4, int32typ); + EnterTyp("INT64", Int, 8, int64typ); - EnterProc("ADR", adrfn); - EnterProc("CC", ccfn); - EnterProc("LSH", lshfn); - EnterProc("ROT", rotfn); - EnterProc("GET", getfn); - EnterProc("PUT", putfn); + EnterProc("ADR", adrfn); + EnterProc("CC", ccfn); + EnterProc("LSH", lshfn); + EnterProc("ROT", rotfn); + EnterProc("GET", getfn); + EnterProc("PUT", putfn); EnterProc("GETREG", getrfn); EnterProc("PUTREG", putrfn); - EnterProc("BIT", bitfn); - EnterProc("VAL", valfn); - EnterProc("NEW", sysnewfn); - EnterProc("MOVE", movefn); + EnterProc("BIT", bitfn); + EnterProc("VAL", valfn); + EnterProc("NEW", sysnewfn); + EnterProc("MOVE", movefn); syslink := topScope^.right; universe := topScope; topScope^.right := NIL; - EnterTyp("BOOLEAN", Bool, OPM.BoolSize, booltyp); - EnterTyp("CHAR", Char, OPM.CharSize, chartyp); - EnterTyp("SET", Set, OPM.SetSize, settyp); - EnterTyp("REAL", Real, OPM.RealSize, realtyp); - EnterTyp("LONGREAL", LReal, OPM.LRealSize, lrltyp); + EnterTyp("BOOLEAN", Bool, 1, booltyp); + EnterTyp("CHAR", Char, 1, chartyp); + EnterTyp("SET", Set, -1, settyp); (* Size set in Vishap.PropagateElementaryTypeSize *) + EnterTyp("REAL", Real, 4, realtyp); + EnterTyp("LONGREAL", LReal, 8, lrltyp); + EnterTyp("HUGEINT", Int, 8, hinttyp); EnterTypeAlias("SHORTINT", sintobj); EnterTypeAlias("INTEGER", intobj); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index d8486ca9..7c7e7464 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -62,7 +62,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 ELSIF typ^.size = -1 THEN f := typ^.form; c := typ^.comp; IF c = OPT.Record THEN btyp := typ^.BaseTyp; - IF btyp = NIL THEN offset := 0; base := (*OPM.RecAlign*)OPC.SizeAlignment(OPM.RecSize); + IF btyp = NIL THEN offset := 0; base := 1; ELSE TypSize(btyp); offset := btyp^.size - btyp^.sysflag DIV 100H; base := btyp^.align; END; fld := typ^.link; @@ -86,12 +86,12 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 TypSize(typ^.BaseTyp); typ^.size := typ^.n * typ^.BaseTyp^.size; ELSIF f = OPT.Pointer THEN - typ^.size := OPM.PointerSize; + typ^.size := OPM.AddressSize; IF typ^.BaseTyp = OPT.undftyp THEN OPM.Mark(128, typ^.n) ELSE TypSize(typ^.BaseTyp) END ELSIF f = OPT.ProcTyp THEN - typ^.size := OPM.ProcSize; + typ^.size := OPM.AddressSize; ELSIF c = OPT.DynArr THEN btyp := typ^.BaseTyp; TypSize(btyp); IF btyp^.comp = OPT.DynArr THEN typ^.size := btyp^.size + 4 (* describes dim not size *) @@ -187,21 +187,17 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 topScope^.leaf := TRUE; Traverse(topScope^.right, topScope, TRUE); (* first pass only on exported types and procedures *) Traverse(topScope^.right, topScope, FALSE); (* second pass *) + (* mark basic types as predefined, OPC.Ident can avoid qualification*) OPT.chartyp^.strobj^.linkadr := PredefinedType; OPT.settyp^.strobj^.linkadr := PredefinedType; OPT.realtyp^.strobj^.linkadr := PredefinedType; - - (* SHORTINT, INTEGER and LONGINT are alternate names for INT8, INT16, INT32 and INT64 and have not been set up yet. - OPT.sinttyp^.strobj^.linkadr := PredefinedType; - OPT.inttyp^.strobj^.linkadr := PredefinedType; - OPT.linttyp^.strobj^.linkadr := PredefinedType; - *) OPT.adrtyp^.strobj^.linkadr := PredefinedType; OPT.int8typ^.strobj^.linkadr := PredefinedType; OPT.int16typ^.strobj^.linkadr := PredefinedType; OPT.int32typ^.strobj^.linkadr := PredefinedType; OPT.int64typ^.strobj^.linkadr := PredefinedType; + OPT.hinttyp.strobj.linkadr := PredefinedType; OPT.lrltyp^.strobj^.linkadr := PredefinedType; OPT.booltyp^.strobj^.linkadr := PredefinedType; OPT.bytetyp^.strobj^.linkadr := PredefinedType; @@ -482,7 +478,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteString(", "); TypeOf(n) ELSIF comp = OPT.DynArr THEN IF n^.class = OPT.Nconst THEN (* ap is string constant *) - OPM.WriteString(Comma); ParIntLiteral(n.conval.intval2, OPM.PointerSize) + OPM.WriteString(Comma); ParIntLiteral(n.conval.intval2, OPM.AddressSize) ELSE aptyp := n^.typ; dim := 0; WHILE (typ^.comp = OPT.DynArr) & (typ^.BaseTyp^.form # OPT.Byte) DO @@ -495,7 +491,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 Len(n, dim); OPM.WriteString(" * "); INC(dim); aptyp := aptyp^.BaseTyp END ; (*OPM.WriteString("((LONGINT)("); OPM.WriteInt(aptyp^.size); OPM.WriteString("))");*) - ParIntLiteral(aptyp.size, OPM.PointerSize) + ParIntLiteral(aptyp.size, OPM.AddressSize) END END END ; @@ -791,12 +787,12 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteString(", "); IF typ^.comp = OPT.DynArr THEN IF x^.class = OPT.Nconst THEN - OPC.IntLiteral(x.conval.intval, OPM.PointerSize) + OPC.IntLiteral(x.conval.intval, OPM.AddressSize) ELSE OPM.WriteString("((address)("); expr(x, 10); OPM.WriteString("))") END ; x := x^.link ELSE - OPC.IntLiteral(typ.n, OPM.PointerSize) + OPC.IntLiteral(typ.n, OPM.AddressSize) END ; typ := typ^.BaseTyp END ; diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index 33481260..c4b06e9c 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -51,23 +51,14 @@ MODULE Vishap; (* J. Templ 3.2.95 *) PROCEDURE PropagateElementaryTypeSizes; BEGIN - OPT.bytetyp.size := OPM.ByteSize; - OPT.sysptrtyp.size := OPM.PointerSize; - OPT.chartyp.size := OPM.CharSize; + OPT.sysptrtyp.size := OPM.AddressSize; + OPT.adrtyp.size := OPM.AddressSize; OPT.settyp.size := OPM.SetSize; - OPT.realtyp.size := OPM.RealSize; - OPT.adrtyp.size := OPM.PointerSize; - OPT.lrltyp.size := OPM.LRealSize; - OPT.booltyp.size := OPM.BoolSize; - OPT.sinttyp := OPT.int8typ; - IF OPM.IntSize = 2 THEN - OPT.inttyp := OPT.int16typ; - OPT.linttyp := OPT.int32typ - ELSE - OPT.inttyp := OPT.int32typ; - OPT.linttyp := OPT.int64typ - END; + OPT.sinttyp := OPT.IntType(OPM.ShortintSize); + OPT.inttyp := OPT.IntType(OPM.IntegerSize); + OPT.linttyp := OPT.IntType(OPM.LongintSize); + OPT.sintobj.typ := OPT.sinttyp; OPT.intobj.typ := OPT.inttyp; OPT.lintobj.typ := OPT.linttyp