Top 10 Craziest Assembly Language Instructions

Top 10 Craziest Assembly Language Instructions

Creel

4 года назад

465,661 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@VinyJones2
@VinyJones2 - 06.09.2023 20:04

Look like the last one is really useful for regexp

Ответить
@fieldmartan4426
@fieldmartan4426 - 09.09.2023 17:09

I've been absolutely humbled.

Ответить
@Decodeish1
@Decodeish1 - 10.09.2023 02:57

wow PEXT might actually be useful in my work... wth :D

Ответить
@Sniperboy5551
@Sniperboy5551 - 10.09.2023 08:53

I love the reference to The Doors, I totally forgot that Mr Mojo Risin was an anagram of Jim Morrison’s name.

Ответить
@paulstubbs7678
@paulstubbs7678 - 10.09.2023 09:35

All these instructions are just crazy, so specialised it's not funny. I think they kind of ruined X86 adding all this bloat, all it seemed to do is make generation after generation of processor obsolete because someone got smart and found a use for these meaning you needed new hardware all the time. I hope they don't ruin ARM in the same way.
This all makes we want to play retro with 8 bit chips, where signed numbers are the limits of head scratching.

Ответить
@MoosesValley
@MoosesValley - 10.09.2023 13:26

Appreciate the tour. Did quite a lot of Assembly coding in my earlier years, and quickly grew to love it - it's a lot of fun when you get up and running, but you need to keep so much more information in your brain / at your finger tips compared to higher level languages.

Ответить
@petyavodolaz
@petyavodolaz - 11.09.2023 08:23

Should've added some horror music. This shit is scary man

Ответить
@RichardDzien
@RichardDzien - 12.09.2023 01:53

How have i ended up watching this? I know literally nothing about ASM, and i am confident i would have understood just as much if this was delivered in Klingon. Yet i am watching it.

Ответить
@Gideon_Judges6
@Gideon_Judges6 - 12.09.2023 04:18

CMPXCHG is very useful! It's called test and set or compare and swap in other instruction sets. Just used it today actually... or at least the gcc wrapper for it __sync_val_compare_and_swap.

Ответить
@erez2417
@erez2417 - 13.09.2023 02:57

How in gods name would you even start creating a compiler that actually uses these

Ответить
@WolfgangS
@WolfgangS - 13.09.2023 22:06

C64's 6510 or Amigas 68000 Instructions was much more simple ...

Ответить
@impulsiveDecider
@impulsiveDecider - 14.09.2023 00:22

Just wanted to say hi, it's nice to be surrounded by like-minded nerds.

Ответить
@EndlessNameless5
@EndlessNameless5 - 14.09.2023 00:49

PCMPxSTRx seems the operation that I use to choose my breakfast!

Ответить
@parmesanzero7678
@parmesanzero7678 - 16.09.2023 23:54

I was hoping for example use cases for each of these. None of them is “crazy” if you know the use cases. These are essential for huge efficiency gains for some of these functions.

Ответить
@dimimegesis
@dimimegesis - 17.09.2023 04:03

CISC is wild

Ответить
@jasper265
@jasper265 - 17.09.2023 12:14

Calling the x86 implementation of the most fundamental operation in parallel programming crazy does not inspire confidence in your ability to determine what is crazy...

Ответить
@KazeN64
@KazeN64 - 17.09.2023 15:22

I've used MIPS excessively and never looked at X86 much. This feels like when you were playing yugioh in 1999 and you were summoning and setting 1 card every turn and then you get teleported to 2023 where people play their entire deck in one turn and have cards with effects that are 7 paragraphs

Ответить
@allezvenga7617
@allezvenga7617 - 17.09.2023 16:24

Thanks for your sharing

Ответить
@drakekoefoed1642
@drakekoefoed1642 - 18.09.2023 16:57

love .asm for dos. there were things in dos like batch files that were great, and even linux not so simple

Ответить
@drakekoefoed1642
@drakekoefoed1642 - 18.09.2023 17:03

these instructions sound great for things i would never use. i would have used the true random number thing. i used to take the fractional seconds and then do a bunch of scrambling with some data. a real random number generator could be taken from an arbitrary photo file.

Ответить
@JohnDoe-rx3vn
@JohnDoe-rx3vn - 19.09.2023 08:31

#1 is like an assembler within an assembler

Ответить
@DW-indeed
@DW-indeed - 19.09.2023 13:27

Was hoping for a string instruction. Wasn't disappointed

Ответить
@ostro169
@ostro169 - 22.09.2023 22:48

Я не понял, почему это выпало в рекомендации. Впрочем я вообще мало что понял. Но спасибо. Вдохновленный голос рассказчика заряжает энергией, чтобы завтра по́йти сидеть планктоном в офис <3

Ответить
@samahearn770
@samahearn770 - 28.09.2023 04:21

Holy crap, MPSADBW would be amazing for doing block matching for stereo vision depth and disparity calculations. You take the value of a bunch of grouped pixels from one camera frame and scrub it horizontally across the x axis of a frame from the other camera to find the closest match i.e. the minimum. Its like this instruction was tailor made for it. Great video btw

Ответить
@RonJohn63
@RonJohn63 - 29.09.2023 15:43

Pfft... VAX computed POLYNOMIALS 40 years ago. It also had instructions which mapped directly to COBOL statements.

Ответить
@Antiorganizer
@Antiorganizer - 29.09.2023 21:02

The sarcasm in your voice, lmao ! I like PEXT but it sounded ridiculous nevertheless, lol.

