projects
/
dosemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
916af91
)
Initialize child AX register correctly during DOS EXEC
author
Robert Pengelly
<robertapengelly@hotmail.com>
Sun, 18 Oct 2026 15:06:22 +0000
(16:06 +0100)
committer
Robert Pengelly
<robertapengelly@hotmail.com>
Sun, 18 Oct 2026 15:06:22 +0000
(16:06 +0100)
interrupts.c
patch
|
blob
|
history
diff --git
a/interrupts.c
b/interrupts.c
index 54db0dbe84c44c120b319d39adfcf358e711c244..f015c8e07c49d795cf22c7514f61f32f1f70540c 100644
(file)
--- a/
interrupts.c
+++ b/
interrupts.c
@@
-6334,6
+6334,17
@@
static void int_21 (CPU8086 *cpu) {
}
+ /* EXEC reports invalid default FCB drives in the initial AX. */
+ cpu->regs[REG_AX] = 0;
+
+ if (mem_read8 (cpu->mem, cpu->mem_size, get_phys (child_psp, 0x5C)) > 26) {
+ cpu->regs[REG_AX] |= 0x00FF;
+ }
+
+ if (mem_read8 (cpu->mem, cpu->mem_size, get_phys (child_psp, 0x6C)) > 26) {
+ cpu->regs[REG_AX] |= 0xFF00;
+ }
+
cpu->psp_seg = child_psp;
cpu->ds = child_psp;
cpu->es = child_psp;