mirror of
https://github.com/g012/l65.git
synced 2024-06-17 19:29:46 +00:00
Fixed jr range check.
This commit is contained in:
parent
5105f8bd8d
commit
8ade3f3fd4
|
@ -242,7 +242,7 @@ M.jr = function(label)
|
||||||
end
|
end
|
||||||
if type(x) ~= 'number' then error("unresolved branch target: " .. tostring(x)) end
|
if type(x) ~= 'number' then error("unresolved branch target: " .. tostring(x)) end
|
||||||
x = x-1 - offset - rorg(section.org)
|
x = x-1 - offset - rorg(section.org)
|
||||||
if x < -32 or x > 0x32 then error("branch target out of range for " .. l .. ": " .. x)
|
if x < -32 or x > 32 then error("branch target out of range for " .. l .. ": " .. x)
|
||||||
elseif x >= 0 then
|
elseif x >= 0 then
|
||||||
x = 0xc0 + x
|
x = 0xc0 + x
|
||||||
return x
|
return x
|
||||||
|
|
Loading…
Reference in New Issue
Block a user