assemblyarmmachine-codearmv8

About ARMv8-A `SVC #0x0f0f` to machine code


Below is objdump -D output:

80730:  d401e1e1    svc #0x0f0f

First column is the address and second is machine code, final is instruction.

I know the SVC opcode code is 0xd4, but why 0x0f0f become to 0x1e1e1 ?

I want to know how 0x0f0f transfers to 0x1e1e1.

Thanks for any reply.


Solution

  • According to Section C4.1.93.2, Exception Generation, in the Arm Architecture Reference Manual for A-profile architecture, the 0x0f0f is shifted over 5 bits. The fields in the SVC instruction are:

    enter image description here

    opc, op2 and LL for SVC are

    enter image description here

    So hex((0b000 << 20) | (0x0f0f << 5) | 0b00001) is 0x1e1e1.