Reputation: 480
Is there any way I can convert an assembly instruction such as
cmp %rdx,%rbp
to bytes, but from text, not memory (so not by going to an address, printing it as an instruction and then printing it as bytes). Alternatively using some other tool than gdb.
Upvotes: 0
Views: 3101
Reputation: 91
There is a tool called compiler explorer: https://godbolt.org/
Using it you can choose the input and output of your code. For example, for this case, you can insert the input as "Assembly" and in the output choose the flag of "compile to binary" to see for any instruction what is the relevant bytes for it.
Upvotes: 1