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

forth: Forth-ify "QUIT"

This commit is contained in:
Virgil Dupras 2020-03-30 08:25:22 -04:00
parent da9f9f9899
commit f6cba4b1cf
4 changed files with 13 additions and 28 deletions

Binary file not shown.

View File

@ -123,7 +123,9 @@ LIT:
.dw INITIAL_SP .dw INITIAL_SP
.dw WORDBUF .dw WORDBUF
jp flagsToBC jp flagsToBC
; 35
jp strcmp jp strcmp
.dw RS_ADDR
; *** Code *** ; *** Code ***
forthMain: forthMain:
@ -174,15 +176,7 @@ forthMain:
.bootName: .bootName:
.db "BOOT", 0 .db "BOOT", 0
INTERPRET: .fill 68
.dw compiledWord
.dw LIT
.db "INTERPRET", 0
.dw FIND_
.dw DROP
.dw EXECUTE
.fill 50
; STABLE ABI ; STABLE ABI
; Offset: 00cd ; Offset: 00cd
@ -632,23 +626,7 @@ EXIT:
call popRSIP call popRSIP
jp next jp next
; ( R:I -- ) .fill 30
.db "QUIT"
.dw $-EXIT
.db 4
QUIT:
.dw compiledWord
.dw NUMBER
.dw 0
.dw FLAGS_
.dw STORE
.dw .private
.dw INTERPRET
.private:
.dw nativeWord
ld ix, RS_ADDR
jp next
abortUnderflow: abortUnderflow:
ld hl, .name ld hl, .name
@ -659,7 +637,7 @@ abortUnderflow:
.db "(uflw)", 0 .db "(uflw)", 0
.db "(br)" .db "(br)"
.dw $-QUIT .dw $-EXIT
.db 4 .db 4
BR: BR:
.dw nativeWord .dw nativeWord

View File

@ -49,7 +49,9 @@
, ( write! ) , ( write! )
; IMMEDIATE ; IMMEDIATE
: ABORT _c (resSP) QUIT ; : QUIT 0 FLAGS ! _c (resRS) LIT< INTERPRET (find) DROP EXECUTE ;
: ABORT _c (resSP) _c QUIT ;
( This is only the "early parser" in earlier stages. No need ( This is only the "early parser" in earlier stages. No need
for an abort message ) for an abort message )

View File

@ -290,6 +290,11 @@ CODE (resSP)
SP JTBL 28 + @ LDdd(nn), SP JTBL 28 + @ LDdd(nn),
;CODE ;CODE
CODE (resRS)
( RS_ADDR == JTBL+38 )
IX JTBL 38 + @ LDddnn,
;CODE
CODE SCMP CODE SCMP
DE POPqq, DE POPqq,
HL POPqq, HL POPqq,