Post Reply 
Funny HP-16C quirk
11-09-2024, 03:44 AM
Post: #6
RE: Funny HP-16C quirk
(11-08-2024 02:42 PM)Thomas Klemm Wrote:  I assume this is related to the value 3fc read from the address 255.
Later, it is converted to 74 and written to reg[010].
It is probably written when subroutine A is executed, but as ThomasF already mentioned, it is not reset anymore.

Yes, reg 0xff contains the current program position in the lowest three digits, 0x000 for line 0. The next three digits to the left of the progran position are the first return level, with 0x3fc being to line 3.

At 0x0a14, a subtroutine is called to read that register, which of course gets all 56 bits of it. However, the microcode programmer apparently assumed that all of the digits 13..3 would be zero. At 0x0a1a, the entire C register is checked for zero, where the check should only be for the exponent and exponent sign digits. When there's no pending return, it jumps ahead to L0a2a. Because of the pending return, the code falls through into 0x0a1c, which formats one digiit of the display, then falls into the comnon path at 0x0a2a.

The code from 0x0a1c to 0x0a29 is what would usually format the base indicator in integer modes, or the least significant display digit (of mantissa, exponent, or blank) in FLOAT. It shouldn't be executed in PRGM mode on line 0. It is being executed with wrong flag settings, so a 0xf in one of the display formatting temporary registers is being formatted in hexadecimal mode as "F", rather than in decimal and special mode where it would be a blank.

Replacing the "? c#0 w" instruction (0x2ee) at 0x0a1a with "? c#0 x" (0x2e6) should fix it. HP used that to test for line 0 in other places in the code, such as 0x0c25. That works because the program pointer register number can never be 0x00, which is in the status registers, so if it is 0x00, it doesn't matter what digit 2 contains (1-7 for byte), though that should always be zero when the register is 0x00.

Are there any other known bugs in the ORIGINAL 16C firmware? At least this one is only cosmetic, and won't lose or corrupt any data.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Funny HP-16C quirk - J-F Garnier - 11-06-2024, 04:33 PM
RE: Funny HP-16C quirk - ThomasF - 11-06-2024, 08:02 PM
RE: Funny HP-16C quirk - RPNerd - 11-08-2024, 09:08 AM
RE: Funny HP-16C quirk - AnnoyedOne - 11-08-2024, 02:55 PM
RE: Funny HP-16C quirk - Thomas Klemm - 11-08-2024, 02:42 PM
RE: Funny HP-16C quirk - brouhaha - 11-09-2024 03:44 AM
RE: Funny HP-16C quirk - J-F Garnier - 11-09-2024, 09:15 AM



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