mirror of
https://github.com/dschmenk/PLASMA.git
synced 2024-12-27 19:30:02 +00:00
Clean up module loading and images
This commit is contained in:
parent
1d099df299
commit
c23cb6d239
BIN
images/apple/A1PLASMA.po
Executable file
BIN
images/apple/A1PLASMA.po
Executable file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -988,7 +988,6 @@ def loadmod(mod)#1
|
|||||||
if loadmod(moddep) < 0
|
if loadmod(moddep) < 0
|
||||||
return -perr
|
return -perr
|
||||||
fin
|
fin
|
||||||
prstr("Loaded "); prstr(@str); crout
|
|
||||||
fin
|
fin
|
||||||
moddep = moddep + dcitos(moddep, @str)
|
moddep = moddep + dcitos(moddep, @str)
|
||||||
loop
|
loop
|
||||||
@ -1033,12 +1032,10 @@ def loadmod(mod)#1
|
|||||||
//
|
//
|
||||||
// Run through the DeFinition Dictionary.
|
// Run through the DeFinition Dictionary.
|
||||||
//
|
//
|
||||||
prstr("Bytecode = "); prword(bytecode); crout
|
|
||||||
while ^rld == $02
|
while ^rld == $02
|
||||||
//
|
//
|
||||||
// This is a bytcode def entry - add it to the def directory.
|
// This is a bytcode def entry - add it to the def directory.
|
||||||
//
|
//
|
||||||
prstr("Add DEF: "); prword(rld=>1 + defofst); prstr(" -> "); prword(deflast); crout
|
|
||||||
adddef(rld=>1 + defofst, @deflast)
|
adddef(rld=>1 + defofst, @deflast)
|
||||||
rld = rld + 4
|
rld = rld + 4
|
||||||
loop
|
loop
|
||||||
@ -1048,7 +1045,7 @@ def loadmod(mod)#1
|
|||||||
while ^rld
|
while ^rld
|
||||||
rld, addr, fixup = reloc(modfix, modofst, bytecode, rld)
|
rld, addr, fixup = reloc(modfix, modofst, bytecode, rld)
|
||||||
if ^rld
|
if ^rld
|
||||||
*addr = ^rld & $10 ?? *addr + lookupextern(esd, rld->3) :: lookupdef(fixup + defofst, deftbl)
|
*addr = ^rld & $10 ?? *addr + lookupextern(esd, rld->3) :: lookupdef(fixup, deftbl)
|
||||||
rld = rld + 4
|
rld = rld + 4
|
||||||
fin
|
fin
|
||||||
loop
|
loop
|
||||||
@ -1062,12 +1059,11 @@ def loadmod(mod)#1
|
|||||||
//
|
//
|
||||||
// EXPORT symbol - add it to the global symbol table.
|
// EXPORT symbol - add it to the global symbol table.
|
||||||
//
|
//
|
||||||
addr = esd=>1 + defofst // modofst
|
addr = esd=>1 + modofst
|
||||||
if uword_isge(addr, bytecode)
|
if uword_isge(addr, bytecode)
|
||||||
//
|
//
|
||||||
// Use the def directory address for bytecode.
|
// Use the def directory address for bytecode.
|
||||||
//
|
//
|
||||||
//addr = lookupdef(addr + defofst, deftbl)
|
|
||||||
addr = lookupdef(addr, deftbl)
|
addr = lookupdef(addr, deftbl)
|
||||||
fin
|
fin
|
||||||
addsym(sym, addr)
|
addsym(sym, addr)
|
||||||
@ -1087,7 +1083,8 @@ def loadmod(mod)#1
|
|||||||
//
|
//
|
||||||
fixup = modkeep
|
fixup = modkeep
|
||||||
if init
|
if init
|
||||||
fixup = adddef(init + defofst, @deflast)()
|
init = init + defofst
|
||||||
|
fixup = adddef(init, @deflast)()
|
||||||
if fixup < 0
|
if fixup < 0
|
||||||
perr = -fixup
|
perr = -fixup
|
||||||
fin
|
fin
|
||||||
|
@ -979,7 +979,7 @@ def adddef(addr, deflast)#1
|
|||||||
return defentry
|
return defentry
|
||||||
end
|
end
|
||||||
def loadmod(mod)#1
|
def loadmod(mod)#1
|
||||||
word rdlen, modsize, bytecode, codefix, defofst, defcnt, init, initcode[], fixup
|
word rdlen, modsize, bytecode, defofst, defcnt, init, initcode[], fixup
|
||||||
word addr, defaddr, modaddr, modfix, modofst, modend
|
word addr, defaddr, modaddr, modfix, modofst, modend
|
||||||
word deftbl, deflast
|
word deftbl, deflast
|
||||||
word moddep, rld, esd, sym
|
word moddep, rld, esd, sym
|
||||||
@ -1074,15 +1074,13 @@ def loadmod(mod)#1
|
|||||||
modofst = modfix - RELADDR
|
modofst = modfix - RELADDR
|
||||||
modend = modaddr + modsize
|
modend = modaddr + modsize
|
||||||
bytecode = defofst + modofst
|
bytecode = defofst + modofst
|
||||||
|
defofst = bytecode - defofst
|
||||||
rld = modend // Re-Locatable Directory
|
rld = modend // Re-Locatable Directory
|
||||||
esd = rld // Extern+Entry Symbol Directory
|
esd = rld // Extern+Entry Symbol Directory
|
||||||
while ^esd // Scan to end of ESD
|
while ^esd // Scan to end of ESD
|
||||||
esd = esd + 4
|
esd = esd + 4
|
||||||
loop
|
loop
|
||||||
esd = esd + 1
|
esd = esd + 1
|
||||||
defaddr = bytecode
|
|
||||||
codefix = defaddr - bytecode
|
|
||||||
defofst = defaddr - defofst
|
|
||||||
//
|
//
|
||||||
// Run through the DeFinition Dictionary.
|
// Run through the DeFinition Dictionary.
|
||||||
//
|
//
|
||||||
@ -1099,7 +1097,7 @@ def loadmod(mod)#1
|
|||||||
while ^rld
|
while ^rld
|
||||||
rld, addr, fixup = reloc(modfix, modofst, bytecode, rld)
|
rld, addr, fixup = reloc(modfix, modofst, bytecode, rld)
|
||||||
if ^rld
|
if ^rld
|
||||||
*addr = ^rld & $10 ?? *addr + lookupextern(esd, rld->3) :: lookupdef(fixup + codefix, deftbl)
|
*addr = ^rld & $10 ?? *addr + lookupextern(esd, rld->3) :: lookupdef(fixup, deftbl)
|
||||||
rld = rld + 4
|
rld = rld + 4
|
||||||
fin
|
fin
|
||||||
loop
|
loop
|
||||||
@ -1118,7 +1116,7 @@ def loadmod(mod)#1
|
|||||||
//
|
//
|
||||||
// Use the def directory address for bytecode.
|
// Use the def directory address for bytecode.
|
||||||
//
|
//
|
||||||
addr = lookupdef(addr + codefix, deftbl)
|
addr = lookupdef(addr, deftbl)
|
||||||
fin
|
fin
|
||||||
addsym(sym, addr)
|
addsym(sym, addr)
|
||||||
fin
|
fin
|
||||||
|
Loading…
Reference in New Issue
Block a user