I've been working with reverse engineering tape image and disk image formats and the files and filesystems they contain.

It struck me that sometimes there are data fields that are not in the same endian as the platforms these represent, sometimes there are even fields of both endians. (I bet this is even more common in networking.)

It would be really beneficial to have variants of the assembly directives dw/defw, dd/defd, etc that include endian information so you can see at a glace what the intended numeric value is and also when the endian is not the expected one.

This makes me wonder if there are already assemblers that let the programmer define words, longs, etc in specific endian formats. And if there are not assemblers that do it, perhaps there are some disassemblers that do.

I'm thinking of adding a feature request for this in Ghidra but first I want to know if it's already in some tools, and what syntax they use if so.

  • 1
    When needed in real world assembly, I would add it as a macro.
    – Jongware
    Jun 6, 2020 at 10:34
  • @usr2564301: Great point! I have no idea if advanced disassemblers like Ida Pro supports reverse-macros. Jun 7, 2020 at 3:03

1 Answer 1


Specifically for IDA, there is no such feature built in but you should be able to create a custom data format to handle this:


(The post is somewhat old so some details may have changed but the functionality is still there)

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.