179 points

To be fair, assembly lines of code are fairly short.

/ducks

permalink
report
reply
43 points

Back in the day we wrote everything in asm

permalink
report
parent
reply
10 points

Pssh, if you haven’t coded on punch cards, you aren’t a real coder

permalink
report
parent
reply
51 points

Writing in ASM is not too bad provided that there’s no operating system getting in the way. If you’re on some old 8-bit microcomputer where you’re free to read directly from the input buffers and write directly to the screen framebuffer, or if you’re doing embedded where it’s all memory-mapped IO anyway, then great. Very easy, makes a lot of sense. For games, that era basically ended with DOS, and VGA-compatible cards that you could just write bits to and have them appear on screen.

Now, you have to display things on the screen by telling the graphics driver to do it, and so a lot of your assembly is just going to be arranging all of your data according to your platform’s C calling convention and then making syscalls, plus other tedious-but-essential requirements like making sure the stack is aligned whenever you make a jump. You might as well write macros to do that since you’ll be doing it a lot, and if you’ve written macros to do it then you might as well be using C instead, since most of C’s keywords and syntax map very closely to the ASM that would be generated by macros.

A shame - you do learn a lot by having to tell the computer exactly what you want it to do - but I couldn’t recommend it for any non-trivial task any more. Maybe a wee bit of assembly here-and-there when you’ve some very specific data alignment or timing-sensitive requirement.

permalink
report
parent
reply
20 points

I like ASM because it can be delightfully simple, but it’s just not very productive especially in light of today’s tooling. In practice, I use it only when nothing else will do, such as for operating system task schedulers or hardware control. It’s nice to have the opportunity every once in a while to work on an embedded system with no OS but not something I get the chance to do very often.

On one large ASM project I worked (an RTOS) it’s exactly as you described. You end up developing your own version of everything a C compiler could have done for you for free.

permalink
report
parent
reply
38 points

I mean, I’m pretty sure it would be a good learning experience so I would really not regret it.

permalink
report
reply
30 points

I tried decades ago. Grew up learning BASIC and then C, how hard could it be? For a 12 year old with no formal teacher and only books to go off of, it turns out, very. I’ve learned a lot of coding languages on my own since, but I still can’t make heads or tales of assembly.

permalink
report
parent
reply
5 points

Sounds very similar to my own experience though there was a large amount of Pascal in between BASIC and C.

permalink
report
parent
reply
5 points

Yeah, I skipped Pascal, but it at least makes sense when you look at it. By the time my family finally jumped over to PC, C was more viable. Then in college, when I finally had to opportunity to formally learn, it was just C++ and HTML… We didn’t even get Java!

permalink
report
parent
reply
23 points

Assembly requires a knowledge of the cpu architecture pipeline and memory storage addressing. Those concepts are generally abstracted away in modern languages

permalink
report
parent
reply
12 points
*

You don’t need to know the details of the CPU architecture and pipeline, just the instruction set.

Memory addressing is barely abstracted in C, and indexing in some form of list is common in most programming languages, so I don’t think that’s too hard to learn.

You might need to learn the details of the OS. That would get more complicated.

permalink
report
parent
reply
9 points

Try 6502 assembly. https://skilldrick.github.io/easy6502/

My favorite assembly language by far.

permalink
report
parent
reply
2 points

this page is great. starting right at “draw some pixels” in such a simple way just instantly makes it feel a bit more approachable!

permalink
report
parent
reply
50 points

Step 1: Begin writing in Assembly

Step 2: Write C

Step 3: Use C to write C#

Step 4: Implement Unity

Step 5: Write your game

Step 6: ???

Step 7: Profit

permalink
report
reply
33 points

Eww Unity

permalink
report
parent
reply
30 points

Step 6 extort developers

permalink
report
parent
reply
7 points

Step 0: Invent the universe

permalink
report
parent
reply
7 points

What are we doing here? Baking a pie?

permalink
report
parent
reply
9 points

Good thing I wrote my own game engine using D, and soon there will be 2 (known) games for it.

permalink
report
parent
reply
4 points

D

Don’t give me hope.

I was really into D, but I gave up on it because it seemed kind of dead. It’s often not mentioned in long lists of languages (i.e. I think Stack Overflow’s report did not mention it), and I think I remember once looking at a list of projects that used D and most of them were dead. I think I also remember once seeing a list of companies that used D, and when I looked up one of them I found out it didn’t exist anymore 😐️

permalink
report
parent
reply
2 points

Give it another go, maybe join the community Discord server.

There’s some very well going hobby projects, and D3 seems to be inevitable (safe by default, PhobosV3, etc.).

permalink
report
parent
reply
5 points

I’m on E already

permalink
report
parent
reply
2 points

I just want to note that “Implement Unity” includes the substep of “use C# to generate C++”.

permalink
report
parent
reply
8 points

Reminder that ttd was open source even before open ttd :D

permalink
report
reply
155 points

I don’t know if everyone gets the reference: RollerCoaster Tycoon is in fact writing mostly in assembly to use the hardware more efficiently

permalink
report
reply
59 points
*
Deleted by creator
permalink
report
parent
reply
19 points

Started playing openrct2 multiplayer with a friend yesterday. Some of the best fun I’ve had.

permalink
report
parent
reply
13 points

Damn this post. This is really going to f up my weekend plans.

permalink
report
parent
reply
6 points

My friend and I created MONORAIL LAND

permalink
report
parent
reply
53 points
*

Writing it in assembly would make it pretty much the opposite of portable (not accounting for emulation), since you are directly giving instructions to a specific hardware and OS.

permalink
report
parent
reply
-8 points
Deleted by creator
permalink
report
parent
reply
8 points
*

OpenRCT2 ditched assembly tho. They wrote it entirely in C++.

permalink
report
parent
reply
1 point

Sorry, two separate thoughts. Wasn’t saying open RCT used assembly just wanting to shout out the project.

permalink
report
parent
reply

RetroGaming

!retrogaming@lemmy.world

Create post

Vintage gaming community.

Rules:

  1. Be kind.
  2. No spam or soliciting for money.
  3. No racism or other bigotry allowed.
  4. Obviously nothing illegal.

If you see these please report them.

Community stats

  • 3.4K

    Monthly active users

  • 1.1K

    Posts

  • 8.8K

    Comments