program “SUN” on DM41

Forum for discussion of the DM10, DM11, DM12, DM15, DM16 and DM41 units
Post Reply
Wyatt_Irk
Posts: 39
Joined: Mon Jul 01, 2019 1:25 am
Location: Leander, Texas

program “SUN” on DM41

Post by Wyatt_Irk »

i’m experiencing difficulty running the “SUN” sunrise/sunset program on my DM41. it runs fine on my DM41X and DM42, but on the DM41, i get answers that are slightly more than two hours different for sunrise (07:24 for DM41X and DM42, 09:30 on the DM41), and less of an difference for sunset (19:18 for DM41X and DM42, 19:48 for the DM41). the results for the full-sized machines agree with published rise/set within a minute or so.

has anyone noticed a difference like this? i’ve verified the program listing line by line on all calculators, which includes lat (30.518267) and long (-97.925022).

i’ve reloaded DM41_32.hex on the DM41 and also tried entering the program by hand, with no difference in results. i *think* maybe it’s a difference in the time module but i’m guessing.

does anyone have any ideas?
🤘
DM41X, DM42, HP33c, DM41
in the past: HP34C, HP41CX, HP48GX, HP32S, HP42s
rprosperi
Posts: 1703
Joined: Mon Apr 24, 2017 7:48 pm
Location: New York

Re: program “SUN” on DM41

Post by rprosperi »

Wyatt_Irk wrote:
Fri Sep 30, 2022 11:05 pm
does anyone have any ideas?
Run both of them side-by-side, using SST to step your way through the programs, using the same inputs, and you will quickly find the source of the problem when you see the interim results differ. While it's not impossible that the cause is the RTC in the 2 units, it's much more likely that it's a difference in the program code.
--bob p

DM42: β00071 & 00282, DM41X: β00071 & 00656, DM10L: 071/100
Wyatt_Irk
Posts: 39
Joined: Mon Jul 01, 2019 1:25 am
Location: Leander, Texas

Re: program “SUN” on DM41

Post by Wyatt_Irk »

Okay, I stepped through the program on 3 machines: i41CX+, a DM41X (sn 01143) and a DM41 (can’t locate the sn). The first time by pairs confirming each step is the same - the DM41 and i41CX+, then the DM41 and the DM41X. All three machines show the same steps.

I then went through stepwise execution by pairs, the iCX41+ and DM41, them the DM41X and the DM41. When the step “XEQ D” was stepped through on each machine, the i41CX+ and the DM41X showed “186 LBL D” but the DM41 showed “169 LBL D”.

In the program listing on all three machines, “LBL D” is at line 169.

I don’t understand why the DM41 shows the correct line number for LBL D when executing the program stepwise (in the program listing LCL D is at line 169 on all three machines). But when executing the program stepwise on the iCX41+ and the DM41X both show “186 LBL D”, but the line number for LBL D is 169 in the program listing.

Results from the iCX41+ and DM41X agree with published values for sunrise and sunset, even though the line numbers during execution appear incorrect but those for the DM41 are off as described in my previous text.

I would submit screen shots but haven’t figured out how to submit those to the forum message. I hope this isn’t too confusing - it is to me.
🤘
DM41X, DM42, HP33c, DM41
in the past: HP34C, HP41CX, HP48GX, HP32S, HP42s
dlachieze
Posts: 613
Joined: Thu May 04, 2017 12:20 pm
Location: France

Re: program “SUN” on DM41

Post by dlachieze »

It seems that you have two labels D in the iCX41 and DM41X, one at line 169 and one at line 186.

Are you using the program "SUN" published here?
Where in the program do you have the "XEQ D" step?
DM42: 00425 - DM41X: β00066 - WP43: 00042
Wyatt_Irk
Posts: 39
Joined: Mon Jul 01, 2019 1:25 am
Location: Leander, Texas

Re: program “SUN” on DM41

Post by Wyatt_Irk »

I did - mistakenly on all three machines - and I’m very thankful for you for calling that to my attention. I had added the “DOY” subroutine as “LBL D”, attempting to merge “DOY” into “SUN” into one program, but forgot about the original “LBL D”. I also added a subroutine “LBL F” to merge “FLOOR” into “SUN” for the same reason. My mistake. I have corrected both and “SUN” now works as it should on all three. Thank you very much for your help.

But I still have part of the same question - why did it branch differently on the DM41, going to the correct “LBL D” on line 169, but both the DM41X and CX41+ both passed by the “LBL D” on line 169 and executed the one at line 186? There is something different about how the machines search for labels, but since the DM41 uses original ROMs from the HP41CX that one searched correctly. Of course, it works in all three when there aren’t duplicate labels for subroutines, …, but it is curious.

With everyone’s help I learned several things. I still have lots to learn as I become reacquainted with the 41 in all it’s reincarnated forms, after a 35-year hiatus. I’m sorry for any pain I’ve caused to everyone who helped, but I’m very grateful.
🤘
DM41X, DM42, HP33c, DM41
in the past: HP34C, HP41CX, HP48GX, HP32S, HP42s
toml_12953
Posts: 795
Joined: Wed May 03, 2017 7:46 pm
Location: Malone, NY USA

Re: program “SUN” on DM41

Post by toml_12953 »

Wyatt_Irk wrote:
Sat Oct 01, 2022 5:12 pm
But I still have part of the same question - why did it branch differently on the DM41, going to the correct “LBL D” on line 169, but both the DM41X and CX41+ both passed by the “LBL D” on line 169 and executed the one at line 186? There is something different about how the machines search for labels, but since the DM41 uses original ROMs from the HP41CX that one searched correctly. Of course, it works in all three when there aren’t duplicate labels for subroutines, …, but it is curious.
Just a guess: Some calculators search from the current program counter to the end and wrap around to 000 if necessary. They would find the first matching label after the current position or the first occurance in the program if there was no later occurrence. Some start the search from location 000 onward. They'd find the first occurrence in the program even if there were matching labels after the current position.

If all calculators are using the same ROM image, though, the above does not apply.
Tom L

Some people call me inept but I'm as ept as anybody!
DM10L SN: 059/100
DM41X SN: 00023 (Beta)
DM41X SN: 00506 (Shipping)
DM42 SN: 00025 (Beta)
DM42 SN: 00221 (Shipping)
WP43 SN: 00025 (Prototype)
rprosperi
Posts: 1703
Joined: Mon Apr 24, 2017 7:48 pm
Location: New York

Re: program “SUN” on DM41

Post by rprosperi »

No need to apologize, no pain induced, these are just simple mistakes, which are not uncommon when re-immersing oneself into a complex machine, and the 41C's ability to use the same label more than once can lead to such confusion. Keep going, bury yourself deep and don't worry about asking questions.

Also, I think all the 41 systems you mentioned use original 41 ROMs, but am unsure about iCX41+. The looping is probably the same, you're probably just catching it at different places while stepping/debugging.
--bob p

DM42: β00071 & 00282, DM41X: β00071 & 00656, DM10L: 071/100
Post Reply