1 Converting HP-41 Programs to PDF ❖ Dr. Jackie F. Woldering (2864) – Euclid, OH. ❖ How to...

20
1 Converting HP-41 Programs to PDF Dr. Jackie F. Woldering (2864) – Euclid, OH. How to preserve PPC Journals (1974-1987)? Jake Schwartz had already scanned PPCJ. DVD also contains thousands of other pages. Scanned journals are OK for articles/pictures. Scanned programs and bar codes not legible. What is the best way to save programs & BC? How can this be presented in a useful format? HHC 2012

Transcript of 1 Converting HP-41 Programs to PDF ❖ Dr. Jackie F. Woldering (2864) – Euclid, OH. ❖ How to...

Page 1: 1 Converting HP-41 Programs to PDF ❖ Dr. Jackie F. Woldering (2864) – Euclid, OH. ❖ How to preserve PPC Journals (1974-1987)? ❖ Jake Schwartz had already.

1

Converting HP-41 Programs to PDF

❖ Dr. Jackie F. Woldering (2864) – Euclid, OH.❖ How to preserve PPC Journals (1974-1987)?❖ Jake Schwartz had already scanned PPCJ.❖ DVD also contains thousands of other pages.❖ Scanned journals are OK for articles/pictures.❖ Scanned programs and bar codes not legible.❖ What is the best way to save programs & BC?❖ How can this be presented in a useful format?

HHC 2012

Page 2: 1 Converting HP-41 Programs to PDF ❖ Dr. Jackie F. Woldering (2864) – Euclid, OH. ❖ How to preserve PPC Journals (1974-1987)? ❖ Jake Schwartz had already.

2

Reproducing PPC Journal Bar Code

❖ Program Bar Code❖ Hi-Resolution scan?❖ Inconsistent/unreliable.❖ MS Paint – too slow!❖ Scan and reproduce?❖ Limited to Journal BC.❖ BC printing program?❖ Advanced techniques!

❖ “Create your own BC”❖ Single/double width.❖ Single width spacing.❖ Single/single to start.❖ Double/single to stop.❖ Binary groups of four.❖ Calculate checksums.❖ Line labeling/spacing.

HHC 2012

Page 3: 1 Converting HP-41 Programs to PDF ❖ Dr. Jackie F. Woldering (2864) – Euclid, OH. ❖ How to preserve PPC Journals (1974-1987)? ❖ Jake Schwartz had already.

3

Transferring between HP-41 and PC

❖ Programs reside in HP-41C. How to transfer?❖ HP-41C/CV/CX & HP-82153A Wand for input.❖ HP-82160A HP-IL Module necessary for I/O.❖ HP-82164A HP-IL/RS232 Serial Interface.❖ Netbook computer with USB or serial interface.❖ USB to Serial Interface and appropriate drivers.❖ Windows Hyper Terminal (hypertrm) program.❖ HP-82183A Extended I/O Module INP/OUTP.

HHC 2012

Page 4: 1 Converting HP-41 Programs to PDF ❖ Dr. Jackie F. Woldering (2864) – Euclid, OH. ❖ How to preserve PPC Journals (1974-1987)? ❖ Jake Schwartz had already.

4

Software for Bar Code Production

❖ “Creating Your Own HP-41 Bar Code” HP 1981.❖ PRGMBR (pp 17-31) ~825 lines of BASIC code.❖ Converting to C/C++/Java would be difficult.❖ Fig. 1, page 8 shows Program Type Bar Code.❖ 8-bit Checksum, 4-bit Type Indicator (1 or 2).❖ 4-bit Row Sequence Number (Modulo 16).❖ 4-bit Count of Leading Broken Function Bytes.❖ 4-bit Count of Trailing Broken Function Bytes.

HHC 2012

Page 5: 1 Converting HP-41 Programs to PDF ❖ Dr. Jackie F. Woldering (2864) – Euclid, OH. ❖ How to preserve PPC Journals (1974-1987)? ❖ Jake Schwartz had already.

