From 59c4802ff857efd11d0ebed4cc9e2bea767f1daa Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Fri, 25 Dec 2015 00:16:35 -0800 Subject: [PATCH] allow LA in place of LI --- lips.lua | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lips.lua b/lips.lua index f86ce4b..7560580 100644 --- a/lips.lua +++ b/lips.lua @@ -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])