3 ms·
0xCD is the interrupt instruction on X86. If you tried to execute out-of-bounds memory, you get a trap right away (handily, the instruction is one byte long).
by insulanus 9y ago
0xCD is the interrupt instruction on X86. If you tried to execute out-of-bounds memory, you get a trap right away (handily, the instruction is one byte long).
http://www.mathemainzel.info/files/x86asmref.html#int http://www.mathemainzel.info/files/x86asmref.html#int
Before Intel processors had execute protection, this was a good way to catch bugs in your buggy C bugs. I mean programs.
- balls187 9y agoIt was a "good" way to catch a certain class of bugs on X86, while introducing a different class of (arguably) harder to catch bugs. With VS .NET (VC7.0), the C++ compiler no longer defaulted uninitialized memory in debug builds. Our software didn't just run on x86 (windows/linux), but also SGI MIPS (Irix), VAX (VMS), DEC Alpha (Tru64), AND PowerPC (VxWorks), so across all those compilers, we ended up having portable and robust code.