5

Bar Code Headers and Trailers

❖ 24 Bits = 3 Bytes of Header Information / Line.❖ Up to 13 Bytes of Program Information / Line.❖ Fig. 6, page 13 shows Bar Code Configuration.❖ Single and double width bar codes = 0 and 1.❖ Single width spaces placed between each bar.❖ Start bars = two single width (0-0) bars.❖ Stop bars = one double, one single width (1-0).❖ Maximum of 16 bytes in any one bar code row.

HHC 2012

Page 6: 1 Converting HP-41 Programs to PDF ❖ Dr. Jackie F. Woldering (2864) – Euclid, OH. ❖ How to preserve PPC Journals (1974-1987)? ❖ Jake Schwartz had already.

6

Program Bar Code Header Bytes

❖ Algorithm on page 43 used to find checksum.❖ Row checksum: 8-bit running end-around carry.❖ Algorithm on page 49 used to compute header.❖ Seq. Number = (Row Number – 1) Mod 16.❖ Leading Broken Function Code Bytes and❖ Trailing Broken Function Code Bytes counted.❖ Everything necessary for program bar code.❖ OUTP performs program to hex translation.

HHC 2012

Page 7: 1 Converting HP-41 Programs to PDF ❖ Dr. Jackie F. Woldering (2864) – Euclid, OH. ❖ How to preserve PPC Journals (1974-1987)? ❖ Jake Schwartz had already.

7

Searching for a Bar Code Program

❖ Perhaps it was best not to “reinvent the wheel”!❖ Was there already a bar code program online?❖ Warren Furlow's www.hp41.org site had one!❖ Leo Duran's HP41UC fulfilled the requirements.❖ HP41UC converts between user code formats.❖ HP41UC compiles and decompiles user code.❖ Generates multiline, labeled program bar code.❖ As Mario said, “Woohoo! Just what I needed!”

HHC 2012

Page 8: 1 Converting HP-41 Programs to PDF ❖ Dr. Jackie F. Woldering (2864) – Euclid, OH. ❖ How to preserve PPC Journals (1974-1987)? ❖ Jake Schwartz had already.

8

Three HP41UC File Formats

❖ /T = Text Format❖ Type in a program.❖ Watch for angle sign,

sigma, not equal sign.❖ Some XROM XX,YY

must be entered.❖ Line numbers are not

needed, will be added later by HP41UC.

❖ /R = RAW format.❖ Binary form stored in

the HP-41C/CV/CX, or in V41 emulator.

❖ /D = DAT format.❖ DAT is hex translation

of RAW file plus byte count and checksum.

❖ DAT same as OUTP.

HHC 2012

Page 9: 1 Converting HP-41 Programs to PDF ❖ Dr. Jackie F. Woldering (2864) – Euclid, OH. ❖ How to preserve PPC Journals (1974-1987)? ❖ Jake Schwartz had already.

9

Two HP41UC Bar Code File Formats

❖ /H = Hewlett-Packard PCL format bar code file.❖ /S = Postscript format bar code output files.❖ PCL files large, unreadable, difficult to modify.❖ PS files smaller, easy to add program code/text.❖ With HP41UC, programs scanned, stored as DAT

format, printed as clean PS bar code files.❖ Programs may also be typed in directly, saved as

TXT, converted to RAW, DAT and PS files, for use by HP41C calculators and emulators.

HHC 2012

Page 10: 1 Converting HP-41 Programs to PDF ❖ Dr. Jackie F. Woldering (2864) – Euclid, OH. ❖ How to preserve PPC Journals (1974-1987)? ❖ Jake Schwartz had already.

10

Final Output File Format 1

❖ Next question: What should be output format?❖ Readability and usability are most important.❖ HP41UC /K produces smaller TXT -> RAW file.❖ HP41UC /N adds line numbers RAW -> TXT.❖ Separate RAW, DAT, PS bar code is useful, but not

