VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

I'm trying to get my 8086 emulation fully working (opcodes still have errors). Anyone knows what's going wrong?

The attachment opcodes_8086.c is no longer available

I'm trying to get the Turbo XT BIOS running using this. I'm currently comparing output to the fake86's CPU. I notice that there's a sudden jump to F000:46E0 while executing a REP STOSW (this is fixed by the debugger to jump manually by loading the expected registers):

0:00:15:10.6.0000: Invalid data according to debuggerverify.dat before exexuting the following instruction:
0:00:15:10.6.0000: Registers:
0:00:15:10.6.0000: AX: 0000, BX: 0000, CX: 0A0D, DX: 55AA
0:00:15:10.6.0000: CS: F000, DS: 0040, ES: 0000, SS: 0000
0:00:15:10.6.0000: SP: 0000, BP: 0000, SI: 0000, DI: 2BE6
0:00:15:10.6.0000: IP: E0E2, FLAGS: F046
0:00:15:10.6.0000: FLAGSINFO:c1P0a0Zstido1111
0:00:15:10.7.0000: Expected:
0:00:15:10.7.0000: Registers:
0:00:15:10.7.0000: AX: 0000, BX: 0000, CX: AA0A, DX: 0055
0:00:15:10.7.0000: CS: F000, DS: 0040, ES: 0000, SS: 0000
0:00:15:10.7.0000: SP: 0000, BP: E200, SI: E600, DI: 002B
0:00:15:10.7.0000: IP: 46E0, FLAGS: F000
0:00:15:10.7.0000: FLAGSINFO:c0p0a0zstido1111
0:00:15:10.8.0000: Writing to memory: 00002BE6=00 ( )
0:00:15:10.8.0000: Writing to memory: 00002BE7=00 ( )
0:00:15:10.8.0000: F000:E0E2 (F3AB)REP STOSW
0:00:15:10.8.0000: Registers:
0:00:15:10.8.0000: AX: 0000, BX: 0000, CX: 0A0D, DX: 55AA
0:00:15:10.8.0000: CS: F000, DS: 0040, ES: 0000, SS: 0000
0:00:15:10.8.0000: SP: 0000, BP: 0000, SI: 0000, DI: 2BE6
0:00:15:10.8.0000: IP: E0E2, FLAGS: F046
0:00:15:10.9.0000: FLAGSINFO:c1P0a0Zstido1111

Anybody knows what's at F000:46E0 at the Turbo XT BIOS?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 2 of 2, by superfury

User metadata
Rank l33t++
Rank
l33t++

I'm comparing output register states (before every instruction) with fake86's CPU(combined with special trigger dumps for hw interrupts(Trap flag and IRQs). There is no mention of any IRQ nor any Trap interrupt at this point.

So the fake86 jumps to that point without any officially documented reason? Maybe it's a hack to make the BIOS working in fake86?

Anyone knows why fake86 jumps to F000:46E0 at this point, while obviously correctly running a REP STOSW instruction (previous REP STOSW instructions have correct register values, and IRQs aren't enabled at this point yet as far as I know?

Is the IRQ0 handler installed at this point of execution in fake86? So interrupt 08h handler afaik?

Is fake86 incorrectly triggering an IRQ0? Or are all IRQs enabled when the PC is turned on?

According to my debuggerverification16.dat dump no HW IRQ is triggered (the dump is made from after IRQs are processed in exec86() function of fake86's CPU.c (also at the point of the IRQ interrupt and Trap handling in the exec86() function. This shows up right before the invalid register dump, if any is encountered, which isn't in this case).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io