diff --git a/emul/forth/z80c.bin b/emul/forth/z80c.bin index 03f9ff6..ca8ccbe 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 96ae17e..e016a80 100644 --- a/forth/forth.asm +++ b/forth/forth.asm @@ -710,24 +710,10 @@ DOES: jp EXIT+2 -.fill 82 - - .db "SCPY" - .dw $-DOES - .db 4 -SCPY: - .dw nativeWord - pop hl - ld de, (HERE) - call strcpy - ld (HERE), de - jp next - - -.fill 460 +.fill 566 .db "_bend" - .dw $-SCPY + .dw $-DOES .db 5 ; Offset: 0647 .out $ diff --git a/forth/icore.fs b/forth/icore.fs index a8d53b2..f515eec 100644 --- a/forth/icore.fs +++ b/forth/icore.fs @@ -146,9 +146,9 @@ ; : (entry) - _c HERE _c @ ( h ) + _c HERE _c @ ( h ) _c WORD ( h s ) - SCPY ( h ) + _c SCPY ( h ) ( Adjust HERE -1 because SCPY copies the null ) _c HERE _c @ 1 _c - ( h h' ) _c DUP _c HERE _c ! ( h h' ) diff --git a/forth/z80a.fs b/forth/z80a.fs index bb1ee5a..5aab069 100644 --- a/forth/z80a.fs +++ b/forth/z80a.fs @@ -39,6 +39,8 @@ : OP1 CREATE C, DOES> C@ A, ; 0xeb OP1 EXDEHL, 0x76 OP1 HALT, +0x12 OP1 LD(DE)A, +0x1a OP1 LDA(DE), 0xc9 OP1 RET, 0x17 OP1 RLA, 0x07 OP1 RLCA, diff --git a/forth/z80c.fs b/forth/z80c.fs index 0f30aed..a673dd9 100644 --- a/forth/z80c.fs +++ b/forth/z80c.fs @@ -379,6 +379,7 @@ CODE (parsed) CODE (find) HL POPqq, + chkPS, ( 3 == find ) 3 CALLnn, 10 JRZe, ( found ) @@ -392,3 +393,20 @@ CODE (find) DE 1 LDddnn, DE PUSHqq, ;CODE + +CODE SCPY + HL POPqq, + chkPS, + DE HERE LDdd(nn), + B 0 LDrn, +( loop ) + A (HL) LDrr, + LD(DE)A, + HL INCss, + DE INCss, + B INCr, + A ORr, + -6 JRNZe, ( loop ) + DE A LD(dd)r + HERE DE LD(nn)dd, +;CODE