Post Reply 
42S local label caching
11-15-2019, 05:42 PM (This post was last modified: 11-16-2019 12:33 PM by Sylvain Cote.)
Post: #11
RE: 42S local label caching
Hello Joe,

Local Label Searches (Users Manual P.148 & 149)
Searches for local labels occur only within the current program. To find a local label, the calculator first searches sequentially downward through the current program, starting at the location of the program pointer. If the specified label is not found before reaching the end of the program, the calculator continues the search from the beginning of the program.

A local label search can consume a significant amount of time, depending on the length of the current program and the distance to the label. To minimize searching time, the calculator remembers the distance from the GTO or XEQ instruction to the specified local label. This eliminates the searching time for subsequent executions of that same GTO or XEQ instruction.

The distance to the label is stored internally as part of the GTO or XEQ instruction. If this distance is greater than 4,096 bytes in either direction (128 bytes for short form labels; LnL 00 through LBL 14), the calculator cannot store the distance and a search must take place for each execution or the instruction.

(11-14-2019 10:54 PM)Joe Horn Wrote:  Even global labels and ENDs are the same internally. There are the same one-and two-byte LBLs, RCLs and STOs..."
Are you sure ?

For the HP-41
  • the 2 bytes GTO binary format is 1011 LLLL DBBB RRRR (Label [value+1], Direction, Bytes and Registers) allowing for a maximum jump of 15 registers and 7 bytes or 112 bytes
    .
    . Ex.: GTO 00 => 1011 0001 0001 0010 => 1011 (GTO) 0001 (00) 0 (decreasing abs. address) 001 (1 byte) 0010 (2 registers) => LBL 00 is located at 15 bytes upward from the location of GTO 00
    .
  • the 3 bytes GTO binary format is 1101 BBBR RRRR RRRR DLLL LLLL (Bytes, Registers, Direction and Label) allowing for a maximum jump of 511 registers and 7 bytes or 3584 bytes
    .
  • the 3 bytes XEQ binary format is 1110 BBBR RRRR RRRR DLLL LLLL (Bytes, Registers, Direction and Label) allowing for a maximum jump of 511 registers and 7 bytes or 3584 bytes

Sylvain
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: 3 Guest(s)