mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-28 07:58:06 +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
|
||||
|
||||
|
||||
.fill 51
|
||||
|
||||
; ( 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
|
||||
.fill 82
|
||||
|
||||
.db "SCPY"
|
||||
.dw $-LITN
|
||||
.dw $-DOES
|
||||
.db 4
|
||||
SCPY:
|
||||
.dw nativeWord
|
||||
|
@ -97,6 +97,12 @@
|
||||
HERE @ 1 + HERE !
|
||||
;
|
||||
|
||||
: LITN
|
||||
( JTBL+24 == NUMBER )
|
||||
JTBL 24 + ,
|
||||
,
|
||||
;
|
||||
|
||||
: (entry)
|
||||
HERE @ ( h )
|
||||
WORD ( h s )
|
||||
@ -118,15 +124,16 @@
|
||||
|
||||
: X
|
||||
_c (entry)
|
||||
( JTBL+6 == compiledWord )
|
||||
[ JTBL 6 + LITN ] ,
|
||||
( We cannot use LITN as IMMEDIATE because of bootstrapping
|
||||
issues. JTBL+24 == NUMBER JTBL+6 == compiledWord )
|
||||
[ JTBL 24 + , JTBL 6 + , ] ,
|
||||
BEGIN
|
||||
WORD
|
||||
(find)
|
||||
( is word )
|
||||
IF DUP _c IMMED? IF EXECUTE ELSE , THEN
|
||||
( maybe number )
|
||||
ELSE (parse*) @ EXECUTE LITN THEN
|
||||
ELSE (parse*) @ EXECUTE _c LITN THEN
|
||||
AGAIN
|
||||
; IMMEDIATE
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user