HP Forums
NQ41 Emulator program testing - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: Not HP Calculators (/forum-7.html)
+--- Forum: Not quite HP Calculators - but related (/forum-8.html)
+--- Thread: NQ41 Emulator program testing (/thread-12453.html)



NQ41 Emulator program testing - Craig Bladow - 02-17-2019 09:28 PM

I'm developing tests for the next version of NQ41. These tests run on the HP-41C and then run on NQ41 to see that the operation is the same. I've included an example below. I'm interested in suggestions regarding other programs that would be useful for validating the emulator. NQ41's numerical precision is different from the 41's so demonstrating equivalence in this area is not necessary.


This code performs various GTOs and XEQs and leaves a "1" in the X register if successful.

Code:

LBL "LBLTEST"
0
GTO 01
LBL "CCC"
2
+
GTO IND X
LBL 01
1
+
GTO "CCC"
LBL 03
4
+
STO 01
GTO IND 01
LBL 07
8
+
XEQ "a"
XEQ IND X
XEQ IND 02
XEQ 13
255
X=Y?
GTO 99
0
STOP
LBL 99
1
STOP
LBL 13
128
+
RTN
LBL 31
12
STO 02
RDN
32
+
RTN
LBL "a"
16
+
RTN
LBL 12
64
+
RTN