Motorola M6800 (6800) Exorciser / SWTPC emulator plus 6801 instruction set emulation
リビジョン | a8cfd78e1d485bcc8af49fc67d3d49732dc3ddc5 (tree) |
---|---|
日時 | 2020-11-22 02:27:01 |
作者 | Joel Matthew Rees <joel.rees@gmai...> |
コミッター | Joel Matthew Rees |
bad boolean math for 8-bit binary
@@ -349,7 +349,7 @@ void show_trace(int insn_no, struct trace_entry *t) | ||
349 | 349 | break; |
350 | 350 | } case 0x9D: case 0xAD: case 0xBD: /* JSR */ { |
351 | 351 | if (cputype == 0x6800 && t->insn[0] == 0x9D) |
352 | -{ fputs( "JSR\n", stderr ); goto invalid16; | |
352 | +{ fputs( "JSR error\n", stderr ); goto invalid16; | |
353 | 353 | } else if (t->cc & 0x80) |
354 | 354 | sprintf(buf3, "EA=%4.4X%s", t->ea, buf_ea); |
355 | 355 | insn = "JSR"; |
@@ -357,21 +357,21 @@ void show_trace(int insn_no, struct trace_entry *t) | ||
357 | 357 | break; |
358 | 358 | } case 0xC3: case 0xD3: case 0xE3: case 0xF3: /* ADDD N,Z,V,C (6801) */ { |
359 | 359 | if (cputype == 0x6800) |
360 | -{ fputs( "ADDD\n", stderr ); goto invalid16; | |
360 | +{ fputs( "ADDD error\n", stderr ); goto invalid16; | |
361 | 361 | } else if (t->cc & 0x80) |
362 | 362 | sprintf(buf3, "EA=%4.4X%s D=%4.4X", t->ea, buf_ea, t->data); |
363 | 363 | insn = "ADDD"; |
364 | 364 | break; |
365 | 365 | } case 0xCC: case 0xDC: case 0xEC: case 0xFC: /* LDD N,Z,V=0 (6801) */ { |
366 | 366 | if (cputype == 0x6800) |
367 | -{ fputs( "LDD\n", stderr ); goto invalid16; | |
367 | +{ fputs( "LDD error\n", stderr ); goto invalid16; | |
368 | 368 | } else if (t->cc & 0x80) |
369 | 369 | sprintf(buf3, "EA=%4.4X%s D=%4.4X", t->ea, buf_ea, t->data); |
370 | 370 | insn = "LDD"; |
371 | 371 | break; |
372 | 372 | } case 0xCD: case 0xDD: case 0xED: case 0xFD: /* STD N,Z,V=0 (6801) */ { |
373 | 373 | if (cputype == 0x6800) |
374 | -{ fputs( "STD\n", stderr ); goto invalid16; | |
374 | +{ fputs( "STD error\n", stderr ); goto invalid16; | |
375 | 375 | } else if (t->cc & 0x80) |
376 | 376 | sprintf(buf3, "EA=%4.4X%s D=%4.4X", t->ea, buf_ea, t->data); |
377 | 377 | insn = "STD"; |
@@ -1047,8 +1047,8 @@ void sim(void) | ||
1047 | 1047 | case 0x9D: /* (6801) */ |
1048 | 1048 | case 0xAD: case 0xBD: /* JSR */ { |
1049 | 1049 | if (cputype == 0x6800 && opcode == 0x9D) |
1050 | - goto invalid16; | |
1051 | - else { | |
1050 | +{ fputs( "JSR op error\n", stderr ); goto invalid16; | |
1051 | +} else { | |
1052 | 1052 | push2(pc); |
1053 | 1053 | jump(ea); |
1054 | 1054 | t->ea = ea; |
@@ -1056,8 +1056,8 @@ void sim(void) | ||
1056 | 1056 | break; |
1057 | 1057 | } case 0xC3: case 0xD3: case 0xE3: case 0xF3: /* ADDD N,Z,V,C (6801) */ { |
1058 | 1058 | if (cputype == 0x6800) |
1059 | - goto invalid16; | |
1060 | - else { | |
1059 | +{ fputs( "ADDD op error\n", stderr ); goto invalid16; | |
1060 | +} else { | |
1061 | 1061 | setACCD( accd ); |
1062 | 1062 | w = mread2(ea); |
1063 | 1063 | t->ea = ea; t->data = w; |
@@ -1071,8 +1071,8 @@ void sim(void) | ||
1071 | 1071 | break; |
1072 | 1072 | } case 0xCC: case 0xDC: case 0xEC: case 0xFC: /* LDD N,Z,V=0 (6801) */ { |
1073 | 1073 | if (cputype == 0x6800) |
1074 | - goto invalid16; | |
1075 | - else { | |
1074 | +{ fputs( "LDD op error\n", stderr ); goto invalid16; | |
1075 | +} else { | |
1076 | 1076 | accd = mread2(ea); |
1077 | 1077 | t->ea = ea; t->data = accd; |
1078 | 1078 | z_flag = Z_16( accd ); |
@@ -1083,8 +1083,8 @@ void sim(void) | ||
1083 | 1083 | break; |
1084 | 1084 | } case 0xDD: case 0xED: case 0xFD: /* STD N,Z,V=0 (6801) */ { |
1085 | 1085 | if (cputype == 0x6800) |
1086 | - goto invalid16; | |
1087 | - else { | |
1086 | +{ fputs( "STD op error\n", stderr ); goto invalid16; | |
1087 | +} else { | |
1088 | 1088 | setACCD( accd ); |
1089 | 1089 | n_flag = N_16( accd ); |
1090 | 1090 | z_flag = Z_16( accd ); |