0

I am revisiting assembly, and there are many, many more instructions on x86 than my previous work with SPARCs. In short, I'm going to write some function that are assembly-inline to handle some speedups that the compiler is just doing poorly (there's no overflow bit in C). Anyway, for this reason, I am interested in the types of instructions that are generally and the addressing modes in a static context.

Is there a better tool than objdump for this? I hacked together objdump and awk, but I feel there's a better way.

b degnan
  • 672
  • 1
  • 14
  • 31
  • 2
    Wouldn't be StackOverflow a better site for this question? – polemon Dec 26 '21 at 13:30
  • @polemon maybe, but generally, I'm using unix tools, so I thought this would be better. If the mods think that it would be better at stackoverflow, I'll happily post it there. – b degnan Dec 26 '21 at 17:14
  • Ray Seyfarth has a nice book on Intel assembly (https://rayseyfarth.com/asm/). You can get the PDF for a pretty reasonable price. Otherwise I'm sure there are a ton of other references on the Internet. – Andy Dalton Dec 27 '21 at 00:03
  • A binary is already compiled to machine code for a specific ISA. At that point it's too late to make any decisions about what inline asm to use. Use CPP macros like `#ifdef __x86_64__`. (On most ISAs including x86, no new addressing modes get added by extensions, other than whole new modes like 64-bit mode. [Referencing the contents of a memory location. (x86 addressing modes)](https://stackoverflow.com/q/34058101)). For instructions, again CPP macros like `#ifdef __BMI2__` – Peter Cordes Jan 31 '22 at 14:56

0 Answers0