Merge pull request #3 from BlockoS/master

Fixed jr range check.
This commit is contained in:
g012 2024-03-01 13:08:46 +01:00 committed by GitHub
commit 0a65af8621
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -242,7 +242,7 @@ M.jr = function(label)
end
if type(x) ~= 'number' then error("unresolved branch target: " .. tostring(x)) end
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
x = 0xc0 + x
return x