HP-15C: Fixing the CHS and Stack Lift Bug
12-14-2015, 11:39 PM
Post: #11
 Thomas Klemm Senior Member Posts: 1,447 Joined: Dec 2013
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
 « Next Oldest | Next Newest »

 Messages In This Thread HP-15C: Fixing the CHS and Stack Lift Bug - Thomas Klemm - 12-12-2015, 10:44 PM RE: HP-15C: Fixing the CHS and Stack Lift Bug - Marcus von Cube - 12-13-2015, 08:59 AM RE: HP-15C: Fixing the CHS and Stack Lift Bug - Katie Wasserman - 12-13-2015, 04:39 PM RE: HP-15C: Fixing the CHS and Stack Lift Bug - matthiaspaul - 12-13-2015, 05:48 PM RE: HP-15C: Fixing the CHS and Stack Lift Bug - matthiaspaul - 12-13-2015, 08:08 PM RE: HP-15C: Fixing the CHS and Stack Lift Bug - Thomas Klemm - 12-13-2015, 10:29 PM HP-11C and HP-16C: Fixing the CHS and Stack Lift Bug - Thomas Klemm - 12-14-2015, 09:35 PM RE: HP-15C: Fixing the CHS and Stack Lift Bug - Massimo Gnerucci - 12-14-2015, 09:49 PM RE: HP-15C: Fixing the CHS and Stack Lift Bug - rprosperi - 12-14-2015, 10:23 PM RE: HP-15C: Fixing the CHS and Stack Lift Bug - Thomas Klemm - 12-14-2015, 10:39 PM RE: HP-15C: Fixing the CHS and Stack Lift Bug - toml_12953 - 12-18-2015, 01:07 PM RE: HP-15C: Fixing the CHS and Stack Lift Bug - Thomas Klemm - 12-14-2015 11:39 PM RE: HP-15C: Fixing the CHS and Stack Lift Bug - Thomas Klemm - 12-16-2015, 10:24 PM RE: HP-15C: Fixing the CHS and Stack Lift Bug - Didier Lachieze - 12-16-2015, 10:37 PM RE: HP-15C: Fixing the CHS and Stack Lift Bug - Thomas Klemm - 12-17-2015, 01:45 AM RE: HP-15C: Fixing the CHS and Stack Lift Bug - Thomas Klemm - 12-17-2015, 09:09 PM RE: HP-15C: Fixing the CHS and Stack Lift Bug - Tugdual - 12-17-2015, 09:54 PM RE: HP-15C: Fixing the CHS and Stack Lift Bug - Thomas Klemm - 12-17-2015, 10:08 PM RE: HP-15C: Fixing the CHS and Stack Lift Bug - Tugdual - 12-17-2015, 11:51 PM RE: HP-15C: Fixing the CHS and Stack Lift Bug - Thomas Klemm - 12-22-2015, 10:40 PM RE: HP-15C: Fixing the CHS and Stack Lift Bug - Thomas Klemm - 12-28-2015, 11:14 PM

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