The Museum of HP Calculators

HP Forum Archive 12

[ Return to Index | Top of Index ]

HP-41 Plotter Module "PLOTBC" prgm. error
Message #1 Posted by Donald Leonard on 16 Apr 2003, 2:07 a.m.

Decades ago, while a member of the SoCal PPC club, I purchased a Plotter Module and 7470 Plotter to make bar codes. After being stolen, I managed to replace the Plotter module. I recall that a PPC member provided club members with a patch for the user entered program "PLOTBC". The manual supplied barcodes have a text line right under the program name/title which states "PROGRAM REGISTERS NEEDED: nn". However, neither the bar code nor the listing provides this line. Close examination of the program shows that label 12 which prints the program title contains two label print commands, yet only one prints the title - the other does nothing. The pen moves to the area, but nothing happens. It then moves to the bar code area and starts to print the bar code. My recollection is that the patch provided by the member corrected this error. Is there anyone out there that has this patch? Don

Re: HP-41 Plotter Module "PLOTBC" prgm. error
Message #2 Posted by Christoph Klug on 16 Apr 2003, 3:28 a.m.,
in response to message #1 by Donald Leonard

Dear Donald,

creating nice and fast HP41Barcode prints also would be possible with EMU41 plus virtual SKWIDINK Rom both running on a PC.

For more details refer to the HP museum article forum item 311....

Best wishes from Germany - Christoph Klug

Re: HP-41 Plotter Module "PLOTBC" prgm. error
Message #3 Posted by Ellis Easley on 16 Apr 2003, 12:46 p.m.,
in response to message #1 by Donald Leonard

I have no experience with the Plotter ROM or the PLOTBC program, but I have been studying the manual on the Museum CD-ROM. On page 117 there is a series of example bar code plots which result when PLOTBC is given the keystrokes on the preceding pages. The example of a program bar code plot includes the program title but not the number of registers. The utility program bar codes starting on page 195 have both titles and number of registers that look like they were typeset and not plotted along with the barcode. Please excuse me if this was obvious to you, and the patch you remember was an enhancement to PLOTBC and not just a fix.

I also studied the program listing starting on page 169 to see the two LABEL instructions you noted after LBL 12. Below, I have added comments to a few lines with my underestanding of the operation:

121 LBL 12

122 FS? 09 "If flag 09 set, does not print title. Otherwise, prints title and moves to next row."

123 RTN

124 CLA empty alpha for first LABEL function

125 2

126 PEN

127 CLX x=0

128 LORG 0 same as 1 for label origin, lower left of text

129 ACOS puts 90 in x (degree mode set for sure?)

130 LDIR label direction 90 degrees plots text perpendicular to bottom edge - like portrait mode on landscape mode plotter

131 LABEL alpha is empty for this one

132 ARCL Z program name was on stack in z? put in alpha

133 LABEL this one plots the program name

134 RDN

135 GTO c

How could the program determine the number of registers needed? As I understand it, the actual program bar code is plotted by a ROM function which is passed the program name, the row of bar code to plot, and the number of bytes to plot on the row. I guess the ROM routine calculates the starting byte for the row assuming all rows before this row had the same number of bytes. After plotting a row which is not the last row, the ROM routine increments the row number by 1. After the ROM routine has plotted the last row of the program, it returns the row number zero. So the PLOTBC program isn't dealing with the program bytes at all, it is just asking the ROM to plot bytes until they run out. The program could multiply the number of bytes per row by the number of rows that were plotted (until the ROM returned 0) but that wouldn't be exact because of the uncertainty of the number of bytes in the last row, and the total wouldn't be available until after all the plotting was finished.

I'm still learning the 41 - I see the 41CX has a function RCLPTA that returns the number of bytes in the program whose name is in alpha. That number divided by 7 and rounded up would be the number of registers. The text "PROGRAM REGISTERS NEEDED" is 24 characters alone, which is the size of the alpha register, so you would have to use LABEL twice, once for the words and then again for the number. And getting the number from X into the alpha register would be a pain. You would have to use CLA to clear alpha, then extract the digits one at a time, add 48 to convert each digit from 0-9 to ASCII, then use XTOA to append the ASCII character to alpha, then use LABEL to plot the characters of the number. To be exactly like the book, you would need to put ASCII ":" and a space in alpha before the digits.

