Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions DAsm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")));
Expand Down