Live data from Hacker News

Some Assembly Required: An approachable introduction to assembly

github.com

31–40 of 131 posts

Re: Some Assembly Required: An approachable introduction to assembly

#31
post #14

Assembly language is actually simple stuff. You just need to read the datasheet. No difficult type systems to deal with. In the old days programming assembly language was nasty because one mistake could mean your computer had to be rebooted and you lost your work. Not anymore.

This is like saying chess is simple stuff because you can learn how the pieces move in five minutes. If all you want is a basic understanding of how things work, that level is ok. If you want to play/program, it is a completely different story. I'd even go so far to say: Why do assembly if your goal is not to be better than the compiler, at least in some respect? Beating the compiler, now tell me that it's simple stu…

But chess is approachable because you can learn how the pieces move in five minutes. Contrast that with some German board games where going over the instructions is the first hour and even then you aren't sure if you understand.

Why learn assembly?, well for one, the non-abstract aspect of assembly is less abstract, and arguably easier to understand than even the simplest high level languages. Secondly, learning assembly is also learning how computers work and that paradigm will help you even as you largely work in a high level language.

And beating the compiler isn't as hard as you might think if that becomes necessary some day.

Re: Some Assembly Required: An approachable introduction to assembly

#32
post #14

Assembly language is actually simple stuff. You just need to read the datasheet. No difficult type systems to deal with. In the old days programming assembly language was nasty because one mistake could mean your computer had to be rebooted and you lost your work. Not anymore.

I taught myself x86 assembly from a book as a pre-internet teenager. My first .COM printed exactly what it was supposed to on the screen. Then it printed a bunch of random junk and my computer rebooted. This happened every single time I ran the executable.

Eventually I actually read the first chapter properly and added MOV AH,4CH / MOV AL,0 / INT 21H. When my executable returned to the DOS prompt this time after running it, I felt like my mind had just expanded 10-fold as I realised what had been happening.

Re: Some Assembly Required: An approachable introduction to assembly

#34

Earlier quoted context omitted.

I'm glad you liked it! By a teenagers' guide I meant it was written by teens (including me: I'm 17). What do you think of the warehouse analogy?

Can't speak for the OP but I really liked it. It reminded me a bit of the computer game Human Resource Machine[0], which creates a mini assembly language that you use to handle a "production line" of incoming numbers. [0] https://store.steampowered.com/app/375820/Human_Resource_Mac...

This is a great way to accidentally learn assembly language! I was so amused that a designer friend of mine who swore they could never learn to program solved this game and in certain cases, more optimally than myself, and I have a fair amount of experience in assembly.

Re: Some Assembly Required: An approachable introduction to assembly

#35
post #14

Assembly language is actually simple stuff. You just need to read the datasheet. No difficult type systems to deal with. In the old days programming assembly language was nasty because one mistake could mean your computer had to be rebooted and you lost your work. Not anymore.

I taught myself x86 assembly from a book as a pre-internet teenager. My first .COM printed exactly what it was supposed to on the screen. Then it printed a bunch of random junk and my computer rebooted. This happened every single time I ran the executable. Eventually I actually read the first chapter properly and added MOV AH,4CH / MOV AL,0 / INT 21H. When my executable returned to the DOS prompt this time after runn…

Did you get that "This machine does whatever I can tell it to do!" feeling?

And then you wonder what can you think to tell it to do. The wonder of computers.

Re: Some Assembly Required: An approachable introduction to assembly

#37
post #26

My favorite part is the heavily commented code examples. Those are much more useful for increasing my understanding than most other resources. To me, that level of information density just works better for my brain than articles or sites that try to explain things. Something about being _in the code_ while stepping through lines one by one with explanations is just so much easier to follow. I wish more learning resou…

Ahhhh thank you for mentioning this! This was _really_ important to us, because it was hard for us to find real code examples that worked, and when we did, they were hard to parse.

It's also why we put it in GitHub, so it could live alongside the code examples :)

Re: Some Assembly Required: An approachable introduction to assembly

#38
Love this! Must admit, my favourite part of doing a CS degree was creating a CPU core from scratch (a cut down ARM, running on a FPGA), then writing asm to run on it. So satisfying knowing I made the actual CPU (at gate level) and ran my own code on it. I’d be happy to do a YouTube series covering how to do this if anyone is interested.

Re: Some Assembly Required: An approachable introduction to assembly

#40
post #11

I basically learned C++ and assembly programmer at the same time when I was 16 by just watching the output of gcc.godbolt.org (yes ok zoomer)

That's incredibly cool to hear! I'm really excited about the upcoming generation of programmers empowered by the tools they have with them.
Post reply on HN