3 ms·
Would love to hear more about this - have you written on your experiences?
by paulsmith 7y ago
Would love to hear more about this - have you written on your experiences?
- WalterBright 7y agoNo, 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.
- WalterBright 7y agoHere's a piece of assembler I wrote for the LSI-11: https://github.com/DigitalMars/Empire-for-PDP-11/blob/master/FIGHMV.MAC https://github.com/DigitalMars/Empire-for-PDP-11/blob/master...
- cmrdporcupine 7y agoIf 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.
- pdkl95 7y agoYou 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/index.php https://www.linusakesson.net/programming/poems-for-bugs/inde... [2] e.g. https://www.linusakesson.net/scene/a-mind-is-born/index.php https://www.linusakesson.net/scene/a-mind-is-born/index.php edit: 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.
- WalterBright 7y agoJust for fun, here's my IEEE 754 implementation of double precision floating point for the 8088: https://github.com/DigitalMars/dmc/blob/master/src/CORE16/DOUBLE.ASM https://github.com/DigitalMars/dmc/blob/master/src/CORE16/DO...