Post Reply 
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 Wink

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
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
42S local label caching - Dave Britten - 11-11-2019, 05:54 PM
RE: 42S local label caching - Sylvain Cote - 11-11-2019 06:18 PM
RE: 42S local label caching - Dave Britten - 11-11-2019, 06:56 PM
RE: 42S local label caching - Sylvain Cote - 11-13-2019, 02:00 PM
RE: 42S local label caching - Sylvain Cote - 11-13-2019, 02:06 PM
RE: 42S local label caching - Andres - 11-11-2019, 07:06 PM
RE: 42S local label caching - Dave Britten - 11-11-2019, 07:28 PM
RE: 42S local label caching - Sylvain Cote - 11-14-2019, 04:00 AM
RE: 42S local label caching - Joe Horn - 11-14-2019, 10:54 PM
RE: 42S local label caching - Sylvain Cote - 11-15-2019, 05:42 PM
RE: 42S local label caching - Joe Horn - 11-15-2019, 09:48 PM
RE: 42S local label caching - Sylvain Cote - 11-16-2019, 03:25 PM
RE: 42S local label caching - Werner - 11-16-2019, 04:50 PM
RE: 42S local label caching - Sylvain Cote - 11-16-2019, 11:33 PM
RE: 42S local label caching - Sylvain Cote - 11-16-2019, 11:22 PM
RE: 42S local label caching - Joe Horn - 11-17-2019, 12:50 PM
RE: 42S local label caching - Werner - 11-17-2019, 09:37 AM
RE: 42S local label caching - J-F Garnier - 11-17-2019, 09:51 AM
RE: 42S local label caching - Werner - 11-17-2019, 07:03 PM



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