diff --git a/forth.c b/forth.c index 5ed32d2..978eb54 100644 --- a/forth.c +++ b/forth.c @@ -1,5 +1,6 @@ -#include +#include #include +#include #include #include @@ -46,7 +47,7 @@ typedef int64_t dcell_t; X("R>", OP_FROMR, DUP; tos = *rp--) \ X("R@", OP_RAT, DUP; tos = *rp) \ X("CELL", OP_CELL, DUP; tos = sizeof(cell_t)) \ - X(".", OP_DOT, printf("%d ", (int) tos); DROP) \ + X(".", OP_DOT, printf("%"PRIiPTR" ", tos); DROP) \ X("TYPE", OP_TYPE, fwrite((void *) *sp, 1, tos, stdout); DROP; DROP) \ X("KEY", OP_KEY, DUP; tos = fgetc(stdin)) \ X("SYSEXIT", OP_SYSEXIT, DUP; exit(tos)) \ @@ -193,7 +194,7 @@ static const char boot[] = " : exit= ( xt -- ) ['] exit = ; " " : see-loop >body begin see-one dup @ exit= until ; " " : see cr ['] : see. ' dup see. see-loop drop ['] ; see. cr ; " -" : words last @ begin dup >name type space >link dup 0= until drop cr ; " +" : words last @ begin dup see. >link dup 0= until drop cr ; " // ( Printing ) " : $. r@ dup cell+ swap @ type r> dup @ aligned + cell+ >r ; "