From eb6a07a162bdc81d7115f089f90ffa0eb9167d28 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Wed, 25 Mar 2020 17:13:10 -0400 Subject: [PATCH] forth: Forth-ify "PC@" --- emul/forth/z80c.bin | Bin 166 -> 190 bytes forth/forth.asm | 16 +--------------- forth/z80a.fs | 2 +- forth/z80c.fs | 8 ++++++++ 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/emul/forth/z80c.bin b/emul/forth/z80c.bin index 5bed93b31e2cba344d9553eb7e246ddf7fcbae87..0884ccd9606dd339c720175e334076cb8098e59c 100644 GIT binary patch delta 41 rcmZ3+xQ}td9Hjtf2L>PzW?5N2Qi05|;wNdN!< diff --git a/forth/forth.asm b/forth/forth.asm index a8a2788..a1756f2 100644 --- a/forth/forth.asm +++ b/forth/forth.asm @@ -733,23 +733,9 @@ PRINT: inc hl jr .loop -; ( port -- c ) - .db "PC@" - .fill 4 - .dw $-PRINT - .db 0 -PFETCH: - .dw nativeWord - pop bc - call chkPS - ld h, 0 - in l, (c) - push hl - jp next - .db "C," .fill 5 - .dw $-PFETCH + .dw $-PRINT .db 0 CWR: .dw nativeWord diff --git a/forth/z80a.fs b/forth/z80a.fs index 411021e..c98af54 100644 --- a/forth/z80a.fs +++ b/forth/z80a.fs @@ -124,7 +124,7 @@ OR A, ; 0xed41 OP2r OUT(C)r, -0xeb40 OP2r INr(C), +0xed40 OP2r INr(C), ( dd nn -- ) : OP3ddnn diff --git a/forth/z80c.fs b/forth/z80c.fs index 61fc883..1237216 100644 --- a/forth/z80c.fs +++ b/forth/z80c.fs @@ -90,3 +90,11 @@ CODE PC! chkPS, L OUT(C)r, ;CODE + +CODE PC@ + BC POPqq, + chkPS, + H 0 LDrn, + L INr(C), + HL PUSHqq, +;CODE