There are several ways to determine the sequence of bytes that make up a program function.
Example 1
- Write a C function
- Use gcc to compile with the -c option
- Use objdump -d on the .o file to get the byte sequence for the machine instruction.
Example 2
Same as above, but write assembler instructions instead of a C function
- Using an editor (e.g. nano or emacs), create a file with assembler instructions (e.g. mycode.s)
- Use gcc to compile mycode.s, again with the -c option.