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

forth: Forth-ify "(parsed)"

This commit is contained in:
Virgil Dupras 2020-03-30 17:21:13 -04:00
parent 80985460d4
commit 4756fb7763
4 changed files with 24 additions and 30 deletions

Binary file not shown.

View File

@ -116,22 +116,23 @@
jp nativeWord
jp next
jp chkPS
; 24
; 32
.dw numberWord
.dw litWord
.dw INITIAL_SP
.dw WORDBUF
jp flagsToBC
; 35
; 43
jp strcmp
.dw RS_ADDR
.dw CINPTR
.dw SYSVNXT
.dw FLAGS
; 46
; 54
.dw PARSEPTR
.dw HERE
.dw CURRENT
jp parseDecimal
; *** Code ***
forthMain:
@ -162,7 +163,7 @@ forthMain:
.bootName:
.db "BOOT", 0
.fill 101
.fill 98
; STABLE ABI
; Offset: 00cd
@ -762,33 +763,10 @@ NOT:
jp next
.fill 100
.db "(parsed)"
.dw $-NOT
.db 8
PARSED:
.dw nativeWord
pop hl
call chkPS
call parseDecimal
jr z, .success
; error
ld de, 0
push de ; dummy
push de ; flag
jp next
.success:
push de
ld de, 1 ; flag
push de
jp next
.fill 224
.fill 362
.db "_bend"
.dw $-PARSED
.dw $-NOT
.db 5
; Offset: 0647
.out $

View File

@ -85,7 +85,7 @@
( This is only the "early parser" in earlier stages. No need
for an abort message )
: (parse)
(parsed) NOT IF _c ABORT THEN
_c (parsed) NOT IF _c ABORT THEN
;
( a -- )

View File

@ -347,3 +347,19 @@ CODE CMP
BC PUSHqq,
;CODE
CODE (parsed)
HL POPqq,
chkPS,
( 60 == parseDecimal )
60 CALLnn,
10 JRZe, ( success )
( error )
DE 0 LDddnn,
DE PUSHqq, ( dummy )
DE PUSHqq, ( flag )
JPNEXT,
( success )
DE PUSHqq,
DE 1 LDddnn,
DE PUSHqq,
;CODE