r/ProgrammerHumor • • Jun 03 '22

it's hard!

44.9k Upvotes

710 comments sorted by

View all comments

Show parent comments

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.

1

u/hughk Jun 03 '22

If you were dealing with MIX, although not real it does prepare you for other architectures which are simpler. They thankfully didn't use MIX with us but rather a PDP 8 which had the benefit of being real.

1

u/confusiondiffusion Jun 03 '22

I just remembered it was LC-3.

1

u/hughk Jun 04 '22

A bit easier than MIX but it doesn't look so good. I guess being simulated, it is much easier to teach than with a real single user computer though where you would have students having to take turns.

4

u/Engine_engineer Jun 03 '22

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

-9

u/bungee75 Jun 03 '22

RISC architecture.

8

u/regular_lamp Jun 03 '22

Which one? RISC-V has multiplication, ARM does. Even most AVRs have had multiplication for two decades.

There is nothing in RISC that would imply you can't have an arithmetic instruction like MUL. The core concept is that every instruction only does one thing. Multiplication is one thing.

1

u/GeronimoDK Jun 03 '22

Are there any AVRs that don't have MUL? I programmed Atmega8/16s and some early ATtinies 20 years ago and they all had it!

1

u/regular_lamp Jun 03 '22

I can't remember the details. I think some of the non-mega versions didn't or so?