Menu

The time the x86 emulator team found code so bad that they fixed it during emulation - The Old New Thing
🖼️

The time the x86 emulator team found code so bad that they fixed it during emulation - The Old New Thing

Hacker News·4 months ago
#6cNpz2ME
#devblogs#code#memory#loop#initialize
Reading 0:00
15s threshold

During an exchange of war stories, a colleague of mine told one from back in the days when Windows included a processor emulator for x86-32 on systems that natively ran some other processor. (This has happened many times. And no, I don’t know which processor this particular story applied to.)

This particular emulator employed binary translation, generating native code to perform the equivalent operations of the original x86-32 code. This offered a significant performance improvement over emulation via interpreter. You can imagine that x86-32 is just a bytecode, and the emulator is a JIT compiler.

Anyway, my colleague found that there was one program that needed to allocate around 64KB of memory on the stack and initialize it.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.