mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-23 23:28:05 +11:00
forth: Forth-ify "QUIT"
This commit is contained in:
parent
da9f9f9899
commit
f6cba4b1cf
Binary file not shown.
@ -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
|
||||||
|
@ -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 )
|
||||||
|
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user