HP 50g Programming Methods???
|
11-04-2017, 11:50 PM
(This post was last modified: 11-04-2017 11:55 PM by TravisE.)
Post: #9
|
|||
|
|||
RE: HP 50g Programming Methods???
Just to share some of my own experience of working with SysRPL/ASM development directly on the calculator itself (my preferred way of developing because I can do it anywhere):
(11-04-2017 05:02 PM)DavidM Wrote: IMHO, a hard crash is actually better than data corruption, which can sometimes go unnoticed for a long time before its impact is seen. I learned that one the hard way. I've lost count of how many times I've discovered odd corruption in variables and programs, seemingly out of nowhere, days or even months after doing some low-level development and wondered how in the world that happened. Or the even better question, when. Bad system-level code can result in garbage bytes being overwritten into variables. If this happens to programs (UserRPL included, as there's no internal distinction between compiled User- and SysRPL code), the result of executing the corrupted part of the program is usually that the OS will jump to an arbitrary execution address, resulting in a lockup, reboot, or generally anything but what was intended and expected. I've also had corruption apparently occur to the file system itself, resulting in unexpected crashes when navigating (in the Filer, for instance) or trying to manipulating directories when it otherwise appeared as though nothing was wrong. Recovering from that was a particularly time-consuming mess. I no longer remember what I did (this was several years back), but I probably had to salvage as many individual variables as I could and copy them to fresh directories (while backing up frequently for the inevitable further crashes I hit during the recovery process). So, my practice eventually evolved into the following: 1. Have a small program to write an archive of HOME to the SD card, each one to a separate file (maintaining a full backup history is important to find fresh copies of variables in case of undetected corruption that occurred at an unknown point in time; the SD card has enough room for practically a lifetime's worth of backups ) 2. Assign the backup program to a key for convenient backups on the fly, anytime 3. Every time I'm about to run new ASM/SysRPL code, press the backup key 4. If a crash occurs (or anything strange at all, for that matter), immediately do an [ON]+[A]+[F] reset and answer “no” to the “Try to Recover Memory?” prompt. Instead, reload the latest backup from the SD card to ensure a fresh copy of all HOME variables is reloaded. That might sound like a pain, but it's not too bad (other than waiting a few seconds) because a lot of it can be automated. I have the assigned keystroke to automatically store a HOME backup, and I have a routine somewhere in a custom library stored in Port 2 to detect on startup if RAM was cleared and automatically prompt for restoring the latest SD card backup if so. So I crash, press [ON]+[A]+[F], [NO], [OK], then I'm back in business, ready for another try. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 8 Guest(s)