7

I'm looking at the paper Users Manual: Donner Algorithms for Reconstruction Tomography (1977), which includes a routine to visualize results on a line printer (page 179 of the PDF). enter image description here The FORTRAN source code for the routine which prints grayscale images is on page 221 of the PDF. The pertinent part, printing the overstruck "pixels" for the legend of the image is, for example, in lines 156-159 of the program:

 DO 54 I=1,6 54 WRITE (LUNOUT,76) (LN(J,I),J=1,J80132) WRITE (LUNOUT,78) (LN(J,7),J=1,J80132) WRITE (LUNOUT,80) (RLEG(J),J=1,MLEG) ... 76 FORMAT(1H+,130A1) 78 FORMAT(1H ,130A1) 80 FORMAT(11(1X,E10.4)) 

Note that lines with the "plus" carriage control ("do not advance") are printed first (format 76), and the final line is with the "space" carriage control ("advance one line"). That is, the control character is understood as applying after the line. However, my memory and most other online sources tell that control characters were understood as applied before the line, for example, See the section Carriage Control here

Character Vertical Spacing Before Printing ' ' advance one line '0' advance two lines '1' advance one page '+' do not advance 

or an example here

 write(8,'(" Let''s underline this statement")') write(8,'("+_______________________________")') 

Was there indeed a discrepancy between different vendors/providers (if so, then which adhered to which understanding?), or am I missing something? Otherwise, how could it work?

3
  • Would also fit my memory how /360ish system handled line printers. The format character is always the first one in a line send out to the device. Having trained for service with 1970s chain printers, I even remember the circuit putting the first byte of any output block directly forwarded to transport, while the rest was stored in a tiny core block to be compared against a 'virtual' chain to control the hammers. So yes, transport happend on a hardware level before print. Of course, that tells little of what Fortran added to it :(
    – Raffzahn
    CommentedJul 21, 2024 at 17:27
  • My recollection is that the first character as format character was handled by the printer itself, not the language that provided the output. But I'm trying to remember back 45 years so I can't be sure.CommentedJul 31, 2024 at 17:01
  • @MarkRansom Could it be that pre-standardization different printer brands understood the format character differently (feed before printing the line vs feed after printing the line)?
    – Leo B.
    CommentedJul 31, 2024 at 20:30

3 Answers 3

9

When I was in Uni, the most common problem for Engineering students was a few pages of output with one number on each line. This was because they forgot the carriage control

Carriage control is not part of the Fortran IV/66 standard but all the versions I have used (IBM, ICL 1900, Data General, Prime) have implemented that feature in their carriage control.

Carriage control for Fortran 77 is specified in page 12-20 of The Fortran 77 standard. The standard specifies

Character Vertical Spacing Before Printing ______________________________________________ Blank One Line 0 Two Lines 1 To First Line of Next Page + No Advance 

which is similar to what you have specified. As long as the vendors have adhered to the standard, the same program would have worked across different vendors.

2
  • 1
    Now that explains it: the document mentions (page 8 of the PDF) than [T]he subroutines are written in the FORTRAN programming language (ANSI standard) and have been tested on CDC 6400, 6600, and 7600 computers and on a PDP 11/45 system. Pre-Fortran 77, it was two worlds, two FORTRANs, it appears.
    – Leo B.
    CommentedJul 20, 2024 at 21:23
  • @LeoB.: Starting a paper advance as soon as a line is done, rather than when the next line is ready, could improve efficiency; I wonder if that motivated the design of some machines, and if the FORTRAN printing logic for such machines was optimized to minimize the time required to handle a sequence like "print empty line with advance after; print actual line of text with advance after" so be comparable to "advance twice and print line of text".
    – supercat
    CommentedJul 22, 2024 at 15:23
7

The appropriate handling of a single formatted-print statement is: (1) do what the carriage control says, (2) print the line. So, if you want line2 to overprint line1, line1 needs to say 'advance' and line2 needs to say 'do not advance'.

This accords with how line printers operate. However, it runs into conflict with systems that think in terms of "line terminators", since the natural behaviour of such systems would be to (on canonical teletypes) to output carriage return, line feed after "line1".

RSX-11M's terminal driver was oriented to FORTRAN use. The default output mode for line-oriented output was line feed, write line, carriage return. This works just fine for line-oriented output, but sometimes has unpleasant effects on anything more complicated; I spent an inordinate amount of time sweating over "should I write a CRLF before this prompt?".

1
  • it runs into conflict with systems that think in terms of "line terminators" Precisely. It appears that on such systems the (underspecified before the '77 standard) carriage control convention had been modified to make it more convenient for the printer driver.
    – Leo B.
    CommentedJul 21, 2024 at 16:14
1

In the days before even ASCII was standardized, at least agreement was reached on the basic printer controls, form feed (1), zero space(+), single space(" "), and double space (0). The IBM printer 1403 had a paper control tape which allowed users to define form specific spacing, but typically only the "1" was used to indicate how long the form page was. Built in were the other basic spacing, but in addition, there was a triple space indicated by a "-". The slew rates on the "0" and "-" were significantly faster than just using " " single spacing to move a distance down the form, and Punching paper tapes (which did wear out) was a chore best avoided.

1
  • 1
    This does not attempt to answer the question in the post.
    – Leo B.
    CommentedJul 22, 2024 at 3:36

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.