Ted Middleton
Ted Middleton

Reputation: 7304

Can't compile/assemble MRC and MCR coprocessor instructions on iPhone?

I don't seem to be able to assemble the MCR and MRC ARMv7 instructions (these are coprocessor access instructions) with iPhone? I have some of these instructions in some inline assembly blocks that work quite nicely with the Code Sourcery gcc toolchain building for a different CortexA8 chip (an OMAP chip), but Apple's assemblers - the Clang assembler and their build of the gnu assembler - throw up errors:

{standard input}:41:bad instruction `MRC p15,0,r2,C9,C12,0'
{standard input}:56:bad instruction `MCR p15,0,r0,C9,C12,0'
{standard input}:78:bad instruction `MCR p15,0,r0,C9,C12,1'
{standard input}:96:bad instruction `MCR p15,0,r0,C9,C12,2'
{standard input}:119:bad instruction `MCR p15,0,r2,C9,C12,4'
{standard input}:143:bad instruction `MCR p15,0,r0,C9,C12,5'
{standard input}:165:bad instruction `MCR p15,0,r0,C9,C13,1'
{standard input}:187:bad instruction `MCR p15,0,r0,C9,C13,2'
{standard input}:209:bad instruction `MCR p15,0,r0,C9,C13,0'
{standard input}:228:bad instruction `MRC p15,0,r0,C9,C13,0'
{standard input}:253:bad instruction `MRC p15,0,r0,C9,C13,2'

Any ideas?

Upvotes: 2

Views: 1605

Answers (1)

servn
servn

Reputation: 3069

(Originally as a comment on the question)

Random guess: have you tried changing "MRC" to "mrc"? Apple has a relatively ancient ARM assembler that has trouble with anything written in upper-case.

Upvotes: 1

Related Questions