I actually got paid a salary for learning & programming in IBM mainframe assembler (BAL or Basic Assembly Language) in 1970, for an insurance company. The CPU memory was so small (32K, yes 32,768 bytes) that the only way we could squeeze enough functionality was to write in assembler, with overlays (no virtual memory). Debugging consisted of manually toggling hex data and instructions at the control panel. What a blast!
It was a lot of fun, but terribly inefficient programmer productivity. I would not want to go back :o) Dereferencing registers prepared me for C pointers later.
Ooo! I have a question! Where do I learn more about overlays? The BSD 2.11 code I've read has comments about overlays, but I have no idea where to learn more about how to understand the topic. I came across it while I was seeing if I could get newlib to compile for the PDP-11.
Wow, 32K! I'm working on an Arduino Uno project where I need to squeeze some complicated logic into 2K RAM and 32K FLASH :). I haven't resorted to assembly, yet.
Forgive me, but I'm struggling to understand how much useful work one could extract from a computer with only 32k of RAM. A microcontroller for an appliance, sure, but a mainframe? Could you tell us more about the work you were doing?
Maybe too much content? 1000+ pages, many architectures... Probably too much content for a beginner book?
Btw, a great book imho is "Assembly Language Step By Step - Programming with Linux - 3rd ed" (https://musho.tk/l/d2d56a34).
The great things is that it is an easy read and really starts from the basic and explains how the i386 architecture works, and then explains how to program it using assembly.
The sad thing is that afaik the author is quite old and probably is not going to release a 4th edition, meaning that the book will stay on intel i386.
I have the first or second edition of "Assembly Language Step By Step", and it's the best intro I know of.
It must be difficult to write a good assembly book. On one hand there's a lot of basics to cover, like memory addressing, segmentation registers, etc. But on the other hand, the main use case for it today is hand optimized functions for when the compiler can't optimize enough, which is inherently an advanced topic.
I read the 2nd edition of Jeff Duntemann's book (DOS & Linux) in little more than a couple of sittings. Incredibly readable! Best introduction on the background of how CPUs work and what machine language is about.
The fact that the document targets multiple architectures is great, most ASM tutorials online target solely x86 and as such give a very partial view of how assembly is written and how CPUs work, and on top of that x86 ASM is really quite a mess.
I've skimmed the document and it seems rather thorough and doesn't shy away from all the nasty details (which is a good thing for an ASM tutorial), the only criticism I have so far is that the assembly listings are a bit hard to read, additional whitespace and basic syntax highlighting (at least to isolate the comments) would make it a bit easier on the eyes I think, for instance: https://svkt.org/~simias/up/20180717-151848_asm-listing.png
Yep, I was very happy to see the ARM and MIPS output. Syntax highlighting is a great idea. It didn't even bother me but this is coming from a guy that had a hard copy print out of the 386 programmers reference.
Yeah, I'm a little confused about this "build" of the pdf. It clearly states: "The latest version (and Russian edition) of this text is accessible at beginners.re." - which points to: https://github.com/DennisYurichev/RE-for-beginners
But as far as I can tell there's no branch with a different name - maybe this was just a working title for the English version at some point?
Anyway, this new submission with a new title made take a look, so I'm happy :)
Now, I just hope someone takes a crack at forcing an epub build for better reflow/resize on small screens...
At one point when I was considerably younger I started learning 32-bit x86 assembly as my very naive career goal was to become the next Linux Torvalds. I managed to construct a multiboot-compliant 32-bit kernel that could load tasks from a ext2 ramdisk image passed to the bootloader and multitask up to around 64 processes. I figured out how to use the CR3 register and craft page tables, enter into kernel syscalls using software interrupts, handle CPU faults, page faults, double faults etc. It was quite the learning experience until it eventually crumbled under my lack of skill and foresight. In short, I got more or less about as far as most amateur, self-taught, lone OS developers get before losing interest and giving up.
Fast forward a couple of decades, and I found myself reverse engineering CP/M for the Z80 processor in order to create a virtual Z80-based system that ran inside Unreal Engine. I started with Udo Munk's wonderful Z80pack system, adapted a public domain Z80 CPU emulator which was written in C to C++, and did minimal reimplementation of the Z80pack terminal and disk I/O devices. Since the systems were implemented as "actors" in UE4 it's possible to spawn and run quite a few concurrently as long as you limit the CPU speed of each instance somewhat.
Learning assembly can be a lot of fun - it can really teach you quite a bit about systems architecture that you otherwise might not get if you're always programming in high-level languages only.
My god, 1000+ pages. What a great submission though. I wonder what kind of things keep such people motivated to write one fuckin' thousand and eighty two pages about assembly!? This is nuts.
"I have made this letter longer than usual, only because I have not had the time to make it shorter."
- Blaise Pascal
As a writer, I can corroborate that. In fact, if he "had the time to make it shorter", it implies that he spent even more time to write those 1000+ pages than it would seem on first glance. Plus even more than for the same 1000+ pages if in a higher level language, since assembly is a lot more error-prone.
I don’t think it’s nuts to share such depth of knowledge. I greatly welcome the knowledge, too. I legitimately am wondering what sort of project I could take up that would be “small enough”, only do-able in asm/c, and interesting.
Amazing. One of my fondest memories is when, at age 10-11, I "played" Core War [0] with an older friend of mine (he was 20-21 back then, and a CS student at one of the best CS universities in Italy, Pisa). I loved to learn how to program in a game-like environment. I still remember several things, ~30 years later.
Since both sites appear to be owned by the book's author this is most likely just a change that has not yet been pushed to github (or mentioned in the author's sites), but it would be better if the author clarified it (would that be you, dennis714?)
I got interested in assembly fairly early on my programming career by playing wargames(io.smashthestack.org anyone?). Writing exploit payloads was very fun. After that in my career i have only written assembly to vectorize some code using neon.
I think the best reason to learn assembly is not to write rather be able to read compiler output.
This is a great resource. I don't think it is for beginners, it is a bit overwhelming. But as a programmer who has to dive into asm every few months (on a variety of architectures!), this will be a very helpful reference to help me reset my frame of mind for the particular architecture.
This sentiment is one of the reasons why I didn't bother in the past: it's apparently so complex that I have to learn something completely different and useless these days, before I can start learning something useful. I'd much rather just deep dive into x86_64 or ARM or something.
These days I know that older versions are still (partly?) included in x86_64 and that they're often mostly the same, but that was not clear to me when I saw tutorials for ancient architectures of which I didn't see the point.
But then, I've never taken well to the school system where you get taught something stupid first only to see practical applications later. It's why I dropped out of high school and went to do something of which I did see the use (a sysadmin 'study', because I knew I enjoyed working with computers, and that was indeed a good fit for me).
13 year old kids figure it out. I was one of them, and I'm an idiot more days than I care to admit. Granted, it was 6502 assembly, but later I'd be able to sift my through x86, before it went completely nuts.
I've never had a desire to learn about Assembly, but I thought the first few pages of this book were kinda interesting, and I might end up learning more than I had ever cared to.
[+] [-] GnarfGnarf|7 years ago|reply
It was a lot of fun, but terribly inefficient programmer productivity. I would not want to go back :o) Dereferencing registers prepared me for C pointers later.
[+] [-] cptnapalm|7 years ago|reply
[+] [-] xigency|7 years ago|reply
[+] [-] Narishma|7 years ago|reply
[+] [-] cylinder714|7 years ago|reply
[+] [-] molteanu|7 years ago|reply
[+] [-] amorousf00p|7 years ago|reply
[deleted]
[+] [-] znpy|7 years ago|reply
Btw, a great book imho is "Assembly Language Step By Step - Programming with Linux - 3rd ed" (https://musho.tk/l/d2d56a34).
The great things is that it is an easy read and really starts from the basic and explains how the i386 architecture works, and then explains how to program it using assembly.
The sad thing is that afaik the author is quite old and probably is not going to release a 4th edition, meaning that the book will stay on intel i386.
[+] [-] jlarocco|7 years ago|reply
It must be difficult to write a good assembly book. On one hand there's a lot of basics to cover, like memory addressing, segmentation registers, etc. But on the other hand, the main use case for it today is hand optimized functions for when the compiler can't optimize enough, which is inherently an advanced topic.
[+] [-] fouc|7 years ago|reply
[+] [-] vasili111|7 years ago|reply
[+] [-] unknown|7 years ago|reply
[deleted]
[+] [-] simias|7 years ago|reply
I've skimmed the document and it seems rather thorough and doesn't shy away from all the nasty details (which is a good thing for an ASM tutorial), the only criticism I have so far is that the assembly listings are a bit hard to read, additional whitespace and basic syntax highlighting (at least to isolate the comments) would make it a bit easier on the eyes I think, for instance: https://svkt.org/~simias/up/20180717-151848_asm-listing.png
[+] [-] snarfy|7 years ago|reply
[+] [-] mbowcutt|7 years ago|reply
[+] [-] tawayway|7 years ago|reply
https://news.ycombinator.com/from?site=beginners.re
[+] [-] e12e|7 years ago|reply
But as far as I can tell there's no branch with a different name - maybe this was just a working title for the English version at some point?
Anyway, this new submission with a new title made take a look, so I'm happy :)
Now, I just hope someone takes a crack at forcing an epub build for better reflow/resize on small screens...
There's a (dormant?) issue: https://github.com/DennisYurichev/RE-for-beginners/issues/37...
[+] [-] dennis714|7 years ago|reply
[+] [-] vmateixeira|7 years ago|reply
[+] [-] nineteen999|7 years ago|reply
Fast forward a couple of decades, and I found myself reverse engineering CP/M for the Z80 processor in order to create a virtual Z80-based system that ran inside Unreal Engine. I started with Udo Munk's wonderful Z80pack system, adapted a public domain Z80 CPU emulator which was written in C to C++, and did minimal reimplementation of the Z80pack terminal and disk I/O devices. Since the systems were implemented as "actors" in UE4 it's possible to spawn and run quite a few concurrently as long as you limit the CPU speed of each instance somewhat.
The resulting virtual system in UE4 is able to run original CP/M ports of Rogue and Zork (https://i.imgur.com/gnOCp3e.png), various Z80 instruction exercisers (https://i.imgur.com/kwNuq5X.png), a Z80 C compiler and and even Wordstar 4 (https://i.imgur.com/Q6307w3.jpg) and Microsoft BASIC.
Learning assembly can be a lot of fun - it can really teach you quite a bit about systems architecture that you otherwise might not get if you're always programming in high-level languages only.
[+] [-] mcdevilkiller|7 years ago|reply
[+] [-] andreygrehov|7 years ago|reply
[+] [-] vram22|7 years ago|reply
1. Assembly language needs more lines of code to achieve the same task than higher level languages, by its very nature.
2. What I call Pascal's Amendment :) - very loosely like claiming the Fifth Amendment (to the US Constitution):
https://en.wikipedia.org/wiki/Fifth_Amendment_to_the_United_...
https://www.brainyquote.com/quotes/blaise_pascal_386732
"I have made this letter longer than usual, only because I have not had the time to make it shorter."
- Blaise Pascal
As a writer, I can corroborate that. In fact, if he "had the time to make it shorter", it implies that he spent even more time to write those 1000+ pages than it would seem on first glance. Plus even more than for the same 1000+ pages if in a higher level language, since assembly is a lot more error-prone.
[+] [-] ianai|7 years ago|reply
[+] [-] jimbokun|7 years ago|reply
[+] [-] merolish|7 years ago|reply
https://chortle.ccsu.edu/AssemblyTutorial/index.html
[+] [-] nickpsecurity|7 years ago|reply
https://opencores.org/project/plasma
Then, they'll understand at least one architecture inside and out. Plus be able to customize it to their liking. :)
[+] [-] simonebrunozzi|7 years ago|reply
[0]: https://en.wikipedia.org/wiki/Core_War
[+] [-] g-b-r|7 years ago|reply
Since both sites appear to be owned by the book's author this is most likely just a change that has not yet been pushed to github (or mentioned in the author's sites), but it would be better if the author clarified it (would that be you, dennis714?)
[+] [-] dennis714|7 years ago|reply
[+] [-] moistoreos|7 years ago|reply
[+] [-] danellis|7 years ago|reply
[+] [-] xfer|7 years ago|reply
I think the best reason to learn assembly is not to write rather be able to read compiler output.
[+] [-] pq0ak2nnd|7 years ago|reply
[+] [-] neuromantik8086|7 years ago|reply
[+] [-] lucb1e|7 years ago|reply
These days I know that older versions are still (partly?) included in x86_64 and that they're often mostly the same, but that was not clear to me when I saw tutorials for ancient architectures of which I didn't see the point.
But then, I've never taken well to the school system where you get taught something stupid first only to see practical applications later. It's why I dropped out of high school and went to do something of which I did see the use (a sysadmin 'study', because I knew I enjoyed working with computers, and that was indeed a good fit for me).
[+] [-] pro_zac|7 years ago|reply
[+] [-] eleitl|7 years ago|reply
[+] [-] cjhanks|7 years ago|reply
https://docs.nvidia.com/cuda/parallel-thread-execution/index...
[+] [-] bigmit37|7 years ago|reply
[+] [-] mikestew|7 years ago|reply
[+] [-] mikehodgson|7 years ago|reply
[+] [-] kolbe|7 years ago|reply
[+] [-] lprd|7 years ago|reply
[+] [-] peter_retief|7 years ago|reply
[+] [-] richfnelson|7 years ago|reply