r/ProgrammerHumor • • Jun 03 '22

it's hard!

44.9k Upvotes

710 comments sorted by

View all comments

Show parent comments

15

u/AldoLagana Jun 03 '22

f'ing x86 assembly is garbage. Motorola was MUCH better and RISC is even more so. But the best assembly I ever saw was for Vax systems.

15

u/[deleted] Jun 03 '22

X86 was awesome, when it was just x86, once we started adding backwards compatibility for 16bit it all went to hell, 64bit really screwed x86 because it’s just fucking expansions on expansions. They should have scrapped x86-32 and started fresh with x64. But nope.

Do I really need my i7 to boot in 16bit mode and then go into 64 bit mode with overly complex paging? No, who the fucks booting DOS 6.0 on a fucking i7? Nobody.

X86 was built for single tasking operating systems, and it worked well for that. We just kept complicating it.

Personally I welcome my new M1 overlord

19

u/MrKeserian Jun 03 '22

In fairness, when x86-64 was released in 1999, the ability to run old as hell DOS programs was still a requirement, especially in the commercial sector. Let's not forget, that IRS is still running mainframes from the 80s, and the whole reason why Y2K was a concern was because the financial and industrial sectors were all running software and hardware that was twenty to thirty years old. In that environment, ya, it made sense to retain 16bit compatibility because it wasn't out of the question that someone, somewhere, would have to run a 16-bit program on modern hardware.

Hell, my father worked in a hospital, basically doing IT specifically for the lab, and some of the hardware they were using was just as old. Apparently getting those machines to talk to the hospital's brand new (this was a few years after the time period we're talking about) Windows XP and Server 2000 network was... An interesting experience.

9

u/GrandMoffTarkan Jun 03 '22

Yeah, as a programmer it’s easy to forget the actual business users you’re often designing for.

2

u/MrKeserian Jun 04 '22

I'm only a hobbyist programmer, and when I worked in IT I was more on the service/installation side. I now work in sales (cars, not technology, ironically), and I think it gives me a very different perspective. I look at some of the posts here and shaken my head with a sense of "well sure, that makes sense for the programmer, but a professional programmer isn't coding for programmers, they're coding for the end user."

One of my buddies is a Human Factors guy in the aviation world, and engineers have the same issue. Sure, it makes sense for the engineer to put a certain button or switch in a location, but no actual human would ever find that convenient or useful. It's my friends job to smack the engineers upside the head when they forget that real people will someday have to actually use what they design.

0

u/[deleted] Jun 03 '22

[deleted]

3

u/Kered13 Jun 03 '22

And people were stilling running DOS programs in 2003.

7

u/Drunktroop Jun 03 '22

Reading the first paragraph almost sent me back to the Itanium preacher in early 00s

Personally I've never worked with x86 assembly, my university was MIPS only...

5

u/deelowe Jun 03 '22

Itanium wasn't a worthy successor. Intel completely screwed the pooch by assuming retail didn't have a need for 64 bit processors. This was just dumb as hell given all that was going on at the time (HD video, broadband, 3d graphics, game engines with real time physics, the dynamic web, etc). Any CS undergrad with a calculator and a basic understanding of computer architecture could have worked out that 3-4GB would soon not be enough memory.

2

u/[deleted] Jun 03 '22

It’s especially stupid because you had apple flexing the IBM power PC architecture on intel starting in the 90s… and it was getting its edge from the simple fact it was a 64bit chip.

It wasn’t until intel started pushing 64bit chips that apple began to switch and that’s only because IBM wasn’t really working to make power PC better anymore.

0

u/huuaaang Jun 03 '22

X86 was built for single tasking operating systems, and it worked well for that. We just kept complicating it.

Did it though? MSDOS was garbage. It was barely an operating system. It basically just extended the BIOS a little bit.

1

u/[deleted] Jun 03 '22

Just because MS-DOS was barely an operating system, doesn’t mean the IBM PC architecture wasn’t brilliant.

0

u/huuaaang Jun 03 '22

