Skip to content

Commit dde829e

Browse files
authored
Merge pull request #425 from TG9541/standard
Standard
2 parents 94d0063 + 349a14c commit dde829e

File tree

4 files changed

+28
-9
lines changed

4 files changed

+28
-9
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ STM8 eForth is an interactive Forth system for the full range of [STM8 8-bit MCU
66

77
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)).
88

9-
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.
9+
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.
1010

1111
[![STM8EF Wiki](https://user-images.githubusercontent.com/5466977/28994765-3267d78c-79d6-11e7-927f-91751cd402db.jpg)](https://github.com/TG9541/stm8ef/wiki)
1212

1313
## About Forth
1414

15-
Forth works by defining new words with phrases of existing words - "Hello World" in Forth is this:
15+
Forth works by defining new words with "phrases" consisting of existing words - "Hello World" in Forth is this:
1616

1717
```Forth
18-
: hello ." Hello World!" ;
18+
: hello ." Hello World!" ;
1919
```
2020

2121
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
3232

3333
STM8 eForth itself is coded in STM8 assembler but it uses the SDCC tool chain. Combining Forth with C is possible.
3434

35-
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).
35+
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).
3636

3737
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.
3838

docs/words.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,16 @@
895895
; this should be sufficent to replace COMPILE and [COMPILE]
896896
```
897897

898+
```
899+
; COMPILE ( -- )
900+
; Ersatz using POSTPONE
901+
```
902+
903+
```
904+
; [COMPILE] ( -- )
905+
; Ersatz using POSTPONE
906+
```
907+
898908
```
899909
; , ( w -- )
900910
; Compile an integer into
@@ -906,6 +916,12 @@
906916
; Compile a byte into code dictionary.
907917
```
908918

919+
```
920+
; A, ( A -- )
921+
; Compile a byte in A into code dictionary.
922+
; GENALIAS ACOMMA "A,"
923+
```
924+
909925
```
910926
; CALL, ( ca -- )
911927
; Compile a subroutine call.
@@ -968,6 +984,12 @@
968984
; indefinite loop structure.
969985
```
970986

987+
```
988+
; COMPILIT ( -- )
989+
; Compile call to inline literall target address into code dictionary.
990+
; GENALIAS COMPILIT "COMPILIT"
991+
```
992+
971993
```
972994
; AGAIN ( a -- )
973995
; Terminate a BEGIN-AGAIN

inc/bgtask.inc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
.ifne HAS_BACKGROUND
1212
RamWord BGADDR ; address of background routine (0: off)
1313
RamWord TICKCNT ; "TICKCNT" 16 bit ticker (counts up)
14-
15-
BSPPSIZE = BG_STACKSIZE ; Size of data stack for background tasks
1614
.endif
1715

1816
;****** timer macro ******

inc/defconf.inc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
;--------------------------------------------------------
55
RELVER1 = 2 ; Revision digit 1
66
RELVER0 = 8 ; Revision digit 0
7-
PRE_REL = 1 ; Pre Release digit 0 (0: release)
7+
PRE_REL = 0 ; Pre Release digit 0 (0: release)
88

99
TERM_LINUX = 1 ; LF terminates line
1010

@@ -41,8 +41,7 @@
4141
BG_USE_TIM3 = 0 ; Use TIM3 for the Background Task (instead of TIM2)
4242
BG_TIM_REL = 0x26DE ; Reload value for Background Task timer (default for 5ms @ HSI 16MHz/8)
4343
BG_RUNMASK = 0 ; BG task runs if "(BG_RUNMASK AND TICKCNT) equals 0"
44-
BG_STACKSIZE = 32 ; Default size in bytes of data stack for background tasks
45-
BSPPSIZE = 0 ; BG task data stack size (bytes) for memory calculation
44+
BSPPSIZE = 32 ; Default size in bytes of data stack for background tasks
4645

4746
HAS_CPNVM = 0 ; Can compile to Flash, always interpret to RAM
4847
HAS_DOES = 0 ; DOES> extension

0 commit comments

Comments
 (0)