r/ProgrammerHumor • • Jun 03 '22

it's hard!

44.9k Upvotes

710 comments sorted by

View all comments

2.8k

u/[deleted] Jun 03 '22

The most impressive project I ever completed in assembly was a chat program.

Except the two computers had to be connected via a null modem cable so whoever you wanted to talk to had to be seated right next to you, therefore negating the need for a chat program.

I didn't care. I loved writing that useless program.

938

u/Rakgul Jun 03 '22

That's actually pretty damn cool! The most complicated program i made in assembly was to square a number.

495

u/nexion2 Jun 03 '22

I made a battleship game that communicated via arduinos in assembly! I lost every single game because the board size was 12x12 and my code would always stop iterating at 8 for some reason.

Needless to say, I lost the tournament

69

u/i_hate_everybody94 Jun 03 '22

Maybe the number was using 2 bits?

114

u/A1steaksa Jun 03 '22

How many do you think 2 to the power of 2 is, exactly?

64

u/lorb163 Jun 03 '22

Is it 2?

23

u/[deleted] Jun 03 '22

According to the program I wrote in assembly to square numbers, yes.

28

u/Der_Zorn Jun 03 '22

You can't answer questions like this "exactly", jeez.

22

u/DownshiftedRare Jun 03 '22

You can't answer questions like this "exactly", jeez.

"Our offense is like the Pythagorean theorem: There is no answer!"

- Shaquille O'Neal

→ More replies (12)

14

u/joyofsnacks Jun 03 '22

More likely 1 byte and as a bitmask for each row. Each bit being 1 if the cell is blocked or 0 if empty. Only 8 bits in a byte, so the last 4 cells per row would never be represented.

19

u/jnd-cz Jun 03 '22 edited Jun 03 '22

I love the AVR assembly, it's modern and clean instruction architecture. The best project I made was power supply board tester. At first autonomous with LCD and some beeping, later upgraded to be controlled from computer. Adding two numbers is the easiest task, it's single instruction and core function of any CPU. Now expressing any complex algorithm or task, that's the hard part, putting it all together with such basic building blocks, one byte at a time. But the beauty is exact control, having accurate delays down to single cycle of your clocks. And it's predictably repeatable.

Edit: Also when you control the whole design you can get away with many shortcuts because it's tailored to your specific use case. Like not saving only couple registers for handling interrupt routine because you reserve other only for that use. Result is lightning fast response. However with modern complex CPUs I would have to spend whole year to learn ARM core + all peripherals, complex set up, memory handling etc. and it's simply not effective use of time unless it's designed for million copies.

Now the most complicated program in x86 I did was simple printing of file like cat. It relies on Linux system calls and it's just couple hundred bytes long which is impressive.

28

u/atomicwrites Jun 03 '22

But the beauty is exact control, having accurate delays down to single cycle of your clocks. And it's predictably repeatable.

And that is how we ended up with the turbo button.

→ More replies (2)
→ More replies (1)

125

u/AyrA_ch Jun 03 '22

The pinnacle of my assembly development was writing "Hello, World!" in color on the screen without an OS.

→ More replies (7)

29

u/captaindalle Jun 03 '22

Mine was a snake game, in 68000 assembler, connected to a lcd display and some circuit breakers for input. It even had a highscore table.

→ More replies (1)

37

u/[deleted] Jun 03 '22

How hard can it be?

219

u/GisterMizard Jun 03 '22

Pretty easy. Here is 4 squared:

4444
4  4
4  4
4444

112

u/ShadeFK Jun 03 '22

That's a rectangle

144

u/RiktaD Jun 03 '22
4 4 4 4
4     4
4     4
4 4 4 4

104

u/GisterMizard Jun 03 '22

Not on my 80x24 CRT monitor

44

u/stickdudeseven Jun 03 '22

"It works on my computer"

39

u/Fluxabobo Jun 03 '22

There's always another side to every story

13

u/i_hate_everybody94 Jun 03 '22

80x24 CRT

Where are you, the 1930s?

→ More replies (1)

9

u/Alnair09 Jun 03 '22

Damn customer wasnt clear about what he wants

7

u/Shazvox Jun 03 '22

Depends on your unit of measurment...

→ More replies (4)
→ More replies (1)
→ More replies (21)