Post Reply 
Raw files for these HP 67 program listings ?
09-02-2016, 04:13 AM (This post was last modified: 09-02-2016 09:18 PM by RobertM.)
Post: #12
RE: Raw files for these HP 67 program listings ?
Here is my take(s) on Blackjack.
First, is the "direct" translation from the 67 program. This version requires the card reader (module) to run:
Code:

LBL "BJ67"
LBL A
RCL 08
ABS
STO 08
9
STO 25
CF 00
CF 01
XEQ 00
7ISZ            ;
STO IND 25
STO 00
STO 02
FS?C 22
SF 00
XEQ 00
STO 04
STO 06
FS?C 02
SF 01
XEQ 00
7ISZ            ;
STO IND 25
STO 01
ST+ 02
FS?C 02
SF 00
XEQ 00
STO 05
ST+ 06
FS?C 02
SF 01
RCL 06
FS? 01
XEQ 07
STO 07
X=Y?
SF 02
7DSP0            ;
RCL 00
PSE
RCL 01
PSE
RCL 02
7PRTX            ;
RCL 04
CHS
FS?C 02
FS?C 02
RTN
PSE
GTO C
LBL 00
10
RCL 24
PI
-
X^2
FRC
STO 24
13
*
INT
X=0?
SF 02
1
+
X>Y?
RDN
RTN
LBL B
XEQ 00
7ISZ            ;
STO IND 25
STO 00
ST+ 02
FS?C 02
SF 00
21
RCL 02
X>Y?
GTO 02
7DSP0            ;
RCL 00
PSE
LBL 01
RCL 02
7PRTX            ;
RTN
LBL 02
CHS
STO 07
RCL 00
CHS
STO 05
GTO 05
LBL C
RCL 02
FS? 00
XEQ 07
STO 03
LBL 03
RCL 06
FS? 01
XEQ 07
STO 07
17
X<=Y?
GTO 04
RCL 05
CHS
PSE
RCL 06
CHS
7PRTX            ;
XEQ 00
FS?C 02
SF 01
STO 05
RCL 06
+
STO 06
STO 07
22
X<=Y?
GTO 06
GTO 03
LBL 04
RCL 07
RCL 03
X=Y?
SF 02
X>Y?
GTO 06
LBL 05
RCL 08
CHS
STO 08
LBL 06
7DSP0            ;
RCL 05
CHS
PSE
RCL 07
CHS
7PRTX            ;
7DSP2            ;
RCL 08
FS?C 02
CLX
ST+ 09
RTN
LBL 07
21
X<>Y
10
+
X<=Y?
RTN
LASTX
-
RTN
LBL a
7DSP0            ;
9
X<> 25
STO 23
LBL 08
RCL 23
RCL 25
X=Y?
GTO 01
7ISZ            ;
RCL IND 25
PSE
GTO 08
LBL b
PI
+
STO 24
GTO b
LBL d
RCL 08
ABS
LBL D
7DSP2            ;
RND
LASTX
X!=Y?
GTO c
X<0?
GTO c
X=0?
GTO c
STO 08
RTN
LBL e
CLX
STO 09
LBL E
7DSP2            ;
RCL 09
RTN

And then a slightly modified version, that doesn't require the card reader module. Replaced 7ISZ with ISG, ENTER, and 7DSP with FIX, and 7PRTX with VIEW X, PSE, PSE, PSE, CLD.

Code:

LBL "BJ"
CF 00
CF 01
CF 02
SF 27        ; User Mode
FIX 0
"BLACKJACK"
PROMPT
LBL A
RCL 08
ABS
STO 08
9
STO 25
CF 00
CF 01
XEQ 00
ISG 25
ENTER            ; NOP
STO IND 25
STO 00
STO 02
FS?C 22
SF 00
XEQ 00
STO 04
STO 06
FS?C 02
SF 01
XEQ 00
ISG 25
ENTER            ; NOP
STO IND 25
STO 01
ST+ 02
FS?C 02
SF 00
XEQ 00
STO 05
ST+ 06
FS?C 02
SF 01
RCL 06
FS? 01
XEQ 07
STO 07
X=Y?
SF 02
FIX 0
RCL 00
PSE
RCL 01
PSE
RCL 02
VIEW X
PSE
PSE
PSE
CLD
RCL 04
CHS
FS?C 02
FS?C 02
RTN
PSE
GTO C
LBL 00
10
RCL 24
PI
-
X^2
FRC
STO 24
13
*
INT
X=0?
SF 02
1
+
X>Y?
RDN
RTN
LBL B
XEQ 00
ISG 25
ENTER            ; NOP
STO IND 25
STO 00
ST+ 02
FS?C 02
SF 00
21
RCL 02
X>Y?
GTO 02
FIX 0
RCL 00
PSE
LBL 01
RCL 02
VIEW X
PSE
PSE
PSE
CLD
RTN
LBL 02
CHS
STO 07
RCL 00
CHS
STO 05
GTO 05
LBL C
RCL 02
FS? 00
XEQ 07
STO 03
LBL 03
RCL 06
FS? 01
XEQ 07
STO 07
17
X<=Y?
GTO 04
RCL 05
CHS
PSE
RCL 06
CHS
VIEW X
PSE
PSE
PSE
CLD
XEQ 00
FS?C 02
SF 01
STO 05
RCL 06
+
STO 06
STO 07
22
X<=Y?
GTO 06
GTO 03
LBL 04
RCL 07
RCL 03
X=Y?
SF 02
X>Y?
GTO 06
LBL 05
RCL 08
CHS
STO 08
LBL 06
FIX 0
RCL 05
CHS
PSE
RCL 07
CHS
VIEW X
PSE
PSE
PSE
CLD
FIX 2
RCL 08
FS?C 02
CLX
ST+ 09
RTN
LBL 07
21
X<>Y
10
+
X<=Y?
RTN
LASTX
-
RTN
LBL a
FIX 0
9
X<> 25
STO 23
LBL 08
RCL 23
RCL 25
X=Y?
GTO 01
ISG 25
ENTER            ; NOP
RCL IND 25
PSE
GTO 08
LBL b
PI
+
STO 24
GTO b
LBL d
RCL 08
ABS
LBL D
FIX 2
RND
LASTX
X!=Y?
GTO c
X<0?
GTO c
X=0?
GTO c
STO 08
RTN
LBL e
CLX
STO 09
LBL E
FIX 2
RCL 09
RTN

Both give a similar "feel" to the 67 version.
Both RAW files are in the .zip.

Edit: just updated the zip to contain the text files with line numbers.


Attached File(s)
.zip  Blackjack.zip (Size: 2.88 KB / Downloads: 3)
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Raw files for these HP 67 program listings ? - RobertM - 09-02-2016 04:13 AM



User(s) browsing this thread: 1 Guest(s)