Some support in makefile for 32 bit model.

This commit is contained in:
David Brown 2016-09-22 20:02:46 +01:00
parent b158671cf8
commit b40dc4e2f8
27 changed files with 141 additions and 116 deletions

View file

@ -118,10 +118,10 @@ void Console_Hex (int32 i)
void Console_Read (CHAR *ch) void Console_Read (CHAR *ch)
{ {
int32 n; address n;
int16 error; int16 error;
Console_Flush(); Console_Flush();
error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); error = Platform_ReadBuf(0, (void*)&*ch, 1, (void*)&n);
if (n != 1) { if (n != 1) {
*ch = 0x00; *ch = 0x00;
} }

View file

@ -663,7 +663,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x
} else { } else {
min = n; min = n;
} }
__MOVE((address)buf->data + offset, (address)x + xpos, min); __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min);
offset += min; offset += min;
(*r).offset = offset; (*r).offset = offset;
xpos += min; xpos += min;
@ -728,7 +728,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT
} else { } else {
min = n; min = n;
} }
__MOVE((address)x + xpos, (address)buf->data + offset, min); __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min);
offset += min; offset += min;
(*r).offset = offset; (*r).offset = offset;
if (offset > buf->size) { if (offset > buf->size) {

View file

@ -639,7 +639,7 @@ void OPB_MOp (int8 op, OPT_Node *x)
} else { } else {
OPB_err(127); OPB_err(127);
} }
z->typ = OPT_linttyp; z->typ = OPT_adrtyp;
break; break;
case 25: case 25:
if ((f == 4 && z->class == 7)) { if ((f == 4 && z->class == 7)) {
@ -1938,11 +1938,11 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno)
case 24: case 25: case 28: case 31: case 24: case 25: case 28: case 31:
if (x->class == 8 || x->class == 9) { if (x->class == 8 || x->class == 9) {
OPB_err(126); OPB_err(126);
} else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) {
OPB_Convert(&x, OPT_linttyp); OPB_Convert(&x, OPT_adrtyp);
} else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) {
OPB_err(111); OPB_err(111);
x->typ = OPT_linttyp; x->typ = OPT_adrtyp;
} }
break; break;
case 26: case 27: case 26: case 27:
@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
x->conval->intval += 1; x->conval->intval += 1;
} }
p = NewOp__53(12, 19, p, x); p = NewOp__53(12, 19, p, x);
p->typ = OPT_linttyp; p->typ = OPT_adrtyp;
} else { } else {
p = x; p = x;
p->conval->intval = typ->n; p->conval->intval = typ->n;
@ -2211,11 +2211,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
case 31: case 31:
if (x->class == 8 || x->class == 9) { if (x->class == 8 || x->class == 9) {
OPB_err(126); OPB_err(126);
} else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) {
OPB_Convert(&x, OPT_linttyp); OPB_Convert(&x, OPT_adrtyp);
} else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) {
OPB_err(111); OPB_err(111);
x->typ = OPT_linttyp; x->typ = OPT_adrtyp;
} }
p->link = x; p->link = x;
break; break;
@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno)
p = p->left; p = p->left;
dim += 1; dim += 1;
} }
OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim));
p->subcl = 19; p->subcl = 19;
} else { } else {
p = OPB_NewIntConst(p->typ->n); p = OPB_NewIntConst(p->typ->n);
@ -2450,8 +2450,12 @@ void OPB_Param (OPT_Node ap, OPT_Object fp)
OPB_err(111); OPB_err(111);
} }
} else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) {
} else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))))) { } 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); OPB_err(123);
}
} else if ((fp->typ->form == 11 && ap->class == 5)) { } else if ((fp->typ->form == 11 && ap->class == 5)) {
OPB_err(123); OPB_err(123);
} }

View file

