1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-27 12:48:07 +11:00

Add word "EMPTY"

This commit is contained in:
Virgil Dupras 2020-04-14 16:07:07 -04:00
parent add3b6629b
commit a67101fb8b
6 changed files with 18 additions and 10 deletions

View File

@ -12,5 +12,5 @@ ALLOT n -- Move HERE by n bytes
C, b -- Write byte b in HERE and advance it.
DELW a -- Delete wordref at a. If it shadows another
definition, that definition is unshadowed.
FORGET x -- Rewind the dictionary (both CURRENT and HERE)
up to x's previous entry. (cont.)
EMPTY -- Rewind HERE and CURRENT where they were at
system initialization. (cont.)

View File

@ -1,5 +1,6 @@
(cont.)
PREV a -- a Return a wordref's previous entry.
WHLEN a -- n Get word header length from
wordref. That is, name length + 3.
a is a wordref
FORGET x -- Rewind the dictionary (both CURRENT and HERE)
up to x's previous entry.
PREV a -- a Return a wordref's previous entry.
WHLEN a -- n Get word header length from wordref. That is,
name length + 3. a is a wordref

View File

@ -11,5 +11,6 @@
['] EFS@ BLK@* !
RDLN$
Z80A$
LIT< _sys [entry]
INTERPRET
;

Binary file not shown.

View File

@ -144,3 +144,8 @@
DUP WHLEN - HERE ! ( w )
PREV CURRENT !
;
: EMPTY
LIT< _sys (find) NOT IF ABORT THEN
DUP HERE ! CURRENT !
;

View File

@ -146,10 +146,9 @@
AGAIN
;
: (entry)
HERE @ ( h )
WORD ( h s )
SCPY ( h )
: [entry]
HERE @ ( w h )
SWAP SCPY ( h )
( Adjust HERE -1 because SCPY copies the null )
HERE @ 1 - ( h h' )
DUP HERE ! ( h h' )
@ -161,6 +160,8 @@
HERE @ CURRENT !
;
: (entry) WORD [entry] ;
: INTERPRET
BEGIN
WORD