diff --git a/emul/forth/z80c.bin b/emul/forth/z80c.bin index ec98338..8eb6d75 100644 Binary files a/emul/forth/z80c.bin and b/emul/forth/z80c.bin differ diff --git a/forth/forth.asm b/forth/forth.asm index 5f07e45..cdf0455 100644 --- a/forth/forth.asm +++ b/forth/forth.asm @@ -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 $ diff --git a/forth/icore.fs b/forth/icore.fs index cb1eb57..b4e4ec5 100644 --- a/forth/icore.fs +++ b/forth/icore.fs @@ -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 -- ) diff --git a/forth/z80c.fs b/forth/z80c.fs index 0ea8c10..0accf92 100644 --- a/forth/z80c.fs +++ b/forth/z80c.fs @@ -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