diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 3b84a5bd..ffd8b03e 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 319659fe..6db13d09 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index d438eca9..4259cfef 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index c300b039..c9994206 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -69,6 +69,9 @@ static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); static void Files_Deregister (CHAR *name, ADDRESS name__len); +export void Files_DumpBuffer (Files_Buffer b, INT16 indent); +export void Files_DumpFile (Files_File f, INT16 indent); +export void Files_DumpRider (Files_Rider r, INT16 indent); static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len); @@ -99,6 +102,7 @@ export void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__l static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len); export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); export void Files_SetSearchPath (CHAR *path, ADDRESS path__len); +static void Files_Spaces (INT16 i); export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); @@ -111,7 +115,132 @@ export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); #define Files_IdxTrap() __HALT(-1) -#define Files_ToAdr(x) (ADDRESS)x + +static void Files_Spaces (INT16 i) +{ + while (i > 0) { + Out_String((CHAR*)" ", 3); + i -= 1; + } +} + +void Files_DumpFile (Files_File f, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"workName: ", 15); + Out_String(f->workName, 101); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"registerName: ", 15); + Out_String(f->registerName, 101); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"tempFile: ", 15); + if (f->tempFile) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"identity: ", 15); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"fd: ", 15); + Out_Int(f->fd, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"len, ", 15); + Out_Int(f->len, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"pos: ", 15); + Out_Int(f->pos, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"bufs: ", 15); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"swapper: ", 15); + Out_Int(f->swapper, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"state: ", 15); + Out_Int(f->state, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"next: ", 15); + Out_Int((INT32)(ADDRESS)f->next, 1); + Out_Ln(); +} + +void Files_DumpBuffer (Files_Buffer b, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"chg: ", 7); + if (b->chg) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"org: ", 7); + Out_Int(b->org, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"size: ", 7); + Out_Int(b->size, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"data: ", 7); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"f: ", 7); + if (b->f == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Files_DumpFile(b->f, indent + 1); + } +} + +void Files_DumpRider (Files_Rider r, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"res: ", 9); + Out_Int(r.res, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"eof: ", 9); + if (r.eof) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"org: ", 9); + Out_Int(r.org, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"offset: ", 9); + Out_Int(r.offset, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"buf: ", 9); + if (r.buf == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Files_DumpBuffer(r.buf, indent + 1); + } +} static void Files_Assert (BOOLEAN truth) { @@ -661,7 +790,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x } else { min = n; } - __MOVE((ADDRESS)buf->data + Files_ToAdr(offset), (ADDRESS)x + Files_ToAdr(xpos), min); + __MOVE((ADDRESS)&buf->data[offset], (ADDRESS)&x[xpos], min); offset += min; (*r).offset = offset; xpos += min; @@ -724,7 +853,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS } else { min = n; } - __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); + __MOVE((ADDRESS)&x[xpos], (ADDRESS)&buf->data[offset], min); offset += min; (*r).offset = offset; Files_Assert(offset <= 4096); diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 258422d6..c548dae1 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,10 +1,19 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h #include "SYSTEM.h" +typedef + struct Files_BufDesc { + INT32 _prvt0; + char _prvt1[4108]; + } Files_BufDesc; + +typedef + Files_BufDesc *Files_Buffer; + typedef struct Files_FileDesc *Files_File; @@ -24,12 +33,16 @@ typedef import ADDRESS *Files_FileDesc__typ; +import ADDRESS *Files_BufDesc__typ; import ADDRESS *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); import void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); import void Files_Close (Files_File f); import void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); +import void Files_DumpBuffer (Files_Buffer b, INT16 indent); +import void Files_DumpFile (Files_File f, INT16 indent); +import void Files_DumpRider (Files_Rider r, INT16 indent); import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); import void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len); import INT32 Files_Length (Files_File f); diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index a3bcc604..125a2854 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index b5a1e4c3..e794a4a3 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index d2183857..b27930e7 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 4cecc8b9..553f80ed 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index a7d429eb..d83386eb 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index a49077b0..feb85d73 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 89ef22dc..ab01642c 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index b30a2315..f742f265 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 0c8ab9b3..a6c7a5cd 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index d1c71f13..621dfb51 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index dfca5a85..383b6d65 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index c82b4d80..c1fe21fb 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index a3b32b0c..4569c80d 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 99c62664..c0707c34 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 59059803..9bc66090 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 1aec7cad..6b2b0929 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 1e66dbde..42081077 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 9ad5508d..d363f022 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index fd578128..a647f77d 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index a3f5db4d..8c7a5774 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index da9669d9..22eb3138 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index d68c4ae0..cd9d9890 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 8ba81525..f5ee1490 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 0fe868e0..6d0ec38b 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index a6a802c4..4ee2fc23 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index bec035c4..ae281477 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 0696f4d7..35e17988 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -194,7 +194,6 @@ export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); static void Texts_DumpElem (Texts_Elem e); export void Texts_DumpReader (Texts_Reader re); -static void Texts_DumpRider (Files_Rider ri); static void Texts_DumpRun (Texts_Run ru); static void Texts_DumpText (Texts_Text t); export Texts_Text Texts_ElemBase (Texts_Elem E); @@ -278,20 +277,6 @@ static void Texts_DumpElem (Texts_Elem e) } } -static void Texts_DumpRider (Files_Rider ri) -{ - Out_String((CHAR*)" res: ", 10); - Out_Int(ri.res, 1); - Out_Ln(); - Out_String((CHAR*)" eof: ", 10); - if (ri.eof) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); -} - static void Texts_DumpRun (Texts_Run ru) { Out_String((CHAR*)" prev: ", 12); @@ -365,7 +350,7 @@ void Texts_DumpReader (Texts_Reader re) } Out_String((CHAR*)" rider: ", 10); Out_Ln(); - Texts_DumpRider(re.rider); + Files_DumpRider(re.rider, 2); Out_String((CHAR*)" run: ", 10); if (re.run == NIL) { Out_String((CHAR*)"", 6); @@ -860,32 +845,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p (*S).nextCh = ' '; } -static struct Scan__36 { +static struct Scan__35 { Texts_Scanner *S; ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; INT16 *e; - struct Scan__36 *lnk; -} *Scan__36_s; + struct Scan__35 *lnk; +} *Scan__35_s; -static void ReadScaleFactor__37 (void); +static void ReadScaleFactor__36 (void); -static void ReadScaleFactor__37 (void) +static void ReadScaleFactor__36 (void) { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); - if (*Scan__36_s->ch == '-') { - *Scan__36_s->negE = 1; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); + if (*Scan__35_s->ch == '-') { + *Scan__35_s->negE = 1; + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } else { - *Scan__36_s->negE = 0; - if (*Scan__36_s->ch == '+') { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + *Scan__35_s->negE = 0; + if (*Scan__35_s->ch == '+') { + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } } - while (('0' <= *Scan__36_s->ch && *Scan__36_s->ch <= '9')) { - *Scan__36_s->e = (*Scan__36_s->e * 10 + (INT16)*Scan__36_s->ch) - 48; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + while (('0' <= *Scan__35_s->ch && *Scan__35_s->ch <= '9')) { + *Scan__35_s->e = (*Scan__35_s->e * 10 + (INT16)*Scan__35_s->ch) - 48; + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } } @@ -899,13 +884,13 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) REAL x, f; LONGREAL y, g; CHAR d[32]; - struct Scan__36 _s; + struct Scan__35 _s; _s.S = S; _s.S__typ = S__typ; _s.ch = &ch; _s.negE = &negE; _s.e = &e; - _s.lnk = Scan__36_s; - Scan__36_s = &_s; + _s.lnk = Scan__35_s; + Scan__35_s = &_s; ch = (*S).nextCh; i = 0; for (;;) { @@ -1006,7 +991,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } - ReadScaleFactor__37(); + ReadScaleFactor__36(); if (negE) { if (e <= 308) { y = y / (LONGREAL)Reals_TenL(e); @@ -1039,7 +1024,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) j += 1; } if (ch == 'E') { - ReadScaleFactor__37(); + ReadScaleFactor__36(); } if (negE) { if (e <= 38) { @@ -1092,7 +1077,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) } } (*S).nextCh = ch; - Scan__36_s = _s.lnk; + Scan__35_s = _s.lnk; } void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) @@ -1311,30 +1296,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } } -static struct WriteRealFix__58 { +static struct WriteRealFix__57 { Texts_Writer *W; ADDRESS *W__typ; INT16 *i; CHAR (*d)[9]; - struct WriteRealFix__58 *lnk; -} *WriteRealFix__58_s; + struct WriteRealFix__57 *lnk; +} *WriteRealFix__57_s; -static void dig__59 (INT16 n); -static void seq__61 (CHAR ch, INT16 n); +static void dig__58 (INT16 n); +static void seq__60 (CHAR ch, INT16 n); -static void seq__61 (CHAR ch, INT16 n) +static void seq__60 (CHAR ch, INT16 n) { while (n > 0) { - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch); + Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, ch); n -= 1; } } -static void dig__59 (INT16 n) +static void dig__58 (INT16 n) { while (n > 0) { - *WriteRealFix__58_s->i -= 1; - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, (*WriteRealFix__58_s->d)[__X(*WriteRealFix__58_s->i, 9)]); + *WriteRealFix__57_s->i -= 1; + Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, (*WriteRealFix__57_s->d)[__X(*WriteRealFix__57_s->i, 9)]); n -= 1; } } @@ -1345,23 +1330,23 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 CHAR sign; REAL x0; CHAR d[9]; - struct WriteRealFix__58 _s; + struct WriteRealFix__57 _s; _s.W = W; _s.W__typ = W__typ; _s.i = &i; _s.d = (void*)d; - _s.lnk = WriteRealFix__58_s; - WriteRealFix__58_s = &_s; + _s.lnk = WriteRealFix__57_s; + WriteRealFix__57_s = &_s; e = Reals_Expo(x); if (k < 0) { k = 0; } if (e == 0) { - seq__61(' ', (n - k) - 2); + seq__60(' ', (n - k) - 2); Texts_Write(&*W, W__typ, '0'); - seq__61(' ', k + 1); + seq__60(' ', k + 1); } else if (e == 255) { Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); - seq__61(' ', n - 4); + seq__60(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); if (x < (REAL)0) { @@ -1394,21 +1379,21 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 i = k + e; Reals_Convert(x, i, (void*)d, 9); if (e > 0) { - seq__61(' ', ((n - e) - k) - 2); + seq__60(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); - dig__59(e); + dig__58(e); Texts_Write(&*W, W__typ, '.'); - dig__59(k); + dig__58(k); } else { - seq__61(' ', (n - k) - 3); + seq__60(' ', (n - k) - 3); Texts_Write(&*W, W__typ, sign); Texts_Write(&*W, W__typ, '0'); Texts_Write(&*W, W__typ, '.'); - seq__61('0', -e); - dig__59(k + e); + seq__60('0', -e); + dig__58(k + e); } } - WriteRealFix__58_s = _s.lnk; + WriteRealFix__57_s = _s.lnk; } void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) @@ -1507,48 +1492,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) } while (!(i == 16)); } -static struct WriteDate__48 { +static struct WriteDate__47 { Texts_Writer *W; ADDRESS *W__typ; - struct WriteDate__48 *lnk; -} *WriteDate__48_s; + struct WriteDate__47 *lnk; +} *WriteDate__47_s; -static void WritePair__49 (CHAR ch, INT32 x); +static void WritePair__48 (CHAR ch, INT32 x); -static void WritePair__49 (CHAR ch, INT32 x) +static void WritePair__48 (CHAR ch, INT32 x) { - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, ch); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, ch); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { - struct WriteDate__48 _s; + struct WriteDate__47 _s; _s.W = W; _s.W__typ = W__typ; - _s.lnk = WriteDate__48_s; - WriteDate__48_s = &_s; - WritePair__49(' ', __MASK(d, -32)); - WritePair__49('.', __MASK(__ASHR(d, 5), -16)); - WritePair__49('.', __MASK(__ASHR(d, 9), -128)); - WritePair__49(' ', __MASK(__ASHR(t, 12), -32)); - WritePair__49(':', __MASK(__ASHR(t, 6), -64)); - WritePair__49(':', __MASK(t, -64)); - WriteDate__48_s = _s.lnk; + _s.lnk = WriteDate__47_s; + WriteDate__47_s = &_s; + WritePair__48(' ', __MASK(d, -32)); + WritePair__48('.', __MASK(__ASHR(d, 5), -16)); + WritePair__48('.', __MASK(__ASHR(d, 9), -128)); + WritePair__48(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__48(':', __MASK(__ASHR(t, 6), -64)); + WritePair__48(':', __MASK(t, -64)); + WriteDate__47_s = _s.lnk; } -static struct Load0__21 { +static struct Load0__20 { Texts_Text *T; INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Load0__21 *lnk; -} *Load0__21_s; + struct Load0__20 *lnk; +} *Load0__20_s; -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); +static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) +static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1559,15 +1544,15 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); Files_Read(&*r, r__typ, (void*)&eno); - if (eno > *Load0__21_s->ecnt) { - *Load0__21_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->mods)[__X(eno, 64)], 32); - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->procs)[__X(eno, 64)], 32); + if (eno > *Load0__20_s->ecnt) { + *Load0__20_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__21_s->mods)[__X(eno, 64)], 32); + M = Modules_ThisMod((*Load0__20_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__21_s->procs)[__X(eno, 64)], 32); + Cmd = Modules_ThisCommand(M, (*Load0__20_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1576,25 +1561,25 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span if (*e != NIL) { (*e)->W = ew; (*e)->H = eh; - (*e)->base = *Load0__21_s->T; - (*Load0__21_s->msg).pos = pos; - (*(*e)->handle)(*e, (void*)&*Load0__21_s->msg, Texts_FileMsg__typ); + (*e)->base = *Load0__20_s->T; + (*Load0__20_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__20_s->msg, Texts_FileMsg__typ); if (Files_Pos(&*r, r__typ) != org + span) { *e = NIL; } } if (*e == NIL) { - Files_Set(&*r, r__typ, *Load0__21_s->f, org + span); + Files_Set(&*r, r__typ, *Load0__20_s->f, org + span); __NEW(a, Texts__1); a->W = ew; a->H = eh; a->handle = Texts_HandleAlien; - a->base = *Load0__21_s->T; - a->file = *Load0__21_s->f; + a->base = *Load0__20_s->T; + a->file = *Load0__20_s->f; a->org = org; a->span = span; - __COPY((*Load0__21_s->mods)[__X(eno, 64)], a->mod, 32); - __COPY((*Load0__21_s->procs)[__X(eno, 64)], a->proc, 32); + __COPY((*Load0__20_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__20_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1611,15 +1596,15 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; CHAR name[32]; Texts_FontsFont fnts[32]; - struct Load0__21 _s; + struct Load0__20 _s; _s.T = &T; _s.ecnt = &ecnt; _s.f = &f; _s.msg = &msg; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Load0__21_s; - Load0__21_s = &_s; + _s.lnk = Load0__20_s; + Load0__20_s = &_s; pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); @@ -1652,7 +1637,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) un = (Texts_Run)p; un->len = plen; } else { - LoadElem__22(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + LoadElem__21(&msg.r, Files_Rider__typ, pos - org, -plen, &e); un = (Texts_Run)e; un->len = 1; } @@ -1670,7 +1655,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) T->corg = 0; Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); - Load0__21_s = _s.lnk; + Load0__20_s = _s.lnk; } void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) @@ -1739,25 +1724,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) __DEL(name); } -static struct Store__44 { +static struct Store__43 { INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Store__44 *lnk; -} *Store__44_s; + struct Store__43 *lnk; +} *Store__43_s; -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); +static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) +static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; INT32 org, span; INT8 eno; - __COPY((*Store__44_s->iden).mod, (*Store__44_s->mods)[__X(*Store__44_s->ecnt, 64)], 32); - __COPY((*Store__44_s->iden).proc, (*Store__44_s->procs)[__X(*Store__44_s->ecnt, 64)], 32); + __COPY((*Store__43_s->iden).mod, (*Store__43_s->mods)[__X(*Store__43_s->ecnt, 64)], 32); + __COPY((*Store__43_s->iden).proc, (*Store__43_s->procs)[__X(*Store__43_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__44_s->mods)[__X(eno, 64)], (*Store__44_s->iden).mod) != 0 || __STRCMP((*Store__44_s->procs)[__X(eno, 64)], (*Store__44_s->iden).proc) != 0) { + while (__STRCMP((*Store__43_s->mods)[__X(eno, 64)], (*Store__43_s->iden).mod) != 0 || __STRCMP((*Store__43_s->procs)[__X(eno, 64)], (*Store__43_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); @@ -1765,14 +1750,14 @@ static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Ele Files_WriteLInt(&*r, r__typ, 0); Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); - if (eno == *Store__44_s->ecnt) { - *Store__44_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).mod, 32); - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).proc, 32); + if (eno == *Store__43_s->ecnt) { + *Store__43_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__43_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__43_s->iden).proc, 32); } - (*Store__44_s->msg).pos = pos; + (*Store__43_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); - (*e->handle)(e, (void*)&*Store__44_s->msg, Texts_FileMsg__typ); + (*e->handle)(e, (void*)&*Store__43_s->msg, Texts_FileMsg__typ); span = Files_Pos(&*r, r__typ) - org; Files_WriteLInt(&r1, Files_Rider__typ, -span); Files_WriteLInt(&r1, Files_Rider__typ, e->W); @@ -1793,14 +1778,14 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; Texts_FontsFont fnts[32]; CHAR block[1024]; - struct Store__44 _s; + struct Store__43 _s; _s.ecnt = &ecnt; _s.msg = &msg; _s.iden = &iden; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Store__44_s; - Store__44_s = &_s; + _s.lnk = Store__43_s; + Store__43_s = &_s; org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; @@ -1842,7 +1827,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) pos += rlen; u = un; } else if (iden.mod[0] != 0x00) { - StoreElem__45(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + StoreElem__44(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); pos += 1; u = u->next; } else { @@ -1896,7 +1881,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) if (T->notify != NIL) { (*T->notify)(T, 3, 0, 0); } - Store__44_s = _s.lnk; + Store__43_s = _s.lnk; } void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 9c320190..dfe60b54 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 669a337a..9ab993c9 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 809a6082..3de3605c 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index b9ca8d5a..213abf27 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 6a31ee74..4278a34c 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 3b84a5bd..ffd8b03e 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 319659fe..6db13d09 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index d438eca9..4259cfef 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index c300b039..c9994206 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -69,6 +69,9 @@ static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); static void Files_Deregister (CHAR *name, ADDRESS name__len); +export void Files_DumpBuffer (Files_Buffer b, INT16 indent); +export void Files_DumpFile (Files_File f, INT16 indent); +export void Files_DumpRider (Files_Rider r, INT16 indent); static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len); @@ -99,6 +102,7 @@ export void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__l static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len); export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); export void Files_SetSearchPath (CHAR *path, ADDRESS path__len); +static void Files_Spaces (INT16 i); export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); @@ -111,7 +115,132 @@ export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); #define Files_IdxTrap() __HALT(-1) -#define Files_ToAdr(x) (ADDRESS)x + +static void Files_Spaces (INT16 i) +{ + while (i > 0) { + Out_String((CHAR*)" ", 3); + i -= 1; + } +} + +void Files_DumpFile (Files_File f, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"workName: ", 15); + Out_String(f->workName, 101); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"registerName: ", 15); + Out_String(f->registerName, 101); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"tempFile: ", 15); + if (f->tempFile) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"identity: ", 15); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"fd: ", 15); + Out_Int(f->fd, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"len, ", 15); + Out_Int(f->len, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"pos: ", 15); + Out_Int(f->pos, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"bufs: ", 15); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"swapper: ", 15); + Out_Int(f->swapper, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"state: ", 15); + Out_Int(f->state, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"next: ", 15); + Out_Int((INT32)(ADDRESS)f->next, 1); + Out_Ln(); +} + +void Files_DumpBuffer (Files_Buffer b, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"chg: ", 7); + if (b->chg) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"org: ", 7); + Out_Int(b->org, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"size: ", 7); + Out_Int(b->size, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"data: ", 7); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"f: ", 7); + if (b->f == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Files_DumpFile(b->f, indent + 1); + } +} + +void Files_DumpRider (Files_Rider r, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"res: ", 9); + Out_Int(r.res, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"eof: ", 9); + if (r.eof) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"org: ", 9); + Out_Int(r.org, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"offset: ", 9); + Out_Int(r.offset, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"buf: ", 9); + if (r.buf == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Files_DumpBuffer(r.buf, indent + 1); + } +} static void Files_Assert (BOOLEAN truth) { @@ -661,7 +790,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x } else { min = n; } - __MOVE((ADDRESS)buf->data + Files_ToAdr(offset), (ADDRESS)x + Files_ToAdr(xpos), min); + __MOVE((ADDRESS)&buf->data[offset], (ADDRESS)&x[xpos], min); offset += min; (*r).offset = offset; xpos += min; @@ -724,7 +853,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS } else { min = n; } - __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); + __MOVE((ADDRESS)&x[xpos], (ADDRESS)&buf->data[offset], min); offset += min; (*r).offset = offset; Files_Assert(offset <= 4096); diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 258422d6..c548dae1 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,10 +1,19 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h #include "SYSTEM.h" +typedef + struct Files_BufDesc { + INT32 _prvt0; + char _prvt1[4108]; + } Files_BufDesc; + +typedef + Files_BufDesc *Files_Buffer; + typedef struct Files_FileDesc *Files_File; @@ -24,12 +33,16 @@ typedef import ADDRESS *Files_FileDesc__typ; +import ADDRESS *Files_BufDesc__typ; import ADDRESS *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); import void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); import void Files_Close (Files_File f); import void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); +import void Files_DumpBuffer (Files_Buffer b, INT16 indent); +import void Files_DumpFile (Files_File f, INT16 indent); +import void Files_DumpRider (Files_Rider r, INT16 indent); import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); import void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len); import INT32 Files_Length (Files_File f); diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index a3bcc604..125a2854 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index b5a1e4c3..e794a4a3 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index d2183857..b27930e7 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 4cecc8b9..553f80ed 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index a7d429eb..d83386eb 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index a49077b0..feb85d73 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 89ef22dc..ab01642c 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index b30a2315..f742f265 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 0c8ab9b3..a6c7a5cd 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index d1c71f13..621dfb51 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index dfca5a85..383b6d65 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index c82b4d80..c1fe21fb 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index a3b32b0c..4569c80d 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 99c62664..c0707c34 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 6edc4b6a..0d32553a 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 1aec7cad..6b2b0929 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 1e66dbde..42081077 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 9ad5508d..d363f022 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index fd578128..a647f77d 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index a3f5db4d..8c7a5774 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index da9669d9..22eb3138 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index d68c4ae0..cd9d9890 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 8ba81525..f5ee1490 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 0fe868e0..6d0ec38b 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index a6a802c4..4ee2fc23 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index bec035c4..ae281477 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index d1a7f696..9016dbc8 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -194,7 +194,6 @@ export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); static void Texts_DumpElem (Texts_Elem e); export void Texts_DumpReader (Texts_Reader re); -static void Texts_DumpRider (Files_Rider ri); static void Texts_DumpRun (Texts_Run ru); static void Texts_DumpText (Texts_Text t); export Texts_Text Texts_ElemBase (Texts_Elem E); @@ -278,20 +277,6 @@ static void Texts_DumpElem (Texts_Elem e) } } -static void Texts_DumpRider (Files_Rider ri) -{ - Out_String((CHAR*)" res: ", 10); - Out_Int(ri.res, 1); - Out_Ln(); - Out_String((CHAR*)" eof: ", 10); - if (ri.eof) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); -} - static void Texts_DumpRun (Texts_Run ru) { Out_String((CHAR*)" prev: ", 12); @@ -365,7 +350,7 @@ void Texts_DumpReader (Texts_Reader re) } Out_String((CHAR*)" rider: ", 10); Out_Ln(); - Texts_DumpRider(re.rider); + Files_DumpRider(re.rider, 2); Out_String((CHAR*)" run: ", 10); if (re.run == NIL) { Out_String((CHAR*)"", 6); @@ -860,32 +845,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p (*S).nextCh = ' '; } -static struct Scan__36 { +static struct Scan__35 { Texts_Scanner *S; ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; INT16 *e; - struct Scan__36 *lnk; -} *Scan__36_s; + struct Scan__35 *lnk; +} *Scan__35_s; -static void ReadScaleFactor__37 (void); +static void ReadScaleFactor__36 (void); -static void ReadScaleFactor__37 (void) +static void ReadScaleFactor__36 (void) { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); - if (*Scan__36_s->ch == '-') { - *Scan__36_s->negE = 1; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); + if (*Scan__35_s->ch == '-') { + *Scan__35_s->negE = 1; + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } else { - *Scan__36_s->negE = 0; - if (*Scan__36_s->ch == '+') { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + *Scan__35_s->negE = 0; + if (*Scan__35_s->ch == '+') { + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } } - while (('0' <= *Scan__36_s->ch && *Scan__36_s->ch <= '9')) { - *Scan__36_s->e = (*Scan__36_s->e * 10 + (INT16)*Scan__36_s->ch) - 48; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + while (('0' <= *Scan__35_s->ch && *Scan__35_s->ch <= '9')) { + *Scan__35_s->e = (*Scan__35_s->e * 10 + (INT16)*Scan__35_s->ch) - 48; + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } } @@ -899,13 +884,13 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) REAL x, f; LONGREAL y, g; CHAR d[32]; - struct Scan__36 _s; + struct Scan__35 _s; _s.S = S; _s.S__typ = S__typ; _s.ch = &ch; _s.negE = &negE; _s.e = &e; - _s.lnk = Scan__36_s; - Scan__36_s = &_s; + _s.lnk = Scan__35_s; + Scan__35_s = &_s; ch = (*S).nextCh; i = 0; for (;;) { @@ -1006,7 +991,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } - ReadScaleFactor__37(); + ReadScaleFactor__36(); if (negE) { if (e <= 308) { y = y / (LONGREAL)Reals_TenL(e); @@ -1039,7 +1024,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) j += 1; } if (ch == 'E') { - ReadScaleFactor__37(); + ReadScaleFactor__36(); } if (negE) { if (e <= 38) { @@ -1092,7 +1077,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) } } (*S).nextCh = ch; - Scan__36_s = _s.lnk; + Scan__35_s = _s.lnk; } void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) @@ -1311,30 +1296,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } } -static struct WriteRealFix__58 { +static struct WriteRealFix__57 { Texts_Writer *W; ADDRESS *W__typ; INT16 *i; CHAR (*d)[9]; - struct WriteRealFix__58 *lnk; -} *WriteRealFix__58_s; + struct WriteRealFix__57 *lnk; +} *WriteRealFix__57_s; -static void dig__59 (INT16 n); -static void seq__61 (CHAR ch, INT16 n); +static void dig__58 (INT16 n); +static void seq__60 (CHAR ch, INT16 n); -static void seq__61 (CHAR ch, INT16 n) +static void seq__60 (CHAR ch, INT16 n) { while (n > 0) { - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch); + Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, ch); n -= 1; } } -static void dig__59 (INT16 n) +static void dig__58 (INT16 n) { while (n > 0) { - *WriteRealFix__58_s->i -= 1; - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, (*WriteRealFix__58_s->d)[__X(*WriteRealFix__58_s->i, 9)]); + *WriteRealFix__57_s->i -= 1; + Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, (*WriteRealFix__57_s->d)[__X(*WriteRealFix__57_s->i, 9)]); n -= 1; } } @@ -1345,23 +1330,23 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 CHAR sign; REAL x0; CHAR d[9]; - struct WriteRealFix__58 _s; + struct WriteRealFix__57 _s; _s.W = W; _s.W__typ = W__typ; _s.i = &i; _s.d = (void*)d; - _s.lnk = WriteRealFix__58_s; - WriteRealFix__58_s = &_s; + _s.lnk = WriteRealFix__57_s; + WriteRealFix__57_s = &_s; e = Reals_Expo(x); if (k < 0) { k = 0; } if (e == 0) { - seq__61(' ', (n - k) - 2); + seq__60(' ', (n - k) - 2); Texts_Write(&*W, W__typ, '0'); - seq__61(' ', k + 1); + seq__60(' ', k + 1); } else if (e == 255) { Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); - seq__61(' ', n - 4); + seq__60(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); if (x < (REAL)0) { @@ -1394,21 +1379,21 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 i = k + e; Reals_Convert(x, i, (void*)d, 9); if (e > 0) { - seq__61(' ', ((n - e) - k) - 2); + seq__60(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); - dig__59(e); + dig__58(e); Texts_Write(&*W, W__typ, '.'); - dig__59(k); + dig__58(k); } else { - seq__61(' ', (n - k) - 3); + seq__60(' ', (n - k) - 3); Texts_Write(&*W, W__typ, sign); Texts_Write(&*W, W__typ, '0'); Texts_Write(&*W, W__typ, '.'); - seq__61('0', -e); - dig__59(k + e); + seq__60('0', -e); + dig__58(k + e); } } - WriteRealFix__58_s = _s.lnk; + WriteRealFix__57_s = _s.lnk; } void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) @@ -1507,48 +1492,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) } while (!(i == 16)); } -static struct WriteDate__48 { +static struct WriteDate__47 { Texts_Writer *W; ADDRESS *W__typ; - struct WriteDate__48 *lnk; -} *WriteDate__48_s; + struct WriteDate__47 *lnk; +} *WriteDate__47_s; -static void WritePair__49 (CHAR ch, INT32 x); +static void WritePair__48 (CHAR ch, INT32 x); -static void WritePair__49 (CHAR ch, INT32 x) +static void WritePair__48 (CHAR ch, INT32 x) { - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, ch); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, ch); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { - struct WriteDate__48 _s; + struct WriteDate__47 _s; _s.W = W; _s.W__typ = W__typ; - _s.lnk = WriteDate__48_s; - WriteDate__48_s = &_s; - WritePair__49(' ', __MASK(d, -32)); - WritePair__49('.', __MASK(__ASHR(d, 5), -16)); - WritePair__49('.', __MASK(__ASHR(d, 9), -128)); - WritePair__49(' ', __MASK(__ASHR(t, 12), -32)); - WritePair__49(':', __MASK(__ASHR(t, 6), -64)); - WritePair__49(':', __MASK(t, -64)); - WriteDate__48_s = _s.lnk; + _s.lnk = WriteDate__47_s; + WriteDate__47_s = &_s; + WritePair__48(' ', __MASK(d, -32)); + WritePair__48('.', __MASK(__ASHR(d, 5), -16)); + WritePair__48('.', __MASK(__ASHR(d, 9), -128)); + WritePair__48(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__48(':', __MASK(__ASHR(t, 6), -64)); + WritePair__48(':', __MASK(t, -64)); + WriteDate__47_s = _s.lnk; } -static struct Load0__21 { +static struct Load0__20 { Texts_Text *T; INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Load0__21 *lnk; -} *Load0__21_s; + struct Load0__20 *lnk; +} *Load0__20_s; -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); +static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) +static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1559,15 +1544,15 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); Files_Read(&*r, r__typ, (void*)&eno); - if (eno > *Load0__21_s->ecnt) { - *Load0__21_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->mods)[__X(eno, 64)], 32); - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->procs)[__X(eno, 64)], 32); + if (eno > *Load0__20_s->ecnt) { + *Load0__20_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__21_s->mods)[__X(eno, 64)], 32); + M = Modules_ThisMod((*Load0__20_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__21_s->procs)[__X(eno, 64)], 32); + Cmd = Modules_ThisCommand(M, (*Load0__20_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1576,25 +1561,25 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span if (*e != NIL) { (*e)->W = ew; (*e)->H = eh; - (*e)->base = *Load0__21_s->T; - (*Load0__21_s->msg).pos = pos; - (*(*e)->handle)(*e, (void*)&*Load0__21_s->msg, Texts_FileMsg__typ); + (*e)->base = *Load0__20_s->T; + (*Load0__20_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__20_s->msg, Texts_FileMsg__typ); if (Files_Pos(&*r, r__typ) != org + span) { *e = NIL; } } if (*e == NIL) { - Files_Set(&*r, r__typ, *Load0__21_s->f, org + span); + Files_Set(&*r, r__typ, *Load0__20_s->f, org + span); __NEW(a, Texts__1); a->W = ew; a->H = eh; a->handle = Texts_HandleAlien; - a->base = *Load0__21_s->T; - a->file = *Load0__21_s->f; + a->base = *Load0__20_s->T; + a->file = *Load0__20_s->f; a->org = org; a->span = span; - __COPY((*Load0__21_s->mods)[__X(eno, 64)], a->mod, 32); - __COPY((*Load0__21_s->procs)[__X(eno, 64)], a->proc, 32); + __COPY((*Load0__20_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__20_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1611,15 +1596,15 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; CHAR name[32]; Texts_FontsFont fnts[32]; - struct Load0__21 _s; + struct Load0__20 _s; _s.T = &T; _s.ecnt = &ecnt; _s.f = &f; _s.msg = &msg; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Load0__21_s; - Load0__21_s = &_s; + _s.lnk = Load0__20_s; + Load0__20_s = &_s; pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); @@ -1652,7 +1637,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) un = (Texts_Run)p; un->len = plen; } else { - LoadElem__22(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + LoadElem__21(&msg.r, Files_Rider__typ, pos - org, -plen, &e); un = (Texts_Run)e; un->len = 1; } @@ -1670,7 +1655,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) T->corg = 0; Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); - Load0__21_s = _s.lnk; + Load0__20_s = _s.lnk; } void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) @@ -1739,25 +1724,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) __DEL(name); } -static struct Store__44 { +static struct Store__43 { INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Store__44 *lnk; -} *Store__44_s; + struct Store__43 *lnk; +} *Store__43_s; -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); +static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) +static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; INT32 org, span; INT8 eno; - __COPY((*Store__44_s->iden).mod, (*Store__44_s->mods)[__X(*Store__44_s->ecnt, 64)], 32); - __COPY((*Store__44_s->iden).proc, (*Store__44_s->procs)[__X(*Store__44_s->ecnt, 64)], 32); + __COPY((*Store__43_s->iden).mod, (*Store__43_s->mods)[__X(*Store__43_s->ecnt, 64)], 32); + __COPY((*Store__43_s->iden).proc, (*Store__43_s->procs)[__X(*Store__43_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__44_s->mods)[__X(eno, 64)], (*Store__44_s->iden).mod) != 0 || __STRCMP((*Store__44_s->procs)[__X(eno, 64)], (*Store__44_s->iden).proc) != 0) { + while (__STRCMP((*Store__43_s->mods)[__X(eno, 64)], (*Store__43_s->iden).mod) != 0 || __STRCMP((*Store__43_s->procs)[__X(eno, 64)], (*Store__43_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); @@ -1765,14 +1750,14 @@ static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Ele Files_WriteLInt(&*r, r__typ, 0); Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); - if (eno == *Store__44_s->ecnt) { - *Store__44_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).mod, 32); - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).proc, 32); + if (eno == *Store__43_s->ecnt) { + *Store__43_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__43_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__43_s->iden).proc, 32); } - (*Store__44_s->msg).pos = pos; + (*Store__43_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); - (*e->handle)(e, (void*)&*Store__44_s->msg, Texts_FileMsg__typ); + (*e->handle)(e, (void*)&*Store__43_s->msg, Texts_FileMsg__typ); span = Files_Pos(&*r, r__typ) - org; Files_WriteLInt(&r1, Files_Rider__typ, -span); Files_WriteLInt(&r1, Files_Rider__typ, e->W); @@ -1793,14 +1778,14 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; Texts_FontsFont fnts[32]; CHAR block[1024]; - struct Store__44 _s; + struct Store__43 _s; _s.ecnt = &ecnt; _s.msg = &msg; _s.iden = &iden; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Store__44_s; - Store__44_s = &_s; + _s.lnk = Store__43_s; + Store__43_s = &_s; org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; @@ -1842,7 +1827,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) pos += rlen; u = un; } else if (iden.mod[0] != 0x00) { - StoreElem__45(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + StoreElem__44(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); pos += 1; u = u->next; } else { @@ -1896,7 +1881,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) if (T->notify != NIL) { (*T->notify)(T, 3, 0, 0); } - Store__44_s = _s.lnk; + Store__43_s = _s.lnk; } void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index dc149133..c7c8d20f 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 669a337a..9ab993c9 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 809a6082..3de3605c 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index b9ca8d5a..213abf27 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 6a31ee74..4278a34c 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 3b84a5bd..ffd8b03e 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 319659fe..6db13d09 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index d438eca9..4259cfef 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 29fc1e9a..2d13a80b 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -69,6 +69,9 @@ static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); static void Files_Deregister (CHAR *name, ADDRESS name__len); +export void Files_DumpBuffer (Files_Buffer b, INT16 indent); +export void Files_DumpFile (Files_File f, INT16 indent); +export void Files_DumpRider (Files_Rider r, INT16 indent); static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len); @@ -99,6 +102,7 @@ export void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__l static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len); export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); export void Files_SetSearchPath (CHAR *path, ADDRESS path__len); +static void Files_Spaces (INT16 i); export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); @@ -111,7 +115,132 @@ export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); #define Files_IdxTrap() __HALT(-1) -#define Files_ToAdr(x) (ADDRESS)x + +static void Files_Spaces (INT16 i) +{ + while (i > 0) { + Out_String((CHAR*)" ", 3); + i -= 1; + } +} + +void Files_DumpFile (Files_File f, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"workName: ", 15); + Out_String(f->workName, 101); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"registerName: ", 15); + Out_String(f->registerName, 101); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"tempFile: ", 15); + if (f->tempFile) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"identity: ", 15); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"fd: ", 15); + Out_Int(f->fd, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"len, ", 15); + Out_Int(f->len, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"pos: ", 15); + Out_Int(f->pos, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"bufs: ", 15); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"swapper: ", 15); + Out_Int(f->swapper, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"state: ", 15); + Out_Int(f->state, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"next: ", 15); + Out_Int((INT64)(ADDRESS)f->next, 1); + Out_Ln(); +} + +void Files_DumpBuffer (Files_Buffer b, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"chg: ", 7); + if (b->chg) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"org: ", 7); + Out_Int(b->org, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"size: ", 7); + Out_Int(b->size, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"data: ", 7); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"f: ", 7); + if (b->f == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Files_DumpFile(b->f, indent + 1); + } +} + +void Files_DumpRider (Files_Rider r, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"res: ", 9); + Out_Int(r.res, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"eof: ", 9); + if (r.eof) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"org: ", 9); + Out_Int(r.org, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"offset: ", 9); + Out_Int(r.offset, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"buf: ", 9); + if (r.buf == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Files_DumpBuffer(r.buf, indent + 1); + } +} static void Files_Assert (BOOLEAN truth) { @@ -661,7 +790,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x } else { min = n; } - __MOVE((ADDRESS)buf->data + Files_ToAdr(offset), (ADDRESS)x + Files_ToAdr(xpos), min); + __MOVE((ADDRESS)&buf->data[offset], (ADDRESS)&x[xpos], min); offset += min; (*r).offset = offset; xpos += min; @@ -724,7 +853,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS } else { min = n; } - __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); + __MOVE((ADDRESS)&x[xpos], (ADDRESS)&buf->data[offset], min); offset += min; (*r).offset = offset; Files_Assert(offset <= 4096); diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 187a00f5..bb6e46df 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,10 +1,19 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h #include "SYSTEM.h" +typedef + struct Files_BufDesc { + INT64 _prvt0; + char _prvt1[4108]; + } Files_BufDesc; + +typedef + Files_BufDesc *Files_Buffer; + typedef struct Files_FileDesc *Files_File; @@ -25,12 +34,16 @@ typedef import ADDRESS *Files_FileDesc__typ; +import ADDRESS *Files_BufDesc__typ; import ADDRESS *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); import void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); import void Files_Close (Files_File f); import void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); +import void Files_DumpBuffer (Files_Buffer b, INT16 indent); +import void Files_DumpFile (Files_File f, INT16 indent); +import void Files_DumpRider (Files_Rider r, INT16 indent); import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); import void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len); import INT32 Files_Length (Files_File f); diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 79d83cee..4554feac 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 29a878c2..0fb80f05 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 10aa7f62..eb227d08 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 162947ee..3ee70401 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index a7d429eb..d83386eb 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index a49077b0..feb85d73 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 89ef22dc..ab01642c 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index b30a2315..f742f265 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 5b3cc3c5..1335c494 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index d1c71f13..621dfb51 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index a529c16e..3f9dfde3 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index c82b4d80..c1fe21fb 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index a3b32b0c..4569c80d 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 99c62664..c0707c34 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 0bca4ab5..07f8f535 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 1aec7cad..6b2b0929 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 097c0a7c..4506267a 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 9ad5508d..d363f022 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index fd578128..a647f77d 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index a3f5db4d..8c7a5774 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 5a5984c0..51a8fde7 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 9ea581aa..56fab736 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 8ba81525..f5ee1490 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 0fe868e0..6d0ec38b 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index a6a802c4..4ee2fc23 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index bec035c4..ae281477 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index eba58f8f..1afb5eba 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -194,7 +194,6 @@ export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); static void Texts_DumpElem (Texts_Elem e); export void Texts_DumpReader (Texts_Reader re); -static void Texts_DumpRider (Files_Rider ri); static void Texts_DumpRun (Texts_Run ru); static void Texts_DumpText (Texts_Text t); export Texts_Text Texts_ElemBase (Texts_Elem E); @@ -278,20 +277,6 @@ static void Texts_DumpElem (Texts_Elem e) } } -static void Texts_DumpRider (Files_Rider ri) -{ - Out_String((CHAR*)" res: ", 10); - Out_Int(ri.res, 1); - Out_Ln(); - Out_String((CHAR*)" eof: ", 10); - if (ri.eof) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); -} - static void Texts_DumpRun (Texts_Run ru) { Out_String((CHAR*)" prev: ", 12); @@ -365,7 +350,7 @@ void Texts_DumpReader (Texts_Reader re) } Out_String((CHAR*)" rider: ", 10); Out_Ln(); - Texts_DumpRider(re.rider); + Files_DumpRider(re.rider, 2); Out_String((CHAR*)" run: ", 10); if (re.run == NIL) { Out_String((CHAR*)"", 6); @@ -860,32 +845,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p (*S).nextCh = ' '; } -static struct Scan__36 { +static struct Scan__35 { Texts_Scanner *S; ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; INT16 *e; - struct Scan__36 *lnk; -} *Scan__36_s; + struct Scan__35 *lnk; +} *Scan__35_s; -static void ReadScaleFactor__37 (void); +static void ReadScaleFactor__36 (void); -static void ReadScaleFactor__37 (void) +static void ReadScaleFactor__36 (void) { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); - if (*Scan__36_s->ch == '-') { - *Scan__36_s->negE = 1; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); + if (*Scan__35_s->ch == '-') { + *Scan__35_s->negE = 1; + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } else { - *Scan__36_s->negE = 0; - if (*Scan__36_s->ch == '+') { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + *Scan__35_s->negE = 0; + if (*Scan__35_s->ch == '+') { + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } } - while (('0' <= *Scan__36_s->ch && *Scan__36_s->ch <= '9')) { - *Scan__36_s->e = (*Scan__36_s->e * 10 + (INT16)*Scan__36_s->ch) - 48; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + while (('0' <= *Scan__35_s->ch && *Scan__35_s->ch <= '9')) { + *Scan__35_s->e = (*Scan__35_s->e * 10 + (INT16)*Scan__35_s->ch) - 48; + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } } @@ -899,13 +884,13 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) REAL x, f; LONGREAL y, g; CHAR d[32]; - struct Scan__36 _s; + struct Scan__35 _s; _s.S = S; _s.S__typ = S__typ; _s.ch = &ch; _s.negE = &negE; _s.e = &e; - _s.lnk = Scan__36_s; - Scan__36_s = &_s; + _s.lnk = Scan__35_s; + Scan__35_s = &_s; ch = (*S).nextCh; i = 0; for (;;) { @@ -1006,7 +991,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } - ReadScaleFactor__37(); + ReadScaleFactor__36(); if (negE) { if (e <= 308) { y = y / (LONGREAL)Reals_TenL(e); @@ -1039,7 +1024,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) j += 1; } if (ch == 'E') { - ReadScaleFactor__37(); + ReadScaleFactor__36(); } if (negE) { if (e <= 38) { @@ -1092,7 +1077,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) } } (*S).nextCh = ch; - Scan__36_s = _s.lnk; + Scan__35_s = _s.lnk; } void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) @@ -1311,30 +1296,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } } -static struct WriteRealFix__58 { +static struct WriteRealFix__57 { Texts_Writer *W; ADDRESS *W__typ; INT16 *i; CHAR (*d)[9]; - struct WriteRealFix__58 *lnk; -} *WriteRealFix__58_s; + struct WriteRealFix__57 *lnk; +} *WriteRealFix__57_s; -static void dig__59 (INT16 n); -static void seq__61 (CHAR ch, INT16 n); +static void dig__58 (INT16 n); +static void seq__60 (CHAR ch, INT16 n); -static void seq__61 (CHAR ch, INT16 n) +static void seq__60 (CHAR ch, INT16 n) { while (n > 0) { - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch); + Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, ch); n -= 1; } } -static void dig__59 (INT16 n) +static void dig__58 (INT16 n) { while (n > 0) { - *WriteRealFix__58_s->i -= 1; - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, (*WriteRealFix__58_s->d)[__X(*WriteRealFix__58_s->i, 9)]); + *WriteRealFix__57_s->i -= 1; + Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, (*WriteRealFix__57_s->d)[__X(*WriteRealFix__57_s->i, 9)]); n -= 1; } } @@ -1345,23 +1330,23 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 CHAR sign; REAL x0; CHAR d[9]; - struct WriteRealFix__58 _s; + struct WriteRealFix__57 _s; _s.W = W; _s.W__typ = W__typ; _s.i = &i; _s.d = (void*)d; - _s.lnk = WriteRealFix__58_s; - WriteRealFix__58_s = &_s; + _s.lnk = WriteRealFix__57_s; + WriteRealFix__57_s = &_s; e = Reals_Expo(x); if (k < 0) { k = 0; } if (e == 0) { - seq__61(' ', (n - k) - 2); + seq__60(' ', (n - k) - 2); Texts_Write(&*W, W__typ, '0'); - seq__61(' ', k + 1); + seq__60(' ', k + 1); } else if (e == 255) { Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); - seq__61(' ', n - 4); + seq__60(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); if (x < (REAL)0) { @@ -1394,21 +1379,21 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 i = k + e; Reals_Convert(x, i, (void*)d, 9); if (e > 0) { - seq__61(' ', ((n - e) - k) - 2); + seq__60(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); - dig__59(e); + dig__58(e); Texts_Write(&*W, W__typ, '.'); - dig__59(k); + dig__58(k); } else { - seq__61(' ', (n - k) - 3); + seq__60(' ', (n - k) - 3); Texts_Write(&*W, W__typ, sign); Texts_Write(&*W, W__typ, '0'); Texts_Write(&*W, W__typ, '.'); - seq__61('0', -e); - dig__59(k + e); + seq__60('0', -e); + dig__58(k + e); } } - WriteRealFix__58_s = _s.lnk; + WriteRealFix__57_s = _s.lnk; } void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) @@ -1507,48 +1492,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) } while (!(i == 16)); } -static struct WriteDate__48 { +static struct WriteDate__47 { Texts_Writer *W; ADDRESS *W__typ; - struct WriteDate__48 *lnk; -} *WriteDate__48_s; + struct WriteDate__47 *lnk; +} *WriteDate__47_s; -static void WritePair__49 (CHAR ch, INT32 x); +static void WritePair__48 (CHAR ch, INT32 x); -static void WritePair__49 (CHAR ch, INT32 x) +static void WritePair__48 (CHAR ch, INT32 x) { - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, ch); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, ch); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { - struct WriteDate__48 _s; + struct WriteDate__47 _s; _s.W = W; _s.W__typ = W__typ; - _s.lnk = WriteDate__48_s; - WriteDate__48_s = &_s; - WritePair__49(' ', __MASK(d, -32)); - WritePair__49('.', __MASK(__ASHR(d, 5), -16)); - WritePair__49('.', __MASK(__ASHR(d, 9), -128)); - WritePair__49(' ', __MASK(__ASHR(t, 12), -32)); - WritePair__49(':', __MASK(__ASHR(t, 6), -64)); - WritePair__49(':', __MASK(t, -64)); - WriteDate__48_s = _s.lnk; + _s.lnk = WriteDate__47_s; + WriteDate__47_s = &_s; + WritePair__48(' ', __MASK(d, -32)); + WritePair__48('.', __MASK(__ASHR(d, 5), -16)); + WritePair__48('.', __MASK(__ASHR(d, 9), -128)); + WritePair__48(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__48(':', __MASK(__ASHR(t, 6), -64)); + WritePair__48(':', __MASK(t, -64)); + WriteDate__47_s = _s.lnk; } -static struct Load0__21 { +static struct Load0__20 { Texts_Text *T; INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Load0__21 *lnk; -} *Load0__21_s; + struct Load0__20 *lnk; +} *Load0__20_s; -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); +static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) +static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1559,15 +1544,15 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); Files_Read(&*r, r__typ, (void*)&eno); - if (eno > *Load0__21_s->ecnt) { - *Load0__21_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->mods)[__X(eno, 64)], 32); - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->procs)[__X(eno, 64)], 32); + if (eno > *Load0__20_s->ecnt) { + *Load0__20_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__21_s->mods)[__X(eno, 64)], 32); + M = Modules_ThisMod((*Load0__20_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__21_s->procs)[__X(eno, 64)], 32); + Cmd = Modules_ThisCommand(M, (*Load0__20_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1576,25 +1561,25 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span if (*e != NIL) { (*e)->W = ew; (*e)->H = eh; - (*e)->base = *Load0__21_s->T; - (*Load0__21_s->msg).pos = pos; - (*(*e)->handle)(*e, (void*)&*Load0__21_s->msg, Texts_FileMsg__typ); + (*e)->base = *Load0__20_s->T; + (*Load0__20_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__20_s->msg, Texts_FileMsg__typ); if (Files_Pos(&*r, r__typ) != org + span) { *e = NIL; } } if (*e == NIL) { - Files_Set(&*r, r__typ, *Load0__21_s->f, org + span); + Files_Set(&*r, r__typ, *Load0__20_s->f, org + span); __NEW(a, Texts__1); a->W = ew; a->H = eh; a->handle = Texts_HandleAlien; - a->base = *Load0__21_s->T; - a->file = *Load0__21_s->f; + a->base = *Load0__20_s->T; + a->file = *Load0__20_s->f; a->org = org; a->span = span; - __COPY((*Load0__21_s->mods)[__X(eno, 64)], a->mod, 32); - __COPY((*Load0__21_s->procs)[__X(eno, 64)], a->proc, 32); + __COPY((*Load0__20_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__20_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1611,15 +1596,15 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; CHAR name[32]; Texts_FontsFont fnts[32]; - struct Load0__21 _s; + struct Load0__20 _s; _s.T = &T; _s.ecnt = &ecnt; _s.f = &f; _s.msg = &msg; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Load0__21_s; - Load0__21_s = &_s; + _s.lnk = Load0__20_s; + Load0__20_s = &_s; pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); @@ -1652,7 +1637,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) un = (Texts_Run)p; un->len = plen; } else { - LoadElem__22(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + LoadElem__21(&msg.r, Files_Rider__typ, pos - org, -plen, &e); un = (Texts_Run)e; un->len = 1; } @@ -1670,7 +1655,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) T->corg = 0; Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); - Load0__21_s = _s.lnk; + Load0__20_s = _s.lnk; } void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) @@ -1739,25 +1724,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) __DEL(name); } -static struct Store__44 { +static struct Store__43 { INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Store__44 *lnk; -} *Store__44_s; + struct Store__43 *lnk; +} *Store__43_s; -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); +static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) +static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; INT32 org, span; INT8 eno; - __COPY((*Store__44_s->iden).mod, (*Store__44_s->mods)[__X(*Store__44_s->ecnt, 64)], 32); - __COPY((*Store__44_s->iden).proc, (*Store__44_s->procs)[__X(*Store__44_s->ecnt, 64)], 32); + __COPY((*Store__43_s->iden).mod, (*Store__43_s->mods)[__X(*Store__43_s->ecnt, 64)], 32); + __COPY((*Store__43_s->iden).proc, (*Store__43_s->procs)[__X(*Store__43_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__44_s->mods)[__X(eno, 64)], (*Store__44_s->iden).mod) != 0 || __STRCMP((*Store__44_s->procs)[__X(eno, 64)], (*Store__44_s->iden).proc) != 0) { + while (__STRCMP((*Store__43_s->mods)[__X(eno, 64)], (*Store__43_s->iden).mod) != 0 || __STRCMP((*Store__43_s->procs)[__X(eno, 64)], (*Store__43_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); @@ -1765,14 +1750,14 @@ static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Ele Files_WriteLInt(&*r, r__typ, 0); Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); - if (eno == *Store__44_s->ecnt) { - *Store__44_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).mod, 32); - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).proc, 32); + if (eno == *Store__43_s->ecnt) { + *Store__43_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__43_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__43_s->iden).proc, 32); } - (*Store__44_s->msg).pos = pos; + (*Store__43_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); - (*e->handle)(e, (void*)&*Store__44_s->msg, Texts_FileMsg__typ); + (*e->handle)(e, (void*)&*Store__43_s->msg, Texts_FileMsg__typ); span = Files_Pos(&*r, r__typ) - org; Files_WriteLInt(&r1, Files_Rider__typ, -span); Files_WriteLInt(&r1, Files_Rider__typ, e->W); @@ -1793,14 +1778,14 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; Texts_FontsFont fnts[32]; CHAR block[1024]; - struct Store__44 _s; + struct Store__43 _s; _s.ecnt = &ecnt; _s.msg = &msg; _s.iden = &iden; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Store__44_s; - Store__44_s = &_s; + _s.lnk = Store__43_s; + Store__43_s = &_s; org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; @@ -1842,7 +1827,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) pos += rlen; u = un; } else if (iden.mod[0] != 0x00) { - StoreElem__45(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + StoreElem__44(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); pos += 1; u = u->next; } else { @@ -1896,7 +1881,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) if (T->notify != NIL) { (*T->notify)(T, 3, 0, 0); } - Store__44_s = _s.lnk; + Store__43_s = _s.lnk; } void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 55558804..e14afb26 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 669a337a..9ab993c9 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 809a6082..3de3605c 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index b9ca8d5a..213abf27 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 6a31ee74..4278a34c 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 3b84a5bd..ffd8b03e 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 319659fe..6db13d09 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index d438eca9..4259cfef 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 6db7dd4d..3e1b5ecd 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -69,6 +69,9 @@ static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); static void Files_Deregister (CHAR *name, ADDRESS name__len); +export void Files_DumpBuffer (Files_Buffer b, INT16 indent); +export void Files_DumpFile (Files_File f, INT16 indent); +export void Files_DumpRider (Files_Rider r, INT16 indent); static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len); @@ -99,6 +102,7 @@ export void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__l static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len); export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); export void Files_SetSearchPath (CHAR *path, ADDRESS path__len); +static void Files_Spaces (INT16 i); export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); @@ -111,7 +115,132 @@ export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); #define Files_IdxTrap() __HALT(-1) -#define Files_ToAdr(x) (ADDRESS)x + +static void Files_Spaces (INT16 i) +{ + while (i > 0) { + Out_String((CHAR*)" ", 3); + i -= 1; + } +} + +void Files_DumpFile (Files_File f, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"workName: ", 15); + Out_String(f->workName, 101); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"registerName: ", 15); + Out_String(f->registerName, 101); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"tempFile: ", 15); + if (f->tempFile) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"identity: ", 15); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"fd: ", 15); + Out_Int(f->fd, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"len, ", 15); + Out_Int(f->len, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"pos: ", 15); + Out_Int(f->pos, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"bufs: ", 15); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"swapper: ", 15); + Out_Int(f->swapper, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"state: ", 15); + Out_Int(f->state, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"next: ", 15); + Out_Int((INT32)(ADDRESS)f->next, 1); + Out_Ln(); +} + +void Files_DumpBuffer (Files_Buffer b, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"chg: ", 7); + if (b->chg) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"org: ", 7); + Out_Int(b->org, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"size: ", 7); + Out_Int(b->size, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"data: ", 7); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"f: ", 7); + if (b->f == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Files_DumpFile(b->f, indent + 1); + } +} + +void Files_DumpRider (Files_Rider r, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"res: ", 9); + Out_Int(r.res, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"eof: ", 9); + if (r.eof) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"org: ", 9); + Out_Int(r.org, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"offset: ", 9); + Out_Int(r.offset, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"buf: ", 9); + if (r.buf == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Files_DumpBuffer(r.buf, indent + 1); + } +} static void Files_Assert (BOOLEAN truth) { @@ -661,7 +790,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x } else { min = n; } - __MOVE((ADDRESS)buf->data + Files_ToAdr(offset), (ADDRESS)x + Files_ToAdr(xpos), min); + __MOVE((ADDRESS)&buf->data[offset], (ADDRESS)&x[xpos], min); offset += min; (*r).offset = offset; xpos += min; @@ -724,7 +853,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS } else { min = n; } - __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); + __MOVE((ADDRESS)&x[xpos], (ADDRESS)&buf->data[offset], min); offset += min; (*r).offset = offset; Files_Assert(offset <= 4096); diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index aa177fb4..dfeeebb3 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,10 +1,19 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h #include "SYSTEM.h" +typedef + struct Files_BufDesc { + INT32 _prvt0; + char _prvt1[4108]; + } Files_BufDesc; + +typedef + Files_BufDesc *Files_Buffer; + typedef struct Files_FileDesc *Files_File; @@ -24,12 +33,16 @@ typedef import ADDRESS *Files_FileDesc__typ; +import ADDRESS *Files_BufDesc__typ; import ADDRESS *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); import void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); import void Files_Close (Files_File f); import void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); +import void Files_DumpBuffer (Files_Buffer b, INT16 indent); +import void Files_DumpFile (Files_File f, INT16 indent); +import void Files_DumpRider (Files_Rider r, INT16 indent); import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); import void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len); import INT32 Files_Length (Files_File f); diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index a3bcc604..125a2854 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index b5a1e4c3..e794a4a3 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 4a04e15a..ab668fec 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 4cecc8b9..553f80ed 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index a7d429eb..d83386eb 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index a49077b0..feb85d73 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 89ef22dc..ab01642c 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index b30a2315..f742f265 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 0c8ab9b3..a6c7a5cd 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index d1c71f13..621dfb51 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index dfca5a85..383b6d65 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index c82b4d80..c1fe21fb 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index a3b32b0c..4569c80d 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 99c62664..c0707c34 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 6edc4b6a..0d32553a 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 1aec7cad..6b2b0929 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 1e66dbde..42081077 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 9ad5508d..d363f022 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 1f466dc9..52896b61 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index a3f5db4d..8c7a5774 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index eb23ff1d..43a2c695 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index ce0d19ba..ddc997ca 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 8ba81525..f5ee1490 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 0fe868e0..6d0ec38b 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index a6a802c4..4ee2fc23 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index bec035c4..ae281477 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index d1a7f696..9016dbc8 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -194,7 +194,6 @@ export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); static void Texts_DumpElem (Texts_Elem e); export void Texts_DumpReader (Texts_Reader re); -static void Texts_DumpRider (Files_Rider ri); static void Texts_DumpRun (Texts_Run ru); static void Texts_DumpText (Texts_Text t); export Texts_Text Texts_ElemBase (Texts_Elem E); @@ -278,20 +277,6 @@ static void Texts_DumpElem (Texts_Elem e) } } -static void Texts_DumpRider (Files_Rider ri) -{ - Out_String((CHAR*)" res: ", 10); - Out_Int(ri.res, 1); - Out_Ln(); - Out_String((CHAR*)" eof: ", 10); - if (ri.eof) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); -} - static void Texts_DumpRun (Texts_Run ru) { Out_String((CHAR*)" prev: ", 12); @@ -365,7 +350,7 @@ void Texts_DumpReader (Texts_Reader re) } Out_String((CHAR*)" rider: ", 10); Out_Ln(); - Texts_DumpRider(re.rider); + Files_DumpRider(re.rider, 2); Out_String((CHAR*)" run: ", 10); if (re.run == NIL) { Out_String((CHAR*)"", 6); @@ -860,32 +845,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p (*S).nextCh = ' '; } -static struct Scan__36 { +static struct Scan__35 { Texts_Scanner *S; ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; INT16 *e; - struct Scan__36 *lnk; -} *Scan__36_s; + struct Scan__35 *lnk; +} *Scan__35_s; -static void ReadScaleFactor__37 (void); +static void ReadScaleFactor__36 (void); -static void ReadScaleFactor__37 (void) +static void ReadScaleFactor__36 (void) { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); - if (*Scan__36_s->ch == '-') { - *Scan__36_s->negE = 1; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); + if (*Scan__35_s->ch == '-') { + *Scan__35_s->negE = 1; + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } else { - *Scan__36_s->negE = 0; - if (*Scan__36_s->ch == '+') { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + *Scan__35_s->negE = 0; + if (*Scan__35_s->ch == '+') { + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } } - while (('0' <= *Scan__36_s->ch && *Scan__36_s->ch <= '9')) { - *Scan__36_s->e = (*Scan__36_s->e * 10 + (INT16)*Scan__36_s->ch) - 48; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + while (('0' <= *Scan__35_s->ch && *Scan__35_s->ch <= '9')) { + *Scan__35_s->e = (*Scan__35_s->e * 10 + (INT16)*Scan__35_s->ch) - 48; + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } } @@ -899,13 +884,13 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) REAL x, f; LONGREAL y, g; CHAR d[32]; - struct Scan__36 _s; + struct Scan__35 _s; _s.S = S; _s.S__typ = S__typ; _s.ch = &ch; _s.negE = &negE; _s.e = &e; - _s.lnk = Scan__36_s; - Scan__36_s = &_s; + _s.lnk = Scan__35_s; + Scan__35_s = &_s; ch = (*S).nextCh; i = 0; for (;;) { @@ -1006,7 +991,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } - ReadScaleFactor__37(); + ReadScaleFactor__36(); if (negE) { if (e <= 308) { y = y / (LONGREAL)Reals_TenL(e); @@ -1039,7 +1024,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) j += 1; } if (ch == 'E') { - ReadScaleFactor__37(); + ReadScaleFactor__36(); } if (negE) { if (e <= 38) { @@ -1092,7 +1077,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) } } (*S).nextCh = ch; - Scan__36_s = _s.lnk; + Scan__35_s = _s.lnk; } void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) @@ -1311,30 +1296,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } } -static struct WriteRealFix__58 { +static struct WriteRealFix__57 { Texts_Writer *W; ADDRESS *W__typ; INT16 *i; CHAR (*d)[9]; - struct WriteRealFix__58 *lnk; -} *WriteRealFix__58_s; + struct WriteRealFix__57 *lnk; +} *WriteRealFix__57_s; -static void dig__59 (INT16 n); -static void seq__61 (CHAR ch, INT16 n); +static void dig__58 (INT16 n); +static void seq__60 (CHAR ch, INT16 n); -static void seq__61 (CHAR ch, INT16 n) +static void seq__60 (CHAR ch, INT16 n) { while (n > 0) { - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch); + Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, ch); n -= 1; } } -static void dig__59 (INT16 n) +static void dig__58 (INT16 n) { while (n > 0) { - *WriteRealFix__58_s->i -= 1; - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, (*WriteRealFix__58_s->d)[__X(*WriteRealFix__58_s->i, 9)]); + *WriteRealFix__57_s->i -= 1; + Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, (*WriteRealFix__57_s->d)[__X(*WriteRealFix__57_s->i, 9)]); n -= 1; } } @@ -1345,23 +1330,23 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 CHAR sign; REAL x0; CHAR d[9]; - struct WriteRealFix__58 _s; + struct WriteRealFix__57 _s; _s.W = W; _s.W__typ = W__typ; _s.i = &i; _s.d = (void*)d; - _s.lnk = WriteRealFix__58_s; - WriteRealFix__58_s = &_s; + _s.lnk = WriteRealFix__57_s; + WriteRealFix__57_s = &_s; e = Reals_Expo(x); if (k < 0) { k = 0; } if (e == 0) { - seq__61(' ', (n - k) - 2); + seq__60(' ', (n - k) - 2); Texts_Write(&*W, W__typ, '0'); - seq__61(' ', k + 1); + seq__60(' ', k + 1); } else if (e == 255) { Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); - seq__61(' ', n - 4); + seq__60(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); if (x < (REAL)0) { @@ -1394,21 +1379,21 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 i = k + e; Reals_Convert(x, i, (void*)d, 9); if (e > 0) { - seq__61(' ', ((n - e) - k) - 2); + seq__60(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); - dig__59(e); + dig__58(e); Texts_Write(&*W, W__typ, '.'); - dig__59(k); + dig__58(k); } else { - seq__61(' ', (n - k) - 3); + seq__60(' ', (n - k) - 3); Texts_Write(&*W, W__typ, sign); Texts_Write(&*W, W__typ, '0'); Texts_Write(&*W, W__typ, '.'); - seq__61('0', -e); - dig__59(k + e); + seq__60('0', -e); + dig__58(k + e); } } - WriteRealFix__58_s = _s.lnk; + WriteRealFix__57_s = _s.lnk; } void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) @@ -1507,48 +1492,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) } while (!(i == 16)); } -static struct WriteDate__48 { +static struct WriteDate__47 { Texts_Writer *W; ADDRESS *W__typ; - struct WriteDate__48 *lnk; -} *WriteDate__48_s; + struct WriteDate__47 *lnk; +} *WriteDate__47_s; -static void WritePair__49 (CHAR ch, INT32 x); +static void WritePair__48 (CHAR ch, INT32 x); -static void WritePair__49 (CHAR ch, INT32 x) +static void WritePair__48 (CHAR ch, INT32 x) { - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, ch); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, ch); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { - struct WriteDate__48 _s; + struct WriteDate__47 _s; _s.W = W; _s.W__typ = W__typ; - _s.lnk = WriteDate__48_s; - WriteDate__48_s = &_s; - WritePair__49(' ', __MASK(d, -32)); - WritePair__49('.', __MASK(__ASHR(d, 5), -16)); - WritePair__49('.', __MASK(__ASHR(d, 9), -128)); - WritePair__49(' ', __MASK(__ASHR(t, 12), -32)); - WritePair__49(':', __MASK(__ASHR(t, 6), -64)); - WritePair__49(':', __MASK(t, -64)); - WriteDate__48_s = _s.lnk; + _s.lnk = WriteDate__47_s; + WriteDate__47_s = &_s; + WritePair__48(' ', __MASK(d, -32)); + WritePair__48('.', __MASK(__ASHR(d, 5), -16)); + WritePair__48('.', __MASK(__ASHR(d, 9), -128)); + WritePair__48(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__48(':', __MASK(__ASHR(t, 6), -64)); + WritePair__48(':', __MASK(t, -64)); + WriteDate__47_s = _s.lnk; } -static struct Load0__21 { +static struct Load0__20 { Texts_Text *T; INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Load0__21 *lnk; -} *Load0__21_s; + struct Load0__20 *lnk; +} *Load0__20_s; -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); +static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) +static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1559,15 +1544,15 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); Files_Read(&*r, r__typ, (void*)&eno); - if (eno > *Load0__21_s->ecnt) { - *Load0__21_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->mods)[__X(eno, 64)], 32); - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->procs)[__X(eno, 64)], 32); + if (eno > *Load0__20_s->ecnt) { + *Load0__20_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__21_s->mods)[__X(eno, 64)], 32); + M = Modules_ThisMod((*Load0__20_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__21_s->procs)[__X(eno, 64)], 32); + Cmd = Modules_ThisCommand(M, (*Load0__20_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1576,25 +1561,25 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span if (*e != NIL) { (*e)->W = ew; (*e)->H = eh; - (*e)->base = *Load0__21_s->T; - (*Load0__21_s->msg).pos = pos; - (*(*e)->handle)(*e, (void*)&*Load0__21_s->msg, Texts_FileMsg__typ); + (*e)->base = *Load0__20_s->T; + (*Load0__20_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__20_s->msg, Texts_FileMsg__typ); if (Files_Pos(&*r, r__typ) != org + span) { *e = NIL; } } if (*e == NIL) { - Files_Set(&*r, r__typ, *Load0__21_s->f, org + span); + Files_Set(&*r, r__typ, *Load0__20_s->f, org + span); __NEW(a, Texts__1); a->W = ew; a->H = eh; a->handle = Texts_HandleAlien; - a->base = *Load0__21_s->T; - a->file = *Load0__21_s->f; + a->base = *Load0__20_s->T; + a->file = *Load0__20_s->f; a->org = org; a->span = span; - __COPY((*Load0__21_s->mods)[__X(eno, 64)], a->mod, 32); - __COPY((*Load0__21_s->procs)[__X(eno, 64)], a->proc, 32); + __COPY((*Load0__20_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__20_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1611,15 +1596,15 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; CHAR name[32]; Texts_FontsFont fnts[32]; - struct Load0__21 _s; + struct Load0__20 _s; _s.T = &T; _s.ecnt = &ecnt; _s.f = &f; _s.msg = &msg; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Load0__21_s; - Load0__21_s = &_s; + _s.lnk = Load0__20_s; + Load0__20_s = &_s; pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); @@ -1652,7 +1637,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) un = (Texts_Run)p; un->len = plen; } else { - LoadElem__22(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + LoadElem__21(&msg.r, Files_Rider__typ, pos - org, -plen, &e); un = (Texts_Run)e; un->len = 1; } @@ -1670,7 +1655,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) T->corg = 0; Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); - Load0__21_s = _s.lnk; + Load0__20_s = _s.lnk; } void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) @@ -1739,25 +1724,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) __DEL(name); } -static struct Store__44 { +static struct Store__43 { INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Store__44 *lnk; -} *Store__44_s; + struct Store__43 *lnk; +} *Store__43_s; -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); +static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) +static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; INT32 org, span; INT8 eno; - __COPY((*Store__44_s->iden).mod, (*Store__44_s->mods)[__X(*Store__44_s->ecnt, 64)], 32); - __COPY((*Store__44_s->iden).proc, (*Store__44_s->procs)[__X(*Store__44_s->ecnt, 64)], 32); + __COPY((*Store__43_s->iden).mod, (*Store__43_s->mods)[__X(*Store__43_s->ecnt, 64)], 32); + __COPY((*Store__43_s->iden).proc, (*Store__43_s->procs)[__X(*Store__43_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__44_s->mods)[__X(eno, 64)], (*Store__44_s->iden).mod) != 0 || __STRCMP((*Store__44_s->procs)[__X(eno, 64)], (*Store__44_s->iden).proc) != 0) { + while (__STRCMP((*Store__43_s->mods)[__X(eno, 64)], (*Store__43_s->iden).mod) != 0 || __STRCMP((*Store__43_s->procs)[__X(eno, 64)], (*Store__43_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); @@ -1765,14 +1750,14 @@ static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Ele Files_WriteLInt(&*r, r__typ, 0); Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); - if (eno == *Store__44_s->ecnt) { - *Store__44_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).mod, 32); - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).proc, 32); + if (eno == *Store__43_s->ecnt) { + *Store__43_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__43_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__43_s->iden).proc, 32); } - (*Store__44_s->msg).pos = pos; + (*Store__43_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); - (*e->handle)(e, (void*)&*Store__44_s->msg, Texts_FileMsg__typ); + (*e->handle)(e, (void*)&*Store__43_s->msg, Texts_FileMsg__typ); span = Files_Pos(&*r, r__typ) - org; Files_WriteLInt(&r1, Files_Rider__typ, -span); Files_WriteLInt(&r1, Files_Rider__typ, e->W); @@ -1793,14 +1778,14 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; Texts_FontsFont fnts[32]; CHAR block[1024]; - struct Store__44 _s; + struct Store__43 _s; _s.ecnt = &ecnt; _s.msg = &msg; _s.iden = &iden; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Store__44_s; - Store__44_s = &_s; + _s.lnk = Store__43_s; + Store__43_s = &_s; org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; @@ -1842,7 +1827,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) pos += rlen; u = un; } else if (iden.mod[0] != 0x00) { - StoreElem__45(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + StoreElem__44(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); pos += 1; u = u->next; } else { @@ -1896,7 +1881,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) if (T->notify != NIL) { (*T->notify)(T, 3, 0, 0); } - Store__44_s = _s.lnk; + Store__43_s = _s.lnk; } void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index dc149133..c7c8d20f 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 669a337a..9ab993c9 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 809a6082..3de3605c 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index b9ca8d5a..213abf27 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 6a31ee74..4278a34c 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 3b84a5bd..ffd8b03e 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 319659fe..6db13d09 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index d438eca9..4259cfef 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 1f47f261..072b15ba 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -70,6 +70,9 @@ static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); static void Files_Deregister (CHAR *name, ADDRESS name__len); +export void Files_DumpBuffer (Files_Buffer b, INT16 indent); +export void Files_DumpFile (Files_File f, INT16 indent); +export void Files_DumpRider (Files_Rider r, INT16 indent); static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len); @@ -100,6 +103,7 @@ export void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__l static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len); export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); export void Files_SetSearchPath (CHAR *path, ADDRESS path__len); +static void Files_Spaces (INT16 i); export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); @@ -112,7 +116,132 @@ export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); #define Files_IdxTrap() __HALT(-1) -#define Files_ToAdr(x) (ADDRESS)x + +static void Files_Spaces (INT16 i) +{ + while (i > 0) { + Out_String((CHAR*)" ", 3); + i -= 1; + } +} + +void Files_DumpFile (Files_File f, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"workName: ", 15); + Out_String(f->workName, 101); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"registerName: ", 15); + Out_String(f->registerName, 101); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"tempFile: ", 15); + if (f->tempFile) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"identity: ", 15); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"fd: ", 15); + Out_Int(f->fd, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"len, ", 15); + Out_Int(f->len, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"pos: ", 15); + Out_Int(f->pos, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"bufs: ", 15); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"swapper: ", 15); + Out_Int(f->swapper, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"state: ", 15); + Out_Int(f->state, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"next: ", 15); + Out_Int((INT64)(ADDRESS)f->next, 1); + Out_Ln(); +} + +void Files_DumpBuffer (Files_Buffer b, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"chg: ", 7); + if (b->chg) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"org: ", 7); + Out_Int(b->org, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"size: ", 7); + Out_Int(b->size, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"data: ", 7); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"f: ", 7); + if (b->f == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Files_DumpFile(b->f, indent + 1); + } +} + +void Files_DumpRider (Files_Rider r, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"res: ", 9); + Out_Int(r.res, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"eof: ", 9); + if (r.eof) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"org: ", 9); + Out_Int(r.org, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"offset: ", 9); + Out_Int(r.offset, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"buf: ", 9); + if (r.buf == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Files_DumpBuffer(r.buf, indent + 1); + } +} static void Files_Assert (BOOLEAN truth) { @@ -662,7 +791,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x } else { min = n; } - __MOVE((ADDRESS)buf->data + Files_ToAdr(offset), (ADDRESS)x + Files_ToAdr(xpos), min); + __MOVE((ADDRESS)&buf->data[offset], (ADDRESS)&x[xpos], min); offset += min; (*r).offset = offset; xpos += min; @@ -725,7 +854,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS } else { min = n; } - __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); + __MOVE((ADDRESS)&x[xpos], (ADDRESS)&buf->data[offset], min); offset += min; (*r).offset = offset; Files_Assert(offset <= 4096); diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 683cb78a..49df83be 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,10 +1,19 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h #include "SYSTEM.h" +typedef + struct Files_BufDesc { + INT64 _prvt0; + char _prvt1[4108]; + } Files_BufDesc; + +typedef + Files_BufDesc *Files_Buffer; + typedef struct Files_FileDesc *Files_File; @@ -25,12 +34,16 @@ typedef import ADDRESS *Files_FileDesc__typ; +import ADDRESS *Files_BufDesc__typ; import ADDRESS *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); import void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); import void Files_Close (Files_File f); import void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); +import void Files_DumpBuffer (Files_Buffer b, INT16 indent); +import void Files_DumpFile (Files_File f, INT16 indent); +import void Files_DumpRider (Files_Rider r, INT16 indent); import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); import void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len); import INT32 Files_Length (Files_File f); diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 79d83cee..4554feac 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 29a878c2..0fb80f05 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 83b46a4a..37cfa0cd 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 162947ee..3ee70401 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index a7d429eb..d83386eb 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index a49077b0..feb85d73 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 89ef22dc..ab01642c 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index b30a2315..f742f265 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 5b3cc3c5..1335c494 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index d1c71f13..621dfb51 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index a529c16e..3f9dfde3 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index c82b4d80..c1fe21fb 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index a3b32b0c..4569c80d 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 99c62664..c0707c34 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 0bca4ab5..07f8f535 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 1aec7cad..6b2b0929 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 097c0a7c..4506267a 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 9ad5508d..d363f022 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 1f466dc9..52896b61 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index a3f5db4d..8c7a5774 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 7a37d42c..44691d4d 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 369ea02a..751980ad 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 8ba81525..f5ee1490 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 0fe868e0..6d0ec38b 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index a6a802c4..4ee2fc23 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index bec035c4..ae281477 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index eba58f8f..1afb5eba 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -194,7 +194,6 @@ export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); static void Texts_DumpElem (Texts_Elem e); export void Texts_DumpReader (Texts_Reader re); -static void Texts_DumpRider (Files_Rider ri); static void Texts_DumpRun (Texts_Run ru); static void Texts_DumpText (Texts_Text t); export Texts_Text Texts_ElemBase (Texts_Elem E); @@ -278,20 +277,6 @@ static void Texts_DumpElem (Texts_Elem e) } } -static void Texts_DumpRider (Files_Rider ri) -{ - Out_String((CHAR*)" res: ", 10); - Out_Int(ri.res, 1); - Out_Ln(); - Out_String((CHAR*)" eof: ", 10); - if (ri.eof) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); -} - static void Texts_DumpRun (Texts_Run ru) { Out_String((CHAR*)" prev: ", 12); @@ -365,7 +350,7 @@ void Texts_DumpReader (Texts_Reader re) } Out_String((CHAR*)" rider: ", 10); Out_Ln(); - Texts_DumpRider(re.rider); + Files_DumpRider(re.rider, 2); Out_String((CHAR*)" run: ", 10); if (re.run == NIL) { Out_String((CHAR*)"", 6); @@ -860,32 +845,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p (*S).nextCh = ' '; } -static struct Scan__36 { +static struct Scan__35 { Texts_Scanner *S; ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; INT16 *e; - struct Scan__36 *lnk; -} *Scan__36_s; + struct Scan__35 *lnk; +} *Scan__35_s; -static void ReadScaleFactor__37 (void); +static void ReadScaleFactor__36 (void); -static void ReadScaleFactor__37 (void) +static void ReadScaleFactor__36 (void) { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); - if (*Scan__36_s->ch == '-') { - *Scan__36_s->negE = 1; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); + if (*Scan__35_s->ch == '-') { + *Scan__35_s->negE = 1; + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } else { - *Scan__36_s->negE = 0; - if (*Scan__36_s->ch == '+') { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + *Scan__35_s->negE = 0; + if (*Scan__35_s->ch == '+') { + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } } - while (('0' <= *Scan__36_s->ch && *Scan__36_s->ch <= '9')) { - *Scan__36_s->e = (*Scan__36_s->e * 10 + (INT16)*Scan__36_s->ch) - 48; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + while (('0' <= *Scan__35_s->ch && *Scan__35_s->ch <= '9')) { + *Scan__35_s->e = (*Scan__35_s->e * 10 + (INT16)*Scan__35_s->ch) - 48; + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } } @@ -899,13 +884,13 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) REAL x, f; LONGREAL y, g; CHAR d[32]; - struct Scan__36 _s; + struct Scan__35 _s; _s.S = S; _s.S__typ = S__typ; _s.ch = &ch; _s.negE = &negE; _s.e = &e; - _s.lnk = Scan__36_s; - Scan__36_s = &_s; + _s.lnk = Scan__35_s; + Scan__35_s = &_s; ch = (*S).nextCh; i = 0; for (;;) { @@ -1006,7 +991,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } - ReadScaleFactor__37(); + ReadScaleFactor__36(); if (negE) { if (e <= 308) { y = y / (LONGREAL)Reals_TenL(e); @@ -1039,7 +1024,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) j += 1; } if (ch == 'E') { - ReadScaleFactor__37(); + ReadScaleFactor__36(); } if (negE) { if (e <= 38) { @@ -1092,7 +1077,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) } } (*S).nextCh = ch; - Scan__36_s = _s.lnk; + Scan__35_s = _s.lnk; } void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) @@ -1311,30 +1296,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } } -static struct WriteRealFix__58 { +static struct WriteRealFix__57 { Texts_Writer *W; ADDRESS *W__typ; INT16 *i; CHAR (*d)[9]; - struct WriteRealFix__58 *lnk; -} *WriteRealFix__58_s; + struct WriteRealFix__57 *lnk; +} *WriteRealFix__57_s; -static void dig__59 (INT16 n); -static void seq__61 (CHAR ch, INT16 n); +static void dig__58 (INT16 n); +static void seq__60 (CHAR ch, INT16 n); -static void seq__61 (CHAR ch, INT16 n) +static void seq__60 (CHAR ch, INT16 n) { while (n > 0) { - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch); + Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, ch); n -= 1; } } -static void dig__59 (INT16 n) +static void dig__58 (INT16 n) { while (n > 0) { - *WriteRealFix__58_s->i -= 1; - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, (*WriteRealFix__58_s->d)[__X(*WriteRealFix__58_s->i, 9)]); + *WriteRealFix__57_s->i -= 1; + Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, (*WriteRealFix__57_s->d)[__X(*WriteRealFix__57_s->i, 9)]); n -= 1; } } @@ -1345,23 +1330,23 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 CHAR sign; REAL x0; CHAR d[9]; - struct WriteRealFix__58 _s; + struct WriteRealFix__57 _s; _s.W = W; _s.W__typ = W__typ; _s.i = &i; _s.d = (void*)d; - _s.lnk = WriteRealFix__58_s; - WriteRealFix__58_s = &_s; + _s.lnk = WriteRealFix__57_s; + WriteRealFix__57_s = &_s; e = Reals_Expo(x); if (k < 0) { k = 0; } if (e == 0) { - seq__61(' ', (n - k) - 2); + seq__60(' ', (n - k) - 2); Texts_Write(&*W, W__typ, '0'); - seq__61(' ', k + 1); + seq__60(' ', k + 1); } else if (e == 255) { Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); - seq__61(' ', n - 4); + seq__60(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); if (x < (REAL)0) { @@ -1394,21 +1379,21 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 i = k + e; Reals_Convert(x, i, (void*)d, 9); if (e > 0) { - seq__61(' ', ((n - e) - k) - 2); + seq__60(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); - dig__59(e); + dig__58(e); Texts_Write(&*W, W__typ, '.'); - dig__59(k); + dig__58(k); } else { - seq__61(' ', (n - k) - 3); + seq__60(' ', (n - k) - 3); Texts_Write(&*W, W__typ, sign); Texts_Write(&*W, W__typ, '0'); Texts_Write(&*W, W__typ, '.'); - seq__61('0', -e); - dig__59(k + e); + seq__60('0', -e); + dig__58(k + e); } } - WriteRealFix__58_s = _s.lnk; + WriteRealFix__57_s = _s.lnk; } void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) @@ -1507,48 +1492,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) } while (!(i == 16)); } -static struct WriteDate__48 { +static struct WriteDate__47 { Texts_Writer *W; ADDRESS *W__typ; - struct WriteDate__48 *lnk; -} *WriteDate__48_s; + struct WriteDate__47 *lnk; +} *WriteDate__47_s; -static void WritePair__49 (CHAR ch, INT32 x); +static void WritePair__48 (CHAR ch, INT32 x); -static void WritePair__49 (CHAR ch, INT32 x) +static void WritePair__48 (CHAR ch, INT32 x) { - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, ch); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, ch); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { - struct WriteDate__48 _s; + struct WriteDate__47 _s; _s.W = W; _s.W__typ = W__typ; - _s.lnk = WriteDate__48_s; - WriteDate__48_s = &_s; - WritePair__49(' ', __MASK(d, -32)); - WritePair__49('.', __MASK(__ASHR(d, 5), -16)); - WritePair__49('.', __MASK(__ASHR(d, 9), -128)); - WritePair__49(' ', __MASK(__ASHR(t, 12), -32)); - WritePair__49(':', __MASK(__ASHR(t, 6), -64)); - WritePair__49(':', __MASK(t, -64)); - WriteDate__48_s = _s.lnk; + _s.lnk = WriteDate__47_s; + WriteDate__47_s = &_s; + WritePair__48(' ', __MASK(d, -32)); + WritePair__48('.', __MASK(__ASHR(d, 5), -16)); + WritePair__48('.', __MASK(__ASHR(d, 9), -128)); + WritePair__48(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__48(':', __MASK(__ASHR(t, 6), -64)); + WritePair__48(':', __MASK(t, -64)); + WriteDate__47_s = _s.lnk; } -static struct Load0__21 { +static struct Load0__20 { Texts_Text *T; INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Load0__21 *lnk; -} *Load0__21_s; + struct Load0__20 *lnk; +} *Load0__20_s; -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); +static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) +static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1559,15 +1544,15 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); Files_Read(&*r, r__typ, (void*)&eno); - if (eno > *Load0__21_s->ecnt) { - *Load0__21_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->mods)[__X(eno, 64)], 32); - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->procs)[__X(eno, 64)], 32); + if (eno > *Load0__20_s->ecnt) { + *Load0__20_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__21_s->mods)[__X(eno, 64)], 32); + M = Modules_ThisMod((*Load0__20_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__21_s->procs)[__X(eno, 64)], 32); + Cmd = Modules_ThisCommand(M, (*Load0__20_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1576,25 +1561,25 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span if (*e != NIL) { (*e)->W = ew; (*e)->H = eh; - (*e)->base = *Load0__21_s->T; - (*Load0__21_s->msg).pos = pos; - (*(*e)->handle)(*e, (void*)&*Load0__21_s->msg, Texts_FileMsg__typ); + (*e)->base = *Load0__20_s->T; + (*Load0__20_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__20_s->msg, Texts_FileMsg__typ); if (Files_Pos(&*r, r__typ) != org + span) { *e = NIL; } } if (*e == NIL) { - Files_Set(&*r, r__typ, *Load0__21_s->f, org + span); + Files_Set(&*r, r__typ, *Load0__20_s->f, org + span); __NEW(a, Texts__1); a->W = ew; a->H = eh; a->handle = Texts_HandleAlien; - a->base = *Load0__21_s->T; - a->file = *Load0__21_s->f; + a->base = *Load0__20_s->T; + a->file = *Load0__20_s->f; a->org = org; a->span = span; - __COPY((*Load0__21_s->mods)[__X(eno, 64)], a->mod, 32); - __COPY((*Load0__21_s->procs)[__X(eno, 64)], a->proc, 32); + __COPY((*Load0__20_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__20_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1611,15 +1596,15 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; CHAR name[32]; Texts_FontsFont fnts[32]; - struct Load0__21 _s; + struct Load0__20 _s; _s.T = &T; _s.ecnt = &ecnt; _s.f = &f; _s.msg = &msg; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Load0__21_s; - Load0__21_s = &_s; + _s.lnk = Load0__20_s; + Load0__20_s = &_s; pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); @@ -1652,7 +1637,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) un = (Texts_Run)p; un->len = plen; } else { - LoadElem__22(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + LoadElem__21(&msg.r, Files_Rider__typ, pos - org, -plen, &e); un = (Texts_Run)e; un->len = 1; } @@ -1670,7 +1655,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) T->corg = 0; Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); - Load0__21_s = _s.lnk; + Load0__20_s = _s.lnk; } void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) @@ -1739,25 +1724,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) __DEL(name); } -static struct Store__44 { +static struct Store__43 { INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Store__44 *lnk; -} *Store__44_s; + struct Store__43 *lnk; +} *Store__43_s; -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); +static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) +static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; INT32 org, span; INT8 eno; - __COPY((*Store__44_s->iden).mod, (*Store__44_s->mods)[__X(*Store__44_s->ecnt, 64)], 32); - __COPY((*Store__44_s->iden).proc, (*Store__44_s->procs)[__X(*Store__44_s->ecnt, 64)], 32); + __COPY((*Store__43_s->iden).mod, (*Store__43_s->mods)[__X(*Store__43_s->ecnt, 64)], 32); + __COPY((*Store__43_s->iden).proc, (*Store__43_s->procs)[__X(*Store__43_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__44_s->mods)[__X(eno, 64)], (*Store__44_s->iden).mod) != 0 || __STRCMP((*Store__44_s->procs)[__X(eno, 64)], (*Store__44_s->iden).proc) != 0) { + while (__STRCMP((*Store__43_s->mods)[__X(eno, 64)], (*Store__43_s->iden).mod) != 0 || __STRCMP((*Store__43_s->procs)[__X(eno, 64)], (*Store__43_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); @@ -1765,14 +1750,14 @@ static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Ele Files_WriteLInt(&*r, r__typ, 0); Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); - if (eno == *Store__44_s->ecnt) { - *Store__44_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).mod, 32); - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).proc, 32); + if (eno == *Store__43_s->ecnt) { + *Store__43_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__43_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__43_s->iden).proc, 32); } - (*Store__44_s->msg).pos = pos; + (*Store__43_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); - (*e->handle)(e, (void*)&*Store__44_s->msg, Texts_FileMsg__typ); + (*e->handle)(e, (void*)&*Store__43_s->msg, Texts_FileMsg__typ); span = Files_Pos(&*r, r__typ) - org; Files_WriteLInt(&r1, Files_Rider__typ, -span); Files_WriteLInt(&r1, Files_Rider__typ, e->W); @@ -1793,14 +1778,14 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; Texts_FontsFont fnts[32]; CHAR block[1024]; - struct Store__44 _s; + struct Store__43 _s; _s.ecnt = &ecnt; _s.msg = &msg; _s.iden = &iden; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Store__44_s; - Store__44_s = &_s; + _s.lnk = Store__43_s; + Store__43_s = &_s; org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; @@ -1842,7 +1827,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) pos += rlen; u = un; } else if (iden.mod[0] != 0x00) { - StoreElem__45(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + StoreElem__44(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); pos += 1; u = u->next; } else { @@ -1896,7 +1881,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) if (T->notify != NIL) { (*T->notify)(T, 3, 0, 0); } - Store__44_s = _s.lnk; + Store__43_s = _s.lnk; } void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 55558804..e14afb26 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 669a337a..9ab993c9 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 809a6082..3de3605c 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index b9ca8d5a..213abf27 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 6a31ee74..4278a34c 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h