1
0
Fork 0
mirror of https://github.com/notwa/lips synced 2024-05-02 17:43:23 -07:00

add reg# register aliases

This commit is contained in:
Connor Olding 2015-11-21 23:50:25 -08:00
parent 4a6c7c4d09
commit 6fc3b8f2b5

View File

@ -30,7 +30,6 @@ local Class = function(inherit)
return setmetatable(class, mt_class)
end
-- TODO: maybe support reg# style too
local registers = {
[0]=
'R0', 'AT', 'V0', 'V1', 'A0', 'A1', 'A2', 'A3',
@ -77,10 +76,15 @@ revtable(fpu_registers)
revtable(all_registers)
revtable(all_directives)
registers['ZERO'] = 0
all_registers['ZERO'] = 0
for i=0, 31 do
local r = 'REG'..tostring(i)
registers[r] = i
all_registers[r] = i
end
local fmt_single = 16
local fmt_double = 17
local fmt_word = 20