From c43c1a995a45478a25d903b94f81eeaf7fdc00dc Mon Sep 17 00:00:00 2001 From: Adam Novak Date: Sat, 2 Jul 2016 20:21:08 -0700 Subject: [PATCH] Add no-argument form of RFI --- DAsm.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/DAsm.cpp b/DAsm.cpp index e6b89bc..65a47d6 100644 --- a/DAsm.cpp +++ b/DAsm.cpp @@ -662,10 +662,17 @@ namespace DAsm{ lOp = GetSpecialOpcode(first_str); lWord |= lOp << 5; if(final_split_list.size()<1){ - Error(first_str.append(std::string(" opcode requires an operand"))); - return; + // These opcodes all take 1 argument + if(lOp != 0x0B){ + // Opcodes that aren't RFI actually need their arguments + Error(first_str.append(std::string(" opcode requires an operand"))); + return; + } + // RFI (0x0B), which doesn't use its argument at all, can take + // no arguments. So if we have no argument for RFI, do nothing. + }else{ + lWord |= ParseArg(*final_split_list.begin(), true) << 10; } - lWord |= ParseArg(*final_split_list.begin(), true) << 10; }else{ if(final_split_list.size()<2){ Error(first_str.append(std::string(" requires two operands")));