HP-65 neg mantissa - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: General Forum (/forum-4.html) +--- Thread: HP-65 neg mantissa (/thread-19980.html) |
HP-65 neg mantissa - teenix - 05-20-2023 10:17 AM Hi all, I was playing around with the 65 emulator and I noticed if the mantissa = 0, then pressing CHS will only change the sign to negative, never positive. I thought I found a bug in my code, but the Windows emulator does the same. I tried it out on a HP-65 and it is the same as well. Looking at the HP microcode, when the mantissa = 0, the code does not know that the negative sign has been set as it is not stored in the C register, only the A register for the display. So each time CHS is pressed when the mantissa = 0, the instruction 0 - C - 1 -> C[S] always sets the sign digit in C = 9 (negative). This gets transferred to the A register so that the display shows a negative number, but not back to the C register where C sign still = 0. The next time CHS is pressed, the same thing happens. If the C register has a negative non zero number, then C[Sign] = 9, so 0 - C - 1 -> C[S] = 0 (positive) If the C register has a positive non zero number, then C[Sign] = 0, so 0 - C - 1 -> C[S] = 9 (negative) If the C register = 0, then C[Sign] = 0, so 0 - C - 1 -> C[S] = 9 (negative, but C sign stays = 0, just A sign = 9) Seeing how there is no more code that can be added to the 65, I guess it was unrepairable. cheers Tony RE: HP-65 neg mantissa - Harald - 05-20-2023 07:16 PM Interesting, I never noticed that. The 35 can display 0 and -0. -0 stays -0 if pushed to the stack, however calculation results are always positive 0. |