3 ms·
BOUND didn't get much of an use because it is useful only for bounds checking of the "dump core if outside" kind.
by dfox 12y ago
BOUND didn't get much of an use because it is useful only for bounds checking of the "dump core if outside" kind.
- mkesper 12y agoWhy? (Honest question).
- unwind 12y agoBecause the instruction raises a software exception if the test fails. This is a rather heavy-handed reaction, although I guess it kind of makes sense from the instruction's point of view I guess. Of course a language runtime based on using this instruction needs to capture the exception and handle it, core-dumping need not be the only option at that point.
- stassats 12y agoPart of the issue is that the interrupt number, 5, is hard-wired. So there really was no need to keep it alive.
- userbinator 12y agoDivide-by-zero has always been interrupt 0, and the page fault is at #14, and that hasn't been problematic... BOUND does raise an exception if it fails but I think that's a good thing - if code is doing array bounds-checking, OOB accesses are very likely to be a bug (and possible security vulnerability) so aborting execution by default is the right thing to do.