title: Getting ILL_ILLOPC (illegal opcode) when trying to execute MRC or MCR instructions on Android
body: <p>I'm using ARM Assembly trying to access several coprocessor registers. Whenever I have something like</p>
  
  <pre><code>mcr p15, #1, r1, c1, c0
  </code></pre>
  
  <p>or</p>
  
  <pre><code>mrc p15, #0, r0, c1, c0
  </code></pre>
  
  <p>I get <code>signal 4 (SIGILL), code 1 (ILL_ILLOPC), fault addr 80400d00</code> error, which means that something is getting an illegal (non-existent, I assume) operation code (instruction). There are several possibilities. The <code>mrc</code> and <code>mcr</code> instructions themselves might be illegal, but the code compiles with no complaints. If this were a privileged mode issue, I'd expect to see a <code>ILL_PRVOPC</code> SIGILL instead.</p>
  
  <p>Another possibility is that the opcode that is a part of <code>mrc</code> and <code>mcr</code> (syntax is <code>MRC{2}&lt;c&gt;&lt;q&gt; &lt;coproc&gt;, #&lt;opc1&gt;, &lt;Rt&gt;, &lt;CRn&gt;, &lt;CRm&gt;</code>) might be illegal. I've tried possible opcodes, but I'm still getting the same error and the same stack dump.</p>
  
  <p>Does Android generally allow there instructions or is it something I'm doing that's wrong? Anything else I should be looking at to debug?</p>