HP41RS232

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 8

HP-41 // RS232 --------- RS232 // HP-41

Transfer of programs, data register blocks, data-files, matrix-files, ASCII-files


and NNN-blocks (Non Normalised Number) between two HP-41 handheld
computers by using two HP-IL/RS232 interfaces HP82164A.
Program needs IL-Module, EXT-I/O and CCD-Module (and optional the
ZENROM).
Create the needed data-, matrix-, ASCII- file with correct size on the receiving
HP41. Now enter the block number to X-Register or the file name to Alpha-
Register on both HP41. First start the receive routine on the receiving HP41.
Last start the send routine on the sending HP41.
Both HP-IL/RS232 interfaces HP82164A set to DTE mode (check the internal
jumper position). Below you find the needed wiring between the two HP82164A
interface devices :

Shield Shield
1 1 ???
2 2 transmitted data
3 3 received data
4 4 request to send
5 5 clear to send
6 6 data set ready
7 7 signal ground
8 8 carrier detect
20 20 data terminal ready

25 pin 25 pin
female female
connector connector

The actual HP41 software below includes the following limits : Data register
blocks and data-files containing numbers (like -12,34E-56) are transferred
correctly. Pure alpha text (like abcXYZ) are also transferred correctly. But alpha
text mixed with numbers (like ABC123) would be reduced to the number on the
receiving side. For transferring this correctly use the NNN transfer routines.
Furthermore the NNN transfer routines are able to transfer any possible byte
value from 000 up to 255 correctly. By using the ZENROM on the receiving
side you are able to speed up the transfer time for NNN´s. For ASCII file
transfer the record length is limited to 24 signs/characters, the maximally length
of the Alpha-Register.

HP-41 // RS232 --------- RS232 // HP-41


10:22 18.01.2006

01_LBL "SENDP" Send USER code program


02 XEQ 20 Asks for the program name
03 "PROG NAME ?"
04 AON
05 PROMPT
06 AOFF
07 OUTP
08 GTO 40
09 RTN

10_LBL "SENDR" Send Main Memory register block


11 XEQ 20 Start with
12_LBL 00 control number bbb.eee in X-Register :
13 CLA bbb = first register
14 ARCL IND X eee = last register
15 OUTA
16 ISG X
17 GTO 00
18 GTO 40
19 RTN

20_LBL "SENDF" Send X-Memory Datafile.


21 CLX Start with filename in Alpha-Register
22 SEEKPTA
23 XEQ 20
24_LBL 01
25 CLA
26 SF 25
27 GETX
28 FC? 25
29 GTO 40
30 ARCL X
31 OUTA
32 GTO 01
33 RTN

34_LBL "SENDM" Send CCD-Module Matrix file


35 1,001 Start with filename in Alpha-Register
36 IJ=A
37 XEQ 20
38_LBL 02
39 CLA
40 SF 25
41 C>+
42 FC? 25
43 GTO 40
44 ARCL X
45 OUTA
46 GTO 02
47 RTN

HP-41 // RS232 --------- RS232 // HP-41


48_LBL "SENDA" Send X-Memory ASCII-File
49 CLX Start with filename in Alpha-Register
50 SEEKPTA
51 XEQ 20
52_LBL 03
53 CLA
54 SF 25
55 GETREC
56 FC? 25
57 GTO 40
58 OUTA
59 GTO 03
60 RTN

61_LBL "SENDNNN" Send Main Memory NNN-Block


62 XEQ 20 Start with
63 ENTER^ control number bbb.eee in X-Register :
64 ENTER^ bbb = first register
65 512 eee = last register
66 SIZE?
67 -
68 STO Y
69 1000
70 /
71 +
72 +
73_LBL 04
74 CLA
75 PEEKR
76 DCD Decodes NNN to Alpha text stream
77 OUTA
78 PSE
79 PSE Wait cycle nearly identical to
80 PSE running time of CDE subroutine
81 PSE
82 PSE
83 PSE Program lines 78 to 85 are not needed
84 PSE when using the fast CODE command from
85 PSE ZENROM
86 RDN
87 ISG X
88 GTO 04
89 GTO 40
90 RTN

91_LBL "RECVP" Receive User code program


92 XEQ 30 No input needed
93 INP
94 GTO 40
95 RTN

HP-41 // RS232 --------- RS232 // HP-41


96_LBL "RECVR" Reveive Main Memory register block
97 XEQ 30 Start with
98_LBL 10 control number bbb.eee in X-Register :
99 CLA bbb = first register
100 INA eee = last register
101 ENTER^
102 CF 22
103 ANUM
104 FS? 22
105 STO IND Y
106 FC? 22
107 ASTO IND Y
108 RDN
109 ISG X
110 GTO 10
111 GTO 40
112 RTN

113_LBL "RECVF" Receive X-Memory Datafile


