HP Forums

Full Version: NQ41 Emulator program testing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
Reference URL's