Post Reply 
DM42 and labels
05-27-2020, 12:32 AM
Post: #28
RE: DM42 and labels
(05-26-2020 11:40 PM)rprosperi Wrote:  
(05-26-2020 05:06 PM)Dave Britten Wrote:  Pressing a subroutine key (A-E) when the corresponding label isn't defined in program memory will start execution from step 1 and behave normally. This is frequently taken advantage of in 65 programs that either need to save two steps by not explicitly defining one of the keyboard-activated subroutine labels, or by simply placing RTN as the first step in memory so that unassigned subroutine keys don't cause unintended program execution if pressed by the user.

Thanks for the additional tips and notes Dave. I have not spent enough time with 65!

I love the little tricks you noted in the quoted section above! Great examples of the time-honored PPC mindset of using bugs or abnormal features as ways to get something done that couldn't otherwise be done.

Another clever trick stems from label searches always beginning from the current program pointer position, and RTN leaving the pointer sitting where it stopped. You can have RTN at the top of program memory, followed by labels A, B, C, and D in your program with each routine ending with GTO a nonexistent label to park back at the top of program memory. Then have a LBL E that's followed only by RTN, and a second set of labels A-D after that. After pressing E, pressing A-D will call one of the second instances of the labels. They all have to be fairly small routines, but you can get 8 user-defined keys in your program this way.

Techniques like these, and the fact that the 65 skips two instructions when a condition is false (because GTO is unmerged, meaning you can also do "x>y 1 -" to decrement x if it's greater than y) can actually make it sort of tricky to port 65 programs to newer models at times. Smile With only 100 steps, you can bet that programmers frequently took advantage of these idiosyncrasies!
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
DM42 and labels - mchris - 05-19-2020, 04:26 PM
RE: DM42 and labels - Massimo Gnerucci - 05-19-2020, 05:19 PM
RE: DM42 and labels - rprosperi - 05-19-2020, 05:30 PM
RE: DM42 and labels - mchris - 05-19-2020, 05:39 PM
RE: DM42 and labels - mchris - 05-19-2020, 05:52 PM
RE: DM42 and labels - toml_12953 - 05-19-2020, 05:57 PM
RE: DM42 and labels - rprosperi - 05-19-2020, 06:13 PM
RE: DM42 and labels - toml_12953 - 05-19-2020, 10:06 PM
RE: DM42 and labels - mchris - 05-19-2020, 06:01 PM
RE: DM42 and labels - J-F Garnier - 05-19-2020, 06:10 PM
RE: DM42 and labels - Sylvain Cote - 05-19-2020, 06:13 PM
RE: DM42 and labels - Thomas Okken - 05-19-2020, 07:12 PM
RE: DM42 and labels - mchris - 05-19-2020, 07:27 PM
RE: DM42 and labels - Thomas Okken - 05-19-2020, 07:56 PM
RE: DM42 and labels - Werner - 05-19-2020, 08:09 PM
RE: DM42 and labels - Massimo Gnerucci - 05-19-2020, 08:26 PM
RE: DM42 and labels - mchris - 05-19-2020, 10:18 PM
RE: DM42 and labels - David Hayden - 05-19-2020, 08:54 PM
RE: DM42 and labels - rprosperi - 05-19-2020, 09:17 PM
RE: DM42 and labels - Sylvain Cote - 05-19-2020, 10:53 PM
RE: DM42 and labels - rprosperi - 05-20-2020, 12:19 AM
RE: DM42 and labels - Mike (Austria) - 05-24-2020, 08:52 PM
RE: DM42 and labels - SlideRule - 05-25-2020, 01:00 PM
RE: DM42 and labels - Didier Lachieze - 05-25-2020, 01:04 PM
RE: DM42 and labels - rprosperi - 05-25-2020, 04:42 PM
RE: DM42 and labels - Dave Britten - 05-26-2020, 05:06 PM
RE: DM42 and labels - rprosperi - 05-26-2020, 11:40 PM
RE: DM42 and labels - Dave Britten - 05-27-2020 12:32 AM



User(s) browsing this thread: 1 Guest(s)