diff --git a/README.md b/README.md index 7f98d08..386908d 100644 --- a/README.md +++ b/README.md @@ -6,16 +6,16 @@ STM8 eForth is an interactive Forth system for the full range of [STM8 8-bit MCU The original STM8 eForth was written by [Dr. C.H. Ting's eForth](http://www.forth.org/svfig/kk/07-2010.html) for the STM8S Discovery. With the kind permission of Dr. Ting the code presented here is under [MIT license](https://github.com/TG9541/stm8ef/blob/master/LICENSE.md). Bugs were fixed, code size reduced, standards compatibility improved and many features were added (e.g. compilation to Flash memory, autostart code, interrupt handling - see [overview](https://github.com/TG9541/stm8ef#stm8-eforth-feature-overview)). -The [binary release](https://github.com/TG9541/stm8ef/releases) provides ready-to-run Forth binaries for a range of target boards or devicesi, a library and STM8 register definitions. Build and test automation in the [uCsim STM8 simulator](https://travis-ci.org/TG9541/stm8ef) in Travis-CI provides is used for quality control. Binary releases also contain the tested source code of STM8 eForth core and libraries so that downstream projectes can use the [modular build support](https://github.com/TG9541/stm8ef-modular-build) to add new targets with specific hardware support, memory layout or a tailored vocabulary. +The [binary release](https://github.com/TG9541/stm8ef/releases) provides ready-to-run Forth binaries for a range of target boards or devices, a library and STM8 register definitions. Build and test automation in the [uCsim STM8 simulator](https://travis-ci.org/TG9541/stm8ef) in Travis-CI provides is used for quality control. Binary releases also contain the tested source code of STM8 eForth core and libraries so that downstream projectes can use the [modular build support](https://github.com/TG9541/stm8ef-modular-build) to add new targets with specific hardware support, memory layout or a tailored vocabulary. [![STM8EF Wiki](https://user-images.githubusercontent.com/5466977/28994765-3267d78c-79d6-11e7-927f-91751cd402db.jpg)](https://github.com/TG9541/stm8ef/wiki) ## About Forth -Forth works by defining new words with phrases of existing words - "Hello World" in Forth is this: +Forth works by defining new words with "phrases" consisting of existing words - "Hello World" in Forth is this: ```Forth -: hello ." Hello World!" ; +: hello ." Hello World!" ; ``` Forth is a "low level" language that offers a high level of abstraction: @@ -32,7 +32,7 @@ Forth is so simple that you can learn the basics in a snap, e.g. in the [STM8 eF STM8 eForth itself is coded in STM8 assembler but it uses the SDCC tool chain. Combining Forth with C is possible. -STM8 eForth is highly configurable: a Forth binary that allows compiling new words to Flash fits in 4 to 5.5K ROM (a minimal interactive system fits in 3.5K). Due to the extraordinary code density a very-low-cost 8K device, e.g. [STM8S003F3P6](https://www.st.com/resource/en/datasheet/stm8s003f3.pdf) or [STM8L051F3P6](https://www.st.com/resource/en/datasheet/stm8l051F3.pdf) has sufficent space for non-trivial applications. If more is needed, low-cost 32K devices with many GPIOs or a richer set of peripherals can be used, e.g. [STM8S005C6](https://www.st.com/resource/en/datasheet/stm8s005c6.pdf) or [STM8L052C6](https://www.st.com/resource/en/datasheet/stm8l052c6.pdf). +STM8 eForth is highly configurable: a Forth binary that allows compiling new words to Flash ROM or RAM requires less than 4K. A binary with an extended vocabulary needs no more than about 5.5K. Due to the extraordinary code density a very-low-cost 8K device, e.g. [STM8S003F3P6](https://www.st.com/resource/en/datasheet/stm8s003f3.pdf) or [STM8L051F3P6](https://www.st.com/resource/en/datasheet/stm8l051F3.pdf) has sufficent space for non-trivial applications. If more is needed a low-cost 32K device with a rich set of peripherals can be used, e.g. [STM8S005C6](https://www.st.com/resource/en/datasheet/stm8s005c6.pdf) or [STM8L052C6](https://www.st.com/resource/en/datasheet/stm8l052c6.pdf). The Forth console uses the STM8 U(S)ART or a simulated serial interface for communicating with the console (3-wire full-duplex or 2-wire half-duplex are supported). For console access and programming [e4thcom](https://wiki.forth-ev.de/doku.php/en:projects:e4thcom) is recommended but any serial terminal will work. The console can be configured, even at runtime, to use other types of [character I/O](https://github.com/TG9541/stm8ef/wiki/STM8-eForth-Board-Character-IO), e.g. keyboard and display. diff --git a/docs/words.md b/docs/words.md index eed6f4c..402d9a5 100644 --- a/docs/words.md +++ b/docs/words.md @@ -895,6 +895,16 @@ ; this should be sufficent to replace COMPILE and [COMPILE] ``` +``` +; COMPILE ( -- ) +; Ersatz using POSTPONE +``` + +``` +; [COMPILE] ( -- ) +; Ersatz using POSTPONE +``` + ``` ; , ( w -- ) ; Compile an integer into @@ -906,6 +916,12 @@ ; Compile a byte into code dictionary. ``` +``` +; A, ( A -- ) +; Compile a byte in A into code dictionary. +; GENALIAS ACOMMA "A," +``` + ``` ; CALL, ( ca -- ) ; Compile a subroutine call. @@ -968,6 +984,12 @@ ; indefinite loop structure. ``` +``` +; COMPILIT ( -- ) +; Compile call to inline literall target address into code dictionary. +; GENALIAS COMPILIT "COMPILIT" +``` + ``` ; AGAIN ( a -- ) ; Terminate a BEGIN-AGAIN diff --git a/inc/bgtask.inc b/inc/bgtask.inc index fbf52ea..0335c9c 100644 --- a/inc/bgtask.inc +++ b/inc/bgtask.inc @@ -11,8 +11,6 @@ .ifne HAS_BACKGROUND RamWord BGADDR ; address of background routine (0: off) RamWord TICKCNT ; "TICKCNT" 16 bit ticker (counts up) - - BSPPSIZE = BG_STACKSIZE ; Size of data stack for background tasks .endif ;****** timer macro ****** diff --git a/inc/defconf.inc b/inc/defconf.inc index d525dc9..5bf98e8 100644 --- a/inc/defconf.inc +++ b/inc/defconf.inc @@ -4,7 +4,7 @@ ;-------------------------------------------------------- RELVER1 = 2 ; Revision digit 1 RELVER0 = 8 ; Revision digit 0 - PRE_REL = 1 ; Pre Release digit 0 (0: release) + PRE_REL = 0 ; Pre Release digit 0 (0: release) TERM_LINUX = 1 ; LF terminates line @@ -41,8 +41,7 @@ BG_USE_TIM3 = 0 ; Use TIM3 for the Background Task (instead of TIM2) BG_TIM_REL = 0x26DE ; Reload value for Background Task timer (default for 5ms @ HSI 16MHz/8) BG_RUNMASK = 0 ; BG task runs if "(BG_RUNMASK AND TICKCNT) equals 0" - BG_STACKSIZE = 32 ; Default size in bytes of data stack for background tasks - BSPPSIZE = 0 ; BG task data stack size (bytes) for memory calculation + BSPPSIZE = 32 ; Default size in bytes of data stack for background tasks HAS_CPNVM = 0 ; Can compile to Flash, always interpret to RAM HAS_DOES = 0 ; DOES> extension