Add proper report if something is trying to call a non initialized interrupt

aka CS=0000h, IP=0000h which is more than likely to crash the whole thing.
This commit is contained in:
Godzil 2019-09-20 16:26:07 +01:00
parent 43292a26dc
commit f71f131dcc

View File

@ -128,6 +128,14 @@ void nec_int(uint16_t vector)
I.TF = I.IF = 0;
dest_off = ReadWord(vector);
dest_seg = ReadWord(vector+2);
if ((dest_off == 0) && (dest_seg == 0))
{
printf("Something wrong with the interrupt, exiting...\n");
//dump_memory();
return;
}
PUSH(I.sregs[CS]);
PUSH(I.ip);
I.ip = (WORD)dest_off;
@ -151,6 +159,14 @@ static void nec_interrupt(uint32_t int_num, /*BOOLEAN*/ int md_flag)
dest_off = ReadWord((int_num)*4);
dest_seg = ReadWord((int_num)*4+2);
if ((dest_off == 0) && (dest_seg == 0))
{
printf("Something wrong with the interrupt, exiting...\n");
//dump_memory();
return;
}
PUSH(I.sregs[CS]);
PUSH(I.ip);
I.ip = (WORD)dest_off;