ALPHA Routines for the HP-41/42S
Back to main page If this is useful to you, Email me at: Genewright143@hotmail.com
These routines use only X-functions or built-in functions. No synthetics. All routines save at least X, Y, and Z of the stack except for M$, which saves only X and Y, and IC which saves X, Y, Z, and T. This first appeared in the PPC Journal V10N3p25 by Alan McCornack.
Routine    Function
AX         Alpha (leftmost) to X
XA         X to rightmost Alpha
AD         Alpha Delete characted number X
XC         Xth Character
IC         Insert Character (X=Char #, Y = Position)
SC         Substitute Character (X=Char #, Y=Position)
M$         Mid String (X=length, Y=starting position)
L$         Left String (Save left X characters)
R$         Right STring (Discard all but right X characters)

Step    Function
01      LBL "AX"
02      LBL 05
03      -1
04      AROT
05      CLX
06      ATOX
07      RTN
08      LBL "XA"
09      XTOA
10      -1
11      AROT
12      CLX
13      RDN
14      RTN
15      LBL "AD"
16      AROT
17      XEQ 05
18      RDN
19      CHS
20      AROT
21      CHS
22      1
23      AROT
24      CLX
25      RDN
26      RTN
27      LBL "XC"
28      AROT
29      XEQ 05
30      XTOA
31      X<>Y
32      CHS
33      AROT
34      CHS
35      X<>Y
36      RTN
37      LBL "IC"
38      X<>Y
39      AROT
40      -1
41      AROT
42      GTO 04
43      LBL "SC"
44      X<>Y
45      AROT
46      -1
47      AROT
48      RDN
49      ATOX
50      LBL 04
51      CLX
52      RDN
53      X<>Y
54      XTOA
55      X<>Y
56      CHS
57      AROT
58      CHS
59      X<>Y
60      RTN
61      LBL "M$"
62      X<>Y
63      ALENG
64      X<>Y
65      ST-Y
66      ISG Y
67      DEG
68      X<>Y
69      XEQ 06
70      RDN
71      X<>Y
72      LBL "L$"
73      AROT
74      LBL "R$"
75      LBL 06
76      ALENG
77      X<>Y
78      ST-Y
79      RDN
80      LBL 00
81      6
82      X>Y?
83      GTO 01
84      ASHF
85      ST-Y
86      RDN
87      GTO 00
88      LBL 01
89      RDN
90      LBL 02
91      X=0?
92      GTO 03
93      ATOX
94      CLX
95      RDN
96      DSE X
97      GTO 02
98      LBL 03
99      CLX
100     ALENG
101     END   

Visitors since 5/15/97