mirror of
https://github.com/notwa/lips
synced 2024-11-14 17:39:03 -08:00
allow LA in place of LI
This commit is contained in:
parent
164b4ceae2
commit
59c4802ff8
1 changed files with 2 additions and 7 deletions
9
lips.lua
9
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])
|
||||
|
|
Loading…
Reference in a new issue