HP-15C: Fixing the CHS and Stack Lift Bug
|
12-12-2015, 10:44 PM
(This post was last modified: 05-15-2022 08:47 AM by Thomas Klemm.)
Post: #1
|
|||
|
|||
HP-15C: Fixing the CHS and Stack Lift Bug
For a description of the bug see: CHS and Stack Lift
TL;DR: CHS doesn't enable the stack lift when the X-register is 0. The line 07117 is responsible for the CHS-bug. When the mantissa of the X-register is all 0 then the program jumps to line 00250. But then the flag 9 which disables the stack-lift is not cleared in line 07127. Thus the stack-lift keeps disabled. Code: 07116: 1372 ? c<>0 m But line 07117 is also used with short branches, probably to save some precious bytes. Thus we have to adjust these as well. And then there are two short branches to line 07127 which we have to consider. This is the patch I came up with: Code: 07116: 1372 ? c<>0 m Thus the long jump to line 00250 was moved down. The commands s=0 9 and c<>n got swapped so we can only enable the stack-lift. Unfortunately the distance from line 07027 is now too long for a short branch. Instead of using a long jump I decided to do it in two steps: Code: 07026: 0414 ? s=0 8 So far the fix works fine. I just hope that I haven't introduced other bugs. Keep a copy of the original ROM! Instructions to apply the patch:
Kind regards Thomas |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 34 Guest(s)