@ -13,7 +13,7 @@ typedef
Platform_ArgPtr (*Platform_ArgVec)[1024]; Platform_ArgPtr (*Platform_ArgVec)[1024];
typedef typedef
int32 (*Platform_ArgVecPtr)[1]; address (*Platform_ArgVecPtr)[1];
typedef typedef
CHAR (*Platform_EnvPtr)[1024]; CHAR (*Platform_EnvPtr)[1024];
@ -83,7 +83,7 @@ export void Platform_SetHalt (Platform_HaltProcedure p);
export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetInterruptHandler (Platform_SignalHandler handler);
export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source);
export void Platform_SetQuitHandler (Platform_SignalHandler handler); export void Platform_SetQuitHandler (Platform_SignalHandler handler);
export int16 Platform_Size (int32 h, int32 *l); export int16 Platform_Size (int32 h, address *l);
export int16 Platform_Sync (int32 h); export int16 Platform_Sync (int32 h);
export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); export int16 Platform_System (CHAR *cmd, LONGINT cmd__len);
static void Platform_TestLittleEndian (void); static void Platform_TestLittleEndian (void);
@ -155,7 +155,7 @@ extern void Heap_InitHeap();
#define Platform_statdev() (LONGINT)s.st_dev #define Platform_statdev() (LONGINT)s.st_dev
#define Platform_statino() (LONGINT)s.st_ino #define Platform_statino() (LONGINT)s.st_ino
#define Platform_statmtime() (LONGINT)s.st_mtime #define Platform_statmtime() (LONGINT)s.st_mtime
#define Platform_statsize() (LONGINT)s.st_size #define Platform_statsize() (address)s.st_size
#define Platform_structstats() struct stat s #define Platform_structstats() struct stat s
#define Platform_system(str, str__len) system((char*)str) #define Platform_system(str, str__len) system((char*)str)
#define Platform_tmhour() (LONGINT)time->tm_hour #define Platform_tmhour() (LONGINT)time->tm_hour
@ -504,7 +504,7 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d)
Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d);
} }
int16 Platform_Size (int32 h, int32 *l) int16 Platform_Size (int32 h, address *l)
{ {
int16 _o_result; int16 _o_result;
Platform_structstats(); Platform_structstats();

View file

@ -67,7 +67,7 @@ import void Platform_SetHalt (Platform_HaltProcedure p);
import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetInterruptHandler (Platform_SignalHandler handler);
import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source);
import void Platform_SetQuitHandler (Platform_SignalHandler handler); import void Platform_SetQuitHandler (Platform_SignalHandler handler);
import int16 Platform_Size (int32 h, int32 *l); import int16 Platform_Size (int32 h, address *l);
import int16 Platform_Sync (int32 h); import int16 Platform_Sync (int32 h);
import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); import int16 Platform_System (CHAR *cmd, LONGINT cmd__len);
import int32 Platform_Time (void); import int32 Platform_Time (void);

View file

