mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-05 23:22:25 +00:00
Reorganise system and runtime library modules for both O2 and OC builds.
This commit is contained in:
parent
c924a33a05
commit
c2567a2600
223 changed files with 1521 additions and 4039 deletions
|
|
@ -229,6 +229,7 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;}
|
|||
#define __ODD(x) ((x)&1)
|
||||
|
||||
#define __IN(x, s, size) (((unsigned int)(x))<size && ((((uint##size)(s))>>(x))&1))
|
||||
// todo tested versions of SETOF and SETRNG: check that x, l and h fit size
|
||||
#define __SETOF(x, size) ((uint##size)1<<(x))
|
||||
#define __SETRNG(l, h, size) ((~(uint##size)0<<(l))&~(uint##size)0>>(size-1-(h)))
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
@ -19,6 +19,6 @@ export void *Configuration__init(void)
|
|||
__DEFMOD;
|
||||
__REGMOD("Configuration", 0);
|
||||
/* BEGIN */
|
||||
__MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
|
||||
__MOVE("1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
|
||||
__ENDMOD;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Configuration__h
|
||||
#define Configuration__h
|
||||
|
|
|
|||
|
|
@ -1,157 +0,0 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
||||
#include "SYSTEM.h"
|
||||
#include "Platform.h"
|
||||
|
||||
|
||||
static CHAR Console_line[128];
|
||||
static int16 Console_pos;
|
||||
|
||||
|
||||
export void Console_Bool (BOOLEAN b);
|
||||
export void Console_Char (CHAR ch);
|
||||
export void Console_Flush (void);
|
||||
export void Console_Hex (int32 i);
|
||||
export void Console_Int (int64 i, int64 n);
|
||||
export void Console_Ln (void);
|
||||
export void Console_Read (CHAR *ch);
|
||||
export void Console_ReadLine (CHAR *line, LONGINT line__len);
|
||||
export void Console_String (CHAR *s, LONGINT s__len);
|
||||
|
||||
|
||||
void Console_Flush (void)
|
||||
{
|
||||
int16 error;
|
||||
error = Platform_Write(1, (address)Console_line, Console_pos);
|
||||
Console_pos = 0;
|
||||
}
|
||||
|
||||
void Console_Char (CHAR ch)
|
||||
{
|
||||
if (Console_pos == 128) {
|
||||
Console_Flush();
|
||||
}
|
||||
Console_line[__X(Console_pos, 128)] = ch;
|
||||
Console_pos += 1;
|
||||
if (ch == 0x0a) {
|
||||
Console_Flush();
|
||||
}
|
||||
}
|
||||
|
||||
void Console_String (CHAR *s, LONGINT s__len)
|
||||
{
|
||||
int16 i;
|
||||
__DUP(s, s__len, CHAR);
|
||||
i = 0;
|
||||
while (s[__X(i, s__len)] != 0x00) {
|
||||
Console_Char(s[__X(i, s__len)]);
|
||||
i += 1;
|
||||
}
|
||||
__DEL(s);
|
||||
}
|
||||
|
||||
void Console_Int (int64 i, int64 n)
|
||||
{
|
||||
CHAR s[32];
|
||||
int32 i1, k;
|
||||
if (i == (int64)__LSHL(1, 31, 32)) {
|
||||
__MOVE("8463847412", s, 11);
|
||||
k = 10;
|
||||
} else {
|
||||
i1 = __ABS(__VAL(int32, i));
|
||||
s[0] = (CHAR)((int)__MOD(i1, 10) + 48);
|
||||
i1 = __DIV(i1, 10);
|
||||
k = 1;
|
||||
while (i1 > 0) {
|
||||
s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48);
|
||||
i1 = __DIV(i1, 10);
|
||||
k += 1;
|
||||
}
|
||||
}
|
||||
if (i < 0) {
|
||||
s[__X(k, 32)] = '-';
|
||||
k += 1;
|
||||
}
|
||||
while (n > (int64)k) {
|
||||
Console_Char(' ');
|
||||
n -= 1;
|
||||
}
|
||||
while (k > 0) {
|
||||
k -= 1;
|
||||
Console_Char(s[__X(k, 32)]);
|
||||
}
|
||||
}
|
||||
|
||||
void Console_Ln (void)
|
||||
{
|
||||
Console_Char(0x0a);
|
||||
}
|
||||
|
||||
void Console_Bool (BOOLEAN b)
|
||||
{
|
||||
if (b) {
|
||||
Console_String((CHAR*)"TRUE", 5);
|
||||
} else {
|
||||
Console_String((CHAR*)"FALSE", 6);
|
||||
}
|
||||
}
|
||||
|
||||
void Console_Hex (int32 i)
|
||||
{
|
||||
int16 k;
|
||||
int64 n;
|
||||
k = -28;
|
||||
while (k <= 0) {
|
||||
n = __MASK(__ASH(i, k), -16);
|
||||
if (n <= 9) {
|
||||
Console_Char((CHAR)(48 + n));
|
||||
} else {
|
||||
Console_Char((CHAR)(55 + n));
|
||||
}
|
||||
k += 4;
|
||||
}
|
||||
}
|
||||
|
||||
void Console_Read (CHAR *ch)
|
||||
{
|
||||
int32 n;
|
||||
int16 error;
|
||||
Console_Flush();
|
||||
error = Platform_ReadBuf(0, (void*)&*ch, 1, &n);
|
||||
if (n != 1) {
|
||||
*ch = 0x00;
|
||||
}
|
||||
}
|
||||
|
||||
void Console_ReadLine (CHAR *line, LONGINT line__len)
|
||||
{
|
||||
int32 i;
|
||||
CHAR ch;
|
||||
Console_Flush();
|
||||
i = 0;
|
||||
Console_Read(&ch);
|
||||
while ((((i < line__len - 1 && ch != 0x0a)) && ch != 0x00)) {
|
||||
line[__X(i, line__len)] = ch;
|
||||
i += 1;
|
||||
Console_Read(&ch);
|
||||
}
|
||||
line[__X(i, line__len)] = 0x00;
|
||||
}
|
||||
|
||||
|
||||
export void *Console__init(void)
|
||||
{
|
||||
__DEFMOD;
|
||||
__MODULE_IMPORT(Platform);
|
||||
__REGMOD("Console", 0);
|
||||
__REGCMD("Flush", Console_Flush);
|
||||
__REGCMD("Ln", Console_Ln);
|
||||
/* BEGIN */
|
||||
Console_pos = 0;
|
||||
__ENDMOD;
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Console__h
|
||||
#define Console__h
|
||||
|
||||
#include "SYSTEM.h"
|
||||
|
||||
|
||||
|
||||
|
||||
import void Console_Bool (BOOLEAN b);
|
||||
import void Console_Char (CHAR ch);
|
||||
import void Console_Flush (void);
|
||||
import void Console_Hex (int32 i);
|
||||
import void Console_Int (int64 i, int64 n);
|
||||
import void Console_Ln (void);
|
||||
import void Console_Read (CHAR *ch);
|
||||
import void Console_ReadLine (CHAR *line, LONGINT line__len);
|
||||
import void Console_String (CHAR *s, LONGINT s__len);
|
||||
import void *Console__init(void);
|
||||
|
||||
|
||||
#endif // Console
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include "SYSTEM.h"
|
||||
#include "Heap.h"
|
||||
#include "Console.h"
|
||||
#include "Out.h"
|
||||
#include "Platform.h"
|
||||
#include "Strings.h"
|
||||
|
||||
|
|
@ -114,26 +114,26 @@ export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT
|
|||
static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode)
|
||||
{
|
||||
__DUP(s, s__len, CHAR);
|
||||
Console_Ln();
|
||||
Console_String((CHAR*)"-- ", 4);
|
||||
Console_String(s, s__len);
|
||||
Console_String((CHAR*)": ", 3);
|
||||
Out_Ln();
|
||||
Out_String((CHAR*)"-- ", 4);
|
||||
Out_String(s, s__len);
|
||||
Out_String((CHAR*)": ", 3);
|
||||
if (f != NIL) {
|
||||
if (f->registerName[0] != 0x00) {
|
||||
Console_String(f->registerName, 101);
|
||||
Out_String(f->registerName, 101);
|
||||
} else {
|
||||
Console_String(f->workName, 101);
|
||||
Out_String(f->workName, 101);
|
||||
}
|
||||
if (f->fd != 0) {
|
||||
Console_String((CHAR*)"f.fd = ", 8);
|
||||
Console_Int(f->fd, 1);
|
||||
Out_String((CHAR*)"f.fd = ", 8);
|
||||
Out_Int(f->fd, 1);
|
||||
}
|
||||
}
|
||||
if (errcode != 0) {
|
||||
Console_String((CHAR*)" errcode = ", 12);
|
||||
Console_Int(errcode, 1);
|
||||
Out_String((CHAR*)" errcode = ", 12);
|
||||
Out_Int(errcode, 1);
|
||||
}
|
||||
Console_Ln();
|
||||
Out_Ln();
|
||||
__HALT(99);
|
||||
__DEL(s);
|
||||
}
|
||||
|
|
@ -460,11 +460,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
|
|||
done = error == 0;
|
||||
}
|
||||
if ((!done && !Platform_Absent(error))) {
|
||||
Console_String((CHAR*)"Warning: Files.Old ", 20);
|
||||
Console_String(name, name__len);
|
||||
Console_String((CHAR*)" error = ", 10);
|
||||
Console_Int(error, 0);
|
||||
Console_Ln();
|
||||
Out_String((CHAR*)"Warning: Files.Old ", 20);
|
||||
Out_String(name, name__len);
|
||||
Out_String((CHAR*)" error = ", 10);
|
||||
Out_Int(error, 0);
|
||||
Out_Ln();
|
||||
}
|
||||
if (done) {
|
||||
error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ);
|
||||
|
|
@ -1043,7 +1043,7 @@ export void *Files__init(void)
|
|||
{
|
||||
__DEFMOD;
|
||||
__MODULE_IMPORT(Heap);
|
||||
__MODULE_IMPORT(Console);
|
||||
__MODULE_IMPORT(Out);
|
||||
__MODULE_IMPORT(Platform);
|
||||
__MODULE_IMPORT(Strings);
|
||||
__REGMOD("Files", EnumPtrs);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
|
||||
#ifndef Files__h
|
||||
#define Files__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
|
||||
#ifndef Heap__h
|
||||
#define Heap__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
@ -6,7 +6,6 @@
|
|||
#define SET uint32
|
||||
|
||||
#include "SYSTEM.h"
|
||||
#include "Console.h"
|
||||
#include "Heap.h"
|
||||
|
||||
typedef
|
||||
|
|
@ -167,7 +166,6 @@ __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 32), {0, -8}};
|
|||
export void *Modules__init(void)
|
||||
{
|
||||
__DEFMOD;
|
||||
__MODULE_IMPORT(Console);
|
||||
__MODULE_IMPORT(Heap);
|
||||
__REGMOD("Modules", 0);
|
||||
__INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Modules__h
|
||||
#define Modules__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
@ -1522,13 +1522,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y)
|
|||
} else if (((*x)->typ->form == 4 && y->typ->form == 4)) {
|
||||
if ((*x)->class == 7) {
|
||||
k = (*x)->conval->intval;
|
||||
if (0 > k || k > 31) {
|
||||
if (0 > k || k > 63) {
|
||||
OPB_err(202);
|
||||
}
|
||||
}
|
||||
if (y->class == 7) {
|
||||
l = y->conval->intval;
|
||||
if (0 > l || l > 31) {
|
||||
if (0 > l || l > 63) {
|
||||
OPB_err(202);
|
||||
}
|
||||
}
|
||||
|
|
@ -1559,17 +1559,18 @@ void OPB_SetElem (OPT_Node *x)
|
|||
OPB_err(93);
|
||||
} else if ((*x)->class == 7) {
|
||||
k = (*x)->conval->intval;
|
||||
if ((0 <= k && k <= 31)) {
|
||||
(*x)->conval->setval = __SETOF(k,32);
|
||||
OPB_SetSetType(*x);
|
||||
if ((0 <= k && k <= 63)) {
|
||||
(*x)->conval->setval = 0x0;
|
||||
(*x)->conval->setval |= __SETOF(k,64);
|
||||
} else {
|
||||
OPB_err(202);
|
||||
}
|
||||
OPB_SetSetType(*x);
|
||||
(*x)->obj = NIL;
|
||||
} else {
|
||||
OPB_Convert(&*x, OPT_settyp);
|
||||
(*x)->typ = OPT_settyp;
|
||||
}
|
||||
(*x)->typ = OPT_settyp;
|
||||
}
|
||||
|
||||
static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||
|
|
@ -1816,7 +1817,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno)
|
|||
x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size));
|
||||
break;
|
||||
case 7:
|
||||
x = OPB_NewIntConst(OPM_MaxSet);
|
||||
x = OPB_NewIntConst(__ASHL(x->typ->size, 3) - 1);
|
||||
x->typ = OPT_inttyp;
|
||||
break;
|
||||
case 5:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPB__h
|
||||
#define OPB__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
@ -1860,7 +1860,7 @@ void OPC_Constant (OPT_Const con, int16 form)
|
|||
{
|
||||
int16 i;
|
||||
uint64 s;
|
||||
int32 hex;
|
||||
int64 hex;
|
||||
BOOLEAN skipLeading;
|
||||
switch (form) {
|
||||
case 1:
|
||||
|
|
@ -1885,7 +1885,7 @@ void OPC_Constant (OPT_Const con, int16 form)
|
|||
OPM_WriteString((CHAR*)"0x", 3);
|
||||
skipLeading = 1;
|
||||
s = con->setval;
|
||||
i = 32;
|
||||
i = 64;
|
||||
do {
|
||||
hex = 0;
|
||||
do {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPC__h
|
||||
#define OPC__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
#include "SYSTEM.h"
|
||||
#include "Configuration.h"
|
||||
#include "Console.h"
|
||||
#include "Files.h"
|
||||
#include "Out.h"
|
||||
#include "Platform.h"
|
||||
#include "Strings.h"
|
||||
#include "Texts.h"
|
||||
|
|
@ -27,7 +27,7 @@ export int16 OPM_AddressSize;
|
|||
static int16 OPM_GlobalAlignment;
|
||||
export int16 OPM_Alignment;
|
||||
export uint32 OPM_GlobalOptions, OPM_Options;
|
||||
export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet;
|
||||
export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize;
|
||||
export int64 OPM_MaxIndex;
|
||||
export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
|
||||
export BOOLEAN OPM_noerr;
|
||||
|
|
@ -102,24 +102,24 @@ export void OPM_err (int16 n);
|
|||
|
||||
void OPM_LogW (CHAR ch)
|
||||
{
|
||||
Console_Char(ch);
|
||||
Out_Char(ch);
|
||||
}
|
||||
|
||||
void OPM_LogWStr (CHAR *s, LONGINT s__len)
|
||||
{
|
||||
__DUP(s, s__len, CHAR);
|
||||
Console_String(s, s__len);
|
||||
Out_String(s, s__len);
|
||||
__DEL(s);
|
||||
}
|
||||
|
||||
void OPM_LogWNum (int64 i, int64 len)
|
||||
{
|
||||
Console_Int(i, len);
|
||||
Out_Int(i, len);
|
||||
}
|
||||
|
||||
void OPM_LogWLn (void)
|
||||
{
|
||||
Console_Ln();
|
||||
Out_Ln();
|
||||
}
|
||||
|
||||
int64 OPM_SignedMaximum (int32 bytecount)
|
||||
|
|
@ -455,7 +455,6 @@ void OPM_InitOptions (void)
|
|||
OPM_SetSize = 4;
|
||||
break;
|
||||
}
|
||||
OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1;
|
||||
if (__IN(18, OPM_Options, 32)) {
|
||||
OPM_VerboseListSizes();
|
||||
}
|
||||
|
|
@ -1075,8 +1074,8 @@ export void *OPM__init(void)
|
|||
{
|
||||
__DEFMOD;
|
||||
__MODULE_IMPORT(Configuration);
|
||||
__MODULE_IMPORT(Console);
|
||||
__MODULE_IMPORT(Files);
|
||||
__MODULE_IMPORT(Out);
|
||||
__MODULE_IMPORT(Platform);
|
||||
__MODULE_IMPORT(Strings);
|
||||
__MODULE_IMPORT(Texts);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPM__h
|
||||
#define OPM__h
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
import CHAR OPM_Model[10];
|
||||
import int16 OPM_AddressSize, OPM_Alignment;
|
||||
import uint32 OPM_GlobalOptions, OPM_Options;
|
||||
import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet;
|
||||
import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize;
|
||||
import int64 OPM_MaxIndex;
|
||||
import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
|
||||
import BOOLEAN OPM_noerr;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPP__h
|
||||
#define OPP__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
|
||||
#ifndef OPS__h
|
||||
#define OPS__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPT__h
|
||||
#define OPT__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPV__h
|
||||
#define OPV__h
|
||||
|
|
|
|||
105
bootstrap/unix-44/Out.c
Normal file
105
bootstrap/unix-44/Out.c
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
||||
#include "SYSTEM.h"
|
||||
#include "Platform.h"
|
||||
|
||||
|
||||
|
||||
|
||||
export void Out_Char (CHAR ch);
|
||||
export void Out_Int (int64 x, int64 n);
|
||||
export void Out_Ln (void);
|
||||
export void Out_LongReal (LONGREAL x, int16 n);
|
||||
export void Out_Open (void);
|
||||
export void Out_Real (REAL x, int16 n);
|
||||
export void Out_String (CHAR *str, LONGINT str__len);
|
||||
|
||||
|
||||
void Out_Open (void)
|
||||
{
|
||||
}
|
||||
|
||||
void Out_Char (CHAR ch)
|
||||
{
|
||||
int16 error;
|
||||
error = Platform_Write(1, (address)&ch, 1);
|
||||
}
|
||||
|
||||
void Out_String (CHAR *str, LONGINT str__len)
|
||||
{
|
||||
int32 l;
|
||||
int16 error;
|
||||
__DUP(str, str__len, CHAR);
|
||||
l = 0;
|
||||
while ((l < str__len && str[l] != 0x00)) {
|
||||
l += 1;
|
||||
}
|
||||
error = Platform_Write(1, (address)str, l);
|
||||
__DEL(str);
|
||||
}
|
||||
|
||||
void Out_Int (int64 x, int64 n)
|
||||
{
|
||||
CHAR s[22];
|
||||
int16 i;
|
||||
BOOLEAN negative;
|
||||
negative = x < 0;
|
||||
if (x == (-9223372036854775807-1)) {
|
||||
__MOVE("8085774586302733229", s, 20);
|
||||
i = 19;
|
||||
} else {
|
||||
if (x < 0) {
|
||||
x = -x;
|
||||
}
|
||||
s[0] = (CHAR)(48 + __MOD(x, 10));
|
||||
x = __DIV(x, 10);
|
||||
i = 1;
|
||||
while (x != 0) {
|
||||
s[i] = (CHAR)(48 + __MOD(x, 10));
|
||||
x = __DIV(x, 10);
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
if (negative) {
|
||||
s[i] = '-';
|
||||
i += 1;
|
||||
}
|
||||
while (n > (int64)i) {
|
||||
Out_Char(' ');
|
||||
n -= 1;
|
||||
}
|
||||
while (i > 0) {
|
||||
i -= 1;
|
||||
Out_Char(s[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void Out_Real (REAL x, int16 n)
|
||||
{
|
||||
}
|
||||
|
||||
void Out_LongReal (LONGREAL x, int16 n)
|
||||
{
|
||||
}
|
||||
|
||||
void Out_Ln (void)
|
||||
{
|
||||
Out_String(Platform_NL, 3);
|
||||
}
|
||||
|
||||
|
||||
export void *Out__init(void)
|
||||
{
|
||||
__DEFMOD;
|
||||
__MODULE_IMPORT(Platform);
|
||||
__REGMOD("Out", 0);
|
||||
__REGCMD("Ln", Out_Ln);
|
||||
__REGCMD("Open", Out_Open);
|
||||
/* BEGIN */
|
||||
__ENDMOD;
|
||||
}
|
||||
21
bootstrap/unix-44/Out.h
Normal file
21
bootstrap/unix-44/Out.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
|
||||
#ifndef Out__h
|
||||
#define Out__h
|
||||
|
||||
#include "SYSTEM.h"
|
||||
|
||||
|
||||
|
||||
|
||||
import void Out_Char (CHAR ch);
|
||||
import void Out_Int (int64 x, int64 n);
|
||||
import void Out_Ln (void);
|
||||
import void Out_LongReal (LONGREAL x, int16 n);
|
||||
import void Out_Open (void);
|
||||
import void Out_Real (REAL x, int16 n);
|
||||
import void Out_String (CHAR *str, LONGINT str__len);
|
||||
import void *Out__init(void);
|
||||
|
||||
|
||||
#endif // Out
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Platform__h
|
||||
#define Platform__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Reals__h
|
||||
#define Reals__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Strings__h
|
||||
#define Strings__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
@ -1473,7 +1473,7 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T)
|
|||
Texts_Piece p = NIL;
|
||||
Texts_Elem e = NIL;
|
||||
int32 org, pos, hlen, plen;
|
||||
int8 ecnt, fno, fcnt, col, voff;
|
||||
int8 ecnt, fcnt, fno, col, voff;
|
||||
Files_File f = NIL;
|
||||
Texts_FileMsg msg;
|
||||
CHAR mods[64][32], procs[64][32];
|
||||
|
|
@ -1653,8 +1653,9 @@ void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T)
|
|||
Texts_Run u = NIL, un = NIL;
|
||||
Texts_Elem e = NIL;
|
||||
int32 org, pos, delta, hlen, rlen;
|
||||
int8 ecnt, fno, fcnt;
|
||||
int8 ecnt, fcnt;
|
||||
CHAR ch;
|
||||
int8 fno;
|
||||
Texts_FileMsg msg;
|
||||
Texts_IdentifyMsg iden;
|
||||
CHAR mods[64][32], procs[64][32];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Texts__h
|
||||
#define Texts__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef errors__h
|
||||
#define errors__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
#include "SYSTEM.h"
|
||||
#include "Configuration.h"
|
||||
#include "Console.h"
|
||||
#include "OPM.h"
|
||||
#include "Out.h"
|
||||
#include "Platform.h"
|
||||
#include "Strings.h"
|
||||
|
||||
|
|
@ -28,9 +28,9 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN
|
|||
__DUP(title, title__len, CHAR);
|
||||
__DUP(cmd, cmd__len, CHAR);
|
||||
if (__IN(18, OPM_Options, 32)) {
|
||||
Console_String(title, title__len);
|
||||
Console_String(cmd, cmd__len);
|
||||
Console_Ln();
|
||||
Out_String(title, title__len);
|
||||
Out_String(cmd, cmd__len);
|
||||
Out_Ln();
|
||||
}
|
||||
r = Platform_System(cmd, cmd__len);
|
||||
status = __MASK(r, -128);
|
||||
|
|
@ -39,18 +39,18 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN
|
|||
exitcode = exitcode - 256;
|
||||
}
|
||||
if (r != 0) {
|
||||
Console_String(title, title__len);
|
||||
Console_String(cmd, cmd__len);
|
||||
Console_Ln();
|
||||
Console_String((CHAR*)"-- failed: status ", 19);
|
||||
Console_Int(status, 1);
|
||||
Console_String((CHAR*)", exitcode ", 12);
|
||||
Console_Int(exitcode, 1);
|
||||
Console_String((CHAR*)".", 2);
|
||||
Console_Ln();
|
||||
Out_String(title, title__len);
|
||||
Out_String(cmd, cmd__len);
|
||||
Out_Ln();
|
||||
Out_String((CHAR*)"-- failed: status ", 19);
|
||||
Out_Int(status, 1);
|
||||
Out_String((CHAR*)", exitcode ", 12);
|
||||
Out_Int(exitcode, 1);
|
||||
Out_String((CHAR*)".", 2);
|
||||
Out_Ln();
|
||||
if ((status == 0 && exitcode == 127)) {
|
||||
Console_String((CHAR*)"Is the C compiler in the current command path\?", 47);
|
||||
Console_Ln();
|
||||
Out_String((CHAR*)"Is the C compiler in the current command path\?", 47);
|
||||
Out_Ln();
|
||||
}
|
||||
if (status != 0) {
|
||||
Platform_Halt(status);
|
||||
|
|
@ -112,8 +112,8 @@ export void *extTools__init(void)
|
|||
{
|
||||
__DEFMOD;
|
||||
__MODULE_IMPORT(Configuration);
|
||||
__MODULE_IMPORT(Console);
|
||||
__MODULE_IMPORT(OPM);
|
||||
__MODULE_IMPORT(Out);
|
||||
__MODULE_IMPORT(Platform);
|
||||
__MODULE_IMPORT(Strings);
|
||||
__REGMOD("extTools", 0);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef extTools__h
|
||||
#define extTools__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
#define SET uint32
|
||||
|
||||
#include "SYSTEM.h"
|
||||
#include "Console.h"
|
||||
#include "Out.h"
|
||||
#include "Strings.h"
|
||||
|
||||
|
||||
|
|
@ -90,7 +90,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len)
|
|||
__DUP(letter, letter__len, CHAR);
|
||||
__COPY(vt100_CSI, cmd, 9);
|
||||
Strings_Append(letter, letter__len, (void*)cmd, 9);
|
||||
Console_String(cmd, 9);
|
||||
Out_String(cmd, 9);
|
||||
__DEL(letter);
|
||||
}
|
||||
|
||||
|
|
@ -103,7 +103,7 @@ static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len)
|
|||
__COPY(vt100_CSI, cmd, 7);
|
||||
Strings_Append(nstr, 2, (void*)cmd, 7);
|
||||
Strings_Append(letter, letter__len, (void*)cmd, 7);
|
||||
Console_String(cmd, 7);
|
||||
Out_String(cmd, 7);
|
||||
__DEL(letter);
|
||||
}
|
||||
|
||||
|
|
@ -116,7 +116,7 @@ static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len)
|
|||
__COPY(vt100_CSI, cmd, 7);
|
||||
Strings_Append(letter, letter__len, (void*)cmd, 7);
|
||||
Strings_Append(nstr, 2, (void*)cmd, 7);
|
||||
Console_String(cmd, 7);
|
||||
Out_String(cmd, 7);
|
||||
__DEL(letter);
|
||||
}
|
||||
|
||||
|
|
@ -132,7 +132,7 @@ static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len)
|
|||
Strings_Append((CHAR*)";", 2, (void*)cmd, 12);
|
||||
Strings_Append(mstr, 5, (void*)cmd, 12);
|
||||
Strings_Append(letter, letter__len, (void*)cmd, 12);
|
||||
Console_String(cmd, 12);
|
||||
Out_String(cmd, 12);
|
||||
__DEL(letter);
|
||||
}
|
||||
|
||||
|
|
@ -242,7 +242,7 @@ void vt100_SetAttr (CHAR *attr, LONGINT attr__len)
|
|||
__DUP(attr, attr__len, CHAR);
|
||||
__COPY(vt100_CSI, tmpstr, 16);
|
||||
Strings_Append(attr, attr__len, (void*)tmpstr, 16);
|
||||
Console_String(tmpstr, 16);
|
||||
Out_String(tmpstr, 16);
|
||||
__DEL(attr);
|
||||
}
|
||||
|
||||
|
|
@ -250,7 +250,7 @@ void vt100_SetAttr (CHAR *attr, LONGINT attr__len)
|
|||
export void *vt100__init(void)
|
||||
{
|
||||
__DEFMOD;
|
||||
__MODULE_IMPORT(Console);
|
||||
__MODULE_IMPORT(Out);
|
||||
__MODULE_IMPORT(Strings);
|
||||
__REGMOD("vt100", 0);
|
||||
__REGCMD("DECTCEMh", vt100_DECTCEMh);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef vt100__h
|
||||
#define vt100__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
@ -19,6 +19,6 @@ export void *Configuration__init(void)
|
|||
__DEFMOD;
|
||||
__REGMOD("Configuration", 0);
|
||||
/* BEGIN */
|
||||
__MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
|
||||
__MOVE("1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
|
||||
__ENDMOD;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Configuration__h
|
||||
#define Configuration__h
|
||||
|
|
|
|||
|
|
@ -1,157 +0,0 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
||||
#include "SYSTEM.h"
|
||||
#include "Platform.h"
|
||||
|
||||
|
||||
static CHAR Console_line[128];
|
||||
static int16 Console_pos;
|
||||
|
||||
|
||||
export void Console_Bool (BOOLEAN b);
|
||||
export void Console_Char (CHAR ch);
|
||||
export void Console_Flush (void);
|
||||
export void Console_Hex (int32 i);
|
||||
export void Console_Int (int64 i, int64 n);
|
||||
export void Console_Ln (void);
|
||||
export void Console_Read (CHAR *ch);
|
||||
export void Console_ReadLine (CHAR *line, LONGINT line__len);
|
||||
export void Console_String (CHAR *s, LONGINT s__len);
|
||||
|
||||
|
||||
void Console_Flush (void)
|
||||
{
|
||||
int16 error;
|
||||
error = Platform_Write(1, (address)Console_line, Console_pos);
|
||||
Console_pos = 0;
|
||||
}
|
||||
|
||||
void Console_Char (CHAR ch)
|
||||
{
|
||||
if (Console_pos == 128) {
|
||||
Console_Flush();
|
||||
}
|
||||
Console_line[__X(Console_pos, 128)] = ch;
|
||||
Console_pos += 1;
|
||||
if (ch == 0x0a) {
|
||||
Console_Flush();
|
||||
}
|
||||
}
|
||||
|
||||
void Console_String (CHAR *s, LONGINT s__len)
|
||||
{
|
||||
int16 i;
|
||||
__DUP(s, s__len, CHAR);
|
||||
i = 0;
|
||||
while (s[__X(i, s__len)] != 0x00) {
|
||||
Console_Char(s[__X(i, s__len)]);
|
||||
i += 1;
|
||||
}
|
||||
__DEL(s);
|
||||
}
|
||||
|
||||
void Console_Int (int64 i, int64 n)
|
||||
{
|
||||
CHAR s[32];
|
||||
int32 i1, k;
|
||||
if (i == (int64)__LSHL(1, 31, 32)) {
|
||||
__MOVE("8463847412", s, 11);
|
||||
k = 10;
|
||||
} else {
|
||||
i1 = __ABS(__VAL(int32, i));
|
||||
s[0] = (CHAR)((int)__MOD(i1, 10) + 48);
|
||||
i1 = __DIV(i1, 10);
|
||||
k = 1;
|
||||
while (i1 > 0) {
|
||||
s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48);
|
||||
i1 = __DIV(i1, 10);
|
||||
k += 1;
|
||||
}
|
||||
}
|
||||
if (i < 0) {
|
||||
s[__X(k, 32)] = '-';
|
||||
k += 1;
|
||||
}
|
||||
while (n > (int64)k) {
|
||||
Console_Char(' ');
|
||||
n -= 1;
|
||||
}
|
||||
while (k > 0) {
|
||||
k -= 1;
|
||||
Console_Char(s[__X(k, 32)]);
|
||||
}
|
||||
}
|
||||
|
||||
void Console_Ln (void)
|
||||
{
|
||||
Console_Char(0x0a);
|
||||
}
|
||||
|
||||
void Console_Bool (BOOLEAN b)
|
||||
{
|
||||
if (b) {
|
||||
Console_String((CHAR*)"TRUE", 5);
|
||||
} else {
|
||||
Console_String((CHAR*)"FALSE", 6);
|
||||
}
|
||||
}
|
||||
|
||||
void Console_Hex (int32 i)
|
||||
{
|
||||
int16 k;
|
||||
int64 n;
|
||||
k = -28;
|
||||
while (k <= 0) {
|
||||
n = __MASK(__ASH(i, k), -16);
|
||||
if (n <= 9) {
|
||||
Console_Char((CHAR)(48 + n));
|
||||
} else {
|
||||
Console_Char((CHAR)(55 + n));
|
||||
}
|
||||
k += 4;
|
||||
}
|
||||
}
|
||||
|
||||
void Console_Read (CHAR *ch)
|
||||
{
|
||||
int32 n;
|
||||
int16 error;
|
||||
Console_Flush();
|
||||
error = Platform_ReadBuf(0, (void*)&*ch, 1, &n);
|
||||
if (n != 1) {
|
||||
*ch = 0x00;
|
||||
}
|
||||
}
|
||||
|
||||
void Console_ReadLine (CHAR *line, LONGINT line__len)
|
||||
{
|
||||
int32 i;
|
||||
CHAR ch;
|
||||
Console_Flush();
|
||||
i = 0;
|
||||
Console_Read(&ch);
|
||||
while ((((i < line__len - 1 && ch != 0x0a)) && ch != 0x00)) {
|
||||
line[__X(i, line__len)] = ch;
|
||||
i += 1;
|
||||
Console_Read(&ch);
|
||||
}
|
||||
line[__X(i, line__len)] = 0x00;
|
||||
}
|
||||
|
||||
|
||||
export void *Console__init(void)
|
||||
{
|
||||
__DEFMOD;
|
||||
__MODULE_IMPORT(Platform);
|
||||
__REGMOD("Console", 0);
|
||||
__REGCMD("Flush", Console_Flush);
|
||||
__REGCMD("Ln", Console_Ln);
|
||||
/* BEGIN */
|
||||
Console_pos = 0;
|
||||
__ENDMOD;
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Console__h
|
||||
#define Console__h
|
||||
|
||||
#include "SYSTEM.h"
|
||||
|
||||
|
||||
|
||||
|
||||
import void Console_Bool (BOOLEAN b);
|
||||
import void Console_Char (CHAR ch);
|
||||
import void Console_Flush (void);
|
||||
import void Console_Hex (int32 i);
|
||||
import void Console_Int (int64 i, int64 n);
|
||||
import void Console_Ln (void);
|
||||
import void Console_Read (CHAR *ch);
|
||||
import void Console_ReadLine (CHAR *line, LONGINT line__len);
|
||||
import void Console_String (CHAR *s, LONGINT s__len);
|
||||
import void *Console__init(void);
|
||||
|
||||
|
||||
#endif // Console
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include "SYSTEM.h"
|
||||
#include "Heap.h"
|
||||
#include "Console.h"
|
||||
#include "Out.h"
|
||||
#include "Platform.h"
|
||||
#include "Strings.h"
|
||||
|
||||
|
|
@ -114,26 +114,26 @@ export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT
|
|||
static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode)
|
||||
{
|
||||
__DUP(s, s__len, CHAR);
|
||||
Console_Ln();
|
||||
Console_String((CHAR*)"-- ", 4);
|
||||
Console_String(s, s__len);
|
||||
Console_String((CHAR*)": ", 3);
|
||||
Out_Ln();
|
||||
Out_String((CHAR*)"-- ", 4);
|
||||
Out_String(s, s__len);
|
||||
Out_String((CHAR*)": ", 3);
|
||||
if (f != NIL) {
|
||||
if (f->registerName[0] != 0x00) {
|
||||
Console_String(f->registerName, 101);
|
||||
Out_String(f->registerName, 101);
|
||||
} else {
|
||||
Console_String(f->workName, 101);
|
||||
Out_String(f->workName, 101);
|
||||
}
|
||||
if (f->fd != 0) {
|
||||
Console_String((CHAR*)"f.fd = ", 8);
|
||||
Console_Int(f->fd, 1);
|
||||
Out_String((CHAR*)"f.fd = ", 8);
|
||||
Out_Int(f->fd, 1);
|
||||
}
|
||||
}
|
||||
if (errcode != 0) {
|
||||
Console_String((CHAR*)" errcode = ", 12);
|
||||
Console_Int(errcode, 1);
|
||||
Out_String((CHAR*)" errcode = ", 12);
|
||||
Out_Int(errcode, 1);
|
||||
}
|
||||
Console_Ln();
|
||||
Out_Ln();
|
||||
__HALT(99);
|
||||
__DEL(s);
|
||||
}
|
||||
|
|
@ -460,11 +460,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
|
|||
done = error == 0;
|
||||
}
|
||||
if ((!done && !Platform_Absent(error))) {
|
||||
Console_String((CHAR*)"Warning: Files.Old ", 20);
|
||||
Console_String(name, name__len);
|
||||
Console_String((CHAR*)" error = ", 10);
|
||||
Console_Int(error, 0);
|
||||
Console_Ln();
|
||||
Out_String((CHAR*)"Warning: Files.Old ", 20);
|
||||
Out_String(name, name__len);
|
||||
Out_String((CHAR*)" error = ", 10);
|
||||
Out_Int(error, 0);
|
||||
Out_Ln();
|
||||
}
|
||||
if (done) {
|
||||
error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ);
|
||||
|
|
@ -1043,7 +1043,7 @@ export void *Files__init(void)
|
|||
{
|
||||
__DEFMOD;
|
||||
__MODULE_IMPORT(Heap);
|
||||
__MODULE_IMPORT(Console);
|
||||
__MODULE_IMPORT(Out);
|
||||
__MODULE_IMPORT(Platform);
|
||||
__MODULE_IMPORT(Strings);
|
||||
__REGMOD("Files", EnumPtrs);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
|
||||
#ifndef Files__h
|
||||
#define Files__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
|
||||
#ifndef Heap__h
|
||||
#define Heap__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
@ -6,7 +6,6 @@
|
|||
#define SET uint32
|
||||
|
||||
#include "SYSTEM.h"
|
||||
#include "Console.h"
|
||||
#include "Heap.h"
|
||||
|
||||
typedef
|
||||
|
|
@ -167,7 +166,6 @@ __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 32), {0, -8}};
|
|||
export void *Modules__init(void)
|
||||
{
|
||||
__DEFMOD;
|
||||
__MODULE_IMPORT(Console);
|
||||
__MODULE_IMPORT(Heap);
|
||||
__REGMOD("Modules", 0);
|
||||
__INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Modules__h
|
||||
#define Modules__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
@ -1522,13 +1522,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y)
|
|||
} else if (((*x)->typ->form == 4 && y->typ->form == 4)) {
|
||||
if ((*x)->class == 7) {
|
||||
k = (*x)->conval->intval;
|
||||
if (0 > k || k > 31) {
|
||||
if (0 > k || k > 63) {
|
||||
OPB_err(202);
|
||||
}
|
||||
}
|
||||
if (y->class == 7) {
|
||||
l = y->conval->intval;
|
||||
if (0 > l || l > 31) {
|
||||
if (0 > l || l > 63) {
|
||||
OPB_err(202);
|
||||
}
|
||||
}
|
||||
|
|
@ -1559,17 +1559,18 @@ void OPB_SetElem (OPT_Node *x)
|
|||
OPB_err(93);
|
||||
} else if ((*x)->class == 7) {
|
||||
k = (*x)->conval->intval;
|
||||
if ((0 <= k && k <= 31)) {
|
||||
(*x)->conval->setval = __SETOF(k,32);
|
||||
OPB_SetSetType(*x);
|
||||
if ((0 <= k && k <= 63)) {
|
||||
(*x)->conval->setval = 0x0;
|
||||
(*x)->conval->setval |= __SETOF(k,64);
|
||||
} else {
|
||||
OPB_err(202);
|
||||
}
|
||||
OPB_SetSetType(*x);
|
||||
(*x)->obj = NIL;
|
||||
} else {
|
||||
OPB_Convert(&*x, OPT_settyp);
|
||||
(*x)->typ = OPT_settyp;
|
||||
}
|
||||
(*x)->typ = OPT_settyp;
|
||||
}
|
||||
|
||||
static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||
|
|
@ -1816,7 +1817,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno)
|
|||
x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size));
|
||||
break;
|
||||
case 7:
|
||||
x = OPB_NewIntConst(OPM_MaxSet);
|
||||
x = OPB_NewIntConst(__ASHL(x->typ->size, 3) - 1);
|
||||
x->typ = OPT_inttyp;
|
||||
break;
|
||||
case 5:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPB__h
|
||||
#define OPB__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
@ -1860,7 +1860,7 @@ void OPC_Constant (OPT_Const con, int16 form)
|
|||
{
|
||||
int16 i;
|
||||
uint64 s;
|
||||
int32 hex;
|
||||
int64 hex;
|
||||
BOOLEAN skipLeading;
|
||||
switch (form) {
|
||||
case 1:
|
||||
|
|
@ -1885,7 +1885,7 @@ void OPC_Constant (OPT_Const con, int16 form)
|
|||
OPM_WriteString((CHAR*)"0x", 3);
|
||||
skipLeading = 1;
|
||||
s = con->setval;
|
||||
i = 32;
|
||||
i = 64;
|
||||
do {
|
||||
hex = 0;
|
||||
do {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPC__h
|
||||
#define OPC__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
#include "SYSTEM.h"
|
||||
#include "Configuration.h"
|
||||
#include "Console.h"
|
||||
#include "Files.h"
|
||||
#include "Out.h"
|
||||
#include "Platform.h"
|
||||
#include "Strings.h"
|
||||
#include "Texts.h"
|
||||
|
|
@ -27,7 +27,7 @@ export int16 OPM_AddressSize;
|
|||
static int16 OPM_GlobalAlignment;
|
||||
export int16 OPM_Alignment;
|
||||
export uint32 OPM_GlobalOptions, OPM_Options;
|
||||
export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet;
|
||||
export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize;
|
||||
export int64 OPM_MaxIndex;
|
||||
export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
|
||||
export BOOLEAN OPM_noerr;
|
||||
|
|
@ -102,24 +102,24 @@ export void OPM_err (int16 n);
|
|||
|
||||
void OPM_LogW (CHAR ch)
|
||||
{
|
||||
Console_Char(ch);
|
||||
Out_Char(ch);
|
||||
}
|
||||
|
||||
void OPM_LogWStr (CHAR *s, LONGINT s__len)
|
||||
{
|
||||
__DUP(s, s__len, CHAR);
|
||||
Console_String(s, s__len);
|
||||
Out_String(s, s__len);
|
||||
__DEL(s);
|
||||
}
|
||||
|
||||
void OPM_LogWNum (int64 i, int64 len)
|
||||
{
|
||||
Console_Int(i, len);
|
||||
Out_Int(i, len);
|
||||
}
|
||||
|
||||
void OPM_LogWLn (void)
|
||||
{
|
||||
Console_Ln();
|
||||
Out_Ln();
|
||||
}
|
||||
|
||||
int64 OPM_SignedMaximum (int32 bytecount)
|
||||
|
|
@ -455,7 +455,6 @@ void OPM_InitOptions (void)
|
|||
OPM_SetSize = 4;
|
||||
break;
|
||||
}
|
||||
OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1;
|
||||
if (__IN(18, OPM_Options, 32)) {
|
||||
OPM_VerboseListSizes();
|
||||
}
|
||||
|
|
@ -1075,8 +1074,8 @@ export void *OPM__init(void)
|
|||
{
|
||||
__DEFMOD;
|
||||
__MODULE_IMPORT(Configuration);
|
||||
__MODULE_IMPORT(Console);
|
||||
__MODULE_IMPORT(Files);
|
||||
__MODULE_IMPORT(Out);
|
||||
__MODULE_IMPORT(Platform);
|
||||
__MODULE_IMPORT(Strings);
|
||||
__MODULE_IMPORT(Texts);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPM__h
|
||||
#define OPM__h
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
import CHAR OPM_Model[10];
|
||||
import int16 OPM_AddressSize, OPM_Alignment;
|
||||
import uint32 OPM_GlobalOptions, OPM_Options;
|
||||
import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet;
|
||||
import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize;
|
||||
import int64 OPM_MaxIndex;
|
||||
import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
|
||||
import BOOLEAN OPM_noerr;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPP__h
|
||||
#define OPP__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
|
||||
#ifndef OPS__h
|
||||
#define OPS__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPT__h
|
||||
#define OPT__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPV__h
|
||||
#define OPV__h
|
||||
|
|
|
|||
105
bootstrap/unix-48/Out.c
Normal file
105
bootstrap/unix-48/Out.c
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
||||
#include "SYSTEM.h"
|
||||
#include "Platform.h"
|
||||
|
||||
|
||||
|
||||
|
||||
export void Out_Char (CHAR ch);
|
||||
export void Out_Int (int64 x, int64 n);
|
||||
export void Out_Ln (void);
|
||||
export void Out_LongReal (LONGREAL x, int16 n);
|
||||
export void Out_Open (void);
|
||||
export void Out_Real (REAL x, int16 n);
|
||||
export void Out_String (CHAR *str, LONGINT str__len);
|
||||
|
||||
|
||||
void Out_Open (void)
|
||||
{
|
||||
}
|
||||
|
||||
void Out_Char (CHAR ch)
|
||||
{
|
||||
int16 error;
|
||||
error = Platform_Write(1, (address)&ch, 1);
|
||||
}
|
||||
|
||||
void Out_String (CHAR *str, LONGINT str__len)
|
||||
{
|
||||
int32 l;
|
||||
int16 error;
|
||||
__DUP(str, str__len, CHAR);
|
||||
l = 0;
|
||||
while ((l < str__len && str[l] != 0x00)) {
|
||||
l += 1;
|
||||
}
|
||||
error = Platform_Write(1, (address)str, l);
|
||||
__DEL(str);
|
||||
}
|
||||
|
||||
void Out_Int (int64 x, int64 n)
|
||||
{
|
||||
CHAR s[22];
|
||||
int16 i;
|
||||
BOOLEAN negative;
|
||||
negative = x < 0;
|
||||
if (x == (-9223372036854775807-1)) {
|
||||
__MOVE("8085774586302733229", s, 20);
|
||||
i = 19;
|
||||
} else {
|
||||
if (x < 0) {
|
||||
x = -x;
|
||||
}
|
||||
s[0] = (CHAR)(48 + __MOD(x, 10));
|
||||
x = __DIV(x, 10);
|
||||
i = 1;
|
||||
while (x != 0) {
|
||||
s[i] = (CHAR)(48 + __MOD(x, 10));
|
||||
x = __DIV(x, 10);
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
if (negative) {
|
||||
s[i] = '-';
|
||||
i += 1;
|
||||
}
|
||||
while (n > (int64)i) {
|
||||
Out_Char(' ');
|
||||
n -= 1;
|
||||
}
|
||||
while (i > 0) {
|
||||
i -= 1;
|
||||
Out_Char(s[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void Out_Real (REAL x, int16 n)
|
||||
{
|
||||
}
|
||||
|
||||
void Out_LongReal (LONGREAL x, int16 n)
|
||||
{
|
||||
}
|
||||
|
||||
void Out_Ln (void)
|
||||
{
|
||||
Out_String(Platform_NL, 3);
|
||||
}
|
||||
|
||||
|
||||
export void *Out__init(void)
|
||||
{
|
||||
__DEFMOD;
|
||||
__MODULE_IMPORT(Platform);
|
||||
__REGMOD("Out", 0);
|
||||
__REGCMD("Ln", Out_Ln);
|
||||
__REGCMD("Open", Out_Open);
|
||||
/* BEGIN */
|
||||
__ENDMOD;
|
||||
}
|
||||
21
bootstrap/unix-48/Out.h
Normal file
21
bootstrap/unix-48/Out.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
|
||||
#ifndef Out__h
|
||||
#define Out__h
|
||||
|
||||
#include "SYSTEM.h"
|
||||
|
||||
|
||||
|
||||
|
||||
import void Out_Char (CHAR ch);
|
||||
import void Out_Int (int64 x, int64 n);
|
||||
import void Out_Ln (void);
|
||||
import void Out_LongReal (LONGREAL x, int16 n);
|
||||
import void Out_Open (void);
|
||||
import void Out_Real (REAL x, int16 n);
|
||||
import void Out_String (CHAR *str, LONGINT str__len);
|
||||
import void *Out__init(void);
|
||||
|
||||
|
||||
#endif // Out
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Platform__h
|
||||
#define Platform__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Reals__h
|
||||
#define Reals__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Strings__h
|
||||
#define Strings__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
@ -1473,7 +1473,7 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T)
|
|||
Texts_Piece p = NIL;
|
||||
Texts_Elem e = NIL;
|
||||
int32 org, pos, hlen, plen;
|
||||
int8 ecnt, fno, fcnt, col, voff;
|
||||
int8 ecnt, fcnt, fno, col, voff;
|
||||
Files_File f = NIL;
|
||||
Texts_FileMsg msg;
|
||||
CHAR mods[64][32], procs[64][32];
|
||||
|
|
@ -1653,8 +1653,9 @@ void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T)
|
|||
Texts_Run u = NIL, un = NIL;
|
||||
Texts_Elem e = NIL;
|
||||
int32 org, pos, delta, hlen, rlen;
|
||||
int8 ecnt, fno, fcnt;
|
||||
int8 ecnt, fcnt;
|
||||
CHAR ch;
|
||||
int8 fno;
|
||||
Texts_FileMsg msg;
|
||||
Texts_IdentifyMsg iden;
|
||||
CHAR mods[64][32], procs[64][32];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Texts__h
|
||||
#define Texts__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef errors__h
|
||||
#define errors__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
#include "SYSTEM.h"
|
||||
#include "Configuration.h"
|
||||
#include "Console.h"
|
||||
#include "OPM.h"
|
||||
#include "Out.h"
|
||||
#include "Platform.h"
|
||||
#include "Strings.h"
|
||||
|
||||
|
|
@ -28,9 +28,9 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN
|
|||
__DUP(title, title__len, CHAR);
|
||||
__DUP(cmd, cmd__len, CHAR);
|
||||
if (__IN(18, OPM_Options, 32)) {
|
||||
Console_String(title, title__len);
|
||||
Console_String(cmd, cmd__len);
|
||||
Console_Ln();
|
||||
Out_String(title, title__len);
|
||||
Out_String(cmd, cmd__len);
|
||||
Out_Ln();
|
||||
}
|
||||
r = Platform_System(cmd, cmd__len);
|
||||
status = __MASK(r, -128);
|
||||
|
|
@ -39,18 +39,18 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN
|
|||
exitcode = exitcode - 256;
|
||||
}
|
||||
if (r != 0) {
|
||||
Console_String(title, title__len);
|
||||
Console_String(cmd, cmd__len);
|
||||
Console_Ln();
|
||||
Console_String((CHAR*)"-- failed: status ", 19);
|
||||
Console_Int(status, 1);
|
||||
Console_String((CHAR*)", exitcode ", 12);
|
||||
Console_Int(exitcode, 1);
|
||||
Console_String((CHAR*)".", 2);
|
||||
Console_Ln();
|
||||
Out_String(title, title__len);
|
||||
Out_String(cmd, cmd__len);
|
||||
Out_Ln();
|
||||
Out_String((CHAR*)"-- failed: status ", 19);
|
||||
Out_Int(status, 1);
|
||||
Out_String((CHAR*)", exitcode ", 12);
|
||||
Out_Int(exitcode, 1);
|
||||
Out_String((CHAR*)".", 2);
|
||||
Out_Ln();
|
||||
if ((status == 0 && exitcode == 127)) {
|
||||
Console_String((CHAR*)"Is the C compiler in the current command path\?", 47);
|
||||
Console_Ln();
|
||||
Out_String((CHAR*)"Is the C compiler in the current command path\?", 47);
|
||||
Out_Ln();
|
||||
}
|
||||
if (status != 0) {
|
||||
Platform_Halt(status);
|
||||
|
|
@ -112,8 +112,8 @@ export void *extTools__init(void)
|
|||
{
|
||||
__DEFMOD;
|
||||
__MODULE_IMPORT(Configuration);
|
||||
__MODULE_IMPORT(Console);
|
||||
__MODULE_IMPORT(OPM);
|
||||
__MODULE_IMPORT(Out);
|
||||
__MODULE_IMPORT(Platform);
|
||||
__MODULE_IMPORT(Strings);
|
||||
__REGMOD("extTools", 0);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef extTools__h
|
||||
#define extTools__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
#define SET uint32
|
||||
|
||||
#include "SYSTEM.h"
|
||||
#include "Console.h"
|
||||
#include "Out.h"
|
||||
#include "Strings.h"
|
||||
|
||||
|
||||
|
|
@ -90,7 +90,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len)
|
|||
__DUP(letter, letter__len, CHAR);
|
||||
__COPY(vt100_CSI, cmd, 9);
|
||||
Strings_Append(letter, letter__len, (void*)cmd, 9);
|
||||
Console_String(cmd, 9);
|
||||
Out_String(cmd, 9);
|
||||
__DEL(letter);
|
||||
}
|
||||
|
||||
|
|
@ -103,7 +103,7 @@ static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len)
|
|||
__COPY(vt100_CSI, cmd, 7);
|
||||
Strings_Append(nstr, 2, (void*)cmd, 7);
|
||||
Strings_Append(letter, letter__len, (void*)cmd, 7);
|
||||
Console_String(cmd, 7);
|
||||
Out_String(cmd, 7);
|
||||
__DEL(letter);
|
||||
}
|
||||
|
||||
|
|
@ -116,7 +116,7 @@ static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len)
|
|||
__COPY(vt100_CSI, cmd, 7);
|
||||
Strings_Append(letter, letter__len, (void*)cmd, 7);
|
||||
Strings_Append(nstr, 2, (void*)cmd, 7);
|
||||
Console_String(cmd, 7);
|
||||
Out_String(cmd, 7);
|
||||
__DEL(letter);
|
||||
}
|
||||
|
||||
|
|
@ -132,7 +132,7 @@ static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len)
|
|||
Strings_Append((CHAR*)";", 2, (void*)cmd, 12);
|
||||
Strings_Append(mstr, 5, (void*)cmd, 12);
|
||||
Strings_Append(letter, letter__len, (void*)cmd, 12);
|
||||
Console_String(cmd, 12);
|
||||
Out_String(cmd, 12);
|
||||
__DEL(letter);
|
||||
}
|
||||
|
||||
|
|
@ -242,7 +242,7 @@ void vt100_SetAttr (CHAR *attr, LONGINT attr__len)
|
|||
__DUP(attr, attr__len, CHAR);
|
||||
__COPY(vt100_CSI, tmpstr, 16);
|
||||
Strings_Append(attr, attr__len, (void*)tmpstr, 16);
|
||||
Console_String(tmpstr, 16);
|
||||
Out_String(tmpstr, 16);
|
||||
__DEL(attr);
|
||||
}
|
||||
|
||||
|
|
@ -250,7 +250,7 @@ void vt100_SetAttr (CHAR *attr, LONGINT attr__len)
|
|||
export void *vt100__init(void)
|
||||
{
|
||||
__DEFMOD;
|
||||
__MODULE_IMPORT(Console);
|
||||
__MODULE_IMPORT(Out);
|
||||
__MODULE_IMPORT(Strings);
|
||||
__REGMOD("vt100", 0);
|
||||
__REGCMD("DECTCEMh", vt100_DECTCEMh);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef vt100__h
|
||||
#define vt100__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
@ -19,6 +19,6 @@ export void *Configuration__init(void)
|
|||
__DEFMOD;
|
||||
__REGMOD("Configuration", 0);
|
||||
/* BEGIN */
|
||||
__MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
|
||||
__MOVE("1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
|
||||
__ENDMOD;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Configuration__h
|
||||
#define Configuration__h
|
||||
|
|
|
|||
|
|
@ -1,157 +0,0 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
||||
#include "SYSTEM.h"
|
||||
#include "Platform.h"
|
||||
|
||||
|
||||
static CHAR Console_line[128];
|
||||
static int16 Console_pos;
|
||||
|
||||
|
||||
export void Console_Bool (BOOLEAN b);
|
||||
export void Console_Char (CHAR ch);
|
||||
export void Console_Flush (void);
|
||||
export void Console_Hex (int32 i);
|
||||
export void Console_Int (int64 i, int64 n);
|
||||
export void Console_Ln (void);
|
||||
export void Console_Read (CHAR *ch);
|
||||
export void Console_ReadLine (CHAR *line, LONGINT line__len);
|
||||
export void Console_String (CHAR *s, LONGINT s__len);
|
||||
|
||||
|
||||
void Console_Flush (void)
|
||||
{
|
||||
int16 error;
|
||||
error = Platform_Write(1, (address)Console_line, Console_pos);
|
||||
Console_pos = 0;
|
||||
}
|
||||
|
||||
void Console_Char (CHAR ch)
|
||||
{
|
||||
if (Console_pos == 128) {
|
||||
Console_Flush();
|
||||
}
|
||||
Console_line[__X(Console_pos, 128)] = ch;
|
||||
Console_pos += 1;
|
||||
if (ch == 0x0a) {
|
||||
Console_Flush();
|
||||
}
|
||||
}
|
||||
|
||||
void Console_String (CHAR *s, LONGINT s__len)
|
||||
{
|
||||
int16 i;
|
||||
__DUP(s, s__len, CHAR);
|
||||
i = 0;
|
||||
while (s[__X(i, s__len)] != 0x00) {
|
||||
Console_Char(s[__X(i, s__len)]);
|
||||
i += 1;
|
||||
}
|
||||
__DEL(s);
|
||||
}
|
||||
|
||||
void Console_Int (int64 i, int64 n)
|
||||
{
|
||||
CHAR s[32];
|
||||
int32 i1, k;
|
||||
if (i == (int64)__LSHL(1, 31, 32)) {
|
||||
__MOVE("8463847412", s, 11);
|
||||
k = 10;
|
||||
} else {
|
||||
i1 = __ABS(__VAL(int32, i));
|
||||
s[0] = (CHAR)((int)__MOD(i1, 10) + 48);
|
||||
i1 = __DIV(i1, 10);
|
||||
k = 1;
|
||||
while (i1 > 0) {
|
||||
s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48);
|
||||
i1 = __DIV(i1, 10);
|
||||
k += 1;
|
||||
}
|
||||
}
|
||||
if (i < 0) {
|
||||
s[__X(k, 32)] = '-';
|
||||
k += 1;
|
||||
}
|
||||
while (n > (int64)k) {
|
||||
Console_Char(' ');
|
||||
n -= 1;
|
||||
}
|
||||
while (k > 0) {
|
||||
k -= 1;
|
||||
Console_Char(s[__X(k, 32)]);
|
||||
}
|
||||
}
|
||||
|
||||
void Console_Ln (void)
|
||||
{
|
||||
Console_Char(0x0a);
|
||||
}
|
||||
|
||||
void Console_Bool (BOOLEAN b)
|
||||
{
|
||||
if (b) {
|
||||
Console_String((CHAR*)"TRUE", 5);
|
||||
} else {
|
||||
Console_String((CHAR*)"FALSE", 6);
|
||||
}
|
||||
}
|
||||
|
||||
void Console_Hex (int32 i)
|
||||
{
|
||||
int16 k;
|
||||
int64 n;
|
||||
k = -28;
|
||||
while (k <= 0) {
|
||||
n = __MASK(__ASH(i, k), -16);
|
||||
if (n <= 9) {
|
||||
Console_Char((CHAR)(48 + n));
|
||||
} else {
|
||||
Console_Char((CHAR)(55 + n));
|
||||
}
|
||||
k += 4;
|
||||
}
|
||||
}
|
||||
|
||||
void Console_Read (CHAR *ch)
|
||||
{
|
||||
int32 n;
|
||||
int16 error;
|
||||
Console_Flush();
|
||||
error = Platform_ReadBuf(0, (void*)&*ch, 1, &n);
|
||||
if (n != 1) {
|
||||
*ch = 0x00;
|
||||
}
|
||||
}
|
||||
|
||||
void Console_ReadLine (CHAR *line, LONGINT line__len)
|
||||
{
|
||||
int32 i;
|
||||
CHAR ch;
|
||||
Console_Flush();
|
||||
i = 0;
|
||||
Console_Read(&ch);
|
||||
while ((((i < line__len - 1 && ch != 0x0a)) && ch != 0x00)) {
|
||||
line[__X(i, line__len)] = ch;
|
||||
i += 1;
|
||||
Console_Read(&ch);
|
||||
}
|
||||
line[__X(i, line__len)] = 0x00;
|
||||
}
|
||||
|
||||
|
||||
export void *Console__init(void)
|
||||
{
|
||||
__DEFMOD;
|
||||
__MODULE_IMPORT(Platform);
|
||||
__REGMOD("Console", 0);
|
||||
__REGCMD("Flush", Console_Flush);
|
||||
__REGCMD("Ln", Console_Ln);
|
||||
/* BEGIN */
|
||||
Console_pos = 0;
|
||||
__ENDMOD;
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Console__h
|
||||
#define Console__h
|
||||
|
||||
#include "SYSTEM.h"
|
||||
|
||||
|
||||
|
||||
|
||||
import void Console_Bool (BOOLEAN b);
|
||||
import void Console_Char (CHAR ch);
|
||||
import void Console_Flush (void);
|
||||
import void Console_Hex (int32 i);
|
||||
import void Console_Int (int64 i, int64 n);
|
||||
import void Console_Ln (void);
|
||||
import void Console_Read (CHAR *ch);
|
||||
import void Console_ReadLine (CHAR *line, LONGINT line__len);
|
||||
import void Console_String (CHAR *s, LONGINT s__len);
|
||||
import void *Console__init(void);
|
||||
|
||||
|
||||
#endif // Console
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include "SYSTEM.h"
|
||||
#include "Heap.h"
|
||||
#include "Console.h"
|
||||
#include "Out.h"
|
||||
#include "Platform.h"
|
||||
#include "Strings.h"
|
||||
|
||||
|
|
@ -114,26 +114,26 @@ export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT
|
|||
static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode)
|
||||
{
|
||||
__DUP(s, s__len, CHAR);
|
||||
Console_Ln();
|
||||
Console_String((CHAR*)"-- ", 4);
|
||||
Console_String(s, s__len);
|
||||
Console_String((CHAR*)": ", 3);
|
||||
Out_Ln();
|
||||
Out_String((CHAR*)"-- ", 4);
|
||||
Out_String(s, s__len);
|
||||
Out_String((CHAR*)": ", 3);
|
||||
if (f != NIL) {
|
||||
if (f->registerName[0] != 0x00) {
|
||||
Console_String(f->registerName, 101);
|
||||
Out_String(f->registerName, 101);
|
||||
} else {
|
||||
Console_String(f->workName, 101);
|
||||
Out_String(f->workName, 101);
|
||||
}
|
||||
if (f->fd != 0) {
|
||||
Console_String((CHAR*)"f.fd = ", 8);
|
||||
Console_Int(f->fd, 1);
|
||||
Out_String((CHAR*)"f.fd = ", 8);
|
||||
Out_Int(f->fd, 1);
|
||||
}
|
||||
}
|
||||
if (errcode != 0) {
|
||||
Console_String((CHAR*)" errcode = ", 12);
|
||||
Console_Int(errcode, 1);
|
||||
Out_String((CHAR*)" errcode = ", 12);
|
||||
Out_Int(errcode, 1);
|
||||
}
|
||||
Console_Ln();
|
||||
Out_Ln();
|
||||
__HALT(99);
|
||||
__DEL(s);
|
||||
}
|
||||
|
|
@ -460,11 +460,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
|
|||
done = error == 0;
|
||||
}
|
||||
if ((!done && !Platform_Absent(error))) {
|
||||
Console_String((CHAR*)"Warning: Files.Old ", 20);
|
||||
Console_String(name, name__len);
|
||||
Console_String((CHAR*)" error = ", 10);
|
||||
Console_Int(error, 0);
|
||||
Console_Ln();
|
||||
Out_String((CHAR*)"Warning: Files.Old ", 20);
|
||||
Out_String(name, name__len);
|
||||
Out_String((CHAR*)" error = ", 10);
|
||||
Out_Int(error, 0);
|
||||
Out_Ln();
|
||||
}
|
||||
if (done) {
|
||||
error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ);
|
||||
|
|
@ -1043,7 +1043,7 @@ export void *Files__init(void)
|
|||
{
|
||||
__DEFMOD;
|
||||
__MODULE_IMPORT(Heap);
|
||||
__MODULE_IMPORT(Console);
|
||||
__MODULE_IMPORT(Out);
|
||||
__MODULE_IMPORT(Platform);
|
||||
__MODULE_IMPORT(Strings);
|
||||
__REGMOD("Files", EnumPtrs);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
|
||||
#ifndef Files__h
|
||||
#define Files__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
|
||||
#ifndef Heap__h
|
||||
#define Heap__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
@ -6,7 +6,6 @@
|
|||
#define SET uint32
|
||||
|
||||
#include "SYSTEM.h"
|
||||
#include "Console.h"
|
||||
#include "Heap.h"
|
||||
|
||||
typedef
|
||||
|
|
@ -167,7 +166,6 @@ __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 40), {0, -16}};
|
|||
export void *Modules__init(void)
|
||||
{
|
||||
__DEFMOD;
|
||||
__MODULE_IMPORT(Console);
|
||||
__MODULE_IMPORT(Heap);
|
||||
__REGMOD("Modules", 0);
|
||||
__INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Modules__h
|
||||
#define Modules__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
@ -1522,13 +1522,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y)
|
|||
} else if (((*x)->typ->form == 4 && y->typ->form == 4)) {
|
||||
if ((*x)->class == 7) {
|
||||
k = (*x)->conval->intval;
|
||||
if (0 > k || k > 31) {
|
||||
if (0 > k || k > 63) {
|
||||
OPB_err(202);
|
||||
}
|
||||
}
|
||||
if (y->class == 7) {
|
||||
l = y->conval->intval;
|
||||
if (0 > l || l > 31) {
|
||||
if (0 > l || l > 63) {
|
||||
OPB_err(202);
|
||||
}
|
||||
}
|
||||
|
|
@ -1559,17 +1559,18 @@ void OPB_SetElem (OPT_Node *x)
|
|||
OPB_err(93);
|
||||
} else if ((*x)->class == 7) {
|
||||
k = (*x)->conval->intval;
|
||||
if ((0 <= k && k <= 31)) {
|
||||
(*x)->conval->setval = __SETOF(k,32);
|
||||
OPB_SetSetType(*x);
|
||||
if ((0 <= k && k <= 63)) {
|
||||
(*x)->conval->setval = 0x0;
|
||||
(*x)->conval->setval |= __SETOF(k,64);
|
||||
} else {
|
||||
OPB_err(202);
|
||||
}
|
||||
OPB_SetSetType(*x);
|
||||
(*x)->obj = NIL;
|
||||
} else {
|
||||
OPB_Convert(&*x, OPT_settyp);
|
||||
(*x)->typ = OPT_settyp;
|
||||
}
|
||||
(*x)->typ = OPT_settyp;
|
||||
}
|
||||
|
||||
static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||
|
|
@ -1816,7 +1817,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno)
|
|||
x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size));
|
||||
break;
|
||||
case 7:
|
||||
x = OPB_NewIntConst(OPM_MaxSet);
|
||||
x = OPB_NewIntConst(__ASHL(x->typ->size, 3) - 1);
|
||||
x->typ = OPT_inttyp;
|
||||
break;
|
||||
case 5:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPB__h
|
||||
#define OPB__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
@ -1860,7 +1860,7 @@ void OPC_Constant (OPT_Const con, int16 form)
|
|||
{
|
||||
int16 i;
|
||||
uint64 s;
|
||||
int32 hex;
|
||||
int64 hex;
|
||||
BOOLEAN skipLeading;
|
||||
switch (form) {
|
||||
case 1:
|
||||
|
|
@ -1885,7 +1885,7 @@ void OPC_Constant (OPT_Const con, int16 form)
|
|||
OPM_WriteString((CHAR*)"0x", 3);
|
||||
skipLeading = 1;
|
||||
s = con->setval;
|
||||
i = 32;
|
||||
i = 64;
|
||||
do {
|
||||
hex = 0;
|
||||
do {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPC__h
|
||||
#define OPC__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
#include "SYSTEM.h"
|
||||
#include "Configuration.h"
|
||||
#include "Console.h"
|
||||
#include "Files.h"
|
||||
#include "Out.h"
|
||||
#include "Platform.h"
|
||||
#include "Strings.h"
|
||||
#include "Texts.h"
|
||||
|
|
@ -27,7 +27,7 @@ export int16 OPM_AddressSize;
|
|||
static int16 OPM_GlobalAlignment;
|
||||
export int16 OPM_Alignment;
|
||||
export uint32 OPM_GlobalOptions, OPM_Options;
|
||||
export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet;
|
||||
export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize;
|
||||
export int64 OPM_MaxIndex;
|
||||
export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
|
||||
export BOOLEAN OPM_noerr;
|
||||
|
|
@ -102,24 +102,24 @@ export void OPM_err (int16 n);
|
|||
|
||||
void OPM_LogW (CHAR ch)
|
||||
{
|
||||
Console_Char(ch);
|
||||
Out_Char(ch);
|
||||
}
|
||||
|
||||
void OPM_LogWStr (CHAR *s, LONGINT s__len)
|
||||
{
|
||||
__DUP(s, s__len, CHAR);
|
||||
Console_String(s, s__len);
|
||||
Out_String(s, s__len);
|
||||
__DEL(s);
|
||||
}
|
||||
|
||||
void OPM_LogWNum (int64 i, int64 len)
|
||||
{
|
||||
Console_Int(i, len);
|
||||
Out_Int(i, len);
|
||||
}
|
||||
|
||||
void OPM_LogWLn (void)
|
||||
{
|
||||
Console_Ln();
|
||||
Out_Ln();
|
||||
}
|
||||
|
||||
int64 OPM_SignedMaximum (int32 bytecount)
|
||||
|
|
@ -455,7 +455,6 @@ void OPM_InitOptions (void)
|
|||
OPM_SetSize = 4;
|
||||
break;
|
||||
}
|
||||
OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1;
|
||||
if (__IN(18, OPM_Options, 32)) {
|
||||
OPM_VerboseListSizes();
|
||||
}
|
||||
|
|
@ -1075,8 +1074,8 @@ export void *OPM__init(void)
|
|||
{
|
||||
__DEFMOD;
|
||||
__MODULE_IMPORT(Configuration);
|
||||
__MODULE_IMPORT(Console);
|
||||
__MODULE_IMPORT(Files);
|
||||
__MODULE_IMPORT(Out);
|
||||
__MODULE_IMPORT(Platform);
|
||||
__MODULE_IMPORT(Strings);
|
||||
__MODULE_IMPORT(Texts);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPM__h
|
||||
#define OPM__h
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
import CHAR OPM_Model[10];
|
||||
import int16 OPM_AddressSize, OPM_Alignment;
|
||||
import uint32 OPM_GlobalOptions, OPM_Options;
|
||||
import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet;
|
||||
import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize;
|
||||
import int64 OPM_MaxIndex;
|
||||
import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
|
||||
import BOOLEAN OPM_noerr;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue