34 ms·
Re: “Does a compiler use all x86 instructions?”
- peter_d_sherman 5y agoThe following might be of interest: movfuscator "The single instruction C compiler" https://github.com/xoreaxeaxeax/movfuscator https://github.com/xoreaxeaxeax/movfuscator ...In other words, yes, it is possible to write a complete compiler which creates all of its compiled code by using only one single type of x86 instruction... Also, this might be interesting: https://en.wikipedia.org/wiki/One-instruction_set_computer https://en.wikipedia.org/wiki/One-instruction_set_computer >"A one-instruction set computer (OISC), sometimes called an ultimate reduced instruction set computer (URISC), is an abstract machine that uses only one instruction – obviating the need for a machine language opcode.[1][2][3] With a judicious choice for the single instruction and given infinite resources, an OISC is capable of being a universal computer in the same manner as traditional computers that have multiple instructions.[2]:55 OISCs have been recommended as aids in teaching computer architecture[1]:327[2]:2 and have been used as computational models in structural computing research.[3]"
- vegadw 5y agoYeah, I've seen the movfuscator before. It's kinda funny to think it's only ~66% different than normal output (if you don't count the size inflation) There's also https://hackaday.com/2020/11/23/a-cpu-less-computer-with-a-single-nor-gate-alu/ https://hackaday.com/2020/11/23/a-cpu-less-computer-with-a-s... which is sorta related
- remram 5y agoIt's a bit different because the mov-only compiler would be taking advantage of the multiple addressing modes available for mov. Those act more like many instructions. You couldn't build a compiler/machine that only does copies.
- TheAdamist 5y agoMost of the exotic and rare instructions are data that a linear disassembler plows through without knowing any better. 3dnow and via extensions aren't actually emitted for common binaries, even if objdump claims they are there. Validating my own disassembler against objdumps output showed a lot of these outliers. A recursive disassembler is better at only attempting to disassemble code that actually appears in the code path, although then it misses things that are indirectly in the code sequence. It's an unsolved problem. You might consider rerunning your analysis with ghidra or Ida, but those aren't as easy to mass disassemble like objdump *.