@ -118,10 +118,10 @@ void Console_Hex (int32 i)
void Console_Read (CHAR *ch) void Console_Read (CHAR *ch)
{ {
int32 n; address n;
int16 error; int16 error;
Console_Flush(); Console_Flush();
error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); error = Platform_ReadBuf(0, (void*)&*ch, 1, (void*)&n);
if (n != 1) { if (n != 1) {
*ch = 0x00; *ch = 0x00;
} }

View file

@ -663,7 +663,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x
} else { } else {
min = n; min = n;
} }
__MOVE((address)buf->data + offset, (address)x + xpos, min); __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min);
offset += min; offset += min;
(*r).offset = offset; (*r).offset = offset;
xpos += min; xpos += min;
@ -728,7 +728,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT
} else { } else {
min = n; min = n;
} }
__MOVE((address)x + xpos, (address)buf->data + offset, min); __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min);
offset += min; offset += min;
(*r).offset = offset; (*r).offset = offset;
if (offset > buf->size) { if (offset > buf->size) {

View file

@ -639,7 +639,7 @@ void OPB_MOp (int8 op, OPT_Node *x)
} else { } else {
OPB_err(127); OPB_err(127);
} }
z->typ = OPT_linttyp; z->typ = OPT_adrtyp;
break; break;
case 25: case 25:
if ((f == 4 && z->class == 7)) { if ((f == 4 && z->class == 7)) {
@ -1938,11 +1938,11 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno)
case 24: case 25: case 28: case 31: case 24: case 25: case 28: case 31:
if (x->class == 8 || x->class == 9) { if (x->class == 8 || x->class == 9) {
OPB_err(126); OPB_err(126);
} else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) {
OPB_Convert(&x, OPT_linttyp); OPB_Convert(&x, OPT_adrtyp);
} else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) {
OPB_err(111); OPB_err(111);
x->typ = OPT_linttyp; x->typ = OPT_adrtyp;
} }
break; break;
case 26: case 27: case 26: case 27:
@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
x->conval->intval += 1; x->conval->intval += 1;
} }
p = NewOp__53(12, 19, p, x); p = NewOp__53(12, 19, p, x);
p->typ = OPT_linttyp; p->typ = OPT_adrtyp;
} else { } else {
p = x; p = x;
p->conval->intval = typ->n; p->conval->intval = typ->n;
@ -2211,11 +2211,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
case 31: case 31:
if (x->class == 8 || x->class == 9) { if (x->class == 8 || x->class == 9) {
OPB_err(126); OPB_err(126);
} else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) {
OPB_Convert(&x, OPT_linttyp); OPB_Convert(&x, OPT_adrtyp);
} else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) {
OPB_err(111); OPB_err(111);
x->typ = OPT_linttyp; x->typ = OPT_adrtyp;
} }
p->link = x; p->link = x;
break; break;
@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno)
p = p->left; p = p->left;
dim += 1; dim += 1;
} }
OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim));
p->subcl = 19; p->subcl = 19;
} else { } else {
p = OPB_NewIntConst(p->typ->n); p = OPB_NewIntConst(p->typ->n);
@ -2450,8 +2450,12 @@ void OPB_Param (OPT_Node ap, OPT_Object fp)
OPB_err(111); OPB_err(111);
} }
} else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) {
} else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))))) { } 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); OPB_err(123);
}
} else if ((fp->typ->form == 11 && ap->class == 5)) { } else if ((fp->typ->form == 11 && ap->class == 5)) {
OPB_err(123); OPB_err(123);
} }

View file

@ -13,7 +13,7 @@ typedef
Platform_ArgPtr (*Platform_ArgVec)[1024]; Platform_ArgPtr (*Platform_ArgVec)[1024];
typedef typedef
int32 (*Platform_ArgVecPtr)[1]; address (*Platform_ArgVecPtr)[1];
typedef typedef
CHAR (*Platform_EnvPtr)[1024]; CHAR (*Platform_EnvPtr)[1024];
@ -83,7 +83,7 @@ export void Platform_SetHalt (Platform_HaltProcedure p);
export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetInterruptHandler (Platform_SignalHandler handler);
export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source);
export void Platform_SetQuitHandler (Platform_SignalHandler handler); export void Platform_SetQuitHandler (Platform_SignalHandler handler);
export int16 Platform_Size (int32 h, int32 *l); export int16 Platform_Size (int32 h, address *l);
export int16 Platform_Sync (int32 h); export int16 Platform_Sync (int32 h);
export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); export int16 Platform_System (CHAR *cmd, LONGINT cmd__len);
static void Platform_TestLittleEndian (void); static void Platform_TestLittleEndian (void);
@ -155,7 +155,7 @@ extern void Heap_InitHeap();
#define Platform_statdev() (LONGINT)s.st_dev #define Platform_statdev() (LONGINT)s.st_dev
#define Platform_statino() (LONGINT)s.st_ino #define Platform_statino() (LONGINT)s.st_ino
#define Platform_statmtime() (LONGINT)s.st_mtime #define Platform_statmtime() (LONGINT)s.st_mtime
#define Platform_statsize() (LONGINT)s.st_size #define Platform_statsize() (address)s.st_size
#define Platform_structstats() struct stat s #define Platform_structstats() struct stat s
#define Platform_system(str, str__len) system((char*)str) #define Platform_system(str, str__len) system((char*)str)
#define Platform_tmhour() (LONGINT)time->tm_hour #define Platform_tmhour() (LONGINT)time->tm_hour
@ -504,7 +504,7 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d)
Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d);
} }
int16 Platform_Size (int32 h, int32 *l) int16 Platform_Size (int32 h, address *l)
{ {
int16 _o_result; int16 _o_result;
Platform_structstats(); Platform_structstats();

View file

@ -67,7 +67,7 @@ import void Platform_SetHalt (Platform_HaltProcedure p);
import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetInterruptHandler (Platform_SignalHandler handler);
import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source);
import void Platform_SetQuitHandler (Platform_SignalHandler handler); import void Platform_SetQuitHandler (Platform_SignalHandler handler);
import int16 Platform_Size (int32 h, int32 *l); import int16 Platform_Size (int32 h, address *l);
import int16 Platform_Sync (int32 h); import int16 Platform_Sync (int32 h);
import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); import int16 Platform_System (CHAR *cmd, LONGINT cmd__len);
import int32 Platform_Time (void); import int32 Platform_Time (void);

