Assembly programming can be intimidating for people who have never looked into it any deeper than a glance, but giving that it underpins how the computers we use work it can be helpful having context in regards to what is actually being run by the CPU.
You can run the code samples live on the webpage itself thanks to Emscription and v86. Neat.
I just did a series of four (so far) videos about using regular, e.g. Linux system GCC to write Real-Mode DOS .COM executables, including various tips and tricks and education bits: https://www.youtube.com/results?search_query=renerebe+dos+gcc you can also find the source at: https://patreon.com/renerebe
Edited 2018-06-19 10:38 UTC
I really miss assembly language programming on the 68000 family – such a civilised instruction set…
I really only did a assembly very briefly, early in my career. I started with x86, then switched to 6800. My god it was a wonderful transition.
Bill Shooter of Bul,
Yea, that’s the RISC versus CISC instruction set debate. I understand why the x86 ISA can be annoying, especially if you learned it in 16bit real mode where segments and addressing were rather archaic.
I’ve done very little ASM outside of x86, a little bit with AVR & PIC microcontrollers. On x86 I have a strong preference for intel assembly syntax (I specifically like the NASM dialect) over GAS/ATT syntax, which is just too cumbersome. I think most people feel the same, but AT&T syntax is more popular due to the proliferation of GNU tools that originally only supported AT&T syntax.
Yes, yes I did learn it in 16bit real mode. It was… fun to a certain degree.
When I wanted to learn assembly, I found most of these tutorials or instructions quite useless. I wanted to learn how to program in assembly, not how to boot up a x86 computer and do BIOS calls. I quickly found that doing things using the BIOS was very different from doing things inside an operating system.
To me, the most useful piece of information I came across was Programming from the Ground Up (https://savannah.nongnu.org/projects/pgubook/). It actually teaches you how to do function calls and the assembly equivalent of structures/records.
Then last year I decided it was time to practice some of what I had learned and relearned over the years and I starting working on: https://github.com/nux-project/nuxutils. Due to personal reasons, I had to stop working on it, but I hope to pick it back up before the end of the year.
teco.sb,
Arguably, BIOS & bootstrapping are the main places assembly get used and few people have reason to use it elsewhere. I used to do a lot of assembly.
These days writing low level asm code is often frowned upon, yet there are times when C is deficient. For example the x86 flags are missing in C, which are extremely useful for efficient arbitrary length arithmetic libraries. Many opcodes supported by the processor aren’t directly exposed to C code (for example bit rotation), which can make it difficult to write optimal code in some algorithms. Sometimes opcodes are exposed as compiler intrinsics, or compiler optimizations, but ironically when you know exactly what you need in assembly it can actually be cleaner to write the code in native assembly than in C. Assembly code is often smaller than compiled code, although critics would say this hasn’t mattered in a long time.