Post Reply 
HP-65 neg mantissa
05-20-2023, 10:17 AM (This post was last modified: 05-20-2023 10:22 AM by teenix.)
Post: #1
HP-65 neg mantissa
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
Find all posts by this user
Quote this message in a reply
05-20-2023, 07:16 PM
Post: #2
RE: HP-65 neg mantissa
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.
Find all posts by this user
Quote this message in a reply
Post Reply 




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