From 5942192ada2d93d8b6ef2a77b5a91bfbb10a9453 Mon Sep 17 00:00:00 2001 From: Koichi Nakamura Date: Sun, 10 Jan 2021 00:00:18 +0900 Subject: [PATCH] Update welcome message --- README.md | 2 +- bootstrap.fs | 4 +++- others/planck.c | 4 ++-- others/planck.py | 8 ++++---- planck.xxd | 14 ++++++-------- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 84abdf8..ea489c8 100644 --- a/README.md +++ b/README.md @@ -86,4 +86,4 @@ $ ./planck < bootstrap.fs --i386-linux example/fib.fs | < | less | ( a b -- c ) | c = (a < b) | | = | equal | ( a b -- c ) | c = (a == b) | | v | argv | ( -- a-addr u ) | argv and argc | -| V | version | ( -- c-addr ) | Version string +| V | impl | ( -- c-addr ) | Implementation String | diff --git a/bootstrap.fs b/bootstrap.fs index cbe8f27..7d360d8 100644 --- a/bootstrap.fs +++ b/bootstrap.fs @@ -453,6 +453,7 @@ alias-builtin mod % alias-builtin and & alias-builtin or | alias-builtin xor ^ +alias-builtin implementation V \ Rename existing FORTH words : word W ; @@ -2422,7 +2423,7 @@ need-defined (read) words id. name>string name>link include included - next-arg shift-args arg argv argc + next-arg shift-args arg argv argc implementation [if] [unless] [else] [then] defined? open-file close-file write-file flush-file @@ -2477,6 +2478,7 @@ need-defined (read) next-arg dup argv @ ! included else + ." PlanckForth (implementation: " implementation type ." )" cr ." Ready." cr s" /dev/tty" included then diff --git a/others/planck.c b/others/planck.c index e8a0f5c..8b22273 100644 --- a/others/planck.c +++ b/others/planck.c @@ -13,7 +13,7 @@ #include #include -#define VERSION "C implementation" +#define IMPLEMENTATION "C" typedef uintptr_t cell; typedef void (**cfa)(); @@ -143,7 +143,7 @@ defcode("t", type) { putchar(pop()); next(); } defcode("x", exec) { (*(ip = (cfa) pop()))(); } defcode("f", find_) { push((cell) find(pop())); next(); } defcode("v", argv_) { push((cell) saved_argv); push(saved_argc); next(); } -defcode("V", version) { push((cell) VERSION); next(); } +defcode("V", impl) { push((cell) IMPLEMENTATION); next(); } #define defbinary(name, label, op, ty) \ defcode(name, label) { \ ty b = (ty) pop(); \ diff --git a/others/planck.py b/others/planck.py index 4dbf74f..df061f3 100644 --- a/others/planck.py +++ b/others/planck.py @@ -7,7 +7,7 @@ import os import sys import operator -VERSION = "Python 3.x implementation" +IMPLEMENTATION = "Python 3.x" MEMORY_SIZE = 0x20000 STACK_SIZE = 0x400 RSTACK_SIZE = 0x400 @@ -158,8 +158,8 @@ for addr in argv_addrs: comma(addr) # Version String -VERSION_ADDR = read(HERE_CELL) -comma_string(VERSION) +IMPLEMENTATION_ADDR = read(HERE_CELL) +comma_string(IMPLEMENTATION) align() def docol(ip, np): @@ -223,7 +223,7 @@ def argv(): push(ARGV_ADDR) push(len(sys.argv)) add_simple_operator('v', argv) -add_simple_operator('V', lambda: push(VERSION_ADDR)) +add_simple_operator('V', lambda: push(IMPLEMENTATION_ADDR)) SUCCESS = 0 ALLOCATE_ERROR = -59 diff --git a/planck.xxd b/planck.xxd index a798566..8bf3da5 100644 --- a/planck.xxd +++ b/planck.xxd @@ -6,10 +6,10 @@ 00000028: 3400 2000 0100 0000 e_ehsize,e_phentsize,e_phnum,e_shentsize 00000030: 0000 0000 0100 0000 e_shnum,e_shstrndx,p_type=PT_LOAD 00000038: 0000 0000 0080 0408 p_offset,p_vaddr=0x08048000 -00000040: 0000 0000 d003 0000 p_paddr,p_filesz +00000040: 0000 0000 c003 0000 p_paddr,p_filesz 00000048: 0000 2000 0700 0000 p_memsz(128KB),p_flags=PF_X|PF_W|PF_R -00000050: 0010 0000 d083 0408 p_align, -00000058: 9483 0408 0000 0000 , +00000050: 0010 0000 c083 0408 p_align, +00000058: 9483 0408 0000 0000 , 00000060: e480 0408 5c81 0408 key, find 00000068: 8881 0408 3081 0408 execute, jump 00000070: f0ff ffff be60 8004 -16, movl $interpreter, %esi @@ -157,11 +157,9 @@ 00000384: 0408 89c3 83c3 0453 movl %eax,%ebx; addl $4,%ebx; pushl %ebx 0000038c: ff30 adff 2000 0000 pushl (%eax); next; -00000394: 7483 0408 0156 0000 V: version -0000039c: 8083 0408 68a8 8304 pushl $version +00000394: 7483 0408 0156 0000 V: implementation +0000039c: a083 0408 68a8 8304 pushl $version 000003a4: 08ad ff20 6861 6e64 next; hand 000003ac: 2d77 7269 7474 656e -written 000003b4: 2069 3338 362d 6c69 i386-li -000003bc: 6e75 7820 696d 706c nux impl -000003c4: 656d 656e 7461 7469 ementati -000003cc: 6f6e 0000 on +000003bc: 6e75 7800 nux