View file

@ -118,10 +118,10 @@ void Console_Hex (int64 i)
void Console_Read (CHAR *ch) void Console_Read (CHAR *ch)
{ {
int64 n; address n;
int32 error; int32 error;
Console_Flush(); Console_Flush();
error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); error = Platform_ReadBuf(0, (void*)&*ch, 1, (void*)&n);
if (n != 1) { if (n != 1) {
*ch = 0x00; *ch = 0x00;
} }

View file

@ -663,7 +663,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x
} else { } else {
min = n; min = n;
} }
__MOVE((address)buf->data + offset, (address)x + xpos, min); __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min);
offset += min; offset += min;
(*r).offset = offset; (*r).offset = offset;
xpos += min; xpos += min;
@ -728,7 +728,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT
} else { } else {
min = n; min = n;
} }
__MOVE((address)x + xpos, (address)buf->data + offset, min); __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min);
offset += min; offset += min;
(*r).offset = offset; (*r).offset = offset;
if (offset > buf->size) { if (offset > buf->size) {

View file

@ -639,7 +639,7 @@ void OPB_MOp (int8 op, OPT_Node *x)
} else { } else {
OPB_err(127); OPB_err(127);
} }
z->typ = OPT_linttyp; z->typ = OPT_adrtyp;
break; break;
case 25: case 25:
if ((f == 4 && z->class == 7)) { if ((f == 4 && z->class == 7)) {
@ -1938,11 +1938,11 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno)
case 24: case 25: case 28: case 31: case 24: case 25: case 28: case 31:
if (x->class == 8 || x->class == 9) { if (x->class == 8 || x->class == 9) {
OPB_err(126); OPB_err(126);
} else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) {
OPB_Convert(&x, OPT_linttyp); OPB_Convert(&x, OPT_adrtyp);
} else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) {
OPB_err(111); OPB_err(111);
x->typ = OPT_linttyp; x->typ = OPT_adrtyp;
} }
break; break;
case 26: case 27: case 26: case 27:
@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
x->conval->intval += 1; x->conval->intval += 1;
} }
p = NewOp__53(12, 19, p, x); p = NewOp__53(12, 19, p, x);
p->typ = OPT_linttyp; p->typ = OPT_adrtyp;
} else { } else {
p = x; p = x;
p->conval->intval = typ->n; p->conval->intval = typ->n;
@ -2211,11 +2211,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
case 31: case 31:
if (x->class == 8 || x->class == 9) { if (x->class == 8 || x->class == 9) {
OPB_err(126); OPB_err(126);
} else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) {
OPB_Convert(&x, OPT_linttyp); OPB_Convert(&x, OPT_adrtyp);
} else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) {
OPB_err(111); OPB_err(111);
x->typ = OPT_linttyp; x->typ = OPT_adrtyp;
} }
p->link = x; p->link = x;
break; break;
@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno)
p = p->left; p = p->left;
dim += 1; dim += 1;
} }
OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim));
p->subcl = 19; p->subcl = 19;
} else { } else {
p = OPB_NewIntConst(p->typ->n); p = OPB_NewIntConst(p->typ->n);
@ -2450,8 +2450,12 @@ void OPB_Param (OPT_Node ap, OPT_Object fp)
OPB_err(111); OPB_err(111);
} }
} else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) {
} else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 64) && ap->typ->size == 1)))))) { } else if (ap->typ != fp->typ) {
if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 64) && ap->typ->size == 1)))) {
} else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) {
} else {
OPB_err(123); OPB_err(123);
}
} else if ((fp->typ->form == 11 && ap->class == 5)) { } else if ((fp->typ->form == 11 && ap->class == 5)) {
OPB_err(123); OPB_err(123);
} }

