EDITOR:
DO;
/* MEMORY LAYOUT

  MONITOR AREA                 0 TO 0FH
  PROGRAM CODE (READ ONLY)     10 TO E0F
  STACK                        E0F+1 TO INPUT$SEND-1
  VARIABLES (DATA)             INPUT$SEND TO MEMORY-1
  WORKSPACE                    MEMORY(0) TO MEMORY(MEMSIZ-1)
    BUFFER DELIMITER           MEMORY(0)
    TEXT BUFFER                MEMORY(1) TO MEMORY(BE-1)
    REMAINING SPACE            MEMORY(BE) TO MEMORY(INPUT$END-1)
    INPUT BUFFER               MEMORY(INPUT$END TO MEMORY(MEMSIZ-1)
  CURRENT INPUT CHARACTER      MEMORY(IPTR)

     BUFFERS AND POINTERS */

 DECLARE(INPUT$END, /*END (BOTTOM) OF INPUT BUFFER */
         BP,        /*CURRENT BUFFER POINTER */
         BE,        /*END (TOP) OF WORKSPACE */
         BP1,BE1,   /*TEMPORARY POINTERS FOR COMPACTIFICATION*/
         I          /*TEMPORARY */
        ) ADDRESS;

 DECLARE (IPTR,     /*INPUT BUFFER POINTER*/
          MEMSIZ    /*MEMORY MAXIMUM SIZE */
         )ADDRESS;

 DECLARE (CHAR,CTYPE, /*CURRENT CHARACTER AND ITS TYPE */
          VALUE,NEGATE, /*NUMERIC VALUE AND ITS SIGN */
          COLUMN,       /*COLUMN COUNTER FOR TAB LOGIC */
          ISP,          /*STACK POINTER FOR ITERATION STACKS*/
          MATCH$LENGTH  /*LENGTH OF SEARCH STRING*/
         )BYTE;

 DECLARE WORK(17) BYTE; /*TEMPORARY STRING BUFFER USED BY F AND S */
 DECLARE IB(8) ADDRESS; /*ITERATION BOUNDS STACK*/
 DECLARE IV(8) BYTE;    /*ITERATION VALUE  STACK*/

   /* LITERAL DECLARATIONS */

 DECLARE TRUE LITERALLY '0FFH';
 DECLARE FALSE LITERALLY '0';
 DECLARE FOREVER LITERALLY 'WHILE 1';
 DECLARE BELL LITERALLY '07H';
 DECLARE CR LITERALLY '0DH';
 DECLARE LF LITERALLY '0AH';
 DECLARE TAB LITERALLY '09H';
 DECLARE END$OF$FILE LITERALLY '1AH';
 DECLARE EOB LITERALLY '0FFH';
 DECLARE RUBOUT LITERALLY '7FH';
 DECLARE ALPHA  LITERALLY '0';
 DECLARE NUMERIC LITERALLY '1';
 DECLARE SPECIAL LITERALLY '2';
 DECLARE ESC LITERALLY '1BH';
 DECLARE ALT LITERALLY '7DH';
 DECLARE QUOTE LITERALLY '22H';
 DECLARE BREAK$KEY LITERALLY '0';
 DECLARE DOUBLE$EOB LITERALLY '0FFFFH';
 DECLARE STKSIZ LITERALLY '8';
 DECLARE PMSK LITERALLY '00110000B';
 DECLARE PITY LITERALLY '0';

   /* MESSAGES */

 DECLARE SIGN$ON (*) BYTE DATA (CR,LF,'INTELLEC 8 TEXT EDITOR,VERSION 2.0');
 DECLARE ILLGL (*) BYTE DATA (QUOTE,'ILLEGAL IN THIS CONTEXT',CR,LF);
 DECLARE NOFND (*) BYTE DATA (CR,LF,'CANNOT FIND ',QUOTE);
 DECLARE CRLF  (*) BYTE DATA (CR,LF);
 DECLARE MSG   (*) BYTE DATA (CR,LF,'START PUNCH,TYPE CHAR',CR,LF);
 DECLARE OVFL  (*) BYTE DATA (CR,LF,'ITERATION STACK FAULT');

   /*PROCEDURES */

   /*LINKAGE ROUTINES TO MONITOR V2,0 I/O SYTEM */

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

 CI:
   PROCEDURE BYTE EXTERNAL;
 END CI;

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

 RI:
   PROCEDURE BYTE EXTERNAL;
 END RI;

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

 CO:
   PROCEDURE (CHAR) EXTERNAL;
   DECLARE CHAR BYTE;
 END CO;

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

 PO:
   PROCEDURE (CHAR) EXTERNAL;
   DECLARE CHAR BYTE;
 END PO;

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

 LO:
   PROCEDURE (CHAR) EXTERNAL;
   DECLARE CHAR BYTE;
 END LO;

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

 CSTS:
   PROCEDURE BYTE EXTERNAL;
 END CSTS;

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

 IOCHK:
   PROCEDURE BYTE EXTERNAL;
 END IOCHK;

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

 IOSET:
   PROCEDURE (CHAR) EXTERNAL;
   DECLARE CHAR BYTE;
 END IOSET;

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

 MEMCHK:
   PROCEDURE ADDRESS EXTERNAL;
 END MEMCHK;

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

   /*TEXT EDITOR ROUTINES */

   /* CONSOLE INPUT,MASK OFF PARITY BIT */

 READ$CHAR:
   PROCEDURE BYTE;

     RETURN CI AND 7FH;
   END READ$CHAR;

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

   /* OUTPUT TO CONSOLE, GENERATE MULTIPLE SPACES
      FOR HORIZONTAL TABS */

 PUT$CHAR:
   PROCEDURE (CHAR);
   DECLARE (CHAR,I,J) BYTE;

     I=(CHAR = TAB) AND (7-(COLUMN AND 7));
     IF CHAR = TAB THEN CHAR=' ';
     DO J= 0 TO I;
       IF CHAR>=' 'THEN COLUMN=COLUMN+1;
       IF CHAR =CR THEN COLUMN=0;
       CALL CO(CHAR);
     END;
   END PUT$CHAR;

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

   /*PUNCH SIX INCHES OF LEADER */

 LEAD:
   PROCEDURE;
     DECLARE LEAD$I BYTE;

     LEAD$I=60;
     DO WHILE LEAD$I<>0 ;
       LEAD$I = LEAD$I-1;
       CALL PO(0);
     END;
   END LEAD;

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

   /*PRINT A CHARACTER STRING,GIVEN AN ADDRESS
     AND A LENGTH */

 PRINT$STRING:
   PROCEDURE(PNAME,PNLST);
     DECLARE(PNAME,PNLST,PNI)ADDRESS;
     DECLARE(CHAR BASED PNAME)BYTE;

     DO PNI=0 TO PNLST;
       CALL PUT$CHAR(CHAR);
       PNAME=PNAME+1;
       IF CSTS THEN IF READ$CHAR =BREAK$KEY THEN GO TO BREAK;
     END;
   END PRINT$STRING;

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

   /*READ TAPE, RETURN CONTROL-Z AS END$OF$FILE
     IF END OF TAPE IS SENSED */

 READ$TAPE:
   PROCEDURE BYTE;
     DECLARE RICH BYTE;
     RICH = RI;
     IF NOT CARRY THEN RETURN RICH AND 7FH;
     RETURN END$OF$FILE;
   END READ$TAPE;

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

   /*IF PUNCH=TTY, OUTPUT A MESSAGE TO TURN ON PUNCH
     AND WAIT FOR ACKNOWLEDGE */


 PUNCH$ON:
   PROCEDURE;
     DECLARE TOCH BYTE;

     IF (IOCHK AND PMSK) <>PITY THEN RETURN;
     CALL PRINT$STRING(.MSG,LAST(MSG));
     TOCH =READ$CHAR;
   END PUNCH$ON;

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

   /*IF PUNCH=TTY WAIT FOR THE OPERATOR TO TURN OFF
     PUNCH AND ACKNOWLEDGE*/

 PUNCH$OFF:
   PROCEDURE;
     DECLARE TFCH BYTE;

     IF(IOCHK AND PMSK) <> PITY THEN RETURN;
     TFCH = READ$CHAR;
   END PUNCH$OFF;

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

   /*COMPRESS INPUT BUFFER*/

 PACK:
   PROCEDURE;
     DECLARE I ADDRESS;

     IF ISP<>0 THEN RETURN; /*DON'T MOVE IF AN ITERATION IS ACTIVE*/
     I = MEMSIZ - 1;
     DO WHILE IPTR >=INPUT$END;
       MEMORY(I) = MEMORY(IPTR);
       I=I-1;
       IPTR=IPTR-1;
     END;
     INPUT$END=I+1;
     IPTR =MEMSIZ-1;
   END PACK;

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

   /*READ CONSOLE,COPY INTO INPUT BUFFER UNTIL DOUBLE
     ESCAPE.ABORT IF'BREAK' KEY IS ENCOUNTERED */

 READ$COMMAND$STRING:
   PROCEDURE;
     DECLARE (CHAR0,CHAR1) BYTE;

 RC0:
     CALL CO('*');
     INPUT$END=MEMSIZ;
     IPTR=MEMSIZ-1;
     CHAR1,ISP = 0;
 RC1:
     IF (CHAR0:=READ$CHAR)=BREAK$KEY THEN GO TO BREAK;/*ABORT*/
 RC2:
     IF CHAR0=CR THEN /*ECHO CR AND LF,COPY BOTH INTO BUFFER */
     DO;
               INPUT$END=INPUT$END-1;
       MEMORY(INPUT$END)=CR;
       CALL CO(CR);
       CHAR0 = LF ;
     END;
     IF CHAR0 =RUBOUT THEN
     DO;
       IF INPUT$END <> MEMSIZ THEN
       DO;
       IF (CHAR0:=MEMORY(INPUT$END)) =ESC THEN CHAR0 =':';
       CALL PUT$CHAR(CHAR0);
       INPUT$END =INPUT$END+1;
       GO TO RC1;
     END;
     ELSE
     DO;
       CALL PRINT$STRING(.CRLF,LAST(CRLF));
       GO TO RC0;
   END;
   END;
   IF INPUT$END =BE+1 THEN CALL PACK; /*FIND MORE SPACE*/
   IF INPUT$END =BE+1 THEN /*WORKSPACE FULL ALLOW ONLY RUBOUTS */
   DO;
       CALL PUT$CHAR(BELL);
       GO TO RC1;
     END;
     IF CHAR0 =ALT THEN CHAR0 =ESC;/*INTERPRET ALTMODE AS ESCAPE*/
     IF CHAR0 =ESC THEN CALL CO('$');
     ELSE CALL PUT$CHAR(CHAR0);/*ECHO THE CHARACTER*/
     INPUT$END = INPUT$END-1;
     MEMORY(INPUT$END) =CHAR0; /*PUT THE CHARACTER IN INPUT BUFFER*/
     IF CHAR0 = ESC AND CHAR1 =ESC THEN /* TEST FOR DOUBLE ESCAPE */
     DO;
       CALL PRINT$STRING(.CRLF,LAST(CRLF));
       RETURN;
     END;
     CHAR1=CHAR0;
     GO TO RC1;
   END READ$COMMAND$STRING;

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

   /*GET A CHARACTER FROM THE INPUT BUFFER,
     MARK IT'S TYPE,ECHO IT */

 GNC:
   PROCEDURE BYTE;
     DECLARE I BYTE;
     IF INPUT$END > IPTR THEN CALL READ$COMMAND$STRING;
     CTYPE = SPECIAL;

     IF (I:=MEMORY(IPTR)) >='A' AND I <='Z' THEN CTYPE =ALPHA;
     IF I>='0' AND I <='9' THEN CTYPE = NUMERIC;
     IPTR =IPTR-1;
     RETURN I;
   END GNC;

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

   /* CONVERT A CHARACTER STRING OF DIGITS IN THE INPUT
      BUFFER INTO A BINARY NUMBER 0-255. SET NEGATE TRUE
      IF A MINUS SIGN IS ENCOUNTERED */

 NUMBER:
   PROCEDURE ADDRESS;
     DECLARE NVAL BYTE;

     IF CHAR = '-' THEN
     DO;
       NEGATE = TRUE;
       CHAR = GNC;
     END;
     ELSE IF CHAR = '+' THEN CHAR = GNC;
     NVAL=0;
     DO WHILE CTYPE = NUMERIC;
       NVAL =SHL(SHL(NVAL,2)+NVAL,1)+CHAR-'0';/*NVAL*10+DIGIT*/
       CHAR =GNC;
     END;
     IF NEGATE AND (NVAL=0) THEN RETURN 1; /*TURN'-0' INTO '-1' */
     RETURN NVAL;
   END NUMBER;

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

   /*LOCATE STRING 'WORK'IN THE IN WORKSPACE,
     SEARCHING FORWARD FROM BP TO THE END OF THE BUFFER */

 INDEX:
   PROCEDURE ADDRESS;
     DECLARE INDXJ ADDRESS;
     DECLARE (INDXK,INDXL) BYTE;

     INDXJ =0;
     DO WHILE MEMORY(BP+INDXJ) <> EOB;
       INDXK =0;
       DO WHILE (INDXL:=MEMORY(BP+INDXJ+INDXK)) = WORK(INDXK);
         IF WORK(INDXK+1) = ESC THEN RETURN INDXJ;
         INDXK = INDXK + 1;
       END;
       IF INDXL = EOB THEN RETURN DOUBLE$EOB;
       INDXJ = INDXJ +1;
     END;
     RETURN DOUBLE$EOB;
   END INDEX;
   /*----------------------------------*/


   /*COUNT LINE FEEDS
     POSITION
     IF VALUE =0,POSITION TO BEGINNING OF CURRENT LINE*/

 SEARCH:
   PROCEDURE ADDRESS;
     DECLARE SI ADDRESS;
     DECLARE SO BYTE;

     SI = BP;
     IF NEGATE OR (VALUE=0) THEN
     DO;
       IF BP=BE AND BP <> 1 THEN SI = SI - 1;
       VALUE = VALUE + 1;
       DO WHILE VALUE <> 0;
         IF (SO:=MEMORY(SI)) =EOB THEN RETURN SI + 1;
         IF SO = LF THEN VALUE = VALUE -1 ;
         SI = SI - 1;
       END;
       RETURN SI + 2;
     END;
     ELSE
     DO WHILE VALUE <> 0;
       IF (SO:=MEMORY(SI)) = EOB THEN RETURN SI;
       IF SO = LF THEN VALUE = VALUE - 1 ;
       SI = SI + 1;
     END;
     RETURN SI;
   END SEARCH;

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

   /*FIND A STRING FOR 'F' AND 'S' COMMANDS */

 MATCH:
   PROCEDURE ADDRESS;
     DECLARE MI ADDRESS;

     MATCH$LENGTH = 0;
     DO WHILE (WORK(MATCH$LENGTH):=GNC) <> ESC;
       IF MATCH$LENGTH < LAST(WORK) THEN MATCH$LENGTH = MATCH$LENGTH+1;
     END;
     IF (MI:=INDEX) = DOUBLE$EOB THEN /*CAN'T FIND IT */
     DO;
       CALL PRINT$STRING(.NOFND,LAST(NOFND));
       IF MATCH$LENGTH <>0 THEN CALL PRINT$STRING(.WORK,MATCH$LENGTH-1);
       CALL CO(QUOTE);
       CALL PRINT$STRING(.CRLF,LAST(CRLF));
       GO TO BREAK;
     END;
     ELSE RETURN MI + BP;
   END MATCH;

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

   /*PACK WORKSPACE FOR 'D', 'K', 'I', AND 'W'.COMMANDS */

 COMPACTIFY:
   PROCEDURE;

     BE = BP;
     DO WHILE BP1 <= BE1;
       MEMORY(BE) =MEMORY(BP1);
       BP1=BP1+1;
       BE =BE +1;
     END;
     MEMORY((BE:=BE-1)) =EOB;
     CALL PACK;
   END COMPACTIFY;

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

   /*INITIALIZATION LOGIC*/

 INIT:
   CALL PRINT$STRING(.SIGN$ON,LAST(SIGN$ON));
   MEMSIZ = MEMCHK - .MEMORY;
   MEMORY(0) = EOB; /*PUT END-OF-BUFFER MARKERS IN THE WORJSPACE*/
   MEMORY(1) = EOB;
   BP,BE = 1;

   /*RETURN TO HERE IF BREAK KEY IS DEPRESSED*/

 BREAK:
   CALL PRINT$STRING(.CRLF,LAST(CRLF));
   CALL READ$COMMAND$STRING;

   /*MAIN LOOP*/

 EDIT:
 DO FOREVER;
   BP1 =BP;
   BE1 = BE;
   NEGATE=FALSE;
   VALUE= 1;
   CHAR = GNC;
   IF CTYPE = NUMERIC OR CHAR = '-' OR CHAR = '+' THEN VALUE = NUMBER;
   IF CHAR = '<' THEN    /*TEST FOR ITERATION*/
   DO;
     IF (ISP:=ISP+1) > STKSIZ THEN
     DO;
       CALL PRINT$STRING(.OVFL,LAST(OVFL));
       GO TO BREAK;
     END;
     IB(ISP) = IPTR;
     IV(ISP) = VALUE;
     GO TO EDIT;
   END;
   IF CHAR = '>' AND ISP <>0 THEN
   DO;
     IF (IV(ISP):=IV(ISP)-1) <> 0 THEN IPTR = IB(ISP);
     ELSE ISP = ISP - 1;
     GO TO EDIT;
   END;
   IF CTYPE = ALPHA THEN
   DO CASE CHAR -'A'; /*BRANCH ON ALPHANUMERIC, 0 TO 25 */

   /*CASE A,APPEND INPUT TO WORKSPACE,
     IGNORE NULLS AND RUBOUTS FROM TAPE,
     TERMINATE ON EOF, BUFFER FULL,
     OR 50 LINES READ */

   DO;
     VALUE = 0;
 A0:
     IF BE < INPUT$END - 10 THEN
     DO;
       IF (CHAR:=READ$TAPE) <> END$OF$FILE THEN
       DO;
         IF CHAR <> 0 AND CHAR <>7FH THEN
         DO;
           MEMORY(BE) = CHAR;
           BE = BE +1;
           IF CHAR =LF THEN
           DO;
             IF (VALUE:=VALUE +1) = 50 THEN GO TO A1;
           END;
         END;
         GO TO A0;
       END;
     END;
 A1:
     MEMORY(BE)=EOB;
   END;

   /* CASE B, RESET POINTER TO BEGINNING OF BUFFER */

   BP = 1;

   /* CASE C, MOVE  POINTER 1 TO 254 CHARACTERS,
      IF NEGATE = FALSE, MOVE RIGHT,
      IF NEGATE = TRUE, MOVE LEFT */

   IF NEGATE THEN
   DO;
     IF VALUE > BP-1 THEN BP=1;
     ELSE BP = BP - VALUE;
   END;
   ELSE
   DO;
     IF (I:=BP + VALUE) > BE THEN BP = BE;
     ELSE BP = I;
   END;

   /*CASE D,DELETE 1 TO 254 CHARACTERS FROM THE BUFFER */

   DO;
     IF NEGATE THEN
     DO;
       IF VALUE > BP THEN BP = 1;
       ELSE BP = BP - VALUE;
     END;
     ELSE
     DO;
       IF (I:=BP+VALUE) > BE THEN BP1 = BE;
       ELSE BP1 = I;
     END;
     CALL COMPACTIFY;
   END;

   /*CASE E,WRITE WORKSPACE TO THE PUNCH,

     IS SENSED, WRITE EOF AND TRAILER,
     RESTART EDITOR */

   DO;
     CALL PUNCH$ON; /*TURN ON PUNCH*/
     DO I =1 TO BE -1;
       CALL PO(MEMORY(I));
     END;
     DO WHILE (CHAR:=READ$TAPE) <>END$OF$FILE;
       CALL  PO(CHAR);
     END;
     CALL PO(END$OF$FILE);
     CALL LEAD;
     CALL PUNCH$OFF; /*TURN OFF PUNCH*/
     GO TO INIT;
   END;

   /*CASE F, FIND A STRING IN THE WORKSPACE,
     BEGIN SEARCH AT BP, CONTINUE UNTIL THE
     STRING IS FOUND OR UNTIL THE END OF THE
     BUFFER IS REACHED, POSITION BUFFER POINTER
     BEYOND THE END OF THE SEARCH STRING IF A
     MATCH IS FOUND, BUFFER POINTER IS UNCHANGED
     IF NO MATCH IS FOUND*/

   BP = MATCH + MATCH$LENGTH;

   /*CASE G*/

   GO TO NOGOOD;

   /*CASE H */

   GO TO NOGOOD;

   /*CASE I, INSERT STRING IN WORKSPACE,
     COPY FROM INPUT BUFFER TO WORKSPACE,
     MOVING WORKSPACE AND INPUT BUFFER AS
     REQUIRED, THIS CASE IS ALSO A SUCCESSOR
     T0 SUBSTITUTE, CASE S */

 INSERT:
   DO;
     DO WHILE (CHAR:=GNC) <> ESC;
       IF BP = BP1 THEN
       DO; /*SHOVE BUFFER UP */
         IF BE = INPUT$END-10 THEN GO TO BREAK; /*BUFFER ALMOST FULL */
         I = BE;
         BE1,BP1 = INPUT$END - 1;
         DO WHILE I >= BP;
           MEMORY(BP1) = MEMORY(I);
           I = I - 1;
           BP1 = BP1 - 1;
         END;
         BP1 = BP1 +1;
       END ;
       MEMORY(BP) = CHAR;
       BP = BP + 1;
     END;
     CALL COMPACTIFY;
   END;

   /*CASE J */

   GO TO NOGOOD;

   /*CASE K, KILL 1 TO 254 LINES IN WORKSPACE,
     IF NEGATE = TRUE, KILL LINES ABOVE BUFFER POINTER,
     IF NEGATE =FALSE, KILL LINES BELOW BUFFER POINTER,*/

   DO;
     IF BP> (BP1:=SEARCH) THEN
     DO;
       I=BP;
       BP=BP1;
       BP1=I;
     END;
     CALL COMPACTIFY;
   END;

   /* CASE L,  MOVE POINTER 1 TO 254 LINES,
      IF NEGATE =TRUE, MOVE LEFT,
      IF NEGATE =FALSE, MOVE RIGHT */

   BP= SEARCH;

   /* CASE M */

   GO TO NOGOOD;

   /* CASE N,PUNCH LEADER/TRAILER */

   DO;
     CALL PUNCH$ON;
     CALL LEAD;
     CALL PUNCH$OFF;
   END;

   /* CASE O */

   GO TO NOGOOD;

   /* CASE P */

   GO TO NOGOOD;

   /* CASE Q */

   GO TO NOGOOD;

   /* CASE R */

   GO TO NOGOOD;

   /* CASE S, SUBSTITUTE ONE STRING FOR ANOTHER IN WORKSPACE,
      SEARCH FOR STRING 1, GOTO INSERT, CASE I, TO INSERT
      STRING 2 INTO THE WORKSPACE */

   DO;
     BP1 = (BP:=MATCH) +MATCH$LENGTH;
     GO TO INSERT;
   END;

   /*CASE T, TYPE 1 TO 254 LINES FROM WORKSPACE,
     TYPE OUT LINES ABOVE BUFFER POINTER IF
     NEGATE = TRUE, TYPE FROM BUFFER POINTER
     DOWN IF NEGATE = FALSE */

   DO;
      IF BP <> (I:=SEARCH) THEN
      DO;
        IF BP < I THEN CALL PRINT$STRING(.MEMORY+BP,I-BP-1);
        ELSE CALL PRINT$STRING(.MEMORY+I,BP-I-1);
      END;
    END;

    /* CASE U */

    GO TO NOGOOD;

    /* CASE V */

    GO TO NOGOOD;

    /*CASE W, WRITE 1 TO 254 LINES TO THE PUNCH,
      OUTPUT STARTS AT THE BEGINNING OF THE WORKSPACE,
      LINES OUTPUT ARE DELETED FROM THE WORKSPACE */

    DO;
      NEGATE = FALSE;
      BP = 1;
      BP1= SEARCH;
      CALL PUNCH$ON;
      DO I = 1 TO BP1 - 1;
        CALL PO(MEMORY(I));
      END;
      CALL COMPACTIFY;
      CALL PUNCH$OFF;
    END;

    /* CASE X */

    GO TO NOGOOD;

    /* CASE Y */

    GO TO NOGOOD;

    /* CASE Z, POSITION TO END OF WORKSPACE */

    BP = BE;

    END; /*OF CASE*/
    ELSE

    /* CHARACTER IN INPUT BUFFER NOT RECOGNIZED
       AS LEGAL COMMAND CHARACTER */

 NOGOOD:
    DO;
      IF CHAR > ' ' THEN
      DO;
        CALL PRINT$STRING(.CRLF,LAST(CRLF));
        CALL CO(QUOTE);
        CALL PUT$CHAR(CHAR);
        CALL PRINT$STRING(.ILLGL,LAST(ILLGL));
        CALL READ$COMMAND$STRING;
      END;
    END;
  END;  /*FOREVER*/
END;
 EOF
