Motorola M6800 (6800) Exorciser / SWTPC emulator plus 6801 instruction set emulation
Revision | 890713b8fea67eee6c3c28e4d96bd001ed5de826 (tree) |
---|---|
Zeit | 2020-11-08 21:59:44 |
Autor | Joel Matthew Rees <joel.rees@gmai...> |
Commiter | Joel Matthew Rees |
partially debugged sim6800.c, fig Forth needs to start over.
@@ -1,5 +1,7 @@ | ||
1 | 1 | * OPT PRT |
2 | 2 | |
3 | + OPT 6801 | |
4 | + | |
3 | 5 | * fig-FORTH FOR 6801 |
4 | 6 | * ASSEMBLY SOURCE LISTING |
5 | 7 |
@@ -920,17 +922,19 @@ USLASH FDB *+2 | ||
920 | 922 | LDA A #17 |
921 | 923 | PSH A |
922 | 924 | TSX |
923 | - LDA A 3,X | |
924 | - LDA B 4,X | |
925 | -USL1 CMP A 1,X | |
925 | + LDD 3,X | |
926 | +USL1 CMPD 1,X | |
927 | +yo! | |
928 | + | |
929 | + BCC USL3 | |
930 | + CMP A 1,X | |
926 | 931 | BHI USL3 |
927 | 932 | BCS USL2 |
928 | 933 | CMP B 2,X |
929 | 934 | BCC USL3 |
930 | 935 | USL2 CLC |
931 | 936 | BRA USL4 |
932 | -USL3 SUB B 2,X | |
933 | - SBC A 1,X | |
937 | +USL3 SUBD 1,X | |
934 | 938 | SEC |
935 | 939 | USL4 ROL 6,X |
936 | 940 | ROL 5,X |
@@ -217,7 +217,11 @@ 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 | +#ifdef SIM6801 | |
221 | + if ( ((t->insn[0] & 0x0F) < 0x0C) && ((t->insn[0] & 0x0F) != 0x03 ) ) { | |
222 | +#else | |
220 | 223 | if ((t->insn[0] & 0x0F) < 0x0C) { |
224 | +#endif /* def SIM6801 */ | |
221 | 225 | if (t->insn[0] & 0x40) { |
222 | 226 | sprintf(operand, "B"); |
223 | 227 | } else { |
@@ -257,7 +261,12 @@ void show_trace(int insn_no, struct trace_entry *t) | ||
257 | 261 | insn = "SBC"; |
258 | 262 | break; |
259 | 263 | } |
260 | -#ifndef SIM6801 | |
264 | +#ifdef SIM6801 | |
265 | + case 0x03: /* ACCMD should never get here at run time. */ { | |
266 | + insn = ""; | |
267 | + break; | |
268 | + } | |
269 | +#else | |
261 | 270 | case 0x03: /* ??? */ { |
262 | 271 | goto invalid; |
263 | 272 | break; |
@@ -850,7 +859,11 @@ void sim(void) | ||
850 | 859 | opcode = fetch(); |
851 | 860 | |
852 | 861 | if (opcode & 0x80) { |
862 | +#ifdef SIM6801 | |
863 | + if ( ((opcode & 0x0F) < 0x0C) && ((opcode & 0x0F) != 0x03) ) { | |
864 | +#else | |
853 | 865 | if ((opcode & 0x0F) < 0x0C) { |
866 | +#endif /* def SIM6801 */ | |
854 | 867 | /* Get operand A */ |
855 | 868 | if (opcode & 0x40) { |
856 | 869 | a = accb; |