mirror of
https://github.com/hsoft/collapseos.git
synced 2025-02-19 03:56:01 +11:00
forth: Forth-ify "LITN"
This commit is contained in:
parent
1227ee7155
commit
758ec025dc
Binary file not shown.
@ -714,25 +714,10 @@ DOES:
|
|||||||
jp EXIT+2
|
jp EXIT+2
|
||||||
|
|
||||||
|
|
||||||
.fill 51
|
.fill 82
|
||||||
|
|
||||||
; ( n -- )
|
|
||||||
.db "LITN"
|
|
||||||
.dw $-DOES
|
|
||||||
.db 4
|
|
||||||
LITN:
|
|
||||||
.dw nativeWord
|
|
||||||
ld hl, (HERE)
|
|
||||||
ld de, NUMBER
|
|
||||||
call DEinHL
|
|
||||||
pop de ; number from stack
|
|
||||||
call chkPS
|
|
||||||
call DEinHL
|
|
||||||
ld (HERE), hl
|
|
||||||
jp next
|
|
||||||
|
|
||||||
.db "SCPY"
|
.db "SCPY"
|
||||||
.dw $-LITN
|
.dw $-DOES
|
||||||
.db 4
|
.db 4
|
||||||
SCPY:
|
SCPY:
|
||||||
.dw nativeWord
|
.dw nativeWord
|
||||||
|
@ -97,6 +97,12 @@
|
|||||||
HERE @ 1 + HERE !
|
HERE @ 1 + HERE !
|
||||||
;
|
;
|
||||||
|
|
||||||
|
: LITN
|
||||||
|
( JTBL+24 == NUMBER )
|
||||||
|
JTBL 24 + ,
|
||||||
|
,
|
||||||
|
;
|
||||||
|
|
||||||
: (entry)
|
: (entry)
|
||||||
HERE @ ( h )
|
HERE @ ( h )
|
||||||
WORD ( h s )
|
WORD ( h s )
|
||||||
@ -118,15 +124,16 @@
|
|||||||
|
|
||||||
: X
|
: X
|
||||||
_c (entry)
|
_c (entry)
|
||||||
( JTBL+6 == compiledWord )
|
( We cannot use LITN as IMMEDIATE because of bootstrapping
|
||||||
[ JTBL 6 + LITN ] ,
|
issues. JTBL+24 == NUMBER JTBL+6 == compiledWord )
|
||||||
|
[ JTBL 24 + , JTBL 6 + , ] ,
|
||||||
BEGIN
|
BEGIN
|
||||||
WORD
|
WORD
|
||||||
(find)
|
(find)
|
||||||
( is word )
|
( is word )
|
||||||
IF DUP _c IMMED? IF EXECUTE ELSE , THEN
|
IF DUP _c IMMED? IF EXECUTE ELSE , THEN
|
||||||
( maybe number )
|
( maybe number )
|
||||||
ELSE (parse*) @ EXECUTE LITN THEN
|
ELSE (parse*) @ EXECUTE _c LITN THEN
|
||||||
AGAIN
|
AGAIN
|
||||||
; IMMEDIATE
|
; IMMEDIATE
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user