Thursday, March 22, 2018

Banner Text on RSX11

  My first exposure to computers was back in the dim dark ages, in my college days, when you stood in line for a chance to use a card punch machine to compose your program, and then handed the resulting card deck in at the service window, where a tape ape would eventually load it into a card reader, and it would get to run on an enormous piece of whirring and buzzing machinery (that is, a mainframe computer). Eventually, much later (much, much,much later if the operators overheard you calling them tape apes) you would get your printed output back, stacked  in the output bins. It would be printed on greenbar paper, typically 14 7/8 inches wide, 132 characters wide at 10 characters/inch.

  So far this sounds pretty boring. Well it definitely was. Tedious, painful, annoying - all of these things. Editing a program on a card punch was even less fun that typing it in in the first place. And it was bad to drop a card deck - very bad. But one part I did enjoy. The output printout had what was called  a flag page, which printed out your user name and the name of your job in large characters, like a banner formed from individual characters. When I saw that, it made me feel like I was involved in some serious computer activity. I don't have any examples of output from that old machine (it was a Burroughs, by the way - at Rice University everyone hated it when the Burroughs was replaced by an IBM system), but here's a sample from an RSX11 batch job flag page....


Sample RSX flag page

  I was reading some DECUS code a few days back - a GREP utility for RSX, written in MACRO-11 by Bruce Mitchell, one of the giants in the RSX11 game. He had decorated each routine's documentation block with its name in the same banner font used by the RSX11 flag page. It looked pretty snazzy. It got me to wondering, what would it take to write a utility to convert text strings to output in that banner font format. I could have done it the hard way and laid out the bitmaps for each letter needed, along with code to raster it out line by line. That approach did not appeal to me. That sounded a lot like work, and this is a hobby. I got to wondering how and where RSX generated the text for flag pages. By coincidence, the very DECUS utility that got me to thinking about doing this in the first place, GREP, was just the ticket for finding the code that generates the banner text. File [121,10]FLGEN.MAC is the module that does the business for flag pages. 

  But,  I didn't want to just rip off the DEC character generating code and stick it into my utility. That is just not sporting. I figured, though, that figuring out how to call it from my code would be pretty much OK. Initially, that looked promising. FLGEN had all the logic for assembling an entire flag page, but it had one particular routine in it,  GEN, that takes a byte character as input and returns the equivalent multi line banner character. I wrote a small front end routine to call that routine - but it didn't work. The first problem was that, FLGEN itself was part of a bigger task, so it referred to a slug of variables and routines found in the other modules that made up the print spooler. When just linking my front end and FLGEN's object file, without the other modules, these symbols were all unresolved. I took care of that problem by getting the list of unresolved symbols from the TKB failure, and defining them as locations in my front end program. That way they resolved and the task built successfully. They would not have the right values in them, but, I wasn't really planning to use them - I just wanted to generate characters, not make an entire flag page.

This just got me to the next problem... I had failed to notice that subroutine GEN was not declared as global, so TKB couldn't resolve it at link time. Well, that was discouraging. But then I had a look at FLGEN and realized that I could call the main entry point of the whole thing, and, with the dummied up variables and routine entry points I had already set to zero (or return, in the case of routines), my inputs would pass into FLGEN, get passed to GEN and cause banner characters to be created. OK, we're most of the way home here. It turned out I got another break - FLGEN takes the results from GEN and passes them to an external  routine called SNDMSG, which normally QIOs them out to the line printer. All I had to do now was create a new SNDMSG routine in my code (and a couple other routines it called), and my routine would get called with each line of output, to display or save.

  Slap on the usual GCML and CSI command switch stuff and FCS file IO stuff, and Bob's your uncle...


banner.mac

To create....

>mac banner=banner
>mac flgen=[121,10]flgen
>tkb
banner=banner,flgen
/
task=...BAN
libr=FCSRES:RO   (optional)
//

To use..

Run banner, or install and invoke as BAN
Banner syntax is the usual, outfile=infile. The default file extension is .txt. For just seeing it on the screen, or inputting characters from the keyboard instead of from a file, use TI: as the input and/or output filename.

>run banner
BAN>ti:=ti:
ABCDE

     AAAAAA        BBBBBBBB            CCCCCCCC   DDDDDDDD       EEEEEEEEEE
     AAAAAA        BBBBBBBB            CCCCCCCC   DDDDDDDD       EEEEEEEEEE
AA               AA   BB              BB   CC                       DD               DD   EE
AA               AA   BB              BB   CC                       DD               DD   EE
AA               AA   BB              BB   CC                       DD               DD   EE
AA               AA   BB              BB   CC                       DD               DD   EE
AA               AA   BBBBBBBB       CC                       DD               DD   EEEEEEEE
AA               AA   BBBBBBBB       CC                       DD               DD   EEEEEEEE
AAAAAAAAAA   BB              BB   CC                       DD               DD   EE
AAAAAAAAAA   BB              BB   CC                       DD               DD   EE
AA               AA   BB              BB   CC                       DD               DD   EE
AA               AA   BB              BB   CC                       DD               DD   EE
AA               AA   BBBBBBBB            CCCCCCCC   DDDDDDDD       EEEEEEEEEE
AA               AA   BBBBBBBB            CCCCCCCC   DDDDDDDD       EEEEEEEEEE

^Z
>

Or specify files to input and or output to/from a file

>run banner
BAN>outfile=infile
>

It's upper case only, so any lower case chars in the input come out as spaces. The  character set is
ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890$.;:[],'!-.   Anything else prints out as a blank.
  
  This routine will handle input strings up to around 20 characters or so - bigger than that and FLGEN returns garbage.

If you specify a longish line and direct output to the ti:, , word wrap will make it look like the dog's breakfast..