From b3f6c7970af12e0762e75c60b856fa948cd341d1 Mon Sep 17 00:00:00 2001 From: David Schmenk Date: Mon, 8 Jan 2024 15:55:07 -0800 Subject: [PATCH] Further source cleanup and calling it an Alpha --- images/apple/PLFORTH.PO | Bin 143360 -> 143360 bytes src/scripts/plasma.4th | 76 +++---------- src/toolsrc/plforth.pla | 245 +++++++++++++++++++--------------------- 3 files changed, 132 insertions(+), 189 deletions(-) diff --git a/images/apple/PLFORTH.PO b/images/apple/PLFORTH.PO index 8e54326c5f668d083835df56cba7b86dcf36be9f..52c69aedd5a97c858100c27100ba4979b9198051 100755 GIT binary patch delta 8908 zcmaLd33L=yy1?;U)s@bkG+9Y!tL`M7jiiHsvXdt1gbbZ@+bJMm(69>$L z>^cvuIqO!5mJTpGT~Uq ze+kJgy+b(3u~aDTW`Di3k4%V5g~d!hC7J11Caf*qMvvx|z9V1gxLsI0E%lO=Aw<}5 zr;z!Ql7}3B71m%hZzKPc;~pUmk){!Dchm}LsB|6SE=RqP21~aPz8_vSr!aKTAsXbG zA@UO7=R^_fZS&TR(!3&_LQ#P{G$;x(MW6~)~| zwc;|O_#&&%?;pwG^pM@#%Np=`TAMxUNV3%8xY3?qlV`ZktBxgi701>2TUs?wi>6*p zKDtJ{_}*)>LJNyxJU$;M#70Vki{i?L2R$uyBg$jUqqf%d zl87&>xv;dswL{2F4INL>{S}wu^|g9CJ|}+9rD!9(EgjzwpL8j89_qglpK{6mhK__R zc0_56x22vWi=?bHmZZ)TqMJ%StyC$i_m`VrDpr)r_5O}3s{2c0d|uCJZ|w+@W2JF) zVK)TI6|>vvQpHRUkz`4E%%~Qv$=9)k#3+v$Gos1o?Rc4Fb-6X@4R}3T$GcTE}g~D@vq69rqBt*<2D+=VyDxgJiFjb9S`U zi^qxgluM=Ra|EZ$Exsl#vd4QA#S(gh9-q3Cmb(k%hmmnnczog`3OhHSnWr?_p6V;g zYI>&@iH|wXHJ7ArPJi~NypYvXSLY3A;x{_ZsZhrFgY_c5CntG@GOT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H7{kMIGy=AGV+_lQm|{yXrrYF@F_#86 z+GPDtHXe^yhLv~}>+uX;#=F>qy$pWPmTDZfWf))ElJyhh-`kRnpUD$*WW6Ydn-}_H zATG%fMpKTWk0rhmlQ0F>P=0exNHOlu;Xe&IS^5VQ9;Wap%kNoc(>Lz0vI&m%L((Weex`=PZLM+DJxCi%z_*j7l@d*Bm zzhFHbU(HpFH}O`kMSqvFJ=lu_ID{V&Yv*Qyp0J|?J*2q<3^?a3Q1FBSE3{ndWpQ`A7;;Aafzmvu@REs{F z1~=d)+=_)*3Iq4jc!gS^Kg4ns18k$u>%@mxex)Yq-w=Px@&}ebsd>g3HCdM(LXUAU zAxEx}*w(d=#V1@!ab%(ov~fiI;}7DdIgv6uYxy^35OC%wT~i z<=0$qgTG>cR&V|SC6vDiix|z9R=4$BGb_zX_;IkR|M^xzStnveeEfyYx*v|0azYpM zE2;~O`K1@bpAsqJ^WGQsV|aeP`qdD+wZL7c@|Oi_rf53n5|Lb|t z|Lnito!4!PZs!j@PDz#&wsSy|RGU?M-HaJGsWo=auDfRHOq#3ZHowt{Tv-rAp250;KQtdone{Se#U5zK&ljZMqHH#xXBlQ<{t@Zjs(MqE8t8_-k4SJiRb!KpG zI%n%@{DJXjM>V70)HZp?)iwm9^=IP?T15Y5LXBJ`-5qJt@FerBscSLM7qxp`nq(`8 zPJuFW6jiMnpqf8MtIb}GGPO4752Ot3miowN!s&A5nha^knsiB)*R17GotD-#NlMHU z>o+`^#z}i7JZrt3R{PdyQtY#>(qM~hi+OIyL}};!mc*oFTAW;7EGy5&{YUz-XIPu^ lNchB*^6= 0 and value <= 255 if value <= 15 - pfillb(value << 1) // CONSTANT NIBBLE + _dictaddb_(value << 1) // CONSTANT NIBBLE else - pfillb($2A) // CONSTANT BYTE - pfillb(value) // Poke literal value into dictionary + _dictaddb_($2A) // CONSTANT BYTE + _dictaddb_(value) // Poke literal value into dictionary fin elsif value < 0 and value >= -256 if value == -1 - pfillb($20) // CONSTANT MINUS_ONE + _dictaddb_($20) // CONSTANT MINUS_ONE else - pfillb($5E) // CONSTANT NEGATIVE BYTE - pfillb(value) // Poke literal value into dictionary + _dictaddb_($5E) // CONSTANT NEGATIVE BYTE + _dictaddb_(value) // Poke literal value into dictionary fin else - pfillb($2C) // CONSTANT WORD - pfillw(value) // Poke literal value into dictionary + _dictaddb_($2C) // CONSTANT WORD + _dictaddw_(value) // Poke literal value into dictionary fin fin end -def interpret#0 +def _interpret_#0 word inchars, dentry, value byte inlen, valid @@ -1043,12 +1038,12 @@ def interpret#0 puts(" : Compile only word\n") _quit_ fin - execword(dentry) + _execword_(dentry) else - compword(dentry) + _compword_(dentry) fin else - value, valid = isnum(inchars, inlen) + value, valid = _isnum_(inchars, inlen) if not valid inchars-- ^inchars = inlen @@ -1057,7 +1052,7 @@ def interpret#0 warmstart else if state & comp_flag - compliteral(value) + _compliteral_(value) else (@push)(value)#0 fin @@ -1277,31 +1272,31 @@ def _plasma_(a)#0 end def _var_(a)#0 newdict - pfillb($20) // Hack - get VM entry vector from divmod - pfillw(*(@divmod + 1)) - pfillb($2C) // CONSTANT WORD - pfillw(heapmark + 3) // Poiner to variable in PFA - pfillb($5C) // RET - pfillw(a) // Variable storage + _dictaddb_($20) // Hack - get VM entry vector from divmod + _dictaddw_(*(@divmod + 1)) + _dictaddb_($2C) // CONSTANT WORD + _dictaddw_(heapmark + 3) // Poiner to variable in PFA + _dictaddb_($5C) // RET + _dictaddw_(a) // Variable storage addhash(vlist) end def _const_(a)#0 newdict - pfillb($20) // Hack - get VM entry vector from divmod - pfillw(*(@divmod + 1)) - pfillb($2C) // CONSTANT WORD - pfillw(a) - pfillb($5C) // RET + _dictaddb_($20) // Hack - get VM entry vector from divmod + _dictaddw_(*(@divmod + 1)) + _dictaddb_($2C) // CONSTANT WORD + _dictaddw_(a) + _dictaddb_($5C) // RET addhash(vlist) end def _create_#0 newdict - pfillb($20) // Hack - get VM entry vector from divmod - pfillw(*(@divmod + 1)) - pfillb($2C) // CONSTANT WORD - pfillw(heapmark + 5) // Pointer to rest of PFA - pfillb($5C) // RET - pfillw(0) // reserved word for DOES> + _dictaddb_($20) // Hack - get VM entry vector from divmod + _dictaddw_(*(@divmod + 1)) + _dictaddb_($2C) // CONSTANT WORD + _dictaddw_(heapmark + 5) // Pointer to rest of PFA + _dictaddb_($5C) // RET + _dictaddw_(0) // reserved word for DOES> // // 9 bytes after PFA, data follows... // @@ -1329,23 +1324,20 @@ def _pbcdoes_(a)#0 end def _does_#0 if state & comp_itc_flag - pfillw(@d_lit) - pfillw(heapmark + 6) // Pointer to DOES code - pfillw(@d_createdoes) - pfillw(0) + _dictaddw_(@d_lit) + _dictaddw_(heapmark + 6) // Pointer to DOES code + _dictaddw_(@d_createdoes) + _dictaddw_(0) // End of else // comp_pbc_flag - pfillb($2C) // CONSTANT WORD - pfillw(heapmark + 6) // Pointer to DOES code - pfillb($54) // CALL - pfillw(@_pbcdoes_) // Fills in code address reserved in _compbuilds_ - pfillb($5C) // RET + _dictaddb_($2C) // CONSTANT WORD + _dictaddw_(heapmark + 6) // Pointer to DOES code + _dictaddb_($54) // CALL + _dictaddw_(@_pbcdoes_) // Fills in code address reserved in _compbuilds_ + _dictaddb_($5C) // RET // End of BUILDS, beginning of DOES> code fin end -def _literal_(a)#0 - compliteral(a) -end def _docolon_#0 execwords(W + 2) // Exec PFA end @@ -1356,8 +1348,8 @@ def _colon_#0 ^(_ffa_(vlist)) = itc_flag *(_cfa_(vlist)) = @_docolon_ else // comp_pbc_flag - pfillb($20) // Hack - get VM entry vector from divmod - pfillw(*(@divmod + 1)) + _dictaddb_($20) // Hack - get VM entry vector from divmod + _dictaddw_(*(@divmod + 1)) fin if state & trace_flag puts(vlist); putc(' ') @@ -1365,9 +1357,9 @@ def _colon_#0 end def _exit_#0 if state & comp_itc_flag - pfillw(0) + _dictaddw_(0) elsif state & comp_pbc_flag - pfillb($5C) // RET + _dictaddb_($5C) // RET else puts("; Not compiling\n") _quit_ @@ -1383,7 +1375,7 @@ def _compile_#0 dentry = find(nextword(' ')) if dentry - compword(dentry) + _compword_(dentry) else puts("No match\n") _quit_ @@ -1426,14 +1418,14 @@ def _0branch_(a)#0 fin end def _if_#0 - compword(@d_0branch) + _compword_(@d_0branch) _tors_(heapalloc(2)) // Save backfill address end def _else_#0 word backref backref = _fromrs_ - compword(@d_branch) + _compword_(@d_branch) _tors_(heapalloc(2)) *backref = heapmark end @@ -1441,15 +1433,15 @@ def _then_#0 *_fromrs_ = heapmark end def _case_#0 - compword(@d_dup) + _compword_(@d_dup) _tors_(0) // Linked address list end def _of_#0 if state & comp_itc_flag - pfillw(@d_eq) - pfillw(@d_0branch) + _dictaddw_(@d_eq) + _dictaddw_(@d_0branch) else // comp_pbc_flag - pfillb($24) // BRNE + _dictaddb_($24) // BRNE fin _tors_(heapalloc(2)) // Save backfill address end @@ -1458,27 +1450,27 @@ def _endof_#0 backref = _fromrs_ link = _fromrs_ - compword(@d_branch) + _compword_(@d_branch) _tors_(heapmark) - pfillw(link) + _dictaddw_(link) if state & comp_itc_flag *backref = heapmark else // comp_pbc_flag *backref = heapmark - backref // Relative branch fin - compword(@d_dup) + _compword_(@d_dup) end def _endcase_#0 word backref, link - compword(@d_drop) + _compword_(@d_drop) backref = _fromrs_ while backref link = *backref *backref = heapmark backref = link loop - compword(@d_drop) + _compword_(@d_drop) end def _dodo_(a,b)#0 if RSP < 2 @@ -1490,7 +1482,7 @@ def _dodo_(a,b)#0 RSTACK[RSP] = b end def _do_#0 - compword(@d_dodo) + _compword_(@d_dodo) _tors_(heapmark) end def _leave_#0 @@ -1532,23 +1524,23 @@ def _dopbcplusloop_(a)#1 end def _loop_#0 if state & comp_itc_flag - pfillw(@d_doloop) + _dictaddw_(@d_doloop) else // comp_pbc_flag - pfillb($54) // CALL - pfillw(@_dopbcloop_) - pfillb($C2) // JUMPZ + _dictaddb_($54) // CALL + _dictaddw_(@_dopbcloop_) + _dictaddb_($C2) // JUMPZ fin - pfillw(_fromrs_) + _dictaddw_(_fromrs_) end def _plusloop_#0 if state & comp_itc_flag - pfillw(@d_doplusloop) + _dictaddw_(@d_doplusloop) else // comp_pbc_flag - pfillb($54) // CALL - pfillw(@_dopbcplusloop_) - pfillb($C2) // JUMPZ + _dictaddb_($54) // CALL + _dictaddw_(@_dopbcplusloop_) + _dictaddb_($C2) // JUMPZ fin - pfillw(_fromrs_) + _dictaddw_(_fromrs_) end def _j_#1 return RSTACK[RSP + 2] @@ -1557,23 +1549,23 @@ def _begin_#0 _tors_(heapmark) end def _again_#0 - compword(@d_branch) - pfillw(_fromrs_) + _compword_(@d_branch) + _dictaddw_(_fromrs_) end def _until_#0 - compword(@d_0branch) - pfillw(_fromrs_) + _compword_(@d_0branch) + _dictaddw_(_fromrs_) end def _while_#0 - compword(@d_0branch) + _compword_(@d_0branch) _tors_(heapalloc(2)) // Save backfill address end def _repeat_#0 word backref backref = _fromrs_ // Backref from WHILE - compword(@d_branch) - pfillw(_fromrs_) + _compword_(@d_branch) + _dictaddw_(_fromrs_) *backref = heapmark // Backref to BEGIN end def _count_(a)#2 @@ -1593,7 +1585,7 @@ def _tick_#0 dentry = find(nextword(' ')) if state & comp_flag - compliteral(dentry) + _compliteral_(dentry) else (@push)(dentry)#0 fin @@ -1616,11 +1608,6 @@ def _forget_#0 _quit_ fin end -def _query_#0 - inptr = gets('?'|$80) - ^(inptr + ^inptr + 1) = 0 - inptr++ -end def _accept_(a,b)#1 word saveinptr byte len @@ -1673,7 +1660,7 @@ def _prat_(a)#0 end def _blank_#0 if state & comp_flag - compliteral(32) + _compliteral_(32) else (@push)(32)#0 fin @@ -1684,7 +1671,7 @@ def _char_#0 str, len = nextword(' ') if state & comp_flag - compliteral(^str) + _compliteral_(^str) else (@push)(^str)#0 fin @@ -1698,7 +1685,7 @@ def _str_#0 ^str = len len++ if state & comp_flag - compword(@d_slit) + _compword_(@d_slit) memcpy(heapalloc(len), str, len) // Add to dictionary else (@push)(heapmark)#0 @@ -1718,7 +1705,7 @@ def _prstr_#0 if state & comp_flag _str_ - compword(@d_doprstr) + _compword_(@d_doprstr) else str, len = nextword('"') str-- @@ -1732,7 +1719,7 @@ def _prpstr_#0 if state & comp_flag _str_ - compword(@d_doprstr) + _compword_(@d_doprstr) else str, len = nextword(')') str-- @@ -1799,7 +1786,7 @@ def _srcstr_#0 if state & comp_flag _str_ - compword(@d_src) + _compword_(@d_src) else filename, len = nextword('"') filename-- @@ -1962,7 +1949,7 @@ def _abortstr_#0 _str_ if state & comp_flag - compword(@d_doabortstr) + _compword_(@d_doabortstr) else (@_doabortstr_)()#0 fin @@ -1981,7 +1968,7 @@ def _bye_#0 throw(@exitforth, TRUE) end -puts("FORTH WIP for PLASMA 2.1\n") +puts("FORTH (Alpha) for PLASMA 2.1\n") if cmdsys:sysver < $0201 puts("PLASMA >= 2.01 required\n") return @@ -1994,6 +1981,6 @@ coldstart inptr = argNext(argFirst) if not except(@exitforth) if ^inptr; inptr++; _srcstr_; fin - interpret + _interpret_ fin done