1
0
Fork 0
mirror of https://github.com/notwa/lips synced 2024-05-05 10:53:23 -07:00

fix labels in word directives

This commit is contained in:
Connor Olding 2016-04-02 08:05:07 -07:00
parent 4b8af13e78
commit fdb4b351a6

View File

@ -85,7 +85,8 @@ function Dumper:add_directive(fn, line, name, a, b)
self:add_bytes(line, b1, b0)
elseif name == 'WORD' then
if type(a) == 'string' then
local t = {line=line, kind='label', name=a}
t.kind = 'label'
t.name = a
insert(self.commands, t)
self:advance(4)
else
@ -270,7 +271,7 @@ function Dumper:dump()
self.pos = self.pos + t.skip
end
elseif t.kind == 'label' then
local val = self:desym{'LABELSYM', t.name}
local val = self:desym{tt='LABELSYM', tok=t.name}
val = (val % 0x80000000) + 0x80000000
local b0 = bitrange(val, 0, 7)
local b1 = bitrange(val, 8, 15)