Live data from Hacker News

Assembly Language Programming: Still Relevant Today (2015)

wilsonminesco.com

71–80 of 100 posts

Re: Assembly Language Programming: Still Relevant Today (2015)

#71

To me, assembly is one of the things while self studying CS that I felt lacked good support in resources such as this, MOOCs, or just plain explaining it. Usually when I post a topic trying to Demystify the topic I am greeted with an extremely hard to digest read about said topic that is more meant for people Already knowledgeable in the subject. And I feel assembly should be more a core building skill in a programme…

I got a fairly good introduction to assembly with LC-3 (Little Computer 3, an instruction set for learning) programming in an elementary electrical engineering class in college. I haven't looked myself, but for those self studying, searching "LC-3" might be a good option for self-learning assembly.

Re: Assembly Language Programming: Still Relevant Today (2015)

#72
post #49

Earlier quoted context omitted.

Might see that flip in the coming years, if you consider web assembly (wasm) to be assembly. I do.

WebAssembly is a bytecode format.

Bytecode is just the instructions, which is actually a level lower than asm, but for a virtual machine instead of a physical one. It's a direct enough abstraction that you can predict the bytecode you'd build from the asm you write.

Re: Assembly Language Programming: Still Relevant Today (2015)

#73

To me, assembly is one of the things while self studying CS that I felt lacked good support in resources such as this, MOOCs, or just plain explaining it. Usually when I post a topic trying to Demystify the topic I am greeted with an extremely hard to digest read about said topic that is more meant for people Already knowledgeable in the subject. And I feel assembly should be more a core building skill in a programme…

Modern assembly is kind of...bad.

I would recommend checking out an old book for an old mainframe's assembly language. They're usually much less mystic by virtue of being much less complex. IBM had some really nice manuals and books; no one ever got fired for buying IBM because an IBM machine could be programmed by a dog.

Octal is where it's really at, though, if you get really into this. A fun weekend project is to write an octal "decompiler" (ideally you won't have compiled anything, just having written some octal by hand) that allows you to reason with what it's doing by translating it to an actual language rather than just thin syntactic sugar over 1s and 0s. Octal itself isn't so difficult, it makes binary much easier to reason with, but this definitely helps you get a more intuitive sense of what is what.

Of course, it's not something that has a substantial amount of value with modern machines. Maybe eventually we'll get back there; I think I'll enjoy it when we do. Until then, though, it's fun to play with.

Re: Assembly Language Programming: Still Relevant Today (2015)

#74
post #49

Earlier quoted context omitted.

Might see that flip in the coming years, if you consider web assembly (wasm) to be assembly. I do.

WebAssembly is not assembly in the ways that the article talks about. Like, writing it directly doesn’t give you any special control or guarantees over timing.

It's assembly against a virtual machine, not a physical one. You're right it's not appropriate for an embedded system or some other RTS, but assembly doesn't stop being assembly when you target a virtual machine.

Re: Assembly Language Programming: Still Relevant Today (2015)

#75
post #57
post #49

Earlier quoted context omitted.

Might see that flip in the coming years, if you consider web assembly (wasm) to be assembly. I do.

Wasm is different than assembly, so I don't think so.

It targets a virtual machine, not a physical one, but other than that it's "assembly-like" enough that learning some core ASM coding practices will help you.

Re: Assembly Language Programming: Still Relevant Today (2015)

#76

Even back in the 1980s, author Lance Leventhal who wrote some great programming books on assembly always warned that productivity wise you write the same number of lines of code whether its 6502 or C. As that 6502 example in the article shows, you don't great great productivity with assembly. And even macros don't improve on it that much.

One writes 6502 assembly by hand because there is really no alternative on that ISA. It does not make a good target for a C compiler, there are very few of them to begin with, and hand written 6502 (or 65816) is going to be better than anything produced by any compiler for it at this point in time.

Re: Assembly Language Programming: Still Relevant Today (2015)

#77
> It is common for the beginner to want all the fancy tools too soon

Am I the only one who’s never felt that way? I get grief from people around me (especially “hurry up and get it done” management types) for spending too much time in the low levels, trying to really understand what I’m doing and what’s going on.

Re: Assembly Language Programming: Still Relevant Today (2015)

#79

To me, assembly is one of the things while self studying CS that I felt lacked good support in resources such as this, MOOCs, or just plain explaining it. Usually when I post a topic trying to Demystify the topic I am greeted with an extremely hard to digest read about said topic that is more meant for people Already knowledgeable in the subject. And I feel assembly should be more a core building skill in a programme…

If you really want to dig into the concepts behind assembler, the assembler language part of TAOCP is available for free download: http://mmix.cs.hm.edu/doc/fasc1.pdf. It doesn’t talk about a “real” assembler language like 6502 or 8086, but a made-up one that was designed to present the concepts. It’s easy to move from Knuth’s academic introduction to an actual assembler.

Re: Assembly Language Programming: Still Relevant Today (2015)

#80

There is many kind of assembly language, some for the actual computer hardware, some for VMs, and some used as both. I have used and sometimes still do use assembly language, including 6502 (specifically, NMOS 6502 without decimal arithmetic, including unofficial opcodes), and a little bit of x86 stuff (although the modern x86 is very messy, I think), but also Z-machine and Glulx. I have also used MIX and MMIX assemb…

He does touch on local labels briefly - he suggests (and I agree) that you can get the same effect, more maintainably, with macros.
Post reply on HN