diff --git a/images/apple/ASM-TK.po b/images/apple/ASM-TK.po index 1809af8..bd13523 100755 Binary files a/images/apple/ASM-TK.po and b/images/apple/ASM-TK.po differ diff --git a/images/apple/PLASMA-2.1-BLD.po b/images/apple/PLASMA-2.1-BLD.po index 80c1973..c5a5bb8 100644 Binary files a/images/apple/PLASMA-2.1-BLD.po and b/images/apple/PLASMA-2.1-BLD.po differ diff --git a/images/apple/PLASMA-2.1-FPSOS.po b/images/apple/PLASMA-2.1-FPSOS.po index f4d0ce3..fcb69e4 100644 Binary files a/images/apple/PLASMA-2.1-FPSOS.po and b/images/apple/PLASMA-2.1-FPSOS.po differ diff --git a/images/apple/PLASMA-2.1-INST.po b/images/apple/PLASMA-2.1-INST.po index 73bacc8..0505f05 100644 Binary files a/images/apple/PLASMA-2.1-INST.po and b/images/apple/PLASMA-2.1-INST.po differ diff --git a/images/apple/PLASMA-2.1.po b/images/apple/PLASMA-2.1.po index 0b25a6e..d21a548 100644 Binary files a/images/apple/PLASMA-2.1.po and b/images/apple/PLASMA-2.1.po differ diff --git a/images/apple/PLASMA-2.11-UPD.po b/images/apple/PLASMA-2.11-UPD.po new file mode 100644 index 0000000..c054f02 Binary files /dev/null and b/images/apple/PLASMA-2.11-UPD.po differ diff --git a/images/apple/PLASMA2-A3MAME.PO b/images/apple/PLASMA2-A3MAME.PO index 6cb967c..ba2e2a4 100644 Binary files a/images/apple/PLASMA2-A3MAME.PO and b/images/apple/PLASMA2-A3MAME.PO differ diff --git a/images/apple/PLFORTH.PO b/images/apple/PLFORTH.PO index e868ad9..193642b 100644 Binary files a/images/apple/PLFORTH.PO and b/images/apple/PLFORTH.PO differ diff --git a/images/apple/apple3.hd b/images/apple/apple3.hd index 363ad9a..f8b5ee5 100644 Binary files a/images/apple/apple3.hd and b/images/apple/apple3.hd differ diff --git a/src/makefile b/src/makefile index 3578dbd..c517e18 100755 --- a/src/makefile +++ b/src/makefile @@ -192,7 +192,7 @@ $(PLVMZP_C64): FORCE FORCE: vmsrc/c64/cmd.a: vmsrc/c64/cmd.pla $(PLASM) - ./$(PLASM) -AOW < vmsrc/c64/cmd.pla > vmsrc/c64/cmd.a + ./$(PLASM) -AOW vmsrc/c64/cmd.pla $(PLVMC64): vmsrc/c64/plvmc64.s vmsrc/c64/cmd.a acme -f cbm -o $(PLVMC64) -l vmsrc/c64/plvmc64.sym vmsrc/c64/plvmc64.s diff --git a/src/mkrel b/src/mkrel index 00093b5..395a377 100755 --- a/src/mkrel +++ b/src/mkrel @@ -222,4 +222,6 @@ cp inc/spiport.plh prodos/bld/inc/SPIPORT.PLH.TXT cp inc/testlib.plh prodos/bld/inc/TESTLIB.PLH.TXT cp inc/grafix.plh prodos/bld/inc/GRAFIX.PLH.TXT cp inc/lz4.plh prodos/bld/inc/LZ4.PLH.TXT -cp vmsrc/apple/plvmzp.inc prodos/bld/inc/PLVMZP.INC.TXT +cp inc/plasma.inc prodos/bld/inc/PLASMA.INC.TXT +cp inc/extheader.inc prodos/bld/inc/EXTHEADER.INC.TXT +cp inc/extdefseg.inc prodos/bld/inc/EXTDEFSEG.INC.TXT diff --git a/src/samplesrc/testasm.pla b/src/samplesrc/testasm.pla index 42b7e89..383f66f 100644 --- a/src/samplesrc/testasm.pla +++ b/src/samplesrc/testasm.pla @@ -1,11 +1,7 @@ -include "inc/cmdsys.plh" import test predef hello#0 predef goodbye#0 end -hello -puts("Did it load?\n") goodbye -hello done diff --git a/src/samplesrc/testext.asm b/src/samplesrc/testext.asm index 12f1448..7a2503b 100644 --- a/src/samplesrc/testext.asm +++ b/src/samplesrc/testext.asm @@ -1,47 +1,25 @@ ; ; EXTENDED REL MODULE WITH DEPENDENCIES, BYTECODE SEGMENT, AND INIT ; - REL - ORG $1000 -; -; USEFUL ZERO PAGE LOCATIONS -; -SRC EQU $06 -SRCL EQU SRC -SRCH EQU SRC+1 -DST EQU SRC+2 -DSTL EQU DST -DSTH EQU DST+1 -TMP EQU $E7 -TMPL EQU TMP -TMPH EQU TMP+1 -ESTKH EQU $C0 -ESTKL EQU $D0 -DROPOP EQU $EF -NEXTOP EQU $F0 -FETCHOP EQU NEXTOP+1 -; -; JUMP TO BYTECODE INTERPRETER ADDRESS -; -INTERP EQU $03D0 + INCLUDE INC/PLASMA.INC ; ; EXTERNALS USED BY THIS MODULE ; EXTRN PUTS EXTRN PUTLN ; -; EXT HEADER +; EXT REL HEADER +; + INCLUDE INC/EXTHEADER.INC +; +; ADD MODULE DEPENDENCIES +; (DCI BACKWARDS HI/LO BIT FROM REL FILE) ; - DW $6502 - DW 0 ; SYSFLAGS - DW DEFSEG ; DEF OFFSET - DW 1 ; DEF COUNT (INCLUDING INIT) - DW MODINIT ; MOD INIT MSB ON - ASC "CMDSY" ; MOD DEPENDENCIES (DCI BACKWARDS HI/LO BIT FROM REL FILE) + ASC "CMDSY" MSB OFF ASC "S" - DB 0 + DB 0 ; TERMINATE LIST WITH ZERO ; ; DATA AND 6502 CODE SEGMENT ; @@ -66,21 +44,13 @@ GOODBYE DEF GOODBYE ; CALLABLE FROM EXTERNAL MODULES ; ; INITIALIZE MODULE AND RETURN SUCCESS ; -INIT LDA #$00 - JSR HELLO - LDY #$00 +INIT JSR HELLO + LDA #$00 DEX STA ESTKL,X - STY ESTKH,X + STA ESTKH,X RTS ; -; BYTECODE DEFS SEGMENT +; EXT REL DEFSEG ; - DB 0 ; PAD BYE -DEFSEG EQU * -; -; INIT CODE RUNS WHEN MODULE LOADED -; -MODINIT DB $54 ; CALL ASM INIT - DW INIT - DB $5C ; RET + INCLUDE INC/EXTDEFSEG.INC diff --git a/src/samplesrc/testrel.asm b/src/samplesrc/testrel.asm index 09785b3..8153fc4 100644 --- a/src/samplesrc/testrel.asm +++ b/src/samplesrc/testrel.asm @@ -1,29 +1,7 @@ ; ; SIMPLE REL FILE - NO DEPENDENCIES, NO INIT CODE ; - REL - ORG $1000 -; -; USEFUL ZERO PAGE LOCATIONS -; -SRC EQU $06 -SRCL EQU SRC -SRCH EQU SRC+1 -DST EQU SRC+2 -DSTL EQU DST -DSTH EQU DST+1 -TMP EQU $E7 -TMPL EQU TMP -TMPH EQU TMP+1 -ESTKH EQU $C0 -ESTKL EQU $D0 -DROPOP EQU $EF -NEXTOP EQU $F0 -FETCHOP EQU NEXTOP+1 -; -; JUMP TO BYTECODE INTERPRETER ADDRESS -; -INTERP EQU $03D0 + INCLUDE INC/PLASMA.INC ; ; EXTERNALS USED BY THIS MODULE ; diff --git a/src/vmsrc/apple/a1cmd.pla b/src/vmsrc/apple/a1cmd.pla index 17a8ef9..15f1c92 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 = $0210 // 02.10 +word version = $0211 // 02.11 word syspath word syscmdln word = @execmod @@ -758,9 +758,6 @@ asm cin()#1 STA ESTKH,X RTS end -def syslookuptbl(dci)#1 - return lookuptbl(dci, symtbl) -end def crout()#0 cout($0D) end @@ -916,6 +913,9 @@ end // // Symbol table routines. // +def syslookuptbl(dci)#1 + return lookuptbl(dci, symtbl) +end def addsym(sym, addr)#0 while ^sym & $80 ^lastsym = ^sym diff --git a/src/vmsrc/apple/cmd.pla b/src/vmsrc/apple/cmd.pla index c84d009..b68ea75 100755 --- a/src/vmsrc/apple/cmd.pla +++ b/src/vmsrc/apple/cmd.pla @@ -39,7 +39,7 @@ predef lookuptbl(dci)#1, execsys(sysfile)#0 // // Exported CMDSYS table // -word version = $0210 // 02.01 Dev +word version = $0211 // 02.11 word syspath word syscmdln word = @execmod, @open, @close, @read, 0 @@ -1388,7 +1388,7 @@ heap = @lastdef // // Print PLASMA version // -prstr("PLASMA 2.1 64K\n")//; prbyte(version.1); cout('.'); prbyte(version.0); crout +prstr("PLASMA 2.11 64K\n") // // Init symbol table. // diff --git a/src/vmsrc/apple/cmdjit.pla b/src/vmsrc/apple/cmdjit.pla index 4f96c78..33d5c09 100755 --- a/src/vmsrc/apple/cmdjit.pla +++ b/src/vmsrc/apple/cmdjit.pla @@ -53,11 +53,10 @@ predef memset(addr,value,size)#0, memcpy(dst,src,size)#0, strcpy(dst,src)#1, str predef uword_isgt(a,b)#1, uword_isge(a,b)#1, uword_islt(a,b)#1, uword_isle(a,b)#1, sext(a)#1, divmod(a,b)#2 predef execmod(modfile)#1, open(path)#1, close(refnum)#1, read(refnum, buf, len)#1 predef lookuptbl(dci)#1, execsys(sysfile)#0 - // // Exported CMDSYS table // -word version = $0210 // 02.10 +word version = $0211 // 02.11 word syspath word syscmdln word = @execmod, @open, @close, @read, 0 @@ -1473,7 +1472,7 @@ heap = @lastdef // // Print PLASMA version // -prstr("PLASMA 2.1 128K\n")//; prbyte(version.1); cout('.'); prbyte(version.0); crout +prstr("PLASMA 2.11 128K\n") // // Init symbol table. // diff --git a/src/vmsrc/apple/sossys.pla b/src/vmsrc/apple/sossys.pla index 930208b..a5d5041 100755 --- a/src/vmsrc/apple/sossys.pla +++ b/src/vmsrc/apple/sossys.pla @@ -45,12 +45,12 @@ predef syslookuptbl(dci)#1 // // Exported CMDSYS table // -word version = $0210 // 02.10 +word version = $0211 // 02.11 word syspath word cmdlnptr word = @execmod, @open, @close, @read, @write byte perr -byte jitcount = 0 // Keep these here for compatibility +byte jitcount = 0 byte jitsize = 0 byte refcons = 0 byte devcons = 0 @@ -1284,7 +1284,7 @@ cmdlnptr = @cmdln // Print PLASMA version // init_cons -prstr("PLASMA 2.1\n")//; putb(version.1); putc('.'); putb(version.0); putln +prstr("PLASMA 2.11\n") prstr("MEM:$"); prword(availheap); crout // // Exec command line parser diff --git a/src/vmsrc/apple/sossysjit.pla b/src/vmsrc/apple/sossysjit.pla index 56fa331..748deea 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 = $0210 // 02.10 +word version = $0211 // 02.11 word syspath word cmdlnptr word = @execmod, @open, @close, @read, @write @@ -1307,7 +1307,7 @@ cmdlnptr = @cmdln // Print PLASMA version // init_cons -prstr("PLASMA 2.1 JITC\n")//; putb(version.1); putc('.'); putb(version.0); putln +prstr("PLASMA 2.11 JITC\n") prstr("MEM:$"); prword(availheap); crout // // Exec command line parser diff --git a/src/vmsrc/c64/cmd.pla b/src/vmsrc/c64/cmd.pla index df158df..4ae5094 100755 --- a/src/vmsrc/c64/cmd.pla +++ b/src/vmsrc/c64/cmd.pla @@ -26,17 +26,19 @@ predef cin()#1, rdstr(p)#1, toupper(c)#1, strcpy(dst,src)#1, strcat(dst,src)#1 predef markheap()#1, allocheap(size)#1, allocalignheap(size, pow2, freeaddr), releaseheap(newheap)#1, availheap()#1 predef memset(addr,value,size)#0, memcpy(dst,src,size)#0 predef uword_isgt(a,b)#1, uword_isge(a,b)#1, uword_islt(a,b)#1, uword_isle(a,b)#1 -predef sext(a)#1, divmod(a,b)#2, execmod(modfile)#1 +predef sext(a)#1, divmod(a,b)#2, execmod(modfile)#1, syslookuptbl(dci)#1 // // Exported CMDSYS table // -word version = $0200 // 02.00 +word version = $0211 // 02.11 word syspath word syscmdln word = @execmod, 0, 0, 0, 0 byte perr byte jitcount = 0 byte jitsize = 0 +word = 0 +word = @syslookuptbl // // String pool. // @@ -651,25 +653,42 @@ asm reloc(modfix, modofst, bytecode, rld)#3 LDY #$00 - LDA (SRC),Y BEQ RLDEX ; END OF RLD - PHA INY LDA (SRC),Y - INY CLC ADC ESTKL+3,X ; ADDR=ENTRY=>1+MODFIX STA DSTL + INY LDA (SRC),Y ADC ESTKH+3,X STA DSTH - PLA + LDY #$00 + LDA (SRC),Y AND #$10 ; EXTERN REF - EXIT BNE RLDEX - TAY ; FIXUP=*ADDR+MODOFST + LDA (SRC),Y + BMI FIX16 + AND #$40 + BNE FIXMSB +FIXLSB LDA (DST),Y + CLC + ADC ESTKL+2,X + CLC + BCC FIX8 +FIXMSB LDY #$03 + LDA (SRC),Y ; FIXUPH=(ENTRY->3+MODOFSTL)+(^ADDR+MODOFSTH) + CLC + ADC ESTKL+2,X + LDY #$00 LDA (DST),Y - INY + ADC ESTKH+2,X + CLC + BCC FIX8 +FIX16 LDA (DST),Y ; FIXUP=*ADDR+MODOFST CLC ADC ESTKL+2,X STA TMPL + INY LDA (DST),Y ADC ESTKH+2,X CMP ESTKH+1,X ; FIXUP >= BYTECODE? @@ -683,7 +702,7 @@ asm reloc(modfix, modofst, bytecode, rld)#3 + STA (DST),Y ; *ADDR=FIXUP DEY LDA TMPL - STA (DST),Y +FIX8 STA (DST),Y LDA SRCL ; NEXT ENTRY ; CLC ADC #$04 @@ -823,6 +842,9 @@ end // // Symbol table routines. // +def syslookuptbl(dci)#1 + return lookuptbl(dci, symtbl) +end def addsym(sym, addr)#0 while ^sym & $80 ^lastsym = ^sym @@ -1078,7 +1100,7 @@ heap = *freemem // // Print PLASMA version // -prstr("\nPLASMA 2.0 Dev\n") //; prbyte(version.1); cout('.'); prbyte(version.0); crout +prstr("\nPLASMA 2.11\n") // // Init symbol table. // diff --git a/src/vmsrc/c64/plvmc64.s b/src/vmsrc/c64/plvmc64.s index 6681817..37c1deb 100644 --- a/src/vmsrc/c64/plvmc64.s +++ b/src/vmsrc/c64/plvmc64.s @@ -121,8 +121,8 @@ OPTBL !WORD CN,CN,CN,CN,CN,CN,CN,CN ; 00 02 !WORD NEG,COMP,BAND,IOR,XOR,SHL,SHR,IDXW ; 90 92 94 96 98 9A 9C 9E !WORD BRGT,BRLT,INCBRLE,ADDBRLE,DECBRGE,SUBBRGE,BRAND,BROR ; A0 A2 A4 A6 A8 AA AC AE !WORD ADDLB,ADDLW,ADDAB,ADDAW,IDXLB,IDXLW,IDXAB,IDXAW ; B0 B2 B4 B6 B8 BA BC BE - !WORD NATV ; C0 -;* + !WORD NATV,JUMPZ,JUMP ; C0 C2 C4 +;;* ;* DIV TOS-1 BY TOS ;* DIV JSR _DIV @@ -1193,6 +1193,28 @@ NATV TYA ; FLATTEN IP JMP (IP) + INC IPH JMP (IP) +;* +;* JUMPS FOR FORTH COMPILER +;* +JUMPZ INX + LDA ESTKH-1,X + ORA ESTKL-1,X + BEQ JUMP + INY ;+INC_IP + INY + BMI + + JMP NEXTOP ++ JMP FIXNEXT +JUMP INY + LDA (IP),Y + PHA + INY + LDA (IP),Y + STA IPH + PLA + STA IPL + LDY #$00 + JMP FETCHOP CMD !SOURCE "vmsrc/c64/cmd.a" SEGEND = * VMINIT JSR $FFE7 ; CLOSE ALL CHANNELS