12

The NOP opcode for x86/x86_64 is 0x90, but which is the analog on the iPhone with the ARM instruction set?

1

3 Answers 3

15

MOV r0, r0 is traditionally used in ARM code, which has the opcode 0xe1a00000; MOV r8, r8 is used in THUMB code (opcode 0x46c0)

3
13

ARMv7 has an actual NOP instruction, with the following encodings:

    0xbf00  2 byte thumb2 form
0xf3af8000  4 byte thumb2 form
0x*320f000  4 byte arm form

When targeting earlier versions of the architecture, assemblers translate NOP into the MOV instructions that moonshadow listed.

You shouldn't need to use the actual opcodes, as the development tools understand NOP.

9

I would like to add that non-conditional NOP for armv7 is 0xE320F000.

Note that if you are going to patch a file you will need to write bytes in reverse order (little endian) - 00 F0 20 E3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.