Hacker News new | past | comments | ask | show | jobs | submit login

Would love to hear more about this - have you written on your experiences?

No, and sadly I've lost the code I wrote, I don't know what happened to it.

Anyhow, programming an 8 bit 6800 for an embedded controller means keeping track of 6 or more things going on at the same time, while modern software focuses on one thing at a time and isolating it from everything else.

Those things include the contents of each register, the stack level, the size of the code, interrupts going off, polling that has to be done, counting cycles, etc. Organizing code into functions is a luxury not usually affordable.

It sounds tedious, but it was fun. I attached my own hard disk drive to my LSI-11, meaning I had to build an interface board and write a device driver. To figure out how to write the device driver, I dumped the floppy driver code. It was a marvel of tight engineering. The bootstrap loader was executing code only an instruction or two behind it getting loaded. I was just in awe.

If you think about it, it's pretty crazy. Register allocation using graph colouring is an NP-complete problem. Writing assembler by hand, one is doing this constantly in one's head, and often with better results than a compiler would do.

Here's a piece of assembler I wrote for the LSI-11:


You might be interested in lft's talk[1] - "Poems For Bugs" - about why people are still writing very impressive demos for the C64 and other highly limited platforms. Instead of thinking about programming as functions and objects that divide the problem into simple mostly-independent modules. It's more like trying to write a highly-constrained poem of asm instructions that fit together in incredibly clever ways[2].

[1] https://www.linusakesson.net/programming/poems-for-bugs/inde...

[2] e.g. https://www.linusakesson.net/scene/a-mind-is-born/index.php


I love the Zachtronics games "Shenzhen I/O" (easier) and "TIS-100" (MUCH harder/esoteric). They are a great (and fun) way to try asm/microcontroller programming.

Just for fun, here's my IEEE 754 implementation of double precision floating point for the 8088:


Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact