Multics > Library > Source
25 Jan 1977

bigletter_.pl1

History | People | Library | Sites | About

This Multics source file was rescued from the messed-up source archive at MIT.

This is a subroutine to print "big letters," used by the I/O Daemon's head and tail page. and by calendar.pl1. An ALM module with constants describing the standard alphabet is attached.

Dennis Capps wrote me:

When you were writing bigletter to use on print job banner pages, I asked you if it would handle backspaces. You said you had decided it was not important. A few minutes later, just as I reached my office, I realized why bigletter had to handle backspaces. I went back to your office and said backspace was needed to spell "Corbató" As I recall, you didn't say anything; you just turned to your console and began implementing backspaces in bigletter. I think this illustrates, besides your general desire to do a good job, the degree of influence of and respect for Corby.

Back to Multics Source index.

            bigletter_.pl1                  01/25/77  1656.1rew 01/25/77  1619.1       74655



/* ******************************************************
   *                                                    *
   *                                                    *
   * Copyright (c) 1972 by Massachusetts Institute of   *
   * Technology and Honeywell Information Systems, Inc. *
   *                                                    *
   *                                                    *
   ****************************************************** */

bigletter_: proc (inchar, writer);

/* BIGLETTER_ - Create "big letters" for printing.
   Used by IO Daemon subroutine "head_sheet_" and routine "make_tape_labels", and others.

   This routine can make two sizes of letters: 9x8 large letters, and 5x5 small ones.
   The letters are printed according to a format matrix which shows where a mark should be made.
   Each input letter is looked up in a "translation alphabet" -- if not found, the letter is skipped.
   Only 132 characters will be put out on a line - this is 13 9x8 letters or 22 5x5 letters.

   An entry point is provided for the user who insists on making his own alphabet and
   format matrix, for the 8x9 case only. the $init entry sets this up, and the $var is used to write.

   THVV */

dcl  inchar char (*);               /* Input character string to be written. */

dcl  writer entry (ptr, fixed bin);         /* Input user program to write one line. */

dcl 1 letters (0:128) based (bigp) aligned,     /* The matrix to be used. Subscript 0 is not used. */
    2 bits bit (item) aligned;          /* 36 or 72 bit elements. */

dcl 1 letter based (letp) aligned,          /* A single letter in the array. */
    2 bitrow (high) bit (wide) unal;            /* .. consists of a matrix of bits */

dcl 1 letters9 (0: 128) based (bigp) aligned,       /* Special for 9x8 */
    2 bits bit (72) aligned;

dcl 1 letter9 based (letp) aligned,
    2 bitrow9 bit (72);

dcl 1 letters5 (0: 128) based (bigp) aligned,       /* Special for 5x5 */
    2 bits bit (36) aligned;

dcl 1 letter5 based (letp) aligned,
    2 bitrow5 bit (36);

dcl  cx fixed bin (8) unal based (addr (c));        /* For convert char to number in fast case. */

dcl  i fixed bin,                   /* index in input string */
     ii fixed bin,                  /* horizontal index in output char */
     m fixed bin,                   /* Constant part of above */
     row fixed bin,                 /* vertical index in output */
     inch char (22),                /* Copy of input. */
     incl fixed bin,                /* Length of input. */
     x fixed bin,                   /* horizontal index in output buffer */
     k fixed bin,                   /* index of character in alphabet. */
     c char (1) aligned,                /* temp for one char of inchar */
     big_letterp ptr int static init (null),        /* pointer to user-supplied format matrix */
     alpha char (128) aligned,          /* actual lookup alphabet used. */
     item fixed bin,                /* width of element in "letters" -- 36 or 72 */
     high fixed bin,                /* letter height */
     wide fixed bin,                /* letter width */
     bigp ptr,                  /* pointer to actual alphabet format matrix */
     letp ptr;                  /* pointer to current letter format matrix */

dcl  alphabet char (128) aligned int static init ("");  /* user-supplied lookup alphabet */
dcl  fill char (1) aligned int static init ("*");       /* user-supplied fill character */