convenient to store in 3 different formats.❖ Adjustments would have to be made to three

different files if mistakes or NOPs found later.

HHC 2012

Page 11: 1 Converting HP-41 Programs to PDF ❖ Dr. Jackie F. Woldering (2864) – Euclid, OH. ❖ How to preserve PPC Journals (1974-1987)? ❖ Jake Schwartz had already.

11

Final Output File Format 2

❖ Word Document or PDF could contain text and bar code, but not direct execution RAW code.

❖ PDF Creator from www.sourceforge.net expects program input in Postscript format. That works!

❖ Printed DAT hexadecimal code is a reasonable substitute for RAW format. Can be copied and pasted into Notepad, converted to a RAW file.

❖ Time to learn more about how to integrate text and hex into a Postscript formatted document!

HHC 2012

Page 12: 1 Converting HP-41 Programs to PDF ❖ Dr. Jackie F. Woldering (2864) – Euclid, OH. ❖ How to preserve PPC Journals (1974-1987)? ❖ Jake Schwartz had already.

12

Mechanics of Postscript 1

❖ PS pages have line numbers and fonts at top.❖ %%Page: 1 1 ❖ /Helvetica findfont 14 scalefont setfont❖ Text lines: position moveto ( TEXT ) show❖ 86.00 748.00 moveto (HP-41C Line) show❖ Pages have ending information at bottom.❖ showpage❖ %%PageTrailer

HHC 2012

Page 13: 1 Converting HP-41 Programs to PDF ❖ Dr. Jackie F. Woldering (2864) – Euclid, OH. ❖ How to preserve PPC Journals (1974-1987)? ❖ Jake Schwartz had already.

13

Mechanics of Postscript 2

❖ Each 8-1/2” x 11” Postscript page can have about 70 lines of 10-point Courier font text.

❖ %%Creator, %%DocumentPaperSizes, gsave, located at top of document to begin printing.

❖ Vertical 740.00 at top to 50.00 at bottom and horizontal 50.00 produces 1/2” margins.

❖ grestore %%Trailer %%Pages: XX %%EOF (4 lines at end of document to finish).

HHC 2012

Page 14: 1 Converting HP-41 Programs to PDF ❖ Dr. Jackie F. Woldering (2864) – Euclid, OH. ❖ How to preserve PPC Journals (1974-1987)? ❖ Jake Schwartz had already.

14

Spreadsheet to Convert TXT to PS

-----------------------COLUMN A-------------------- ---COLUMN B--- --COL C-- --------------------COLUMN D-----------------------%!PS-Adobe-2.0 %!PS-Adobe-2.0%%Creator: Dr. Jackie F. Woldering %%Creator: Dr. Jackie F. Woldering

%%DocumentPaperSizes: letter%%Pages: (atend)%%PageOrder: Ascend%%EndComments

%%BeginProlog%%EndProlog

gsave%%Page: 1 1 %%Page: 1 1

/Courier-Bold findfont 10 scalefont setfontLine 1 ) show 50.00 740.00 moveto (Line 1) showLine 2 ) show 50.00 730.00 moveto (Line 2) show

) show 50.00 720.00 moveto () show) show 50.00 710.00 moveto () show

-----------------------COLUMN A-------------------- ---COLUMN B--- --COL C-- --------------------COLUMN D-----------------------) show 50.00 70.00 moveto () show

Line 69 ) show 50.00 60.00 moveto (Line 69) showLine 70 ) show 50.00 50.00 moveto (Line 70) show

showpage%%PageTrailergrestore

%%Trailer %%Trailer%%Pages: 4 %%Pages: 4%%EOF %%EOF

%%DocumentPaperSizes: letter%%Pages: (atend)%%PageOrder: Ascend%%EndComments

%%BeginProlog%%EndProlog

