Posts: 15
Threads: 7
Joined: Jan 2011
Hi all, I was given this small program for the Emu41, by the creater of the Emu41 to read numbers from an ascii text file into the main memory of the Emu41.
34*LBL IMPORT
35 AUTOIO
36 "DOSLINK"
37 FINDID
38 SELECT
39 CLRDEV
40 0
41*LBL 04
42 INA
43 ALENG
44 X=0?
45 GTO 05
46 AVIEW
47 RDN
48 ANUM
49 STO IND Y
50 RDN
51 1
52 +
53 GTO 04
54*LBL 05
55 RTN
56 END
This program works real nice.
Does any one know how to change it to read the numbers from the ascii file directly into an extended memory file?
Thank you in advance.
Rich
Posts: 412
Threads: 40
Joined: Mar 2006
You have to replace the line 49 STO IND Y with SAVEX, and create the extended memory file before or at the beginning of IMPORT, with something like that:
"MYFILE"
50
CRFLD
0
SEEKPTA
Posts: 15
Threads: 7
Joined: Jan 2011
Thank you so much J-F for the help.
I have one more question for you please.
Is there a way to list the numbers in the extended memory data file with out putting them back into main memory?
Thanks
Rich
Posts: 412
Threads: 40
Joined: Mar 2006
Well, you can use the GETX function to get the numbers one by one in X register:
LBL VNUM (view numbers)
"MYFILE"
0
SEEKPTA
50 (for instance)
LBL 01
GETX
VIEW X
RDN
DSE X
GTO 01
Posts: 15
Threads: 7
Joined: Jan 2011
Thank you for the help.
I am writing a program to have my HP41cx with the help of my HP7470a plotter with the plotter module and my HP9114B disk drive to draw vector based maps of my state of Nevada. Things like the state boundary, the country boundaries, some of the major roads, and the major rivers and streams. The location of most of the cities and towns in Nevada. All the coordinates are in degrees of Latitude and Longitude. I just wanted to show what the little HP41cx can do in the field of Computer Mapping.
Thanks again for your help.
Rich
Posts: 1,253
Threads: 117
Joined: Nov 2005
Sounds like a nice project, make sure you post the maps when complete - I'm sure you'll enjoy the work.
Posts: 15
Threads: 7
Joined: Jan 2011
Thank you for your interest in the project. I have only had some experience in programing in 1977 Fortran. I must say I like programing the HP41cx. Some of my project data files are quite large. For example, highway I80 across northern Nevada has about 1,800 points to plot. I have to break it up into several files of 120 points. I also have to write the program in such a way that I use several subroutines in which I call them up and use them, then delete them form the main program to save memory.
Rich