diff --git a/images/apple/PLFORTH.PO b/images/apple/PLFORTH.PO index 4c57335..5f1f26b 100755 Binary files a/images/apple/PLFORTH.PO and b/images/apple/PLFORTH.PO differ diff --git a/src/makefile b/src/makefile index 96fac53..b50330b 100755 --- a/src/makefile +++ b/src/makefile @@ -93,6 +93,8 @@ PLASM = plasm PLASMAPLASM = rel/PLASM\#FE1000 CODEOPT = rel/CODEOPT\#FE1000 PLFORTH = rel/PLFORTH\#FE1000 +HRFORTH = rel/HRFORTH\#FE1000 +HR2FORTH = rel/HR2FORTH\#FE1000 INCS = toolsrc/plasm.h toolsrc/tokens.h toolsrc/symbols.h toolsrc/lex.h toolsrc/parse.h toolsrc/codegen.h OBJS = toolsrc/plasm.c toolsrc/parse.c toolsrc/lex.c toolsrc/codegen.c # @@ -111,7 +113,7 @@ TXTTYPE = .TXT #SYSTYPE = \#FF2000 #TXTTYPE = \#040000 -apple: $(PLVMZP_APL) $(PLASM) $(PLVM) $(PLVM01) $(PLVM02) $(PLVMJIT) $(PLVM802) $(PLVM03) $(PLVMJIT03) $(CMD) $(CMDJIT) $(JIT) $(JIT16) $(JITUNE) $(SOSCMD) $(SOSCMDJIT) $(PLASMAPLASM) $(CODEOPT) $(PLFORTH) $(ZIPCHIP) $(MATCHFILES) $(ARGS) $(MEMMGR) $(MEMTEST) $(FIBER) $(FIBERTEST) $(LONGJMP) $(ED) $(MON) $(COPY) $(DEL) $(REN) $(CAT) $(NEWDIR) $(TYPE) $(SOS) $(ROD) $(SIEVE) $(PRIMEGAP) $(MOUSE) $(UTHERNET2) $(UTHERNET) $(ETHERIP) $(INET) $(DHCP) $(HTTPD) $(TFTPD) $(ROGUE) $(ROGUEMAP) $(ROGUECOMBAT) $(SFM) $(SFMSPRT) $(GRAFIX) $(GFXDEMO) $(LINES) $(HGRTILE) $(HGRFONT) $(HGRSPRITE) $(HGRLIB) $(TILETEST) $(HGRTEST) $(GRLIB) $(DGRLIB) $(GRTEST) $(DGRTEST) $(HGRTEST) $(FILEIO_APL) $(CONIO_APL) $(JOYBUZZ) $(PORTIO) $(SPIPORT) $(SDFAT) $(FATCAT) $(FATGET) $(FATPUT) $(FATWDSK) $(FATRDSK) $(INT32) $(INT32TEST) $(SANE) $(FPSTR) $(FPU) $(SANITY) $(LZ4) $(LZ4CAT) $(RPNCALC) $(SNDSEQ) $(PLAYSEQ) $(CONIOTST) +apple: $(PLVMZP_APL) $(PLASM) $(PLVM) $(PLVM01) $(PLVM02) $(PLVMJIT) $(PLVM802) $(PLVM03) $(PLVMJIT03) $(CMD) $(CMDJIT) $(JIT) $(JIT16) $(JITUNE) $(SOSCMD) $(SOSCMDJIT) $(PLASMAPLASM) $(CODEOPT) $(PLFORTH) $(HRFORTH) $(HR2FORTH) $(ZIPCHIP) $(MATCHFILES) $(ARGS) $(MEMMGR) $(MEMTEST) $(FIBER) $(FIBERTEST) $(LONGJMP) $(ED) $(MON) $(COPY) $(DEL) $(REN) $(CAT) $(NEWDIR) $(TYPE) $(SOS) $(ROD) $(SIEVE) $(PRIMEGAP) $(MOUSE) $(UTHERNET2) $(UTHERNET) $(ETHERIP) $(INET) $(DHCP) $(HTTPD) $(TFTPD) $(ROGUE) $(ROGUEMAP) $(ROGUECOMBAT) $(SFM) $(SFMSPRT) $(GRAFIX) $(GFXDEMO) $(LINES) $(HGRTILE) $(HGRFONT) $(HGRSPRITE) $(HGRLIB) $(TILETEST) $(HGRTEST) $(GRLIB) $(DGRLIB) $(GRTEST) $(DGRTEST) $(HGRTEST) $(FILEIO_APL) $(CONIO_APL) $(JOYBUZZ) $(PORTIO) $(SPIPORT) $(SDFAT) $(FATCAT) $(FATGET) $(FATPUT) $(FATWDSK) $(FATRDSK) $(INT32) $(INT32TEST) $(SANE) $(FPSTR) $(FPU) $(SANITY) $(LZ4) $(LZ4CAT) $(RPNCALC) $(SNDSEQ) $(PLAYSEQ) $(CONIOTST) -rm vmsrc/plvmzp.inc @@ -151,6 +153,14 @@ $(CODEOPT): toolsrc/codeopt.pla toolsrc/codeseq.plh ./$(PLASM) -AMOW toolsrc/codeopt.pla acme --setpc 4094 -o $(CODEOPT) toolsrc/codeopt.a +$(HRFORTH): toolsrc/hrforth.pla + ./$(PLASM) -AMOW toolsrc/hrforth.pla + acme --setpc 4094 -o $(HRFORTH) toolsrc/hrforth.a + +$(HR2FORTH): toolsrc/hr2forth.pla + ./$(PLASM) -AMOW toolsrc/hr2forth.pla + acme --setpc 4094 -o $(HR2FORTH) toolsrc/hr2forth.a + $(PLFORTH): toolsrc/plforth.pla ./$(PLASM) -AMOW toolsrc/plforth.pla acme --setpc 4094 -o $(PLFORTH) toolsrc/plforth.a diff --git a/src/mkrel b/src/mkrel index 0c49fd7..35556b0 100755 --- a/src/mkrel +++ b/src/mkrel @@ -51,6 +51,8 @@ cp ../sysfiles/FP6502.CODE#060000 prodos/sys/FP6502.CODE.BIN cp ../sysfiles/ELEMS.CODE#060000 prodos/sys/ELEMS.CODE.BIN cp rel/apple/SOS#FE1000 prodos/sys/SOS.REL cp rel/apple/GRAFIX#FE1000 prodos/sys/GRAFIX.REL +cp rel/HRFORTH#FE1000 prodos/sys/HRFORTH.REL +cp rel/HR2FORTH#FE1000 prodos/sys/HR2FORTH.REL cp rel/PLFORTH#FE1000 prodos/sys/PLFORTH.REL rm -rf prodos/syspro diff --git a/src/scripts/bounce.4th b/src/scripts/bounce.4th index e78743c..2d36b93 100644 --- a/src/scripts/bounce.4th +++ b/src/scripts/bounce.4th @@ -63,7 +63,7 @@ MOVEBALL ?TERMINAL UNTIL - KEY + KEY DROP 0 GRMODE DROP ; diff --git a/src/scripts/hrbounce.4th b/src/scripts/hrbounce.4th index 1fd5369..af5a12f 100644 --- a/src/scripts/hrbounce.4th +++ b/src/scripts/hrbounce.4th @@ -1,10 +1,6 @@ -: RESERVEHGR2 - $6000 HERE - DUP - 0< ABORT" Can't reserve HGR2" - ALLOT -; - -RESERVEHGR2 +LOOKUP HRFORTH +LOOKUP HR2FORTH +OR NOT ABORT" Must run with HRFORTH." : ?PLASMA " IFACE" FIND @@ -64,14 +60,14 @@ RESERVEHGR2 ; : BOUNCE - 2 HGRMODE DROP - 1 HGRDRAWBUF DROP - 1 HGRSHOW DROP + 1 HGRMODE DROP + 0 HGRDRAWBUF DROP + 0 HGRSHOW DROP BEGIN MOVEBALL ?TERMINAL UNTIL - KEY + KEY DROP 0 HGRMODE DROP ; diff --git a/src/scripts/plasma.4th b/src/scripts/plasma.4th index d501e70..c1e715e 100644 --- a/src/scripts/plasma.4th +++ b/src/scripts/plasma.4th @@ -7,6 +7,14 @@ LOOKUP STRCPY PLASMA STRCPY LOOKUP STRCAT PLASMA STRCAT LOOKUP HEAPAVAIL PLASMA FREEMEM +: .PLASMAVER + PLASMA_VER 12 RSHIFT $0F AND 48 + EMIT + PLASMA_VER 8 RSHIFT $0F AND 48 + EMIT + 46 EMIT + PLASMA_VER 4 RSHIFT $0F AND 48 + EMIT + PLASMA_VER $0F AND 48 + EMIT +; + : LOADMOD ( modulename paramstr -- ) CMDLINE " . " STRCPY DROP ( Dummy parameter for module name ) CMDLINE SWAP STRCAT DROP diff --git a/src/scripts/rod.4th b/src/scripts/rod.4th index 89077aa..1291991 100644 --- a/src/scripts/rod.4th +++ b/src/scripts/rod.4th @@ -56,7 +56,7 @@ LOOP ( next ) ?TERMINAL UNTIL - KEY + KEY DROP TEXT ; diff --git a/src/toolsrc/ed.pla b/src/toolsrc/ed.pla index 7ae1fcc..03a2e97 100755 --- a/src/toolsrc/ed.pla +++ b/src/toolsrc/ed.pla @@ -1631,7 +1631,7 @@ def cmdmode#0 word cmdptr, line clrscrn - puts("PLASMA Editor, Version 2.0\n") + puts("PLASMA Editor, Version 2.1\n") while not exit puts(@filename) cmdptr = gets($BA) diff --git a/src/toolsrc/hr2forth.pla b/src/toolsrc/hr2forth.pla new file mode 100644 index 0000000..ae8c456 --- /dev/null +++ b/src/toolsrc/hr2forth.pla @@ -0,0 +1,5 @@ +include "inc/cmdsys.plh" +sysflags reshgr1 | reshgr2 // Reserve HGR page 1 and 2 + +return cmdsys:modexec("PLFORTH") +done \ No newline at end of file diff --git a/src/toolsrc/hrforth.pla b/src/toolsrc/hrforth.pla new file mode 100644 index 0000000..a88aecf --- /dev/null +++ b/src/toolsrc/hrforth.pla @@ -0,0 +1,5 @@ +include "inc/cmdsys.plh" +sysflags reshgr1 // Reserve HGR page 1 + +return cmdsys:modexec("PLFORTH") +done \ No newline at end of file diff --git a/src/toolsrc/plasm.pla b/src/toolsrc/plasm.pla index 1a16ff6..3ec7c8f 100755 --- a/src/toolsrc/plasm.pla +++ b/src/toolsrc/plasm.pla @@ -508,7 +508,7 @@ include "toolsrc/parse.pla" // // Look at command line arguments and compile module // -puts("PLASMA Compiler, Version 2.0\n") +puts("PLASMA Compiler, Version 2.1\n") arg = argNext(argFirst) if ^arg and ^(arg + 1) == '-' opt = arg + 2 diff --git a/src/toolsrc/plforth.pla b/src/toolsrc/plforth.pla index ed5d22c..1a37701 100644 --- a/src/toolsrc/plforth.pla +++ b/src/toolsrc/plforth.pla @@ -95,7 +95,7 @@ const hidden_flag = $80 predef _drop_(a)#0, _swap_(a,b)#2, _dup_(a)#2, _dashdup_(a)#1, _over_(a,b,c)#4, _rot_(a,b,c)#3 predef _add_(a,b)#1, _inc_(a)#1, _inc2_(a)#1, _dec_(a)#1, _dec2_(a)#1 predef _sub_(a,b)#1, _mul_(a,b)#1, _div_(a,b)#1 -predef _neg_(a)#1, _and_(a,b)#1, _or_(a,b)#1, _xor_(a,b)#1, _not_(a)#1 +predef _neg_(a)#1, _and_(a,b)#1, _or_(a,b)#1, _xor_(a,b)#1, _compliment_(a)#1, _not_(a)#1 predef _mod_(a,b)#1, _abs_(a)#1, _max_(a,b)#1, _min_(a,b)#1 predef _lshift_(a,b)#1, _rshift_(a,b)#1 predef _cset_(a,b)#0, _cget_(a)#1, _wset_(a,b)#0, _wplusset_(a,b)#0, _wget_(a)#1 @@ -200,10 +200,14 @@ word = @d_and, 0, @_or_, $96 char d_xor = "XOR" byte = inline_flag word = @d_or, 0, @_xor_, $98 +// COMPLIMENT +char d_compliment = "COMPLIMENT" +byte = inline_flag +word = @d_xor, 0, @_compliment_, $92 // NOT char d_not = "NOT" byte = inline_flag -word = @d_xor, 0, @_not_, $92 +word = @d_compliment, 0, @_not_, $80 // LEFT SHIFT char d_lshift = "LSHIFT" byte = inline_flag @@ -1118,9 +1122,12 @@ end def _xor_(a,b)#1 return a ^ b end -def _not_(a)#1 +def _compliment_(a)#1 return ~a end +def _not_(a)#1 + return not a +end def _eq_(a,b)#1 return a == b end @@ -1951,7 +1958,7 @@ def _bye_#0 throw(@exit, TRUE) end -puts("FORTH for PLASMA 2.0 WIP\n") +puts("FORTH for PLASMA 2.1 WIP\n") if cmdsys:sysver < $0201 puts("PLASMA >= 2.01 required\n") return diff --git a/src/vmsrc/apple/a1cmd.pla b/src/vmsrc/apple/a1cmd.pla index 3b8f973..8c9bd95 100755 --- a/src/vmsrc/apple/a1cmd.pla +++ b/src/vmsrc/apple/a1cmd.pla @@ -40,7 +40,7 @@ predef sext(a)#1, divmod(a,b)#2, execmod(modfile)#1, syslookuptbl(a)#1 // // Exported CMDSYS table // -word version = $0201 // 02.01 +word version = $0210 // 02.10 word syspath word syscmdln word = @execmod diff --git a/src/vmsrc/apple/cmd.pla b/src/vmsrc/apple/cmd.pla index 1518612..91743a0 100755 --- a/src/vmsrc/apple/cmd.pla +++ b/src/vmsrc/apple/cmd.pla @@ -38,7 +38,7 @@ predef lookuptbl(dci)#1 // // Exported CMDSYS table // -word version = $0201 // 02.01 Dev +word version = $0210 // 02.01 Dev word syspath word syscmdln word = @execmod, @open, @close, @read, @write @@ -1381,7 +1381,7 @@ heap = @lastdef // // Print PLASMA version // -prstr("PLASMA 2.0 64K\n")//; prbyte(version.1); cout('.'); prbyte(version.0); crout +prstr("PLASMA 2.1 64K\n")//; prbyte(version.1); cout('.'); prbyte(version.0); crout // // Init symbol table. // diff --git a/src/vmsrc/apple/cmdjit.pla b/src/vmsrc/apple/cmdjit.pla index feb819b..d574be3 100755 --- a/src/vmsrc/apple/cmdjit.pla +++ b/src/vmsrc/apple/cmdjit.pla @@ -57,7 +57,7 @@ predef lookuptbl(dci)#1 // // Exported CMDSYS table // -word version = $0201 // 02.01 Dev +word version = $0210 // 02.10 word syspath word syscmdln word = @execmod, @open, @close, @read, 0 // Mark write() as NULL @@ -1456,7 +1456,7 @@ heap = @lastdef // // Print PLASMA version // -prstr("PLASMA 2.0 128K\n")//; prbyte(version.1); cout('.'); prbyte(version.0); crout +prstr("PLASMA 2.1 128K\n")//; prbyte(version.1); cout('.'); prbyte(version.0); crout // // Init symbol table. // diff --git a/src/vmsrc/apple/sossys.pla b/src/vmsrc/apple/sossys.pla index b98323e..8be6464 100755 --- a/src/vmsrc/apple/sossys.pla +++ b/src/vmsrc/apple/sossys.pla @@ -45,7 +45,7 @@ predef syslookuptbl(dci)#1 // // Exported CMDSYS table // -word version = $0201 // 02.01 Dev +word version = $0210 // 02.10 word syspath word cmdlnptr word = @execmod, @open, @close, @read, @write @@ -1268,7 +1268,7 @@ cmdlnptr = @cmdln // Print PLASMA version // init_cons -prstr("PLASMA 2.0\n")//; putb(version.1); putc('.'); putb(version.0); putln +prstr("PLASMA 2.1\n")//; putb(version.1); putc('.'); putb(version.0); putln prstr("MEM:$"); prword(availheap); crout // // Exec command line parser diff --git a/src/vmsrc/apple/sossysjit.pla b/src/vmsrc/apple/sossysjit.pla index 8eabc47..be9d641 100755 --- a/src/vmsrc/apple/sossysjit.pla +++ b/src/vmsrc/apple/sossysjit.pla @@ -56,7 +56,7 @@ predef syslookuptbl(dci)#1 // // Exported CMDSYS table // -word version = $0201 // 02.01 Dev +word version = $0210 // 02.10 word syspath word cmdlnptr word = @execmod, @open, @close, @read, @write @@ -1291,7 +1291,7 @@ cmdlnptr = @cmdln // Print PLASMA version // init_cons -prstr("PLASMA 2.0 JITC\n")//; putb(version.1); putc('.'); putb(version.0); putln +prstr("PLASMA 2.1 JITC\n")//; putb(version.1); putc('.'); putb(version.0); putln prstr("MEM:$"); prword(availheap); crout // // Exec command line parser