Changed _ to . in symbol file for local labels.

Removed DASM style comments in symbol file.
This commit is contained in:
g012 2017-09-21 00:56:36 +02:00
parent 9eebcb520a
commit dc2d7feff7
3 changed files with 14 additions and 9 deletions

View File

@ -209,18 +209,21 @@ M.writesym = function(filename)
local f = assert(io.open(filename, "wb"), "failed to open " .. filename .. " for writing")
table.sort(symbols)
local ins,fmt,rep = table.insert,string.format,string.rep
local s ={'--- Symbol List'}
local sym_rev = {}
local s,sym_rev = {},{}
for k,v in pairs(symbols) do if type(v) == 'number' then ins(sym_rev,k) end end
table.sort(sym_rev, function(a,b) local x,y=symbols[a],symbols[b] return x==y and a<b or x<y end)
for _,v in ipairs(sym_rev) do local k=symbols[v] ins(s, fmt("%s%s %04x", v, rep(' ',24-#v), k)) end
s[#s+1] = '--- End of Symbol List.'
for _,v in ipairs(sym_rev) do
local k=symbols[v]
local u=v:find'_' if u then -- change _ to . in local labels
local parent=v:sub(1,u-1) if symbols[parent] then v = v:sub(1,u-1)..'.'..v:sub(u+1) end
end
ins(s, fmt("%s%s %04x", v, rep(' ',24-#v), k))
end
f:write(table.concat(s, '\n'))
f:close()
end
M.getstats = function()
return 'TODO' -- TODO
end
M.location = function(start, finish)

View File

@ -127,8 +127,9 @@ ptr_table("ptrs", message, data, 0)
jam asl lsr ldx #16 ldy 0xf0f0
rts
writebin()
writesym()
local filename=string.match(arg[0], ".-([^\\/]-)%.?[^%.\\/]*$")
writebin(filename..'.bin')
writesym(filename..'.sym')
print(getstats())
--[[

View File

@ -125,8 +125,9 @@ label("_toto")
jamimp() aslimp() lsrimp() ldximm (function(_o) return _o+(16) end) ldyzab(function(_o) return _o+( 0xf0f0) end)
rtsimp()
writebin()
writesym()
local filename=string.match(arg[0], ".-([^\\/]-)%.?[^%.\\/]*$")
writebin(filename..'.bin')
writesym(filename..'.sym')
print(getstats())
--[[