Ответить
@QuantenMagier
@QuantenMagier - 06.10.2023 09:16

Last time I benchmarked (like 10 years ago) the LOCK BTS instruction was faster for mutexes than LOCK CMPXCHG; and it's stupid anyway to waste a whole byte on a mutex, when a single bit suffices.

Ответить
@everynametaken
@everynametaken - 06.10.2023 21:24

The funny thing about PEXT is that it directly corresponds to the joke programming language INTERCAL's "select" operator. A joke operator made in 1972 has become a real, useful instruction for CPUs.

Ответить
@sack-shaw
@sack-shaw - 01.12.2023 12:42

Wow, it's basically a whole standard library down there.

Ответить
@punpck
@punpck - 09.12.2023 10:41

perhaps we get lucky and x86 is abandoned and replaced by risc-v or arm somewhen in future^^ it's ridiculous what the CPUs are still carrying burdens. Btw, I'm a bit sad that the "punpck" instructions (from which I have my nick) were too simple for this list 😅 But afaik they have been cleaning up a bit like getting rid of A20 gate and real-mode if I'm not mistaken.

Ответить
@TheBuilder
@TheBuilder - 26.01.2024 20:05

real

Ответить
@Some_Beach
@Some_Beach - 14.02.2024 15:19

vfmaddsub132ps xmm0, xmm1, xmmword ptr cs:[edi+esi*4+8068860h] is a valid x86 instruction

Ответить
@gazehound
@gazehound - 22.02.2024 02:51

Wow that carryless multiplication instruction took me straight back to my Information & Coding Theory class.

Ответить
@floppa9415
@floppa9415 - 21.03.2024 21:28

Crazy? The last one is more like crazy usefull and powerfull.

Ответить
@juliansantos1900
@juliansantos1900 - 03.04.2024 02:50

Thays crazy 😧

Ответить
@ninjacat230
@ninjacat230 - 16.04.2024 11:53

this is why i prefer RISC

Ответить
@arneseifert9257
@arneseifert9257 - 29.05.2024 16:09

PEXT seems like a very useful operation if you pack or unpack binary data.

Ответить
@oolmfoxz8170
@oolmfoxz8170 - 10.06.2024 02:10

confusion between x86 en xmms or sse...
x86=8bits instructions
x286=16bits instructions
x386=32bits instruction / protected mode
x686=complete and lastest 32bits
x86_64 (sometime amd64) = 64 bits instruction
XMMS, SSE3 etc= extended instructions not part of x86 formly

Ответить
@polhikkii
@polhikkii - 18.06.2024 13:21

Feels like I'm collecting slideshows at a slenderman game, half expecting him to pop up at some point. Nice style and vid.

Ответить
@dycedargselderbrother5353
@dycedargselderbrother5353 - 24.06.2024 00:37

I first learned about CMPXCHG in contemporary reviews of the 486 that questioned the level of architectural improvement over the 386. Some reviewers thought the instruction was bizarre and was representative of a lackluster architectural improvement. Granted, it wasn't used much in the main lifecycle of the product, but the Linux kernel ended up requiring it, which is why 386 support was eventually dropped. Linux is possibly dropping 486 support (can't tell if they went through with it) for a similar reason: they want to require the presence of CMPXCHG8B, introduced with the original Pentium.

Fun fact, it was problems with CMPXCHG8B that resulted in the Pentium F00F bug. The FDIV math bug is more famous, but the F00F bug would lock the processor rather than give slightly imprecise floating point results.

Ответить
@B_dev
@B_dev - 25.06.2024 17:22

Actualy though what were they thinking 💀

Ответить
@H33t3Speaks
@H33t3Speaks - 06.07.2024 14:21

How “micro” is this microcode lmao
This is really cool stuff. I mean, it’s really difficult to explain how far ISAs have moved in twenty years.

C can still do it but how much farther can we abstract mid level languages from how powerful machine code has become?

Ответить
@unknownworld0000
@unknownworld0000 - 24.08.2024 13:11

Udbgwr and udbgrd are also crazy!

Ответить
@johnmckown1267
@johnmckown1267 - 26.08.2024 19:44

And this explains why I like RISC processors.

Ответить
@georgegonzalez2476
@georgegonzalez2476 - 22.09.2024 19:02

Ah yes. Mostly useless instructions but sometimes a lifesaver. A long time ago I had to parse a file of road lat/longs, billions of them. The straightforward C code to do this took days. In a fit of energy, I rewrote the code to use the advanced string instructions and got like a 10,000 times speedup. Then we were limited by the disk speed.

Ответить
@heh2k
@heh2k - 20.11.2024 20:37

PCLMULQDQ can be used for acceleration of CRCs. There are single-cycle CRC32 and CRC32C instructions now too (common on other archs too: arm, sparc, risc-v).

Ответить
@gigigigiotto1673
@gigigigiotto1673 - 03.12.2024 13:39

Technically you are wrong when saying "this instruction does this in only 1 clock cycle" as when decoded by the cpu in micro ops, it might take more than 1 cycle to actually execute

Ответить
@goodtimejoe1325
@goodtimejoe1325 - 28.12.2024 12:38

Holly... Why is this comment section full of hypercompetent people like I just going through uni and reading some of these comments makes me really understand that we are standing on the shoulders of giants

Ответить
@rasitsimsek9400
@rasitsimsek9400 - 30.12.2024 15:22

X86 assembler syntax is odd compared to another CPUs like Motorola or ARM. The register names are strange like eax, edx ...

Ответить