dcl (letseg_$letseg, letseg_$littles) fixed bin ext;    /* System alphabet format matrices */

dcl (null, length, substr, index) builtin;

dcl  linebuf char (132) aligned;            /* Output buffer for one line. */

/* ===================================================== */

regular:    bigp = addr (letseg_$letseg);           /* Regular 9 x 8 big letters, upper and lower case. */
    inch = inchar;              /* Copy input for speed. */
    incl = length (inchar) + 1 - verify (reverse (inchar), " ");
    m = 0;
    do row = 1 to 9;                /* Will put out nine lines. */
         linebuf = "";              /* Clean out line buffer. */
         x = 1;             /* Reset to left margin. */

         do i = 1 to incl;          /* Loop over the input string. */
        c = substr (inch, i, 1);        /* Get one character. */
        if unspec (c) = "000001000"b then do;   /* handle backpsace */
             if x > 10 then x = x - 10;  /* .. overstriking will work */
             go to skip0;
        end;
        if x > 125 then go to skip0;     /* write max of 132 */
        k = cx - 31;
        if k <= 0 then go to skip0;
        if k = 1 then do;           /* Special-case blanks. */
             x = x +10;
             go to skip0;
        end;

        if fill ^= " " then c = fill;       /* Default makes all *'s - user can change. */
        letp = addr (letters9 (k));     /* Find format matrix for the "K"th letter */
        do ii = 1 to 8;         /* Minor loop is over the letter width. */
             if substr (bitrow9, m+ii, 1) then
            substr (linebuf, x, 1) = c;
             x = x + 1;         /* Go to next column */
        end;
        x = x + 2;          /* Make room between letters. */

skip0:       end;

         call writer (addr (linebuf), 132);     /* Give the line to the user procedure. */
         m = m + 8;             /* Increment array index. */
    end;
    return;                 /* Finished. */

/* Entry point to make 5 x 5 characters. */

five:   entry (inchar, writer);

    bigp = addr (letseg_$littles);      /* Find 5x5 letters. */
    inch = inchar;              /* Copy input for speed. */
    incl = length (inchar) + 1 - verify (reverse (inchar), " ");
    m = 0;
    do row = 1 to 5;                /* Will put out five lines. */
         linebuf = "";              /* Clean out line buffer. */
         x = 1;             /* Reset to left margin. */

         do i = 1 to incl;          /* Loop over the input string. */
        c = substr (inch, i, 1);        /* Get one character. */
        if unspec (c) = "000001000"b then do;   /* handle backpsace */
             if x > 7 then x = x - 7;        /* .. overstriking will work */
             go to skip1;
        end;
        if x > 128 then go to skip1;     /* write max of 132 */
        k = cx - 31;
        if k <= 0 then go to skip1;
        if k = 1 then do;           /* Special-case blanks. */
             x = x + 7;
             go to skip1;
        end;

        if fill ^= " " then c = fill;       /* Default makes all *'s - user can change. */
        letp = addr (letters5 (k));     /* Find format matrix for the "K"th letter */
        do ii = 1 to 5;         /* Minor loop is over the letter width. */
             if substr (bitrow5, m+ii, 1) then
            substr (linebuf, x, 1) = c;
             x = x + 1;         /* Go to next column */
        end;
        x = x + 2;          /* Make room between letters. */

skip1:       end;

         call writer (addr (linebuf), 132);     /* Give the line to the user procedure. */
         m = m + 5;             /* Increment array index. */
    end;
    return;                 /* Finished. */

/* Entry to use user-specified alphabel for 9 x 8 characters */

var:    entry (inchar, writer);

    if big_letterp = null then go to regular;   /* If user never init'ed, use regular big letters */
    bigp = big_letterp;             /* Retrieve saved matrix pointer */
    alpha = alphabet;               /* .. and saved lookup alphabet */

    wide = 8;                   /* Set sizes */
    high = 9;                   /* ... */
    item = 72;              /* ... */

