Post Reply 
HP-41 Byte Table
12-27-2018, 08:31 PM
Post: #2
RE: HP-41 Byte Table
The HP-41C/CV/CX and 42S store the offset from a GTO or XEQ instruction to its target LBL in the GTO / XEQ instruction. When the GTO or XEQ is first entered into a program, the offset is initially set to zero, meaning "unknown"; when the instruction is executed for the first time, a label search is performed, just like on older programmable HPs, and when the label is found, the difference between its address and the address of the GTO or XEQ is stored in said GTO or XEQ. Any subsequent time the instruction is executed, it can find the label instantly by adding the stored offset to the current instruction's address.

In order to store these offsets, GTO and XEQ need to take up some more space than other instructions with parameters. In the case of GTO 00 through GTO 14, one byte is added, giving an 8-bit offset, and thus a limited range, in exchange for taking up little memory. GTO 15-99, A-J, a-e, and all local XEQ instructions, have one and a half extra bytes, giving a 12-bit offset, enough even for the largest programs. Those twelve extra bits are stored by using four bits in the opcode byte, and and additional byte used entirely for the offset. The four bits in the opcode byte are why you end up with 16 local GTO opcodes and 16 local XEQ opcodes.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP-41 Byte Table - JurgenRo - 12-27-2018, 07:54 PM
RE: HP-41 Byte Table - Thomas Okken - 12-27-2018 08:31 PM
RE: HP-41 Byte Table - JurgenRo - 12-27-2018, 09:05 PM
RE: HP-41 Byte Table - JurgenRo - 12-27-2018, 09:11 PM
RE: HP-41 Byte Table - Sylvain Cote - 12-28-2018, 04:43 PM
RE: HP-41 Byte Table - JurgenRo - 12-28-2018, 08:34 PM
RE: HP-41 Byte Table - Sylvain Cote - 12-27-2018, 09:02 PM
RE: HP-41 Byte Table - JurgenRo - 12-27-2018, 10:46 PM
RE: HP-41 Byte Table - Thomas Okken - 12-27-2018, 09:18 PM
RE: HP-41 Byte Table - JurgenRo - 12-27-2018, 09:22 PM
RE: HP-41 Byte Table - hth - 12-28-2018, 05:14 PM
RE: HP-41 Byte Table - JurgenRo - 12-28-2018, 08:44 PM
RE: HP-41 Byte Table - Sylvain Cote - 12-28-2018, 09:17 PM
RE: HP-41 Byte Table - Thomas Okken - 12-28-2018, 11:44 PM
RE: HP-41 Byte Table - JurgenRo - 12-28-2018, 11:57 PM



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