From 1b23db1a71207c24ce741a52e84381023668dfee Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Sun, 22 Nov 2015 00:24:28 -0800 Subject: [PATCH] unfudge LI/LA a little --- Lua/inject/assembler.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Lua/inject/assembler.lua b/Lua/inject/assembler.lua index 04a5cbc..8b6ae94 100644 --- a/Lua/inject/assembler.lua +++ b/Lua/inject/assembler.lua @@ -871,14 +871,16 @@ function Parser:instruction() args.rt = self:register() self:optional_comma() local im = self:const() - local is_label = type(im[2]) ~= 'number' + local is_label = im[1] == 'LABELSYM' if h == 'LI' and is_label then self:error('use LA for addresses') end if h == 'LA' and not is_label then self:error('use LI for immediates') end - if h == 'LA' or im[2] >= 0x10000 then + -- FIXME: defines shouldn't need a special case, + -- we should know their values already. + if h == 'LA' or im[1] == 'DEFSYM' or im[2] >= 0x10000 then args.rs = args.rt args.immediate = {'UPPER', im} self:format_out(lui[3], lui[1], args, lui[4], lui[5])