Motorola M6800 (6800) Exorciser / SWTPC emulator plus 6801 instruction set emulation
リビジョン | 5943efec16b4df85a08cfdb0d0c7a26b5ddabe29 (tree) |
---|---|
日時 | 2020-11-22 02:42:52 |
作者 | Joel Matthew Rees <joel.rees@gmai...> |
コミッター | Joel Matthew Rees |
got the bug in the opcode determinant logic for 8-bit binary, need to
clean up debug prints
@@ -217,8 +217,9 @@ void show_trace(int insn_no, struct trace_entry *t) | ||
217 | 217 | sprintf(buf + strlen(buf), "%2.2X ", t->insn[0]); |
218 | 218 | |
219 | 219 | if (t->insn[0] & 0x80) { |
220 | - if ( ((t->insn[0] & 0x0F) < 0x0C) | |
221 | - && ( (cputype == 0x6801 && (t->insn[0] & 0x0F) != 0x03) ) ) { | |
220 | + unsigned opc_det = t->insn[0] & 0x0f; | |
221 | + if ( (cputype < 0x6801 && opc_det < 0x0C) | |
222 | + || (opc_det < 0x0c && opc_det != 0x03) ) { | |
222 | 223 | if (t->insn[0] & 0x40) { |
223 | 224 | sprintf(operand, "B"); |
224 | 225 | } else { |
@@ -852,8 +853,9 @@ void sim(void) | ||
852 | 853 | opcode = fetch(); |
853 | 854 | |
854 | 855 | if (opcode & 0x80) { |
855 | - if ( ((opcode & 0x0F) < 0x0C) | |
856 | - && (cputype == 0x6801 && ((opcode & 0x0F) != 0x03)) ) { | |
856 | + unsigned opc_det = opcode & 0x0f; | |
857 | + if ( (cputype < 0x6801 && opc_det < 0x0C) | |
858 | + || (opc_det < 0x0c && opc_det != 0x03) ) { | |
857 | 859 | /* Get operand A */ |
858 | 860 | if (opcode & 0x40) { |
859 | 861 | a = accb; |