Following up to prior comments and answers
The sf bit is never at bit 7 it is always at bit 31 for this instruction, the ARM view from the document you posted is the only proper way to view the instruction. Never try to byte swap that view of the instruction. Fix the data or even better use a tool that works rather than a buggy/broken one.
so.s
movz w1,#0x6208
gnu binutils
aarch64-none-elf-as so.s -o so.o
aarch64-none-elf-objdump -d so.o
so.o: file format elf64-littleaarch64
Disassembly of section .text:
0000000000000000 <.text>:
0: 528c4101 mov w1, #0x6208
clang/llvm
clang -c so.s -o so.o
llvm.objdump so.o
Disassembly of section .text:
0000000000000000 <$x.0>:
0: 01 41 8c 52 mov w1, #25096
now this is different than 01418c52, the spacing implies these are bytes not a whole word and then that can indicate there may be some endianness involved. I do not agree necessarily that disassemblers byte swap, they may as in this case show a byte view vs a word or halfword view yes. And then if a halfword view you have to know what order they show in memory/to the processor:
mov.w r10,r11
0: ea4f 0a0b mov.w r10, r11
0xEA4F is the first half of the instruction in this case.
Both clang/llvm and binutils use the same file format as shown so you can disassemble the clang/llvm generated binary with binutils
aarch64-none-elf-objdump -d so.o
Disassembly of section .text:
0000000000000000 <.text>:
0: 528c4101 mov w1, #0x6208 // #25096
There are different forms of big endian. As documented for armv8
If I have the 32 bit little endian (default/normal) word 0x11223344 at address 0x1000 then little endian the BYTES view is
0x1000: 0x44
0x1001: 0x33
0x1002: 0x22
0x1000: 0x11
(not 11223344 that is a word view)
for big endian the BYTE view of the same data at the same time is
0x1000: 0x44
0x1001: 0x33
0x1002: 0x22
0x1000: 0x11
Which is the same, known as byte invariant or BE-8. For armv6 and later big endian is BE-8, byte invariant. (ARMv4 and v5 are word invariant BE-32)
A word access though does vary as one would expect:
0x1000: 0x11223344 little endian DATA
0x1000: 0x44332211 big endian DATA
0x1000: 0x11223344 little endian INSTRUCTION fetch
0x1000: 0x11223344 big endian INSTRUCTION fetch
Instruction endianness
In ARMv8-A, A64 instructions have a fixed length of 32 bits and are always little-endian.
The tool you are using is simply broken and if the goal of the tool is to assemble and show you the machine code or vice versa, and it cannot do this simple task (which it clearly cannot), then I would simply avoid the site as a whole. If they cannot do something this simple then they do not understand the instruction set well enough. Their "gdb" big endian switch is not a solution it is just one more thing that is broken.
The ARM documentation is correct and binutils is easy to use. clang/llvm a little harder, I can provide a build script if you want. Although binutils objdump has its issues it is still the best set of tools for this kind of work. You can
easily go back and forth from assembly language and machine code.
movz w1,#0x6208
.inst 0x528c4101
aarch64-none-elf-as so.s -o so.o
aarch64-none-elf-objdump -d so.o
so.o: file format elf64-littleaarch64
Disassembly of section .text:
0000000000000000 <.text>:
0: 528c4101 mov w1, #0x6208 // #25096
4: 528c4101 mov w1, #0x6208 // #25096
(can as well with clang/llvm)
Disassembly of section .text:
0000000000000000 <$x.0>:
0: 01 41 8c 52 mov w1, #25096
4: 01 41 8c 52 mov w1, #25096
You can see from the document segment you posted the instruction starts with x1010010 which can either be 0x52 or 0xD2 the (broken) tool shows 02418C52 which quickly indicates they may have byte swapped the machine code (further investigation is required if you see such a thing as it could be dumb luck) if you had not see a 0x52 nor 0xD2 in the data then it is not the same instruction, or there is some other issue.
If you want to see the machine code for this architecture just use binutils or clang/llvm or some other easy to use, not-broken, tool.