Well, that shows how much I know - ARCL X can be used to put a text version of the number in X into alpha. The first time I read that page, I understood it to mean that only ASCII data stored in a register could be ARCLed. There is a routine (LBL 00) in the XBC program, which supports PLOTBC, that appends the number in X to alpha after using a loop with the FIX function to suppress trailing (insignificant)zeros but I don't think you can call that label in XBC from PLOTBC. However, since the number of registers is a whole number, you could just FIX 0 and then ARCL X.

It will be necessary to take steps to position the pen to plot the "Registers" line and then to plot the first line of program bar code.

If I had all the hardware I'd try this to see if it really works!

So the answer to your question is, no, I don't have the patch, but maybe my ramblings will help you to modify the program.

I meant to look in the PPC Journal CD-ROMs to see if the patch is there, it might well be.

Today's program was brought to you by the functions RCLPTA and ARCL.

Re: HP-41 Plotter Module "PLOTBC" prgm. error
Message #4 Posted by Donald Leonard on 17 Apr 2003, 2:24 a.m.,
in response to message #3 by Ellis Easley

Thank you for your reply, and nicely done. Yes, I recall that the patch was published in the PPC newsletter.

I did miss the page 117 example of program plot. But, I knew that all Plotter Modules printed the 'header' this way. As I recall the 20+ year article, the patch not only added the 'needed register' line, it also altered the height of the bar code using something like .200 in the X reg. before Xeq BCSIZE, and reduced the height of all text after the title to around 1.5 in the X reg. before Xeq CSIZE. This new format for bar codes was used by the PPC newsletter crew (Richard Nelson) for all published bar codes as it was very efficient of page space. Since I do not have access to the PPC CD set, your best place to look is the earliest issue with the shorter bar codes.

Your analysis of the program section (LABEL 12) is the same as mine as I understand it.

I don't remember the specifics of the patch. I think the program stores the register length somewhere within the program - perhaps within the program label or the end. All that the patch may require is a synthetic line or two to locate and extract the program reg. size, load the text and extracted reg. size in alpha and Xeq LABEL. I see no reason to Xeq LABEL with a cleared alpha reg.

I am about 15 years out of practice programming the 41 as my system was stolen and I have just replaced most of it. It won't take me too long to catch up as it is a lot like riding a bike or sex. You really never forget how to do it after a little practice.

Re: HP-41 Plotter Module "PLOTBC" prgm. error
Message #5 Posted by Ellis Easley on 17 Apr 2003, 3:48 a.m.,
in response to message #4 by Donald Leonard

I'll use that clue to try to find the patch on the CD-ROM.

The only sense I can make of printing a blank label is to position the pen, but I think that must be done already elsewhere in the program.

BTW, I'm happy to look for the patch but you might like to know that the CD-ROMs are easy to get and not very expensive. You can read about it here:

one more thing about the PPC CD-ROMs
Message #6 Posted by Ellis Easley on 17 Apr 2003, 3:55 a.m.,
in response to message #5 by Ellis Easley

I think the info file for the PPC CD-ROMs says the scanning resolution that they had to use to fit in all the issues means that you can't read the bar codes after printing the pages. That might influence your interest in the CD-ROMs.

Re: HP-41 Plotter Module "PLOTBC" prgm. error
Message #7 Posted by Donald Leonard on 18 Apr 2003, 3:18 p.m.,
in response to message #5 by Ellis Easley

I want to thank Ellis Easley for providing me the PPC newsletter article and BC* program I was looking for. I am not sure if I had used this program or just implemented the features of this program into PLOTBC (I think that is what I did). For the record and for anyone who is or will be interested in this program, it is in V13N7P22 (Vol. 13 Num. 7 Page(s) 22-24). Thanx again, Ellis. Your time and effort is greatly appreciated as I don't have the hardware to do it myself.

Re: HP-41 Plotter Module "PLOTBC" prgm. error
Message #8 Posted by Ellis Easley on 18 Apr 2003, 3:49 p.m.,
in response to message #7 by Donald Leonard

You're welcome, Don, and I'm glad you were able to replace your 41. You can see by the polls that have been taken here in the last couple of days that it is still the most popular HP calculator.

To anyone who wants to take extracts from large .pdf files like the ones on the MoHPC and PPC CD-ROMs but doesn't have the retail Adobe Acrobat, I discovered an easy way to do it without creating giant files. I used the graphics selection tool in the free Acrobat reader to copy the material I wanted to extract, then I pasted it into Windows Paint and saved it as a .GIF file. My first attempt was to paste the graphics into a Word document in WordPad which resulted in a 1.5MB file containing less than 1/2 page from a PPC Journal. The .GIF file via Paint was only about 32kB!

[ Return to Index | Top of Index ]

Go back to the main exhibit hall