mirror of
https://github.com/dschmenk/PLASMA.git
synced 2024-11-08 06:09:15 +00:00
Huge update: memset() now matches C library for params. stdlib renamed
cmdsys so that dependencies have to be updated. Version now 0.8 - getting close
This commit is contained in:
parent
561459cacf
commit
f2c9526c79
BIN
SANDBOX.PO
BIN
SANDBOX.PO
Binary file not shown.
@ -1,4 +1,4 @@
|
||||
import stdlib
|
||||
import cmdsys
|
||||
predef putc, putln, puts, getc, gets
|
||||
predef call, syscall
|
||||
predef heapmark, heapallocallign, heapalloc, heaprelease, heapavail
|
@ -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
|
||||
|
@ -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
|
||||
//
|
||||
|
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
import STDLIB
|
||||
import cmdsys
|
||||
predef puts
|
||||
end
|
||||
|
||||
|
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
import STDLIB
|
||||
import cmdsys
|
||||
predef memset, memcpy, getc, heapalloc, heapmark, heaprelease
|
||||
end
|
||||
import HGR1
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
//
|
||||
|
@ -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
|
||||
|
||||
//
|
||||
|
@ -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]
|
||||
|
@ -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
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Include all imported modules and their data/functions.
|
||||
//
|
||||
include(stdlib.plh)
|
||||
include(cmdsys.plh)
|
||||
include(testlib.plh)
|
||||
//
|
||||
// Structure definition.
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Include all imported modules and their data/functions.
|
||||
//
|
||||
include(stdlib.plh)
|
||||
include(cmdsys.plh)
|
||||
//
|
||||
// Module data.
|
||||
//
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
//
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
//
|
||||
|
@ -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)
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user