Oddball x86 Instructions

David Letterman made the top ten list famous. [Creel] has a top ten that should appeal to many Hackaday readers: the top 10 craziest x86 assembly language instructions. You have to admit that the percentage of assembly language programmers is decreasing every year, so this isnā€™t going to have mass appeal, but if you are interested in assembly or CPU architecture, this is a fun way to kill 15 minutes.

Some would say that all x86 instructions are crazy, especially if you are accustomed to reduced instruction set computers. The x86, like other non-RISC processors, has everything but the kitchen sink. Some of these instructions might help you get that last 10 nanoseconds shaved off a time-critical loop.

There are also interesting instructions like RDSEED, which generates a real random number. That can be useful but it takes many clock cycles to run, and like anything that purports to generate random numbers, is subject to a lot of controversies.

Our favorite, though, was PSHUFB. As soon as we saw ā€œMr. Mojo Risinā€™!ā€ as the example input string, we knew where it was going. You could probably go a lifetime without using any of these instructions. But if you need them, now youā€™ll know.

If you really want to learn modern assembly language, thereā€™s plenty of help. We occasionally write a little Linux assembly, just to keep in practice.



from Blog ā€“ Hackaday https://ift.tt/3stW4t3

Comments

Popular posts from this blog

Hackaday Links: May 31, 2020

Modern Radio Receiver Architecture: From Regenerative to Direct Conversion

Homebrew 68K Micro-ATX Computer Runs Its Own OS