3 ms·
Here it is (warning: Perl): http://pastebin.com/MFmDzY0g http://pastebin.com/MFmDzY0g It calls "objdump -d" on the binary, which is binutil's disassembler. ob
by kr7 10y ago
Here it is (warning: Perl): http://pastebin.com/MFmDzY0g http://pastebin.com/MFmDzY0g
It calls "objdump -d" on the binary, which is binutil's disassembler.
objdump prints each instruction out in the following format:
5dc: 67 80 7d 00 00 cmpb $0x0,0x0(%ebp)
The first part is the instruction offset; the second is the bytes that comprise the instruction; the third part is the instruction in AT&T assembly syntax.
The script uses regexs to cut off the front and back, then counts the number of bytes (in hex format) in the second part.
Then it calculates the average for all instructions.
- TheDauthi 10y agoMight I suggest http://pastebin.com/2PHXi78A http://pastebin.com/2PHXi78A instead? It handles a few bugs from the original, and cleans the nested loops.