Skip to content

Instantly share code, notes, and snippets.

@TG9541
Created February 3, 2018 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TG9541/1a903be6589147391eb518c165d8f33f to your computer and use it in GitHub Desktop.
Save TG9541/1a903be6589147391eb518c165d8f33f to your computer and use it in GitHub Desktop.
Make local echo in STM8 eForth optional
\ STM8 eForth ECHO
\ Make local echo in STM8 eForth optional
\ Note1: since this code patches TAP, and sets the startup word,
\ it should be loaded with #require ECHO
\ Note2: the RAM address of variable TAPECHO must be below 0x0100,
\ it's recommended to #require ECHO early on in the main file
\ Note3: this file sets the 'BOOT vector for initializing TAPECHO -
\ any startup code must execute this task!
#require TAP
#require 'PROMPT
#require .OK
#require HI
NVM
VARIABLE TAPECHO
: ECHO ( f -- )
\ turn on (true), or off (false) interpreter echo
( f ) IF
[ ' TX! ] LITERAL TAPECHO !
[ ' .OK ] LITERAL 'PROMPT !
ELSE
[ ' DROP ] LITERAL TAPECHO !
[ ' CR ] LITERAL 'PROMPT !
THEN
;
\ Initialize ECHO
-1 ECHO
\ patch TAP
TAPECHO ' TAP 5 + C!
: START ( -- )
\ code for initializing TAPECHO
0 ECHO
\ HI
;
\ set 'BOOT to startup code
' START 'BOOT !
RAM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment