3 ms·
Assembler programmers of that vintage were crazy. I did a fair amount of reverse engineering of Honda engine computers[0] from the late 80's early 90's and this
by mrbogle 12y ago
Assembler programmers of that vintage were crazy. I did a fair amount of reverse engineering of Honda engine computers[0] from the late 80's early 90's and this kind of thing was the status quo. These things had 256 _bytes_ of memory, and they used every single one, some of them being multiplexed to do multiple things.
There are some interesting, digestible bits in the serial interrupt handler[1]
[0]: https://github.com/benogle/obd0vtec_dev/blob/master/src/stock/jdmpw0-comments.asm https://github.com/benogle/obd0vtec_dev/blob/master/src/stoc...
[1]: https://github.com/benogle/obd0vtec_dev/blob/master/src/stock/jdmpw0-comments.asm#L85 https://github.com/benogle/obd0vtec_dev/blob/master/src/stoc...
- T-hawk 12y agoHere's my favorite, from the Atari 2600. The graphics chip has two "missile" objects that act like simple sprites that are only one bit wide. They are each enabled or disabled by writing 1 or 0 to a certain bit of a certain hardware register of the graphics chip. That register is laid out in hardware with that certain bit at bit 1. Why there, why not the low or high bit? Because that corresponds to the location of the zero flag in the flags register of the 6502 CPU. So the missile objects can be quickly enabled or disabled by setting the stack pointer to the address of that register, doing a compare on the object coordinates, and pushing the flags register. Both missiles can be done in sequence because the registers are adjacent and the push instruction decrements the stack pointer to set up for the next one. All to save two instructions on rendering the missiles each scanline. With a nice bonus that the code is time-invariant without branching.
- kabdib 12y ago2600 programming is an exercise in crazy. - The parallel port chip has direction bits that control whether a line is an input or an output. This register is read/write, so you can use it as temporary memory when you don't care about reading or writing I/O (which is most of the time). - Lots of code doesn't need a stack; it doesn't call anything, and it can just jump to where it needs to be at the end. Now we can use the S register for something else. Many, many other tricks. I used some of them a few years ago on an embedded system that needed to fit into 1920 bytes. I enlisted a cow-orker into the effort and we were both cackling away. [Later, the hardware guys offered us a different chip with twice the memory, but at that point we were too close to shipping to make any changes, and besides, it wouldn't have been as fun... :-) ]
- apaprocki 12y ago2600 programming is alive in the demo scene. This was just created in 2014 and is completely insane: http://youtu.be/04Wk9Oi_Fsk http://youtu.be/04Wk9Oi_Fsk