From fd641bef8f814fea91bba7fea2fe533e3529a462 Mon Sep 17 00:00:00 2001 From: David Schmenk Date: Fri, 6 Apr 2018 14:22:39 -0700 Subject: [PATCH] JIT specific module loading --- src/makefile | 7 ++++++- src/mkrel | 1 + src/vmsrc/apple/cmdjit.pla | 9 +++------ src/vmsrc/apple/plvm802.s | 14 ++++++++++++++ src/vmsrc/apple/plvmjit02.s | 10 ++++++++++ 5 files changed, 34 insertions(+), 7 deletions(-) diff --git a/src/makefile b/src/makefile index de1131e..e308491 100755 --- a/src/makefile +++ b/src/makefile @@ -14,6 +14,7 @@ PLVMZP_C64 = vmsrc/c64/plvmzp.inc PLVMC64 = rel/c64/PLASMA ED = rel/ED\#FE1000 JIT = rel/apple/JIT\#FE1000 +JIT16 = rel/apple/JIT16\#FE1000 JITUNE = rel/apple/JITUNE\#FE1000 SOS = rel/apple/SOS\#FE1000 ROD = rel/ROD\#FE1000 @@ -80,7 +81,7 @@ TXTTYPE = .TXT #SYSTYPE = \#FF2000 #TXTTYPE = \#040000 -apple: $(PLVMZP_APL) $(PLASM) $(PLVM) $(PLVM01) $(PLVM02) $(PLVMJIT) $(PLVM802) $(PLVM03) $(CMD) $(CMDJIT) $(JIT) $(JITUNE) $(SOSCMD) $(PLASMAPLASM) $(CODEOPT) $(ARGS) $(MEMMGR) $(MEMTEST) $(FIBER) $(FIBERTEST) $(LONGJMP) $(ED) $(MON) $(SOS) $(ROD) $(SIEVE) $(UTHERNET2) $(UTHERNET) $(ETHERIP) $(INET) $(DHCP) $(HTTPD) $(ROGUE) $(ROGUEMAP) $(ROGUECOMBAT) $(GRAFIX) $(GFXDEMO) $(DGR) $(DGRTEST) $(FILEIO_APL) $(CONIO_APL) $(JOYBUZZ) $(PORTIO) $(SPIPORT) $(SDFAT) $(FATCAT) $(FATGET) $(FATPUT) $(FATWDSK) $(FATRDSK) $(SANE) $(FPSTR) $(FPU) $(SANITY) $(RPNCALC) $(SNDSEQ) $(PLAYSEQ) +apple: $(PLVMZP_APL) $(PLASM) $(PLVM) $(PLVM01) $(PLVM02) $(PLVMJIT) $(PLVM802) $(PLVM03) $(CMD) $(CMDJIT) $(JIT) $(JIT16) $(JITUNE) $(SOSCMD) $(PLASMAPLASM) $(CODEOPT) $(ARGS) $(MEMMGR) $(MEMTEST) $(FIBER) $(FIBERTEST) $(LONGJMP) $(ED) $(MON) $(SOS) $(ROD) $(SIEVE) $(UTHERNET2) $(UTHERNET) $(ETHERIP) $(INET) $(DHCP) $(HTTPD) $(ROGUE) $(ROGUEMAP) $(ROGUECOMBAT) $(GRAFIX) $(GFXDEMO) $(DGR) $(DGRTEST) $(FILEIO_APL) $(CONIO_APL) $(JOYBUZZ) $(PORTIO) $(SPIPORT) $(SDFAT) $(FATCAT) $(FATGET) $(FATPUT) $(FATWDSK) $(FATRDSK) $(SANE) $(FPSTR) $(FPU) $(SANITY) $(RPNCALC) $(SNDSEQ) $(PLAYSEQ) -rm vmsrc/plvmzp.inc c64: $(PLVMZP_C64) $(PLASM) $(PLVM) $(PLVMC64) @@ -370,6 +371,10 @@ $(JIT): libsrc/apple/jit.pla libsrc/jitcore.pla $(PLVMJIT) $(PLASM) ./$(PLASM) -AMO < libsrc/apple/jit.pla > libsrc/apple/jit.a acme --setpc 4094 -o $(JIT) libsrc/apple/jit.a +$(JIT16): libsrc/apple/jit16.pla libsrc/jit16core.pla $(PLVMJIT) $(PLASM) + ./$(PLASM) -AMO < libsrc/apple/jit16.pla > libsrc/apple/jit16.a + acme --setpc 4094 -o $(JIT16) libsrc/apple/jit16.a + $(JITUNE): libsrc/apple/jitune.pla $(PLVMJIT) $(PLASM) ./$(PLASM) -AMO < libsrc/apple/jitune.pla > libsrc/apple/jitune.a acme --setpc 4094 -o $(JITUNE) libsrc/apple/jitune.a diff --git a/src/mkrel b/src/mkrel index 395ca51..bde649c 100755 --- a/src/mkrel +++ b/src/mkrel @@ -33,6 +33,7 @@ cp rel/apple/UTHERNET2#FE1000 prodos/sys/UTHERNET2.REL cp rel/apple/SOS#FE1000 prodos/sys/SOS.REL cp rel/apple/GRAFIX#FE1000 prodos/sys/GRAFIX.REL cp rel/apple/JIT#FE1000 prodos/sys/JIT.REL +cp rel/apple/JIT16#FE1000 prodos/sys/JIT16.REL cp rel/apple/JITUNE#FE1000 prodos/sys/JITUNE.REL cp ../sysfiles/FP6502.CODE#060000 prodos/sys/FP6502.CODE.BIN cp ../sysfiles/ELEMS.CODE#060000 prodos/sys/ELEMS.CODE.BIN diff --git a/src/vmsrc/apple/cmdjit.pla b/src/vmsrc/apple/cmdjit.pla index 88ed673..184a2c1 100755 --- a/src/vmsrc/apple/cmdjit.pla +++ b/src/vmsrc/apple/cmdjit.pla @@ -41,6 +41,7 @@ end // const jitcomp = $03E2 const jitcodeptr = $03E4 +const jitmod = $02E0 // // Pedefined functions. // @@ -65,10 +66,6 @@ byte jitsize = 0 // byte cmdln = "" // -// DCI version of JIT -// -byte jitmod = 'J'|$80, 'I'|$80, 'T' -// // Name for auto-run file (must follow cmdln) // byte autorun = "AUTORUN" @@ -1023,7 +1020,7 @@ end // def adddef(isfirst, addr, deflast)#1 word preventry, defentry, defsize - + defentry = *deflast *deflast = defentry + t_defentry if not isfirst @@ -1426,7 +1423,7 @@ loop strcat(strcpy(@sysmods, $280), "SYS/")) // This is the path to CMD syspath = @sysmods // Update external interface table syscmdln = @cmdln -loadmod(@jitmod) +loadmod(jitmod) xheap = $0800 // Reset heap to point at low memory xheaptop = $A000 // Top where JIT loaded // diff --git a/src/vmsrc/apple/plvm802.s b/src/vmsrc/apple/plvm802.s index ee1d012..26906da 100644 --- a/src/vmsrc/apple/plvm802.s +++ b/src/vmsrc/apple/plvm802.s @@ -64,6 +64,7 @@ OPPAGE = OPIDX+1 ; BUFFER ADDRESSES ; STRBUF = $0280 +JITMOD = $02E0 INTERP = $03D0 JITCOMP = $03E2 JITCODE = $03E4 @@ -342,6 +343,19 @@ BYE LDY DEFCMD ; STY $01FF CMDENTRY = * ; +; SET DCI STRING FOR JIT MODULE +; + LDA #'J'|$80 + STA JITMOD+0 + LDA #'I'|$80 + STA JITMOD+1 + LDA #'T'|$80 + STA JITMOD+2 + LDA #'1'|$80 + STA JITMOD+3 + LDA #'6' + STA JITMOD+4 +; ; DEACTIVATE 80 COL CARDS ; BIT ROMEN diff --git a/src/vmsrc/apple/plvmjit02.s b/src/vmsrc/apple/plvmjit02.s index e00b664..f0d57f8 100755 --- a/src/vmsrc/apple/plvmjit02.s +++ b/src/vmsrc/apple/plvmjit02.s @@ -51,6 +51,7 @@ IPH = IPL+1 OPIDX = FETCHOP+6 OPPAGE = OPIDX+1 STRBUF = $0280 +JITMOD = $02E0 INTERP = $03D0 JITCOMP = $03E2 JITCODE = $03E4 @@ -277,6 +278,15 @@ BYE LDY DEFCMD ; STY $01FF CMDENTRY = * ; +; SET DCI STRING FOR JIT MODULE +; + LDA #'J'|$80 + STA JITMOD+0 + LDA #'I'|$80 + STA JITMOD+1 + LDA #'T' + STA JITMOD+2 +; ; DEACTIVATE 80 COL CARDS ; BIT ROMEN