Has there ever been an Instruction set Architecture that includes an explicit "range check" instruction?
I'm thinking something that would cause an exception, rather than storing a result.
rangecheck op1, op2, op3 ; raise an exception if op1 is not between op2 and op3.
rangecheck op1, op2 ; raise an exception if op1 is not between zero and op2.
Ideally, op2, op3 could be immediate values, or whatever the CPU normally uses for operands (registers on RISC, anything on CISC?)