News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

What are the 5 most absurd x86 assembly instructions?

Started by jj2007, April 22, 2022, 08:59:36 PM

Previous topic - Next topic

jj2007

Every instruction was created with a purpose, and even if the purpose is highly specialized, it's still a purpose.

fnop, BSF, BSR, SARX/SHLX/SHRX, INTO, GF2P8AFFINEINVQB...

See here for the AAC instruction (use Ctrl F to find AAC inside the page); my favourite so far is WBT :cool:

LiaoMi


hutch--

 :biggrin:

I think AT&T notation GAS is more as a backend for the GNU C compiler than for writing assembler code manually. GAS with Intel notation is OK to use with a little practice.

_japheth

Quote from: jj2007 on April 22, 2022, 08:59:36 PM
fnop, BSF, BSR, SARX/SHLX/SHRX, INTO, GF2P8AFFINEINVQB...

Ouch - I admit I used SHLD and SHRD quite regularly and found them useful for 64-bit shifts. Since they are so absurd, what am I missing?  :hmmm:
Dummheit, gepaart mit Dreistigkeit - eine furchtbare Macht.

jj2007

Quote from: _japheth on April 30, 2022, 03:32:59 AM
Ouch - I admit I used SHLD and SHRD quite regularly and found them useful for 64-bit shifts. Since they are so absurd, what am I missing?  :hmmm:

I didn't mention shld or shrd, and they are not found in the pages I am linking to. Probably you confuse it with the SHLX and SHRX instructions mentioned there.

I use shld/shrd 3 times in 43k lines of code, so I agree they are not absurd - although rarely needed :cool:

_japheth

Quote from: jj2007 on April 30, 2022, 09:50:40 AM
I didn't mention shld or shrd, and they are not found in the pages I am linking to. Probably you confuse it with the SHLX and SHRX instructions mentioned there.

Ah, I see  I thought the 'X' in SHLX/SHRX was a placeholder for SHLD/SHRD/SHLQ/SHRQ/....  :tongue:
Dummheit, gepaart mit Dreistigkeit - eine furchtbare Macht.

jj2007

SARX/SHLX/SHRX — Shift Without Affecting Flags

On a side note: "SHL is faster if surrounded by instructions that write all flags without reading them. (This is one case where ADD 1 is preferable to INC) ... still a lot worse than SHLX"