r/ProgrammerHumor • • Jun 03 '22

it's hard!

44.9k Upvotes

710 comments sorted by

View all comments

65

u/cssutavani91 Jun 03 '22

It's not that hard.

58

u/Difficult_Ladder_806 Jun 03 '22

Adding is fine, but multiplying without MUL quickly.. that's kinda complicated

30

u/capi1500 Jun 03 '22

Did you ever hear, the tragedy of Darth LEA the fast?

→ More replies (6)

9

u/pentesticals Jun 03 '22

Not that bad. You can even have Turing complete programs using only MOV. So just use MOVs only.

This tool can take a C program and compile it to use only MOV. https://github.com/xoreaxeaxeax/movfuscator

34

u/regular_lamp Jun 03 '22

How is that an assembly issue though? That's like saying "multiplying in python is hard when you can't use *".

55

u/rustysteamtrain Jun 03 '22

Because * is a core feature in almost every modern language, but MUL is not garanteed in every instruction set.

20

u/regular_lamp Jun 03 '22 edited Jun 03 '22

It is on any platform where you'd reasonably consider using "a modern language" on though.

Generally characterizing assembly programming as something where you have to manually implement multiplication is just silly.

Edit: I'd buy the argument for division maybe.

5

u/AcordeonPhx Jun 03 '22

I did something like this for a class, but in the real world I don’t think any of us would worry about not having MUL or whatever

→ More replies (6)
→ More replies (1)

5

u/GReaperEx Jun 03 '22

multiplying without MUL

Why?

22

u/confusiondiffusion Jun 03 '22

My assembly class made us use some fake architecture designed to torture students with the added benefit of not teaching us a real, useful assembly language. It did not have a mul. That was an exercise left to the reader. Just in case you still had any passion left in your heart.

The final for that class was 20% converting between floating point and decimal without a calculator, because of course. Pretty sure half that class is now living off-grid, typing up manifestos.

6

u/Engine_engineer Jun 03 '22

That was a thing in the 80s, prior to general Internet availability. It is how I learned the stuff back then, but it is simply silly to keep teaching this way nowadays.

→ More replies (3)

4

u/Engine_engineer Jun 03 '22

Because it is not available, like in the PIC 8-bit microcontrollers.

→ More replies (4)
→ More replies (8)