From: Miodrag Milanovic

Hello Aaron,
 
I have found few more things not ok in T11, this time I have fixed it myself.
 
1. HALT - should call interrupt vector
2. ILLEGAL - had PC=0 at the end which makes code not run fine
3. MARK - now it is implemented

Can you please check if your drivers are working fine with these cahanges.
 
After adjustments I have some things working finaly.
 
Please inform me,
 
Miodrag Milanovic
This commit is contained in:
Aaron Giles 2008-04-21 03:41:51 +00:00
parent af71decdb7
commit cb8514a175
2 changed files with 27 additions and 5 deletions

View File

@ -255,7 +255,7 @@ static void op_0000(void)
{
switch (t11.op & 0x3f)
{
case 0x00: /* HALT */ t11_ICount = 0; break;
case 0x00: /* HALT */ halt(); break;
case 0x01: /* WAIT */ t11_ICount = 0; t11.wait_state = 1; break;
case 0x02: /* RTI */ t11_ICount -= 24; PC = POP(); PSW = POP(); change_pc(PC); t11_check_irqs(); break;
case 0x03: /* BPT */ t11_ICount -= 48; PUSH(PSW); PUSH(PC); PC = RWORD(0x0c); PSW = RWORD(0x0e); change_pc(PC); t11_check_irqs(); break;
@ -266,6 +266,17 @@ static void op_0000(void)
}
}
static void halt(void)
{
t11_ICount -= 48;
PUSH(PSW);
PUSH(PC);
PC = RWORD(0x04);
PSW = RWORD(0x06);
change_pc(PC);
t11_check_irqs();
}
static void illegal(void)
{
t11_ICount -= 48;
@ -275,7 +286,17 @@ static void illegal(void)
PSW = RWORD(0x0a);
change_pc(PC);
t11_check_irqs();
PC = 0;
}
static void mark(void)
{
t11_ICount -= 36;
SP = SP + 2 * (t11.op & 0x3f);
PC = REGW(5);
REGW(5) = POP();
change_pc(PC);
}
static void jmp_rgd(void) { t11_ICount -= 15; { JMP(RGD); } }

View File

@ -21,6 +21,7 @@ modes:
*/
static void op_0000(void);
static void halt(void);
static void illegal(void);
static void jmp_rgd(void);
@ -168,7 +169,7 @@ static void asl_ded(void);
static void asl_ix(void);
static void asl_ixd(void);
/*static void mark(void);*/
static void mark(void);
static void sxt_rg(void);
static void sxt_rgd(void);
@ -1112,7 +1113,7 @@ static void sub_ixd_ixd(void);
static void (*const opcode_table[65536 >> 3])(void) =
{
/* 0x0000 */
op_0000, illegal, illegal, illegal, illegal, illegal, illegal, illegal,
op_0000, halt, illegal, illegal, illegal, illegal, illegal, illegal,
illegal, jmp_rgd, jmp_in, jmp_ind, jmp_de, jmp_ded, jmp_ix, jmp_ixd,
rts, illegal, illegal, illegal, ccc, ccc, scc, scc,
swab_rg, swab_rgd, swab_in, swab_ind, swab_de, swab_ded, swab_ix, swab_ixd,
@ -1177,7 +1178,7 @@ static void (*const opcode_table[65536 >> 3])(void) =
asr_rg, asr_rgd, asr_in, asr_ind, asr_de, asr_ded, asr_ix, asr_ixd,
asl_rg, asl_rgd, asl_in, asl_ind, asl_de, asl_ded, asl_ix, asl_ixd,
/* 0x0d00 */
illegal, illegal, illegal, illegal, illegal, illegal, illegal, illegal,
mark, mark, mark, mark, mark, mark, mark, mark,
illegal, illegal, illegal, illegal, illegal, illegal, illegal, illegal,
illegal, illegal, illegal, illegal, illegal, illegal, illegal, illegal,
sxt_rg, sxt_rgd, sxt_in, sxt_ind, sxt_de, sxt_ded, sxt_ix, sxt_ixd,