mirror of
https://github.com/notwa/lips
synced 2024-05-19 00:33:23 -07:00
allow LA in place of LI
This commit is contained in:
parent
164b4ceae2
commit
59c4802ff8
9
lips.lua
9
lips.lua
|
@ -1029,6 +1029,8 @@ function Parser:instruction()
|
||||||
self:optional_comma()
|
self:optional_comma()
|
||||||
local im = self:const()
|
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
|
if im[1] == 'LABELSYM' then
|
||||||
self:error('use LA for labels')
|
self:error('use LA for labels')
|
||||||
end
|
end
|
||||||
|
@ -1059,13 +1061,6 @@ function Parser:instruction()
|
||||||
self:optional_comma()
|
self:optional_comma()
|
||||||
local im = self:const()
|
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.rs = args.rt
|
||||||
args.immediate = {'UPPEROFF', im}
|
args.immediate = {'UPPEROFF', 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])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user