Search found 615 matches

by Thomas Okken
Thu Jan 07, 2021 8:17 pm
Forum: Usage tips, tricks and problem reports
Topic: minor inconsistency
Replies: 9
Views: 477

Re: minor inconsistency

int docmd_pgmslvi(arg_struct *arg) { /* This command can only be invoked from a menu; we assume that * the menu handler only gives us valid arguments. We do check * the argument type, but the existence of the named label, and * whether it actually has MVAR instructions, we just assume. */ That assu...
by Thomas Okken
Sat Jan 02, 2021 12:32 am
Forum: DM42
Topic: Kind of "overflow" in integers
Replies: 16
Views: 672

Re: Kind of "overflow" in integers

can't free42 and DM42 go up to 128bits? Because 128bits is the nearest integer to 1e34 (in fact 112bits)... Bumping the maximum WSIZE up to 112 would require a significant amount of work because the current code for binary functions in Free42 makes heavy use of 64-bit integers. Since 128-bit intege...
by Thomas Okken
Wed Dec 30, 2020 11:33 pm
Forum: DM42
Topic: Word concept from Forth applicable in DM 42
Replies: 1
Views: 258

Re: Word concept from Forth applicable in DM 42

Calling a subroutine with XEQ is like executing a Forth word, except Forth really requires an unlimited stack, and the four-level stack of the DM42 and other "classic" RPN calculators is way too small for that style of programming. The RPL calculators by Hewlett-Packard are a better match ...
by Thomas Okken
Wed Dec 30, 2020 11:22 pm
Forum: DM42
Topic: Kind of "overflow" in integers
Replies: 16
Views: 672

Re: Kind of "overflow" in integers

The calculator does not keep track of whether numbers are exact or not, so making sure that your results (and all intermediates) are less than 1e34 is the only way to be sure.
by Thomas Okken
Fri Dec 18, 2020 5:07 pm
Forum: DM42
Topic: Merry Christmas to forum contributors
Replies: 15
Views: 894

Re: Merry Christmas to forum contributors

Happy Holidays!
by Thomas Okken
Fri Dec 18, 2020 12:17 pm
Forum: User Software Contributions
Topic: 18 - DOOR - 100 Doors
Replies: 3
Views: 252

Re: 18 - DOOR - 100 Doors

Hmm. That sounds like it doesn't require a program. Each door n is changed as many times as n has divisors, including 1 and itself. Since divisors come in pairs, d and n/d, numbers tend to have an even number of divisors, so the doors are closed as many times as they are opened, and at the end all d...
by Thomas Okken
Mon Dec 14, 2020 11:21 am
Forum: DM42
Topic: Program menu; key press remembered?
Replies: 5
Views: 396

Re: Program menu; key press remembered?

When I define menu keys in a program with KEYX or KEYG, are the key presses stored in a register? No. You can check whether or not Shift was pressed by testing flag 64, but for which key was pressed, the only information you have is which LBL was called. (The flag 64 thing is a DM42/Free42 feature....
by Thomas Okken
Sat Dec 05, 2020 10:42 am
Forum: Discuss!
Topic: Possibility for comment lines?
Replies: 10
Views: 819

Re: Possibility for comment lines?

Thanks all! I am currently waiting for my DM42, and of course I am looking for a method that works on both the DM41X and DM42. It looks like flag 14 would be a safe choice as well. I'd go with 52, not 14. Programs written for the HP-42S could conceivably use flag 14 since it has no special meaning ...
by Thomas Okken
Fri Dec 04, 2020 8:02 pm
Forum: Discuss!
Topic: Possibility for comment lines?
Replies: 10
Views: 819

Re: Possibility for comment lines?

I think that intelligible inline comments would consume so much space that 2 additional bytes for "FS? XX" are negligible . Flag 14 looks like a good candidate, as it will be cleared every time you switch on the calculator. To my knowledge it's not automatically set by any operation. And ...
by Thomas Okken
Wed Dec 02, 2020 11:17 pm
Forum: Usage tips, tricks and problem reports
Topic: .END. in XEQ menu
Replies: 10
Views: 757

Re: .END. in XEQ menu

If you want to prevent the .END. from taking up a space in your PGM catalog, just make sure you don't have an empty program at the end of program memory. Meaning: go to the next-to-last program, and delete its END. (I always do that, too. :) )