mirror of
https://github.com/nineties/planckforth
synced 2024-12-25 21:58:22 +01:00
Add 'state' variable
This commit is contained in:
parent
eb56e988e3
commit
465dcae4e4
1 changed files with 16 additions and 0 deletions
16
core.fs
16
core.fs
|
@ -313,4 +313,20 @@ cG i,
|
|||
'L, k1k0-, '+, \ add 1 to the addr (1byte for len+field)
|
||||
'a, \ align
|
||||
'e, l!
|
||||
|
||||
\ `state` variable (**The 1st multi-char word**)
|
||||
\ 0: immediate mode
|
||||
\ 1: compile mode
|
||||
h@ \ save address of cell
|
||||
k0k0-, \ allocate 1 cell and fill 0
|
||||
h@ \ save address of word
|
||||
W state \ ( cell word name u )
|
||||
l@, \ fill link
|
||||
#B \ fill length ( cell word name u )
|
||||
#{ \ preserve u
|
||||
h@~m \ fill name ( cell word )
|
||||
h@ } + h! \ restore u, increment here
|
||||
A \ align here
|
||||
i, 'L, ~, 'e, l!
|
||||
|
||||
Q
|
||||
|
|
Loading…
Reference in a new issue