mirror of
https://github.com/g012/l65.git
synced 2025-01-16 16:30:02 +00:00
Changed _ to . in symbol file for local labels.
Removed DASM style comments in symbol file.
This commit is contained in:
parent
9eebcb520a
commit
dc2d7feff7
13
6502.lua
13
6502.lua
@ -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)
|
||||
|
5
asm.l65
5
asm.l65
@ -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())
|
||||
|
||||
--[[
|
||||
|
5
asm.lua
5
asm.lua
@ -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())
|
||||
|
||||
--[[
|
||||
|
Loading…
x
Reference in New Issue
Block a user