Post Reply 
HP-15C: Fixing the CHS and Stack Lift Bug
12-14-2015, 11:39 PM
Post: #11
RE: HP-15C: Fixing the CHS and Stack Lift Bug
(12-14-2015 10:23 PM)rprosperi Wrote:  Earlier research revealed the 10C and 12C do not have this problem. Likely because they actually wrote the code for the 10C and 12C, rather than porting the 34C code to the 11C/15C/16C, where it appears the bug originated.

This is the relevant code of the HP-12C:

Code:
01155: 1276 c=-c-1  s
01156: 0707 ?c  goto 01246
...
01246: 0371 ?nc goto 00076
...
00076: 1104 s=0 9
00077: 1404 s=0 1
00100: 0240 sel p
00101: 1625 ?nc call 03745
00102: 0034
00103: 0055 ?nc call 10413
00104: 0104
...
10413: 1372 ? c<>0  m
10414: 0027 ?c  goto 10416
10415: 0116 c=0     w
10416: 1240 set dec

Compared to the other calculators the sign is negated unconditionally (line 01155) and only much later it's checked whether the mantissa is 0 (line 10413).
If so the whole register c is set to 0 (line 10415).

It could be interesting to compare this code to even earlier implementations of CHS.

Cheers
Thomas
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP-15C: Fixing the CHS and Stack Lift Bug - Thomas Klemm - 12-14-2015 11:39 PM



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