1
0
Fork 0
mirror of https://github.com/notwa/lips synced 2024-05-05 19:03:27 -07:00

allow LA in place of LI

This commit is contained in:
Connor Olding 2015-12-25 00:16:35 -08:00
parent 164b4ceae2
commit 59c4802ff8

View File

@ -1029,6 +1029,8 @@ function Parser:instruction()
self:optional_comma()
local im = self:const()
-- for us, this is just semantics. for a "real" assembler,
-- LA could add appropriate RELO LUI/ADDIU directives.
if im[1] == 'LABELSYM' then
self:error('use LA for labels')
end
@ -1059,13 +1061,6 @@ function Parser:instruction()
self:optional_comma()
local im = self:const()
-- for us, this is just semantics. for a "real" assembler,
-- LA could add appropriate RELO LUI/ADDIU directives.
-- for that reason, we should always use the respective instructions.
if im[1] ~= 'LABELSYM' then
self:error('use LI for immediates')
end
args.rs = args.rt
args.immediate = {'UPPEROFF', im}
self:format_out(lui[3], lui[1], args, lui[4], lui[5])