-
-
Save TG9541/1a903be6589147391eb518c165d8f33f to your computer and use it in GitHub Desktop.
Make local echo in STM8 eForth optional
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\ 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