version 1.28, 2001/02/27 21:17:11
|
version 1.33, 2001/12/09 19:12:46
|
Line 20
|
Line 20
|
*/ |
*/ |
|
|
#include "config.h" |
#include "config.h" |
|
#include "forth.h" |
#include <ctype.h> |
#include <ctype.h> |
#include <stdio.h> |
#include <stdio.h> |
#include <string.h> |
#include <string.h> |
Line 27
|
Line 28
|
#include <assert.h> |
#include <assert.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <errno.h> |
#include <errno.h> |
#include "forth.h" |
|
#include "io.h" |
#include "io.h" |
#include "threaded.h" |
#include "threaded.h" |
#ifndef STANDALONE |
#ifndef STANDALONE |
Line 196 DCell timeval2us(struct timeval *tvp)
|
Line 196 DCell timeval2us(struct timeval *tvp)
|
|
|
#ifdef HAS_FILE |
#ifdef HAS_FILE |
static char* fileattr[6]={"rb","rb","r+b","r+b","wb","wb"}; |
static char* fileattr[6]={"rb","rb","r+b","r+b","wb","wb"}; |
|
static char* pfileattr[6]={"r","r","r+","r+","w","w"}; |
|
|
#ifndef O_BINARY |
#ifndef O_BINARY |
#define O_BINARY 0 |
#define O_BINARY 0 |
Line 244 static int ufileattr[6]= {
|
Line 245 static int ufileattr[6]= {
|
#define vm_longname2Cell(x) ((Cell)(x)) |
#define vm_longname2Cell(x) ((Cell)(x)) |
#define vm_r2Float(x) (x) |
#define vm_r2Float(x) (x) |
|
|
|
#define vm_Cell2Cell(x) (x) |
|
|
/* if machine.h has not defined explicit registers, define them as implicit */ |
/* if machine.h has not defined explicit registers, define them as implicit */ |
#ifndef IPREG |
#ifndef IPREG |
#define IPREG |
#define IPREG |
Line 306 Xt *ip;
|
Line 309 Xt *ip;
|
Cell *rp; |
Cell *rp; |
#endif |
#endif |
|
|
|
Xt *primtable(Label symbols[], Cell size) |
|
{ |
|
#ifdef DIRECT_THREADED |
|
return symbols; |
|
#else /* !defined(DIRECT_THREADED) */ |
|
Xt *xts = (Xt *)malloc(size*sizeof(Xt)); |
|
Cell i; |
|
|
|
for (i=0; i<size; i++) |
|
xts[i] = &symbols[i]; |
|
return xts; |
|
#endif /* !defined(DIRECT_THREADED) */ |
|
} |
|
|
Label *engine(Xt *ip0, Cell *sp0, Cell *rp0, Float *fp0, Address lp0) |
Label *engine(Xt *ip0, Cell *sp0, Cell *rp0, Float *fp0, Address lp0) |
/* executes code at ip, if ip!=NULL |
/* executes code at ip, if ip!=NULL |
returns array of machine code labels (for use in a loader), if ip==NULL |
returns array of machine code labels (for use in a loader), if ip==NULL |
Line 527 Label *engine(Xt *ip0, Cell *sp0, Cell *
|
Line 544 Label *engine(Xt *ip0, Cell *sp0, Cell *
|
} |
} |
NEXT; |
NEXT; |
|
|
|
#define LABEL(name) I_##name |
#include "prim.i" |
#include "prim.i" |
} |
} |