1
0
Fork 0
mirror of https://github.com/notwa/lips synced 2024-05-18 16:33:22 -07:00

add BEQZ/BNEZ pseudo-instructions

This commit is contained in:
Connor Olding 2016-01-05 01:01:52 -08:00
parent d217ff8147
commit 83a194f829

View File

@ -409,6 +409,8 @@ local instructions = {
-- pseudo-instructions -- pseudo-instructions
B = {4, 'r', '00o'}, -- BEQ R0, R0, offset B = {4, 'r', '00o'}, -- BEQ R0, R0, offset
BAL = {1, 'r', '0Co', 17}, -- BGEZAL R0, offset BAL = {1, 'r', '0Co', 17}, -- BGEZAL R0, offset
BEQZ = {4, 'sr', 's0o'}, -- BEQ RS, R0, offset
BNEZ = {5, 'sr', 's0o'}, -- BNE RS, R0, offset
CL = {0, 'd', '00d0C', 37}, -- OR RD, R0, R0 CL = {0, 'd', '00d0C', 37}, -- OR RD, R0, R0
MOV = {0, 'ds', 's0d0C', 37}, -- OR RD, RS, R0 MOV = {0, 'ds', 's0d0C', 37}, -- OR RD, RS, R0
NEG = {0, 'dt', '0td0C', 34}, -- SUB RD, R0, RT NEG = {0, 'dt', '0td0C', 34}, -- SUB RD, R0, RT
@ -426,7 +428,7 @@ local instructions = {
POP = {}, POP = {},
JPOP = {}, JPOP = {},
ABS = {}, -- BGEZ NOP SUB? ABS = {}, -- BGEZ NOP SUBU?
MUL = {}, -- MULT MFLO MUL = {}, -- MULT MFLO
--DIV = {}, -- 3 arguments --DIV = {}, -- 3 arguments
REM = {}, -- 3 arguments REM = {}, -- 3 arguments
@ -437,37 +439,18 @@ local instructions = {
ROL = {}, -- SLL, SRL, OR ROL = {}, -- SLL, SRL, OR
ROR = {}, -- SRL, SLL, OR ROR = {}, -- SRL, SLL, OR
SEQ = {}, SEQ = {}, SEQI = {}, SEQIU = {}, SEQU = {},
SEQI = {}, SGE = {}, SGEI = {}, SGEIU = {}, SGEU = {},
SEQIU = {}, SGT = {}, SGTI = {}, SGTIU = {}, SGTU = {},
SEQU = {}, SLE = {}, SLEI = {}, SLEIU = {}, SLEU = {},
SGE = {}, SNE = {}, SNEI = {}, SNEIU = {}, SNEU = {},
SGEI = {},
SGEIU = {},
SGEU = {},
SGT = {},
SGTI = {},
SGTIU = {},
SGTU = {},
SLE = {},
SLEI = {},
SLEIU = {},
SLEU = {},
SNE = {},
SNEI = {},
SNEIU = {},
SNEU = {},
BEQI = {}, BEQI = {},
BNEI = {}, BNEI = {},
BGE = {}, BGE = {}, BGEI = {},
BGEI = {}, BLE = {}, BLEI = {},
BLE = {}, BLT = {}, BLTI = {},
BLEI = {}, BGT = {}, BGTI = {},
BLT = {},
BLTI = {},
BGT = {},
BGTI = {},
} }
local all_instructions = {} local all_instructions = {}
@ -1491,6 +1474,7 @@ function Dumper:add_directive(line, name, a, b)
end end
function Dumper:desym(tok) function Dumper:desym(tok)
-- FIXME: errors can give wrong filename, also off by one
if type(tok[2]) == 'number' then if type(tok[2]) == 'number' then
return tok[2] return tok[2]
elseif tok[1] == 'LABELSYM' then elseif tok[1] == 'LABELSYM' then