[DM16L] Collatz explorer

Contributed software for the DM10, DM11, DM12, DM15 and DM16 goes here.

Please prefix the subject of your post with the model of the calculator that your program is for.
Post Reply
User avatar
dalremnei
Posts: 43
Joined: Thu Dec 10, 2020 11:32 am
Location: Scotland

[DM16L] Collatz explorer

Post by dalremnei »

Just a fun program that displays the collatz sequence for any number in Hex, Decimal or Octal modes. Binary mode is not supported.

I tried to use the decoder on the swissmicros help page for the voyager clones, however it appears to be broken, so I can only post the memory dump. If someone can tell me an alternative way to get a code listing, I will edit this post to include it.

LBL C starts displaying the collatz sequence for the number in the X register.
LBL A starts displaying the collatz sequence for all numbers following on from the contents of register 1 and doesn't terminate.
LBL 2 is the even case for generating new Collatz sequence numbers.

The G and C flags are used to indicate the 3X+1 and X/2 cases respectively.

Code: Select all

DM16
04  f0000000000000  f0000000000020  02cf0000800000  eae00000000000
08  00000000000000  00000000000000  5c0080bc000000  00000000000000
f8  0000004a5c81cc  f1610a4c14cff2  c5024c15ccf1ce  f3c542ace9f2c6
fc  c6c5d4abf1aa0c  00000000000000  000000000004f8  000000000001fc
A: f0000000000000  B: 00000000000eae  C: eae00000000000
S: 00000000000000
M: 000000000004f8  N: 00000000000000  G: 02

Instructions, thank you pwarden42

Code: Select all

001 LBL C | 43 22 C
002 PSE | 43 34
003 1 | 1
004 x=y | 43 49
005 RTN | 43 21
006 Rv | 33
007 ENTER | 36
008 ENTER | 36
009 2 | 2
010 RMD | 42 9
011 x=0 | 43 40
012 GTO 2 | 22 2
013 Rv | 33
014 3 | 3
015 * | 20
016 1 | 1
017 + | 40
018 SF 5 | 43 4 5
019 GTO C | 22 C
020 LBL 2 | 43 22 2
021 Rv | 33
022 2 | 2
023 / | 10
024 SF 4 | 43 4 4
025 GTO C | 22 C
026 LBL A | 43 22 A
027 RCL 1 | 45 1
028 1 | 1
029 + | 40
030 STO 1 | 44 1
031 GSB C | 21 C
032 GTO A | 22 A
SwissMicros DM42, DM16L, HP 12c Platinum, Prime G2 CASIO fx-9750gii, fx-991ex classwiz, fx-CG50, TEXET fx1500, TI nspire CX II-T
Post Reply