Update C bootstrap source.

This commit is contained in:
David Brown 2016-12-20 15:17:12 +00:00
parent 412a8c3337
commit 3cb60cc59f
185 changed files with 870 additions and 3740 deletions

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */
#define SHORTINT INT8
#define INTEGER INT16
@ -122,7 +122,7 @@ static void Compiler_FindLocalObjectFiles (CHAR *objectnames, ADDRESS objectname
Strings_Append((CHAR*)" ", 2, (void*)objectnames, objectnames__len);
Strings_Append(fn, 64, (void*)objectnames, objectnames__len);
} else {
OPM_LogVT100((CHAR*)"33m", 4);
OPM_LogVT100((CHAR*)"91m", 4);
OPM_LogWStr((CHAR*)"Link warning: a local symbol file is present for module ", 57);
OPM_LogWStr(l->name, 256);
OPM_LogWStr((CHAR*)", but local object file '", 26);

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. 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/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__MOVE("2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__ENDMOD;
}

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef Configuration__h
#define Configuration__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
#define SHORTINT INT8
#define INTEGER INT16
@ -69,9 +69,6 @@ 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);
@ -102,7 +99,6 @@ 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);
@ -116,132 +112,6 @@ export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS
#define Files_IdxTrap() __HALT(-1)
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_Hex((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_Ln();
Out_HexDump((void*)b->data, 4096);
Files_Spaces(indent);
Out_String((CHAR*)"f: ", 7);
if (b->f == NIL) {
Out_String((CHAR*)"<NIL>", 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*)"<NIL>", 6);
Out_Ln();
} else {
Out_Ln();
Files_DumpBuffer(r.buf, indent + 1);
}
}
static void Files_Assert (BOOLEAN truth)
{
if (!truth) {

View file

@ -1,19 +1,10 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
/* voc 2.00 [2016/12/20]. 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;
@ -33,16 +24,12 @@ 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);

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
#ifndef Heap__h
#define Heap__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef Modules__h
#define Modules__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef OPB__h
#define OPB__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef OPC__h
#define OPC__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16
@ -63,6 +63,7 @@ export void OPM_Init (BOOLEAN *done);
export void OPM_InitOptions (void);
export INT16 OPM_Integer (INT64 n);
static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len);
export void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len);
static void OPM_LogErrMsg (INT16 n);
export void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len);
export void OPM_LogW (CHAR ch);
@ -92,7 +93,6 @@ export void OPM_SymWInt (INT64 i);
export void OPM_SymWLReal (LONGREAL lr);
export void OPM_SymWReal (REAL r);
export void OPM_SymWSet (UINT64 s);
static void OPM_VerboseListSizes (void);
export void OPM_Write (CHAR ch);
export void OPM_WriteHex (INT64 i);
export void OPM_WriteInt (INT64 i);
@ -136,6 +136,27 @@ void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len)
__DEL(vt100code);
}
void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len)
{
__DUP(modname, modname__len, CHAR);
OPM_LogWStr((CHAR*)"Compiling ", 11);
OPM_LogWStr(modname, modname__len);
if (__IN(18, OPM_Options, 32)) {
OPM_LogWStr((CHAR*)", s:", 5);
OPM_LogWNum(__ASHL(OPM_ShortintSize, 3), 1);
OPM_LogWStr((CHAR*)" i:", 4);
OPM_LogWNum(__ASHL(OPM_IntegerSize, 3), 1);
OPM_LogWStr((CHAR*)" l:", 4);
OPM_LogWNum(__ASHL(OPM_LongintSize, 3), 1);
OPM_LogWStr((CHAR*)" adr:", 6);
OPM_LogWNum(__ASHL(OPM_AddressSize, 3), 1);
OPM_LogWStr((CHAR*)" algn:", 7);
OPM_LogWNum(__ASHL(OPM_Alignment, 3), 1);
}
OPM_LogW('.');
__DEL(modname);
}
INT64 OPM_SignedMaximum (INT32 bytecount)
{
INT64 result;
@ -363,32 +384,6 @@ BOOLEAN OPM_OpenPar (void)
__RETCHK;
}
static void OPM_VerboseListSizes (void)
{
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Type Size", 15);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"SHORTINT ", 12);
OPM_LogWNum(OPM_ShortintSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"INTEGER ", 12);
OPM_LogWNum(OPM_IntegerSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"LONGINT ", 12);
OPM_LogWNum(OPM_LongintSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"SET ", 12);
OPM_LogWNum(OPM_LongintSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"ADDRESS ", 12);
OPM_LogWNum(OPM_AddressSize, 4);
OPM_LogWLn();
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Alignment: ", 12);
OPM_LogWNum(OPM_Alignment, 4);
OPM_LogWLn();
}
void OPM_InitOptions (void)
{
CHAR s[256];
@ -432,9 +427,6 @@ void OPM_InitOptions (void)
OPM_LongintSize = 4;
break;
}
if (__IN(18, OPM_Options, 32)) {
OPM_VerboseListSizes();
}
__MOVE(OPM_InstallDir, OPM_ResourceDir, 1024);
if (OPM_ResourceDir[0] != 0x00) {
Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024);
@ -491,17 +483,6 @@ void OPM_Get (CHAR *ch)
{
OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ);
Texts_Read(&OPM_inR, Texts_Reader__typ, &*ch);
if ((OPM_curpos == 0 && OPM_inR.eot)) {
OPM_LogWLn();
OPM_LogWStr((CHAR*)"DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = ", 53);
OPM_LogWNum((INT16)*ch, 1);
OPM_LogW('.');
Texts_DumpReader(OPM_inR);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Heap dump:", 11);
OPM_LogWLn();
Out_DumpHeap();
}
if ((*ch < 0x09 && !OPM_inR.eot)) {
*ch = ' ';
}

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef OPM__h
#define OPM__h
@ -33,6 +33,7 @@ import void OPM_Get (CHAR *ch);
import void OPM_Init (BOOLEAN *done);
import void OPM_InitOptions (void);
import INT16 OPM_Integer (INT64 n);
import void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len);
import void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len);
import void OPM_LogW (CHAR ch);
import void OPM_LogWLn (void);

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16
@ -1796,9 +1796,7 @@ void OPP_Module (OPT_Node *prog, UINT32 opt)
OPP_err(16);
}
if (OPP_sym == 38) {
OPM_LogWStr((CHAR*)"compiling ", 11);
OPM_LogWStr(OPS_name, 256);
OPM_LogW('.');
OPM_LogCompiling(OPS_name, 256);
OPT_Init(OPS_name, opt);
OPS_Get(&OPP_sym);
OPP_CheckSym(39);

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef OPP__h
#define OPP__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
#ifndef OPS__h
#define OPS__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef OPT__h
#define OPT__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef OPV__h
#define OPV__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16
@ -14,19 +14,10 @@ export BOOLEAN Out_IsConsole;
static CHAR Out_buf[128];
static INT16 Out_in;
static ADDRESS *typedesc__11__typ;
static ADDRESS *blockdesc__5__typ;
static ADDRESS *chunkdesc__7__typ;
export void Out_Char (CHAR ch);
export void Out_DumpHeap (void);
static void Out_DumpModule (Heap_Module m);
export void Out_DumpTag (INT32 addr);
export void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len);
export void Out_Flush (void);
export void Out_Hex (INT64 x, INT64 n);
export void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len);
export void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length);
export void Out_Int (INT64 x, INT64 n);
static INT32 Out_Length (CHAR *s, ADDRESS s__len);
export void Out_Ln (void);
@ -40,8 +31,6 @@ static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i);
static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i);
#define Out_Entier64(x) (INT64)(x)
extern ADDRESS Heap_heap;
#define Out_getheap() Heap_heap
void Out_Flush (void)
{
@ -139,8 +128,10 @@ void Out_Hex (INT64 x, INT64 n)
} else if (n > 16) {
n = 16;
}
while ((n < 16 && __LSH(x, -__ASHL(n, 2), 64) != 0)) {
n += 1;
if (x >= 0) {
while ((n < 16 && __LSH(x, -__ASHL(n, 2), 64) != 0)) {
n += 1;
}
}
x = __ROT(x, __ASHL(16 - n, 2), 64);
while (n > 0) {
@ -160,235 +151,6 @@ void Out_Ln (void)
Out_Flush();
}
void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length)
{
INT16 i;
INT32 n, lim;
CHAR c;
lim = (INT32)(adr + length);
while (adr < lim) {
if (adr + 16 < lim) {
n = 16;
} else {
n = lim - adr;
}
Out_Hex(offset, 8);
Out_Char(' ');
i = 0;
while (i < n) {
if (__MASK(i, -4) == 0) {
Out_Char(' ');
}
__GET(adr + i, c, CHAR);
Out_Hex((INT16)c, 2);
Out_Char(' ');
i += 1;
}
while (i < 16) {
if (__MASK(i, -4) == 0) {
Out_Char(' ');
}
Out_String((CHAR*)" ", 4);
i += 1;
}
Out_String((CHAR*)" ", 2);
i = 0;
while (i < n) {
__GET(adr + i, c, CHAR);
if ((INT16)c < 32 || (INT16)c > 126) {
Out_Char('.');
} else {
Out_Char(c);
}
i += 1;
}
adr += n;
offset += (INT64)n;
Out_Ln();
}
}
void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len)
{
Out_HexDumpAdr((ADDRESS)m, 0, m__len);
}
static void Out_DumpModule (Heap_Module m)
{
Out_String((CHAR*)" next: ", 19);
Out_Hex((INT32)(ADDRESS)m->next, 1);
Out_Ln();
Out_String((CHAR*)" name: ", 19);
Out_String(m->name, 20);
Out_Ln();
Out_String((CHAR*)" refcnt: ", 19);
Out_Hex(m->refcnt, 1);
Out_Ln();
Out_String((CHAR*)" cmds: ", 19);
Out_Hex((INT32)(ADDRESS)m->cmds, 1);
Out_Ln();
Out_String((CHAR*)" types: ", 19);
Out_Hex(m->types, 1);
Out_Ln();
Out_String((CHAR*)" enumPtrs: ", 19);
Out_Hex((INT32)(ADDRESS)m->enumPtrs, 1);
Out_Ln();
}
typedef
struct typedesc__11 *tag__10;
typedef
struct typedesc__11 {
INT32 tag, next, level, module;
CHAR name[24];
INT32 bases[16];
INT32 reserved, blksz, ptr0;
} typedesc__11;
void Out_DumpTag (INT32 addr)
{
tag__10 desc = NIL;
INT16 i;
Out_String((CHAR*)" obj tag: ", 17);
Out_Hex(addr, 1);
Out_Ln();
addr -= __MASK(addr, -2);
desc = (tag__10)(ADDRESS)(addr - 108);
Out_String((CHAR*)" desc at: ", 17);
Out_Hex((INT32)(ADDRESS)desc, 1);
Out_Ln();
Out_String((CHAR*)" desc contains:", 21);
Out_Ln();
Out_String((CHAR*)" tag: ", 17);
Out_Hex(desc->tag, 1);
Out_Ln();
Out_String((CHAR*)" next: ", 17);
Out_Hex(desc->next, 1);
Out_Ln();
Out_String((CHAR*)" level: ", 17);
Out_Hex(desc->level, 1);
Out_Ln();
Out_String((CHAR*)" module: ", 17);
Out_Hex(desc->module, 1);
Out_Ln();
if (desc->module != 0) {
Out_DumpModule((Heap_Module)(ADDRESS)desc->module);
}
Out_String((CHAR*)" name: ", 17);
Out_String(desc->name, 24);
Out_Ln();
Out_String((CHAR*)" bases: ", 17);
i = 0;
while (i < 16) {
Out_Hex(desc->bases[__X(i, 16)], 8);
if (__MASK(i, -4) == 3) {
Out_Ln();
Out_String((CHAR*)" ", 17);
} else {
Out_Char(' ');
}
i += 1;
}
Out_Ln();
Out_String((CHAR*)" reserved: ", 17);
Out_Hex(desc->reserved, 1);
Out_Ln();
Out_String((CHAR*)" blksz: ", 17);
Out_Hex(desc->blksz, 1);
Out_Ln();
Out_String((CHAR*)" ptr0: ", 17);
Out_Hex(desc->ptr0, 1);
Out_Ln();
}
void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len)
{
INT32 addr;
__GET((ADDRESS)o - 4, addr, INT32);
Out_DumpTag(addr);
}
typedef
INT32 (*adrptr__3)[1];
typedef
struct blockdesc__5 *block__4;
typedef
struct blockdesc__5 {
INT32 tag, size, sentinel, next;
} blockdesc__5;
typedef
struct chunkdesc__7 *chunk__6;
typedef
struct chunkdesc__7 {
INT32 next, end, reserved;
blockdesc__5 firstblock;
} chunkdesc__7;
void Out_DumpHeap (void)
{
INT32 caddr;
chunk__6 c = NIL;
INT32 baddr;
block__4 b = NIL;
adrptr__3 tag = NIL;
caddr = Heap_heap;
while (caddr != 0) {
Out_String((CHAR*)"Chunk at: ", 11);
Out_Hex(caddr, 1);
Out_Ln();
c = (chunk__6)(ADDRESS)caddr;
Out_String((CHAR*)" next: ", 11);
Out_Hex(c->next, 1);
Out_Ln();
Out_String((CHAR*)" end: ", 11);
Out_Hex(c->end, 1);
Out_String((CHAR*)" => size: ", 11);
Out_Hex(c->end - caddr, 1);
Out_Ln();
Out_String((CHAR*)" rsvd: ", 11);
Out_Hex(c->reserved, 1);
Out_Ln();
baddr = (ADDRESS)&c->firstblock;
while (c->end - baddr > 0) {
Out_String((CHAR*)" Block at: ", 15);
Out_Hex(baddr, 1);
Out_Ln();
b = (block__4)(ADDRESS)baddr;
tag = (adrptr__3)(ADDRESS)(b->tag - __MASK(b->tag, -2));
Out_String((CHAR*)" tag: ", 15);
Out_Hex(b->tag, 1);
if (__MASK(b->tag, -2) != 0) {
Out_String((CHAR*)" <--- ODD! ---", 15);
}
Out_Ln();
Out_String((CHAR*)" tag^: ", 15);
Out_Hex((*tag)[0], 1);
Out_Ln();
Out_String((CHAR*)" size: ", 15);
Out_Hex(b->size, 1);
Out_Ln();
Out_String((CHAR*)" sentinel: ", 15);
Out_Hex(b->sentinel, 1);
Out_Ln();
Out_String((CHAR*)" next: ", 15);
Out_Hex(b->next, 1);
Out_Ln();
if (b->tag != (ADDRESS)&b->size) {
Out_DumpTag(b->tag);
}
baddr += (*tag)[0];
Out_Ln();
}
caddr = c->next;
Out_Ln();
}
}
static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i)
{
*i -= 1;
@ -566,9 +328,6 @@ void Out_LongReal (LONGREAL x, INT16 n)
Out_RealP(x, n, 1);
}
__TDESC(typedesc__11, 1, 0) = {__TDFLDS("typedesc__11", 116), {-4}};
__TDESC(blockdesc__5, 1, 0) = {__TDFLDS("blockdesc__5", 16), {-4}};
__TDESC(chunkdesc__7, 1, 0) = {__TDFLDS("chunkdesc__7", 28), {-4}};
export void *Out__init(void)
{
@ -576,13 +335,9 @@ export void *Out__init(void)
__MODULE_IMPORT(Heap);
__MODULE_IMPORT(Platform);
__REGMOD("Out", 0);
__REGCMD("DumpHeap", Out_DumpHeap);
__REGCMD("Flush", Out_Flush);
__REGCMD("Ln", Out_Ln);
__REGCMD("Open", Out_Open);
__INITYP(typedesc__11, typedesc__11, 0);
__INITYP(blockdesc__5, blockdesc__5, 0);
__INITYP(chunkdesc__7, chunkdesc__7, 0);
/* BEGIN */
Out_IsConsole = Platform_IsConsole(1);
Out_in = 0;

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef Out__h
#define Out__h
@ -10,13 +10,8 @@ import BOOLEAN Out_IsConsole;
import void Out_Char (CHAR ch);
import void Out_DumpHeap (void);
import void Out_DumpTag (INT32 addr);
import void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len);
import void Out_Flush (void);
import void Out_Hex (INT64 x, INT64 n);
import void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len);
import void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length);
import void Out_Int (INT64 x, INT64 n);
import void Out_Ln (void);
import void Out_LongReal (LONGREAL x, INT16 n);

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef Platform__h
#define Platform__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef Reals__h
#define Reals__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef Strings__h
#define Strings__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16
@ -192,11 +192,6 @@ export void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len);
export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB);
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);
static void Texts_DumpPiece (Texts_Piece p);
export void Texts_DumpReader (Texts_Reader re);
static void Texts_DumpRun (Texts_Run ru);
static void Texts_DumpText (Texts_Text t);
export Texts_Text Texts_ElemBase (Texts_Elem E);
export INT32 Texts_ElemPos (Texts_Elem E);
static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off);
@ -238,161 +233,6 @@ export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x);
export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len);
static void Texts_DumpText (Texts_Text t)
{
Out_String((CHAR*)" len: ", 15);
Out_Int(t->len, 1);
Out_Ln();
Out_String((CHAR*)" notify: ", 15);
Out_Hex((INT32)(ADDRESS)t->notify, 1);
Out_Ln();
Out_String((CHAR*)" head: ", 15);
Out_Hex((INT32)(ADDRESS)t->head, 1);
Out_Ln();
Out_String((CHAR*)" cache: ", 15);
Out_Hex((INT32)(ADDRESS)t->cache, 1);
Out_Ln();
Out_String((CHAR*)" corg: ", 15);
Out_Int(t->corg, 1);
Out_Ln();
}
static void Texts_DumpRun (Texts_Run ru)
{
Out_String((CHAR*)" Run at ", 12);
Out_Hex((INT32)(ADDRESS)ru, 1);
Out_Ln();
Out_String((CHAR*)" prev: ", 12);
Out_Hex((INT32)(ADDRESS)ru->prev, 1);
Out_Ln();
Out_String((CHAR*)" next: ", 12);
Out_Hex((INT32)(ADDRESS)ru->next, 1);
Out_Ln();
Out_String((CHAR*)" len: ", 12);
Out_Int(ru->len, 1);
Out_Ln();
Out_String((CHAR*)" fnt: ", 12);
if (ru->fnt != NIL) {
Out_String(ru->fnt->name, 32);
} else {
Out_String((CHAR*)"<NIL>", 6);
}
Out_Ln();
Out_String((CHAR*)" col: ", 12);
Out_Int(ru->col, 1);
Out_Ln();
Out_String((CHAR*)" voff: ", 12);
Out_Int(ru->voff, 1);
Out_Ln();
Out_String((CHAR*)" ascii: ", 12);
if (ru->ascii) {
Out_String((CHAR*)"TRUE", 5);
} else {
Out_String((CHAR*)"FALSE", 6);
}
Out_Ln();
}
static void Texts_DumpElem (Texts_Elem e)
{
Texts_DumpRun((void*)e);
Out_String((CHAR*)" -- Elem --", 15);
Out_Ln();
Out_String((CHAR*)" W: ", 13);
Out_Int(e->W, 1);
Out_Ln();
Out_String((CHAR*)" H: ", 13);
Out_Int(e->H, 1);
Out_Ln();
Out_String((CHAR*)" handle: ", 13);
Out_Hex((INT32)(ADDRESS)e->handle, 1);
Out_Ln();
Out_String((CHAR*)" base: ", 13);
if (e->base == NIL) {
Out_String((CHAR*)"<NIL>", 6);
Out_Ln();
} else {
Out_Ln();
Texts_DumpText(e->base);
}
}
static void Texts_DumpPiece (Texts_Piece p)
{
Texts_DumpRun((void*)p);
Out_String((CHAR*)" -- Piece --", 16);
Out_Ln();
Out_String((CHAR*)" file: ", 12);
if (p->file == NIL) {
Out_String((CHAR*)"<NIL>", 6);
Out_Ln();
} else {
Out_Ln();
Files_DumpFile(p->file, 3);
}
Out_String((CHAR*)" org: ", 12);
Out_Int(p->org, 1);
Out_Ln();
}
void Texts_DumpReader (Texts_Reader re)
{
Out_String((CHAR*)"Reader:", 8);
Out_Ln();
Out_String((CHAR*)" eot: ", 10);
if (re.eot) {
Out_String((CHAR*)"TRUE", 5);
} else {
Out_String((CHAR*)"FALSE", 6);
}
Out_Ln();
Out_String((CHAR*)" fnt: ", 10);
if (re.fnt != NIL) {
Out_String(re.fnt->name, 32);
} else {
Out_String((CHAR*)"<NIL>", 6);
}
Out_Ln();
Out_String((CHAR*)" col: ", 10);
Out_Int(re.col, 1);
Out_Ln();
Out_String((CHAR*)" voff: ", 10);
Out_Int(re.voff, 1);
Out_Ln();
Out_String((CHAR*)" org: ", 10);
Out_Int(re.org, 1);
Out_Ln();
Out_String((CHAR*)" off: ", 10);
Out_Int(re.off, 1);
Out_Ln();
Out_String((CHAR*)" elem: ", 10);
if (re.elem == NIL) {
Out_String((CHAR*)"<NIL>", 6);
Out_Ln();
} else {
Out_Ln();
Texts_DumpElem(re.elem);
}
Out_String((CHAR*)" rider: ", 10);
Out_Ln();
Files_DumpRider(re.rider, 2);
Out_String((CHAR*)" run: ", 10);
if (re.run == NIL) {
Out_String((CHAR*)"<NIL>", 6);
Out_Ln();
} else {
Out_Ln();
if (__ISP(re.run, Texts_PieceDesc, 1)) {
Texts_DumpPiece(__GUARDP(re.run, Texts_PieceDesc, 1));
} else if (__ISP(re.run, Texts_ElemDesc, 1)) {
Texts_DumpElem(__GUARDP(re.run, Texts_ElemDesc, 1));
} else {
Texts_DumpRun(re.run);
}
}
Out_DumpType((void*)&*re.run, 20);
}
static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len)
{
Texts_FontsFont F = NIL;
@ -877,32 +717,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p
(*S).nextCh = ' ';
}
static struct Scan__36 {
static struct Scan__31 {
Texts_Scanner *S;
ADDRESS *S__typ;
CHAR *ch;
BOOLEAN *negE;
INT16 *e;
struct Scan__36 *lnk;
} *Scan__36_s;
struct Scan__31 *lnk;
} *Scan__31_s;
static void ReadScaleFactor__37 (void);
static void ReadScaleFactor__32 (void);
static void ReadScaleFactor__37 (void)
static void ReadScaleFactor__32 (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__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch);
if (*Scan__31_s->ch == '-') {
*Scan__31_s->negE = 1;
Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_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__31_s->negE = 0;
if (*Scan__31_s->ch == '+') {
Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_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__31_s->ch && *Scan__31_s->ch <= '9')) {
*Scan__31_s->e = (*Scan__31_s->e * 10 + (INT16)*Scan__31_s->ch) - 48;
Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch);
}
}
@ -916,13 +756,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__31 _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__31_s;
Scan__31_s = &_s;
ch = (*S).nextCh;
i = 0;
for (;;) {
@ -1023,7 +863,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ)
y = ((INT16)d[__X(j, 32)] - 48) * g + y;
j += 1;
}
ReadScaleFactor__37();
ReadScaleFactor__32();
if (negE) {
if (e <= 308) {
y = y / (LONGREAL)Reals_TenL(e);
@ -1056,7 +896,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ)
j += 1;
}
if (ch == 'E') {
ReadScaleFactor__37();
ReadScaleFactor__32();
}
if (negE) {
if (e <= 38) {
@ -1109,7 +949,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ)
}
}
(*S).nextCh = ch;
Scan__36_s = _s.lnk;
Scan__31_s = _s.lnk;
}
void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ)
@ -1328,30 +1168,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n)
}
}
static struct WriteRealFix__58 {
static struct WriteRealFix__53 {
Texts_Writer *W;
ADDRESS *W__typ;
INT16 *i;
CHAR (*d)[9];
struct WriteRealFix__58 *lnk;
} *WriteRealFix__58_s;
struct WriteRealFix__53 *lnk;
} *WriteRealFix__53_s;
static void dig__59 (INT16 n);
static void seq__61 (CHAR ch, INT16 n);
static void dig__54 (INT16 n);
static void seq__56 (CHAR ch, INT16 n);
static void seq__61 (CHAR ch, INT16 n)
static void seq__56 (CHAR ch, INT16 n)
{
while (n > 0) {
Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch);
Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch);
n -= 1;
}
}
static void dig__59 (INT16 n)
static void dig__54 (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__53_s->i -= 1;
Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]);
n -= 1;
}
}
@ -1362,23 +1202,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__53 _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__53_s;
WriteRealFix__53_s = &_s;
e = Reals_Expo(x);
if (k < 0) {
k = 0;
}
if (e == 0) {
seq__61(' ', (n - k) - 2);
seq__56(' ', (n - k) - 2);
Texts_Write(&*W, W__typ, '0');
seq__61(' ', k + 1);
seq__56(' ', k + 1);
} else if (e == 255) {
Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5);
seq__61(' ', n - 4);
seq__56(' ', n - 4);
} else {
e = __ASHR((e - 127) * 77, 8);
if (x < (REAL)0) {
@ -1411,21 +1251,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__56(' ', ((n - e) - k) - 2);
Texts_Write(&*W, W__typ, sign);
dig__59(e);
dig__54(e);
Texts_Write(&*W, W__typ, '.');
dig__59(k);
dig__54(k);
} else {
seq__61(' ', (n - k) - 3);
seq__56(' ', (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__56('0', -e);
dig__54(k + e);
}
}
WriteRealFix__58_s = _s.lnk;
WriteRealFix__53_s = _s.lnk;
}
void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x)
@ -1524,48 +1364,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x)
} while (!(i == 16));
}
static struct WriteDate__48 {
static struct WriteDate__43 {
Texts_Writer *W;
ADDRESS *W__typ;
struct WriteDate__48 *lnk;
} *WriteDate__48_s;
struct WriteDate__43 *lnk;
} *WriteDate__43_s;
static void WritePair__49 (CHAR ch, INT32 x);
static void WritePair__44 (CHAR ch, INT32 x);
static void WritePair__49 (CHAR ch, INT32 x)
static void WritePair__44 (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__43_s->W, WriteDate__43_s->W__typ, ch);
Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48));
Texts_Write(&*WriteDate__43_s->W, WriteDate__43_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__43 _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__43_s;
WriteDate__43_s = &_s;
WritePair__44(' ', __MASK(d, -32));
WritePair__44('.', __MASK(__ASHR(d, 5), -16));
WritePair__44('.', __MASK(__ASHR(d, 9), -128));
WritePair__44(' ', __MASK(__ASHR(t, 12), -32));
WritePair__44(':', __MASK(__ASHR(t, 6), -64));
WritePair__44(':', __MASK(t, -64));
WriteDate__43_s = _s.lnk;
}
static struct Load0__21 {
static struct Load0__16 {
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__16 *lnk;
} *Load0__16_s;
static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e);
static void LoadElem__17 (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__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e)
{
Heap_Module M = NIL;
Heap_Command Cmd;
@ -1576,15 +1416,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__16_s->ecnt) {
*Load0__16_s->ecnt = eno;
Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32);
Files_ReadString(&*r, r__typ, (void*)(*Load0__16_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__16_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__16_s->procs)[__X(eno, 64)], 32);
if (Cmd != NIL) {
(*Cmd)();
}
@ -1593,25 +1433,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__16_s->T;
(*Load0__16_s->msg).pos = pos;
(*(*e)->handle)(*e, (void*)&*Load0__16_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__16_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__16_s->T;
a->file = *Load0__16_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__16_s->mods)[__X(eno, 64)], a->mod, 32);
__COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32);
*e = (Texts_Elem)a;
}
}
@ -1628,15 +1468,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__16 _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__16_s;
Load0__16_s = &_s;
pos = Files_Pos(&*r, r__typ);
f = Files_Base(&*r, r__typ);
__NEW(u, Texts_RunDesc);
@ -1669,7 +1509,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__17(&msg.r, Files_Rider__typ, pos - org, -plen, &e);
un = (Texts_Run)e;
un->len = 1;
}
@ -1687,7 +1527,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__16_s = _s.lnk;
}
void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T)
@ -1756,25 +1596,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len)
__DEL(name);
}
static struct Store__44 {
static struct Store__39 {
INT8 *ecnt;
Texts_FileMsg *msg;
Texts_IdentifyMsg *iden;
CHAR (*mods)[64][32], (*procs)[64][32];
struct Store__44 *lnk;
} *Store__44_s;
struct Store__39 *lnk;
} *Store__39_s;
static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e);
static void StoreElem__40 (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__40 (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__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32);
__COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_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__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) {
eno += 1;
}
Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ));
@ -1782,14 +1622,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__39_s->ecnt) {
*Store__39_s->ecnt += 1;
Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32);
Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32);
}
(*Store__44_s->msg).pos = pos;
(*Store__39_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__39_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);
@ -1810,14 +1650,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__39 _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__39_s;
Store__39_s = &_s;
org = Files_Pos(&*r, r__typ);
msg.id = 1;
msg.r = *r;
@ -1859,7 +1699,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__40(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1));
pos += 1;
u = u->next;
} else {
@ -1913,7 +1753,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__39_s = _s.lnk;
}
void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len)

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef Texts__h
#define Texts__h
@ -134,7 +134,6 @@ import void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len);
import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB);
import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE);
import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end);
import void Texts_DumpReader (Texts_Reader re);
import Texts_Text Texts_ElemBase (Texts_Elem E);
import INT32 Texts_ElemPos (Texts_Elem E);
import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B);

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef VT100__h
#define VT100__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16
@ -82,7 +82,7 @@ void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len)
Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023);
Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023);
Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023);
extTools_execute((CHAR*)"Assemble: ", 11, cmd, 1023);
extTools_execute((CHAR*)"C compile: ", 12, cmd, 1023);
__DEL(moduleName);
}
@ -106,7 +106,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati
Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023);
Strings_Append(OPM_Model, 10, (void*)cmd, 1023);
Strings_Append((CHAR*)"", 1, (void*)cmd, 1023);
extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023);
extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 1023);
__DEL(additionalopts);
}

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef extTools__h
#define extTools__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */
#define SHORTINT INT8
#define INTEGER INT16
@ -122,7 +122,7 @@ static void Compiler_FindLocalObjectFiles (CHAR *objectnames, ADDRESS objectname
Strings_Append((CHAR*)" ", 2, (void*)objectnames, objectnames__len);
Strings_Append(fn, 64, (void*)objectnames, objectnames__len);
} else {
OPM_LogVT100((CHAR*)"33m", 4);
OPM_LogVT100((CHAR*)"91m", 4);
OPM_LogWStr((CHAR*)"Link warning: a local symbol file is present for module ", 57);
OPM_LogWStr(l->name, 256);
OPM_LogWStr((CHAR*)", but local object file '", 26);

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. 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/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__MOVE("2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__ENDMOD;
}

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef Configuration__h
#define Configuration__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
#define SHORTINT INT8
#define INTEGER INT16
@ -69,9 +69,6 @@ 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);
@ -102,7 +99,6 @@ 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);
@ -116,132 +112,6 @@ export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS
#define Files_IdxTrap() __HALT(-1)
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_Hex((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_Ln();
Out_HexDump((void*)b->data, 4096);
Files_Spaces(indent);
Out_String((CHAR*)"f: ", 7);
if (b->f == NIL) {
Out_String((CHAR*)"<NIL>", 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*)"<NIL>", 6);
Out_Ln();
} else {
Out_Ln();
Files_DumpBuffer(r.buf, indent + 1);
}
}
static void Files_Assert (BOOLEAN truth)
{
if (!truth) {

View file

@ -1,19 +1,10 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
/* voc 2.00 [2016/12/20]. 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;
@ -33,16 +24,12 @@ 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);

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
#ifndef Heap__h
#define Heap__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef Modules__h
#define Modules__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef OPB__h
#define OPB__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef OPC__h
#define OPC__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16
@ -63,6 +63,7 @@ export void OPM_Init (BOOLEAN *done);
export void OPM_InitOptions (void);
export INT16 OPM_Integer (INT64 n);
static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len);
export void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len);
static void OPM_LogErrMsg (INT16 n);
export void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len);
export void OPM_LogW (CHAR ch);
@ -92,7 +93,6 @@ export void OPM_SymWInt (INT64 i);
export void OPM_SymWLReal (LONGREAL lr);
export void OPM_SymWReal (REAL r);
export void OPM_SymWSet (UINT64 s);
static void OPM_VerboseListSizes (void);
export void OPM_Write (CHAR ch);
export void OPM_WriteHex (INT64 i);
export void OPM_WriteInt (INT64 i);
@ -136,6 +136,27 @@ void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len)
__DEL(vt100code);
}
void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len)
{
__DUP(modname, modname__len, CHAR);
OPM_LogWStr((CHAR*)"Compiling ", 11);
OPM_LogWStr(modname, modname__len);
if (__IN(18, OPM_Options, 32)) {
OPM_LogWStr((CHAR*)", s:", 5);
OPM_LogWNum(__ASHL(OPM_ShortintSize, 3), 1);
OPM_LogWStr((CHAR*)" i:", 4);
OPM_LogWNum(__ASHL(OPM_IntegerSize, 3), 1);
OPM_LogWStr((CHAR*)" l:", 4);
OPM_LogWNum(__ASHL(OPM_LongintSize, 3), 1);
OPM_LogWStr((CHAR*)" adr:", 6);
OPM_LogWNum(__ASHL(OPM_AddressSize, 3), 1);
OPM_LogWStr((CHAR*)" algn:", 7);
OPM_LogWNum(__ASHL(OPM_Alignment, 3), 1);
}
OPM_LogW('.');
__DEL(modname);
}
INT64 OPM_SignedMaximum (INT32 bytecount)
{
INT64 result;
@ -363,32 +384,6 @@ BOOLEAN OPM_OpenPar (void)
__RETCHK;
}
static void OPM_VerboseListSizes (void)
{
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Type Size", 15);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"SHORTINT ", 12);
OPM_LogWNum(OPM_ShortintSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"INTEGER ", 12);
OPM_LogWNum(OPM_IntegerSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"LONGINT ", 12);
OPM_LogWNum(OPM_LongintSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"SET ", 12);
OPM_LogWNum(OPM_LongintSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"ADDRESS ", 12);
OPM_LogWNum(OPM_AddressSize, 4);
OPM_LogWLn();
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Alignment: ", 12);
OPM_LogWNum(OPM_Alignment, 4);
OPM_LogWLn();
}
void OPM_InitOptions (void)
{
CHAR s[256];
@ -432,9 +427,6 @@ void OPM_InitOptions (void)
OPM_LongintSize = 4;
break;
}
if (__IN(18, OPM_Options, 32)) {
OPM_VerboseListSizes();
}
__MOVE(OPM_InstallDir, OPM_ResourceDir, 1024);
if (OPM_ResourceDir[0] != 0x00) {
Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024);
@ -491,17 +483,6 @@ void OPM_Get (CHAR *ch)
{
OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ);
Texts_Read(&OPM_inR, Texts_Reader__typ, &*ch);
if ((OPM_curpos == 0 && OPM_inR.eot)) {
OPM_LogWLn();
OPM_LogWStr((CHAR*)"DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = ", 53);
OPM_LogWNum((INT16)*ch, 1);
OPM_LogW('.');
Texts_DumpReader(OPM_inR);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Heap dump:", 11);
OPM_LogWLn();
Out_DumpHeap();
}
if ((*ch < 0x09 && !OPM_inR.eot)) {
*ch = ' ';
}

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef OPM__h
#define OPM__h
@ -33,6 +33,7 @@ import void OPM_Get (CHAR *ch);
import void OPM_Init (BOOLEAN *done);
import void OPM_InitOptions (void);
import INT16 OPM_Integer (INT64 n);
import void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len);
import void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len);
import void OPM_LogW (CHAR ch);
import void OPM_LogWLn (void);

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16
@ -1796,9 +1796,7 @@ void OPP_Module (OPT_Node *prog, UINT32 opt)
OPP_err(16);
}
if (OPP_sym == 38) {
OPM_LogWStr((CHAR*)"compiling ", 11);
OPM_LogWStr(OPS_name, 256);
OPM_LogW('.');
OPM_LogCompiling(OPS_name, 256);
OPT_Init(OPS_name, opt);
OPS_Get(&OPP_sym);
OPP_CheckSym(39);

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef OPP__h
#define OPP__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
#ifndef OPS__h
#define OPS__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef OPT__h
#define OPT__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef OPV__h
#define OPV__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16
@ -14,19 +14,10 @@ export BOOLEAN Out_IsConsole;
static CHAR Out_buf[128];
static INT16 Out_in;
static ADDRESS *typedesc__11__typ;
static ADDRESS *blockdesc__5__typ;
static ADDRESS *chunkdesc__7__typ;
export void Out_Char (CHAR ch);
export void Out_DumpHeap (void);
static void Out_DumpModule (Heap_Module m);
export void Out_DumpTag (INT32 addr);
export void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len);
export void Out_Flush (void);
export void Out_Hex (INT64 x, INT64 n);
export void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len);
export void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length);
export void Out_Int (INT64 x, INT64 n);
static INT32 Out_Length (CHAR *s, ADDRESS s__len);
export void Out_Ln (void);
@ -40,8 +31,6 @@ static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i);
static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i);
#define Out_Entier64(x) (INT64)(x)
extern ADDRESS Heap_heap;
#define Out_getheap() Heap_heap
void Out_Flush (void)
{
@ -139,8 +128,10 @@ void Out_Hex (INT64 x, INT64 n)
} else if (n > 16) {
n = 16;
}
while ((n < 16 && __LSH(x, -__ASHL(n, 2), 64) != 0)) {
n += 1;
if (x >= 0) {
while ((n < 16 && __LSH(x, -__ASHL(n, 2), 64) != 0)) {
n += 1;
}
}
x = __ROT(x, __ASHL(16 - n, 2), 64);
while (n > 0) {
@ -160,235 +151,6 @@ void Out_Ln (void)
Out_Flush();
}
void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length)
{
INT16 i;
INT32 n, lim;
CHAR c;
lim = (INT32)(adr + length);
while (adr < lim) {
if (adr + 16 < lim) {
n = 16;
} else {
n = lim - adr;
}
Out_Hex(offset, 8);
Out_Char(' ');
i = 0;
while (i < n) {
if (__MASK(i, -4) == 0) {
Out_Char(' ');
}
__GET(adr + i, c, CHAR);
Out_Hex((INT16)c, 2);
Out_Char(' ');
i += 1;
}
while (i < 16) {
if (__MASK(i, -4) == 0) {
Out_Char(' ');
}
Out_String((CHAR*)" ", 4);
i += 1;
}
Out_String((CHAR*)" ", 2);
i = 0;
while (i < n) {
__GET(adr + i, c, CHAR);
if ((INT16)c < 32 || (INT16)c > 126) {
Out_Char('.');
} else {
Out_Char(c);
}
i += 1;
}
adr += n;
offset += (INT64)n;
Out_Ln();
}
}
void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len)
{
Out_HexDumpAdr((ADDRESS)m, 0, m__len);
}
static void Out_DumpModule (Heap_Module m)
{
Out_String((CHAR*)" next: ", 19);
Out_Hex((INT32)(ADDRESS)m->next, 1);
Out_Ln();
Out_String((CHAR*)" name: ", 19);
Out_String(m->name, 20);
Out_Ln();
Out_String((CHAR*)" refcnt: ", 19);
Out_Hex(m->refcnt, 1);
Out_Ln();
Out_String((CHAR*)" cmds: ", 19);
Out_Hex((INT32)(ADDRESS)m->cmds, 1);
Out_Ln();
Out_String((CHAR*)" types: ", 19);
Out_Hex(m->types, 1);
Out_Ln();
Out_String((CHAR*)" enumPtrs: ", 19);
Out_Hex((INT32)(ADDRESS)m->enumPtrs, 1);
Out_Ln();
}
typedef
struct typedesc__11 *tag__10;
typedef
struct typedesc__11 {
INT32 tag, next, level, module;
CHAR name[24];
INT32 bases[16];
INT32 reserved, blksz, ptr0;
} typedesc__11;
void Out_DumpTag (INT32 addr)
{
tag__10 desc = NIL;
INT16 i;
Out_String((CHAR*)" obj tag: ", 17);
Out_Hex(addr, 1);
Out_Ln();
addr -= __MASK(addr, -2);
desc = (tag__10)(ADDRESS)(addr - 108);
Out_String((CHAR*)" desc at: ", 17);
Out_Hex((INT32)(ADDRESS)desc, 1);
Out_Ln();
Out_String((CHAR*)" desc contains:", 21);
Out_Ln();
Out_String((CHAR*)" tag: ", 17);
Out_Hex(desc->tag, 1);
Out_Ln();
Out_String((CHAR*)" next: ", 17);
Out_Hex(desc->next, 1);
Out_Ln();
Out_String((CHAR*)" level: ", 17);
Out_Hex(desc->level, 1);
Out_Ln();
Out_String((CHAR*)" module: ", 17);
Out_Hex(desc->module, 1);
Out_Ln();
if (desc->module != 0) {
Out_DumpModule((Heap_Module)(ADDRESS)desc->module);
}
Out_String((CHAR*)" name: ", 17);
Out_String(desc->name, 24);
Out_Ln();
Out_String((CHAR*)" bases: ", 17);
i = 0;
while (i < 16) {
Out_Hex(desc->bases[__X(i, 16)], 8);
if (__MASK(i, -4) == 3) {
Out_Ln();
Out_String((CHAR*)" ", 17);
} else {
Out_Char(' ');
}
i += 1;
}
Out_Ln();
Out_String((CHAR*)" reserved: ", 17);
Out_Hex(desc->reserved, 1);
Out_Ln();
Out_String((CHAR*)" blksz: ", 17);
Out_Hex(desc->blksz, 1);
Out_Ln();
Out_String((CHAR*)" ptr0: ", 17);
Out_Hex(desc->ptr0, 1);
Out_Ln();
}
void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len)
{
INT32 addr;
__GET((ADDRESS)o - 4, addr, INT32);
Out_DumpTag(addr);
}
typedef
INT32 (*adrptr__3)[1];
typedef
struct blockdesc__5 *block__4;
typedef
struct blockdesc__5 {
INT32 tag, size, sentinel, next;
} blockdesc__5;
typedef
struct chunkdesc__7 *chunk__6;
typedef
struct chunkdesc__7 {
INT32 next, end, reserved;
blockdesc__5 firstblock;
} chunkdesc__7;
void Out_DumpHeap (void)
{
INT32 caddr;
chunk__6 c = NIL;
INT32 baddr;
block__4 b = NIL;
adrptr__3 tag = NIL;
caddr = Heap_heap;
while (caddr != 0) {
Out_String((CHAR*)"Chunk at: ", 11);
Out_Hex(caddr, 1);
Out_Ln();
c = (chunk__6)(ADDRESS)caddr;
Out_String((CHAR*)" next: ", 11);
Out_Hex(c->next, 1);
Out_Ln();
Out_String((CHAR*)" end: ", 11);
Out_Hex(c->end, 1);
Out_String((CHAR*)" => size: ", 11);
Out_Hex(c->end - caddr, 1);
Out_Ln();
Out_String((CHAR*)" rsvd: ", 11);
Out_Hex(c->reserved, 1);
Out_Ln();
baddr = (ADDRESS)&c->firstblock;
while (c->end - baddr > 0) {
Out_String((CHAR*)" Block at: ", 15);
Out_Hex(baddr, 1);
Out_Ln();
b = (block__4)(ADDRESS)baddr;
tag = (adrptr__3)(ADDRESS)(b->tag - __MASK(b->tag, -2));
Out_String((CHAR*)" tag: ", 15);
Out_Hex(b->tag, 1);
if (__MASK(b->tag, -2) != 0) {
Out_String((CHAR*)" <--- ODD! ---", 15);
}
Out_Ln();
Out_String((CHAR*)" tag^: ", 15);
Out_Hex((*tag)[0], 1);
Out_Ln();
Out_String((CHAR*)" size: ", 15);
Out_Hex(b->size, 1);
Out_Ln();
Out_String((CHAR*)" sentinel: ", 15);
Out_Hex(b->sentinel, 1);
Out_Ln();
Out_String((CHAR*)" next: ", 15);
Out_Hex(b->next, 1);
Out_Ln();
if (b->tag != (ADDRESS)&b->size) {
Out_DumpTag(b->tag);
}
baddr += (*tag)[0];
Out_Ln();
}
caddr = c->next;
Out_Ln();
}
}
static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i)
{
*i -= 1;
@ -566,9 +328,6 @@ void Out_LongReal (LONGREAL x, INT16 n)
Out_RealP(x, n, 1);
}
__TDESC(typedesc__11, 1, 0) = {__TDFLDS("typedesc__11", 116), {-4}};
__TDESC(blockdesc__5, 1, 0) = {__TDFLDS("blockdesc__5", 16), {-4}};
__TDESC(chunkdesc__7, 1, 0) = {__TDFLDS("chunkdesc__7", 28), {-4}};
export void *Out__init(void)
{
@ -576,13 +335,9 @@ export void *Out__init(void)
__MODULE_IMPORT(Heap);
__MODULE_IMPORT(Platform);
__REGMOD("Out", 0);
__REGCMD("DumpHeap", Out_DumpHeap);
__REGCMD("Flush", Out_Flush);
__REGCMD("Ln", Out_Ln);
__REGCMD("Open", Out_Open);
__INITYP(typedesc__11, typedesc__11, 0);
__INITYP(blockdesc__5, blockdesc__5, 0);
__INITYP(chunkdesc__7, chunkdesc__7, 0);
/* BEGIN */
Out_IsConsole = Platform_IsConsole(1);
Out_in = 0;

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef Out__h
#define Out__h
@ -10,13 +10,8 @@ import BOOLEAN Out_IsConsole;
import void Out_Char (CHAR ch);
import void Out_DumpHeap (void);
import void Out_DumpTag (INT32 addr);
import void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len);
import void Out_Flush (void);
import void Out_Hex (INT64 x, INT64 n);
import void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len);
import void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length);
import void Out_Int (INT64 x, INT64 n);
import void Out_Ln (void);
import void Out_LongReal (LONGREAL x, INT16 n);

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef Platform__h
#define Platform__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef Reals__h
#define Reals__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef Strings__h
#define Strings__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16
@ -192,11 +192,6 @@ export void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len);
export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB);
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);
static void Texts_DumpPiece (Texts_Piece p);
export void Texts_DumpReader (Texts_Reader re);
static void Texts_DumpRun (Texts_Run ru);
static void Texts_DumpText (Texts_Text t);
export Texts_Text Texts_ElemBase (Texts_Elem E);
export INT32 Texts_ElemPos (Texts_Elem E);
static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off);
@ -238,161 +233,6 @@ export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x);
export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len);
static void Texts_DumpText (Texts_Text t)
{
Out_String((CHAR*)" len: ", 15);
Out_Int(t->len, 1);
Out_Ln();
Out_String((CHAR*)" notify: ", 15);
Out_Hex((INT32)(ADDRESS)t->notify, 1);
Out_Ln();
Out_String((CHAR*)" head: ", 15);
Out_Hex((INT32)(ADDRESS)t->head, 1);
Out_Ln();
Out_String((CHAR*)" cache: ", 15);
Out_Hex((INT32)(ADDRESS)t->cache, 1);
Out_Ln();
Out_String((CHAR*)" corg: ", 15);
Out_Int(t->corg, 1);
Out_Ln();
}
static void Texts_DumpRun (Texts_Run ru)
{
Out_String((CHAR*)" Run at ", 12);
Out_Hex((INT32)(ADDRESS)ru, 1);
Out_Ln();
Out_String((CHAR*)" prev: ", 12);
Out_Hex((INT32)(ADDRESS)ru->prev, 1);
Out_Ln();
Out_String((CHAR*)" next: ", 12);
Out_Hex((INT32)(ADDRESS)ru->next, 1);
Out_Ln();
Out_String((CHAR*)" len: ", 12);
Out_Int(ru->len, 1);
Out_Ln();
Out_String((CHAR*)" fnt: ", 12);
if (ru->fnt != NIL) {
Out_String(ru->fnt->name, 32);
} else {
Out_String((CHAR*)"<NIL>", 6);
}
Out_Ln();
Out_String((CHAR*)" col: ", 12);
Out_Int(ru->col, 1);
Out_Ln();
Out_String((CHAR*)" voff: ", 12);
Out_Int(ru->voff, 1);
Out_Ln();
Out_String((CHAR*)" ascii: ", 12);
if (ru->ascii) {
Out_String((CHAR*)"TRUE", 5);
} else {
Out_String((CHAR*)"FALSE", 6);
}
Out_Ln();
}
static void Texts_DumpElem (Texts_Elem e)
{
Texts_DumpRun((void*)e);
Out_String((CHAR*)" -- Elem --", 15);
Out_Ln();
Out_String((CHAR*)" W: ", 13);
Out_Int(e->W, 1);
Out_Ln();
Out_String((CHAR*)" H: ", 13);
Out_Int(e->H, 1);
Out_Ln();
Out_String((CHAR*)" handle: ", 13);
Out_Hex((INT32)(ADDRESS)e->handle, 1);
Out_Ln();
Out_String((CHAR*)" base: ", 13);
if (e->base == NIL) {
Out_String((CHAR*)"<NIL>", 6);
Out_Ln();
} else {
Out_Ln();
Texts_DumpText(e->base);
}
}
static void Texts_DumpPiece (Texts_Piece p)
{
Texts_DumpRun((void*)p);
Out_String((CHAR*)" -- Piece --", 16);
Out_Ln();
Out_String((CHAR*)" file: ", 12);
if (p->file == NIL) {
Out_String((CHAR*)"<NIL>", 6);
Out_Ln();
} else {
Out_Ln();
Files_DumpFile(p->file, 3);
}
Out_String((CHAR*)" org: ", 12);
Out_Int(p->org, 1);
Out_Ln();
}
void Texts_DumpReader (Texts_Reader re)
{
Out_String((CHAR*)"Reader:", 8);
Out_Ln();
Out_String((CHAR*)" eot: ", 10);
if (re.eot) {
Out_String((CHAR*)"TRUE", 5);
} else {
Out_String((CHAR*)"FALSE", 6);
}
Out_Ln();
Out_String((CHAR*)" fnt: ", 10);
if (re.fnt != NIL) {
Out_String(re.fnt->name, 32);
} else {
Out_String((CHAR*)"<NIL>", 6);
}
Out_Ln();
Out_String((CHAR*)" col: ", 10);
Out_Int(re.col, 1);
Out_Ln();
Out_String((CHAR*)" voff: ", 10);
Out_Int(re.voff, 1);
Out_Ln();
Out_String((CHAR*)" org: ", 10);
Out_Int(re.org, 1);
Out_Ln();
Out_String((CHAR*)" off: ", 10);
Out_Int(re.off, 1);
Out_Ln();
Out_String((CHAR*)" elem: ", 10);
if (re.elem == NIL) {
Out_String((CHAR*)"<NIL>", 6);
Out_Ln();
} else {
Out_Ln();
Texts_DumpElem(re.elem);
}
Out_String((CHAR*)" rider: ", 10);
Out_Ln();
Files_DumpRider(re.rider, 2);
Out_String((CHAR*)" run: ", 10);
if (re.run == NIL) {
Out_String((CHAR*)"<NIL>", 6);
Out_Ln();
} else {
Out_Ln();
if (__ISP(re.run, Texts_PieceDesc, 1)) {
Texts_DumpPiece(__GUARDP(re.run, Texts_PieceDesc, 1));
} else if (__ISP(re.run, Texts_ElemDesc, 1)) {
Texts_DumpElem(__GUARDP(re.run, Texts_ElemDesc, 1));
} else {
Texts_DumpRun(re.run);
}
}
Out_DumpType((void*)&*re.run, 20);
}
static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len)
{
Texts_FontsFont F = NIL;
@ -877,32 +717,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p
(*S).nextCh = ' ';
}
static struct Scan__36 {
static struct Scan__31 {
Texts_Scanner *S;
ADDRESS *S__typ;
CHAR *ch;
BOOLEAN *negE;
INT16 *e;
struct Scan__36 *lnk;
} *Scan__36_s;
struct Scan__31 *lnk;
} *Scan__31_s;
static void ReadScaleFactor__37 (void);
static void ReadScaleFactor__32 (void);
static void ReadScaleFactor__37 (void)
static void ReadScaleFactor__32 (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__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch);
if (*Scan__31_s->ch == '-') {
*Scan__31_s->negE = 1;
Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_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__31_s->negE = 0;
if (*Scan__31_s->ch == '+') {
Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_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__31_s->ch && *Scan__31_s->ch <= '9')) {
*Scan__31_s->e = (*Scan__31_s->e * 10 + (INT16)*Scan__31_s->ch) - 48;
Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch);
}
}
@ -916,13 +756,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__31 _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__31_s;
Scan__31_s = &_s;
ch = (*S).nextCh;
i = 0;
for (;;) {
@ -1023,7 +863,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ)
y = ((INT16)d[__X(j, 32)] - 48) * g + y;
j += 1;
}
ReadScaleFactor__37();
ReadScaleFactor__32();
if (negE) {
if (e <= 308) {
y = y / (LONGREAL)Reals_TenL(e);
@ -1056,7 +896,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ)
j += 1;
}
if (ch == 'E') {
ReadScaleFactor__37();
ReadScaleFactor__32();
}
if (negE) {
if (e <= 38) {
@ -1109,7 +949,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ)
}
}
(*S).nextCh = ch;
Scan__36_s = _s.lnk;
Scan__31_s = _s.lnk;
}
void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ)
@ -1328,30 +1168,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n)
}
}
static struct WriteRealFix__58 {
static struct WriteRealFix__53 {
Texts_Writer *W;
ADDRESS *W__typ;
INT16 *i;
CHAR (*d)[9];
struct WriteRealFix__58 *lnk;
} *WriteRealFix__58_s;
struct WriteRealFix__53 *lnk;
} *WriteRealFix__53_s;
static void dig__59 (INT16 n);
static void seq__61 (CHAR ch, INT16 n);
static void dig__54 (INT16 n);
static void seq__56 (CHAR ch, INT16 n);
static void seq__61 (CHAR ch, INT16 n)
static void seq__56 (CHAR ch, INT16 n)
{
while (n > 0) {
Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch);
Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch);
n -= 1;
}
}
static void dig__59 (INT16 n)
static void dig__54 (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__53_s->i -= 1;
Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]);
n -= 1;
}
}
@ -1362,23 +1202,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__53 _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__53_s;
WriteRealFix__53_s = &_s;
e = Reals_Expo(x);
if (k < 0) {
k = 0;
}
if (e == 0) {
seq__61(' ', (n - k) - 2);
seq__56(' ', (n - k) - 2);
Texts_Write(&*W, W__typ, '0');
seq__61(' ', k + 1);
seq__56(' ', k + 1);
} else if (e == 255) {
Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5);
seq__61(' ', n - 4);
seq__56(' ', n - 4);
} else {
e = __ASHR((e - 127) * 77, 8);
if (x < (REAL)0) {
@ -1411,21 +1251,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__56(' ', ((n - e) - k) - 2);
Texts_Write(&*W, W__typ, sign);
dig__59(e);
dig__54(e);
Texts_Write(&*W, W__typ, '.');
dig__59(k);
dig__54(k);
} else {
seq__61(' ', (n - k) - 3);
seq__56(' ', (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__56('0', -e);
dig__54(k + e);
}
}
WriteRealFix__58_s = _s.lnk;
WriteRealFix__53_s = _s.lnk;
}
void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x)
@ -1524,48 +1364,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x)
} while (!(i == 16));
}
static struct WriteDate__48 {
static struct WriteDate__43 {
Texts_Writer *W;
ADDRESS *W__typ;
struct WriteDate__48 *lnk;
} *WriteDate__48_s;
struct WriteDate__43 *lnk;
} *WriteDate__43_s;
static void WritePair__49 (CHAR ch, INT32 x);
static void WritePair__44 (CHAR ch, INT32 x);
static void WritePair__49 (CHAR ch, INT32 x)
static void WritePair__44 (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__43_s->W, WriteDate__43_s->W__typ, ch);
Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48));
Texts_Write(&*WriteDate__43_s->W, WriteDate__43_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__43 _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__43_s;
WriteDate__43_s = &_s;
WritePair__44(' ', __MASK(d, -32));
WritePair__44('.', __MASK(__ASHR(d, 5), -16));
WritePair__44('.', __MASK(__ASHR(d, 9), -128));
WritePair__44(' ', __MASK(__ASHR(t, 12), -32));
WritePair__44(':', __MASK(__ASHR(t, 6), -64));
WritePair__44(':', __MASK(t, -64));
WriteDate__43_s = _s.lnk;
}
static struct Load0__21 {
static struct Load0__16 {
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__16 *lnk;
} *Load0__16_s;
static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e);
static void LoadElem__17 (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__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e)
{
Heap_Module M = NIL;
Heap_Command Cmd;
@ -1576,15 +1416,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__16_s->ecnt) {
*Load0__16_s->ecnt = eno;
Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32);
Files_ReadString(&*r, r__typ, (void*)(*Load0__16_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__16_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__16_s->procs)[__X(eno, 64)], 32);
if (Cmd != NIL) {
(*Cmd)();
}
@ -1593,25 +1433,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__16_s->T;
(*Load0__16_s->msg).pos = pos;
(*(*e)->handle)(*e, (void*)&*Load0__16_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__16_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__16_s->T;
a->file = *Load0__16_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__16_s->mods)[__X(eno, 64)], a->mod, 32);
__COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32);
*e = (Texts_Elem)a;
}
}
@ -1628,15 +1468,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__16 _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__16_s;
Load0__16_s = &_s;
pos = Files_Pos(&*r, r__typ);
f = Files_Base(&*r, r__typ);
__NEW(u, Texts_RunDesc);
@ -1669,7 +1509,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__17(&msg.r, Files_Rider__typ, pos - org, -plen, &e);
un = (Texts_Run)e;
un->len = 1;
}
@ -1687,7 +1527,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__16_s = _s.lnk;
}
void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T)
@ -1756,25 +1596,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len)
__DEL(name);
}
static struct Store__44 {
static struct Store__39 {
INT8 *ecnt;
Texts_FileMsg *msg;
Texts_IdentifyMsg *iden;
CHAR (*mods)[64][32], (*procs)[64][32];
struct Store__44 *lnk;
} *Store__44_s;
struct Store__39 *lnk;
} *Store__39_s;
static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e);
static void StoreElem__40 (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__40 (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__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32);
__COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_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__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) {
eno += 1;
}
Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ));
@ -1782,14 +1622,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__39_s->ecnt) {
*Store__39_s->ecnt += 1;
Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32);
Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32);
}
(*Store__44_s->msg).pos = pos;
(*Store__39_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__39_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);
@ -1810,14 +1650,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__39 _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__39_s;
Store__39_s = &_s;
org = Files_Pos(&*r, r__typ);
msg.id = 1;
msg.r = *r;
@ -1859,7 +1699,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__40(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1));
pos += 1;
u = u->next;
} else {
@ -1913,7 +1753,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__39_s = _s.lnk;
}
void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len)

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef Texts__h
#define Texts__h
@ -135,7 +135,6 @@ import void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len);
import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB);
import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE);
import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end);
import void Texts_DumpReader (Texts_Reader re);
import Texts_Text Texts_ElemBase (Texts_Elem E);
import INT32 Texts_ElemPos (Texts_Elem E);
import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B);

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef VT100__h
#define VT100__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16
@ -82,7 +82,7 @@ void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len)
Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023);
Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023);
Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023);
extTools_execute((CHAR*)"Assemble: ", 11, cmd, 1023);
extTools_execute((CHAR*)"C compile: ", 12, cmd, 1023);
__DEL(moduleName);
}
@ -106,7 +106,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati
Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023);
Strings_Append(OPM_Model, 10, (void*)cmd, 1023);
Strings_Append((CHAR*)"", 1, (void*)cmd, 1023);
extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023);
extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 1023);
__DEL(additionalopts);
}

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef extTools__h
#define extTools__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */
#define SHORTINT INT8
#define INTEGER INT16
@ -122,7 +122,7 @@ static void Compiler_FindLocalObjectFiles (CHAR *objectnames, ADDRESS objectname
Strings_Append((CHAR*)" ", 2, (void*)objectnames, objectnames__len);
Strings_Append(fn, 64, (void*)objectnames, objectnames__len);
} else {
OPM_LogVT100((CHAR*)"33m", 4);
OPM_LogVT100((CHAR*)"91m", 4);
OPM_LogWStr((CHAR*)"Link warning: a local symbol file is present for module ", 57);
OPM_LogWStr(l->name, 256);
OPM_LogWStr((CHAR*)", but local object file '", 26);

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. 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/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__MOVE("2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__ENDMOD;
}

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef Configuration__h
#define Configuration__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
#define SHORTINT INT8
#define INTEGER INT16
@ -69,9 +69,6 @@ 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);
@ -102,7 +99,6 @@ 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);
@ -116,132 +112,6 @@ export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS
#define Files_IdxTrap() __HALT(-1)
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_Hex((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_Ln();
Out_HexDump((void*)b->data, 4096);
Files_Spaces(indent);
Out_String((CHAR*)"f: ", 7);
if (b->f == NIL) {
Out_String((CHAR*)"<NIL>", 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*)"<NIL>", 6);
Out_Ln();
} else {
Out_Ln();
Files_DumpBuffer(r.buf, indent + 1);
}
}
static void Files_Assert (BOOLEAN truth)
{
if (!truth) {

View file

@ -1,19 +1,10 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
/* voc 2.00 [2016/12/20]. 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;
@ -34,16 +25,12 @@ 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);

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
#ifndef Heap__h
#define Heap__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef Modules__h
#define Modules__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef OPB__h
#define OPB__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef OPC__h
#define OPC__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16
@ -63,6 +63,7 @@ export void OPM_Init (BOOLEAN *done);
export void OPM_InitOptions (void);
export INT16 OPM_Integer (INT64 n);
static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len);
export void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len);
static void OPM_LogErrMsg (INT16 n);
export void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len);
export void OPM_LogW (CHAR ch);
@ -92,7 +93,6 @@ export void OPM_SymWInt (INT64 i);
export void OPM_SymWLReal (LONGREAL lr);
export void OPM_SymWReal (REAL r);
export void OPM_SymWSet (UINT64 s);
static void OPM_VerboseListSizes (void);
export void OPM_Write (CHAR ch);
export void OPM_WriteHex (INT64 i);
export void OPM_WriteInt (INT64 i);
@ -136,6 +136,27 @@ void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len)
__DEL(vt100code);
}
void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len)
{
__DUP(modname, modname__len, CHAR);
OPM_LogWStr((CHAR*)"Compiling ", 11);
OPM_LogWStr(modname, modname__len);
if (__IN(18, OPM_Options, 32)) {
OPM_LogWStr((CHAR*)", s:", 5);
OPM_LogWNum(__ASHL(OPM_ShortintSize, 3), 1);
OPM_LogWStr((CHAR*)" i:", 4);
OPM_LogWNum(__ASHL(OPM_IntegerSize, 3), 1);
OPM_LogWStr((CHAR*)" l:", 4);
OPM_LogWNum(__ASHL(OPM_LongintSize, 3), 1);
OPM_LogWStr((CHAR*)" adr:", 6);
OPM_LogWNum(__ASHL(OPM_AddressSize, 3), 1);
OPM_LogWStr((CHAR*)" algn:", 7);
OPM_LogWNum(__ASHL(OPM_Alignment, 3), 1);
}
OPM_LogW('.');
__DEL(modname);
}
INT64 OPM_SignedMaximum (INT32 bytecount)
{
INT64 result;
@ -363,32 +384,6 @@ BOOLEAN OPM_OpenPar (void)
__RETCHK;
}
static void OPM_VerboseListSizes (void)
{
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Type Size", 15);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"SHORTINT ", 12);
OPM_LogWNum(OPM_ShortintSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"INTEGER ", 12);
OPM_LogWNum(OPM_IntegerSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"LONGINT ", 12);
OPM_LogWNum(OPM_LongintSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"SET ", 12);
OPM_LogWNum(OPM_LongintSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"ADDRESS ", 12);
OPM_LogWNum(OPM_AddressSize, 4);
OPM_LogWLn();
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Alignment: ", 12);
OPM_LogWNum(OPM_Alignment, 4);
OPM_LogWLn();
}
void OPM_InitOptions (void)
{
CHAR s[256];
@ -432,9 +427,6 @@ void OPM_InitOptions (void)
OPM_LongintSize = 4;
break;
}
if (__IN(18, OPM_Options, 32)) {
OPM_VerboseListSizes();
}
__MOVE(OPM_InstallDir, OPM_ResourceDir, 1024);
if (OPM_ResourceDir[0] != 0x00) {
Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024);
@ -491,17 +483,6 @@ void OPM_Get (CHAR *ch)
{
OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ);
Texts_Read(&OPM_inR, Texts_Reader__typ, &*ch);
if ((OPM_curpos == 0 && OPM_inR.eot)) {
OPM_LogWLn();
OPM_LogWStr((CHAR*)"DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = ", 53);
OPM_LogWNum((INT16)*ch, 1);
OPM_LogW('.');
Texts_DumpReader(OPM_inR);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Heap dump:", 11);
OPM_LogWLn();
Out_DumpHeap();
}
if ((*ch < 0x09 && !OPM_inR.eot)) {
*ch = ' ';
}

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef OPM__h
#define OPM__h
@ -33,6 +33,7 @@ import void OPM_Get (CHAR *ch);
import void OPM_Init (BOOLEAN *done);
import void OPM_InitOptions (void);
import INT16 OPM_Integer (INT64 n);
import void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len);
import void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len);
import void OPM_LogW (CHAR ch);
import void OPM_LogWLn (void);

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16
@ -1796,9 +1796,7 @@ void OPP_Module (OPT_Node *prog, UINT32 opt)
OPP_err(16);
}
if (OPP_sym == 38) {
OPM_LogWStr((CHAR*)"compiling ", 11);
OPM_LogWStr(OPS_name, 256);
OPM_LogW('.');
OPM_LogCompiling(OPS_name, 256);
OPT_Init(OPS_name, opt);
OPS_Get(&OPP_sym);
OPP_CheckSym(39);

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef OPP__h
#define OPP__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
#ifndef OPS__h
#define OPS__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef OPT__h
#define OPT__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef OPV__h
#define OPV__h

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16
@ -14,19 +14,10 @@ export BOOLEAN Out_IsConsole;
static CHAR Out_buf[128];
static INT16 Out_in;
static ADDRESS *typedesc__11__typ;
static ADDRESS *blockdesc__5__typ;
static ADDRESS *chunkdesc__7__typ;
export void Out_Char (CHAR ch);
export void Out_DumpHeap (void);
static void Out_DumpModule (Heap_Module m);
export void Out_DumpTag (INT64 addr);
export void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len);
export void Out_Flush (void);
export void Out_Hex (INT64 x, INT64 n);
export void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len);
export void Out_HexDumpAdr (INT64 adr, INT64 offset, INT32 length);
export void Out_Int (INT64 x, INT64 n);
static INT32 Out_Length (CHAR *s, ADDRESS s__len);
export void Out_Ln (void);
@ -40,8 +31,6 @@ static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i);
static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i);
#define Out_Entier64(x) (INT64)(x)
extern ADDRESS Heap_heap;
#define Out_getheap() Heap_heap
void Out_Flush (void)
{
@ -139,8 +128,10 @@ void Out_Hex (INT64 x, INT64 n)
} else if (n > 16) {
n = 16;
}
while ((n < 16 && __LSH(x, -__ASHL(n, 2), 64) != 0)) {
n += 1;
if (x >= 0) {
while ((n < 16 && __LSH(x, -__ASHL(n, 2), 64) != 0)) {
n += 1;
}
}
x = __ROT(x, __ASHL(16 - n, 2), 64);
while (n > 0) {
@ -160,235 +151,6 @@ void Out_Ln (void)
Out_Flush();
}
void Out_HexDumpAdr (INT64 adr, INT64 offset, INT32 length)
{
INT16 i;
INT64 n, lim;
CHAR c;
lim = (INT64)(adr + (INT64)length);
while (adr < lim) {
if (adr + 16 < lim) {
n = 16;
} else {
n = lim - adr;
}
Out_Hex(offset, 8);
Out_Char(' ');
i = 0;
while ((INT64)i < n) {
if (__MASK(i, -4) == 0) {
Out_Char(' ');
}
__GET(adr + (INT64)i, c, CHAR);
Out_Hex((INT16)c, 2);
Out_Char(' ');
i += 1;
}
while (i < 16) {
if (__MASK(i, -4) == 0) {
Out_Char(' ');
}
Out_String((CHAR*)" ", 4);
i += 1;
}
Out_String((CHAR*)" ", 2);
i = 0;
while ((INT64)i < n) {
__GET(adr + (INT64)i, c, CHAR);
if ((INT16)c < 32 || (INT16)c > 126) {
Out_Char('.');
} else {
Out_Char(c);
}
i += 1;
}
adr += n;
offset += n;
Out_Ln();
}
}
void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len)
{
Out_HexDumpAdr((ADDRESS)m, 0, m__len);
}
static void Out_DumpModule (Heap_Module m)
{
Out_String((CHAR*)" next: ", 19);
Out_Hex((INT64)(ADDRESS)m->next, 1);
Out_Ln();
Out_String((CHAR*)" name: ", 19);
Out_String(m->name, 20);
Out_Ln();
Out_String((CHAR*)" refcnt: ", 19);
Out_Hex(m->refcnt, 1);
Out_Ln();
Out_String((CHAR*)" cmds: ", 19);
Out_Hex((INT64)(ADDRESS)m->cmds, 1);
Out_Ln();
Out_String((CHAR*)" types: ", 19);
Out_Hex(m->types, 1);
Out_Ln();
Out_String((CHAR*)" enumPtrs: ", 19);
Out_Hex((INT64)(ADDRESS)m->enumPtrs, 1);
Out_Ln();
}
typedef
struct typedesc__11 *tag__10;
typedef
struct typedesc__11 {
INT64 tag, next, level, module;
CHAR name[24];
INT64 bases[16];
INT64 reserved, blksz, ptr0;
} typedesc__11;
void Out_DumpTag (INT64 addr)
{
tag__10 desc = NIL;
INT16 i;
Out_String((CHAR*)" obj tag: ", 17);
Out_Hex(addr, 1);
Out_Ln();
addr -= __MASK(addr, -2);
desc = (tag__10)(ADDRESS)(addr - 192);
Out_String((CHAR*)" desc at: ", 17);
Out_Hex((INT64)(ADDRESS)desc, 1);
Out_Ln();
Out_String((CHAR*)" desc contains:", 21);
Out_Ln();
Out_String((CHAR*)" tag: ", 17);
Out_Hex(desc->tag, 1);
Out_Ln();
Out_String((CHAR*)" next: ", 17);
Out_Hex(desc->next, 1);
Out_Ln();
Out_String((CHAR*)" level: ", 17);
Out_Hex(desc->level, 1);
Out_Ln();
Out_String((CHAR*)" module: ", 17);
Out_Hex(desc->module, 1);
Out_Ln();
if (desc->module != 0) {
Out_DumpModule((Heap_Module)(ADDRESS)desc->module);
}
Out_String((CHAR*)" name: ", 17);
Out_String(desc->name, 24);
Out_Ln();
Out_String((CHAR*)" bases: ", 17);
i = 0;
while (i < 16) {
Out_Hex(desc->bases[__X(i, 16)], 16);
if (__MASK(i, -4) == 3) {
Out_Ln();
Out_String((CHAR*)" ", 17);
} else {
Out_Char(' ');
}
i += 1;
}
Out_Ln();
Out_String((CHAR*)" reserved: ", 17);
Out_Hex(desc->reserved, 1);
Out_Ln();
Out_String((CHAR*)" blksz: ", 17);
Out_Hex(desc->blksz, 1);
Out_Ln();
Out_String((CHAR*)" ptr0: ", 17);
Out_Hex(desc->ptr0, 1);
Out_Ln();
}
void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len)
{
INT64 addr;
__GET((ADDRESS)o - 8, addr, INT64);
Out_DumpTag(addr);
}
typedef
INT64 (*adrptr__3)[1];
typedef
struct blockdesc__5 *block__4;
typedef
struct blockdesc__5 {
INT64 tag, size, sentinel, next;
} blockdesc__5;
typedef
struct chunkdesc__7 *chunk__6;
typedef
struct chunkdesc__7 {
INT64 next, end, reserved;
blockdesc__5 firstblock;
} chunkdesc__7;
void Out_DumpHeap (void)
{
INT64 caddr;
chunk__6 c = NIL;
INT64 baddr;
block__4 b = NIL;
adrptr__3 tag = NIL;
caddr = Heap_heap;
while (caddr != 0) {
Out_String((CHAR*)"Chunk at: ", 11);
Out_Hex(caddr, 1);
Out_Ln();
c = (chunk__6)(ADDRESS)caddr;
Out_String((CHAR*)" next: ", 11);
Out_Hex(c->next, 1);
Out_Ln();
Out_String((CHAR*)" end: ", 11);
Out_Hex(c->end, 1);
Out_String((CHAR*)" => size: ", 11);
Out_Hex(c->end - caddr, 1);
Out_Ln();
Out_String((CHAR*)" rsvd: ", 11);
Out_Hex(c->reserved, 1);
Out_Ln();
baddr = (ADDRESS)&c->firstblock;
while (c->end - baddr > 0) {
Out_String((CHAR*)" Block at: ", 15);
Out_Hex(baddr, 1);
Out_Ln();
b = (block__4)(ADDRESS)baddr;
tag = (adrptr__3)(ADDRESS)(b->tag - __MASK(b->tag, -2));
Out_String((CHAR*)" tag: ", 15);
Out_Hex(b->tag, 1);
if (__MASK(b->tag, -2) != 0) {
Out_String((CHAR*)" <--- ODD! ---", 15);
}
Out_Ln();
Out_String((CHAR*)" tag^: ", 15);
Out_Hex((*tag)[0], 1);
Out_Ln();
Out_String((CHAR*)" size: ", 15);
Out_Hex(b->size, 1);
Out_Ln();
Out_String((CHAR*)" sentinel: ", 15);
Out_Hex(b->sentinel, 1);
Out_Ln();
Out_String((CHAR*)" next: ", 15);
Out_Hex(b->next, 1);
Out_Ln();
if (b->tag != (ADDRESS)&b->size) {
Out_DumpTag(b->tag);
}
baddr += (*tag)[0];
Out_Ln();
}
caddr = c->next;
Out_Ln();
}
}
static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i)
{
*i -= 1;
@ -566,9 +328,6 @@ void Out_LongReal (LONGREAL x, INT16 n)
Out_RealP(x, n, 1);
}
__TDESC(typedesc__11, 1, 0) = {__TDFLDS("typedesc__11", 208), {-8}};
__TDESC(blockdesc__5, 1, 0) = {__TDFLDS("blockdesc__5", 32), {-8}};
__TDESC(chunkdesc__7, 1, 0) = {__TDFLDS("chunkdesc__7", 56), {-8}};
export void *Out__init(void)
{
@ -576,13 +335,9 @@ export void *Out__init(void)
__MODULE_IMPORT(Heap);
__MODULE_IMPORT(Platform);
__REGMOD("Out", 0);
__REGCMD("DumpHeap", Out_DumpHeap);
__REGCMD("Flush", Out_Flush);
__REGCMD("Ln", Out_Ln);
__REGCMD("Open", Out_Open);
__INITYP(typedesc__11, typedesc__11, 0);
__INITYP(blockdesc__5, blockdesc__5, 0);
__INITYP(chunkdesc__7, chunkdesc__7, 0);
/* BEGIN */
Out_IsConsole = Platform_IsConsole(1);
Out_in = 0;

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#ifndef Out__h
#define Out__h
@ -10,13 +10,8 @@ import BOOLEAN Out_IsConsole;
import void Out_Char (CHAR ch);
import void Out_DumpHeap (void);
import void Out_DumpTag (INT64 addr);
import void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len);
import void Out_Flush (void);
import void Out_Hex (INT64 x, INT64 n);
import void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len);
import void Out_HexDumpAdr (INT64 adr, INT64 offset, INT32 length);
import void Out_Int (INT64 x, INT64 n);
import void Out_Ln (void);
import void Out_LongReal (LONGREAL x, INT16 n);

View file

@ -1,4 +1,4 @@
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
#define SHORTINT INT8
#define INTEGER INT16

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