Post Reply 
42S local label caching
11-16-2019, 03:25 PM (This post was last modified: 11-16-2019 10:57 PM by Sylvain Cote.)
Post: #13
RE: 42S local label caching
(11-15-2019 09:48 PM)Joe Horn Wrote:  I *was* sure when I wrote it, but that was 31 years ago, soon after which my 42S was stolen and I haven't had one since.
Really sorry for your loss. Sad

(11-15-2019 09:48 PM)Joe Horn Wrote:  Those who own a real 42S will be able to use its built-in (unsupported) hex memory viewer/editor to explore the internal structure of GTO's, XEQ's, and LBL's.
ok, ok, got the hint ... Wink

First I entered this short FOCAL (FTCAL?) program in my HP-42S
Code:
LBL "ABC"
5
LBL 00
"AAAAAAAAAAAAA"
AVIEW
TONE ST X
DSE ST X
GTO 00
END

Then I fired the debugger and scanned the memory for the AAAA's, then went to the start of the program, so here is the dump:
Code:
     0123456789ABCDEF
53DF        0C004F001
53E0 42434510010DF141
53E1 4141414141414141
53E2 4141414E7F93F793
53E3 71B61AC4090
Note: a little surprise, the nibbles are reversed within each bytes

Then I manually reversed the nibbles and reorganized things by their meaning
Code:
42S Memory Dump (reversed)    :  42S Memory Dump (rearranged)             
----------------------------  :  -----------------------------------------
0C004F00142434                :  C0 00 F4 00 41 42 43                     
5100                          :  15 00                                    
10                            :  01                                       
DF14141414141414141414141414  :  FD 41 41 41 41 41 41 41 41 41 41 41 41 41
E7                            :  7E                                       
F93F                          :  9F F3                                    
7937                          :  97 73                                    
1B61                          :  B1 16                                    
AC4090                        :  CA 04 09

Then I entered the same program in my HP-41C and with the RAMED function of the ZENROM I dumped the memory.

After that I mapped the two dump with the program code
Code:
42S Memory Dump                            :  41C Memory Dump                            :  FOCAL program   
-----------------------------------------  :  -----------------------------------------  :  ----------------
C0 00 F4 00 41 42 43                       :  C6 00 F4 00 41 42 43                       :  LBL "ABC"
15 00                                      :  15                                         :  5
01                                         :  01                                         :  LBL 00
FD 41 41 41 41 41 41 41 41 41 41 41 41 41  :  FD 41 41 41 41 41 41 41 41 41 41 41 41 41  :  "AAAAAAAAAAAAA"
7E                                         :  7E                                         :  AVIEW
9F F3                                      :  9F F3                                      :  TONE ST X
97 73                                      :  97 73                                      :  DSE ST X
B1 16                                      :  B1 93                                      :  GTO 00
CA 04 09                                   :  C4 04 09                                   :  END

There are small differences between the HP-42S and HP-41C like the global label and the end but what I was investigating here was the short form goto.

The 41C 2 bytes GTO format is 1011 LLLL DBBB RRRR and the value is B193 or 1011 0001 1001 0033 with the distance translated to 1 byte and 3 registers or 22 bytes between the GTO 00 and the LBL 00

The 42S 2 bytes GTO format is 1011 LLLL DBBB BBBB and the value is B116 or 1011 0001 1001 0110 with the distance translated to 22 bytes between the GTO 00 and the LBL 00

So the initial question about the short form goto has been answered!

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