Reputation: 21290
In a Bash shell:
$ echo "0xe1 0x4f" | llvm-mc-3.2 -disassemble -triple i386
.section __TEXT,__text,regular,pure_instructions
loope 79
$ echo -n "\xe1\x4f" | ndisasm -b 32 -
00000000 E14F loope 0x51
But 0x51 is 81 in decimal.
Upvotes: 2
Views: 161
Reputation: 126203
It should really disassemble as
loope *+79
That is, loop branch relative forward 79 bytes. Now in the ndisasm case, the instruction is at address 0 (so the next instruction, which is what the relative branch is computed off, is address 2), so it computes the target (absolute) address for you: 2+79 = 81 (0x51)
Upvotes: 4