1
0
Fork 0
mirror of https://github.com/notwa/lips synced 2024-05-02 17:43:23 -07:00
This commit is contained in:
Connor Olding 2015-11-25 21:27:46 -08:00
parent 774b04795d
commit c7f0d15910

View File

@ -933,12 +933,14 @@ function Parser:instruction()
self:error('use LI for immediates')
end
im[2] = im[2] % 0x100000000
if im[2] >= 0x8000 and im[2] <= 0xFFFF8000 then
if not is_label then
im[2] = im[2] % 0x100000000
end
if is_label or (im[2] >= 0x8000 and im[2] <= 0xFFFF8000) then
args.rs = args.rt
args.immediate = {'UPPER', im}
self:format_out(lui[3], lui[1], args, lui[4], lui[5])
if im[2] % 0x10000 ~= 0 then
if is_label or im[2] % 0x10000 ~= 0 then
args.immediate = {'LOWER', im}
self:format_out(ori[3], ori[1], args, ori[4], ori[5])
end