What I like about programming for retro computers

Feel free to talk about any other retro stuff here including Commodore, Sinclair, Atari, Amstrad, Apple... the list goes on!
Post Reply
ZeroByte
Posts: 714
Joined: Wed Feb 10, 2021 2:40 pm

What I like about programming for retro computers

Post by ZeroByte »


One thought just went through my head while thinking about my music playback routine - there's no kind of checking being done when you say "start here and go." What happens if you're off by one byte? Meh, it'll just crash. Don't do that.

"It'll just crash" - there's something fun about that, and in this theater of operation, it's totally justified. You have neither the CPU time nor the memory resources to waste on paltry things like range checks and sanity checks on values passed in to / out from subroutines. "Git gud" Plus, all that meticulous guarding against every conceivable thing that could go wrong is just tedious anyway. It's nice that you don't have to harden every routine of every module of code against bad actors on the Internet or anything like that. Just "start here and start copying until you reach a sentinel value." (no sentinel value found - interrupt table overwritten - oh well, time to launch the debugger and see why the screen turns to garbage and the sound sticks on a digital shriek that makes your hair stand on end)

BruceMcF
Posts: 1336
Joined: Fri Jul 03, 2020 4:27 am

What I like about programming for retro computers

Post by BruceMcF »



On 11/20/2021 at 3:37 AM, ZeroByte said:




One thought just went through my head while thinking about my music playback routine - there's no kind of checking being done when you say "start here and go." What happens if you're off by one byte? Meh, it'll just crash. Don't do that.



"It'll just crash" - there's something fun about that, and in this theater of operation, it's totally justified. You have neither the CPU time nor the memory resources to waste on paltry things like range checks and sanity checks on values passed in to / out from subroutines. "Git gud" Plus, all that meticulous guarding against every conceivable thing that could go wrong is just tedious anyway. It's nice that you don't have to harden every routine of every module of code against bad actors on the Internet or anything like that. Just "start here and start copying until you reach a sentinel value." (no sentinel value found - interrupt table overwritten - oh well, time to launch the debugger and see why the screen turns to garbage and the sound sticks on a digital shriek that makes your hair stand on end)



There's a lot of the Forth programming philosophy in that ... build little routines that do what they claim to do, test every border case, document the stack interface, and then use it as a plug in. If a process needs a range check, there's a range test word that can be used with THROW, but it's not built into the routine call: instead, the routine call is typically designed to be as efficient as feasible for the target processor, in line with typical word definitions that are two to seven words long. With words so short, CALL and RETURN together are often a quarter of all primitives executed, so making CALL and RETURN fast is the key to the implementation not bogging down.

Also, keeping most words short is also an integral part of testing every border case, since it's what allows for keeping the border cases of each word down to a manageable number.

John Chow Seymour
Posts: 143
Joined: Sun Jul 05, 2020 3:27 pm

What I like about programming for retro computers

Post by John Chow Seymour »


If something I do on one of my modern systems causes a crash (or, more likely, it crashes on its own, heh) then the process of shutting down / restarting can take several minutes.  On an 8-bit device, just flip the switch on and off, or hit the 'reset' button if your device has one, and you're right back where you were (usually, staring at code wondering what caused the crash).

A family member gifted us an iPad recently -- no one in my household had ever used one before.  After four days of attempts, we have yet to successfully get it associated with an Apple ID, which means we can't connect to the store to get any software on it, etc.  It's always some new problem: it's supposed to send us a verification code but doesn't, or a mysterious "Cannot login to Apple ID due to a server error", or any number of other things.  It was frustrating at first but has now become so rediculous as to be amusing to us.

My C64, by comparison, immediately lets me do whatever I want when I turn it on.  (So did the Apple ][ I had as a kid.)

Ju+Te
Posts: 40
Joined: Sat Sep 25, 2021 6:33 am

What I like about programming for retro computers

Post by Ju+Te »


Yes, the problem with the iPad is that no programming environment is preinstalled. Same for the iPhone, Android, Windows, macOS. But programming for Linux is also not that easy because there is a large back box between your code and the hardware.

User avatar
Cyber
Posts: 482
Joined: Mon Apr 27, 2020 7:36 am

What I like about programming for retro computers

Post by Cyber »



On 11/21/2021 at 7:01 PM, John Chow Seymour said:




If something I do on one of my modern systems causes a crash (or, more likely, it crashes on its own, heh) then the process of shutting down / restarting can take several minutes.  On an 8-bit device, just flip the switch on and off, or hit the 'reset' button if your device has one, and you're right back where you were (usually, staring at code wondering what caused the crash).



A family member gifted us an iPad recently -- no one in my household had ever used one before.  After four days of attempts, we have yet to successfully get it associated with an Apple ID, which means we can't connect to the store to get any software on it, etc.  It's always some new problem: it's supposed to send us a verification code but doesn't, or a mysterious "Cannot login to Apple ID due to a server error", or any number of other things.  It was frustrating at first but has now become so rediculous as to be amusing to us.



My C64, by comparison, immediately lets me do whatever I want when I turn it on.  (So did the Apple ][ I had as a kid.)









 

User avatar
Tatwi
Posts: 103
Joined: Wed Sep 22, 2021 7:28 pm

What I like about programming for retro computers

Post by Tatwi »



On 11/21/2021 at 12:36 PM, Ju+Te said:




Yes, the problem with the iPad is that no programming environment is preinstalled. Same for the iPhone, Android, Windows, macOS. But programming for Linux is also not that easy because there is a large back box between your code and the hardware.



In many cases it's the dark, empty void that sits between you and the software's functionality that's the biggest impediment to understanding and education. People can't be arsed to write any documentation anymore, let alone provide comprehensive practical code examples. But don't worry, the community will docu.. produce 10,000 "hello world" videos and blog posts!

Sincerely,

A VIC20 Manual Owner

Post Reply