mirror of
https://github.com/nineties/planckforth
synced 2024-12-26 21:58:42 +01:00
Redefine TICK
This commit is contained in:
parent
38ef3ef9fc
commit
c4d99e739a
1 changed files with 19 additions and 8 deletions
27
core.fs
27
core.fs
|
@ -336,8 +336,22 @@ I \ Enter 2nd Stage
|
||||||
|
|
||||||
r C + R \ Drop 1st stage interpreter from call stack
|
r C + R \ Drop 1st stage interpreter from call stack
|
||||||
|
|
||||||
|
\ '\'' ( "name" -- xt )
|
||||||
|
\ Redefine existing '\'' which uses 'k' and 'f'
|
||||||
|
\ to use 'W' and 'F'.
|
||||||
|
c ' i , ' W , ' F , ' G , ' e , l !
|
||||||
|
|
||||||
\ : ( "<spaces>name" -- R:w ) COLON
|
\ [ immediate ( -- )
|
||||||
|
\ Switch to immediate mode
|
||||||
|
c [ i , ' L , k 0 k 0 - , ' M , ' ! , ' e , l !
|
||||||
|
\ Toggle immediate-bit of [
|
||||||
|
l @ C + # { ? k @ k @ + | } $
|
||||||
|
|
||||||
|
\ ] ( -- )
|
||||||
|
\ Switch to compile mode
|
||||||
|
c ] i , ' L , k 1 k 0 - , ' M , ' ! , ' e , l !
|
||||||
|
|
||||||
|
\ : ( "name" -- R:w ) COLON
|
||||||
\ Read name, create word, push it to return stack,
|
\ Read name, create word, push it to return stack,
|
||||||
\ compile 'docol' and enter compile mode.
|
\ compile 'docol' and enter compile mode.
|
||||||
c : i ,
|
c : i ,
|
||||||
|
@ -352,8 +366,7 @@ c : i ,
|
||||||
' m , \ fill name
|
' m , \ fill name
|
||||||
' A , \ align here
|
' A , \ align here
|
||||||
' i , ' , , \ compile docol
|
' i , ' , , \ compile docol
|
||||||
\ enter compile mode
|
' ] , \ enter compile mode
|
||||||
' L , k 1 k 0 - , ' M , ' ! ,
|
|
||||||
' e , l !
|
' e , l !
|
||||||
|
|
||||||
\ ; immediate ( R:w -- ) SEMICOLON
|
\ ; immediate ( R:w -- ) SEMICOLON
|
||||||
|
@ -362,11 +375,9 @@ c ; i ,
|
||||||
' L , ' e , ' , , \ compile exit
|
' L , ' e , ' , , \ compile exit
|
||||||
|
|
||||||
\ pick 2nd element of return stack
|
\ pick 2nd element of return stack
|
||||||
' } , ' } , ' ~ , ' { ,
|
' } , ' } , ' ~ , ' { ,
|
||||||
' l , ' ! , \ update latest
|
' l , ' ! , \ update latest
|
||||||
|
' [ , \ enter immediate mode
|
||||||
\ enter immediate mode
|
|
||||||
' L , k 0 k 0 - , ' M , ' ! ,
|
|
||||||
' e , l !
|
' e , l !
|
||||||
\ Toggle immediate-bit of ';'
|
\ Toggle immediate-bit of ';'
|
||||||
l @ C + # { ? k @ k @ + | } $
|
l @ C + # { ? k @ k @ + | } $
|
||||||
|
|
Loading…
Reference in a new issue