/* The main loop is on the height of the letters. */

    inch = inchar;              /* Copy input for speed. */
    incl = length (inchar) + 1 - verify (reverse (inchar), " ");
    do row = 1 to high;             /* Will put out "high" lines. */
         linebuf = "";              /* Clean out line buffer. */
         x = 1;             /* Reset to left margin. */

         do i = 1 to incl;          /* Loop over the input string. */
        c = substr (inch, i, 1);        /* Get one character. */
        if unspec (c) = "000001000"b then do;   /* handle backpsace */
             if x > (wide+2) then x = x-wide-2; /* .. overstriking will work */
             go to skip;
        end;
        if x+wide > 133 then go to skip; /* write max of 132 */
        k = index (alpha, c);       /* Look up input character in lookup alphabet */
        if k = 0 then go to skip;       /* If not found, ignore character. */

        if fill ^= " " then c = fill;       /* Default makes all *'s - user can change. */
        letp = addr (letters (k));      /* Find format matrix for the "K"th letter */
        do ii = 1 to wide;          /* Minor loop is over the letter width. */
             if substr (bitrow (row), ii, 1) then
            substr (linebuf, x, 1) = c;
             x = x + 1;         /* Go to next column */
        end;
        x = x + 2;          /* Make room between letters. */

skip:        end;

         call writer (addr (linebuf), 132);     /* Give the line to the user procedure. */

    end;
    return;                 /* Finished. */

/* --------------------------------------------- */

init:   entry (xp, a, f);               /* Entry for the user who wants to play. */

dcl  xp ptr, (a, f) char (*);

    fill = f;
    alphabet = a;
    big_letterp = xp;

    return;

     end bigletter_;




            letseg_.alm                     01/25/77  1656.1rew 01/25/77  1629.0       47583



"  ******************************************************
"  *                                                    *
"  *                                                    *
"  * Copyright (c) 1972 by Massachusetts Institute of   *
"  * Technology and Honeywell Information Systems, Inc. *
"  *                                                    *
"  *                                                    *
"  ******************************************************

    name    letseg_

    segdef  letseg
    segdef  littles

letseg: oct 000000000000,000000000000
    oct 000000000000,000000000000
    oct 060140300601,403000014030
    oct 314630000000,000000000000
    oct 000220447762,237711022000
    oct 000041766207,701337404000
    oct 001617460301,406031743400
    oct 060220440604,460641474000
    oct 030140000000,000000000000
    oct 006030140300,601403003003
    oct 600600601403,006014060300
    oct 000142312657,753246214000
    oct 000000300617,743006000000
    oct 000000000000,000030060200
    oct 000000000007,700000000000
    oct 000000000000,000030060000
    oct 006014060301,406030140300
    oct 060631463146,314631414000
    oct 030160140300,601403037400
    oct 170430030140,603014077400
    oct 376030140700,300301476000
    oct 006034170663,157700601400
    oct 771403007600,600643074000
    oct 160621403706,314631436000
    oct 776030140603,014030060000
    oct 060631460606,314631414000
    oct 060631461740,300611416000
    oct 000000003006,000030060000
    oct 000000003006,000030060200
    oct 006030140603,003003003003
    oct 000000003740,017600000000
    oct 600600600600,603014060300
    oct 170410020103,406014000060
    oct 375006355132,264547677000
    oct 170773036077,770360741400
    oct 771413027714,130360777000
    oct 375407006014,030060277000
    oct 771413036074,170360576000
    oct 777403007754,030060177400
    oct 777403007754,030060140000
    oct 375407006014,770360677000
    oct 607417037774,170360741400
    oct 170140300601,403006036000
    oct 006014030060,170360677000
    oct 615463307015,431461541400
    oct 601403006014,030060177400
    oct 607637336674,170360741400
    oct 607617236674,571761741400
    oct 375417036074,170360677000
    oct 771413027714,030060140000
    oct 375417036074,170362677002
    oct 771413027714,130360741400
    oct 375407003740,140340677000
    oct 776140300601,403006014000
    oct 607417036074,170360677000
    oct 607417036074,154617014000
    oct 607417036675,574760700400
    oct 606630740603,614660741400
    oct 403415461701,403006014000
    oct 776014060301,406030177400
    oct 036060140300,601403006017
    oct 601401401401,401401401403
    oct 740300601403,006014030360
    oct 020120000000,000000000000
    oct 000000000000,000000000377
    oct 060060000000,000000000000
    oct 000000003740,157760677400
    oct 601403007754,170360777000
    oct 000000003774,030060077400
    oct 006014033774,170360677400
    oct 000000003754,177660077000
    oct 000160607703,006014030000
    oct 000000003754,031760677000
    oct 601403007754,170360741400
    oct 000000300003,403006036000
    oct 000000300001,403006154370
    oct 001403146617,033063143000
    oct 000001700601,403006017000
    oct 000000005555,573366755400
    oct 000000005754,170360741400
    oct 000000003754,170360677000
    oct 000000007754,170377540300
    oct 000000003754,170337601407
    oct 000000005616,630060140000
    oct 000000003754,017600677000
    oct 000000303741,403006014000
    oct 000000006074,170360677400
    oct 000000006074,154617014000
    oct 000000006075,573371641000
    oct 000000006063,603017141400
    oct 000000006066,146607014170
    oct 000000003740,603014077000
    oct 006030140141,600603003003
    oct 040100200400,002004010020
    oct 600600603003,414014060300
    oct 170020000000,000000000000
    oct 000000000000,000000000000

