HP-41 END vs RTN
|
07-14-2019, 02:54 AM
Post: #2
|
|||
|
|||
RE: HP-41 END vs RTN
The advantage of using END to separate programs from each other is that each program gets its own space for searching local labels (i.e. LBL 00-99, A-J, and a-e.)
Let's say you have two programs, each containing a loop. The loop requires a GTO that jumps backwards, back to the beginning of the loop. If the two programs are joined, that is, there is no END separating them, then the two loops must be written with different labels, or else each of the two GTOs would jump to the wrong label, that is, the one in the other program, since that would be the first one found while searching downwards (towards higher line numbers) from the GTO. If the programs are separated by an END, you can choose the labels within each program without worrying about interfering with the other program. If you are writing your own programs, you can, of course, choose your labels such that these kinds of collisions do not occur, and so, using RTN to end your programs is fine. If, on the other hand, you are using pre-written programs, you may have to use END to separate them. Regarding your point of being able to save multiple programs in one file if they are separated by RTN: I don't have my DM42 at hand to check, but in Free42, you can save multiple programs to one file even if they are separated by ENDs. In fact, they don't even have to be contiguous in memory. Does the DM42 not allow that? |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
HP-41 END vs RTN - NoEqualsButton - 07-14-2019, 02:33 AM
RE: HP-41 END vs RTN - Thomas Okken - 07-14-2019 02:54 AM
RE: HP-41 END vs RTN - grsbanks - 07-14-2019, 07:43 AM
RE: HP-41 END vs RTN - NoEqualsButton - 07-14-2019, 03:58 AM
|
User(s) browsing this thread: 1 Guest(s)