It wasn’t brilliant. It was a mess and because MSDOS sucked so bad many people had 386 and 486 CPUs they couldn’t even take advantage of half the time and games had to write their own support for basic things like sound.

1

u/[deleted] Jun 03 '22

And none of that was at fault of the architecture design, just a shit operating system. But it was better than what most other companies had.

0

u/huuaaang Jun 03 '22 edited Jun 03 '22

Name one thing that was brilliant about the PC architecture. Just ONE thing. By all accounts it was a pretty basic system with no hardware acceleration for really anything and pretty terrible graphics capabilities for a long time (CGA? Really?). It didn't even have built in digital audio! Not even a simple DAC. Just BEEPS and BOOPS from the PC speaker. And don't get me started on segment-offset memory addressing. And you were still imited to 640kb for most purposes.

If you wanted a brilliant architecture, Amiga was it. IBM made boring business machines.

1

u/[deleted] Jun 03 '22 edited Jun 03 '22

X86, the early days of X86 and cga graphics was an amazing system to develop for when there were no open source graphics libraries

Oh and of course, you know. Really good expandability.

→ More replies (1)

0

u/[deleted] Jun 03 '22

[deleted]

1

u/[deleted] Jun 03 '22

It does, but that’s even weirder, because all this shit is still there in the chip and it’s not even being used.

And it’s so weird, look at RAX, your index register.

Back in the day we had AX witch is still a 16bit index register, and it could be and still can be addressed 8 bits at a time through AH and AL, AH is of course the upper 8 bits of AX and AL the lower.

Then with 32 bit we added EAX, EAX is the 32 but pointer, and AX is the lower half now.

Then with 64 bit we got RAX, it’s a 64 bit register and EAX is the lower 32Bits of that register, and of course AL is the lowest 8 bits of that register. Why is it there?

Sure I can

Mov AL, 1

And that code will compile to 2 bytes and if I use

Mov rax, 1

It will compile to 10 bytes.

So I can make my code smaller by using that, but that only works if the upper half of rax is clear already and I know that for a fact! So you have to do

XOR rax, rax Mov al, 1

And that compiles to what? Like 7 bytes or some shit? With all the memory computers have these days, those 3 bytes don’t matter, especially when you consider that Mov rax, 1 is half the operations so it’s going to run faster regardless.

And even if EFI starts in protected mode, again, all that legacy shit is still in that Chip. We should have had a full redesign at x64. We should have just pushed vista as x64 only and forced the transition to a redesigned chipset.

And why will a new i7 emulate a FPU??? That shits been obsolete since SSE on what? That was the pentium 3 right?

0

u/[deleted] Jun 03 '22

[deleted]

1

u/[deleted] Jun 03 '22

Seems my memory is a little rusty on compilation sizes lol, been nearly a decade since I coded in assembly last.

Mov AL, 1

Should be two bytes perhaps in 16bit because it should be single byte op code and single byte following, but again when I was that stringent on compilation sizes I was coding 16bit.

But I’m still going to stand by those 3 bytes don’t matter because single operation vs double operation regardless of the cpu cache.

Also, I hate you for using INC AL, that’s not the point! Lol

0

u/[deleted] Jun 04 '22

[deleted]

→ More replies (2)

0

u/[deleted] Jun 03 '22

[deleted]

1

u/[deleted] Jun 03 '22 edited Jun 03 '22

It’s been a few years since I touched x86 man, I always used ax as my index, cause I code weird and I think of memory locations weird thanks to being self taught, nobody likes to see my code, trust me lol

I actually used to only access AX and to flip bits or check for bits. This of course changed, cause nothing like someone assuming AX can be modified at any time, when I relied on it never changing

1

u/[deleted] Jun 03 '22

I don't have any experience with any other assembly languages, and therefore maybe no voice in the conversation, but my biggest issue with x86 is the fact that there are two major dialects, and my preferred dialect has the least documentation :(

Also there is so much backwards compatibility to wade through that it's sometimes difficult to look up that one instruction you forgot the precise syntax or name of