title: Find which assembly instruction caused an Illegal Instruction error without debugging
body: <p>While running a program I've written in assembly, I get <code>Illegal instruction</code> error. Is there a way to know which instruction is causing the error, without debugging that is, because the machine I'm running on does not have a debugger or any developement system. In other words, I compile in one machine and run on another. I cannot test my program on the machine I'm compiling because they don't support SSE4.2. The machine I'm running the program on does support SSE4.2 instructions nevertheless.</p>
  
  <p>I think it maybe because I need to tell the assembler (YASM) to recognize the SSE4.2 instructions, just like we do with gcc by passing it the <code>-msse4.2</code> flag. Or do you think its not the reason? Any idea how to tell YASM to recognize SSE4.2 instructions?</p>
  
  <p>Maybe I should trap the <a href="http://en.wikipedia.org/wiki/SIGILL" rel="noreferrer">SIGILL</a> signal and then decode the SA_SIGINFO to see what kind of illegal operation the program does.</p>