by quackduck on 6/28/22, 3:42 PM with 125 comments
by jessicard on 6/28/22, 4:26 PM
Hack Club is a group of teenagers from all over the world, and we decided to learn assembly together from scratch and see what happened.
We ended up making this guide as we learned, since a lot of the resources we were working with weren't the easiest to parse.
Happy to answer any questions :)
by kup0 on 6/28/22, 5:33 PM
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 resources took this approach.
by mhh__ on 6/28/22, 4:51 PM
by djmips on 6/28/22, 5:49 PM
https://www.gamesindustry.biz/articles/2011-03-30-machine-co...
by egypturnash on 6/28/22, 5:56 PM
by amelius on 6/28/22, 4:59 PM
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.
by dingosity on 6/28/22, 4:04 PM
by howenterprisey on 6/28/22, 4:30 PM
by tejasag on 6/28/22, 4:22 PM
by aasasd on 6/29/22, 1:38 AM
Not sure how true it is, but I heard that keeping track of a lot of objects required plenty of optimization, and apparently such levels of detail may have not been in games before. RCT was the second Tycoon game by Chris Sawyer, after Transport Tycoon from 1994—which is also in assembly and which keeps track of buses and trucks each with its own parameters, trains with each car, signals on the roads; of every passenger and every batch of goods: where it's from, how long it's on the way, etc. (At least if OpenTTD recreates the mechanics faithfully.) You can also pop up several windows with views to different parts of the map or following various vehicles.
by banashark on 6/29/22, 6:21 PM
As a developer who didn't learn via a scholastic setting, taking the time to sit down and learn a bit of assembly was something I see as a critical point in my career.
Starting with a high level scripting language, my brain had a hard time dealing with so much abstraction and taking what felt like a crazy amount of axioms as given.
I took a few months to sit down and go through the excellent book Programming From the Ground Up. After doing some bit twiddling, writing a basic allocator, and a handful of the other exercises from the book, I felt way more prepared to handle abstractions higher up.
Anything that I couldn't infer based on the underlying knowledge was something I could google, then quickly form the missing links between starting from the bottom.
I feel like learning C could give the same benefits, though I do hear some struggle with pointers, and in assembly you get to look face first at what they actually are. Everyone has different levels of abstraction that they're comfortable with as well. Assembly was enough to fill the seeming void of knowledge that I felt was holding me back, but for others it may be higher depending on which aspects are puzzling (memory management, intermediate representations, etc).
I also appreciate how much information modern VM authors publish about the inner workings of their platforms. It helps a lot in the same manner to reason about the systems (v8, JVM, CLR, etc).
by greyhair on 6/28/22, 9:17 PM
If you are still interested in learning more, ARM and PowerPC are also both interesting assembly targets.
Prior to Bell Labs (college) my assembly experience was 8085 bare metal (no OS) or Z80 under CP/M and MP/M. I wrote a couple console management applications for MP/M that had to dig into BIOS/BDOS routines. It was fun, and that was the thing that made my EE self realize that I wanted to work on software in embedded systems.
by trollied on 6/28/22, 5:50 PM
by seanalltogether on 6/28/22, 6:46 PM
by mNovak on 6/28/22, 9:10 PM
by zzo38computer on 6/28/22, 10:44 PM
I have used some assembly language stuff, including 6502, Knuth's MIX and MMIX, and virtual codes such as Z-code and Glulx.
I have written small amounts of old x86 assembly code (for the older 16-bit PC), too. (I think that the new x86 is too messy and too complicated, compared with the old x86 which is not bad.)
I have been trying to learn TRON assembly code too, although I cannot find enough information. I found some documents, but they are in Japanese and some important diagrams seem to be missing. There is some English documentation too but it does not explain much.
by zoomablemind on 6/28/22, 8:25 PM
In using assembler I find the hardest part is to represent the task at hand into a form of a sequence of elementary operations over the dynamic set of data pieces and their locations.
Perhaps, when the problem scope is on a lower level with a limited sets of data and operations, this maps easier. But when the task is on a macro level, that extra step of mapping the context onto a lower level scope is just too much effort.
In a way, in a higher level scope the programmers create their specific 'assembler' with a different set of registers and opcodes and sequences of operation, and even busses.
by jcims on 6/28/22, 5:54 PM
But the scoring mechanism was heavily weighted towards lines of code and the turbo Pascal entry one even though it took about six minutes to complete.
That pissed me off so much I never really messed with assembly again.
by olah_1 on 6/28/22, 7:43 PM
Also there is a book called Programming from the Ground Up that starts with assembly and moves up to C and beyond.
by sunpazed on 6/29/22, 8:14 AM
https://github.com/hackclub/some-assembly-required/tree/main...
by marai2 on 6/28/22, 8:18 PM
by MR4D on 7/1/22, 4:23 AM
I’m definitely not an assembly guy, but it would be fun if there was a REPL to play with this. Not sure if that would accidentally invert the universe or it’s too low level for a REPL, but conceptually it would be fun to play with in a sandbox.
by tech_tuna on 6/28/22, 7:42 PM
by GaNuongLaChanh on 6/30/22, 1:35 AM
by Existenceblinks on 6/28/22, 6:53 PM
by darkgray on 6/28/22, 6:11 PM
by whoomp12342 on 6/28/22, 6:49 PM
by dj_mc_merlin on 6/28/22, 4:47 PM
There's quite a big difficulty spike so to speak in the later section as you go towards the code examples. The beginning explains relatively simple concepts like binary, then basically jmps into an instruction table which won't make sense to anyone who hasn't done some form of programming (they would know binary then, right?).
The tone is also a bit off putting, although I might be out of touch with today's teenagers. When I was learning asm as a teen I learned it from grungy 1337 h4x0r sites (well, they didn't actually use 1337speak except ironically, much like today) which were at least a great deal.. meaner? less nice?.. than the tone of the article.
From what I wrote I gather my main criticism is that it doesn't know its audience. However, it seemingly _was_ produced by an actual group of teenager as per the author's HN comment:
> Hack Club is a group of teenagers from all over the world, and we decided to learn assembly together from scratch and see what happened.
Although it probably means a trained adult was lightly helped by some teenagers in producing it.
I hope this didn't sound too harsh, the effort is very good and so are the illustrations. It needs some fleshing and perhaps a little less "yay!!". Learning assembly is not actually that fun, it's rather painful. It's what you do with it that is fun.
by davb on 6/28/22, 7:38 PM
by 50yearsold on 6/28/22, 5:51 PM
by tomcam on 6/29/22, 4:26 AM
by martin1975 on 6/28/22, 8:56 PM
Hubris?
by faisalsayed10 on 6/28/22, 5:26 PM
by bilekas on 6/29/22, 3:58 AM
by HPGBeans on 6/28/22, 8:08 PM