Post Reply 
(11C) Reverse Integer
06-04-2018, 05:16 PM
Post: #5
RE: (11C) Reverse Integer
(06-04-2018 01:27 PM)Dieter Wrote:  Great! And now try it with only one data register and at most 20 steps. And don't forget, every "10" requires two steps. ;-)

Here's what I got:

Code:
001 LBL A
002 STO 0
003 STO-0
004 LBL 1
005 1
006 0
007 ÷
008 INT
009 LstX
010 FRAC
011 1
012 0
013 STOx0
014 x
015 STO+0
016 R↓
017 X≠0?
018 GTO 1
019 RCL 0
020 RTN

Step 002/003 clear R0 "en passant" whithout disturbing the stack.
And the final RTN can be omitted. Then it's merely 19 steps. ;-)

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


Messages In This Thread
(11C) Reverse Integer - Gamo - 06-04-2018, 10:16 AM
RE: (11C) Reverse Integer - Dieter - 06-04-2018, 01:27 PM
RE: (11C) Reverse Integer - Dieter - 06-04-2018 05:16 PM
RE: (11C) Reverse Integer - Dieter - 06-04-2018, 10:05 PM
RE: (11C) Reverse Integer - Gamo - 06-05-2018, 01:17 AM
RE: (11C) Reverse Integer - Dieter - 06-05-2018, 10:48 AM
RE: (11C) Reverse Integer - rprosperi - 06-05-2018, 01:17 PM



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