From a7a2f3d08bfb19fe8990c46b4acdfab07d0bbf53 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Wed, 8 Apr 2020 16:23:02 -0400 Subject: [PATCH] Move IMMEDIATE from z80c to core This makes IMMEDIATE affected by memory mappings. --- emul/forth/z80c.bin | Bin 1841 -> 1818 bytes forth/core.fs | 6 +++++- forth/icore.fs | 18 +++++------------- forth/z80c.fs | 7 ------- 4 files changed, 10 insertions(+), 21 deletions(-) diff --git a/emul/forth/z80c.bin b/emul/forth/z80c.bin index 43464a6c705c74333d4ed905975ac6d95ce33e5e..4a50d46722efce4f153eeab8da0bcc242747011c 100644 GIT binary patch delta 822 zcmX|9O-NKx6#nje_ul6W`m`Sh842EKkt2o>w5Y6Uybd%F{)}TyOk`q$LE@`s6@*Be zW@YepwU3syt7#>)av{-12nO7_%T0qDVLIpC(Zze*bH4NQo%5Zq{s;d{&T(?RQN{W0 zy&3$NSWNzo2Hc^`yV77JTzdIxWi)#hT|NRN!OpvdQo)C0hs18Q^Vm&dLe`UU*t^Ux)T7Mzy$WAPjXnSMmsXIa-?jL zZ`8p|^zp0#x@lWg#f-;#nS@qVRa5*A;81N%7KM+cIh@^_9grJa@WFg;5H1(XU_F{u zDg9YDMN3D|)rG6Ovd`;vYE+FAED+*vn`!#7QuAi^;TSK}4!RfpP{YgIY2174St0@l zPE&BVV{t%Tt13<3fz!}?+FDHVRD>K7w05s9Lktir5zDkiFDqCDU1-T_l-H>Z9-jLi z3rjG-6C%acCTC{K7f*DKPeo3-Lmg?dvCb_DWFjX?gf355$S$^~_%w=q6(Kdl~XKtngQ!Hphl`grH@W*XWKkfOEd(`-rp3W-egNwc?I75r%%+`Ptl Q0cqIK|J*}iut-||2RjO@7XSbN delta 919 zcmX|9KTH#06#sqK@9romhY@En=dBgNoMj_0T3l;W(ri6D8{4KysI7GBlQ&$&4ranZ&4BGaDxVd1O1r zC|MLfIn3bujmlJ znt7SNj?uFAEN!uzqjeRKrUltsGQ<$^7x6-y^wO)Xq6ZnuZ=#Ct#5ebNDt}4yeH71) zh}5Z*rtE@2u0LI=1ZNL##08z1ETzVhwdUg+$q+@Rc9=w7DjvJ^QW_?oRhcg;BpOV? zqK*Hw74DXUxd*zuyM&h2vJ|fM;kAQJn`hOsw4{?XsL`WrNqChGL<`#J(UPuT;XIf2 O-?ILsx DROP ; : LIT 34 , ; @@ -29,6 +32,7 @@ (br)) and then call LITN on it. ) : +! SWAP OVER @ + SWAP ! ; +: -^ SWAP - ; : ALLOT HERE +! ; : IF ( -- a | a: br cell addr ) diff --git a/forth/icore.fs b/forth/icore.fs index 5719aa4..2443bf5 100644 --- a/forth/icore.fs +++ b/forth/icore.fs @@ -53,11 +53,7 @@ ' ( get word ) -^ ( apply offset ) , ( write! ) -; -( We can't use IMMEDIATE because the one we've just compiled - in z80c target's the *target*'s RAM addr, not the host's. - manually set namelen field. ) -0x82 CURRENT @ 1 - C! +; IMMEDIATE : RAM+ [ RAMSTART LITN ] _c + @@ -250,9 +246,7 @@ ( : and ; have to be defined last because it can't be executed now also, they can't have their real name - right away. We also can't use IMMEDIATE because the offset - used for CURRENT is the *target*'s RAM offset. we're still - on the host. + right away. ) : X @@ -269,17 +263,15 @@ ( maybe number ) ELSE _c (parse*) _c @ EXECUTE _c LITN THEN AGAIN -; +; IMMEDIATE : Y ['] EXIT _c , _c R> _c DROP ( exit : ) -; +; IMMEDIATE -( Give ":" and ";" their real name and make them IMMEDIATE ) -0x81 ' X 1 - _C! +( Give ":" and ";" their real name ) ':' ' X 4 - _C! -0x81 ' Y 1 - _C! ';' ' Y 4 - _C! ( Add dummy entry. we use CREATE because (entry) is, at this diff --git a/forth/z80c.fs b/forth/z80c.fs index d43b0f5..61a217e 100644 --- a/forth/z80c.fs +++ b/forth/z80c.fs @@ -311,13 +311,6 @@ CODE R> HL PUSHqq, ;CODE -CODE IMMEDIATE - ( CURRENT == RAM+2 ) - RAMSTART 0x02 + LDHL(nn), - HL DECss, - 7 (HL) SETbr, -;CODE - CODE IMMED? HL POPqq, chkPS,