mirror of
https://github.com/notwa/lips
synced 2024-11-14 18:09:03 -08:00
fix and deprecate options.offset
This commit is contained in:
parent
1266dfd18f
commit
515a5f7635
1 changed files with 11 additions and 2 deletions
|
@ -45,6 +45,17 @@ function lips.assemble(fn_or_asm, writer, options)
|
||||||
options = options or {}
|
options = options or {}
|
||||||
|
|
||||||
local function main()
|
local function main()
|
||||||
|
if options.offset then
|
||||||
|
if options.origin or options.base then
|
||||||
|
error('offset and origin/base options are mutually exclusive')
|
||||||
|
end
|
||||||
|
io.stderr:write('Warning: options.offset is deprecated.\n')
|
||||||
|
options.origin = options.offset
|
||||||
|
options.base = 0
|
||||||
|
else
|
||||||
|
options.base = options.base or 0x80000000
|
||||||
|
end
|
||||||
|
|
||||||
local fn = nil
|
local fn = nil
|
||||||
local asm
|
local asm
|
||||||
if fn_or_asm:find('[\r\n]') then
|
if fn_or_asm:find('[\r\n]') then
|
||||||
|
@ -63,8 +74,6 @@ function lips.assemble(fn_or_asm, writer, options)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
options.base = options.base or 0x80000000
|
|
||||||
|
|
||||||
if options.unsafe then
|
if options.unsafe then
|
||||||
return main()
|
return main()
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue