mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-04-07 01:38:18 +00:00
Add Apple /// non-jit default to free up a little memory and update images to DP2
This commit is contained in:
parent
8c885a6b8b
commit
64f4f56379
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
images/apple/PLASMA2-INET.PO
Normal file
BIN
images/apple/PLASMA2-INET.PO
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
15
src/makefile
15
src/makefile
@ -7,7 +7,9 @@ PLVM02 = rel/apple/PLASMA.SYSTEM\#FF2000
|
||||
PLVMJIT = rel/apple/PLVM.128\#FF2000
|
||||
PLVM802 = rel/apple/PLVM16\#FF2000
|
||||
PLVM03 = rel/apple/SOS.INTERP\#050000
|
||||
PLVMJIT03 = rel/apple/SOS.INTERPJIT\#050000
|
||||
SOSCMD = rel/apple/SOS.CMD\#FE1000
|
||||
SOSCMDJIT = rel/apple/SOS.CMDJIT\#FE1000
|
||||
CMD = rel/apple/CMD\#061000
|
||||
CMDJIT = rel/apple/CMD128\#061000
|
||||
PLVMZP_C64 = vmsrc/c64/plvmzp.inc
|
||||
@ -100,7 +102,7 @@ TXTTYPE = .TXT
|
||||
#SYSTYPE = \#FF2000
|
||||
#TXTTYPE = \#040000
|
||||
|
||||
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) $(COPY) $(DEL) $(REN) $(CAT) $(NEWDIR) $(TYPE) $(SOS) $(ROD) $(SIEVE) $(PRIMEGAP) $(MOUSE) $(UTHERNET2) $(UTHERNET) $(ETHERIP) $(INET) $(DHCP) $(HTTPD) $(TFTPD) $(ROGUE) $(ROGUEMAP) $(ROGUECOMBAT) $(GRAFIX) $(GFXDEMO) $(LINES) $(HGRSPRITE) $(HGRLIB) $(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)
|
||||
apple: $(PLVMZP_APL) $(PLASM) $(PLVM) $(PLVM01) $(PLVM02) $(PLVMJIT) $(PLVM802) $(PLVM03) $(PLVMJIT03) $(CMD) $(CMDJIT) $(JIT) $(JIT17) $(JITUNE) $(SOSCMD) $(SOSCMDJIT) $(PLASMAPLASM) $(CODEOPT) $(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) $(GRAFIX) $(GFXDEMO) $(LINES) $(HGRSPRITE) $(HGRLIB) $(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)
|
||||
|
||||
-rm vmsrc/plvmzp.inc
|
||||
|
||||
@ -180,10 +182,14 @@ $(CMDJIT): vmsrc/apple/cmdjit.pla vmsrc/apple/cmdjitstub.s $(PLVMJIT) $(PLASM)
|
||||
./$(PLASM) -AOW < vmsrc/apple/cmdjit.pla > vmsrc/apple/cmdjit.a
|
||||
acme --setpc 8192 -o $(CMDJIT) vmsrc/apple/cmdjitstub.s
|
||||
|
||||
$(SOSCMD): vmsrc/apple/soscmd.pla libsrc/jitcore.pla $(PLVM03) $(PLASM)
|
||||
$(SOSCMD): vmsrc/apple/soscmd.pla $(PLVM03) $(PLASM)
|
||||
./$(PLASM) -AMOW < vmsrc/apple/soscmd.pla > vmsrc/apple/soscmd.a
|
||||
acme --setpc 4094 -o $(SOSCMD) vmsrc/apple/soscmd.a
|
||||
|
||||
$(SOSCMDJIT): vmsrc/apple/soscmdjit.pla libsrc/jitcore.pla $(PLVMJIT03) $(PLASM)
|
||||
./$(PLASM) -AMOW < vmsrc/apple/soscmdjit.pla > vmsrc/apple/soscmdjit.a
|
||||
acme --setpc 4094 -o $(SOSCMDJIT) vmsrc/apple/soscmdjit.a
|
||||
|
||||
$(PLVM02): vmsrc/apple/plvm02.s
|
||||
acme -o $(PLVM02) -l vmsrc/apple/plvm02.sym vmsrc/apple/plvm02.s
|
||||
|
||||
@ -199,6 +205,11 @@ vmsrc/apple/sossys.a: vmsrc/apple/sossys.pla $(PLASM)
|
||||
$(PLVM03): vmsrc/apple/plvm03.s vmsrc/apple/sossys.a
|
||||
acme -o $(PLVM03) -l vmsrc/apple/plvm03.sym vmsrc/apple/plvm03.s
|
||||
|
||||
vmsrc/apple/sossysjit.a: vmsrc/apple/sossysjit.pla $(PLASM)
|
||||
./$(PLASM) -AOW < vmsrc/apple/sossysjit.pla > vmsrc/apple/sossysjit.a
|
||||
|
||||
$(PLVMJIT03): vmsrc/apple/plvmjit03.s vmsrc/apple/sossysjit.a
|
||||
acme -o $(PLVMJIT03) -l vmsrc/apple/plvmjit03.sym vmsrc/apple/plvmjit03.s
|
||||
#
|
||||
# Sample code
|
||||
#
|
||||
|
40
src/mkrel
40
src/mkrel
@ -50,8 +50,12 @@ cp rel/apple/GRAFIX#FE1000 prodos/sys/GRAFIX.REL
|
||||
|
||||
rm -rf prodos/fpsos
|
||||
mkdir prodos/fpsos
|
||||
cp ../sysfiles/SOS.KERNEL#0C0000 prodos/fpsos/SOS.KERNEL.\$0C
|
||||
cp ../sysfiles/SOS.DRIVER#0C0000 prodos/fpsos/SOS.DRIVER.\$0C
|
||||
cp rel/apple/SOS.INTERP#050000 prodos/fpsos/SOS.INTERP.\$05
|
||||
cp rel/apple/SOS.CMD#FE1000 prodos/fpsos/SOS.CMD.REL
|
||||
cp rel/apple/SOS.INTERPJIT#050000 prodos/fpsos/SOS.INTERPJIT.\$05
|
||||
cp rel/apple/SOS.CMDJIT#FE1000 prodos/fpsos/SOS.CMDJIT.REL
|
||||
|
||||
mkdir prodos/fpsos/sys
|
||||
cp rel/apple/SOS#FE1000 prodos/fpsos/sys/SOS.REL
|
||||
@ -127,24 +131,24 @@ cp samplesrc/fatcat.pla prodos/bld/samples/FATCAT.PLA.TXT
|
||||
cp samplesrc/gfxdemo.pla prodos/bld/samples/GFXDEMO.PLA.TXT
|
||||
cp samplesrc/lz4cat.pla prodos/bld/samples/Z4CAT.PLA.TXT
|
||||
|
||||
mkdir prodos/bld/examples
|
||||
cp samplesrc/examples/ex.1.pla prodos/bld/examples/EX.1.PLA.TXT
|
||||
cp samplesrc/examples/ex.2.pla prodos/bld/examples/EX.2.PLA.TXT
|
||||
cp samplesrc/examples/ex.3.pla prodos/bld/examples/EX.3.PLA.TXT
|
||||
cp samplesrc/examples/ex.4.pla prodos/bld/examples/EX.4.PLA.TXT
|
||||
cp samplesrc/examples/ex.5.pla prodos/bld/examples/EX.5.PLA.TXT
|
||||
cp samplesrc/examples/ex.6.pla prodos/bld/examples/EX.6.PLA.TXT
|
||||
cp samplesrc/examples/ex.7.pla prodos/bld/examples/EX.7.PLA.TXT
|
||||
cp samplesrc/examples/ex.8.pla prodos/bld/examples/EX.8.PLA.TXT
|
||||
cp samplesrc/examples/ex.9.pla prodos/bld/examples/EX.9.PLA.TXT
|
||||
cp samplesrc/examples/ex.10.pla prodos/bld/examples/EX.10.PLA.TXT
|
||||
cp samplesrc/examples/ex.11.pla prodos/bld/examples/EX.11.PLA.TXT
|
||||
cp samplesrc/examples/ex.12.pla prodos/bld/examples/EX.12.PLA.TXT
|
||||
cp samplesrc/examples/ex.13.pla prodos/bld/examples/EX.13.PLA.TXT
|
||||
cp samplesrc/examples/ex.14.pla prodos/bld/examples/EX.14.PLA.TXT
|
||||
cp samplesrc/examples/ex.15.pla prodos/bld/examples/EX.15.PLA.TXT
|
||||
cp samplesrc/examples/ex.16.pla prodos/bld/examples/EX.16.PLA.TXT
|
||||
cp samplesrc/examples/ex.17.pla prodos/bld/examples/EX.17.PLA.TXT
|
||||
#mkdir prodos/bld/examples
|
||||
#cp samplesrc/examples/ex.1.pla prodos/bld/examples/EX.1.PLA.TXT
|
||||
#cp samplesrc/examples/ex.2.pla prodos/bld/examples/EX.2.PLA.TXT
|
||||
#cp samplesrc/examples/ex.3.pla prodos/bld/examples/EX.3.PLA.TXT
|
||||
#cp samplesrc/examples/ex.4.pla prodos/bld/examples/EX.4.PLA.TXT
|
||||
#cp samplesrc/examples/ex.5.pla prodos/bld/examples/EX.5.PLA.TXT
|
||||
#cp samplesrc/examples/ex.6.pla prodos/bld/examples/EX.6.PLA.TXT
|
||||
#cp samplesrc/examples/ex.7.pla prodos/bld/examples/EX.7.PLA.TXT
|
||||
#cp samplesrc/examples/ex.8.pla prodos/bld/examples/EX.8.PLA.TXT
|
||||
#cp samplesrc/examples/ex.9.pla prodos/bld/examples/EX.9.PLA.TXT
|
||||
#cp samplesrc/examples/ex.10.pla prodos/bld/examples/EX.10.PLA.TXT
|
||||
#cp samplesrc/examples/ex.11.pla prodos/bld/examples/EX.11.PLA.TXT
|
||||
#cp samplesrc/examples/ex.12.pla prodos/bld/examples/EX.12.PLA.TXT
|
||||
#cp samplesrc/examples/ex.13.pla prodos/bld/examples/EX.13.PLA.TXT
|
||||
#cp samplesrc/examples/ex.14.pla prodos/bld/examples/EX.14.PLA.TXT
|
||||
#cp samplesrc/examples/ex.15.pla prodos/bld/examples/EX.15.PLA.TXT
|
||||
#cp samplesrc/examples/ex.16.pla prodos/bld/examples/EX.16.PLA.TXT
|
||||
#cp samplesrc/examples/ex.17.pla prodos/bld/examples/EX.17.PLA.TXT
|
||||
|
||||
mkdir prodos/bld/inc
|
||||
cp inc/args.plh prodos/bld/inc/ARGS.PLH.TXT
|
||||
|
@ -1600,7 +1600,7 @@ def cmdmode#0
|
||||
word cmdptr, line
|
||||
|
||||
clrscrn
|
||||
puts("PLASMA Editor, Version 2.0 Dev\n")
|
||||
puts("PLASMA Editor, Version 2.0 DP2\n")
|
||||
while not exit
|
||||
puts(@filename)
|
||||
cmdptr = gets($BA)
|
||||
|
@ -507,7 +507,7 @@ include "toolsrc/parse.pla"
|
||||
//
|
||||
// Look at command line arguments and compile module
|
||||
//
|
||||
puts("PLASMA Compiler, Version 2.0 Dev\n")
|
||||
puts("PLASMA Compiler, Version 2.0 DP2\n")
|
||||
arg = argNext(argFirst)
|
||||
if ^arg and ^(arg + 1) == '-'
|
||||
opt = arg + 2
|
||||
|
@ -40,7 +40,7 @@ predef sext(a)#1, divmod(a,b)#2, execmod(modfile)#1
|
||||
//
|
||||
// Exported CMDSYS table
|
||||
//
|
||||
word version = $0110 // 01.10
|
||||
word version = $0200 // 02.00
|
||||
word syspath
|
||||
word syscmdln
|
||||
word = @execmod
|
||||
@ -52,7 +52,7 @@ byte perr, refauto
|
||||
// String pool.
|
||||
//
|
||||
byte autorun[] = "AUTORUN"
|
||||
byte verstr[] = "\nPLASMA "
|
||||
byte verstr[] = "\nPLASMA DP2"
|
||||
byte freestr[] = "MEM FREE:$"
|
||||
byte errorstr[] = "ERR:$"
|
||||
byte prompt[] = "PLASMA"
|
||||
|
@ -1383,7 +1383,7 @@ heap = @lastdef
|
||||
//
|
||||
// Print PLASMA version
|
||||
//
|
||||
prstr("PLASMA 2.0 Dev 64K\n")//; prbyte(version.1); cout('.'); prbyte(version.0); crout
|
||||
prstr("PLASMA 2.0 DP2 64K\n")//; prbyte(version.1); cout('.'); prbyte(version.0); crout
|
||||
//
|
||||
// Init symbol table.
|
||||
//
|
||||
|
@ -1460,7 +1460,7 @@ heap = @lastdef
|
||||
//
|
||||
// Print PLASMA version
|
||||
//
|
||||
prstr("PLASMA 2.0 Dev 128K\n")//; prbyte(version.1); cout('.'); prbyte(version.0); crout
|
||||
prstr("PLASMA 2.0 DP2 128K\n")//; prbyte(version.1); cout('.'); prbyte(version.0); crout
|
||||
//
|
||||
// Init symbol table.
|
||||
//
|
||||
|
@ -81,13 +81,9 @@ SEGSTART = $2000
|
||||
CMP #$B8
|
||||
BNE -
|
||||
LDA #$00 ; INIT JIT, FRAME & POOL POINTERS
|
||||
STA JITCOMP
|
||||
STA JITCOMP+1
|
||||
STA JITCODE
|
||||
STA PPL
|
||||
STA IFPL
|
||||
LDA #$90 ; RESERVE 4K FOR JITCODE
|
||||
STA JITCODE+1
|
||||
LDA #$A0 ; TOP OF RAM FOR FRAME POINER
|
||||
STA PPH
|
||||
STA IFPH
|
||||
LDX #$FF ; INIT STACK POINTER
|
||||
|
1436
src/vmsrc/apple/plvmjit03.s
Executable file
1436
src/vmsrc/apple/plvmjit03.s
Executable file
File diff suppressed because it is too large
Load Diff
@ -17,14 +17,9 @@ end
|
||||
//
|
||||
// Private addresses
|
||||
//
|
||||
const jitcbuf = $9000
|
||||
const codemax = $A000
|
||||
const cmdparser = $A0F0
|
||||
const jitcomp = $A0F2
|
||||
const jitcodeptr = $A0F4
|
||||
const sinterp = $A0F6
|
||||
const xinterp = $A0F8
|
||||
const jitinterp = $A0FA
|
||||
const estkh8 = $C000
|
||||
const estkh = $00C0
|
||||
const estkl8 = $D000
|
||||
@ -36,49 +31,6 @@ const tmpl8 = $E700
|
||||
const tmph8 = $E800
|
||||
word directentry, indirectentry
|
||||
//
|
||||
// COPY FROM EXT MEM TO MAIN MEM.
|
||||
//
|
||||
asm defcpy(dst, defentry)#0
|
||||
!SOURCE "vmsrc/plvmzp.inc"
|
||||
XPAGE = $1600
|
||||
SRCX = XPAGE+SRCH
|
||||
DSTX = XPAGE+DSTH
|
||||
|
||||
LDA ESTKL+1,X
|
||||
STA DSTL
|
||||
LDA ESTKH+1,X
|
||||
STA DSTH
|
||||
LDA ESTKL,X
|
||||
STA TMPL
|
||||
LDA ESTKH,X
|
||||
STA TMPH
|
||||
LDY #$05
|
||||
LDA (TMP),Y
|
||||
STA SRCX
|
||||
DEY
|
||||
LDA (TMP),Y
|
||||
STA SRCH
|
||||
DEY
|
||||
LDA (TMP),Y
|
||||
STA SRCL
|
||||
LDY #$07
|
||||
LDA (TMP),Y
|
||||
TAY
|
||||
DEY
|
||||
BEQ +
|
||||
- LDA (SRC),Y
|
||||
STA (DST),Y
|
||||
DEY
|
||||
BNE -
|
||||
+ LDA (SRC),Y
|
||||
STA (DST),Y
|
||||
STY SRCX
|
||||
INX
|
||||
INX
|
||||
RTS
|
||||
end
|
||||
include "libsrc/jitcore.pla"
|
||||
//
|
||||
// SOS routines
|
||||
// FILE I/O
|
||||
//
|
||||
@ -291,8 +243,7 @@ def shell#1
|
||||
volumes
|
||||
break
|
||||
is '+'
|
||||
*jitcodeptr = jitcbuf
|
||||
//cmdsys:modexec(striptrail(cmdptr))
|
||||
//cmdsys:modexec(striptrail(cmdptr))
|
||||
return striptrail(cmdptr)
|
||||
//cmdsys:syswrite(cmdsys.refcons, @textmode, 3)
|
||||
break
|
||||
@ -317,13 +268,7 @@ end
|
||||
//
|
||||
// Save pointer to command line handler
|
||||
//
|
||||
*cmdparser = @shell
|
||||
//
|
||||
// Install JIT compiler
|
||||
//
|
||||
*cmdparser = @shell
|
||||
directentry = *sinterp
|
||||
indirectentry = *xinterp
|
||||
*jitcomp = @compiler
|
||||
cmdsys.jitcount = 32
|
||||
cmdsys.jitsize = 96
|
||||
done
|
||||
|
329
src/vmsrc/apple/soscmdjit.pla
Executable file
329
src/vmsrc/apple/soscmdjit.pla
Executable file
@ -0,0 +1,329 @@
|
||||
include "inc/cmdsys.plh"
|
||||
sysflags nojitc // Keep JITC from compiling itself
|
||||
//
|
||||
// JIT compiler values
|
||||
//
|
||||
//
|
||||
// Indirect interpreter DEFinition entrypoint
|
||||
//
|
||||
struc t_defentry
|
||||
byte interpjsr
|
||||
word interpaddr
|
||||
word bytecodeaddr
|
||||
byte bytecodexbyte
|
||||
byte callcount
|
||||
byte bytecodesize
|
||||
end
|
||||
//
|
||||
// Private addresses
|
||||
//
|
||||
const jitcbuf = $9000
|
||||
const codemax = $A000
|
||||
const cmdparser = $A0F0
|
||||
const jitcomp = $A0F2
|
||||
const jitcodeptr = $A0F4
|
||||
const sinterp = $A0F6
|
||||
const xinterp = $A0F8
|
||||
const jitinterp = $A0FA
|
||||
const estkh8 = $C000
|
||||
const estkh = $00C0
|
||||
const estkl8 = $D000
|
||||
const estkl = $00D0
|
||||
const ifpl8 = $E000
|
||||
const ifph8 = $E100
|
||||
const jmptmp = $00E6
|
||||
const tmpl8 = $E700
|
||||
const tmph8 = $E800
|
||||
word directentry, indirectentry
|
||||
//
|
||||
// COPY FROM EXT MEM TO MAIN MEM.
|
||||
//
|
||||
asm defcpy(dst, defentry)#0
|
||||
!SOURCE "vmsrc/plvmzp.inc"
|
||||
XPAGE = $1600
|
||||
SRCX = XPAGE+SRCH
|
||||
DSTX = XPAGE+DSTH
|
||||
|
||||
LDA ESTKL+1,X
|
||||
STA DSTL
|
||||
LDA ESTKH+1,X
|
||||
STA DSTH
|
||||
LDA ESTKL,X
|
||||
STA TMPL
|
||||
LDA ESTKH,X
|
||||
STA TMPH
|
||||
LDY #$05
|
||||
LDA (TMP),Y
|
||||
STA SRCX
|
||||
DEY
|
||||
LDA (TMP),Y
|
||||
STA SRCH
|
||||
DEY
|
||||
LDA (TMP),Y
|
||||
STA SRCL
|
||||
LDY #$07
|
||||
LDA (TMP),Y
|
||||
TAY
|
||||
DEY
|
||||
BEQ +
|
||||
- LDA (SRC),Y
|
||||
STA (DST),Y
|
||||
DEY
|
||||
BNE -
|
||||
+ LDA (SRC),Y
|
||||
STA (DST),Y
|
||||
STY SRCX
|
||||
INX
|
||||
INX
|
||||
RTS
|
||||
end
|
||||
include "libsrc/jitcore.pla"
|
||||
//
|
||||
// SOS routines
|
||||
// FILE I/O
|
||||
//
|
||||
def getpfx(path)#1
|
||||
byte params[4]
|
||||
|
||||
^path = 0
|
||||
params.0 = 2
|
||||
params:1 = path
|
||||
params.3 = 128
|
||||
syscall($C7, @params)
|
||||
return path
|
||||
end
|
||||
def setpfx(path)#1
|
||||
byte params[6]
|
||||
byte fileinfo[2]
|
||||
|
||||
params.0 = 3
|
||||
params:1 = path
|
||||
params:3 = @fileinfo
|
||||
params.5 = 2
|
||||
if not syscall($C4, @params) and (fileinfo.1 == $00 or fileinfo.1 == $0F) // Make sure it's a directory
|
||||
params.0 = 1
|
||||
params:1 = path
|
||||
syscall($C6, @params)
|
||||
else
|
||||
getpfx(path) // Get current path
|
||||
fin
|
||||
return path
|
||||
end
|
||||
def dev_info(devnum, name, list, listlen)#1
|
||||
byte params[7]
|
||||
|
||||
params.0 = 4
|
||||
params.1 = devnum
|
||||
params:2 = name
|
||||
params:4 = list
|
||||
params.6 = listlen
|
||||
return syscall($85, @params)
|
||||
end
|
||||
def volume(devname, volname)#1
|
||||
byte params[9]
|
||||
|
||||
params.0 = 4
|
||||
params:1 = devname
|
||||
params:3 = volname
|
||||
params:5 = 0
|
||||
params:7 = 0
|
||||
return syscall($C5, @params)
|
||||
end
|
||||
//
|
||||
// Command mode
|
||||
//
|
||||
def volumes()#0
|
||||
byte info[11]
|
||||
byte devname[17]
|
||||
byte volname[17]
|
||||
byte i
|
||||
|
||||
for i = $01 to $18
|
||||
if dev_info(i, @devname, @info, 11) == 0
|
||||
puts(@devname)
|
||||
if volume(@devname, @volname) == 0
|
||||
puts(" => /")
|
||||
puts(@volname)
|
||||
putc('/')
|
||||
fin
|
||||
putln
|
||||
fin
|
||||
next
|
||||
end
|
||||
def catalog(path)#0
|
||||
byte refnum
|
||||
byte firstblk
|
||||
byte entrylen, entriesblk
|
||||
byte i, type, len
|
||||
word entry, filecnt, catptr
|
||||
|
||||
if !^path
|
||||
getpfx(path)
|
||||
fin
|
||||
refnum = cmdsys:sysopen(path)
|
||||
if not refnum
|
||||
return
|
||||
fin
|
||||
catptr = heapmark
|
||||
firstblk = 1
|
||||
repeat
|
||||
if cmdsys:sysread(refnum, catptr, 512) == 512
|
||||
entry = catptr + 4
|
||||
if firstblk
|
||||
entrylen = catptr->$23
|
||||
entriesblk = catptr->$24
|
||||
filecnt = catptr=>$25
|
||||
entry = entry + entrylen
|
||||
fin
|
||||
for i = firstblk to entriesblk
|
||||
if ^entry
|
||||
^entry = ^entry & $0F
|
||||
puts(entry)
|
||||
type = ' '
|
||||
when entry->$10
|
||||
is $0F // Is it a directory?
|
||||
type = '/'
|
||||
break
|
||||
is $FF // SYSTEM file
|
||||
type = '-'
|
||||
break
|
||||
is $FE // REL file
|
||||
type = '+'
|
||||
wend
|
||||
putc(type)
|
||||
for len = ^entry to 18
|
||||
putc(' ')
|
||||
next
|
||||
filecnt--
|
||||
fin
|
||||
entry = entry + entrylen
|
||||
next
|
||||
firstblk = 0
|
||||
else
|
||||
filecnt = 0
|
||||
fin
|
||||
until filecnt == 0
|
||||
cmdsys:sysclose(refnum)
|
||||
putln()
|
||||
end
|
||||
def stripchars(strptr)#1
|
||||
while ^strptr and ^(strptr + 1) > ' '
|
||||
memcpy(strptr + 1, strptr + 2, ^strptr)
|
||||
^strptr--
|
||||
loop
|
||||
return ^strptr
|
||||
end
|
||||
def stripspaces(strptr)#0
|
||||
while ^strptr and ^(strptr + ^strptr) <= ' '
|
||||
^strptr--
|
||||
loop
|
||||
while ^strptr and ^(strptr + 1) <= ' '
|
||||
memcpy(strptr + 1, strptr + 2, ^strptr)
|
||||
^strptr--
|
||||
loop
|
||||
end
|
||||
def striptrail(strptr)#1
|
||||
byte i
|
||||
|
||||
for i = 1 to ^strptr
|
||||
if ^(strptr + i) <= ' '
|
||||
^strptr = i - 1
|
||||
break
|
||||
fin
|
||||
next
|
||||
return strptr
|
||||
end
|
||||
def parsecmd(strptr)#1
|
||||
byte cmd
|
||||
|
||||
cmd = 0
|
||||
stripspaces(strptr)
|
||||
if ^strptr
|
||||
cmd = ^(strptr + 1)
|
||||
memcpy(strptr + 1, strptr + 2, ^strptr)
|
||||
^strptr--
|
||||
fin
|
||||
stripspaces(strptr)
|
||||
return cmd
|
||||
end
|
||||
//
|
||||
// Command line handler
|
||||
//
|
||||
def shell#1
|
||||
byte textmode[3]
|
||||
byte prefix[64]
|
||||
byte err[]
|
||||
word cmdptr
|
||||
//
|
||||
// Copy AUTORUN commmand line
|
||||
//
|
||||
cmdptr = strcpy(heapmark, cmdsys:cmdline)
|
||||
//
|
||||
// Handle commands.
|
||||
//
|
||||
repeat
|
||||
if ^cmdptr
|
||||
when toupper(parsecmd(cmdptr))
|
||||
is 'C'
|
||||
catalog(cmdptr)
|
||||
break
|
||||
is 'P'
|
||||
if ^cmdptr and ^(cmdptr + 1) <> '/'
|
||||
strcat(@prefix, cmdptr)
|
||||
else
|
||||
strcpy(@prefix, cmdptr)
|
||||
fin
|
||||
setpfx(@prefix)
|
||||
break
|
||||
is '/'
|
||||
repeat
|
||||
prefix--
|
||||
until prefix[prefix] == '/'
|
||||
if prefix > 1
|
||||
setpfx(@prefix)
|
||||
fin
|
||||
break
|
||||
is 'S'
|
||||
setpfx(cmdptr)
|
||||
strcat(getpfx(cmdsys:syspath), "SYS/"))
|
||||
break
|
||||
is 'V'
|
||||
volumes
|
||||
break
|
||||
is '+'
|
||||
*jitcodeptr = jitcbuf
|
||||
//cmdsys:modexec(striptrail(cmdptr))
|
||||
return striptrail(cmdptr)
|
||||
//cmdsys:syswrite(cmdsys.refcons, @textmode, 3)
|
||||
break
|
||||
otherwise
|
||||
puts("?\n")
|
||||
wend
|
||||
if cmdsys.syserr
|
||||
err = cmdsys.syserr
|
||||
puts("ERR:$")
|
||||
putb(err)
|
||||
else
|
||||
puts("OK")
|
||||
fin
|
||||
putln
|
||||
fin
|
||||
puts(getpfx(@prefix))
|
||||
cmdptr = gets($BA)
|
||||
strcpy(cmdsys:cmdline, cmdptr)
|
||||
until 0
|
||||
return 0
|
||||
end
|
||||
//
|
||||
// Save pointer to command line handler
|
||||
//
|
||||
*cmdparser = @shell
|
||||
//
|
||||
// Install JIT compiler
|
||||
//
|
||||
directentry = *sinterp
|
||||
indirectentry = *xinterp
|
||||
*jitcomp = @compiler
|
||||
cmdsys.jitcount = 32
|
||||
cmdsys.jitsize = 96
|
||||
done
|
@ -23,7 +23,6 @@ const modinitkeep = $4000
|
||||
const instr = $A020
|
||||
const cmdparser = $A0F0
|
||||
const xinterp = $A0F8
|
||||
const jitinterp = $A0FA
|
||||
//
|
||||
// Indirect interpreter DEFinition entrypoint
|
||||
//
|
||||
@ -32,17 +31,8 @@ struc t_defentry
|
||||
word interpaddr
|
||||
word bytecodeaddr
|
||||
byte bytecodexbyte
|
||||
byte callcount
|
||||
byte bytecodesize
|
||||
end
|
||||
//
|
||||
// JIT compiler values
|
||||
//
|
||||
const jitcbuf = $9000
|
||||
const jitcomp = $A0F2
|
||||
const jitcodeptr = $A0F4
|
||||
const codemax = $A000
|
||||
//
|
||||
// Pedefined functions.
|
||||
//
|
||||
predef syscall(cmd,params)#1, call(addr,areg,xreg,yreg,status)#1
|
||||
@ -1027,19 +1017,10 @@ def lookupextern(esd, index)#1
|
||||
fin
|
||||
return 0
|
||||
end
|
||||
def adddef(isfirst, ext, addr, deflast)#1
|
||||
def adddef(ext, addr, deflast)#1
|
||||
word preventry, defentry, defsize
|
||||
defentry = *deflast
|
||||
*deflast = defentry + t_defentry
|
||||
if not isfirst
|
||||
preventry = defentry - t_defentry
|
||||
defsize = addr - preventry=>bytecodeaddr
|
||||
if defsize <= jitsize
|
||||
preventry=>interpaddr = *jitinterp // JSR JITINTRP
|
||||
preventry->callcount = jitcount // Set JIT countdown
|
||||
preventry->bytecodesize = defsize // Set size
|
||||
fin
|
||||
fin
|
||||
defentry->interpjsr = $20 // JSR
|
||||
defentry=>interpaddr = *xinterp // XINTERP
|
||||
defentry=>bytecodeaddr = addr
|
||||
@ -1048,11 +1029,11 @@ def adddef(isfirst, ext, addr, deflast)#1
|
||||
return defentry
|
||||
end
|
||||
def loadmod(mod)#1
|
||||
word refnum[], deffirst, rdlen, modsize, bytecode, codefix, defofst, defcnt, init, initcode[], fixup
|
||||
word refnum[], rdlen, modsize, bytecode, codefix, defofst, defcnt, init, initcode[], fixup
|
||||
word addr, defaddr, modaddr, modfix, modofst, modend
|
||||
word deftbl, deflast, codeseg
|
||||
word moddep, rld, esd, sym
|
||||
byte lerr, defext, skipjit, fileinfo[], str[16], filename[33]
|
||||
byte lerr, defext, fileinfo[], str[16], filename[33]
|
||||
byte header[128]
|
||||
lerr = 0
|
||||
//
|
||||
@ -1087,7 +1068,6 @@ def loadmod(mod)#1
|
||||
// This is an EXTended RELocatable (data+bytecode) module.
|
||||
//
|
||||
systemflags = header.4 | systemflags
|
||||
skipjit = header.5 & (nojitc >> 8)
|
||||
defofst = header:6
|
||||
defcnt = header:8
|
||||
init = header:10
|
||||
@ -1173,14 +1153,12 @@ def loadmod(mod)#1
|
||||
//
|
||||
// Run through the DeFinition Dictionary.
|
||||
//
|
||||
deffirst = 1
|
||||
while ^rld == $02
|
||||
//
|
||||
// This is a bytcode def entry - add it to the def directory.
|
||||
//
|
||||
adddef(deffirst, defext, rld=>1 + defofst, @deflast)
|
||||
deffirst = skipjit // Calculate JIT potential or not
|
||||
rld = rld + 4
|
||||
adddef(defext, rld=>1 + defofst, @deflast)
|
||||
rld = rld + 4
|
||||
loop
|
||||
//
|
||||
// Run through the Re-Location Dictionary.
|
||||
@ -1234,7 +1212,7 @@ def loadmod(mod)#1
|
||||
//
|
||||
initcode = 0
|
||||
if init
|
||||
initcode = adddef(deffirst, defext, init + defofst, @deflast)()
|
||||
initcode = adddef(defext, init + defofst, @deflast)()
|
||||
if initcode < 0
|
||||
perr = -initcode
|
||||
fin
|
||||
@ -1286,7 +1264,7 @@ cmdlnptr = @cmdln
|
||||
// Print PLASMA version
|
||||
//
|
||||
init_cons
|
||||
prstr("PLASMA 2.0 Dev JITC\n")//; putb(version.1); putc('.'); putb(version.0); putln
|
||||
prstr("PLASMA 2.0 DP2\n")//; putb(version.1); putc('.'); putb(version.0); putln
|
||||
prstr("MEM:$"); prword(availheap); crout
|
||||
//
|
||||
// Exec command line parser
|
||||
|
1309
src/vmsrc/apple/sossysjit.pla
Executable file
1309
src/vmsrc/apple/sossysjit.pla
Executable file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user