Drop more stdlib things.
This commit is contained in:
@ -27,7 +27,9 @@ STRIP_ARGS = -S \
|
||||
--remove-section=.note.ABI-tag
|
||||
LIBS=-ldl
|
||||
|
||||
WINFLAGS = -mwindows -luser32
|
||||
WINFLAGS = -ffreestanding -fno-stack-check \
|
||||
-fno-stack-protector -mno-stack-arg-probe \
|
||||
-mwindows -lkernel32
|
||||
|
||||
# Default to 32-bit Windows for maximum portability.
|
||||
ifeq ($(WIN_ARCH),)
|
||||
@ -201,7 +203,7 @@ $(DEPLOY)/app.yaml: $(ARDUINO)/ueforth-arduino-esp32.zip \
|
||||
mkdir -p $(DEPLOY)/static
|
||||
cp -r $(ARDUINO)/ueforth-arduino-esp32.zip $(DEPLOY)/static
|
||||
cp -r $(POSIX)/ueforth $(DEPLOY)/static/ueforth.linux
|
||||
cp -r $(WINDOWS)/uEforth.exe $(DEPLOY)/static
|
||||
cp -r $(WINDOWS)/uEforth.exe $(DEPLOY)/static/ueforth.windows
|
||||
cp -r $(RES)/eforth.ico $(DEPLOY)/static/favicon.ico
|
||||
cp -r site/* $(DEPLOY)
|
||||
|
||||
|
||||
@ -163,6 +163,10 @@ variable hld
|
||||
: s>z ( a n -- z ) here >r $place r> ;
|
||||
: z>s ( z -- a n ) 0 over begin dup c@ while 1+ swap 1+ swap repeat drop ;
|
||||
|
||||
( Fill, Move )
|
||||
: cmove ( a a n -- ) for aft >r dup c@ r@ c! 1+ r> 1+ then next 2drop ;
|
||||
: fill ( a a n -- ) swap for swap aft 2dup c! 1 + then next 2drop ;
|
||||
|
||||
( Better Errors )
|
||||
: notfound ( a n n -- )
|
||||
if cr ." ERROR: " type ." NOT FOUND!" cr -1 throw then ;
|
||||
|
||||
@ -59,7 +59,8 @@ static cell_t find(const char *name, cell_t len) {
|
||||
}
|
||||
|
||||
static void create(const char *name, cell_t length, cell_t flags, void *op) {
|
||||
memcpy(g_sys.heap, name, length); // name
|
||||
char *pos = (char *) g_sys.heap;
|
||||
for (cell_t n = length; n; --n) { *pos++ = *name++; } // name
|
||||
g_sys.heap += CELL_LEN(length);
|
||||
*g_sys.heap++ = length; // length
|
||||
*g_sys.heap++ = (cell_t) g_sys.last; // link
|
||||
@ -141,11 +142,11 @@ static void ueforth_run() {
|
||||
|
||||
static void ueforth(int argc, char *argv[], void *heap,
|
||||
const char *src, cell_t src_len) {
|
||||
memset(&g_sys, 0, sizeof(g_sys));
|
||||
g_sys.heap = (cell_t *) heap;
|
||||
g_sys.ip = 0;
|
||||
g_sys.heap = (cell_t *) heap + 4; // Leave a little room.
|
||||
ueforth_run();
|
||||
g_sys.sp = g_sys.heap + sizeof(cell_t); g_sys.heap += STACK_SIZE;
|
||||
g_sys.rp = g_sys.heap; g_sys.heap += STACK_SIZE;
|
||||
g_sys.sp = g_sys.heap + 1; g_sys.heap += STACK_SIZE;
|
||||
g_sys.rp = g_sys.heap + 1; g_sys.heap += STACK_SIZE;
|
||||
g_sys.last[-1] = 1; // Make ; IMMEDIATE
|
||||
g_sys.DOLIT_XT = FIND("DOLIT");
|
||||
g_sys.DOEXIT_XT = FIND("EXIT");
|
||||
|
||||
@ -46,8 +46,6 @@ typedef uint64_t udcell_t;
|
||||
X("!", STORE, *(cell_t *) tos = (*sp)|0; --sp; DROP) \
|
||||
X("L!", LSTORE, *(int32_t *) tos = (*sp)|0; --sp; DROP) \
|
||||
X("C!", CSTORE, *(uint8_t *) tos = (*sp)|0; --sp; DROP) \
|
||||
X("FILL", FILL, memset((void *) (sp[-1] | 0), tos | 0, (*sp | 0)); sp -= 2; DROP) \
|
||||
X("MOVE", MOVE, memmove((void *) (sp[-1] | 0), (void *) (*sp | 0), tos | 0); sp -= 2; DROP) \
|
||||
X("SP@", SPAT, DUP; tos = (cell_t) sp) \
|
||||
X("SP!", SPSTORE, sp = (cell_t *) tos; DROP) \
|
||||
X("RP@", RPAT, DUP; tos = (cell_t) rp) \
|
||||
|
||||
@ -18,6 +18,11 @@ handlers:
|
||||
upload: static/index.html
|
||||
secure: always
|
||||
|
||||
- url: /static/uEforth.exe
|
||||
static_files: static/ueforth.windows
|
||||
upload: static/ueforth.windows
|
||||
secure: always
|
||||
|
||||
- url: /static
|
||||
static_dir: static
|
||||
secure: always
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
#include "common/calling.h"
|
||||
|
||||
#define HEAP_SIZE (10 * 1024 * 1024)
|
||||
#define STACK_SIZE (16 * 1024)
|
||||
#define STACK_SIZE (64 * 1024)
|
||||
|
||||
#define PLATFORM_OPCODE_LIST \
|
||||
X("GETPROCADDRESS", GETPROCADDRESS, \
|
||||
|
||||
Reference in New Issue
Block a user