1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2024-07-05 04:28:57 +00:00

Sync cmd exported sysroutines

This commit is contained in:
David Schmenk 2018-03-17 15:52:15 -07:00
parent 3356cdd036
commit a9237f58cc
4 changed files with 25 additions and 12 deletions

View File

@ -6,7 +6,7 @@ PLVM01 = rel/apple/A1PLASMA\#060280
PLVM02 = rel/apple/PLASMA.SYSTEM\#FF2000 PLVM02 = rel/apple/PLASMA.SYSTEM\#FF2000
PLVM802 = rel/apple/PLASMA16.SYSTEM\#FF2000 PLVM802 = rel/apple/PLASMA16.SYSTEM\#FF2000
PLVM03 = rel/apple/SOS.INTERP\#050000 PLVM03 = rel/apple/SOS.INTERP\#050000
SOSCMD = rel/apple/SOS.CMD\#0FE1000 SOSCMD = rel/apple/SOS.CMD\#FE1000
CMD = rel/apple/CMD\#061000 CMD = rel/apple/CMD\#061000
PLVMZP_C64 = vmsrc/c64/plvmzp.inc PLVMZP_C64 = vmsrc/c64/plvmzp.inc
PLVMC64 = rel/c64/PLASMA PLVMC64 = rel/c64/PLASMA

View File

@ -34,14 +34,15 @@ predef crout()#0, cout(c)#0, prstr(s)#0, prbyte(b)#0, prword(w)#0, print(i)#0, c
predef markheap()#1, allocheap(size)#1, allocalignheap(size, pow2, freeaddr)#1, releaseheap(newheap)#1, availheap()#1 predef markheap()#1, allocheap(size)#1, allocalignheap(size, pow2, freeaddr)#1, releaseheap(newheap)#1, availheap()#1
predef memset(addr,value,size)#0, memcpy(dst,src,size)#0, strcpy(dst,src)#1, strcat(dst,src)#1 predef memset(addr,value,size)#0, memcpy(dst,src,size)#0, strcpy(dst,src)#1, strcat(dst,src)#1
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 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 predef execmod(modfile)#1, open(path)#1, close(refnum)#1, read(refnum, buff, len)#1, write(refnum, buff, len)#1
// //
// Exported CMDSYS table // Exported CMDSYS table
// //
word version = $0200 // 02.00 Dev word version = $0200 // 02.00 Dev
word syspath word syspath
word syscmdln word syscmdln
word = @execmod word = @execmod, @open, @close, @read, @write
byte perr
// //
// Working input buffer overlayed with strings table // Working input buffer overlayed with strings table
// //
@ -117,7 +118,6 @@ word sysmodsym = @exports
// System variable. // System variable.
// //
word systemflags = 0 word systemflags = 0
byte perr
word heap word heap
word xheap = $0800 word xheap = $0800
word lastsym = symtbl word lastsym = symtbl
@ -898,6 +898,17 @@ def read(refnum, buff, len)#1
perr = syscall($CA, @params) perr = syscall($CA, @params)
return params:6 return params:6
end end
def write(refnum, buf, len)#1
byte params[8]
params.0 = 4
params.1 = refnum
params:2 = buf
params:4 = len
params:6 = 0
perr = syscall($CB, @params)
return params:6
end
// //
// Heap routines. // Heap routines.
// //

View File

@ -79,15 +79,13 @@ def dev_info(devnum, name, list, listlen)#1
end end
def init_cons()#0 def init_cons()#0
byte nlmode[2] byte nlmode[2]
if !cmdsys.refcons cmdsys.refcons = cmdsys:sysopen(@console)
cmdsys.refcons = cmdsys:sysopen(@console) cmdsys:syswrite(cmdsys.refcons, @textmode, 3)
fin
cmdsys:syswrite(refcons, @textmode, 3)
cmdsys.devcons = dev_getnum(@console) cmdsys.devcons = dev_getnum(@console)
nlmode:0 = $0D80 nlmode:0 = $0D80
//nlmode.0 = $80 //nlmode.0 = $80
//nlmode.1 = $0D //nlmode.1 = $0D
dev_control(devcons, $02, @nlmode) dev_control(cmdsys.devcons, $02, @nlmode)
end end
def volume(devname, volname)#1 def volume(devname, volname)#1
byte params[9] byte params[9]
@ -219,6 +217,10 @@ def parsecmd(strptr)#1
return cmd return cmd
end end
// //
// Clear out module memory segment
//
cmdsys.modid = 0
//
// Init console. // Init console.
// //
init_cons init_cons
@ -279,7 +281,7 @@ while 1
saveX saveX
cmdsys:modexec(striptrail(cmdptr)) cmdsys:modexec(striptrail(cmdptr))
restoreX restoreX
//close(0) cmdsys:sysclose(0)
init_cons init_cons
break break
otherwise otherwise

View File

@ -33,9 +33,10 @@ word version = $0200 // 02.00
word syspath word syspath
word cmdlnptr word cmdlnptr
word = @execmod, @open, @close, @read, @write word = @execmod, @open, @close, @read, @write
byte perr
byte modid = 0
byte refcons = 0 byte refcons = 0
byte devcons = 0 byte devcons = 0
byte modid = 0
// //
// String pool. // String pool.
// //
@ -117,7 +118,6 @@ word systemflags = 0
word heap = $2000 word heap = $2000
byte modseg[15] byte modseg[15]
word symtbl, lastsym word symtbl, lastsym
byte perr
// //
// CALL SOS // CALL SOS
// SYSCALL(CMD, PARAMS) // SYSCALL(CMD, PARAMS)