Post Reply 
DM42 and labels
05-26-2020, 05:06 PM
Post: #26
RE: DM42 and labels
The 65 is a very odd duck with regards to RTN and subroutines (forgivable, considering it was the first programmable handheld, and it technically doesn't use RAM for program storage as it's not random-access memory). A few of its quirks:

As noted, the first RTN encountered does nothing when starting a program by pressing R/S (this does not apply to restarting a program that stopped itself with R/S). Execution will continue to the second RTN.

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.

A programmed subroutine call (A-E) without the corresponding label defined results in a brief delay while the calculator searches for the label, and then execution begins at step 1. However, the RTN does not properly return to the calling routine.

There are similar quirks involving GTO to labels that don't exist, and I think they mostly result in execution branching to step 1 with out any strange side-effects to RTN (I could be wrong). There's a rather extensive article in 65 Notes V2N1 (Jan 1975) that goes into detail about how the 65 behaves. The important part is that it's all consistent and predictable, and can be taken advantage of by a crafty programmer.
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)