gsave

/Courier-Bold findfont 10 scalefont setfont50.00 740.00 moveto (50.00 730.00 moveto (50.00 720.00 moveto (50.00 710.00 moveto (

50.00 70.00 moveto (50.00 60.00 moveto (50.00 50.00 moveto (showpage%%PageTrailergrestore

HHC 2012

Page 15: 1 Converting HP-41 Programs to PDF ❖ Dr. Jackie F. Woldering (2864) – Euclid, OH. ❖ How to preserve PPC Journals (1974-1987)? ❖ Jake Schwartz had already.

15

Header, Program, DAT, Byte Count

HP-41C Normal Function Program by Richard NelsonPPC Journal Volume 6 Number 4 Page 16 July, 1979

01 LBL "NORMAL" ;Standard Normal Distribution Curve02 X^203 -.504 *05 E^X06 207 PI08 *09 SQRT10 1/X11 *12 RTN13 END

001AC000F7004E4F524D414C511C1A15425512724252604285C0000DD9

26 BYTES

HHC 2012

Page 16: 1 Converting HP-41 Programs to PDF ❖ Dr. Jackie F. Woldering (2864) – Euclid, OH. ❖ How to preserve PPC Journals (1974-1987)? ❖ Jake Schwartz had already.

16

Spreadsheet to Relocate Bar Code

Original 796.20 <<NEW Original 450.00 <<NEW748.00 748.00 14 PT HDR 748.00 401.80 14 PT HDR720.80 720.80 720.80 374.60709.80 709.80 12 PT REGS 709.80 363.60 12 PT REGS682.60 682.60 682.60 336.40671.60 671.60 8 PT Row 1 671.60 325.40 8 PT Row 1644.40 644.40 644.40 298.20

16#XX Barcode 1 16#XX Barcode 1633.40 633.40 8 PT Row 2 633.40 287.20 8 PT Row 2606.20 606.20 606.20 260.00

16#XX Barcode 2 16#XX Barcode 2595.20 595.20 8 PT Row 3 595.20 249.00 8 PT Row 3568.00 568.00 568.00 221.80

16#XX Barcode 3 16#XX Barcode 3557.00 557.00 8 PT Row 4 557.00 210.80 8 PT Row 4529.80 529.80 529.80 183.60

16#XX Barcode 4 16#XX Barcode 4518.80 518.80 8 PT Row 5 518.80 172.60 8 PT Row 5491.60 491.60 491.60 145.40

16#XX Barcode 5 16#XX Barcode 5480.60 480.60 8 PT Row 6 480.60 134.40 8 PT Row 6453.40 453.40 453.40 107.20

16#XX Barcode 6 16#XX Barcode 6442.40 442.40 8 PT Row 7 442.40 96.20 8 PT Row 7415.20 415.20 415.20 69.00

16#XX Barcode 7 16#XX Barcode 7

/ps_top /ps_top

/ps_top /ps_top

/ps_top /ps_top

/ps_top /ps_top

/ps_top /ps_top

/ps_top /ps_top

/ps_top /ps_top

HHC 2012

Page 17: 1 Converting HP-41 Programs to PDF ❖ Dr. Jackie F. Woldering (2864) – Euclid, OH. ❖ How to preserve PPC Journals (1974-1987)? ❖ Jake Schwartz had already.

17

Spreadsheet Index of PDF Programs

PPC1979 Page # Name of Program Month,Year PPC#-------------- ----------- ------------------------- ----------------- ------------- ---------

V6N4P13 July, 1979 2916V6N4P14 Random Numbers (Translation) July, 1979 John Kennedy 918V6N4P14 July, 1979 John Kennedy 918V6N4P16 Normal Function Program July, 1979 Richard Nelson 1V6N5P6 Charles C. Campbell 1605V6N5P28 Bird or Bat (Bug 3 Demo) Lee Skinner 256V6N5P30 Special Display Characters Richard Nelson 1V6N5P30 Print Special Characters Richard Nelson 1V6N5P31 Display Mode Store & Recall Scott Morrison 3491V6N5P31 Greatest Common Denominator John Kennedy 918V6N5P31 Printer Column Alignment John Kennedy 918V6N6P3 Flying Goose Demo 1237V6N6P16 Banner Load Registers 41V6N6P16 Banner Printing Program 41V6N6P21 Even-Odd Register Routines 103V6N6P21 Bug 3 Flag Demo Routine David G. Motto 2339V6N6P21 Test Register Size 1816V6N6P21 Pause Length Routines 3502V6N6P22 HP67/97 Type Display Functions 3502V6N7P17 Register Sort Program 644V6N7P19

Author(s)

SELECT Chebyshev Polynomial Example Bruce K. MurdockSELECT

SELECT Random Number (HP-41C Pgm)SELECT

SELECT HP-41C Princeps Puzzle Aug, 1979SELECT Aug, 1979SELECT Aug, 1979SELECT Aug, 1979SELECT Aug, 1979SELECT Aug, 1979SELECT Aug, 1979SELECT Sep, 1979 Donald F. HouchinsSELECT Sep, 1979 Dean LampmanSELECT Sep, 1979 Dean LampmanSELECT Sep, 1979 Hugh KennerSELECT Sep, 1979SELECT Sep, 1979 Gary M. TenzerSELECT Sep, 1979 Tom CadwalladerSELECT Sep, 1979 Tom CadwalladerSELECT Oct, 1979 Robert KnouseSELECT HP Corvallis Standard Routines Oct, 1979 HP-Corvallis, Oregon

HHC 2012

Page 18: 1 Converting HP-41 Programs to PDF ❖ Dr. Jackie F. Woldering (2864) – Euclid, OH. ❖ How to preserve PPC Journals (1974-1987)? ❖ Jake Schwartz had already.

18

Using the Indexed HP-41 Programs

❖ Each completed program has Header, Code, Byte Count, DAT (Hex Dump) and Bar Code.

❖ Programs can be selected from spreadsheet.❖ Programs in readable form can be studied.❖ DAT can be copied, pasted, converted to RAW.❖ Bar code can be printed, entered via wand.❖ PPC V6N4 to V10N4 done (33/75 Journals).❖ July, 1979 to May, 1983 630 programs/groups.

HHC 2012

Page 19: 1 Converting HP-41 Programs to PDF ❖ Dr. Jackie F. Woldering (2864) – Euclid, OH. ❖ How to preserve PPC Journals (1974-1987)? ❖ Jake Schwartz had already.

19

Inclusion in the PAHHC CD/DVD

❖ Jake Schwartz plans to incorporate into DVD.❖ Blue box goes to article, red box to program.❖ No more trying to read different fonts, various styles

of programming, handwritten code, bad or faded bar code, typing, correcting programs.

❖ Programs can be brought to HP-41 via wand, HP-82164A Serial Interface, HP-82973A PC to HP-IL card, PIL box, HP-9114A/B 3.5” diskette and LIFUTIL or run on V41 or other emulators.

HHC 2012

Page 20: 1 Converting HP-41 Programs to PDF ❖ Dr. Jackie F. Woldering (2864) – Euclid, OH. ❖ How to preserve PPC Journals (1974-1987)? ❖ Jake Schwartz had already.

20

A Few Final Thoughts

❖ Sample program PRINT and Wand Byte Table.❖ Why only HP-41 programs? HP-65/67/97, etc.?❖ Why not scan the entire PPC Journal via OCR?❖ M-Code programs & selected bar code tables.❖ Any volunteers to help with typing/formatting?❖ V6N4 to V10N4 are on HHUC 2012 flash drive.❖ More programs made available as time permits.❖ I hope this will be a useful preservation of code.

HHC 2012