diff --git a/lips/Dumper.lua b/lips/Dumper.lua index 5a41c45..9cb1837 100644 --- a/lips/Dumper.lua +++ b/lips/Dumper.lua @@ -127,13 +127,13 @@ function Dumper:add_directive(fn, line, name, a, b) end local temp = self.pos + align - 1 t.skip = temp - (temp % align) - self.pos - t.fill = t.fill or 0 + t.fill = b and b % 0x100 or 0 insert(self.commands, t) self:advance(t.skip) elseif name == 'SKIP' then t.kind = 'ahead' t.skip = a - t.fill = b + t.fill = b and b % 0x100 or nil insert(self.commands, t) self:advance(t.skip) else diff --git a/lips/Parser.lua b/lips/Parser.lua index bb2ce09..ff0a774 100644 --- a/lips/Parser.lua +++ b/lips/Parser.lua @@ -23,7 +23,6 @@ function Parser:directive() local function add(...) self.dumper:add_directive(self.fn, self.line, ...) end - -- FIXME: some of these directives allow byte values greater than 255 if name == 'ORG' then add(name, self:number().tok) elseif name == 'ALIGN' or name == 'SKIP' then