Assembly Nights
11–20 of 37 posts
Re: Assembly Nights
#12Earlier quoted context omitted.
Same boat. Exercising my brain before sleep basically means I'll sleep very late because I just have to figure it out or figure out that I can't figure it out in a few hours. The author seems to possess some super human power to cool down whenever he wants, or he is super good with assembly.
Ya same here, if I dive into some programming task it usually delays my sleep by 2 hours at least. I've had to avoid it for my health.
Re: Assembly Nights
#13I haven't figured out how to get gdb hooked so I'm just debugging with a print integer routine. That's annoying.
And writing to and reading from the bios video service (int 10h) in my text editor bootloader is not the most fun. Randomly characters get overridden and it could be my code or register state I haven't reset but it's pretty hard to get right and understand the bios APIs.
I'm getting ready to give up than write anything about my bootloaders since their behavior is not always deterministic in more complex programs (boot4.asm is the complex text editor and sometimes when hitting backspace on the last column in a line the cursor sometimes freaks out trying to find the end of the previous line.)
Re: Assembly Nights
#14Now we have too many distracting mediums that are only a click away.
Internet has made many things easier, but the real cost of it is yet to be determined.
Re: Assembly Nights
#15Re: Assembly Nights
#16So, firstly, I’m amazed anyone can do that in bed and then sleep properly. I’d be dreaming in assembly all night. When the author talked about reading the entire GNU Screen manual I did think “this sounds like stressful overkill” for a personal project, but I see their point about focusing on process rather than goal. Does it ever really matter than personal projects don’t get finished?
Re: Assembly Nights
#17I recently started manually writing assembly with focus AVX2 (a flavor of Intel SIMD extensions). The rationale is that these are complex enough that compilers do not always notice the opportunity to use them, so my ultimate goal is to apply this is to find a non-artificial problem where I could beat a compiler :-) I confirm that its one of the most satisfactory ways to add some numbers using a modern computer.
https://github.com/skx/math-compiler
I had far too much fun writing it, even though it is completely pointless!
Re: Assembly Nights
#18Then I decided to try Nim, I found it very ergonomic and lets you write compact code that expresses the main logic without too much syntax noise. But I got blocked by some issues making it work for a UEFI target.
Then I tried Zig and got as far as parsing ACPI tables and writing an AML bytecode parser. Zig is nice and I like its optionals support and error handling approach. But I was put off by its noisy syntax (e.g. !?*[*]u8 to represent an error union of an optional pointer to a many-pointer of uint8). Also having to prepare and weave allocoators throughout most of the code that needs to dynamically allocate (which is most of the code) gets in the way of the main logic. Even little things like string concatenation or formatting becomes a chore. In the end I realized that Zig is not for me.
So I got back to Nim and resolved the issues that were blocking me. I'm now on my journey to write a complete kernel in Nim (so far I have access to UEFI services and ACPI table parsing and on my way to get interrups working). The code is pleasant to write and read. Also the language and the stdlib documentation is great (Zig's stdlib documentation is almost non-existent.)
Overall, I found that systems programming is very satisfying, and you can depend on specs that rarely change (some are over 20 and 30 years old and still work the same way today) and is quite a welcome change from web dev where it depends on tech de jour.
Edit: Here are the github repo links:
- C kernel: https://github.com/khaledh/bitflow
- Zig "kernel": https://github.com/khaledh/axiom-zig
- Nim "kernel": https://github.com/khaledh/axiom
Re: Assembly Nights
#19I think that programming in assembly language is compelling because it is "rightsized" for the human brain. You spend a lot of time solving small, manageable puzzles about the best way to do achieve small victories like trying to squeeze every last cycle or byte out of some small section of code. And then you sit back and laugh because after all that struggle you managed to compute something that would take an insignificant amount of effort to do in a high level language. But it works on this very limited device, and that's a thrill.
[1] https://www.youtube.com/watch?v=yl8vPW5hydQ [2] http://skilldrick.github.io/easy6502/
Re: Assembly Nights
#20Earlier quoted context omitted.
Same boat. Exercising my brain before sleep basically means I'll sleep very late because I just have to figure it out or figure out that I can't figure it out in a few hours. The author seems to possess some super human power to cool down whenever he wants, or he is super good with assembly.
Ya same here, if I dive into some programming task it usually delays my sleep by 2 hours at least. I've had to avoid it for my health.
For example, translating one assembly to another with the same architecture might fit the description because most of the time you are just doing "translation". Of course I'm not an assembly professional so I might be underestimating the difficulty here.
Another good example is carpentry. As long as you finish step X you can leave it there. There is no need to burn candles to finish all steps at once.
A bad example is algorithm design. Unless it's second nature to you, it's really difficult to decompose it into steps (because maybe they are wrong steps), and even if you can, picking up from where you left off last night might actually be more difficult than starting over from the beginning.