HP-35 Div By 0
|
08-07-2023, 12:24 PM
(This post was last modified: 08-07-2023 12:28 PM by teenix.)
Post: #1
|
|||
|
|||
HP-35 Div By 0
I was just watching Dave Cochran on UTube and his reminiscing of the HP-35 development.
He mentioned that one of the privileged few who got to use the calculator before its public release tried it out and managed to do a divide by zero and the calculator subsequently crashed. Dave said it made him a tad embarrassed because he had not allowed for that possibility in the new algorithms. There must be countless times that this has happened when a new project is given to someone to try out and they do something totally unexpected, and of course, it fails. It has surely happened to me. Anyway, I decided to see what the code would do if I bypassed the "new" snippet in the HP-35 Red Dot. I found the few lines of code, which just checks for a zero mantissa, and if so, branches to the error display flash routine. The denominator is in the C register at this point, and the code line is [if c[m] >= 1] (then go to the division routine, else go to the error routine) This same test is performed in later models as well. The P register = 12 at this point, so I changed that line of code for the [if P = 12] instruction and recompiled. This will now allow the following [go to] instruction regardless of the C value. In the next few instructions, the A and B registers both equal zero when a subtraction is performed and as there is no carry generated, the following [go to] is executed and loops back and does the subtract again, and it will do this adfinitum. This is probably the "crash" that Dave saw on the HP-35 with a blank display and a blank stare on a prospective customers face :-) It was only a small code change, but if anyone has had a fiddle with the code in the Classics, then you may have some sort of appreciation for what effort that a modification like this would have presented to the engineers. It can be a mammoth task to modify code in the Classic architecture, even single line changes, as it causes a horrible butterfly effect for the other parts and can break code all over the place. cheers Tony |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
HP-35 Div By 0 - teenix - 08-07-2023 12:24 PM
RE: HP-35 Div By 0 - John Garza (3665) - 08-07-2023, 02:31 PM
RE: HP-35 Div By 0 - Thomas Klemm - 08-07-2023, 07:33 PM
RE: HP-35 Div By 0 - teenix - 08-08-2023, 01:15 AM
|
User(s) browsing this thread: 1 Guest(s)