diff --git a/demo/xs-lisp/Makefile.sub b/demo/xs-lisp/Makefile.sub index 2c3aa77..9457a4f 100644 --- a/demo/xs-lisp/Makefile.sub +++ b/demo/xs-lisp/Makefile.sub @@ -10,7 +10,7 @@ DEMO_XS_STACKSIZE?=$(XS_STACKSIZE) #OPTIONS=-DLISTLIB #OPTIONS= -DEMO_XS_SOURCES1=fact.lsp lib.lsp range.lsp remote.lsp rover.lsp rover-watcher.lsp trace.lsp +DEMO_XS_SOURCES1=fact.lsp hello-lisp.lsp lib.lsp range.lsp remote.lsp rover.lsp rover-watcher.lsp trace.lsp # sample.lsp is too large to build under a typical kernel configuration DEMO_XS_SOURCES=$(DEMO_XS_SOURCES1:%=demo/xs-lisp/%) DEMO_XS_PROGRAMS=$(patsubst %.lsp, %.lx, $(DEMO_XS_SOURCES)) diff --git a/demo/xs-lisp/hello-lisp.lsp b/demo/xs-lisp/hello-lisp.lsp new file mode 100644 index 0000000..dac5dde --- /dev/null +++ b/demo/xs-lisp/hello-lisp.lsp @@ -0,0 +1,28 @@ +;; The contents of this file are subject to the Mozilla Public License +;; Version 1.0 (the "License"); you may not use this file except in +;; compliance with the License. You may obtain a copy of the License at +;; http://www.mozilla.org/MPL/ +;; +;; Software distributed under the License is distributed on an "AS IS" +;; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +;; License for the specific language governing rights and limitations +;; under the License. +;; +;; Contributor(s): Matthew Sheets + +;; hello world + +(putc :char_H 4) +(putc :char_E 3) +(putc :char_Parallel 2) +(putc :char_O 1) +(sleep 1) + +(putc :char_L 4) +(putc :char_E 3) +(putc :char_G 2) +(putc :char_O 1) +(sleep 1) + +(cls) +(sleep 1) diff --git a/xs/lisp/eval.c b/xs/lisp/eval.c index 1bac72d..1c42561 100644 --- a/xs/lisp/eval.c +++ b/xs/lisp/eval.c @@ -1373,14 +1373,13 @@ object eval(object e) { } case Lputc: if (check_int_args(base)) goto LERROR; - // the second arg is between 0 (right-most) and 4 (left-most) + // the second arg is between 0 (right-most) and 4 (left-most), or 5 for the '-' spot #if ((defined(RCX) && defined(CONF_ASCII)) || (!defined(RCX))) + // TODO: If not on the RCX and CONF_ASCII is not defined, + // this value (which is the character mask), will not display the intended character cputc(INTval(e = base[0]), INTval(base[1])); #elif (defined(RCX) && defined(CONF_CONIO)) - // ASCII is not enabled on the RCX, so we cannot display the ASCII character - // Display a generic '-' in the requested position instead - e = base[0]; - cputc_native(CHAR_DASH, INTval(base[1])); + cputc_native(INTval(e = base[0]), INTval(base[1])); #endif #ifndef RCX show_lcd();