DM42/DM15L - best and fastest way to display x during program ?

Discussion around the SwissMicros DM42 calculator
Post Reply
User avatar
OlidaBel
Posts: 58
Joined: Thu Mar 11, 2021 8:52 am
Location: Belgium

DM42/DM15L - best and fastest way to display x during program ?

Post by OlidaBel »

hi,
what is your prefered way to display the content of x register during a program ?
I'd like to see a serie converging to a certain value, live !
By default DM42 is showing the entire stack, its fast movements are not easy to read ;-)
thanks,

PS: I want to see the same behaviour on the DM15L, but here I only know the PSE command, which pauses for 1 sec, this is a bit too long.
Last edited by OlidaBel on Sun Jun 27, 2021 9:16 pm, edited 3 times in total.
---
Olivier
48GX, Prime G2, 50G, DM15L, DM42, 28S, HP 15c CE
Peet
Posts: 257
Joined: Tue Sep 29, 2020 12:01 am
Location: Germany

Re: DM42 - best and fastest way to display x during program ?

Post by Peet »

VIEW ST X
(PSE)
My programmable calculators - former: CBM PR100, HP41CV, HP28S, HP11C - current: HP48G(256kB), HP35S, Prime, DM41X, DM42
User avatar
OlidaBel
Posts: 58
Joined: Thu Mar 11, 2021 8:52 am
Location: Belgium

Re: DM42 - best and fastest way to display x during program ?

Post by OlidaBel »

Peet wrote:
Fri Jun 25, 2021 4:10 pm
VIEW ST X
(PSE)
yes, thanks ! it's a pity we can't define the time it pauses. I saw an fast example on Youtube, I'll come back with this solution I hope ;-)
---
Olivier
48GX, Prime G2, 50G, DM15L, DM42, 28S, HP 15c CE
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: DM42 - best and fastest way to display x during program ?

Post by Thomas Okken »

It's not very elegant, but you could use something like this to implement short delays:

Code: Select all

00 { 33-Byte Prgm }
01▸LBL "WAIT"
02 FUNC 00
03 DUP
04 3600
05 ÷
06 →HMS
07 TIME
08 HMS+
09▸LBL 00
10 TIME
11 X≥Y?
12 RTN
13 DROP
14 GTO 00
15 END
Pur the desired delay, in seconds, in X, and call XEQ "WAIT". The TIME function has a resolution of 10 ms so that's the shortest delay you can accomplish in this manner.

The FUNC 00 DUP at the start is to make sure the stack and LASTx are left unchanged. The code works in 4STK and NSTK modes.
User avatar
OlidaBel
Posts: 58
Joined: Thu Mar 11, 2021 8:52 am
Location: Belgium

Re: DM42/DM15L - best and fastest way to display x during program ?

Post by OlidaBel »

I wrote a simple converging to ln(2) serie program with a pause (PSE) every x (R0) iterations.
Too much PSE is slow, now it's what I want.
A good exercice to play with I register, Χ↔ and DSE, many years later after my 15C (owned by my parents, they don't want to give it to me :D ).
Not sure if I used DSE in the past though ;-)

Image

Code: Select all

# ------------------------------------------------------------------------------
# HEWLETT·PACKARD 15C Simulator program
# Created with version 4.3.00
# ------------------------------------------------------------------------------
#T:Serie converging to Ln(2), a pause every 10 iterations
#D:GSB A
#D:-Change delay between pauses (PSE) on lines 002 and 003
#D:-One iteration sum 1 negative term and 1 positive term.
#D:-Ln(2) = serie(1-1/2+1/3-1/4+1/5-1/6 etc)
#D:-nothing required on the stack before starting.
#D:
#L-1:program start
#L1:start iteration with a PSE counter reset
#L2:start iteration
#R0:nbr of iterations between PSE
#RI:counts iterations
# ------------------------------------------------------------------------------

   000 {             } 
   001 {    42 21 11 } f LBL A
   002 {           9 } 9
   003 {           0 } 0
   004 {       44  0 } STO 0
   005 {           1 } 1
   006 {          36 } ENTER
   007 {    42 21  1 } f LBL 1
   008 {    42  4  0 } f Χ↔ 0
   009 {       44 25 } STO I
   010 {    42  4  0 } f Χ↔ 0
   011 {    42 21  2 } f LBL 2
   012 {           1 } 1
   013 {          40 } +
   014 {          36 } ENTER
   015 {          33 } R⬇
   016 {          15 } 1/x
   017 {          30 } −
   018 {       43 33 } g R⬆
   019 {           1 } 1
   020 {          40 } +
   021 {          36 } ENTER
   022 {          33 } R⬇
   023 {          15 } 1/x
   024 {          40 } +
   025 {       43 33 } g R⬆
   026 {    42  5 25 } f DSE I
   027 {       22  2 } GTO 2
   028 {          33 } R⬇
   029 {       42 31 } f PSE
   030 {       43 33 } g R⬆
   031 {       22  1 } GTO 1

# ------------------------------------------------------------------------------
Last edited by OlidaBel on Sun Jun 27, 2021 10:41 pm, edited 5 times in total.
---
Olivier
48GX, Prime G2, 50G, DM15L, DM42, 28S, HP 15c CE
User avatar
OlidaBel
Posts: 58
Joined: Thu Mar 11, 2021 8:52 am
Location: Belgium

Re: DM42 - best and fastest way to display x during program ?

Post by OlidaBel »

Thomas Okken wrote:
Fri Jun 25, 2021 5:12 pm
It's not very elegant, but you could use something like this to implement short delays:

Code: Select all

00 { 33-Byte Prgm }
01▸LBL "WAIT"
02 FUNC 00
03 DUP
04 3600
05 ÷
06 →HMS
07 TIME
08 HMS+
09▸LBL 00
10 TIME
11 X≥Y?
12 RTN
13 DROP
14 GTO 00
15 END
Pur the desired delay, in seconds, in X, and call XEQ "WAIT". The TIME function has a resolution of 10 ms so that's the shortest delay you can accomplish in this manner.

The FUNC 00 DUP at the start is to make sure the stack and LASTx are left unchanged. The code works in 4STK and NSTK modes.
thanks Thomas.
I see it uses special functions for the stack, I couldn't immediately figure out how it works and why I couldn't find these functions in the menu :lol: .
Alone, this pause works well. Called by my program, it does pause once, then my program stop, it was not expected, I don't see how to fix it (yet!) :)
---
Olivier
48GX, Prime G2, 50G, DM15L, DM42, 28S, HP 15c CE
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: DM42/DM15L - best and fastest way to display x during program ?

Post by Thomas Okken »

If you don't need the WAIT program to work in big stack mode, you can change the DUP to RCL ST X and the DROP to R↓.

It shouldn't just stop, though. If you post your complete program, or email it to me, I could take a look at it.
Post Reply