littles:    oct 000000000000
    oct 000000000000
    oct 102040020000
    oct 240000000000
    oct 257527650000
    oct 372161370000
    oct 635042714000
    oct 212145370000
    oct 021000000000
    oct 144102030000
    oct 301020460000
    oct 112775220000
    oct 002371000000
    oct 000001440000
    oct 000160000000
    oct 000000010000
    oct 021042100000
    oct 105212420000
    oct 106041070000
    oct 311042174000
    oct 740560370000
    oct 430770204000
    oct 770360370000
    oct 164364270000
    oct 761042100000
    oct 311144460000
    oct 311360460000
    oct 000040020000
    oct 003001440000
    oct 104202020000
    oct 017407600000
    oct 101010420000
    oct 350421020000
    oct 772674174000
    oct 105374304000
    oct 750764370000
    oct 370204074000
    oct 750614370000
    oct 770364174000
    oct 770364100000
    oct 370274274000
    oct 430774304000
    oct 342041070000
    oct 020414270000
    oct 431304504000
    oct 410204174000
    oct 435654304000
    oct 434654704000
    oct 350614270000
    oct 750764100000
    oct 350614674000
    oct 750764304000
    oct 370160370000
    oct 762041020000
    oct 430614270000
    oct 430612420000
    oct 430656704000
    oct 425042504000
    oct 425041020000
    oct 761042174000
    oct 344102070000
    oct 404040404000
    oct 341020470000
    oct 042400000000
    oct 000000174000
    oct 040400000000
    oct 105374304000
    oct 750764370000
    oct 370204074000
    oct 750614370000
    oct 770364174000
    oct 770364100000
    oct 370274274000
    oct 430774304000
    oct 342041070000
    oct 020414270000
    oct 431304504000
    oct 410204174000
    oct 435654304000
    oct 434654704000
    oct 350614270000
    oct 750764100000
    oct 350614674000
    oct 750764304000
    oct 370160370000
    oct 762041020000
    oct 430614270000
    oct 430612420000
    oct 430656704000
    oct 425042504000
    oct 425041020000
    oct 761042174000
    oct 144302030000
    oct 102001020000
    oct 301030460000
    oct 341000000000
    oct 000000000000

    end

"This material is presented to ensure dissemination of scholarly and technical work. Copyright and all rights therein are retained by authors or by other copyright holders. All persons copying this information are expected to adhere to the terms and constraints invoked by each author's copyright. In most cases, these works may not be reposted without the explicit permission of the copyright holder."