Convert assembly instructions to bytes in gdb

Solution 1:

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.