From: Tim Vaughan Date: Sun, 24 Apr 2016 07:37:45 +0000 (+1200) Subject: Exposed debug functions as forth words. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=dc0a7162eafa10b09a028ce4a878366e4cc58d8c;p=forth.jl.git Exposed debug functions as forth words. --- diff --git a/src/forth.jl b/src/forth.jl index b1a78f3..ea849cd 100644 --- a/src/forth.jl +++ b/src/forth.jl @@ -1017,4 +1017,23 @@ function printRS() end end +DOT = defPrimWord(".", () -> begin + print(popPS()) + return NEXT +end) + +DOTS = defPrimWord(".s", () -> begin + printPS() + return NEXT +end) + +DUMP = defPrimWord("DUMP", () -> begin + count = popPS() + addr = popPS() + + dump(addr, count=count) + + return NEXT +end) + end diff --git a/src/lib.fs b/src/lib.fs index daaa80c..f4883c5 100644 --- a/src/lib.fs +++ b/src/lib.fs @@ -15,5 +15,5 @@ : LITERAL IMMEDIATE ' LIT , , ; -: ':' [ CHAR : ] ; +: ':' [ CHAR : ] LITERAL ;