Post Reply 
HMS-> & ->HMS Prog. for 12C
01-11-2018, 04:46 AM
Post: #5
RE: HMS-> & ->HMS Prog. for 12C
(01-10-2018 10:37 AM)Dieter Wrote:  The following program adapts Werner's 42s implementation.

Code:
01 ENTER
02 CLX
03 x<>y
04 x<=y?
05 GTO 23
06 ENTER
07 FRAC
08 ,
09 4
10 x
11 -
12 EEX
13 4
14 %
15 FRAC
16 2
17 5
18 0
19 /
20 -
21 CHS
22 GTO 00
23 CHS
24 ENTER
25 INTG
26 ,
27 4
28 *
29 -
30 EEX
31 2
32 *
33 ENTER
34 INTG
35 ,
36 4
37 *
38 -
39 3
40 6
41 /
42 GTO 00

Rule: values in hh.mmss format are entered and returned with negative sign.

I LOVE this program simply because I don't have to switch program lines to convert from HH.MMSS to decimal and vice versa. It's pretty cool. I'll end up using this program. The formulas it uses is also unique and fun.

But I'm still going to keep and work on my own HMS programs. I made the suggested changes and that's so cool because now the program takes up one less register. I also tried to make some more amends but to no avail.

HMS to decimal program V3.
Code:

01  g INTG
02  g LSTX
03  g FRAC
04  EEX
05  2
06  x
07  g INTG
08  g LSTX
09  g FRAC
10  [ . ]
11  6
12  /
13  +
14  6
15  0
16  /
17  +

And the decimal to HMS program V3

Code:

01  g INTG
02  g LSTX
03  g FRAC
04  6
05  0
06  x
07  g FRAC
08  g LSTX
09  g INTG
10  EEX
11  2
12  /
13  SWAP
14  [ . ]
15  0
16  0
17  6
18  x
19  +
20  +

Examples Gamo? No problem. I'll use the driving times I collected today...

Example #1: Carsen's takes a trip to his job. He times himself on how fast he gets to his job and back home. Trip #1 is his venture to his job and trip #2 is his drive back home. Convert the times Carsen collected on both of his trips from HH.MMSS to decimal format. Then figure out his total time he spent getting back and forth from his job that day. Assume that the HMS to decimal prog. is entered into the 12C first. Then the decimal to HMS prog. is entered second. Thus decimal to HMS prog. starts on line #19.
Trip #1: 0 hr 55 min & 53 sec
0.5553 [R/S] ---> 0.931388889 [STO] [+] 1
Trip #2: 0 hr 53 min & 00 sec
0.53 [R/S] ---> 0.883333333 [STO] [+]. Then...
[RCL] 1 ---> 1.814722222. Finally...
[GTO] 19 [R/S] ---> 1.4853 which is 1 hr 48 min & 53 sec.

Sweet! I'm in the club!
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HMS-> & ->HMS Prog. for 12C - Carsen - 01-10-2018, 05:18 AM
RE: HMS-> & ->HMS Prog. for 12C - Carsen - 01-10-2018, 05:22 AM
RE: HMS-> & ->HMS Prog. for 12C - Gamo - 01-10-2018, 06:49 AM
RE: HMS-> & ->HMS Prog. for 12C - Dieter - 01-10-2018, 10:37 AM
RE: HMS-> & ->HMS Prog. for 12C - Carsen - 01-11-2018 04:46 AM
RE: HMS-> & ->HMS Prog. for 12C - Pekis - 01-11-2018, 06:08 AM
RE: HMS-> & ->HMS Prog. for 12C - Dieter - 01-11-2018, 07:03 PM
RE: HMS-> & ->HMS Prog. for 12C - Pekis - 01-11-2018, 09:22 PM
RE: HMS-> & ->HMS Prog. for 12C - Dieter - 01-12-2018, 09:13 AM
RE: HMS-> & ->HMS Prog. for 12C - Carsen - 01-13-2018, 01:26 AM
RE: HMS-> & ->HMS Prog. for 12C - Pekis - 01-12-2018, 12:36 PM
RE: HMS-> & ->HMS Prog. for 12C - Dieter - 01-12-2018, 12:50 PM



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