1
0
Fork 0
mirror of https://github.com/notwa/lips synced 2024-11-14 21:19:03 -08: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') self:error('use LI for immediates')
end end
im[2] = im[2] % 0x100000000 if not is_label then
if im[2] >= 0x8000 and im[2] <= 0xFFFF8000 then im[2] = im[2] % 0x100000000
end
if is_label or (im[2] >= 0x8000 and im[2] <= 0xFFFF8000) then
args.rs = args.rt args.rs = args.rt
args.immediate = {'UPPER', im} args.immediate = {'UPPER', im}
self:format_out(lui[3], lui[1], args, lui[4], lui[5]) 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} args.immediate = {'LOWER', im}
self:format_out(ori[3], ori[1], args, ori[4], ori[5]) self:format_out(ori[3], ori[1], args, ori[4], ori[5])
end end