Charlie Balogh: "I involuntarily (cheers @root42@chaos.social!) sp…" - Mastodon
Attached: 1 image I involuntarily (cheers @root42@chaos.social!) spent my Saturday on tracing down an ancient Turbo C bug. 😅 The intr() function, used to call DOS/BIOS interrupts will pass the wrong BP register value to the interrupt. BP is heavily used in stack handling, so intr() generates a BP-reload-and-INT-trampoline on the stack, but the BP reload offset it creates is off-by-four. Fix: Look for the sequence C6 46 F4 E2 in affected binaries, and change E2 to DE. More details in reply. 🧵 #msdos #retrocomputing