One of the cool things about ISAs with variable-length instructions is that when you start disassembling at a random address you can get very interesting results as the poor disassembler tries valiantly to figure out what’s going on. Combine that with a rather large instruction set in which most instructions aren’t used any more and you can learn all kinds of things.
For example, who knew that the x86 instruction set has an instruction called BOUND? Not me, that’s for sure — until otool showed it to me tonight while trying to disassemble something in the kernel. I’ll never use it, of course, but it’s interesting nonetheless.
Update: In case you’re wondering why nearly nobody uses the BOUND instruction (aside from it being slower than the equivalent implementation using other instructions on all modern processors) there’s this note from the page above:
A second problem with the bound instruction is that it executes an int 5 if the specified register is out of range. IBM, in their infinite wisdom, decided to use the int 5 interrupt handler routine to print the screen. Therefore, if you execute a bound instruction and the value is out of range, the system will, by default, print a copy of the screen to the printer. If you replace the default int 5 handler with one of your own, pressing the PrtSc key will transfer control to your bound instruction handler.
Neat. That’s a heck of a lot simpler than figuring out the printing APIs.