Update bootstrap sources.

This commit is contained in:
David Brown 2016-08-12 12:19:02 +01:00
parent f5ae1af37d
commit 0049d88a0f
203 changed files with 621 additions and 1873 deletions

2
.gitignore vendored
View file

@ -16,6 +16,8 @@
/src/test/**/*.sym /src/test/**/*.sym
/src/test/**/*.stackdump /src/test/**/*.stackdump
/src/test/confidence/**/result /src/test/confidence/**/result
/src/test/confidence/**/*.asm
/src/test/confidence/**/*.s
/.DS_store /.DS_store
**/.DS_store **/.DS_store
**/*.dSYM **/*.dSYM

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
@ -13,6 +13,6 @@ export void *Configuration__init(void)
__DEFMOD; __DEFMOD;
__REGMOD("Configuration", 0); __REGMOD("Configuration", 0);
/* BEGIN */ /* BEGIN */
__MOVE("1.95 [2016/07/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); __MOVE("1.95 [2016/08/12] for gcc LP64 on cygwin", Configuration_versionLong, 41);
__ENDMOD; __ENDMOD;
} }

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Configuration__h #ifndef Configuration__h
#define Configuration__h #define Configuration__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "Platform.h" #include "Platform.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Console__h #ifndef Console__h
#define Console__h #define Console__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin tspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "Configuration.h" #include "Configuration.h"
#include "Console.h" #include "Console.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin tspkaSfF */
#ifndef Files__h #ifndef Files__h
#define Files__h #define Files__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin tskSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
struct Heap__1 { struct Heap__1 {

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin tskSfF */
#ifndef Heap__h #ifndef Heap__h
#define Heap__h #define Heap__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "Console.h" #include "Console.h"
#include "Heap.h" #include "Heap.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Modules__h #ifndef Modules__h
#define Modules__h #define Modules__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "OPM.h" #include "OPM.h"
#include "OPS.h" #include "OPS.h"
@ -90,8 +90,8 @@ OPT_Node OPB_NewLeaf (OPT_Object obj)
node = OPT_NewNode(9); node = OPT_NewNode(9);
break; break;
default: default:
OPB_err(127);
node = OPT_NewNode(0); node = OPT_NewNode(0);
OPB_err(127);
break; break;
} }
node->obj = obj; node->obj = obj;
@ -1596,8 +1596,9 @@ void OPB_SetElem (OPT_Node *x)
static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
{ {
OPT_Struct y = NIL;
INTEGER f, g; INTEGER f, g;
OPT_Struct y = NIL, p = NIL, q = NIL; OPT_Struct p = NIL, q = NIL;
if (OPM_Verbose) { if (OPM_Verbose) {
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22);
@ -1642,15 +1643,9 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
} }
break; break;
case 6: case 6:
if (OPM_LIntSize == 4) {
if (!__IN(g, 0x70)) { if (!__IN(g, 0x70)) {
OPB_err(113); OPB_err(113);
} }
} else {
if (!__IN(g, 0x70)) {
OPB_err(113);
}
}
break; break;
case 7: case 7:
if (!__IN(g, 0xf0)) { if (!__IN(g, 0xf0)) {

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPB__h #ifndef OPB__h
#define OPB__h #define OPB__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "Configuration.h" #include "Configuration.h"
#include "OPM.h" #include "OPM.h"
@ -315,7 +315,7 @@ void OPC_Andent (OPT_Struct typ)
static BOOLEAN OPC_Undefined (OPT_Object obj) static BOOLEAN OPC_Undefined (OPT_Object obj)
{ {
BOOLEAN _o_result; BOOLEAN _o_result;
_o_result = (((obj->mnolev >= 0 && obj->linkadr != (LONGINT)(3 + OPM_currFile))) && obj->linkadr != 2) || obj->name[0] == 0x00; _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (LONGINT)(3 + OPM_currFile))) && obj->linkadr != 2);
return _o_result; return _o_result;
} }
@ -1238,8 +1238,8 @@ void OPC_GenHdr (OPT_Node n)
static void OPC_GenHeaderMsg (void) static void OPC_GenHeaderMsg (void)
{ {
INTEGER i; INTEGER i;
OPM_WriteString((CHAR*)"/*", (LONGINT)3); OPM_WriteString((CHAR*)"/* ", (LONGINT)4);
OPM_WriteString((CHAR*)" voc ", (LONGINT)6); OPM_WriteString((CHAR*)"voc", (LONGINT)4);
OPM_Write(' '); OPM_Write(' ');
OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); OPM_WriteString(Configuration_versionLong, ((LONGINT)(41)));
OPM_Write(' '); OPM_Write(' ');

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPC__h #ifndef OPC__h
#define OPC__h #define OPC__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "Configuration.h" #include "Configuration.h"
#include "Console.h" #include "Console.h"
@ -36,6 +36,7 @@ static CHAR OPM_OBERON[1024];
static CHAR OPM_MODULES[1024]; static CHAR OPM_MODULES[1024];
export INTEGER OPM_AlignSize (LONGINT size);
static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F);
export void OPM_CloseFiles (void); export void OPM_CloseFiles (void);
export void OPM_CloseOldSym (void); export void OPM_CloseOldSym (void);
@ -57,7 +58,6 @@ export void OPM_LogWNum (LONGINT i, LONGINT len);
export void OPM_LogWStr (CHAR *s, LONGINT s__len); export void OPM_LogWStr (CHAR *s, LONGINT s__len);
static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len);
export void OPM_Mark (INTEGER n, LONGINT pos); export void OPM_Mark (INTEGER n, LONGINT pos);
static INTEGER OPM_Min (INTEGER a, INTEGER b);
export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_NewSym (CHAR *modName, LONGINT modName__len);
export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done);
export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len);
@ -85,7 +85,7 @@ export void OPM_WriteString (CHAR *s, LONGINT s__len);
export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len);
export BOOLEAN OPM_eofSF (void); export BOOLEAN OPM_eofSF (void);
export void OPM_err (INTEGER n); export void OPM_err (INTEGER n);
static LONGINT OPM_minus (LONGINT i); static LONGINT OPM_minusop (LONGINT i);
static LONGINT OPM_power0 (LONGINT i, LONGINT j); static LONGINT OPM_power0 (LONGINT i, LONGINT j);
@ -117,50 +117,38 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
i = 1; i = 1;
while (s[__X(i, s__len)] != 0x00) { while (s[__X(i, s__len)] != 0x00) {
switch (s[__X(i, s__len)]) { switch (s[__X(i, s__len)]) {
case 'e':
*opt = *opt ^ 0x0200;
break;
case 's':
*opt = *opt ^ 0x10;
break;
case 'm':
*opt = *opt ^ 0x0400;
break;
case 'x':
*opt = *opt ^ 0x01;
break;
case 'r':
*opt = *opt ^ 0x04;
break;
case 't':
*opt = *opt ^ 0x08;
break;
case 'a': case 'a':
*opt = *opt ^ 0x80; *opt = *opt ^ 0x80;
break; break;
case 'k':
*opt = *opt ^ 0x40;
break;
case 'p':
*opt = *opt ^ 0x20;
break;
case 'S':
*opt = *opt ^ 0x2000;
break;
case 'c': case 'c':
*opt = *opt ^ 0x4000; *opt = *opt ^ 0x4000;
break; break;
case 'M': case 'e':
*opt = *opt ^ 0x8000; *opt = *opt ^ 0x0200;
break; break;
case 'f': case 'f':
*opt = *opt ^ 0x010000; *opt = *opt ^ 0x010000;
break; break;
case 'F': case 'k':
*opt = *opt ^ 0x020000; *opt = *opt ^ 0x40;
break; break;
case 'V': case 'm':
*opt = *opt ^ 0x040000; *opt = *opt ^ 0x0400;
break;
case 'p':
*opt = *opt ^ 0x20;
break;
case 'r':
*opt = *opt ^ 0x04;
break;
case 's':
*opt = *opt ^ 0x10;
break;
case 't':
*opt = *opt ^ 0x08;
break;
case 'x':
*opt = *opt ^ 0x01;
break; break;
case 'B': case 'B':
if (s[__X(i + 1, s__len)] != 0x00) { if (s[__X(i + 1, s__len)] != 0x00) {
@ -178,6 +166,19 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
__ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0);
__ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0);
__ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0);
Files_SetSearchPath((CHAR*)"", (LONGINT)1);
break;
case 'F':
*opt = *opt ^ 0x020000;
break;
case 'M':
*opt = *opt ^ 0x8000;
break;
case 'S':
*opt = *opt ^ 0x2000;
break;
case 'V':
*opt = *opt ^ 0x040000;
break; break;
default: default:
OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19);
@ -575,7 +576,7 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG
__DEL(name); __DEL(name);
} }
static LONGINT OPM_minus (LONGINT i) static LONGINT OPM_minusop (LONGINT i)
{ {
LONGINT _o_result; LONGINT _o_result;
_o_result = -i; _o_result = -i;
@ -663,17 +664,25 @@ static void OPM_VerboseListSizes (void)
OPM_LogWLn(); OPM_LogWLn();
} }
static INTEGER OPM_Min (INTEGER a, INTEGER b) INTEGER OPM_AlignSize (LONGINT size)
{ {
INTEGER _o_result; INTEGER _o_result;
if (a < b) { INTEGER align;
_o_result = a; if (size < (LONGINT)OPM_Alignment) {
return _o_result; if (size > 8) {
align = 16;
} else if (size > 4) {
align = 8;
} else if (size > 2) {
align = 4;
} else { } else {
_o_result = b; align = (int)size;
return _o_result;
} }
__RETCHK; } else {
align = OPM_Alignment;
}
_o_result = align;
return _o_result;
} }
static void OPM_GetProperties (void) static void OPM_GetProperties (void)
@ -682,24 +691,24 @@ static void OPM_GetProperties (void)
OPM_ProcSize = OPM_PointerSize; OPM_ProcSize = OPM_PointerSize;
OPM_LIntSize = __ASHL(OPM_IntSize, 1); OPM_LIntSize = __ASHL(OPM_IntSize, 1);
OPM_SetSize = OPM_LIntSize; OPM_SetSize = OPM_LIntSize;
OPM_CharAlign = OPM_Min(OPM_Alignment, OPM_CharSize); OPM_CharAlign = OPM_AlignSize(OPM_CharSize);
OPM_BoolAlign = OPM_Min(OPM_Alignment, OPM_BoolSize); OPM_BoolAlign = OPM_AlignSize(OPM_BoolSize);
OPM_SIntAlign = OPM_Min(OPM_Alignment, OPM_SIntSize); OPM_SIntAlign = OPM_AlignSize(OPM_SIntSize);
OPM_RecAlign = OPM_Min(OPM_Alignment, OPM_RecSize); OPM_RecAlign = OPM_AlignSize(OPM_RecSize);
OPM_RealAlign = OPM_Min(OPM_Alignment, OPM_RealSize); OPM_RealAlign = OPM_AlignSize(OPM_RealSize);
OPM_LRealAlign = OPM_Min(OPM_Alignment, OPM_LRealSize); OPM_LRealAlign = OPM_AlignSize(OPM_LRealSize);
OPM_PointerAlign = OPM_Min(OPM_Alignment, OPM_PointerSize); OPM_PointerAlign = OPM_AlignSize(OPM_PointerSize);
OPM_ProcAlign = OPM_Min(OPM_Alignment, OPM_ProcSize); OPM_ProcAlign = OPM_AlignSize(OPM_ProcSize);
OPM_IntAlign = OPM_Min(OPM_Alignment, OPM_IntSize); OPM_IntAlign = OPM_AlignSize(OPM_IntSize);
OPM_LIntAlign = OPM_Min(OPM_Alignment, OPM_LIntSize); OPM_LIntAlign = OPM_AlignSize(OPM_LIntSize);
OPM_SetAlign = OPM_Min(OPM_Alignment, OPM_SetSize); OPM_SetAlign = OPM_AlignSize(OPM_SetSize);
base = -2; base = -2;
OPM_MinSInt = __ASH(base, __ASHL(OPM_SIntSize, 3) - 2); OPM_MinSInt = __ASH(base, __ASHL(OPM_SIntSize, 3) - 2);
OPM_MaxSInt = OPM_minus(OPM_MinSInt + 1); OPM_MaxSInt = OPM_minusop(OPM_MinSInt + 1);
OPM_MinInt = __ASH(base, __ASHL(OPM_IntSize, 3) - 2); OPM_MinInt = __ASH(base, __ASHL(OPM_IntSize, 3) - 2);
OPM_MaxInt = OPM_minus(OPM_MinInt + 1); OPM_MaxInt = OPM_minusop(OPM_MinInt + 1);
OPM_MinLInt = __ASH(base, __ASHL(OPM_LIntSize, 3) - 2); OPM_MinLInt = __ASH(base, __ASHL(OPM_LIntSize, 3) - 2);
OPM_MaxLInt = OPM_minus(OPM_MinLInt + 1); OPM_MaxLInt = OPM_minusop(OPM_MinLInt + 1);
if (OPM_RealSize == 4) { if (OPM_RealSize == 4) {
OPM_MaxReal = 3.40282346000000e+038; OPM_MaxReal = 3.40282346000000e+038;
} else if (OPM_RealSize == 8) { } else if (OPM_RealSize == 8) {

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPM__h #ifndef OPM__h
#define OPM__h #define OPM__h
@ -18,6 +18,7 @@ import SET OPM_opt, OPM_glbopt;
import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose;
import INTEGER OPM_AlignSize (LONGINT size);
import void OPM_CloseFiles (void); import void OPM_CloseFiles (void);
import void OPM_CloseOldSym (void); import void OPM_CloseOldSym (void);
import void OPM_DeleteNewSym (void); import void OPM_DeleteNewSym (void);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "OPB.h" #include "OPB.h"
#include "OPM.h" #include "OPM.h"
@ -438,10 +438,10 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned)
if (OPP_sym == 38) { if (OPP_sym == 38) {
OPP_qualident(&id); OPP_qualident(&id);
if (id->mode == 5) { if (id->mode == 5) {
if (id->typ != *banned) { if (id->typ == *banned) {
*typ = id->typ;
} else {
OPP_err(58); OPP_err(58);
} else {
*typ = id->typ;
} }
} else { } else {
OPP_err(52); OPP_err(52);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPP__h #ifndef OPP__h
#define OPP__h #define OPP__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin tspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "OPM.h" #include "OPM.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin tspkaSfF */
#ifndef OPS__h #ifndef OPS__h
#define OPS__h #define OPS__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "OPM.h" #include "OPM.h"
#include "OPS.h" #include "OPS.h"
@ -1809,6 +1809,7 @@ export void *OPT__init(void)
OPT_syslink = OPT_topScope->right; OPT_syslink = OPT_topScope->right;
OPT_universe = OPT_topScope; OPT_universe = OPT_topScope;
OPT_topScope->right = NIL; 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*)"CHAR", 3, OPM_CharSize, &OPT_chartyp);
OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp);
OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp);
@ -1816,7 +1817,6 @@ export void *OPT__init(void)
OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp);
OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp);
OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp);
OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp);
OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0)));
OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1)));
OPT_EnterProc((CHAR*)"HALT", 0); OPT_EnterProc((CHAR*)"HALT", 0);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPT__h #ifndef OPT__h
#define OPT__h #define OPT__h
@ -59,8 +59,7 @@ typedef
INTEGER ref, sysflag; INTEGER ref, sysflag;
LONGINT n, size, align, txtpos; LONGINT n, size, align, txtpos;
BOOLEAN allocated, pbused, pvused; BOOLEAN allocated, pbused, pvused;
char _prvt0[8]; char _prvt0[16];
LONGINT pbfp, pvfp;
OPT_Struct BaseTyp; OPT_Struct BaseTyp;
OPT_Object link, strobj; OPT_Object link, strobj;
} OPT_StrDesc; } OPT_StrDesc;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "OPC.h" #include "OPC.h"
#include "OPM.h" #include "OPM.h"
@ -332,7 +332,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN
return _o_result; return _o_result;
break; break;
default: default:
OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence Nmop, subclass = ", (LONGINT)51); OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPM.Nmop, subclass = ", (LONGINT)55);
OPM_LogWNum(subclass, ((LONGINT)(0))); OPM_LogWNum(subclass, ((LONGINT)(0)));
OPM_LogWLn(); OPM_LogWLn();
break; break;
@ -402,7 +402,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN
return _o_result; return _o_result;
break; break;
default: default:
OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence Ndop, subclass = ", (LONGINT)51); OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPM.Ndop, subclass = ", (LONGINT)55);
OPM_LogWNum(subclass, ((LONGINT)(0))); OPM_LogWNum(subclass, ((LONGINT)(0)));
OPM_LogWLn(); OPM_LogWLn();
break; break;
@ -954,7 +954,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec)
} }
break; break;
case 29: case 29:
if ((((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size) || !__IN(l->class, 0x17)) { if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size)) {
OPM_Write('('); OPM_Write('(');
OPC_Ident(n->typ->strobj); OPC_Ident(n->typ->strobj);
OPM_Write(')'); OPM_Write(')');

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPV__h #ifndef OPV__h
#define OPV__h #define OPV__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
typedef typedef

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Platform__h #ifndef Platform__h
#define Platform__h #define Platform__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Reals__h #ifndef Reals__h
#define Reals__h #define Reals__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Strings__h #ifndef Strings__h
#define Strings__h #define Strings__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "Files.h" #include "Files.h"
#include "Modules.h" #include "Modules.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Texts__h #ifndef Texts__h
#define Texts__h #define Texts__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkamSf */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkamSf */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "Configuration.h" #include "Configuration.h"
#include "Heap.h" #include "Heap.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
typedef typedef

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef errors__h #ifndef errors__h
#define errors__h #define errors__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "Configuration.h" #include "Configuration.h"
#include "Console.h" #include "Console.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef extTools__h #ifndef extTools__h
#define extTools__h #define extTools__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "Console.h" #include "Console.h"
#include "Strings.h" #include "Strings.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef vt100__h #ifndef vt100__h
#define vt100__h #define vt100__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
@ -13,6 +13,6 @@ export void *Configuration__init(void)
__DEFMOD; __DEFMOD;
__REGMOD("Configuration", 0); __REGMOD("Configuration", 0);
/* BEGIN */ /* BEGIN */
__MOVE("1.95 [2016/07/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); __MOVE("1.95 [2016/08/12] for gcc LP64 on cygwin", Configuration_versionLong, 41);
__ENDMOD; __ENDMOD;
} }

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Configuration__h #ifndef Configuration__h
#define Configuration__h #define Configuration__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "Platform.h" #include "Platform.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Console__h #ifndef Console__h
#define Console__h #define Console__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin tspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "Configuration.h" #include "Configuration.h"
#include "Console.h" #include "Console.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin tspkaSfF */
#ifndef Files__h #ifndef Files__h
#define Files__h #define Files__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin tskSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
struct Heap__1 { struct Heap__1 {

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin tskSfF */
#ifndef Heap__h #ifndef Heap__h
#define Heap__h #define Heap__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "Console.h" #include "Console.h"
#include "Heap.h" #include "Heap.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Modules__h #ifndef Modules__h
#define Modules__h #define Modules__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "OPM.h" #include "OPM.h"
#include "OPS.h" #include "OPS.h"
@ -90,8 +90,8 @@ OPT_Node OPB_NewLeaf (OPT_Object obj)
node = OPT_NewNode(9); node = OPT_NewNode(9);
break; break;
default: default:
OPB_err(127);
node = OPT_NewNode(0); node = OPT_NewNode(0);
OPB_err(127);
break; break;
} }
node->obj = obj; node->obj = obj;
@ -1596,8 +1596,9 @@ void OPB_SetElem (OPT_Node *x)
static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
{ {
OPT_Struct y = NIL;
INTEGER f, g; INTEGER f, g;
OPT_Struct y = NIL, p = NIL, q = NIL; OPT_Struct p = NIL, q = NIL;
if (OPM_Verbose) { if (OPM_Verbose) {
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22);
@ -1642,15 +1643,9 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
} }
break; break;
case 6: case 6:
if (OPM_LIntSize == 4) {
if (!__IN(g, 0x70)) { if (!__IN(g, 0x70)) {
OPB_err(113); OPB_err(113);
} }
} else {
if (!__IN(g, 0x70)) {
OPB_err(113);
}
}
break; break;
case 7: case 7:
if (!__IN(g, 0xf0)) { if (!__IN(g, 0xf0)) {

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPB__h #ifndef OPB__h
#define OPB__h #define OPB__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "Configuration.h" #include "Configuration.h"
#include "OPM.h" #include "OPM.h"
@ -315,7 +315,7 @@ void OPC_Andent (OPT_Struct typ)
static BOOLEAN OPC_Undefined (OPT_Object obj) static BOOLEAN OPC_Undefined (OPT_Object obj)
{ {
BOOLEAN _o_result; BOOLEAN _o_result;
_o_result = (((obj->mnolev >= 0 && obj->linkadr != (LONGINT)(3 + OPM_currFile))) && obj->linkadr != 2) || obj->name[0] == 0x00; _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (LONGINT)(3 + OPM_currFile))) && obj->linkadr != 2);
return _o_result; return _o_result;
} }
@ -1238,8 +1238,8 @@ void OPC_GenHdr (OPT_Node n)
static void OPC_GenHeaderMsg (void) static void OPC_GenHeaderMsg (void)
{ {
INTEGER i; INTEGER i;
OPM_WriteString((CHAR*)"/*", (LONGINT)3); OPM_WriteString((CHAR*)"/* ", (LONGINT)4);
OPM_WriteString((CHAR*)" voc ", (LONGINT)6); OPM_WriteString((CHAR*)"voc", (LONGINT)4);
OPM_Write(' '); OPM_Write(' ');
OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); OPM_WriteString(Configuration_versionLong, ((LONGINT)(41)));
OPM_Write(' '); OPM_Write(' ');

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPC__h #ifndef OPC__h
#define OPC__h #define OPC__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "Configuration.h" #include "Configuration.h"
#include "Console.h" #include "Console.h"
@ -36,6 +36,7 @@ static CHAR OPM_OBERON[1024];
static CHAR OPM_MODULES[1024]; static CHAR OPM_MODULES[1024];
export INTEGER OPM_AlignSize (LONGINT size);
static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F);
export void OPM_CloseFiles (void); export void OPM_CloseFiles (void);
export void OPM_CloseOldSym (void); export void OPM_CloseOldSym (void);
@ -57,7 +58,6 @@ export void OPM_LogWNum (LONGINT i, LONGINT len);
export void OPM_LogWStr (CHAR *s, LONGINT s__len); export void OPM_LogWStr (CHAR *s, LONGINT s__len);
static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len);
export void OPM_Mark (INTEGER n, LONGINT pos); export void OPM_Mark (INTEGER n, LONGINT pos);
static INTEGER OPM_Min (INTEGER a, INTEGER b);
export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_NewSym (CHAR *modName, LONGINT modName__len);
export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done);
export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len);
@ -85,7 +85,7 @@ export void OPM_WriteString (CHAR *s, LONGINT s__len);
export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len);
export BOOLEAN OPM_eofSF (void); export BOOLEAN OPM_eofSF (void);
export void OPM_err (INTEGER n); export void OPM_err (INTEGER n);
static LONGINT OPM_minus (LONGINT i); static LONGINT OPM_minusop (LONGINT i);
static LONGINT OPM_power0 (LONGINT i, LONGINT j); static LONGINT OPM_power0 (LONGINT i, LONGINT j);
@ -117,50 +117,38 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
i = 1; i = 1;
while (s[__X(i, s__len)] != 0x00) { while (s[__X(i, s__len)] != 0x00) {
switch (s[__X(i, s__len)]) { switch (s[__X(i, s__len)]) {
case 'e':
*opt = *opt ^ 0x0200;
break;
case 's':
*opt = *opt ^ 0x10;
break;
case 'm':
*opt = *opt ^ 0x0400;
break;
case 'x':
*opt = *opt ^ 0x01;
break;
case 'r':
*opt = *opt ^ 0x04;
break;
case 't':
*opt = *opt ^ 0x08;
break;
case 'a': case 'a':
*opt = *opt ^ 0x80; *opt = *opt ^ 0x80;
break; break;
case 'k':
*opt = *opt ^ 0x40;
break;
case 'p':
*opt = *opt ^ 0x20;
break;
case 'S':
*opt = *opt ^ 0x2000;
break;
case 'c': case 'c':
*opt = *opt ^ 0x4000; *opt = *opt ^ 0x4000;
break; break;
case 'M': case 'e':
*opt = *opt ^ 0x8000; *opt = *opt ^ 0x0200;
break; break;
case 'f': case 'f':
*opt = *opt ^ 0x010000; *opt = *opt ^ 0x010000;
break; break;
case 'F': case 'k':
*opt = *opt ^ 0x020000; *opt = *opt ^ 0x40;
break; break;
case 'V': case 'm':
*opt = *opt ^ 0x040000; *opt = *opt ^ 0x0400;
break;
case 'p':
*opt = *opt ^ 0x20;
break;
case 'r':
*opt = *opt ^ 0x04;
break;
case 's':
*opt = *opt ^ 0x10;
break;
case 't':
*opt = *opt ^ 0x08;
break;
case 'x':
*opt = *opt ^ 0x01;
break; break;
case 'B': case 'B':
if (s[__X(i + 1, s__len)] != 0x00) { if (s[__X(i + 1, s__len)] != 0x00) {
@ -178,6 +166,19 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
__ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0);
__ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0);
__ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0);
Files_SetSearchPath((CHAR*)"", (LONGINT)1);
break;
case 'F':
*opt = *opt ^ 0x020000;
break;
case 'M':
*opt = *opt ^ 0x8000;
break;
case 'S':
*opt = *opt ^ 0x2000;
break;
case 'V':
*opt = *opt ^ 0x040000;
break; break;
default: default:
OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19);
@ -575,7 +576,7 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG
__DEL(name); __DEL(name);
} }
static LONGINT OPM_minus (LONGINT i) static LONGINT OPM_minusop (LONGINT i)
{ {
LONGINT _o_result; LONGINT _o_result;
_o_result = -i; _o_result = -i;
@ -663,17 +664,25 @@ static void OPM_VerboseListSizes (void)
OPM_LogWLn(); OPM_LogWLn();
} }
static INTEGER OPM_Min (INTEGER a, INTEGER b) INTEGER OPM_AlignSize (LONGINT size)
{ {
INTEGER _o_result; INTEGER _o_result;
if (a < b) { INTEGER align;
_o_result = a; if (size < (LONGINT)OPM_Alignment) {
return _o_result; if (size > 8) {
align = 16;
} else if (size > 4) {
align = 8;
} else if (size > 2) {
align = 4;
} else { } else {
_o_result = b; align = (int)size;
return _o_result;
} }
__RETCHK; } else {
align = OPM_Alignment;
}
_o_result = align;
return _o_result;
} }
static void OPM_GetProperties (void) static void OPM_GetProperties (void)
@ -682,24 +691,24 @@ static void OPM_GetProperties (void)
OPM_ProcSize = OPM_PointerSize; OPM_ProcSize = OPM_PointerSize;
OPM_LIntSize = __ASHL(OPM_IntSize, 1); OPM_LIntSize = __ASHL(OPM_IntSize, 1);
OPM_SetSize = OPM_LIntSize; OPM_SetSize = OPM_LIntSize;
OPM_CharAlign = OPM_Min(OPM_Alignment, OPM_CharSize); OPM_CharAlign = OPM_AlignSize(OPM_CharSize);
OPM_BoolAlign = OPM_Min(OPM_Alignment, OPM_BoolSize); OPM_BoolAlign = OPM_AlignSize(OPM_BoolSize);
OPM_SIntAlign = OPM_Min(OPM_Alignment, OPM_SIntSize); OPM_SIntAlign = OPM_AlignSize(OPM_SIntSize);
OPM_RecAlign = OPM_Min(OPM_Alignment, OPM_RecSize); OPM_RecAlign = OPM_AlignSize(OPM_RecSize);
OPM_RealAlign = OPM_Min(OPM_Alignment, OPM_RealSize); OPM_RealAlign = OPM_AlignSize(OPM_RealSize);
OPM_LRealAlign = OPM_Min(OPM_Alignment, OPM_LRealSize); OPM_LRealAlign = OPM_AlignSize(OPM_LRealSize);
OPM_PointerAlign = OPM_Min(OPM_Alignment, OPM_PointerSize); OPM_PointerAlign = OPM_AlignSize(OPM_PointerSize);
OPM_ProcAlign = OPM_Min(OPM_Alignment, OPM_ProcSize); OPM_ProcAlign = OPM_AlignSize(OPM_ProcSize);
OPM_IntAlign = OPM_Min(OPM_Alignment, OPM_IntSize); OPM_IntAlign = OPM_AlignSize(OPM_IntSize);
OPM_LIntAlign = OPM_Min(OPM_Alignment, OPM_LIntSize); OPM_LIntAlign = OPM_AlignSize(OPM_LIntSize);
OPM_SetAlign = OPM_Min(OPM_Alignment, OPM_SetSize); OPM_SetAlign = OPM_AlignSize(OPM_SetSize);
base = -2; base = -2;
OPM_MinSInt = __ASH(base, __ASHL(OPM_SIntSize, 3) - 2); OPM_MinSInt = __ASH(base, __ASHL(OPM_SIntSize, 3) - 2);
OPM_MaxSInt = OPM_minus(OPM_MinSInt + 1); OPM_MaxSInt = OPM_minusop(OPM_MinSInt + 1);
OPM_MinInt = __ASH(base, __ASHL(OPM_IntSize, 3) - 2); OPM_MinInt = __ASH(base, __ASHL(OPM_IntSize, 3) - 2);
OPM_MaxInt = OPM_minus(OPM_MinInt + 1); OPM_MaxInt = OPM_minusop(OPM_MinInt + 1);
OPM_MinLInt = __ASH(base, __ASHL(OPM_LIntSize, 3) - 2); OPM_MinLInt = __ASH(base, __ASHL(OPM_LIntSize, 3) - 2);
OPM_MaxLInt = OPM_minus(OPM_MinLInt + 1); OPM_MaxLInt = OPM_minusop(OPM_MinLInt + 1);
if (OPM_RealSize == 4) { if (OPM_RealSize == 4) {
OPM_MaxReal = 3.40282346000000e+038; OPM_MaxReal = 3.40282346000000e+038;
} else if (OPM_RealSize == 8) { } else if (OPM_RealSize == 8) {

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPM__h #ifndef OPM__h
#define OPM__h #define OPM__h
@ -18,6 +18,7 @@ import SET OPM_opt, OPM_glbopt;
import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose;
import INTEGER OPM_AlignSize (LONGINT size);
import void OPM_CloseFiles (void); import void OPM_CloseFiles (void);
import void OPM_CloseOldSym (void); import void OPM_CloseOldSym (void);
import void OPM_DeleteNewSym (void); import void OPM_DeleteNewSym (void);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "OPB.h" #include "OPB.h"
#include "OPM.h" #include "OPM.h"
@ -438,10 +438,10 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned)
if (OPP_sym == 38) { if (OPP_sym == 38) {
OPP_qualident(&id); OPP_qualident(&id);
if (id->mode == 5) { if (id->mode == 5) {
if (id->typ != *banned) { if (id->typ == *banned) {
*typ = id->typ;
} else {
OPP_err(58); OPP_err(58);
} else {
*typ = id->typ;
} }
} else { } else {
OPP_err(52); OPP_err(52);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPP__h #ifndef OPP__h
#define OPP__h #define OPP__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin tspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "OPM.h" #include "OPM.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin tspkaSfF */
#ifndef OPS__h #ifndef OPS__h
#define OPS__h #define OPS__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "OPM.h" #include "OPM.h"
#include "OPS.h" #include "OPS.h"
@ -1809,6 +1809,7 @@ export void *OPT__init(void)
OPT_syslink = OPT_topScope->right; OPT_syslink = OPT_topScope->right;
OPT_universe = OPT_topScope; OPT_universe = OPT_topScope;
OPT_topScope->right = NIL; 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*)"CHAR", 3, OPM_CharSize, &OPT_chartyp);
OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp);
OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp);
@ -1816,7 +1817,6 @@ export void *OPT__init(void)
OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp);
OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp);
OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp);
OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp);
OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0)));
OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1)));
OPT_EnterProc((CHAR*)"HALT", 0); OPT_EnterProc((CHAR*)"HALT", 0);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPT__h #ifndef OPT__h
#define OPT__h #define OPT__h
@ -59,8 +59,7 @@ typedef
INTEGER ref, sysflag; INTEGER ref, sysflag;
LONGINT n, size, align, txtpos; LONGINT n, size, align, txtpos;
BOOLEAN allocated, pbused, pvused; BOOLEAN allocated, pbused, pvused;
char _prvt0[8]; char _prvt0[16];
LONGINT pbfp, pvfp;
OPT_Struct BaseTyp; OPT_Struct BaseTyp;
OPT_Object link, strobj; OPT_Object link, strobj;
} OPT_StrDesc; } OPT_StrDesc;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "OPC.h" #include "OPC.h"
#include "OPM.h" #include "OPM.h"
@ -332,7 +332,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN
return _o_result; return _o_result;
break; break;
default: default:
OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence Nmop, subclass = ", (LONGINT)51); OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPM.Nmop, subclass = ", (LONGINT)55);
OPM_LogWNum(subclass, ((LONGINT)(0))); OPM_LogWNum(subclass, ((LONGINT)(0)));
OPM_LogWLn(); OPM_LogWLn();
break; break;
@ -402,7 +402,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN
return _o_result; return _o_result;
break; break;
default: default:
OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence Ndop, subclass = ", (LONGINT)51); OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPM.Ndop, subclass = ", (LONGINT)55);
OPM_LogWNum(subclass, ((LONGINT)(0))); OPM_LogWNum(subclass, ((LONGINT)(0)));
OPM_LogWLn(); OPM_LogWLn();
break; break;
@ -954,7 +954,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec)
} }
break; break;
case 29: case 29:
if ((((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size) || !__IN(l->class, 0x17)) { if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size)) {
OPM_Write('('); OPM_Write('(');
OPC_Ident(n->typ->strobj); OPC_Ident(n->typ->strobj);
OPM_Write(')'); OPM_Write(')');

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPV__h #ifndef OPV__h
#define OPV__h #define OPV__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
typedef typedef

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Platform__h #ifndef Platform__h
#define Platform__h #define Platform__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Reals__h #ifndef Reals__h
#define Reals__h #define Reals__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Strings__h #ifndef Strings__h
#define Strings__h #define Strings__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "Files.h" #include "Files.h"
#include "Modules.h" #include "Modules.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Texts__h #ifndef Texts__h
#define Texts__h #define Texts__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkamSf */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkamSf */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "Configuration.h" #include "Configuration.h"
#include "Heap.h" #include "Heap.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
typedef typedef

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef errors__h #ifndef errors__h
#define errors__h #define errors__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "Configuration.h" #include "Configuration.h"
#include "Console.h" #include "Console.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef extTools__h #ifndef extTools__h
#define extTools__h #define extTools__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h" #include "SYSTEM.h"
#include "Console.h" #include "Console.h"
#include "Strings.h" #include "Strings.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef vt100__h #ifndef vt100__h
#define vt100__h #define vt100__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#define LARGE #define LARGE
#include "SYSTEM.h" #include "SYSTEM.h"
@ -14,6 +14,6 @@ export void *Configuration__init(void)
__DEFMOD; __DEFMOD;
__REGMOD("Configuration", 0); __REGMOD("Configuration", 0);
/* BEGIN */ /* BEGIN */
__MOVE("1.95 [2016/07/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); __MOVE("1.95 [2016/08/12] for gcc LP64 on cygwin", Configuration_versionLong, 41);
__ENDMOD; __ENDMOD;
} }

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Configuration__h #ifndef Configuration__h
#define Configuration__h #define Configuration__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#define LARGE #define LARGE
#include "SYSTEM.h" #include "SYSTEM.h"
#include "Platform.h" #include "Platform.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Console__h #ifndef Console__h
#define Console__h #define Console__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin tspkaSfF */
#define LARGE #define LARGE
#include "SYSTEM.h" #include "SYSTEM.h"
#include "Configuration.h" #include "Configuration.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin tspkaSfF */
#ifndef Files__h #ifndef Files__h
#define Files__h #define Files__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin tskSfF */
#define LARGE #define LARGE
#include "SYSTEM.h" #include "SYSTEM.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin tskSfF */
#ifndef Heap__h #ifndef Heap__h
#define Heap__h #define Heap__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#define LARGE #define LARGE
#include "SYSTEM.h" #include "SYSTEM.h"
#include "Console.h" #include "Console.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Modules__h #ifndef Modules__h
#define Modules__h #define Modules__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#define LARGE #define LARGE
#include "SYSTEM.h" #include "SYSTEM.h"
#include "OPM.h" #include "OPM.h"
@ -91,8 +91,8 @@ OPT_Node OPB_NewLeaf (OPT_Object obj)
node = OPT_NewNode(9); node = OPT_NewNode(9);
break; break;
default: default:
OPB_err(127);
node = OPT_NewNode(0); node = OPT_NewNode(0);
OPB_err(127);
break; break;
} }
node->obj = obj; node->obj = obj;
@ -1597,8 +1597,9 @@ void OPB_SetElem (OPT_Node *x)
static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
{ {
OPT_Struct y = NIL;
INTEGER f, g; INTEGER f, g;
OPT_Struct y = NIL, p = NIL, q = NIL; OPT_Struct p = NIL, q = NIL;
if (OPM_Verbose) { if (OPM_Verbose) {
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22);
@ -1643,15 +1644,9 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
} }
break; break;
case 6: case 6:
if (OPM_LIntSize == 4) {
if (!__IN(g, 0x70)) { if (!__IN(g, 0x70)) {
OPB_err(113); OPB_err(113);
} }
} else {
if (!__IN(g, 0x70)) {
OPB_err(113);
}
}
break; break;
case 7: case 7:
if (!__IN(g, 0xf0)) { if (!__IN(g, 0xf0)) {

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPB__h #ifndef OPB__h
#define OPB__h #define OPB__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#define LARGE #define LARGE
#include "SYSTEM.h" #include "SYSTEM.h"
#include "Configuration.h" #include "Configuration.h"
@ -316,7 +316,7 @@ void OPC_Andent (OPT_Struct typ)
static BOOLEAN OPC_Undefined (OPT_Object obj) static BOOLEAN OPC_Undefined (OPT_Object obj)
{ {
BOOLEAN _o_result; BOOLEAN _o_result;
_o_result = (((obj->mnolev >= 0 && obj->linkadr != (LONGINT)(3 + OPM_currFile))) && obj->linkadr != 2) || obj->name[0] == 0x00; _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (LONGINT)(3 + OPM_currFile))) && obj->linkadr != 2);
return _o_result; return _o_result;
} }
@ -1239,8 +1239,8 @@ void OPC_GenHdr (OPT_Node n)
static void OPC_GenHeaderMsg (void) static void OPC_GenHeaderMsg (void)
{ {
INTEGER i; INTEGER i;
OPM_WriteString((CHAR*)"/*", (LONGINT)3); OPM_WriteString((CHAR*)"/* ", (LONGINT)4);
OPM_WriteString((CHAR*)" voc ", (LONGINT)6); OPM_WriteString((CHAR*)"voc", (LONGINT)4);
OPM_Write(' '); OPM_Write(' ');
OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); OPM_WriteString(Configuration_versionLong, ((LONGINT)(41)));
OPM_Write(' '); OPM_Write(' ');

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPC__h #ifndef OPC__h
#define OPC__h #define OPC__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#define LARGE #define LARGE
#include "SYSTEM.h" #include "SYSTEM.h"
#include "Configuration.h" #include "Configuration.h"
@ -37,6 +37,7 @@ static CHAR OPM_OBERON[1024];
static CHAR OPM_MODULES[1024]; static CHAR OPM_MODULES[1024];
export INTEGER OPM_AlignSize (LONGINT size);
static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F);
export void OPM_CloseFiles (void); export void OPM_CloseFiles (void);
export void OPM_CloseOldSym (void); export void OPM_CloseOldSym (void);
@ -58,7 +59,6 @@ export void OPM_LogWNum (LONGINT i, LONGINT len);
export void OPM_LogWStr (CHAR *s, LONGINT s__len); export void OPM_LogWStr (CHAR *s, LONGINT s__len);
static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len);
export void OPM_Mark (INTEGER n, LONGINT pos); export void OPM_Mark (INTEGER n, LONGINT pos);
static INTEGER OPM_Min (INTEGER a, INTEGER b);
export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_NewSym (CHAR *modName, LONGINT modName__len);
export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done);
export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len);
@ -86,7 +86,7 @@ export void OPM_WriteString (CHAR *s, LONGINT s__len);
export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len);
export BOOLEAN OPM_eofSF (void); export BOOLEAN OPM_eofSF (void);
export void OPM_err (INTEGER n); export void OPM_err (INTEGER n);
static LONGINT OPM_minus (LONGINT i); static LONGINT OPM_minusop (LONGINT i);
static LONGINT OPM_power0 (LONGINT i, LONGINT j); static LONGINT OPM_power0 (LONGINT i, LONGINT j);
@ -118,50 +118,38 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
i = 1; i = 1;
while (s[__X(i, s__len)] != 0x00) { while (s[__X(i, s__len)] != 0x00) {
switch (s[__X(i, s__len)]) { switch (s[__X(i, s__len)]) {
case 'e':
*opt = *opt ^ 0x0200;
break;
case 's':
*opt = *opt ^ 0x10;
break;
case 'm':
*opt = *opt ^ 0x0400;
break;
case 'x':
*opt = *opt ^ 0x01;
break;
case 'r':
*opt = *opt ^ 0x04;
break;
case 't':
*opt = *opt ^ 0x08;
break;
case 'a': case 'a':
*opt = *opt ^ 0x80; *opt = *opt ^ 0x80;
break; break;
case 'k':
*opt = *opt ^ 0x40;
break;
case 'p':
*opt = *opt ^ 0x20;
break;
case 'S':
*opt = *opt ^ 0x2000;
break;
case 'c': case 'c':
*opt = *opt ^ 0x4000; *opt = *opt ^ 0x4000;
break; break;
case 'M': case 'e':
*opt = *opt ^ 0x8000; *opt = *opt ^ 0x0200;
break; break;
case 'f': case 'f':
*opt = *opt ^ 0x010000; *opt = *opt ^ 0x010000;
break; break;
case 'F': case 'k':
*opt = *opt ^ 0x020000; *opt = *opt ^ 0x40;
break; break;
case 'V': case 'm':
*opt = *opt ^ 0x040000; *opt = *opt ^ 0x0400;
break;
case 'p':
*opt = *opt ^ 0x20;
break;
case 'r':
*opt = *opt ^ 0x04;
break;
case 's':
*opt = *opt ^ 0x10;
break;
case 't':
*opt = *opt ^ 0x08;
break;
case 'x':
*opt = *opt ^ 0x01;
break; break;
case 'B': case 'B':
if (s[__X(i + 1, s__len)] != 0x00) { if (s[__X(i + 1, s__len)] != 0x00) {
@ -179,6 +167,19 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
__ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0);
__ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0);
__ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0);
Files_SetSearchPath((CHAR*)"", (LONGINT)1);
break;
case 'F':
*opt = *opt ^ 0x020000;
break;
case 'M':
*opt = *opt ^ 0x8000;
break;
case 'S':
*opt = *opt ^ 0x2000;
break;
case 'V':
*opt = *opt ^ 0x040000;
break; break;
default: default:
OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19);
@ -576,7 +577,7 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG
__DEL(name); __DEL(name);
} }
static LONGINT OPM_minus (LONGINT i) static LONGINT OPM_minusop (LONGINT i)
{ {
LONGINT _o_result; LONGINT _o_result;
_o_result = -i; _o_result = -i;
@ -664,17 +665,25 @@ static void OPM_VerboseListSizes (void)
OPM_LogWLn(); OPM_LogWLn();
} }
static INTEGER OPM_Min (INTEGER a, INTEGER b) INTEGER OPM_AlignSize (LONGINT size)
{ {
INTEGER _o_result; INTEGER _o_result;
if (a < b) { INTEGER align;
_o_result = a; if (size < (LONGINT)OPM_Alignment) {
return _o_result; if (size > 8) {
align = 16;
} else if (size > 4) {
align = 8;
} else if (size > 2) {
align = 4;
} else { } else {
_o_result = b; align = (int)size;
return _o_result;
} }
__RETCHK; } else {
align = OPM_Alignment;
}
_o_result = align;
return _o_result;
} }
static void OPM_GetProperties (void) static void OPM_GetProperties (void)
@ -683,24 +692,24 @@ static void OPM_GetProperties (void)
OPM_ProcSize = OPM_PointerSize; OPM_ProcSize = OPM_PointerSize;
OPM_LIntSize = __ASHL(OPM_IntSize, 1); OPM_LIntSize = __ASHL(OPM_IntSize, 1);
OPM_SetSize = OPM_LIntSize; OPM_SetSize = OPM_LIntSize;
OPM_CharAlign = OPM_Min(OPM_Alignment, OPM_CharSize); OPM_CharAlign = OPM_AlignSize(OPM_CharSize);
OPM_BoolAlign = OPM_Min(OPM_Alignment, OPM_BoolSize); OPM_BoolAlign = OPM_AlignSize(OPM_BoolSize);
OPM_SIntAlign = OPM_Min(OPM_Alignment, OPM_SIntSize); OPM_SIntAlign = OPM_AlignSize(OPM_SIntSize);
OPM_RecAlign = OPM_Min(OPM_Alignment, OPM_RecSize); OPM_RecAlign = OPM_AlignSize(OPM_RecSize);
OPM_RealAlign = OPM_Min(OPM_Alignment, OPM_RealSize); OPM_RealAlign = OPM_AlignSize(OPM_RealSize);
OPM_LRealAlign = OPM_Min(OPM_Alignment, OPM_LRealSize); OPM_LRealAlign = OPM_AlignSize(OPM_LRealSize);
OPM_PointerAlign = OPM_Min(OPM_Alignment, OPM_PointerSize); OPM_PointerAlign = OPM_AlignSize(OPM_PointerSize);
OPM_ProcAlign = OPM_Min(OPM_Alignment, OPM_ProcSize); OPM_ProcAlign = OPM_AlignSize(OPM_ProcSize);
OPM_IntAlign = OPM_Min(OPM_Alignment, OPM_IntSize); OPM_IntAlign = OPM_AlignSize(OPM_IntSize);
OPM_LIntAlign = OPM_Min(OPM_Alignment, OPM_LIntSize); OPM_LIntAlign = OPM_AlignSize(OPM_LIntSize);
OPM_SetAlign = OPM_Min(OPM_Alignment, OPM_SetSize); OPM_SetAlign = OPM_AlignSize(OPM_SetSize);
base = -2; base = -2;
OPM_MinSInt = __ASH(base, __ASHL(OPM_SIntSize, 3) - 2); OPM_MinSInt = __ASH(base, __ASHL(OPM_SIntSize, 3) - 2);
OPM_MaxSInt = OPM_minus(OPM_MinSInt + 1); OPM_MaxSInt = OPM_minusop(OPM_MinSInt + 1);
OPM_MinInt = __ASH(base, __ASHL(OPM_IntSize, 3) - 2); OPM_MinInt = __ASH(base, __ASHL(OPM_IntSize, 3) - 2);
OPM_MaxInt = OPM_minus(OPM_MinInt + 1); OPM_MaxInt = OPM_minusop(OPM_MinInt + 1);
OPM_MinLInt = __ASH(base, __ASHL(OPM_LIntSize, 3) - 2); OPM_MinLInt = __ASH(base, __ASHL(OPM_LIntSize, 3) - 2);
OPM_MaxLInt = OPM_minus(OPM_MinLInt + 1); OPM_MaxLInt = OPM_minusop(OPM_MinLInt + 1);
if (OPM_RealSize == 4) { if (OPM_RealSize == 4) {
OPM_MaxReal = 3.40282346000000e+038; OPM_MaxReal = 3.40282346000000e+038;
} else if (OPM_RealSize == 8) { } else if (OPM_RealSize == 8) {

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPM__h #ifndef OPM__h
#define OPM__h #define OPM__h
@ -19,6 +19,7 @@ import SET OPM_opt, OPM_glbopt;
import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose;
import INTEGER OPM_AlignSize (LONGINT size);
import void OPM_CloseFiles (void); import void OPM_CloseFiles (void);
import void OPM_CloseOldSym (void); import void OPM_CloseOldSym (void);
import void OPM_DeleteNewSym (void); import void OPM_DeleteNewSym (void);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#define LARGE #define LARGE
#include "SYSTEM.h" #include "SYSTEM.h"
#include "OPB.h" #include "OPB.h"
@ -439,10 +439,10 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned)
if (OPP_sym == 38) { if (OPP_sym == 38) {
OPP_qualident(&id); OPP_qualident(&id);
if (id->mode == 5) { if (id->mode == 5) {
if (id->typ != *banned) { if (id->typ == *banned) {
*typ = id->typ;
} else {
OPP_err(58); OPP_err(58);
} else {
*typ = id->typ;
} }
} else { } else {
OPP_err(52); OPP_err(52);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPP__h #ifndef OPP__h
#define OPP__h #define OPP__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin tspkaSfF */
#define LARGE #define LARGE
#include "SYSTEM.h" #include "SYSTEM.h"
#include "OPM.h" #include "OPM.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin tspkaSfF */
#ifndef OPS__h #ifndef OPS__h
#define OPS__h #define OPS__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/08/12] for gcc LP64 on cygwin xtspkaSfF */
#define LARGE #define LARGE
#include "SYSTEM.h" #include "SYSTEM.h"
#include "OPM.h" #include "OPM.h"
@ -1810,6 +1810,7 @@ export void *OPT__init(void)
OPT_syslink = OPT_topScope->right; OPT_syslink = OPT_topScope->right;
OPT_universe = OPT_topScope; OPT_universe = OPT_topScope;
OPT_topScope->right = NIL; 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*)"CHAR", 3, OPM_CharSize, &OPT_chartyp);
OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp);
OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp);
@ -1817,7 +1818,6 @@ export void *OPT__init(void)
OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp);
OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp);
OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp);
OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp);
OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0)));
OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1)));
OPT_EnterProc((CHAR*)"HALT", 0); OPT_EnterProc((CHAR*)"HALT", 0);

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