Live data from Hacker News

Assembly Nights

ratfactor.com

31–37 of 37 posts

Re: Assembly Nights

#31

Lately, I've been reliving my youth of writing 6502 assembly language, inspired in part by one of Ben Eater's videos[1], and with the aid of Easy 6502[2]. I 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 ou…

If you want a more modern microcontroller that can actually be used to make things, take a look at the 8 bit STM8 series. They are widely used (you may have a few already, toasters, rice cooker, car etc). They definitely have that 6502 flavor, although even closer to being MC6800 improved, (eg 16 bit index registers), plus a good set of timers, ADCs, UARTs, SPI, I2C etc.

Official "Discovery boards" from ST include a programmer and debug connection for under $10, and cheap dev boards are plentiful. Open source C compiler SDCC, and free tools from ST.

There is also a very good Forth [0]. Even if Forth is not your thing the site has a lot of good information on STM8.

[0] https://github.com/TG9541/stm8ef

Re: Assembly Nights

#32
post #15

If hand-written assembly becomes a fashion trend of 2022 (must say I'm tempted) - are there any good targets for optimization in popular free software packages that anybody here can think of? Filters in GIMP, effects in Audacity, etc?

Interesting question, but I think you'll be hard pressed to find many large, popular projects still using large amounts of load-bearing assembly in the-year-of-our-lord-2022 since compilers have gotten very good and we still really care about portability since aarch32, aarch64, x86-64, and (less to) x86 are all reasonable targets that tons of people use.

I'm not sure how into systems programming you are, but there is globs of interesting assembly worth optimizing in various kernels. Interrupt routines, optimized memcpy, filesystem encryption, etc. are all great places where a small speed boost will have very large impacts on the overall platform performance.

Re: Assembly Nights

#33

Kinda agree with the "intel vs atnt" argument. From my very limited exp in asm reading Intel is always easier.

I honestly even buy the "convention" argument. Damn near every other assembly language uses pattern and so trying to read at&t always feels like pig latin

Re: Assembly Nights

#34

Earlier quoted context omitted.

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.

I wonder how to learn to cool down whenever you want. Going to be a HUGE advantage.

Might try Wim Hof breathing techniques: hyperventilate + breath hold, and repeat. Can’t stay up thinking if you starve your brain of oxygen

taps temple

Re: Assembly Nights

#35
post #3

So, 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?

What's wrong about dreaming about assembly? Your brain needs to process all that learning

Because my mind will be racing before I go to sleep, making it harder to get to sleep, and then my dreams are really dull but repetitive and I wake up mentally frazzled and worn out. Almost as if I’ve mentally computed a long loop for hours.

The other evening I did a small amount of work on a compiler I’m making and for ages all I could think was “compilers! So cool! Making those basic blocks! Yeah!”.

It would be cool if I had a dream where I intuitively understood whatever I was designing, but my dreams aren’t that insightful…

Re: Assembly Nights

#36

Earlier quoted context omitted.

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.

I'm thinking, maybe the trick is to pick an exercise that can be easily decomposed into steps, each of them requires very little time and energy. 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 exampl…

I’ve tried this and it sort of works, but what happens is that I get excited by the sense of achievement and want to do more, and/or get wrapped up in thinking through the next steps.

Re: Assembly Nights

#37
post #24

Earlier quoted context omitted.

Would you maybe be able to share some of the learning resources you’ve been using? I’ve really been wanting to get into this! :)

I found surprisingly little material about "how to program AVX/AVX2". That said here's what I used so far: * Intel AVX Programming Reference [0] - comprehensive but not very useful as "where do I even start" * Godbolt[1] to look at code samples produced by compilers. This is good to see how the instructions work together. * A random discussion that has *some* concepts behind the YMM registers[2] * Stack Overflow, for…

Thank you! Sorry for the late response, I always seem to miss responses to my posts.

I had been struggling with the same thing, but these are some great sources. Thanks :)

Post reply on HN