This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ARM v7 Instruction Set Architecture Opcode Code

Hello,

I am working with some ARM hardware and I wrote a program in ARM Assembly. The ARM hardware that I am using requires the the program to be in HEX values and I found a website online that allowed me to convert the ARM Assembly language to HEX, the converter I used is 'x32 - ARM32/AArch32/ARMv7'. I would like to verify that the online converter works correctly so I have been looking online for an ARM Instruction Set Architecture document or manual for ARMv7.

I did find the manual for ARMv7 but I couldn't find the Opcode HEX values for the corresponding ARM assembly commands. I am been searching online but no luck.

Any advice? Or information about where I can find a chart, list, or document about ARM Assembly HEX opcodes?

Thanks,

David

  • Have you tried putting on the listing option on the assembler to output the code in a readable form? Or tried a utility like objdump to look at the object file produced by the assembler or linker. I don't know what manual for ARMv7 you found but the ARM® Architecture Reference Manual ARMv7-A and ARMv7-R edition is over 20 megabytes long and goes into everything in excruciating detail and you probably are better looking at some introductory text instead.

  • For a recent project of mine, I wrote an ARMv7 assembler stub, available here.

    I also wrote the same small prototype in Ruby a few months ago.

    The manual you're searching for is the ARM Architecture Reference Manual, which describes how the opcodes are formed in section 3.8 Alphabetical list of instructions

    Also, as stated by , what you can do is :

    • write a small assembly listing
    • save it
    • assemble it with a version of Sourceware AS that understands ARMv7
    • Then use objcopy to generate a 'raw' binary, containing only the text section (aka 'the code') using the following command :

    Like this, assuming you have a 'test.s' file containing the code you want to convert :

    export CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi-
    ${CROSS_COMPILE}as -o test test.s
    ${CROSS_COMPILE}objcopy test raw -O binary



    At that point, you should have a file named 'raw', containing only the code generated.

  • Also, note that what you call "hex values" is just an hexadecimal representation of the machine code.

    If you have something that produces machine code, and view this code with an hexadecimal editor, you'll get the "hex values" of the code.
  • Excuse me but, are you trying to upload an hex file to your target or you´ll enter each hex value manually translating each op code?