Post Reply 
HHC 2015 RPN programming Contest is now open
09-30-2015, 03:42 PM (This post was last modified: 09-30-2015 03:51 PM by Gerson W. Barbosa.)
Post: #51
RE: HHC 2015 RPN programming Contest is now open
(09-30-2015 01:54 PM)Csaba Tizedes Wrote:  Bytes, bytes everybody talks about bytes...
Can somebody check my beloved HP15C 53 steps solution is how many byte costs on a pure 41???

Thanks!
Csaba

Hello Csaba,

Your program is 45-step long and takes up 84 bytes on the HP-42S, but you can save a few bytes by using HP-41C specific instructions. Also, CLX instead of 0 takes up only one byte instead of two. END instead of the final RTN saves you another byte.

Code:

00 { 84-Byte Prgm }
01>LBL "RR"
02 9
03 STO 06
04 XEQ "SORT"
05 1.005
06 STO 08
07>LBL 00
08 RCL 08
09 RCL IND 08
10 STO 08
11 RCL IND 08
12 ABS
13 +/-
14 STO IND 08
15 Rv
16 Rv
17 STO 08
18 ISG 08
19 GTO 00
20 1.006
21 STO 08
22 0
23 STO 00
24>LBL 01
25 RCL IND 08
26 X>0?
27 GTO 02
28 1
29 STO+ 00
30 RCL 00
31 3
32 X<Y?
33 GTO 03
34>LBL 09
35 ISG 08
36 GTO 01
37 9
38 RTN
39>LBL 02
40 0
41 STO 00
42 GTO 09
43>LBL 03
44 0
45 RTN

Quoting from your code comments:

Quote:
Code:

1       005-       1     |
.       006-      48     |
0       007-       0     |   Maybe this is only one step on 41C
0       008-       0     |
5       009-       5     |

Yes, only one step. Six bytes, though.

Regards,

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


Messages In This Thread
RE: HHC 2015 RPN programming Contest is now open - Gerson W. Barbosa - 09-30-2015 03:42 PM



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