Page 1 of 1

Benchmark Testing Program

Posted: Fri Oct 26, 2018 10:08 pm
by nmihiylov
Is there a benchmark testing program or calculation available that I could use to run my DM42 through its' paces so I can see just how amazing this machine runs?

Re: Benchmark Testing Program

Posted: Wed May 20, 2020 1:38 am
by Stu_In_VA
[Moderator note: code placed in "code" tags]

Here's a trivial program that will run a subroutine using the value in the X register as an iteration count. I put some random instructions in the called subroutine to test but you should replace them with any instructions or procedures you're interested in timing. Set flag 00 to execute your test routine. Clear flag 00 to simply loop per the initial value in the X register. When the program stops, the stack will contain:
T: - Start Time
Z: - End Time
Y: - Elapsed Time
X:- Initial Loop Count Value

Code: Select all

00 { 74-Byte Prgm }
01 LBL "BNCHMRK"
02 STO 00		Store iteration count for DSE
03 FIX 04		for display
04 STO 02		save iteration count
05 CLST			housekeep
06 ×
07 CLA
08 TIME			capture start time
09 STO 01		save it
10 ATIME24		to alpha for start time display
11 |-"--"		format alpha reg
12 LBL 01		Loop Top
13 FS? 00			test flag 00 to execute code or jump around
14 XEQ 99			Execute routine of your choice
15 DSE 00		decrement loop count
16 GTO 01		not zero, loop back
17 TIME			done, capture end time
18 ATIME24		to alpha for end time display
19 STO 03		save it
20 RCL 01		start time	
21 HMS-			end time - start time = elapsed time
22 FIX 06		for display 
23 RCL 01		Build stack for end display
24 X<>Y				x=initial loop count
25 RCL 03			y=elapsed time (h.mmsshh) hours, minutes,seconds, hundredths
26 X<>Y				z=end time
27 RCL 02			t=start time
28 AVIEW		display start and stop times
29 STOP			stop
30 GTO "BNCHMRK"	r/s to repeat test
31 LBL 99		dummy subroutine containing instructions to benchmark
32 CLST				insert anything to time
33 30				'
34 SIN				'
35 SQRT				'
36 LOG				'
37 ABS				'
38 LN				'
39 RTN			Exit dummy routine
40 END