View file

@ -13,7 +13,7 @@ typedef
Platform_ArgPtr (*Platform_ArgVec)[1024]; Platform_ArgPtr (*Platform_ArgVec)[1024];
typedef typedef
int64 (*Platform_ArgVecPtr)[1]; address (*Platform_ArgVecPtr)[1];
typedef typedef
CHAR (*Platform_EnvPtr)[1024]; CHAR (*Platform_EnvPtr)[1024];
@ -83,7 +83,7 @@ export void Platform_SetHalt (Platform_HaltProcedure p);
export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetInterruptHandler (Platform_SignalHandler handler);
export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source);
export void Platform_SetQuitHandler (Platform_SignalHandler handler); export void Platform_SetQuitHandler (Platform_SignalHandler handler);
export int32 Platform_Size (int64 h, int64 *l); export int32 Platform_Size (int64 h, address *l);
export int32 Platform_Sync (int64 h); export int32 Platform_Sync (int64 h);
export int32 Platform_System (CHAR *cmd, LONGINT cmd__len); export int32 Platform_System (CHAR *cmd, LONGINT cmd__len);
static void Platform_TestLittleEndian (void); static void Platform_TestLittleEndian (void);
@ -155,7 +155,7 @@ extern void Heap_InitHeap();
#define Platform_statdev() (LONGINT)s.st_dev #define Platform_statdev() (LONGINT)s.st_dev
#define Platform_statino() (LONGINT)s.st_ino #define Platform_statino() (LONGINT)s.st_ino
#define Platform_statmtime() (LONGINT)s.st_mtime #define Platform_statmtime() (LONGINT)s.st_mtime
#define Platform_statsize() (LONGINT)s.st_size #define Platform_statsize() (address)s.st_size
#define Platform_structstats() struct stat s #define Platform_structstats() struct stat s
#define Platform_system(str, str__len) system((char*)str) #define Platform_system(str, str__len) system((char*)str)
#define Platform_tmhour() (LONGINT)time->tm_hour #define Platform_tmhour() (LONGINT)time->tm_hour
@ -504,7 +504,7 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d)
Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d);
} }
int32 Platform_Size (int64 h, int64 *l) int32 Platform_Size (int64 h, address *l)
{ {
int32 _o_result; int32 _o_result;
Platform_structstats(); Platform_structstats();

View file

@ -67,7 +67,7 @@ import void Platform_SetHalt (Platform_HaltProcedure p);
import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetInterruptHandler (Platform_SignalHandler handler);
import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source);
import void Platform_SetQuitHandler (Platform_SignalHandler handler); import void Platform_SetQuitHandler (Platform_SignalHandler handler);
import int32 Platform_Size (int64 h, int64 *l); import int32 Platform_Size (int64 h, address *l);
import int32 Platform_Sync (int64 h); import int32 Platform_Sync (int64 h);
import int32 Platform_System (CHAR *cmd, LONGINT cmd__len); import int32 Platform_System (CHAR *cmd, LONGINT cmd__len);
import int64 Platform_Time (void); import int64 Platform_Time (void);

View file

@ -118,10 +118,10 @@ void Console_Hex (int32 i)
void Console_Read (CHAR *ch) void Console_Read (CHAR *ch)
{ {
int32 n; address n;
int16 error; int16 error;
Console_Flush(); Console_Flush();
error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, (void*)&n);
if (n != 1) { if (n != 1) {
*ch = 0x00; *ch = 0x00;
} }

View file

@ -663,7 +663,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x
} else { } else {
min = n; min = n;
} }
__MOVE((address)buf->data + offset, (address)x + xpos, min); __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min);
offset += min; offset += min;
(*r).offset = offset; (*r).offset = offset;
xpos += min; xpos += min;
@ -728,7 +728,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT
} else { } else {
min = n; min = n;
} }
__MOVE((address)x + xpos, (address)buf->data + offset, min); __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min);
offset += min; offset += min;
(*r).offset = offset; (*r).offset = offset;
if (offset > buf->size) { if (offset > buf->size) {

View file

@ -639,7 +639,7 @@ void OPB_MOp (int8 op, OPT_Node *x)
} else { } else {
OPB_err(127); OPB_err(127);
} }
z->typ = OPT_linttyp; z->typ = OPT_adrtyp;
break; break;
case 25: case 25:
if ((f == 4 && z->class == 7)) { if ((f == 4 && z->class == 7)) {
@ -1938,11 +1938,11 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno)
case 24: case 25: case 28: case 31: case 24: case 25: case 28: case 31:
if (x->class == 8 || x->class == 9) { if (x->class == 8 || x->class == 9) {
OPB_err(126); OPB_err(126);
} else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) {
OPB_Convert(&x, OPT_linttyp); OPB_Convert(&x, OPT_adrtyp);
} else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) {
OPB_err(111); OPB_err(111);
x->typ = OPT_linttyp; x->typ = OPT_adrtyp;
} }
break; break;
case 26: case 27: case 26: case 27:
@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
x->conval->intval += 1; x->conval->intval += 1;
} }
p = NewOp__53(12, 19, p, x); p = NewOp__53(12, 19, p, x);
p->typ = OPT_linttyp; p->typ = OPT_adrtyp;
} else { } else {
p = x; p = x;
p->conval->intval = typ->n; p->conval->intval = typ->n;
@ -2211,11 +2211,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
case 31: case 31:
if (x->class == 8 || x->class == 9) { if (x->class == 8 || x->class == 9) {
OPB_err(126); OPB_err(126);
} else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) {
OPB_Convert(&x, OPT_linttyp); OPB_Convert(&x, OPT_adrtyp);
} else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) {
OPB_err(111); OPB_err(111);
x->typ = OPT_linttyp; x->typ = OPT_adrtyp;
} }
p->link = x; p->link = x;
break; break;
@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno)
p = p->left; p = p->left;
dim += 1; dim += 1;
} }
OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim));
p->subcl = 19; p->subcl = 19;
} else { } else {
p = OPB_NewIntConst(p->typ->n); p = OPB_NewIntConst(p->typ->n);
@ -2450,8 +2450,12 @@ void OPB_Param (OPT_Node ap, OPT_Object fp)
OPB_err(111); OPB_err(111);
} }
} else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) {
} else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))))) { } 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); OPB_err(123);
}
} else if ((fp->typ->form == 11 && ap->class == 5)) { } else if ((fp->typ->form == 11 && ap->class == 5)) {
OPB_err(123); OPB_err(123);
} }

