Post Reply 
(11C) Digit Sum
01-20-2018, 09:23 AM
Post: #4
RE: (11C) Digit Sum
(01-20-2018 08:14 AM)wawa Wrote:  and here is a HP42s version of this program with a little modification in the way I use the stack
...

This one is shorter and requires less stack acrobatics. Works on the 41 and the 42s and also preserves Y.

Code:
01 LBL"DSUM"
02 0
03 X<>Y
04 LBL 01
05 10
06 /
07 FRC
08 ST+ Y
09 X<> L
10 INT
11 X≠0?
12 GTO 01
13 +
14 10
15 *
16 END

Note for 42s users: Y and L are stack registers (ST Y and ST L).

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


Messages In This Thread
(11C) Digit Sum - Gamo - 01-16-2018, 08:52 AM
RE: (11C) Digit Sum - Dieter - 01-16-2018, 07:16 PM
RE: (11C) Digit Sum - wawa - 01-20-2018, 08:14 AM
RE: (11C) Digit Sum - Dieter - 01-20-2018 09:23 AM
RE: (11C) Digit Sum - Gamo - 01-20-2018, 10:10 AM
RE: (11C) Digit Sum - Dieter - 01-20-2018, 05:21 PM



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