114 CLX Start with filename in Alpha Register
115 SEEKPTA
116 XEQ 30
117_LBL 11
118 CLA
119 INA
120 CF 22
121 ANUM
122 FS? 22
123 STO X
124 FC? 22
125 ASTO X
126 SF 25
127 SAVEX
128 FS? 25
129 GTO 11
130 GTO 40
131 RTN

132_LBL "RECVM" Receive CCD-Module Matrix file


133 1,001 Start with filename in Alpha-Register
134 IJ=A
135 XEQ 30
136_LBL 12
137 CLA
138 INA
139 CF 22
140 ANUM
141 FS? 22
142 STO X
143 FC? 22
144 ASTO X
145 SF 25

HP-41 // RS232 --------- RS232 // HP-41


146 >C+
147 FS? 25
148 GTO 12
149 GTO 40
150 RTN

151_LBL "RECVA" Receive X-Memory ASCII-File


152 CLFL Start with filename in Alpha-Register
153 XEQ 30
154_LBL 13
155 CLA
156 INA
157 ALENG
158 X=0? Test : Alpha-Register empty
159 GTO 40
160 SF 25
161 APPREC
162 FS? 25 Test : End Of File
163 GTO 13
164 GTO 40
165 RTN

166_LBL "RECVNNN" Receive Main Memory NNN-Block


167 XEQ 30 Start with
168 ENTER^ control number bbb.eee in X-Register :
169 ENTER^ bbb = first register
170 512 eee = last register
171 SIZE?
172 - Program version with CDE subroutine
173 STO Y from CCD-module manual
174 1000 needs data register 00
175 /
176 + Fast program version with
177 + CODE command from ZENROM :
178 STO 00 178_LBL 14
179_LBL 14 179 CLA
180 CLA 180 INA
181 INA 181 CODE
182 XEQ "CDE" 182 POKER
183 RCL 00 183 RDN
184 RCL M 184 ISG X
185 POKER 185 GTO 14
186 ISG 00 186 GTO 40
187 GTO 14 187 RTN
188 GTO 40 About incompatibility of CCD-Module
189 RTN and ZENROM refer to CCD-Module manual

HP-41 // RS232 --------- RS232 // HP-41


190_LBL 20 Initialisation of the
191 AUTOIO sending HP-IL/RS232 Interface
192 "HP82164A"
193 FINDID
194 SELECT
195 MANIO
196 CF 17
197 CLDEV
198 RDN
199 RTN

200_LBL 30 Initialisation of the


201 AUTOIO receiving HP-IL/RS232 Interface
202 "HP82164A"
203 FINDID
204 SELECT
205 MANIO
206 CF 17
207 CLRDEV
208 RDN
209 ENTER^
210 CLX
211 X<>FIO
212_LBL 31
213 STAT receive buffer contains data
214 2
215 ATOXX
216 X<>FIO
217 RDN
218 FC? 02
219 GTO 31
220 X<>FIO
221 RDN
222 RTN

223_LBL 40 End routine


224 AUTOIO
225 CLX
226 CLA
227 RTN

228_LBL "CDE" Subroutine from CCD-Module Manual :


229 CLX Codes Alpha text stream to NNN
230 WSIZE
231 6,5
232 SF 22 Instead CDE you can use the fast
233_LBL 50 CODE command from the ZENROM
234 5

HP-41 // RS232 --------- RS232 // HP-41


235 PEEKB
236 ABSP
237 X<>Y
238 RDN
239 57
240 -
241 X>0?
242 2
243 X<=0?
244 9
245 +
246 X<0?
247 CLX
248 FS?C 22
249 GTO 50
250 16
251 *
252 +
253 POKEB
254 SF 22
255 CLX
256 5,5
257 X<>Y
258 A-
259 X≠Y?
260 GTO 50
261 RCL M RCL ∙ M
262 END Program length = 594 Bytes

HP-41 // RS232 --------- RS232 // HP-41


01_LBL "IA" Utility software routine for
02 CLFL loading ASCII file with text
03_LBL 00 File name in Alpha-Register
04 CLA
05 "TEXT ?"
06 CF 23
07 AON
08 PROMPT
09 AOFF
10 FC? 23
11 RTN
12 SF 25
13 APPREC
14 FS? 25
15 GTO 00
16 RTN

17_LBL "OA" Utility software routine for


18 CLX displaying ASCII file contents
19 SEEKPTA File name in Alpha-Register
20 CLA
21_LBL 01
22 GETREC
23 AVIEW
24 PSE
25 CLA
26 GTO 01
27 END Program length = 55 Bytes

HP-41 // RS232 ---- RS232 // HP-41


software was programmed and tested by

Christoph Klug
Körnerstrasse 47B
31141 Hildesheim
Germany

© January 2006

HP-41 // RS232 --------- RS232 // HP-41

You might also like