diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 7f7f4b26..28528f64 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 618bc77f..d9030dbe 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index f9e5e585..5bf17489 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index d645f05c..4eb27c8b 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index ad002606..6f5eb201 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -83,7 +83,6 @@ export int32 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); @@ -673,11 +672,6 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len) -{ - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); -} - Files_File Files_Base (Files_Rider *r, address *r__typ) { Files_File _o_result; diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 0518133f..c75a1073 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -40,7 +40,6 @@ import int32 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 905fcb24..945fbff7 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 @@ -39,7 +39,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - address obj; + int32 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -56,19 +56,19 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - address types; + int32 types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static address Heap_freeList[10]; -static address Heap_bigBlocks; -export address Heap_allocated; +static int32 Heap_freeList[10]; +static int32 Heap_bigBlocks; +export int32 Heap_allocated; static BOOLEAN Heap_firstTry; -static address Heap_heap, Heap_heapend; -export address Heap_heapsize; +static int32 Heap_heap, Heap_heapend; +export int32 Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -80,27 +80,27 @@ export address *Heap_FinDesc__typ; export address *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (address blksz); +static void Heap_ExtendHeap (int32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (address n, address *a, LONGINT a__len); +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (address q); -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); +static void Heap_Mark (int32 q); +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (address size); -export SYSTEM_PTR Heap_NEWREC (address tag); -static address Heap_NewChunk (address blksz); +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (int32 size); +export SYSTEM_PTR Heap_NEWREC (int32 tag); +static int32 Heap_NewChunk (int32 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, address typ); +export void Heap_REGTYP (Heap_Module m, int32 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (address l, address r, address *a, LONGINT a__len); +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -158,9 +158,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, address typ) +void Heap_REGTYP (Heap_Module m, int32 typ) { - __PUT(typ, m->types, address); + __PUT(typ, m->types, int32); m->types = typ; } @@ -169,17 +169,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static address Heap_NewChunk (address blksz) +static int32 Heap_NewChunk (int32 blksz) { - address _o_result; - address chnk; + int32 _o_result; + int32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), address); - __PUT(chnk + 12, chnk + 16, address); - __PUT(chnk + 16, blksz, address); - __PUT(chnk + 20, -4, address); - __PUT(chnk + 24, Heap_bigBlocks, address); + __PUT(chnk + 4, chnk + (12 + blksz), int32); + __PUT(chnk + 12, chnk + 16, int32); + __PUT(chnk + 16, blksz, int32); + __PUT(chnk + 20, -4, int32); + __PUT(chnk + 24, Heap_bigBlocks, int32); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -187,9 +187,9 @@ static address Heap_NewChunk (address blksz) return _o_result; } -static void Heap_ExtendHeap (address blksz) +static void Heap_ExtendHeap (int32 blksz) { - address size, chnk, j, next; + int32 size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -198,31 +198,31 @@ static void Heap_ExtendHeap (address blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, address); + __PUT(chnk, Heap_heap, int32); Heap_heap = chnk; } else { j = Heap_heap; - __GET(j, next, address); + __GET(j, next, int32); while ((next != 0 && chnk > next)) { j = next; - __GET(j, next, address); + __GET(j, next, int32); } - __PUT(chnk, next, address); - __PUT(j, chnk, address); + __PUT(chnk, next, int32); + __PUT(j, chnk, int32); } if (next == 0) { - __GET(chnk + 4, Heap_heapend, address); + __GET(chnk + 4, Heap_heapend, int32); } } } -SYSTEM_PTR Heap_NEWREC (address tag) +SYSTEM_PTR Heap_NEWREC (int32 tag) { SYSTEM_PTR _o_result; - address i, i0, di, blksz, restsize, t, adr, end, next, prev; + int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - __GET(tag, blksz, address); + __GET(tag, blksz, int32); i0 = __ASHR(blksz, 4); i = i0; if (i < 9) { @@ -233,17 +233,17 @@ SYSTEM_PTR Heap_NEWREC (address tag) } } if (i < 9) { - __GET(adr + 12, next, address); + __GET(adr + 12, next, int32); Heap_freeList[i] = next; if (i != i0) { di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, address); - __PUT(end + 8, -4, address); - __PUT(end, end + 4, address); - __PUT(adr + 4, restsize, address); - __PUT(adr + 12, Heap_freeList[di], address); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; adr += restsize; } @@ -274,31 +274,31 @@ SYSTEM_PTR Heap_NEWREC (address tag) return _o_result; } } - __GET(adr + 4, t, address); + __GET(adr + 4, t, int32); if (t >= blksz) { break; } prev = adr; - __GET(adr + 12, adr, address); + __GET(adr + 12, adr, int32); } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, address); - __PUT(end + 8, -4, address); - __PUT(end, end + 4, address); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); if (restsize > 144) { - __PUT(adr + 4, restsize, address); + __PUT(adr + 4, restsize, int32); } else { - __GET(adr + 12, next, address); + __GET(adr + 12, next, int32); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, address); + __PUT(prev + 12, next, int32); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, address); - __PUT(adr + 12, Heap_freeList[di], address); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; } } @@ -307,72 +307,72 @@ SYSTEM_PTR Heap_NEWREC (address tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, address); - __PUT(i + 4, 0, address); - __PUT(i + 8, 0, address); - __PUT(i + 12, 0, address); + __PUT(i, 0, int32); + __PUT(i + 4, 0, int32); + __PUT(i + 8, 0, int32); + __PUT(i + 12, 0, int32); i += 16; } - __PUT(adr + 12, 0, address); - __PUT(adr, tag, address); - __PUT(adr + 4, 0, address); - __PUT(adr + 8, 0, address); + __PUT(adr + 12, 0, int32); + __PUT(adr, tag, int32); + __PUT(adr + 4, 0, int32); + __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(address)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (address size) +SYSTEM_PTR Heap_NEWBLK (int32 size) { SYSTEM_PTR _o_result; - address blksz, tag; + int32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((address)&blksz); - tag = ((address)(address)new + blksz) - 12; - __PUT(tag - 4, 0, address); - __PUT(tag, blksz, address); - __PUT(tag + 4, -4, address); - __PUT((address)(address)new - 4, tag, address); + tag = ((int32)(address)new + blksz) - 12; + __PUT(tag - 4, 0, int32); + __PUT(tag, blksz, int32); + __PUT(tag + 4, -4, int32); + __PUT((int32)(address)new - 4, tag, int32); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (address q) +static void Heap_Mark (int32 q) { - address p, tag, offset, fld, n, tagbits; + int32 p, tag, offset, fld, n, tagbits; if (q != 0) { - __GET(q - 4, tagbits, address); + __GET(q - 4, tagbits, int32); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, address); + __PUT(q - 4, tagbits + 1, int32); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, address); + __GET(tag, offset, int32); if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, address); + __PUT(q - 4, (tag + offset) + 1, int32); if (p == 0) { break; } n = q; q = p; - __GET(q - 4, tag, address); + __GET(q - 4, tag, int32); tag -= 1; - __GET(tag, offset, address); + __GET(tag, offset, int32); fld = q + offset; - __GET(fld, p, address); + __GET(fld, p, int32); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - __GET(fld, n, address); + __GET(fld, n, int32); if (n != 0) { - __GET(n - 4, tagbits, address); + __GET(n - 4, tagbits, int32); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, address); - __PUT(q - 4, tag + 1, address); + __PUT(n - 4, tagbits + 1, int32); + __PUT(q - 4, tag + 1, int32); __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; @@ -388,12 +388,12 @@ static void Heap_Mark (address q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((address)(address)p); + Heap_Mark((int32)(address)p); } static void Heap_Scan (void) { - address chnk, adr, end, start, tag, i, size, freesize; + int32 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -405,58 +405,58 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 12; - __GET(chnk + 4, end, address); + __GET(chnk + 4, end, int32); while (adr < end) { - __GET(adr, tag, address); + __GET(adr, tag, int32); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, address); - __PUT(start + 4, freesize, address); - __PUT(start + 8, -4, address); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], address); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, address); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, address); - __GET(tag, size, address); + __PUT(adr, tag, int32); + __GET(tag, size, int32); Heap_allocated += size; adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int32); freesize += size; adr += size; } } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, address); - __PUT(start + 4, freesize, address); - __PUT(start + 8, -4, address); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], address); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, address); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int32); } } -static void Heap_Sift (address l, address r, address *a, LONGINT a__len) +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) { - address i, j, x; + int32 i, j, x; j = l; x = a[j]; for (;;) { @@ -473,9 +473,9 @@ static void Heap_Sift (address l, address r, address *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (address n, address *a, LONGINT a__len) +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) { - address l, r, x; + int32 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -491,25 +491,25 @@ static void Heap_HeapSort (address n, address *a, LONGINT a__len) } } -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) { - address chnk, adr, tag, next, lim, lim1, i, ptr, size; + int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 12; - __GET(chnk + 4, lim1, address); + __GET(chnk + 4, lim1, int32); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - __GET(adr, tag, address); + __GET(adr, tag, int32); if (__ODD(tag)) { - __GET(tag - 1, size, address); + __GET(tag - 1, size, int32); adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int32); ptr = adr + 4; while (cand[i] < ptr) { i += 1; @@ -524,17 +524,17 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) adr = next; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int32); } } static void Heap_CheckFin (void) { Heap_FinNode n; - address tag; + int32 tag; n = Heap_fin; while (n != NIL) { - __GET(n->obj - 4, tag, address); + __GET(n->obj - 4, tag, int32); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -580,10 +580,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - address inc, nofcand, sp, p, stack0; + int32 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -600,7 +600,7 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, address); + __GET(sp, p, int32); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -622,8 +622,8 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - address cand[10000]; + int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + int32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(address)Heap_modules; @@ -703,7 +703,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (address)(address)obj; + f->obj = (int32)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -713,8 +713,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); - __GET(Heap_heap + 4, Heap_heapend, address); - __PUT(Heap_heap, 0, address); + __GET(Heap_heap + 4, Heap_heapend, int32); + __PUT(Heap_heap, 0, int32); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 3ea975a7..eccb5d85 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import address Heap_allocated, Heap_heapsize; +import int32 Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import address *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (address size); -import SYSTEM_PTR Heap_NEWREC (address tag); +import SYSTEM_PTR Heap_NEWBLK (int32 size); +import SYSTEM_PTR Heap_NEWREC (int32 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, address typ); +import void Heap_REGTYP (Heap_Module m, int32 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 21d62e05..a87d0732 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index d2d0a476..93e2105b 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 6c15aa17..d211135a 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -2449,12 +2449,8 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if (ap->typ != fp->typ) { - if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { - } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { - } else { - OPB_err(123); - } + } else if ((ap->typ != fp->typ && !((((fp->typ->form == 1 && __IN(ap->typ->form, 0x1e, 32))) && ap->typ->size == 1)))) { + OPB_err(123); } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 8395741b..97860bfc 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 9104c5c4..e4c0eb06 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 6236cd73..3325aded 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index abb5a584..7234f518 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index b62666db..e249edd5 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 66b821d2..1e5c6674 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index ea6663ba..3b9acd86 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 2b449cae..ee182741 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 8d90d974..1514d9eb 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 7405b27f..c1b4cb67 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 1a525fcb..d4f953ba 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index cdb2ab50..a70a40bf 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 09931dda..0a9135f5 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index e95203ed..ef0c0dbe 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - address (*Platform_ArgVecPtr)[1]; + int32 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -31,12 +31,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export address Platform_MainStackFrame; +export int32 Platform_MainStackFrame; export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[256]; export int16 Platform_ArgCount; -export address Platform_ArgVector; +export int32 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -64,15 +64,15 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, address argvadr); +export void Platform_Init (int16 argc, int32 argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export address Platform_OSAllocate (address size); -export void Platform_OSFree (address address); +export int32 Platform_OSAllocate (int32 size); +export void Platform_OSFree (int32 address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -92,7 +92,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 l); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, address p, int32 l); +export int16 Platform_Write (int32 h, int32 p, int32 l); static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -218,19 +218,19 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -address Platform_OSAllocate (address size) +int32 Platform_OSAllocate (int32 size) { - address _o_result; + int32 _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (address address) +void Platform_OSFree (int32 address) { Platform_free(address); } -void Platform_Init (int16 argc, address argvadr) +void Platform_Init (int16 argc, int32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -517,7 +517,7 @@ int16 Platform_Size (int32 h, int32 *l) return _o_result; } -int16 Platform_Read (int32 h, address p, int32 l, int32 *n) +int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) { int16 _o_result; *n = Platform_readfile(h, p, l); @@ -547,10 +547,10 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, address p, int32 l) +int16 Platform_Write (int32 h, int32 p, int32 l) { int16 _o_result; - address written; + int32 written; written = Platform_writefile(h, p, l); if (written < 0) { _o_result = Platform_err(); diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index d76d7ed5..986a65ef 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -7,7 +7,8 @@ typedef struct Platform_FileIdentity { - int32 volume, index, mtime; + int32 _prvt0; + char _prvt1[8]; } Platform_FileIdentity; typedef @@ -18,12 +19,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import address Platform_MainStackFrame; +import int32 Platform_MainStackFrame; import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[256]; import int16 Platform_ArgCount; -import address Platform_ArgVector; +import int32 Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; @@ -48,15 +49,15 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, address argvadr); +import void Platform_Init (int16 argc, int32 argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import address Platform_OSAllocate (address size); -import void Platform_OSFree (address address); +import int32 Platform_OSAllocate (int32 size); +import void Platform_OSFree (int32 address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -75,7 +76,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 l); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, address p, int32 l); +import int16 Platform_Write (int32 h, int32 p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 4b72fbe3..e75d35ff 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 4a4c73b0..8a42b39b 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index f765b98f..9f9562db 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index be1e7d7f..da213d81 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 28dd23c6..9d981ce0 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 56d3fd40..1faae4d6 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c deleted file mode 100644 index 30b81ac7..00000000 --- a/bootstrap/unix-44/Vishap.c +++ /dev/null @@ -1,171 +0,0 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ - -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 - -#include "SYSTEM.h" -#include "Configuration.h" -#include "Heap.h" -#include "OPB.h" -#include "OPC.h" -#include "OPM.h" -#include "OPP.h" -#include "OPT.h" -#include "OPV.h" -#include "Platform.h" -#include "Strings.h" -#include "extTools.h" -#include "vt100.h" - - -static CHAR Vishap_mname[256]; - - -export void Vishap_Module (BOOLEAN *done); -static void Vishap_PropagateElementaryTypeSizes (void); -export void Vishap_Translate (void); -static void Vishap_Trap (int16 sig); - - -void Vishap_Module (BOOLEAN *done) -{ - BOOLEAN ext, new; - OPT_Node p = NIL; - OPP_Module(&p, OPM_opt); - if (OPM_noerr) { - OPV_Init(); - OPT_InitRecno(); - OPV_AdrAndSize(OPT_topScope); - OPT_Export(&ext, &new); - if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, 256); - OPC_Init(); - OPV_Module(p); - if (OPM_noerr) { - if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { - OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - } else { - if (new) { - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - OPM_RegisterNewSym(); - } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", 24); - OPM_RegisterNewSym(); - } - } - } else { - OPM_DeleteNewSym(); - } - } - } - OPM_CloseFiles(); - OPT_Close(); - OPM_LogWLn(); - *done = OPM_noerr; -} - -static void Vishap_PropagateElementaryTypeSizes (void) -{ - OPT_sysptrtyp->size = OPM_AddressSize; - OPT_adrtyp->size = OPM_AddressSize; - OPT_settyp->size = OPM_SetSize; - OPT_sinttyp = OPT_IntType(OPM_ShortintSize); - OPT_inttyp = OPT_IntType(OPM_IntegerSize); - OPT_linttyp = OPT_IntType(OPM_LongintSize); - OPT_sintobj->typ = OPT_sinttyp; - OPT_intobj->typ = OPT_inttyp; - OPT_lintobj->typ = OPT_linttyp; -} - -void Vishap_Translate (void) -{ - BOOLEAN done; - CHAR modulesobj[2048]; - modulesobj[0] = 0x00; - if (OPM_OpenPar()) { - for (;;) { - OPM_Init(&done, (void*)Vishap_mname, 256); - if (!done) { - return; - } - OPM_InitOptions(); - Vishap_PropagateElementaryTypeSizes(); - Heap_GC(0); - Vishap_Module(&done); - if (!done) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", 27); - OPM_LogWLn(); - Platform_Exit(1); - } - if (!__IN(13, OPM_opt, 32)) { - if (__IN(14, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - } else { - if (!__IN(10, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); - Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); - Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); - } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); - } - } - } - } - } -} - -static void Vishap_Trap (int16 sig) -{ - Heap_FINALL(); - if (sig == 3) { - Platform_Exit(0); - } else { - if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); - OPM_LogWLn(); - } - Platform_Exit(2); - } -} - - -export int main(int argc, char **argv) -{ - __INIT(argc, argv); - __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Heap); - __MODULE_IMPORT(OPB); - __MODULE_IMPORT(OPC); - __MODULE_IMPORT(OPM); - __MODULE_IMPORT(OPP); - __MODULE_IMPORT(OPT); - __MODULE_IMPORT(OPV); - __MODULE_IMPORT(Platform); - __MODULE_IMPORT(Strings); - __MODULE_IMPORT(extTools); - __MODULE_IMPORT(vt100); - __REGMAIN("Vishap", 0); - __REGCMD("Translate", Vishap_Translate); -/* BEGIN */ - Platform_SetInterruptHandler(Vishap_Trap); - Platform_SetQuitHandler(Vishap_Trap); - Platform_SetBadInstructionHandler(Vishap_Trap); - Vishap_Translate(); - __FINI; -} diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index d465624d..34e6fae3 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index cf093ab3..ce275b8c 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 46f8ac7e..fd7974da 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 700e6b39..f87adfac 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 8d4cbdfc..ca56f466 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index da86e98b..f5b8588f 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 7f7f4b26..28528f64 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 618bc77f..d9030dbe 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index f9e5e585..5bf17489 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index d645f05c..4eb27c8b 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index ad002606..6f5eb201 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -83,7 +83,6 @@ export int32 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); @@ -673,11 +672,6 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len) -{ - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); -} - Files_File Files_Base (Files_Rider *r, address *r__typ) { Files_File _o_result; diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 0518133f..c75a1073 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -40,7 +40,6 @@ import int32 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 905fcb24..945fbff7 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 @@ -39,7 +39,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - address obj; + int32 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -56,19 +56,19 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - address types; + int32 types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static address Heap_freeList[10]; -static address Heap_bigBlocks; -export address Heap_allocated; +static int32 Heap_freeList[10]; +static int32 Heap_bigBlocks; +export int32 Heap_allocated; static BOOLEAN Heap_firstTry; -static address Heap_heap, Heap_heapend; -export address Heap_heapsize; +static int32 Heap_heap, Heap_heapend; +export int32 Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -80,27 +80,27 @@ export address *Heap_FinDesc__typ; export address *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (address blksz); +static void Heap_ExtendHeap (int32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (address n, address *a, LONGINT a__len); +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (address q); -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); +static void Heap_Mark (int32 q); +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (address size); -export SYSTEM_PTR Heap_NEWREC (address tag); -static address Heap_NewChunk (address blksz); +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (int32 size); +export SYSTEM_PTR Heap_NEWREC (int32 tag); +static int32 Heap_NewChunk (int32 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, address typ); +export void Heap_REGTYP (Heap_Module m, int32 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (address l, address r, address *a, LONGINT a__len); +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -158,9 +158,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, address typ) +void Heap_REGTYP (Heap_Module m, int32 typ) { - __PUT(typ, m->types, address); + __PUT(typ, m->types, int32); m->types = typ; } @@ -169,17 +169,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static address Heap_NewChunk (address blksz) +static int32 Heap_NewChunk (int32 blksz) { - address _o_result; - address chnk; + int32 _o_result; + int32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), address); - __PUT(chnk + 12, chnk + 16, address); - __PUT(chnk + 16, blksz, address); - __PUT(chnk + 20, -4, address); - __PUT(chnk + 24, Heap_bigBlocks, address); + __PUT(chnk + 4, chnk + (12 + blksz), int32); + __PUT(chnk + 12, chnk + 16, int32); + __PUT(chnk + 16, blksz, int32); + __PUT(chnk + 20, -4, int32); + __PUT(chnk + 24, Heap_bigBlocks, int32); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -187,9 +187,9 @@ static address Heap_NewChunk (address blksz) return _o_result; } -static void Heap_ExtendHeap (address blksz) +static void Heap_ExtendHeap (int32 blksz) { - address size, chnk, j, next; + int32 size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -198,31 +198,31 @@ static void Heap_ExtendHeap (address blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, address); + __PUT(chnk, Heap_heap, int32); Heap_heap = chnk; } else { j = Heap_heap; - __GET(j, next, address); + __GET(j, next, int32); while ((next != 0 && chnk > next)) { j = next; - __GET(j, next, address); + __GET(j, next, int32); } - __PUT(chnk, next, address); - __PUT(j, chnk, address); + __PUT(chnk, next, int32); + __PUT(j, chnk, int32); } if (next == 0) { - __GET(chnk + 4, Heap_heapend, address); + __GET(chnk + 4, Heap_heapend, int32); } } } -SYSTEM_PTR Heap_NEWREC (address tag) +SYSTEM_PTR Heap_NEWREC (int32 tag) { SYSTEM_PTR _o_result; - address i, i0, di, blksz, restsize, t, adr, end, next, prev; + int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - __GET(tag, blksz, address); + __GET(tag, blksz, int32); i0 = __ASHR(blksz, 4); i = i0; if (i < 9) { @@ -233,17 +233,17 @@ SYSTEM_PTR Heap_NEWREC (address tag) } } if (i < 9) { - __GET(adr + 12, next, address); + __GET(adr + 12, next, int32); Heap_freeList[i] = next; if (i != i0) { di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, address); - __PUT(end + 8, -4, address); - __PUT(end, end + 4, address); - __PUT(adr + 4, restsize, address); - __PUT(adr + 12, Heap_freeList[di], address); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; adr += restsize; } @@ -274,31 +274,31 @@ SYSTEM_PTR Heap_NEWREC (address tag) return _o_result; } } - __GET(adr + 4, t, address); + __GET(adr + 4, t, int32); if (t >= blksz) { break; } prev = adr; - __GET(adr + 12, adr, address); + __GET(adr + 12, adr, int32); } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, address); - __PUT(end + 8, -4, address); - __PUT(end, end + 4, address); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); if (restsize > 144) { - __PUT(adr + 4, restsize, address); + __PUT(adr + 4, restsize, int32); } else { - __GET(adr + 12, next, address); + __GET(adr + 12, next, int32); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, address); + __PUT(prev + 12, next, int32); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, address); - __PUT(adr + 12, Heap_freeList[di], address); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; } } @@ -307,72 +307,72 @@ SYSTEM_PTR Heap_NEWREC (address tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, address); - __PUT(i + 4, 0, address); - __PUT(i + 8, 0, address); - __PUT(i + 12, 0, address); + __PUT(i, 0, int32); + __PUT(i + 4, 0, int32); + __PUT(i + 8, 0, int32); + __PUT(i + 12, 0, int32); i += 16; } - __PUT(adr + 12, 0, address); - __PUT(adr, tag, address); - __PUT(adr + 4, 0, address); - __PUT(adr + 8, 0, address); + __PUT(adr + 12, 0, int32); + __PUT(adr, tag, int32); + __PUT(adr + 4, 0, int32); + __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(address)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (address size) +SYSTEM_PTR Heap_NEWBLK (int32 size) { SYSTEM_PTR _o_result; - address blksz, tag; + int32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((address)&blksz); - tag = ((address)(address)new + blksz) - 12; - __PUT(tag - 4, 0, address); - __PUT(tag, blksz, address); - __PUT(tag + 4, -4, address); - __PUT((address)(address)new - 4, tag, address); + tag = ((int32)(address)new + blksz) - 12; + __PUT(tag - 4, 0, int32); + __PUT(tag, blksz, int32); + __PUT(tag + 4, -4, int32); + __PUT((int32)(address)new - 4, tag, int32); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (address q) +static void Heap_Mark (int32 q) { - address p, tag, offset, fld, n, tagbits; + int32 p, tag, offset, fld, n, tagbits; if (q != 0) { - __GET(q - 4, tagbits, address); + __GET(q - 4, tagbits, int32); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, address); + __PUT(q - 4, tagbits + 1, int32); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, address); + __GET(tag, offset, int32); if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, address); + __PUT(q - 4, (tag + offset) + 1, int32); if (p == 0) { break; } n = q; q = p; - __GET(q - 4, tag, address); + __GET(q - 4, tag, int32); tag -= 1; - __GET(tag, offset, address); + __GET(tag, offset, int32); fld = q + offset; - __GET(fld, p, address); + __GET(fld, p, int32); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - __GET(fld, n, address); + __GET(fld, n, int32); if (n != 0) { - __GET(n - 4, tagbits, address); + __GET(n - 4, tagbits, int32); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, address); - __PUT(q - 4, tag + 1, address); + __PUT(n - 4, tagbits + 1, int32); + __PUT(q - 4, tag + 1, int32); __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; @@ -388,12 +388,12 @@ static void Heap_Mark (address q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((address)(address)p); + Heap_Mark((int32)(address)p); } static void Heap_Scan (void) { - address chnk, adr, end, start, tag, i, size, freesize; + int32 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -405,58 +405,58 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 12; - __GET(chnk + 4, end, address); + __GET(chnk + 4, end, int32); while (adr < end) { - __GET(adr, tag, address); + __GET(adr, tag, int32); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, address); - __PUT(start + 4, freesize, address); - __PUT(start + 8, -4, address); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], address); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, address); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, address); - __GET(tag, size, address); + __PUT(adr, tag, int32); + __GET(tag, size, int32); Heap_allocated += size; adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int32); freesize += size; adr += size; } } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, address); - __PUT(start + 4, freesize, address); - __PUT(start + 8, -4, address); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], address); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, address); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int32); } } -static void Heap_Sift (address l, address r, address *a, LONGINT a__len) +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) { - address i, j, x; + int32 i, j, x; j = l; x = a[j]; for (;;) { @@ -473,9 +473,9 @@ static void Heap_Sift (address l, address r, address *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (address n, address *a, LONGINT a__len) +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) { - address l, r, x; + int32 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -491,25 +491,25 @@ static void Heap_HeapSort (address n, address *a, LONGINT a__len) } } -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) { - address chnk, adr, tag, next, lim, lim1, i, ptr, size; + int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 12; - __GET(chnk + 4, lim1, address); + __GET(chnk + 4, lim1, int32); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - __GET(adr, tag, address); + __GET(adr, tag, int32); if (__ODD(tag)) { - __GET(tag - 1, size, address); + __GET(tag - 1, size, int32); adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int32); ptr = adr + 4; while (cand[i] < ptr) { i += 1; @@ -524,17 +524,17 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) adr = next; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int32); } } static void Heap_CheckFin (void) { Heap_FinNode n; - address tag; + int32 tag; n = Heap_fin; while (n != NIL) { - __GET(n->obj - 4, tag, address); + __GET(n->obj - 4, tag, int32); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -580,10 +580,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - address inc, nofcand, sp, p, stack0; + int32 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -600,7 +600,7 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, address); + __GET(sp, p, int32); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -622,8 +622,8 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - address cand[10000]; + int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + int32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(address)Heap_modules; @@ -703,7 +703,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (address)(address)obj; + f->obj = (int32)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -713,8 +713,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); - __GET(Heap_heap + 4, Heap_heapend, address); - __PUT(Heap_heap, 0, address); + __GET(Heap_heap + 4, Heap_heapend, int32); + __PUT(Heap_heap, 0, int32); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 3ea975a7..eccb5d85 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import address Heap_allocated, Heap_heapsize; +import int32 Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import address *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (address size); -import SYSTEM_PTR Heap_NEWREC (address tag); +import SYSTEM_PTR Heap_NEWBLK (int32 size); +import SYSTEM_PTR Heap_NEWREC (int32 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, address typ); +import void Heap_REGTYP (Heap_Module m, int32 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 21d62e05..a87d0732 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index d2d0a476..93e2105b 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 6c15aa17..d211135a 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -2449,12 +2449,8 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if (ap->typ != fp->typ) { - if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { - } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { - } else { - OPB_err(123); - } + } else if ((ap->typ != fp->typ && !((((fp->typ->form == 1 && __IN(ap->typ->form, 0x1e, 32))) && ap->typ->size == 1)))) { + OPB_err(123); } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 8395741b..97860bfc 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 9104c5c4..e4c0eb06 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 6236cd73..3325aded 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index abb5a584..7234f518 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index b62666db..e249edd5 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 66b821d2..1e5c6674 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index ea6663ba..3b9acd86 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 2b449cae..ee182741 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 8d90d974..1514d9eb 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 1b69128c..0a1f8f54 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 1a525fcb..d4f953ba 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index cdb2ab50..a70a40bf 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 09931dda..0a9135f5 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index e95203ed..ef0c0dbe 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - address (*Platform_ArgVecPtr)[1]; + int32 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -31,12 +31,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export address Platform_MainStackFrame; +export int32 Platform_MainStackFrame; export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[256]; export int16 Platform_ArgCount; -export address Platform_ArgVector; +export int32 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -64,15 +64,15 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, address argvadr); +export void Platform_Init (int16 argc, int32 argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export address Platform_OSAllocate (address size); -export void Platform_OSFree (address address); +export int32 Platform_OSAllocate (int32 size); +export void Platform_OSFree (int32 address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -92,7 +92,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 l); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, address p, int32 l); +export int16 Platform_Write (int32 h, int32 p, int32 l); static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -218,19 +218,19 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -address Platform_OSAllocate (address size) +int32 Platform_OSAllocate (int32 size) { - address _o_result; + int32 _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (address address) +void Platform_OSFree (int32 address) { Platform_free(address); } -void Platform_Init (int16 argc, address argvadr) +void Platform_Init (int16 argc, int32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -517,7 +517,7 @@ int16 Platform_Size (int32 h, int32 *l) return _o_result; } -int16 Platform_Read (int32 h, address p, int32 l, int32 *n) +int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) { int16 _o_result; *n = Platform_readfile(h, p, l); @@ -547,10 +547,10 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, address p, int32 l) +int16 Platform_Write (int32 h, int32 p, int32 l) { int16 _o_result; - address written; + int32 written; written = Platform_writefile(h, p, l); if (written < 0) { _o_result = Platform_err(); diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index d76d7ed5..986a65ef 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -7,7 +7,8 @@ typedef struct Platform_FileIdentity { - int32 volume, index, mtime; + int32 _prvt0; + char _prvt1[8]; } Platform_FileIdentity; typedef @@ -18,12 +19,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import address Platform_MainStackFrame; +import int32 Platform_MainStackFrame; import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[256]; import int16 Platform_ArgCount; -import address Platform_ArgVector; +import int32 Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; @@ -48,15 +49,15 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, address argvadr); +import void Platform_Init (int16 argc, int32 argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import address Platform_OSAllocate (address size); -import void Platform_OSFree (address address); +import int32 Platform_OSAllocate (int32 size); +import void Platform_OSFree (int32 address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -75,7 +76,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 l); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, address p, int32 l); +import int16 Platform_Write (int32 h, int32 p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 4b72fbe3..e75d35ff 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 4a4c73b0..8a42b39b 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index f765b98f..9f9562db 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index be1e7d7f..da213d81 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 779daa7a..ab510cdb 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 07f53445..64e78861 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c deleted file mode 100644 index 30b81ac7..00000000 --- a/bootstrap/unix-48/Vishap.c +++ /dev/null @@ -1,171 +0,0 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ - -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 - -#include "SYSTEM.h" -#include "Configuration.h" -#include "Heap.h" -#include "OPB.h" -#include "OPC.h" -#include "OPM.h" -#include "OPP.h" -#include "OPT.h" -#include "OPV.h" -#include "Platform.h" -#include "Strings.h" -#include "extTools.h" -#include "vt100.h" - - -static CHAR Vishap_mname[256]; - - -export void Vishap_Module (BOOLEAN *done); -static void Vishap_PropagateElementaryTypeSizes (void); -export void Vishap_Translate (void); -static void Vishap_Trap (int16 sig); - - -void Vishap_Module (BOOLEAN *done) -{ - BOOLEAN ext, new; - OPT_Node p = NIL; - OPP_Module(&p, OPM_opt); - if (OPM_noerr) { - OPV_Init(); - OPT_InitRecno(); - OPV_AdrAndSize(OPT_topScope); - OPT_Export(&ext, &new); - if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, 256); - OPC_Init(); - OPV_Module(p); - if (OPM_noerr) { - if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { - OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - } else { - if (new) { - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - OPM_RegisterNewSym(); - } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", 24); - OPM_RegisterNewSym(); - } - } - } else { - OPM_DeleteNewSym(); - } - } - } - OPM_CloseFiles(); - OPT_Close(); - OPM_LogWLn(); - *done = OPM_noerr; -} - -static void Vishap_PropagateElementaryTypeSizes (void) -{ - OPT_sysptrtyp->size = OPM_AddressSize; - OPT_adrtyp->size = OPM_AddressSize; - OPT_settyp->size = OPM_SetSize; - OPT_sinttyp = OPT_IntType(OPM_ShortintSize); - OPT_inttyp = OPT_IntType(OPM_IntegerSize); - OPT_linttyp = OPT_IntType(OPM_LongintSize); - OPT_sintobj->typ = OPT_sinttyp; - OPT_intobj->typ = OPT_inttyp; - OPT_lintobj->typ = OPT_linttyp; -} - -void Vishap_Translate (void) -{ - BOOLEAN done; - CHAR modulesobj[2048]; - modulesobj[0] = 0x00; - if (OPM_OpenPar()) { - for (;;) { - OPM_Init(&done, (void*)Vishap_mname, 256); - if (!done) { - return; - } - OPM_InitOptions(); - Vishap_PropagateElementaryTypeSizes(); - Heap_GC(0); - Vishap_Module(&done); - if (!done) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", 27); - OPM_LogWLn(); - Platform_Exit(1); - } - if (!__IN(13, OPM_opt, 32)) { - if (__IN(14, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - } else { - if (!__IN(10, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); - Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); - Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); - } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); - } - } - } - } - } -} - -static void Vishap_Trap (int16 sig) -{ - Heap_FINALL(); - if (sig == 3) { - Platform_Exit(0); - } else { - if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); - OPM_LogWLn(); - } - Platform_Exit(2); - } -} - - -export int main(int argc, char **argv) -{ - __INIT(argc, argv); - __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Heap); - __MODULE_IMPORT(OPB); - __MODULE_IMPORT(OPC); - __MODULE_IMPORT(OPM); - __MODULE_IMPORT(OPP); - __MODULE_IMPORT(OPT); - __MODULE_IMPORT(OPV); - __MODULE_IMPORT(Platform); - __MODULE_IMPORT(Strings); - __MODULE_IMPORT(extTools); - __MODULE_IMPORT(vt100); - __REGMAIN("Vishap", 0); - __REGCMD("Translate", Vishap_Translate); -/* BEGIN */ - Platform_SetInterruptHandler(Vishap_Trap); - Platform_SetQuitHandler(Vishap_Trap); - Platform_SetBadInstructionHandler(Vishap_Trap); - Vishap_Translate(); - __FINI; -} diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index d465624d..34e6fae3 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index cf093ab3..ce275b8c 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 46f8ac7e..fd7974da 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 700e6b39..f87adfac 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 8d4cbdfc..ca56f466 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index da86e98b..f5b8588f 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 7f7f4b26..28528f64 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 618bc77f..d9030dbe 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index f9e5e585..5bf17489 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index d645f05c..4eb27c8b 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index d7e16dab..5b82978c 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -83,7 +83,6 @@ export int32 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); @@ -673,11 +672,6 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len) -{ - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); -} - Files_File Files_Base (Files_Rider *r, address *r__typ) { Files_File _o_result; diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 64d47c3f..75495244 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -42,7 +42,6 @@ import int32 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 785efa1a..ca208a31 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 @@ -39,7 +39,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - address obj; + int64 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -56,19 +56,19 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - address types; + int64 types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static address Heap_freeList[10]; -static address Heap_bigBlocks; -export address Heap_allocated; +static int64 Heap_freeList[10]; +static int64 Heap_bigBlocks; +export int64 Heap_allocated; static BOOLEAN Heap_firstTry; -static address Heap_heap, Heap_heapend; -export address Heap_heapsize; +static int64 Heap_heap, Heap_heapend; +export int64 Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -80,27 +80,27 @@ export address *Heap_FinDesc__typ; export address *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (address blksz); +static void Heap_ExtendHeap (int64 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (address n, address *a, LONGINT a__len); +static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (address q); -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); +static void Heap_Mark (int64 q); +static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (address size); -export SYSTEM_PTR Heap_NEWREC (address tag); -static address Heap_NewChunk (address blksz); +static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (int64 size); +export SYSTEM_PTR Heap_NEWREC (int64 tag); +static int64 Heap_NewChunk (int64 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, address typ); +export void Heap_REGTYP (Heap_Module m, int64 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (address l, address r, address *a, LONGINT a__len); +static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -158,9 +158,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, address typ) +void Heap_REGTYP (Heap_Module m, int64 typ) { - __PUT(typ, m->types, address); + __PUT(typ, m->types, int64); m->types = typ; } @@ -169,17 +169,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static address Heap_NewChunk (address blksz) +static int64 Heap_NewChunk (int64 blksz) { - address _o_result; - address chnk; + int64 _o_result; + int64 chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), address); - __PUT(chnk + 24, chnk + 32, address); - __PUT(chnk + 32, blksz, address); - __PUT(chnk + 40, -8, address); - __PUT(chnk + 48, Heap_bigBlocks, address); + __PUT(chnk + 8, chnk + (24 + blksz), int64); + __PUT(chnk + 24, chnk + 32, int64); + __PUT(chnk + 32, blksz, int64); + __PUT(chnk + 40, -8, int64); + __PUT(chnk + 48, Heap_bigBlocks, int64); Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } @@ -187,9 +187,9 @@ static address Heap_NewChunk (address blksz) return _o_result; } -static void Heap_ExtendHeap (address blksz) +static void Heap_ExtendHeap (int64 blksz) { - address size, chnk, j, next; + int64 size, chnk, j, next; if (blksz > 320000) { size = blksz; } else { @@ -198,31 +198,31 @@ static void Heap_ExtendHeap (address blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, address); + __PUT(chnk, Heap_heap, int64); Heap_heap = chnk; } else { j = Heap_heap; - __GET(j, next, address); + __GET(j, next, int64); while ((next != 0 && chnk > next)) { j = next; - __GET(j, next, address); + __GET(j, next, int64); } - __PUT(chnk, next, address); - __PUT(j, chnk, address); + __PUT(chnk, next, int64); + __PUT(j, chnk, int64); } if (next == 0) { - __GET(chnk + 8, Heap_heapend, address); + __GET(chnk + 8, Heap_heapend, int64); } } } -SYSTEM_PTR Heap_NEWREC (address tag) +SYSTEM_PTR Heap_NEWREC (int64 tag) { SYSTEM_PTR _o_result; - address i, i0, di, blksz, restsize, t, adr, end, next, prev; + int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - __GET(tag, blksz, address); + __GET(tag, blksz, int64); i0 = __ASHR(blksz, 5); i = i0; if (i < 9) { @@ -233,17 +233,17 @@ SYSTEM_PTR Heap_NEWREC (address tag) } } if (i < 9) { - __GET(adr + 24, next, address); + __GET(adr + 24, next, int64); Heap_freeList[i] = next; if (i != i0) { di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, address); - __PUT(end + 16, -8, address); - __PUT(end, end + 8, address); - __PUT(adr + 8, restsize, address); - __PUT(adr + 24, Heap_freeList[di], address); + __PUT(end + 8, blksz, int64); + __PUT(end + 16, -8, int64); + __PUT(end, end + 8, int64); + __PUT(adr + 8, restsize, int64); + __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; adr += restsize; } @@ -274,31 +274,31 @@ SYSTEM_PTR Heap_NEWREC (address tag) return _o_result; } } - __GET(adr + 8, t, address); + __GET(adr + 8, t, int64); if (t >= blksz) { break; } prev = adr; - __GET(adr + 24, adr, address); + __GET(adr + 24, adr, int64); } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, address); - __PUT(end + 16, -8, address); - __PUT(end, end + 8, address); + __PUT(end + 8, blksz, int64); + __PUT(end + 16, -8, int64); + __PUT(end, end + 8, int64); if (restsize > 288) { - __PUT(adr + 8, restsize, address); + __PUT(adr + 8, restsize, int64); } else { - __GET(adr + 24, next, address); + __GET(adr + 24, next, int64); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, address); + __PUT(prev + 24, next, int64); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, address); - __PUT(adr + 24, Heap_freeList[di], address); + __PUT(adr + 8, restsize, int64); + __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; } } @@ -307,72 +307,72 @@ SYSTEM_PTR Heap_NEWREC (address tag) i = adr + 32; end = adr + blksz; while (i < end) { - __PUT(i, 0, address); - __PUT(i + 8, 0, address); - __PUT(i + 16, 0, address); - __PUT(i + 24, 0, address); + __PUT(i, 0, int64); + __PUT(i + 8, 0, int64); + __PUT(i + 16, 0, int64); + __PUT(i + 24, 0, int64); i += 32; } - __PUT(adr + 24, 0, address); - __PUT(adr, tag, address); - __PUT(adr + 8, 0, address); - __PUT(adr + 16, 0, address); + __PUT(adr + 24, 0, int64); + __PUT(adr, tag, int64); + __PUT(adr + 8, 0, int64); + __PUT(adr + 16, 0, int64); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(address)(adr + 8); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (address size) +SYSTEM_PTR Heap_NEWBLK (int64 size) { SYSTEM_PTR _o_result; - address blksz, tag; + int64 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); new = Heap_NEWREC((address)&blksz); - tag = ((address)(address)new + blksz) - 24; - __PUT(tag - 8, 0, address); - __PUT(tag, blksz, address); - __PUT(tag + 8, -8, address); - __PUT((address)(address)new - 8, tag, address); + tag = ((int64)(address)new + blksz) - 24; + __PUT(tag - 8, 0, int64); + __PUT(tag, blksz, int64); + __PUT(tag + 8, -8, int64); + __PUT((int64)(address)new - 8, tag, int64); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (address q) +static void Heap_Mark (int64 q) { - address p, tag, offset, fld, n, tagbits; + int64 p, tag, offset, fld, n, tagbits; if (q != 0) { - __GET(q - 8, tagbits, address); + __GET(q - 8, tagbits, int64); if (!__ODD(tagbits)) { - __PUT(q - 8, tagbits + 1, address); + __PUT(q - 8, tagbits + 1, int64); p = 0; tag = tagbits + 8; for (;;) { - __GET(tag, offset, address); + __GET(tag, offset, int64); if (offset < 0) { - __PUT(q - 8, (tag + offset) + 1, address); + __PUT(q - 8, (tag + offset) + 1, int64); if (p == 0) { break; } n = q; q = p; - __GET(q - 8, tag, address); + __GET(q - 8, tag, int64); tag -= 1; - __GET(tag, offset, address); + __GET(tag, offset, int64); fld = q + offset; - __GET(fld, p, address); + __GET(fld, p, int64); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - __GET(fld, n, address); + __GET(fld, n, int64); if (n != 0) { - __GET(n - 8, tagbits, address); + __GET(n - 8, tagbits, int64); if (!__ODD(tagbits)) { - __PUT(n - 8, tagbits + 1, address); - __PUT(q - 8, tag + 1, address); + __PUT(n - 8, tagbits + 1, int64); + __PUT(q - 8, tag + 1, int64); __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; @@ -388,12 +388,12 @@ static void Heap_Mark (address q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((address)(address)p); + Heap_Mark((int64)(address)p); } static void Heap_Scan (void) { - address chnk, adr, end, start, tag, i, size, freesize; + int64 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -405,58 +405,58 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 24; - __GET(chnk + 8, end, address); + __GET(chnk + 8, end, int64); while (adr < end) { - __GET(adr, tag, address); + __GET(adr, tag, int64); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, address); - __PUT(start + 8, freesize, address); - __PUT(start + 16, -8, address); + __PUT(start, start + 8, int64); + __PUT(start + 8, freesize, int64); + __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], address); + __PUT(start + 24, Heap_freeList[i], int64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, address); + __PUT(start + 24, Heap_bigBlocks, int64); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, address); - __GET(tag, size, address); + __PUT(adr, tag, int64); + __GET(tag, size, int64); Heap_allocated += size; adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int64); freesize += size; adr += size; } } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, address); - __PUT(start + 8, freesize, address); - __PUT(start + 16, -8, address); + __PUT(start, start + 8, int64); + __PUT(start + 8, freesize, int64); + __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], address); + __PUT(start + 24, Heap_freeList[i], int64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, address); + __PUT(start + 24, Heap_bigBlocks, int64); Heap_bigBlocks = start; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int64); } } -static void Heap_Sift (address l, address r, address *a, LONGINT a__len) +static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) { - address i, j, x; + int64 i, j, x; j = l; x = a[j]; for (;;) { @@ -473,9 +473,9 @@ static void Heap_Sift (address l, address r, address *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (address n, address *a, LONGINT a__len) +static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) { - address l, r, x; + int64 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -491,25 +491,25 @@ static void Heap_HeapSort (address n, address *a, LONGINT a__len) } } -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) +static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) { - address chnk, adr, tag, next, lim, lim1, i, ptr, size; + int64 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 24; - __GET(chnk + 8, lim1, address); + __GET(chnk + 8, lim1, int64); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - __GET(adr, tag, address); + __GET(adr, tag, int64); if (__ODD(tag)) { - __GET(tag - 1, size, address); + __GET(tag - 1, size, int64); adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int64); ptr = adr + 8; while (cand[i] < ptr) { i += 1; @@ -524,17 +524,17 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) adr = next; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int64); } } static void Heap_CheckFin (void) { Heap_FinNode n; - address tag; + int64 tag; n = Heap_fin; while (n != NIL) { - __GET(n->obj - 8, tag, address); + __GET(n->obj - 8, tag, int64); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -580,10 +580,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) +static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - address inc, nofcand, sp, p, stack0; + int64 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -600,7 +600,7 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, address); + __GET(sp, p, int64); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == (int64)cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -622,8 +622,8 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - address cand[10000]; + int64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + int64 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(address)Heap_modules; @@ -703,7 +703,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (address)(address)obj; + f->obj = (int64)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -713,8 +713,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); - __GET(Heap_heap + 8, Heap_heapend, address); - __PUT(Heap_heap, 0, address); + __GET(Heap_heap + 8, Heap_heapend, int64); + __PUT(Heap_heap, 0, int64); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index cfa2ab6f..3fcd0b28 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import address Heap_allocated, Heap_heapsize; +import int64 Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import address *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (address size); -import SYSTEM_PTR Heap_NEWREC (address tag); +import SYSTEM_PTR Heap_NEWBLK (int64 size); +import SYSTEM_PTR Heap_NEWREC (int64 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, address typ); +import void Heap_REGTYP (Heap_Module m, int64 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index b6890cfe..e3ff56bd 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index d2d0a476..93e2105b 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 6c15aa17..d211135a 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -2449,12 +2449,8 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if (ap->typ != fp->typ) { - if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { - } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { - } else { - OPB_err(123); - } + } else if ((ap->typ != fp->typ && !((((fp->typ->form == 1 && __IN(ap->typ->form, 0x1e, 32))) && ap->typ->size == 1)))) { + OPB_err(123); } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 8395741b..97860bfc 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 9104c5c4..e4c0eb06 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 6236cd73..3325aded 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 18e25b0f..4710b95f 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index b62666db..e249edd5 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 03366726..f6a8dfc5 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index ea6663ba..3b9acd86 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 2b449cae..ee182741 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 8d90d974..1514d9eb 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index c9ff5430..ad18ebdb 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 1a525fcb..d4f953ba 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index f9e7c27c..09f3d249 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 09931dda..0a9135f5 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 8df906c3..5bad2591 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - address (*Platform_ArgVecPtr)[1]; + int64 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -31,12 +31,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export address Platform_MainStackFrame; +export int64 Platform_MainStackFrame; export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[256]; export int16 Platform_ArgCount; -export address Platform_ArgVector; +export int64 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -64,15 +64,15 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, address argvadr); +export void Platform_Init (int16 argc, int64 argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export address Platform_OSAllocate (address size); -export void Platform_OSFree (address address); +export int64 Platform_OSAllocate (int64 size); +export void Platform_OSFree (int64 address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +export int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n); export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -92,7 +92,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 l); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, address p, int32 l); +export int16 Platform_Write (int32 h, int64 p, int32 l); static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -218,19 +218,19 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -address Platform_OSAllocate (address size) +int64 Platform_OSAllocate (int64 size) { - address _o_result; + int64 _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (address address) +void Platform_OSFree (int64 address) { Platform_free(address); } -void Platform_Init (int16 argc, address argvadr) +void Platform_Init (int16 argc, int64 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -517,7 +517,7 @@ int16 Platform_Size (int32 h, int32 *l) return _o_result; } -int16 Platform_Read (int32 h, address p, int32 l, int32 *n) +int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n) { int16 _o_result; *n = Platform_readfile(h, p, l); @@ -547,10 +547,10 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, address p, int32 l) +int16 Platform_Write (int32 h, int64 p, int32 l) { int16 _o_result; - address written; + int64 written; written = Platform_writefile(h, p, l); if (written < 0) { _o_result = Platform_err(); diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index d76d7ed5..2402b996 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -7,7 +7,8 @@ typedef struct Platform_FileIdentity { - int32 volume, index, mtime; + int32 _prvt0; + char _prvt1[8]; } Platform_FileIdentity; typedef @@ -18,12 +19,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import address Platform_MainStackFrame; +import int64 Platform_MainStackFrame; import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[256]; import int16 Platform_ArgCount; -import address Platform_ArgVector; +import int64 Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; @@ -48,15 +49,15 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, address argvadr); +import void Platform_Init (int16 argc, int64 argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import address Platform_OSAllocate (address size); -import void Platform_OSFree (address address); +import int64 Platform_OSAllocate (int64 size); +import void Platform_OSFree (int64 address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +import int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n); import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -75,7 +76,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 l); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, address p, int32 l); +import int16 Platform_Write (int32 h, int64 p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 4b72fbe3..e75d35ff 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 4a4c73b0..8a42b39b 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index f765b98f..9f9562db 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index be1e7d7f..da213d81 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 6cb415b9..2590cb27 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index dc456f77..7800b252 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c deleted file mode 100644 index 30b81ac7..00000000 --- a/bootstrap/unix-88/Vishap.c +++ /dev/null @@ -1,171 +0,0 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ - -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 - -#include "SYSTEM.h" -#include "Configuration.h" -#include "Heap.h" -#include "OPB.h" -#include "OPC.h" -#include "OPM.h" -#include "OPP.h" -#include "OPT.h" -#include "OPV.h" -#include "Platform.h" -#include "Strings.h" -#include "extTools.h" -#include "vt100.h" - - -static CHAR Vishap_mname[256]; - - -export void Vishap_Module (BOOLEAN *done); -static void Vishap_PropagateElementaryTypeSizes (void); -export void Vishap_Translate (void); -static void Vishap_Trap (int16 sig); - - -void Vishap_Module (BOOLEAN *done) -{ - BOOLEAN ext, new; - OPT_Node p = NIL; - OPP_Module(&p, OPM_opt); - if (OPM_noerr) { - OPV_Init(); - OPT_InitRecno(); - OPV_AdrAndSize(OPT_topScope); - OPT_Export(&ext, &new); - if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, 256); - OPC_Init(); - OPV_Module(p); - if (OPM_noerr) { - if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { - OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - } else { - if (new) { - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - OPM_RegisterNewSym(); - } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", 24); - OPM_RegisterNewSym(); - } - } - } else { - OPM_DeleteNewSym(); - } - } - } - OPM_CloseFiles(); - OPT_Close(); - OPM_LogWLn(); - *done = OPM_noerr; -} - -static void Vishap_PropagateElementaryTypeSizes (void) -{ - OPT_sysptrtyp->size = OPM_AddressSize; - OPT_adrtyp->size = OPM_AddressSize; - OPT_settyp->size = OPM_SetSize; - OPT_sinttyp = OPT_IntType(OPM_ShortintSize); - OPT_inttyp = OPT_IntType(OPM_IntegerSize); - OPT_linttyp = OPT_IntType(OPM_LongintSize); - OPT_sintobj->typ = OPT_sinttyp; - OPT_intobj->typ = OPT_inttyp; - OPT_lintobj->typ = OPT_linttyp; -} - -void Vishap_Translate (void) -{ - BOOLEAN done; - CHAR modulesobj[2048]; - modulesobj[0] = 0x00; - if (OPM_OpenPar()) { - for (;;) { - OPM_Init(&done, (void*)Vishap_mname, 256); - if (!done) { - return; - } - OPM_InitOptions(); - Vishap_PropagateElementaryTypeSizes(); - Heap_GC(0); - Vishap_Module(&done); - if (!done) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", 27); - OPM_LogWLn(); - Platform_Exit(1); - } - if (!__IN(13, OPM_opt, 32)) { - if (__IN(14, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - } else { - if (!__IN(10, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); - Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); - Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); - } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); - } - } - } - } - } -} - -static void Vishap_Trap (int16 sig) -{ - Heap_FINALL(); - if (sig == 3) { - Platform_Exit(0); - } else { - if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); - OPM_LogWLn(); - } - Platform_Exit(2); - } -} - - -export int main(int argc, char **argv) -{ - __INIT(argc, argv); - __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Heap); - __MODULE_IMPORT(OPB); - __MODULE_IMPORT(OPC); - __MODULE_IMPORT(OPM); - __MODULE_IMPORT(OPP); - __MODULE_IMPORT(OPT); - __MODULE_IMPORT(OPV); - __MODULE_IMPORT(Platform); - __MODULE_IMPORT(Strings); - __MODULE_IMPORT(extTools); - __MODULE_IMPORT(vt100); - __REGMAIN("Vishap", 0); - __REGCMD("Translate", Vishap_Translate); -/* BEGIN */ - Platform_SetInterruptHandler(Vishap_Trap); - Platform_SetQuitHandler(Vishap_Trap); - Platform_SetBadInstructionHandler(Vishap_Trap); - Vishap_Translate(); - __FINI; -} diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index d465624d..34e6fae3 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index cf093ab3..ce275b8c 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 46f8ac7e..fd7974da 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 700e6b39..f87adfac 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 8d4cbdfc..ca56f466 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index da86e98b..f5b8588f 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 7f7f4b26..28528f64 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 618bc77f..d9030dbe 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 8b55dc14..11937ee4 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index d645f05c..4eb27c8b 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 9a5d7c98..7c1ea1bd 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -83,7 +83,6 @@ export int32 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); @@ -673,11 +672,6 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len) -{ - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); -} - Files_File Files_Base (Files_Rider *r, address *r__typ) { Files_File _o_result; diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 3e6db0f2..a7de696c 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -40,7 +40,6 @@ import int32 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 905fcb24..945fbff7 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 @@ -39,7 +39,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - address obj; + int32 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -56,19 +56,19 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - address types; + int32 types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static address Heap_freeList[10]; -static address Heap_bigBlocks; -export address Heap_allocated; +static int32 Heap_freeList[10]; +static int32 Heap_bigBlocks; +export int32 Heap_allocated; static BOOLEAN Heap_firstTry; -static address Heap_heap, Heap_heapend; -export address Heap_heapsize; +static int32 Heap_heap, Heap_heapend; +export int32 Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -80,27 +80,27 @@ export address *Heap_FinDesc__typ; export address *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (address blksz); +static void Heap_ExtendHeap (int32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (address n, address *a, LONGINT a__len); +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (address q); -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); +static void Heap_Mark (int32 q); +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (address size); -export SYSTEM_PTR Heap_NEWREC (address tag); -static address Heap_NewChunk (address blksz); +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (int32 size); +export SYSTEM_PTR Heap_NEWREC (int32 tag); +static int32 Heap_NewChunk (int32 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, address typ); +export void Heap_REGTYP (Heap_Module m, int32 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (address l, address r, address *a, LONGINT a__len); +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -158,9 +158,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, address typ) +void Heap_REGTYP (Heap_Module m, int32 typ) { - __PUT(typ, m->types, address); + __PUT(typ, m->types, int32); m->types = typ; } @@ -169,17 +169,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static address Heap_NewChunk (address blksz) +static int32 Heap_NewChunk (int32 blksz) { - address _o_result; - address chnk; + int32 _o_result; + int32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), address); - __PUT(chnk + 12, chnk + 16, address); - __PUT(chnk + 16, blksz, address); - __PUT(chnk + 20, -4, address); - __PUT(chnk + 24, Heap_bigBlocks, address); + __PUT(chnk + 4, chnk + (12 + blksz), int32); + __PUT(chnk + 12, chnk + 16, int32); + __PUT(chnk + 16, blksz, int32); + __PUT(chnk + 20, -4, int32); + __PUT(chnk + 24, Heap_bigBlocks, int32); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -187,9 +187,9 @@ static address Heap_NewChunk (address blksz) return _o_result; } -static void Heap_ExtendHeap (address blksz) +static void Heap_ExtendHeap (int32 blksz) { - address size, chnk, j, next; + int32 size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -198,31 +198,31 @@ static void Heap_ExtendHeap (address blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, address); + __PUT(chnk, Heap_heap, int32); Heap_heap = chnk; } else { j = Heap_heap; - __GET(j, next, address); + __GET(j, next, int32); while ((next != 0 && chnk > next)) { j = next; - __GET(j, next, address); + __GET(j, next, int32); } - __PUT(chnk, next, address); - __PUT(j, chnk, address); + __PUT(chnk, next, int32); + __PUT(j, chnk, int32); } if (next == 0) { - __GET(chnk + 4, Heap_heapend, address); + __GET(chnk + 4, Heap_heapend, int32); } } } -SYSTEM_PTR Heap_NEWREC (address tag) +SYSTEM_PTR Heap_NEWREC (int32 tag) { SYSTEM_PTR _o_result; - address i, i0, di, blksz, restsize, t, adr, end, next, prev; + int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - __GET(tag, blksz, address); + __GET(tag, blksz, int32); i0 = __ASHR(blksz, 4); i = i0; if (i < 9) { @@ -233,17 +233,17 @@ SYSTEM_PTR Heap_NEWREC (address tag) } } if (i < 9) { - __GET(adr + 12, next, address); + __GET(adr + 12, next, int32); Heap_freeList[i] = next; if (i != i0) { di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, address); - __PUT(end + 8, -4, address); - __PUT(end, end + 4, address); - __PUT(adr + 4, restsize, address); - __PUT(adr + 12, Heap_freeList[di], address); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; adr += restsize; } @@ -274,31 +274,31 @@ SYSTEM_PTR Heap_NEWREC (address tag) return _o_result; } } - __GET(adr + 4, t, address); + __GET(adr + 4, t, int32); if (t >= blksz) { break; } prev = adr; - __GET(adr + 12, adr, address); + __GET(adr + 12, adr, int32); } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, address); - __PUT(end + 8, -4, address); - __PUT(end, end + 4, address); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); if (restsize > 144) { - __PUT(adr + 4, restsize, address); + __PUT(adr + 4, restsize, int32); } else { - __GET(adr + 12, next, address); + __GET(adr + 12, next, int32); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, address); + __PUT(prev + 12, next, int32); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, address); - __PUT(adr + 12, Heap_freeList[di], address); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; } } @@ -307,72 +307,72 @@ SYSTEM_PTR Heap_NEWREC (address tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, address); - __PUT(i + 4, 0, address); - __PUT(i + 8, 0, address); - __PUT(i + 12, 0, address); + __PUT(i, 0, int32); + __PUT(i + 4, 0, int32); + __PUT(i + 8, 0, int32); + __PUT(i + 12, 0, int32); i += 16; } - __PUT(adr + 12, 0, address); - __PUT(adr, tag, address); - __PUT(adr + 4, 0, address); - __PUT(adr + 8, 0, address); + __PUT(adr + 12, 0, int32); + __PUT(adr, tag, int32); + __PUT(adr + 4, 0, int32); + __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(address)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (address size) +SYSTEM_PTR Heap_NEWBLK (int32 size) { SYSTEM_PTR _o_result; - address blksz, tag; + int32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((address)&blksz); - tag = ((address)(address)new + blksz) - 12; - __PUT(tag - 4, 0, address); - __PUT(tag, blksz, address); - __PUT(tag + 4, -4, address); - __PUT((address)(address)new - 4, tag, address); + tag = ((int32)(address)new + blksz) - 12; + __PUT(tag - 4, 0, int32); + __PUT(tag, blksz, int32); + __PUT(tag + 4, -4, int32); + __PUT((int32)(address)new - 4, tag, int32); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (address q) +static void Heap_Mark (int32 q) { - address p, tag, offset, fld, n, tagbits; + int32 p, tag, offset, fld, n, tagbits; if (q != 0) { - __GET(q - 4, tagbits, address); + __GET(q - 4, tagbits, int32); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, address); + __PUT(q - 4, tagbits + 1, int32); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, address); + __GET(tag, offset, int32); if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, address); + __PUT(q - 4, (tag + offset) + 1, int32); if (p == 0) { break; } n = q; q = p; - __GET(q - 4, tag, address); + __GET(q - 4, tag, int32); tag -= 1; - __GET(tag, offset, address); + __GET(tag, offset, int32); fld = q + offset; - __GET(fld, p, address); + __GET(fld, p, int32); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - __GET(fld, n, address); + __GET(fld, n, int32); if (n != 0) { - __GET(n - 4, tagbits, address); + __GET(n - 4, tagbits, int32); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, address); - __PUT(q - 4, tag + 1, address); + __PUT(n - 4, tagbits + 1, int32); + __PUT(q - 4, tag + 1, int32); __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; @@ -388,12 +388,12 @@ static void Heap_Mark (address q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((address)(address)p); + Heap_Mark((int32)(address)p); } static void Heap_Scan (void) { - address chnk, adr, end, start, tag, i, size, freesize; + int32 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -405,58 +405,58 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 12; - __GET(chnk + 4, end, address); + __GET(chnk + 4, end, int32); while (adr < end) { - __GET(adr, tag, address); + __GET(adr, tag, int32); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, address); - __PUT(start + 4, freesize, address); - __PUT(start + 8, -4, address); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], address); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, address); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, address); - __GET(tag, size, address); + __PUT(adr, tag, int32); + __GET(tag, size, int32); Heap_allocated += size; adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int32); freesize += size; adr += size; } } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, address); - __PUT(start + 4, freesize, address); - __PUT(start + 8, -4, address); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], address); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, address); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int32); } } -static void Heap_Sift (address l, address r, address *a, LONGINT a__len) +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) { - address i, j, x; + int32 i, j, x; j = l; x = a[j]; for (;;) { @@ -473,9 +473,9 @@ static void Heap_Sift (address l, address r, address *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (address n, address *a, LONGINT a__len) +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) { - address l, r, x; + int32 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -491,25 +491,25 @@ static void Heap_HeapSort (address n, address *a, LONGINT a__len) } } -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) { - address chnk, adr, tag, next, lim, lim1, i, ptr, size; + int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 12; - __GET(chnk + 4, lim1, address); + __GET(chnk + 4, lim1, int32); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - __GET(adr, tag, address); + __GET(adr, tag, int32); if (__ODD(tag)) { - __GET(tag - 1, size, address); + __GET(tag - 1, size, int32); adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int32); ptr = adr + 4; while (cand[i] < ptr) { i += 1; @@ -524,17 +524,17 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) adr = next; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int32); } } static void Heap_CheckFin (void) { Heap_FinNode n; - address tag; + int32 tag; n = Heap_fin; while (n != NIL) { - __GET(n->obj - 4, tag, address); + __GET(n->obj - 4, tag, int32); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -580,10 +580,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - address inc, nofcand, sp, p, stack0; + int32 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -600,7 +600,7 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, address); + __GET(sp, p, int32); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -622,8 +622,8 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - address cand[10000]; + int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + int32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(address)Heap_modules; @@ -703,7 +703,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (address)(address)obj; + f->obj = (int32)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -713,8 +713,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); - __GET(Heap_heap + 4, Heap_heapend, address); - __PUT(Heap_heap, 0, address); + __GET(Heap_heap + 4, Heap_heapend, int32); + __PUT(Heap_heap, 0, int32); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 3ea975a7..eccb5d85 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import address Heap_allocated, Heap_heapsize; +import int32 Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import address *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (address size); -import SYSTEM_PTR Heap_NEWREC (address tag); +import SYSTEM_PTR Heap_NEWBLK (int32 size); +import SYSTEM_PTR Heap_NEWREC (int32 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, address typ); +import void Heap_REGTYP (Heap_Module m, int32 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 21d62e05..a87d0732 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index d2d0a476..93e2105b 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 6c15aa17..d211135a 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -2449,12 +2449,8 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if (ap->typ != fp->typ) { - if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { - } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { - } else { - OPB_err(123); - } + } else if ((ap->typ != fp->typ && !((((fp->typ->form == 1 && __IN(ap->typ->form, 0x1e, 32))) && ap->typ->size == 1)))) { + OPB_err(123); } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 8395741b..97860bfc 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 9104c5c4..e4c0eb06 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 6236cd73..3325aded 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index abb5a584..7234f518 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index b62666db..e249edd5 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 66b821d2..1e5c6674 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index ea6663ba..3b9acd86 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 2b449cae..ee182741 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 8d90d974..1514d9eb 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 1b69128c..0a1f8f54 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 1a525fcb..d4f953ba 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index cdb2ab50..a70a40bf 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 09931dda..0a9135f5 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 21a73e4d..51a62ed7 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - address (*Platform_ArgVecPtr)[1]; + int32 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -31,12 +31,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export address Platform_MainStackFrame; +export int32 Platform_MainStackFrame; export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[4096]; export int16 Platform_ArgCount; -export address Platform_ArgVector; +export int32 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -66,15 +66,15 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, address argvadr); +export void Platform_Init (int16 argc, int32 argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export address Platform_OSAllocate (address size); -export void Platform_OSFree (address address); +export int32 Platform_OSAllocate (int32 size); +export void Platform_OSFree (int32 address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -92,7 +92,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 limit); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, address p, int32 l); +export int16 Platform_Write (int32 h, int32 p, int32 l); static void Platform_YMDHMStoClock (int16 ye, int16 mo, int16 da, int16 ho, int16 mi, int16 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -230,19 +230,19 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -address Platform_OSAllocate (address size) +int32 Platform_OSAllocate (int32 size) { - address _o_result; + int32 _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (address address) +void Platform_OSFree (int32 address) { Platform_free(address); } -void Platform_Init (int16 argc, address argvadr) +void Platform_Init (int16 argc, int32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -543,7 +543,7 @@ int16 Platform_Size (int32 h, int32 *l) return _o_result; } -int16 Platform_Read (int32 h, address p, int32 l, int32 *n) +int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) { int16 _o_result; int16 result; @@ -579,7 +579,7 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, address p, int32 l) +int16 Platform_Write (int32 h, int32 p, int32 l) { int16 _o_result; if (Platform_writefile(h, p, l) == 0) { diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index d697acd7..fff5ea74 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -19,12 +19,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import address Platform_MainStackFrame; +import int32 Platform_MainStackFrame; import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[4096]; import int16 Platform_ArgCount; -import address Platform_ArgVector; +import int32 Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_nl[3]; @@ -50,15 +50,15 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, address argvadr); +import void Platform_Init (int16 argc, int32 argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import address Platform_OSAllocate (address size); -import void Platform_OSFree (address address); +import int32 Platform_OSAllocate (int32 size); +import void Platform_OSFree (int32 address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -75,7 +75,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 limit); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, address p, int32 l); +import int16 Platform_Write (int32 h, int32 p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 4b72fbe3..e75d35ff 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 4a4c73b0..8a42b39b 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index f765b98f..9f9562db 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index be1e7d7f..da213d81 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 779daa7a..ab510cdb 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 07f53445..64e78861 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c deleted file mode 100644 index 30b81ac7..00000000 --- a/bootstrap/windows-48/Vishap.c +++ /dev/null @@ -1,171 +0,0 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ - -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 - -#include "SYSTEM.h" -#include "Configuration.h" -#include "Heap.h" -#include "OPB.h" -#include "OPC.h" -#include "OPM.h" -#include "OPP.h" -#include "OPT.h" -#include "OPV.h" -#include "Platform.h" -#include "Strings.h" -#include "extTools.h" -#include "vt100.h" - - -static CHAR Vishap_mname[256]; - - -export void Vishap_Module (BOOLEAN *done); -static void Vishap_PropagateElementaryTypeSizes (void); -export void Vishap_Translate (void); -static void Vishap_Trap (int16 sig); - - -void Vishap_Module (BOOLEAN *done) -{ - BOOLEAN ext, new; - OPT_Node p = NIL; - OPP_Module(&p, OPM_opt); - if (OPM_noerr) { - OPV_Init(); - OPT_InitRecno(); - OPV_AdrAndSize(OPT_topScope); - OPT_Export(&ext, &new); - if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, 256); - OPC_Init(); - OPV_Module(p); - if (OPM_noerr) { - if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { - OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - } else { - if (new) { - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - OPM_RegisterNewSym(); - } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", 24); - OPM_RegisterNewSym(); - } - } - } else { - OPM_DeleteNewSym(); - } - } - } - OPM_CloseFiles(); - OPT_Close(); - OPM_LogWLn(); - *done = OPM_noerr; -} - -static void Vishap_PropagateElementaryTypeSizes (void) -{ - OPT_sysptrtyp->size = OPM_AddressSize; - OPT_adrtyp->size = OPM_AddressSize; - OPT_settyp->size = OPM_SetSize; - OPT_sinttyp = OPT_IntType(OPM_ShortintSize); - OPT_inttyp = OPT_IntType(OPM_IntegerSize); - OPT_linttyp = OPT_IntType(OPM_LongintSize); - OPT_sintobj->typ = OPT_sinttyp; - OPT_intobj->typ = OPT_inttyp; - OPT_lintobj->typ = OPT_linttyp; -} - -void Vishap_Translate (void) -{ - BOOLEAN done; - CHAR modulesobj[2048]; - modulesobj[0] = 0x00; - if (OPM_OpenPar()) { - for (;;) { - OPM_Init(&done, (void*)Vishap_mname, 256); - if (!done) { - return; - } - OPM_InitOptions(); - Vishap_PropagateElementaryTypeSizes(); - Heap_GC(0); - Vishap_Module(&done); - if (!done) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", 27); - OPM_LogWLn(); - Platform_Exit(1); - } - if (!__IN(13, OPM_opt, 32)) { - if (__IN(14, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - } else { - if (!__IN(10, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); - Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); - Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); - } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); - } - } - } - } - } -} - -static void Vishap_Trap (int16 sig) -{ - Heap_FINALL(); - if (sig == 3) { - Platform_Exit(0); - } else { - if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); - OPM_LogWLn(); - } - Platform_Exit(2); - } -} - - -export int main(int argc, char **argv) -{ - __INIT(argc, argv); - __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Heap); - __MODULE_IMPORT(OPB); - __MODULE_IMPORT(OPC); - __MODULE_IMPORT(OPM); - __MODULE_IMPORT(OPP); - __MODULE_IMPORT(OPT); - __MODULE_IMPORT(OPV); - __MODULE_IMPORT(Platform); - __MODULE_IMPORT(Strings); - __MODULE_IMPORT(extTools); - __MODULE_IMPORT(vt100); - __REGMAIN("Vishap", 0); - __REGCMD("Translate", Vishap_Translate); -/* BEGIN */ - Platform_SetInterruptHandler(Vishap_Trap); - Platform_SetQuitHandler(Vishap_Trap); - Platform_SetBadInstructionHandler(Vishap_Trap); - Vishap_Translate(); - __FINI; -} diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index d465624d..34e6fae3 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index cf093ab3..ce275b8c 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 46f8ac7e..fd7974da 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 700e6b39..f87adfac 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 8d4cbdfc..ca56f466 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index da86e98b..f5b8588f 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 7f7f4b26..28528f64 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 618bc77f..d9030dbe 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 8b55dc14..11937ee4 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index d645f05c..4eb27c8b 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 1071d452..7d407820 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -83,7 +83,6 @@ export int32 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); @@ -673,11 +672,6 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len) -{ - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); -} - Files_File Files_Base (Files_Rider *r, address *r__typ) { Files_File _o_result; diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 1a73a6ec..1391c541 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -42,7 +42,6 @@ import int32 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 785efa1a..ca208a31 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 @@ -39,7 +39,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - address obj; + int64 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -56,19 +56,19 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - address types; + int64 types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static address Heap_freeList[10]; -static address Heap_bigBlocks; -export address Heap_allocated; +static int64 Heap_freeList[10]; +static int64 Heap_bigBlocks; +export int64 Heap_allocated; static BOOLEAN Heap_firstTry; -static address Heap_heap, Heap_heapend; -export address Heap_heapsize; +static int64 Heap_heap, Heap_heapend; +export int64 Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -80,27 +80,27 @@ export address *Heap_FinDesc__typ; export address *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (address blksz); +static void Heap_ExtendHeap (int64 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (address n, address *a, LONGINT a__len); +static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (address q); -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); +static void Heap_Mark (int64 q); +static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (address size); -export SYSTEM_PTR Heap_NEWREC (address tag); -static address Heap_NewChunk (address blksz); +static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (int64 size); +export SYSTEM_PTR Heap_NEWREC (int64 tag); +static int64 Heap_NewChunk (int64 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, address typ); +export void Heap_REGTYP (Heap_Module m, int64 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (address l, address r, address *a, LONGINT a__len); +static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -158,9 +158,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, address typ) +void Heap_REGTYP (Heap_Module m, int64 typ) { - __PUT(typ, m->types, address); + __PUT(typ, m->types, int64); m->types = typ; } @@ -169,17 +169,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static address Heap_NewChunk (address blksz) +static int64 Heap_NewChunk (int64 blksz) { - address _o_result; - address chnk; + int64 _o_result; + int64 chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), address); - __PUT(chnk + 24, chnk + 32, address); - __PUT(chnk + 32, blksz, address); - __PUT(chnk + 40, -8, address); - __PUT(chnk + 48, Heap_bigBlocks, address); + __PUT(chnk + 8, chnk + (24 + blksz), int64); + __PUT(chnk + 24, chnk + 32, int64); + __PUT(chnk + 32, blksz, int64); + __PUT(chnk + 40, -8, int64); + __PUT(chnk + 48, Heap_bigBlocks, int64); Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } @@ -187,9 +187,9 @@ static address Heap_NewChunk (address blksz) return _o_result; } -static void Heap_ExtendHeap (address blksz) +static void Heap_ExtendHeap (int64 blksz) { - address size, chnk, j, next; + int64 size, chnk, j, next; if (blksz > 320000) { size = blksz; } else { @@ -198,31 +198,31 @@ static void Heap_ExtendHeap (address blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, address); + __PUT(chnk, Heap_heap, int64); Heap_heap = chnk; } else { j = Heap_heap; - __GET(j, next, address); + __GET(j, next, int64); while ((next != 0 && chnk > next)) { j = next; - __GET(j, next, address); + __GET(j, next, int64); } - __PUT(chnk, next, address); - __PUT(j, chnk, address); + __PUT(chnk, next, int64); + __PUT(j, chnk, int64); } if (next == 0) { - __GET(chnk + 8, Heap_heapend, address); + __GET(chnk + 8, Heap_heapend, int64); } } } -SYSTEM_PTR Heap_NEWREC (address tag) +SYSTEM_PTR Heap_NEWREC (int64 tag) { SYSTEM_PTR _o_result; - address i, i0, di, blksz, restsize, t, adr, end, next, prev; + int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - __GET(tag, blksz, address); + __GET(tag, blksz, int64); i0 = __ASHR(blksz, 5); i = i0; if (i < 9) { @@ -233,17 +233,17 @@ SYSTEM_PTR Heap_NEWREC (address tag) } } if (i < 9) { - __GET(adr + 24, next, address); + __GET(adr + 24, next, int64); Heap_freeList[i] = next; if (i != i0) { di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, address); - __PUT(end + 16, -8, address); - __PUT(end, end + 8, address); - __PUT(adr + 8, restsize, address); - __PUT(adr + 24, Heap_freeList[di], address); + __PUT(end + 8, blksz, int64); + __PUT(end + 16, -8, int64); + __PUT(end, end + 8, int64); + __PUT(adr + 8, restsize, int64); + __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; adr += restsize; } @@ -274,31 +274,31 @@ SYSTEM_PTR Heap_NEWREC (address tag) return _o_result; } } - __GET(adr + 8, t, address); + __GET(adr + 8, t, int64); if (t >= blksz) { break; } prev = adr; - __GET(adr + 24, adr, address); + __GET(adr + 24, adr, int64); } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, address); - __PUT(end + 16, -8, address); - __PUT(end, end + 8, address); + __PUT(end + 8, blksz, int64); + __PUT(end + 16, -8, int64); + __PUT(end, end + 8, int64); if (restsize > 288) { - __PUT(adr + 8, restsize, address); + __PUT(adr + 8, restsize, int64); } else { - __GET(adr + 24, next, address); + __GET(adr + 24, next, int64); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, address); + __PUT(prev + 24, next, int64); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, address); - __PUT(adr + 24, Heap_freeList[di], address); + __PUT(adr + 8, restsize, int64); + __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; } } @@ -307,72 +307,72 @@ SYSTEM_PTR Heap_NEWREC (address tag) i = adr + 32; end = adr + blksz; while (i < end) { - __PUT(i, 0, address); - __PUT(i + 8, 0, address); - __PUT(i + 16, 0, address); - __PUT(i + 24, 0, address); + __PUT(i, 0, int64); + __PUT(i + 8, 0, int64); + __PUT(i + 16, 0, int64); + __PUT(i + 24, 0, int64); i += 32; } - __PUT(adr + 24, 0, address); - __PUT(adr, tag, address); - __PUT(adr + 8, 0, address); - __PUT(adr + 16, 0, address); + __PUT(adr + 24, 0, int64); + __PUT(adr, tag, int64); + __PUT(adr + 8, 0, int64); + __PUT(adr + 16, 0, int64); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(address)(adr + 8); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (address size) +SYSTEM_PTR Heap_NEWBLK (int64 size) { SYSTEM_PTR _o_result; - address blksz, tag; + int64 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); new = Heap_NEWREC((address)&blksz); - tag = ((address)(address)new + blksz) - 24; - __PUT(tag - 8, 0, address); - __PUT(tag, blksz, address); - __PUT(tag + 8, -8, address); - __PUT((address)(address)new - 8, tag, address); + tag = ((int64)(address)new + blksz) - 24; + __PUT(tag - 8, 0, int64); + __PUT(tag, blksz, int64); + __PUT(tag + 8, -8, int64); + __PUT((int64)(address)new - 8, tag, int64); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (address q) +static void Heap_Mark (int64 q) { - address p, tag, offset, fld, n, tagbits; + int64 p, tag, offset, fld, n, tagbits; if (q != 0) { - __GET(q - 8, tagbits, address); + __GET(q - 8, tagbits, int64); if (!__ODD(tagbits)) { - __PUT(q - 8, tagbits + 1, address); + __PUT(q - 8, tagbits + 1, int64); p = 0; tag = tagbits + 8; for (;;) { - __GET(tag, offset, address); + __GET(tag, offset, int64); if (offset < 0) { - __PUT(q - 8, (tag + offset) + 1, address); + __PUT(q - 8, (tag + offset) + 1, int64); if (p == 0) { break; } n = q; q = p; - __GET(q - 8, tag, address); + __GET(q - 8, tag, int64); tag -= 1; - __GET(tag, offset, address); + __GET(tag, offset, int64); fld = q + offset; - __GET(fld, p, address); + __GET(fld, p, int64); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - __GET(fld, n, address); + __GET(fld, n, int64); if (n != 0) { - __GET(n - 8, tagbits, address); + __GET(n - 8, tagbits, int64); if (!__ODD(tagbits)) { - __PUT(n - 8, tagbits + 1, address); - __PUT(q - 8, tag + 1, address); + __PUT(n - 8, tagbits + 1, int64); + __PUT(q - 8, tag + 1, int64); __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; @@ -388,12 +388,12 @@ static void Heap_Mark (address q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((address)(address)p); + Heap_Mark((int64)(address)p); } static void Heap_Scan (void) { - address chnk, adr, end, start, tag, i, size, freesize; + int64 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -405,58 +405,58 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 24; - __GET(chnk + 8, end, address); + __GET(chnk + 8, end, int64); while (adr < end) { - __GET(adr, tag, address); + __GET(adr, tag, int64); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, address); - __PUT(start + 8, freesize, address); - __PUT(start + 16, -8, address); + __PUT(start, start + 8, int64); + __PUT(start + 8, freesize, int64); + __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], address); + __PUT(start + 24, Heap_freeList[i], int64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, address); + __PUT(start + 24, Heap_bigBlocks, int64); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, address); - __GET(tag, size, address); + __PUT(adr, tag, int64); + __GET(tag, size, int64); Heap_allocated += size; adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int64); freesize += size; adr += size; } } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, address); - __PUT(start + 8, freesize, address); - __PUT(start + 16, -8, address); + __PUT(start, start + 8, int64); + __PUT(start + 8, freesize, int64); + __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], address); + __PUT(start + 24, Heap_freeList[i], int64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, address); + __PUT(start + 24, Heap_bigBlocks, int64); Heap_bigBlocks = start; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int64); } } -static void Heap_Sift (address l, address r, address *a, LONGINT a__len) +static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) { - address i, j, x; + int64 i, j, x; j = l; x = a[j]; for (;;) { @@ -473,9 +473,9 @@ static void Heap_Sift (address l, address r, address *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (address n, address *a, LONGINT a__len) +static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) { - address l, r, x; + int64 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -491,25 +491,25 @@ static void Heap_HeapSort (address n, address *a, LONGINT a__len) } } -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) +static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) { - address chnk, adr, tag, next, lim, lim1, i, ptr, size; + int64 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 24; - __GET(chnk + 8, lim1, address); + __GET(chnk + 8, lim1, int64); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - __GET(adr, tag, address); + __GET(adr, tag, int64); if (__ODD(tag)) { - __GET(tag - 1, size, address); + __GET(tag - 1, size, int64); adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int64); ptr = adr + 8; while (cand[i] < ptr) { i += 1; @@ -524,17 +524,17 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) adr = next; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int64); } } static void Heap_CheckFin (void) { Heap_FinNode n; - address tag; + int64 tag; n = Heap_fin; while (n != NIL) { - __GET(n->obj - 8, tag, address); + __GET(n->obj - 8, tag, int64); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -580,10 +580,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) +static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - address inc, nofcand, sp, p, stack0; + int64 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -600,7 +600,7 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, address); + __GET(sp, p, int64); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == (int64)cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -622,8 +622,8 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - address cand[10000]; + int64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + int64 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(address)Heap_modules; @@ -703,7 +703,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (address)(address)obj; + f->obj = (int64)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -713,8 +713,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); - __GET(Heap_heap + 8, Heap_heapend, address); - __PUT(Heap_heap, 0, address); + __GET(Heap_heap + 8, Heap_heapend, int64); + __PUT(Heap_heap, 0, int64); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index cfa2ab6f..3fcd0b28 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import address Heap_allocated, Heap_heapsize; +import int64 Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import address *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (address size); -import SYSTEM_PTR Heap_NEWREC (address tag); +import SYSTEM_PTR Heap_NEWBLK (int64 size); +import SYSTEM_PTR Heap_NEWREC (int64 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, address typ); +import void Heap_REGTYP (Heap_Module m, int64 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index b6890cfe..e3ff56bd 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index d2d0a476..93e2105b 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 6c15aa17..d211135a 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -2449,12 +2449,8 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if (ap->typ != fp->typ) { - if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { - } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { - } else { - OPB_err(123); - } + } else if ((ap->typ != fp->typ && !((((fp->typ->form == 1 && __IN(ap->typ->form, 0x1e, 32))) && ap->typ->size == 1)))) { + OPB_err(123); } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 8395741b..97860bfc 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 9104c5c4..e4c0eb06 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 6236cd73..3325aded 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 18e25b0f..4710b95f 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index b62666db..e249edd5 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 03366726..f6a8dfc5 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index ea6663ba..3b9acd86 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 2b449cae..ee182741 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 8d90d974..1514d9eb 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index c9ff5430..ad18ebdb 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 1a525fcb..d4f953ba 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index f9e7c27c..09f3d249 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 09931dda..0a9135f5 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 8dc2c83e..c0accb85 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - address (*Platform_ArgVecPtr)[1]; + int64 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -31,12 +31,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export address Platform_MainStackFrame; +export int64 Platform_MainStackFrame; export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[4096]; export int16 Platform_ArgCount; -export address Platform_ArgVector; +export int64 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -66,15 +66,15 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, address argvadr); +export void Platform_Init (int16 argc, int64 argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export address Platform_OSAllocate (address size); -export void Platform_OSFree (address address); +export int64 Platform_OSAllocate (int64 size); +export void Platform_OSFree (int64 address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +export int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n); export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -92,7 +92,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 limit); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, address p, int32 l); +export int16 Platform_Write (int32 h, int64 p, int32 l); static void Platform_YMDHMStoClock (int16 ye, int16 mo, int16 da, int16 ho, int16 mi, int16 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -230,19 +230,19 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -address Platform_OSAllocate (address size) +int64 Platform_OSAllocate (int64 size) { - address _o_result; + int64 _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (address address) +void Platform_OSFree (int64 address) { Platform_free(address); } -void Platform_Init (int16 argc, address argvadr) +void Platform_Init (int16 argc, int64 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -543,7 +543,7 @@ int16 Platform_Size (int32 h, int32 *l) return _o_result; } -int16 Platform_Read (int32 h, address p, int32 l, int32 *n) +int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n) { int16 _o_result; int16 result; @@ -579,7 +579,7 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, address p, int32 l) +int16 Platform_Write (int32 h, int64 p, int32 l) { int16 _o_result; if (Platform_writefile(h, p, l) == 0) { diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index d697acd7..dcdb5e82 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -19,12 +19,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import address Platform_MainStackFrame; +import int64 Platform_MainStackFrame; import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[4096]; import int16 Platform_ArgCount; -import address Platform_ArgVector; +import int64 Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_nl[3]; @@ -50,15 +50,15 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, address argvadr); +import void Platform_Init (int16 argc, int64 argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import address Platform_OSAllocate (address size); -import void Platform_OSFree (address address); +import int64 Platform_OSAllocate (int64 size); +import void Platform_OSFree (int64 address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +import int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n); import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -75,7 +75,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 limit); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, address p, int32 l); +import int16 Platform_Write (int32 h, int64 p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 4b72fbe3..e75d35ff 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 4a4c73b0..8a42b39b 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index f765b98f..9f9562db 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index be1e7d7f..da213d81 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 6cb415b9..2590cb27 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index dc456f77..7800b252 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c deleted file mode 100644 index 30b81ac7..00000000 --- a/bootstrap/windows-88/Vishap.c +++ /dev/null @@ -1,171 +0,0 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ - -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 - -#include "SYSTEM.h" -#include "Configuration.h" -#include "Heap.h" -#include "OPB.h" -#include "OPC.h" -#include "OPM.h" -#include "OPP.h" -#include "OPT.h" -#include "OPV.h" -#include "Platform.h" -#include "Strings.h" -#include "extTools.h" -#include "vt100.h" - - -static CHAR Vishap_mname[256]; - - -export void Vishap_Module (BOOLEAN *done); -static void Vishap_PropagateElementaryTypeSizes (void); -export void Vishap_Translate (void); -static void Vishap_Trap (int16 sig); - - -void Vishap_Module (BOOLEAN *done) -{ - BOOLEAN ext, new; - OPT_Node p = NIL; - OPP_Module(&p, OPM_opt); - if (OPM_noerr) { - OPV_Init(); - OPT_InitRecno(); - OPV_AdrAndSize(OPT_topScope); - OPT_Export(&ext, &new); - if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, 256); - OPC_Init(); - OPV_Module(p); - if (OPM_noerr) { - if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { - OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - } else { - if (new) { - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - OPM_RegisterNewSym(); - } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", 24); - OPM_RegisterNewSym(); - } - } - } else { - OPM_DeleteNewSym(); - } - } - } - OPM_CloseFiles(); - OPT_Close(); - OPM_LogWLn(); - *done = OPM_noerr; -} - -static void Vishap_PropagateElementaryTypeSizes (void) -{ - OPT_sysptrtyp->size = OPM_AddressSize; - OPT_adrtyp->size = OPM_AddressSize; - OPT_settyp->size = OPM_SetSize; - OPT_sinttyp = OPT_IntType(OPM_ShortintSize); - OPT_inttyp = OPT_IntType(OPM_IntegerSize); - OPT_linttyp = OPT_IntType(OPM_LongintSize); - OPT_sintobj->typ = OPT_sinttyp; - OPT_intobj->typ = OPT_inttyp; - OPT_lintobj->typ = OPT_linttyp; -} - -void Vishap_Translate (void) -{ - BOOLEAN done; - CHAR modulesobj[2048]; - modulesobj[0] = 0x00; - if (OPM_OpenPar()) { - for (;;) { - OPM_Init(&done, (void*)Vishap_mname, 256); - if (!done) { - return; - } - OPM_InitOptions(); - Vishap_PropagateElementaryTypeSizes(); - Heap_GC(0); - Vishap_Module(&done); - if (!done) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", 27); - OPM_LogWLn(); - Platform_Exit(1); - } - if (!__IN(13, OPM_opt, 32)) { - if (__IN(14, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - } else { - if (!__IN(10, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); - Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); - Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); - } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); - } - } - } - } - } -} - -static void Vishap_Trap (int16 sig) -{ - Heap_FINALL(); - if (sig == 3) { - Platform_Exit(0); - } else { - if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); - OPM_LogWLn(); - } - Platform_Exit(2); - } -} - - -export int main(int argc, char **argv) -{ - __INIT(argc, argv); - __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Heap); - __MODULE_IMPORT(OPB); - __MODULE_IMPORT(OPC); - __MODULE_IMPORT(OPM); - __MODULE_IMPORT(OPP); - __MODULE_IMPORT(OPT); - __MODULE_IMPORT(OPV); - __MODULE_IMPORT(Platform); - __MODULE_IMPORT(Strings); - __MODULE_IMPORT(extTools); - __MODULE_IMPORT(vt100); - __REGMAIN("Vishap", 0); - __REGCMD("Translate", Vishap_Translate); -/* BEGIN */ - Platform_SetInterruptHandler(Vishap_Trap); - Platform_SetQuitHandler(Vishap_Trap); - Platform_SetBadInstructionHandler(Vishap_Trap); - Vishap_Translate(); - __FINI; -} diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index d465624d..34e6fae3 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index cf093ab3..ce275b8c 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 46f8ac7e..fd7974da 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 700e6b39..f87adfac 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 8d4cbdfc..ca56f466 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index da86e98b..f5b8588f 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/makefile b/makefile index c9feb82b..893e59bc 100644 --- a/makefile +++ b/makefile @@ -1,7 +1,7 @@ # Vishap Oberon master makefile. # # Makes sure configuration parameters are up to date and then hands off -# to src/tools/make/vishap.make. +# to src/tools/make/oberon.mk. @@ -134,124 +134,104 @@ reportsizes: FORCE # clean - clean out the bulid directory clean: configuration - @make -f src/tools/make/vishap.make -s clean + @make -f src/tools/make/oberon.mk -s clean # full: Full build of compiler and libarary. full: configuration - @make -f src/tools/make/vishap.make -s installable - @-make -f src/tools/make/vishap.make -s uninstall - @make -f src/tools/make/vishap.make -s clean + @make -f src/tools/make/oberon.mk -s installable + @-make -f src/tools/make/oberon.mk -s uninstall + @make -f src/tools/make/oberon.mk -s clean # Make bootstrap compiler from source suitable for current data model @printf "\n\n--- Compiler build started ---\n\n" - @make -f src/tools/make/vishap.make -s compilerfromsavedsource + @make -f src/tools/make/oberon.mk -s compilerfromsavedsource MODEL=2 # Use bootstrap compiler to make compiler binary from latest compiler sources - @make -f src/tools/make/vishap.make -s translate - @make -f src/tools/make/vishap.make -s assemble + @make -f src/tools/make/oberon.mk -s translate MODEL=2 + @make -f src/tools/make/oberon.mk -s assemble MODEL=2 # Use latest compiler to make compiler binary from latest compiler sources - @make -f src/tools/make/vishap.make -s translate - @make -f src/tools/make/vishap.make -s assemble + @make -f src/tools/make/oberon.mk -s translate MODEL=2 + @make -f src/tools/make/oberon.mk -s assemble MODEL=2 @printf "\n\n--- Compiler build successfull ---\n\n" - @make -f src/tools/make/vishap.make -s browsercmd + @make -f src/tools/make/oberon.mk -s browsercmd MODEL=2 @printf "\n\n--- Library build started ---\n\n" - @make -f src/tools/make/vishap.make -s library + @make -f src/tools/make/oberon.mk -s library MODEL=2 @printf "\n\n--- Library build successfull ---\n\n" - @make -f src/tools/make/vishap.make -s sourcechanges - @make -f src/tools/make/vishap.make -s install + @make -f src/tools/make/oberon.mk -s sourcechanges + @make -f src/tools/make/oberon.mk -s install MODEL=2 @printf "\n\n--- Confidence tests started ---\n\n" - @make -f src/tools/make/vishap.make -s confidence - @make -f src/tools/make/vishap.make -s showpath - - -# short - like make full, but omitting most libraries -# Convenient for testing changes to the compilersource but not a shippable result -short: configuration - @make -f src/tools/make/vishap.make -s installable - @-make -f src/tools/make/vishap.make -s uninstall - @make -f src/tools/make/vishap.make -s clean -# Make bootstrap compiler from source suitable for current data model - @printf "\n\n--- Compiler build started ---\n\n" - @make -f src/tools/make/vishap.make -s compilerfromsavedsource -# Use bootstrap compiler to make compiler binary from latest compiler sources - @make -f src/tools/make/vishap.make -s translate - @make -f src/tools/make/vishap.make -s assemble -# Use latest compiler to make compiler binary from latest compiler sources - @make -f src/tools/make/vishap.make -s translate - @make -f src/tools/make/vishap.make -s assemble - @printf "\n\n--- Compiler build successfull ---\n\n" - @make -f src/tools/make/vishap.make -s v4 - @make -f src/tools/make/vishap.make -s misc + @make -f src/tools/make/oberon.mk -s confidence MODEL=2 + @make -f src/tools/make/oberon.mk -s showpath MODEL=2 assemble: - @make -f src/tools/make/vishap.make -s assemble + @make -f src/tools/make/oberon.mk -s assemble MODEL=2 # compile: compiler only, without cleaning compiler: configuration - @make -f src/tools/make/vishap.make -s translate - @make -f src/tools/make/vishap.make -s assemble + @make -f src/tools/make/oberon.mk -s translate MODEL=2 + @make -f src/tools/make/oberon.mk -s assemble MODEL=2 # Report changes to compiler source relative to bootstrap compiler sourcechanges: - @make -f src/tools/make/vishap.make -s sourcechanges + @make -f src/tools/make/oberon.mk -s sourcechanges # browsercmd: build the 'showdef' command browsercmd: configuration - @make -f src/tools/make/vishap.make -s browsercmd + @make -f src/tools/make/oberon.mk -s browsercmd # library: build all directories under src/library library: configuration - @make -f src/tools/make/vishap.make -s library + @make -f src/tools/make/oberon.mk -s library # Individual library components v4: configuration - @make -f src/tools/make/vishap.make -s v4 + @make -f src/tools/make/oberon.mk -s v4 ooc2: configuration - @make -f src/tools/make/vishap.make -s ooc2 + @make -f src/tools/make/oberon.mk -s ooc2 ooc: configuration - @make -f src/tools/make/vishap.make -s ooc + @make -f src/tools/make/oberon.mk -s ooc ulm: configuration - @make -f src/tools/make/vishap.make -s ulm + @make -f src/tools/make/oberon.mk -s ulm pow32: configuration - @make -f src/tools/make/vishap.make -s pow32 + @make -f src/tools/make/oberon.mk -s pow32 misc: configuration - @make -f src/tools/make/vishap.make -s misc + @make -f src/tools/make/oberon.mk -s misc s3: configuration - @make -f src/tools/make/vishap.make -s s3 + @make -f src/tools/make/oberon.mk -s s3 # install: Copy built files to install directory install: configuration - @make -f src/tools/make/vishap.make -s installable - @make -f src/tools/make/vishap.make -s install - @make -f src/tools/make/vishap.make -s showpath + @make -f src/tools/make/oberon.mk -s installable + @make -f src/tools/make/oberon.mk -s install MODEL=2 + @make -f src/tools/make/oberon.mk -s showpath MODEL=2 uninstall: configuration - @make -f src/tools/make/vishap.make -s installable - @make -f src/tools/make/vishap.make -s uninstall + @make -f src/tools/make/oberon.mk -s installable + @make -f src/tools/make/oberon.mk -s uninstall # confidence: Run a set of confidence tests confidence: configuration - @make -f src/tools/make/vishap.make -s confidence + @make -f src/tools/make/oberon.mk -s confidence planned-binary-change: @date >src/test/confidence/planned-binary-change @@ -266,25 +246,25 @@ planned-binary-change: # If the bootstrap directories are broken or only partially # built then run 'make revertbootstrap' first. bootstrap: bootstrapconfiguration - @make -f src/tools/make/vishap.make -s clean - @make -f src/tools/make/vishap.make -s translate - @make -f src/tools/make/vishap.make -s assemble + @make -f src/tools/make/oberon.mk -s clean + @make -f src/tools/make/oberon.mk -s translate + @make -f src/tools/make/oberon.mk -s assemble rm -rf bootstrap/* - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym cp src/system/*.[ch] bootstrap bootstrapunclean: bootstrapconfiguration rm -rf bootstrap/* - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym cp src/system/*.[ch] bootstrap @@ -304,10 +284,10 @@ revertbootstrap: # coordinator: Start the test machine coordinator coordinator: configuration - @make -f src/tools/make/vishap.make -s clean - @make -f src/tools/make/vishap.make -s translate - @make -f src/tools/make/vishap.make -s assemble - @make -f src/tools/make/vishap.make -s testtools + @make -f src/tools/make/oberon.mk -s clean + @make -f src/tools/make/oberon.mk -s translate + @make -f src/tools/make/oberon.mk -s assemble + @make -f src/tools/make/oberon.mk -s testtools @rm -f "build/*.log" cd build && ../testcoordinator.exe @@ -316,7 +296,7 @@ coordinator: configuration # auto: machine specific build server auto: configuration - @make -f src/tools/make/vishap.make -s auto + @make -f src/tools/make/oberon.mk -s auto diff --git a/src/compiler/Vishap.Mod b/src/compiler/Compiler.Mod similarity index 82% rename from src/compiler/Vishap.Mod rename to src/compiler/Compiler.Mod index 0b1e4830..f27fd578 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Compiler.Mod @@ -1,4 +1,4 @@ -MODULE Vishap; (* J. Templ 3.2.95 *) +MODULE Compiler; (* J. Templ 3.2.95 *) IMPORT SYSTEM, Heap, Platform, Configuration, @@ -12,7 +12,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) PROCEDURE Module*(VAR done: BOOLEAN); VAR ext, new: BOOLEAN; p: OPT.Node; BEGIN - OPP.Module(p, OPM.opt); + OPP.Module(p, OPM.Options); IF OPM.noerr THEN OPV.Init; OPT.InitRecno; @@ -23,16 +23,16 @@ MODULE Vishap; (* J. Templ 3.2.95 *) OPC.Init; OPV.Module(p); IF OPM.noerr THEN - IF (OPM.mainprog IN OPM.opt) & (OPM.modName # "SYSTEM") THEN + IF (OPM.mainprog IN OPM.Options) & (OPM.modName # "SYSTEM") THEN OPM.DeleteNewSym; - IF ~(OPM.notcoloroutput IN OPM.opt) THEN vt100.SetAttr(vt100.Green) END; + IF ~(OPM.notcoloroutput IN OPM.Options) THEN vt100.SetAttr(vt100.Green) END; OPM.LogWStr(" Main program."); - IF ~(OPM.notcoloroutput IN OPM.opt) THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(OPM.notcoloroutput IN OPM.Options) THEN vt100.SetAttr(vt100.ResetAll) END; ELSE IF new THEN - IF ~(OPM.notcoloroutput IN OPM.opt) THEN vt100.SetAttr(vt100.Green) END; + IF ~(OPM.notcoloroutput IN OPM.Options) THEN vt100.SetAttr(vt100.Green) END; OPM.LogWStr(" New symbol file."); - IF ~(OPM.notcoloroutput IN OPM.opt) THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(OPM.notcoloroutput IN OPM.Options) THEN vt100.SetAttr(vt100.ResetAll) END; OPM.RegisterNewSym ELSIF ext THEN OPM.LogWStr(" Extended symbol file."); @@ -95,12 +95,12 @@ MODULE Vishap; (* J. Templ 3.2.95 *) END; (* 'assemble' (i.e. c compile) .c to object or executable. *) - IF ~(OPM.dontasm IN OPM.opt) THEN - IF OPM.dontlink IN OPM.opt THEN + IF ~(OPM.dontasm IN OPM.Options) THEN + IF OPM.dontlink IN OPM.Options THEN (* If not linking, just assemble each module. *) extTools.Assemble(OPM.modName) ELSE - IF ~(OPM.mainprog IN OPM.opt) THEN + IF ~(OPM.mainprog IN OPM.Options) THEN (* Assemble non main program and add object name to link list *) extTools.Assemble(OPM.modName); Strings.Append(" ", modulesobj); @@ -108,7 +108,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) Strings.Append(Configuration.objext, modulesobj) ELSE (* Assemble and link main program *) - extTools.LinkMain(OPM.modName, OPM.mainlinkstat IN OPM.opt, modulesobj) + extTools.LinkMain(OPM.modName, OPM.mainlinkstat IN OPM.Options, modulesobj) END END END @@ -123,7 +123,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) Platform.Exit(0) ELSE IF (sig = 4) & (Platform.HaltCode = -15) THEN - OPM.LogWStr(" --- Vishap Oberon: internal error"); + OPM.LogWStr(" --- Oberon compiler internal error"); OPM.LogWLn END ; Platform.Exit(2) @@ -135,4 +135,4 @@ BEGIN Platform.SetQuitHandler(Trap); Platform.SetBadInstructionHandler(Trap); Translate -END Vishap. +END Compiler. diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 260280e5..547f2521 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -829,16 +829,18 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) g: INTEGER; (* expression (source) form *) p, q: OPT.Struct; BEGIN - IF OPM.verbose IN OPM.opt THEN + y := ynode^.typ; f := x^.form; g := y^.form; + (* + IF OPM.verbose IN OPM.Options THEN OPM.LogWLn; OPM.LogWStr("PROCEDURE CheckAssign"); OPM.LogWLn; END; - y := ynode^.typ; f := x^.form; g := y^.form; - IF OPM.verbose IN OPM.opt THEN + IF OPM.verbose IN OPM.Options THEN OPM.LogWStr("y.form = "); OPM.LogWNum(y.form, 0); OPM.LogWLn; OPM.LogWStr("f = "); OPM.LogWNum(f, 0); OPM.LogWLn; OPM.LogWStr("g = "); OPM.LogWNum(g, 0); OPM.LogWLn; OPM.LogWStr("ynode.typ.syze = "); OPM.LogWNum(ynode.typ.size, 0); OPM.LogWLn; END; + *) IF (ynode^.class = OPT.Ntype) OR (ynode^.class = OPT.Nproc) & (f # OPT.ProcTyp) THEN err(126) END ; CASE f OF OPT.Undef, @@ -1328,7 +1330,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) f := atyp^.comp; ftyp := ftyp^.BaseTyp; atyp := atyp^.BaseTyp; IF fvarpar & (ftyp = OPT.bytetyp) THEN (* ok, but ... *) IF ~(f IN {OPT.Array, OPT.DynArr}) OR ~((atyp.form IN {OPT.Byte..OPT.Char, OPT.Int}) & (atyp.size = 1)) THEN - IF OPM.verbose IN OPM.opt THEN err(-301) END + IF OPM.verbose IN OPM.Options THEN err(-301) END END ELSIF f IN {OPT.Array, OPT.DynArr} THEN IF ftyp^.comp = OPT.DynArr THEN DynArrParCheck(ftyp, atyp, fvarpar) diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 456bcf87..4f4839c5 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -660,7 +660,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) EndStat; BegStat; OPM.WriteString("address *"); Ident(obj); OPM.WriteString(TagExt); base := NIL - ELSIF (OPM.ptrinit IN OPM.opt) & (vis = 0) & (obj^.mnolev > 0) & (obj^.typ^.form = OPT.Pointer) THEN + ELSIF (OPM.ptrinit IN OPM.Options) & (vis = 0) & (obj^.mnolev > 0) & (obj^.typ^.form = OPT.Pointer) THEN OPM.WriteString(" = NIL") END END ; @@ -779,7 +779,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteString("/* "); OPM.WriteString(Configuration.name); OPM.Write(" "); OPM.WriteString(Configuration.versionLong); OPM.Write (" "); (* noch *) FOR i := 0 TO MAX(SET) DO - IF i IN OPM.glbopt THEN + IF i IN OPM.Options THEN CASE i OF (* c.f. ScanOptions in OPM *) | OPM.inxchk: OPM.Write("x") | OPM.ranchk: OPM.Write("r") @@ -902,22 +902,22 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE EnterBody*; BEGIN OPM.WriteLn; OPM.WriteString(Export); - IF OPM.mainprog IN OPM.opt THEN + IF OPM.mainprog IN OPM.Options THEN OPM.WriteString("int main(int argc, char **argv)"); OPM.WriteLn; ELSE OPM.WriteString("void *"); OPM.WriteString(OPM.modName); OPM.WriteString(BodyNameExt); OPM.WriteLn; END ; BegBlk; BegStat; - IF OPM.mainprog IN OPM.opt THEN OPM.WriteString("__INIT(argc, argv)") ELSE OPM.WriteString("__DEFMOD") END ; + IF OPM.mainprog IN OPM.Options THEN OPM.WriteString("__INIT(argc, argv)") ELSE OPM.WriteString("__DEFMOD") END ; EndStat; - IF (OPM.mainprog IN OPM.opt) & demoVersion THEN BegStat; + IF (OPM.mainprog IN OPM.Options) & demoVersion THEN BegStat; OPM.WriteString('/*don`t do it!*/ printf("DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\n")'); EndStat END ; InitImports(OPT.topScope^.right); BegStat; - IF OPM.mainprog IN OPM.opt THEN OPM.WriteString('__REGMAIN("') ELSE OPM.WriteString('__REGMOD("') END ; + IF OPM.mainprog IN OPM.Options THEN OPM.WriteString('__REGMAIN("') ELSE OPM.WriteString('__REGMOD("') END ; OPM.WriteString(OPM.modName); IF GlbPtrs THEN OPM.WriteString('", EnumPtrs)') ELSE OPM.WriteString('", 0)') END ; EndStat; @@ -927,7 +927,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE ExitBody*; BEGIN BegStat; - IF OPM.mainprog IN OPM.opt THEN OPM.WriteString("__FINI;") ELSE OPM.WriteString("__ENDMOD;") END ; + IF OPM.mainprog IN OPM.Options THEN OPM.WriteString("__FINI;") ELSE OPM.WriteString("__ENDMOD;") END ; OPM.WriteLn; EndBlk END ExitBody; diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.Mod similarity index 78% rename from src/compiler/OPM.cmdln.Mod rename to src/compiler/OPM.Mod index e954ea63..f7a171aa 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.Mod @@ -24,7 +24,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) notcoloroutput* = 16; (* turn off color output *) forcenewsym* = 17; (* force new symbol file *) verbose* = 18; (* verbose *) - defopt* = {inxchk, typchk, ptrinit, assert}; (* default options *) nilval* = 0; @@ -87,10 +86,12 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) VAR SourceFileName : ARRAY 256 OF CHAR; - (* Parameter selectable sizes *) - AddressSize*, Alignment*, - SetSize*, - ShortintSize*, IntegerSize*, LongintSize*: INTEGER; + GlobalModel, Model*: CHAR; (* 2: S8/I16/L32, C: S16/I32/L64, V:S8/I32/L64 *) + GlobalAddressSize, AddressSize*: INTEGER; + GlobalAlignment, Alignment*: INTEGER; + GlobalOptions*, Options*: SET; + + ShortintSize*, IntegerSize*, LongintSize*, SetSize*: INTEGER; MaxSet*: INTEGER; MaxIndex*: SYSTEM.INT64; @@ -105,7 +106,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) pc*, entno*: INTEGER; (* entry number *) modName*: ARRAY 32 OF CHAR; objname*: ARRAY 64 OF CHAR; - opt*, glbopt*: SET; ErrorLineStartPos, ErrorLineLimitPos, ErrorLineNumber: LONGINT; (* Limit = start of next line *) @@ -120,8 +120,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) S: INTEGER; - OBERON: ARRAY 1024 OF CHAR; - MODULES: ARRAY 1024 OF CHAR; + ResourceDir*: ARRAY 1024 OF CHAR; (* ------------------------- Log Output ------------------------- *) @@ -134,12 +133,32 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) + (* Integer size support *) + + PROCEDURE SignedMaximum*(bytecount: LONGINT): SYSTEM.INT64; + VAR result: SYSTEM.INT64; + BEGIN + result := 1; + result := SYSTEM.LSH(result, bytecount*8-1); + RETURN result - 1; + END SignedMaximum; + + PROCEDURE SignedMinimum*(bytecount: LONGINT): SYSTEM.INT64; + BEGIN RETURN -SignedMaximum(bytecount) - 1 + END SignedMinimum; + + + (* Unchecked conversion of any size integer to INTEGER or LONGINT *) + PROCEDURE Longint* (n: SYSTEM.INT64): LONGINT; BEGIN RETURN SYSTEM.VAL(LONGINT, n) END Longint; PROCEDURE Integer* (n: SYSTEM.INT64): INTEGER; BEGIN RETURN SYSTEM.VAL(INTEGER, n) END Integer; - (* ------------------------- parameter handling -------------------------*) - PROCEDURE ScanOptions(s: ARRAY OF CHAR; VAR opt: SET); + + + (* --------------- Initialisation and parameter handling ---------------*) + + PROCEDURE ScanOptions(s: ARRAY OF CHAR); VAR i: INTEGER; BEGIN i := 1; (* skip - *) @@ -147,34 +166,32 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) CASE s[i] OF (* Run time safety *) - | "p": opt := opt / {ptrinit} (* Initialise pointers to NIL. *) - | "a": opt := opt / {assert} (* Halt on assertion failures. *) - | "r": opt := opt / {ranchk} (* Halt on range check failures. *) - | "t": opt := opt / {typchk} (* Halt on type guad failure. *) - | "x": opt := opt / {inxchk} (* Halt on index out of range. *) + | "p": Options := Options / {ptrinit} (* Initialise pointers to NIL. *) + | "a": Options := Options / {assert} (* Halt on assertion failures. *) + | "r": Options := Options / {ranchk} (* Halt on range check failures. *) + | "t": Options := Options / {typchk} (* Halt on type guad failure. *) + | "x": Options := Options / {inxchk} (* Halt on index out of range. *) (* Symbol file management *) - | "e": opt := opt / {extsf} (* Allow extension of old symbol file. *) - | "s": opt := opt / {newsf} (* Allow generation of new symbol file. *) - | "F": opt := opt / {forcenewsym} (* Force generation of new symbol file. *) + | "e": Options := Options / {extsf} (* Allow extension of old symbol file. *) + | "s": Options := Options / {newsf} (* Allow generation of new symbol file. *) + | "F": Options := Options / {forcenewsym} (* Force generation of new symbol file. *) (* C compiler and linker control *) - | "m": opt := opt / {mainprog} (* This module is main. Link dynamically. *) - | "M": opt := opt / {mainlinkstat} (* This module is main. Link statically. *) - | "S": opt := opt / {dontasm} (* Don't call C compiler *) - | "c": opt := opt / {dontlink} (* Don't link. *) + | "m": Options := Options / {mainprog} (* This module is main. Link dynamically. *) + | "M": Options := Options / {mainlinkstat} (* This module is main. Link statically. *) + | "S": Options := Options / {dontasm} (* Don't call C compiler *) + | "c": Options := Options / {dontlink} (* Don't link. *) (* Miscellaneous *) - | "f": opt := opt / {notcoloroutput} (* Disable vt100 control characters in status output. *) - | "V": opt := opt / {verbose} + | "f": Options := Options / {notcoloroutput} (* Disable vt100 control characters in status output. *) + | "V": Options := Options / {verbose} (* Elementary type size model *) | "O": IF i+1 >= Strings.Length(s) THEN LogWStr("-O option requires following size model character."); LogWLn ELSE - CASE s[i+1] OF - |'2': ShortintSize := 1; IntegerSize := 2; LongintSize := 4; SetSize := 4 (* Original Oberon / Oberon 2 *) - |'V': ShortintSize := 1; IntegerSize := 4; LongintSize := 8; SetSize := 8 (* Vishap 64 bit *) - |'C': ShortintSize := 2; IntegerSize := 4; LongintSize := 8; SetSize := 8 (* Component Pascal *) - ELSE LogWStr("Unrecognised size model character following -O."); LogWLn + Model := s[i+1]; + IF (Model # '2') & (Model # 'C') & (Model # 'V') THEN + LogWStr("Unrecognised size model character following -O."); LogWLn END; INC(i) END @@ -212,26 +229,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END ScanOptions; - PROCEDURE ^GetProperties; - - - (* Undocumented options used by the build system: - - Todo - this is obsoleted by the -A and -O options. Remove when the build system - has been updated. - - The following parameter overrides the integer size, pointer size and alignment - settings compiled into the binary. They are used when bootstrapping to generate - the C source for a compiler with different sizes to the current compiler. - - -Bnnn Where each n is a single digit specifying the integer size, pointer size - and alignment in bytes. - - An alignment of n means that types smaller than n align to their - own size, types larger than n align to n bytes. - - LONGINT size will be set to twice the integer size. - *) + PROCEDURE -GetAlignment(VAR a: INTEGER) "struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s"; PROCEDURE OpenPar*(): BOOLEAN; (* prepare for a sequence of translations *) VAR s: ARRAY 256 OF CHAR; @@ -286,43 +284,82 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LogWStr("Repeating an option toggles its value."); LogWLn; RETURN FALSE ELSE + (* Set options to initial defaults *) + AddressSize := SIZE(SYSTEM.ADDRESS); (* This compilers address size *) + GetAlignment(Alignment); (* This compilers alignment *) + Model := '2'; (* Size model of common Oberon-2 implementations: S8/I16/L32 *) + Options := {inxchk, typchk, ptrinit, assert}; (* Default options *) + + (* Pick up global option changes from start of command line *) S:=1; s:=""; Platform.GetArg(S, s); - - glbopt := defopt; - WHILE s[0] = OptionChar DO - ScanOptions(s, glbopt); + ScanOptions(s); INC(S); s:=""; Platform.GetArg(S, s) END; + (* Record global option settings for this command line *) + GlobalAddressSize := AddressSize; + GlobalAlignment := Alignment; + GlobalModel := Model; + GlobalOptions := Options; + RETURN TRUE END; END OpenPar; - PROCEDURE InitOptions*; (* get the options for one translation *) - VAR s: ARRAY 256 OF CHAR; + PROCEDURE VerboseListSizes; BEGIN - opt := glbopt; + LogWLn; + LogWStr("Type Size"); LogWLn; + LogWStr("SHORTINT "); LogWNum(ShortintSize, 4); (* LogWNum(SIntAlign, 5); *) LogWLn; + LogWStr("INTEGER "); LogWNum(IntegerSize, 4); (* LogWNum(IntAlign, 5); *) LogWLn; + LogWStr("LONGINT "); LogWNum(LongintSize, 4); (* LogWNum(LIntAlign, 5); *) LogWLn; + LogWStr("SET "); LogWNum(SetSize, 4); (* LogWNum(SetAlign, 5); *) LogWLn; + LogWStr("ADDRESS "); LogWNum(AddressSize, 4); (* LogWNum(PointerAlign, 5); *) LogWLn; + LogWLn; + LogWStr("Alignment: "); LogWNum(Alignment, 4); LogWLn; + END VerboseListSizes; + + + PROCEDURE InitOptions*; (* get the options for one translation *) + VAR s: ARRAY 256 OF CHAR; searchpath, modules: ARRAY 1024 OF CHAR; + MODULES: ARRAY 1024 OF CHAR; + + BEGIN + Options := GlobalOptions; Model:=GlobalModel; Alignment := GlobalAlignment; AddressSize := GlobalAddressSize; + s:=""; Platform.GetArg(S, s); WHILE s[0] = OptionChar DO - ScanOptions(s, opt); + ScanOptions(s); INC(S); s:=""; Platform.GetArg(S, s) END; - (* - dontAsm := dontasm IN opt; - dontLink := dontlink IN opt; - mainProg := mainprog IN opt; - mainLinkStat := mainlinkstat IN opt; - notColorOutput := notcoloroutput IN opt; - forceNewSym := forcenewsym IN opt; - Verbose := verbose IN opt; - *) + IF mainlinkstat IN Options THEN INCL(Options, mainprog) END; - IF mainlinkstat IN opt THEN INCL(glbopt, mainprog); INCL(opt, mainprog) END; + MaxIndex := SignedMaximum(AddressSize); + CASE Model OF + |'2': ShortintSize := 1; IntegerSize := 2; LongintSize := 4; SetSize := 4 + |'C': ShortintSize := 2; IntegerSize := 4; LongintSize := 8; SetSize := 8 + |'V': ShortintSize := 1; IntegerSize := 4; LongintSize := 8; SetSize := 8 + ELSE ShortintSize := 1; IntegerSize := 2; LongintSize := 4; SetSize := 4 + END; + MaxSet := SetSize * 8 - 1; - GetProperties; + IF verbose IN Options THEN VerboseListSizes END; + + ResourceDir := Configuration.installdir; + Strings.Append("/ ", ResourceDir); + ResourceDir[Strings.Length(ResourceDir)-1] := Model; + + modules := ""; Platform.GetEnv("MODULES", modules); + searchpath := "."; Platform.GetEnv("OBERON", searchpath); + Strings.Append(";.;", searchpath); + Strings.Append(modules, searchpath); + Strings.Append(";", searchpath); + Strings.Append(ResourceDir, searchpath); + Strings.Append("/sym;", searchpath); + Files.SetSearchPath(searchpath); END InitOptions; @@ -391,13 +428,13 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) buf: ARRAY 1024 OF CHAR; BEGIN IF n >= 0 THEN - IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.Red) END; + IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.Red) END; LogWStr(" err "); - IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.ResetAll) END; ELSE - IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.Magenta) END; + IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.Magenta) END; LogWStr(" warning "); n := -n; - IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.ResetAll) END; END ; LogWNum(n, 1); LogWStr(" "); @@ -470,9 +507,9 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) i := SHORT(Longint(pos - ErrorLineStartPos)); WHILE i > 0 DO LogW(" "); DEC(i) END; - IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.Green) END; + IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.Green) END; LogW("^"); - IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.ResetAll) END; Files.Close(f); END ShowLine; @@ -548,93 +585,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) - (* ------------------------- initialization ------------------------- *) - - PROCEDURE GetProperty(VAR S: Texts.Scanner; name: ARRAY OF CHAR; VAR size, align: INTEGER); - BEGIN - IF (S.class = Texts.Name) & (S.s = name) THEN Texts.Scan(S); - IF S.class = Texts.Int THEN size := SHORT(S.i); Texts.Scan(S) ELSE Mark(-157, -1) END ; - IF S.class = Texts.Int THEN align := SHORT(S.i); Texts.Scan(S) ELSE Mark(-157, -1) END - ELSE Mark(-157, -1) - END - END GetProperty; - - - PROCEDURE minusop(i: LONGINT): LONGINT; - BEGIN - RETURN -i; - END minusop; - - - PROCEDURE power0(i, j : LONGINT) : LONGINT; (* we would like to calculate exact Min Max values in GetProperties, not hardcode em, noch *) - VAR k : LONGINT; - p : LONGINT; - BEGIN - k := 1; - p := i; - REPEAT - p := p * i; - INC(k); - UNTIL k=j; - RETURN p; - END power0; - - - PROCEDURE VerboseListSizes; - BEGIN - LogWLn; - LogWStr("Type Size"); LogWLn; - LogWStr("SHORTINT "); LogWNum(ShortintSize, 4); (* LogWNum(SIntAlign, 5); *) LogWLn; - LogWStr("INTEGER "); LogWNum(IntegerSize, 4); (* LogWNum(IntAlign, 5); *) LogWLn; - LogWStr("LONGINT "); LogWNum(LongintSize, 4); (* LogWNum(LIntAlign, 5); *) LogWLn; - LogWStr("SET "); LogWNum(SetSize, 4); (* LogWNum(SetAlign, 5); *) LogWLn; - LogWStr("ADDRESS "); LogWNum(AddressSize, 4); (* LogWNum(PointerAlign, 5); *) LogWLn; - LogWLn; - LogWStr("Alignment: "); LogWNum(Alignment, 4); LogWLn; - END VerboseListSizes; - - - - - (* Integer size support *) - - PROCEDURE SignedMaximum*(bytecount: LONGINT): SYSTEM.INT64; - VAR result: SYSTEM.INT64; - BEGIN - result := 1; - result := SYSTEM.LSH(result, bytecount*8-1); - RETURN result - 1; - END SignedMaximum; - - PROCEDURE SignedMinimum*(bytecount: LONGINT): SYSTEM.INT64; - BEGIN RETURN -SignedMaximum(bytecount) - 1 - END SignedMinimum; - - - - - - - - PROCEDURE GetProperties(); - (* VAR base: LONGINT; *) - BEGIN - (* Fixed and Configuration.Mod based sizes have been initialised in - the module startup code, and maybe overridden by the -Bnnn bootstrap - parameter *) - - MaxReal := 3.40282346D38; (* REAL is 4 bytes *) - MaxLReal := 1.7976931348623157D307 * 9.999999; (* LONGREAL is 8 bytes *) - (*should be 1.7976931348623157D308 *) - - MinReal := -MaxReal; - MinLReal := -MaxLReal; - MaxSet := SetSize * 8 - 1; - MaxIndex := SignedMaximum(AddressSize); - - IF verbose IN opt THEN VerboseListSizes END; - END GetProperties; - (* ------------------------- Read Symbol File ------------------------- *) @@ -711,7 +661,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE RegisterNewSym*; BEGIN - IF (modName # "SYSTEM") OR (mainprog IN opt) THEN Files.Register(newSFile) END + IF (modName # "SYSTEM") OR (mainprog IN Options) THEN Files.Register(newSFile) END END RegisterNewSym; PROCEDURE DeleteNewSym*; @@ -837,8 +787,8 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) IF noerr THEN LogWStr(" "); LogWNum(Files.Pos(R[BodyFile]), 0); LogWStr(" chars.") END; IF noerr THEN IF modName = "SYSTEM" THEN - IF ~(mainprog IN opt) THEN Files.Register(BFile) END - ELSIF ~(mainprog IN opt) THEN + IF ~(mainprog IN Options) THEN Files.Register(BFile) END + ELSIF ~(mainprog IN Options) THEN Append(R[HeaderInclude], HFile); Files.Register(HIFile); Files.Register(BFile) ELSE @@ -854,29 +804,11 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) -PROCEDURE -GetAlignment(VAR a: INTEGER) "struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s"; - BEGIN + MaxReal := 3.40282346D38; (* REAL is 4 bytes *) + MaxLReal := 1.7976931348623157D307 * 9.999999; (* LONGREAL is 8 bytes, should be 1.7976931348623157D308 *) + MinReal := -MaxReal; + MinLReal := -MaxLReal; + Texts.OpenWriter(W); - - MODULES := ""; Platform.GetEnv("MODULES", MODULES); - - OBERON := "."; Platform.GetEnv("OBERON", OBERON); - Strings.Append(";.;", OBERON); - Strings.Append(MODULES, OBERON); - Strings.Append(";", OBERON); - Strings.Append(Configuration.installdir, OBERON); - Strings.Append("/sym;", OBERON); - - Files.SetSearchPath(OBERON); - - (* Default address size and alignment are those of this compiler *) - AddressSize := SIZE(SYSTEM.ADDRESS); - GetAlignment(Alignment); - - (* Default type size model is that of the original Oberon-2 implementation (-O2) *) - ShortintSize := 1; - IntegerSize := 2; - LongintSize := 4; - SetSize := 4 END OPM. diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index bd95c80f..ad3afe73 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -1234,7 +1234,7 @@ END Import; i := 1; WHILE i < maxImps DO expCtxt.locmno[i] := -1; INC(i) END; OutObj(topScope^.right); ext := sfpresent & symExtended; - new := ~sfpresent OR symNew OR (OPM.forcenewsym IN OPM.opt); + new := ~sfpresent OR symNew OR (OPM.forcenewsym IN OPM.Options); IF OPM.noerr & sfpresent & (impCtxt.reffp # expCtxt.reffp) THEN new := TRUE; IF ~extsf THEN err(155) END @@ -1296,8 +1296,8 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; (*initialization of module SYSTEM*) EnterTyp("BYTE", Byte, 1, bytetyp); - EnterTyp("PTR", Pointer, -1, sysptrtyp); (* Size set in Vishap.PropagateElementaryTypeSize *) - EnterTyp("ADDRESS", Int, -1, adrtyp); (* Size set in Vishap.PropagateElementaryTypeSize *) + EnterTyp("PTR", Pointer, -1, sysptrtyp); (* Size set in Compiler.PropagateElementaryTypeSize *) + EnterTyp("ADDRESS", Int, -1, adrtyp); (* Size set in Compiler.PropagateElementaryTypeSize *) EnterTyp("INT8", Int, 1, int8typ); EnterTyp("INT16", Int, 2, int16typ); EnterTyp("INT32", Int, 4, int32typ); @@ -1322,7 +1322,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTyp("BOOLEAN", Bool, 1, booltyp); EnterTyp("CHAR", Char, 1, chartyp); - EnterTyp("SET", Set, -1, settyp); (* Size set in Vishap.PropagateElementaryTypeSize *) + EnterTyp("SET", Set, -1, settyp); (* Size set in Compiler.PropagateElementaryTypeSize *) EnterTyp("REAL", Real, 4, realtyp); EnterTyp("LONGREAL", LReal, 8, lrltyp); EnterTyp("HUGEINT", Int, 8, hinttyp); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index dafedf3d..34d1ef34 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -162,7 +162,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPT.Nindex, OPT.Nproc, OPT.Ncall: RETURN 10 - | OPT.Nguard: IF OPM.typchk IN OPM.opt THEN RETURN 10 ELSE RETURN 9 (*cast*) END + | OPT.Nguard: IF OPM.typchk IN OPM.Options THEN RETURN 10 ELSE RETURN 9 (*cast*) END | OPT.Nvarpar: IF comp IN {OPT.Array, OPT.DynArr} THEN RETURN 10 ELSE RETURN 9 END (* arrays don't need deref *) | OPT.Nderef: RETURN 9 | OPT.Nmop: CASE subclass OF @@ -243,7 +243,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteString("__SETOF("); Entier(n, MinPrec); OPM.WriteString(","); OPM.WriteInt(newtype.size*8); OPM.Write(CloseParen) ELSIF to = OPT.Int THEN - IF (newtype.size < n.typ.size) & (OPM.ranchk IN OPM.opt) THEN + IF (newtype.size < n.typ.size) & (OPM.ranchk IN OPM.Options) THEN OPM.WriteString("__SHORT"); IF SideEffects(n) THEN OPM.Write("F") END; OPM.Write(OpenParen); Entier(n, MinPrec); OPM.WriteString(Comma); OPM.WriteInt(OPM.SignedMaximum(newtype.size) + 1); OPM.Write(CloseParen) @@ -251,7 +251,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 SizeCast(n.typ.size, newtype.size); Entier(n, 9) END ELSIF to = OPT.Char THEN - IF OPM.ranchk IN OPM.opt THEN OPM.WriteString("__CHR"); + IF OPM.ranchk IN OPM.Options THEN OPM.WriteString("__CHR"); IF SideEffects(n) THEN OPM.Write("F") END ; OPM.Write(OpenParen); Entier(n, MinPrec); OPM.Write(CloseParen) ELSE OPM.WriteString("(CHAR)"); Entier(n, 9) @@ -280,7 +280,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE Index(n, d: OPT.Node; prec, dim: INTEGER); BEGIN - IF ~(OPM.inxchk IN OPM.opt) + IF ~(OPM.inxchk IN OPM.Options) OR (n^.right^.class = OPT.Nconst) & ((n^.right^.conval^.intval = 0) OR (n^.left^.typ^.comp # OPT.DynArr)) THEN expr(n^.right, prec) ELSE @@ -342,7 +342,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.Write(CloseBracket) END | OPT.Nguard: typ := n^.typ; obj := n^.left^.obj; - IF OPM.typchk IN OPM.opt THEN + IF OPM.typchk IN OPM.Options THEN IF typ^.comp = OPT.Record THEN OPM.WriteString(GuardRecFunc); IF obj^.mnolev # OPM.level THEN (*intermediate level var-par record*) OPM.WriteStringVar(obj^.scope^.name); OPM.WriteString("__curr->"); OPC.Ident(obj) @@ -363,7 +363,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.Write("("); OPC.Ident(typ^.strobj); OPM.Write(")"); expr(n^.left, designPrec) END END - | OPT.Neguard: IF OPM.typchk IN OPM.opt THEN + | OPT.Neguard: IF OPM.typchk IN OPM.Options THEN IF n^.left^.class = OPT.Nvarpar THEN OPM.WriteString("__GUARDEQR("); OPC.CompleteIdent(n^.left^.obj); OPM.WriteString(Comma); TypeOf(n^.left); ELSE OPM.WriteString("__GUARDEQP("); expr(n^.left^.left, MinPrec) @@ -844,7 +844,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END ; ActualPar(n^.right, n^.obj) | OPT.Nifelse: IF n^.subcl # OPT.assertfn THEN IfStat(n, FALSE, outerProc) - ELSIF OPM.assert IN OPM.opt THEN + ELSIF OPM.assert IN OPM.Options THEN OPM.WriteString("__ASSERT("); expr(n^.left^.left^.left, MinPrec); OPM.WriteString(Comma); OPM.WriteInt(n^.left^.right^.right^.conval^.intval); OPM.Write(CloseParen); OPC.EndStat END @@ -867,7 +867,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteString("goto exit__"); OPM.WriteInt(exit.label) END | OPT.Nreturn: IF OPM.level = 0 THEN - IF OPM.mainprog IN OPM.opt THEN OPM.WriteString("__FINI") ELSE OPM.WriteString("__ENDMOD") END + IF OPM.mainprog IN OPM.Options THEN OPM.WriteString("__FINI") ELSE OPM.WriteString("__ENDMOD") END ELSE IF n^.left # NIL THEN (* Make local copy of result before ExitProc deletes dynamic vars *) @@ -895,7 +895,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE Module*(prog: OPT.Node); BEGIN - IF ~(OPM.mainprog IN OPM.opt) THEN OPC.GenHdr(prog^.right); OPC.GenHdrIncludes END ; + IF ~(OPM.mainprog IN OPM.Options) THEN OPC.GenHdr(prog^.right); OPC.GenHdrIncludes END ; OPC.GenBdy(prog^.right); stat(prog, NIL) END Module; diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index 22752d9b..b4f6ca95 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -2,13 +2,13 @@ MODULE extTools; IMPORT Strings, Console, Configuration, Platform, OPM; -VAR compilationOptions, CFLAGS: ARRAY 1023 OF CHAR; +VAR CFLAGS: ARRAY 1023 OF CHAR; PROCEDURE execute(title: ARRAY OF CHAR; cmd: ARRAY OF CHAR); VAR r, status, exitcode: INTEGER; BEGIN - IF OPM.verbose IN OPM.opt THEN + IF OPM.verbose IN OPM.Options THEN Console.String(title); Console.String(cmd); Console.Ln END; r := Platform.System(cmd); @@ -29,16 +29,27 @@ BEGIN END execute; +PROCEDURE InitialiseCompilerCommand(VAR s: ARRAY OF CHAR); +BEGIN + COPY(Configuration.compile, s); + Strings.Append(' -I "', s); + Strings.Append(OPM.ResourceDir, s); + Strings.Append('/include" ', s); + Platform.GetEnv("CFLAGS", CFLAGS); + Strings.Append (CFLAGS, s); + Strings.Append (" ", s); +END InitialiseCompilerCommand; + + PROCEDURE Assemble*(moduleName: ARRAY OF CHAR); VAR cmd: ARRAY 1023 OF CHAR; BEGIN - cmd := Configuration.compile; - Strings.Append(compilationOptions, cmd); - Strings.Append("-c ", cmd); - Strings.Append(moduleName, cmd); - Strings.Append(".c", cmd); - execute("Assemble: ", cmd); + InitialiseCompilerCommand(cmd); + Strings.Append("-c ", cmd); + Strings.Append(moduleName, cmd); + Strings.Append(".c", cmd); + execute("Assemble: ", cmd); END Assemble; @@ -46,9 +57,7 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition VAR cmd: ARRAY 1023 OF CHAR; BEGIN - cmd := Configuration.compile; - Strings.Append(" ", cmd); - Strings.Append(compilationOptions, cmd); + InitialiseCompilerCommand(cmd); Strings.Append(moduleName, cmd); Strings.Append(".c ", cmd); Strings.Append(additionalopts, cmd); @@ -58,7 +67,7 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition Strings.Append(Configuration.objflag, cmd); Strings.Append(moduleName, cmd); Strings.Append(Configuration.linkflags, cmd); - Strings.Append(Configuration.installdir, cmd); + Strings.Append(OPM.ResourceDir, cmd); Strings.Append('/lib"', cmd); Strings.Append(Configuration.libspec, cmd); @@ -66,11 +75,5 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition END LinkMain; -BEGIN - Strings.Append(' -I "', compilationOptions); - Strings.Append(Configuration.installdir, compilationOptions); - Strings.Append('/include" ', compilationOptions); - Platform.GetEnv("CFLAGS", CFLAGS); - Strings.Append (CFLAGS, compilationOptions); - Strings.Append (" ", compilationOptions); END extTools. +, \ No newline at end of file diff --git a/src/system/Files.Mod b/src/system/Files.Mod index 388b3a95..76732ebc 100644 --- a/src/system/Files.Mod +++ b/src/system/Files.Mod @@ -433,11 +433,6 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files r.res := 0; r.eof := FALSE END ReadBytes; - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - PROCEDURE Base* (VAR r: Rider): File; BEGIN RETURN r.buf.f END Base; diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index 2a908c99..2db3669c 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -14,9 +14,9 @@ TYPE FileHandle* = LONGINT; FileIdentity* = RECORD - volume*: LONGINT; (* dev on Unix filesystems, volume serial number on NTFS *) - index*: LONGINT; (* inode on Unix filesystems, file id on NTFS *) - mtime*: LONGINT; (* File modification time, value is system dependent *) + volume: LONGINT; (* dev on Unix filesystems, volume serial number on NTFS *) + index: LONGINT; (* inode on Unix filesystems, file id on NTFS *) + mtime: LONGINT; (* File modification time, value is system dependent *) END; EnvPtr = POINTER TO ARRAY 1024 OF CHAR; diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 5e6e518b..b8d261dd 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -384,8 +384,6 @@ void writeMakeParameters() { fprintf(fd, "VERSION=%s\n", version); fprintf(fd, "ONAME=%s\n", oname); fprintf(fd, "DATAMODEL=%s\n", dataModel); - fprintf(fd, "INTSIZE=%d\n", intsize); - fprintf(fd, "MODEL=-O%c\n", intsize == 2 ? '2' : 'V'); fprintf(fd, "ADRSIZE=%d\n", addressSize); fprintf(fd, "ALIGNMENT=%d\n", alignment); fprintf(fd, "INSTALLDIR=%s\n", installdir); diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk new file mode 100644 index 00000000..baf784c0 --- /dev/null +++ b/src/tools/make/oberon.mk @@ -0,0 +1,379 @@ +# DO NOT RUN THIS MAKEFILE DIRECTLY. +# +# Always use the makefile in the root of the enlistment. This makefile +# depends on up to date configuration files generated by the root makefile. + + + + +# Be independent of any CFLAGS settings in the calling environment +CFLAGS = + +# Gnu make has the make initial directory in CURDIR, BSD make has it in .CURDIR. +ROOTDIR = $(CURDIR)$(.CURDIR) + +# Configuration.Make is created by src/tools/make/configure.c, which is run on +# *every* build by the makefile in the enlistment root. +include ./Configuration.Make + +FLAVOUR = $(OS).$(DATAMODEL).$(COMPILER) +BUILDDIR = build/$(FLAVOUR) +OBECOMP = $(ONAME)$(BINEXT) + + + +# Default make target - explain usage +usage: + @echo "" + @echo Do not run this makefile directly, always run the makefile in + @echo the root of the enlistment. + + + + +clean: + @printf "\n\n--- Cleaning branch $(BRANCH) $(OS) $(COMPILER) $(DATAMODEL) ---\n\n" + rm -rf $(BUILDDIR) + rm -f $(OBECOMP) + + + + +# Assemble: Generate the Vishap Oberon compiler binary by compiling the C sources in the build directory + +assemble: + @printf "\nmake assemble - compiling Oberon compiler c source:\n" + @printf " VERSION: %s\n" "$(VERSION)" + @printf " BRANCH: %s\n" "$(BRANCH)" + @printf " Target characteristics:\n" + @printf " PLATFORM: %s\n" "$(PLATFORM)" + @printf " OS: %s\n" "$(OS)" + @printf " BUILDDIR: %s\n" "$(BUILDDIR)" + @printf " INSTALLDIR: %s\n" "$(INSTALLDIR)" + @printf " Oberon characteristics:\n" + @printf " MODEL: %s\n" "$(MODEL)" + @printf " ADRSIZE: %s\n" "$(ADRSIZE)" + @printf " ALIGNMENT: %s\n" "$(ALIGNMENT)" + @printf " C compiler:\n" + @printf " COMPILER: %s\n" "$(COMPILER)" + @printf " COMPILE: %s\n" "$(COMPILE)" + @printf " DATAMODEL: %s\n" "$(DATAMODEL)" + + cd $(BUILDDIR) && $(COMPILE) -c SYSTEM.c Configuration.c Platform.c Heap.c + cd $(BUILDDIR) && $(COMPILE) -c Console.c Strings.c Modules.c Files.c + cd $(BUILDDIR) && $(COMPILE) -c Reals.c Texts.c vt100.c errors.c + cd $(BUILDDIR) && $(COMPILE) -c OPM.c extTools.c OPS.c OPT.c + cd $(BUILDDIR) && $(COMPILE) -c OPC.c OPV.c OPB.c OPP.c + + cd $(BUILDDIR) && $(COMPILE) $(STATICLINK) Compiler.c -o $(ROOTDIR)/$(OBECOMP) \ + SYSTEM.o Configuration.o Platform.o Heap.o Console.o Strings.o Modules.o Files.o \ + Reals.o Texts.o vt100.o errors.o OPM.o extTools.o OPS.o OPT.o \ + OPC.o OPV.o OPB.o OPP.o + + cp src/system/*.[ch] $(BUILDDIR) + @printf "$(OBECOMP) created.\n" + + + + +compilerfromsavedsource: + @echo Populating clean build directory from bootstrap C sources $(PLATFORM)-$(ADRSIZE)$(ALIGNMENT). + @mkdir -p $(BUILDDIR) + @cp bootstrap/$(PLATFORM)-$(ADRSIZE)$(ALIGNMENT)/* $(BUILDDIR) + @cp bootstrap/*.[ch] $(BUILDDIR) + @make -f src/tools/make/oberon.mk -s assemble + @cp bootstrap/*.[ch] $(BUILDDIR) + + + + +translate: +# Make sure we have an oberon compiler binary: if we built one earlier we'll use it, +# otherwise use one of the pre-prepared sets of C sources in the bootstrap directory. + + if [ ! -e $(OBECOMP) ]; then make -f src/tools/make/oberon.mk -s compilerfromsavedsource; fi + + @printf "\nmake translate - translating compiler source from Oberon to C:\n" + @printf " PLATFORM: %s\n" $(PLATFORM) + @printf " MODEL: %s\n" $(MODEL) + @printf " ADRSIZE: %s\n" $(ADRSIZE) + @printf " ALIGNMENT: %s\n" $(ALIGNMENT) + @mkdir -p $(BUILDDIR) + @rm -f $(BUILDDIR)/*.sym + + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../Configuration.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/system/Platform$(PLATFORM).Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFapx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/system/Heap.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/system/Console.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/library/v4/Strings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/library/v4/Modules.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/system/Files.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/library/v4/Reals.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/library/v4/Texts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/library/misc/vt100.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/errors.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPM.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/extTools.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPS.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPT.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPC.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPV.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPB.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPP.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ssfm -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/Compiler.Mod + + @printf "$(BUILDDIR) filled with compiler C source.\n" + + + + +browsercmd: + @printf "\nMaking symbol browser\n" + @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -fSm -O$(MODEL) ../../src/tools/browser/BrowserCmd.Mod + @cd $(BUILDDIR); $(COMPILE) BrowserCmd.c -o showdef \ + Platform.o Texts.o OPT.o Heap.o Console.o SYSTEM.o OPM.o OPS.o OPV.o \ + Files.o Reals.o Modules.o vt100.o errors.o Configuration.o Strings.o \ + OPC.o + + + + +FORCE: + +# installable: Check for access to the installation directory + +installable: + @rm -rf "S(INSTALLDIR)/test-access-qqq" + @if ! mkdir -p "$(INSTALLDIR)/test-access-qqq";then echo "\\n\\n Cannot write to install directory.\\n Please use sudo or run as root/administrator.\\n\\n"; exit 1;fi + @rm -rf "S(INSTALLDIR)/test-access-qqq" + + + + +# install: Use only after a successful full build. Installs the compiler +# and libraries in /opt/$(ONAME). +# May require root access. +install: + @printf "\nInstalling into \"$(INSTALLDIR)\"\n" + @rm -rf "$(INSTALLDIR)/bin" "$(INSTALLDIR)/$(MODEL)" + @mkdir -p "$(INSTALLDIR)/bin" + @mkdir -p "$(INSTALLDIR)/$(MODEL)/include" + @mkdir -p "$(INSTALLDIR)/$(MODEL)/sym" + @mkdir -p "$(INSTALLDIR)/$(MODEL)/lib" + @cp $(BUILDDIR)/*.h "$(INSTALLDIR)/$(MODEL)/include/" + @cp $(BUILDDIR)/*.sym "$(INSTALLDIR)/$(MODEL)/sym/" + @cp $(OBECOMP) "$(INSTALLDIR)/bin/$(OBECOMP)" + @-cp $(BUILDDIR)/showdef$(BINEXT) "$(INSTALLDIR)/bin" + @cp $(BUILDDIR)/lib$(ONAME)* "$(INSTALLDIR)/$(MODEL)/lib/" + @if which ldconfig >/dev/null 2>&1; then $(LDCONFIG); fi + + +# showpath: Describe how to set the PATH variable +showpath: + @printf "\nNow add $(INSTALLDIR)/bin to your path, for example with the command:\n" + @printf "export PATH=\"$(INSTALLDIR)/bin:\$$PATH\"\n" + @printf "\n" + + + + +uninstall: + @printf "\nUninstalling from \"$(INSTALLDIR)\"\n" + rm -rf "$(INSTALLDIR)" + rm -f /etc/ld.so.conf/lib$(ONAME) + if which ldconfig >/dev/null 2>&1; then ldconfig; fi + + + + +v4: + @printf "\nMaking v4 library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/v4/Args.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/v4/Printer.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/v4/Sets.Mod + +ooc2: + @printf "\nMaking ooc2 library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2Strings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2Ascii.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2CharClass.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2ConvTypes.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2IntConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2IntStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2Real0.Mod + + +TODO: Comment disabled lines contain use of VAL that reads beyond source variable + +ooc: + @printf "\nMaking ooc library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLowReal.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLowLReal.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealMath.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocOakMath.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLongInts.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocComplexMath.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLComplexMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocAscii.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocCharClass.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocConvTypes.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealConv.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealStr.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealConv.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocIntConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocIntStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocMsg.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocSysClock.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocTime.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocChannel.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocStrings2.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocFilenames.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocTextRider.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocBinaryRider.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocJulianDay.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocFilenames.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocwrapperlibc.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocC$(DATAMODEL).Mod + +oocX11: + @printf "\nMaking oocX11 library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/oocX11/oocX11.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/oocX11/oocXutil.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/oocX11/oocXYplane.Mod + +ulm: + @printf "\nMaking ulm library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmObjects.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPriorities.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmServices.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSys.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSYSTEM.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmEvents.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmProcess.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmResources.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmForwarders.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmRelatedEvents.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTypes.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreams.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysTypes.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTexts.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysConversions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmErrors.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysErrors.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysStat.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmASCII.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSets.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIO.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmAssertions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIndirectDisciplines.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreamDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIEEE.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmMC68881.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmReals.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPrint.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmWrite.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConstStrings.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPlotters.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysIO.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmLoader.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmNetIO.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPersistentObjects.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPersistentDisciplines.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmOperations.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmScales.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimes.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmClocks.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimers.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConditions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreamConditions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimeConditions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmCiphers.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmCipherOps.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmBlockCiphers.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmAsymmetricCiphers.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConclusions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmRandomGenerators.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTCrypt.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIntOperations.Mod + +pow32: + @printf "\nMaking pow library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/pow/powStrings.Mod + +misc: + @printf "\nMaking misc library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/system/Oberon.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/crt.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/Listen.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/MersenneTwister.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/MultiArrays.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/MultiArrayRiders.Mod + +s3: + @printf "\nMaking s3 library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethBTrees.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethMD5.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethSets.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlib.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibBuffers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibInflate.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibDeflate.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibReaders.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibWriters.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZip.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethRandomNumbers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethGZReaders.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethGZWriters.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethUnicode.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethDates.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethReals.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethStrings.Mod + +librarybinary: + @printf "\nMaking lib$(ONAME)\n" + +# Remove objects that should not be part of the library + rm -f $(BUILDDIR)/Compiler.o + +# Note: remining compiler files are retained in the library allowing the building +# of utilities like BrowserCmd.Mod (aka showdef). + +# Make static library + ar rcs "$(BUILDDIR)/lib$(ONAME).a" $(BUILDDIR)/*.o + +# Make shared library + @cd $(BUILDDIR) && $(COMPILE) -shared -o lib$(ONAME).so *.o + + + + +library: v4 ooc2 ooc ulm pow32 misc s3 librarybinary + + + + +sourcechanges: + @cd $(BUILDDIR) && sh $(ROOTDIR)/src/tools/make/sourcechanges.sh $(ROOTDIR)/bootstrap/$(PLATFORM)-$(ADRSIZE)$(ALIGNMENT) + + + + +RUNTEST = COMPILER=$(COMPILER) OBECOMP="$(OBECOMP) -O$(MODEL)" FLAVOUR=$(FLAVOUR) BRANCH=$(BRANCH) sh ./test.sh "$(INSTALLDIR)" + +confidence: + @printf "\n\n--- Confidence tests ---\n\n" + cd src/test/confidence/hello; $(RUNTEST) + cd src/test/confidence/intsyntax; $(RUNTEST) + cd src/test/confidence/language; $(RUNTEST) + cd src/test/confidence/texts; $(RUNTEST) + cd src/test/confidence/library; $(RUNTEST) + cd src/test/confidence/lola; $(RUNTEST) + cd src/test/confidence/arrayassignment; $(RUNTEST) + if [ "$(PLATFORM)" != "windows" ] ; then cd src/test/confidence/signal; $(RUNTEST); fi + @printf "\n\n--- Confidence tests passed ---\n\n" diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make deleted file mode 100644 index b863944a..00000000 --- a/src/tools/make/vishap.make +++ /dev/null @@ -1,379 +0,0 @@ -# DO NOT RUN THIS MAKEFILE DIRECTLY. -# -# Always use the makefile in the root of the enlistment. This makefile -# depends on up to date configuration files generated by the root makefile. - - - - -# Be independent of any CFLAGS settings in the calling environment -CFLAGS = - -# Gnu make has the make initial directory in CURDIR, BSD make has it in .CURDIR. -ROOTDIR = $(CURDIR)$(.CURDIR) - -# Configuration.Make is created by src/tools/make/configure.c, which is run on -# *every* build by the makefile in the enlistment root. -include ./Configuration.Make - -FLAVOUR = $(OS).$(DATAMODEL).$(COMPILER) -BUILDDIR = build/$(FLAVOUR) -VISHAP = $(ONAME)$(BINEXT) - -MODEL=-O2 # Override model - build everything as S8,I16,L32. - - - -# Default make target - explain usage -usage: - @echo "" - @echo Do not run this makefile directly, always run the makefile in - @echo the root of the enlistment. - - - - -clean: - @printf "\n\n--- Cleaning branch $(BRANCH) $(OS) $(COMPILER) $(DATAMODEL) ---\n\n" - rm -rf $(BUILDDIR) - rm -f $(VISHAP) - - - - -# Assemble: Generate the Vishap Oberon compiler binary by compiling the C sources in the build directory - -assemble: - @printf "\nmake assemble - compiling Oberon compiler c source:\n" - @printf " VERSION: %s\n" "$(VERSION)" - @printf " BRANCH: %s\n" "$(BRANCH)" - @printf " Target characteristics:\n" - @printf " PLATFORM: %s\n" "$(PLATFORM)" - @printf " OS: %s\n" "$(OS)" - @printf " BUILDDIR: %s\n" "$(BUILDDIR)" - @printf " INSTALLDIR: %s\n" "$(INSTALLDIR)" - @printf " Oberon characteristics:\n" - @printf " INTSIZE: %s\n" "$(INTSIZE)" - @printf " ADRSIZE: %s\n" "$(ADRSIZE)" - @printf " ALIGNMENT: %s\n" "$(ALIGNMENT)" - @printf " C compiler:\n" - @printf " COMPILER: %s\n" "$(COMPILER)" - @printf " COMPILE: %s\n" "$(COMPILE)" - @printf " DATAMODEL: %s\n" "$(DATAMODEL)" - - cd $(BUILDDIR) && $(COMPILE) -c SYSTEM.c Configuration.c Platform.c Heap.c - cd $(BUILDDIR) && $(COMPILE) -c Console.c Strings.c Modules.c Files.c - cd $(BUILDDIR) && $(COMPILE) -c Reals.c Texts.c vt100.c errors.c - cd $(BUILDDIR) && $(COMPILE) -c OPM.c extTools.c OPS.c OPT.c - cd $(BUILDDIR) && $(COMPILE) -c OPC.c OPV.c OPB.c OPP.c - - cd $(BUILDDIR) && $(COMPILE) $(STATICLINK) Vishap.c -o $(ROOTDIR)/$(VISHAP) \ - SYSTEM.o Configuration.o Platform.o Heap.o Console.o Strings.o Modules.o Files.o \ - Reals.o Texts.o vt100.o errors.o OPM.o extTools.o OPS.o OPT.o \ - OPC.o OPV.o OPB.o OPP.o - - cp src/system/*.[ch] $(BUILDDIR) - @printf "$(VISHAP) created.\n" - - - - -compilerfromsavedsource: - @echo Populating clean build directory from bootstrap C sources. - @mkdir -p $(BUILDDIR) - @cp bootstrap/$(PLATFORM)-$(ADRSIZE)$(ALIGNMENT)/* $(BUILDDIR) - @cp bootstrap/*.[ch] $(BUILDDIR) - @make -f src/tools/make/vishap.make -s assemble - @cp bootstrap/*.[ch] $(BUILDDIR) - - - - -translate: -# Make sure we have an oberon compiler binary: if we built one earlier we'll use it, -# otherwise use one of the pre-prepared sets of C sources in the bootstrap directory. - - if [ ! -e $(VISHAP) ]; then make -f src/tools/make/vishap.make -s compilerfromsavedsource; fi - - @printf "\nmake translate - translating compiler source from Oberon to C:\n" - @printf " PLATFORM: %s\n" $(PLATFORM) - @printf " INTSIZE: %s\n" $(INTSIZE) - @printf " MODEL: %s\n" $(MODEL) - @printf " ADRSIZE: %s\n" $(ADRSIZE) - @printf " ALIGNMENT: %s\n" $(ALIGNMENT) - @mkdir -p $(BUILDDIR) - @rm -f $(BUILDDIR)/*.sym - - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../Configuration.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/system/Platform$(PLATFORM).Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfFapx -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/system/Heap.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/system/Console.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/library/v4/Strings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/library/v4/Modules.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/system/Files.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/library/v4/Reals.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/library/v4/Texts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/library/misc/vt100.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/errors.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPM.cmdln.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/extTools.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPS.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPT.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPC.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPV.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPB.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPP.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ssfm -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/Vishap.Mod - - @printf "$(BUILDDIR) filled with compiler C source.\n" - - - - -browsercmd: - @printf "\nMaking symbol browser\n" - @cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -fSm $(MODEL) ../../src/tools/browser/BrowserCmd.Mod - @cd $(BUILDDIR); $(COMPILE) BrowserCmd.c -o showdef \ - Platform.o Texts.o OPT.o Heap.o Console.o SYSTEM.o OPM.o OPS.o OPV.o \ - Files.o Reals.o Modules.o vt100.o errors.o Configuration.o Strings.o \ - OPC.o - - - - -FORCE: - -# installable: Check for access to the installation directory - -installable: - @rm -rf "S(INSTALLDIR)/test-access-qqq" - @if ! mkdir -p "$(INSTALLDIR)/test-access-qqq";then echo "\\n\\n Cannot write to install directory.\\n Please use sudo or run as root/administrator.\\n\\n"; exit 1;fi - @rm -rf "S(INSTALLDIR)/test-access-qqq" - - - - -# install: Use only after a successful full build. Installs the compiler -# and libraries in /opt/$(ONAME). -# May require root access. -install: - @printf "\nInstalling into \"$(INSTALLDIR)\"\n" - @rm -rf "$(INSTALLDIR)" - @mkdir -p "$(INSTALLDIR)/bin" "$(INSTALLDIR)/include" "$(INSTALLDIR)/sym" "$(INSTALLDIR)/lib" - @cp $(BUILDDIR)/*.h "$(INSTALLDIR)/include/" - @cp $(BUILDDIR)/*.sym "$(INSTALLDIR)/sym/" - @cp $(VISHAP) "$(INSTALLDIR)/bin/$(VISHAP)" - @-cp $(BUILDDIR)/showdef$(BINEXT) "$(INSTALLDIR)/bin" - @cp $(BUILDDIR)/lib$(ONAME).* "$(INSTALLDIR)/lib/" - @if which ldconfig >/dev/null 2>&1; then $(LDCONFIG); fi - - -# showpath: Describe how to set the PATH variable -showpath: - @printf "\nNow add $(INSTALLDIR)/bin to your path, for example with the command:\n" - @printf "export PATH=\"$(INSTALLDIR)/bin:\$$PATH\"\n" - @printf "\n" - - - - -uninstall: - @printf "\nUninstalling from \"$(INSTALLDIR)\"\n" - rm -rf "$(INSTALLDIR)" - rm -f /etc/ld.so.conf/lib$(ONAME) - if which ldconfig >/dev/null 2>&1; then ldconfig; fi - - - - -v4: - @printf "\nMaking v4 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/v4/Args.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/v4/Printer.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/v4/Sets.Mod - -ooc2: - @printf "\nMaking ooc2 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2Strings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2Ascii.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2CharClass.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2ConvTypes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2IntConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2IntStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2Real0.Mod - - -TODO: Comment disabled lines contain use of VAL that reads beyond source variable - -ooc: - @printf "\nMaking ooc library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLowReal.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLowLReal.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocRealMath.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocOakMath.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLRealMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLongInts.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocComplexMath.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLComplexMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocAscii.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocCharClass.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocStrings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocConvTypes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLRealConv.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLRealStr.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocRealConv.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocRealStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocIntConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocIntStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocMsg.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocSysClock.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocTime.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocChannel.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocStrings2.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocRts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocFilenames.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocTextRider.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocBinaryRider.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocJulianDay.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocFilenames.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocwrapperlibc.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocC$(DATAMODEL).Mod - -oocX11: - @printf "\nMaking oocX11 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/oocX11/oocX11.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/oocX11/oocXutil.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/oocX11/oocXYplane.Mod - -ulm: - @printf "\nMaking ulm library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmObjects.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmPriorities.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmServices.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSys.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSYSTEM.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmEvents.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmProcess.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmResources.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmForwarders.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmRelatedEvents.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTypes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmStreams.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmStrings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSysTypes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTexts.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSysConversions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmErrors.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSysErrors.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSysStat.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmASCII.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSets.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmIO.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmAssertions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmIndirectDisciplines.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmStreamDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmIEEE.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmMC68881.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmReals.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmPrint.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmWrite.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmConstStrings.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmPlotters.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSysIO.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmLoader.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmNetIO.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmPersistentObjects.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmPersistentDisciplines.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmOperations.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmScales.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTimes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmClocks.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTimers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmConditions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmStreamConditions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTimeConditions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmCiphers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmCipherOps.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmBlockCiphers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmAsymmetricCiphers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmConclusions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmRandomGenerators.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTCrypt.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmIntOperations.Mod - -pow32: - @printf "\nMaking pow library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/pow/powStrings.Mod - -misc: - @printf "\nMaking misc library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/system/Oberon.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/misc/crt.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/misc/Listen.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/misc/MersenneTwister.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/misc/MultiArrays.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/misc/MultiArrayRiders.Mod - -s3: - @printf "\nMaking s3 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethBTrees.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethMD5.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethSets.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlib.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlibBuffers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlibInflate.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlibDeflate.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlibReaders.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlibWriters.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZip.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethRandomNumbers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethGZReaders.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethGZWriters.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethUnicode.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethDates.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethReals.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethStrings.Mod - -librarybinary: - @printf "\nMaking lib$(ONAME)\n" - -# Remove objects that should not be part of the library - rm -f $(BUILDDIR)/vishap.o - -# Note: remining compiler files are retained in the library allowing the building -# of utilities like BrowserCmd.Mod (aka showdef). - -# Make static library - ar rcs "$(BUILDDIR)/lib$(ONAME).a" $(BUILDDIR)/*.o - -# Make shared library - @cd $(BUILDDIR) && $(COMPILE) -shared -o lib$(ONAME).so *.o - - - - -library: v4 ooc2 ooc ulm pow32 misc s3 librarybinary - - - - -sourcechanges: - @cd $(BUILDDIR) && sh $(ROOTDIR)/src/tools/make/sourcechanges.sh $(ROOTDIR)/bootstrap/$(PLATFORM)-$(ADRSIZE)$(ALIGNMENT) - - - - -RUNTEST = COMPILER=$(COMPILER) OBECOMP=$(VISHAP) FLAVOUR=$(FLAVOUR) BRANCH=$(BRANCH) sh ./test.sh "$(INSTALLDIR)" - -confidence: - @printf "\n\n--- Confidence tests ---\n\n" - cd src/test/confidence/hello; $(RUNTEST) - cd src/test/confidence/intsyntax; $(RUNTEST) - cd src/test/confidence/language; $(RUNTEST) - cd src/test/confidence/texts; $(RUNTEST) - cd src/test/confidence/library; $(RUNTEST) - cd src/test/confidence/lola; $(RUNTEST) - cd src/test/confidence/arrayassignment; $(RUNTEST) - if [ "$(PLATFORM)" != "windows" ] ; then cd src/test/confidence/signal; $(RUNTEST); fi - @printf "\n\n--- Confidence tests passed ---\n\n"