diff --git a/ROGUE.PO b/ROGUE.PO new file mode 100644 index 0000000..a1de91d Binary files /dev/null and b/ROGUE.PO differ diff --git a/SANDBOX.PO b/SANDBOX.PO index b7d6249..ae6a3c3 100644 Binary files a/SANDBOX.PO and b/SANDBOX.PO differ diff --git a/src/inc/stdlib.plh b/src/inc/cmdsys.plh similarity index 97% rename from src/inc/stdlib.plh rename to src/inc/cmdsys.plh index 886e59a..4928ded 100644 --- a/src/inc/stdlib.plh +++ b/src/inc/cmdsys.plh @@ -1,4 +1,4 @@ -import stdlib +import cmdsys predef putc, putln, puts, getc, gets predef call, syscall predef heapmark, heapallocallign, heapalloc, heaprelease, heapavail diff --git a/src/libsrc/memmgr.pla b/src/libsrc/memmgr.pla index 30a3177..a0d6191 100644 --- a/src/libsrc/memmgr.pla +++ b/src/libsrc/memmgr.pla @@ -1,8 +1,8 @@ // // Handle based swapping memory manager // -import stdlib - predef syscall, call, memset, getc, gets, putc, puts, putln +import cmdsys + predef syscall, call, getc, gets, putc, puts, putln predef memset, memcpy, modaddr, modexec predef heapmark, heapallocalign, heapalloc, heaprelease predef isugt, isuge, isult, isule @@ -163,7 +163,7 @@ end def get_info(path, infoptr) byte params[18] - memset(@params, 18, 0) + memset(@params, 0, 18) params.0 = 10 params:1 = path syscall($C4, @params) @@ -609,7 +609,7 @@ export def hmemNew(size) // Allocate a new page table // hpgtbl[page] = heapalloc(PG_SIZE) - memset(hpgtbl[page], PG_SIZE, HMEM_AVAIL) + memset(hpgtbl[page], HMEM_AVAIL, PG_SIZE) //puts(@allocpgstr);puth(hpgtbl[page]);putln // // Check if we need to allocate the memory pool diff --git a/src/samplesrc/dhcp.pla b/src/samplesrc/dhcp.pla index b8d948f..7bee64a 100644 --- a/src/samplesrc/dhcp.pla +++ b/src/samplesrc/dhcp.pla @@ -1,8 +1,8 @@ // // DHCP // -import stdlib - predef syscall, call, memset, getc, gets, putc, puts, putln +import cmdsys + predef syscall, call, getc, gets, putc, puts, putln predef memset, memcpy, modaddr, modexec predef heapmark, heapallocalign, heapalloc, heaprelease byte MACHID @@ -187,11 +187,11 @@ memcpy(@DHCP.dhcp_clientha, @localha, 6) // // Clear our local IP address // -memset(@localip, 4, 0) +memset(@localip, 0, 4) // // Set subnet mask to all 1's // -memset(@subnet_mask, 4, IP_BROADCAST) +memset(@subnet_mask, IP_BROADCAST, 4) // // Prepare to receive DHCP packets from a server // diff --git a/src/samplesrc/etherip.pla b/src/samplesrc/etherip.pla index d48cbe8..3504c44 100644 --- a/src/samplesrc/etherip.pla +++ b/src/samplesrc/etherip.pla @@ -1,5 +1,5 @@ -import stdlib - predef syscall, call, memset, getc, gets, putc, puts, putln +import cmdsys + predef syscall, call, getc, gets, putc, puts, putln predef memset, memcpy, modaddr, modexec predef heapmark, heapallocalign, heapalloc, heaprelease byte MACHID @@ -422,8 +422,8 @@ export def sendIP(ipdst, proto, seglist, size) hdr:ip_chksm = 0 memcpy(@hdr.ip_src, @localip, IPADR_SIZE) if !ipdst // IP_BROADCAST - memset(@hdr.ip_dst, IPADR_SIZE, IP_BROADCAST) - memset(@dstha, MAC_SIZE, MAC_BROADCAST) + memset(@hdr.ip_dst, IP_BROADCAST, IPADR_SIZE) + memset(@dstha, MAC_BROADCAST, MAC_SIZE) else retry = 0 while ipdst=>0 <> remoteip:0 and ipdst=>2 <> remoteip:2 @@ -431,9 +431,9 @@ export def sendIP(ipdst, proto, seglist, size) return -1 // ARP failed fin retry = retry + 1 - memset(@dstMAC, MAC_SIZE, MAC_BROADCAST) - memset(@remoteha, MAC_SIZE, 0) - memcpy(@remoteip, ipdst, IPADR_SIZE) + memset(@dstMAC, MAC_BROADCAST, MAC_SIZE) + memset(@remoteha, 0, MAC_SIZE) + memcpy(@remoteip, ipdst, IPADR_SIZE) opARP = ARP_REQST writeEther(@ARP, t_earp) for timeout = 1000 downto 0 @@ -500,7 +500,7 @@ export def recvUDP(localport, callback, param) if !portsUDP portsUDP = heapalloc(MAX_UDP_NOTIFIES * t_notify) if !portsUDP; return -1; fin - memset(portsUDP, MAX_UDP_NOTIFIES * t_notify, 0) + memset(portsUDP, 0, MAX_UDP_NOTIFIES * t_notify) fin // // Look for an existing notification on localport diff --git a/src/samplesrc/hello.pla b/src/samplesrc/hello.pla index 36f52b6..fe78b6a 100644 --- a/src/samplesrc/hello.pla +++ b/src/samplesrc/hello.pla @@ -1,4 +1,4 @@ -import STDLIB +import cmdsys predef puts end diff --git a/src/samplesrc/hgr1.pla b/src/samplesrc/hgr1.pla index c9361dd..c0e7b33 100644 --- a/src/samplesrc/hgr1.pla +++ b/src/samplesrc/hgr1.pla @@ -1,4 +1,4 @@ -import STDLIB +import cmdsys predef memset // // System flags: memory allocator screen holes. @@ -13,7 +13,7 @@ end sysflags reshgr1 // Reserve HGR page 1 -memset($2000, $2000, 0) // Clear HGR page 1 +memset($2000, 0, $2000) // Clear HGR page 1 ^$C054 ^$C052 ^$C057 diff --git a/src/samplesrc/hgr1test.pla b/src/samplesrc/hgr1test.pla index 82a1b2a..ed707c6 100644 --- a/src/samplesrc/hgr1test.pla +++ b/src/samplesrc/hgr1test.pla @@ -1,4 +1,4 @@ -import STDLIB +import cmdsys predef memset, memcpy, getc, heapalloc, heapmark, heaprelease end import HGR1 diff --git a/src/samplesrc/icmp.pla b/src/samplesrc/icmp.pla index 78b0a8e..cb5af9c 100644 --- a/src/samplesrc/icmp.pla +++ b/src/samplesrc/icmp.pla @@ -1,8 +1,8 @@ // // ICMP service // -import stdlib - predef syscall, call, memset, getc, gets, putc, puts, putln +import cmdsys + predef syscall, call, getc, gets, putc, puts, putln predef memset, memcpy, modaddr, modexec predef heapmark, heapallocalign, heapalloc, heaprelease byte MACHID diff --git a/src/samplesrc/memtest.pla b/src/samplesrc/memtest.pla index f424a96..e055a73 100644 --- a/src/samplesrc/memtest.pla +++ b/src/samplesrc/memtest.pla @@ -1,4 +1,4 @@ -import stdlib +import cmdsys predef syscall, call, memset, getc, gets, putc, puts, putln predef memset, memcpy, modaddr, modexec predef heapmark, heapallocalign, heapalloc, heaprelease @@ -50,13 +50,13 @@ hmemDel(d) memfre=hmemFre(@memlrgst);puth(memfre); putc(' '); puth(memlrgst); putln memptr = hmemLock(a) -if memptr; memset(memptr, MAX_MEMBLK_SIZE, $1111); fin +if memptr; memset(memptr, $1111, MAX_MEMBLK_SIZE); fin hmemUnlock(a) memptr = hmemLock(b) -if memptr; memset(memptr, MAX_MEMBLK_SIZE, $2222); fin +if memptr; memset(memptr, $2222, MAX_MEMBLK_SIZE); fin hmemUnlock(b) memptr = hmemLock(c) -if memptr; memset(memptr, MAX_MEMBLK_SIZE, $3333); fin +if memptr; memset(memptr, $3333, MAX_MEMBLK_SIZE); fin hmemUnlock(c) memptr = hmemLock(a) if memptr; puth(a); putc('='); puth(*(memptr + MAX_MEMBLK_SIZE - 2)); putln; fin diff --git a/src/samplesrc/mon.pla b/src/samplesrc/mon.pla index 04be5ac..3b49838 100644 --- a/src/samplesrc/mon.pla +++ b/src/samplesrc/mon.pla @@ -1,4 +1,4 @@ -import stdlib +import cmdsys predef syscall, call, memset, getc, gets, putc, puts, putln predef memset, memcpy, modaddr, modexec predef heapmark, heapallocalign, heapalloc, heaprelease diff --git a/src/samplesrc/profile.pla b/src/samplesrc/profile.pla deleted file mode 100755 index 0fa01c2..0000000 --- a/src/samplesrc/profile.pla +++ /dev/null @@ -1,91 +0,0 @@ -// -// Include all imported modules and their data/functions. -// -include(stdlib.plh) -// -// Profile commands. -// -const stop = 0 -const start = 1 -const dump = 2 -// -// Declare all global variables for this module. -// -byte profstr[] = "PLASMA Profiler\n" -byte optstr[] = "Module to profile" -byte ttlstr[] = "Total executed opcodes: $" -byte hdrstr[] = " OP COUNT\n" -byte valstr[] = '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' -word cmdstr -byte opstats[260] -// -// Define functions. -// -asm equate - !SOURCE "vmsrc/plvmzp.inc" -end -asm profiler - LDA ESTKL,X - CMP #$02 - BNE + - INX - LDY ESTKL,X - STY DSTL - LDY ESTKH,X - STY DSTH -+ STX ESP - JSR $03E2 - LDX ESP - RTS -end -def printb(b) - putc(valstr[(b >> 4) & $0F]) - putc(valstr[ b & $0F]) -end -def printw(h) - putc(valstr[(h >> 12) & $0F]) - putc(valstr[(h >> 8) & $0F]) - putc(valstr[(h >> 4) & $0F]) - putc(valstr[ h & $0F]) -end -def printl(lo, hi) - printw(hi) - printw(lo) -end -def dumpstats - byte opcnt, linecnt - word longptr - profiler(@opstats, 2) - puts(@ttlstr) - printl(opstats:0, opstats:2) - putln - puts(@hdrstr) - longptr = @opstats:4 - linecnt = 0 - for opcnt = 0 to 63 - if (longptr):0 | (longptr):2 - putc('$') - printb(opcnt << 1) - putc(' ') - putc('$') - printl((longptr):0, (longptr):2) - linecnt = linecnt + 1 - if linecnt % 20 == 0 - getc - fin - putln - fin - longptr = longptr + 4 - next -end - -puts(@profstr) -puts(@optstr) -cmdstr = gets($BA) -if ^cmdstr - profiler(1) - modexec(cmdstr) - profiler(0) - dumpstats -fin -done diff --git a/src/samplesrc/rod.pla b/src/samplesrc/rod.pla index 0d94fe8..23edd46 100644 --- a/src/samplesrc/rod.pla +++ b/src/samplesrc/rod.pla @@ -1,4 +1,4 @@ -import STDLIB +import cmdsys predef syscall, call, memset, getc, putc, puts, modaddr byte MACHID end @@ -38,7 +38,7 @@ byte a1err[] = "Apple 1 not supported.\n" byte a3err[] = "Apple 3 version mismatch.\n" byte exitmsg[] = "Press any key to exit.\n" byte goodbye[] = "That's all, folks!\n" -byte stdlib[] = "STDLIB" +byte cmdsys[] = "cmdsys" // // Screen row address arrays. // @@ -212,8 +212,8 @@ def a3grmode(mix) dev_control(devcons, 17, @grcharset) a3viewport(0, 20, 40, 4) for i = 0 to mix - memset(txt1scrn[i], 40, $0000) // text screen - memset(txt2scrn[i], 40, $0000) // color screen + memset(txt1scrn[i], $0000, 40) // text screen + memset(txt2scrn[i], $0000, 40) // color screen next return grscrn(@txt2scrn) // point to color screen end @@ -264,8 +264,8 @@ when MACHID & $C8 gotoxy = @a3gotoxy grmode = @a3grmode textmode = @a3textmode - if modaddr(@stdlib):0 == $0010 - devcons = modaddr(@stdlib).5 // devcons variable from STDLIB + if modaddr(@cmdsys):0 == $0010 + devcons = modaddr(@cmdsys).5 // devcons variable from cmdsys else puts(@a3err) return diff --git a/src/samplesrc/rogue.combat.pla b/src/samplesrc/rogue.combat.pla index 359390e..fea5868 100644 --- a/src/samplesrc/rogue.combat.pla +++ b/src/samplesrc/rogue.combat.pla @@ -1,4 +1,4 @@ -import STDLIB +import cmdsys predef syscall, call, memset, getc, putc, puts, putln predef memset, memcpy predef heapmark, heapallocalign, heapalloc, heaprelease, heapavail diff --git a/src/samplesrc/rogue.io.pla b/src/samplesrc/rogue.io.pla index 5d710e2..e9f2e4f 100644 --- a/src/samplesrc/rogue.io.pla +++ b/src/samplesrc/rogue.io.pla @@ -1,4 +1,4 @@ -import STDLIB +import cmdsys predef syscall, call, getc, putc, puts, putln predef memset, memcpy, modaddr predef heapmark, heapallocalign, heapalloc, heaprelease, heapavail @@ -8,7 +8,7 @@ end const modkeep = $2000 const modinitkeep = $4000 -byte stdlib = "STDLIB" +byte cmdsys = "cmdsys" byte[] initstr byte = " ( )\n" @@ -251,7 +251,7 @@ when MACHID & $C8 home = @a3home gotoxy = @a3gotoxy tone = @a3tone - devcons = modaddr(@stdlib).5 // devcons variable from STDLIB + devcons = modaddr(@cmdsys).5 // devcons variable from cmdsys open = @a3open read = @a3read close = @a3close diff --git a/src/samplesrc/rogue.map.pla b/src/samplesrc/rogue.map.pla index c2ee9a7..774a62e 100644 --- a/src/samplesrc/rogue.map.pla +++ b/src/samplesrc/rogue.map.pla @@ -1,15 +1,14 @@ // // Map module // - -import STDLIB +import cmdsys predef syscall, call, getc, putc, puts, putln predef memset, memcpy, modaddr predef heapmark, heapallocalign, heapalloc, heaprelease, heapavail byte MACHID end -import ROGUEIO +import rogueio const O_READ = 1 const O_WRITE = 2 const O_READ_WRITE = 3 @@ -173,14 +172,14 @@ export def loadmap(level) if not viewmap viewmap = heapalloc(mapsize) fin - memset(viewmap, mapsize, $A0A0) + memset(viewmap, $A0A0, mapsize) // // Load catacomb map from file // if not map map = heapalloc(mapsize) fin - memset(map, mapsize, $2323) // Solid walls + memset(map, $2323, mapsize) // Solid walls // // Set level map and read it // diff --git a/src/samplesrc/rogue.pla b/src/samplesrc/rogue.pla index 44b21db..be37d78 100755 --- a/src/samplesrc/rogue.pla +++ b/src/samplesrc/rogue.pla @@ -1,11 +1,11 @@ -import STDLIB +import cmdsys predef syscall, call, memset, getc, gets, putc, puts, putln predef memset, memcpy predef heapmark, heapallocalign, heapalloc, heaprelease, heapavail byte MACHID end -import ROGUEMAP +import roguemap const xcentr = 20 const ycentr = 12 const scrnwidth = 40 @@ -37,12 +37,12 @@ import ROGUEMAP predef loadmap, getmaptile, setmaptile, updtmaptile, lighttorches, drawmap, drawvisentity end -import ROGUECOMBAT +import roguecombat predef fight word entity, entities end -import ROGUEIO +import rogueio predef puti, toupper word rnd, getkb, home, gotoxy, tone end @@ -229,7 +229,7 @@ def status end def clearstatus - return memset($07D0, 40, $A0A0) + return memset($07D0, $A0A0, 40) end // diff --git a/src/samplesrc/sieve.pla b/src/samplesrc/sieve.pla index c8779cd..7eee507 100644 --- a/src/samplesrc/sieve.pla +++ b/src/samplesrc/sieve.pla @@ -1,4 +1,4 @@ -import STDLIB +import cmdsys predef syscall, call, memset, getc, putc, puts, putln byte MACHID end @@ -29,7 +29,7 @@ end beep //for iter = 1 to 10 - memset(@flag, sizepl, TRUE) + memset(@flag, TRUE, sizepl) count = 0 for i = 0 to size if flag[i] diff --git a/src/samplesrc/staticip.pla b/src/samplesrc/staticip.pla index d85fd48..08792e3 100644 --- a/src/samplesrc/staticip.pla +++ b/src/samplesrc/staticip.pla @@ -1,8 +1,8 @@ // // Static IP // -import stdlib - predef syscall, call, memset, getc, gets, putc, puts, putln +import cmdsys + predef syscall, call, getc, gets, putc, puts, putln predef memset, memcpy, modaddr, modexec predef heapmark, heapallocalign, heapalloc, heaprelease byte MACHID diff --git a/src/samplesrc/test.pla b/src/samplesrc/test.pla index e815673..e62d8ea 100755 --- a/src/samplesrc/test.pla +++ b/src/samplesrc/test.pla @@ -1,7 +1,7 @@ // // Include all imported modules and their data/functions. // -include(stdlib.plh) +include(cmdsys.plh) include(testlib.plh) // // Structure definition. diff --git a/src/samplesrc/testlib.pla b/src/samplesrc/testlib.pla index 7efb083..6a2e829 100755 --- a/src/samplesrc/testlib.pla +++ b/src/samplesrc/testlib.pla @@ -1,7 +1,7 @@ // // Include all imported modules and their data/functions. // -include(stdlib.plh) +include(cmdsys.plh) // // Module data. // diff --git a/src/samplesrc/uthernet.pla b/src/samplesrc/uthernet.pla index c894714..15d1008 100644 --- a/src/samplesrc/uthernet.pla +++ b/src/samplesrc/uthernet.pla @@ -1,5 +1,5 @@ -import stdlib - predef syscall, call, memset, getc, gets, putc, puts, putln +import cmdsys + predef syscall, call, getc, gets, putc, puts, putln predef memset, memcpy, modaddr, modexec predef heapmark, heapallocalign, heapalloc, heaprelease, heapavail byte MACHID diff --git a/src/toolsrc/sb.pla b/src/toolsrc/sb.pla index c04649c..cb5d040 100644 --- a/src/toolsrc/sb.pla +++ b/src/toolsrc/sb.pla @@ -90,7 +90,7 @@ word = $0450,$04D0,$0550,$05D0,$0650,$06D0,$0750,$07D0 // Editor variables // byte nullstr = "" -byte version = "PLASMA ][ SANDBOX VERSION 00.12" +byte version = "PLASMA ][ SANDBOX VERSION 00.80" byte errorstr = "ERROR: $" byte okstr = "OK" byte outofmem = "OUT OF MEMORY!" @@ -512,7 +512,7 @@ PARAMS: !WORD 0000 RTS end // SET MEMORY TO VALUE -// MEMSET(ADDR, SIZE, VALUE) +// MEMSET(ADDR, VALUE, SIZE) // With optimizations from Peter Ferrie // asm memset @@ -520,25 +520,25 @@ asm memset STA DSTL LDA ESTKH+2,X STA DSTH - LDY ESTKL+1,X + LDY ESTKL,X BEQ + - INC ESTKH+1,X + INC ESTKH,X LDY #$00 -+ LDA ESTKH+1,X ++ LDA ESTKH,X BEQ SETMEX SETMLPL CLC - LDA ESTKL,X + LDA ESTKL+1,X SETMLPH STA (DST),Y - DEC ESTKL+1,X + DEC ESTKL,X BNE + - DEC ESTKH+1,X + DEC ESTKH,X BEQ SETMEX + INY BNE + INC DSTH + BCS SETMLPL SEC - LDA ESTKH,X + LDA ESTKH+1,X BCS SETMLPH SETMEX INX INX @@ -1099,8 +1099,8 @@ end def inittxtbuf word i - memset(strheapmap, strheapmsz, 0) - memset(strlinbuf, maxfill * 2, @nullstr) + memset(strheapmap, 0, strheapmsz) + memset(strlinbuf, @nullstr, maxfill * 2) numlines = 1 cursrow = 0 curscol = 0 @@ -1269,7 +1269,7 @@ def drawrow(row, ofst, strptr) if numchars >= 40 numchars = 40 else - memset(scrnptr + numchars, 40 - numchars, $A0A0) + memset(scrnptr + numchars, $A0A0, 40 - numchars) fin return memcpy(scrnptr, strptr + ofst + 1, numchars) end @@ -1288,7 +1288,7 @@ def drawscrn(toprow, ofst) if numchars >= 40 numchars = 40 else - memset(scrnptr + numchars, 40 - numchars, $A0A0) + memset(scrnptr + numchars, $A0A0, 40 - numchars) fin memcpy(scrnptr, strptr + ofst + 1, numchars) next @@ -1616,7 +1616,7 @@ def editline(key) if (editkey(key)) flags = flags | changed - memset(@editstr, 80, $A0A0) + memset(@editstr, $A0A0, 80) strcpy(@editstr, strlinbuf:[cursrow]) undoline = strlinbuf:[cursrow] strlinbuf:[cursrow] = @editstr @@ -2035,7 +2035,7 @@ def emit_word(wval) codeptr = codeptr + 2 end def emit_fill(size) - memset(codeptr, size, 0) + memset(codeptr, 0, size) codeptr = codeptr + size end def emit_op(op) @@ -4026,7 +4026,7 @@ close(0) // // Set memory bitmap // -memset($BF58, 24, 0) +memset($BF58, 0, 24) ^$BF58 = $CF ^$BF6F = $01 // diff --git a/src/vmsrc/a1cmd.pla b/src/vmsrc/a1cmd.pla index 6e3ecf8..e817967 100644 --- a/src/vmsrc/a1cmd.pla +++ b/src/vmsrc/a1cmd.pla @@ -39,7 +39,7 @@ predef loadmod, execmod, lookupstrmod // // System variables. // -word version = $0012 // 00.12 +word version = $0080 // 00.80 word systemflags = 0 word heap word symtbl, lastsym @@ -66,7 +66,7 @@ word cmdptr = @hexchar // make it point to a zero // // Standard Library exported functions. // -byte stdlibstr[] = "STDLIB" +byte syslibstr[] = "CMDSYS" byte machidstr[] = "MACHID" byte putcstr[] = "PUTC" byte putlnstr[] = "PUTLN" @@ -112,7 +112,7 @@ word = @modadrstr, @lookupstrmod word = @machidstr, @machid word = @argstr, @cmdptr word = 0 -word stdlibsym = @exports +word syslibsym = @exports // // CALL CFFA1 API ENTRYPOINT // SYSCALL(CMD) @@ -178,7 +178,7 @@ asm quit end // // SET MEMORY TO VALUE -// MEMSET(ADDR, SIZE, VALUE) +// MEMSET(ADDR, VALUE, SIZE) // With optimizations from Peter Ferrie // asm memset @@ -186,25 +186,25 @@ asm memset STA DSTL LDA ESTKH+2,X STA DSTH - LDY ESTKL+1,X + LDY ESTKL,X BEQ + - INC ESTKH+1,X + INC ESTKH,X LDY #$00 -+ LDA ESTKH+1,X ++ LDA ESTKH,X BEQ SETMEX SETMLPL CLC - LDA ESTKL,X + LDA ESTKL+1,X SETMLPH STA (DST),Y - DEC ESTKL+1,X + DEC ESTKL,X BNE + - DEC ESTKH+1,X + DEC ESTKH,X BEQ SETMEX + INY BNE + INC DSTH + BCS SETMLPL SEC - LDA ESTKH,X + LDA ESTKH+1,X BCS SETMLPH SETMEX INX INX @@ -990,18 +990,18 @@ heap = *freemem symtbl = allocheap($200) lastsym = symtbl ^lastsym = 0 -stodci(@stdlibstr, heap) +stodci(@syslibstr, heap) addmod(heap, @version) -while *stdlibsym - stodci(stdlibsym=>0, heap) - addsym(heap, stdlibsym=>2) - stdlibsym = stdlibsym + 4 +while *syslibsym + stodci(syslibsym=>0, heap) + addsym(heap, syslibsym=>2) + syslibsym = syslibsym + 4 loop // // Try to load autorun. // cmdptr = heap -memset(cmdptr, 128, 0) +memset(cmdptr, 0, 128) readfile(@autorun, cmdptr + 1) while ^(cmdptr + ^cmdptr + 1) >= ' ' ^cmdptr = ^cmdptr + 1 diff --git a/src/vmsrc/cmd.pla b/src/vmsrc/cmd.pla index 2db94b5..b44f91a 100644 --- a/src/vmsrc/cmd.pla +++ b/src/vmsrc/cmd.pla @@ -33,7 +33,7 @@ predef loadmod, execmod, lookupstrmod // // System variable. // -word version = $0012 // 00.12 +word version = $0080 // 00.80 word systemflags = 0 word heap word xheap = $0800 @@ -43,7 +43,7 @@ byte cmdln = "" // Overlay exported strings table // // Standard Library exported functions. // -byte stdlibstr = "STDLIB" +byte syslibstr = "CMDSYS" byte machidstr = "MACHID" byte sysstr = "SYSCALL" byte callstr = "CALL" @@ -91,7 +91,7 @@ word = @modadrstr, @lookupstrmod word = @machidstr, MACHID word = @argstr, @cmdln word = 0 -word stdlibsym = @exports +word syslibsym = @exports // // String pool. // @@ -192,7 +192,7 @@ asm reboot end // // SET MEMORY TO VALUE -// MEMSET(ADDR, SIZE, VALUE) +// MEMSET(ADDR, VALUE, SIZE) // With optimizations from Peter Ferrie // asm memset @@ -200,25 +200,25 @@ asm memset STA DSTL LDA ESTKH+2,X STA DSTH - LDY ESTKL+1,X + LDY ESTKL,X BEQ + - INC ESTKH+1,X + INC ESTKH,X LDY #$00 -+ LDA ESTKH+1,X ++ LDA ESTKH,X BEQ SETMEX SETMLPL CLC - LDA ESTKL,X + LDA ESTKL+1,X SETMLPH STA (DST),Y - DEC ESTKL+1,X + DEC ESTKL,X BNE + - DEC ESTKH+1,X + DEC ESTKH,X BEQ SETMEX + INY BNE + INC DSTH + BCS SETMLPL SEC - LDA ESTKH,X + LDA ESTKH+1,X BCS SETMLPH SETMEX INX INX @@ -1217,7 +1217,7 @@ def resetmemfiles // // Set memory bitmap // - memset($BF58, 24, 0) + memset($BF58, 0, 24) ^$BF58 = $CF ^$BF6F = $01 end @@ -1273,19 +1273,19 @@ heap = *freemem // // Init symbol table. // -stodci(@stdlibstr, heap) +stodci(@syslibstr, heap) addmod(heap, @version) -while *stdlibsym - stodci(stdlibsym=>0, heap) - addsym(heap, stdlibsym=>2) - stdlibsym = stdlibsym + 4 +while *syslibsym + stodci(syslibsym=>0, heap) + addsym(heap, syslibsym=>2) + syslibsym = syslibsym + 4 loop // // Try to load autorun. // autorun = open(@autorun, iobuffer) if autorun > 0 - cmdln = read(autorun, @stdlibstr, 128) + cmdln = read(autorun, @syslibstr, 128) close(autorun) else // diff --git a/src/vmsrc/plvm.c b/src/vmsrc/plvm.c index 07a8ee4..86fbd8b 100755 --- a/src/vmsrc/plvm.c +++ b/src/vmsrc/plvm.c @@ -874,7 +874,7 @@ void interp(code *ip) } } -char *stdlib_exp[] = { +char *syslib_exp[] = { "PUTC", "PUTS", "PUTSZ", @@ -902,12 +902,12 @@ int main(int argc, char **argv) /* * Add default library. */ - stodci("STDLIB", dci); + stodci("CMDSYS", dci); add_mod(dci, 0xFFFF); - for (i = 0; stdlib_exp[i]; i++) + for (i = 0; syslib_exp[i]; i++) { mem_data[i] = i + 3; - stodci(stdlib_exp[i], dci); + stodci(syslib_exp[i], dci); add_sym(dci, i); } if (argc) diff --git a/src/vmsrc/soscmd.pla b/src/vmsrc/soscmd.pla index 73b9f3e..66ce1f2 100644 --- a/src/vmsrc/soscmd.pla +++ b/src/vmsrc/soscmd.pla @@ -34,7 +34,7 @@ predef loadmod, execmod, lookupstrmod // // System variables. // -word version = $0012 // 00.12 +word version = $0080 // 00.80 word systemflags = 0 byte refcons = 0 byte devcons = 0 @@ -67,7 +67,7 @@ word cmdptr // // Standard Library exported functions. // -byte stdlibstr[] = "STDLIB" +byte syslibstr[] = "CMDSYS" byte machidstr[] = "MACHID" byte sysstr[] = "SYSCALL" byte callstr[] = "CALL" @@ -114,7 +114,7 @@ word = @modadrstr, @lookupstrmod word = @machidstr, @machid word = @argstr, @cmdptr word = 0 -word stdlibsym = @exports +word syslibsym = @exports // // CALL SOS // SYSCALL(CMD, PARAMS) @@ -179,7 +179,7 @@ JMPTMP JMP (TMP) end // // SET MEMORY TO VALUE -// MEMSET(ADDR, SIZE, VALUE) +// MEMSET(ADDR, VALUE, SIZE) // With optimizations from Peter Ferrie // asm memset @@ -187,25 +187,25 @@ asm memset STA DSTL LDA ESTKH+2,X STA DSTH - LDY ESTKL+1,X + LDY ESTKL,X BEQ + - INC ESTKH+1,X + INC ESTKH,X LDY #$00 -+ LDA ESTKH+1,X ++ LDA ESTKH,X BEQ SETMEX SETMLPL CLC - LDA ESTKL,X + LDA ESTKL+1,X SETMLPH STA (DST),Y - DEC ESTKL+1,X + DEC ESTKL,X BNE + - DEC ESTKH+1,X + DEC ESTKH,X BEQ SETMEX + INY BNE + INC DSTH + BCS SETMLPL SEC - LDA ESTKH,X + LDA ESTKH+1,X BCS SETMLPH SETMEX INX INX @@ -1274,12 +1274,12 @@ init_cons seg_find($00, @symtbl, @lastsym, $08, $11) lastsym = symtbl & $FF00 xpokeb(symtbl.0, lastsym, 0) -stodci(@stdlibstr, heap) +stodci(@syslibstr, heap) addmod(heap, @version) -while *stdlibsym - stodci(stdlibsym=>0, heap) - addsym(heap, stdlibsym=>2) - stdlibsym = stdlibsym + 4 +while *syslibsym + stodci(syslibsym=>0, heap) + addsym(heap, syslibsym=>2) + syslibsym = syslibsym + 4 loop // // Try to load autorun.