summaryrefslogtreecommitdiff
path: root/nuttx/configs/sim
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-11-11 09:36:33 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-11-11 09:36:33 -0600
commit3da8039196142eec07174a38f11c460ab22f952d (patch)
tree52f6a52c9db5d729bf03693b88f74c1fe4a074ab /nuttx/configs/sim
parenteaedb099b2a38a2c8e13bb8fb8c29648949ee7eb (diff)
downloadnuttx-3da8039196142eec07174a38f11c460ab22f952d.tar.gz
nuttx-3da8039196142eec07174a38f11c460ab22f952d.tar.bz2
nuttx-3da8039196142eec07174a38f11c460ab22f952d.zip
Update README files
Diffstat (limited to 'nuttx/configs/sim')
-rw-r--r--nuttx/configs/sim/README.txt91
1 files changed, 91 insertions, 0 deletions
diff --git a/nuttx/configs/sim/README.txt b/nuttx/configs/sim/README.txt
index 9db5ff534..b0f09e3b1 100644
--- a/nuttx/configs/sim/README.txt
+++ b/nuttx/configs/sim/README.txt
@@ -14,6 +14,7 @@ Contents
- Stack Size Issues
- Networking Issues
- X11 Issues
+ o BASIC
o Configurations
Overview
@@ -166,6 +167,96 @@ XOpenDisplay() aborted the program. UPDATE: This was caused by the small stack
size and can be fixed by increasing the size of the NuttX stack that calls into
X11. See the discussion "Stack Size Issues" above.
+BASIC
+^^^^^
+
+BASIC
+=====
+ I have used the sim/nsh configuration to test Michael Haardt's BASIC interpreter
+ that you can find at apps/interpreters/bas.
+
+ Bas is an interpreter for the classic dialect of the programming language
+ BASIC. It is pretty compatible to typical BASIC interpreters of the 1980s,
+ unlike some other UNIX BASIC interpreters, that implement a different
+ syntax, breaking compatibility to existing programs. Bas offers many ANSI
+ BASIC statements for structured programming, such as procedures, local
+ variables and various loop types. Further there are matrix operations,
+ automatic LIST indentation and many statements and functions found in
+ specific classic dialects. Line numbers are not required.
+
+ There is also a test suite for the interpreter that can be found at
+ apps/examples/bastest.
+
+ Configuration
+ -------------
+ Below are the recommended configuration changes to use BAS with the
+ stm32f4discovery/nsh configuration:
+
+ Dependencies:
+ CONFIG_LIBC_EXECFUNCS=y : exec*() functions are required
+ CONFIG_LIBM=y : Some floating point library is required
+ CONFIG_LIBC_FLOATINGPOINT=y : Floating point printing support is required
+ CONFIG_LIBC_TMPDIR="/tmp" : Writable temporary files needed for some commands
+
+ Enable the BASIC interpreter. Other default options should be okay:
+ CONFIG_INTERPRETERS_BAS=y : Enables the interpreter
+ CONFIG_INTERPREPTER_BAS_VT100=y
+
+ The BASIC test suite can be included:
+ CONFIG_FS_ROMFS=y : ROMFS support is needed
+ CONFIG_EXAMPLES_BASTEST=y : Enables the BASIC test setup
+ CONFIG_EXAMPLES_BASTEST_DEVMINOR=6
+ CONFIG_EXAMPLES_BASTEST_DEVPATH="/dev/ram6"
+
+ Usage
+ -----
+ This setup will initialize the BASIC test (optional): This will mount
+ a ROMFS file system at /mnt/romfs that contains the BASIC test files:
+
+ nsh> bastest
+ Registering romdisk at /dev/ram6
+ Mounting ROMFS filesystem at target=/mnt/romfs with source=/dev/ram6
+ nsh>
+
+ The interactive interpreter is started like:
+
+ nsh> bas
+ bas 2.4
+ Copyright 1999-2014 Michael Haardt.
+ This is free software with ABSOLUTELY NO WARRANTY.
+ >
+
+ Ctrl-D exits the interpreter.
+
+ The test programs can be ran like this:
+
+ nsh> bastest
+ Registering romdisk at /dev/ram0
+ Mounting ROMFS filesystem at target=/mnt/romfs with source=/dev/ram0
+ nsh> bas /mnt/romfs/test01.bas
+ 1
+ hello
+ 0.0002
+ 0.0000020
+ 0.0000002
+
+ nsh>
+
+ Or you can load a test into memory and execute it interactively:
+
+ nsh> bas
+ bas 2.4
+ Copyright 1999-2014 Michael Haardt.
+ This is free software with ABSOLUTELY NO WARRANTY.
+ > load "/mnt/romfs/test01.bas"
+ > run
+ 1
+ hello
+ 0.0002
+ 0.0000020
+ 0.0000002
+ >
+
Configurations
^^^^^^^^^^^^^^