42S local label caching
|
11-11-2019, 06:18 PM
(This post was last modified: 11-11-2019 06:33 PM by Sylvain Cote.)
Post: #2
|
|||
|
|||
RE: 42S local label caching
Hello Dave,
That is a lot of questions I do not remember the details of the HP-42S implementation, but since it is a close simulation of the HP-41, here are the guidelines for the HP-41 ... (11-11-2019 05:54 PM)Dave Britten Wrote: Is that distance literally stored directly in the GTO or XEQ instruction inside the program?Yep! ... for local labels only, 2 bytes GTO/XEQ for short distance LBL 00 to LBL 14 and 3 bytes GTO/XEQ for long distance for LBL 15 and up (11-11-2019 05:54 PM)Dave Britten Wrote: Or is it held elsewhere in memory?Nop! ... see above (11-11-2019 05:54 PM)Dave Britten Wrote: How long are these cached branching distances kept?Until the program is modified or packed, when that happens, all local GTO/XEQ distances are reset to zero (11-11-2019 05:54 PM)Dave Britten Wrote: Do they persist between multiple invocations of a program?Yep! (11-11-2019 05:54 PM)Dave Britten Wrote: How does this work exactly?When a GTO/XEQ is encountered and the distance field is set to zero, then the FOCAL interpreter then do a scan in search of the requested LBL, if label is found and the distance is within allowed reach then the number of bytes to jump is stored in the GTO/XEQ itself. (11-11-2019 05:54 PM)Dave Britten Wrote: What about if you XEQ a global label in a different program area? Will local label lookups inside that program be cached if you call that same external program multiple times inside your program?Global GTO/XEQ are different beasts and global LBL are looked up every time. Sylvain Ref.: Synthetic Programming on the HP-41C, by W.C Wickes, pages 16 & 17 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)