1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-24 14:38:05 +11:00

forth: Forth-ify "DROP"

This commit is contained in:
Virgil Dupras 2020-03-30 13:57:06 -04:00
parent 49994f09ce
commit f9c3a0444c
4 changed files with 12 additions and 15 deletions

Binary file not shown.

View File

@ -869,18 +869,10 @@ FETCH:
push hl
jp next
; ( a -- )
.db "DROP"
.dw $-FETCH
.db 4
; STABLE ABI
DROP:
.dw nativeWord
pop hl
jp next
.fill 13
.db "_bend"
.dw $-DROP
.dw $-FETCH
.db 5
; Offset: 0647
.out $

View File

@ -57,7 +57,7 @@
: QUIT
0 FLAGS ! _c (resRS)
LIT< INTERPRET (find) DROP EXECUTE
LIT< INTERPRET (find) _c DROP EXECUTE
;
: ABORT _c (resSP) _c QUIT ;
@ -101,7 +101,7 @@
: TOWORD
BEGIN
_c C< _c DUP _c WS? NOT IF EXIT THEN DROP
_c C< _c DUP _c WS? NOT IF EXIT THEN _c DROP
AGAIN
;
@ -155,10 +155,10 @@
;
: BOOT
LIT< (c<) (find) NOT IF LIT< KEY (find) DROP THEN
LIT< (c<) (find) NOT IF LIT< KEY (find) _c DROP THEN
( JTBL+40 == CINPTR )
[ JTBL 40 + @ LITN ] !
LIT< (c<$) (find) IF EXECUTE ELSE DROP THEN
LIT< (c<$) (find) IF EXECUTE ELSE _c DROP THEN
_c INTERPRET
;
@ -191,7 +191,7 @@
: Y
['] EXIT ,
_c R> DROP ( exit : )
_c R> _c DROP ( exit : )
; IMMEDIATE
( Give ":" and ";" their real name )

View File

@ -39,6 +39,11 @@ CODE DUP
HL PUSHqq, ( A )
;CODE
( a -- )
CODE DROP
HL POPqq,
;CODE
( a b -- b a )
CODE SWAP
HL POPqq, ( B )