I have some old assembly listing files that are text, paged by formfeed characters. I can't find a way to print nice listings on a modern laser printer/copier. They ignore the formfeeds or print a black box.
Any ideas?
Maybe I could write a program to replace the ff's with a control sequence or something?
Didn't find your answer? Ask the community — no account required.
E
Ed Lee
man pr The old fashion way.
J
John Larkin
????
Actually, Word will do it. It's not entirely obvious.
E
Ed Lee
pr file.asm > file.txt (then ftp to printer machine) or pr file.asm | lpr (for native linux)
man pr (for manual). default is 55 lines per page, can be overridden.
S
Spehro Pefhany
Page breaks are not really considered part of the responsibility of modern text editors.
I don't suppose you'd be willing to paste it into a word processing program such as Word (or one of the free ones)?
Of course you'll want to set up a monospaced font. You *could* use Courier, but why with nostalgic fonts like this one available?
formatting link
J
John Larkin
Word does it. It fooled me by refusing to let me drag-drop a text file onto the icon, or drag it into a doc, but it does eventually allow a text file to be opened, and printed properly. This is an old 68K assembly program that I need to update to replace an EOL digital capacitor chip. I want a paper listing to scribble on. Just getting all the tools to work was fun.
That isn't a real chain font; the characters are spaced too well horizontally. Drum printers scattered them vertically.
There must be typewriter and dot matrix fonts.
D
DecadentLinuxUserNumeroUno
Ed Lee snipped-for-privacy@gmail.com wrote in news:304707f9-4854-4c75- snipped-for-privacy@googlegroups.com:
Output to a text file and then edit the file and remove the offending control sequences.
J
John Larkin
It's already a text file, an assembly listing.
The "control sequence" is a single formfeed character per page. But I want that to shoot out a fresh page!
There might actually be some escape sequence that the Cannon copier/printer accepts as a page feed, but I can't find it.
H
Hul Tytus
Try Unix (or linux). Maybe Microsoft doesn't like to print other company's output?
Hul
John Lark> I have some old assembly listing files that are text, paged
D
Don Y
Wordpad (not Notepad) should do the trick. You'll likely want to pick a fixed-width font to ensure the columns (opcode, args, comments) line up pretty.
C
chris
A unix / Linux one line script using sed would do that. Using the substitute s command. Something like:
echo <infile> | sed s/oldchar/newchar/ > <outfile>
Don't do much script here, but quite amazing what can be done in a single line with standard commands and pipes...
Chris
E
Ed Lee
You also need to count lines before FF and pad up to 66 lines (55 + top and bot margins). That's exactly what "pr" does.
Interesting to know how many ways to replace "pr".
D
DecadentLinuxUserNumeroUno
John Larkin <jlarkin@highland_atwork_technology.com> wrote in news: snipped-for-privacy@4ax.com:
I am saying to use a filter to pull everything out but the text. Then you can put whatever you want there to make it work right.
S
Spehro Pefhany
The 'old typewriter' and dot matrix fonts are easy to find but the creators of the whole programming paradigm didn't anticipate wanting variations like that.
If you have access to a Adobe Indesign there's a free plugin from Beetroot Design called Humane Type that will convert all those sterile perfectly aligned characters into more organic crappy alignment.
It's not ideal and some of the effects look like they were designed by a millenial trying to emulate photocopier distortions rather than typographic variations. A real artist would do each one individually. A real engineer would write a custom script.
R
Rob
The way that "pr" handles that is by adding the correct number of linefeeds at every formfeed character to skip exactly to the next page.
It is a broken approach that falls apart when the printer does auto-wrap too long lines (printers did not do that at the time pr was written...) or when there are other uncontrollable vertical spacing problems.
It normally is the formfeed (FF, hex 0C) character. When the printer does not recognize that, it is unlikely that it recognizes something else.
These days, printers normally do not get fed with plain characters, CR, LF, TAB and FF. The pages get rendered in the computer and get sent in a page description language that is either some printer-dependent thing, or Postscript. The printer is not involved in layout issues anymore.
J
John Larkin
I can write a program to find formfeeds and replace with some escape sequence that the copier/printer recognizes as a page feed; I just don't know what will work. Googling didn't help.
Actually, I'm not sure that I can actually send a stream of characters to this kind of printer... opened as LPT3: or something. There may be drivers in the way.
J
John Larkin
Is that a Linux thing?
I thought about writing a program to do that, but Word seems to work.
Yes, some lines wrap, even in landscape mode.
B
boB
Many times now I kind of wish I still had a nice page printer with tractor feed and lots of paper for those long listings... Like we used to do decades ago.
I should not have recycled my big box of tractor feed paper just a few years ago !
D
Don Y
I have a box of 8.5x11 (microperf edges so you can rip the tractor feed holes off). But, I try hard to avoid paper.
There are tools that let you annotate "electronic paper" in much the same way that you would markup paper listings in days past.
Personally, I like not having stacks of paper lying around the office. There's enough shi^H^H^Htuff there, already!
And, project listings that were 20-50 pages are now 2000 - 5000 pages...
S
Spehro Pefhany
You can still buy it. I see 2700 sheets for about $87 USD equivalent.
I have a Panasonic KX-P1124 kicking around- you can still get clone ribbons for it at $14 for 6 pieces free ship in the US.
But .. why ? These days most likely the issue is in some code that someone else wrote or in your interpretation of it.
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.