Skip to content

Commit

Permalink
[PDP8] Cleanup implicit-word feature
Browse files Browse the repository at this point in the history
  • Loading branch information
tgtakaoka committed Oct 4, 2024
1 parent 31ea61f commit db63bb9
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/asm_pdp8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,21 +377,8 @@ Error AsmPdp8::processPseudo(StrScanner &scan, Insn &insn) {

Error AsmPdp8::encodeImpl(StrScanner &scan, Insn &_insn) const {
AsmInsn insn(_insn);
scan.skipSpaces();
const auto error = TABLE.searchName(cpuType(), insn);
if (error == OK) {
const auto mode = insn.mode();
if (mode == M_MEM) {
parseMemReferenceOperand(scan, insn);
} else if (mode == M_GR1 || mode == M_GR2 || mode == M_GR3) {
parseOperateOperand(scan, insn);
} else if (mode == M_IOT) {
parseIoTransferOperand(scan, insn);
} else if (mode == M_MEX) {
parseMemExtensionOperand(scan, insn);
}
insn.emitInsn();
} else if (_implicitWord) {
if (_implicitWord && error != OK) {
StrScanner p = _insn.errorAt();
insn.setOK(); // clear UNKNOWN_INSTRUCTION
const auto opc = parseInteger(p, insn);
Expand All @@ -404,6 +391,19 @@ Error AsmPdp8::encodeImpl(StrScanner &scan, Insn &_insn) const {
insn.setOpCode(opc.getUnsigned() & 07777);
scan = p;
insn.emitInsn();
} else if (error == OK) {
scan.skipSpaces();
const auto mode = insn.mode();
if (mode == M_MEM) {
parseMemReferenceOperand(scan, insn);
} else if (mode == M_GR1 || mode == M_GR2 || mode == M_GR3) {
parseOperateOperand(scan, insn);
} else if (mode == M_IOT) {
parseIoTransferOperand(scan, insn);
} else if (mode == M_MEX) {
parseMemExtensionOperand(scan, insn);
}
insn.emitInsn();
}
return _insn.setError(insn);
}
Expand Down

0 comments on commit db63bb9

Please sign in to comment.