View file

@ -118,10 +118,10 @@ void Console_Hex (int64 i)
void Console_Read (CHAR *ch) void Console_Read (CHAR *ch)
{ {
int64 n; address n;
int32 error; int32 error;
Console_Flush(); Console_Flush();
error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, (void*)&n);
if (n != 1) { if (n != 1) {
*ch = 0x00; *ch = 0x00;
} }

View file

@ -663,7 +663,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x
} else { } else {
min = n; min = n;
} }
__MOVE((address)buf->data + offset, (address)x + xpos, min); __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min);
offset += min; offset += min;
(*r).offset = offset; (*r).offset = offset;
xpos += min; xpos += min;
@ -728,7 +728,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT
} else { } else {
min = n; min = n;
} }
__MOVE((address)x + xpos, (address)buf->data + offset, min); __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min);
offset += min; offset += min;
(*r).offset = offset; (*r).offset = offset;
if (offset > buf->size) { if (offset > buf->size) {

View file

@ -639,7 +639,7 @@ void OPB_MOp (int8 op, OPT_Node *x)
} else { } else {
OPB_err(127); OPB_err(127);
} }
z->typ = OPT_linttyp; z->typ = OPT_adrtyp;
break; break;
case 25: case 25:
if ((f == 4 && z->class == 7)) { if ((f == 4 && z->class == 7)) {
@ -1938,11 +1938,11 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno)
case 24: case 25: case 28: case 31: case 24: case 25: case 28: case 31:
if (x->class == 8 || x->class == 9) { if (x->class == 8 || x->class == 9) {
OPB_err(126); OPB_err(126);
} else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) {
OPB_Convert(&x, OPT_linttyp); OPB_Convert(&x, OPT_adrtyp);
} else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) {
OPB_err(111); OPB_err(111);
x->typ = OPT_linttyp; x->typ = OPT_adrtyp;
} }
break; break;
case 26: case 27: case 26: case 27:
@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
x->conval->intval += 1; x->conval->intval += 1;
} }
p = NewOp__53(12, 19, p, x); p = NewOp__53(12, 19, p, x);
p->typ = OPT_linttyp; p->typ = OPT_adrtyp;
} else { } else {
p = x; p = x;
p->conval->intval = typ->n; p->conval->intval = typ->n;
@ -2211,11 +2211,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
case 31: case 31:
if (x->class == 8 || x->class == 9) { if (x->class == 8 || x->class == 9) {
OPB_err(126); OPB_err(126);
} else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) {
OPB_Convert(&x, OPT_linttyp); OPB_Convert(&x, OPT_adrtyp);
} else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) {
OPB_err(111); OPB_err(111);
x->typ = OPT_linttyp; x->typ = OPT_adrtyp;
} }
p->link = x; p->link = x;
break; break;
@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno)
p = p->left; p = p->left;
dim += 1; dim += 1;
} }
OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim));
p->subcl = 19; p->subcl = 19;
} else { } else {
p = OPB_NewIntConst(p->typ->n); p = OPB_NewIntConst(p->typ->n);
@ -2450,8 +2450,12 @@ void OPB_Param (OPT_Node ap, OPT_Object fp)
OPB_err(111); OPB_err(111);
} }
} else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) {
} else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 64) && ap->typ->size == 1)))))) { } else if (ap->typ != fp->typ) {
if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 64) && ap->typ->size == 1)))) {
} else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) {
} else {
OPB_err(123); OPB_err(123);
}
} else if ((fp->typ->form == 11 && ap->class == 5)) { } else if ((fp->typ->form == 11 && ap->class == 5)) {
OPB_err(123); OPB_err(123);
} }

View file

@ -262,21 +262,21 @@ bootstrap: configuration
@make -f src/tools/make/vishap.make -s translate @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 assemble
rm -rf bootstrap/* rm -rf bootstrap/*
make -f src/tools/make/vishap.make -s translate 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=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym
make -f src/tools/make/vishap.make -s translate 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=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 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=-OV 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 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=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 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym make -f src/tools/make/vishap.make -s translate MODEL=-OV INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym
cp src/system/*.[ch] bootstrap cp src/system/*.[ch] bootstrap
bootstrapunclean: bootstrapunclean:
rm -rf bootstrap/* rm -rf bootstrap/*
make -f src/tools/make/vishap.make -s translate 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=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym
make -f src/tools/make/vishap.make -s translate 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=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 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=-OV 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 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=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 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym make -f src/tools/make/vishap.make -s translate MODEL=-OV INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym
cp src/system/*.[ch] bootstrap cp src/system/*.[ch] bootstrap

View file

@ -65,7 +65,7 @@ MODULE Console; (* J. Templ, 29-June-96 *)
END Hex; END Hex;
PROCEDURE Read*(VAR ch: CHAR); PROCEDURE Read*(VAR ch: CHAR);
VAR n: LONGINT; error: Platform.ErrorCode; VAR n: SYSTEM.ADDRESS; error: Platform.ErrorCode;
BEGIN Flush(); BEGIN Flush();
error := Platform.ReadBuf(Platform.StdIn, ch, n); error := Platform.ReadBuf(Platform.StdIn, ch, n);
IF n # 1 THEN ch := 0X END IF n # 1 THEN ch := 0X END

View file

@ -34,13 +34,15 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files
Buffer = POINTER TO BufDesc; Buffer = POINTER TO BufDesc;
FileDesc = RECORD FileDesc = RECORD
workName, registerName: FileName; workName: FileName;
registerName: FileName;
tempFile: BOOLEAN; tempFile: BOOLEAN;
identity: Platform.FileIdentity; identity: Platform.FileIdentity;
fd-: Platform.FileHandle; fd-: Platform.FileHandle;
len, pos: LONGINT; len, pos: LONGINT;
bufs: ARRAY nofbufs OF Buffer; bufs: ARRAY nofbufs OF Buffer;
swapper, state: INTEGER; swapper: INTEGER;
state: INTEGER;
next: File; next: File;
END; END;
@ -56,7 +58,8 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files
res*: LONGINT; res*: LONGINT;
eof*: BOOLEAN; eof*: BOOLEAN;
buf: Buffer; buf: Buffer;
org, offset: LONGINT org: LONGINT;
offset: LONGINT
END; END;

View file

@ -316,7 +316,7 @@ PROCEDURE -structstats "struct stat s";
PROCEDURE -statdev(): LONGINT "(LONGINT)s.st_dev"; PROCEDURE -statdev(): LONGINT "(LONGINT)s.st_dev";
PROCEDURE -statino(): LONGINT "(LONGINT)s.st_ino"; PROCEDURE -statino(): LONGINT "(LONGINT)s.st_ino";
PROCEDURE -statmtime(): LONGINT "(LONGINT)s.st_mtime"; PROCEDURE -statmtime(): LONGINT "(LONGINT)s.st_mtime";
PROCEDURE -statsize(): LONGINT "(LONGINT)s.st_size"; PROCEDURE -statsize(): SYSTEM.ADDRESS "(address)s.st_size";
PROCEDURE Identify*(h: FileHandle; VAR identity: FileIdentity): ErrorCode; PROCEDURE Identify*(h: FileHandle; VAR identity: FileIdentity): ErrorCode;
BEGIN BEGIN
@ -358,7 +358,7 @@ BEGIN
END MTimeAsClock; END MTimeAsClock;
PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; PROCEDURE Size*(h: FileHandle; VAR l: SYSTEM.ADDRESS): ErrorCode;
BEGIN BEGIN
structstats; structstats;
IF fstat(h) < 0 THEN RETURN err() END; IF fstat(h) < 0 THEN RETURN err() END;

View file

@ -379,6 +379,7 @@ void writeMakeParameters() {
fprintf(fd, "ONAME=%s\n", oname); fprintf(fd, "ONAME=%s\n", oname);
fprintf(fd, "DATAMODEL=%s\n", dataModel); fprintf(fd, "DATAMODEL=%s\n", dataModel);
fprintf(fd, "INTSIZE=%d\n", intsize); fprintf(fd, "INTSIZE=%d\n", intsize);
fprintf(fd, "MODEL=-O%c\n", intsize == 2 ? '2' : 'V');
fprintf(fd, "ADRSIZE=%d\n", addressSize); fprintf(fd, "ADRSIZE=%d\n", addressSize);
fprintf(fd, "ALIGNMENT=%d\n", alignment); fprintf(fd, "ALIGNMENT=%d\n", alignment);
fprintf(fd, "INSTALLDIR=%s\n", installdir); fprintf(fd, "INSTALLDIR=%s\n", installdir);

View file

@ -97,6 +97,7 @@ translate:
@printf "\nmake translate - translating compiler source from Oberon to C:\n" @printf "\nmake translate - translating compiler source from Oberon to C:\n"
@printf " PLATFORM: %s\n" $(PLATFORM) @printf " PLATFORM: %s\n" $(PLATFORM)
@printf " INTSIZE: %s\n" $(INTSIZE) @printf " INTSIZE: %s\n" $(INTSIZE)
@printf " MODEL: %s\n" $(MODEL)
@printf " ADRSIZE: %s\n" $(ADRSIZE) @printf " ADRSIZE: %s\n" $(ADRSIZE)
@printf " ALIGNMENT: %s\n" $(ALIGNMENT) @printf " ALIGNMENT: %s\n" $(ALIGNMENT)
@mkdir -p $(BUILDDIR) @mkdir -p $(BUILDDIR)