MVOLSYSX     ,  -  .        	31-MAR-90                  .Generated by mvol on Mon Apr 09 12:57:57 2012                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             [    	{                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            pl h[J  a h[h  - h[  0b h[   WQ h[    Wz h[
   	g h[L   h[   Az h[    h[   a h[|  _ h[u  ]m+ h[  cBf h[;  iK h[  a h[  iKVO h[M  iK h[|  iK h[    h[   nq h[                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              %List; %list; %list
%include "ACCNT:specs.inc"
%include "ACCNT:DA.inc"
%include "ACCNT:recordIO.inc"
%external %integer %fn %spec SIZE OF (%name object)

%record %format parm fm (%short dsno, dact, ssno, sact,
                         (%integer p1,p2,p3,p4,p5,p6 %or
                          %string(23) text))
%record %format pack fm (%integer unit, user, f1, f2, %string(31) string)

%begin;                                  !EDIT updates/listing

   !streams, files

   %const %integer command = {input} 1,
                   report  = {output}0,
                   listing = {output}1
   %const %string(3) LP dev = "LP:"
   %const %string(31) account file = "ACCNT:MAIN"
   %string(63)%name out1 == string (comreg(4))
   out1 = LP dev %if out1 = ""

   !globals

   %record %format group (%integer unit, user,
                          %byte size,    {no. in group}
                                from, to,{bounds: FRED01..10}
                                single)  {TRUE: no suffix "nn"}

   %const %integer true = 0,  false = 1
   %const %integer fault = {event} 11, to director = {svc} 20
   %own %integer no list = true;         !no listing file generated yet
   %const %record(*)%name null == (0)
   %record(account)%name hdr;            !account file header record
   %const %integer last cmd = 4
   %own %string(15) %array  cmd(1:last cmd+1) =
      "NEW",   "EXILE",  "SHOW",  "EXIT",
      ""
   %own %record(account)%name dummy == null
   %const %integer file = {DA channel no} 1
   %own %integer sep = NL;               !after TOKEN

   !specs

   %routine %spec bit set (%integer j);  !bitmap access procedures
   %routine %spec bit clear (%integer j);!(Map is held n HDR record)
   %routine %spec set bit (%integer j)
   %string(15) %fn %spec itos (%integer n,places)
   %routine %spec error (%string(63) mess); !log MESS & %signal FAULT
   %routine %spec skip;                  !ignore spaces/control chars
   %routine %spec token (%string(15)%name s);   !letters/digits: sets SEP
   %integer %fn %spec lookup (%string(15) s, %string(155)%arrayname table)
   %routine %spec get names (%record(group)%name g); !encode "FRED[m..n]"
   %routine %spec for all (%record(group)%name g,
                           %routine X (%record(pack fm)%name u))
   %routine %spec create user (%record(pack fm)%name u)
   %routine %spec exile user  (%record(pack fm)%name u)
   %routine %spec printaccount(%record(pack fm)%name u)
   %routine %spec paccnt (%record(account) A)
   %routine %spec suffix (%string(*)%name s, %integer suffix)
      !"FRED",3 -> "FRED03"


   !open files

   open (file,SIZE OF(dummy),account file)
   hdr == REC (file,0)
   prompt ("EDIT:")

   %record(account)%name A
   %integer j
   %string(15) s
   %record(group) g
   %switch C(1:last used)
   %label CC

   %cycle
      skip symbol %and skip %while next symbol = NL
      token (s)
      j = look up (s,cmd)
      %if j < 0 %start
C(*):    error (s . "?")
      %finish
      -> C(j)
      C(1): !new <users>
            get names (g);               !<users>
            for all (g,create user)
            ->CC
      C(2): !exile <users>
            get names (g)
            for all (g,exile user)
            ->CC
      C(3): !show <users>
            skip
            %if next symbol = NL %start
               %for j = offset, 1, max user + offset %cycle
                  %if bit set (j) %start
                     A == REC (file,j)
                     Paccnt (A) %if A_user # 0
                  %finish
               %repeat
            %else
               get names (g)
               for all (g,print account)
            %finish
            ->CC
      C(4): !exit
            close account file
            close (file)
            select output (listing)
            %if no listing = true %then abandon output %c
                                  %else close output
            %stop
CC:   skip
      error (" ignored") %if next symbol # NL
   %repeat

   
   %routine error (%string(63) mess)
      print symbol ('*')
      %if next symbol # NL %start
         print symbol ('"')
         %while next symbol # NL %cycle
            print symbol (next symbol)
            skip symbol
         %repeat
         print symbol ('"')
         space
      %finish
      print string (mess)
      newline
      %signal fault
   %end

   %routine skip
      skip symbol %while next symbol <= ' '
   %end

   %routine token (%string(15)%name t)
      %integer ch
      t = "";  skip
      %cycle
         ch = next symbol
         ch = ch - 'a' + 'A' %if 'a' <= ch <= 'z'
         %exit %unless 'A' <= ch <= 'Z' %or '0' <= ch <= '9'
         t <- t . to string (ch)
      %repeat
      sep = ch
      skip symbol %if ch # NL
      skip
   %end

   %integer %fn lookup (%string(15) s, %string(15)%arrayname table)
      %string(15)%name t
      %integer j = 0
      %cycle
         j = j + 1;  t == table(j)
         %result = -1 %if t = ""
         %result = j %if s = t
      %repeat
   %end

   %routine get names (%record(group)%name g)
      %record(pack fm) u,v
      %string(15) t
      %label NO DOT
      u_string = ""
      g = 0;  g_size = 1;  g_single = true
      %cycle
         token (t);  u_string <- u_string . t
         %exit %if sep = NL %or sep = ',' %or sep = '['
         u_string <- u_string . to string (sep)
      %repeat
      u_string = u_string . ":" %if u_string = "" %or
                                char no (u_string,length(u_string)) # ':'
      pack (u)
      error (u_string . " invalid username") %if u_user < 0 %or
                                                 u_f1 # 0 %or u_f2 # 0
      g_unit = u_unit;  g_user = u_user
      %if sep = '[' %start
         g_single = false
         v = 0;  v_user = u_user;  unpack (v)
         suffix (v_string,99);           !FAULT signalled if too long
         token (t)
         g_from = stoi (t)
         %if sep # '.' %start
NO DOT:     error ("expecting '.'")
         %finish
         token (t);  -> NO DOT %if t # "" %or sep # '.'
         token (t);  g_to = stoi (t)
         g_size = g_to - g_from + 1
         error ("Bounds inside-out") %if g_size <= 0
         error ("expecting ']'") %if sep # ']'
         token (t)
         error (t . "?") %if t # ""
      %finish
      %return %if sep = ',' %or sep = NL
      error (to string(sep) . "?") %if sep # ':';   !optional : in username
      token (t)
      error (t . "?") %if t # ""
   %end

   %routine for all (%record(group)%name g,
                     %routine X (%record(pack fm)%name u))
      !G is expanded as a list of packed usernames.
      !We call X to process each user in the list.
      %record(pack fm) u = 0
      %integer who = g_user, j
      %string(31) s
      u_unit = g_unit;  u_user = who
      %if g_single = true %then X(u) %else %start
         unpack (u)
         s = u_string
         length(s) = length(s) - 1;      !lose ':' from username
         %for j = g_from, 1, g_to %cycle
            u_string = s
            suffix (u_string,j)
            pack (u)
            X(u)
         %repeat
      %finish
   %end

   %routine suffix (%string(*)%name s, %integer n)
      %string(63) u = s;  length(u) = length(u) - 1
      %string(3)  t
      error (itos(suffix,0) . " not in 0..99") %unless 0 <= suffix <= 99
      t = itos (suffix,2)
      char no (t,1) = '0' %if char no (t,1) = ' '
      error (u . t . ":  too long") %if length(u) + length(t) > 6
      s = u . t . ":"
   %end

   %string(15) %fn itos (%integer n,places)
      %string(15) s = ""
      %integer sign = n;  n = |n|
      %cycle
         s = to string (rem(n,10)+'0') . s
         n = n // 10
      %repeat %until n = 0
      s = "-" . s %if sign < 0
      s = " " . s %while length(s) < places
      %result = s
   %end

   %routine paccnt (%record(account) A)
      %record(pack fm) u = 0
      u_unit = A_unit;  u_user = A_user
      unpack (u)
      print string (u_string)
      newline
   %end

   %routine print account (%record(pack fm)%name u)
      %record(account)%name A == USER INFO (u_user)
      %return %if A_user = 0;            !non-existant user
      paccnt (A)
   %end

   %routine create user (%record(pack fm)%name u)
      %record(account)%name new == USER INFO (u_user)
      %record(parm fm) P
      P_p1 = u_unit;  P_p2 = u_user;  P_p3 = packed PASS
      P_dact = 31;                       !new user
      SVC (to director,P)
      %if P_p6 # 0 %start
         unpack (u)
         print string ("*Create " . u_string . " fails -- ")
         print string (P_text)
         newline
         %return
      %finish
      %if new_user # 0 %start
         unpack (u)
         print string (u_string . " already exists")
         newline
         %return
      %finish
      new_unit = u_unit;  new_user = u_user
      set bit (new_index);               !accnt record holds own index
   %end

   %routine exile user (%record(pack fm)%name u)
      %record(account)%name who == USER INFO (u_user)
      %record(parm fm) P
      %integer index
      P_p1 = u_unit;  P_p2 = u_user
      P_dact = 32;                       !EXILE
      SVC (to director,P)
      %if P_p6 # 0 %start
         unpack (u)
         print string ("*Exile " . u_string . " fails -- ")
         print string (P_text)
         newline
         %return
      %finish
      %if who_user = 0 %start
         print string ("*Exile fails -- ")
         unpack (u)
         print string (u_string . " does not exist")
         newline
         %return
      %finish
      index = who_index;                 !splat account, preserve INDEX
      who = 0
      who_index = index
      clear bit (who_index)
   %end

   %routine set bit (%integer j)
      %integer k = j>>3, m = j&7
      hdr_abyte(j) = hdr_abyte(j) ! 1<<m
   %end

   %routine clear bit (%integer j)
      %integer k = j>>3, m = j&7
      hdr_abyte(j) = hdr_abyte(j) & (\(1<<m))
   %end

   %predicate bit set (%integer j)
      %integer k = j>>3, m = j&7
      %true %if hdr_abyte(j) & 1<<m # 0
      %false
   %end

%end %of %program
 H?    /                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    $a escape='/'
/a left=10
/l1um
System Disc Organisation
/p
This document describes the intended use of the various directories on the
system disk in an attempt to prevent chaos resulting from the proliferation
of multiple copies of the same program or module.
/p There is no enforcing mechanism so adherence is entirely voluntary!!
/b3
/a indent=+1
/t-
%Process name
/b /t-
*BLURB /t+ sundry files (LAYOUT format) describing contents of system disc
/b /t-
SUPER /t+ contains all the components and the means of generating a loadable
image of the resident supervisor.
/b2 /t-
SUBSYS /t+ contains source and object of subsystem proper (SUBSYS) and
immediately associated modules (SUBINIT, STANDARD, BATCH, MDIAG).
/b /t-
*SYSINC /t+ contains 'include' files for subsystem externally linked
data structures etc.
*SYSEXE /t+ contains object modules of generally-available utility programs,
notably, drivers for compilers, 'HELP' scheme, LIST, COMPARE, editors.
/b /t-
OPER /t+ operator process - also contains object of various operator-specific
utilities. For example OP (expanded/ command/ set), DISC (filesystem/ compactor),
ARCHIVE (disc//tape dump//restore/ utility),
SPY (disc//store/ poker), CDUMP (crash/ dumper)
/b /t-
OPSRC /t+ source versions of operator-specific utilities.
/b /t-
SPOOL /t+ source and object of all system spoolers and spool queue manager
/b /t-
*SYSLIB /t+ contains libraries for basic language support (MATHLIB, RECORDIO etc)
/b /t-
LIBSRC /t+ source versions of SYSLIB contents.
/b /t-
IMP /t+ IMP-77 compiler source and object. Also, all the support software
necessary to maintain it and it's perm.
IMPS /t+ 'old' IMP compiler - required meantime to support original supervisor.
/b /t-
HELP /t+ general 'help' program and data file for system information
/b /t-
IBM /t+ magnetic tape support, especially IBM standard labelled.
/b /t-

/p Those directories whose names are marked with a '*' above should have
their access control flags set so that all users can display the directory
contents.
/a indent=-1
/b2
%Maintenance
/p In order to delay the onset of chaos and anarchy, altering of modules should
be done by copying the %whole process in which they reside, modifying
the copy then %after/ testing, copying the whole process back again.  
Prior to this, the original process should be archived onto tape so
it can be put back again should the need arise.
 /b BETTER SUGGESTIONS
PLEASE!!!!!
/p Any adequate scheme must avoid the proliferation of sources and objects
of questionnable or plain unknown parentage.
 H?    D                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     @?   @ PmWzC                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              !Mag tape archiving program

%begin
   %conststring(10) version = "1.4"
   %constinteger H = x'FFFF'
   %recordformat parmfm(%shortinteger dsno, dact, ssno, sact, %c
                        %integer p1, p2, p3, p4, p5, p6)
   %recordformat filefm(%integer name1, name2, %c
                        %shortinteger spine, day)
   %recordformat dirfm(%shortinteger mark, %c
                       %byteinteger access, check, %c
                       %shortinteger chain, %c
                       %byteinteger spare, daccess, %c
                       %record(filefm)%array file(1:42))
   %recordformat packfm(%integer unit, owner, name1, name2)
   %recordformat blockfm(%string(59) text, %shortinteger index, spare)
   %record(blockfm) BL
   %owninteger file number = 0
   %integer exclam;  exclam = comreg(2)

   %record(packfm) F
   %record(packfm) owner
   %ownstring(63) em = "***end***"
   %ownstring(63) eot= "***end of tape***"
   %string(63) unit, username
   %ownstring(63) head text = "***no label***"
   %string(63) word, key
   %owninteger sym = ' ', sp = ' ', used = 0
   %string(15)%name int
   %integer error, unit no, x
   %constinteger user list = 301
   %byteintegerarray b(0:2047)

   %routinespec release tape
   %routinespec rewind

   %routine prepare terminal
      %record(parmfm) P
      p_p1 = 1;  p_p2 = 0;  p_p3 = 0;  svc(29, p); !width=0
      p_p1 = 2;  p_p2 = 0;  p_p3 = 0;  svc(29, p); !page =0
      p_p1 = 100000;  svc(21, p);                  !time =100000
   %end
   %routine stop
      rewind
      release tape
      %stop
   %end
   %routine report(%string(63) text, %integer value)
      selectoutput(0)
      printstring(text)
      write(value, 0) %if value # 0
      newline
      selectoutput(1)
   %end
   %routine pack(%string(31) file, %record(packfm)%name f)
      %record(parmfm) P
      string(addr(p_sact)) = file
      svc(17, p)
      f_unit = p_p1
      f_owner = p_p2
      f_name1 = p_p3
      f_name2 = p_p4
   %end
   %routine unpack(%record(packfm)%name f, %string(31)%name file)
      %record(parmfm) p
      p_p1 = f_unit
      p_p2 = f_owner
      p_p3 = f_name1
      p_p4 = f_name2
      svc(18, p)
      file = string(addr(p_sact))
   %end

   %routine read block(%integer block no, %record(dirfm)%name dir)
      %record(parmfm) p
      p_sact = 1
      p_p1 = block no&H
      p_p2 = addr(dir)
      p_p3 = unit no
      p_p4 = 0
      svc(101, p)
      %if p_p1 # 0 %start
         select output(0)
         printstring("Read block ")
         write(block no, 0)
         printstring(" on unit ");  write(unit no, 0)
         printstring(" fails ");  write(p_p1, 0)
         newline
         stop
      %finish
   %end

   %routine read sym
      readsymbol(sym)
      sym = sym-32 %if 'a' <= sym <= 'z'
   %end
   %routine read(%integername n)
      %integer s
      n = 0
      %cycle
         read sym
         %return %if sym = nl
         %unless '0' <= sym <= '9' %start
            n = -1
            printstring("Invalid file number");  newline
            %return
         %finish
         n = n*10+(sym-'0')
      %repeat
   %end
   %routine read word(%string(63)%name s)
      s = ""
      read sym %while sym = ' '
      %cycle
         %exit %if sym = sp %or sym = nl
         s = s.tostring(sym)
         read sym
      %repeat
      sp = ' '
   %end

!Tape operations

   %routine claim tape
      %record(parmfm) p
      p_dact = 1;  svc(105, p)
      report("Tape already claimed - force released", 0) %if p_p6 # 0
   %end
   %routine release tape
      %record(parmfm) p
      p_dact = 2;  svc(105, p)
   %end
   %routine function(%integer n)
      %record(parmfm) p
      p_dact = 10;  p_p1 = n;  svc(105, p)
      error = p_p6
   %end
  %routine clear
      function(1)
      report("Clear fails ", error) %if error # 0
   %end
   %routine tape mark
      function(2)
      report("Tape mark fails ", error) %if error # 0
   %end
   %routine rewind
      function(3)
   %end
   %routine skip forward
      function(4)
      report("Skip forward fails ", error) %if error # 0
   %end
   %routine skip reverse
      function(5)
      report("Skip reverse fails ", error) %if error # 0
   %end
   %routine backspace
      function(6)
      report("Backspace fails ", error) %if error # 0
   %end
   %routine read tape(%integer buffer, size)
      %record(parmfm) p
      p_dact = 8;  p_p2 = buffer;  p_p4 = size
      svc(105, p)
      error = p_p6
   %end
   %routine writetape(%integer buffer, size)
      %record(parmfm) p
      p_dact = 9;  p_p2 = buffer;  p_p4 = size
      svc(105, p)
      error = p_p6
   %end

   %integerfn find unit no(%integer packed unit)
      %record(parmfm) p
      %result = 0 %if packed unit = 0
      p_dact = 45;  p_p1 = packed unit;  svc(20, p)
      %if p_p6 # 0 %start
         report(string(addr(p_p1)), p_p6)
         %result = 0
      %finish
      %result = p_p1
   %end
   %routine terminate
      %record(blockfm) bl
      bl_text = eot
      bl_index = file number
      write tape(addr(em), 63)
      tape mark
      write tape(addr(BL), 63)
   %end
   %routine skip to end
      %record(blockfm) BL
      function(5);      !skipr
      %cycle
         skip forward
         read tape(addr(bl), 63)
         %exit %if bl_text = eot
      %repeat
      file number = bl_index
      backspace
   %end
   %routine dump header
      %string(63) h
      skip to end
      h = head text." on ".date." at ".time
      write tape(addr(h), 63)
      printstring("Adding label - ");  printstring(h);  newline
   %end

   %routine dump file(%record(filefm)%name file)
      %record(blockfm) BL
      %integer p, s, index, bp
      %byteintegerarray buf(1:512)
      %record(parmfm) fp, ap
      %record(packfm) f
      %return %if file_name2 = 0
      f_unit = owner_unit;  f_owner = owner_owner
      f_name1 = file_name1;  f_name2 = file_name2
      unpack(f, bl_text)
      fp_p1 = f_unit
      fp_p2 = f_owner
      fp_p3 = f_name1
      fp_p4 = f_name2
      ap = fp;                     !save for later
      fp_dact = 4
      svc(20, fp)
      index = fp_p5
      %if fp_p6 # 0 %start
         report("Cannot open ".BL_text." -- ".string(addr(fp_p1)), 0)
         %return
      %finish
      %if used # 0 %and fp_p4&x'C000' = 0 %start
         fp_dact = 11;  fp_p5 = index;  svc(20, fp)
         %return
      %finish
      printstring("<- ".BL_text);  newline
      b(0) = 255
      file number = file number+1;  bl_index = file number
      write tape(addr(BL), 63)
      p = 0;  bp = 512
      %cycle
         %if bp = 512 %start
            bp = 0
            fp_dact = 7;  fp_p4 = addr(buf(1));  fp_p5 = index
            svc(20, fp)
            %exit %if fp_p6 < 0
         %finish
         bp = bp+1;  p = p+1;  b(p) = buf(bp)
         %if p = 2047 %start
            p = 0
            write tape(addr(b(0)), 2048)
            %exit %if int # ""
         %finish
      %repeat
      int = ""
      %while p < 2047 %cycle
         p = p+1;  b(p) = 4
      %repeat
      b(0) = 0
      write tape(addr(b(0)), 2048)
      tape mark
      fp_dact = 11; fp_p5 = index;  svc(20, fp)
      printstring("Close fails -- ".string(addr(fp_p1))) %if fp_p6 # 0
      %if used # 0 %start
         ap_dact = 46;  svc(20, ap);         !remove usage bits
      %finish
   %end
   %routine dump user(%record(filefm)%name file)
      %integer j
      %record(dirfm) spine
      %return %if file_name2 = 0
      owner_owner = file_name1
      unpack(owner, user name)
      printstring("Dumping ".username);  newline
      read block(file_spine, spine)
      %for j = 1, 1, 42 %cycle
         dump file(spine_file(j))
         %exit %if int # ""
      %repeat
      int = ""
   %end
   %routine dump user files(%record(packfm)%name f)
      %integer j
      %record(dirfm) users
      owner_unit = f_unit;  owner_name1 = 0;  owner_name2 = 0
      unit no = find unit no(f_unit)
      %return %if unit no = 0
      read block(user list, users)
      dump header
      %for j = 1, 1, 42 %cycle
         %exit %if int # ""
         %if f_owner = users_file(j)_name1 %or f_owner = 0 %start
            dump user(users_file(j))
         %finish
      %repeat
      terminate
      int = ""
   %end
%routine read file(%string(63)%name header, %record(packfm)%name ff)
      %integer k, limit
      %string(63) new file
      %record(packfm) f
      pack(header, f)
      %return %if ff_unit # 0 %and ff_unit # f_unit
      %return %if ff_owner # 0 %and ff_owner # f_owner
      %if ff_name1 # 0 %or ff_name2 # 0 %start
         %return %if ff_name1 # f_name1 %or ff_name2 # f_name2
      %finish
      printstring("-> ".header);  newline
      f_unit = 0;  f_owner = 0
      unpack(f, new file)
      open output(2, new file)
      %if comreg(0) # 0 %start
         report("Cannot create ".new file, 0)
         %return
      %finish
      select output(2)
      %cycle
         read tape(addr(b(0)), 2048)
         k = 1
         limit = 2048
         %if b(0) = 0 %start
            limit = limit-1 %while b(limit-1) = 4
         %finish
         %while k # limit %cycle
            printsymbol(b(k))
            k = k+1
         %repeat
         %exit %if b(0) = 0
      %repeat
      close output
      select output(1)
   %end
   %routine restore user files(%string(63) which, %integer x)
      %record(blockfm) BL
      %record(packfm) f
      %if which = "" %or x # 0 %start
         f = 0
      %else
         pack(which, f)
      %finish
      %cycle
         skip forward
         read tape(addr(bl), 63)
         %exit %if bl_text = eot
         printstring("Label: ".bl_text);  newline
         %cycle
            read tape(addr(bl), 63)
            %exit %if bl_text = em %or int # ""
            %if x = 0 %or bl_index&H = x %start
               read file(bl_text, f)
               %return %if x # 0
            %finish
            skip forward
         %repeat
         %exit %if int # ""
      %repeat
      int = ""
      rewind
   %end
%routine analyse tape(%record(packfm)%name f)
   %record(blockfm) BL
   %string(63) label
   %record(packfm) ff
   %integer k
   rewind
   read tape(addr(bl), 63)
   printstring("Tape identifier: ".bl_text);  newlines(2)
   %cycle
      skip forward
      read tape(addr(bl), 63)
      ->err %if error # 0
      %exit %if bl_text = eot
      label = bl_text
      %cycle
         %if int # "" %start
            int = ""
            rewind
            %return
         %finish
         read tape(addr(bl), 63)
         %if error # 0 %start
err:         report("Tape read error ", error)
            %return
         %finish
         %exit %if bl_text = em
         pack(bl_text, ff)
         %if ff_owner >= 0 %start
            %if (f_unit = 0 %or f_unit = ff_unit) %and %c
                (f_owner = 0 %or f_owner = ff_owner) %start
               %if label # "" %start
                  newlines(2);  printstring("Label: ".label)
                  newline
                  k = 0
                  label = ""
               %finish
               newline %and k = 3 %if k <= 0
               k = k-1
               write(bl_index&H, -8);  space
               print string (bl_text);  spaces (30 - length(bl_text)) %if k # 0
            %finish
         %finish
         skip forward
      %repeat
   %repeat
   newline;  printstring("***end of tape***");  newline
%end

int == string(comreg(15))

printstring("Archive version ".version);  newlines(2)

claim tape
prepare terminal
rewind
%if exclam = 0 %start;               !old tape
   read tape(addr(bl), 63)
   printstring("Tape ".bl_text);  newline
   skip forward
%finish
prompt("Archive:")
%cycle
   used = 0
   int = ""
   read word(word)
   %if word = "DUMP" %start
      read word(word)
      %if word = "USER" %start
         read word(word)
         pack(word.":", f)
         dump user files(F)
      %else %if word = "UNIT"
         read word(word)
         pack(word."_x:", f)
         f_owner = 0
         dump user files(f)
      %else
         report("UNIT or USER wanted", 0)
      %finish
   %else %if word = "IDUMP"
      read word(word)
      pack(word."_X:", f)
      f_owner = 0
      used = 1
      dump user files(f)
   %else %if word = "RESTORE"
      rewind
      x = 0
      read sym %while sym = ' '
      %if sym = '#' %start
         read(x)
         restore user files("", x) %if x > 0
      %else
         read word(key)
         read word(word)
         %if key = "UNIT" %start
            restore user files(word."_:", 0)
         %else %if key = "USER"
            restore user files(word.":", 0)
         %else %if key = "FILE"
            restore user files(word, 0)
         %else
            report("UNIT, USER, or FILE wanted", 0)
         %finish
      %finish
   %else %if word = "ANALYSE"
      read word(word)
      f = 0
      pack(word.":", f) %unless word = ""
      analyse tape(f)
   %else %if word = "LABEL"
      sp = 0;  read word(head text)
      length(head text) = 31 %if length(head text) > 31
   %else %if word = "INITIALISE"
      %if exclam = 0 %start
         printstring("Initialise not permitted");  newline
         %continue
      %finish
      rewind
      sp = 0;  read word(word)
      word = word." - Dated ".date." at ".time
      rewind
      tape mark
      skip reverse
      write tape(addr(word), 63)
      tape mark
      BL_text = EOT;  BL_index = 0;  BL_spare = 0
      write tape(addr(BL), 63)
      printstring("Tape identified as ".word);  newline
   %else %if word = "HELP" %or word = "?"
      select output(0)
      printstring("
Analyse
Analyse unit extn
Analyse user fred
Dump unit extn
Dump user sys5_fred
Idump unit
Exit
Help
Initialise tape-id
Label anything
Restore unit extn
Restore user extn_fred
Restore file extn_fred:file1.imp
Restore # filnum
")
      selectoutput(1)
   %else
      stop %if word = "EXIT" %or word = "STOP"
      report("Unknown command ".word, 0) %unless word = ""
   %finish
   read sym %while sym # nl
   sym = ' '
%repeat
%endofprogram
 H?    K                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     @?   @  Z  I                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              !
!The currently available disc utility commands are:
!
!     DISC(TEST) disc/,listing
!           Check the integrity of logical disc unit 'disc'.  A listing
!           of the names and sizes {FILENAME (blocks,extents)} of all
!           files on that disc are sent to output stream 2 ('listing')
!           'Disc' is either the logical name of a loaded disc unit,
!           (e.g. "SYS7","EXTN") or the unit number of the drive the
!           logical disc is mounted on, preceded by a '#'.  E.g. '#1'
!           (the first cartridge disc, device address X'C6').
!           'Listing' may be any valid output stream destination, a
!           queue, (LP:, PP:) a file (FRED.LST, $1) or a device (T:).
!
!     DISC(COMPRESS) disc1/disc2,listing
!           The logical contents of 'disc1' are copied onto 'disc2',
!           being compressed into a minimally fragmented form in the
!           process.  A 'listing' of the output disc may be produced
!           if required.   Examples:
!              DISC(COMPRESS) SYS7/#5
!              DISC(COMPRESS) #1/JIM,LP:newJIM.lst
!
!     DISC(COPYUSERS) disc1/disc2,listing
!     DISC(COPYUSER)  disc2/disc2,listing
!        These two are synonymous, and perform the same function as
!        COMPRESS, on a selected group of users from 'disc1'.  When
!        the program starts, you will be prompted "Copy:", to which
!        you should reply with a list of usernames from 'disc1', seperated
!        by commas or newlines, and terminated by the dummy name ".END".
!        E.g.  DISC(COPYUSER) FRED/JIM
!              Copy: XXX, YYY
!              Copy: A, BB
!              Copy:.end
!        (This will copy users FRED_XXX, FRED_YYY, FRED_A and FRED_BB
!        onto disc JIM.  ***JIM WILL BE OTHERWISE EMPTY AFTER THIS
!        OPERATION***, i.e. any existing users on JIM will be overwritten).
!
!     DISC(TIDY) disc
!        The free list on 'disc' is reconstructed.  As many 'lost blocks'
!        as possible are reclaimed and put on the new free list.
!
!     DISC(COPY) disc1/disc2
!        This operation is a mindless track-by-track image dump of disc1
!        onto 'disc2'.  No compression is performed.  Note that if an
!        attempt is made to copy a disc onto a different physical type
!        of unit, block zero in the dumped disc will indicate the old
!        type of drive, this should be avoided.  COPY is mainly to
!        enable the operator make copies of discs not recorded in MOUSES
!        format.  (Any disc may be copied since no interpretation is placed
!        on the data on the disc: the number of blocks to be copied is
!        prompted for at the operator's console).
!
!     DISC(INITIALISE) /disc
!        The operator supplies various bits of information to be recorded
!        on block zero of 'disc' to identify it in the future. (Volume
!        serial number, disc name and description etc).  The directory
!        structure of the 'disc' is then wiped clean, leaving no users
!        with no files on the disc.
!        All 'blank' discs when received by an installation must be
!        initialised before the system will LOAD them.
!
!     DISC(WIPE) /disc
!        As for initialise, except that the contents of block zero remain
!        unaltered.  Used to clean out a corrupted disc.
!
!     DISC(ZERO) /disc
!        Allows the operator to alter the contents of block zero.
!        (In order to resurrect dead discs).  Pointers in block zero
!        (to free list etc) are simply set to their preferred values
!        while keeping fingers firmly crossed...
!
!     DISC(KILL) /disc
!        Block zero of the 'disc' is overwritten with an invalid pattern.
!        All data on the disc is destroyed.  The disc can no longer be LOADed
!        by the system.  (It must be re-INITIALISEd first).
!\
!
!New MOUSES disc utility program.        A. Culloch,  July 1980.
%const %string(31) version = "V2.02"
!2.02: Bug fix in COPY SYSTEM.  30-JUN-81 (ADC)

%include "sysinc:command.inc"

%const %string(31) program source = "crash:DISC"

%external %routine %spec doing (%string(12) activity)
!User may interrogate current value of ACTIVITY by
!using the system's '^G' facility.

!System message format
%include "SYSINC:PARMFM.INC"

!File system disc block formats

%record %format extent  (%short length,  {# of contiguous blocks in extent}
                         %short base)    {disc addr of first block}
%record %format spine   (%short extents, {# of extents in file}
                         %byte  access permissions,
                                check,   {should always be '?'}
                         %integer blocks,{# of blocks in file}
                         %record(extent) %array extent (1:126))

%record %format file    (%integer name1, name2,   {packed filename}
                         %short spine block,      {disc addr of file's spine}
                         %short day)              {date last written}
%const %integer dollar hash = x'C000 0000'        {&NAME1#0 => temp file}
%record %format directory(%short files,  {# of files in directory}
                         %byte  access rights,    {user access}
                         %byte  check,            {always '?'}
                         %short unused,
                         %byte  spare,
                         %byte  access permissions,{directory access}
                         %record(file) %array file (1:42))

%record %format user    (%integer name, password,
                         %short   dir block,      {disc addr of user dir}
                         %short   spare)
%record %format userlist(%short   users, spare1,  {# of users on unit}
                         %integer spare2,
                         %record(user) %array user (1:42))

!Block zero on every logical disc

%record %format zero fm (%integer vol id,         {m'VOLN'}
                         %string(7) disc id,      {"SVOL"}
                         %integer   free list,    {free blocks spine}
                                    user list,    {user catalog}
                                    defective list,{bad blocks list}
                         %integer   system area,  {start of system image}
                                    system size,  {N contiguous blocks}
                         %string(11)initialisation date,
                         %integer   tracks,       {physical disc info}
                                    blocks per cylinder,
                                    heads,
                         %integer   initialised,  {=0 => Disc WIPED O.K.}
                         %integer   copied,
                         %integer   checksum,     {sum(blockzero)-1 = 0}
                         %string(187) description,{of logical disc contents}
                         %integer marked,   {V2.00+: Disc INITIALISED O.K.}
                         %byte %array spare (1:252))

%record %format block   (%record(spine) S %or
                         %record(directory) D %or
                         %record(user list) U %or
                         %record(zero fm) Z)   {bad blocks list and free
                                               {list are just perverted
                                               {spine blocks

!System constants

%const %integer disc read = 101          {read from absolute disc address}
%const %integer disc write = 102         {write absolute disc block}
%const %integer read segment = 106       {read N contiguous blocks at abs disc ad}
%const %integer write segment = 107      {write N contiguous blocks}
%const %integer disc status = 108
%const %integer pack filename = 17
%const %integer unpack filename = 18
%const %integer to director = 20
%const %integer unit name = 40
%const %integer find disc = 45           {map packed disc-id => unit#}

%begin
   !Events trapped in program
   %const %integer input ended = 9       {end of file}
   %const %integer total failure = 11    {signalled by GET space routine}

   {I/O stream names}
   %const %integer console = 0, listing = 2, help text = 3

   %record %format disc (%integer unit no,     {unit# disc is mounted on}
                         %integer unit,        {packed unit-name}
                         %integer blocks,      {size of logical disc}
                         %integer FP,          {first free block pointer}
                         %integer prot,        {non-zero => write-prot disc}
                         %integer errors,      {# of errors found on disc}
                         %record(zero fm) zero,{copy of block zero}
                         %integer %array bitmap (0:2047))

   %record(disc) in, out                 {disc descriptors}

   %const %integer H = 16_FFFF           {halfword mask}
   %const %integer non zero = 1
   %const %integer sys size = 256        {size of system image on disc}
   %const %integer default free list=300 {preferred value}
   %const %string(31) corrupt = " corrupt pointer to ",
                      nocheck = " invalid check byte in " {error messages}
   %const %integer commands = 13
   %const %string(15) %array command word (1:commands) =
      "TEST",                            {perform integrity checks on disc}
      "COMPRESS",                        {copy & compress logical disc unit}
      "INITIALISE",                      {let operator set up disc block zero}
      "WIPE",                            {clear directory structure on disc}
      "KILL",                            {write bad block zero onto disc}
      "ZERO",                            {alter selected fields in block 0}
      "COPY",                            {brainless copy of N blocks}
      "HELP",                            {copy the start of the source to TTY}
      "COPYUSER",                        {compress selected users from a disc}
      "COPYUSERS",                       {synonymous with COPYUSER}
      "TIDY",                            {recreate free list on disc}
      "RENAME",                          {alter logical name of a disc}
      "LIST"                             {just user listing}
   %const %integer single block = 1      {mnemonic}
   %integer errors = 0                   {see ERROR logging routine}
   %integer testing = 0                  {#0 => "TEST" parameter given}
   %integer splatting = 0                {#0 to inhibit block-0 validation
                                         {in the SET DISC routine}
   %integer copy user {flag} = 0         {#0 => only copy selected users}
   %integer wanted users = 0             {number of the chosen few}
   %integer exclam = COMMAND_modifier
   %integer %array wanted user (1:42)    {Their packed names}

   %routine clear out
      errors = 0
      testing = 0
      splatting = 0
      copy user = 0
      wanted users = 0
   %end

   %predicate wanted (%integer packed name)
      %integer j
      %for j = 1,1,wanted users %cycle
         %true %if packed name = wanted user (j)
      %repeat
      %false
   %end


   !Utility routines

   %integer %fn stoi (%string(15) s)
      %byte %name b
      %integer j = 0, k, sign = 1
      %result = 0 %if s = ""
      sign = -sign %if s -> ("-") . s
      %for k = 1,1,length(s) %cycle
         b == char no (s,k)
         %result = -1 %unless '0' <= b <= '9'
         j = 10*j + (b-'0')
      %repeat
      %result = sign*j
   %end

   %string(15) %fn itos (%integer j)
      %string(15) s = ""
      %integer n = | j |
      %cycle
         s = to string (rem(n,10)+'0') . s
         n = n // 10
      %repeat %until n = 0
      s = "-" . s %if j < 0
      %result = s
   %end

   %routine normalise (%string(*)%name s)   {Kill ' 's & force upper case}
      %string(63) t
      %byte %name b
      %integer j
      s = s . t %while s -> s . (" ") . t
      %for j = 1,1,length(s) %cycle
         b == char no (s,j)
         b = b - 'a' + 'A' %if 'a' <= b <= 'z'
      %repeat
   %end

   %routine scan (%string(*)%name s)
      %on %event input ended %start
         s = s . ",.END";  %return
      %finish
      s <- ""
      skip symbol %while next symbol <= ' '
      %while next symbol >= ' ' %cycle
         s <- s . to string (next symbol)
         skip symbol
      %repeat
      normalise (s)
   %end

   %routine set bit (%integer %array %name bitmap, %integer index)
      %integer j = index>>5, k = index&31
      bitmap(j) = bitmap(j) ! 1<<k
   %end

   %routine clear bit (%integer %array %name bitmap, %integer index)
      %integer j = index>>5, k = index&31
      bitmap(j) = bitmap(j) & (\(1<<k))
   %end

   %predicate bit set (%integer %array %name bitmap, %integer index)
      %integer j = index>>5, k = index&31
      %true %if bitmap(j) & 1<<k # 0
      %false
   %end

   %routine report (%string(63) message)
      print string (message);  newline
   %end

   !Allocate buffer space for multiblock disc transfers
   %integer buf len = (FREE SPACE {on stack} - 8000 {safety})//512 {blocks}
   %record(block) %array buf (1:buf len)
   
   %routine error (%string(63) message)
      report ("*" . message);  errors = errors + 1
   %end

   %predicate valid block (%record(disc)%name D, %integer block no)
      block no = block no & H
      %false %unless 0 <= block no <= D_blocks %and
                     (%not bit set (D_bitmap,block no))
      set bit (D_bitmap, block no)
      %true
   %end

   %predicate valid extent (%record(disc)%name D, %record(extent)%name x)
      %integer base, length, j
      base = x_base&H
      length = x_length&H
      %false %unless length > 0 %and 0 <= base < D_blocks %and
                     base + length <= D_blocks
      %for j = base, 1, base + length - 1 %cycle
         %false %if bit set (D_bitmap,j) {overlaps blocks on other files?}
         set bit (D_bitmap,j)
      %repeat
      %true
   %end

   %integer %fn checkword (%record(zero fm)%name Z)
      !Calc check word for block zero
      %integer j, k = 0
      k = k + integer(j) %for j = addr(Z), 4, addr(Z) + 512 - 4
      %result = 1 - k
   %end

   %byte %fn checksum (%record(*)%name spine)
      %integer j, k
      k = 0;  k = k + byte integer(j) %for j = addr(spine),1,addr(spine) + 511
      %result = (-k) & 16_FF
   %end

   %routine read block (%record(disc)%name D, %integer block no,
                        %record(*)%name buffer)
      %record(parm fm) P
      P_p1 = block no&H;  P_p2 = addr(buffer);  P_p3 = D_unit no;  P_p4 = 0
      SVC (disc read,P)
      %if P_p1 # 0 %start
         report ("Disc read error " . itos(P_p1) . " from unit #" . %c
                 itos(D_unit no) . " at block #" . itos(block no))
      %finish
   %end

   %routine write block (%record(disc)%name D, %integer block no,
                         %record(*)%name buffer)
      %record(parm fm) P
      %return %if D_unit no = 0 {null}
      P_p1 = block no&H;  P_p2 = addr(buffer);  P_p3 = D_unit no;  P_p4 = 0
      SVC (disc write,P)
      %if P_p1 # 0 %start
         report (D_zero_disc id . " protected") %and %stop %if D_prot # 0
         report ("Disc write error " . itos(P_p1) . " to unit #" . %c
                 itos(D_unit no) . " at block #" . itos(block no))
         %stop
      %finish
   %end

   %routine list (%record(disc)%name D)
      !Uses CLEAR BIT rather than splatting D_BITMAP
      !before traversing the disc so that the operation
      !is transparent as far as the bitmap is concerned
      %record(parm fm) P
      %record(spine) spine block
      %record(user list) users
      %integer j, k, files, user count, blocks, total, free
      %string(63) s
      %record(user)%name u
      %record(directory) dir
      %record(file)%name f
      doing ("Disc listing")
      select output (listing)
      report ("Dump of " . D_zero_disc id)
      clear bit (D_bitmap,D_zero_user list)
      %return %unless valid block (D,D_zero_user list)
      read block (D,D_zero_user list,users)
      user count = 0;  total = 0
      %for j = 1,1,42 %cycle
         u == users_user(j)
         %if u_name # 0 %start
            user count = user count + 1
            newline
            P = 0;  P_p2 = u_name;  SVC (unpack filename,P)
            report (P_filename)
            clear bit (D_bitmap,u_dir block) %if 0 <= u_dir block < D_blocks
            %return %unless valid block (D,u_dir block)
            read block (D,u_dir block,dir)
            files = 0;  blocks = 0
            %for k = 1,1,42 %cycle
               f == dir_file(k)
               %if f_name2 # 0 %start
                  newline %if rem(files,3) = 0
                  files = files + 1
                  P = 0;  P_p3 = f_name1;  P_p4 = f_name2
                  SVC (unpack filename,P)
                  P_filename = " " . P_filename %while length(P_filename) < 15
                  print string (P_filename)
                  %if 0 <= f_spine block < D_blocks %start
                     clear bit (D_bitmap,f_spine block)
                  %finish
                  %if %not valid block (D,f_spine block) %start
                     error (P_filename . " corrupt")
                     s = "*CORRUPT*"
                  %else
                     read block (D,f_spine block,spine block)
                     blocks = blocks + spine block_blocks&H
                     s = " (" . itos (spine block_blocks&H) . "," . %c
                                itos (spine block_extents). ")"
                  %finish
                  s = s . " " %while length(s) < 10
                  print string (s)
               %finish
            %repeat
            blocks = blocks + files      {remember spines themselves}
            newline
            write (files,8);  print string (" file")
            print symbol ('s') %if files # 1;  print symbol (',')
            write (blocks,1); print string (" block")
            print symbol ('s') %if blocks # 1
            newline
            total = total + blocks
         %finish
      %repeat
      total = total + user count         {directory blocks}      %c
                    + single block       {block zero}            %c
                    + 3 * single block   {free,user,defective}
      total = total + D_zero_system size
      newlines (3);  spaces (3)
      print string (D_zero_disc id . ": ");  write (user count,0)
      print string (" users")
      newline
      write (total,8);  print string (" blocks in use");  newline
      free = D_blocks - total {used blocks}
      write (free,8);   print string (" free blocks (")
      free = 100*free//D_blocks {%}
      free = 0 %if free < 0
      write (free,0);   print string ("%)");  newline
      select output (console)            {again}
   %end

   %routine tidy (%record(disc)%name D)
      !Creates a new free list on D holding all blocks
      !not claimed so far (BITMAP entries not SET).
      %record(extent) e, swap
      %integer j, k, flag, lost = 0
      %record(spine) new free list = 0
      %return %if D_unit no <= 0
      %record(extent)%name this, that, victim
      doing ("free list")
      k = 0;  k = k + 1 %while \D_bitmap(k) = 0   {find a clear bit}
      j = 32*k
      %while j < D_blocks %cycle
         %if %not bit set (D_bitmap,j) %start   {start of a free extent}
            e_base <- j;  e_length = 0
            %cycle
               e_length <- e_length&H + 1
               j = j + 1
            %repeat %until j >= D_blocks %or bit set (D_bitmap,j)
            !now put this extent in NEW FREE LIST
            %if new free list_extents < 126 %start
               new free list_extents = new free list_extents + 1
               new free list_extent(new free list_extents) = e
            %else
               !Free list full -- throw away smallest
               !existing extent (the VICTIM) if it's smaller than 'E'.
               victim == new free list_extent(1)   {perhaps}
               %for k = 1,1,126 %cycle
                  this == new free list_extent(k)
                  victim == this %if this_length&H < victim_length&H
               %repeat
               %if e_length&H <= victim_length&H %start   {VICTIM is spared}
                  lost = lost + e_length&H
               %else
                  report ("reject")
                  lost = lost + victim_length&H
                  victim = e
               %finish
            %finish
         %finish
         j = j + 1
      %repeat
      !Sort new free list by ascending base address
      %if new free list_extents = 0 %start
         error(d_zero_disc id.": empty free list?")
      %else
         %cycle
            flag = 0
            this == new free list_extent(1)
            %for j = 2,1,new free list_extents %cycle
               that == new free list_extent(j)
               %if this_base&H > that_base&H %start
                  swap = this;  this = that;  that = swap
                  flag = non zero
               %finish
               this == that
            %repeat
         %repeat %until flag = 0
      %finish
      new free list_check = 0
      !DIRECTOR uses FREE_EXTENTS really as a
      !lost blocks counter, which we must initialise.
      new free list_extents = lost
      new free list_check = checksum (new free list)
      write block (D, D_zero_free list, new free list)
   %end

   %routine validate free list (%record(disc)%name D)
      %record(spine) free
      %record(extent)%name e
      %integer j, free blocks = 0, last
      !This routine checks that no blocks allegedly
      !on the free list are in fact part of the
      !directory structure of the disc. (In which
      !case their bits in the bitmap will be SET).
      doing ("freelist chk")
      read block (D, D_zero_free list, free)
      report (D_zero_disc id . ": ". itos(free_extents) . " lost blocks") %c
         %if free_extents # 0            {DIRECTOR counts lost blocks there}
      %if checksum (free) # 0 %start
         error (D_zero_disc id . ": " . no check . "free list")
         %return
      %finish
      last = 0
      %for j = 1,1,126 %cycle
         e == free_extent(j)
         %if e_base = 0 %start
            %cycle
               %if e_base # 0 %or e_length # 0 %start
                  error(d_zero_disc id.": incomplete free list")
                  %return
               %finish
               %exit %if j = 126
               j = j+1
               e == free_extent(j)
            %repeat
            %exit
         %finish
         %if e_base&H <= last %start
            error (D_zero_disc id . ": free list out of order")
         %finish
         last <- (e_base + e_length)&H
         %if valid extent (D,e) %start
            free blocks = free blocks + e_length&H
         %else
            error (D_zero_disc id . ": corrupt free list")
         %finish
      %repeat
      report ("free blocks: " . itos(free blocks))
   %end

   %routine get (%record(disc)%name D,
                 %record(extent)%name free, %integer max size)
      !A contiguous extent of up to MAX SIZE blocks
      !is claimed from the OUTPUT disc, and an extent
      !descriptor for it returned in FREE.
      free = 0 %and %return %if D_unit no <= 0 {NULL disc}
      %cycle                          {find a single free block on OUTPUT}
         %if D_FP >= D_blocks %start
            error ("Output disc too small")
            %signal total failure     {trapped in SQUEEZE: forces a return}
         %finish
         %exit %if %not bit set (D_bitmap,D_FP)
         D_FP = D_FP + 1
      %repeat
      free_base <- D_FP;  free_length = 0
      %cycle
         %exit %if D_FP >= D_blocks %or
                   bit set (D_bitmap,D_FP) {block in use} %or
                   free_length&H >= max size  {got all we wanted}
         set bit (D_bitmap, D_FP)
         free_length <- free_length&H + 1
         D_FP = D_FP + 1
      %repeat
   %end

   %routine %spec set disc (%record(disc)%name D, %string(25) id)

   %routine wipe (%record(disc)%name D)
      report ("***WIPING " . D_zero_disc id)
      %record(parm fm) P                 {D.I.Y. disc I/O - dont abort on errs}
      %integer j, k, block, left, N
      %record(spine) bad = 0             {new defective blocks list}
      %record(spine) user                {new (empty) user list}
      %record(zero fm)%name Z == D_zero
      %record(extent) free
      %record(extent)%name this

      %on %event total failure %start    {GET failed to claim system area}
         report ("No space for system area")
         -> NO SYS
      %finish

      %if Z_marked # -1 %start           {disc not properly initialised}
         report ("Unit #" . itos(D_unit no) . " not initialised")
         %stop
      %finish

      !Create defective list

      doing ("badblock chk")
      report ("blocks: ".itos(D_blocks))
      D_bitmap(j) = 0 %for j = 0, 1, 2047   {splat the bitmap}
      set bit (D_bitmap,0)               {don't scribble on block zero!}
      block = 0
      %cycle
         left = D_blocks&H - block       {# of blocks left to test}
         %exit %unless left > 0
         N = buf len;  N = left %if N > left   {test in N-block chunks}
         P_p1 = block;  P_p2 = addr(buf(1))
         P_p3 = D_unit no;  P_p4 = N
         SVC (read segment,P)
         %if P_p1 # 0 %start             {I/O err => 1 or more bad blocks}
            %for j = block, 1, block + N - 1 %cycle
               P_p1 = j                  {test individual blocks in chunk}
               P_p2 = addr(buf(1))
               P_p3 = D_unit no;  P_p4 = 0
               SVC (disc read,P)
               %if P_p1 # 0 %start       {block #J is duff}
                  set bit (D_bitmap,j)
                  bad_extents = bad_extents + 1   {use one extent for each}
                  %if bad_extents > 126 %start
                     report ("Too many bad blocks!")
                     %stop
                  %finish
                  this == bad_extent (bad_extents)
                  this_base = j;  this_length = single block
                  %if j = 0 %start
                     error ("Block zero is defective!!")
                     %stop
                  %finish
               %finish
            %repeat
         %finish
         block = block + N
      %repeat
      report ("Bad blocks: " . itos(bad_extents)) %if bad_extents # 0

      !Allocate system area

      D_FP = 0
      %if Z_system area # 0 # Z_system size %start
         %cycle
            get (D,free,sys size)
            %exit %if free_length&H = sys size
            !chunk not big enough - forget it
            clear bit (D_bitmap,j) %for j = free_base&H, 1,
                                            free_base&H + free_length&H - 1
         %repeat
         Z_system area = free_base&H
         Z_system size = free_length&H
      %finish

NO SYS:
      !Allocate free, user, defective blocks
      !(normally 300,301 and 302)

      D_FP = default free list
      %if %not valid block (D,Z_free list) %start
         get (D,free,single block)
         Z_free list = free_base&H
      %finish
      %if %not valid block (D,Z_user list) %start
         get (D,free,single block)
         Z_user list = free_base&H
      %finish
      user = 0;  write block (D,Z_user list,user)
      %if %not valid block (D,Z_defective list) %start
         get (D,free,single block)
         Z_defective list = free_base&H
      %finish
      bad_check = 0;  bad_check = checksum (bad)
      write block (D,Z_defective list,bad)
      bad = 0;                           !use BAD as free list now
      bad_check = checksum (bad)
      write block (D,Z_free list,bad)
      D_FP = 0                           {put things back}

      tidy (D)                           {create new free list}
      Z_initialisation date = DATE
      Z_initialised = 0                  {DONE}
      Z_checksum = 0;  Z_checksum = checkword (Z)
      write block (D,0,Z)
   %end

   %routine read page (%record(disc)%name D,
                       %integer disc addr, blocks, buf start)
      %record(parm fm) P
      P_p1 = disc addr&H; P_p2 = addr(buf(buf start)); P_p3 = D_unit no
      P_p4 = blocks&H;  SVC (read segment,P)
      %if P_p1 # 0 %start
         report ("Read page fails on unit #" . itos(D_unit no) . %c
                 ", status: " . itos(P_p1))
      %finish
   %end

   %routine write page (%record(disc)%name D,
                        %integer disc addr, blocks, buf start)
      %record(parm fm) P
      %return %if D_unit no = 0
      P_p1 = disc addr&H;  P_p2 = addr(buf(buf start));  P_p3 = D_unit no
      P_p4 = blocks&H;  SVC (write segment,P)
      %if P_p1 # 0 %start
         report (D_zero_disc id . " protected") %and
            %stop %if D_prot # 0
         report ("Write page fails on unit #" . itos(D_unit no) . %c
                 ", status: " . itos(P_p1))
         %stop
      %finish
   %end

   %routine merge (%record(userlist)%name new, %record(disc)%name D)
      !Create a new userlist from the old one on 'D'
      !and the NEW one passed to us.  Return merged
      !list in NEW.
      %record(userlist) old
      %integer j,k
      %record(user)%name u, slot
      %return %if D_unit no <= 0
      read block (D,D_zero_user list,old)
      j = 1
      %for k = 1,1,42 %cycle
         u == new_user(k)
         %if u_name # 0 %start
            %while j <= 42 %cycle
               slot == old_user(j)
               j = j + 1
               %if slot_name = 0 %start
                  slot = u
                  %exit
               %finish
            %repeat
         %finish
      %repeat
      new = old
   %end

   %routine squeeze (%record(disc)%name input, output)
      !The logical contents of the INPUT disc are
      !copied to the OUTPUT disc.  As the files are
      !being written sequentially, the output disc
      !will be minimally fragmented after the operation,
      !with all free space in one or two extents.

      %routine copy system
         %integer done
         %return %if input_zero_system size <= 0 %or
                    output_zero_system size <= 0
         doing ("Copy system")
         %if input_zero_system size > output_zero_system size %start
            report ("Not enough space for system area on " . %c
                    output_zero_disc id)
            %return
         %finish
         %integer j, k
         %integer pages = input_zero_system size // buf len,
                  odd blocks = rem (input_zero_system size,buf len)
         %for j = input_zero_system area, buf len,
                  input_zero_system area + (pages-1)*buf len %cycle
            read page (input, j, buf len, 1)
            writepage(output, j, buf len, 1)
         %repeat
         done = input_zero_system area + pages*buf len;   !block
         %for j = done, 1, done + odd blocks - 1 %cycle
            read block (input, j, buf(1))
            writeblock(output, j, buf(1))
         %repeat
         report ("System area: " . itos(input_zero_system size))
      %end

      %integer %fn squeezed file (%integer {packed} user {name},
                                  %record(file)%name F)
         !Result is disc addr in OUTPUT disc of new spine
         !block for the copied file.
         %integer bufp = 1, free buf = buf len, base
         %integer last, left, xfer len, j, extents
         %record(spine) old spine, new spine;  new spine = 0
         %integer {flag} empty spine = non zero
         %record(extent)%name e
         %record(extent) free
         %record(parm fm) P = 0;  P_p1 = input_unit;  P_p2 = user
                                  P_p3 = F_name1;     P_p4 = F_name2

         %routine output buf
            !The contents of BUF, from block 1 to BUFP is
            !written to the OUTPUT disc in as many extents
            !as required.  Each new extent is added to the
            !NEW SPINE block being created.
            %own %record(extent)%name last extent
            %record(extent) free
            %integer p = 1
            bufp = bufp - 1              {index of next free block->#of blocks}
            %while p <= bufp %cycle      {more to write}
               get (output, free, {extent of size up to # of blocks left}
                          bufp - p + 1)
               write page (output, free_base, free_length, {buf start} P)
               %if empty spine # 0 %or {not contiguous with last ext}
               free_base&H # last extent_base&H + last extent_length&H %start
                  empty spine = 0
                  new spine_extents = new spine_extents + 1
                  %if new spine_extents > 126 %start
                     error ("Spine block full!!")
                     %stop
                  %finish
                  last extent == new spine_extent(new spine_extents)
                  last extent = free
               %else                     {merge with LAST EXTENT}
                  last extent_length = (last extent_length + free_length)&H
               %finish
               p = p + free_length
            %repeat
            free buf = buf len           {buffer empty now}
            bufp = 1
         %end

         read block (input, F_spine block, old spine)
         %unless 0 <= old spine_extents <= 126 %start
            SVC (unpack filename,P)
            error (P_filename . itos(old spine_extents) . " extents?")
            old spine_extents = 126
         %finish
         %if old spine_check # '?' %start
            SVC (unpack filename,P)
            error (P_filename . no check . "spine block")
         %finish
         extents = 0
         %for j = 1,1,old spine_extents %cycle
            e == old spine_extent(j)
            %if e_length # 0 %start
               extents = extents + 1
               %if %not valid extent (input,e) %start
                  P = 0;  P_p1 = input_unit;  P_p2 = user
                  SVC (unpack filename,P)
                  error (P_filename . corrupt . "extent")
                  %if %not (0 <= e_base&H < input_blocks %and
                            0 <=(e_base+e_length)&H < input_blocks) %or
                     e_length&H > 200 {arbitrary} %start
                     !all is lost
                     report ("(Not copied)")
                     %continue
                  %finish
                  !copy poss. duff extent
               %finish
               new spine_blocks <- (new spine_blocks + e_length)&H
               %if testing = 0 %start    {actually copy the file?}
                  base = e_base&H;  last = (e_base + e_length)&H
                  left = e_length&H      {# of blocks yet to be transferred}
                  %cycle
                     output buf %if free buf <= 0
                     xfer len = left     {Try to read in all the other blocks}
                     xfer len = free buf %if xfer len > free buf
                     read page (input, base, xfer len, bufp)
                     bufp = bufp + xfer len;  left = left - xfer len
                     free buf = free buf - xfer len{less space left in buffer}
                     base = base + xfer len    {next disc addr}
                  %repeat %until base >= last  {read in whole extent?}
               %finish
            %finish
         %repeat
         output buf                      {flush}
         P = 0; P_p1 = input_unit; P_p2 = user; P_p3 = F_name1; P_p4 = F_name2
         %if new spine_blocks # old spine_blocks %start
            SVC (unpack filename,P)
            error (P_filename . " block count wrong in spine")
         %else %if extents # old spine_extents
            SVC (unpack filename,P)
            error (P_filename . " zero length extent in spine?")
         %finish
         %result = 0 %if new spine_extents = 0
         get (output, free, single block)
         new spine_check = '?'
         new spine_access permissions = old spine_access permissions
         write block (output, free_base, new spine)
         %result = free_base
      %end

      %integer %fn squeezed user (%integer {packed} name {of user},
                                  {disc addr of user's} dir block)
         !Result is disc addr (on OUTPUT) of copied directory.
         %record(directory) D, new dir
         %record(spine) S
         %record(parm fm) P = 0;  P_p1 = input_unit;  P_p2 = name
         %record(extent) free
         %record(file)%name F
         %integer j

         read block (input, dir block, D);  new dir = D
         %unless 0 <= D_files <= 42 %start
            SVC (unpack filename,P)
            error (P_filename . itos(D_files) . " files?")
            D_files = 42
         %finish
         new dir_files = 0
         %for j = 1,1,42 %cycle
            F == new dir_file(j)
            %if f_name2 # 0 %and f_name1&dollar hash = 0 %start
               %if %not valid block (input,F_spine block) %start
                  P = 0;  P_p1 = input_unit;  P_p2 = name
                  P_p3 = f_name1;  P_p4 = f_name2
                  SVC (unpack filename,P)
                  error (P_filename . corrupt . "spine block")
                  %if %not (0 <= f_spine block < input_blocks) %start
                     report ("(Not copied)")
                     F = 0
                     %continue
                  %finish;   !might be OK
                  read block (input,f_spine block,S)
                  %if S_check # '?' %start
                     report ("(Not copied)")
                     F = 0
                     %continue
                  %finish;   !plausible
               %finish
               !spine OK
               f_spine block <- squeezed file (name,f) &H
               %if f_spine block # 0 %start;   !exists
                  new dir_files = new dir_files + 1
               %finish %else f = 0
            %finish %else f = 0
         %repeat
         get (output, free, single block)
         write block (output, free_base, new dir)
         %result = free_base
      %end

      !SQUEEZE input => output disc

      %record(user list) catalog         {users on input disc}
      %record(user list) new cat
      %record(user)%name U
      %record(parm fm) P
      %string(63) s
      %integer j

      %on %event total failure %start    {Detected in GET space routine}
         %return                         {ERROR was called in GET,
      %finish                            {so main program will produce the
                                         {FAULTY OUTPUT DISC message}
      wipe (output) %if output_errors # 0
      read block (input, input_zero_user list, catalog)
      %unless 0 <= catalog_users <= 42 %start
         error (input_zero_disc id . ": " . itos(catalog_users) . %c
                " users?")
      %finish
      copy system
      new cat = catalog;  new cat_users = 0
      %for j = 1,1,42 %cycle
         U == new cat_user(j)
         %if U_name # 0 %start
            P = 0;  P_p1 = input_unit;  P_p2 = U_name
            SVC (unpack filename,P)
            s <- P_filename
            %if %not valid block (input,U_dir block) %start
               error (P_filename . corrupt . "directory")
               !no hope
               U = 0
               %continue
            %finish
            %if copy user = 0 {do everyone} %or wanted(U_name) %start
               doing (s)
               %if exclam # 0 %start
                  %if testing # 0 %then report ("testing " . s) %c
                                  %else report ("copying " . s)
               %finish
               new cat_users = new cat_users + 1
               U_dir block <- squeezed user (U_name,U_dir block)&H
            %finish %else U = 0
         %finish
      %repeat

      merge (new cat,output) %if copy user # 0;   !combine with old catalog
      write block (output, output_zero_user list, new cat)
      tidy (output) %if output_unit no > 0
   %end {of SQUEEZE}


   %routine validate block zero (%record(disc)%name D)
      %record(zero fm)%name Z == D_zero
      %record(spine) bad blocks
      %record(extent) temp
      %integer j,k
      %if exclam = '?' %start            {print interpreted block zero}
         report ("Unit " . Z_disc id . ", " . Z_description)
         report ("Free list at " . itos(Z_free list))
         report ("User list at " . itos(Z_user list))
         report ("Bad blocks list at " . itos(Z_defective list))
         report ("System area at " . itos(Z_system area))
         report ("System size: " . itos(Z_system size))
         report ("Tracks: " . itos(Z_tracks))
         report ("Blocks per cylinder: " . itos(Z_blocks per cylinder))
         report ("Heads: " . itos(Z_heads))
      %finish
      k = checkword(Z)
      error("Block zero checksum fault ".itos(k)) %if k # 0
      %if %not valid block (D,Z_free list) %start
         error (Z_disc id . corrupt . "free list")
         Z_free list = default free list {& hope for the best}
      %finish
      %if %not valid block (D,Z_user list) %start
         error (Z_disc id . corrupt . "user list")
         Z_user list = default free list + 1
      %finish
      %if %not valid block (D,Z_defective list) %start
         error (Z_disc id . corrupt . "bad blocks list")
         Z_defective list = default free list + 2
      %finish
      %if Z_system size # 0 %start    {unit holds a system image}
         temp_base = Z_system area
         temp_length = Z_system size
         %if %not valid extent (D,temp) %start
            error (Z_disc id . corrupt . "system area")
            Z_system area = 1;  Z_system size = sys size
         %finish
      %finish
      %if Z_tracks <= 0 %or Z_blocks per cylinder <= 0 %or Z_heads <= 0 %start
         error ("-ve no. of tracks, sectors, heads?")
         D_blocks = x'FFFF'              {max poss disc addr}
      %finish
      %if errors = 0 %then read block (D, Z_defective list, bad blocks) %c
                     %else bad blocks = 0
      %if 0 <= bad blocks_extents <= 126 %start
         %if checksum (bad blocks) # 0 %start
            error (Z_disc id . ": defective list checksum error")
         %else
            %for j = 1,1,bad blocks_extents %cycle
               %if bad blocks_extent(j)_length # 0 %and
                  (%not valid extent(D,bad blocks_extent(j))) %start
                  error (Z_disc id . ": Defective list" . %c
                         corrupt . "an extent")
               %finish
            %repeat
         %finish
      %else
         error (Z_disc id . ": " . %c
                itos (bad blocks_extents) . " bad blocks?")
      %finish
   %end

   %routine set disc (%record(disc)%name D, %string(25) id)
      %string(63) S
      %record(parm fm) P = 0
      %integer j, old errors = errors
      D = 0
      %return %if id = ""
      %if id -> ("#") . id %start        {unit# given numerically}
         j = stoi (id);  id = "#" . id
      %else
         P_filename = id . "_:"
         SVC (pack filename,P)
         j = -1
         P_dact = find disc                 {packed disc name => unit#}
         SVC (to director,P)
         j = P_p1 %if P_p6 = 0
      %finish
      error ("Invalid disc name " . id) %and %stop %if j < 0
      D_unit no = j
      P_p3 = D_unit no
      SVC (disc status,P)
      error ("Unit #" . itos(D_unit no) . " offline") %and %stop %if P_p6&3 # 0
      D_prot = P_p6 & 4
      read block (D,0,D_zero)
      D_blocks <- D_zero_tracks * D_zero_blocks per cylinder
      set bit (D_bitmap,0)
      length(D_zero_disc id) = 4 %if length(D_zero_disc id) > 4;!!!!!!!!!!!!!
      s <- D_zero_disc id
      s <- s . "_:"
      P_filename <- s
      SVC (pack filename,P)
      D_unit = P_p1
      P_dact = unit name;  P_p1 = D_unit no
      SVC (to director,P)
      D_prot = non zero %if P_p6 = 0 %and P_p2 # 0   {prot in director?}
      %return %if splatting # 0
      validate block zero (D)
      D_errors = errors - old errors
   %end


   !field number mnemonics on block zero

   %const %integer vol id = 1
   %const %integer disc id = 2
   %const %integer sys area = 3
   %const %integer make = 4
   %const %integer descr = 5
   %const %integer fields = 5

   %routine set zero (%record(disc)%name D, %integer mask, to do)
      !Alter fields indicated by mask in disc block zero from data
      !supplied by operator at the console.
      !No. of fields TO DO passed as a parameter.
      %string(63) atom
      %const %integer parms = 5          {fields in block zero}
      %const %string(15) %array parm id (1:parms) =
         "Phy. disc name:",
         "Log. disc name:",
         "System area? ",
         "Disc type:",
         "Description:"
      %const %integer {disc} types = 5, last type = types
      %const %string(9) %array type id (1:types) =
         "DIABLO",                       {5MB cartridge disc}
         "TELEFILE",                     {300MB fixed disc unit}
         "MSM80",                        {Perkin-Elmer 67MB disc}
         "CALCOMP",                      {Calcomp 67M disc}
         "UNKNOWN"                       {track size/cyls etc explicit}
      !*** UNKNOWN must be last type ***
      %const %integer %array tracks (1:types) = 400,100,815//3,815//3,0(*)
      %const %integer %array blocks per cylinder (1:types) = 2*12,19*32,5*26,5*26,
                                                             0(*)
      %const %integer %array heads (1:types) = 2,19,5,5,0(*)
      %integer j,k,m
      %switch F (1:parms)
      %record(zero fm)%name Z == D_zero
      %record(parm fm) P = 0

      Z_marked = -1;  Z_system area = -1;  Z_system size = -1
      Z_initialisation date = DATE
      %while to do > 0 %cycle            {fields left to fill}
         j = 1
         %while j <= parms %cycle
            %if mask & 1<<j # 0 %start
               prompt (parm id(j))
               scan (atom) %if j # descr
               -> F(j)

               F(vol id):
                  %if length(atom) > 4 %start
                     report ("Volume-id too long")
                     %continue
                  %finish
                  Z_vol id = 0
                  atom = atom . " " %while length(atom) < 4
                  Z_vol id = Z_vol id<<8 ! char no (atom,k) %for k = 1,1,4
                  mask = mask & (\(1<<j))
                  to do = to do - 1
                  %continue
               F(disc id):
                  P_filename = atom . "_:";  SVC (pack filename,P)
                  report ("Illegal disc name") %and
                     %continue %if P_p6 # 0
                  Z_disc id = atom
                  mask = mask & (\(1<<j))
                  to do = to do - 1
                  %continue
               F(sys area):
                  %if atom = "NO" %start
                     {Sytem area deleted next time disc is COMPRESSed}
                     Z_system area = 0
                     Z_system size = 0
                  %finish
                  mask = mask & (\(1<<j));  to do = to do - 1
                  %continue
               F(descr):
                  Z_description = ""
                  %while next symbol # NL %cycle
                     Z_description <- Z_description . to string(next symbol)
                     skip symbol
                  %repeat
                  skip symbol {NL}
                  mask = mask & (\(1<<j))
                  to do = to do - 1
                  %continue
               F(make):
                  %cycle
                     %for k = 1,1,types %cycle
                        %if type id (k) = atom %start
                           Z_tracks = tracks(k)
                           Z_blocks per cylinder = blocks per cylinder(k)
                           Z_heads = heads(k)
                           mask = mask & (\(1<<j))
                           to do = to do - 1
                           %if k = last type {"UNKNOWN"} %start
                              prompt ("Tracks:");  scan (atom)
                              Z_tracks = stoi (atom)
                              prompt ("Blocks per cylinder:");  scan (atom)
                              Z_blocks per cylinder = stoi (atom)
                              prompt ("Heads:");  scan (atom)
                              Z_heads = stoi (atom)
                           %finish
                           %exit
                        %finish
                        %if k = last type %start   {ATOM matches no type}
                           report ("Valid types are:")
                           report (type id(m)) %for m = 1,1,types
                           report ("UNKNOWN to spec disc parms by hand")
                           scan (atom)
                        %finish
                     %repeat
                  %repeat %until mask & 1<<j = 0
            %finish
            j = j + 1
         %repeat
      %repeat
      D_zero_checksum = 0
      D_zero_checksum = checkword (D_zero)
      write block (D,0,D_zero)
   %end

   %routine make sure (%record(disc)%name D)
      %string(15) reply
      %return %if D_errors # 0           {nothing worth keeping}
      report ("**Are you sure you want to overwrite " . D_zero_disc id . "?")
      prompt ("Yes/no? ")
      scan   (reply)
      %stop %unless reply = "YES"
   %end

   %routine set map (%record(disc)%name D)
      !D bitmap set with all blocks protected
      !except those on its free list
      %record(spine) free
      %record(extent)%name e
      %integer j,k
      %const %integer all bits = \0
      D_bitmap(j) = all bits %for j = 0,1,2047   {protect all}
      read block (D,D_zero_free list,free)
      %for j = 1,1,126 %cycle
         e == free_extent(j)
         %if e_length # 0 %start
            clear bit (D_bitmap,k) %for k = e_base&H, 1, %c
                                            e_base&H + e_length&H - 1
         %finish
      %repeat
   %end


                     !###############################
                     !#                             #
                     !#   M A I N   P R O G R A M   #
                     !#                             #
                     !###############################


   %const %integer all = \0              {all bits set}
   %const %string(1) null = ""
   %const %string(31) no disc = ": no such disc"
   %integer keep = 0
   %string(*)%name parm == COMMAND_parameter  {command line parameter}
   normalise (Parm)
   report ("DISC " . parm . " " . version)
   report (itos(buf len) . " buffers claimed") %if exclam = '?'
   %string(*)%name listing file == COMMAND_out2,
                   in1          == COMMAND_in1,   {1st input stream-id}
                   out1         == COMMAND_out2
   %integer pages, odd blocks
   open output (listing,listing file) %if listing file # null
   select input (console);  select output (console)
   %integer j, ctype = 0
   %string(80) line
   %record(parm fm) P
   %switch C (1:commands)

   %routine check (%string(*)%name s, %string(31) mess)
      %return %if s # null
      prompt (mess);  scan (s)
   %end

   %routine check in (%string(*)%name s) {check file was specd for stream}
      check (s, "Input disc? ")
   %end

   %routine check out (%string(*)%name s)
      check (s, "Output disc? ")
   %end

   %if parm = "KEEP" %start
      keep = 1
again:prompt("Param: ");  read(parm)
      normalise(parm)
   %finish
   clear out
   keep = 0 %and ->stop %if parm = "STOP" %or PARM = "QUIT"
   %for j = 1,1,commands %cycle
      %if parm = command word(j) %start
         Ctype = j
         %exit
      %finish
   %repeat
   report (parm . "?") %and %stop %if Ctype <= 0
   -> C (Ctype)

C(1): !TEST
      testing = non zero
      check in (in1);  set disc (in,in1);  set disc (out,null)
      squeeze (in,out)
      validate free list (in)
      list (in) %if listing file # null
      -> STOP

C(9): !COPYUSER
C(10):!COPYUSERS
      copy user = non zero;  wanted users = 0
      prompt ("Copy: ")
      %cycle
         scan (line);  line = line . ","
         %while line -> parm . (",") . line %and parm # ".END" %cycle
            %continue %if parm = ""
            P_filename = parm . ":";  SVC (pack filename,P)
            %if P_p2 < 0 %start
               report ("Illegal name: " . parm)
            %else
               wanted users = wanted users + 1
               wanted user(wanted users) = P_p2
            %finish
         %repeat
      %repeat %until parm = ".END"
      !drop thru..

C(2): !COMPRESS
      check in (in1);  check out (out1)
      set disc (out,out1)
      make sure (out) %if copy user = 0
      set map (out) %if ctype = 9 %or ctype = 10
      set disc (in,in1)
      error ("Input = output?") %if in_unit no = out_unit no
      squeeze (in,out)
      validate free list (in)
      %if errors # 0 %start
         error ("***FAULTY INPUT DISC***")
         %stop %if exclam # '!'          {explictly ignore errors with '!'}
         errors = 0
      %finish
      report ("Testing output disc")
      testing = non zero
      set disc (in,null)
      set disc (out,out1)   {clears bitmap in OUT}
      squeeze (out,in)
      validate free list (out)
      report ("***FAULTY OUPUT DISC PRODUCED***") %and %stop %if errors # 0
      list (out) %if listing file # null
      -> STOP

C(3): !initialise
      splatting = non zero
      check out (out1);  set disc (out,out1)
      make sure (out)
      out_zero_free list = -1            {these blocks are allocated by WIPE}
      out_zero_user list = -1
      out_zero_defective list = -1
      out_zero_initialised = -1          {only after wiping}
      set zero (out,all,fields)

C(4): !WIPE
      check out (out1);  set disc (out,out1)
      make sure (out) %if ctype = 4
      wipe (out)
      -> stop

C(5): !KILL
      check out (out1);  set disc (out,out1)
      make sure (out)
      out_zero = 0;  out_zero_initialised = non zero   {now wont LOAD ok}
      out_zero_checksum = checkword(out_zero) + 1      {checksum wrong too!}
      write block (out,0,out_zero)
      -> STOP

C(6): !ZERO
      splatting = non zero
      check out (out1);  set disc (out,out1)
      make sure (out)
      set zero (out, all, fields)
      !set preferred pointers
      out_zero_free list     = default free list
      out_zero_user list     = default free list + 1
      out_zero_defective list= default free list + 2
      %if out_zero_system area # 0 %start
         out_zero_system area = 1
         out_zero_system size = sys size
      %finish
PUT ZERO:
      out_zero_checksum = 0;  out_zero_checksum = check word (out_zero)
      write block(out,0,out_zero)
      -> STOP

C(7): !COPY
      splatting = non zero               {suppress block zero checking}
      check out (out1);  set disc (out,out1)
      check in  (in1);   set disc (in,in1)
      make sure (out)
      set zero (out, 1<<make, 1);        !!cant scribble on IN!!
      j = out_zero_tracks * out_zero_blocks per cylinder
      pages = j // buf len;  odd blocks = rem (j,buf len)
      %for j = 0, buf len, (pages - 1) * buf len %cycle
         read page  (in, j, buf len, 1)
         write page (out,j, buf len, 1)
      %repeat
      %for j = pages*buf len, 1, pages*buf len + odd blocks - 1 %cycle
         read block  (in,  j, buf(1))
         write block (out, j, buf(1))
      %repeat
      -> STOP

C(8): !HELP
      open input (help text, program source)
      select input (help text)
      skip symbol                        {first '!'}
      %cycle
         read symbol (j)
         %exit %if j = '\'               {terminating character}
         print symbol (j)
         skip symbol %if j = NL          {past '!'}
      %repeat
      newline
      close input;  -> STOP

C(11):!TIDY
      check in (in1);  set disc (in,in1)
      set disc (out,null)
      -> STOP %if errors # 0
      testing = non zero
      squeeze (in,out)                   {check input disc for errors}
      %if errors # 0 %start
         report("***Faulty input disc")
         errors = 0 %if exclam # 0
      %finish
      tidy(in) %if errors = 0
      -> STOP

C(12):!RENAME
      check in (in1);  set disc (in,in1)
      check out (out1)
      length(out1) = 4 %if length(out1) > 4;  in_zero_disc id = out1
      report (in1 . " renamed " . in_zero_disc id)
      -> PUT ZERO

C(13):!LIST
      check in (in1);  set disc (in,in1)
      list (in)
      -> STOP

STOP:
   doing ("")
   %if errors = 0 %then parm = "No" %else parm = itos (errors)
   parm = parm . " error";  parm = parm . "s" %if errors # 1
   report (parm)
   ->again %if keep # 0

%end %of %program
 H?   n ni                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     8 C!         <7 |}!       OC   	  !      NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    %Qv   #p}SId:w	RaX                            !  a a a a    "!A    B aaA    ! a !  
   $Aa 	  
! b a!  A    !!A   !!   !!!   'A   /A   3! BA   ;"     H" a   O"   U#A  
c   `#!  
b    n,  A  !      ! !   A  A a !! ba  ! a  A  $ a " A" b  a C! !AA! A    B a B a!a!!a b A c   2  # e "  b a ! aa B a! A BAb  Ab    .%  a Aca A   I!    C  ! bA a!!   A     a  !   a AD BAB Aag!b!b!b!     a!! K  #a c   #!!     '! a  ! a ! " B   " a CB!   ' a  b a  a  !  !  A  a   	$  c!5      aa!   a   D        Aaa A  !  A 8  s%%!    a !a !   B!    D!   !A $  胬!  c  Aa ! !    B  C A "  !   ! a!  " a Aa A .  B    a A  a  A A A!aA  A a  a &  F:  a  aAA   B   Ba  B    B !A  A   C a AAB B  !    A A a H  "!a   	  ' !    A!   !    !     a  a b a aa+! A a!!d !   Aa!  "A     D ! !   AD!!    a    !   C   a A A A!  C! ! ! C !      a !! C !! !! C     A  !       C!  C!  #        dQ@    D"Z$h%Qv    	`   }     d+EW@ ,>   y8@     ,v  Ő <   @>   DD   Hx/W ;ov     >   ,v   <W   YQt;=  Ð v   ,}   Ő l   p>   w9W    Ð v   	w     :t#  4>   8D   	;`   :t#  4>   8D   w     :t#  4>   8D   qX`     ,Rv@   ""`     ,Rv@   8M[DĐ      o]   8%ZĐ    Đ      ,@ 0K.聐 4>   `  Đ    ,>   0D   H  Đ yIXH ,>   0D   qI\^C  Đ      o]  Đ ,&Z 0d    }M[DĐ      o]  Đ ,&Z 0d    L{}     Đ     ,d    TyIXJM[DT=sxT>  XD  \&"8`=q  dohl l(U@pv  Đ@  z  Đ%   E~l@    Đ     ,@   0zYd  4>   8D   <'a+ @Mk}  DX_(U!)yĐD~IvĐH~A} ĐL~u 38}qMĐ     ,(U@Đ,@  0>  4(U^Cv8K;}  ,      Đ    Đ  (U@ ,QxB@   8@    Đ     ,d    T>   XD   \ox `K}  dW   h  h=pĐh  l(U@Đp~Iv 5qI,  Đ      {   ,o 0ys   4d    }]  Đ      {   ,o 0ys   4d    R,    Đ X_  Đ      ,_  ,>  0D  Đ4@  Đ8x}  !(QyQ@ ,f@ 0>   4D   8d/"8 <^do   ag\  DK;}}}  ,(U@ 0d    y} ":% =pĠ  %   ,d  0(U%   4@ 8K;}  <K}  @reW   D>   H#!v   L_yIXH  LX_yIXH  L!Xev@ĠP@  T(U@Xd    Qy} "w W@  zox   ,   ,X_z,v  ,d   T(U@ĠX%  \>   +y} "@  Đ :`Đ  ag\ ,/+  ,X_Đ,@  0d   Xv  >   '8}M[Đ    Đ ,   0o  0}d 4>  8D   w{  Đ     ,8   Hv   d    >   _""`   wZ]  Đ      Q{D ,\] 0	oQ@ p>   tD   xQ@  Đ |   d    )Qs"MqH  Đ     ,qXN wQx    Đ     ,(U@Đ,@  0>  4D   x    Ð v   ,Rv W  Ð v   	`  Ð v   	ox     ,:p  "Da  D\""`D`}~v+  DdyL	t:w  Dh("  Dl}̆=sxDp#K5DKցDEd ÀDd:Q@CDL{~v,KÀD:  ÀDa Dd/"8D^do  D>  DdȃDLv@E d    ates error No 	 renamed ***Faulty input disc  ***FAULTY OUPUT DISC PRODUCED*** Testing output disc***FAULTY INPUT DISC***Input = output?.END Illegal name:  :.END ,,Copy:  ?QUIT STOP Param: KEEP Output disc? Input disc?    #B#$$$%%h&q#w#w&&'< buffers claimed  DISC : no such disc   YESYes/no?  ?%**Are you sure you want to overwrite "UNKNOWN to spec disc parms by hand Valid types are: Heads: Blocks per cylinder: Tracks:NO Illegal disc name_:  Volume-id too long   6a                                 `                           d                    DIABLOptiTELEFILEiMSM80ILEiCALCOMPEiUNKNOWNEi_e            
Phy. disc name:Log. disc name:System area? e:
Disc type:a? e:Description: e:            er_:  offline Unit # Invalid disc name  _: ## bad blocks? :  	an extent: Defective list : defective list checksum error"-ve no. of tracks, sectors, heads? system areabad blocks list	user list	free listBlock zero checksum fault  Heads: Blocks per cylinder: Tracks:  System size: System area at Bad blocks list at User list at Free list at ,  Unit copying  testing  	directory users?:  (Not copied) (Not copied) spine block files? zero length extent in spine? block count wrong in spine(Not copied) extent spine block	 extents?Spine block full!! System area: $Not enough space for system area on  Copy system
, status:  Write page fails on unit # 
 protected 
, status:  Read page fails on unit #Bad blocks:  Block zero is defective!!Too many bad blocks! blocks:  badblock chk  not initialised Unit # No space for system area 
***WIPING  Output disc too smallfree blocks: : corrupt free list: free list out of order : incomplete free list 	free list:   lost blocks :  freelist chk : empty free list? reject 	free list%)  free blocks (  blocks in use  users :   block  file ), ( 	*CORRUPT* corrupt  Dump of  Disc listing  at block #
 to unit # Disc write error 
 protected  at block # from unit # Disc read error  *,.END --  TESTalid check COMPRESS check 
INITIALISEheck WIPEIALISEheck KILLIALISEheck ZEROIALISEheck COPYIALISEheck HELPIALISEheck COPYUSERSEheck 	COPYUSERSEheck TIDYUSERSEheck RENAMEERSEheck LISTMEERSEheck               invalid check byte in  corrupt pointer to                                   *            *            ~   
crash:DISC                           V2.02
   |'?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nH  !34  1  0 !81 !5$$A> #$$A> &C ?1  34C0  D   D   
C H  !34  1  0 !81 !5$$A> $@#0#D   D   &A'1"C H  !34  1  0 !81 !5$$A> B  @ !4B ";
C@ !$$A> #$$A> B  C
B$P#E  E  &Q'1"C s_  eX!34RUUh!34dffз  ӳ  Ű !4Գ #9    !8 !5$$A> B$ C08 L  #9&"C  "
  'M  M   >' ("#4\BbD#:  
  nBJ"#<  #M  M  '"DC0  
$#M  M  &'"%ѷ  C $ "ѷ  $$A> $A1    0#
#	QD   RD   ?&A'"3  $$A> X# Y !Y !&\ Z  B!$$A> З  $1$H  H X [ &B0P  [ ,&' ?P  
*&30H  P  ї  C Kї  $$A> 
Y  #%$$A> 
qPr  PB &(pX  ?$PS?PE   &T 41I2 !,K2  !
3s3B  #9
3
>!$$A> !$$A> A>  ?&?$$A> O$$A> ?$$A> "#:  ! ?$$A> ?$$A> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$2#XC   PC   '4"2$ #PC   '4" ?$$A> H  !34  "#(!B   C $$A> X   $$A>  w AX , X $0P8@ D\P8@ D`P8@ DdP8@ DhP8@ Dly  	g AX , X X8@ DlP9 4$@$!A0PI ,C 4&API ,PI 08DAXY Xa  lV!5%y UI 0ANUI 4B0P 0$" <	w ) ,A AX < X !A  $0P9 @$API HY ,U!5y 9 ,$ `CA #5[) HP) Hc  Pi P$$!A0P DC P&P DP L ,+A P <ӡ  ɠ 0!ɠ 9#$%C XY @$jFAʠ
ZPY @U LANU PB0P LX H\	 @AC V t	g AX , X $09 ,F#cdPi <XY <\ $j: 0  @	 @' , @A  ,Af ) ,A XY <E@ FPY <U#3C X C ' ,^A  ,Af ) ,A $Ay  \	g AX , X X9 #\I ,A ?#8#Af C ӳ  P x$
$!A0P pC >&P pP tX *A  P lA  @ a!@ z!%DA  X pU tANU xB0P ty  S	g AX , X Py ,#Xy ,X9 #VAf y $@F  W   $  !'W   0"W   $  BHW   $  @	 0XY ' ,A   0Af X) A"  W   0C Xi AC r _ 	 g AX 4 X ePi 4X9 0 P9 89 ,AP <AXA  LX) 8A$QR  Xi <EPF  y  4	g AX 4 X ePi 4X9 0 P9 89 ,AP <AX) 8A$AB  XQ  \%adXI <VPT  y  3	g AX 4 X ePi 4X9 0 P9 89 ,AXA  LX) 8A$QR  E#5%y $" ,	w ) ,A AX l X !A  ? ,W   HW  ,y  #	w ) ,A AX l X !A  ?' ,TA  ,Af AzX8@ D\&1P8@ D\y  ,	W  AX , X P  PY  B(X6 <	S!/ZP ,XP 0eA#5$y X ZP ,XP 0Xi  A%C  ?	W  AX , X H5 0  P9 ,HE  @  PI 0#,3!XV \	5#
4	5#%$y X9 ,
4'1P9 <X ,'$!A0P 4C h&P 4P 8X 
ZP ,XP 0kA#4$C XI LZP ,XP 0Xi 4lAX 4U 8ANU <B0P 8%C \ x	g AX , X $0P9 0FPI 8'd$$A0Pi ,C $&dPi ,Pi 4XY 0X6  <
SPY 0Ui 4ANUi 8B0P 4$[ 0y  :	g AX , X $0P9 0FPI 8'a$!A0Pi ,C  &aPi ,Pi 4XY 06  
SPY 0Ui 4ANUi 8B0P 4$[ 0  A&y  ?	W  AX 0 X P  PY 8X9 ,P9 <XF  LPI @$PPY Dr	 0  eq	 0Xi 8lfC0Al' ,A  ',BA  ,Af X9 <Xc  lP) Xp,A0p,',A  X X+4Af ,Af Xi  P) \p,Ap,',A  X \*(Af ,Af Ay  	W  AX 0 X X6  <3!4y P  PY 8XI ,PI <P9 @$PPY Dr	 0  fq	 0Xi 8lfC0X9 <X C0(' , A  Af At$ AA$' ,A  ',
A  ,Af X Xj  lP) Xp,Ap,',A  XI X$Af ,Af Xi  P) \p,Ap,',A  XY \%Af ,Af A$ AC  	g AX ,X W  $bW   l' ,A X9 < Af AbX ZP ,XP 0Xk (lA|X XZ (\jA!4y ITPG ,XY \XU (\Xi A$`Pi`Pih6&1P9TP9=A\PX  C0X`&P`W  ,) ,$:AXILXT  \PY 8r	 ,  q	 , .A|XilH6 B.X X 	:#ZP ,XP 0cAXILHT Xi A!3C YPW ,XilHV Xi A$0P9\P9d&PXP=APX C0XI\LTE@ $cFD!6W  ,X9\<&1P9\) ,$:AXX  P <XK LPI @r	 ,  q	 ,Y .P C$' ,A  .Af ) .A C  .W   HXilH6 B.X X 	:#ZP ,XP 0cA2XILHT Xi AzB0.' , .A  Af A )pA C Y TPW ,XilHV Xi AX9 X<Xd0  
PdXi X`  A"' ,A  ',A  ,Af Hi TP)p,Ap,',A  X*Af ,Af Af )pA  ?Ip@ 
#)pAf ?"pW   HXXUANŰ *B0PXYd\Xi\l
VPYdW  ,$XXi\lW   TW   HX9\<0 #8` sW   <` ,W   <$QXidlW   TW   HXdŰ #8` sW   <W  ,XhXIdL
PhX9TU9AN0 *B0PXYh\Xi`l
V&TPYhX9 <X 4
[PYh$cW  8$cW   X ' , A  Af W   H$PXi`lW   TW   HW  ,$XXihlW   TW   HW  ,XI LXT \XihlVPYl$XXilW   TW   HXYl\0 dCA XI LXT \Pl#$Pl$PkW   T|W   HW  ,$`W   lC :-	g AX , X $0P9 @) D0 AXF  LD!$y rW  $PPY 8X 8=AXi l%X  !8XI 8&API 8C XY 8Ȱ  KAPY 4X 4XI LXT \	CZP ,XP 0jA2B0hXi 4l@i .$0@9 ,H ,  &@ ,X 4&P 4XI LXT \	C ZP ,XP 0jA!3C Hi D` ~C*&a@i D=A LPP ,X)P$1AC $=A LPL$&P 8PP=A LPDXLHA  @  HZ  P  	E#PLUPANŰ ~B0PPXiLlH9 ,0  H    	;!,H ,  Z @P @C .jADXILLHT  P  ZY @PY @ ,$$1AXi 4l&aPi 4C JH9 DB0*X ' , A  VAf A$C $P <$=A LPDHI DPIT$Q%A0PY 4C ~&QPY 4PYP=A LPHXiDlH   H   	C ,) 0$1AXH&$1A 0X)H$1A$API <XiHlPiDUYPANUYTB0zPPXY <\U#3C 2$`i GX9 @@9 D3Ai DAp Gȹ DP ,X XZ $\jAC ɀ	g AX , X $0P94HW  ȹ ,P ,X XZ $\jAHI ,C0JdA2' ,A  XY \', A  DAf  ,Af 6Af A0i ,AC0@Xi l' , A  2Af FAf (Af A.y $0P98&P0P<=A 4P,H B0pXI,LHT !5Hd  C0*X9 <' , A  Af AC X0Ű ~!2#&P0=A 4P,C C   XI8L	B &XY \' , A  Af ARXi,lH6 J6  0  P98VXi AC0X,H    Z4P4C &XI L' , A  Af AX0U<ANŰ ~B0P<Xi4A>' ,A  ',A  ,Af AZC n:	W  AX 0 X X6  <3!(%$1Ay X X XK L	!AH$ $AZP ,XP 0jA!2#XY \Xe l&aPe C X9  <X X @ XI  L$P@T  Xi lX6 <X 	;C4ZP ,XP 0cA!=X  HJ  @  YI ,!C ZXY \ZP ,XP 0Xe lAXi  lH6  0  &1@6  X X &P C PC  	g AX , X ' ,A  Af A) h0 AX9 <ȳ PhPyt#	XytAC X ŠC0FXc  lA ' ,A  ',A  ,Af ~Af A2$ ApW  XI LXd lA' ,A  ',fA  ,Af A%Q&QPY TPYx=AXi l$P  XY TUYxANPB0PxX 
ZP ,XP 0$`A^$@PI \XY \Xe l`  X9 \<cPi `!#C X@ DP d	##Pi dP9 4$8DAP 8X  P <XI dLPI @r	 ,  jq	 ,XY 4\UC02Xi \lX9 d<
c'aPi|X \'$!A0P TC &P TPxP 4$8DAP 8X XJ  LPI <$PPY @r	 ,  eq	 ,Xi 4lfC0X9 <ZP ,XP 0Xi TlA0H h&@ hɰ ~#*PA8$ A=A pPpX T@ AXIpL$Q@T  Xi Tlf!:6A.$ AX TUxANU|B0PxX9 \<X d
;P9 \C 4H hC0,jA\' ,A  ',(A  ,Af AxXI L$PPT XihlX6 <3C0X C0Ƞ P ,YlXi AHIl@  @ !3C HYnP  Hil`  
V'QPY|H9n0  '1$!A0P9 TC 8&1P9 TP9xX ZP ,XP 0cAX9 TU9xANU9|B0PxC VXhHIn@  PJ XYh\Hil`  Pe X9 <Ȱ,P XhXZ \Xi AB0($APG ,YlXi AXYh\Hin`  Pe X9h<XS \Xi AB0($P ,YlXi AXhHIn@  PJ )h0 AP' ,XYh\XU \Xi AXihlXV \Xi A6B0($1P7 ,YlXi A0XhHn  P $@I ki hA kY hPW ,XihlXV \Xi A8) h0 AbA k9 hP7 ,XhX[ \Xi AX $@PJ Xi AW   XYh\%  A  $`Pe 8X9h<$P @XihAXhP @XIhPG ,$PXi Ay ( 	 W  AX 4 X P  PY <X 08DAP @XF  LPI DXY ,P  PY Hr	 4  jq	 4Xi <lfC0vX9 <Xc  lA' ,A  ',A  ,Af Xi <lP) \p,Ap,',A  X \+Af ,Af Ay  s	W  AX 4 X X6  <3!4y P  PY <X 08DAP @XF  PI DXY ,P  PY Hr	 4  kq	 4Xi <lfC0X9 <X C0(' , A  Af A$ AXc  lA' ,A  ',A  ,Af Xi <lP) \p,Azp,',A  X \*Af ,Af A$ AC  	W  AX , X X5  <3!$y I ,PG ,XU (\Xi  A>$QPY,$`&aPi0Pi<=AX  P4X  C0LXI,L@ *B <=A 4P8&API,XQ  \U!;X4X)8$3A#C Xi0Ui<AN` *B0nP< ,X) 0 AC 0 y	w AX , X X9 <XC 4LD#+XY  \Xe 4lf!$z W  X9 <X 4XI  LXT 4\	C $' ,A Xi   Af AC [E@ ]H@ DPZ 8;#  ](@ DP* <X9 XC 0L5\(@ DA
CPJ DXh@ DPj HX9 X 0&A0P 0C RZ HP 0P @XH@ DPG ,$QPW 0[Xi AXh@ DPg ,$1P7 0XZ 0\Xi  AX 0U @ANU DB0P @X 8XI LXT 0\;\(@ DA
SPZ ,Xj <l
V'QPZ DX: ,'1$!A0P: 0C N&1P: 0P: @$8DAP ,XZ 0Xi A$8DAP ,XZ 0\Xi  AX: 0U: @ANU: DB0P @X Xk 4lA ' ,A  ',A  ,Af A<C +
w AX , X $1P; 0XJ ,'APJ ,X[ 0YZ ,B Xj ,e&aPg ,[ ,Xi  AH; ,P7 ,XK 0PG 0H[ .Xi  A*XZLB0.XmlH6 0  HF  @  H[ .P  
4SC0J$`PjLH:L&1@:L0 ~#*zA$ A=ATP ,X-$1A#HF  JK ,@  @F  DAX[ 0J[ ,P[ 0C Xh@ DPj 0$1P: ,{  W  AX ,"X $1P: ,XH@ DPJ 0*L0 A$1P:L*X$:AX9 <X P`PjdXE  LPJhXe lPjl: LP7 ,X  H[ Xi AHJ L!@ ~C Nr
X  q
XHj LA"' ,A  ',ZA   ,Af pAf AxP ~@Z Lj O` ?C04r
X  q
X' ,ZA  FAf dAf A0$0P: HH LPC$!A0PJ DC &APJ DPJ=A TPPHQ  C0Xj Hl&aPj HQXi AߨB0*X$:AX9 <X P`XJ PJdr
X  q
X' ,ZA  ^Af \Af AtXZP\He `  B:X9 <X 	kC$HE JE  @  !	K#He  `  ` #'NAC X:P<XPJ;  0  P:PXH@ D`B0H[ P  PZ 4Hk Jk  `  Pj 8H;  0  P: <X 0!#A>XJ <LPJ @YJ 0#%XJ 0PJ @PG ,XZ ,PW 0XZ 4\Xi AXj ,X: @<
cPj ,X <P <XJ 0CPJ 0XZ 4\
SPZ 4Xj 8l	V#C xXJ DUJANUJB0PA*X$:AX9 <X P`XJ PJdXZ  \Xe  lPjhX5 <P:lXPXJ PLC0.r
X  q
X' ,ZA  2Af AܘC :XZ H\EZ LC0*r
X  q
X' ,ZA  Af AZHjL!5$z $1P7 ,ZTXi  AȰ ?ҺOJ NJNZLPW ,HZVXi  AHVC &
W  AX ,X *,$:AX9 <XC LPJ4Pj8Z ,PW ,XZ  cA| ,*,0 AHj ,!` *C Nr
,  q
,Hj ,A
' ,A  ',.A   ,Af Af A`0 *@: ,$@,K&APJ\PJ`=A4PXXQ \UC0TXa  l`   B0BHQ Xi A`B0*,$:AX9 <X P4XJ PJ8XZX\Xe  lPj<X5 <P:@r
,  q
,' ,.A  ^Af  Af AڊXXHK !XY \Xe l	F!AX*X,$3AC :,P7 ,TXi AӺ/Ű ?#>AX*X,$3AC TXZX\Xj AXJXL  @ XZX\He #7H:,&1@:,#%$3A#X*X,$3AXJ\UJ`AN@ *B0`P`$P ,ZTXi  AJ,PG ,HZVXi  A>HVz I
W  AX ,)X Py#Xyy X9  <X #4cAȩ ,P ,XI LXT (\dAHY ,!P *C JeAՂ' ,A  Xi l', A  Af  ,Af Af AA ,),0 A$0@9,&PP=A4P,X  C0N)0$:AXI LXT \PY8P<r	0  q	0)X2A" ?Xi,lHV Xi A؈B0:' ,2A  ^Af Af AX),,$3AC X8@ Dh#=X,Xk  lAC0XW  X@ DpC0DXH@ D`C0' ,A XAf AN#' ,A XAf A0HY,&Q@Y,Xi,lHV Xf  lAJX9,<  @ #X),,$3AXUANŰ *B0tPX@ Dh#7XY  i,ADȩ,P ,XI  LXT (\dAڠXY  \Xe  lf#$eA0C nY 	 fkg AX , X 6 P9 ,XH@ Dp@ ?B0' ,A X9 , Af Af XI , DAf AXY ,\Xe lA' ,A  ',A  ,Af AXi ,lXf lAҊ' ,A  ',A  ,Af AզX9 ,<Xc lAP' ,A  ',A  ,Af AlX ,Xk lA' ,A  ',pA  ,Af A2X ,Xj lA' ,A  ',bA  ,Af AXI ,LXd ,lAѢ' ,A  ',XA  ,Af AԾXY ,\Xe 0lAh' ,A  ',BA  ,Af AԄXi ,lXf 4lA.' ,A  ',:A  ,Af AJXi ,ANP8C0,aA' ,A  ',A  ,Af ARX9 ,<XS \Xi AԒB0@X ,' , A  ^Af Af AX ,@,PJ XY ,\XU \Xi A6B0@Xi ,l' , A  ^Af 
Af AӪX9 ,<Ȱ-P X ,XZ \Xi AB0<XI ,L' , A  ^Af Af ANXY ,`.Pe X9 ,<X C0vX @2A@0AY0Xi AB0JXI ,L' , A  ^Af Af AXY ,$aPe X9 ,<Ȱ P X ,XJ ,LD#-XZ 0\U#'Xj 4lf!.A҂X9 <  P X@ D\B0"I 0PG ,XY ,\XU \Xi A#) 00 AHi 0B` ~B i 0AZC0*X9 ,<' , A  Af AC H 0P@$
$!A0P4C ~&P4P<=A 8HA  C0RA 8QXi AvB0:XY ,\' , A  Af ^Af Af AbX4U<ANU@B0zP<C LHi 0AͶ' ,A  Xi ,l', A  Af  ,Af |Af Ay 	g ) ,A AX H .X !A  ) $:AX8@ D\P9 &0AI ,D!4y 9 ,$ zCA C0.AP ' ,xA  ,Af ) ,A C \' ,A tAf ) A r	   q	 %QPY ` -@i r	   q	 X9 <3!7X P X C&' ,`A  ,Af A$ AXI LP  XY \Xe  lPi r	   lq	 X9 <0 C0NX Xk  lA' ,A  ',XA  ,Af NAf AL$ AX 0 P: XI LT PW ,$PdAXi lX6 D<X H+AP6 X 
ZP ,XP 0$`AnXI LT P #$$TT ) HXi l A" ?' , HA  JAf ) HA" ?)  HA" r	   q	 X9 <X P Ƞ (@ XI LXT  \PY r	   q	 Xi lf!>X9 <3#8X $P XH@ Dd#3C TXi A2XY \Xh@ D\[i Pe C 2	W  AX 0 -X 6 P9 |) $:AXI |%1P4 X |%P XI |L%QPT W   Xi |l&  A  X9 ,C ~$P pX pɠ B d*A$AB  TI  C0>=AW   XY p\P #6i?  0AX p.*Ai 0` #'ĄC X9 |<$P  ө 0ɠ #) 0Af ?"$@&API tPI XY |\Xe  l 0$A ?h1  cPe  XI tUI AN@ B0P X) p,A$  %T  P  XI ,'API ,C Z' , 0A  Af ) A  r	   q	 XY \U#7AC Xi |l&  0A  X) p,A$12  %T  P  X ,'P ,C  0.A!?XI |L$PPT Xi |l$0P6 X) p,A$  %T  P  XI ,'API ,C zXY |\$`e DW   $ 
C0RW   $  @	 X9 |<' , DA   Af X |+ DA" W   0C W   0X) p,A$  %AJTI  PI  XY ,'QPY ,C $`&aPi tPi =A) 0AB0=AX |X  P ,X t=AXI |LXQ  PT 0X t=AXi |lX  P 4X) p,A$  %AJTI  PI  XY ,'QPY ,X9 t<0 B0W   i?  0A 0A~X |P ,W   i?  0AǠ 0ARX |P 0W   i?  0At 0A&XI |LP 4C h` B0LA0$P&QPY xPY =AAXY xUY ANP B0P Ai?  0AXi tUi AN` B0^P X) p,A$ab  Ti  #3C <X9 p<&1P9 pC C zX $P XXI Ld AʐXY \P XXi l6 P7 ,$PA`y 	g AX , X X6 <3#4y ' ,xA  Af vAf AlW   i  ,A ,.hA#6$ AC  A	g AX , X %1&1P90P98=AX %P  X90U98AN0B0P8I ,PG ,XY \XU $\Xi Ab$`&aPi0Pi8=A 4P,H  C0zH     
'P@HA @  'A$!A0PI4C 8&API4PI<XY \ZP ,XP 0dAXI4UI<ANUI@B0P<Xi0Ui8AN` ~B0NP8y  	g ) ,A AX L X !A  .fA#4y  ,W   X9 cAp" *	g AX , X Ay  	g AX , X Any  	w P (AX ,UX $0P8@ D\P8@ D`P8@ DdP8@ DhP8@ DlXMpLXT \PX@ DpHDt$aPd 0 *P4 A:  (DAA1#00 	P8@ DHD$P P4 A:  (DA$0P8@ DXp?  P@ DjA¶' ,PA X@ DAf NAf Af AX@ DpŐ ?B0$Xh@ DA' ,A  <Af AXMpLT  PX@ Dd   Ph@ DPX@ D.fA#:X@ D$bW   $`W   `$`W   l$0P8@ DX@ D.AB0>$1P8@ DW   X@ DP ,Ȱ P 0W   X@ DjAAX@ D.A#6.A!7$P@ DC $@&APH@ DPH@ EH=AP@ ELX@ DX(@ ELA!8XX@ DPX@ D#XH@ DUH@ EHAN@ B0P@ EHXh@ DlfB $' ,A  Af Av$ A.A$1P8@ D`X@ DkAX@ Dh ,Afh"DAX"Dh ,Ah ,ARX@ D.fA#5h ,AJC $P@ Dh$P@ DlW   hP DA(DAf P8DX(@ DCA PC0.AC0XH@ DT  U!3C z' ,A Af (E"A r@ E   q@ E Xh@ E,lfC ' ,A X@ DAf A,#X8@ Dl&1P8@ Dl8DAPa  C HX@ D.A#3C X@ DkAX@ DjAX@ Dh"DAX@ Dh!5h"DA\XH@ DL@ 	#4@ 
!5h"DAX@ Dh ,AXX ,\Xh"DlV!5AX"Dh ,A*h ,AЎX8@ D\C0&AX@ DpŰ !#6$ A$P@ D\A$P@ D`fh ,A^X@ Dh"DALX ,h"DAh"DAXH@ D\#:^A$ AX@ D.fA#5h"DAC f$QPX@ DdXh@ DlAhX@ Dh"DAh"DA %1P8"hP8"lP8"pP8"$P ,Sh"DAX@ DjAX@ Dh"DAX@ DŐ !5h"DAh"DA6C XH@ DLdAX@ Dh"DADh"DA("\0 A$QPX"bA&P"h"\Pg ,$Ph"DAôC p$1P8@ DdX@ DkApX@ Dh"DAh"DA($P ,%Qh"DAȐ,P"h@-PH"lP.PX"pXh"tlf#8$aPh"t0 P8"x$P"h"\A<P"Ȩ"\P ,$Ph"DAC $P@ DdXH@ DLdAX@ Dh"DABXX@ D\eAX@ Dh ,A h"DAj$aPg ,P h"DA"X8"<X"+AP8@ DSE@ ]H@ DPX@ D ]@ DP@ D5\(@ DAP8@ ELX@ DP@ EP$@I)A0PH@ DC ^ZH@ EPPH@ DPH@ EHXX@ DPW ,$aPg 0Th ,A|X8@ DP7 ,$P 0XX@ D\h"DA:XH@ DUH@ EHANUH@ ELB0P@ EHX@ DZ\H@ DAX@ D
Y'QPX@ EL:\(@ DA'1$!A0P8@ DC Z&1P8@ DP8@ EH$8DAP ,XX@ Dh ,AF$8DAP ,XX@ D\h"DA&X8@ DU8@ EHANU8@ ELB0P@ EHC $cW   x$cW   `W   0W   P@ D \!3C *aW   <XH@ DL@ 
!6W   0C W  ,W   C @XX@ D\eA$X@ Dh ,Afh"DAXh@ D\#3C $1P8@ D`X"Dh ,AX@ D\#=HA	X@ Dp#5$P@ D\XH@ D\!5h ,AǬC XX@ D\eAX@ Dh ,A4Xh@ DlAX8@ D<ӳ  ɰ #$$ҳ  ( HX@ DA  X@ D' ,A  >Af  HAf A	C 0X@ DiAX@ Dh ,Ah ,A#bW  XH@ D\!9X(@ D:A #
dAX(@ DA   2Af XX@ D\P #:Xh@ D&0Af X@ DA	X8@ D#3C nx d pointers
      out_zero_free list     = default free list
      out_zero_user list     = default free list + 1
      out_zero_defective list= default free list + 2
      %if out_zero_system area # 0 %start
         out_zero_system area = 1
         out_zero_system size = sys size
      %finish
PUT ZERO:
      out_zero_checksum = 0;  out_zero_checksum = check word (out_zero)
      write block(out,0,out_zero)
      -> STOP

C(7): !COPY
      splatting = non zero               {suppress block zero checking}
      check out (out1);  set disc (out,out1)
      check in  (in1);   set disc (in,in1)
      make sure (out)
      set zero (out, 1<<make, 1);        !!cant scribble on IN!!
      j = out_zero_tracks * out_zero_blocks per cylinder
      pages = j // buf len;  odd blocks = rem (j,buf len)
      %for j = 0, buf len, (pages - 1) * buf len %cycle
         read page  (in, j, buf len, 1)
         write page (out,j, buf len, 1)
      %repeat
      %for j = pages*buf len, 1, pages*buf len + odd blocks - 1 %cycle
         read block  (in,  j, buf(1))
         write block (out, j, buf(1))
      %repeat
      -> STOP

C(8): !HELP
      open input (help text, program source)
      select input (help text)
      skip symbol                        {first '!'}
      %cycle
         read symbol (j)
         %exit %if j = '\'               {terminating character}
         print symbol (j)
         skip symbol %if j = NL          {past '!'}
      %repeat
      newline
      close in                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                              tT48|Xp4L   `  H?   < <                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!          ~ 0}        &           NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    %Qv   #p}SId:w	R`EX!    qI    w@  eE     ;ov            B a   a A!  BA    PA    V!    Z#a       aA!!   !  aA  AA      A b A  Aa a aA 7   " A! a  !     /  A A    "A    % a  !a !  a    "!   !     ~aaaE B a K F a  a  !    A   B   ! a E A a a a   B   a! ba A A a    a a!A   Aaa B U  dQ@    D"ZPZx7W  $%Qv    y8@     ,v  Ő <   @>   DW   H@ qX`     ,Rv@   U     ^ed:Q@ ,v   l}    >   X       *  ,>   0D   Ud;1   *   y@   ,>   0D   f[}      W   ,>   fZ́ W    (_Q@ ,>   0D   qI\^C   o]   ,d    ox     ,ox,d   L^wPd:Q@#K5d/ Lv"(  >  ['q3&yth  rvXy!$v  &yK;} eYx+   ąy} y} "@  ^iX  ЏLv"8`EXLK  o}   o]  D  Q@  v@ $EPG ,$PBlock #
Won't fit! 
 fails --  *Dump  	, status:
 from unit *cannot read block ??=? Dumping unit # _: #DISC WIDTHPAGE =?.. .. PAGEDASCIIOCTALHEX  ,,                                       d
   0	w?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nH  !34  1  0 !81 !5$$A> #$$A> &C ?1  34C0  D   D   
C H  !34  1  0 !81 !5$$A> B  @ !4B ";
C@ !$$A> #$$A> B  C
B$P#E  E  &Q'1"C s_  eX!34RUUh!34dffз  ӳ  Ű !4Գ #9    !8 !5$$A> B$ C08 L  #9&"C  "
  'M  M   >' ("#4\BbD#:  
  nBJ"#<  #M  M  '"DC0  
$#M  M  &'"%ѷ  C $ "ѷ  $$A> $A1    0#
#	QD   RD   ?&A'"3X# Y !Y !&\ Z  B!$$A> A>  ?&?$$A> ?$$A> "#:  ! ?$$A> ?$$A> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$ ?$$A> H  !34  "#(!B   C $$A> р w ) ,A A. < X !A  $0P9 D$JPI HY ,PY Pc$!APi @C &aPi @Pi L ,&Az P <1  0  !#C 0 0!0 9!'31  C R0 _0 AB"0 Z!/ӱ  İ _ȫҡ  à AC $A  @ _#5%y XY DPY H$PPY DC ,Xi <l6  Y9 H!%C XY H\I DA
SPY DXi @Ui LA$Ui PB0.P LX DC  	w ) ,A A. l X !A  ? ,W   HW  ,y  #	w A. , X W  ,X8<&1P8y  	w A. , -X X8#9XHL@ PH(PA" ?8P) ,CA??C0Y ,U!3C  ,.A!;Xhl` PhC .A!;X8<0 P8C .A!;Xư PC .A!6$PC 1!I lA??C0Y lU!?$P`W  ) lA  ? ,AJP lA>PXhlf!C<' , ,A  A"  lA" A" A$$ AC  ,A! ,APPC 9 ,#I lA??C0~.A!9 lAPC ( ,.A!9 lA~PC 
.AB0$1P89 l$ CA ?#8AJPC ~' ,A  A" (2A  r,  q,Ȱ -@.r,  q,XHC0"4W   HW  ,$ AXH4LPHtW   H$PXhlW   TW  ,C (' , ,A  pA" A$ AXX!XhC(' , lA  nA" An$ AC (' , ,A  lA" AB$ AC X8<0 !50 P8$P&P P XHL*Al$QR  E#8Xhl&aPhU A$Š B0P y ߀	g A. , X $0&1P: ,P: 4XZ E@ Ȱ %KPJ 0X: #  +P: D!8W  C $@ !)d @W   <#d W   <X: ,U: 4A$0 B0P 4z  M
W  A. , X X8<3#7XŰ ?C0t$&P ,P 4Xi  W   XI @ @ PI 0XY XPY @  !@ !7W  #dW   <X ,U 4A$Š B0P 4C 6XY  $dFAeW   Xi ` AXi `  Ay  o	g A. , X 0 !'3P9 ,P9 0#AlX   İ k 0W   <X9 ,U9 0A$3B0P 0y  0	W  A. , X $1P8$dW   ` |W   <$&P ,P 4X+Al$AB  C0+Al$QR  P !7$bW   Xi  Zi 'aPi <X9  '1$!AP9 0C &1P9 0P9 8X) ,,Al$  Ű B00W  X 0=A ,$QXa  lAC <Al$  Š B0=A ,$RXa  lA#$dW   X9 0U9 8A$U9 <B0\P 8X ,U 4A$Ű B0P 4$@PHy  	g A. , X X8<3B0$H ,PG ,@ PG 0V$aW  y Pi 4H ,PI 8XX\PY <$`Pi @r	 ,  eq	 ,X9 4<3C0vXW   H$QXi W   TLW   H$QXhlW   TBW   H$QXi 4lW   TW  ,$ AC H }	w P (A. , X (PX=< A  ?XMX4 <P8Ȱ <PȠ PPӔ P$@$!APHC 8&APHPHX]\ $Az a  ` :!50 P8UHA$UHB0P$PPP$PPP$0P8PxC ~XxX=B0R' ,:A X  A" .A" XL A" W   HW  ,#$aW  W   $ AA$PXHL@ #4&P@ #4&P@ #4&PXX'UXhlV PPX8<3!:"A$ AP E@ CD!2#'1P8C Ȱ  PPXà #8$
AP&PY!$APHXX\U!>Xml  $P$aW  $1P=X cW   $aW   l$lW   <ABX'PX&PXHL	##C iAFXX\Xhl
VYXB(X8<3!<$lW   <W  ,$PAW   H$PXhlW   TAA$PLXPJ$!APHC :&APHPHX8L<$T%AcW  ` |W   <$`&aPhPh&Al$12  0 !=Xð#6W  XX(,Al$  C0JW  XHLLPHXX\PX$`$!APhC &aPhPhX(,Al$12  0 B06W  XL=A ,$XXa  lW  C Al$  Ű B0.W  XL=A ,Xa  lAC HAl$  Š B0$XL=A ,$PXa  lAv#
$ %AAXL&PLXhUhA$UhB0PXHLPHLXhUhA$` B0NPAXX\P #=XXL\XhlA0AbXhLlX8<
cPhLXHUHA$UHB0PC x @ Q94 %SETTYPE      [1 - fixing type]
195 %OPER         [8 - check operator type]
196 %PARAM        [10- set parameter type & check]
197 %BLOCK        [7 - check block type]
198 %OTHER        [3,4,9 - sundry others]
199 %COMPILE      [compile phrase]

[phrasal=200]
200 APP               *** used by compile ***
201 BASEAPP
202 APP2
203 APP3
204 APP4
205 APP5
206 APP6
207 ADEFN
208 NPARM
209 SWDEF
210 SWIDS
211 CIEXP
212 RCONST
213 SCONST
214 ARRAYP
215 XIMP
216 IMP
217 COND
218 SCOND
219 EXP1
220 EXP2
221 SEXP
222 IEXP
223 IEXP1
224 IEXP2
225 ISEXP
226 SEQ
227 FDEF
228 EXP
229 NARRAYP
230 STRUCT
231 RESEXP
232 BPL
233 CONSTB
234 FITEM
235 MOREA
236 CLIST
237 FPP
238 FPP0
239 FPP1
240 FPP2
241 INITVAR
242 RECEXP
243 EIMP
244 IDENTS
245 RANGE

246 RCONSTB
247 VARP
248 INITDEC

252 ESCDEC
253 ESCPROC
254 ESCARRAY
255 ESCREC

/RULES

SS      -> %DECL (VDEC< IDENT INITDEC (COMMA IDENT INITDEC)* T,
           ADEC ADEFN (COMMA ADEFN)* T,
           (PROC<<, PROCSPEC<<) PIDENT ALIAS ACONST< %OTHER[1] &
                                       (LB Z FPP RB, %PIN Z %POUT) T,
           (PROC<<, PROCSPEC<<) PIDENT (LB Z FPP RB, %PIN Z %POUT) T,
           EXTVSPEC< IDENT (A                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |          (pre-release) vsn 2.1HT  P P]                                                                              y [ `  l H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        %begin;      !disc recovery program
   %recordformat parmfm(%short dsno, dact, ssno, sact,
                        %integer p1,p2,p3,p4,p5,p6)
   %record(parmfm) p
   %integer this unit = 0
   %integer from
   %integer max block = 32000
   %recordformat filefm(%integer name1, name2, %short spine, day)
   %recordformat dirfm(%short files, %byte access, check, %short chain,
                       %byte spare, daccess,
                       %record(filefm)%array file(1:42))

   %recordformat blockfm(%short size, addr)

   %recordformat spinefm(%short last, %byte access, check,
                         %integer size,
                         %record(blockfm)%array b(1:126))

   %routine read block(%integer block number, %record(*)%Name block)
      %record(parmfm) p
      p_sact = 1
      p_p1 = block number
      p_p2 = addr(block)
      p_p3 = this unit
      p_p4 = 0
      svc(101, p)
      %if p_p1 # 0 %start
         printstring("Cannot read block")
         write(block number, 1)
         write(p_p1, 6)
         newline
         %signal 13,0
      %finish
   %end
   %routine print file(%record(filefm)%Name f)
      %string(27)%name sn
      %record(parmfm) p
      p_p1 = 0
      p_p2 = 0
      p_p3 = f_name1
      p_p4 = f_name2
      svc(18, p)
      sn == string(addr(p_sact))
      printstring(Sn)
      spaces(15-length(sn))
   %end
   %integer n,j,k,l,z
   %record(dirfm) dir
   %record(filefm)%Name f
   %record(spinefm) spine

   %on 13 %start
      newline
      printstring("End of disc at block")
      write(n, 1)
      newline
      %stop
   %finish
   prompt("Unit: ");  read(this unit)


   prompt("From block: ");  read(n)
   n = n-1
   %cycle
      n = n+1
      read block(n, dir)
!      %continue %unless -100 <= dir_files <= 100
      l = 0;  z = 0
      %for j = 1,1,42 %cycle
         f == dir_file(j)
         %continue %If f_name2 = 0
         ->no %if f_name1 # 0 %and f_name1&X'FFFF' = 0
         read block(f_spine&X'FFFF', spine)
         z = z+1 %if spine_check # '?'
         z = z+1 %if f_name1&X'C0000000' # 0;  !dubious
         l = l+1
         ->no %if z > 8
      %repeat
      %continue %if l = 0
      printstring("Directory found at block")
      write(n, 1)
      newline
      k = 0
      %for j = 1,1,42 %cycle
         f == dir_file(j)
         %continue %If f_name2 = 0
         k = k-1
         %if k <= 0 %start
            k = 4
            newline
            spaces(10)
         %finish
         print file(f)
      %repeat
      newlines(2)
no:%repeat
%endofprogram
 H?    *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %begin;      !disc recovery program
   %integer owner, file1, file2
   %recordformat parmfm(%short dsno, dact, ssno, sact,
                        %integer p1,p2,p3,p4,p5,p6)
   %record(parmfm) p
   %integer this unit = 0
   %integer max block = 32000
   %recordformat filefm(%integer name1, name2, %short spine, day)
   %recordformat dirfm(%short files, %byte access, check, %short chain,
                       %byte spare, daccess,
                       %record(filefm)%array file(1:42))

   %recordformat blockfm(%short size, addr)

   %recordformat spinefm(%short last, %byte access, check,
                         %integer size,
                         %record(blockfm)%array b(1:126))

   %record(dirfm) dir
   %record(filefm)%name f
   %integer j,n
   %string(15) username
   %routine write block(%record(*)%Name block)
      %record(parmfm) p
      p_sact = 1
      p_p1 = 301
      p_p2 = addr(block)
      p_p3 = this unit
      p_p4 = 0
      svc(102, p)
      %if p_p1 # 0 %start
         printstring("Cannot write block")
         write(p_p1, 6)
         newline
         %signal 13,0
      %finish
   %end
   %routine pack(%string(15) file)
      %record(parmfm) p
      string(addr(p_sact)) = file
      svc(17, p)
      owner = p_p2;  file1 = p_p3;  file2 = p_p4
   %end
   prompt("Unit: ");  read(this unit)

   dir = 0
   %for j = 1,1,42 %cycle
      prompt("User name: ");  read(username)
      %exit %if username = "."
      prompt("Directory block: ");  read(n)
      pack(username.":PASS")
      f == dir_file(j)
      f_name1 = owner;  f_name2 = file2;  f_spine = n;  f_day = b'01000000'
   %repeat
   write block(dir)
%endofprogram
 H?    0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !VECCE: Screen editing implementation of ECCE for VAX, EMAS and
!       Perkin-Elmer 32-bit machines running MOUSES.
! Files addressed in virtual memory
!      Hamish Dewar  --  February 1981
!      V00: 09/02/81
!      V01: Bantam/hardcopy support added
!
%begin;                                   !MOUSES version,  A.Culloch
%constinteger rt=13, esc=27, tab=9;       !ASCII
%constinteger EOT = 4, ctrl X = 24, DEL = 127, BS = 8, CR = 13, LF = NL

!*System-dependent

%externalroutinespec   Temp library (%string(27) lib)
   Temp library ("ECCE:VM");              !dynamic linking with BYTEINTEGER etc
%externalpredicatespec Exists (%string(31) file)
%externalroutinespec CPU limit (%integer seconds)
   CPU limit (65535)
%externalroutinespec Terminal mode (%integer bits)
   Terminal mode (3)
   !(Binary input/output - no echoing)

%routine newline
   print symbol (CR);  print symbol (LF);  print symbol (-1)
%end
%routine newlines (%integer n)
   newline %and n = n - 1 %while n > 0
%end

%constinteger maxname=127;         !max file name length
%recordformat file(%string(maxname) name, %integer chan,
                    %integer top,lim,vmtop,vmlim,flag)
   %record %format blockfm (%byte %array B(0:511))
   %record %format buffm(%integer from,to,  {block maps these V.addrs}
                         %integer chan,     {paged in from here}
                         %integer block,    {block in paging file}
                         %record(buffm)%name link,   {circular list}
                         %record(blockfm) blk)
   %include "NewSrc:Command.inc"

   !*These procedures in ECCE:VM.EXE

   %external %routine %spec Close Off
   %external %byte %map %spec byte integer (%integer index)
   %external %routine %spec move (%integer length, from, to)
   %string(72) sys mess = "*unknown error*"
   %external %routine %spec connect input (%record(file)%name f)
   %external %integer buffers
      buffers = (Free Space - 3000) // (512 + 5*4)
   %record(buffm) %array buffr(1:buffers)
   %external %record(buf fm) %array %name buffer;  buffer == buffr
   %external %record(buf fm) %name buf
   buf == buffr(buffers)

!!!!!!!!!!!!!!!!!!!  Start of Editor proper !!!!!!!!!!!!!!!!!!!

!   Low                                                            High
!   addresses                                                      addresses
!   _______________________________________________________________________
!  | |      | |            |  |      |/|//////////| |                   |  |
!  | |      |C|urrent line |NL|      |/|//////////| |                 NL|NL|
!  |_|______|_|____________|__|______|_|__________|_|___________________|__|
!   ^        ^              ^         ^            ^                     ^
!   NEWTOP   LBEG           LEND      GAPTOP       GAPLIM                FLIM
!  
!   FP (The file pointer) may point above, below or at the gap (shaded area).
!   When the gap has been moved onto the file pointer (necessary for I/.../,
!   E,G etc), FP equals GAPLIM & characters may be inserted at GAPTOP.
!   (The "move gap onto FP" operation is performed by SPLIT).  Consolidate
!   Moves the gap to a line boundary.

%integer i,j,f,l,sym,default
%external %record(file) in,sec,out
%string(63) parm
parm = command_parameter

%routine edi(%record(file)%name old,sec,new, %integer video,rows,cols)
! Only the TOP and LIM components of the file info records are
!  relevant for editing (except when referencing secondary input)
!  In the EMAS version the original file is not copied into the
!  working space (NEW) prior to entry, so that OLD_LIM is not
!  equal to NEW_LIM: on VAX, OLD_LIM is equal to NEW_LIM (except
!  when just 'showing' in which case NEW_TOP = NEW_LIM = 0).
! The parameter VIDEO defines terminal characteristics:
!    signbit: Can DELETE-LINE & INSERT-LINE
!    4000000: Can reverse/reduce/underline arbitrary character
!          2: VT52-compatible
!          1: Bantam compatible
!   all zero: hardcopy
%constinteger cbound=50;        !command cell array bound
%constinteger tbound=120;       !quoted text array bound
%constinteger stopper=-10000;   !loop stop
%constinteger casebit=32
%integer cmax;                  !command cell max
%integer ci;                    !command index
%integer ti;                    !text index
%integer code;                  !command code
%integer ref;                   !text or bracket pointer
%integer scope;                 !search limit
%integer num;                   !repetition number
%integer sym,sym1,pend
%integer casemask;              !\0(\CASEBIT) to respect(ignore) case
%integer width;                 !line width (default 80)
%integer dir;                   !current direction of movement
%integer sin;                   !0(1) for main(secondary) input
%integer macpos;                !macro index values (3-byte nest)
!File pointers (byte addresses)
%integer lbeg;                  !line start position
%integer fp;                    !current file position
%integer lend;                  !line end position
%integer flim;                  !limit of current infile
%integer gaptop;                !start of gap
%integer gaplim;                !limit of gap
%integer mstart,msize;          !match start/size
%integer sfp,slim;              !saved FP/LIM for switching
%integer newtop,newlim;         !copies of NEW_TOP,NEW_LIM
! Video control variables
%integer line;                  !line number of current line
%integer winline;               !line number of top line on screen
%integer limline;               !limit line number (if known)
%integer breaks,joins;          !count of lines added/removed
%integer vrow,vcol;             !video cursor position
%own %integer zrow = 0
%own %integer mon = 1
%integer fprow
%own %integer print line = 0, printed = 0
%integer wintop, winbot;        !first/last window row
                                !the variable size window extends
                                !from floating WINTOP to fixed WINBOT
%integer winlim;                != WINBOT+1
%integer minwin;                !minimum window size
%integer changemin,changelbeg;  !alteration positions
%integer vp
%integer endon
!
!
%ownstring(9)%array prom(0:3) = ">", "^X  ^I >", "^Y  ^x>", "^Y  ^x>"
%ownstring(3)%array gprom(0:3)= ":", "^A ", "", "";  !*MOUSES*
%byteintegerarray macstore(1:192)
%recordformat commandcell(%byteinteger code,ref, %c
                     %shortinteger scope, %integer count)
%record(commandcell) %array r(1:cbound)
%byteintegerarray text(1:tbound); !text strings
!
! V i d e o   c o n t r o l   r o u t i n e s
!
%routine at(%integer row,col)
! Set cursor to row ROW (0:ROWS-1) and column COL (0:COLS-1)
  %if video # 0 %start
    vrow = row;  vcol = col
    col = cols - 1 %if col >= cols
    print symbol (ESC)
    %if video&2 # 0 %start;  !VT52
      print symbol ('Y');  print symbol (' '+row)
    %finish %else %start;    !Bantam
      print symbol ('X');  print symbol (' '+row)
      print symbol (ESC);  print symbol ('Y')
    %finish
    print symbol (' '+col)
  %finish
%end
!
%routine clear line
! Clear rest of current line
  %if video # 0 %and vcol < cols %start
    print symbol (ESC)
    %if video&2 # 0 %then print symbol ('x') %c
                    %else print symbol ('I') %and print symbol (0)
  %finish
%end
!
%routine vnewline
  vrow = vrow+1;  vcol = 0
  newline
%end
!
%routine insert line(%integer row)
  %if video < 0 %start
    at (row,0) %if vrow # row
    vcol = 0
    print symbol (ESC);  print symbol ('L')
  %finish
%end
!
%routine delete line(%integer row)
  %if video < 0 %start
    at (row,0) %if vrow # row
    vcol = 0
    print symbol (ESC);  print symbol ('M')
  %finish
%end
!
%const %integer clear = 1, inc = 2
!
%routine display line (%integer mode)
%integer k
  %if video<<1 > 0 %and vcol = 0 %start
    print symbol (' ');  vcol = 1
  %finish
  %cycle
    vp = gaplim %if vp = gaptop
    %if vp = flim %start
      %if endon = 0 %start
        print string(" **END**")
        limline = winline + vrow - wintop
      %finish
      endon = 1
      %exit
    %finish
    k = byteinteger(vp);  vp = vp+1
    %exit %if k = nl
    print symbol(k) %if vcol < cols
    vcol = vcol+1
  %repeat
  clear line %if mode&clear # 0
  vnewline %if mode&inc # 0
%end
!
%routine update
! If a change has been made to the file
!  update screen image, but only if current line is on screen
!  CHANGEMIN identifies the earliest point in the file affected
!  by alterations
%integer l,d,j,nop
  %return %if changemin = newlim;          !no change =>
  %return %if video = 0
  joins = joins-breaks;  l = line - winline + wintop - breaks
  %if l >= wintop %and l < winlim %start;  !within window
    vp = changemin;  endon = 0
    changemin = changemin-1 %while changemin # newtop %c
            %and byteinteger(changemin-1) # nl
    %if video < 0 %then at(l,vp-changemin) %c
                  %else at(l,vp-changemin+1)
    nop = 1
    %if changelbeg # lbeg %or vp # changemin %start
      nop = 0
      display line (clear+inc)
      l = l+1
    %finish
    -> done %if l = winlim
    %if joins < 0 %and video < 0 %start;  !net expansion
      j = joins
      %cycle
        %if wintop > zrow %start
          delete line(zrow)
          wintop = wintop-1;  l = l-1
        %finish %else %start
          delete line(winbot)
        %finish
        j = j+1
      %repeat %until j = 0
      %cycle
        insert line(l)
        joins = joins+1
      %repeat %until joins = 0
    %finish
    %while vrow # winlim %c
      %and (newtop<=vp<gaptop %or (vp=gaptop %and nop=0)) %cycle
      display line (clear+inc)
      l = l+1
    %repeat
    %if joins # 0 %start
      d = winlim-l-joins
      %if d <= 0 %or video > 0 %start
        display line (clear+inc) %while vrow # winlim
      %finish %else %start
        j = joins
        %cycle
          delete line(vrow)
          j = j-1
        %repeat %until j = 0
        %cycle
          %cycle
            vp = gaplim %if vp = gaptop
            endon = 1 %and %exit %if vp = flim
            vp = vp + 1
          %repeat %until byteinteger(vp-1) = NL
          d = d-1
        %repeat %until d = 0
        at(winlim-joins,0)
        %cycle
          insert line(vrow)
          display line(clear+inc)
        %repeat %until vrow = winlim
      %finish
    %finish
  %finish
done:
  changemin = newlim;  joins = 0;  breaks = 0
%end
!
%routine display
! Update screen & ensure that current line is on screen
%integer pre,k
!
%routine scanback
  %while pre > 0 %cycle
    vp = gaptop %if vp = gaplim
    %exit %if vp = newtop
    %cycle
      vp = vp-1
      vp = gaptop %if vp = gaplim
    %repeat %until vp = newtop %or byteinteger(vp-1) = nl
    pre = pre-1
  %repeat
%end
!
  update
  vp = lbeg;  endon = 0
  vp = vp-gaplim+gaptop %if vp < gaplim <= fp
  %if video = 0 %start;                    !hardcopy
    vcol = 0;  printline = line;  printed = gaptop+fp
    %if vp # fp %and num = 1 %start
      %cycle
        print symbol (byteinteger(vp))
        vp = vp + 1
        vp = gaplim %if vp = gaptop
      %repeat %until vp = fp
      print symbol ('^')
    %finish
    display line (inc)
    %return
  %finish
  pre = line - winline
  %if pre < 0 %start;                      !before start of window
    %if pre > -minwin %and (video<0 %or wintop+pre>=zrow) %start
                                           !worth prefixing
      wintop = wintop+pre;                 !decrease wintop (PRE neg)
      %while wintop < zrow %cycle
        delete line(winbot)
        insert line(zrow)
        wintop = wintop+1
      %repeat
      %if wintop > zrow %start
        at(wintop-1,0)
        print symbol('=');  clear line
      %finish
      at(wintop,0)
      %cycle
        display line (clear)
        pre = pre+1
        %exit %if pre >= 0
        vnewline
      %repeat
      winline = line
      %return
    %finish
  %finish %else %start
    pre = pre+wintop-winlim
    %return %if pre < 0;                   !within window =>
    %if pre < minwin %start;               !worth appending
      k = pre
      scanback
      at (winlim,0) %if video > 0
      %cycle
        delete line(zrow)
        %if wintop > zrow %then wintop = wintop-1 %c
        %else winline = winline+1
        insert line(winbot)
        display line (clear+inc)
        k = k-1
      %repeat %until k < 0
      NEWLINE %IF VIDEO > 0;               !*MOUSES*/*VAX*
      %return
    %finish
  %finish
  pre = minwin-1
  pre = pre//2 %if fp # flim
  winline = line-pre
  scanback
  winline = winline+pre
  wintop = winlim-minwin
  %if wintop > zrow %start
    at(wintop-1,0)
    print symbol('=');  clear line
    vnewline
  %finish %else %start
    at(zrow,0)
  %finish
  %cycle
    display line (clear)
    %exit %if vrow >= winbot
    vnewline
  %repeat
%end
!
! F i l e   m o d i f y i n g   r o u t i n e s
!
%routine split
! Create gap in file if gap is not at FP
%integer j,diff,unit
  %if newtop <= fp < gaptop %start;        !FP in upper half
!??????
!??????    %if flim # newlim %start;              !Lower half still in old
!??????      j = flim - gaplim;                   !  so must now copy across
!??????      ->abdn %if newlim - j < gaptop
!??????      move (j,gaplim,newlim-j)
!??????      gaplim = newlim - j
!??????      flim = newlim
!??????    %finish
!??????
    j = gaptop-fp;                         !amount to shift down
    diff = gaplim-gaptop
    %cycle;                                !shift in units <= gapsize
      unit = j;  unit = diff %if diff < unit
      gaptop = gaptop-unit;  gaplim = gaplim-unit
      move(unit,gaptop,gaplim)
      j = j-unit
    %repeat %until j = 0
    mstart = gaplim %if mstart = fp
    lbeg = lbeg+diff;  lend = lend+diff
    fp = gaplim
  %finish %else %start
    j = fp-gaplim
    %if j > 0 %start
      ->abdn %if gaptop+j >= newlim
      move(j,gaplim,gaptop)
    %finish
    gaptop = gaptop+j;  gaplim = fp
  %finish
  %if gaptop < changemin %start
    changemin = gaptop;  changelbeg = lbeg
  %finish
  j = gaplim;  j = newlim %if flim # newlim
  %return %if gaptop+256 < j
abdn:
  print string(" ** File too big ")
  %stop
%end
!
%routine consolidate
! Ensure that the gap lies on a line boundary
!  by copying up the remainder of a split line
%integer diff
  %if gaptop # newtop %and byteinteger(gaptop-1) # nl %start
    %cycle
      byteinteger(gaptop) = byteinteger(gaplim)
      %if gaplim = fp %start
        diff = gaplim-gaptop
        lbeg = lbeg-diff;  fp = fp-diff
        lend = lend-diff;  mstart = fp %if mstart = gaplim
      %finish
      gaptop = gaptop+1;  gaplim = gaplim+1
    %repeat %until byteinteger(gaptop-1) = nl
  %finish
%end
!
%routine join
! Erase from FP to end of line AND the line terminator
!  (covers Kill, Join, Uncover)
!  NB LEND not updated
  split
  lbeg = lbeg+(lend-fp+1);  fp = lend+1
  changelbeg = lbeg
  gaplim = fp
  %if line >= winline %then joins = joins+1 %c
  %else winline = winline-1
  limline = limline-1
%end
!
%routine switch
! Switch between main and secondary input
!  Create false bottom if switching from main and lower half is in NEW
%integer i
  split
  newlim = gaplim %if flim = newlim;       !create false bottom
  i = sfp;  sfp = fp;  fp = i
  i = slim;  slim = flim;  flim = i
  sin = sin!!1
  lbeg = lbeg-sfp+fp;  gaplim = fp
  newlim = flim %if newlim = gaplim;       !remove false bottom
  lend = fp
  lend = lend+1 %while lend # flim %and byteinteger(lend) # nl
  joins = 999
  limline = 99999
%end
!
! C o m m a n d   i n p u t   routines
!
%integer type,chain,hold,echo
!
%routine print code(%integer k)
! Print command letter (mapping 'minus' values)
  print symbol(k-casebit) %and k='-' %if k >= 'a'
  print symbol(k)
%end
!
%own %string(80) com line = ""
%own %integer com pos = 1
%own %string(15) prompt
!
%routine report bells(%integer N)
   %cycle
      printsymbol(7)
      printsymbol(-1)
      %exit %if n <= 0
      n = n-1
      skipsymbol
   %repeat
%end

%routine read line
! Binary input burdens us with line editing
  %integer sym
  print string (prompt)
  com line = ""
  %cycle
    print symbol (-1);                     !force output
    read symbol (sym);  sym = sym&127
    %if sym = ctrl X %start;               !line cancel
      com line = ""
      print symbol (CR);  clear line;  newline
      print string (prompt);  print symbol (-1)
    %else %if sym = DEL %or sym = BS
      %if com line # "" %start
        length(com line) = length(com line) - 1
        print symbol (BS)
        print symbol (' ')
        print symbol (BS);                 !erase char on screen
      %finish
    %else %if sym = TAB
      print symbol (' ');  print symbol (' ');  print symbol (' ')
      com line = com line . "   "
    %else
      %if sym = CR %start
        print symbol (CR);  sym = NL
        print symbol (LF)
      %else %if sym = NL
        report bells(0) %and %continue %if Com Line # ""
        sym = CR
      %else %if sym = ESC
        !no echo
        report bells(1) %and %continue %if Com Line # ""
      %else %if sym < ' '
        %continue
      %finish %else print symbol (sym)
      com line = com line . to string (sym)
      %exit %if sym < ' '
    %finish
  %repeat
  print symbol (-1)
  com pos = 1
%end
!
%routine read sym
! Read next command symbol to SYM (maybe from macro def)
  %if pend # 0 %start
    sym = pend;  pend = 0
  %finish %else %start
    %while macpos # 0 %cycle;              !expanding macro
      sym = macstore(macpos&255)
      macpos = macpos+1
      %return %unless sym = nl;            !(NL is definition terminator)
      macpos = macpos>>8
    %repeat
    read line %if com pos > length(com line)
    sym = char no (com line,com pos)
    com pos = com pos + 1
    print symbol (sym) %if echo # 0 %and sym >= ' '
  %finish
%end
!
%routine ignore
  echo = 0
  read sym %while sym # nl
%end
!
!Symbol types:-
!   0:numeric  1:terminator 2:illegal  3:quote
!   4:DU       5:IS         6:E        7:KJBGC@$
!   8:F        9:TV        10:M       11:LR
!  12:( [     13:,         14:) ]     15:? \
!High order bits relevant following percent
%constbyteintegerarray symtype(32:95) = %c
   16_03,16_03,16_03,16_03,16_07,16_02,16_03,16_03,
   16_0C,16_0E,16_00,16_03,16_0D,16_02,16_03,16_03,
   16_00,16_00,16_00,16_00,16_00,16_00,16_00,16_00,
   16_00,16_00,16_03,16_01,16_02,16_02,16_02,16_0F,
   16_07,16_87,16_07,16_17,16_54,16_06,16_08,16_07,
   16_02,16_05,16_07,16_07,16_6B,16_4A,16_02,16_02,
   16_0B,16_02,16_0B,16_25,16_09,16_34,16_49,16_70,
   16_70,16_70,16_70,16_0C,16_0F,16_0E,16_03,16_03
!     sp    !     "     #     $     %     &     '
!     (     )     *     +     ,     -     .     /
!     0     1     2     3     4     5     6     7
!     8     9     :     sc    <     =     >     ?
!     @     A     B     C     D     E     F     G
!     H     I     J     K     L     M     N     O
!     P     Q     R     S     T     U     V     W
!     X     Y     Z     (     \     )     ^     _
!
%routine read item
! Read symbol to SYM and codify in TYPE
! intercept macro letters ('W', 'X', 'Y', 'Z')
! assemble numeric items in NUM
  %cycle
    type = 1;                              !for terminator
    read sym %until sym # ' ';             !ignore spaces
    %return %if sym < ' ';                 !terminator (any control) =>
    sym = sym&95 %if sym >= 96;            !ensure upper case (and more)
    type = symtype(sym)&15
    %return %if type # 0;                  !not numeric or macro =>
    %exit %if sym < 'W'
    %if macpos>>24 # 0 %then macpos = 0 %c
    %else macpos = (macpos<<2+(sym-'W'))<<6+1;   !push down any existing calls
  %repeat
  num = 0
  %return %if sym = '*'
  %cycle
    num = num*10+sym-'0'
    read sym
  %repeat %until %not '0' <= sym <= '9'
  pend = sym
%end
!
%routine minus
! Test for minus: map CODE if so
  %if sym = '-' %start
    code = code+casebit;                   !lower-case
    read item
  %finish
%end
!
%routine unchain
! Insert forward references in left bracket and comma cells
  %cycle
    ref = chain
    %return %if ref = 0
    chain = r(ref)_ref
    r(ref)_ref = ci
  %repeat %until r(ref)_code = '['
%end
!
!
%const %byte %array immed('A':'D') =
   'm',  'M',  'R',  'L'
   !up   down  right left
   !escA escB  escC  escD  (fn keys on input)
%switch c(4:15), pc(0:15), s('$':'p')
%integer i,j,p,fp1
%shortinteger forced
!
! I n i t i a l i s a t i o n
!
  mstart = 0;  cmax = 0
  r(cbound-1) = 0;                         !'immediate-action' cell
  r(cbound-1)_count = 1
  r(cbound) = 0
  r(cbound)_code = ']';                    !terminating cell for i-a
  r(cbound)_count = stopper+1
  macpos = 0
  macstore(1) = nl;  macstore(65) = nl
  macstore(129) = nl;  macstore(192) = nl
  casemask = \casebit;                     !ignore case distinctions (default)
  width = 80;  dir = 0
  newtop = new_top;  gaptop = newtop
  newlim = new_lim
  fp = old_top
  gaplim = fp;  lbeg = fp;  lend = fp
  flim = old_lim
  lend = lend+1 %while lend # flim %and byteinteger(lend) # nl
  sin = 0;  sfp = sec_top;  slim = sec_lim
  changemin = newlim;  changelbeg = 0
  joins = 0;  breaks = 0
  line = 1;  winline = 0;  limline = 999999
  WINLIM = ROWS-2;  !VAX/MOUSES
  winbot = winlim-1;  wintop = winbot
  minwin = 3
  vrow = 99
  newlines (rows-winlim-1) %if video # 0
  %for i = 0,1,3 %cycle
    %for j = 1,1,length(prom(i)) %cycle
      charno(prom(i),j) = esc %if charno(prom(i),j) = '^'
    %repeat
    charno(prom(i),3) = ' '+winlim %if i > 0
    CHARNO(GPROM(I),1) = ESC %IF I > 0;  !VAX/MOUSES
  %repeat
  charno(prom(1),4) = rt;  charno(prom(1),7) = rt
  %IF NEW_LIM > OLD_LIM %START;          !MOUSES
    GAPTOP = OLD_LIM;  GAPLIM = NEW_LIM
    FLIM = GAPLIM
    BYTEINTEGER(GAPLIM) = NL
    FP = GAPLIM %IF FP = GAPTOP
    LBEG = FP;  LEND = FP
  %FINISH
  LEND = LEND+1 %WHILE LEND # FLIM %AND BYTEINTEGER(LEND) # NL
  sym = nl
!
! R e a d   n e w   c o m m a n d   l i n e
!
read:
  %if sin = 0 %then prompt = prom(video&3) %c
  %else prompt = prom(video&3).">"
  pend = 0;  sym1 = sym
  r(cbound-1)_count = 1
  %if sym = nl %start
    %if video = 0 %start
      num = 1
      display %if (mon=0 %and printline#line) %c
          %or (mon>0 %and printed#gaptop+fp)
    %finish %else %start
      display
      ! show position of pointer
      fprow = line-winline+wintop
      at(fprow,fp-lbeg)
      %if video > 0 %start
        print symbol ('^')
        sym1 = ' '
        %if fp # lbeg %start
          %if fp # gaplim %then sym1 = byteinteger(fp-1) %c
          %else sym1 = byteinteger(gaptop-1)
        %finish
      %finish %else %start
        print symbol(esc);  print symbol('4');  !reduced intensity
        sym1 = ' ';  sym = '|'
        %if fp # lend %and byteinteger(fp) # ' ' %start
          sym1 = byteinteger(fp);  sym = sym1
        %finish
        print symbol(sym)
        print symbol(esc);  print symbol('3');  !normal intensity
      %finish
      NEWLINE;    !VAX to flush
    %finish
  %finish %else %start
    read sym
    pend = sym %if sym # nl;               !NL not significant
  %finish
! Deal with special cases
  ci = 0;  ti = 0;  chain = 0
  echo = 0
  %cycle
    read item
    %exit %if sym # '-'
    dir = dir!!casebit;                    !toggle direction
  %repeat
  %if type = 1 %and sym = ESC %start;      !fn key input
    read symbol (sym)
    r(cbound-1)_code = immed(sym) %if 'A' <= sym <= 'D'
    %if sym = 'P' %start
      r(cbound-1)_code = 'W';  r(cbound-1)_count = 0
    %finish
    ci = cbound - 2
    sym = NL;  !force display later
    ->restore
  %finish
  %if type = 1 %start
    ->read %if cmax = 0 %or sym # CR
    type = 0;  num = 1
    r(cmax)_count = num
    sym = NL;  ->restore
  %finish;                                 !LF->CR (in READLINE) -> "1" (again)
  %if type = 0 %and cmax # 0 %start;       !repetition
    r(cmax)_count = num
    read item;  -> er1 %if type # 1
    -> restore
  %finish
  %if sym = '%' %start
    read sym;  -> erq %if sym < 'A'
    code = sym&95;                         !upper-case
    read sym
    -> pc(symtype(code)>>4&15)
  %finish
  dir = 0
  %if video > 0 %start
    clear line;  print symbol('=')
    print symbol(sym)
    echo = 1
  %finish
! C o m m a n d   i n p u t:  m a i n   l o o p
more:                                      !(command code has been read)
  hold = type;  -> er2 %if hold < 4
  -> er0 %if hold < 8 %and newtop = 0;     !'change' command when Showing
  ci = ci+1;  -> er6 %if ci >= cbound-3
  code = sym;                              !command letter
  ref = 0;  num = 1;  scope = 1;           !default values
  read item
  -> c(hold)
c(8):                                      !Find
  minus
  scope = 0
c(4):                                      !+ Delete, Uncover
c(9):                                      !+ Traverse, Verify
  %if type = 0 %start;                     !followed by number
    scope = num
    read item
  %finish
  num = 0;                                 !as indicator (not I,S)
c(5):                                      !+ Insert, Substitute
  hold = sym;  -> er4 %if type # 3;        !not valid quote mark ->
  ti = ti+1;  ref = ti;                    !REF indexes first quoted symbol
  %cycle
    read sym
    %if sym = nl %start;                   !closing quote omitted
      -> er4 %if num = 0;                  !allowed only for I,S
      pend = sym;  sym = hold
    %finish
    %exit %if sym = hold
    -> er6 %if ti > tbound-2
    sym = sym&casemask %if 'a' <= sym <= 'z' %and num = 0
    text(ti) = sym;  ti = ti+1
  %repeat
  -> er4 %if ti = ref %and num = 0;        !null allowed only for I,S
  text(ti) = 0;                            !end-marker
  num = 1;                                 !restore default
  read item
  -> nput
c(6):                                      !Erase
c(10):                                     !+ Move, Print
  minus
c(7):                                      !+ Get, Kill, etc
c(11):                                     !+ Left, Right, etc
  -> er1 %if type = 3;                     !(redundant, but better report)
  -> nput
c(12):                                     !open bracket
  code = '['
  -> comma
c(13):                                     !comma
  code = '^'
! read item %if type = 1;                  !permit line break (better not?)
comma:
  ref = chain;  chain = ci
  -> put
c(14):                                     !close bracket
  unchain;  -> er3 %if ref = 0
  code = ']';  r(ref)_count = num
nput:
  read item %if type = 0;                  !get next item if number
c(15):                                     !invert, query
put:
  r(ci)_code = code;  r(ci)_ref = ref
  r(ci)_scope = scope;  r(ci)_count = num
  -> more %unless type = 1
  ci = ci+1;  cmax = ci
  unchain;  -> er3 %if ref # 0
  r(ci)_code = ']'; r(ci)_ref = 0
  r(ci)_count = 1
  ci = 0
  insert line(winlim);                     !preserve command line
restore:
  %if sym1 # nl %start
    at(fprow,fp-lbeg)
    print symbol(sym1)
  %finish
  -> next
!
er0:print symbol(' ');  print code(sym)
    print string(" when showing")
    -> erq
er1:print symbol(' ');  print symbol(code)
er2:code = sym
    -> er5
er3:printstring(" ()")
    -> erq
er4:printstring(" Text for")
pc(0):
er5:print symbol(' ');  print code(code)
    -> erq
er6:printstring(" Size")
erq:print symbol('?')
    %if video # 0 %then clear line %else newline
    cmax = 0 %if ci > 1
    ignore
    -> read
!
! Percent commands
pc(1):                                     !%C: close
  switch %if sin # 0
  new_flag = 1 %if changelbeg # 0
  new_lim = gaptop
  old_top = gaplim;  old_lim = flim
  clear line
  %return
pc(2):                                     !%S: switch inputs
  switch %if sin # 0
  %if sym = '=' %start
    i = 0
    %cycle
      read sym
      %exit %if sym = ';' %or sym = nl
      -> er6 %if i = maxname
      i = i+1;  charno(sec_name,i) = sym
    %repeat
    %if i # 0 %start
      length(sec_name) = i
      ->erq %unless exists (sec_name)
      connect input(sec)
    %finish
  %finish
  sfp = sec_top;  slim = sec_lim
  -> erq %if sec_top = sec_lim
  switch
  -> read
pc(3):                                     !%U: ignore/respect case
  casemask = \casebit
  casemask = \0 %and read sym %if sym = '-'
  -> read
pc(4):                                     !%M (%V)
  %if code = 'M' %start
    mon = 0
    mon = 1 %and read sym %if sym = '+'
    mon = -1 %and read sym %if sym = '-'
  %finish %else %start
    read item
    -> erq %if type # 0
    video = (num&x'C')<<28+num&3
    winline = -99
  %finish
  -> read
pc(5):                                     !%D: define window size
  %if sym = '=' %start
    read item
    -> erq %if type # 0
    -> er6 %unless num <= winlim
    minwin = num
    video = 0 %if num <= 0
  %finish
  winline = -99
  -> read
pc(6):                                     !%L: define line length
  -> erq %if sym # '='
  read item
  -> erq %if type # 0
  -> er6 %unless 5 <= num <= 256
  width = num
  -> read
pc(7):                                     !%W, %X, %Y, %Z
  i = (code-'W')<<6+1;                     !64-byte increments
  %if sym = '=' %start;                    !definition
    %cycle
      read sym
      macstore(i) = sym
      %exit %if sym = nl
      i = i+1 %if i # 255
    %repeat
  %finish %else %start;                    !enquiry
    -> er1 %if sym # nl
    print symbol(code);  print symbol('=')
    %cycle
      sym = macstore(i)
      %exit %if sym = nl
      print symbol(sym)
      i = i+1
    %repeat
    %if video # 0 %then clear line %else newline
  %finish
  -> read
!
pc(8):                                     !%A: abandon edit
  out_name = "";                           !force SHOW
  %return;                                 !back from EDI
!
pc(*): ->er5
!
! C o m m a n d   e x e c u t i o n
!
%integerfn matched
%integer i,j,k
  i = fp-1; j = ref-1
  %cycle
    i = i+1;  j = j+1
    k = byteinteger(i)
    k = k&casemask %if 'a' <= k <= 'z'
  %repeat %until k # text(j)
  %result = 0 %if text(j) # 0
  mstart = fp;  msize = i-fp
  %result = 1
%end
!
! Extract next command
!
next: s('?'):
  ci = ci+1
  code = r(ci)_code;  ref = r(ci)_ref
  num = r(ci)_count;  forced = 0
  -> s(code)
!
! Successful return after Move etc
!   FP has been advanced into next line, new LEND to be determined
lok:
  lend = fp
  %if lend # flim %start
    lend = lend+1 %while byteinteger(lend) # nl
  %finish
! Successful return from execution
ok:
  num = num-1
  -> next %if num = 0
  -> s(code)
fail:
  num = 1
! Failure return
no: s('\'):
  %cycle
    -> next %if num <= 0;                  !indefinite repetition ->
    ci = ci+1
    -> next %if r(ci)_code = '\';          !invert immediately after ->
    -> next %if r(ci)_code = '?';          !query immediately after ->
    %while r(ci)_code # ']' %cycle
      -> next %if r(ci)_code = '^';        !comma ->
      ci = r(ci)_ref %if r(ci)_code = '['
      ci = ci+1
    %repeat
    num = r(ci)_count
  %repeat %until ci >= cmax
  -> read %if num <= 0
!
!E x e c u t i o n   e r r o r
!
  at(winlim+1,40)
  printstring(" Failure: ")
  print code(code)
  %if ref # 0 %start
    print symbol('''')
    %while text(ref) # 0 %cycle
      print symbol(text(ref))
      ref = ref+1
    %repeat
    print symbol('''')
  %finish
  %if video # 0 %then clear line %else newline
  ignore
  -> read

!
!I n d i v i d u a l   c o m m a n d s
!
s('['):                                    !open bracket
  r(ref)_count = num;                      !restore count on ']'
  -> next
!
s(']'):                                    !close bracket
  num = num-1
  %if num # 0 %and num # stopper %start
    r(ci)_count = num;                     !update
    ci = ref;                              !position of '['
  %finish %else %start
    -> read %if ci >= cmax
  %finish
  -> next
!
s('^'):                                    !comma
  ci = ref-1;                              !position of ']' - 1
  -> next
!
s('P'):
  display
  ->ok %if num = 1
s('M'):                                    !Move
  -> no %if fp = flim
  update
  fp = lend+1
  fp = gaplim %if fp = gaptop
  line = line+1
  fp = flim %and line = limline %if num = 0 %and code = 'M'
  lbeg = fp
  -> lok
!
s('m'):                                    !Move back
  -> no %if lbeg = newtop %or sin # 0
  update
  consolidate
  mstart = 0
  %if num = 0 %start;                      !M-*
    lbeg = newtop
    lbeg = gaplim %if lbeg = gaptop
    fp = lbeg
    line = 1;  num = 1
    -> lok
  %finish
  %if lbeg = gaplim %start
    -> no %if gaptop = newtop
    lbeg = gaptop
  %finish
  line = line-1;                           !there is a line there
  lend = lbeg-1
  lbeg = lbeg-1 %until lbeg=gaplim %or lbeg=newtop %or byteinteger(lbeg-1)=nl
  fp = lbeg
  -> ok
!
s('c'):                                    !Left-shift then case flip
s('L'):                                    !Left-shift
left:
  -> no %if fp = lbeg %or sin # 0
  consolidate %if fp = gaplim
  mstart = 0
  fp = fp-1
  forced = 0 %and ->ok %if forced # 0 %or code = 'L'
!
s('C'):                                    !Case-change with right-shift
  -> no %if fp = lend
  %if 'A' <= byteinteger(fp)&95 <= 'Z' %start
    split
    byteinteger(gaptop) = byteinteger(fp)!!casebit
    gaptop = gaptop+1;  gaplim = gaplim+1
  %finish
!
s('R'):                                    !Right-shift
  -> no %if fp = lend
  fp = fp+1
  forced = 1 %and ->left %if code = 'c'
  -> ok
!
s('E'):                                    !Erase
  -> no %if fp = lend
  split
  lbeg = lbeg+1;  fp = fp+1
  gaplim = fp
  -> ok
!
s('e'):                                    !Erase back
  -> no %if fp = lbeg
  split
  lbeg = lbeg+1;  gaptop = gaptop-1
  changemin = gaptop %if gaptop < changemin
  -> ok
!
s('V'):                                    !Verify
  -> no %if fp = lend
  -> no %if (byteinteger(fp)!!text(ref))&casemask # 0; !quick check
  -> no %if matched = 0
  -> next
!
s('D'):                                    !Delete
s('T'):                                    !+ Traverse
  fp1 = fp
  -> find
!
s('F'):                                    !Find
s('U'):                                    !+ Uncover
  fp1 = fp
  fp = fp+1 %if fp = mstart
find:
  scope = r(ci)_scope;                     !number of lines to search
  sym1 = text(ref);                        !first symbol of quoted text
  %while fp # flim %cycle
    %while byteinteger(fp) # nl %cycle
      %if (byteinteger(fp)!!sym1)&casemask = 0 %start
        -> found %if matched # 0
      %finish
      fp = fp+1
    %repeat
    lend = fp
    scope = scope-1
    %exit %if scope = 0
    %if code # 'U' %start
      update
      fp = fp+1
      fp = gaplim %if fp = gaptop
      lbeg = fp
      line = line+1
    %finish %else %start
      fp = fp1;  join
    %finish
    fp1 = fp
  %repeat
  lend = fp;  fp = fp1
  -> no
found:
  %if code = 'D' %start
    split
    lbeg = lbeg+msize;  fp = fp+msize
    gaplim = fp
  %finish
  fp = fp+msize %if code = 'T'
  %if code = 'U' %start
    i = fp-fp1;  fp = fp1
    split
    lbeg = lbeg+i;  fp = fp+i
    gaplim = fp
  %finish
  -> lok
!
s('f'):                                    !Find back
  scope = r(ci)_scope
  update
  consolidate
  %cycle
    %while fp # lbeg %cycle
      fp = fp-1
      -> ok %if matched # 0
    %repeat
    scope = scope-1
    -> no %if scope = 0 %or fp = newtop
    %if fp = gaplim %start
      -> no %if gaptop = newtop
      fp = gaptop
    %finish
    lbeg = fp
    fp = fp-1;  lend = fp
    line = line-1
    lbeg = lbeg-1 %until lbeg=gaplim %or lbeg=newtop %or byteinteger(lbeg-1)=nl
  %repeat
!
s('S'):                                    !Substitute
  -> no %if fp # mstart
  split
  lbeg = lbeg+msize;  fp = fp+msize
  gaplim = fp
!
s('I'):                                    !+Insert
  -> ok %if text(ref) = 0
  -> no %if fp-lbeg > width %or fp = flim
  split
  j = ref
  %cycle
    byteinteger(gaptop) = text(j)
    gaptop = gaptop+1;  j = j+1
  %repeat %until text(j) = 0
  lbeg = lbeg-(j-ref)
  -> ok
!
s('W'):                                    !immediate insert
  split
  display
  at (line-winline+wintop,fp-lbeg)
  print symbol (-1)
  %cycle
    read symbol (sym);  sym = sym&127
    %if sym = ESC %start
      read symbol (Sym);  %continue %unless Sym&127 = 'H'
      print symbol (ESC);  print symbol ('j');  !out of insert mode
      consolidate
      sym = NL
      ->no
    %finish
    %if sym = DEL %or sym = ctrl X %start
      %while gaptop # newtop %and byteinteger(gaptop-1) # NL %cycle
         gaptop = gaptop - 1
         print symbol (BS);  print symbol (ESC);  print symbol ('O')
         print symbol (-1)
         lbeg = lbeg + 1
      %repeat %until sym = DEL
      %continue
    %finish
    %if sym = CR %start
      consolidate
      display
      ->s('B')
    %finish
    %if sym = TAB %start
      %for j = 0,1,2 %cycle
        byte integer (gaptop+j) = ' '
        print symbol (' ')
      %repeat
      print symbol (-1)
      gaptop = gaptop + 3
      %continue
    %finish
    print symbol (ESC);  print symbol ('i');      !into insert mode
    print symbol (sym)
    sym = NL %and print symbol (sym) %if sym = CR
    print symbol (ESC);  print symbol ('j');      !& out again
    print symbol (-1)
    byte integer (gaptop) = sym
    gaptop = gaptop + 1
    lbeg = lbeg - 1 {?}
  %repeat
!
s('G'):                                    !Get (line from terminal)
  -> no %if sin # 0 %and fp # lbeg
  consolidate
  fp = lbeg
  split
  %if video # 0 %start
    %if video < 0 %start
      display
      fprow = line-winline+wintop
      delete line(winlim)
      insert line(fprow)
    %finish %else %start
      byteinteger(gaptop) = nl;  gaptop = gaptop+1
      breaks = breaks+1
      line = line+1;  limline = limline+1
      update
      fp = gaptop-1;  lbeg = fp
      line = line-1
      display
      fprow = line-winline+wintop
      gaptop = gaptop-1
      fp = gaplim;  lbeg = fp
      limline = limline-1
      at(fprow,0)
    %finish
    NEWLINE;   !VAX
  %finish
  prompt = gprom(video&3)
  read sym
  vrow = 999
  %if sym = ':' %start
    read sym %until sym = nl
    %if video # 0 %start
      %if video < 0 %start
        delete line(fprow)
        insert line(winlim)
      %finish %else %start
        changemin = gaptop;  changelbeg = lbeg
        joins = joins+1
      %finish
    %finish
    -> no
  %finish
  line = line+1;  limline = limline+1
  %cycle
    byteinteger(gaptop) = sym;  gaptop = gaptop+1
    %exit %if sym = nl
    read sym
  %repeat
  %if video < 0 %and fprow = winbot %start;  !bring back
    delete line(zrow)
    %if wintop > zrow %then wintop = wintop-1 %c
    %else winline = winline+1
    insert line(winlim)
  %finish
  -> ok
!
s('B'):                                    !Break
  num = 66 %if num = 0 %or num > 66
  split
break:
  byteinteger(gaptop) = nl;  gaptop = gaptop+1
  breaks = breaks+1
  line = line+1;  limline = limline+1
  lbeg = fp
  -> ok
!
s('K'):                                    !Kill
  -> no %if fp = flim
  fp = lbeg
  join
  -> lok
!
s('J'):                                    !Join
  fp = lend
  -> no %if fp = flim %or fp-lbeg > width
  join
  -> lok
!
s('A'):                                    !Adjust
  -> s('M') %if lend = lbeg
  consolidate
  %while lend-lbeg <= width %cycle
    fp = lend+1
    %if fp = gaptop %start
      fp = gaplim;  lbeg = lbeg+(gaplim-gaptop)
    %finish
    lend = fp
    lend = lend+1 %while lend # flim %and byteinteger(lend) # nl
    %if fp = lend %or byteinteger(fp) = ' ' %start
      update
      lbeg = fp;  line = line+1
      ->no
    %finish
    split
    byteinteger(gaptop-1) = ' '
    changemin = gaptop-1 %if changemin >= gaptop
    joins = joins+1;  limline = limline-1
  %repeat
  consolidate
  fp = lbeg+width+1
  %cycle
    fp = fp-1
    -> no %if fp = lbeg
  %repeat %until byteinteger(fp) = ' '
  split
  fp = fp+1
  gaplim = fp
  -> break
!
!
s('@'):                                    !'at' Column NUM
  -> fail %if lend = flim
  i = width-(lend-fp)
  num = i %if i < num
  i = fp-lbeg-num
  -> next %if i = 0
  split
  %cycle
    %if i < 0 %start;                      !left of it
      byteinteger(gaptop) = ' ';  gaptop = gaptop+1
      lbeg = lbeg-1;  i = i+1
    %finish %else %start
      -> fail %if fp = lbeg %or byteinteger(gaptop-1) # ' '
      gaptop = gaptop-1;  lbeg = lbeg+1
      changemin = gaptop %if gaptop < changemin
      i = i-1
    %finish
  %repeat %until i = 0
  -> next
s('$'):
  switch
  -> next
%end;                                      !END OF EDI
!
!
  in = 0;  sec = 0;  out = 0
  l = 0
  IN_NAME  = COMMAND_IN1
  SEC_NAME = COMMAND_IN2
  out_name = in_name;  default = 1
  OUT_NAME = COMMAND_OUT1 %AND DEFAULT = 0 %IF COMMAND_OUT1 # ""
  IN_NAME = "" %IF IN_NAME = "n:"
  OUT_NAME = "" %IF OUT_NAME = "n:"
  %IF OUT_NAME = "" %START
    CONNECT INPUT(IN);                     !WITHOUT EXTRA
    %STOP %IF IN_FLAG # 0
  %FINISH %ELSE %START
    IN_FLAG = 20;                          !EXTRA BLOCKS
    CONNECT INPUT(IN)
    %STOP %IF IN_FLAG # 0
    %IF SEC_NAME # "" %START
      CONNECT INPUT(SEC)
      %STOP %IF SEC_FLAG # 0
    %FINISH
    OUT_TOP = IN_VMTOP;  OUT_LIM = IN_ LIM; !VAX
    in_top = in_lim %if in_name = ""
  %finish
  newline
  %if command_modifier # 0 %then EDI(in,sec,out,0,24,80) %c
  %else edi (in,sec,out,x'C0000002'{vt52},24,80)
  %if (default # 0 %and out_flag = 0) %or out_name = "" %start
    print string("No changes")
    out_top = 0
  %finish
  Terminal mode (0);   !back to normal
  %if out_top # 0 %start
    i = in_lim-in_top;  move(i,in_top,out_lim)
    out_lim = out_lim+i
    CLOSE OFF
  %finish
  %if out_flag # 0 %and out_name # "" %start
    print string (out_name . " complete")
    newline
  %finish
%endofprogram
 H?   R R5                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     @?   @ +I  g            :     W:)   sa  /    {a  4                                                                                                                                                                                                                                                                                                                                                                                                                                                  %begin
   %option "Noopen"
! Implementation of Edinburgh Compatible Context Editor in IMP
! K.Adam & R. Thonnes (April 1977)
! based on that for DEC PDP-9/15 by H.Dewar (June 1970)
! Updated for Mouses P. Robertson (June 1980)
! with:   Re-implementation of - commands using lower-case controls
!         Plus:  J-  K-  C  C-  L-  R-  O
%OWNINTEGER BUFFER SIZE = 3000
%CONSTINTEGER MIN=1;                  !MAIN INPUT STREAM
%CONSTINTEGER MOUT=1;                 !MAIN OUTPUT STREAM
%CONSTINTEGER SIN=2;                  !SECONDARY INPUT STREAM
!  Secondary input is not a standard feature of ECCE
%CONSTINTEGER STOP=-5000;             !LOOP STOP VALUE
%OWNINTEGER IN=MIN;                   !CURRENT INPUT STREAM
%OWNINTEGER MON=1;                    !MONITOR INDICATOR
%OWNINTEGER PRINT1=0,PRINT2=0;        !PRINT INDICATORS
%OWNINTEGER SYM = NL
%BYTEINTEGERARRAY MAP(0:127);         !UPPER/LOWER CASE MAP
%INTEGER I,J,K,PP1
%CONSTINTEGER SEXTRA=180;             !EXTRA BUFFER FOR SIN
%INTEGERNAME MAINFP;                  ! == FP OR MFP (FOR SIN)

!  The command input phase reads and checks a complete
!command line, forming up an internal representation
!as a sequence of fixed-length command units.
!The basic components of a command unit are:
%externalstring(17) %spec Console int
%INTEGER CODE;                        !COMMAND CODE SYMBOL
%INTEGER TEXT;                     !TEXT POINTER (0 IF NOT RELEVANT)
%INTEGER NUM;                         !REPETITION NUMBER
!Command units are stored sequentially from the start
!of array C (CBASE): text strings are stored backwards
!from the end of the same array (TBASE).
!Parentheses and commas occurring in commands are also
!transformed to command units. The TEXT component of
!open bracket and comma units points to the corresponding
!close bracket: the TEXT component of close bracket
!units points back to the first enclosed unit.
%INTEGERARRAY C(0:119)
%INTEGER CBASE;  CBASE = ADDR(C(0));  !(CONST AD)
%INTEGER TBASE;  TBASE = CBASE+119*4;   !(CONST AD)
%INTEGER CI;                       !COMMAND INDEX (AD)
%INTEGER TI;                       !TEXT INDEX (AD)
%OWNINTEGER CMAX=0;                   !COMMAND MAX (AD)

!  Macro definitions (optional feature)
%INTEGERARRAY STORED(1:192);       !DEFS OF X,Y,Z
%OWNINTEGER POS1=0, POS2=0, POS3=0;   !DEF POINTERS
%owninteger null file = 0

%include "sysinc:command.inc"
%begin
   %integer j
   %externalintegerfnspec out type
   %on 9 %start
      select output(0)
      printstring("Edit ".Command_In1." fails -- ".Event_message)
      newline
      %stop
   %finish
   buffer size = freespace-1000
   %signal 1,0 %if buffer size < 1000
   map(j) = j %for j = 0, 1, 127
   map(j+32) = j %for j = 'A', 1, 'Z';    !start with lower=upper (%u)
   command_in1 = "n:" %if command_in1 = ""
   command_in2 = command_in1 %if command_in2 = ""
   command_out1 = command_in1 %if command_out1 = ""
   open input(1, command_in1)
   open input(2, command_in2)
   open output(1, command_out1)
   select output(1);  null file = 1 %if out type = 0
   select output(0)
%end
%BYTEINTEGERARRAY A(0:BUFFER SIZE)
!  The following variables are pointers to the main array A
!Their values are interpreted as byte addresses by
!the machine-code byte-accessing routines LOAD PP, LOAD
!FP and BYTE.
!The addresses of the left and right bytes of a word are
!2W and 2W+1 respectively: hence incrementation and comparison
!properties are preserved.
%OWNINTEGER TOP=1; !TOP OF BUFF (CONST)
%INTEGER BOT;  BOT=BUFFER SIZE-sextra-1;  !BOTTOM OF BUFF (CONST)
%INTEGER LBEG;                        !LINE START
%INTEGER PP;                          !PREVIOUS POINTER
%OWNINTEGER FP=0;                       !FILE POINTER
%INTEGER LEND;                        !LINE END
%OWNINTEGER FEND=0;                  !END OF FILE IN BUFF
%OWNINTEGER MS=0;                     !MATCH START
%OWNINTEGER ML=0;                     !MATCH LIMIT
%OWNINTEGER CASE = 95;                 !%U DEFAULT
%owninteger gprompt = 1;               !zero to inhibit any prompt for G
!  The (part of the) file held in the array A is
!stored as a top half (from TOP inclusive to PP exclusive)
!and a bottom half (from FP inclusive to FEND exclusive).
!The gap corresponds to the position of the file-pointer.
!Text location operations do not therefore simply involve
!moving a pointer: the text passed over is moved across
!the gap.  The additional processing overhead is relatively
!small and is outweighed by the simplification of insertion and
!deletion operations that is achieved by this technique.
!  Illustration of pointer significance:
! [NL] O N E NL T W . . . O NL N E X T NL . . NL L A S T NL [NL]
!      !        !   !     !  !                                !
!      T        L   P     F  L                                F
!      O        B   P     P  E                                E
!      P        E            N                                N
!               G            D                                D
%INTEGER TYPE,CHAIN
%OWNINTEGER PEND=0
%SWITCH T(0:14)
%SWITCH S('(':126)
%ROUTINESPEC PRINT LINE

!  Symbol classification codes are 16X+Y, where Y
!is the basic code and X is used to sub-classify
!when necessary (eg percent command letters).
%OWNINTEGERARRAY SYMTYPE(33:95) =
     64, 3, 3, 3, 2, 3, 3,11, 9,64, 3,12, 2, 3, 3,
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 3, 3, 3,64,
   3, 18,10,24, 5, 8,52,234, 2, 6, 8, 8,120,56, 2, 13,
  10,50, 8,22, 5,117, 6, 2,32,32,32, 3,10, 3, 3, 3
!     !  "  #  $  %  &  '  (  )  *  +  ,  -  .  /
!  0  1  2  3  4  5  6  7  8  9  :  ;! <  =  >  ?
!  @  A  B  C  D  E  F  G  H  I  J  K  L  M  N  O
!  P  Q  R  S  T  U  V  W  X  Y  Z  [  \  ]  ^  _

   %on %event 9 %start
      ->er7
   %finish


%ROUTINE READ SYM
   %on %event 9 %start
      sym = '%'
      pend = 'C'
      %return
   %finish
!  Read command symbol
    %IF PEND # 0 %THEN SYM=PEND %AND PEND=0 %ELSE %START
       %WHILE POS3 # 0 %CYCLE;        !MACRO EXPANSION
          SYM = STORED(POS3);  POS3 = POS3+1
          %RETURN %UNLESS SYM = 0
          POS3 = POS2;  POS2 = POS1;  POS1 = 0
       %REPEAT
       READ SYMBOL(SYM)
      %signal 9 %if sym < 0
    %FINISH
%END

%ROUTINE READ ITEM
!  Read command item (symbol or number), skipping leading
!spaces, standardising case and detecting macro letters.
!Set up the type (ie SYMTYPE) of the item in TYPE.
!For a 'numeric' item, assemble sequence of digits
!as necessary and return value in NUM.
!Note that NUM is not altered for a non-numeric item.
    %CYCLE
       TYPE = 1;                      !DEFAULT FOR NL
       READ SYM %UNTIL SYM # ' '
       %RETURN %IF SYM < ' ';         !TREAT ANY CONTROL AS NL
       SYM = SYM-32 %IF SYM >= 96;    !ENSURE UPPER CASE
       TYPE = SYMTYPE(SYM)
       %RETURN %UNLESS TYPE&15 = 0;   !RETURN UNLESS NUMERIC OR X,Y,Z
       %EXIT %UNLESS TYPE = 32;       !X,Y,Z (MACRO LETTERS)
       POS1 = POS2;  POS2 = POS3
       POS3 = (SYM-'X')<<6+1
    %REPEAT
    %IF TYPE = 0 %START;              !DECIMAL DIGIT
       NUM = SYM-'0'
       %CYCLE
          READ SYM
          %EXIT %UNLESS '0' <= SYM <= '9'
          NUM = NUM*10-'0'+SYM
       %REPEAT
       PEND = SYM
    %FINISH %ELSE %START
       TYPE = 0
       NUM = 0;   %RETURN %IF SYM = '*'
       NUM = STOP+1;  %RETURN %IF SYM = '?'
       NUM = STOP;                    ! '!'
    %FINISH
%END

%ROUTINE UNCHAIN
!  Use temporary links to locate last unmatched
!open bracket (if any), fixing up any comma
!units en route.
    %CYCLE
       TEXT = CHAIN;  %RETURN %IF TEXT = 0
       CHAIN = INTEGER(TEXT+4);  INTEGER(TEXT+4) = CI
       %RETURN %IF INTEGER(TEXT) = '('
    %REPEAT
%END

%ROUTINE STACK(%INTEGER V)
    INTEGER(CI) = V;  CI = CI+4
%END

%ROUTINE READ LINE
   %INTEGER K
   %on %event 9 %start
      ->eof
   %finish
!  Read line from file (if bottom part of buffer empty)
    %IF FP # FEND %START;             !LINE AVAILABLE
       LEND = FP
       LEND = LEND+1 %WHILE A(LEND) # NL
    %FINISH %ELSE %START
       SELECT INPUT(IN);  
       FP = BOT-181
       %CYCLE
          %IF FP # BOT %THEN%START
             READSYMBOL(K)
          %FINISHELSE K = NL
          A(FP)=K&127;  FP = FP+1
         %exit %if k = nl
      %repeat
       FEND = FP;  LEND = FEND-1
       FP = BOT-181
       ->L1
EOF:   FP = BOT;  LEND = FP;  FEND = LEND
       A(FP)=NL
L1:    SELECT INPUT(0)
       MS = 0;  PRINT1 = 0;  PRINT2 = 0
    %FINISH
%END

%ROUTINE BREAK
    A(PP)=NL;  PP = PP+1;  LBEG = PP
%END

!INITIALISE
   SELECT INPUT(0); SELECT OUTPUT(0)
   STORED(0<<6+1) = 0
   STORED(1<<6+1) = 0
   STORED(2<<6+1) = 0
    PP = TOP-1;  BREAK;               !FOR BOUNCING OFF
    MAINFP == FP
    READ LINE

   ->MONITOR
READ COMMAND:
   Console int = ""
    CI = CBASE;  TI = TBASE;  CHAIN = 0
   %IF IN#SIN %THEN PROMPT(">") %ELSE PROMPT(">>")
    READ ITEM
   %IF TYPE = 1 %AND SYM = NL %START
      I = NUM
      NUM = 0;  PRINT LINE
      NUM = I
   %FINISH
    ->READ COMMAND %IF TYPE = 1;!IGNORE BLANK LINES
    %IF TYPE = 0 %AND CMAX # 0 %START
       INTEGER(CMAX+8) = NUM
       READ ITEM;  ->ER2 %IF TYPE # 1
       ->EXECUTE
    %FINISH
    ->NEXT UNIT %UNLESS SYM = '%'
    READ SYM;  SYM = SYM-32 %IF SYM >= 96
    CODE = SYM;  ->ER5 %IF CODE < 'A'
    READ ITEM
    ->T(SYMTYPE(CODE)>>4);            !SWITCH ON EXT TYPE
!T(1) AT END OF PROGRAM
T(2): !%X, %Y, %Z (MACRO DEFINITION)
    ->ER1 %IF SYM # '='
    I = (CODE-'X')<<6+1
    %CYCLE
       READ SYM
       %EXIT %IF SYM = NL
       STORED(I) = SYM
       ->ER6 %IF I&63 = 0
       I = I+1
    %REPEAT
    STORED(I) = 0
    ->READ COMMAND
T(3): !%M, %F, %Q (MONITOR CONTROL)
    MON = 'M'-CODE
    ->READ COMMAND
T(7):
   CASE = -32
   CASE = 0 %IF CODE = 'L'
   MAP(J) = J+CASE %FOR J = 'a', 1, 'z'
   ->READ COMMAND
t(14):gprompt = 1-gprompt
      ->read command
NEXT UNIT:
!FIRST ITEM ALREADY READ
    I = TYPE&15;  ->ER2 %IF I < 4
    CODE = SYM;  TEXT = 0;  NUM = 1;  !DEFAULT VALUES
    READ ITEM
    ->T(I);                           !SWITCH ON BASIC TYPE
T(13):!OBSERVE
T(4): !+FIND
    NUM = 0 %UNLESS TYPE = 0
T(5): !+DEL,TRAV,UNCOVER
    CODE = NUM<<7+CODE;               !PACK LIMIT NUMBER
    NUM = 1;                          !RESET DEFAULT REPETITION
    READ ITEM %IF TYPE = 0
T(6): !+INSERT,SUBST,VERIFY
    ->ER4 %IF TYPE # 3;               !NOT LEGIT QUOTE SYMBOL ->
    TEXT = TI;  I = SYM
    %CYCLE
       READ SYM
       %EXIT %IF SYM = I
       PEND = SYM %AND %EXIT %IF SYM = NL
       ->ER6 %IF TI <= CI
       INTEGER(TI) = SYM;  TI = TI-4
    %REPEAT
    ->ER4 %IF (SYM=NL %OR TI=TEXT) %AND CODE # 'I' %AND CODE # 'S'
    INTEGER(TI) = -1;  TI = TI-4;      !TEXT END MARKER
    ->RI
T(8): !MOVE,ERASE
    ->NQ %UNLESS SYM = '-'
    CODE = CODE+32;                   !to lower case
RI: READ ITEM
    ->RN
T(9): !CLOSE BRACKET
    UNCHAIN;  ->ER3 %IF TEXT = 0
    INTEGER(TEXT+8) = NUM
    TEXT = TEXT+12
T(10): !+GET,KILL,ETC.
NQ: ->ER1 %IF TYPE = 3;               !WOULD FAIL LATER BUT WITH LESS HELPFUL RE
RN: READ ITEM %IF TYPE = 0
    ->PUT
T(12): !COMMA
    READ ITEM %IF TYPE = 1;           !IGNORE FOLLOWING NL
T(11): !OPEN BRACKET
    TEXT = CHAIN;  CHAIN = CI
    NUM = 0
PUT:STACK(CODE);  STACK(TEXT);  STACK(NUM)
    ->ER6 %IF CI+8 >= TI
    ->NEXT UNIT %UNLESS TYPE = 1
    UNCHAIN;  ->ER3 %IF TEXT # 0
    CMAX = CI
    STACK(')');  STACK(CBASE);  STACK(1); !EXTRA ')'
    STACK(0)
    ->EXECUTE
!COMMAND INPUT ERROR REPORTS
ER1:SPACE;  PRINT SYMBOL(CODE)
ER2:CODE = SYM
    ->ER5
ER3:PRINT STRING(" ()")
    ->ER7
ER4:PRINT STRING(" TEXT FOR")
T(0):
ER5:SPACE;  PRINT SYMBOL(CODE&127)
    ->ER7
ER6:PRINT STRING(" SIZE")
ER7:PRINT SYMBOL('?')
    NEWLINE;  CMAX = 0 %IF CI # CBASE
    READ SYM %WHILE SYM # NL
   ->read command

%ROUTINE LEFT STAR
    %CYCLE
       %RETURN %IF PP = LBEG
       FP = FP-1;  PP = PP-1
       A(FP)=A(PP)
    %REPEAT
%END

%ROUTINE RIGHT STAR
    %CYCLE
       %RETURN %IF FP = LEND
       A(PP)=A(FP)
       PP = PP+1;  FP = FP+1
    %REPEAT
%END


%ROUTINE MAKE SPACE
%INTEGER K,P1,P2
!  Check that sufficient breathing space remains
!in the internal file buffer.  If not, expel part
!of the file.
    %RETURN %IF MAINFP-PP > 240
    P1 = TOP;  P2 = (P1+LBEG)>>1;     !OUTPUT ABOUT HALF
    P2 = LBEG %IF CODE = 'C' %OR CODE = 'A';         !BUT ALL IF CLOSING
    %if null file = 0 %start
       select output(mout)
       %CYCLE
          K = A(P1);  PRINT SYMBOL(K);  P1 = P1+1
         %exit %if k = nl %and p1 >= p2
      %repeat
       SELECT OUTPUT(0)
    %else
       p1 = p2;  p1 = p1+1 %while a(p1) # nl
       p1 = p1+1
    %finish
    LBEG = TOP+LBEG-P1;  P2 = PP;  PP = TOP
    %WHILE P1 # P2 %CYCLE;            !COPY UP REMAINDER
       A(PP)=A(P1)
       PP = PP+1;  P1 = P1+1
    %REPEAT
%END

%ROUTINE REFRESH
    FP = FP+1;  MAKE SPACE;  READ LINE
%END

%ROUTINE PRINT LINE
%INTEGER P
    PRINT1 = LEND;  PRINT2 = FP+PP
    P = LBEG
    %CYCLE 
       %IF P = PP %START
          PRINT SYMBOL('^') %IF P # LBEG %AND NUM = 0
          P = FP
       %FINISH
       %EXIT %IF P = LEND
       PRINT SYMBOL(A(P))
       P = P+1
    %REPEAT
    PRINT STRING("**END**") %IF P = FEND
    NEWLINE
%END

%PREDICATE MATCHED
%INTEGER I,J,K,L,T1,FP1,LIM
!  Used for Find, Uncover, Delete, Traverse
    LIM = INTEGER(CI-12)>>7;       !SEARCH LIMIT
    T1 = MAP(INTEGER(TEXT));               !EXTRACT FIRST CHAR FOR SPEED
    %CYCLE
       PP1 = PP;  FP1 = FP
       %WHILE FP # LEND %CYCLE
          K = A(FP)
          %IF MAP(K) = T1 %AND (FP#MS %OR CODE='D' %OR CODE='T') %START
             I = FP;  J = TEXT
             %CYCLE
                I = I+1;  J = J-4;  L = INTEGER(J)
                %IF L < 0 %START;     !COMPLETE STRING MATCHED
                   MS = FP;  ML = I
                   PRINT LINE %IF CODE = 'O'
                   %TRUE
                %FINISH
             %REPEAT %UNTIL MAP(L) # MAP(A(I))
          %FINISH
          A(PP)=K
          PP = PP+1;  FP = FP+1
       %REPEAT
       LIM = LIM-1
       %EXIT %IF LIM = 0 %OR FP = FEND %OR Console int # ""
       %IF CODE = 'O' %START
          J = NUM;  NUM = 1;  PRINT LINE;  NUM = J
       %FINISH
       %IF CODE # 'U' %THEN BREAK %ELSE PP = PP1
       REFRESH
    %REPEAT
    PP = PP1;  FP = FP1
    %FALSE
%END


EXECUTE:
    Console int = ""
    CI = CBASE
GET:CODE = INTEGER(CI)&127;  ->MONITOR %IF CODE = 0
    TEXT = INTEGER(CI+4)
    NUM = INTEGER(CI+8)
    CI = CI+12
REP:NUM = NUM-1
    ->HALT %UNLESS Console int = ""
    ->S(CODE)
OK: ->REP %UNLESS NUM = 0 %OR NUM = STOP
    ->GET
S('\'): !INVERT
NO: ->GET %IF NUM < 0
    CI = CI+12 %AND ->GET %IF INTEGER(CI) = '\'
SKP:I = INTEGER(CI);  CI = INTEGER(CI+4) %IF I = '('
    CI = CI+12
    NUM = INTEGER(CI-4)-1 %AND ->NO %IF I = ',' %OR I = ')'
    ->SKP %IF I # 0

!EXECUTION ERROR
HALT:
    PRINT STRING("FAILURE: ")
    %if code >= 'a' %start
       PRINT SYMBOL(CODE-32);  CODE = '-'
    %FINISH
    PRINT SYMBOL(CODE)
    %IF TEXT # 0 %and code # ')' %START
       PRINT SYMBOL('''')
       %WHILE INTEGER(TEXT) >= 0 %CYCLE
          PRINT SYMBOL(INTEGER(TEXT))
          TEXT = TEXT-4
       %REPEAT
       PRINT SYMBOL('''')
    %FINISH
    NEWLINE
    PRINT1 = 0

MONITOR:
    ->READ COMMAND %IF SYM # NL %OR MON < 0
    ->READ COMMAND %IF PRINT1 = LEND %AND (MON = 0 %OR PRINT2 = FP+PP)
    NUM = 0;  PRINT LINE
    ->READ COMMAND

!INDIVIDUAL COMMANDS
S('('): !OPEN BRACKET
    !RESET REPETITION NUMBER ON CLOSE BRACKET
    INTEGER(TEXT+8) = NUM+1
    ->GET
S(')'): !CLOSE BRACKET
    ->GET %IF NUM = 0 %OR NUM = STOP
    INTEGER(CI-4) = NUM;              !UPDATED REPETITION NUMBER
S(','): !+COMMA
    CI = TEXT
    ->GET
S('C'):!CASE SHIFT
      J = A(FP)
      J = J!!32 %IF 'A' <= J&95 <= 'Z'
      A(FP) = J
s('l'):!left minus
S('R'): !RIGHT SHIFT
    ->NO %IF FP = LEND
    A(PP)=A(FP)
    PP = PP+1;  FP = FP+1
    ->OK
s('c'):!c-
s('r'):!R-
S('L'): !LEFT SHIFT
    ->NO %IF PP = LBEG %OR IN = SIN
    FP = FP-1;  PP = PP-1
    j = a(pp)
    j = j!!32 %if code = 'c' %and 'A' <= j&95 <= 'Z'
    a(fp) = j
    MS = 0
    ->OK
S('E'): !ERASE
    ->NO %IF FP = LEND
    FP = FP+1
    ->OK
S('e'): !ERASE BACK
    ->NO %IF PP = LBEG
    PP = PP-1
    ->OK
S('V'): !VERIFY
    I = FP-1;  J = TEXT+4
V1: I = I+1;  J = J-4
    K = MAP(INTEGER(J))
    ->V1 %IF MAP(A(I)) = K
    ->NO %IF K >= 0
    MS = FP;  ML = I
    ->OK
S('O'):!OBSERVE
S('F'): !+FIND
    ->NO %UNLESS MATCHED
    ->OK
S('U'): !UNCOVER
    ->NO %UNLESS MATCHED;  PP = PP1
    ->OK
S('D'): !DELETE
    ->NO %UNLESS MATCHED;  FP = ML
    ->OK
S('T'): !TRAVERSE
    ->NO %UNLESS MATCHED
   FP = ML
   I = MS
   %CYCLE
      ->OK %IF I = FP
      A(PP) = A(I)
      PP = PP+1;  I = I+1
   %REPEAT
S('S'): !SUBSTITUTE
    ->NO %IF FP # MS
     FP = ML
S('I'): !+INSERT
    MAKE SPACE
    ->NO %IF PP-LBEG+LEND-FP > 160
    I = TEXT
    %CYCLE
       ->OK %IF INTEGER(I) < 0
       A(PP)=INTEGER(I)
       PP = PP+1;  I = I-4
    %REPEAT
S('G'): !GET (LINE FROM TT)
    %if gprompt = 0 %then prompt("") %else PROMPT(":")
    MAKE SPACE
    READ SYMBOL(I)
    %IF I = ':' %START
       SYM = NEXTSYMBOL
       SKIPSYMBOL %IF SYM = NL
       ->NO
    %FINISH
    LEFT STAR
    %WHILE I # NL %CYCLE
       A(PP)=I;  PP = PP+1
       READ SYMBOL(I)
    %REPEAT
S('B'): !+BREAK (INSERT NEWLINE)
    BREAK
    MAKE SPACE
    ->OK
S('P'): !PRINT
    PRINT LINE
    ->GET %IF NUM = 0
S('M'): !+MOVE
    RIGHT STAR
    ->NO %IF FP = FEND
    BREAK
M1: REFRESH
    ->OK
S('K'): !KILL (LINE)
k0: PP = LBEG;  FP = LEND
K1: ->NO %IF FP = FEND
    ->M1
S('J'): !JOIN (DELETE NEWLINE)
j0: RIGHT STAR
    ->NO %IF PP-LBEG > 160
    ->K1
s('k'):!K-
s('j'):!J-
S('m'): !MOVE BACK
    ->NO %IF IN = SIN
    MAKE SPACE
    ->NO %IF LBEG = TOP
    LEND = FP-PP+LBEG-1
    %CYCLE
       K = A(PP-1)
       %EXIT %IF K = NL %AND PP # LBEG
       FP = FP-1;  PP = PP-1;  A(FP)=K
    %REPEAT
    LBEG = PP;  MS = 0
    ->K0 %if code = 'k'
    ->J0 %if code = 'j'
    ->OK
s(*):->NO

%ROUTINE SWITCH INPUTS
    %OWNINTEGER MFP,MLEND,MEND,SFP=0,SEND=0
    %string(63) file
    %on 9 %start
       printstring("*Cannot open ".file." -- ".event_message)
       newline
       %return
    %finish
    %IF IN = MIN %START
       %if sym = '=' %start;   !redefine secondary input
          file = ""
          %cycle
             readsym
             %exit %if sym = nl
             file = file.tostring(sym)
          %repeat
          open input(sin, file)
          sfp = 0;  send = 0
       %finish
       LEFT STAR
       IN = SIN
       MFP = FP;  MLEND = LEND;  MEND = FEND
       MAINFP == MFP
       BOT = BOT+SEXTRA;  FP = SFP;  FEND = SEND
       READ LINE
    %FINISH %ELSE %START
       PP = LBEG
       IN = MIN
       BOT = BOT-SEXTRA;  SFP = FP;  SEND = FEND
       FP = MFP;  LEND = MLEND;  FEND = MEND
       MAINFP == FP
    %FINISH
%END

T(1): !%C, %S, %A
    %if type # 1 %start
       ->er2 %if sym # '=' %or in=sin %or code # 'S'
    %finish
    %IF CODE = 'S' %START
       SWITCH INPUTS
       ->MONITOR
    %FINISH
!CLOSE FILE (+EOF ON COMMAND STREAM)
    %if null file = 0 %start
       SWITCH INPUTS %IF IN = SIN
       %CYCLE
          RIGHT STAR
          %EXIT %IF FP = FEND
          BREAK
          REFRESH
       %REPEAT
       SELECT OUTPUT(MOUT)
       %WHILE TOP # PP %CYCLE
          PRINT SYMBOL(A(TOP));  TOP = TOP+1
       %REPEAT
    %finish
    %SIGNAL 0, 1 %IF CODE = 'A'
    select output(0)
    printstring(command_out1. " complete") %and newline %if null file = 0
%endofprogram
 H?   & &                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!         t` }            	        NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    &y$ } %Qv   a@      	 complete --  *Cannot open :	FAILURE: **END** SIZE	 TEXT FOR ()>> >      !   _    ( ~			&	
y

g

SB	3
g,	


n
1	
%``	`	   }=Een:   
 fails --  Edit                                    w                 
   9`,H  !34  1  0 !81 !5$$A> rB  @ !4B ";
C@ !$$A> r#$$A> rB  C
B$P#E  E  &Q'1"C  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nЗ  $1$H  H X [ &B0P  [ ,&' ?P  
*&30H  P  ї  C Kї  $$A> r
Y  #%$$A> r
qPr  PB &(pX  ?$PS?PE   &T 4A> r?1  &034C0  D   D   
C X   $$A> r w p 4Py 0C bXy 0$`W   l' ,AX  A   A   X=L A   W   HW  ,$ AAȱPPɰ#$ $A%&P ,Z ,XI ,J  Š  <P @&QPY ,ZX ,Xi ,e  VP Z <X<  3!7,  AӼ @!7, @  AӬ !7,   A  $aW   xXM @$bW   xX] $aW   $aW   lW  !4$aPm$`W   ly   	 =w p 0Py ,#Xy , %Pd0 CP=y X#8Pd$PC ZXC06Z lXJ  PMd$QQ]D#3C Xm|PmXmxPm|$`PmxC W   Pd#$ $	AC  S 	 w p ,$P AFX=d0  !2"0  #y 0 `!3P=d2Z=X  P ð #3C Ű  #3C &X|PxXP|XMd@FȤ PC B0@X]dePh PAXd 0! 9#"#XX P$:Cȵ
P PC PC 2$P P PXdŠ *!3C FȰyP PŠ ?!3C 4ȰxP PC ( 	w p ,X P L!4y X P X8 LX dP X  Š (!3C C  "	g p ,X dPl  &P dy  	w p 4Py 0#Xy 0C XUC0"P X8 Z8 ӳ  Ű 
#5$Q "C XmTW   `XH TKP]XmUh #9W   P ,#$P ,X8 Z=X ,İ ҳ  $QXI ,@ 
!2#C X]P]'QPX Xh KP#X8 P=P8 P=Z8 $ҳ  $`W   `$PP\P`y   	 w p ,X Z $:<  $Q X P y  	w p ,X U !4y %1Q='P X ZZ Ӭ  ҫ  C  !	w p ,XU !4y X8 Z8 Z Ӽ  ҳ  $Q QC   	w p 8X DX<  [8 0 #$y X=P9 0Z8 1P9 4X HŰ C#4Ű A!5X8 P9 4XB0X$aW   lXH ZI 0T  PY ,eW   <$aQi 0X , 
!7X9 0Y9 4!#C $`W   lC $P9 0X Z 0ӫ  Š 
#5$AQI 0"$QQY 0XmZh [i 0Ph X P 4XP X9 0U9 4C0"X Z Z8 ӣ  ҫ  $AQH QI 0C C  	w p ,$QAAy  	w p 0X P\X=Z8 P=`X P ,X ,U B0"U #;XH P!8` ^W   <X]PY ,Xi ,Uh !2#Zh f  W   <$Q ,C Um!8W   HW  ,y  R	w p HX dX<@7P9 DX LX ,Z  J  PI <XX PX @XmPi @XU C0Z <  P9 4Z8 ,ӳ  U <B0XU!:XH H@ D#5@ TB0rP ,XX LPY 0$aQi ,%Q 0X9 0X  P 8C&XPXI ,PMXX HP O!3A%y Z ,X Z ,J  ZH ,[  d  V!3C X Z X9 4<  $Q QC ,%Q DXI D#<X]U]#7Xmp  #3C DX8 H0 O!>X PP 0$P PAX 0P PXH H@ U#4A#XX @PX AC Xh @Ph X @P$C 8 ˀ	w p pPy lC NXy l' ,|A ,A   vA   XL A   W   HW  ,y X=T0 B0XdŰ =B0D$ҩ ,A2XMd@ 
!2#Y ,&QIE  ,Y ,C  ,$bW   x$`PmPmA<$PTX=P=X PXPMPH DP QX XmPmXPAC FX P $1P=T0LQ8 XPXPXPXMPH XP]PX DC 
  	 qw P (p NPH 0p P ,NPH XpP TX TP \<P8 `NPH pp P lAH t$P X=PP4 A*  ( AX]P5KP8 Px #Xx C f$`W   `$`W   lX l$0P< P<P<X'P AȭP DAC Xp$@I  XX \PX dXh `Ph hPH XT #9W   #W   AX8 0 B0$XdŰ 
!>X PP 4$P PAX 4P PXH @ !3C xDB0&X]tC0Xh PPe AX  #3C C X=d0 %#3C AXdɰ `!ȻPdP Hɰ A#C A8X HZX  
sI~

XMd@ =#3C XX HPV&QPX 4ARXmd` 
!3C &X 4Z lPl  X8 40 ?!3C &1P8 4C X 4Z l$P  C Ȑ M[ HPXC ~@PMXX HP L!4$@PM` `&aPh 8Zh ,X 8Z  Xh 8` z ?C >$1[=P=C 0X İ P 4ɰ #C XdP H$P L$APH PA$XX 4
UsE~

Xh #4$P PX8 P7Z8 HP8 H$P PX !3AX Ő #3C XH hPH LX]dPX 4A XmdUh 4!3C (` 
!4Pm#X hY d!#C Pl  'P hC ` 
#6X8 hU8 L!;X HŰ I#6Ű S#3C .X h%P  'P h#XMd@ -#3C ,P  QX HA@C *A:Xh L!3C X PP &lPh LX8 0 !3C X !3AC $X Š !3AX P LX dP $@PH PXh HAXh LAXh PAXX d&XYX h!C Xh ` #3C XAX L#3C LX8 dP=t` )AXh \A$aA$`AC W  Xh HW   <XdP HC  W   HC :W   HW  Xh H` W   <#W   H` ?W   <W  ,X dU \#4$PtXMd@ 
#4A("C Xp$0<  X \P dX dX  Đ P H!3C PXJ PH LXZ PX P&P d%aQh PXp<  3#3C X H
sK|

X P#6Šx#3C C X P#C XH dXT  P \!6&LPH dC vXh dX  P 4 (!5Xf Ph d&lPh d ,#4 )!9X6@'1P8 PC #3C W   HX Hɰ a!kW   <Ƞ -P HXh HW   <X LC0DXH H@ )C08` 'W   <XX LXe  !W   <%Q L"` 'W   <W  ,$0P=\XdŰ 
!4XX#C X\U !=#9XM`X]ZX E!3C $`Ph PA|C X LX8 P&1P< C DX P#4Űx!3C 4X dP@X LP dC XH ZMT  PX 8P _P A!P Z!'Xh 8`  Ph 8X ZX8 8<  XU !3C <X Z Z ӛ  Қ  $AQH QMC XX UX #6XmT` !3C %Q'QPX ZX 5  P8 8X HŰ c!?0 _0 A!0 Z!'X 8Ǡ  P 8X ZXH 8I  $PP]C XmUh !3C &aPmC ~X U !3C 'P C fX='1P8 4X L&P 8$Q 4%Q 8XH 8XX ,ZT  e  Ph <X Z 4<  Z8 ,ӳ  !3C f!C "XPX 4PC Ah!3C C AZ!3C XH @PH C AD!3C X]P]C A.!3C XmPmXP 4X8 4U=!3C X Z Z8 ӣ  ҫ  $Q Q 4C XMUM#3C |XMPMAXX [X ZX []P ##C VXh LPh 4X 4X<  #C ,X Z ;  $Q 'P 4C X!9W   #W   AnW   P 4 :B0"W   $Pd 
!6W   0C AXH 4@ 
C0$XX ZX E  $aQh W   P 4C ALAC pA:X P!3C AX=U=!3C dA AC DX P X PXU!3C :C AdXH [H @ ##C  C X]TP !3C A|Xh Um!3C X[ 
'P X8 Z8 ӳ@P <Ű 
!7X U #2#%QQ XH ZMҴ  C P $PP]Xh H` k!3C >` j!3C VC tC X  C0"X=d0 =!;XTŰ #6X HŠ S#3C HX HŐ S!5A<C BXMB0ZX]TP !3A"A\XmUm!2#AA"$aW   lXU #?Z l  W   <$1Q=C X HŰ A!6$ $A$`W   lXB00X' , AlA   W   HW  ,x @ \`XX d&XYX h!C Xh ` #3C XAX L#3C LX8 dP=t` )AXh \A$aA$`AC W  Xh HW   <XdP HC  W   HC :W   HW  Xh H` W   <#W   H` ?W   <W  ,X dU \#4$PtXMd@ 
#4A("C Xp$0<  X \P dX dX  Đ P H!3C PXJ PH LXZ PX P&P d%aQh PXp<  3#3C X H
sK|

X P#6Šx#3C C X P#C XH dXT  P \!6&LPH dC vXh dX  P 4 (!5Xf Ph d&lPh d ,#4 )!9X6@'1P8 PC #3C W   HX Hɰ a!kW   <Ƞ -P HXh HW   <X LC0DXH H@ )C08` 'W   <XX LXe  !W   <%Q L"` 'W   <W  ,$0P=\XdŰ 
!4XX#C X\U !=#9XM`X]ZX E!3C $`Ph PA|C X LX8 P&1P< C D                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                             
                                                             _         T   @                        	   @                                                                         @         
            4                  x   8         
   2            u                        
                                                                                                                                                                                                                                                                                                          $PP]Xh H` k!3C >` j!3C VC tC X  C0"X=d0 =!;XTŰ #6X HŠ S#3C HX HŐ S!5A<C BXMB0ZX]TP !3A"A\XmUm!2#AA"$aW   lXU #?Z l  W   <$1Q=C X HŰ A!6$ $A$`W   lXB00X' , AlA   W   HW  ,x @ \`Charno(S, P) <= 'Z'
   %repeat
%end
%endoffile
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                             
                                                             _         T   @                        	   @                                                                         @         
            4                  x   8         
   2            u                        
                  H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        !ECCExx:    Implementation of ECCE for VAX, EMAS and MOUSES
!  Revised specification (1981) including video support.
!  Files addressed directly in virtual memory.
!  Most of the main part of the program (routine EDI) is common
!  to both VAX and EMAS versions.  The procedures for opening
!  and closing files are distinct.  Upper-case is used for those
!  sections of program text which are peculiar to one version.
!
!      ECCE00 (09/02/81): initial test release
!
!      ECCE01 (04/06/81): VT52/Bantam/hard-copy support

!      ECCE02  (23/03/82): VT100 support added
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
%OPTION "NOOPEN"
%constinteger  line insert = x'8000 0000',
              inverse video = x'4000 0000'

%constinteger  Hard Copy   = 0,
               Bantam      = 1,   {P-E 550 old model}
               VT52        = 2+line insert+inverse video,
               VT100       = 3+line insert+inverse video,
               VC404       = 4

!
%BEGIN;                            !MOUSES version (program not routine)
%constinteger rt=13, esc=27, dle=x'10'; !ISO control characters
%CONSTINTEGER MAXNAME=31;          !max file-name length
%RECORDFORMAT FILE(%STRING(MAXNAME) NAME, %C
                    %INTEGER TOP,LIM,VMTOP,VMLIM,FLAG)
!
%ROUTINESPEC MOVE(%INTEGER LENGTH,FROM,TO);  !bulk move
!
%routinespec connect input(%record(file)%name f)
%BYTEINTEGERMAPSPEC BYTEINTEGER(%INTEGER PSEUDO ADDR);  !*MOUSES*

!!!!!!!!!!!!!!!!!!!  Start of Editor proper !!!!!!!!!!!!!!!!!!!
!
%routine edi(%record(file)%name old,sec,new, %integer video,rows,cols)
! Only the TOP and LIM components of the file info records
!  OLD, SEC and NEW are relevant for editing (except when
!  referencing secondary input).
!  In the EMAS version the original file is not copied into the
!  working space (NEW) prior to entry, so that OLD_LIM is not
!  equal to NEW_LIM: on VAX, OLD_LIM is equal to NEW_LIM (except
!  when just 'showing' in which case NEW_TOP = NEW_LIM = 0).
!  The parameter VIDEO defines terminal characteristics:
!    sign-bit: can DELETE-LINE & INSERT-LINE
!    4000000:  can reverse/reduce/underline arbitrary character
!          4:  VC404
!          3:  VT100
!          2:  VT52
!          1:  Bantam
!    all zero: hard-copy
%constinteger cbound=50;        !command cell array bound
%constinteger tbound=120;       !quoted text array bound
%constinteger stopper=-10000;   !loop stop
%constinteger casebit=32
%integer cmax;                  !command cell max
%integer ci;                    !command index
%integer ti;                    !text index
%integer code;                  !command code
%integer ref;                   !text or bracket pointer
%integer scope;                 !search limit
%integer num;                   !repetition number
%integer sym,sym1,pend
%integer casemask;              !\0[\CASEBIT] to respect[ignore] case
%integer width;                 !line width (default 80)
%integer dir;                   !current direction of movement
%integer sin;                   !0[1] for main[secondary] input
%integer macpos;                !macro index values (3-byte nest)
!File pointers (byte addresses)
%integer lbeg;                  !line start position
%integer fp;                    !current file position
%integer lend;                  !line end position
%integer flim;                  !limit of current infile
%integer gaptop;                !start of gap
%integer gaplim;                !limit of gap
%integer mstart,msize;          !match start/size
%integer sfp,slim;              !saved FP & LIM for switching
%integer newtop,newlim;         !copies of NEW_TOP,NEW_LIM
! Video control variables
%integer line;                  !line number of current line
%integer winline;               !line number of top line on screen
%integer limline;               !limit line number (if known)
%integer breaks,joins;          !count of lines added/removed
%integer vrow,vcol;             !video cursor position
%owninteger zrow=0
%owninteger mon=1
%integer fprow
%owninteger printline=0,printed=0
%integer wintop,winbot;         !first/last window row
                                !the variable size window extends
                                !from floating WINTOP to fixed WINBOT
%integer winlim;                != WINBOT+1
%integer minwin;                !minimum window size
%integer changemin,changelbeg;  !alteration positions
%integer vp
%integer endon
!
{ ^ stands for ESC in below }
%conststring(11)%array  proms(0:7) =  ">",   {hardcopy}
                                     "^X  ^I >",   {Bantam}
                                     "^Y  ^x>",    {VT52}
                                     "^[rrH^[2K>",  {VT100}
                                     "see below",  {VC404}
                                     ""(*)
!%OWNSTRING(3)%ARRAY GPROM(0:3) = ":", "^A ", "^A", "^A";  !*VAX*
!%OWNSTRING(1)%ARRAY GPROM(0:3) = ":", " ", "", "";  !*EMAS*
%constSTRING(3)%ARRAY GPROMS(0:7) = ":", "^A ", "^A", "^M", " H?   
 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!         
,p }                    NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    %Qv   #p}SId:w	R#	y    `EX!    qVM&@	e&@"e&@qI    }@  #!t(  w@            )+D File unchanged= Creating     to   = Editing  = Showing  NULL:N: NULL:N:                                                                                                 $ECCE.                           f 
 Failure:   Size	 Text for	 Brackets when Showing[m [1;7m $ p                                                    DR  ;z    q  /~        @Kj            fU                     ]m  {           TkJ%	4Ipppp          _    ** File too big  **END** [;r[;r1           x            2                :ee^A ^A ^M                         >#4X=!3C ^X  ^I >3C ^Y  ^x>>3C 
^[rrH^[2K> 	see below>  see below>  see below>  see below>              
   9pH  !34  1  0 !81 !5$$A> rB  @ !4B ";
C@ !$$A> r#$$A> rB  C
B$P#E  E  &Q'1"C  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n$A1    0#
#	QD   RD   ?&A'"3  $$A> r    !8 !5$$A> r"#&!2#C$$A> r
!  1  #C   C  '1"A> r2$ #PC   '4"?1  34C0  D   D   
C   g p 4$ ,` d!* , AfPj ` 
B2VE@ $:CPZ 0Ӻ ,&E 0JK  ,Һ ,RZZ 0
UePj Z ,&Q 0E  ,Z , ,$ATz  F
W  p <* ,A0 [B  &A2D   B  f#>AB' ,A* , ,A   Z ,&QXj  jE  ,Z , ,W   Hz  :
W  p D* 0A0 [B  &A2D   B  f#>A' ,A* 0 ,A   XZ  C0FeA' ,A', 0Ab  &a ;F   b  P* @!X @A ,A   : 0&1X ,ҺC  0: 0 0W   Hz  a
w p ,X 0  !?P J$bA0 HP7 ,$PXi 4Az  
W  p ,X 0C0Pi PY YY 8!XY 8'QPZ    !<0 HP7 ,&Q&aAz   B02` W   <` YW   <Xj `  W   <C v B0$` W   <Xj `  W   <C J` W   <` XW   <Xj `  W   <` W   <` YW   <Xj  `  W   <C 2 
w p ,X 0C0X9 Y9 8C  !8P K$`AJC z  B0 ` W   <` xW   <C P B0 ` W   <` W   <C (` W   <` IW   <$`W   <z  \
w p ,$Q $0P9 W  ,z  
g p 0X 0CX9 6#4$PA$P XI 0@  B0` W   <` 7W   <Xj &aP rPW ,$PA` W   <` 8W   <` W   <` MW   <' ,AA   W   H` W   <` 8W   <#` W   <` LW   <z  
g p ,X 0CX9 6#4$PA$P XI 0@  B0` W   <` 7W   <Xj &aP rPW ,$PA` HPg ,$PXi 4A` W   <` DW   <' ,AA   W   H` W   <` 8W   <#` W   <` MW   <z  |
g p 0X 0
#.X !;`  W   <$1P9 X U !5X P U B00XI B0W   HXY ZY [Y PY $aPi C >kA  P ,$1Q9  
!3C  X Y 8#lW   <$AQI C xXZ P #3AbXj ` #3Az  m
w p <X U !4z X9 0!2"X [ P XI [I ZI [I PJ ,YI BYI CP $PPY Xi Ui #>'aA   
#6%1Q9 C X 0#XY [Y Xj ,A#XI [I T Xj ,A$QPZ 8Xi Ui x!6X U #:$PPZ 8$cAT$1Q: ,X ,U !3C \XI CXXY 0CPPJ 4Xi YmP#+XmPA"%Q Q ,#Xi A$1Q: 4X 4#3C Xj ,A$AQI XY #2"
Xi Ui C0,X Y !Y !U !<X: 8!9$cA$Q ,C XI C0XY [Z ,TPZ 0#$X 0#,X9 U9 #5$cAz"C X P 4Xi Al%AQJ 4XZ 4#2"
Xi Ui !5Xi Pi Ui !5$P #&aPi 'aAt1  0 
#3C %Q 0XJ 0#3C Xi [i $PAXi A$cAXY UY #2"Xi Pi $P P C .
w p ,X ,C ZX9 U9 !5X9 P9 U9 !3C >%AQI XY UY !5XY PY UY #<eAa  ` 
#3C %Q ,C {  ;w p 8A X xP $0P9 X 	#)Y |!&Z P XI 0B0~P9 XY P]XXi Zi |Pm\U |C0RX T B0FXi A.a  W   <$1Q9 X U !5X P U |#3C ` ^W   <$bAz XY [Y PZ ,C[9 	SC D!Xi 
eYmPBzQY X YP#Xi A`XmPAV$1Q9 C YP#/$PlAF` =W   <AH$PXi A*$aA$Q ,XJ ,!#A"XY PY C TC Xj ,Zi [i Pj ,#C :Yi CPj 0A X 0#&$PXi AXmPAX9 Y=P#%'1P9 #$Q Xi A$cA%AQJ 0XZ 0!C Xi 0C W  ,W  ,W  ,C X 'P ,X9 |U9 #8#& P ,X P AXXJ ,QI XY [Y PY Y]PC (PZ 4$PXj 4'aA` =W   <AA#$PXmPA$aAX Y !#A"C P
w p 8X |Y BY CX9 U9 C0@[9 P: ,X Y #C 2X P ,XY cAXI [J ,PI XY PY Xi [i |Pj ,X [ P 0X: ,P: 4X 0	#P 4XI [J 4PI XY [Z 4PY PW ,TXj 4AXXj ,[j 4Pj ,#3C X U |!5X P X: 0Q9 xQ9 X P |C >[ P ,C "XI 
LYI !C `XY PW ,XY lAXj ,Qi X |P X9 Y9 #P9 X xP Xi Pj ,XI UI #5Xi Pj ,S 	V#z W   H$ A Ȁ
w p 4X U C0lAP1  0 
C0Xi A<Xi P 0A0X 0A  K  XY UY |B04[Y PZ ,Xi xePi xX |P |X9 5P9 X U !3P $QQY QY Xi 'aAa  ` 
#3C ~z  [
w p ,AX [ |&Q xX9 &1P9 |X xP P9 XI YI !$QQY #%aQi %Q z  -
w p 0ARX U !5X9 P9 X P ,X |P X ,P |X P ,P P XI p@ PI pXY x[Y ZY |PY xXi |Pi X9 6!3P Pi X U #>kAA  @ 
#6$QQY C `Pi  P z  ^
g p ,` a!fW   < -P Xj W   <z  
w p 0Pz ,#Xz ,X `#8P X$P `C XX9 tC0*Z K  PI X&1P9 t@ 
#4z 8P9 tC W   P XXY<#:  !aW   <C  D 
 w p ,$P<X9 X0 
#4AT"z  
w p ,$P0A4X9 X0  !2"0  #z 0 `!0 _P9 XZ=pӳ  İ P0#3C XI X@ W#C (XY tP #5$`Pi t#
X t&P tC $PPY T@ *!3C XY T$jFZY XP TAX9 X0 0!0 9!#C P9 `C \ g
w p ,X X -!70  Q9 HAz  
w p ,X4P L!4z Z < P94X LZ XI @K XY LSZY e  ` [#3C C  -
w p @X 0 PH$<<Z=`) AZh)AB @ ^!5@ B Y PZ <$`PiDC $&aPiD 
<  0 ^!8ȹ 
@ K  Uj <B0XY 0P  #5P B0`Xi   ) A0 4Ӳ  &2K   Ҳ  )(A@ 32  &1BC   2  P !6$ҹҹC P  B0RXi &bA* ,AB IR Y) AA   )(AA   C pP B0h' ,Ab  &a 4F   b  X9 0  &a2F   b  &aȰ ҲF   b  P* <) X <A@ >2  &1BC   2  z  
w p 8X |'P ,X9 L'1P: 0$Q ,Q 0Xj ,AXA  PJ 4@ a!@ z!%TI dPJ 4XY ZZ 0e  F!3C X Z 0<  3#5$z X |P XJ ,KPI $" I
W  pTNDPI p P	 N4PI pP	 N$PI p xP	 $P P <X9 #$2AX9 $P#$2AX9 Ȱ ]ҳȠPP tXI $ZT T AT T `Pi d PP h$0P9 lX ,X  P P XK $PI XY Xe  Pi |Pi Pi xPi X $P X9 U9 #>cAӱ  Ű 
#6$Q C $@PI pXY  Xe  Pi X $P X9 P9 PI PI PI $P PI  B?P XI 4'DPI 'API PI P PY `Pi  cP X9 0#<X 4[ kW  8AA$P XX9 p!: W   C ,' , AӲ  &Ƞ >ҢK   Ҳ  W   $@PI `XY XPY \P 
B0NXi 0B02$P TX=T!6XXU !;3#+X\X Z |#3A C AX [ Z P XY |[Y xjA^XI 0C t@ B0` W   <` W   <#` ^W   <P  PY \Xi |Ui xC0(Ui #9'aA<  P \#
Xi 'aA(1  P9 \C j W   HȰ  P \Ƞ |P XXI |UI C0$dAQ  P  #;Xi |Aa  Pi \Pi XXi XW   <(W   HW  ,#
A>X X 
#3P `$0P9 @P9 DP94P9<AX XŰ -#2#X lǠ  P l"XI0@ !?XY Xi l M0 0P9 @C DB0,X <C0$Z XY TPZ ArXi0` #3C *C Ű %B0>AX X A#C z _P HAX=pZ9 Hӳ  İ 
sKx

$P lXY 0C &A` =W   <Xi XW   <$aPi<X0P8 #C  #X9 !3C b$Q @X @ɠ /!C XI XPI H$PPY LP TP PAXi8
fsF

AN$P PX90!7X TP PAh$P TXI XPI8XY0P #3C L$aQi DX DP LAX9 X0 
!<X T!3C &P9 `X98P9 XU98!3C :X Dɠ v##C (0 a!0 z!(XI T!5T9 dP9 XZ :  $QQY DC Xi DUi L!6X T!3C Zi $Ҷ  $P TAC `AtXI0@ !3C ^C JP [PY H#` ^Pi HX4P LX @P4C .AbX9 L!3C NȰ ]P H3Z9 X TP XI0!3A@XY @SZY Xi He  X @Z X9 L< X @Z X P@ XI @CZI XY TPT Xi0` #3C $Q @X9 @P9 <AX L#3C X @Z @ ]J  XY @SZY $`e X @Z $1P< Pi @Xi AX \Ű 
C0XY |[Y xXi AXi \W   <C p`  W   <Xi XAVW   HC n`  W   <Xi HW   <X XP HC  W   HC 4W   H`  W   <Xi HA#W   H` ?W   <XI 0#4A:#W  ,XY @P #$$`Pi <AjC X p#3AX9 #6X ,$P 0XI ,XY PT $Xi X P  X P $Ay X p#3AXI X@ =B0R$PPY@AtXi X` ;#4` 
!3C "X@ !3C 0&P@X9  
<c  C X  X@ҫ  kAVXI  XT  PY Xd $Pi V!3C AC P dX9 X0 -!6%P dAC X HŰ MB02$PTXI X@ +!6$PTAXY XP -!6%aPmTAC 0A^X0#3C X9 T0 0 X Tİ 
;P9 0ȠP C XI X@ =B0*AXY0#3C HXi TYi ##C ,Pi f!$$P 00P9 C JX XŰ =#3C AX0#3C XI T@ !@ ##C PI hC XY HPV&QPY@Xi X` =B04AX Z@X9 X<  0 
!2#X@Ű #4&P@C C nX XŠ 
#3C Xi HW   <` =W   <XI ZI@T  PY XP 
!2#eW   <$aQi@C X 0#4A#W  ,C P$Q @X9 @3Z9 ӳ  P HX @Z J PI LXY @SZY Xe Pi T
sK

X |P U #>Xi A>1  0 
#5$Q "%Q TXI T!3C ~XY H
UsE

$aPi TX T!#C \$1Q9 @X @Z ӫ  Š \!3C >XI @CZI T  P ?!3C &Xi @cZi    ]C0HX9 @3Z9 ӳ  Ű ^!3C X @Z J  @ [!:XY @SZY e Pi @$Q @C X9 @3Z9 X P TX @Y <#C B!#C Xi &aP (AW   HXi HAxXI LC0N` 'W   <XY ZY Le  fC0 X Z Ll  W   <$1Q9 LC ` 'W   <X 0#4A#W  ,AC XX LZ XI TPJ C %QQY TXi TC0`#=X @Z Pl X9 LP9 @#X @Y <!C C X L'P @C AXI T@ !3C XY |UY !3C  AXi &aPi |Ui !5Xi Pi |$Q X9 T!>X HŰ M!9Xi Pi |X P Pi xC XI xUI #4XY p#3C ARAP$`Pi X TB0(X9 P9 xU9 !5X9 P9 xP9 |$P P TC 4X xU !:XI UI !3C lPI x%QQY X9 x'1P9 %Q xX xU #?U #<jA>A  @ 
#3C XY xPY |C Xi |Ui !3C A   _ AB: ZB 2AXi AXi |PPA1  XP0  ;  $Q Q XI |UI !3C &API |C XY |UY x#4Xi p#3C UY !3A$$P %1Q9 |C VX |U !3C pAr$Q xQ |XI |PI C .XY |UY x!3C HAJ$aQi x%Q X9 Y9 #P9 C X |U !3C kAX Z LA  Z  ETI d#3C An!3C C LXi |PiL#X |PLU !4&P |X9 @3Z9 H P PX Z LJ  PI \XY |UY C0Xi |Aa  ` 
C0,Xi |A  W \T d!7A#3C $1Q9 |C X |P %Q PXI P!3C JXY HP UC0&A$aQi |X |U !5X P |P xQi #X9LP9 |APX |PLC RX |P XLP |C XI H@ D!=AXY QY xQY |Xi |Pi X H T!5X9 Q9 | UB0,X |[LP@XLP |AXI@QI xQI |XY |PY C (Xi @cZi H P PAAX9 |U9 x#;'1P9 |A#3C "%Q PX P#4U9 !3C *U9 !:XI UI !3C PI |XY |PY x'QPY |PY Q %aQi xX xU #?U #<lA1  0 
#3C C nX |U #3C AX Q xQ |XI |PI XY ZY Le  f!3C jX |[ xY h!&X9 |U9 !3C vAxX LPDXi AfX ZDJ  A  $QQY QYDXi ZiD  #3C X9D[9 LX xP xC X p#8XI |UI x#3C 
AXY xPY |A Xi 0C0C(APX [ Z P Xi AޔXi A݊C lXi A$:1  $Q Q Q Q A6X 'P |P x%AQI AXY [Y ZY PY %aQi X P |P xQi $PXi A$W  ,W   A0P9 X XŰ :B0FAX XŠ 
#2"XI 0C0*#Xi AXi A#XY PY Xi xPi $Q C $Q Q Xi AXI XA  $QQY @ 
!2#AXC Xi 0C4X U B0(XmPAZX9 Y=P#%'1P9 #$Q Xi A8C LX T#4ɠ B#%Ƞ BP TAbXi AX$JA  $QQY QY QY QY Xi |Pi xC X |U !3C "X xP |AbC X9 P9 |U9 #6[9 xY9 h##C A>C X U x!7s@,

AjX [ xY hB XI &API |UI !;XI PI |[I ZI xPI xXY |PY Xi Ui #<A   
#5$1Q9 "X |U #9kAlӡ  Š  !<AXI |PI x$QQY C HAJXi 'aA>`  a  X Y !X 'P $1Q9 %Q C :AX xZ h&P |%AQI |XY |UY x!3C eAa  `  #3C A$Q |X9 |P9 C bX U !3C [ |X hP@Y T#P TXI |[I x[ TP@!3C AXY@C$Xi Ap`  a  $Q %1Q9 xQ@C @X |U x#;Xi 'aA@ӡ  Š  #3C (%AQI $QQY xXi Yi #Pi QI@X@#3C C hAC `
	w p P @ .r	 ,  q	 ,s9 BP9 @r	 ,  q	 ,ȹ 2P L;  $"Ab$ATy  +	w p 4$&P 00<Z8 PP9 ,X  B,&8P7 ,0 P7 0X ,XZ  $aW  (XI ,%QPT  X 0 B0y  5	w p P$P 4r	 ,  q	 ,X9 H2Z=PX  P Ly  	g p <'aPi iPi ,X P 0X8 XX P 8X 8XJ  UI ,B0HU X!7XY 4PX XC "Xh XU #=X 4X: P< X6 P: P X 0Zʺ y U X!2#	P 4X P 8C XX XXe  B"&XPW ,P PW 0X XX\  $aW  (X9 4P8 XX 8X ,P  &P ,Ȱ P 0Z$aW  XI 8XY 0Z]T C n 	W  p 4UY ,!4y X ,	B @X9 C 4Xi ,AXi  P 0AX 0ӡ  ҫ  $AQI  QI ,%QQY C C H
VPY  
P ,Xi C 4%Q  Q ,Xi ,AdXi  P 0AXX9 0ӱ  ҳ  %Q C C d X	g p` ,P,Py\#Xy\C X6 (#3P=L%QLXLà#5&PL"P4$AQMLXY XmLPe (X 0
lPmLZ 0P4Pe  $0P5 0ӵ  !3C 6W  C0A)BX Ar	<  q	<$@>r	<  q	<XITPI8XY8PYTXi,PiP$@>r	<  q	<X9,P7 ,$4P7 0XY4$aW  (Ȱ QL$Q4XIX!3C XY8PYT$k@i>r	<  q	<C zX W  #:X $cW   x#X %1P< 0$P  P $y $cW   `W   P0XmLAX0ҡ  $AQMLC W   XY XmLPe $X X< $U<  C0 cA\ӱ  Ű 
#8X %AQJ $C P (Q]LXi XL'P ,W   $`W   `C P 	 w P (p A' ,A-dA ,A   NDPH Tp`P PW  #8W  ' ,A]XmW  $QeW  $`W   `$`W   l$&P \0<Z8 PP8 X%P   #;ȠZ PȚP #XH PT`PS  B0( t$=A( $=A( $=A$0P8 hXȫ  Pț @PK PH( tA.A*#8 t.A*!4$PX t( A( XAh f!;(  tA$P p#$0P8 p .A*#6.A*!4$@H X UB0>h tA
Xh #6$ A' ,A tA   W   HC  P X; 0 !!5 dP h tAX #6$ AӨ #=h AX #6$ AXH PH XX PX h tfC0H' ,A tA   W   HX p!?W   H W   HC "' ,A A   W   HW  ,8 P7 ,p `Ap `P 0Ȱ P 4Ƞ PP 8X h tAX pC04XHB0,W   HW  ,$PPX W  Xh C0X [ P `X8 P7 ,XX lAX `Q ( 2 Ar ,  q , $cW   $cW   lX 'PX 'P `C &P `iA8a  W   <X `UB0W   $aW  @W  #W  x gram is limited and even if a school invests in a printer for it, the cost
of paper needed for this will be extremely high.
$p If, as is likely in the near future, exams are introduced at other grades
the problems are going to be exacerbated and serious thought will have to be
given to providing adequate computer power in the school at reasonable cost.
$a indent=0
$p 4. %Use %as %a %Teaching %Aid.
$a indent=1
$p Most of the packages at present available and most being developed are
teaching aids in the various subject disciplines.  Unfortunately, a large
number of these require a one to one situation and are therefore unsuitable in
the present situation.  Others, which are suitable for classroom presentation,
simulate a situation which can be demonstrated better by other means. Too often,
we find packages being produced for the wrong educational reason. They are 
produced because they are easy to do. The question which the teacher of every
subject discipli                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                         Tt||l                       Failure: ingbig XZ ,P P      T                                                                          4 schools throughout the
country with the first exam in 1984.  There is, however, no commitment to extend
the exam to all schools after that date. No doubt this will eventually happen but
as mentioned earlier the drawback is going to be lack of reasonable equipment.
The syllabus is still in the process of being finalised and is being kept a
closely guarded secret.  From what has been divulged the exam will be like the
CSYS Maths IV paper in that part of it will be project work. Whether fourth year
pupils are mature enough to cope with this is a debatable point. There will be
a large measure of appreciation and package running in the course as well as 
programming.
$p In the realms of appreciation courses, a seminar was held in Glasgow at the 
beginning of March under the auspices of the Project Steering Committee of the
Microelectronics, Computing and the Curriculum (MCC) Project set up by the
Consultative Committee on the Curriculum. This seminar produced plans for a
general appreciation course for %all pupils, to be taught either during year
1 or 2.
It was realised that materials had to be produced and a proposal has been submitted
to the CCC that at least two teachers be seconded to produce the materials and
that backup support for programming should be provided. It is hoped to have this
material ready for session 1983-84.
$a indent=0
$p %Maintenance.
$a indent=1
$p The problem of breakdown of machinery is one which can cause problems for
the teacher. This is bound to happen with the amount of hard use to which the
computers are subjected.  So far, schools have found that a machine may be out of
action for some considerable time. Since schools cannot have extra computer
power to cover this eventuality, some consideration will have to be made at
Regional level to the desirability of employing technicians who can deal with the
schools problems immediately.
$e
 H?   ( (                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !Virtual memory support for visual ECCE
!A.D. Culloch.  March 1981
!Large byte address space mapped over a large
!temporary DA file.

%const %integer CR = 13
%const %integer maxname=127;         !max file name length
%recordformat file(%string(maxname) name, %integer chan,
                    %integer top,lim,vmtop,vmlim,flag)


%include "Sysinc:Command.INC"
%include "sysinc:DA.inc"

   %own %integer maxVM = 400 {blocks}
   %ownintegerarray bitmap(0:50) = 0(*)

   %routine set bit (%integer index)
      %integer j = index>>5, k = index&31
      bitmap(j) = bitmap(j) ! 1<<k
   %end

   %predicate bit set {?} (%integer index)
      %integer j = index>>5, k=index&31
      %true %if bitmap(j) & 1<<k # 0
      %false
   %end

   %routine clear bit (%integer index)
      %integer j = index>>5, k = index&31
      bitmap(j) = bitmap(j) & (\(1<<k))
   %end


   %record %format blockfm (%byte %array B(0:511))

   %record %format buffm(%integer from,to,  {block maps these V.addrs}
                         %integer chan,     {paged in from here}
                         %integer block,    {block in paging file}
                         %record(buffm)%name link,   {circular list}
                         %record(blockfm) blk)

   %const %integer max con = 3;          !max files in VM: IN,OUT,SEC
   %const %integer sec chan = 3
   %own %integer %array base(1:max con) = 512,0(*);!base V.addr of file (j)
   %own %integer connected = 1;          !no of files currently mapped
   %const %integer paging file = {channel} 1
   %own %string(31) page file name;      !tmp file in current directory
   %external %integer %spec buffers
   %external %record(buffm) %array %name %spec buffer
   %external %record(buf fm)%name %spec buf
   %own %integer free VM = 512;          !bytes of VM connected (must be >0)

   %string(4) %function Unique Extension
      %record(parm fm) P
      P_dact = 25;  SVC (20,P);          !Director call for unique ext
      P_p4 = P_p4&x'FFFF'
      SVC (18,P);                        !Unpack filename -> ".EXT"
      %result = string(addr(P_sact))
   %end
   

   %external %byte %map byte integer (%integer index);!into notional VM in DA file
      %integer block = index>>9, offset = index&511, chan
      %record(buffm)%name prev, p
      p == buf_link;                     !hd of circ. list
      %cycle;                            !id BLOCK in buffer chain?
         %if p_from <= index <= p_to %start
            !promote this buffer to hd of list
            !(most recently used)
            %if p == buf %start;         !tl becomes hd
               buf == prev
            %else %if p ## buf_link;     !already hd?
               prev_link == p_link
               p_link == buf_link
               buf_link == p
            %finish
            %result == p_blk_B(offset)
         %finish
         %exit %if p == buf
         prev == p
         p == p_link
      %repeat
      !block not in store.. replace last page in list
      %if buf_block >= 0 %and buf_chan # sec chan %start
         write DA (paging file, buf_block, buf_blk)
      %finish
      !promote last buffer
      buf == prev
      chan = paging file
      %if %not bit set (block-1) %start;   !not in paging file - which chan?
         chan = chan + 1 %until chan={last}connected %or index < base(chan+1)
      %finish
      p_from = 512*block
      p_to   = p_from + 512 - 1
      p_chan = chan
      read DA (chan,(p_from - base(chan))>>9,p_blk)
      p_block = block - 1 {offset for initial free VM=512}
      set bit (p_block);  !used
      %result == p_blk_B(offset)
   %end
   %external %routine connect input (%record(file)%name f)
      %own %integer first {call} = 1 {nonzero: true}
      %integer j,k, size
      %const %integer to Director = 20,
                      pack filename = 17,
                      get status = 18;  !magic nos for svcs
      %recordformat parmfm ( %c
            %short dsno,dact, %short ssno, sact, %integer p1,p2,p3,p4,p5,p6 %or
               %integer frig, %short ssno2,sact2,%string(23) text         %or   
               %integer frig2,%short ssno3,%string(25) fname)
      %record(parm fm) Q
      %if f_top # 0 %start;              !previous secondary input file
         %for j = 1,1,buffers %cycle;    !free any buffers in use
            buffer(j)_to = -1 %if buffer(j)_from >= f_top
         %repeat
         close DA (f_chan)
         connected = connected - 1
      %finish
      !get size of file (blocks) from Director
      %if f_name = "" %then size = 0 %else %start
         Q_fname = f_name
         SVC (pack filename,Q)
         Q_text = "illegal filename" %and ->fail %if Q_p1 < 0 %or Q_p2 < 0
         Q_dact = get status
         SVC (to Director,Q)
         %if Q_p6 # 0 %start
fail:       print symbol (CR);  print symbol (NL);         !cr/lf
            print string ("*Edit " . f_name . " fails -- " . Q_text)
            %stop
         %finish
         size = Q_p2;                       !blocks
      %finish
      %record(buffm) %name p
      %if first # 0 %start
         first = 0
         %for j = 1,1,buffers %cycle
            p == buffer(j)
            p_from = 0;  p_to = -1; p_chan = -1; p_block = -1
            %if j = buffers %then p_link == buffer(1) %c
                            %else p_link == buffer(j+1)
            p_blk_B(k) = '@' %for k = 0,1,511;   !warning of problems
         %repeat
         page file name = "$ECCE" . unique extension
         create file (page file name, max VM, max VM)
Write(Max VM, 1);  Printstring(" blocks created");  Newline
         open DA (paging file, read write, page file name)
      %finish
      f_flag = -1 %and %return %if size < 0
      connected = connected + 1
      f_chan = connected
      open DA (f_chan,read only,f_name) %if f_name # ""
      %monitor %if f_chan > max con
      base(f_chan) = free VM;  f_top = free VM
      f_lim = free VM + 512*size
      free VM = free VM + 512*(size + f_flag)
      %if f_flag # 0 %start;              !mark extra pages as 'in file'
         set bit (j-1) %for j = f_top>>9 + size, 1, free VM>>9 - 1
      %finish
      f_flag = 0
      f_VM top = f_top;  f_VM lim = free VM - 1;  !VAX
      f_lim = f_lim - 1 %while f_lim # f_top %and byte integer (f_lim-1) # NL
   %end
   %external %routine move (%integer length, from, to)
      %return %if from = to
      %if to <= from %start
         %while length > 0 %cycle
            byte integer (to) = byte integer (from)
            from = from + 1
            to = to + 1
            length = length - 1
         %repeat
      %else
         from = from + length;            !move from back to front
         to   = to   + length
         %while length > 0 %cycle
            from = from - 1
            to   = to   - 1
            byte integer (to) = byte integer (from)
            length = length - 1
         %repeat
      %finish
   %end
   %external %routine close off
      %external %record(file) %spec in, out, sec
      %integer flim = out_lim, size
      %record(buffm)%name this
      %integer k
      %integer j = flim - out_top;   !out size
      %const %integer eot = 4
!      Dump last couple of blocks on the console
!      k = flim - 1024;  k = 512 %if k < 512
!      %while k # flim %cycle
!         print symbol (byteinteger(k))
!         k = k + 1
!      %repeat
       %while j&511 # 0 %cycle;     !fill last block
         j = j + 1
         byte integer (flim) = EOT
         flim = flim + 1
       %repeat
       size = j>>9 {blocks}
       !fill paging file
       %for j = 512,512,512*size %cycle
         %unless bit set (j>>9-1) %start;   !block not used yet
            k = byte integer (j);           !access it
         %finish
       %repeat
       %for j = 1,1,buffers %cycle;        !flush buffers
         this == buffer(j)
         write DA (paging file,this_block,this_blk) %if this_block >= 0
       %repeat
       extend DA (paging file,size - max VM,size);   !truncate
       close DA (j) %for j = 1,1,max con
       delete file (out_name) %if out_name # "" %and exists (out_name)
       rename file (page file name,out_name)
       write (size,0);  print string (" block")
       print symbol ('s') %if size # 1;  print symbol (':');  space
   %end
%end %of %file
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        %externalroutine Help(%string(28) Wanted)
   %recordformat hfm(%string(31-9) Key, %byte Flag, %integer start, finish)
   %externalroutinespec To Upper(%string(*)%name S)
   %externalroutinespec open da(%integer chan, rw, %string(25) file)
   %externalroutinespec read da(%integer chan, block, %name to)
   %externalroutinespec close da(%integer chan)
   %routinespec Copy(%integer from, to)
   %routinespec find topic(%integername start, finish)
   %routinespec show all

   %integer start, finish, l, control
   %byteintegerarray b(0:511)
   %string(28) Topic, Topics

   Open Da(1, 0, "Help:Help.dat")

   control = 0
   %if wanted # "" %start
      control = Charno(wanted, length(wanted))
      %if control = '!' %start
         length(wanted) = length(wanted)-1
      %else
         control = 0
      %finish
   %finish

   %if wanted = "?"  %start
      show all
      %return
   %finish

   Topic = wanted
   To Upper(Topic)

   find topic(start, finish)
   %if start # 0 %start
      copy(start, finish)
   %else
      printstring("No information about ".wanted);  newline
      printstring("Help ?     will give a list of the topics available")
      New Line
   %finish
   %return

   %record(hfm)%map R(%integer n)
      %owninteger previous = -1
      %integer block, byte
      n = n*32
      block = n>>9
      read da(1, block, b(0)) %unless previous = block
      previous = block
      byte = n&511
      %result == record(addr(b(byte)))
   %end

   %routine show all
      %integer j,n
      %record(hfm)%name H

      %routine Add(%string(31) s)
         %owninteger n = 3
         %owninteger pending = 0
         %return %if s = ""
         spaces(pending);  pending = 0
         printstring(S)
         n = n-1
         n = 0 %if length(s) >= 22
         %if n <= 0 %start
            newline
            n = 3
         %else
            pending = 24-length(s)
         %finish
      %end

      printstring("Help is available on the following topics:");  newline
      n = R(0)_Finish
      %for j = 1,1,n %cycle
         h == r(J)
         add(H_key) %if H_Flag = '+'
      %repeat
      newline
   %end

   %routine find topic(%integername start, finish)
      %integer High, Low, P
      %record(hfm)%name H
      low = 1;  high = r(0)_finish
      %while low <= high %cycle
         p = (low+high)>>1
         H == R(P)
         %if H_Key = Topic %start
            start = H_Start;  Finish = H_finish
            %return
         %finish
         %if H_Key > Topic %then High = p-1 %else Low = P+1
      %repeat
      start = 0;  finish = 0
   %end

   %routine copy(%integer from, to)
      %integer last = nl, sym
      %integer quiet = 0
      %integer n, byte, block, next block, next byte
      Block = from>>9
      Byte  = from&511
      Next Block = to>>9
      Next Byte  = to&511
      n = (next block-block)*512-byte+next byte
      quiet = 1 %if control = '!'
      %cycle
         read da(1, block, b(0))
         %cycle
            sym = b(byte)
            %if last = nl %and sym = '?' %start   {more detailed info}
               %return %if control # '!'
               quiet = 0
            %else
               printsymbol(sym) %if quiet = 0
            %finish
            last = sym
            byte = byte+1
            n = n-1
         %repeat %until byte = 512 %or n = 0
         %exit %if n = 0
         block = block+1
         byte = 0
      %repeat
   %end
%end

%begin
   %include "Sysinc:command.inc"
   Help(Command_Parameter)
%endofprogram
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         @?   @       -c/     -c/:     /       /:                                                                                                                                                                                                                                                                                                                                                                                                                                                          ?ANYTHINGiBELwE_KTAPE DUMPS
These describe the available archiver commands separately, but in fact
sequences of commands (e.g. to dump several discs then generate a listing) are
commonly entered. The Archive program prompts "Archive: " when it wants a
command.  Reply with EXIT to return to MOUSES command level. 
+Archive_Initialise
&Archive_initialize
To create an empty archive tape, mount a scratch tape in the drive with a
write ring fitted.  Enter the command:

            Command: ARCHIVE!

In reply to the "Archive:" prompt, enter: 

            Archive: initialise ...text...

The text following "INITIALISE" is recorded in the tape label and appears on
listings of the contents of the tape.  (See HELP ARCHIVE_ANALYSE).
At this point, either reply EXIT to the "Archive:" prompt to return to command
level, or enter another archiver command.
+Archive_analyse
A listing of the contents of an archive tape can be produced by the following
sequence of commands:

            Command: archive / listing-file
            Archive version 1.5          Program announces itself

            Archive: analyse

            Archive: exit

When the EXIT command is entered, the 'listing-file' is closed and control
returns to command level.  The 'listing-file' may be any file or device, e.g.

            Command: archive /$temp
            Command: Archive /LP:
            Command: ARCHIVE/LP:LISTING
+Archive_Dump
The archiver command:  DUMP UNIT disc
is used to dump all the files on the named disc unit to the mounted archive
tape.  To dump only the files belonging to a single user, use the command:
                       DUMP USER who
As each file is archived, a message line is written on the operator's console
of the form:           <- filename
Reply "EXIT" to the "Archive:" prompt to return to MOUSES command level.

Examples:               Archive: dump unit sys
                        Archive: DUMP USER User_Fred
                        Archive: Dump user Alan
                        Archive: Dump unit PAK4
+Archive_Restore_User
The archiver command:   RESTORE USER who
causes the mounted archive tape to be searched for any files belinging to the
specified user.  They are reloaded onto the disc.  Where they are put depends
on how the archiver was started.  By default, the files are loaded into the
directory currently being used by the operator, so to reload FRED's files, do:
                        Command: Be Fred     {switch to right directory}
                        Fred: Archive
                        Archive version 1.5
                        Archive: restore user fred
                        Archive: exit
                        Fred: Be             {Become OPER again}
+Archive_Restore_Unit
The archiver command:   RESTORE UNIT disc
causes the program to read through an entire archive tape, reloading any files
which were originally dumped from the named 'disc'.  Users will automatically
be created on the disc to read the files into.  For example the disc PAK5
could be restored to the state it was in when last dumped by mounting the dump
tape, re-initialising PAK5 (see Help Disc_initialise) then entering :-

            Command: Archive
            Archive version 1.5
            Archive: restore unit pak5
            Archive: exit

+Archive_Restore
Files can be retored to disc from an archive tape either singly, or grouped
per user or per disc unit.  See one of:

   o  Help Archive_restore_file

   o  Help Archive_restore_user

   o  Help Archive_restore_unit

+Archive_restore_file
To restore the latest version of a file from an archive tape, use:

            Command:archive
            Archive:restore file user:filename
    e.g.    Archive:restore file pak5_fred:program.imp

If you have an analysis (see Help Archive_analyse) of the tape, the version
of the file as it was when dumped on a particular date at a particular time
may be restored.  First find the serial number of the required version from
the analyse listing, then:

            Command: Archive
            Archive: Restore #nnn

Where 'nnn' is the sequence number of the file.
+Utilities
&utility programs
Information about several system utilities is available.  See:

   Help Disc      - The disc backup/copy utility.
   Help Archive   - The magnetic tape disc backup utility
   Help Tapes     - Utilities to process tapes (including IBM tapes)

+Disc
&Disc utility
&Disc checks
&Disc checking
&Disc copying
&Disc compression
&compressing discs
&copying discs
The disc utility supports the following operations.  

   o  Initialise 'raw' discs with an empty file system.

   o  Perform self-consistency checks on the directories on a disc.

   o  Copying one disc straight onto another.

   o  Copy a disc, compressing the free space on the disc into a single area.
      (May have to deal with corrupt input discs).

   o  Compare the contents of two discs.  (Verify copy).

See:  Help Disc_initialise   Help Disc_Test       Help Disc_copy
      Help Disc_compress     Help Disc_Compare
+Disc_test
Checking of a disc is initiated by the command:

            Command: disc(test)          Program prompts for disc to test
    Or:-    Command: disc(test) xx       Disc to test specified in command line

'xx' is the disc unit to be tested: either a unit number '#n' or the name of
a loaded disc.  (See Help Disc units).
Any errors detected are logged on the console.  More logging output is
produced if a question mark '?' is appended to the command line.  The enquiry
facility (see Help ENQ) may be used to discover the directory currently under
test.
Examples:   Command: disc(test)          Program prompts for disc to test.
            Command: disc(test) #1       Test disc on unit one.
            Command: disc(test) Sys      Test disc with logical name "SYS".
+Disc_Initialise
&Disc_initialize
The command:         Disc(initialise) / xxxx
is used to start initialisation of the disc 'xxxx', which may be specified
either as the logical name of a loaded disc or as a unit number '#n' (see
under Help Disc units).  The program prompts for certain parameter values.
Sample dialogue:     Command: disc(initialise) /#1    {init disc on unit one}
                     Are you sure you want to overwrite OLD?
                     Yes/no? yes         {reply NO to abort program}
                     Phy. disc name: NEW {any four letters/digits}
                     Log. disc name: NEW {Logical name as used in LOAD etc}
                     System area? yes    {reserve an area for a system image?}
                     Disc type: Diablo   {or HELP/MSM80/CALCOMP/TELEFILE}
                     Description: any text supplied by the operator
                     ***WIPING NEW
                     Blocks: 9600
                     No errors
The valid replies to "Disc type:" are:
   DIABLO   10MB cartridge disc      MSM80    P-E 67MB drive
   TELEFILE 300MB drive              CALCOMP  67MB drive with TDC controller
   UNKNOWN  Specify no. of tracks, blocks per cylinder and heads by hand.
If the command line "Disc(initialise)" on its own is given, the program will
prompt "Output disc?" for the name of a unit to initialise.
+Disc_Copy
The command:   Disc(copy) xxxx / yyyy
will cause the program to copy the contents of disc 'xxxx' block by block over
the contents of disc 'yyyy'.  No interpretation is placed on the blocks, i.e.
non-MOUSES discs may be copied.  The disc identifiers 'xxxx' and 'yyyy' are
either logical disc names or disc unit numbers (see Help Disc units).  Either
may be omitted, in which case the program prompts for "Input disc?" or "Output
disc?".After the program starts it will prompt the operator for the type of
disc to be copied.  (Answer DIABLO for cartridge discs, MSM80 for P-E 67MB
drives, CALCOMP for TDC 67MB drives or TELEFILE for 300MB drives).
Examples:      Command: Disc(copy) Sys/#3
               DISC COPY V2.0
               Disc type: Diablo
               Command: disc(copy) /#4
               DISC COPY V2.0
               Input disc? #3
               Disc type: MSM80
               Command: DISC(copy) Fred/Jim
               DISC COPY V2.0
               Disc type: telefile
+Disc_Compare
&Disc_Verify
&verify
&disc verify
To discover whether two discs are identical, use the command:

               DISC(COMPARE) xxxx, yyyy

'xxxx' and 'yyyy' are logical disc names or disc unit numbers '#n', see
Help Disc units.
Either may be omitted, in which case the program prompts for "Input disc?" and
"Output disc?".  The program will prompt "Disc type:" to find out how many
blocks are to be compared.  Reply DIABLO for cartridge discs, MSM80 for
Perkin-Elmer 67MB drives, CALCOMP for TDC 67MB drives or TELEFILE for 300MB
drives.
Examples:      Command: disc(compare) #1, #2
               Command: DISC(COMPARE) SYS0, SYS1
+Disc_Compress
&Disc_squeeze
The command:   DISC(COMPRESS) xxxx / yyyy
will copy all user directories and files from disc 'xxxx' to disc 'yyyy'.
'xxxx' and 'yyyy' may be either the logical names of two loaded discs or
disc unit numbers '#n' (see Help Disc units).  Either may be omitted, in which
case the prompts "Input disc?" or "Output disc?" will be output.
A listing of the contents of the generated output disc can be produced:
               DISC(COMPRESS) xxxx / yyyy, listing-file
If the file system on the input disc is not self-consistent, the program
stops with the message:
               ***FAULTY INPUT DISC
If it is necessary to attempt to 'rescue' a corrupt disc, append an exclamation
mark "!" to the command line, and the program will attempt to copy any good
data remaining on the faulty disc:
               DISC(COMPRESS) xxxx / yyyy, listing !
(The ", listing" part is optional).
The operation of the program can be inspected using the ENQ facility (see
Help ENQ).
Examples:      Command: disc(compress)            {Prompts for disc names}
               Command: disc(compress) user/arch
               Command: Disc(compress) DEAD / #5, LP:listing !
               Command: disc(compress) user/back, List
+Ctrl+D
&EOT
&end of file
&end of input
The end of file condition can be signalled to a program reading from a terminal
by striking the Ctrl+D (EOT) key.  This is echoed by the system as "[]". 
+Ctrl+H
&Backspace
&rubout
&DEL
&erase
DEL and Ctrl+H (backspace) have identical effects.  The last character on the
current input line is erased.  Pressing DEL 'n' times erases the last 'n'
characters from the current line.  This is obvious on a VDU.  On hardcopy
devices the characters cannot be physically rubbed out, so the group of
characters being erased are echoed on the terminal (backwards as they are
deleted), enclosed between a pair of backslash "\" characters.
+Can
&Ctrl+X
This character causes the whole of the current line to be erased.  On fast
VDU terminals, the line is visibly erased.  On slower hardcopy terminals, a
'#' is printed, a carriage return/line feed sequence is output and the command
prompt is reissued.  (See also:  Set_erase)
+CR
&return
&newline
Striking the CR (carriage return, RET) key causes the current line to be
entered and processed by the system.  A carriage-return/linefeed is output
to put the cursor at the start of the next line.  An IMP program reading from
the console will read this as a single NEWLINE (LF) character,  Pascal and
FORTRAN programs see 'end of record' (EOLN).
+LF
&linefeed
&Ctrl+Q
&DC1
Linefeed and Ctrl+Q have identical properties.  Output to the terminal is
re-initiated after being suspended for one of the following reasons:

      o  End of page on VDU.   See:  Help Set_Page

      o  Output suspended manually by user pressing Ctrl+S.  See: Help Ctrl+S

      o  Output being discarded.   See:  Help Ctrl+T

+Ctrl+S
&DC3
&hold output
Striking the Ctrl+S key causes output to the terminal to be immediately
paused.  (Output is resumed by pressing linefeed, LF, or Ctrl+Q).
+Ctrl+R
&DC2
&retype
The current line being input by the user is retyped by the system.  This is
most useful on hardcopy terminals where a proliferation of '\' characters
echoed by DEL can obscure the meaning of the line.
+Ctrl+T
&DC4
This character causes the system to start THROWING AWAY terminal output.
Output is resumed either by pressing Ctrl+Q or Linefeed (LF), or when the 
running program stops to ask for input from the console.
+Ctrl+I
&TAB
&tabulation
&tabs
The system provides a 'tab stop' facility for user console input.  By default
pressing TAB (i.e. Ctrl+I) is equivalent to entering three space characters.
The user may alternatively set tab stops at particular columns,
see:   Help Set_Tabs
       Help Set_Tab
+Ctrl+E
&ENQ
Pressing ENQ (Ctrl+I) causes the system to display a short message indicating
the operation that is currently being performed in the form:

                  ***System: text

By default, "text" is the name of the program currently running or null if the
system is waiting for a command.  User programs and utilities (e.g. the IMP-77
compiler, the DISC utility etc) may set this string to indicate the operation
currently being performed.  E.g. the compiler indicates which pass it is 
performing.

There is no restriction on when ENQ may be used, during console output, while
the system is waiting for input or while there is no console activity.
+Ctrl+U
&NAK
The current line is erased as for CAN (Ctrl+X).  Additionally any lines which
have been typed ahead by the user and have not yet been processed by the system
are discarded.  NAK (Ctrl+U) echoes as '#', CR, LF.
+Ctrl+O
&SI
The console is shifted into the normal (default) mode, where upper and lower
case letters are distinct.  (Although all system programs treat upper and lower
case identically).  See also:  Help SO
+Ctrl+N
&SO
The console is shifted out of normal mode.  Henceforth, all lower case letters
typed will be echoed as the corresponding upper case character and any program
reading from the terminal will see the upper case character.  This effect may
be cancelled by striking the SI (Ctrl+O) key to shift back into normal mode.
+Ctrl+P
&DLE
&Binary input
To allow the input of any ASCII character to a program reading from the console
it must be possible to disable the standard interpretation of characters like
ESC and TAB.  Any character may be entered in thsi way by prefixing it with
DLE (Ctrl+P). 
Examples:      <dle> <esc>               - to enter the ESC character
               <dle> <dle> <dle> <dle>   - to enter two consecutive DLE chars.
               <dle> F <dle> <bel>       - to enter 'F' BEL.  (The <dle> before
                                           the 'F' is redundant since 'F' has
                                           no special significance.
               <dle> <eot>               - EOT normally causes end-of-file.
+Operator commands
&ops
The operator has access to several privileged commands:

   Catalog              - List usernames on a particular disc.
   State                - Gives status of system/discs/spoolers.
   Broadcast            - Send a short message text to all terminals.
   Close                - Prevent users from logging in.
   Shutdown             - Automatically close after broadcasting warnings.
   Open                 - Stop any pending shutdown, and allow user logins.
   Dateis               - Set the date and time counters used by the system.
   Protect              - Set software protection on a disc unit.
   Hazard               - Reset software protection on a disc unit.
   Load                 - Make a disc unit available to users.
   Unload               - Used before putting a disc offline.
   Pass                 - Set a global system password.
   Reprime              - All spooled files are revoked.
   Restart              - Reboot the system.

Type: Help 'command' for further information, e.g.  Help broadcast
See also:  Help utilites  Help disc units
+Catalog

The command:   CATALOG disc              
will generate a listing of the names of all users whose directories
reside on the specified disc.  'Disc' is either the name of a logical disc
unit, or a disc unit number "#n" in which case the analysis is of the disc
mounted on unit "n".  (See also:  Help disc units). 

Examples:      Command: catalog sys      what users are on the system disc?
               Command: catalog #1       Who is on the disc mounted on unit 1?
+Disc units
&discs
MOUSES accesses discs internally by 'logical disc unit number'.  More than one
logical disc may be mapped onto a single physical disc unit. (E.g. a 67MB drive
is normally partitioned into three logical discs). Usually, the operator will
refer to discs by name, but it is possible with most commands to quote the unit
number instead in the form "#n".  The correspondance between the numbers and
real disc drives varies from system to system.  For example:

   #1:  Cartridge disc C6:               #5:  67MB drive, first partition.
   #2:      "      "   C7:               #6:    "    "    second   "
   #3:      "      "   D6:               #7:    "    "    third    "
   #4:      "      "   D7:
+State
&Status
This command has several forms:
Command: state          - This form produces information about the user who
                          runs it (e.g. amount of CPU time used, username etc).
Command: state system   - This displays information about all active users.
Command: state discs    - This lists the names of the online discs.
Command: state discs!   - As above with extra information - free blocks etc.
Command: state discs?   - As for STATE DISCS, with disc description displayed.
Command: state queues   - Display a list of all spooled files.
+Broadcast
The command:   BROADCAST text
causes the message "text" to be displayed on all terminals in the form:

               ***OPER: text

Text longer than 23 characters will be truncated on the right.
+Close
The command:  CLOSE
will prevent users other than OPER logging in to the system.  Attempts to do so
will produce the "No user service" message.
See also:  Help open   Help shutdown
+Open
The command:  OPEN
allows users other than the operator to log in to the system.  The system is
normally opened automatically as part of the startup sequence.  It should
therefore only be necessary to use the OPEN command:

    o   After an explicit CLOSE

    o   If the normal startup sequence has been bypassed by logging in as OPER
        in the interval between system startup and the message "OPER starts"
        appearing on the system log.

OPEN also cancels the effect of any pending SHUTDOWN command.

See also:  Help close   Help shutdown
+Shutdown
&Shut
&Closedown
The command:   SHUTDOWN  nn
causes an orderly shutdown of the system in 'nn' minutes.
A warning message is sent to all terminals when the command is entered, and
after successively shorter intervals before the deadline.  The messages are
of the form:
               ***OPER: Close in nn minutes

When the deadline is reached, processing of the spooler queues is halted
and a final warning is issued:

               ***OPER: Closing down NOW!!

After a further minute of grace all logged on users except OPER are forcibly
logged off.
+Protect
&write protect
&prot
When the system starts up, all discs whose logical names start with "SYS" and
all hardware-protected discs are automatically software-protected. To software
write-protect a disc manually, use the command:

               PROTECT disc

'Disc' is either the logical name of the disc (e.g. Sys, User) or a unit number
'#n' (see Help disc units).  After execution of the command, users may no
longer create or alter files on the disc in question.  The disc need not be
hardware protected.  Note that if a disc is hardware protected but is NOT
software protected then attempts to write to the disc cannot be detected at the
user level, but will be reported on the logging device as disc errors. (The
attempted write will be retried until either the disc is made unprotected again
or the fifteenth retry fails, in which case the attemped operation is
abandoned).  Disc protection can be reset using the HAZARD command.
Examples:      Command: Protect SYS
               Command: protect #1

The protection status of the discs can be displayed with the STATE DISCS
command.  See also:  Help state  Help Hazard 
+Hazard
&unprotect
&deprotect
To remove any software write-protection on a disc, use the command:

               HAZARD  disc

'Disc' is either the logical name of a disc, or a disc unit number '#n'.
Hazarding a hardware-protected disc is not advised, since any user who then
attempts to write to the disc will not be trapped until the lowest level of the
system is reached, where the attempted write will be rejected by the hardware,
resulting in a series of up to fifteen retries before it fails). The PROTECT
command is used to set software protection.
Examples:      Command: hazard sys
               Command: hazard #5

The current protection status of the discs may be inspected by the STATE DISCS
command.  See also:  Help state  Help protect
+Load
&mark on
&mark
Not all discs physically online to the system are available to users.  To make
a disc available, the operator must LOAD it.  This is done automatically at
system startup for all discs online at the time.  Discs can be made
inaccessible by UNLOADing them (see 'help unload').  The form of command is:

               LOAD  disc

'Disc' is either the logical name of the disc to be loaded or a unit number of
the form '#n'.  The system will report the fact that the disc has been loaded
on the logging device.  If the name of the disc begins with "SYS", or the disc
device is hardware protected, the loaded disc will automatically be software
protected.  The command STATE DISCS (see "help state") will display a list of
the discs which are currently loaded.

Examples:      Command: load pak2
               Command: load #1
+Unload
&Mark off
To make a disc which is currently online inaccessible to user processes, use 
the command:   UNLOAD disc
where 'disc' is either the logical name of the disc to be unloaded or a disc
unit number '#n'.  (See "help disc units"). The command STATE DISCS (see "help
state") will display a list of the discs which are currently loaded.

Examples:      Command: unload arch
               Command: unload #5
+Pass
The command:   PASS ...
allows the operator to set a global system password.  The text string "..."
should be from one to six letters or digits.  After execution of this command
a user may log in to ANY user's account by quoting either its the correct
password, or the global password.  A user may also log in when the system is
closed (see 'help close') by quoting the system password.  If the command PASS
is entered on its own (with no "..." part) the global password is removed.

Examples:      Command: pass twit
               Command: pass xyz123
               Command: pass             {revoke global password}

Note: For security reasons this command should be used infrequently and with
      caution.
+Reprime
The command:   REPRIME
causes all files spooled to any queue (e.g. LP:, PP:, BATCH:) to be deleted.
The spoolers are reinitialised.  It should not normally be necessary to use
this command unless the queues become corrupt.
+Restart
&Reboot
&rebooting
&boot
&bootstrap
&booting
&reloading
The system can by booted either from the front panel with the 50-sequence
loader and the MOUSES bootstrap papertape/magtape or while the system is
running (e.g. to test new versions of the system).  To boot from disc 'xx'
from a running system, use the command:
                RESTART xx               (See also: Help disc units).
Examples:       RESTART #1
                Restart SYS
The system will go into an loop waiting for a valid system disc to be put
online on the nominated disc.
(See: Help 50-sequence  for details of front panel booting)
+50-Sequence
&50 sequence
To boot from the high speed paper tape reader or the magnetic tape unit, set up
the store locations using the front panel, then run from location X'50' after
clearing the PSW (press DTA ADR FN SEL on the front panel).

      Address  Contents   (both hexadecimal)
         50    D500
         52      CF
         54    4300
         56      80
         78    1399     {To boot from the high speed paper tape reader}
         78    85A1     {To boot from the default magnetic tape drive}
         7A    dd00     {'dd' is the cartridge disc address, e.g. C6}
         7C    ccss     {'cc': disc controller address, normally B6
                        {'ss': SELCH address, normally F0
         7E       0
+Dateis
&set date
&time
&date
The current date and time (as displayed by the STATE program, see: Help state)
are set using the operator command:

               DATEIS  date  

'Date' is of the form:   dd-mmm-yy    e.g.  15-Sep-81

      Or       DATEIS  date  time

'Time' has the form:     hh:mm        e.g.  13:10    (ten past one PM)
                 or:     hh:mm:ss     e.g.  10:11:30

Examples:      Command: dateis 25-Dec-81
               Command: DateIs 13-Jun-79 11:30
               Command: Dateis 13-Jul-80 12:00:02
+COMMANDS
&Command
&Command format
&format
The general form of a command line is:-

     CommandVerb {command parameter} {stream definition}

If no stream definition is required the rest of the command line may be used to
specify the parameter by using the form:

     CommandVerb-{command parameter}

Examples:      E file1/file2
               COPY file2/LP:file
               SET TIME=10
               SET-stack=32,password=FRED

The way in which the command line is interpreted may be controled
by options set in the object file corresponding to the command.

See also:   Help Streams            Help Option             Help ?
            Help Stream Definition  Help Command parameter
+Creating files
&Create
&Creation
&new files
Files are created automatically when they are specified as outputs for programs.
Commonly files are created using either the COPY program or the editor.
See also:   Help Copy   Help Files
            Help Edit   Help Filenames
+EDIT
&Editing
&Editing files
&E
&ECCE
The Edinburgh Compatible Context Editor, ECCE, is called using a command of
the general form:     E     input,input2/output
where:   input:   is the primary or only input stream (default N:).
         input2:  is an optional secondary input (defaults to input).
         output:  the file for the edited output (defaults to input).
E.g.     e    fred            modify existing file called fred
         e    fred/jim        modify fred - output into jim
         e    /fred           create a new file fred
         e    tom,dick/harry  produce harry from pieces of tom & dick
         e    fred/n:         examine FRED without being able to modify it.
For full information on ECCE see separate documentation.
Help about individual Ecce commands may be obtained by typing:
      Help E_command-letter         e.g.  Help E_M
Ecce commands are:  B   C   C-  D   E   E-  F   G   I   J   K
                    L   M   M-  P   R   S   T   U   V   X   Y   Z
                    %C  %F  %L  %M  %N  %Q  %S  %U  %X  %Y  %Z
                    ,   *   0   ?   ()  \
+E_B
Editor command BREAK: B breaks the current line at the file pointer.
+E_C
Editor command CASE SHIFT: C Moves right and inverts the case of letters.
+E_C-
Editor command CASE SHIFT BACK: C- Moves left and inverts the case of letters.
+E_D
Editor command DELETE: D/text/ deletes the next occurrance of text on the
                               current line.
+E_E
Editor command ERASE: E erases the character to the right of the pointer.
+E_E-
Editor command ERASE BACK: E- erases the character to the left of the pointer.
+E_F
Editor command FIND: F/text/ locates the next occurrance of text.
+E_G
Editor command GET: G inserts the next complete line typed at the console
                      in front of the current line.  G* to input multiple lines
                      terminated by a colon.
                    Failure Condition: The line starts with a colon (:).
+E_I
Editor command INSERT: I/text/ inserts the text to the left of the pointer.
+E_J
Editor command JOIN: J joins the next line onto the end of the current line.
+E_K
Editor command KILL: K deletes the current line.
+E_L
Editor command LEFT SHIFT: L moves the pointer left one character.
+E_M
Editor command MOVE: M  moves the pointer is moved the the start of the
                        next line.
+E_M-
Editor command MOVE BACK: M- moves the pointer to the start of the
                             previous line.
+E_P
Editor command PRINT: P prints the current line on the console.
                        When repeated (e.g. P4) a MOVE is performed before the
                        second and subsequent printings.
+E_R
Editor command RIGHT SHIFT: R moves the pointer right one character.
+E_S
Editor command SUBSTITUTE: S/text/ substitutes text for the text string last
                                   located using F, V, or U.
+E_T
Editor command TRAVERSE: T/text/ moves the pointer past the next occurrance
                                 of text.
+E_U
Editor command UNCOVER: U/text/ deletes characters up to but not including
                                the next occurrance of text.
+E_V
Editor command VERIFY: V/text/ does nothing.
                       Failure condition: the pointer is not immediately to the
                                          left of the given text.
+E_X
&E_Y
&E_Z
User-defined editor command: X,Y and Z  replaced by the string previously
 specified by an editor command %X=.......,
                                %Y=.......,
                             or %Z=.......
+E_%C
Editor command CLOSE: %C terminates the editing session and causes the
                         updated output file to be generated.
+E_%F
Editor command FULL MONITORING: %F enables full command monitoring.
+E_%L
Editor command LOWER CASE: %L causes subsequent text locating commands to
                              distinguish between upper and lower case letters.
+E_%Q
Editor command QUIET: %Q turns off command monitoring.
+E_%S
Editor command SWITCH INPUTS: %S switches between primary and secondary input.
+E_%X
&E_%Y
&E_%Z
Editor macro definition commands: %X, %Y and %Z are used to specify strings
                                  to be used whenever X, Y, or Z are used
                                  as commands. E,g, %X=f/jim/s/bert/
+E_()
&E_(
&E_)
Editor brackets: A sequence of editor commands in brackets is treated as
                 a single command for the interpretation of failure conditions
                 of commands within the brackets.
+E_,
Editor comma: A comma separates alternative command sequences.
+E_*
&E_0
Editor indefinite repetition: A repetition count of * or 0 causes the
                              command to be repeated until it fails.
+E_\
Editor failure inversion: \ after a command produces a new command which
                           has the same effect as the original command except
                          that the new command fails if the original
                          command would have succeeded.
+E_?
Editor ignore failure: Any failure condition caused by the previous
                       command is ignored.
+COMPARE
&Comparing files
&File comparison
&Differences
&changes

This command causes the contents of the two text files specified as  inputs to
be compared and any discrepancies to be noted on the output stream.
   COMPARE file.new,file.old
   Compare file.new,file.old/lp:differs
+Compilation
&Compilers
&compiling
&compiling programs
&compiling programmes
Source programs may be compiled using a general command of the form:
   Compiler(parameters) Source/Object,Listing
where 'compiler' stands for one of the supported compilers.
The currently supported compilers are:
      Imp      - The IMP77 compiler
      Fortran  - The Fortran77 compiler (pre-release only)
      Pascal   - The Pascal compiler    (pre-release only)

See also:   Help Imp
            Help Fortran
            Help Pascal
            Help Compilation parameters
            Help Run
+IMP
The IMP compiler is called using a command of the form:
            IMP(compilation parameters)  source/object,listing
The executable object file is given the same name as the source file but with
the extension .EXE unless explicitly specified otherwise.
If the source file specifed does not exist and has no extension, .IMP is
appended then that file is tried.
+Compilation parameters
&Compilation parameter
&Compiler parameters
&Compiler parameter
&compiler options
&Compiler option
&Compilation options
The optional parameter to commands which invoke the standard compilers
comprises a list of options.
Three basic compilation options specify an initial state which may be modified
by further options - the order is thus significant.
   Initial states are defined by:
      DEFAULT:   include all checking code and full diagnostic data tables
      OPT:       remove all checking code and reduce size of diagnostic tables
      TRUSTED:   as OPT but diagnostic tables completely removed
   Modifiers are:                        (can be inverted by prefix NO)
      ASSIGN:    check for use of unassigned variables
      ARRAY:     check for array subscripts out-of-bounds
      CAPACITY:  check for truncation when storing strings, shorts, bytes
      BRIEF:     generate a summary listing with only procedure headings
   For example:    IMP(ARRAY,NOASSIGN,BRIEF)   pgm1/,t:
+Fortran77
This command is not generally available yet.
+Pascal
This command is not generally available yet.
+run
&running programs
&running programmes
&execute
&executing programmes
&executing programs
&do
Programs are run by giving a command of the form:
      PROG ...............
which causes the file "PROG.EXE" to be loaded and run.
The interpretation of the remainder for the line (.......) is
dependent on the options set in the object file (PROG.EXE);
By default the interpretation is the the line is either of the form:-      
             (parameter) <stream definition>
 or:-        <stream definition>
         or:-        -parameter
The parameter (or the null string) is made available to the program and the
required streams are set up.
Input stream 1 and output stream 1 are selected before the program is entered.
See also:   Help Streams     Help Set
            Help Option      Help Files
+STOP
&Stopping
&logging off
&finishing
&QUIT
&quitting
&BYE
The command STOP stops the process and logs the user off.
All temporary and volatile files are deleted.
However, if this command is given from within a command file,
see HELP COMMAND FILE, the effect is simply to terminate the execution of that
file. Subsequent commands are taken from the user's terminal.
+FILES
&Files
&DIRECTORY
&index
The format of the FILES command is:
      FILES            - for a listing of the names of all of your own files
      FILES fred:      - for a listing of another user's files.

The command produces the listing in alphabetical order in several columns across
the page. The output produced may be altered (with both of the above forms), by
appending a '!' or '?' to the command, as shown below:
   FILES!  or  FILES fred: !  - An extended listing is produced, one file
                                per line, with additional information.
   FILES?  or  FILES jim: ?   - A '2-D' listing: filenames vertically,
                                with extensions horizontally.
A star (*) may be used as a wild-card to select the owner, filename or
extension for all the files which match the rest of the parameter.
E.g. Files *.imp  will list the names of all of the files in the current
directory with the extension .imp;  Files  *:RULES.*  will list the names of all
the files in the whole file system with filename RULES and any extension.

See also:      Help Fileinfo      Help Filenames    Help Temporary files
+FILEINFO
A FILE is an ordered collection of data bytes (8 bit quantities).
The interpretation of these bytes is totally dependant on the program
using the file; the system imposes no restrictions on the contents of files.
See also:      Help Creating files      Help Editing
               Help Delete              Help Rename
               Help Files               Help Dump
               Help Filenames           Help Directory
+MAIL
&Messages
&MESSAGE
Text messages may be sent between users.  (See HELP TELL). If a message is
received while a user is logged on, the line "***ACOUNT: mail from ???" will be
displayed on the recipient's console. (Where "???" is the sender's username).
   Messages sent to users when they are not logged on are queued up. When the
user next logs on a the message "You have new mail" will be displayed on the
console.
   Mail sent at any time may be read by giving the command MAIL. The program
steps through all pending messages.  Once a message has been read it may be
deleted.  If it is not deleted it will continue to appear when the MAIL program
is run in future.
   Two variants of the MAIL command are provided.

MAIL?      -   This simply displays the number of queued messages
MAIL!      -   This shows when and from whom any pending messages were sent.

+TELL
&SEND
&NOTIFY
The command TELL may be used to send messages to other users.
            Command: TELL username      e.g.  TELL ALAN  or  TELL THU5
The user is then invited to type a message in on the console.  No prompt is
issued for the lines of the message.  When the entire message has been typed
the program is stopped by typing Ctrl+D.

To mark a message as being about a particular subject, use:
            Command: TELL(subject) username   e.g. TELL(bug report) FRED

To send files to other users, the full form of the TELL command is:
            Command: TELL(subject) file / username
      e.g.  Command: tell(compiler bug) testprog / IMPD
        or  Command: tell /fred:   {file defaults to T:, the user's console,
                                    colons in usernames are optional}
For very short messages consisting only of a 'subject' line that the user
wishes broadcast immediately to the recipient's console rather than being
queued as normal mail, use:
   Command: TELL(up to 19 chars) username!  e.g. TELL(coffee time?) fred!
+FILENAME
&Filenames
&file
&NAME
In general filenames take the form:      UNIT_OWNER:FILE.EXT
where:  UNIT    is the name of the disc unit on which the file resides
        OWNER   is the name of the owning process
        FILE    is the file name, which comprises a letter or a dollar
                optionally followed by up to seven letters or digits.
        EXT     is an optional extension of up to 3 letters or digits.

Within filenames lower case letters are treated as upper case. If the UNIT is
not specified all available units are searched until the specified OWNER is
discovered. If the OWNER is not specified the current user is assumed. On
creation the system marks files as being volatile by following the name with a
hash(#). Only when the file is closed will the file be renamed properly and any
old version deleted. Filenames starting with a dollar are considered temporary.
Temporary and volatile files are deleted when the process logs off, or the
command PURGE is given.
Examples of filenames:          DATA                      NEWS.TXT
                                PETER:prog.IMP            SYSTEM:NEWS
                                arch_system:help.txt      ARCH_PETER:VERSION1
                                $program.tst
+Ctrl
&Ctrl+
&Control
&Control characters
&Control Character
The notation  Ctrl+A  is used to specify characters generated at the terminal
by typing the letter specified (in this case A) while holding down the
CONTROL shift key (commonly marked CTRL).
E.g. Ctrl+X is generated by holding down CTRL and typing X.
+rename
&newname
&change
   The command RENAME may be used to change the name of a file.
The form of the command is:   RENAME oldname/newname
The command will fail with an error message if file NEWNAME already exists.
Wildcards may be used: 
   Command: rename *.imp/*.old           All .IMP files become .OLD files
   Command: rename xxx.imp/yyy.*         XXX.IMP renamed YYY.IMP
+CONSOLE
&Keyboard
&console conventions
&TT
&T
&TTY
&input
&terminal
Information about the special characters which are used to control the operation
of interactive terminals may be obtained by giving the command 
HELP special-character, where 'special-character' is one of the following
mnemonics:  Backspace     BS           CAN         Cancel
            CR            Ctrl+D       Ctrl+E      Ctrl+G
            Ctrl+N        Ctrl+O       Ctrl+P      Ctrl+Q
            Ctrl+R        Ctrl+S       Ctrl+T      Ctrl+X
            DC1           DC2          DC3         DC4
            DEL           DLE          ESC         Escape
            LF            Line feed    Return      SI
            SO            TAB
+Copy
&copying files
&C
&transfer
The command COPY may be used to copy any input stream to any output stream. 
Data from a second input stream, if specified, will be concatenated onto the end
of the output stream.
The command takes the form:
      COPY input1,input2/output

The files take defaults as follows:
              input1 = T:       the user's terminal
              input2 = N:       the null file
              output = T:       the user's terminal

Examples:    Copy file1/file2
             Copy heading,letter/final
             Copy t:/newfile

+Be
&become
&change hats
The system allows a user to pretend to be logged on as a different user. This
is useful if a lot of work is to be done in a short period on another user's
files.  The command:  BECOME Fred  will prompt you for Fred's  password (which
is not echoed).  Subsequently all unqualified filenames refer to files in
FRED's directory.  Your own files may be referred to by using the "USER:file"
notation.   To remind you of the changed state of the process, the subsystem
command prompt becomes the appropriate username.  In the example, the prompt
would change to "Fred:".  The STATE command will indicate the directory
currently in use at any time. 
The command:  BECOME  with no username parameter specified will return the
process to its 'home' directory.  The command prompt is restored to its
original value.
The form:  BECOME user,pass  may be used for brevity. 

+line printer
&lp:
&lp
&printer
Any output files specified as having the owner LP: will be offered to the
printer spooler when the file is closed.
e.g.       COPY FRED.IMP/LP:OUTPUT.XXX
will send a copy of the file "FRED.IMP" to the printer and label it
           "OUTPUT.XXX".
If no name is required on the output the form "LP:" may be used.
      e.g. COPY FRED.IMP/LP:

A file may be sent to the printer without copying (resulting in the file being
deleted) by offering the file to the printer using the command OFFER.
 e.g.      OFFER FRED.IMP/LP:OUTPUT.XXX
+paper tape punch
&pp:
&pp
&punch
&paper punch
&paper tape
Files may be sent to the paper tape punch in a manner analogous to that from
sending files to the printer; see HELP LP.
   e.g.   COPY FILE/PP:FILE
          OFFER TAPE.TMP/PP:OUT.ABC
+stream
&Streams
&environment
&Logical units
The environment for a program may be specified in the command which invokes the
program. This is done using a stream specification of the form:
   INPUT1,INPUT2,INPUT3/OUTPUT1,OUTPUT2,OUTPUT3
where INPUTx defines input stream 'x' and OUTPUTx defines output stream 'x'.
If any of the streams is not specified the default stream assignment is taken.
The defaults are:  T:, Null:, Null: / T:, Null:, Null: 
+PASSWORD
&PASS
The user's password may be changed by a command of the form:
      SET PASSWORD=<new password>
<new password> is any sequence of up to 6 letters or digits starting with a
letter.
   e.g.   SET PASSWORD=SECRET
+delete
&destroy
&remove
&del
&purge
&kill
&deleting files
&destroying files
&removing files
The command:      DELETE <file name list>
where <file name list> is a list of file names separated by commas, can be used
to delete unwanted files. If the command is given as DELETE *, a prompt is
given for every file in the owner's index. A reply of YES causes the file to be
deleted, any other reply leaves the file alone.
The command PURGE may be used to delete temporary and volatile files.
+null
&Null:
&n:
&n
&null stream
&null file
&null input
&null output
&Drain
&Sink
The null file is represented by N: or Null:. On input it immediately signals
end-of-file, and any output sent to it is discarded.
+ESC
&Escape
&BEL
&Ctrl+G
ESC and BEL (Ctrl+G) are equivalent.  Both signal to the system that the user
wants to interrupt the currently executing program, either to halt it or to
convey some information to it asynchronously.  The system responds to ESC by
prompting "Int:" at the start of a new line.  See "Help int" for details of
the valid replies to this prompt.  (The normal reply is "." full stop followed
by carriage return, which aborts the currently executing program).
+interrupt
&Interrupts
&int
&Break
The replies to the prompt Int: (see HELP ESC) are normally made available to
a process in the external string variable Console Int.
However several of the replies are reserved  for use  by the system. These are:
      Int:.         (Int full stop)
                    Terminates the running program and returns the process to
                    command level.
      Int:?         (Int question mark)
                    Terminates the running program and invokes the run-time
                    monitor to produce diagnostics (if they are available).
      Int:!         (Int exclamation mark) 
                    For convenience this interrupt may be generated by striking
                    the escape key (<esc>) twice in which case no <return> is
                    necessary. It has the normal significance of any other
                    interrupt, except that it is used in the editor to force the
                    command currently being executed to fail, and hence request
                    another command.
+option
&Options
&command interpretation
The command OPTION may be used to modify the interpretation of the command line
associated with the execution of an object file.
The command takes the form:  OPTION(<option list>) FILE
where FILE is the name of an EXE file (i.e. .EXE assumed).
The current options are:

     Decode              Open              Upper          Spaces 
   NoDecode            NoOpen            NoUpper        NoSpaces
     Stack=              Time=

See also:  Help Option_Decode         Help Option_Open
           Help Option_Upper          Help Option_Spaces
           Help Option_Stack=         Help Option_Time=
+Option_Upper
&Option_NoUpper
The UPPER option causes all lower-case letters in the command parameter
to be converted to their upper-case equivalents.
NOUPPER causes letters to be left as typed.
+Option_Spaces
&Option_nospaces
The NOSPACES option causes all spaces to be removed from the command parameter.
SPACES causes the spaces to be retained.
+Option_Decode
&Option_nodecode
DECODE specifies that the command line is to be interpreted by the usual syntax
rules.
NODECODE specifies that the remainder of the command line is to be passed to the
program as a parameter.
+Option_Open
&Option_noopen
OPEN specifies that the files in the stream definition part of the command are
to be opened before the program is entered.
NOOPEN results in the stream definition part being decoded but the files
will not be opened before the program is entered.
The OPEN option is ignored if NODECODE is selected.
+Option_Stack=
&Option_Stack
The stack option is used to control the size of workspace made available
to a command.
If NN is positive it specifies the minimum size of stack (work area) required by
the program. If the value specified by a previous SET-STACK= command is greater,
that value will be used.
If NN is negative its absolute value represents the exact size of stack
required, regardless of the value defined by a SET-STACK= command.
NN is specified in Kilobytes.
+Option_Time=
&Option_Time
The Time option is used to control the total execution time allowed for the
command. NN specifies the time limit (in seconds) to be imposed on the program.
If NN is negative its absolute value represents the time limit in seconds
which overrides any SET TIME= command currently in effect.
If NN is positive it specifies a minimum time limit which will be extended to
the current value of SET TIME= if necessary.
+SET
&Prompts
&prompt
&cpulimit
&cpu
&stack
&width
&time
&space
&timelimit
The command SET may be used to set various system parameters. The form
of the command is:
          SET <value list>
where <value list> is a list of value settings separated by commas.
The current parameters are:
   Time=         Stack=    Password=    Width=   Errorfile=
   Timelimit=    TAB=      Tabs         Quick    Dump
   Monitor       Verify    Prompt=

See Also:   Help Set_Time      Help Set_Stack      Help Set_Password
            Help Set_Width     Help Set_Tab        Help Set_Tabs
            Help Set_Quick     Help Set_Dump       Help Set_Errorfile
            Help Set_Monitor   Help Set_Verify     Help Set_Prompt
+Set_Prompt
The command: Set Prompt=....
causes the system to use the string "..." as the prompt it issues when
asking for a command line from a terminal.  (The default prompt is
"Command:").  The command "BE" also changes the command prompt, see
Help Be
+Set_Quick
&Set_Noquick
&Quick
&Noquick
The command: Set Quick causes subsequent external references to be
satisfied by examining the standard subsystem first, with the
files in the library list being examined last.
The command: Set NoQuick causes the library list to be examined first,
with the standard subsystem being searched last.
Note that in general the NoQuick option will slow down the loading
of most system-provided commands and programs.
See also:   Help Lib
+Set_Dump
The command: Set Dump   enables a dump of register contents and the code area
about the failing instruction on a contingency. This facility is usually only
of interrest to fairly experienced programmers. 
The command: Set NoDump disables the dump.
+Set_Monitor
The command: Set Monitor  causes each command execution to be followed by a
report of the time of day and the processor time used by the last command (or
since the previous Set NoDump command).
The command: Set NoMonitor  disables the facility.
+Set_Errorfile
&Errorfile
&Errorfile=
&SET_Errorfile=
The command: Set Errorfile=filename  causes subsequent diagnostic output to be
sent to the nominated file. A message is sent to the terminal whenever such
output is generated.
Giving a null filename (i.e. SET ERRORFILE= ) causes diagnostic output
to be sent to the terminal.  This is the default case.
+Set_Verify
The command: Set Verify  causes command lines to be echoed onto the report
stream after being expanded (for aliases etc.). This is useful when command
files are being obeyed.
The command: Set NoVerify inhibits the echoing. Note that for interactive users
Set NoVerify is the default while for Batch jobs Set Verify is the Default.
+Set_Time
&Set_Time=
&Set_Timelimit=
&Set_Timelimit
Set Timelimit=nnn  sets the program execution time limit to nnn seconds.
                   (default=30 seconds).
                   TIMELIMIT may be abbreviated to TIME.
This setting may be overridden for any particular command by use of
the Option(TIME=...)  command.
The command SET TIME=? will cause the current value of the time limit
to be output.

See also:   Help Option      Help Option_Time=
+set_Stack
&Set_Stack=
Set STACK=nn       sets the stack size to nnK bytes (default=60K bytes).
This setting may be overridden for any particular command by use of the
Option(STACK=...) command.
The command SET STACK=? will cause the current value of the stack size
to be output.

See also:   help Option      help Option_Stack=
+Set_Password
&Set_Pass
Set PASSWORD=pppppp    makes "pppppp" the user's password.
+Set_Width
&Set_Width=
Set WIDTH=nnn          sets the terminal output line limit to nnn characters
                       (default=72).
Lines longer than this will be broken on output after each nnn characters.
Set Width=0   inhibits any such extra line-breaks in terminal output.
+Set_Tab
Set TAB=a+b+c...       Defines up to 10 tab stops incrementally.
                       I.e. the first tab stop is at column a,
                            the second is at column a+b,  etc.
Initially the tab stops are set by:  Set TAB=3+3+3+3+3+3+3+3+3+3
The interpretation of TAB on input is furthur controlled by the
SET TABS and SET NOTABS commands.

See also:   Help Set      Help Set_Tabs
+Set_Tabs
&Set_Tab
&Set_NoTab
&Set_NoTabs
Set TABS               Enables tab stops. On input from the keyboard
                       Tab will be converted into as many spaces (at least one)
                       as necessary to move to the next tab stop as defined
                       by SET Tab=....
                       Once the 10'th tab stop has been reached each TAB will
                       be converted into 3 spaces.
Set NOTABS             Disables tab stops. On input, the TAB character
                       will be replaced by three spaces.

See also:   Help Set      Help Set_Tab
+topic
The parameter to help should be the name of a command or a particular topic for
which information is required.
+PERMIT
&Permissions
&permission
&access
The command: PERMIT FILE=<permissions> may be used to alter the accessibility of
the specified file. Each user of the system has a set of access rights given by
the system manager; the rights are denoted by the letters A-H. Access to other
users' files is only permitted if that file has been given any permission
corresponding to the rights of the requesting user. In order to prevent
inadvertent destruction of files, the user must give files the permission D
before they may be deleted. Access to directories may be given by giving
DIRECTORY in place of a file name.  E.g.
      PERMIT DATA.1=ABC
      PERMIT DATA.2=D
      PERMIT DIRECTORY=G
The commands STATE, FILES, and ANALYSE may be used to discover the current
settings of access rights and directory and file permissions.

See also:   Help Files      Help Analyse      Help State
+OFFER
&SEND
&GIVE
&Spooling
A file may be sent to a queue for future processing by giving a command
of the form:     OFFER FILE/QUEUE:NEWNAME
The queues which are currently available are:
                 LP:       - the line-printer queue.
                 PP:       - the paper-tape punch queue.
                 BATCH:    - the batch (background) job queue.

The file will be destroyed when the queue server takes the file.

For example:   OFFER BOOK.TXT/LP:BOOK  sends the file BOOK.TXT to
                                       the line-printer.
+OS32MT
&OS-32MT
&OS32-MT
&EMULATE
&EMULATOR
&FORTRAN
&BASIC
 The command OS32MT may be used to enter the OS-32MT emulator.   The commands
so made available are:
   BASIC
   CAL
   COBOL   (not yet implemented)
   FORTGO  (compile and go Fortran 5)
   FORTRAN (compile and assemble FORTRAN 5)
   LINK    (build store image 'task')
   TET     (gives direct access to TET)
   RUN
   SET     (modify emulator parameters e.g. time, store, i/o streams etc)
   STOP    (return to standard subsystem)
This utility can also run off-line work prefixed by //OS32 instead of the
standard //JOB card.
For further details:  COPY OS32:DOCUMENT.
+TAB
Tab stops may be set using the command: SET TAB=a+b+c+d......
where a, b, c, d.... are increments in spaces from the previous tab stop
(initially 0).
 e.g. SET TAB=6+4+4  sets tabs at columns 6, 10 and 14.
There are 10 tab stops in all; any not specified are filled in
increments of 3. Once the final tab stop has been passed the tab key
acts as three spaces.
 Before the tab settings may be used the feature must be enabled by the
command: SET TABS. The feature is disabled by the command: SET NOTABS
after which the TAB character will cause three spaces to be input  (the
default condition).
+list
&listing
A line-numbered listing of a source file may be produced by
giving the command:   LIST filename
By default the listing is sent to the printer.
In the near future the command will accept a parameter
containing a list of directives:-
   lines=????       to set the number of lines on a page
   width=????       to set the number of characters on a line
   columns=???      to set the number of columns to be printed.

The default settings are (lines=60,width=120, columns=1)
+CLEAN
The CLEAN command causes the system to prompt the user with the name of
each file in the users' directory.  A null reply (just typing RETURN)
moves on to the next file.  A set of commands are available within CLEAN
to delete, rename etc. the current file. To start the program, just
type:
                  CLEAN
   Information about the commands available is available within the
program, by typing HELP in reponse to its prompt.
   If a user has access to another's directory, it may be CLEANed using
the following form of the command:
                  CLEAN   (username )
   After CLEANing, the user is automatically returned to his home
directory.
   Appending a '!' to either form of command will cause CLEAN to output
extra information about the physical placement of files on the disc.
Examples:         CLEAN                  clean out home directory
                  CLEAN (EXTN_ENGINR)    clean another users' directory
                  CLEAN!                 clean with extra info
                  CLEAN (FRED)!          poke elsewhere
+Link
&Linking
&tet
&tasks
Mouses supports dynamic linking, that is references to an external
subroutine are only satisfied when it is called for the first time.
At this point the loader automatically searches a list of object files
defined by the LIB command for the procedure.  (If it is not found, an
event is signalled).
See also: Help Lib
          Help Compiling
          Help Run
          Help Events
+Library
&lib
&libraries
&external routines
&externals
&External
The LIB command is used to maintain a list of up to seven program files
containing external extry points. When the loader receives a request for
an external object this list is searched in order. If the entry is not
found the current subsystem procedures are checked.
The command has three forms:
   1:   Lib .none              - this clears the list
   2:   Lib                    - this prints the current list of files
   3:   Lib item-list          - this inserts or removes items.

Item-list is a list of items separated by commas, where each item is:
    File   in which case FILE.EXE is added to the list,
or -File   in which case FILE.EXE is removed from the list (if possible)

Whenever an item is added to the list it is added at the end, and any
duplicates are removed. In this way the library list may be reordered.

   E.G.   Lib Maths,Hypers,-testlib
+Let
&Alias
&assign
&Abbreviation
&Abbreviations
Abbreviations for commands may be defined using the LET command.
e.g.      Let F=Files
Once an abbreviation has been defined its occurrence in the command-verb
position of a command line results in the expansion being used.
e.g. Given the definition of F above, the command line:  F System:
will result in the execution of the command: Files System:
Abbreviations may be redefined at any time, and may be removed
by assigning a null definition e.g.  Let F=
Note that the definition is never expanded furthur so that the following
sequence will swop the definitions of the commands A and B:
   Let A=B
   Let B=A
The form:   LET Abbr   will display the expansion of the abbreviation Abbr
while:      LET        will display the expansions of all abbreviations.
An abbreviation embedded in a command line is expanded if prefixed by '@'.
e.g. Command: let L=$longfile
     Command: copy @L/Lp:@L  =>  copy $longfile/lp:$longfile
+Command Files
&Command File
&Css
&Css Files
&Css File
A file of commands may be executed by giving the file the extension .COM
and giving the filename (without the .COM) as a command verb.
E.g. Assume a file SHOW.COM contains:
Files
Lib
Let
The command: SHOW will cause the three commands FILES, LIB and LET to be
executed in order.
A command file may be given parameters: a list of strings separated by
commas. Within the command file each string may be referred to by '@n'
where 'n' is the position in the list of the required parameter. E.g.  
SHOW User, P   will result in @1 being the four characters User, and @2
being the character P. By convention @0 is always replaced by the
nesting level of command files, i.e. the first command file has @0 as 1,
any command file invoked from within the first will have @0 as 2, and so
on. The order of execution of the commands in a command file may be
controlled by special directives. See Help Sequence Control
+Sequence Control
Looping and branching is available within command files,  see:

   Help $IF      Help $ELSE      Help $FINISH      Help $EXIT
   Help $UNLESS  Help $LABEL     Help $GOTO        Help comments

+comments
Comment lines prefixed with an exclamation mark "!" are permitted within
command files.  They are ignored.
+$IF
Inside a command file the $IF command may be used to select one of two
alternative command sequences. If the condition following $IF is
satisfied the group of statements up to the matching $ELSE or $FINISH is
executed. If $ELSE is found the statements following it up to the
matching $FINISH will be executed.
 If the condition is not satisfied the statements up to the matching
$ELSE or $FINISH are skipped and then statements after an $ELSE are
executed.
 There are two forms of condition:
   1:   EXISTS Filename    - this is satisfied if the file exists.
   2:   string .EQ. string - this is satisfied if the two strings
                             are identical ignoring case dictinctions.

E.g.   $IF exists Data.txt
       $IF @1 .EQ. do it all
+$UNLESS
This is the same as $IF except that the condition is inverted.
+$ELSE
See $IF
+$FINISH
See $IF
+$EXIT
This causes the command file to terminate immediately.
+$LABEL
$LABEL tag   causes the character string 'tag' to identify the current
             point in the command file.
See also HELP $GOTO
Jumping to a label outwith the current command file is not allowed.
Label tags are shared between all command files and nesting levels.  To
generate unique labels within recursive command files add '@0' as a suffix
to the label.  This is expanded as the current nesting level and will make
the labels unique.

Example:     $Label top
                Printstring Hello
                !In an infinite loop
             $goto top
+$GOTO
$GOTO tag    causes control to be transferred to the point in the command
             file identified by the character string 'tag'.
See also HELP $LABEL
+Events
&Errors
&Event
&Subsystem events
The following events are signalled by the subsystem:
Event   Subevent  Extra
  3         1       Sym     Symbol Sym in numeric data (from READ)
  5         5       Type    Illegal type of parameter to READ
  8         8               Load fails (cannot find an external subroutine)
  9         1               Input Ended  (end of file encountered)
  9         2       St      Illegal stream St
  9         3       St      Illegal Direct Access Channel
  9         4               Invalid filename in OPEN
  9        10       N       Director Error N
 10         1               Pack fails -- illegal filename
 10         2               Rename fails
 10         3               Create fails
 10         4               Entry to file of externals
+Dump
&Filedump
The command DUMP may be used to examine the contents of files.
The general form of the command is:   DUMP(parameters) Filename/Output
Where 'parameters' is a list of items of the form:
   HEX            - the dump is wanted in hexadecimal
   OCTAL          - the dump is wanted in octal
   ASCII          - the dump is wanted interpreted as being ASCII characters
   EBCDIC         - the dump is wanted interpreted as being EBCDIC characters
   PAGED          - the output is to be paginated
   PAGE=n         - each output page contains 'n' lines
   WIDTH=n        - each output line can hold 'n' characters
   DISC=dev       - dev specifies a unit which is to be dumped
   n..m           - dump blocks 'n' to 'm' inclusive
   ..m            - dump blocks 0 to 'm' inclusive
   n..            - dump from block 'n'
   n              - dump block 'n'
If the command is followed by an exclamation mark, each line of the dump
will be followed by the interpretation of each byte as an ASCII character.
Similarly, following the command with a question mark will cause interpretation
of each halfword as a "packed" 3-character string.
For Example:   DUMP(HEX,1..5) Testfile
+God
&god almighty
&jesus
Please apply to deities directly, not via MOUSES.
+Love
&Sex
MOUSES, being of neutral gender, can offer no advice on this subject.
+Buses
What is this that roareth thus?
Can it be a Motor Bus?
Yes, the smell and hideous hum
Indicat Motorem Bum...
How shall wretches live like us
Cinci bis Motoribus
Domine, defende nos
Contra hos Motores Bos!
+SVCs
&SVC
&SVC list
This is a short summary of the parameters taken by and the general effect of
the supervisor calls (SVCs) supported by the MOUSES supervisor.
SVCs with numbers greater than 100 may only be executed by a privileged
process.

   1  - stop
   2  - prompt flags<p1> text<sp2>
   3  - console input
   4  - console output text<sp1>
   5  - locate process id<p1>
   6  - kill i/o
   7  - date & time  -> date<sp1> time<sp4>
   8  - create segment size<p2> seg<p3>
   9  - destroy segment n<p1>
  10  - load file
  11  - segment info seg<p1>
  12  - performance info
  13  - unpack date
  14  - get proc info proc<p1> -> powner<p1>,cputime<p2>, store<p3>,
                                  uptime<p6>
  15  - load file
  16  - poff   sact = reply wanted (0 = any)
  17  - pack   file<sp1> -> p1,p2,p3<owner>
  18  - unpack p1,p2,p3<owner> -> file<sp1>
  19  - info seconds<p1> users<p2> cpu<p3>
             date<p4> owner<p5> version<p6>
  20  - to director & wait
  21  - set time limit <p1> seconds from now
  22  - message to potter
  23  - wake after p1 .01 secs.
  24  - stack contingency vector<p1>
  25  - unstack contingency to<p1>
  26  - fire contingency weight<p1> at<p2>
  27  - resume from contingency vector<p1> repeat<p2>
  28  - info 2 users<p1> clevel<p2> console<p3> priv<p4>
  29  - set param<p1> value<p2>
  30  - validate addr<p1> size<p2>
  31  - detach process
  32  - protect segment<p1>
  33  - delete segs<p1>
  34  - pack date <sp1> -> <p1>
  35  - unpack time <p1> -> <sp1>
  36  - user message to account
  37  - priv
 101  - disc read discaddr<p1> storeaddr<p2> disc<p3> process<p4>
 102  - disc write     ""            ""       ""         ""
 103  - set swop disc
 104  - operator message
 105  - MT operation
 106  - read segment
 107  - write segment
 108  - disc status unit<p3>
 109  - start process console<p1> owner<p2> disc<p3>
                      pass<p4>file<p5> reason<p6>
 110  - get resident buffer
 111  - lp demon
 112  - pt demon
 113  - broadcast
 114  - get unit no
 115  - pon (no wait)
 116  - pon
 117  - read real <p1>
 118  - write real addr<p1> value<p2>
 119  - define potter
 120  - tell process<p1> text<p2>
 121  - inhibit service<p1>
 122  - uninhibit service<p1>
 123  - boot  dev<p1> restart<p2>
 124  - privilege process<p1> priv<p2>
 125  - hazard/protect dev<p1> prot<p2>
 126  - stop process<p1>
 127  - lk demon
 128  - define accountant
 129  - resume & time out
 130  - CR demon
 131  - SHUTDOWN process P1
 132  - claim terminal P1
+Yourself
Thank you.
+42
Tricky!
+Reincarnation
First, drop dead,
Then,  it's all up to you.
+$

 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          C!          4 }      怰         F2d            NWfS    X`QK xgQK fZJ_fZX!t^Z} }    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  (QT    :      :H  ayu  "Z    mfp  `EX!    qI    w@  %Qv        - < 8 U e  dQ@    p            xK   &/ek  (@    2d     ox    &A'             *Help is available on the following topics: 3Help ?     will give a list of the topics availableNo information about ?  Help:Help.dat            	
   94H  !34  1  0 !81 !5$$A> rB  @ !4B ";
C@ !$$A> r#$$A> rB  C
B$P#E  E  &Q'1"C  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n$A1    0#
#	QD   RD   ?&A'"3?1  &034C0  D   D   
C   g p 4ePi iPi ,XC0X8 \P7 ,0 P7 0V$aW  X ,PX ĠP 0Z \y  1	w * ,ATp L: ,3!4z XmW   $P ,W   H%AQMZ ,P !$`PmX!*W  ,$3P=#Ȱ PC  A
w p <\W   HW  ,$`AX P 0P 8$0P9 ,C "&1P9 ,cAP 4ӱ Ű +!3A"X9 ,U9 8B0W  ,y  >	W  p <$P 0$`AX1 P9 ,X 0Y ,B ^Z ,P 4kAfP 8( dA*B0X XA PJ  XY  Xa Pe  y A*#'X 4'P ,#X9 4&1P9 0C X $@PJ  XY  PE  C  Q	W  p L$P ,$0P9 4iPi @X İP <YPY DX  ĠP HVY[
ZPY 8XH X@ !!4$1P9 4XX \PW ,P PW 0XY @$aW  Xh \Zi <  P 0X9 ,0 
B0 ?!=X XŰ !#4y $P 4#
XI 4!7lW   <XY 0PY ,$aQi <%Q 8X9 <0 #6X 8#3C X 8!2#Qi @$0P9 <C VC  	w P (( ,ATp NPH `p P \$P$aW  $P X8 ,3C0&ȸ ,Ө ,
  P X !!5'Ҩ ,#$P X ,.A*!6AXx ( dATh  dW  X Ph LAX L#8XX PiA<C D' ,AT ,A   W   HW  ,W   HW  ,C z w P (p ,X Ax  X8 d< C zXX \$aAfW   X \&P |X ,X \P $aW   xXH \PH %QPX T#	&QPX TeA\XX TUX  :W   P haW   <" @            &6@SVC LISTG                 &6@SVCSS                     +6@TT                        &9TABI                      +*TABL                      &h(i,TABSL                     &h(i,
TABULATIONT               &h(i,TAPE BACKUP              &6$9&TAPE DUMPING             &6$9&
TAPE DUMPSP                      "         &         *         .         2 $       $ 6 *       * : 0       0 > 6       6 B <       < F B       B J H       H N N       N R T       T V Z       Z Z `       ` ^ f       f b l       l f r       r j x       x n ~       ~ r         v         z         ~                                                                                                  LL     NGT                &ޕREMOVEY         H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
&HELP
&Anything
&please
&me
The HELP command is used to obtain information about system features.
To select a particular topic give the command:  Help Topic
where 'Topic' is one or more words describing the subject of interrest, e.g.
               Help files
In certain cases more detailed information may be obtained by
following the command with an exclamation mark: e.g.  Help Files!
Information is available concerning:
   Commands         Compiling         Console conventions
   Copying files    Creating files    Deleting Files
   Editing files    Files             Running programs
   Stopping         Operator commands

A complete list of topics available may be obtained by typing:   Help ?

Note that typing line feed (LF) will cause output to continue if it has been
suspended after the screen has been filled.
+Ctrl+D
&EOT
&end of file
&end of input
The end of file condition can be signalled to a program reading from a terminal
by striking the Ctrl+D (EOT) key.  This is echoed by the system as "[]". 
+Ctrl+H
&Backspace
&rubout
&DEL
&erase
DEL and Ctrl+H (backspace) have identical effects.  The last character on the
current input line is erased.  Pressing DEL 'n' times erases the last 'n'
characters from the current line.  This is obvious on a VDU.  On hardcopy
devices the characters cannot be physically rubbed out, so the group of
characters being erased are echoed on the terminal (backwards as they are
deleted), enclosed between a pair of backslash "\" characters.
+Can
&Ctrl+X
This character causes the whole of the current line to be erased.  On fast
VDU terminals, the line is visibly erased.  On slower hardcopy terminals, a
'#' is printed, a carriage return/line feed sequence is output and the command
prompt is reissued.  (See also:  Set_erase)
+CR
&return
&newline
Striking the CR (carriage return, RET) key causes the current line to be
entered and processed by the system.  A carriage-return/linefeed is output
to put the cursor at the start of the next line.  An IMP program reading from
the console will read this as a single NEWLINE (LF) character,  Pascal and
FORTRAN programs see 'end of record' (EOLN).
+LF
&linefeed
&Ctrl+Q
&DC1
Linefeed and Ctrl+Q have identical properties.  Output to the terminal is
re-initiated after being suspended for one of the following reasons:

      o  End of page on VDU.   See:  Help Set_Page

      o  Output suspended manually by user pressing Ctrl+S.  See: Help Ctrl+S

      o  Output being discarded.   See:  Help Ctrl+T

+Ctrl+S
&DC3
&hold output
Striking the Ctrl+S key causes output to the terminal to be immediately
paused.  (Output is resumed by pressing linefeed, LF, or Ctrl+Q).
+Ctrl+R
&DC2
&retype
The current line being input by the user is retyped by the system.  This is
most useful on hardcopy terminals where a proliferation of '\' characters
echoed by DEL can obscure the meaning of the line.
+Ctrl+T
&DC4
This character causes the system to start THROWING AWAY terminal output.
Output is resumed either by pressing Ctrl+Q or Linefeed (LF), or when the 
running program stops to ask for input from the console.
+Ctrl+I
+TAB
+tabulation
+tabs
The system provides a 'tab stop' facility for user console input.  By default
pressing TAB (i.e. Ctrl+I) is equivalent to entering three space characters.
The user may alternatively set tab stops at particular columns,
see:   Help Set_Tabs
       Help Set_Tab
+Ctrl+E
&ENQ
Pressing ENQ (Ctrl+I) causes the system to display a short message indicating
the operation that is currently being performed in the form:

                  ***System: text

By default, "text" is the name of the program currently running or null if the
system is waiting for a command.  User programs and utilities (e.g. the IMP-77
compiler, the DISC utility etc) may set this string to indicate the operation
currently being performed.  E.g. the compiler indicates which pass it is 
performing.

There is no restriction on when ENQ may be used, during console output, while
the system is waiting for input or while there is no console activity.
+Ctrl+U
&NAK
The current line is erased as for CAN (Ctrl+X).  Additionally any lines which
have been typed ahead by the user and have not yet been processed by the system
are discarded.  NAK (Ctrl+U) echoes as '#', CR, LF.
+Ctrl+O
&SI
The console is shifted into the normal (default) mode, where upper and lower
case letters are distinct.  (Although all system programs treat upper and lower
case identically).  See also:  Help SO
+Ctrl+N
&SO
The console is shifted out of normal mode.  Henceforth, all lower case letters
typed will be echoed as the corresponding upper case character and any program
reading from the terminal will see the upper case character.  This effect may
be cancelled by striking the SI (Ctrl+O) key to shift back into normal mode.
+Ctrl+P
&DLE
&Binary input
To allow the input of any ASCII character to a program reading from the console
it must be possible to disable the standard interpretation of characters like
ESC and TAB.  Any character may be entered in thsi way by prefixing it with
DLE (Ctrl+P). 
Examples:      <dle> <esc>               - to enter the ESC character
               <dle> <dle> <dle> <dle>   - to enter two consecutive DLE chars.
               <dle> F <dle> <bel>       - to enter 'F' BEL.  (The <dle> before
                                           the 'F' is redundant since 'F' has
                                           no special significance.
               <dle> <eot>               - EOT normally causes end-of-file.
+Operator commands
&ops
The operator has access to several privileged commands:

   Catalog              - List usernames on a particular disc.
   State                - Gives status of system/discs/spoolers.
   Broadcast            - Send a short message text to all terminals.
   Close                - Prevent users from logging in.
   Shutdown             - Automatically close after broadcasting warnings.
   Open                 - Stop any pending shutdown, and allow user logins.
   Dateis               - Set the date and time counters used by the system.
   Protect              - Set software protection on a disc unit.
   Hazard               - Reset software protection on a disc unit.
   Load                 - Make a disc unit available to users.
   Unload               - Used before putting a disc offline.
   Pass                 - Set a global system password.
   Reprime              - All spooled files are revoked.
   Restart              - Reboot the system.

Type: Help 'command' for further information, e.g.  Help broadcast
See also:  Help utilites  Help disc units
+Catalog

The command:   CATALOG disc              
will generate a listing of the names of all users whose directories
reside on the specified disc.  'Disc' is either the name of a logical disc
unit, or a disc unit number "#n" in which case the analysis is of the disc
mounted on unit "n".  (See also:  Help disc units). 

Examples:      Command: catalog sys      what users are on the system disc?
               Command: catalog #1       Who is on the disc mounted on unit 1?
+Disc units
&discs
MOUSES accesses discs internally by 'logical disc unit number'.  More than one
logical disc may be mapped onto a single physical disc unit. (E.g. a 67MB drive
is normally partitioned into three logical discs). Usually, the operator will
refer to discs by name, but it is possible with most commands to quote the unit
number instead in the form "#n".  The correspondance between the numbers and
real disc drives varies from system to system.  For example:

   #1:  Cartridge disc C6:               #5:  67MB drive, first partition.
   #2:      "      "   C7:               #6:    "    "    second   "
   #3:      "      "   D6:               #7:    "    "    third    "
   #4:      "      "   D7:
+State
&Status
This command has several forms:
Command: state          - This form produces information about the user who
                          runs it (e.g. amount of CPU time used, username etc).
Command: state system   - This displays information about all active users.
Command: state discs    - This lists the names of the online discs.
Command: state discs!   - As above with extra information - free blocks etc.
Command: state discs?   - As for STATE DISCS, with disc description displayed.
Command: state queues   - Display a list of all spooled files.
+Broadcast
The command:   BROADCAST text
causes the message "text" to be displayed on all terminals in the form:

               ***OPER: text

Text longer than 23 characters will be truncated on the right.
+Close
The command:  CLOSE
will prevent users other than OPER logging in to the system.  Attempts to do so
will produce the "No user service" message.
See also:  Help open   Help shutdown
+Open
The command:  OPEN
allows users other than the operator to log in to the system.  The system is
normally opened automatically as part of the startup sequence.  It should
therefore only be necessary to use the OPEN command:

    o   After an explicit CLOSE

    o   If the normal startup sequence has been bypassed by logging in as OPER
        in the interval between system startup and the message "OPER starts"
        appearing on the system log.

OPEN also cancels the effect of any pending SHUTDOWN command.

See also:  Help close   Help shutdown
+Shutdown
&Shut
&Closedown
The command:   SHUTDOWN  nn
causes an orderly shutdown of the system in 'nn' minutes.
A warning message is sent to all terminals when the command is entered, and
after successively shorter intervals before the deadline.  The messages are
of the form:
               ***OPER: Close in nn minutes

When the deadline is reached, processing of the spooler queues is halted
and a final warning is issued:

               ***OPER: Closing down NOW!!

After a further minute of grace all logged on users except OPER are forcibly
logged off.
+Protect
&write protect
&prot
When the system starts up, all discs whose logical names start with "SYS" and
all hardware-protected discs are automatically software-protected. To software
write-protect a disc manually, use the command:

               PROTECT disc

'Disc' is either the logical name of the disc (e.g. Sys, User) or a unit number
'#n' (see Help disc units).  After execution of the command, users may no
longer create or alter files on the disc in question.  The disc need not be
hardware protected.  Note that if a disc is hardware protected but is NOT
software protected then attempts to write to the disc cannot be detected at the
user level, but will be reported on the logging device as disc errors. (The
attempted write will be retried until either the disc is made unprotected again
or the fifteenth retry fails, in which case the attemped operation is
abandoned).  Disc protection can be reset using the HAZARD command.
Examples:      Command: Protect SYS
               Command: protect #1

The protection status of the discs can be displayed with the STATE DISCS
command.  See also:  Help state  Help Hazard 
+Hazard
&unprotect
&deprotect
To remove any software write-protection on a disc, use the command:

               HAZARD  disc

'Disc' is either the logical name of a disc, or a disc unit number '#n'.
Hazarding a hardware-protected disc is not advised, since any user who then
attempts to write to the disc will not be trapped until the lowest level of the
system is reached, where the attempted write will be rejected by the hardware,
resulting in a series of up to fifteen retries before it fails). The PROTECT
command is used to set software protection.
Examples:      Command: hazard sys
               Command: hazard #5

The current protection status of the discs may be inspected by the STATE DISCS
command.  See also:  Help state  Help protect
+Load
&mark on
&mark
Not all discs physically online to the system are available to users.  To make
a disc available, the operator must LOAD it.  This is done automatically at
system startup for all discs online at the time.  Discs can be made
inaccessible by UNLOADing them (see 'help unload').  The form of command is:

               LOAD  disc

'Disc' is either the logical name of the disc to be loaded or a unit number of
the form '#n'.  The system will report the fact that the disc has been loaded
on the logging device.  If the name of the disc begins with "SYS", or the disc
device is hardware protected, the loaded disc will automatically be software
protected.  The command STATE DISCS (see "help state") will display a list of
the discs which are currently loaded.

Examples:      Command: load pak2
               Command: load #1
+Unload
&Mark off
To make a disc which is currently online inaccessible to user processes, use 
the command:   UNLOAD disc
where 'disc' is either the logical name of the disc to be unloaded or a disc
unit number '#n'.  (See "help disc units"). The command STATE DISCS (see "help
state") will display a list of the discs which are currently loaded.

Examples:      Command: unload arch
               Command: unload #5
+Pass
The command:   PASS ...
allows the operator to set a global system password.  The text string "..."
should be from one to six letters or digits.  After execution of this command
a user may log in to ANY user's account by quoting either its the correct
password, or the global password.  A user may also log in when the system is
closed (see 'help close') by quoting the system password.  If the command PASS
is entered on its own (with no "..." part) the global password is removed.

Examples:      Command: pass twit
               Command: pass xyz123
               Command: pass             {revoke global password}

Note: For security reasons this command should be used infrequently and with
      caution.
+Reprime
The command:   REPRIME
causes all files spooled to any queue (e.g. LP:, PP:, BATCH:) to be deleted.
The spoolers are reinitialised.  It should not normally be necessary to use
this command unless the queues become corrupt.
+Restart
&Reboot
&rebooting
&boot
&bootstrap
&booting
&reloading
The system can by booted either from the front panel with the 50-sequence
loader and the MOUSES bootstrap papertape/magtape or while the system is
running (e.g. to test new versions of the system).  To boot from disc 'xx'
from a running system, use the command:
                RESTART xx               (See also: Help disc units).
Examples:       RESTART #1
                Restart SYS
The system will go into an loop waiting for a valid system disc to be put
online on the nominated disc.
(See: Help 50-sequence  for details of front panel booting)
+50-Sequence
&50 sequence
To boot from the high speed paper tape reader or the magnetic tape unit, set up
the store locations using the front panel, then run from location X'50' after
clearing the PSW (press DTA ADR FN SEL on the front panel).

      Address  Contents   (both hexadecimal)
         50    D500
         52      CF
         54    4300
         56      80
         78    1399     {To boot from the high speed paper tape reader}
         78    85A1     {To boot from the default magnetic tape drive}
         7A    dd00     {'dd' is the cartridge disc address, e.g. C6}
         7C    ccss     {'cc': disc controller address, normally B6
                        {'ss': SELCH address, normally F0
         7E       0
+Dateis
&set date
&time
&date
The current date and time (as displayed by the STATE program, see: Help state)
are set using the operator command:

               DATEIS  date  

'Date' is of the form:   dd-mmm-yy    e.g.  15-Sep-81

      Or       DATEIS  date  time

'Time' has the form:     hh:mm        e.g.  13:10    (ten past one PM)
                 or:     hh:mm:ss     e.g.  10:11:30

Examples:      Command: dateis 25-Dec-81
               Command: DateIs 13-Jun-79 11:30
               Command: Dateis 13-Jul-80 12:00:02
+COMMANDS
&Command
&Command format
&format
The general form of a command line is:-

     CommandVerb {command parameter} {stream definition}

If no stream definition is required the rest of the command line may be used to
specify the parameter by using the form:

     CommandVerb-{command parameter}

Examples:      E file1/file2
               COPY file2/LP:file
               SET TIME=10
               SET-stack=32,password=FRED

The way in which the command line is interpreted may be controled
by options set in the object file corresponding to the command.

See also:   Help Streams            Help Option             Help ?
            Help Stream Definition  Help Command parameter
+Creating files
&Create
&Creation
&new files
Files are created automatically when they are specified as outputs for programs.
Commonly files are created using either the COPY program or the editor.
See also:   Help Copy   Help Files
            Help Edit   Help Filenames
+EDIT
&Editing
&Editing files
&E
&ECCE
The Edinburgh Compatible Context Editor, ECCE, is called using a command of
the general form:     E     input,input2/output
where:   input:   is the primary or only input stream (default N:).
         input2:  is an optional secondary input (defaults to input).
         output:  the file for the edited output (defaults to input).
E.g.     e    fred            modify existing file called fred
         e    fred/jim        modify fred - output into jim
         e    /fred           create a new file fred
         e    tom,dick/harry  produce harry from pieces of tom & dick
         e    fred/n:         examine FRED without being able to modify it.
For full information on ECCE see separate documentation.
Help about individual Ecce commands may be obtained by typing:
      Help E_command-letter         e.g.  Help E_M
Ecce commands are:  B   C   C-  D   E   E-  F   G   I   J   K
                    L   M   M-  P   R   S   T   U   V   X   Y   Z
                    %C  %F  %L  %M  %N  %Q  %S  %U  %X  %Y  %Z
                    ,   *   0   ?   ()  \
+E_B
Editor command BREAK: B breaks the current line at the file pointer.
+E_C
Editor command CASE SHIFT: C Moves right and inverts the case of letters.
+E_C-
Editor command CASE SHIFT BACK: C- Moves left and inverts the case of letters.
+E_D
Editor command DELETE: D/text/ deletes the next occurrance of text on the
                               current line.
+E_E
Editor command ERASE: E erases the character to the right of the pointer.
+E_E-
Editor command ERASE BACK: E- erases the character to the left of the pointer.
+E_F
Editor command FIND: F/text/ locates the next occurrance of text.
+E_G
Editor command GET: G inserts the next complete line typed at the console
                      in front of the current line.  G* to input multiple lines
                      terminated by a colon.
                    Failure Condition: The line starts with a colon (:).
+E_I
Editor command INSERT: I/text/ inserts the text to the left of the pointer.
+E_J
Editor command JOIN: J joins the next line onto the end of the current line.
+E_K
Editor command KILL: K deletes the current line.
+E_L
Editor command LEFT SHIFT: L moves the pointer left one character.
+E_M
Editor command MOVE: M  moves the pointer is moved the the start of the
                        next line.
+E_M-
Editor command MOVE BACK: M- moves the pointer to the start of the
                             previous line.
+E_P
Editor command PRINT: P prints the current line on the console.
                        When repeated (e.g. P4) a MOVE is performed before the
                        second and subsequent printings.
+E_R
Editor command RIGHT SHIFT: R moves the pointer right one character.
+E_S
Editor command SUBSTITUTE: S/text/ substitutes text for the text string last
                                   located using F, V, or U.
+E_T
Editor command TRAVERSE: T/text/ moves the pointer past the next occurrance
                                 of text.
+E_U
Editor command UNCOVER: U/text/ deletes characters up to but not including
                                the next occurrance of text.
+E_V
Editor command VERIFY: V/text/ does nothing.
                       Failure condition: the pointer is not immediately to the
                                          left of the given text.
+E_X
&E_Y
&E_Z
User-defined editor command: X,Y and Z  replaced by the string previously
 specified by an editor command %X=.......,
                                %Y=.......,
                             or %Z=.......
+E_%C
Editor command CLOSE: %C terminates the editing session and causes the
                         updated output file to be generated.
+E_%F
Editor command FULL MONITORING: %F enables full command monitoring.
+E_%L
Editor command LOWER CASE: %L causes subsequent text locating commands to
                              distinguish between upper and lower case letters.
+E_%Q
Editor command QUIET: %Q turns off command monitoring.
+E_%S
Editor command SWITCH INPUTS: %S switches between primary and secondary input.
+E_%X
&E_%Y
&E_%Z
Editor macro definition commands: %X, %Y and %Z are used to specify strings
                                  to be used whenever X, Y, or Z are used
                                  as commands. E,g, %X=f/jim/s/bert/
+E_()
&E_(
&E_)
Editor brackets: A sequence of editor commands in brackets is treated as
                 a single command for the interpretation of failure conditions
                 of commands within the brackets.
+E_,
Editor comma: A comma separates alternative command sequences.
+E_*
&E_0
Editor indefinite repetition: A repetition count of * or 0 causes the
                              command to be repeated until it fails.
+E_\
Editor failure inversion: \ after a command produces a new command which
                           has the same effect as the original command except
                          that the new command fails if the original
                          command would have succeeded.
+E_?
Editor ignore failure: Any failure condition caused by the previous
                       command is ignored.
+COMPARE
&Comparing files
&File comparison
&Differences
&changes

This command causes the contents of the two text files specified as  inputs to
be compared and any discrepancies to be noted on the output stream.
   COMPARE file.new,file.old
   Compare file.new,file.old/lp:differs
+Compilation
&Compilers
&compiling
&compiling programs
&compiling programmes
Source programs may be compiled using a general command of the form:
   Compiler(parameters) Source/Object,Listing
where 'compiler' stands for one of the supported compilers.
The currently supported compilers are:
      Imp      - The IMP77 compiler
      Fortran  - The Fortran77 compiler (pre-release only)
      Pascal   - The Pascal compiler    (pre-release only)

See also:   Help Imp
            Help Fortran
            Help Pascal
            Help Compilation parameters
            Help Run
+IMP
The IMP compiler is called using a command of the form:
            IMP(compilation parameters)  source/object,listing
The executable object file is given the same name as the source file but with
the extension .EXE unless explicitly specified otherwise.
If the source file specifed does not exist and has no extension, .IMP is
appended then that file is tried.
+Compilation parameters
&Compilation parameter
&Compiler parameters
&Compiler parameter
&compiler options
&Compiler option
&Compilation options
The optional parameter to commands which invoke the standard compilers
comprises a list of options.
Three basic compilation options specify an initial state which may be modified
by further options - the order is thus significant.
   Initial states are defined by:
      DEFAULT:   include all checking code and full diagnostic data tables
      OPT:       remove all checking code and reduce size of diagnostic tables
      TRUSTED:   as OPT but diagnostic tables completely removed
   Modifiers are:                        (can be inverted by prefix NO)
      ASSIGN:    check for use of unassigned variables
      ARRAY:     check for array subscripts out-of-bounds
      CAPACITY:  check for truncation when storing strings, shorts, bytes
      BRIEF:     generate a summary listing with only procedure headings
   For example:    IMP(ARRAY,NOASSIGN,BRIEF)   pgm1/,t:
+Fortran77
This command is not generally available yet.
+Pascal
This command is not generally available yet.
+run
&running programs
&running programmes
&execute
&executing programmes
&executing programs
&do
Programs are run by giving a command of the form:
      PROG ...............
which causes the file "PROG.EXE" to be loaded and run.
The interpretation of the remainder for the line (.......) is
dependent on the options set in the object file (PROG.EXE);
By default the interpretation is the the line is either of the form:-      
             (parameter) <stream definition>
 or:-        <stream definition>
         or:-        -parameter
The parameter (or the null string) is made available to the program and the
required streams are set up.
Input stream 1 and output stream 1 are selected before the program is entered.
See also:   Help Streams     Help Set
            Help Option      Help Files
+STOP
&Stopping
&logging off
&finishing
&QUIT
&quitting
&BYE
The command STOP stops the process and logs the user off.
All temporary and volatile files are deleted.
However, if this command is given from within a command file,
see HELP COMMAND FILE, the effect is simply to terminate the execution of that
file. Subsequent commands are taken from the user's terminal.
+FILES
&Files
&DIRECTORY
&index
The format of the FILES command is:
      FILES            - for a listing of the names of all of your own files
      FILES fred:      - for a listing of another user's files.

The command produces the listing in alphabetical order in several columns across
the page. The output produced may be altered (with both of the above forms), by
appending a '!' or '?' to the command, as shown below:
   FILES!  or  FILES fred: !  - An extended listing is produced, one file
                                per line, with additional information.
   FILES?  or  FILES jim: ?   - A '2-D' listing: filenames vertically,
                                with extensions horizontally.
A star (*) may be used as a wild-card to select the owner, filename or
extension for all the files which match the rest of the parameter.
E.g. Files *.imp  will list the names of all of the files in the current
directory with the extension .imp;  Files  *:RULES.*  will list the names of all
the files in the whole file system with filename RULES and any extension.

See also:      Help Fileinfo      Help Filenames    Help Temporary files
+FILEINFO
A FILE is an ordered collection of data bytes (8 bit quantities).
The interpretation of these bytes is totally dependant on the program
using the file; the system imposes no restrictions on the contents of files.
See also:      Help Creating files      Help Editing
               Help Delete              Help Rename
               Help Files               Help Dump
               Help Filenames           Help Directory
+MAIL
&Messages
&MESSAGE
Text messages may be sent between users.  (See HELP TELL). If a message is
received while a user is logged on, the line "***ACOUNT: mail from ???" will be
displayed on the recipient's console. (Where "???" is the sender's username).
   Messages sent to users when they are not logged on are queued up. When the
user next logs on a the message "You have new mail" will be displayed on the
console.
   Mail sent at any time may be read by giving the command MAIL. The program
steps through all pending messages.  Once a message has been read it may be
deleted.  If it is not deleted it will continue to appear when the MAIL program
is run in future.
   Two variants of the MAIL command are provided.

MAIL?      -   This simply displays the number of queued messages
MAIL!      -   This shows when and from whom any pending messages were sent.

+TELL
&SEND
&NOTIFY
The command TELL may be used to send messages to other users.
            Command: TELL username      e.g.  TELL ALAN  or  TELL THU5
The user is then invited to type a message in on the console.  No prompt is
issued for the lines of the message.  When the entire message has been typed
the program is stopped by typing Ctrl+D.

To mark a message as being about a particular subject, use:
            Command: TELL(subject) username   e.g. TELL(bug report) FRED

To send files to other users, the full form of the TELL command is:
            Command: TELL(subject) file / username
      e.g.  Command: tell(compiler bug) testprog / IMPD
        or  Command: tell /fred:   {file defaults to T:, the user's console,
                                    colons in usernames are optional}
For very short messages consisting only of a 'subject' line that the user
wishes broadcast immediately to the recipient's console rather than being
queued as normal mail, use:
   Command: TELL(up to 19 chars) username!  e.g. TELL(coffee time?) fred!
+FILENAME
&Filenames
&file
&NAME
In general filenames take the form:      UNIT_OWNER:FILE.EXT
where:  UNIT    is the name of the disc unit on which the file resides
        OWNER   is the name of the owning process
        FILE    is the file name, which comprises a letter or a dollar
                optionally followed by up to seven letters or digits.
        EXT     is an optional extension of up to 3 letters or digits.

Within filenames lower case letters are treated as upper case. If the UNIT is
not specified all available units are searched until the specified OWNER is
discovered. If the OWNER is not specified the current user is assumed. On
creation the system marks files as being volatile by following the name with a
hash(#). Only when the file is closed will the file be renamed properly and any
old version deleted. Filenames starting with a dollar are considered temporary.
Temporary and volatile files are deleted when the process logs off, or the
command PURGE is given.
Examples of filenames:          DATA                      NEWS.TXT
                                PETER:prog.IMP            SYSTEM:NEWS
                                arch_system:help.txt      ARCH_PETER:VERSION1
                                $program.tst
+Ctrl
&Ctrl+
&Control
&Control characters
&Control Character
The notation  Ctrl+A  is used to specify characters generated at the terminal
by typing the letter specified (in this case A) while holding down the
CONTROL shift key (commonly marked CTRL).
E.g. Ctrl+X is generated by holding down CTRL and typing X.
+rename
&newname
&change
   The command RENAME may be used to change the name of a file.
The form of the command is:   RENAME oldname/newname
The command will fail with an error message if file NEWNAME already exists.
Wildcards may be used: 
   Command: rename *.imp/*.old           All .IMP files become .OLD files
   Command: rename xxx.imp/yyy.*         XXX.IMP renamed YYY.IMP
+CONSOLE
&Keyboard
&console conventions
&TT
&T
&TTY
&input
&terminal
Information about the special characters which are used to control the operation
of interactive terminals may be obtained by giving the command 
HELP special-character, where 'special-character' is one of the following
mnemonics:  Backspace     BS           CAN         Cancel
            CR            Ctrl+D       Ctrl+E      Ctrl+G
            Ctrl+N        Ctrl+O       Ctrl+P      Ctrl+Q
            Ctrl+R        Ctrl+S       Ctrl+T      Ctrl+X
            DC1           DC2          DC3         DC4
            DEL           DLE          ESC         Escape
            LF            Line feed    Return      SI
            SO            TAB
+Copy
&copying files
&C
&transfer
The command COPY may be used to copy any input stream to any output stream. 
Data from a second input stream, if specified, will be concatenated onto the end
of the output stream.
The command takes the form:
      COPY input1,input2/output

The files take defaults as follows:
              input1 = T:       the user's terminal
              input2 = N:       the null file
              output = T:       the user's terminal

Examples:    Copy file1/file2
             Copy heading,letter/final
             Copy t:/newfile

+Be
&become
&change hats
The system allows a user to pretend to be logged on as a different user. This
is useful if a lot of work is to be done in a short period on another user's
files.  The command:  BECOME Fred  will prompt you for Fred's  password (which
is not echoed).  Subsequently all unqualified filenames refer to files in
FRED's directory.  Your own files may be referred to by using the "USER:file"
notation.   To remind you of the changed state of the process, the subsystem
command prompt becomes the appropriate username.  In the example, the prompt
would change to "Fred:".  The STATE command will indicate the directory
currently in use at any time. 
The command:  BECOME  with no username parameter specified will return the
process to its 'home' directory.  The command prompt is restored to its
original value.
The form:  BECOME user,pass  may be used for brevity. 

+line printer
&lp:
&lp
&printer
Any output files specified as having the owner LP: will be offered to the
printer spooler when the file is closed.
e.g.       COPY FRED.IMP/LP:OUTPUT.XXX
will send a copy of the file "FRED.IMP" to the printer and label it
           "OUTPUT.XXX".
If no name is required on the output the form "LP:" may be used.
      e.g. COPY FRED.IMP/LP:

A file may be sent to the printer without copying (resulting in the file being
deleted) by offering the file to the printer using the command OFFER.
 e.g.      OFFER FRED.IMP/LP:OUTPUT.XXX
+paper tape punch
&pp:
&pp
&punch
&paper punch
&paper tape
Files may be sent to the paper tape punch in a manner analogous to that from
sending files to the printer; see HELP LP.
   e.g.   COPY FILE/PP:FILE
          OFFER TAPE.TMP/PP:OUT.ABC
+stream
&Streams
&environment
&Logical units
The environment for a program may be specified in the command which invokes the
program. This is done using a stream specification of the form:
   INPUT1,INPUT2,INPUT3/OUTPUT1,OUTPUT2,OUTPUT3
where INPUTx defines input stream 'x' and OUTPUTx defines output stream 'x'.
If any of the streams is not specified the default stream assignment is taken.
The defaults are:  T:, Null:, Null: / T:, Null:, Null: 
+PASSWORD
&PASS
The user's password may be changed by a command of the form:
      SET PASSWORD=<new password>
<new password> is any sequence of up to 6 letters or digits starting with a
letter.
   e.g.   SET PASSWORD=SECRET
+delete
&destroy
&remove
&del
&purge
&kill
&deleting files
&destroying files
&removing files
The command:      DELETE <file name list>
where <file name list> is a list of file names separated by commas, can be used
to delete unwanted files. If the command is given as DELETE *, a prompt is
given for every file in the owner's index. A reply of YES causes the file to be
deleted, any other reply leaves the file alone.
The command PURGE may be used to delete temporary and volatile files.
+null
&Null:
&n:
&n
&null stream
&null file
&null input
&null output
&Drain
&Sink
The null file is represented by N: or Null:. On input it immediately signals
end-of-file, and any output sent to it is discarded.
+ESC
&Escape
&BEL
&Ctrl+G
ESC and BEL (Ctrl+G) are equivalent.  Both signal to the system that the user
wants to interrupt the currently executing program, either to halt it or to
convey some information to it asynchronously.  The system responds to ESC by
prompting "Int:" at the start of a new line.  See "Help int" for details of
the valid replies to this prompt.  (The normal reply is "." full stop followed
by carriage return, which aborts the currently executing program).
+interrupt
&Interrupts
&int
&Break
The replies to the prompt Int: (see HELP ESC) are normally made available to
a process in the external string variable Console Int.
However several of the replies are reserved  for use  by the system. These are:
      Int:.         (Int full stop)
                    Terminates the running program and returns the process to
                    command level.
      Int:?         (Int question mark)
                    Terminates the running program and invokes the run-time
                    monitor to produce diagnostics (if they are available).
      Int:!         (Int exclamation mark) 
                    For convenience this interrupt may be generated by striking
                    the escape key (<esc>) twice in which case no <return> is
                    necessary. It has the normal significance of any other
                    interrupt, except that it is used in the editor to force the
                    command currently being executed to fail, and hence request
                    another command.
+option
&Options
&command interpretation
The command OPTION may be used to modify the interpretation of the command line
associated with the execution of an object file.
The command takes the form:  OPTION(<option list>) FILE
where FILE is the name of an EXE file (i.e. .EXE assumed).
The current options are:

     Decode              Open              Upper          Spaces 
   NoDecode            NoOpen            NoUpper        NoSpaces
     Stack=              Time=

See also:  Help Option_Decode         Help Option_Open
           Help Option_Upper          Help Option_Spaces
           Help Option_Stack=         Help Option_Time=
+Option_Upper
&Option_NoUpper
The UPPER option causes all lower-case letters in the command parameter
to be converted to their upper-case equivalents.
NOUPPER causes letters to be left as typed.
+Option_Spaces
&Option_nospaces
The NOSPACES option causes all spaces to be removed from the command parameter.
SPACES causes the spaces to be retained.
+Option_Decode
&Option_nodecode
DECODE specifies that the command line is to be interpreted by the usual syntax
rules.
NODECODE specifies that the remainder of the command line is to be passed to the
program as a parameter.
+Option_Open
&Option_noopen
OPEN specifies that the files in the stream definition part of the command are
to be opened before the program is entered.
NOOPEN results in the stream definition part being decoded but the files
will not be opened before the program is entered.
The OPEN option is ignored if NODECODE is selected.
+Option_Stack=
&Option_Stack
The stack option is used to control the size of workspace made available
to a command.
If NN is positive it specifies the minimum size of stack (work area) required by
the program. If the value specified by a previous SET-STACK= command is greater,
that value will be used.
If NN is negative its absolute value represents the exact size of stack
required, regardless of the value defined by a SET-STACK= command.
NN is specified in Kilobytes.
+Option_Time=
&Option_Time
The Time option is used to control the total execution time allowed for the
command. NN specifies the time limit (in seconds) to be imposed on the program.
If NN is negative its absolute value represents the time limit in seconds
which overrides any SET TIME= command currently in effect.
If NN is positive it specifies a minimum time limit which will be extended to
the current value of SET TIME= if necessary.
+SET
&Prompts
&prompt
&cpulimit
&cpu
&stack
&width
&time
&space
&timelimit
The command SET may be used to set various system parameters. The form
of the command is:
          SET <value list>
where <value list> is a list of value settings separated by commas.
The current parameters are:
   Time=         Stack=    Password=    Width=   Errorfile=
   Timelimit=    TAB=      Tabs         Quick    Dump
   Monitor       Verify    Prompt=

See Also:   Help Set_Time      Help Set_Stack      Help Set_Password
            Help Set_Width     Help Set_Tab        Help Set_Tabs
            Help Set_Quick     Help Set_Dump       Help Set_Errorfile
            Help Set_Monitor   Help Set_Verify     Help Set_Prompt
+Set_Prompt
The command: Set Prompt=....
causes the system to use the string "..." as the prompt it issues when
asking for a command line from a terminal.  (The default prompt is
"Command:").  The command "BE" also changes the command prompt, see
Help Be
+Set_Quick
&Set_Noquick
&Quick
&Noquick
The command: Set Quick causes subsequent external references to be
satisfied by examining the standard subsystem first, with the
files in the library list being examined last.
The command: Set NoQuick causes the library list to be examined first,
with the standard subsystem being searched last.
Note that in general the NoQuick option will slow down the loading
of most system-provided commands and programs.
See also:   Help Lib
+Set_Dump
The command: Set Dump   enables a dump of register contents and the code area
about the failing instruction on a contingency. This facility is usually only
of interrest to fairly experienced programmers. 
The command: Set NoDump disables the dump.
+Set_Monitor
The command: Set Monitor  causes each command execution to be followed by a
report of the time of day and the processor time used by the last command (or
since the previous Set NoDump command).
The command: Set NoMonitor  disables the facility.
+Set_Errorfile
&Errorfile
&Errorfile=
&SET_Errorfile=
The command: Set Errorfile=filename  causes subsequent diagnostic output to be
sent to the nominated file. A message is sent to the terminal whenever such
output is generated.
Giving a null filename (i.e. SET ERRORFILE= ) causes diagnostic output
to be sent to the terminal.  This is the default case.
+Set_Verify
The command: Set Verify  causes command lines to be echoed onto the report
stream after being expanded (for aliases etc.). This is useful when command
files are being obeyed.
The command: Set NoVerify inhibits the echoing. Note that for interactive users
Set NoVerify is the default while for Batch jobs Set Verify is the Default.
+Set_Time
&Set_Time=
&Set_Timelimit=
&Set_Timelimit
Set Timelimit=nnn  sets the program execution time limit to nnn seconds.
                   (default=30 seconds).
                   TIMELIMIT may be abbreviated to TIME.
This setting may be overridden for any particular command by use of
the Option(TIME=...)  command.
The command SET TIME=? will cause the current value of the time limit
to be output.

See also:   Help Option      Help Option_Time=
+set_Stack
&Set_Stack=
Set STACK=nn       sets the stack size to nnK bytes (default=60K bytes).
This setting may be overridden for any particular command by use of the
Option(STACK=...) command.
The command SET STACK=? will cause the current value of the stack size
to be output.

See also:   help Option      help Option_Stack=
+Set_Password
&Set_Pass
Set PASSWORD=pppppp    makes "pppppp" the user's password.
+Set_Width
&Set_Width=
Set WIDTH=nnn          sets the terminal output line limit to nnn characters
                       (default=72).
Lines longer than this will be broken on output after each nnn characters.
Set Width=0   inhibits any such extra line-breaks in terminal output.
+Set_Tab
Set TAB=a+b+c...       Defines up to 10 tab stops incrementally.
                       I.e. the first tab stop is at column a,
                            the second is at column a+b,  etc.
Initially the tab stops are set by:  Set TAB=3+3+3+3+3+3+3+3+3+3
The interpretation of TAB on input is furthur controlled by the
SET TABS and SET NOTABS commands.

See also:   Help Set      Help Set_Tabs
+Set_Tabs
&Set_Tab
&Set_NoTab
&Set_NoTabs
Set TABS               Enables tab stops. On input from the keyboard
                       Tab will be converted into as many spaces (at least one)
                       as necessary to move to the next tab stop as defined
                       by SET Tab=....
                       Once the 10'th tab stop has been reached each TAB will
                       be converted into 3 spaces.
Set NOTABS             Disables tab stops. On input, the TAB character
                       will be replaced by three spaces.

See also:   Help Set      Help Set_Tab
+topic
The parameter to help should be the name of a command or a particular topic for
which information is required.
+PERMIT
&Permissions
&permission
&access
The command: PERMIT FILE=<permissions> may be used to alter the accessibility of
the specified file. Each user of the system has a set of access rights given by
the system manager; the rights are denoted by the letters A-H. Access to other
users' files is only permitted if that file has been given any permission
corresponding to the rights of the requesting user. In order to prevent
inadvertent destruction of files, the user must give files the permission D
before they may be deleted. Access to directories may be given by giving
DIRECTORY in place of a file name.  E.g.
      PERMIT DATA.1=ABC
      PERMIT DATA.2=D
      PERMIT DIRECTORY=G
The commands STATE, FILES, and ANALYSE may be used to discover the current
settings of access rights and directory and file permissions.

See also:   Help Files      Help Analyse      Help State
+OFFER
&SEND
&GIVE
&Spooling
A file may be sent to a queue for future processing by giving a command
of the form:     OFFER FILE/QUEUE:NEWNAME
The queues which are currently available are:
                 LP:       - the line-printer queue.
                 PP:       - the paper-tape punch queue.
                 BATCH:    - the batch (background) job queue.

The file will be destroyed when the queue server takes the file.

For example:   OFFER BOOK.TXT/LP:BOOK  sends the file BOOK.TXT to
                                       the line-printer.
+OS32MT
&OS-32MT
&OS32-MT
&EMULATE
&EMULATOR
&FORTRAN
&BASIC
 The command OS32MT may be used to enter the OS-32MT emulator.   The commands
so made available are:
   BASIC
   CAL
   COBOL   (not yet implemented)
   FORTGO  (compile and go Fortran 5)
   FORTRAN (compile and assemble FORTRAN 5)
   LINK    (build store image 'task')
   TET     (gives direct access to TET)
   RUN
   SET     (modify emulator parameters e.g. time, store, i/o streams etc)
   STOP    (return to standard subsystem)
This utility can also run off-line work prefixed by //OS32 instead of the
standard //JOB card.
For further details:  COPY OS32:DOCUMENT.
+TAB
Tab stops may be set using the command: SET TAB=a+b+c+d......
where a, b, c, d.... are increments in spaces from the previous tab stop
(initially 0).
 e.g. SET TAB=6+4+4  sets tabs at columns 6, 10 and 14.
There are 10 tab stops in all; any not specified are filled in
increments of 3. Once the final tab stop has been passed the tab key
acts as three spaces.
 Before the tab settings may be used the feature must be enabled by the
command: SET TABS. The feature is disabled by the command: SET NOTABS
after which the TAB character will cause three spaces to be input  (the
default condition).
+list
&listing
A line-numbered listing of a source file may be produced by
giving the command:   LIST filename
By default the listing is sent to the printer.
In the near future the command will accept a parameter
containing a list of directives:-
   lines=????       to set the number of lines on a page
   width=????       to set the number of characters on a line
   columns=???      to set the number of columns to be printed.

The default settings are (lines=60,width=120, columns=1)
+CLEAN
The CLEAN command causes the system to prompt the user with the name of
each file in the users' directory.  A null reply (just typing RETURN)
moves on to the next file.  A set of commands are available within CLEAN
to delete, rename etc. the current file. To start the program, just
type:
                  CLEAN
   Information about the commands available is available within the
program, by typing HELP in reponse to its prompt.
   If a user has access to another's directory, it may be CLEANed using
the following form of the command:
                  CLEAN   (username )
   After CLEANing, the user is automatically returned to his home
directory.
   Appending a '!' to either form of command will cause CLEAN to output
extra information about the physical placement of files on the disc.
Examples:         CLEAN                  clean out home directory
                  CLEAN (EXTN_ENGINR)    clean another users' directory
                  CLEAN!                 clean with extra info
                  CLEAN (FRED)!          poke elsewhere
+Link
&Linking
Mouses supports dynamic linking, that is references to an external
procedure are only satisfied when the procedure is called for the first
time. To satisfy each reference the loader uses a list of object files
defined using the LIB command. See also: Help Lib
+Library
&lib
&libraries
&external routines
&externals
&External
The LIB command is used to maintain a list of up to seven program files
containing external extry points. When the loader receives a request for
an external object this list is searched in order. If the entry is not
found the current subsystem procedures are checked.
The command has three forms:
   1:   Lib .none              - this clears the list
   2:   Lib                    - this prints the current list of files
   3:   Lib item-list          - this inserts or removes items.

Item-list is a list of items separated by commas, where each item is:
    File   in which case FILE.EXE is added to the list,
or -File   in which case FILE.EXE is removed from the list (if possible)

Whenever an item is added to the list it is added at the end, and any
duplicates are removed. In this way the library list may be reordered.

   E.G.   Lib Maths,Hypers,-testlib
+Let
&Alias
&assign
&Abbreviation
&Abbreviations
Abbreviations for commands may be defined using the LET command.
e.g.      Let F=Files
Once an abbreviation has been defined its occurrence in the command-verb
position of a command line results in the expansion being used.
e.g. Given the definition of F above, the command line:  F System:
will result in the execution of the command: Files System:
Abbreviations may be redefined at any time, and may be removed
by assigning a null definition e.g.  Let F=
Note that the definition is never expanded furthur so that the following
sequence will swop the definitions of the commands A and B:
   Let A=B
   Let B=A
The form:   LET Abbr   will display the expansion of the abbreviation Abbr
while:      LET        will display the expansions of all abbreviations.
An abbreviation embedded in a command line is expanded if prefixed by '@'.
e.g. Command: let L=$longfile
     Command: copy @L/Lp:@L  =>  copy $longfile/lp:$longfile
+Command Files
&Command File
&Css
&Css Files
&Css File
A file of commands may be executed by giving the file the extension .COM
and giving the filename (without the .COM) as a command verb.
E.g. Assume a file SHOW.COM contains:
Files
Lib
Let
The command: SHOW will cause the three commands FILES, LIB and LET to be
executed in order.
A command file may be given parameters: a list of strings separated by
commas. Within the command file each string may be referred to by '@n'
where 'n' is the position in the list of the required parameter. E.g.  
SHOW User, P   will result in @1 being the four characters User, and @2
being the character P. By convention @0 is always replaced by the
nesting level of command files, i.e. the first command file has @0 as 1,
any command file invoked from within the first will have @0 as 2, and so
on. The order of execution of the commands in a command file may be
controlled by special directives. See Help Sequence Control
+Sequence Control
Looping and branching is available within command files,  see:

   Help $IF      Help $ELSE      Help $FINISH      Help $EXIT
   Help $UNLESS  Help $LABEL     Help $GOTO        Help comments

+comments
Comment lines prefixed with an exclamation mark "!" are permitted within
command files.  They are ignored.
+$IF
Inside a command file the $IF command may be used to select one of two
alternative command sequences. If the condition following $IF is
satisfied the group of statements up to the matching $ELSE or $FINISH is
executed. If $ELSE is found the statements following it up to the
matching $FINISH will be executed.
 If the condition is not satisfied the statements up to the matching
$ELSE or $FINISH are skipped and then statements after an $ELSE are
executed.
 There are two forms of condition:
   1:   EXISTS Filename    - this is satisfied if the file exists.
   2:   string .EQ. string - this is satisfied if the two strings
                             are identical ignoring case dictinctions.

E.g.   $IF exists Data.txt
       $IF @1 .EQ. do it all
+$UNLESS
This is the same as $IF except that the condition is inverted.
+$ELSE
See $IF
+$FINISH
See $IF
+$EXIT
This causes the command file to terminate immediately.
+$LABEL
$LABEL tag   causes the character string 'tag' to identify the current
             point in the command file.
See also HELP $GOTO
Jumping to a label outwith the current command file is not allowed.
Label tags are shared between all command files and nesting levels.  To
generate unique labels within recursive command files add '@0' as a suffix
to the label.  This is expanded as the current nesting level and will make
the labels unique.

Example:     $Label top
                Printstring Hello
                !In an infinite loop
             $goto top
+$GOTO
$GOTO tag    causes control to be transferred to the point in the command
             file identified by the character string 'tag'.
See also HELP $LABEL
+Events
&Errors
&Event
&Subsystem events
The following events are signalled by the subsystem:
Event   Subevent  Extra
  3         1       Sym     Symbol Sym in numeric data (from READ)
  5         5       Type    Illegal type of parameter to READ
  8         8               Load fails (cannot find an external subroutine)
  9         1               Input Ended  (end of file encountered)
  9         2       St      Illegal stream St
  9         3       St      Illegal Direct Access Channel
  9         4               Invalid filename in OPEN
  9        10       N       Director Error N
 10         1               Pack fails -- illegal filename
 10         2               Rename fails
 10         3               Create fails
 10         4               Entry to file of externals
+Dump
&Filedump
The command DUMP may be used to examine the contents of files.
The general form of the command is:   DUMP(parameters) Filename/Output
Where 'parameters' is a list of items of the form:
   HEX            - the dump is wanted in hexadecimal
   OCTAL          - the dump is wanted in octal
   ASCII          - the dump is wanted interpreted as being ASCII characters
   EBCDIC         - the dump is wanted interpreted as being EBCDIC characters
   PAGED          - the output is to be paginated
   PAGE=n         - each output page contains 'n' lines
   WIDTH=n        - each output line can hold 'n' characters
   DISC=dev       - dev specifies a unit which is to be dumped
   n..m           - dump blocks 'n' to 'm' inclusive
   ..m            - dump blocks 0 to 'm' inclusive
   n..            - dump from block 'n'
   n              - dump block 'n'
If the command is followed by an exclamation mark, each line of the dump
will be followed by the interpretation of each byte as an ASCII character.
Similarly, following the command with a question mark will cause interpretation
of each halfword as a "packed" 3-character string.
For Example:   DUMP(HEX,1..5) Testfile
+God
&god almighty
&jesus
Please apply to deities directly, not via MOUSES.
+Love
&Sex
MOUSES, being of neutral gender, can offer no advice on this subject.
+Buses
What is this that roareth thus?
Can it be a Motor Bus?
Yes, the smell and hideous hum
Indicat Motorem Bum...
How shall wretches live like us
Cinci bis Motoribus
Domine, defende nos
Contra hos Motores Bos!
+SVCs
&SVC
&SVC list
This is a short summary of the parameters taken by and the general effect of
the supervisor calls (SVCs) supported by the MOUSES supervisor.
SVCs with numbers greater than 100 may only be executed by a privileged
process.

   1  - stop
   2  - prompt flags<p1> text<sp2>
   3  - console input
   4  - console output text<sp1>
   5  - locate process id<p1>
   6  - kill i/o
   7  - date & time  -> date<sp1> time<sp4>
   8  - create segment size<p2> seg<p3>
   9  - destroy segment n<p1>
  10  - load file
  11  - segment info seg<p1>
  12  - performance info
  13  - unpack date
  14  - get proc info proc<p1> -> powner<p1>,cputime<p2>, store<p3>,
                                  uptime<p6>
  15  - load file
  16  - poff   sact = reply wanted (0 = any)
  17  - pack   file<sp1> -> p1,p2,p3<owner>
  18  - unpack p1,p2,p3<owner> -> file<sp1>
  19  - info seconds<p1> users<p2> cpu<p3>
             date<p4> owner<p5> version<p6>
  20  - to director & wait
  21  - set time limit <p1> seconds from now
  22  - message to potter
  23  - wake after p1 .01 secs.
  24  - stack contingency vector<p1>
  25  - unstack contingency to<p1>
  26  - fire contingency weight<p1> at<p2>
  27  - resume from contingency vector<p1> repeat<p2>
  28  - info 2 users<p1> clevel<p2> console<p3> priv<p4>
  29  - set param<p1> value<p2>
  30  - validate addr<p1> size<p2>
  31  - detach process
  32  - protect segment<p1>
  33  - delete segs<p1>
  34  - pack date <sp1> -> <p1>
  35  - unpack time <p1> -> <sp1>
  36  - user message to account
  37  - priv
 101  - disc read discaddr<p1> storeaddr<p2> disc<p3> process<p4>
 102  - disc write     ""            ""       ""         ""
 103  - set swop disc
 104  - operator message
 105  - MT operation
 106  - read segment
 107  - write segment
 108  - disc status unit<p3>
 109  - start process console<p1> owner<p2> disc<p3>
                      pass<p4>file<p5> reason<p6>
 110  - get resident buffer
 111  - lp demon
 112  - pt demon
 113  - broadcast
 114  - get unit no
 115  - pon (no wait)
 116  - pon
 117  - read real <p1>
 118  - write real addr<p1> value<p2>
 119  - define potter
 120  - tell process<p1> text<p2>
 121  - inhibit service<p1>
 122  - uninhibit service<p1>
 123  - boot  dev<p1> restart<p2>
 124  - privilege process<p1> priv<p2>
 125  - hazard/protect dev<p1> prot<p2>
 126  - stop process<p1>
 127  - lk demon
 128  - define accountant
 129  - resume & time out
 130  - CR demon
 131  - SHUTDOWN process P1
 132  - claim terminal P1
+Yourself
Thank you.
+42
Tricky!
+Reincarnation
First, drop dead,
Then,  it's all up to you.
+$
 H?   s s                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
&HELP
&Anything
&please
&me
The HELP command is used to obtain information about system features.
To select a particular topic give the command:  Help Topic
where 'Topic' is one or more words describing the subject of interrest, e.g.
               Help files
In certain cases more detailed information may be obtained by
following the command with an exclamation mark: e.g.  Help Files!
Information is available concerning:
   Commands         Compiling           Console conventions
   Copying files    Creating files      Deleting Files
   Editing files    Files               Running programs
   Stopping         Operator commands   Utilities

A complete list of topics available may be obtained by typing:   Help ?

Note that typing line feed (LF) will cause output to continue if it has been
suspended after the screen has been filled.
+Archive
&tape backup
&tape dumps
&tape dumping
&backup
The command:      ARCHIVE
invokes the MOUSES magnetic tape archive manager.  For further information see

   o  Help Archive_Initialise            Labelling archive tapes.

   o  Help Archive_Analyse               List the contents of an archive tape.

   o  Help Archive_Dump                  Details of dumping files to tape.

   o  Help Archive_Restore               Details of loading files from tape.

   o  Help Archive_Idump                 Incremental dumping of user files.

These describe the available archiver commands separately, but in fact
sequences of commands (e.g. to dump several discs then generate a listing) are
commonly entered. The Archive program prompts "Archive: " when it wants a
command.  Reply with EXIT to return to MOUSES command level. 
+Archive_Initialise
&Archive_initialize
To create an empty archive tape, mount a scratch tape in the drive with a
write ring fitted.  Enter the command:

            Command: ARCHIVE!

In reply to the "Archive:" prompt, enter: 

            Archive: initialise ...text...

The text following "INITIALISE" is recorded in the tape label and appears on
listings of the contents of the tape.  (See HELP ARCHIVE_ANALYSE).
At this point, either reply EXIT to the "Archive:" prompt to return to command
level, or enter another archiver command.
+Archive_analyse
A listing of the contents of an archive tape can be produced by the following
sequence of commands:

            Command: archive / listing-file
            Archive version 1.5          Program announces itself

            Archive: analyse

            Archive: exit

When the EXIT command is entered, the 'listing-file' is closed and control
returns to command level.  The 'listing-file' may be any file or device, e.g.

            Command: archive /$temp
            Command: Archive /LP:
            Command: ARCHIVE/LP:LISTING
+Archive_Dump
The archiver command:  DUMP UNIT disc
is used to dump all the files on the named disc unit to the mounted archive
tape.  To dump only the files belonging to a single user, use the command:
                       DUMP USER who
As each file is archived, a message line is written on the operator's console
of the form:           <- filename
Reply "EXIT" to the "Archive:" prompt to return to MOUSES command level.

Examples:               Archive: dump unit sys
                        Archive: DUMP USER User_Fred
                        Archive: Dump user Alan
                        Archive: Dump unit PAK4
+Archive_Restore_User
The archiver command:   RESTORE USER who
causes the mounted archive tape to be searched for any files belinging to the
specified user.  They are reloaded onto the disc.  Where they are put depends
on how the archiver was started.  By default, the files are loaded into the
directory currently being used by the operator, so to reload FRED's files, do:
                        Command: Be Fred     {switch to right directory}
                        Fred: Archive
                        Archive version 1.5
                        Archive: restore user fred
                        Archive: exit
                        Fred: Be             {Become OPER again}
+Archive_Restore_Unit
The archiver command:   RESTORE UNIT disc
causes the program to read through an entire archive tape, reloading any files
which were originally dumped from the named 'disc'.  Users will automatically
be created on the disc to read the files into.  For example the disc PAK5
could be restored to the state it was in when last dumped by mounting the dump
tape, re-initialising PAK5 (see Help Disc_initialise) then entering :-

            Command: Archive
            Archive version 1.5
            Archive: restore unit pak5
            Archive: exit

+Archive_Restore
Files can be retored to disc from an archive tape either singly, or grouped
per user or per disc unit.  See one of:

   o  Help Archive_restore_file

   o  Help Archive_restore_user

   o  Help Archive_restore_unit

+Archive_restore_file
To restore the latest version of a file from an archive tape, use:

            Command:archive
            Archive:restore file user:filename
    e.g.    Archive:restore file pak5_fred:program.imp

If you have an analysis (see Help Archive_analyse) of the tape, the version
of the file as it was when dumped on a particular date at a particular time
may be restored.  First find the serial number of the required version from
the analyse listing, then:

            Command: Archive
            Archive: Restore #nnn

Where 'nnn' is the sequence number of the file.
+Utilities
&utility programs
Information about several system utilities is available.  See:

   Help Disc      - The disc backup/copy utility.
   Help Archive   - The magnetic tape disc backup utility
   Help Tapes     - Utilities to process tapes (including IBM tapes)

+Disc
&Disc utility
&Disc checks
&Disc checking
&Disc copying
&Disc compression
&compressing discs
&copying discs
The disc utility supports the following operations.  

   o  Initialise 'raw' discs with an empty file system.

   o  Perform self-consistency checks on the directories on a disc.

   o  Copying one disc straight onto another.

   o  Copy a disc, compressing the free space on the disc into a single area.
      (May have to deal with corrupt input discs).

   o  Compare the contents of two discs.  (Verify copy).

See:  Help Disc_initialise   Help Disc_Test       Help Disc_copy
      Help Disc_compress     Help Disc_Compare
+Disc_test
Checking of a disc is initiated by the command:

            Command: disc(test)          Program prompts for disc to test
    Or:-    Command: disc(test) xx       Disc to test specified in command line

'xx' is the disc unit to be tested: either a unit number '#n' or the name of
a loaded disc.  (See Help Disc units).
Any errors detected are logged on the console.  More logging output is
produced if a question mark '?' is appended to the command line.  The enquiry
facility (see Help ENQ) may be used to discover the directory currently under
test.
Examples:   Command: disc(test)          Program prompts for disc to test.
            Command: disc(test) #1       Test disc on unit one.
            Command: disc(test) Sys      Test disc with logical name "SYS".
+Disc_Initialise
&Disc_initialize
The command:         Disc(initialise) / xxxx
is used to start initialisation of the disc 'xxxx', which may be specified
either as the logical name of a loaded disc or as a unit number '#n' (see
under Help Disc units).  The program prompts for certain parameter values.
Sample dialogue:     Command: disc(initialise) /#1    {init disc on unit one}
                     Are you sure you want to overwrite OLD?
                     Yes/no? yes         {reply NO to abort program}
                     Phy. disc name: NEW {any four letters/digits}
                     Log. disc name: NEW {Logical name as used in LOAD etc}
                     System area? yes    {reserve an area for a system image?}
                     Disc type: Diablo   {or HELP/MSM80/CALCOMP/TELEFILE}
                     Description: any text supplied by the operator
                     ***WIPING NEW
                     Blocks: 9600
                     No errors
The valid replies to "Disc type:" are:
   DIABLO   10MB cartridge disc      MSM80    P-E 67MB drive
   TELEFILE 300MB drive              CALCOMP  67MB drive with TDC controller
   UNKNOWN  Specify no. of tracks, blocks per cylinder and heads by hand.
If the command line "Disc(initialise)" on its own is given, the program will
prompt "Output disc?" for the name of a unit to initialise.
+Disc_Copy
The command:   Disc(copy) xxxx / yyyy
will cause the program to copy the contents of disc 'xxxx' block by block over
the contents of disc 'yyyy'.  No interpretation is placed on the blocks, i.e.
non-MOUSES discs may be copied.  The disc identifiers 'xxxx' and 'yyyy' are
either logical disc names or disc unit numbers (see Help Disc units).  Either
may be omitted, in which case the program prompts for "Input disc?" or "Output
disc?".After the program starts it will prompt the operator for the type of
disc to be copied.  (Answer DIABLO for cartridge discs, MSM80 for P-E 67MB
drives, CALCOMP for TDC 67MB drives or TELEFILE for 300MB drives).
Examples:      Command: Disc(copy) Sys/#3
               DISC COPY V2.0
               Disc type: Diablo
               Command: disc(copy) /#4
               DISC COPY V2.0
               Input disc? #3
               Disc type: MSM80
               Command: DISC(copy) Fred/Jim
               DISC COPY V2.0
               Disc type: telefile
+Disc_Compare
&Disc_Verify
&verify
&disc verify
To discover whether two discs are identical, use the command:

               DISC(COMPARE) xxxx, yyyy

'xxxx' and 'yyyy' are logical disc names or disc unit numbers '#n', see
Help Disc units.
Either may be omitted, in which case the program prompts for "Input disc?" and
"Output disc?".  The program will prompt "Disc type:" to find out how many
blocks are to be compared.  Reply DIABLO for cartridge discs, MSM80 for
Perkin-Elmer 67MB drives, CALCOMP for TDC 67MB drives or TELEFILE for 300MB
drives.
Examples:      Command: disc(compare) #1, #2
               Command: DISC(COMPARE) SYS0, SYS1
+Disc_Compress
&Disc_squeeze
The command:   DISC(COMPRESS) xxxx / yyyy
will copy all user directories and files from disc 'xxxx' to disc 'yyyy'.
'xxxx' and 'yyyy' may be either the logical names of two loaded discs or
disc unit numbers '#n' (see Help Disc units).  Either may be omitted, in which
case the prompts "Input disc?" or "Output disc?" will be output.
A listing of the contents of the generated output disc can be produced:
               DISC(COMPRESS) xxxx / yyyy, listing-file
If the file system on the input disc is not self-consistent, the program
stops with the message:
               ***FAULTY INPUT DISC
If it is necessary to attempt to 'rescue' a corrupt disc, append an exclamation
mark "!" to the command line, and the program will attempt to copy any good
data remaining on the faulty disc:
               DISC(COMPRESS) xxxx / yyyy, listing !
(The ", listing" part is optional).
The operation of the program can be inspected using the ENQ facility (see
Help ENQ).
Examples:      Command: disc(compress)            {Prompts for disc names}
               Command: disc(compress) user/arch
               Command: Disc(compress) DEAD / #5, LP:listing !
               Command: disc(compress) user/back, List
+Ctrl+D
&EOT
&end of file
&end of input
The end of file condition can be signalled to a program reading from a terminal
by striking the Ctrl+D (EOT) key.  This is echoed by the system as "[]". 
+Ctrl+H
&Backspace
&rubout
&DEL
&erase
DEL and Ctrl+H (backspace) have identical effects.  The last character on the
current input line is erased.  Pressing DEL 'n' times erases the last 'n'
characters from the current line.  This is obvious on a VDU.  On hardcopy
devices the characters cannot be physically rubbed out, so the group of
characters being erased are echoed on the terminal (backwards as they are
deleted), enclosed between a pair of backslash "\" characters.
+Can
&Ctrl+X
This character causes the whole of the current line to be erased.  On fast
VDU terminals, the line is visibly erased.  On slower hardcopy terminals, a
'#' is printed, a carriage return/line feed sequence is output and the command
prompt is reissued.  (See also:  Set_erase)
+CR
&return
&newline
Striking the CR (carriage return, RET) key causes the current line to be
entered and processed by the system.  A carriage-return/linefeed is output
to put the cursor at the start of the next line.  An IMP program reading from
the console will read this as a single NEWLINE (LF) character,  Pascal and
FORTRAN programs see 'end of record' (EOLN).
+LF
&linefeed
&Ctrl+Q
&DC1
Linefeed and Ctrl+Q have identical properties.  Output to the terminal is
re-initiated after being suspended for one of the following reasons:

      o  End of page on VDU.   See:  Help Set_Page

      o  Output suspended manually by user pressing Ctrl+S.  See: Help Ctrl+S

      o  Output being discarded.   See:  Help Ctrl+T

+Ctrl+S
&DC3
&hold output
Striking the Ctrl+S key causes output to the terminal to be immediately
paused.  (Output is resumed by pressing linefeed, LF, or Ctrl+Q).
+Ctrl+R
&DC2
&retype
The current line being input by the user is retyped by the system.  This is
most useful on hardcopy terminals where a proliferation of '\' characters
echoed by DEL can obscure the meaning of the line.
+Ctrl+T
&DC4
This character causes the system to start THROWING AWAY terminal output.
Output is resumed either by pressing Ctrl+Q or Linefeed (LF), or when the 
running program stops to ask for input from the console.
+Ctrl+I
&TAB
&tabulation
&tabs
The system provides a 'tab stop' facility for user console input.  By default
pressing TAB (i.e. Ctrl+I) is equivalent to entering three space characters.
The user may alternatively set tab stops at particular columns,
see:   Help Set_Tabs
       Help Set_Tab
+Ctrl+E
&ENQ
Pressing ENQ (Ctrl+I) causes the system to display a short message indicating
the operation that is currently being performed in the form:

                  ***System: text

By default, "text" is the name of the program currently running or null if the
system is waiting for a command.  User programs and utilities (e.g. the IMP-77
compiler, the DISC utility etc) may set this string to indicate the operation
currently being performed.  E.g. the compiler indicates which pass it is 
performing.

There is no restriction on when ENQ may be used, during console output, while
the system is waiting for input or while there is no console activity.
+Ctrl+U
&NAK
The current line is erased as for CAN (Ctrl+X).  Additionally any lines which
have been typed ahead by the user and have not yet been processed by the system
are discarded.  NAK (Ctrl+U) echoes as '#', CR, LF.
+Ctrl+O
&SI
The console is shifted into the normal (default) mode, where upper and lower
case letters are distinct.  (Although all system programs treat upper and lower
case identically).  See also:  Help SO
+Ctrl+N
&SO
The console is shifted out of normal mode.  Henceforth, all lower case letters
typed will be echoed as the corresponding upper case character and any program
reading from the terminal will see the upper case character.  This effect may
be cancelled by striking the SI (Ctrl+O) key to shift back into normal mode.
+Ctrl+P
&DLE
&Binary input
To allow the input of any ASCII character to a program reading from the console
it must be possible to disable the standard interpretation of characters like
ESC and TAB.  Any character may be entered in thsi way by prefixing it with
DLE (Ctrl+P). 
Examples:      <dle> <esc>               - to enter the ESC character
               <dle> <dle> <dle> <dle>   - to enter two consecutive DLE chars.
               <dle> F <dle> <bel>       - to enter 'F' BEL.  (The <dle> before
                                           the 'F' is redundant since 'F' has
                                           no special significance.
               <dle> <eot>               - EOT normally causes end-of-file.
+Operator commands
&ops
The operator has access to several privileged commands:

   Catalog              - List usernames on a particular disc.
   State                - Gives status of system/discs/spoolers.
   Broadcast            - Send a short message text to all terminals.
   Close                - Prevent users from logging in.
   Shutdown             - Automatically close after broadcasting warnings.
   Open                 - Stop any pending shutdown, and allow user logins.
   Dateis               - Set the date and time counters used by the system.
   Protect              - Set software protection on a disc unit.
   Hazard               - Reset software protection on a disc unit.
   Load                 - Make a disc unit available to users.
   Unload               - Used before putting a disc offline.
   Pass                 - Set a global system password.
   Reprime              - All spooled files are revoked.
   Restart              - Reboot the system.

Type: Help 'command' for further information, e.g.  Help broadcast
See also:  Help utilites  Help disc units
+Catalog

The command:   CATALOG disc              
will generate a listing of the names of all users whose directories
reside on the specified disc.  'Disc' is either the name of a logical disc
unit, or a disc unit number "#n" in which case the analysis is of the disc
mounted on unit "n".  (See also:  Help disc units). 

Examples:      Command: catalog sys      what users are on the system disc?
               Command: catalog #1       Who is on the disc mounted on unit 1?
+Disc units
&discs
MOUSES accesses discs internally by 'logical disc unit number'.  More than one
logical disc may be mapped onto a single physical disc unit. (E.g. a 67MB drive
is normally partitioned into three logical discs). Usually, the operator will
refer to discs by name, but it is possible with most commands to quote the unit
number instead in the form "#n".  The correspondance between the numbers and
real disc drives varies from system to system.  For example:

   #1:  Cartridge disc C6:               #5:  67MB drive, first partition.
   #2:      "      "   C7:               #6:    "    "    second   "
   #3:      "      "   D6:               #7:    "    "    third    "
   #4:      "      "   D7:
+State
&Status
This command has several forms:
Command: state          - This form produces information about the user who
                          runs it (e.g. amount of CPU time used, username etc).
Command: state system   - This displays information about all active users.
Command: state discs    - This lists the names of the online discs.
Command: state discs!   - As above with extra information - free blocks etc.
Command: state discs?   - As for STATE DISCS, with disc description displayed.
Command: state queues   - Display a list of all spooled files.
+Broadcast
The command:   BROADCAST text
causes the message "text" to be displayed on all terminals in the form:

               ***OPER: text

Text longer than 23 characters will be truncated on the right.
+Close
The command:  CLOSE
will prevent users other than OPER logging in to the system.  Attempts to do so
will produce the "No user service" message.
See also:  Help open   Help shutdown
+Open
The command:  OPEN
allows users other than the operator to log in to the system.  The system is
normally opened automatically as part of the startup sequence.  It should
therefore only be necessary to use the OPEN command:

    o   After an explicit CLOSE

    o   If the normal startup sequence has been bypassed by logging in as OPER
        in the interval between system startup and the message "OPER starts"
        appearing on the system log.

OPEN also cancels the effect of any pending SHUTDOWN command.

See also:  Help close   Help shutdown
+Shutdown
&Shut
&Closedown
The command:   SHUTDOWN  nn
causes an orderly shutdown of the system in 'nn' minutes.
A warning message is sent to all terminals when the command is entered, and
after successively shorter intervals before the deadline.  The messages are
of the form:
               ***OPER: Close in nn minutes

When the deadline is reached, processing of the spooler queues is halted
and a final warning is issued:

               ***OPER: Closing down NOW!!

After a further minute of grace all logged on users except OPER are forcibly
logged off.
+Protect
&write protect
&prot
When the system starts up, all discs whose logical names start with "SYS" and
all hardware-protected discs are automatically software-protected. To software
write-protect a disc manually, use the command:

               PROTECT disc

'Disc' is either the logical name of the disc (e.g. Sys, User) or a unit number
'#n' (see Help disc units).  After execution of the command, users may no
longer create or alter files on the disc in question.  The disc need not be
hardware protected.  Note that if a disc is hardware protected but is NOT
software protected then attempts to write to the disc cannot be detected at the
user level, but will be reported on the logging device as disc errors. (The
attempted write will be retried until either the disc is made unprotected again
or the fifteenth retry fails, in which case the attemped operation is
abandoned).  Disc protection can be reset using the HAZARD command.
Examples:      Command: Protect SYS
               Command: protect #1

The protection status of the discs can be displayed with the STATE DISCS
command.  See also:  Help state  Help Hazard 
+Hazard
&unprotect
&deprotect
To remove any software write-protection on a disc, use the command:

               HAZARD  disc

'Disc' is either the logical name of a disc, or a disc unit number '#n'.
Hazarding a hardware-protected disc is not advised, since any user who then
attempts to write to the disc will not be trapped until the lowest level of the
system is reached, where the attempted write will be rejected by the hardware,
resulting in a series of up to fifteen retries before it fails). The PROTECT
command is used to set software protection.
Examples:      Command: hazard sys
               Command: hazard #5

The current protection status of the discs may be inspected by the STATE DISCS
command.  See also:  Help state  Help protect
+Load
&mark on
&mark
Not all discs physically online to the system are available to users.  To make
a disc available, the operator must LOAD it.  This is done automatically at
system startup for all discs online at the time.  Discs can be made
inaccessible by UNLOADing them (see 'help unload').  The form of command is:

               LOAD  disc

'Disc' is either the logical name of the disc to be loaded or a unit number of
the form '#n'.  The system will report the fact that the disc has been loaded
on the logging device.  If the name of the disc begins with "SYS", or the disc
device is hardware protected, the loaded disc will automatically be software
protected.  The command STATE DISCS (see "help state") will display a list of
the discs which are currently loaded.

Examples:      Command: load pak2
               Command: load #1
+Unload
&Mark off
To make a disc which is currently online inaccessible to user processes, use 
the command:   UNLOAD disc
where 'disc' is either the logical name of the disc to be unloaded or a disc
unit number '#n'.  (See "help disc units"). The command STATE DISCS (see "help
state") will display a list of the discs which are currently loaded.

Examples:      Command: unload arch
               Command: unload #5
+Pass
The command:   PASS ...
allows the operator to set a global system password.  The text string "..."
should be from one to six letters or digits.  After execution of this command
a user may log in to ANY user's account by quoting either its the correct
password, or the global password.  A user may also log in when the system is
closed (see 'help close') by quoting the system password.  If the command PASS
is entered on its own (with no "..." part) the global password is removed.

Examples:      Command: pass twit
               Command: pass xyz123
               Command: pass             {revoke global password}

Note: For security reasons this command should be used infrequently and with
      caution.
+Reprime
The command:   REPRIME
causes all files spooled to any queue (e.g. LP:, PP:, BATCH:) to be deleted.
The spoolers are reinitialised.  It should not normally be necessary to use
this command unless the queues become corrupt.
+Restart
&Reboot
&rebooting
&boot
&bootstrap
&booting
&reloading
The system can by booted either from the front panel with the 50-sequence
loader and the MOUSES bootstrap papertape/magtape or while the system is
running (e.g. to test new versions of the system).  To boot from disc 'xx'
from a running system, use the command:
                RESTART xx               (See also: Help disc units).
Examples:       RESTART #1
                Restart SYS
The system will go into an loop waiting for a valid system disc to be put
online on the nominated disc.
(See: Help 50-sequence  for details of front panel booting)
+50-Sequence
&50 sequence
To boot from the high speed paper tape reader or the magnetic tape unit, set up
the store locations using the front panel, then run from location X'50' after
clearing the PSW (press DTA ADR FN SEL on the front panel).

      Address  Contents   (both hexadecimal)
         50    D500
         52      CF
         54    4300
         56      80
         78    1399     {To boot from the high speed paper tape reader}
         78    85A1     {To boot from the default magnetic tape drive}
         7A    dd00     {'dd' is the cartridge disc address, e.g. C6}
         7C    ccss     {'cc': disc controller address, normally B6
                        {'ss': SELCH address, normally F0
         7E       0
+Dateis
&set date
&time
&date
The current date and time (as displayed by the STATE program, see: Help state)
are set using the operator command:

               DATEIS  date  

'Date' is of the form:   dd-mmm-yy    e.g.  15-Sep-81

      Or       DATEIS  date  time

'Time' has the form:     hh:mm        e.g.  13:10    (ten past one PM)
                 or:     hh:mm:ss     e.g.  10:11:30

Examples:      Command: dateis 25-Dec-81
               Command: DateIs 13-Jun-79 11:30
               Command: Dateis 13-Jul-80 12:00:02
+COMMANDS
&Command
&Command format
&format
The general form of a command line is:-

     CommandVerb {command parameter} {stream definition}

If no stream definition is required the rest of the command line may be used to
specify the parameter by using the form:

     CommandVerb-{command parameter}

Examples:      E file1/file2
               COPY file2/LP:file
               SET TIME=10
               SET-stack=32,password=FRED

The way in which the command line is interpreted may be controled
by options set in the object file corresponding to the command.

See also:   Help Streams            Help Option             Help ?
            Help Stream Definition  Help Command parameter
+Creating files
&Create
&Creation
&new files
Files are created automatically when they are specified as outputs for programs.
Commonly files are created using either the COPY program or the editor.
See also:   Help Copy   Help Files
            Help Edit   Help Filenames
+EDIT
&Editing
&Editing files
&E
&ECCE
The Edinburgh Compatible Context Editor, ECCE, is called using a command of
the general form:     E     input,input2/output
where:   input:   is the primary or only input stream (default N:).
         input2:  is an optional secondary input (defaults to input).
         output:  the file for the edited output (defaults to input).
E.g.     e    fred            modify existing file called fred
         e    fred/jim        modify fred - output into jim
         e    /fred           create a new file fred
         e    tom,dick/harry  produce harry from pieces of tom & dick
         e    fred/n:         examine FRED without being able to modify it.
For full information on ECCE see separate documentation.
Help about individual Ecce commands may be obtained by typing:
      Help E_command-letter         e.g.  Help E_M
Ecce commands are:  B   C   C-  D   E   E-  F   G   I   J   K
                    L   M   M-  P   R   S   T   U   V   X   Y   Z
                    %C  %F  %L  %M  %N  %Q  %S  %U  %X  %Y  %Z
                    ,   *   0   ?   ()  \
+E_B
Editor command BREAK: B breaks the current line at the file pointer.
+E_C
Editor command CASE SHIFT: C Moves right and inverts the case of letters.
+E_C-
Editor command CASE SHIFT BACK: C- Moves left and inverts the case of letters.
+E_D
Editor command DELETE: D/text/ deletes the next occurrance of text on the
                               current line.
+E_E
Editor command ERASE: E erases the character to the right of the pointer.
+E_E-
Editor command ERASE BACK: E- erases the character to the left of the pointer.
+E_F
Editor command FIND: F/text/ locates the next occurrance of text.
+E_G
Editor command GET: G inserts the next complete line typed at the console
                      in front of the current line.  G* to input multiple lines
                      terminated by a colon.
                    Failure Condition: The line starts with a colon (:).
+E_I
Editor command INSERT: I/text/ inserts the text to the left of the pointer.
+E_J
Editor command JOIN: J joins the next line onto the end of the current line.
+E_K
Editor command KILL: K deletes the current line.
+E_L
Editor command LEFT SHIFT: L moves the pointer left one character.
+E_M
Editor command MOVE: M  moves the pointer is moved the the start of the
                        next line.
+E_M-
Editor command MOVE BACK: M- moves the pointer to the start of the
                             previous line.
+E_P
Editor command PRINT: P prints the current line on the console.
                        When repeated (e.g. P4) a MOVE is performed before the
                        second and subsequent printings.
+E_R
Editor command RIGHT SHIFT: R moves the pointer right one character.
+E_S
Editor command SUBSTITUTE: S/text/ substitutes text for the text string last
                                   located using F, V, or U.
+E_T
Editor command TRAVERSE: T/text/ moves the pointer past the next occurrance
                                 of text.
+E_U
Editor command UNCOVER: U/text/ deletes characters up to but not including
                                the next occurrance of text.
+E_V
Editor command VERIFY: V/text/ does nothing.
                       Failure condition: the pointer is not immediately to the
                                          left of the given text.
+E_X
&E_Y
&E_Z
User-defined editor command: X,Y and Z  replaced by the string previously
 specified by an editor command %X=.......,
                                %Y=.......,
                             or %Z=.......
+E_%C
Editor command CLOSE: %C terminates the editing session and causes the
                         updated output file to be generated.
+E_%F
Editor command FULL MONITORING: %F enables full command monitoring.
+E_%L
Editor command LOWER CASE: %L causes subsequent text locating commands to
                              distinguish between upper and lower case letters.
+E_%Q
Editor command QUIET: %Q turns off command monitoring.
+E_%S
Editor command SWITCH INPUTS: %S switches between primary and secondary input.
+E_%X
&E_%Y
&E_%Z
Editor macro definition commands: %X, %Y and %Z are used to specify strings
                                  to be used whenever X, Y, or Z are used
                                  as commands. E,g, %X=f/jim/s/bert/
+E_()
&E_(
&E_)
Editor brackets: A sequence of editor commands in brackets is treated as
                 a single command for the interpretation of failure conditions
                 of commands within the brackets.
+E_,
Editor comma: A comma separates alternative command sequences.
+E_*
&E_0
Editor indefinite repetition: A repetition count of * or 0 causes the
                              command to be repeated until it fails.
+E_\
Editor failure inversion: \ after a command produces a new command which
                           has the same effect as the original command except
                          that the new command fails if the original
                          command would have succeeded.
+E_?
Editor ignore failure: Any failure condition caused by the previous
                       command is ignored.
+COMPARE
&Comparing files
&File comparison
&Differences
&changes

This command causes the contents of the two text files specified as  inputs to
be compared and any discrepancies to be noted on the output stream.
   COMPARE file.new,file.old
   Compare file.new,file.old/lp:differs
+Compilation
&Compilers
&compiling
&compiling programs
&compiling programmes
Source programs may be compiled using a general command of the form:
   Compiler(parameters) Source/Object,Listing
where 'compiler' stands for one of the supported compilers.
The currently supported compilers are:
      Imp      - The IMP77 compiler
      Fortran  - The Fortran77 compiler (pre-release only)
      Pascal   - The Pascal compiler    (pre-release only)

See also:   Help Imp
            Help Fortran
            Help Pascal
            Help Compilation parameters
            Help Run
+IMP
The IMP compiler is called using a command of the form:
            IMP(compilation parameters)  source/object,listing
The executable object file is given the same name as the source file but with
the extension .EXE unless explicitly specified otherwise.
If the source file specifed does not exist and has no extension, .IMP is
appended then that file is tried.
+Compilation parameters
&Compilation parameter
&Compiler parameters
&Compiler parameter
&compiler options
&Compiler option
&Compilation options
The optional parameter to commands which invoke the standard compilers
comprises a list of options.
Three basic compilation options specify an initial state which may be modified
by further options - the order is thus significant.
   Initial states are defined by:
      DEFAULT:   include all checking code and full diagnostic data tables
      OPT:       remove all checking code and reduce size of diagnostic tables
      TRUSTED:   as OPT but diagnostic tables completely removed
   Modifiers are:                        (can be inverted by prefix NO)
      ASSIGN:    check for use of unassigned variables
      ARRAY:     check for array subscripts out-of-bounds
      CAPACITY:  check for truncation when storing strings, shorts, bytes
      BRIEF:     generate a summary listing with only procedure headings
   For example:    IMP(ARRAY,NOASSIGN,BRIEF)   pgm1/,t:
+Fortran77
This command is not generally available yet.
+Pascal
This command is not generally available yet.
+run
&running programs
&running programmes
&execute
&executing programmes
&executing programs
&do
Programs are run by giving a command of the form:
      PROG ...............
which causes the file "PROG.EXE" to be loaded and run.
The interpretation of the remainder for the line (.......) is
dependent on the options set in the object file (PROG.EXE);
By default the interpretation is the the line is either of the form:-      
             (parameter) <stream definition>
 or:-        <stream definition>
         or:-        -parameter
The parameter (or the null string) is made available to the program and the
required streams are set up.
Input stream 1 and output stream 1 are selected before the program is entered.
See also:   Help Streams     Help Set
            Help Option      Help Files
+STOP
&Stopping
&logging off
&finishing
&QUIT
&quitting
&BYE
The command STOP stops the process and logs the user off.
All temporary and volatile files are deleted.
However, if this command is given from within a command file,
see HELP COMMAND FILE, the effect is simply to terminate the execution of that
file. Subsequent commands are taken from the user's terminal.
+FILES
&Files
&DIRECTORY
&index
The format of the FILES command is:
      FILES            - for a listing of the names of all of your own files
      FILES fred:      - for a listing of another user's files.

The command produces the listing in alphabetical order in several columns across
the page. The output produced may be altered (with both of the above forms), by
appending a '!' or '?' to the command, as shown below:
   FILES!  or  FILES fred: !  - An extended listing is produced, one file
                                per line, with additional information.
   FILES?  or  FILES jim: ?   - A '2-D' listing: filenames vertically,
                                with extensions horizontally.
A star (*) may be used as a wild-card to select the owner, filename or
extension for all the files which match the rest of the parameter.
E.g. Files *.imp  will list the names of all of the files in the current
directory with the extension .imp;  Files  *:RULES.*  will list the names of all
the files in the whole file system with filename RULES and any extension.

See also:      Help Fileinfo      Help Filenames    Help Temporary files
+FILEINFO
A FILE is an ordered collection of data bytes (8 bit quantities).
The interpretation of these bytes is totally dependant on the program
using the file; the system imposes no restrictions on the contents of files.
See also:      Help Creating files      Help Editing
               Help Delete              Help Rename
               Help Files               Help Dump
               Help Filenames           Help Directory
+MAIL
&Messages
&MESSAGE
Text messages may be sent between users.  (See HELP TELL). If a message is
received while a user is logged on, the line "***ACOUNT: mail from ???" will be
displayed on the recipient's console. (Where "???" is the sender's username).
   Messages sent to users when they are not logged on are queued up. When the
user next logs on a the message "You have new mail" will be displayed on the
console.
   Mail sent at any time may be read by giving the command MAIL. The program
steps through all pending messages.  Once a message has been read it may be
deleted.  If it is not deleted it will continue to appear when the MAIL program
is run in future.
   Two variants of the MAIL command are provided.

MAIL?      -   This simply displays the number of queued messages
MAIL!      -   This shows when and from whom any pending messages were sent.

+TELL
&SEND
&NOTIFY
The command TELL may be used to send messages to other users.
            Command: TELL username      e.g.  TELL ALAN  or  TELL THU5
The user is then invited to type a message in on the console.  No prompt is
issued for the lines of the message.  When the entire message has been typed
the program is stopped by typing Ctrl+D.

To mark a message as being about a particular subject, use:
            Command: TELL(subject) username   e.g. TELL(bug report) FRED

To send files to other users, the full form of the TELL command is:
            Command: TELL(subject) file / username
      e.g.  Command: tell(compiler bug) testprog / IMPD
        or  Command: tell /fred:   {file defaults to T:, the user's console,
                                    colons in usernames are optional}
For very short messages consisting only of a 'subject' line that the user
wishes broadcast immediately to the recipient's console rather than being
queued as normal mail, use:
   Command: TELL(up to 19 chars) username!  e.g. TELL(coffee time?) fred!
+FILENAME
&Filenames
&file
&NAME
In general filenames take the form:      UNIT_OWNER:FILE.EXT
where:  UNIT    is the name of the disc unit on which the file resides
        OWNER   is the name of the owning process
        FILE    is the file name, which comprises a letter or a dollar
                optionally followed by up to seven letters or digits.
        EXT     is an optional extension of up to 3 letters or digits.

Within filenames lower case letters are treated as upper case. If the UNIT is
not specified all available units are searched until the specified OWNER is
discovered. If the OWNER is not specified the current user is assumed. On
creation the system marks files as being volatile by following the name with a
hash(#). Only when the file is closed will the file be renamed properly and any
old version deleted. Filenames starting with a dollar are considered temporary.
Temporary and volatile files are deleted when the process logs off, or the
command PURGE is given.
Examples of filenames:          DATA                      NEWS.TXT
                                PETER:prog.IMP            SYSTEM:NEWS
                                arch_system:help.txt      ARCH_PETER:VERSION1
                                $program.tst
+Ctrl
&Ctrl+
&Control
&Control characters
&Control Character
The notation  Ctrl+A  is used to specify characters generated at the terminal
by typing the letter specified (in this case A) while holding down the
CONTROL shift key (commonly marked CTRL).
E.g. Ctrl+X is generated by holding down CTRL and typing X.
+rename
&newname
&change
   The command RENAME may be used to change the name of a file.
The form of the command is:   RENAME oldname/newname
The command will fail with an error message if file NEWNAME already exists.
Wildcards may be used: 
   Command: rename *.imp/*.old           All .IMP files become .OLD files
   Command: rename xxx.imp/yyy.*         XXX.IMP renamed YYY.IMP
+CONSOLE
&Keyboard
&console conventions
&TT
&T
&TTY
&input
&terminal
Information about the special characters which are used to control the operation
of interactive terminals may be obtained by giving the command 
HELP special-character, where 'special-character' is one of the following
mnemonics:  Backspace     BS           CAN         Cancel
            CR            Ctrl+D       Ctrl+E      Ctrl+G
            Ctrl+N        Ctrl+O       Ctrl+P      Ctrl+Q
            Ctrl+R        Ctrl+S       Ctrl+T      Ctrl+X
            DC1           DC2          DC3         DC4
            DEL           DLE          ESC         Escape
            LF            Line feed    Return      SI
            SO            TAB
+Copy
&copying files
&C
&transfer
The command COPY may be used to copy any input stream to any output stream. 
Data from a second input stream, if specified, will be concatenated onto the end
of the output stream.
The command takes the form:
      COPY input1,input2/output

The files take defaults as follows:
              input1 = T:       the user's terminal
              input2 = N:       the null file
              output = T:       the user's terminal

Examples:    Copy file1/file2
             Copy heading,letter/final
             Copy t:/newfile

+Be
&become
&change hats
The system allows a user to pretend to be logged on as a different user. This
is useful if a lot of work is to be done in a short period on another user's
files.  The command:  BECOME Fred  will prompt you for Fred's  password (which
is not echoed).  Subsequently all unqualified filenames refer to files in
FRED's directory.  Your own files may be referred to by using the "USER:file"
notation.   To remind you of the changed state of the process, the subsystem
command prompt becomes the appropriate username.  In the example, the prompt
would change to "Fred:".  The STATE command will indicate the directory
currently in use at any time. 
The command:  BECOME  with no username parameter specified will return the
process to its 'home' directory.  The command prompt is restored to its
original value.
The form:  BECOME user,pass  may be used for brevity. 

+line printer
&lp:
&lp
&printer
Any output files specified as having the owner LP: will be offered to the
printer spooler when the file is closed.
e.g.       COPY FRED.IMP/LP:OUTPUT.XXX
will send a copy of the file "FRED.IMP" to the printer and label it
           "OUTPUT.XXX".
If no name is required on the output the form "LP:" may be used.
      e.g. COPY FRED.IMP/LP:

A file may be sent to the printer without copying (resulting in the file being
deleted) by offering the file to the printer using the command OFFER.
 e.g.      OFFER FRED.IMP/LP:OUTPUT.XXX
+paper tape punch
&pp:
&pp
&punch
&paper punch
&paper tape
Files may be sent to the paper tape punch in a manner analogous to that from
sending files to the printer; see HELP LP.
   e.g.   COPY FILE/PP:FILE
          OFFER TAPE.TMP/PP:OUT.ABC
+stream
&Streams
&environment
&Logical units
The environment for a program may be specified in the command which invokes the
program. This is done using a stream specification of the form:
   INPUT1,INPUT2,INPUT3/OUTPUT1,OUTPUT2,OUTPUT3
where INPUTx defines input stream 'x' and OUTPUTx defines output stream 'x'.
If any of the streams is not specified the default stream assignment is taken.
The defaults are:  T:, Null:, Null: / T:, Null:, Null: 
+PASSWORD
&PASS
The user's password may be changed by a command of the form:
      SET PASSWORD=<new password>
<new password> is any sequence of up to 6 letters or digits starting with a
letter.
   e.g.   SET PASSWORD=SECRET
+delete
&destroy
&remove
&del
&purge
&kill
&deleting files
&destroying files
&removing files
The command:      DELETE <file name list>
where <file name list> is a list of file names separated by commas, can be used
to delete unwanted files. If the command is given as DELETE *, a prompt is
given for every file in the owner's index. A reply of YES causes the file to be
deleted, any other reply leaves the file alone.
The command PURGE may be used to delete temporary and volatile files.
+null
&Null:
&n:
&n
&null stream
&null file
&null input
&null output
&Drain
&Sink
The null file is represented by N: or Null:. On input it immediately signals
end-of-file, and any output sent to it is discarded.
+ESC
&Escape
&BEL
&Ctrl+G
ESC and BEL (Ctrl+G) are equivalent.  Both signal to the system that the user
wants to interrupt the currently executing program, either to halt it or to
convey some information to it asynchronously.  The system responds to ESC by
prompting "Int:" at the start of a new line.  See "Help int" for details of
the valid replies to this prompt.  (The normal reply is "." full stop followed
by carriage return, which aborts the currently executing program).
+interrupt
&Interrupts
&int
&Break
The replies to the prompt Int: (see HELP ESC) are normally made available to
a process in the external string variable Console Int.
However several of the replies are reserved  for use  by the system. These are:
      Int:.         (Int full stop)
                    Terminates the running program and returns the process to
                    command level.
      Int:?         (Int question mark)
                    Terminates the running program and invokes the run-time
                    monitor to produce diagnostics (if they are available).
      Int:!         (Int exclamation mark) 
                    For convenience this interrupt may be generated by striking
                    the escape key (<esc>) twice in which case no <return> is
                    necessary. It has the normal significance of any other
                    interrupt, except that it is used in the editor to force the
                    command currently being executed to fail, and hence request
                    another command.
+option
&Options
&command interpretation
The command OPTION may be used to modify the interpretation of the command line
associated with the execution of an object file.
The command takes the form:  OPTION(<option list>) FILE
where FILE is the name of an EXE file (i.e. .EXE assumed).
The current options are:

     Decode              Open              Upper          Spaces 
   NoDecode            NoOpen            NoUpper        NoSpaces
     Stack=              Time=

See also:  Help Option_Decode         Help Option_Open
           Help Option_Upper          Help Option_Spaces
           Help Option_Stack=         Help Option_Time=
+Option_Upper
&Option_NoUpper
The UPPER option causes all lower-case letters in the command parameter
to be converted to their upper-case equivalents.
NOUPPER causes letters to be left as typed.
+Option_Spaces
&Option_nospaces
The NOSPACES option causes all spaces to be removed from the command parameter.
SPACES causes the spaces to be retained.
+Option_Decode
&Option_nodecode
DECODE specifies that the command line is to be interpreted by the usual syntax
rules.
NODECODE specifies that the remainder of the command line is to be passed to the
program as a parameter.
+Option_Open
&Option_noopen
OPEN specifies that the files in the stream definition part of the command are
to be opened before the program is entered.
NOOPEN results in the stream definition part being decoded but the files
will not be opened before the program is entered.
The OPEN option is ignored if NODECODE is selected.
+Option_Stack=
&Option_Stack
The stack option is used to control the size of workspace made available
to a command.
If NN is positive it specifies the minimum size of stack (work area) required by
the program. If the value specified by a previous SET-STACK= command is greater,
that value will be used.
If NN is negative its absolute value represents the exact size of stack
required, regardless of the value defined by a SET-STACK= command.
NN is specified in Kilobytes.
+Option_Time=
&Option_Time
The Time option is used to control the total execution time allowed for the
command. NN specifies the time limit (in seconds) to be imposed on the program.
If NN is negative its absolute value represents the time limit in seconds
which overrides any SET TIME= command currently in effect.
If NN is positive it specifies a minimum time limit which will be extended to
the current value of SET TIME= if necessary.
+SET
&Prompts
&prompt
&cpulimit
&cpu
&stack
&width
&time
&space
&timelimit
The command SET may be used to set various system parameters. The form
of the command is:
          SET <value list>
where <value list> is a list of value settings separated by commas.
The current parameters are:
   Time=         Stack=    Password=    Width=   Errorfile=
   Timelimit=    TAB=      Tabs         Quick    Dump
   Monitor       Verify    Prompt=

See Also:   Help Set_Time      Help Set_Stack      Help Set_Password
            Help Set_Width     Help Set_Tab        Help Set_Tabs
            Help Set_Quick     Help Set_Dump       Help Set_Errorfile
            Help Set_Monitor   Help Set_Verify     Help Set_Prompt
+Set_Prompt
The command: Set Prompt=....
causes the system to use the string "..." as the prompt it issues when
asking for a command line from a terminal.  (The default prompt is
"Command:").  The command "BE" also changes the command prompt, see
Help Be
+Set_Quick
&Set_Noquick
&Quick
&Noquick
The command: Set Quick causes subsequent external references to be
satisfied by examining the standard subsystem first, with the
files in the library list being examined last.
The command: Set NoQuick causes the library list to be examined first,
with the standard subsystem being searched last.
Note that in general the NoQuick option will slow down the loading
of most system-provided commands and programs.
See also:   Help Lib
+Set_Dump
The command: Set Dump   enables a dump of register contents and the code area
about the failing instruction on a contingency. This facility is usually only
of interrest to fairly experienced programmers. 
The command: Set NoDump disables the dump.
+Set_Monitor
The command: Set Monitor  causes each command execution to be followed by a
report of the time of day and the processor time used by the last command (or
since the previous Set NoDump command).
The command: Set NoMonitor  disables the facility.
+Set_Errorfile
&Errorfile
&Errorfile=
&SET_Errorfile=
The command: Set Errorfile=filename  causes subsequent diagnostic output to be
sent to the nominated file. A message is sent to the terminal whenever such
output is generated.
Giving a null filename (i.e. SET ERRORFILE= ) causes diagnostic output
to be sent to the terminal.  This is the default case.
+Set_Verify
The command: Set Verify  causes command lines to be echoed onto the report
stream after being expanded (for aliases etc.). This is useful when command
files are being obeyed.
The command: Set NoVerify inhibits the echoing. Note that for interactive users
Set NoVerify is the default while for Batch jobs Set Verify is the Default.
+Set_Time
&Set_Time=
&Set_Timelimit=
&Set_Timelimit
Set Timelimit=nnn  sets the program execution time limit to nnn seconds.
                   (default=30 seconds).
                   TIMELIMIT may be abbreviated to TIME.
This setting may be overridden for any particular command by use of
the Option(TIME=...)  command.
The command SET TIME=? will cause the current value of the time limit
to be output.

See also:   Help Option      Help Option_Time=
+set_Stack
&Set_Stack=
Set STACK=nn       sets the stack size to nnK bytes (default=60K bytes).
This setting may be overridden for any particular command by use of the
Option(STACK=...) command.
The command SET STACK=? will cause the current value of the stack size
to be output.

See also:   help Option      help Option_Stack=
+Set_Password
&Set_Pass
Set PASSWORD=pppppp    makes "pppppp" the user's password.
+Set_Width
&Set_Width=
Set WIDTH=nnn          sets the terminal output line limit to nnn characters
                       (default=72).
Lines longer than this will be broken on output after each nnn characters.
Set Width=0   inhibits any such extra line-breaks in terminal output.
+Set_Tab
Set TAB=a+b+c...       Defines up to 10 tab stops incrementally.
                       I.e. the first tab stop is at column a,
                            the second is at column a+b,  etc.
Initially the tab stops are set by:  Set TAB=3+3+3+3+3+3+3+3+3+3
The interpretation of TAB on input is furthur controlled by the
SET TABS and SET NOTABS commands.

See also:   Help Set      Help Set_Tabs
+Set_Tabs
&Set_Tab
&Set_NoTab
&Set_NoTabs
Set TABS               Enables tab stops. On input from the keyboard
                       Tab will be converted into as many spaces (at least one)
                       as necessary to move to the next tab stop as defined
                       by SET Tab=....
                       Once the 10'th tab stop has been reached each TAB will
                       be converted into 3 spaces.
Set NOTABS             Disables tab stops. On input, the TAB character
                       will be replaced by three spaces.

See also:   Help Set      Help Set_Tab
+topic
The parameter to help should be the name of a command or a particular topic for
which information is required.
+PERMIT
&Permissions
&permission
&access
The command: PERMIT FILE=<permissions> may be used to alter the accessibility of
the specified file. Each user of the system has a set of access rights given by
the system manager; the rights are denoted by the letters A-H. Access to other
users' files is only permitted if that file has been given any permission
corresponding to the rights of the requesting user. In order to prevent
inadvertent destruction of files, the user must give files the permission D
before they may be deleted. Access to directories may be given by giving
DIRECTORY in place of a file name.  E.g.
      PERMIT DATA.1=ABC
      PERMIT DATA.2=D
      PERMIT DIRECTORY=G
The commands STATE, FILES, and ANALYSE may be used to discover the current
settings of access rights and directory and file permissions.

See also:   Help Files      Help Analyse      Help State
+OFFER
&SEND
&GIVE
&Spooling
A file may be sent to a queue for future processing by giving a command
of the form:     OFFER FILE/QUEUE:NEWNAME
The queues which are currently available are:
                 LP:       - the line-printer queue.
                 PP:       - the paper-tape punch queue.
                 BATCH:    - the batch (background) job queue.

The file will be destroyed when the queue server takes the file.

For example:   OFFER BOOK.TXT/LP:BOOK  sends the file BOOK.TXT to
                                       the line-printer.
+OS32MT
&OS-32MT
&OS32-MT
&EMULATE
&EMULATOR
&FORTRAN
&BASIC
 The command OS32MT may be used to enter the OS-32MT emulator.   The commands
so made available are:
   BASIC
   CAL
   COBOL   (not yet implemented)
   FORTGO  (compile and go Fortran 5)
   FORTRAN (compile and assemble FORTRAN 5)
   LINK    (build store image 'task')
   TET     (gives direct access to TET)
   RUN
   SET     (modify emulator parameters e.g. time, store, i/o streams etc)
   STOP    (return to standard subsystem)
This utility can also run off-line work prefixed by //OS32 instead of the
standard //JOB card.
For further details:  COPY OS32:DOCUMENT.
+TAB
Tab stops may be set using the command: SET TAB=a+b+c+d......
where a, b, c, d.... are increments in spaces from the previous tab stop
(initially 0).
 e.g. SET TAB=6+4+4  sets tabs at columns 6, 10 and 14.
There are 10 tab stops in all; any not specified are filled in
increments of 3. Once the final tab stop has been passed the tab key
acts as three spaces.
 Before the tab settings may be used the feature must be enabled by the
command: SET TABS. The feature is disabled by the command: SET NOTABS
after which the TAB character will cause three spaces to be input  (the
default condition).
+list
&listing
A line-numbered listing of a source file may be produced by
giving the command:   LIST filename
By default the listing is sent to the printer.
In the near future the command will accept a parameter
containing a list of directives:-
   lines=????       to set the number of lines on a page
   width=????       to set the number of characters on a line
   columns=???      to set the number of columns to be printed.

The default settings are (lines=60,width=120, columns=1)
+CLEAN
The CLEAN command causes the system to prompt the user with the name of
each file in the users' directory.  A null reply (just typing RETURN)
moves on to the next file.  A set of commands are available within CLEAN
to delete, rename etc. the current file. To start the program, just
type:
                  CLEAN
   Information about the commands available is available within the
program, by typing HELP in reponse to its prompt.
   If a user has access to another's directory, it may be CLEANed using
the following form of the command:
                  CLEAN   (username )
   After CLEANing, the user is automatically returned to his home
directory.
   Appending a '!' to either form of command will cause CLEAN to output
extra information about the physical placement of files on the disc.
Examples:         CLEAN                  clean out home directory
                  CLEAN (EXTN_ENGINR)    clean another users' directory
                  CLEAN!                 clean with extra info
                  CLEAN (FRED)!          poke elsewhere
+Link
&Linking
&tet
&tasks
Mouses supports dynamic linking, that is references to an external
subroutine are only satisfied when it is called for the first time.
At this point the loader automatically searches a list of object files
defined by the LIB command for the procedure.  (If it is not found, an
event is signalled).
See also: Help Lib
          Help Compiling
          Help Run
          Help Events
+Library
&lib
&libraries
&external routines
&externals
&External
The LIB command is used to maintain a list of up to seven program files
containing external extry points. When the loader receives a request for
an external object this list is searched in order. If the entry is not
found the current subsystem procedures are checked.
The command has three forms:
   1:   Lib .none              - this clears the list
   2:   Lib                    - this prints the current list of files
   3:   Lib item-list          - this inserts or removes items.

Item-list is a list of items separated by commas, where each item is:
    File   in which case FILE.EXE is added to the list,
or -File   in which case FILE.EXE is removed from the list (if possible)

Whenever an item is added to the list it is added at the end, and any
duplicates are removed. In this way the library list may be reordered.

   E.G.   Lib Maths,Hypers,-testlib
+Let
&Alias
&assign
&Abbreviation
&Abbreviations
Abbreviations for commands may be defined using the LET command.
e.g.      Let F=Files
Once an abbreviation has been defined its occurrence in the command-verb
position of a command line results in the expansion being used.
e.g. Given the definition of F above, the command line:  F System:
will result in the execution of the command: Files System:
Abbreviations may be redefined at any time, and may be removed
by assigning a null definition e.g.  Let F=
Note that the definition is never expanded furthur so that the following
sequence will swop the definitions of the commands A and B:
   Let A=B
   Let B=A
The form:   LET Abbr   will display the expansion of the abbreviation Abbr
while:      LET        will display the expansions of all abbreviations.
An abbreviation embedded in a command line is expanded if prefixed by '@'.
e.g. Command: let L=$longfile
     Command: copy @L/Lp:@L  =>  copy $longfile/lp:$longfile
+Command Files
&Command File
&Css
&Css Files
&Css File
A file of commands may be executed by giving the file the extension .COM
and giving the filename (without the .COM) as a command verb.
E.g. Assume a file SHOW.COM contains:
Files
Lib
Let
The command: SHOW will cause the three commands FILES, LIB and LET to be
executed in order.
A command file may be given parameters: a list of strings separated by
commas. Within the command file each string may be referred to by '@n'
where 'n' is the position in the list of the required parameter. E.g.  
SHOW User, P   will result in @1 being the four characters User, and @2
being the character P. By convention @0 is always replaced by the
nesting level of command files, i.e. the first command file has @0 as 1,
any command file invoked from within the first will have @0 as 2, and so
on. The order of execution of the commands in a command file may be
controlled by special directives. See Help Sequence Control
+Sequence Control
Looping and branching is available within command files,  see:

   Help $IF      Help $ELSE      Help $FINISH      Help $EXIT
   Help $UNLESS  Help $LABEL     Help $GOTO        Help comments

+comments
Comment lines prefixed with an exclamation mark "!" are permitted within
command files.  They are ignored.
+$IF
Inside a command file the $IF command may be used to select one of two
alternative command sequences. If the condition following $IF is
satisfied the group of statements up to the matching $ELSE or $FINISH is
executed. If $ELSE is found the statements following it up to the
matching $FINISH will be executed.
 If the condition is not satisfied the statements up to the matching
$ELSE or $FINISH are skipped and then statements after an $ELSE are
executed.
 There are two forms of condition:
   1:   EXISTS Filename    - this is satisfied if the file exists.
   2:   string .EQ. string - this is satisfied if the two strings
                             are identical ignoring case dictinctions.

E.g.   $IF exists Data.txt
       $IF @1 .EQ. do it all
+$UNLESS
This is the same as $IF except that the condition is inverted.
+$ELSE
See $IF
+$FINISH
See $IF
+$EXIT
This causes the command file to terminate immediately.
+$LABEL
$LABEL tag   causes the character string 'tag' to identify the current
             point in the command file.
See also HELP $GOTO
Jumping to a label outwith the current command file is not allowed.
Label tags are shared between all command files and nesting levels.  To
generate unique labels within recursive command files add '@0' as a suffix
to the label.  This is expanded as the current nesting level and will make
the labels unique.

Example:     $Label top
                Printstring Hello
                !In an infinite loop
             $goto top
+$GOTO
$GOTO tag    causes control to be transferred to the point in the command
             file identified by the character string 'tag'.
See also HELP $LABEL
+Events
&Errors
&Event
&Subsystem events
The following events are signalled by the subsystem:
Event   Subevent  Extra
  3         1       Sym     Symbol Sym in numeric data (from READ)
  5         5       Type    Illegal type of parameter to READ
  8         8               Load fails (cannot find an external subroutine)
  9         1               Input Ended  (end of file encountered)
  9         2       St      Illegal stream St
  9         3       St      Illegal Direct Access Channel
  9         4               Invalid filename in OPEN
  9        10       N       Director Error N
 10         1               Pack fails -- illegal filename
 10         2               Rename fails
 10         3               Create fails
 10         4               Entry to file of externals
+Dump
&Filedump
The command DUMP may be used to examine the contents of files.
The general form of the command is:   DUMP(parameters) Filename/Output
Where 'parameters' is a list of items of the form:
   HEX            - the dump is wanted in hexadecimal
   OCTAL          - the dump is wanted in octal
   ASCII          - the dump is wanted interpreted as being ASCII characters
   EBCDIC         - the dump is wanted interpreted as being EBCDIC characters
   PAGED          - the output is to be paginated
   PAGE=n         - each output page contains 'n' lines
   WIDTH=n        - each output line can hold 'n' characters
   DISC=dev       - dev specifies a unit which is to be dumped
   n..m           - dump blocks 'n' to 'm' inclusive
   ..m            - dump blocks 0 to 'm' inclusive
   n..            - dump from block 'n'
   n              - dump block 'n'
If the command is followed by an exclamation mark, each line of the dump
will be followed by the interpretation of each byte as an ASCII character.
Similarly, following the command with a question mark will cause interpretation
of each halfword as a "packed" 3-character string.
For Example:   DUMP(HEX,1..5) Testfile
+God
&god almighty
&jesus
Please apply to deities directly, not via MOUSES.
+Love
&Sex
MOUSES, being of neutral gender, can offer no advice on this subject.
+Buses
What is this that roareth thus?
Can it be a Motor Bus?
Yes, the smell and hideous hum
Indicat Motorem Bum...
How shall wretches live like us
Cinci bis Motoribus
Domine, defende nos
Contra hos Motores Bos!
+SVCs
&SVC
&SVC list
This is a short summary of the parameters taken by and the general effect of
the supervisor calls (SVCs) supported by the MOUSES supervisor.
SVCs with numbers greater than 100 may only be executed by a privileged
process.

   1  - stop
   2  - prompt flags<p1> text<sp2>
   3  - console input
   4  - console output text<sp1>
   5  - locate process id<p1>
   6  - kill i/o
   7  - date & time  -> date<sp1> time<sp4>
   8  - create segment size<p2> seg<p3>
   9  - destroy segment n<p1>
  10  - load file
  11  - segment info seg<p1>
  12  - performance info
  13  - unpack date
  14  - get proc info proc<p1> -> powner<p1>,cputime<p2>, store<p3>,
                                  uptime<p6>
  15  - load file
  16  - poff   sact = reply wanted (0 = any)
  17  - pack   file<sp1> -> p1,p2,p3<owner>
  18  - unpack p1,p2,p3<owner> -> file<sp1>
  19  - info seconds<p1> users<p2> cpu<p3>
             date<p4> owner<p5> version<p6>
  20  - to director & wait
  21  - set time limit <p1> seconds from now
  22  - message to potter
  23  - wake after p1 .01 secs.
  24  - stack contingency vector<p1>
  25  - unstack contingency to<p1>
  26  - fire contingency weight<p1> at<p2>
  27  - resume from contingency vector<p1> repeat<p2>
  28  - info 2 users<p1> clevel<p2> console<p3> priv<p4>
  29  - set param<p1> value<p2>
  30  - validate addr<p1> size<p2>
  31  - detach process
  32  - protect segment<p1>
  33  - delete segs<p1>
  34  - pack date <sp1> -> <p1>
  35  - unpack time <p1> -> <sp1>
  36  - user message to account
  37  - priv
 101  - disc read discaddr<p1> storeaddr<p2> disc<p3> process<p4>
 102  - disc write     ""            ""       ""         ""
 103  - set swop disc
 104  - operator message
 105  - MT operation
 106  - read segment
 107  - write segment
 108  - disc status unit<p3>
 109  - start process console<p1> owner<p2> disc<p3>
                      pass<p4>file<p5> reason<p6>
 110  - get resident buffer
 111  - lp demon
 112  - pt demon
 113  - broadcast
 114  - get unit no
 115  - pon (no wait)
 116  - pon
 117  - read real <p1>
 118  - write real addr<p1> value<p2>
 119  - define potter
 120  - tell process<p1> text<p2>
 121  - inhibit service<p1>
 122  - uninhibit service<p1>
 123  - boot  dev<p1> restart<p2>
 124  - privilege process<p1> priv<p2>
 125  - hazard/protect dev<p1> prot<p2>
 126  - stop process<p1>
 127  - lk demon
 128  - define accountant
 129  - resume & time out
 130  - CR demon
 131  - SHUTDOWN process P1
 132  - claim terminal P1
+Yourself
Thank you.
+42
Tricky!
+Reincarnation
First, drop dead,
Then,  it's all up to you.
+$
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
%begin         {help file generation program}
   %recordformat hfm(%string(31-9) key, %byte Flag, %integer start, finish)
   %record(hfm)%array keys(0:1000)
   %record(hfm)%name K
   %string(31-5) key
   %integer j,l, keyn, n, token, sym, last
   %integer start pos, end pos, lastn, bias
   %integer pos = 0
   %routine get sym
      readsymbol(Sym)
      pos = pos+1
   %end
   %routine get key
      %integer s
      key = ""
      %cycle
         get sym
         %exit %if sym = nl
         sym = sym-32 %if 'a' <= sym <= 'z'
         key = key.tostring(sym)
      %repeat
   %end
   %routine locate key
      start pos = pos
      %cycle
         end pos = pos
         get sym
         %exit %if Last = NL %and (sym = '+' %or sym = '&')
         Last = sym
      %repeat
      Token = Sym
      get key
   %end
   %routine Sort(%integer a, b)
      %record(hfm) Dump
      %integer l, u
      %while a < b %cycle
         l = a;  u = b
         dump = Keys(u);  ->find

up:      l = l+1;  ->found %if l = u
find:    ->up %unless Keys(l)_Key > dump_key
         Keys(u) = Keys(l)
down:    u = u-1;  ->found %if l = u
         ->down %unless Keys(u)_Key < dump_key
         Keys(l) = Keys(u)
         ->up

found:   Keys(u) = dump
         l = l-1;  u = u+1
         %if l-a > b-l %start
            Sort(u, b);  b = l
         %else
            Sort(a, l);  a = u
         %finish
      %repeat
   %end
   %routine dump record(%integer n)
      %record(hfm)%name R
      %integer j
      R == keys(N)
      %if N # 0 %start
         R_start <- R_start+bias
         R_finish <- R_finish+bias
      %finish
      printsymbol(byteinteger(J)) %for j = addr(R), 1, addr(R)+31
   %end
   %on 9 %start
      newline
      %stop
   %finish
   keyn = 0;  lastn = 0
   select input(1)
   last = nl
   %cycle
      locate key
      %if token = '+' %start
         %while lastn < keyn %cycle
            lastn = lastn+1
            keys(lastn)_Start <- start pos
            keys(lastn)_Finish <- end pos
         %repeat
      %finish
      %exit %if key = "$"
      keyn = Keyn+1
      K == Keys(Keyn)
      K = 0
      K_Key = Key
      K_Flag = Token
   %repeat
   sort(1, keyn)
   reset input
   bias = (keyn+1)*32
   keys(0)_Finish = Keyn
   select output(1)
   dump record(j) %for j = 0,1,keyn
   %cycle
      readsymbol(sym);  printsymbol(sym)
   %repeat
%endofprogram
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          C!             }             	        NWfS    X`QK xgQK fZJ_fZX!t^Z} }    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  (QT    :      :H  ayu  "Z       
   # ; dQ@    ,z    ,E    M[	eE  y*}     Uf* ox     $                 
    $A1    0#
#	QD   RD   ?&A'"3A> . ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n2#XC   PC   '4"2$ #PC   '4"?1  &034C0  D   D   
C   w p ,W   P h$Q y  	w p 0$ 8AX8 h0 
!3C (0 a!0 z!%3P8 hӸ 8&8K  8Ҹ 8C y  *	w p ,X P pX8 P8 tAfX lŰ 
!:X hŠ +#4Š &!2#X hP lC P dA^y  ,	W  p TX Y  C P LX9  P9 P5Z8 ,) ,$8A #$Q LX LU P!3C XI LEZH ,) ,A  !#C XY PUZX ,Xi LeZh ,%$8A %Q PX9 LU9 P!3C <X PZ ,) ,A  !C X LZ ,XI PEZH ,*$8A C dXY PUZX , ,%$8A %aQi L$Q PX9 L[9 X  [ L	;#,XY  Xi PAX LP  #XY LXi AXI PPI C y  	g p 8eZh ,Pi ,X #7X8 |Q6 Q6 ȶ P 4'aPi 0#&aPi 0f  W   <Xi 0Ui 4 >y  /	w P (p NPH 0p} P ,$P Px #Xx W  ,$ A *$P \P x$aW   l$:P8 lAX dŰ +B06X xY \C*&P xZ ,X pP XH xEZH ,XX tPT C  8.A  !3C .$aQh \X \Z ,P 4,$8A ,AX8 d< C zXX \$aArW   X \&P |X ,X \P $aW   xXH \PH %QPX T#	&QPX TeAhXX TUX  :W   P haW   <" @ " @            &6@SVC LISTG                 &6@SVCSS                     +6@TT                        &9TABI                      +*TABL                      &h(i,TABSL                     &h(i,
TABULATIONT               &h(i,TAPE BACKUP              &6$9&TAPE DUMPING             &6$9&
TAPE DUMPSP                                         $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                                                                         LL     NGT                &ޕREMOVEY                                             $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                             H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        e help.txt/lp:helpdata
(v'+' ei//m, v'&'k,m)!
%c
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Helpgen Help.txt/Help.dat
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           %routine Sort Hash(%integer a, b)
      %integer Dump
      %integer l, u
      %while a < b %cycle
         l = a;  u = b
         dump = Hash(u);  ->find

up:      l = l+1;  ->found %if l = u
find:    ->up %unless Hash(l) > dump
         Hash(u) = Hash(l)
down:    u = u-1;  ->found %if l = u
         ->down %unless Hash(u) < dump
         Hash(l) = Hash(u)
         ->up

found:   Hash(u) = dump
         l = l-1;  u = u+1
         %if l-a > b-l %start
            Sort Hash(u, b);  b = l
         %else
            Sort Hash(a, l);  a = u
         %finish
      %repeat
   %end
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        %begin;            !decode for new imp
   %include "Sysinc:command.inc"
   %option "Noopen"
   %constinteger h = 16_FFFF
   %owninteger end = 0
   %recordformat parmfm(%shortinteger dsno, dact, ssno, sact, %c
                        %integer p1, p2, p3, p4, p5, p6)
   %recordformat procfm(%short   line, last line,
                        %integer ca, ca limit, table, table limit)
   %constinteger max procs = 300
   %record(procfm)%array proc(0:max procs)
   %record(procfm)%name thisp
   %integer ca, q, line, procs
   %integer event head, event limit
   %integer line head, line limit
   %recordformat hdfm(%shortinteger p1, p2)
   %recordformat headfm(%shortinteger pure size, gla size, code disp,
                                      lit disp, registers, main ep,
                        %record(hdfm) reloc, defs, specs, ldiag, vdiag)
   %ownrecord(headfm)%name head

   %integer j
   %integer code base, gla base
   %integer file base
   %integer current line
   %integer control
   %routinespec hex(%integer n)

   %string(15) controls, grot
   %string(63) source file, object file, listing file
   %routine connect object file(%string(63) file)
      %record(parmfm) p
      %integer k
      string(addr(p_sact)) = file
      svc(10, p)
      %if p_p1 # 0 %start
         select output(0)
         printstring("*Cannot load ".file)
         newline
         %stop
      %finish
      file base = p_p2;      !really seg+16
      gla base = p_p3
      head == record(file base)
      code base = (head_code disp&X'FFFF')*2+file base
      k = head_ldiag_p1
      k = k&16_7fff*2
      %signal 13,1 %if k = 0
      line head = k+head_ldiag_p2*2+file base
      line limit = k-2+file base
      event head = shortinteger(code base-2)&H*2+code base
      event limit = code base-2
!      line head = line head-shortinteger(line head)&H*2;      !????????
   %end
   %routine  hex(%integer n)
      %integer  j,k
      %for j = 1, 1, 4 %cycle
         k = n>>12&15;  n = n<<4
         %if k < 10 %then k = k+'0' %else k = k-10+'A'
         print symbol(k)
      %repeat
   %end
%routine decode line(%integer pc, to)
   %conststring(5)%array opcode(0:255) =
       "", "BALR", "BTCR", "BFCR", "NR  ", "CLR ", "OR  ", "XR  ",
   "LR  ", "CR  ", "AR  ", "SR  ", "MHR ", "DHR ", "", "",
   "SRLS", "SLLS", "CHVR", ""(5),
   "LPSWR", ""(3), "MR  ", "DR  ", ""(2),
   "BTBS", "BTFS", "BFBS", "BFFS", "LIS ", "LCS ", "AIS ", "SIS ",
   "LER ", "CER ", "AER ", "SER ", "MER ", "DER ", "FXR ", "FLR ",
    ""(4), "EXHR", ""(11),
   "STH ", "BAL ", "BTC ", "BFC ", "NH  ", "CLH ", "OH  ", "XH  ",
   "LH  ", "CH  ", "AH  ", "SH  ", "MH  ", "DH  ", "", "",
   "ST  ", "AM  ", ""(2), "N   ", "CL  ", "O   ", "X   ",
   "L   ", "C   ", "A   ", "S   ", "M   ", "D   ", "CRC12", "CRC16",
   "STE ", "AHM ", "",     "",     "ATL ", "ABL ", "RTL ", "RBL ",
   "LE  ", "CE  ", "AE  ", "SE  ", "ME  ", "DE  ", ""(2),
      "", "STME", "LME ", "LHL ", "TBT ", "SBT ", "RBT ", "CBT ",
       ""(8),
       ""(16),
   "SRHLS", "SLHLS", "STBR", "LBR ", "EXBR", "EPSR", "WBR ", "RBR ",
   "WHR ", "RHR ", "WDR ", "RDR ", "", "SSR ", "OCR ", "",
   ""(16),
   ""(16),
   "BXH ", "BXLE", "LPSW", "THI ", "NHI ", "CLHI", "OHI ", "XHI ",
   "LHI ", "CHI ", "AHI ", "SHI ", "SRHL", "SLHL", "SRHA", "SLHA",
   "STM ", "LM  ", "STB ", "LB  ", "CLB ", "AL  ", "WB  ", "RB  ",
   "WH  ", "RH  ", "WD  ", "RD  ", "", "SS  ", "OC  ", "",
   "TS  ", "SVC ", "SINT", "SCP ",  ""(2), "LA  ", "TLATE",
       "",     "", "RRL ", "RLL ", "SRL ", "SLL ", "SRA ", "SLA ",
    ""(3), "TI  ", "NI  ", "CLI ", "OI  ", "XI  ",
   "LI  ", "CI  ", "AI  ", "SI  ", ""(4)

   %routine show cc(%integer op, m)
      %if op = X'43' %start
         printstring("  GE") %and %return %if m=1
         printstring("  LE") %and %return %if m=2
         printstring("  EQ") %and %return %if m=3
      %else
         printstring("  LT") %and %return %if m=1
         printstring("  GT") %and %return %if m=2
         printstring("  NE") %and %return %if m=3
      %finish
      write(m, 3)
   %end
   %routine decode
      %switch ops(0:15)
      %integer n, r1, x, d, op, x2, xop
      %string(7) opc
!
      n = shortinteger(pc);  pc = pc+2
      print string("        | ")
      hex(pc-2-code base);  printstring("  ")
      op = n>>8&255;  opc = opcode(op)
      r1 = n>>4&15;  x = n&15
      hex(n);
      %if length(opc) = 0 %start
         newline;  %return
      %finish
      xop = op>>4
      ->ops(xop)

ops(0):ops(1):ops(2):ops(3):ops(9):;  ! rr and short formats
      spaces(8+2);  printstring(opc)
      %if x'20' <= op <= x'23' %start
         show cc(op, r1);  printsymbol(',')
         x = -x %if op&1 = 0;   ! ...it's a backward jump
         space
         hex(pc-2-code base+x*2)
      %else
         write(r1, 3);  printsymbol(',')
         write(x, 4)
      %finish
      newline;  %return

ops(12):       ! bxh, bxle, lpsw or halfword immediate
   %if op&15 >= 3 %start
      d = shortinteger(pc);  pc = pc+2;  hex(d)
      spaces(4)
      ->do ri
   %finish

ops(4):ops(5):ops(6):ops(7):ops(13):ops(14):  ! rx formats
   d = shortinteger(pc);  pc = pc+2;  hex(d)
   %if d&x'8000' # 0 %start;   !  pc relative
      d = (d<<1&x'8000')!(d&x'7FFF')
      spaces(4+2);  printstring(opc)
      %if op = X'42' %or op = X'43' %start
         show cc(op, r1)
      %else
        write(r1, 3)
      %finish
      printsymbol(',')
      space
      hex(pc-code base+d)
      %if x # 0 %start;   ! indexing specified
         printsymbol('(');  write(x, -2)
         printsymbol(')')
      %finish
   %else
      %if d&x'4000' = 0 %start;         ! 32-bit form
         spaces(4+2);  printstring(opc)
         %if op = X'42' %or op = X'43' %start
            show cc(op, r1)
         %else
          write(r1, 3)
         %finish
         printsymbol(',')
         write(d, 4)
         %if x # 0 %start
            printsymbol('(');  write(x, -2);  printsymbol(')')
         %finish
      %else;                            ! 48-bit form
         x2 = (d>>8)&15
         n = shortinteger(pc);  pc = pc+2;  hex(n)
         d = ((d&255)<<16) ! (n&x'FFFF')
         spaces(0+2);  printstring(opc)
         %if op = X'42' %or op = X'43' %start
            show cc(op, r1)
         %else
            write(r1, 3)
         %finish
         printsymbol(',')
         d = d ! x'FF000000' %if d&x'00800000' # 0;   ! -ve displacement
         write(d, 4)
         %if x # 0 %start
            printsymbol('(')
            write(x, -2)
            %if x2 # 0 %start;  ! second index specified?
               printsymbol(',')
               write(x2, -2)
            %finish
            printsymbol(')')
         %finish
      %finish
   %finish
   newline;  %return
!
ops(15):    ! full-word immediate
      n = shortinteger(pc)&X'FFFF';  pc = pc+2
      d = shortinteger(pc)&X'FFFF';  pc = pc+2
      hex(n);  hex(d)
      d = (n<<16) ! d
do ri:spaces(2);  printstring(opc)
      write(r1, 3)
      printsymbol(',')
      write(d, 4)
      %if x # 0 %start
         printsymbol('(');  write(x, -2);  printsymbol(')')
      %finish
      newline
%end;      ! decode

   decode %while pc < to
%end;      !decode line
%routine print next line
   %integer s
   %on 9 %start
      end = 1;  %return
   %finish
   current line = current line+1
   %return %if end # 0
   readsymbol(s)
   end = 1 %and %return %if s < 0
   write(current line, 4);  space
   %cycle
      %if s < 0 %start
         printstring(" **end**")
         end = 1
         s = nl
      %finish
      printsymbol(s)
      %return %If s = nl
      readsymbol(s)
   %repeat
%end
%routine find line(%integer line)
   %integer p
   %record(procfm)%name pr
   %for p = procs, -1, 0 %cycle
      pr == proc(p)
      %exit %if pr_line <= Line <= pr_last line
   %repeat
   thisp == Pr
%end
%routine next line(%record(procfm)%name pr)
   %integer n, linc, cinc
   line = pr_line
   ca = pr_ca
   q = pr_table
   %cycle
      q = q+2
      %if q >= pr_table limit %start
         ca = pr_ca limit
         %return
      %finish
      n = shortinteger(q)
      %exit %if n >= 0
      line = n&16_7fff;      !reset
   %repeat
   linc = n&16_1f
   cinc = n>>5*2
   line = line+linc
   ca = ca+cinc
%end
%routine extract blocks
   %integer n, ln, ep, lp, nep, nlp
   %record(Procfm)%name pr
   procs = 0;  proc(0) = 0
   ep = event head
   lp = Line head
   %cycle
      procs = procs+1;  pr == proc(procs)
      pr_ca limit = ep
      nep = ep-shortinteger(ep)&H*2
      ep = nep
      nep = nep+6 %if shortinteger(nep+2) >= 0
      nep = nep+4
      pr_ca = nep
      nlp = lp-shortinteger(lp)&H*2
      pr_table limit = lp;  lp = nlp
      nlp = nlp+2 %until shortinteger(nlp) # 0
      ln = shortinteger(nlp)&H
      pr_line = ln
      q = nlp
      %cycle
         pr_table = q
         next line(pr)
         pr_line = Line
      %repeat %until pr_ca limit <= ca
      pr_last line = line
      pr_line = ln
      pr_table = nlp
   %repeat %Until ep = event limit
   procs = procs-1;         !strip of perm
%end
%routine decode file
   %record(procfm)%name p
   %on %event 9 %start
      %return
   %finish
   extract blocks
   current line = 0
   %cycle
      print next line
      find line(current line)
      p == thisp
      next line(p)
      decode line(p_ca, ca);  p_ca = ca
      %while current line+1 # line %cycle
         find line(current line+1)
         %exit %if thisp ## p
         print next line
      %repeat %until end # 0
      p_line = line
      p_table = q
   %repeat %until end # 0
%end
%routine decode glap
%end

   object file = Command_In2
   listing file = Command_Out1
   source file = Command_In1
   %if object file = "" %start
      object file = source file %unless sourcefile -> objectfile.(".").grot
      objectfile = objectfile.".EXE"
   %finish
   connect object file(object file)
   listing file = "T:" %if listing file = ""
   open output(1, listing file)
   open input(1, source file)
   select input(1);  select output(1)
   printstring("Decode of object file ")
   printstring(object file)
   newlines(2)
   controls = Command_Parameter

   decode file
   decode glap

%endofprogram
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
@?   @   WQ       WQk     WQ:     WQ/     WQn   WQK     WQK:   BmG   -WQG                                                                                                                                                                                                                                                                                                                                                                                                             C!          D}       D   	        NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    %Qv            C    !     A!     A b    7"   	   ^! a A    j%! A    AA  A a  D!a  !     A   ! A  A!  !      B  A!a A   T   ?!    "         a b!!     #a !a  	   "    A  b  A  A       
#   a A  a aa ! A !AA    )"  b A b A   a a A A    ?!    jA!a!!   A   b A B   dQ@    D"Z 	&XKZ?K ,&@ ld    D   2       W   ,>   0D   x;     `@    Q@   ^e     ,W   0t   4    8    <`@   @   Dh   H`C   %^eLv@ dx    X   fZ#Lv ,v   	&XH   Lv@ ,d   Đ 0f   X`~XH  Đ f   ,W   0Lv 46 #p}\^C ,W   0M0   4!   8M   <XX   @Yp  Đ Df   !^e&@Đ ,d    	^e-d  ox    $h%Qv   t!t  Ā D~Iy@ H   Lj@   PLv@ Tf X"Zl   \"Z:Q}  `Lv    dLv!)R  x2  h>   lw   p-@   t&w   xqV~XH |&K    &M   .}  y-p&@ ^&@ L{~v,K }X HP PADecode of object file  T: .EXE .   **end**    
        |           |  NE   GT   LT   EQ   LE   GE  *CannBALRnBTCRnBFCRnNR  nCLR nOR  nXR  nLR  nCR  nAR  nSR  nMHR nDHR n DHR n DHR nSRLSnSLLSnCHVRn CHVRn CHVRn CHVRn CHVRn CHVRnLPSWR LPSWR LPSWR LPSWRMR  RDR  R DR  R DR  RBTBSRBTFSRBFBSRBFFSRLIS RLCS RAIS RSIS RLER RCER RAER RSER RMER RDER RFXR RFLR R FLR R FLR R FLR R FLR REXHRR EXHRR EXHRR EXHRR EXHRR EXHRR EXHRR EXHRR EXHRR EXHRR EXHRR EXHRRSTH RBAL RBTC RBFC RNH  RCLH ROH  RXH  RLH  RCH  RAH  RSH  RMH  RDH  R DH  R DH  RST  RAM  R AM  R AM  RN   RCL  RO   RX   RL   RC   RA   RS   RM   RD   RCRC12CRC16STE 6AHM 6 AHM 6 AHM 6ATL 6ABL 6RTL 6RBL 6LE  6CE  6AE  6SE  6ME  6DE  6 DE  6 DE  6 DE  6STME6LME 6LHL 6TBT 6SBT 6RBT 6CBT 6 CBT 6 CBT 6 CBT 6 CBT 6 CBT 6 CBT 6 CBT 6 CBT 6 CBT 6 CBT 6 CBT 6 CBT 6 CBT 6 CBT 6 CBT 6 CBT 6 CBT 6 CBT 6 CBT 6 CBT 6 CBT 6 CBT 6 CBT 6 CBT 6SRHLSSLHLSSTBRSLBR SEXBRSEPSRSWBR SRBR SWHR SRHR SWDR SRDR S RDR SSSR SOCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR S OCR SBXH SBXLESLPSWSTHI SNHI SCLHISOHI SXHI SLHI SCHI SAHI SSHI SSRHLSSLHLSSRHASSLHASSTM SLM  SSTB SLB  SCLB SAL  SWB  SRB  SWH  SRH  SWD  SRD  S RD  SSS  SOC  S OC  STS  SSVC SSINTSSCP S SCP S SCP SLA  STLATE TLATE TLATERRL ERLL ESRL ESLL ESRA ESLA E SLA E SLA E SLA ETI  ENI  ECLI EOI  EXI  ELI  ECI  EAI  ESI  E SI  E SI  E SI  E SI  E             j*Cannot load                           0
   D	1?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nH  !34  1  0 !81 !5$$A> #$$A> &C ?1  34C0  D   D   
C H  !34  1  0 !81 !5$$A> B  @ !4B ";
C@ !$$A> #$$A> B  C
B$P#E  E  &Q'1"C s_  eX!34RUUh!34dffз  ӳ  Ű !4Գ #9    !8 !5$$A> B$ C08 L  #9&"C  "
  'M  M   >' ("#4\BbD#:  
  nBJ"#<  #M  M  '"DC0  
$#M  M  &'"%ѷ  C $ "ѷ  $$A> X# Y !Y !&\ Z  B!$$A> З  $1$H  H X [ &B0P  [ ,&' ?P  
*&30H  P  ї  C Kї  $$A> 
Y  #%$$A> 
qPr  PB &(pX  ?$PS?PE   &T 41I2 !,K2  !
3s3B  #9
3
>!$$A> !$$A> A> O$$A> "#:  ! ?$$A> ?$$A> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$2$ #PC   '4"
 w ) ,A A l $X !A  ?) r ,A r	 l  
q	 lX9 t<3C0B$`W   l' ,A  ,A" W   HW  ,$ AX xP tX |P pPxHK @  
D
KPH lH[ PY P
UPY !6$ $$AHk 
f
V
[PX `Xi 'b
kPh dH4@0  
3
4P8 X'BPH \y  	g A , X $0&1P9 ,P9 4X İ P 0X P ɰ 
#Ȼ 0P 0#Ȼ 7P 0kW   <X9 ,U9 4A0 B0P 4y  >	W  A , X ` CB0LP !;W   Hz P !9W   H"P !:W   HC C HP !:W   HC P !:W   HC P !:W   HC $SXj  W   TC l c
w A , X X9 HC  PJ ,&2P9 `W   HXY 'ReX8 l<cAv\W   HX ,İ P <=|A* HA XJ ,D@ PJ 0XZ ,P PZ 4Xj ,A&j Hf!9W  ,z X: <4P: D.lAZ$jW    HW   HX <ɰ  B^ɰ #B VXZ 0kA>` ,W   <XJ <@ !6$P[Z 4PZ 4W  Xi 'bX8 l<cX 4

kAzC .$SXj 0W   T` ,W   <$TXj 4W   TW  ,C &XJ <@ @ B&XY He  Pj 8&RPY A$dW   C $X9 H  P 8&2P9 kAXJ 8L@   C0
D@   XZ 8PEPJ 8$fW    HW   HXj <` B#4` C!6XZ 0A#	$SXj 0W   T` ,W   <W  X9 X l;cXJ 8L
dAJXZ 4C0,` (W   <%RXj 4W   T` )W   <C @@ B0$fW    HW   HXj <` B#4` C!6XZ 0AT#	$SXj 0W   T` ,W   <$TXj 8lW   TX: 4C0,` (W   <%RXj 4W   T` )W   <C *X 8İ P @XI HT  PZ ,&BPI eABXj 8l` ` X: ,0  cPj 8$bW    HW   HX <Ű B#4Ű C!7XZ 0kAj#	$SXj 0W   T` ,W   <XJ 8L@   #6@   PJ 8$TdW   TXZ 4C0\` (W   <%RXj 4W   TXj @lfC0"` ,W   <%RXj @lW   T` )W   <W  ,C  X9 H    P ,&2P9 HC  @  PJ 8&2P9 kAXj 8lAXZ ,P Xj 8lVPZ 8$bW    HW   H$SXj 0W   T` ,W   <$TXj 8lW   TX: 4C0,` (W   <%RXj 4W   T` )W   <W  ,C >
W  A , X X9 Y9  #Ap"y  	w A , X Py 0#	Xy 0$1P=ty XH xL&APH xX=t#2"W   P ,#$PtC $TXh xlW   TW  X ,#RW   H$APMt$ZPY ,Xi ,lW   <Xi ,l` 
!3C `W   P ,C  l 	 g A , X X8 T<&1$%!AP9 ,C 6'1P9 ,P9 48 <AP 0X I  !I !"#
X9 ,U9 4A3B0P 4X 0P Dy  E	g A , X H6  P8 PXF LPH HXV \PX LXh Ll&bPh LX9 <X 	k!X P Hy HF  PI ,!#@PH PC @ PI 0XY ,U
UPY 4X P
P PXH HL
EPH HC  [	w A , X $0P8 T8 <A!$5A XH XLPI 4X8 `<P9 8X T&P T8 <AP DX 4P XI 4HT  P  
UEPI <PI 4Hd !&FPI <&DPI <X9 D<PC X 8H    
P @XY D\Xi 8Pe X9 @<P9 8X @&P @H  !2"
  P 0XI DL@  AXY @\PX LXi DlX8 L<P6 Xi DlAX DX P@  AXI DLXT \Xh Hl	V##C X8 P<@4 3AX DX 0@  AXI DLXY @\PT Xi 4X8 \<c#3C X T'P Ty  	w A , X Py 0#Xy 0y A$0P8 xAXh xlAX DP ,kA(XX H\X ,Xj lA~XI ,LXX H\PT Xh xl&aX8 P<cC0.Xh x&aARX DX ,#2#AZXMt!3C XY ,\Xh Pl@e  fAX9 ,<X LP Xt!3C 0C   	 w A , X y  	w P (A , XX H ,$0P4 Ȱ,P A  ( <A( X=p< @A  ?( XMp A  ?( X=p  A  ?H DB0*2( NH A?!6 A  ?HA" ? ALX U!7( DA  $aW    $aW   x$aW   `$aW   l,W   H W   H$bW  8( Xmpl A  AAx  0EO_RO`: Oa@ pn @ J@ opESOb@ pn @ qN   @!SOc@ pn N   SOd@ pn N    SOe@ N   sp@ ppEOf;Oh$ oSPOOLER, ,  , #{$ pPARM, 1, ?,  }OjOkN   N   b$ qSPOOLERCOMMAND, ;, ,'PAUSEA 'CONTINUEA 'RESTARTA 'CANCELA 'STOPA Om$ rQUEUEID, 1, ?,  On$ sP, A, 7,  Oo$ tJ, , ,  Op@ K@ ppEOp@ MN   N   +pEOq@ r@ 9n SOq@ p@ 9n SOr@ sn @ R@ rpESOs@ sn N    ?> Ot@ 'Invalid queue name @ r.pEOu@ 0EOvROw: Ox@ F@ ppEOy@ tN   N   N   f Oz@ q@ ta@ p?# O{@ sn @ tSO|@ sn N   SO}@ N   p@ spEO~@ sn N    ?= 
O@ @ @ 	@ sn pEpEpEO@ 0EO: 
OF O: O@ tN   ?# O@ @ ppEO@ N   ?pEO@ 0EORO: OB : O;O$ pLIFEANDDEATH, ,  ,  {$ qOP, , ,  $ rPARM, 2, ?,  }O$ sUSER, A, 7,  $ tPARM2, A, 7,  O@ K@ rpEO@ qN    ?# O@ MN   pEO@ tn n N    SOF : @ qN   ?# O@ MN   N   +pEO@ L@ 9n p@ tn pEOF : O@ MN   N   +pEO@ L@ 9n p@ tn pEO: O@ L@ 9n p@ sn pEO@ sn n N    ?# OL uO@ 'Faulty unit name?pEO@ 0EORO: O@ qN   ?# O@ tn n N    ?= @ tn n @ sn n ?= : J u: O@ sn 
@ tn n SO@ qN   /SOF : O@ sn 	@ tn n SO@ qN    ?# @ qN    SF : @ qN   S: O: O@ Q@ qp@ spEO;O$ qCREATE, ,  , ${$ rPARM, 1, ?,  }O@ pN   p@ rpEO;O                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                    7 Y R  8 U S  = W    W \ U B ^ V q ] W  r T X   ` Y  _ Z   a [  [     d ]   Z ^   E _   N `   H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        %begin;            !decode for new imp
   %include "Newsrc:Command.inc"
   %constinteger h = 16_FFFF
   %owninteger end = 0
   %recordformat parmfm(%shortinteger dsno, dact, ssno, sact, %c
                        %integer p1, p2, p3, p4, p5, p6)
   %recordformat procfm(%short   line, last line,
                        %integer ca, ca limit, table, table limit)
   %constinteger max procs = 300
   %record(procfm)%array proc(0:max procs)
   %record(procfm)%name thisp
   %integer ca, q, line, procs
   %integer event head, event limit
   %integer line head, line limit
   %recordformat hdfm(%shortinteger p1, p2)
   %recordformat headfm(%shortinteger pure size, gla size, code disp,
                                      lit disp, registers, main ep,
                        %record(hdfm) reloc, defs, specs, ldiag, vdiag)
   %ownrecord(headfm)%name head

   %integer j
   %integer code base, gla base
   %integer file base
   %integer current line
   %integer control
   %routinespec hex(%integer n)

   %string(15) controls, grot
   %string(63) source file, object file, listing file
   %on 9 %start
      newline
      printstring("*end of file*")
      newline
      %stop
   %finish
   %routine connect object file(%string(63) file)
      %record(parmfm) p
      %integer k
      string(addr(p_sact)) = file
      svc(10, p)
      %if p_p1 # 0 %start
         select output(0)
         printstring("*Cannot load ".file)
         newline
         %stop
      %finish
      file base = p_p2;      !really seg+16
      gla base = p_p3
      head == record(file base)
      code base = (head_code disp&X'FFFF')*2+file base
      k = head_ldiag_p1
      k = k&16_7fff*2
      %signal 13,1 %if k = 0
      line head = k+head_ldiag_p2*2+file base
      line limit = k-2+file base
      event head = shortinteger(code base-2)&H*2+code base
      event limit = code base-2
!      line head = line head-shortinteger(line head)&H*2;      !????????
   %end
   %routine  hex(%integer n)
      %integer  j,k
      %for j = 1, 1, 4 %cycle
         k = n>>12&15;  n = n<<4
         %if k < 10 %then k = k+'0' %else k = k-10+'A'
         print symbol(k)
      %repeat
   %end
%routine decode line(%integer pc, to)
   %conststring(5)%array opcode(0:255) =
       "", "BALR", "BTCR", "BFCR", "NR  ", "CLR ", "OR  ", "XR  ",
   "LR  ", "CR  ", "AR  ", "SR  ", "MHR ", "DHR ", "", "",
   "SRLS", "SLLS", "CHVR", ""(5),
   "LPSWR", ""(3), "MR  ", "DR  ", ""(2),
   "BTBS", "BTFS", "BFBS", "BFFS", "LIS ", "LCS ", "AIS ", "SIS ",
   "LER ", "CER ", "AER ", "SER ", "MER ", "DER ", "FXR ", "FLR ",
    ""(4), "EXHR", ""(11),
   "STH ", "BAL ", "BTC ", "BFC ", "NH  ", "CLH ", "OH  ", "XH  ",
   "LH  ", "CH  ", "AH  ", "SH  ", "MH  ", "DH  ", "", "",
   "ST  ", "AM  ", ""(2), "N   ", "CL  ", "O   ", "X   ",
   "L   ", "C   ", "A   ", "S   ", "M   ", "D   ", "CRC12", "CRC16",
   "STE ", "AHM ", "",     "",     "ATL ", "ABL ", "RTL ", "RBL ",
   "LE  ", "CE  ", "AE  ", "SE  ", "ME  ", "DE  ", ""(2),
      "", "STME", "LME ", "LHL ", "TBT ", "SBT ", "RBT ", "CBT ",
       ""(8),
       ""(16),
   "SRHLS", "SLHLS", "STBR", "LBR ", "EXBR", "EPSR", "WBR ", "RBR ",
   "WHR ", "RHR ", "WDR ", "RDR ", "", "SSR ", "OCR ", "",
   ""(16),
   ""(16),
   "BXH ", "BXLE", "LPSW", "THI ", "NHI ", "CLHI", "OHI ", "XHI ",
   "LHI ", "CHI ", "AHI ", "SHI ", "SRHL", "SLHL", "SRHA", "SLHA",
   "STM ", "LM  ", "STB ", "LB  ", "CLB ", "AL  ", "WB  ", "RB  ",
   "WH  ", "RH  ", "WD  ", "RD  ", "", "SS  ", "OC  ", "",
   "TS  ", "SVC ", "SINT", "SCP ",  ""(2), "LA  ", "TLATE",
       "",     "", "RRL ", "RLL ", "SRL ", "SLL ", "SRA ", "SLA ",
    ""(3), "TI  ", "NI  ", "CLI ", "OI  ", "XI  ",
   "LI  ", "CI  ", "AI  ", "SI  ", ""(4)

   %routine show cc(%integer op, m)
      %if op = X'43' %start
         printstring("  GE") %and %return %if m=1
         printstring("  LE") %and %return %if m=2
         printstring("  EQ") %and %return %if m=3
      %else
         printstring("  LT") %and %return %if m=1
         printstring("  GT") %and %return %if m=2
         printstring("  NE") %and %return %if m=3
      %finish
      write(m, 3)
   %end
   %routine decode
      %switch ops(0:15)
      %integer n, r1, x, d, op, x2, xop
      %string(7) opc
!
      n = shortinteger(pc);  pc = pc+2
      print string("        | ")
      hex(pc-2-code base);  printstring("  ")
      op = n>>8&255;  opc = opcode(op)
      r1 = n>>4&15;  x = n&15
      hex(n);
      %if length(opc) = 0 %start
         newline;  %return
      %finish
      xop = op>>4
      ->ops(xop)

ops(0):ops(1):ops(2):ops(3):ops(9):;  ! rr and short formats
      spaces(8+2);  printstring(opc)
      %if x'20' <= op <= x'23' %start
         show cc(op, r1);  printsymbol(',')
         x = -x %if op&1 = 0;   ! ...it's a backward jump
         space
         hex(pc-2-code base+x*2)
      %else
         write(r1, 3);  printsymbol(',')
         write(x, 4)
      %finish
      newline;  %return

ops(12):       ! bxh, bxle, lpsw or halfword immediate
   %if op&15 >= 3 %start
      d = shortinteger(pc);  pc = pc+2;  hex(d)
      spaces(4)
      ->do ri
   %finish

ops(4):ops(5):ops(6):ops(7):ops(13):ops(14):  ! rx formats
   d = shortinteger(pc);  pc = pc+2;  hex(d)
   %if d&x'8000' # 0 %start;   !  pc relative
      d = (d<<1&x'8000')!(d&x'7FFF')
      spaces(4+2);  printstring(opc)
      %if op = X'42' %or op = X'43' %start
         show cc(op, r1)
      %else
        write(r1, 3)
      %finish
      printsymbol(',')
      space
      hex(pc-code base+d)
      %if x # 0 %start;   ! indexing specified
         printsymbol('(');  write(x, -2)
         printsymbol(')')
      %finish
   %else
      %if d&x'4000' = 0 %start;         ! 32-bit form
         spaces(4+2);  printstring(opc)
         %if op = X'42' %or op = X'43' %start
            show cc(op, r1)
         %else
          write(r1, 3)
         %finish
         printsymbol(',')
         write(d, 4)
         %if x # 0 %start
            printsymbol('(');  write(x, -2);  printsymbol(')')
         %finish
      %else;                            ! 48-bit form
         x2 = (d>>8)&15
         n = shortinteger(pc);  pc = pc+2;  hex(n)
         d = ((d&255)<<16) ! (n&x'FFFF')
         spaces(0+2);  printstring(opc)
         %if op = X'42' %or op = X'43' %start
            show cc(op, r1)
         %else
            write(r1, 3)
         %finish
         printsymbol(',')
         d = d ! x'FF000000' %if d&x'00800000' # 0;   ! -ve displacement
         write(d, 4)
         %if x # 0 %start
            printsymbol('(')
            write(x, -2)
            %if x2 # 0 %start;  ! second index specified?
               printsymbol(',')
               write(x2, -2)
            %finish
            printsymbol(')')
         %finish
      %finish
   %finish
   newline;  %return
!
ops(15):    ! full-word immediate
      n = shortinteger(pc)&X'FFFF';  pc = pc+2
      d = shortinteger(pc)&X'FFFF';  pc = pc+2
      hex(n);  hex(d)
      d = (n<<16) ! d
do ri:spaces(2);  printstring(opc)
      write(r1, 3)
      printsymbol(',')
      write(d, 4)
      %if x # 0 %start
         printsymbol('(');  write(x, -2);  printsymbol(')')
      %finish
      newline
%end;      ! decode

   decode %while pc < to
%end;      !decode line
%routine print next line
   %integer s
   current line = current line+1
   %return %if end # 0
   readsymbol(s)
   end = 1 %and %return %if s < 0
   write(current line, 4);  space
   %cycle
      %if s < 0 %start
         printstring(" **end**")
         end = 1
         s = nl
      %finish
      printsymbol(s)
      %return %If s = nl
      readsymbol(s)
   %repeat
%end
%routine find line(%integer line)
   %integer p
   %record(procfm)%name pr
   %for p = procs, -1, 0 %cycle
      pr == proc(p)
      %exit %if pr_line <= Line <= pr_last line
   %repeat
   thisp == Pr
%end
%routine next line(%record(procfm)%name pr)
   %integer n, linc, cinc
   line = pr_line
   ca = pr_ca
   q = pr_table
   %cycle
      q = q+2
      %if q >= pr_table limit %start
         ca = pr_ca limit
         %return
      %finish
      n = shortinteger(q)
      %exit %if n >= 0
      line = n&16_7fff;      !reset
   %repeat
   linc = n&16_1f
   cinc = n>>5*2
   line = line+linc
   ca = ca+cinc
%end
%routine extract blocks
   %integer n, ln, ep, lp, nep, nlp
   %record(Procfm)%name pr
   procs = 0;  proc(0) = 0
   ep = event head
   lp = Line head
   %cycle
      procs = procs+1;  pr == proc(procs)
      pr_ca limit = ep
      nep = ep-shortinteger(ep)&H*2
      ep = nep
      nep = nep+6 %if shortinteger(nep+2) >= 0
      nep = nep+4
      pr_ca = nep
      nlp = lp-shortinteger(lp)&H*2
      pr_table limit = lp;  lp = nlp
      nlp = nlp+2 %until shortinteger(nlp) # 0
      ln = shortinteger(nlp)&H
      pr_line = ln
      q = nlp
      %cycle
         pr_table = q
         next line(pr)
         pr_line = Line
      %repeat %until pr_ca limit <= ca
      pr_last line = line
      pr_line = ln
      pr_table = nlp
   %repeat %Until ep = event limit
   procs = procs-1;         !strip of perm
%end
%routine decode file
   %record(procfm)%name p
   extract blocks
   current line = 0
   %cycle
      print next line
      find line(current line)
      p == thisp
      next line(p)
      decode line(p_ca, ca);  p_ca = ca
      %while current line+1 # line %cycle
         find line(current line+1)
         %exit %if thisp ## p
         print next line
      %repeat %until end # 0
      p_line = line
      p_table = q
   %repeat %until end # 0
%end
%routine decode glap
%end

   object file = Command_in2
   listing file = Command_out1
   source file = Command_in1
   %if object file = "" %start
      object file = source file %unless sourcefile -> objectfile.(".").grot
      objectfile = objectfile.".EXE"
   %finish
   connect object file(object file)
   listing file = "T:" %if listing file = ""
   open output(1, listing file)
   open input(1, source file)
   select input(1);  select output(1)
   printstring("Decode of object file ")
   printstring(object file)
   newlines(2)

   decode file
   decode glap

%endofprogram
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        !!!!  18/4/79

!  GPM -- DIRTY VERSION FOR INTERDATA IMP
!
%CONSTSTRING(8)  VERSION = "GPM 1.09"



          !-------------------------------------------------!
          ! I/O STREAMS:                                    !
          ! -----------                                     !
          !  INPUT 2:  MACRO DEFN. FILE                     !
          !  INPUT 1:  SOURCE TEXT TO BE EXPANDED           !
          !                                                 !
          ! OUTPUT 0:  REPORT STREAM FOR ERROR MESSAGES     !
          ! OUTPUT 1:  EXPANDED VERSION OF SOURCE TEXT.     !
          ! OUTPUT 2:  DUMP FILE FOR MACRO DEFINITIONS.     !
          !-------------------------------------------------!

! ****THE DUMP FACILITY FOR UNLOADING ALL CURRENT MACRO DEFINITIONS
!     IS NOT SUPPORTED MEANTIME****
!
%CONSTINTEGER  CUT OFF = 50;  ! ... STOP AFTER THIS MANY ERRORS
%CONSTINTEGER DUPLICATE = 1;  ! DUPLICATE ERROR MESSAGES IN OUTPUT 1
!
!
!
! PRIMARY INPUT:  SOURCE TEXT TO BE EXPANDED
! PRIMARY OUTPUT: RESULTING OUTPUT TEXT
! MACRO DEFNS:    MACRO DEFN. FILE READ BEFORE PRIMARY INPUT.
! DUMP FILE:      DUMP OF MACRO ENVIRONMENT DEFINED.
!   THE LAST TWO ARE OPTIONAL:  IF NO DEFN. FILE IS DEFINED THAT
! STAGE WILL BE SKIPPED:  IF A DUMP FILE IS DEFINED, MACROS
! DEFINED AT '$*END*' OF THE PRIMARY INPUT WILL BE DUMPED ONTO
! IT IN A FORM IN WHICH THEY CAN BE RE-READ AS A 'MACRO FILE'
!     NOTE THAT BOTH THE MACRO FILE AND THE PRIMARY INPUT MUST
! END WITH '$*END*' - ALSO THAT DEFNS AND/OR CALLS CAN BE
! PUT IN EITHER INPUT FILE, THE SEPARATION BEING MERELY A MATTER
! OF CONVENIENCE.
!
!    A COMMAND('DELIMS') HAS BEEN ADDED TO PERMIT THE VARIOUS
! SPECIAL CHARACTERS TO BE CHANGED.  NOTE THAT USED  IN CONJUNCTION
! WITH THE 'DUMP' FACILITY, THIS CAN PRODUCE ABSOLUTE RUBBISH.
!
%BEGIN;            ! ...MAIN PROGRAM LEVEL
%INTEGER  STKLIMIT;  %CONSTINTEGER  STKMAX = 32767; ! ...16 BITS!
%BEGIN
   STKLIMIT = (FREE SPACE - 1000)>>1
   STKLIMIT = STKMAX %IF STKLIMIT > STKMAX
%END
%SHORTINTEGERARRAY  ST(0:STKLIMIT)


! DEFINE I/O STREAMS -- NOTE THAT THE DUMP FACILITY CAN BE
! DISABLED BY SETTING 'DUMP' TO A NEGATIVE VALUE.

%CONSTINTEGER DEFN FILE=2, SOURCE=1, REPORT=0, OUT=1, DUMP=-1
%CONSTINTEGER  FF=12;  ! FORM-FEED CHARACTER
%OWNINTEGER ERROR = 0
%OWNSHORTINTEGER INSTRM
%SHORTINTEGER  LBR, RBR;     ! ... LEFT/RIGHT BRACKET
%OWNINTEGER A,R,W,X,K
%OWNINTEGER D1,D2,D3,W1
%OWNINTEGER Q = 1;  %CONSTINTEGER  MARKER = -1
%SWITCH MACHINE MACRO(1:8);    ! DEF,VAL,UPDATE,BIN,DEC,BAR,*END*,DELIMS
%OWNSHORTINTEGER  LAST OUT=NL; ! LAST OUTPUT CHARACTER
%OWNSHORTINTEGER  SP=0;        ! NO. OF SPACES PENDING

%OWNINTEGER S = 56,E = 50;  %CONSTBYTEINTEGER MSTHEAD = 50
%CONSTSHORTINTEGERARRAY  MST(0:55) =
-1,6,'*','E','N','D','*',-8,
0,7,'D','E','L','I','M','S',-7,
8,4,'D','E','F',-1,
17,4,'V','A','L',-2,
23,7,'U','P','D','A','T','E',-3,
29,4,'B','I','N',-4,
38,4,'D','E','C',-5,
44,4,'B','A','R',-6
%OWNINTEGER  H=0, P=0, F=0, C=0
%OWNBYTEINTEGERARRAY  SYMTYPE(-1:127)
%SWITCH  SW(1:7)
!
!
%BEGIN;    ! SET DEFAULT WARNING CHARACTERS INTO 'SYMTYPE'
   SYMTYPE(K) = 0 %FOR K = -1,1,127
   SYMTYPE('$') = 1;          ! ...FN
   SYMTYPE(',') = 2;          ! ...NEXT ITEM
   SYMTYPE(';') = 3;          ! ...APPLY
   SYMTYPE('\') = 4;          ! ...LOAD ARG
   SYMTYPE(MARKER) = 5;       ! ...END FN
   SYMTYPE('[') = 6;          ! ...PROTECT
   SYMTYPE(']') = 7;          ! ...EXIT
   LBR = '[';                 ! ...DEFAULT LEFT BRACKET
   RBR = ']';                 ! ...DEFAULT RIGHT BRACKET
%END
!
!
!

!============= MOUSES SPECIFIC=====================
%PREDICATE  NULL INPUT(%INTEGER  N)
%INTEGER  K;  %STRING(255)%NAME  S
   K = 3+(N-1)*2
   S == STRING(COMREG(K))
   %TRUE %IF S = ".N" %OR S = ""
   %FALSE
%END
!================================================
!
   SELECT OUTPUT(REPORT);  PRINT SYMBOL(FF);  NEWLINE
   PRINT STRING(VERSION."    Stack size =")
   WRITE(STKLIMIT+1,1);  PRINT STRING(" cells")
   NEWLINES(2)

   %IF STKLIMIT < S+100 %START;     ! ... AD HOCKERY
      PRINT STRING("***** MORE STORE REQ'D *****"); NEWLINE
      %SIGNAL 0,2
   %FINISH

!   INITIALISE STACK WITH NAMES OF 'MACHINE MACROS'
   ST(K) = MST(K) %FOR K = 0,1,S-1
   INSTRM = DEFN FILE;  INSTRM = SOURCE %IF NULL INPUT(INSTRM)
   SELECT INPUT(INSTRM);  SELECT OUTPUT(OUT)
   -> START
!
!
%ROUTINESPEC LOAD

   %ROUTINE MONITOR(%INTEGER N)
   %SWITCH M(0 : 15);  %INTEGER W1,R
      ERROR = ERROR+1
      %IF DUPLICATE # 0 %THEN %START
         NEWLINE %IF LAST OUT # NL
         PRINT STRING("   ** ERROR");  WRITE(ERROR,1);  PRINT STRING(" **")
         NEWLINE;  LAST OUT = NL;  SP = 0
         SELECT OUTPUT(REPORT)
      %FINISH
      PRINT STRING("
*ERROR");  WRITE(ERROR,1);  PRINT SYMBOL(':')
      -> M(N)
!

      %ROUTINE ITEM(%INTEGER X)
      %INTEGER APR,HPR,K,J
         APR = A;  HPR = H
         H = 0
         J = ST(X)-1;  J = S-X-1 %IF ST(X) = 0
         %IF J > 0 %THEN %START
            %CYCLE K = 1,1,J
               A = ST(X+K);  LOAD
            %REPEAT
         %FINISH
         PRINT STRING("... (INCOMPLETE)") %IF ST(X) = 0
         A = APR;  H = HPR
      %END
!
M(0):
      PRINT STRING("
         *** STACK OVERFLOW - GPM CANNOT PROCEED ***
")
      %STOP
!
M(1):
      PRINT STRING("UNMATCHED SEMI-COLON IN DEFINITION OF ")
      ITEM(P+2)
      PRINT STRING("
IF THIS HAD BEEN QUOTED THE RESULT WOULD BE
")
      -> RETURN
!
M(2):
      PRINT STRING("UNQUOTED TILDE IN ARGUMENT LIST OF ");  ITEM(F+2)
      PRINT STRING("
IF THIS HAD BEEN QUOTED THE RESULT WOULD BE")
      -> RETURN
!
M(3):
      PRINT STRING("IMPOSSIBLE ARGUMENT NUMBER IN DEFINITION OF ")
      ITEM(P+2)
      -> M11
!
M(4):
      PRINT STRING("NO ARGUMENT ")
      D1 = H;  H = 0
      LOAD
      PRINT STRING(" IN CALL FOR ");  ITEM(P+2)
      H = D1
      -> RETURN
!
M(5):
      PRINT STRING("TERMINATOR IN ")
      %IF C = 0 %THEN %START
         PRINT STRING("INPUT STREAM.  PROBABLY MACHINE ERROR. ")
         -> M11
      %FINISH
      PRINT STRING("ARGUMENT LIST FOR ");  ITEM(F+2)
      PRINT STRING("
PROBABLY DUE TO A SEMI-COLON MISSING FROM THE DEFINITION OF ")
      ITEM(P+2)
      PRINT STRING("
IF A FINAL SEMI-COLON IS ADDED THE RESULT IS
")
      -> RETURN
!
M(7):
      PRINT STRING("UNDEFINED NAME ");  ITEM(W)
      -> M11
!
M(8):
      PRINT STRING("UNMATCHED ']'.  PROBABLY YOUR ERROR.")
      -> M11
!
M(9):
      PRINT STRING("UPDATE ARGUMENT TOO LONG FOR ");  ITEM(P+9)
      -> M11
!
M(10):
      PRINT STRING("NON-DIGIT IN NUMBER ")
      -> M11
!
M(12):
      PRINT STRING("BAR - FAULTY OPERATOR SPECIFICATION")
      -> M11
!
M(13):
      PRINT STRING("BAR - ZERO DIVISOR SET TO ONE")
      NEWLINE
      -> RETURN
!
M(14):
   PRINT STRING("UNMATCHED ']' -- GPM TERMINATES")
   NEWLINE
   -> RETURN


M(15):
   PRINT STRING("'DELIMS' ARGUMENT FAULTY ");  ITEM(P+9)
   NEWLINE
   -> RETURN


M(11):
M11:
      W = 36
      PRINT STRING("
CURRENT MACROS ARE:")
      %WHILE P # 0 %OR F # 0 %CYCLE
         %IF P > F %THEN %START
            W1 = P+2
            P = ST(P)
            PRINT STRING("
ALREADY ENTERED ")
         %FINISH %ELSE %START
            W1 = F+2
            F = ST(F)
            PRINT STRING("
NOT YET ENTERED ")
         %FINISH
         %CYCLE R = 1,1,W
            ITEM(W1);  %EXIT %IF ST(W1) = 0
            W1 = W1+ST(W1);  %EXIT %IF ST(W1) = MARKER
            %IF W # 1 %THEN %START
               PRINT STRING("
ARG");  WRITE(R,0);  PRINT STRING("   ")
            %FINISH
         %REPEAT
         W = 1
      %REPEAT
      PRINT STRING("
END OF MONITOR PRINTING
")
      A = '?';  H = 0;  LOAD
RETURN:
      %SIGNAL 0,2 %IF ERROR = CUT OFF %OR N = 15

      SELECT OUTPUT(OUT) %IF DUPLICATE # 0
   %END;            ! ... OF MONITOR ROUTINE

          !-------------------------------------------------!
          ! THIS ROUTINE EDITS OUTPUT TO:                   !
          ! (1) REMOVE MULTIPLE NEWLINES.                   !
          ! (2) REMOVE TRAILING SPACES.                     !
          ! (3) INSERT ONE SPACE AT THE END OF EACH LINE    !
          !     TO KEEP CAL R04 ET AL HAPPY.                !
          !-------------------------------------------------!
   %ROUTINE LOAD
      %IF H # 0 %THEN ST(S) = A %AND S = S+1 %ELSE %START
         %IF A # NL %START
            %IF A = ' ' %THEN SP = SP+1 %ELSE %START
               SPACES(SP) %AND SP=0 %UNLESS SP=0
               PRINT SYMBOL(A);  LAST OUT = A
            %FINISH
         %ELSE
            SP = 0
            SPACE %AND NEWLINE %AND LAST OUT = NL %UNLESS LAST OUT = NL
         %FINISH
      %FINISH
   %END

   %ROUTINE NEXT CH
      %IF C = 0 %THEN READ SYMBOL(A) %ELSE A = ST(C) %AND C = C+1
   %END

   %ROUTINE FIND(%INTEGER X)
   %INTEGER R
      A = E;  W = X;  K = 0
      %WHILE A >= 0 %CYCLE
         %CYCLE R = 0,1,ST(W)-1
            -> L1 %IF ST(W+R) # ST(A+R+1)
         %REPEAT
         W = A+1+ST(W)
         %RETURN
L1:       A = ST(A)
      %REPEAT
      MONITOR(7);  K = 1
   %END
!
!
!*** MAIN LOOP ***
! 'STRIP' IS FOR ERROR RECOVERY
!
STRIP:
   -> END FN %IF P > F
START:
   MONITOR(0) %IF S > STKLIMIT;    ! STACK OVERFLOW?
   NEXT CH
   K = SYMTYPE(A);  -> SW(K) %IF K # 0
! THE ABOVE LINE REPLACES THE TEST-AND-BRANCH SEQUENCE BELOW
! PURELY FOR EFFICIENCY REASONS -- LOGICALLY THERE IS NO CHANGE.
!   Q = Q+1 %AND -> Q2 %IF A = '['
!   -> FN %IF A = '$'
!   -> NEXT ITEM %IF A = ','
!   -> APPLY %IF A = SEMI-COLON
!   -> LOAD ARG %IF A = '\'
!   -> END FN %IF A = MARKER
!   -> EXIT %IF A = ']'
COPY:

   LOAD
! SCAN:
   -> START %IF Q = 1
Q2:NEXT CH
   Q = Q+1 %AND -> COPY %IF A = LBR;     ! ...LEFT BRACKET
   -> COPY %IF A # RBR;                  ! ...RIGHT BRACKET
   Q = Q-1;  -> START %IF Q = 1
   -> COPY
!
!  [ ... PROTECT FROM EVALUATION
SW(6):
   Q = Q+1
   -> Q2
!
SW(1):
! FN:
   ST(S) = H;  ST(S+1) = F;  F = S+1
   ST(S+2) = 0;  ST(S+3) = 0;  H = S+3
   S = S+4
   -> START
!
SW(2):
!  NEXT ITEM:

   -> COPY %IF H = 0
   ST(H) = S-H-ST(H);  ST(S) = 0
   H = S;  S = S+1
   -> START
!
SW(3):
APPLY:
   MONITOR(1) %AND -> COPY %IF P > F
   -> COPY %IF H = 0
   D1 = ST(F);  D2 = ST(F-1)
   ST(H) = S-H;  ST(S) = MARKER
   ST(F-1) = S-F+2
   ST(F) = P
   ST(F+1) = C
   P = F;  F = D1;  H = D2;  S = S+1
   ST(H) = ST(H)+ST(P-1) %IF H # 0
   FIND(P+2);  -> STRIP %IF K # 0
   -> MACHINE MACRO(-ST(W)) %IF ST(W) < 0
   C = W+1
   -> START
!
SW(4):
!  LOAD ARG:
   %IF P = 0 %THEN %START
      -> COPY %IF H = 0
      MONITOR(2);  -> COPY
   %FINISH
   NEXT CH
   W = P+2
   %IF '0' <= A <= '9' %THEN W1 = A-'0' %ELSE %START
      %IF 'A' <= A <= 'Z' %THEN W1 = A-'A'+10 %ELSE %START
         W1 = -1;  MONITOR(3);  -> STRIP
      %FINISH
   %FINISH
   %WHILE W1 # 0 %CYCLE
      W = W+ST(W)
      MONITOR(4) %AND -> STRIP %IF ST(W) = MARKER
      W1 = W1-1
   %REPEAT
   A = ST(W+R) %AND LOAD %FOR R = 1,1,ST(W)-1
   -> START
!
SW(5):
END FN:
   %IF F > P %THEN %START
      MONITOR(5);  -> STRIP %IF C = 0
      C = C-1;  -> APPLY
   %FINISH
   ST(S) = E;  A = S
   %WHILE ST(A) >= P-1+ST(P-1) %CYCLE
      D1 = ST(A)
      ST(A) = D1-ST(P-1)
      A = D1
   %REPEAT
   W = ST(A)
   W = ST(W) %WHILE W > P-1
   ST(A) = W;  E = ST(S)
   %IF H # 0 %THEN %START
      %IF H > P %THEN H = H-ST(P-1) %ELSE ST(H) = ST(H)-ST(P-1)
   %FINISH
   A = P-1;  W = P-1+ST(P-1)
   S = S-ST(P-1);  C = ST(P+1);  P = ST(P)
   %WHILE A # S %CYCLE
      ST(A) = ST(W);  A = A+1;  W = W+1
   %REPEAT
   -> START
!
SW(7):
EXIT:
   MONITOR(14) %AND -> STOP  %IF C = 0 = H;  ! ...TOO MANY ']'
   MONITOR(8);  -> STRIP
!
!*** BUILT-IN MACRO'S FOLLOW ***
!DEF
MACHINE MACRO(1):
   ST(H) = ST(H)-ST(P-1) %IF H # 0
   ST(P-1) = E;  E = P-1
   W = P;  P = ST(P)
   ST(W) = ST(W+6) %AND W = W+1 %WHILE W+6 # S
   S = W
   -> START
!
! VAL
MACHINE MACRO(2):
   FIND(P+6);  -> STRIP %IF K # 0
   %WHILE ST(W+1) # MARKER %CYCLE
      A = ST(W+1);  W = W+1;  LOAD
   %REPEAT
   -> END FN
!
! UPDATE
MACHINE MACRO(3):
   FIND(P+9);  -> STRIP %IF K # 0
   A = P+9+ST(P+9)
   MONITOR(9) %AND -> STRIP %IF ST(A) > ST(W)
   ST(W+R) = ST(A+R) %FOR R = 1,1,ST(A)
   -> END FN
!
! BIN
MACHINE MACRO(4):
   W = 0;  A = P+7
   MONITOR(4) %AND -> STRIP %IF ST(P+6) = MARKER
   A = P+8 %UNLESS '+' # ST(P+7) # '-'
   %WHILE ST(A) # MARKER %CYCLE
      X = ST(A)-'0'
      MONITOR(10) %AND -> STRIP %UNLESS 0 <= X <= 9
      W = 10*W+X;  A = A+1
   %REPEAT
   W = -W %IF ST(P+7) = '-'
   MONITOR(4) %AND -> STRIP %IF A = P+7;! MISSING PARAMETER
   ST(S) = W;  S = S+1
   -> END FN
!
! DEC
MACHINE MACRO(5):
   W = ST(P+7)
   MONITOR(4) %AND -> STRIP %IF ST(P+6) = MARKER
   %IF W < 0 %THEN %START
      W = -W;  A = '-';  LOAD
   %FINISH
   W1 = 1;  W1 = 10*W1 %WHILE 10*W1 <= W
   %CYCLE
      D1 = W//W1;  D2 = W-D1*W1
      D1 = D1+'0';  D3 = W1//10
      A = D1;  W = D2;  W1 = D3
      LOAD
      %exit %if w1 < 1
   %REPEAT
   -> END FN
!
! BAR
MACHINE MACRO(6):
   %IF ST(P+6) = MARKER %OR ST(P+8) = MARKER %C
      %OR ST(P+10) = MARKER %THEN MONITOR(4) %AND -> STRIP
   R = ST(P+7);  W = ST(P+9);  A = ST(P+11)
   %IF R = '+' %OR R = '-' %THEN %START
      %IF R = '+' %THEN A = W+A %ELSE A = W-A
   %ELSE
      %IF R # '*' %AND R # '/' %AND R # 'R' %C
         %THEN MONITOR(12) %AND -> STRIP
      %IF R = '*' %THEN A = W*A %ELSE %START
         MONITOR(13) %AND A = 1 %IF A = 0
         A = W//A %IF R = '/'
         A = W-A*(W//A) %IF R = 'R'
      %FINISH
   %FINISH
   LOAD
   -> END FN
!
!  DELIMS
MACHINE MACRO(7):
   MONITOR(15) %IF ST(P+9) # 7 %OR ST(P+16) # MARKER
   %FOR W = P+9+1,1,P+16-1 %CYCLE
      %FOR  K = W+1,1,P+16 %CYCLE;    ! ...CHECKS AGAINST 'MARKER'
         MONITOR(15) %IF ST(W) = ST(K) %OR ST(W)<0 %OR ST(W)>127
      %REPEAT
   %REPEAT
   %BEGIN
   %CONSTBYTEINTEGERARRAY  M(1:6) = 1,2,3,4,6,7
      SYMTYPE(K) = 0 %FOR K = 0,1,127
      SYMTYPE(ST(P+9+K)) = M(K) %FOR K = 1,1,6
      LBR = ST(P+9+5);            ! ...LEFT BRACKET
      RBR = ST(P+9+6);            ! ...RIGHT BRACKET
   %END
   -> END FN
!
!
STOP:            !  FORCE TERMINATION
   INSTRM = SOURCE
!
!*END*
MACHINE MACRO(8):   ! '*END*'
   %IF INSTRM = DEFN FILE %THEN %START;   ! READING MACRO DEFN FILE?
      CLOSE INPUT
      INSTRM = SOURCE;  SELECT INPUT(INSTRM)
      -> END FN
   %FINISH
!
          !-------------------------------------------------!
          ! N.B.                                            !
          !     THIS FEATURE USED IN CONJUNCTION WITH       !
          !     'DELIMS' AS CURRENTLY IMPLEMENTED CAN       !
          !     CAUSE ABSOLUTE CHAOS.                       !
          !-------------------------------------------------!
  %ROUTINE DUMP TEXT
! ASSUMES 'W' POINTS TO LENGTH CELL
   %INTEGER END
      R = 0;  END = ST(W)-1
      R = R+1 %AND PRINT SYMBOL(ST(W+R)) %WHILE R # END
   %END
   %IF DUMP >= 0 %THEN %START
      SELECT OUTPUT(DUMP)
      W = E;  K = STK LIMIT+1
      %WHILE W # MSTHEAD %CYCLE
         K = K-1;  ST(K) = W;  W = ST(W)
      %REPEAT
      %WHILE K <= STK LIMIT %CYCLE
         W = ST(K)+1
         PRINT STRING("
$DEF,");  DUMP TEXT;  PRINT STRING(",[")
         W = W+ST(W); ! START OF DEFN BODY
         DUMP TEXT;  PRINT STRING("];");  NEWLINE
         K = K+1
      %REPEAT
      PRINT STRING("
$*END*;
")
   %FINISH
!
!

   SELECT OUTPUT(REPORT)
   %IF ERROR = 0 %C
      %THEN PRINT STRING("

   No monitor entries - output O.K.
") %C
      %ELSE %START
      PRINT STRING("
****");  WRITE(ERROR,1)
      PRINT STRING(" MONITOR ENTRIES - OUTPUT FAULTY
")
   %FINISH
   WRITE(S,7);  PRINT STRING(" out of");  WRITE(STKLIMIT+1,1)
   PRINT STRING(" cells are occupied.")
   NEWLINES(2)
   %SIGNAL 0,1 %UNLESS ERROR = 0;  ! ...TELL NEXT OUTERMOST LEVEL

%ENDOFPROGRAM
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        * 16-OCT-1980        IMP-77 GRAMMAR

*     actions                             pactions
*
* 1 - set type                            check for record exp
* 2 - check type                          set numerical ptype
* 3 - check string                        set string type
* 4 - recover atom                        set integer type
* 5 - apply parameters,subscripts         set const type
* 6 - indirect next                       set next
* 7 - check&set block type                generalise cond exps
* 8 - check operator
* 9 - check non-local %for
*10 - direct next

/CLASSES


  0 Z"         ,(19)

[generated classes=1]

  1 VDEC"      %
  2 OWNVDEC"   %
  3 EXTVSPEC"  %
  4 ADEC"      %
  5 OWNADEC"   %
  6 EXTASPEC"  %
  7 PROC"      %
  8 PROCSPEC"  %
  9 FORMDEC"   %
 10 SWDEC"     %
 11 LDEC"      %
 12 FORMSPEC"  %

 18 OPTION"    OPTION
 19 COMMA"     %

[normal classes=20]

 20 T"         ;
 21 COLON"     :
 22 COMMENT"   COMMENT
 23 LB"        (, [
 24 ALIAS"     ALIAS
 25 RB"        ), ]
 26 SUB"       _

 27 ARRAYD     ARRAY$40(2)
 28 STYPE      INTEGER(16+1),
               REAL(32+1),
               BYTEINTEGER(16+2),                BYTE(16+2),
               SHORTINTEGER(16+3),               SHORT(16+3),
               LONGINTEGER(16+4),                LONG(16+4),
               LONGREAL(32+4)
 29 ARRAY      ARRAY(2)
 30 NAME       NAME(1)
 31 PROCD      ROUTINE(8+96),      PREDICATE(11+112)
 32 FNMAP      FUNCTION(9),        FN(9),
               MAP(10),            NAMEFN(10),     NAMEFUNCTION(10)
 33 SWITCH     SWITCH(12)
 34 OWN        OWN(1),             CONST(2),       CONSTANT(2)
 35 EXTERNAL   EXTERNAL(3),        SYSTEM(4),      DYNAMIC(5),
               PRIM(6),            PERM(7)
 36 STRING     STRING$40(48)
 37 RECORD     RECORD(64)
 38 FORMAT     RECORDFORMAT(9), RECORDFORMATSPEC(12)
 39 SPEC       SPEC
 40 MCODE      *(40)
 41 LABEL      LABEL(6)
 42 OP1        <<(4+1),    >>(8+1),    ^^(12+1),    ^(48+3),
                                       \\(12+1),    \(48+3)
 43 OP2        &(20+1),    *(40),      //(16+1),    /(44+2)
 44 OP3        +(32),      -(36),      !(24+1),     !!(28+1)
 45 SIGN       -(36), +(32)
 46 UOP        \(48+3), ^(48+3), ~(48+3)
 47 MOD        |(14)
 48 DOT        .(13)
 49 COMP       =(0),       <(2),       >(4),
               #(1),       >=(3),      <=(5),
               \=(1),      <>(1),      ~=(1)
 50 ACOMP      ==,         ##(1)
 51 EQ         =(0),       =$10(0)
 52 EQEQ       ==,         ==$10
 53 JAM        <(2)
 54 JUMP"      ->
 55 RESOP      ->
 56 AND        AND,        AND$10
 57 OR         OR(2),      OR$10(2)
 58 NOT        NOT
 59 WHILE      WHILE(128+32+16+4)
 60 UNTIL      UNTIL(128+32+16+4+2)
 61 FOR"       FOR
 62 CWORD      IF(32+8+4),    UNLESS(32+8+6)
 63 EXIT       EXIT(4),       CONTINUE(32)
 64 ON         ON,            ONEVENT
 65 SIGNAL     SIGNAL,        SIGNALEVENT
 66 THEN"      THEN
 67 START      START
 68 ELSE       ELSE
 69 FINISH     FINISH
 70 FELSE      FINISHELSE
 71 CYCLE      CYCLE
 72 REPEAT     REPEAT
 73 PROGRAM    PROGRAM
 74 BEGIN      BEGIN
 75 END        END(2)
 76 ENDPROG    ENDOFPROGRAM(1), ENDOFFILE(0)
 77 ENDPERM    ENDOFPERM
 78 FRESULT    RESULT=(1384)
 79 MRESULT    RESULT==(1241)
 80 BACK       RETURN(1319),    TRUE(1354),     FALSE(1210)
 81 MONITOR    MONITOR(77+32)
 82 STOP       STOP(83+32)
 83 LIST       LIST(1),         ENDOFLIST(3)
 84 REALSLN    REALSLONG(4),    REALSNORMAL(1)
 85 CONTROL    CONTROL,         DIAGNOSE(1)
 86 INCLUDE    INCLUDE
 87 MASS       *=
 88 RTYPE      INTEGER$40(16+1)
 89 ADDOP      ++(117), --(113)

[built-in=90]

 90 IDENT       [identifier]
 91 V           [simple variable]
 92 N           [pointer variable]
 93 CONST       [constant]
 94 FM          [recordformat]
 96 R           [routine call]
 97 F           [function call]
 98 M           [map call]
 99 P           [predicate call]
100 RP          [routine parameter]
101 FP          [function parameter]
102 MP          [map parameter]
103 PP          [predicate parameter]
104 L           [label]
105 S           [switch]
106 A           [array]
107 AN          [arrayname]
108 NA          [name array]
109 NAN         [namearrayname]

[manifest=120]

120 %MSTART     [infiltrate %start]
121 %CLEAR      [record=0]
122 %PRED       [set cc from predicate]

124 %DUBIOUS    [check dubious declaration]
125 %DUP        [duplicate proc param id]
126 %PIN        [start of parameters]
127 %POUT       [end   of parameters]
128 %EDUP        [end of DUP]

[figurative=130]

130 PIDENT     =IDENT
131 CIDENT     =IDENT
132 OIDENT     =IDENT
133 FNAME      =IDENT
134 SWID       =IDENT
135 DOTL       =DOT
136 DOTR       =DOT
137 ASEP       =COMMA
138 CSEP       =COMMA
139 OSEP       =COMMA
140 PSEP       =COMMA
141 ARB        =RB
142 BPLRB      =RB
143 ORB        =RB
144 PRB        =RB
145 CRB        =RB
146 RCRB       =RB
147 RECRB      =RB
148 RECLB      =LB
149 LAB        =L
150 MLAB       =L
151 SLAB       =S
152 XNAME      =NAME
153 OWNT       =T
154 DBSEP      =COLON
155 PCONST     =CONST
156 CMOD       =MOD
157 CSIGN      =SIGN
158 CUOP       =UOP
159 COP1       =OP1
160 COP2       =OP2
161 COP3       =OP3
162 INDEF      =MCODE
163 XELSE      =ELSE
164 CRESOP     =RESOP
165 NLAB       =L
166 RUNTIL     =UNTIL
167 ACONST     =CONST
168 ORRB       =RB
169 FMANY      =MCODE
170 OSTRING    =CONST
171 FMLB       =LB
172 FMRB       =RB
173 FMOR       =OR
174 RANGERB    =RB
175 FSID       =IDENT

[actions=180]

181 %DUMMY        [set dummy var for init]
182 %DECL         [escape to declarator]
183 %TYPE         [2 - check operand type]
184 %ZERO         [check record=0]
185 %APPLY        [apply parameters]
186 %PROT         [check prot=0]
187 %SETPROT      [set protection]
188 %PTYPE        [6 - set phrase type]
189 %GAPP         [generate and set app]
190 %LOCAL        [reset local limit]
191 %GUARD        [protect record subnames]
192 %MCODE        [handle machine code]
193 %CDUMMY       [check = + DUMMY]
194 %SETTYPE      [1 - fixing type]
195 %OPER         [8 - check operator type]
196 %PARAM        [10- set parameter type & check]
197 %BLOCK        [7 - check block type]
198 %OTHER        [3,4,9 - sundry others]
199 %COMPILE      [compile phrase]

[phrasal=200]
200 APP               *** used by compile ***
201 BASEAPP
202 APP2
203 APP3
204 APP4
205 APP5
206 APP6
207 ADEFN
208 NPARM
209 SWDEF
210 SWIDS
211 CIEXP
212 RCONST
213 SCONST
214 ARRAYP
215 XIMP
216 IMP
217 COND
218 SCOND
219 EXP1
220 EXP2
221 SEXP
222 IEXP
223 IEXP1
224 IEXP2
225 ISEXP
226 SEQ
227 FDEF
228 EXP
229 NARRAYP
230 STRUCT
231 RESEXP
232 BPL
233 CONSTB
234 FITEM
235 MOREA
236 CLIST
237 FPP
238 FPP0
239 FPP1
240 FPP2
241 INITVAR
242 RECEXP
243 EIMP
244 IDENTS
245 RANGE

246 RCONSTB
247 VARP
248 INITDEC

252 ESCDEC
253 ESCPROC
254 ESCARRAY
255 ESCREC

/RULES

SS      -> %DECL (VDEC< IDENT INITDEC (COMMA IDENT INITDEC)* T,
           ADEC ADEFN (COMMA ADEFN)* T,
           (PROC<<, PROCSPEC<<) PIDENT ALIAS ACONST< %OTHER[1] &
                                       (LB Z FPP RB, %PIN Z %POUT) T,
           (PROC<<, PROCSPEC<<) PIDENT (LB Z FPP RB, %PIN Z %POUT) T,
           EXTVSPEC< IDENT (ALIAS ACONST< %OTHER[1])? &
                     (COMMA IDENT (ALIAS ACONST< %OTHER[1])?)* T,
           OWNVDEC<  INITVAR (COMMA INITVAR)* T,
           OWNADEC< OIDENT %SETTYPE (ALIAS ACONST< %OTHER[1])? CONSTB< &
            (EQ Z ((IEXP[5] (OSEP, LB (INDEF, IEXP) ORB OSEP))* &
                       (T Z)?)*  IEXP[5] (LB (INDEF, IEXP) ORB)? OWNT,  T),
           EXTASPEC<     OIDENT (ALIAS ACONST< %OTHER[1])? CONSTB<   &
                  (COMMA OIDENT (ALIAS ACONST< %OTHER[1])? CONSTB<)* T,
           FORMDEC< FNAME LB %PIN Z FITEM (COMMA IDENT, COMMA FITEM)* &
                     (FMOR FITEM (COMMA (IDENT, FITEM))* )* RECRB %POUT T,
           FORMSPEC< FSID T,
           LDEC IDENT (COMMA IDENT)* T,
           SWDEC< SWDEF (COMMA SWDEF)* T),
           LAB< COLON,
           SLAB< LB (INDEF", IEXP<<) RB COLON,
           FELSE<? CWORD COND START T,
           FELSE<? CWORD COND THEN START T,
           FELSE<? CWORD COND THEN IMP (ELSE (START, CWORD EIMP, IMP))? T,
           FELSE< START T,
           FELSE< IMP T,
           XELSE< T,
           XELSE<  CWORD COND T %MSTART,
           XELSE<  CWORD COND THEN IMP (ELSE (CWORD XIMP)?)? T %MSTART,
           FINISH< T,
           BEGIN<<    T,
           PROGRAM<< PIDENT T,
           END<<<     T,
           ENDPROG<<<,
           ENDPERM<   T,
           CYCLE T,
           CYCLE SEQ<[4] T,
           (WHILE COND, FOR SEQ[4]) (CYCLE, THEN IMP) T,
           REPEAT< T,
           REPEAT< RUNTIL COND T,
           ON (CLIST<, MCODE") START" T,
           CONTROL< CIEXP< T,
           LIST< T,
           MASS IEXP< T,
           MCODE" %MCODE,
           INCLUDE< CONST %OTHER[1] LIST? T,
           REALSLN< T,
           OPTION< OSTRING %OTHER[1] T,
           IMP (T,
                (CWORD<, WHILE<) COND< T,
                UNTIL< COND T,
                FOR SEQ<[4] T)

INITDEC -> %CDUMMY (V   (EQ %SETTYPE  EXP<[1], JAM %SETTYPE SIGN" EXP<[1]),
                   N   EQEQ %SETTYPE (V< %TYPE, N< %TYPE) %PROT (ADDOP< SEXP<<[4])?,
                   AN  EQEQ %SETTYPE (A< %TYPE, AN< %TYPE) %PROT,
                   NAN EQEQ %SETTYPE (NA< %TYPE, NAN< %TYPE) %PROT)

IDENTS  -> IDENT (COMMA IDENT)*

SWIDS   -> SWID (COMMA SWID)*

SWDEF   -> SWIDS CONSTB< %COMPILE

IMP     -> V %PROT (EQ %SETTYPE        EXP<[1],
                       JAM %SETTYPE SIGN" EXP<[1],
                       RESOP %OTHER[1]     RESEXP<[3]) (AND" IMP)?,
           R (AND" IMP)?,
           N      (%PROT ((ADDOP< SEXP<<[4])? (EQ %SETTYPE        EXP<[1],
                        JAM %SETTYPE SIGN" EXP<[1],
                        RESOP %OTHER[1]     RESEXP<[3]),
                        EQEQ %SETTYPE  (V< %TYPE, N< %TYPE) %PROT (ADDOP< SEXP<<[4])?),
             EQEQ %SETTYPE (V<, N<) %TYPE %PROT (ADDOP< SEXP<<[4])?) (AND" IMP)?,
           BACK %BLOCK,
           FRESULT %BLOCK EXP<[1],
           EXIT,
           AN  EQEQ %SETTYPE (%PROT  (A< %TYPE %PROT, AN< %TYPE %PROT),
                                 (A< %TYPE, AN< %TYPE)) (AND" IMP)?,
           NAN EQEQ %SETTYPE (%PROT ((NA< %TYPE, NAN< %TYPE) %PROT ,
                                     (NA< %TYPE, NAN< %TYPE) %PROT),
                           ((NA< %TYPE, NAN< %TYPE) ,
                                (NA< %TYPE, NAN< %TYPE)))         (AND" IMP)?,
           MRESULT %BLOCK (%PROT (V< %TYPE, N< %TYPE) %PROT,
                           (V< %TYPE, N< %TYPE)),
           STOP,
           MONITOR (AND" IMP)?,
           JUMP (L, S< LB EXP<<[4] RB),
           SIGNAL IEXP< (COMMA EXP<[4] (COMMA EXP<[4])?)?

EIMP    -> COND START,
           COND THEN START,
           COND THEN IMP (ELSE (START, CWORD EIMP, IMP))?

XIMP    -> COND THEN?,
           COND THEN IMP (ELSE (CWORD XIMP)?)?

COND    -> SCOND ((AND< SCOND)*, (OR< SCOND)*),
           EXP +

SCOND  ->  (V %SETTYPE, N %SETTYPE) (COMP %OTHER[2] EXP<[7] (COMP %OTHER[2] EXP<[7])?,
                         ACOMP (V< %TYPE, N< %TYPE),
                         CRESOP %OTHER[1] RESEXP<[3],
                            (OP1 %OPER SEXP<[2])* &
                            (OP2 %OPER EXP1<[2])* &
                            (OP3 %OPER EXP2<[2])* &
                            (+, COMP %OTHER[2] EXP<[7] (COMP %OTHER[2] EXP<[7])?),
                         (DOT %OTHER[1] (V<, N<) %OTHER[1])* &
                           (+, COMP %OTHER[2] EXP<[7] (COMP %OTHER[2] EXP<[7])?)),
           LB COND[2] RB,
           NOT SCOND,
           P %PRED,
           LB EXP[2] RB (OP1 %OPER SEXP<[2])* &
                        (OP2 %OPER EXP1<[2])* &
                        (OP3 %OPER EXP2<[2])* &
                        (+, COMP %OTHER[2] %SETTYPE EXP<[2] (COMP %OTHER[2] EXP<[2])?),
           (A, AN, NA, NAN) ACOMP &
              %SETTYPE (A< %TYPE, AN< %TYPE, NA< %TYPE, NAN< %TYPE),
           EXP[2] (+, COMP %OTHER[2] EXP<[2] (COMP %OTHER[2] EXP<[2])?)

RECEXP  -> CONST" %ZERO %CLEAR,
           V %TYPE, N %TYPE

EXP     -> (V<, N<) %TYPE &
                     (OP1 %OPER SEXP<)* (OP2 %OPER EXP1<)* (OP3 %OPER EXP2<)*,
           (V<, N<) %TYPE (DOT %OTHER[1] (V<, N<) %TYPE)*,
           UOP? SEXP< (OP1 %OPER SEXP<)* (OP2 %OPER EXP1<)* (OP3 %OPER EXP2<)*,
           SIGN EXP2< (OP3 %OPER EXP2<)*

EXP2    -> SEXP< (OP1 %OPER SEXP<)* (OP2 %OPER EXP1<)*

EXP1    -> SEXP< (OP1 %OPER SEXP<)*

SEXP    -> V %TYPE, N %TYPE, LB EXP RB,
           MOD" EXP MOD

IEXP    -> CUOP? ISEXP<[4] (COP1 ISEXP<[4])* (COP2 IEXP1<)* (COP3 IEXP2<)*,
           CSIGN IEXP2< (COP3 IEXP2<)*

IEXP2   -> ISEXP<[4] (COP1 ISEXP<[4])* (COP2 IEXP1<)*

IEXP1   -> ISEXP<[4] (COP1 ISEXP<[4])*

ISEXP   -> PCONST %TYPE,
           LB IEXP RB,
           MOD" IEXP CMOD

SEQ     -> (V %TYPE, N %TYPE) %PROT %OTHER[4] EQ" EXP COMMA EXP< CSEP EXP<<

RCONST  -> SIGN? CONST< %TYPE

SCONST  -> CONST %OTHER[1]

FDEF    -> RECLB (FM, INDEF") RB %COMPILE

FITEM   -> FMLB FITEM (COMMA (IDENT, FITEM))* &
                  (FMOR FITEM (COMMA (IDENT, FITEM))* )* FMRB,
           %DECL (VDEC IDENT, ADEC IDENTS RCONSTB (COMMA MOREA)?)

MOREA   -> IDENT (COMMA IDENT)* RCONSTB (COMMA MOREA)?,
           FITEM (COMMA IDENT, COMMA FITEM)*

CONSTB  -> LB IEXP COLON IEXP CRB

RCONSTB -> LB IEXP COLON IEXP RCRB

BPL     -> LB EXP[4] DBSEP EXP<[4] (COMMA EXP[4] DBSEP EXP<[4])* BPLRB

FPP     -> %PIN %DECL (VDEC IDENT (COMMA IDENT)* (COMMA FPP0, %POUT),
                       PROC IDENT %DUP FPP1 (COMMA FPP0<<, %POUT<<) %EDUP)

FPP0    -> %DECL      (VDEC IDENT (COMMA IDENT)* (COMMA FPP0, %POUT),
                       PROC IDENT %DUP FPP1 (COMMA FPP0<<, %POUT<<) %EDUP)

FPP1    -> %PIN (LB %LOCAL FPP2 %GAPP RB)? %POUT

FPP2    -> %DECL (VDEC IDENT (COMMA IDENT)*, PROC IDENT FPP1") (COMMA FPP2)?


ADEFN   -> IDENTS BPL %COMPILE

BASEAPP -> EXP[4]

APP2    -> EXP[4] ASEP EXP[4]

APP3    -> EXP[4] ASEP EXP[4] ASEP EXP[4]

APP4    -> EXP[4] ASEP EXP[4] ASEP EXP[4] ASEP EXP[4]

APP5    -> EXP[4] ASEP EXP[4] ASEP EXP[4] ASEP EXP[4] ASEP EXP[4]

APP6    -> EXP[4] ASEP EXP[4] ASEP EXP[4] ASEP EXP[4] ASEP EXP[4] ASEP EXP[4]

CLIST   -> IEXP (COMMA IEXP)*

INITVAR -> CIDENT %SETTYPE (ALIAS ACONST< %OTHER[1])? &
                 (EQ" %DUMMY V" IEXP<[5],
                  EQEQ" %DUMMY (N", AN", NAN") %OTHER[3] (V<, N<) %PROT %TYPE  &
                              (ADDOP< IEXP<<[4])?,
                  EQEQ" %DUMMY (N", AN", NAN") IEXP<[4],
                  %DUBIOUS) %COMPILE


CIEXP   -> IEXP %COMPILE

RESEXP  -> ((V, N) %PROT DOTL)? LB EXP RB (DOTR (V, N) %PROT)?

NPARM   -> (V, N, A, AN, NA, NAN) %PROT, NLAB

VARP    -> (V %PTYPE, N %PTYPE) %PROT (ADDOP< SEXP<<[4])?

ARRAYP  -> A %PTYPE, AN %PTYPE

NARRAYP -> NA %PTYPE, NAN %PTYPE

STRUCT  -> STRING (MCODE", IEXP<) RB,
           RECORD RECLB (FM, MCODE") RB

RANGE   -> IEXP COLON IEXP RANGERB

ESCDEC  -> (STYPE< NAME? (ARRAY XNAME?, ARRAYD IEXP< RB XNAME)?,
             OWN? (STYPE<, RTYPE RANGE, STRUCT<) NAME? &
                  (ARRAY XNAME?, ARRAYD IEXP< RB XNAME)?,
             PROCD< SPEC?,
             EXTERNAL? (STYPE<, RTYPE RANGE, STRUCT<) NAME? &
                  (ARRAY XNAME?, ARRAYD IEXP< RB XNAME)?,
             EXTERNAL? (PROCD<, (STYPE<, RTYPE RANGE, STRUCT<) FNMAP) SPEC?,
             EXTERNAL          (STYPE<, RTYPE RANGE, STRUCT<) NAME?         &
                   (ARRAY XNAME?, ARRAYD IEXP< RB XNAME)? SPEC,
             FORMAT,
             SWITCH,
             LABEL,
             NAME) %COMPILE

ESCPROC -> (R, F, M, P) LB APP PRB %APPLY

ESCARRAY-> (V, N) LB (%PROT APP, APP %SETPROT) ARB %APPLY

ESCREC  -> (V, N) SUB %GUARD (V %OTHER[0], N %OTHER[0],
                              A %OTHER[0], AN %OTHER[0],
                              NA %OTHER[0], NAN %OTHER[0])

/END

 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        delete cal.lst
gpm @1.cal/$1.cal
os32mt /t:
set time=1000
cal(squez=99,lcnt=55) $1.cal/@1,$cal.lst
//
exit
rename $cal.lst#/cal.lst
rename $cal.lst/cal.lst
purge
offer cal.lst/@2@1.cal
 H?    :                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %begin;         !table generator for IMP machine code
   %conststring(1) snl="
"
   %integer op, flag, j,k,l,p, entries
   %integerarray mn, flags(1:255)
   %string(5)%array ops(1:255)
   %routine read mnemonic(%integer n)
      %integer sym, m;  %string(5)  s
      readsymbol(sym) %until sym # ' ' %and sym # nl
      m = 0;  s = ""
      %cycle
         sym = sym-32 %if sym >= 'a'
         m = m<<6!!sym;  s = s.tostring(sym)
         readsymbol(sym)
         %exit %if sym = ' ' %or sym = nl
      %repeat
      mn(n) = m; ops(n) = s
      %return
   %end
   %routine hex(%integername s)
      %if s >= 'A' %then s = (s-'A')&15+10 %else s = s-'0'
   %end
   %routine read hex(%integername n)
      %integer s1, s2
      readsymbol(s1) %until s1 # ' '
      readsymbol(s2)
      hex(s1);  hex(s2)
      n = s1<<4!s2
   %end
   %string(11)%fn  hex val(%integer  val, digits)
      %string(11) s;  s = "x'"
      %integer  j,k
      %for j = digits*4-4,-4,0 %cycle
         k = (val>>j)&15
         %if k < 10 %then k = k+'0' %else k = k-10+'A'
         s = s.tostring(k)
      %repeat
      %result = s."'"
   %end
   %routine get flags(%integername n)
      %integer s
      n = 0
      %cycle
         readsymbol(s);  s = s-32 %if s >= 'a'
         %return %if s = nl
         %if s = 'B' %start
            readsymbol(s)
            hex(s)
            n = s<<4!1
         %else %if s = 'R'
            n = N!2
         %else %if s = 'X'
            n = n!4
         %else %if s = '1'
            n = n!8
         %else %if s = '2'
            n = n!16
         %finish
      %repeat
   %end
   %routine input mcode
      %integer p, op, f
      %on %event 9 %start
         -> EOF
      %finish
      p = 0
      %cycle
         %exit %if nextsymbol < 0
         p = p+1
         read mnemonic(p)
         read hex(op)
         get flags(f)
         flags(p) = op<<8!f
      %repeat
EOF:
      entries = p
      %end
   %routine sort mcode
      %integer flag, p ,temp, limit
      %string(5) s
      limit = entries
      %while limit > 0 %cycle
         flag = 0;  limit = limit-1
         %for p = 1, 1, limit %cycle
            %if mn(p) > mn(p+1) %start
               temp = mn(p);  mn(p) = mn(p+1);  mn(p+1) = temp
               temp = flags(p);  flags(p) = flags(p+1);  flags(p+1) = temp
               s =ops(p); ops(p) =ops(p+1); ops(p+1) = s
               flag = 1
            %finish
         %repeat
         %return %if flag = 0
      %repeat
   %end
   %routine dump(%integerarrayname n, %integer  digits)
      %constinteger  round = 1,  oplength = 5
      %ownstring(3) indent="   "
      %integer  unit, prefix, cols
      %string(80)  line1, line2
      %string(20)  item
      %integer  j,k,l
      unit = 1+digits+3+1;   ! space + x' . . .' + comma
      cols = (80-length(indent))//unit
      cols = (cols//round)*round
      prefix = (op length - unit)//2
      newline
      l = 0
      %for j = 1,1,entries %cycle
         l = l-1
         %if l <= 0 %start
            %if l = 0 %start;      ! not first time through
               print string(line1.snl.line2.snl)
            %finish
            line1 = indent
            line2 = indent;  charno(line2,1) = '!'
            l = cols
         %finish
         line1 = line1." ".hexval(n(j),digits)
         item = ops(j)
         item = " ".item." " %while length(item) < unit-1
         item = " ".item %if length(item) # unit
         line2 = line2.item
         line1 = line1."," %if j # entries
      %repeat
      print string(line1.snl.line2.snl) %if line1 # indent
   %end

   input mcode
   sort mcode
   printstring("%constinteger mc entries =");  write(entries, 1)
   newline
   printstring("%constintegerarray mcop(1:mc entries) =")
   dump(mn,8)
   printstring("%constshortintegerarray opflags(1:mc entries) =")
   dump(flags,4)
   newline
%endofprogram
 H?    <                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    balr 01 r
btcr 02 r
bfcr 03 r
nr 04 r
clr 05 r
or 06 r
xr 07 r
lr 08 r
cr 09 r
ar 0a r
sr 0b r
mhr 0c r
dhr 0d r
srls 10 r
slls 11 r
chvr 12 r
bfcr 13 r
lpswr 18 r b0
mr 1c r
dr 1d r
btbs 20 r
btfs 21 r
bfbs 22 r
bffs 23 r
lis 24 r
lcs 25 r
ais 26 r
sis 27 r
ler 28 r
cer 29 r
aer 2a r
ser 2b r
mer 2c r
der 2d r
fxr 2e r
flr 2f r
exhr 34 r
sth 40 X
ldr 38 r
cdr 39 r
adr 3a r
sdr 3b r
mdr 3c r
ddr 3d r
fxdr 3e r
fldr 3f r
bal 41 X
btc 42 X
bfc 43 X
nh 44 X
clh 45 X
oh 46 X
xh 47 X
lh 48 X
ch 49 X
ah 4a X
sh 4b X
mh 4c X
dh 4d X
st 50 X
am 51 X
n 54 X
cl 55 X
o 56 X
x 57 X
l 58 X
c 59 X
a 5a X
s 5b X
m 5c X
d 5d X
crc12 5e X
crc16 5f X
ste 60 X
ahm 61 X
atl 64 X
abl 65 X
rtl 66 X
rbl 67 X
le 68 X
ce 69 X
ae 6a X
se 6b X
me 6c X
de 6d X
stme 71 X
lme 72 X
std 70 X
lhl 73 X
tbt 74 X
sbt 75 X
rbt 76 X
cbt 77 X
ld 78 X
cd 79 X
ad 7a X
sd 7B X
md 7C X
dd 7d X
stmd 7e X
lmd 7f X
srhls 90 r
slhls 91 r
stbr 92 r
lbr 93 r
exbr 94 r
epsr 95 r
wbr 96 r
rbr 97 r
whr 98 r
rhr 99 r
wdr 9a r
rdr 9b r
ssr 9d r
ocr 9e r
bxh c0 X
bxle c1 X
lpsw c2 b0 X
thi c3 1
nhi c4 1
clhi c5 1
ohi c6 1
xhi c7 1
lhi c8 1
chi c9 1
ahi ca 1
shi cb 1
srhl cc 1
slhl cd 1
srha ce 1
slha cf 1
stm d0 X
lm d1 X
stb d2 X
lb d3 X
clb d4 X
al d5 b0
wb d6 X
rb d7 X
wh d8 X
rh d9 X
wd da X
rd db X
ss dd X
oc de X
ts e0 X
svc e1 X
sint e2 b0
scp e3 X
la e6 X
tlate e7 X
rrl ea
rll eb
srl ec
srr ed
sra ee
sla ef
ti f3 2
ni f4 2
cli f5 2
oi f6 2
xi f7 2
li f8 2
ci f9 2
ai fa 2
si fb 2
bc 42 b8 X
bcr 02 r b8
bnc 43 b8 X
bncr 03 b8 r
be 43 b3 X
ber 03 b3 r
bne 42 b3 X
bner 02 b3 r
bl 42 b8 X
blr 02 b8 r
bnl 43 b8 X
bnlr 03 b8 r
bm 42 b1 X
bmr 02 b1 r
bnm 43 b1 X
bnmr 03 b1 r
bp 42 b2 X
bpr 02 b2 r
bnp 43 b2 X
bnpr 03 b2 r
bo 42 b4 X
bor 02 b4 r
bno 43 b4 X
bnor 03 b4 r
bz 43 b3 X
bzr 03 b3 r
bnz 42 b3 X
bnzr 02 b3 r
b 43 b0 X
br 03 b0 r
nop 42 b0 X
nopr 02 b0 r
bg 42 b2 X
bgr 02 b2 r
bge 43 b1 X
bger 03 b1 r
ble 43 b2 X
bler 03 b2 r
 H?    E                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     ^ C!          ]b }R[  B          
  R[      NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    :X%                    579;?ACEGIKMOQSUWY[]_a  BLOCK                                                                                    AAA  AAAA  AAA  AAAA               m       	      if  ;;<<=9==<!<<<<<<<<e<h=<>A={={=ASS RH ASS LH   p                               lh                                                   ,,,,,,,,,,,,,-,--9LOAD 
	              +?++G+G+G+G+?+?+?+?+?+?+?    ,
+D  (8(8''((=* '.'''')(*       	&&X    &z&&&&&ADDRESS     	 a                                                         POP DROP POP LHSBOTH RHS BOTH LHS SET LHSSSET C stackS STACKV stack                               @ @                 Block index ! GI%HCGGDHHGGQpGGGQpQpQpQpQpQpQpQpQpQpKIQwHHHIECJHE8FKDQ<NEK/GpK>FE(CKiGGlH<GtGFIGQpHAGGGN6IQQpGCQpL+KK[L+L$GH7HCKEbKHFHKIJKHHKGK_GKvKPQpPPhQp   	  ) ? a   9     3   !               	 	      9  	 	 	                             2                           no RX3 formform?	) missingindex register?no double indexed form base register? displacement?register 2?comma missingregister 1?invalid offset unknown operation  :  ZCY]X\TV[WzjJQ
yiIU	BC5B%BBBEB%C5}mM|lLxhHFD{kKPGe*:&adw)9EA3C#CC%CCB5CCCEC%B5#B3-=/.,<%(8$srBu+;'    p`@gv  ft"##3C#3 !4?>~q^_               A   B   C   D   L   M   N   O   S   X        	                                      D  E  H  R          A  B  D  E  H  I  M  R                                    I  S        H  I  R    R  I M L   ! !R "I #B #H #I #R 0 0 1 1 1 1 3 3E 3R 3 3 3 3 3 3 3 3 4R 5C 6H 6 Q QR RR sR vR  R R Г   R  I L    I I      ! !R " "I #A $ $ $ $ %B %D %E %H %M % 0 0 0 1R 2R 3L 4 5L P RI ` aR bR IIRapppqRRPPQERRR5<RHHAHLHSI2AI2LI3SIPISISBL<rBL<vME%R4SRLSU4E            #0!0!! # #                                    ,l             -->lineGA CA  defnEN r refN p refN sw ref j reff c reff                         
            	CHEAPENED) =*opt list empty   	    Numerical constant too big Illegal constant exponentNo. of shifts outwith 0..31String constant too long !Invalid parameter for READ SYMBOLNon-local control variable?Illegal FORdivision by zero :  *WARNING: line   oxUSING: STACK: Please seek assistance!! 	' at line*Compiler error '
         +                      x                                      P            <                                                                                  XH  $ % P PS@Q        P
 ZJ  & '  [K  ' & P\SP]S	YI TD   VF   WG                      ( h8 x( `S  pS* j: z+ k; {, l< |- m= })i9yUE C  A PPP/ .  PrPqPPLQLQsQatu         |   	!#(-2070=uC
GKOSW[dfghikl_ino
opqpvxz{         (   $%&                            	
            	
 
  }             
#READSYMFN $TRACE $%GO
   S{"#$$A> $$#'!"C  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n ?&?$$A> $/ #-( $  ?,'"H  !34  1  0 !81 !5$$A> $@#0#D   D   &A'1"C H  !34  1  0 !81 !5$$A> B  @ !4B ";
C@ !$$A> #$$A> B  C
B$P#E  E  &Q'1"C A> 2#XC   PC   '4"2$ #PC   '4"?1  34C0  D   D   
C  g p ,$RHf W   T` :W   <$SX Hl W   T$RX9 c W   T$RX k W   T$SX j W   T$UXI Xd  W   T$SXi Hf W   T$SX Hl W   T$SX9 Hc W   T$SX Hk 
W   T$SX j W   TXI T UC06$Rd W   TW  ,0W   HXi Xf A#W  ,y  	g p 8$`W   lW   H  'P 0X9 <  cW   <X 0B0W   H$QXmTW   TW  ,W   HW  ,X\C0FW   HW  ,X\P 4$@PI 0#&API 0BZH LXd  AXI 0UI 4 >XX dC0>W   HW  ,Xh dPi ,X ,Xl  AX9 ,X P ,!2#"$bW   l$ $A 	g p ,$`W   lW   H$QXmTW   TW   HX 
sL

W   HC zW   HC hW   HC VfW   HC DLW   HC 20W   HC  W   H#	W   H#W  ,$bW   ly  	g ) ,Ap <$`W   l ,W   H` :W   <$i ,lW   Xi A*$bW   ly  5	g p ,H  ! !<6 3#<X H ɠ !%y 0 !%"$"	 %	g p ,X  !<6 3!8Ӷ #8Ű #5$y Ӧ #3$"%"
 !	g p , !56 3#5$y H ɰ ##$"	%" 	W  p 4H P ,#8Z ,s< P9 ,H P 0#8Z ,s P 0XI ,#6X 0#7	#XI 0PI ,D#%y `Rec0A0 6	g p 4$P 0$0&1P9 ,X 0
P 0Y !U !5y %"0 B0%"
 %	W  p ,X  U  B0<6 ӵ ;B0.H E B0"F e F!<X H< E5 !5%y $" -	g p ,  !;6 2Z=X  ɰ #%$y %" 	w p 0XUB0<X=`&30P9 ,&4P=`XŰ <!6X ,y &P
Z tX ,@  &P
Z ts  C  5	w p 4X P ,W   P 0W   P X9 ,8V 0y  "	w p @$P 4/` $P 4/` <AP 4W   P h ` 8+` X8 P8 W   P X Ű .!3C H%Q 4Ű @!3C Ű _!3C ɰ A!'P h l 8K/d*` XY 4!3C C hI <`I ,%aQi 4X 4!3C zX8 P8 W   P X Ű @!3C ,ɰ A!'P h) ,m) 8`) ,ȫ/
,j ` C AP 4   #6  P 4h) 8A l ` XH @ U!=W   P +k ` y  	g p ,` #&`REL1Af#7bZmX  #y X9 2Z=X ZX  'P  XI BZMXT  #`REL2A%aQm C  ;	g p ,` #&`CLM1Af#7bZmX  #y X9 2Z=X ZX  &P  $AQM C  .	g p ,X  %1Q9 ,Ӷ 
sK

XI 4@ B08Xi AfXY PW ,Xj H P 0$aA$1@9 LX XI 0@K C h`HAZ1AXZ Xe  !:Xi 0Pe  $ C 2X: ӳ &ҳ XI 0@C #XZ $de X 0P  H9 L@5 X K @ K z  p
g p \X ZX<  P9 ,!$y P9 4X P X Z$@PJ  AP 0$Q@Y LXi ` !` !$$W@Y LX dP 8X9 8!3C $X  ӫ U !4kAXI 8XT PY 8C Xh @i RX 0P <Ȱ@ Nȩ <P ,XY $bAi <AXI ,#6`HAZ2AC < s	w p 0%aAX #=$0&1P9 ,cAX9 ,0  :y  	w p 0$P 0 P=P$P%P P$PPK&API ,P TZXXmPe   ZP@ xB0$0&1P9 ,4Z8($P  X ,Z(P X9 ,0 B0y  N	w p 0$`W   lXP ,!?W   HW  ,C $QX9 ,c W   T$QX ,k W   T$SX ,Xj W   T` (W   <%QXI ,d W   TW   H$QXi ,Hf W   TW  ,X ,X<  P9 ,#3C d$bW   ly  w	W  p 4%Q[Y  PY  XP ,$0P9 0X ,C00X XI W  T  !8[ d V!2#P 0X  P ,C $y X 0#=X9 ,X  P  XP  P=XC  F	w p 8X#7X8$0 B\XP ,$P 0@ PI 4%QQY 4Xi ,X  !2#Pi 0P ,"X9 4#6`OPT1AX 0$P  XP  PmQX$XMPI ,XD  PM$QQX$Xh$` #&`Opt3AX) ,$5Ay  \	W  p 0P !4y $PAP ,!<A P ,XP  P#$aH1 c  AX ,X  @ XI T [ Xd  Pk H  4 ; $ҫ XI    V P [ RZ]Xe  !$;   P C ^ [	W  p < P 4H6 P9 8$PAP ,!4y ӱ Ű !9X J @ J HQ !3C Xi 4` #8 U 8!3PX X9  #` !3C PY 0` B0Pӡ Š B0DŰ B0<XI d AXi 0AtXY Xi 0e $P  $45 XY  Xi A.C >ӡ U 8!3#3C @XI d AXi 0A&XY Xi 0e $P  $15 H&#Xi AH&à #3AC  	g p 0$SXi AP ,!4y   C  	g p 0X !4y `Pi %T P X=P9 ,fC6X ,C0*$K   T #5@ K $P@[ X  P ,C C BXi ,C0:$6   T #50 6 $H   T #4$@ Xf  Pi ,C XMC02T P B0&PI ,XD  PMXi ,XP  Pm%1Q8$C X$#`Use?AtC  	w p 0XC02P ,%1Q8$X ,X  !2#P ,"XP  XP$PXH$#6`FallA$PPX y  2	g p 4fC 0$&P 0Z(P ,X<  U9 !5y X 0 B0$"
 $	g p 0fB0"$QX=0 ##PXZ(P X XJ PI ,C0$XY ,Xe  #4Pi ,"XmPe  X Xl PmX9 $P P  P y  B	g p 0f!5$y X!6`EcopAP ,X  PX) ,$5AXf  AX9 ,P  C  ,	g p @XP <i 0A
P ,Xi AP ,!:$0P=P8 P8$C  Xa A`PX ,X P XK PH$y  5	g p 0f!$y AZP ,aAP ,X P  X8 P1 X$P XmAX ,P C  +	g p 0XP ,X: ,C0X XJ U B0HS ET B0vc  lB0hӳ T B0Zc  lB0Lӳ T B0>Xi 4PF  PI 4X ,$1X ,HK 4  V< $Qk V  5P< $QQ\ z X3  P: ,C ZXj XP  PmC  h
g p PXi A:P ,C0VX P 0$P P P P <9 <P9 4X 0#=X  P 8kAXI 8PI 0"XY 4$`Pe  X ,X9 <P< y  >	w p 8X P 4$0&1P9 0%Q X !4$P ZJ  PI ,BZMXT  !=$aX ,l  Ti 4!5y 0 B0X9 4!2#$0P9 4C $eA$C  C	w p 8X P 4$0&1P9 ,%QX!4$PZ J  PI 0BZMXT  B0*Xi 0bZmX !>$3X 0;  T9 4!6 y X9 ,0 B0X 4!2#$P 4C $cA>$dA8$C  R	w p 4X P 00 &1P9 ,%QXŠ !5Ƞ PZXJ  !6Xy 0 B0XY 0!2#$PPY 0C ` A C  <	g p ,hW   <i W   <y  	w p 0$mW   <X4#`DMP1AX=<P9 ,P<P=4y   	w p 0X4#&`DMP2AX=<P9 ,P<P=4$lW   <y   	g p 4$bW    'P ,X9 <  0 P9 00 	!&3 0P9 0#3 7P9 0cW   <X ,B0y  4	W  p ,$`W   l` *W   <%SXm4W   TX  Z(W   H$QXi W   TW  ,$bW   ly  =	W  p 0$`W   lX CA!=TW   HX=4P9 ,#PW   HX8P ,Xi ,'b%SW   T` :W   <Xi  AW  ,$bW   ly  K	g p ,$gW   <Xi hW   <i W   <$Q4H=&#XY `CAAy  +	g p ,$hW   <Xi hW   <i W   <$Q8H=&#XY `GAAy  +	g p ,` ABXi A:y  	g p ,%[4P4!=$1Q=4X0k
jA#Pm0%AQM4X]4#&`DMP3Ay  )	g p ,` A"si Ay  	g p ,` Asi A` W   <$Qy  	g p ,` Asi A` W   <$Qy  	g p ,%[<P<!=%1Q=8X8k
jAt#Pm8$AQM8y  !	g p ,X8T #5$`A"y  	g p 0$aW   l$aW   <Xi hW   <i W   <X4P ,lhW   <i /W   <$bW   lH=&#$QXi APy  F	W  p 0XTUX#3A@$aW   lXi  W   <Xi hW   <i W   <X=41P9 ,chW   <i /W   <$bW   lH&#XY  Xi AXi  W   <X  Š B0Xi hW   <i W   <y  k	W  p 0X4!X=@#&`DMP4ApX<ð #8AZ$`AA$[@Z Z  %A[I  $PZP]@P]<$`eaPi ,$nW   <Xi ,Ay  A	w p 0X4#y X=T[=X0 #5$:P9 ,#$9P9 ,$aW   lXi ,W   <X ,Ű 
!5XmTAzH&C4$`W   lHW   H$QXmTW   TW  ,$bW   lXi ,W   <XI ,@ 
!5XmTAX]TP]XXm4PmC 6 o	W  p DX ,<  0 #$$<<  cW   <X ,ӫ  P @$@PI 8C &API 8XY ,
Te  W   <XI 8UI @B0Xi #y X P 0X8 P9 40 #X ɰ !#!4$P 03!$$1P9 4'P <$P 8XH #8XX #5Ƞ P 8dW   <Xm@Zi <  V lVi 8W   <X=\Z9 ӳ   X   
P 8k` W   <Xi 8hW   <Xi 8W   <C   	W  p ,$Q=0 #$$Q$kW   <ȭP ,XY  Xi Apy  %	W  p 4` !` #&`DMP5Av` #5$Q#$1Q=` W   <Xi W   <Xi  #&a` A $P 0X Š !4$P 0XY ,#&QP MPG ,kAXY P B0$$`A$`A Xi ` !5$`A#%aAy  e	w p ,$aW   l` W   <XmaAh$[@laAZXm8aAPXmAHXmA@XmA8$`W   <W   $bW   l` W   <W   y  Q	W  p |X4P XX9 ,H P @ӣ P DC PI HXS  PY Lc Pi PX   !$=Q9 X9 
3Z=|H  P 4P 0XMXUMT#3AXY D#5P B0:Xi P#6`RXDxAX LB0fX9 HC0^X Ű C0RŰ C0JŰ C0BX  !5Ű C0&@9 r$@PI \$QY oi \Pg ,ZkAy @ PI 8C X9 0 B0`X  U HB0T B LBD$3P9 #$4P9 $[ LP L$ҩ o@ rP \I \PG ,[cAXi HAC 0 B0@ B08X HB00Xi  AX  @ r$@PI \$QY oi \Pg ,Z$cAPC :X 4ð !?0 #<0 #90 #6`RXD1AP$Q 0$@PI < B 2B*XY HB0"ð` #?!$BPI <#P <[ LP L#
!' !$API <XI 0ZI <
DZMHT  PY 8Xi <` B$X\Z  <  P   4
SeZi LAC @X\Z  ӫ  P   XM\ZI H
ZeT  
eAxXi <!5si LAjXi LAbC :X D B0nX9  #7X H#4X P#6`RXD2AFXI 0
DZMHT  PY 8P  #7P9 TP  P9 HXm\Zi  6  P   4X\Z H
Se[  
eAC Xi  #6X9 H0 !6`RXD3AXHZ @ӫ  P <!6`RXD4AݼXI 0
J
DZMHT  PY 8P TY L#6`RXD5AݔZm\V  Xi 8`   TZ=\
eS  
eA`Xi L!`?!%X PC0 X=\Z9 Pӳ  ` ʰ@ k
jA,Xi LA$XI H#$dAXY P#4eAXi 8` @#:XLZ4[ XPL#` !9X=4P=LX  PPC $	W  p PX ,@ F$0P9 0$@ @P !$@ @$ҩ CI 0PG ,A|y  #	W  p TX ,@ JX9 0P9 4$@ D$ҩ GI 4PG ,A@y  	W  p TX ,@ JX9 0P9 4$@ DP !$@ D$ҩ GI 4PG ,Ay  $	W  p 0P #7Z]  P  f#*` !'X9  !0 #&`SKP1A
3Z=P&aPi ,Hc  Vi ,Ay  /	w * ,Ap,$`W   l` *W   <$SXmTW   TW   ,W   HW   H ,W   HW  ,$bW   lX  ;#>X P W   P C z  Z
w p ,$ ,P 8X8 P8 W   P X Ű _!3C &I ,@ #=XY 8V[PY 8&AҹD  ,I ,C P W   P z  =
w p 8 P ,$1P: 0X ,Y 0BRZ 0P 4ZXXK  UI 8!6X 4z XZ 4RZ]XXe  Yi 8#'X 4'P ,#X: 4&1P: 0C AT$C  D
g p ,$P  X8 0 0!0 7#%z X XK  CXX PEPK  Xh Ph W   P X  0! 7#$%C C  :
g p ,A~!5$z X X<  !0 ##$"%" 
w p 4X  +#8 -#5%z P ,X P W   P j 0A!8AT$C X: ,0 -!6$[ 0P 0XJ 0QI @%C  =
w p X%P <P D$0P9 @AA4P L!4y 
Z`H  P Hð #8İ P TC Bi TA!7AC X Š ,#7AC X P W   P XI H@ #>i <A!7AxC vC XX P  B0A4P PXh Ph W   P X PZ ,P 4X<  P9 @Ӽ Ű B0 c`$RAl$P @Al!3C 
C 6L D#7ZM\T  PY <AJ!3C Xh ` (!8X <##C ~C BC X8 0 -!5A#2#i @Af!7AC A!3C X Ű (B0X P W   P i <A!7AdC bXH @ ,B0BXX PX W   P Xi H` !7A,C *i DAJ!7xAC X  )#7nA C X P W   P X8 0 ;#7hAC X <#$P <X D#$P D!8#6P <$P DXI H@   XY TT
EdZi <A4Xi H` #7si BA"C j` #>` !;si @A
si BAC J` B0BX @!5X9 DC *` !7\A.C ,X Ds @ʰ@ Jk
dAsi BAC 	w p 0X [ &P ,$S` A
AX=4P8 $aA$Xh AXh AXh AAXY ,\H PX X \ P y  9	g p 8
fZmpH  P 4X= C0BP ,$P 0X ,C0,à #:XI 0
DZMhHd  A|XY ,QPY ,$aQi 0C X 4X9 40 
P 0lAXX 4#X #:$@PG ,P 0$X$cAi $SA:$_PW ,i Pg 0P ` A&X 4C X8 #:$P ,P7 0$X$dAȠ,Q y  {	w p ,XTUX#<$0P=` 2AXmTAy  	g p 4$P ,Xj ,W   lXj W   <X: 0 B0<Xi W   <X ,Ű B0XmTA%OPMX]PW ,$P%aAC Xj ,` B0Xx#&`TAG?AӌXm4aALXmADX=`&30P=`Z=dP: ,H$ð  !:2P: ,@  PJ 0#PPZ 03#$Y: 0#&`FRM?A,cAXm\Zh f  W   <Xi 8AXi <AXi 0AX4QX: ,0 !2#$P ,C %APMz  
w p ,H&C@$`W   lW   H$QXi W   TW  ,$bW   l$oW   <z  4
w p x$P X9 !0 !4$P $ҽP D$CPJ HAFP B00%QQX Xh Yi ,!&`DFV1AdZh ,Ph 4&$4AC 6Y !`DFV2AZ ,P 4X Y ,#*P ,$1P: D!$4AX P W   P XH @ ,!2#]P #7&QME ]C mf!4$P AֈP 4W   P X: 44P: ,X 4İ P 0A\P 8W   P XJ ,PH XZ 0PX Xj 8Ph @ B0<` C04` !7$CPJ ,$P H` !7$BPJ ,$1P: HZMd  Pj 8C |@ !<$GPJ ,ZMd  Pj 8C `@ B0*$FPJ ,Pj <X 4@k Yi ,!(dZh ,s P 8C .@ !?$EPJ ,$0P: HX 4@k &aPj 8#ZMd  Pj 8XJ ,@ #7Xh 4X 8@ X8 4C 
UZ]|H  @ ABP  P XH HTPZ LXh ` Ph C0d` B\#9-AC 8` B0$' ,AAB -A  #-A` !$$cPh $0=X 0ɰ Bɰ 
B XH PMtXX C0rDC0lP B0<$aQmX 4< 0 < X@ 
Ű #4z $SPX -A$cAXH 4X]8PT  $nd PW ,$P$fAlC XxB0,PX Xj D#7ALX 4P  X8 !7-AC $aPi P8 $P 8P C XJ 8PH Ű C0$SPZ HXj ,B0&$P X8 4Xx@ $dPj ,$HPJ 8c C vŰ #4Ű !>$P P: 8Ű !4$DPH C PŰ #5Ű B0<$P $HPJ 8PZ HX8 4%@ 
XJ L#$@ #&`DFV3A
S TS #$DPJ 8Xh C0` B0@X , !9X: 00 !4$P XJ 0@ #7@ #4@ !5$`Ph #$QPY #Xj HAXi ` #6X]8$nAX ,P X: 0P8 0 !7$P $P XH 4%Q@T 
Xh B00 #50 B0$;P8 Ӵ İư AҴ HT C "P!/` Yh !*X !%ư  Ҵ $cAADX8 0 C0*X 4XM8PK  $^[ d [h AXh A<C 8$SXh A0AXh 4X8P  $>6 Xm4[h AXh AAX Ű !:XM8'HPG ,$P$eAC JXX 4He &c` @e X 0 !` @e $>5 $P  XM8&H@E X]8PW ,[$dAC Xj 0` !9AzX 4P  C ` B0X8 4X @ XH K&A@C X]x&Q@S X l 
f$QA>X8 4$ҳ XM@PC  AXh AXh AXX PZ tXh 'aPj @C "&aPj @$Qx$TXmxAXmxAdXj @Uj tB0AC "` B0(X=x#;X 4HK YM`##PM`#%QP]tPX C X 4X8 < XBL @ `B0\ P !6l ` !;P B0l ` B P  'PP !9` !` !#Ql  @ L $Q H=$0 B0RX 4K J c[ @Z `k @j fX  P P: c0 !7$4: c$@ `XY 'QPZ t$W[Z tj PAC 4Xm`Zj H%[ HlPm`Pi X8 4Pc  Zj 8Pm`X xV HP xXI !9XX 4XU  Xh A.C .
g p , #4 !5$z 6 0 #3$"	H Ű #7Ű #4ɰ !%C $C  *
w p 4$Q\X=\0 #&`DSC1AɎX HP 0!6`DSC2AzXH \PJ ,!6`DSC3AfX P HX* 0$8AXD PH \X: ,X dP P8 dP#  z  C
g p 4 `P ,X: ,X P 0!6`DROPAXK  UJ !2#P ,C X P XZ 0Xh \Pe PX \X X8 HP< P Hz  8
g p 0f!` #&`VSTKAȞdZh ,Pj ,AP HX\Z LP  X: ,ӳ ұ XC  PA  HS @Q Hc @a  @ H @ HC 
@A 
$PPQ @ Hc @a    Xj @a H& #7Xi HA@z  `
g p 0A<P ,X X* ,$8AX\Z LP,  H=&0 #6bAz  &
g p ,AP L$ X: P1  $@  XM\BZH LP  H]&P #7Xi LAɜz  ,
W  p ,AA&XZ  Xi HAz  
W  p 4ApP LX  X:  P1  $@ XJ ,@A XZ 0@Q $`Pa X\Z LP  H=&0 #7Xi LAz  6
w p ,X\Z LX<  P9 HH&ð #6zcAz  
w p ,X\ !&`SETBAlZ LX<@P9 HX\Z LXK  PI LH]&P #<pcApfXi LAdz  5
w p ,X\!&`POPLAZ LX<  P9 H%Q\HM&@ #6^cAz  &
w p ,AH& #7TXi HAXi HA|z  
g p 4f!;X<  c&aPj C <XK  &A	FC ,K  @ !8XXe ` #;$eAƈXX: '1<  X Ű B0:A(XJ 'APJ 0%QPZ ,#&QPZ ,ZXe  AXZ ,UZ 0 =A6C .Xj 'aPj 0%P ,#&P ,Zl  A|X ,U 0 =z  n
w p 0X P ,X8$ҳ  XJ ,C 0'APJ ,W   P XXe  &a  Z  C W   P  AC0 $C0 .B0>X8ӳ  Ű B0.HM$@ B0"XXe ApXi L   z $`ATX9 L$@ $BPH $_S `@c X<  X L&1@; L  D!5X]B0<d&a$QA*Xi LX<P  $`A
X=!=XK  D!7XY LX5  P=#P[  #$`AC h 
g p 4X P 0X8 0 #>$cA:Xj 0A\X8'z fB0BXP ,XMBZMXT  UZ 0!3C fXm&a` PmUj ,!2#C $S$dAfX& PPAX=2Z=X 0P  XM
DZM X]4@T  kARAXm
fZm H  C \ l
w p ,$QxXxz  
w p ,$Q  X9  0 P#&`NLBLAZ2Z8 |z  
g p 4X  P ,X: ,U9 C0&2Z8 |P: 0H  U !5z %AQJ ,C $"	 &
g p <$PLP 0f!4z f#P ,$1P: 0C fA~P 4B0&A:P 4X @  AXJ 4@ $QPZ 0C Ha #X !AX: 4@ $P 0XJ 4HT P @T PZ ,Xj 0#<Xj ANP 8#4$P  Xj ,`AJX=pU=4#5Xj AXj A>X#;XH @ :#6@ L#3A$PP]pPY C  
W  p 8$PhP #7Z]5  P:  X ,Bf!4z f#PC zAhP 0B0(A$P 0XJ @A  AXZ 0@ Xj AC 4Ha C X , !<AX: 0@ Xj A#f#%Xj AX 0HK @PH#XZ PXXj  ` !5$P 4#$6P: 4XZ 4XhA٦XXJ  @ k
dA$RQ]LXj  ` B0 X4PpX8 0 :!7H$İ @P#HM$@ @PM$P C  
W  p 0P !5AP  Xj AºC0X X<  B0DXj  AXj  AƮX  P ,[$dAxXj  AƖXJ $W@T $ad X   C 2/` $P $`AP ,XJ P@T $g@d $ P  C BP Xj ABX: ӳ P ,XZ  $mAXj  AXJ $QT $g@d X   z  {
W  p ,AX l AhXj Afz  
W  p T* 4$8A$1@: DZ GX ,Һ KX* 0P* 4Vj 4Az  !
g p <H 'P 0H6 P: ,X  P 4F PJ 8H P  $1@6 $TV P ALXj X ,@ X: 00@6 X 4P  z  9
g p 0 
ZhH<  P: ,CxӶ Ű #6`AMAPAPAP ,$aa  AXJ Xd  `$RA$_PW ,$`Pg 0XZ ,` AX $1@< @< X ,Ҽ $@PL  kAĆz 0 #50 B0"XV  !?0 !5$6P: ,#$4P: ,HV PV  $@ 6 C  m
g p 4H P ,H6 P: 0AX ,Ű #4z XJ T P !dArXj   #4 !5P AX: X 0 Z  P  $EC C  @
g p 8$P ,6 3C0Z0 #50 B0<Xf AC00X XK XT  PZ ,k ` !6$P[Z ,PZ ,$`k dAP Xj AXC <  #5 	B0*H P 4AP Xj A*XJ XZ 4@T $dd X < 
3Z=pH  P 0#`VMAPAPҼ XJ ,QL  z  t
W  p @H& #5AX:  P: 4B .0 P: 4X HK @ #[ U#9kA#5` Pj 4X 4P <X: ӳ C0lŰ B0TXc AC0HXJ HT P B 8Xd X  P 8AX: $ҳ XZ 4cA,XJ XZ 8PT  $ed #XZ 4Xj AC >C PJ 0HS PZ ,@ !cAXXj  P 0H=$0 B0(X <P XZ  Xj AǔXH PJ <XZ e Pj 0X 0 #3!3C  B0$X: ӳ !5$@C #XS  !4$ac C  B0DX: $ҳ $A@C P cALXZ Xj ,@e   @ $0P5  $P 0XMxUJ C0LXJ PMxXZ  B6Hm$` #:H  #5dA!8X: H Ű !7XZ 4Xj A$@PMxXZ <PX z 
g p 0XZ  AX   #5 B0rP ,X;  P  ZXL  @ C0"XZ  RZ]Xe  ` !;X ,< U:  !4{ XK ,@ !6AP  #A6P  QXk A$#ZX\  P #6`PickAPC  \W  p lH& #7NXj AXj A!<X:  0 !0 #$0 !3C XX K PJ T$@K XZ TC02Xk Pj , <!9K 4#5P AXZ T
UsE

Hk #7` #4` !4kA6XZ  Xj AlX   B0VX: ӳ Ű !4z Ű B0.C BZMXT  P !>Xc  `!` !& P  #AP  C VX: ӳ B0BZXL  @ C .Xj  A
XZ $`e Xj  AXj  A
X X:  < #lAX K 
DsD

` LD1APXZ He ` !` LD2AP P ,X5  P7 0XZ  $aAX$aX  k  AvXJ  XZ e F#6TXj A8X $1@< X $AK XZ  [ $`Pk  eA
C X < U:  !3C P7 ,XZ  $aAٞ$aX  k  AXJ XZ  T eA
C xHm$` Pj hX H< 0 C (0 C 0 #90 #6` LD3AP$`Pj hC &Ӽ ð !<lA#8XJ HT P !4$`Pj hX H< 0 B0($2@< P ,XZ  ` %AԢ$aX  k  ANC (P ,XZ  $aAԂ$aXJ  d  A.XZ  Xj AXZ hC0Xj H  C@$@ X=(0 #;$P ,XZ  ` Av#$OPG ,$P 0XZ  ` AC  XJ $W@T $oPg ,$P 0XZ  $gAغ$?P7 ,P ` A&X K @K C 2H]$P B0 Xj , B0XZ  Xj A<X: ,X    B0VXJ T P B0BHd ` #5` B00` !4$Q  X: Ȱ @ Xj ,ANXZ  Xj AC C ~Ű B0vcA,XJ T P B0.Xj  ` !5AbP  X < P7 ,XZ  ` A<C NH Ű !5$cQd  #Ű !4$Q  $@ XZ  dA:C Xj Av$PXj ,ADX: ,P7 ,XZ  Xj TAҘC H$ð B0BXJ ,T UB04Xd  ` B0(XZ  Xj AX < 0 !8H Ű !3C XJ ,T U#>Hm$` #9$SdA` A Xj AX ,< 3!;X  !ɰ #$$fA#0 #6P lA`XJ ,$PPT  Xj , P ,X6  P7 0X [ Xj TAHC ` LD4APXJ ,T UB0Xd  A$P dC Xj ADXj AXj  P  lA
$1P: XX dɰ #$$2P: X$UcA^$@PG ,%QXj dV  %P 0X: S $cAմ$P ,XJ dPG 0XZ U ` AՖC HXj  ` B0$P dX: T0 !4$P dXj AC0VX K ZM\T  P UZ dB0:k Zm|  ZX<  B0 [ PZ `Xj T` #7Z]|  P `#ATP `C >X=\Z:  ӳ  ð C0"XM|ZJ  T  RZ]Xe  !6X  P `#AP `X=|Z: `ӳ  P dkA
XZ `Xj AXj dA
Xj dAXj dA
XJ TPJ X@ C0:XZ `PW ,XZ d$aA"Xj `A
$`Pg , P 0XZ d` AF$6P: X$cX dk  A$PXj ,A2XJ ,T U#9P #6Hd ` #6P dAX ,P ,XZ dXj XA`Xj dA
X: T0 B08H$ð C0(XJ d@ #<dA
XZ dPW ,$QeAh` AC 00 B0(Xj dA
Xj `A
Xj `Pj XXj dPj `Xj XPj dX X: `< $P  $AL U:  #6XZ  lA4C XZ  Xj  \#6H6 0 !7P AC ($PA$X K @ #;@ #8D#6P kAXZ He ` !4$Q  Xj ,AX: P7 ,XZ  $mA<X XJ  K $PP[  $a@k C d$TXj A$SXj ,A$dA
$cA
$bA$bA
X $2< C *XZ  Xj ArX HK C0XX !5P ,PX Xi LPj P$P ,$0P7 0$hAX L$E@K P @[ X PP LXj AXj $ $aA$cA
X: $@ $DC $SS $`Pc   @ 0 Q8 X ,K @ C0X * 0$8Aj GA
$S@Z @P j 0Aj GPg ,$P 0VlAтj GA
P Xj ,AXX: Ӻ Gҳ $C@C $TS P7 ,Xj ,V $bA̶X ,l A
X: c A
X $@K P ,Z G$bĂC N$SXj A$RXj ,A$bA
$cA
XZ He Pj d!5` Pj d$fA&Xj dAXX $4< X k A
XJ $P@T Xj  ` #?f#=VdAX $0@< $Ҽ Xj ,AC 2XJ  @ !6` LD5APXZ e Pj T$`e X TC0X5 P: ,
sLv

` LD6AP$P TXJ ,HT P ChP dA$aX ,< cB0NX K dC0@H[ P B4Xj T` #5` B0"* 0$8A+$8A 0,$8AXj AX < P:  $PXj ,AX ,P ,XZ  Xj TAC .` LD7APXJ HT P #XZ  dAHXZ  Xj ATXj   B0HX:  0 #5Ӷ !3C cAXJ T PW ,XZ  $aAXj X   lA
C X:  0 !6AP  #Ӷ ;#4cAXJ  @ !@ #&` LD8APXZ e 
fsF

X ,H< 0 !` LD9APP Xj Af$RXj ,A\` A
$bA
$cAհ` A
X @ K XZ He ` !$$a@e $a l  AXj ,AC 
g p 4$P ,$0P; 0XK ,YK !X 0{ 4$Z%CPK ,$aQk 0X 0 d#&`COP1APC  ,W  p 8X  X<  P: 0X ,XK  PJ 4XZ 
UsE*

`COP2APXj 4Qj 0C ~X 0[ 4P 0C nX: 0V: 4P: 0C ^X 0T 4P 0C NXJ 0WJ 4PJ 0C >XZ 0Xj 4V  PZ 0C *XZ 0\J 4PZ 0C X: 0\* 4P: 0C 
X 0X: 4  P 0C X: 0X* 4A  P 0C X 4!7$aA$APJ 4XZ 0E@ ]J 4PZ 0C XZ 4!7$aA$aPj 4X: 0#  ]* 4\* 4X 0P 0C X: 0#$0;cAV\
 4 F#'$gA$@PJ 4XZ 0/%X 4A ` C $Xj 4!7$aA$P 4X: 4/X 0/-` $BPH $`A:P 0XZ  $oe $@ $45 X  XJ 0PK  z  
g p ,A#8P Xk A#P Xk A{  g p L%Q\$0P: <P: @P: DX\Z LXK  PJ ,dA#6$QPZ <C  Xj ,H  #:#86 3!4$PAVX\Z LXK PJ 0dAC0$$QPZ @Xj ` !;$cPj X 0$0[<  P<  X ,K DC0PJ HX[ PZ 4eA#4$aPj DX DT @C0X=Z: XZ HC  [  EPJ 8#;@ B0^Xj Uj HB0RX H !;Xj 4$[  P  $3P: HXj 4Pg ,XZ 0Xj AXj 4AX ,X: 0P< X HҼ C Xj ,AhXJ @C0jXZ <B0.Xj ` B0VX ,H< 0 B0FӼ Ű #5Ű B04Xj ,  !4$ X: 0P7 ,VXj A&Xj 0ANz X 0[ U#6kAC XDC0RXk  ` B0FX  #8 #5 B0. !5$P #$P X ,+$8A$@PJ @k A
X=Z: ӳ  C0rXJ <B02XZ ,e ` C0ZX 0< 0 B0JӼ ZXK  B8XZ 0Xj ,Pe X\Z LP\  X: 5 PZ 4Pj 0PZ ,X <P @#XJ ,XZ T Xj 0Pd X @C0dX: 
3Z=X 0XK  EC  !;XZ ,$`e kAC 8X: 0 B0,H]$P B0 dA$P 8#*Xj ,$ X: 0P  C 
g p t$P hX=\0 #`ASS1AP2Z8 LX  P 0XM\BZH LXT@PZ ,e Pj lH& #<eAXj 0AX: CfX ,K @ C02* 8$8AX 0+$8A 8X* 0$8A$PPX z %aak Hk AxX\Z LX<  P: ,ӳ P lXC  PJ pŰ #4$PPZ c ` B0&JC PH HS P !7Ű !4&APH Xh Qc  C @ C0$QPZ @S $dc X 0@\ $5< Ӽ #8Ű #5l C vŰ !7@QL  C dX]`&SPPZ \e  Pm`X<  P: `P\  X Ҽ $RcA$P ,$@PG 0P ` AXX PW ,Xj \Pg 0$Y` Aƾ%Q\X: 0ӳ ð `C0VXJ ,XT  &XPX $aA%QXj ,AX%QXj 0ANXj 0H 
!?6 P7 ,X  P 0$QeAZC DF PG ,XV  PW 0$QeA$nPg ,X 0H< 
P7 0$Q$cA$X 0HK 
PK  $^[ Xj ,H  B0&H6 B0$P ,XJ 0HT P PW 0$Q$cAŠ$bAXj , P ,X6  P7 0$Q$bAźX 0k A
XJ 0T PW ,Xd  &dPg 0$QeAŐX ,l A
X: ,ӳ P ,XC  &DPG 0$Q$bAfXj ,AؒXj 0A؊C jXZ ,He ` B0XJ #6`ASS2APHS P B0Xj ,A%QXj ,AXj 0A%QXj 0A$aAXj 0 P ,X6  P7 0$QeAX ,K PG ,X[  PW 0$Q$bAXj ,f A
X 0l A
X: 0ӳ P ,XC  &DPG 0$QeAĎXZ ,e Pg ,X  &P 0$Q$bApXj ,AלXj 0AהC tPZ `ư ҳ H P XP !4&P XcAP Xj 0AXJ 0T PZ \Xj , P ,X6  P7 0$bAX ,k A
XMlZJ `XZ XTe  
lXZ \AX: ,ӳ P ,XC  &DPG 0XZ \$bAúXj ,AC XJ B0"eA,XZ ,He !6Xj 0A#Xj 0AX ,H< 0 B0\XZ 0lAP XX 0K D#:$RkAP PZ d#kAv` Pj d$SXj ,AXj Xb$TA,Xj dA2C 00 B0Ӽ ð B0XJ C @XZ 0He ` B00eAX ,$3@< lA:Xj ,A$`AxXj A&C H\ PZ \@ C0^XZ 0lAnC0PXj 0 !;Xj ,AվXj 0AնC ,X: \@6 X ,k A
Xj ,AՖXJ 0$P@T dAC <Hm$`  C0X  C0X: 0ӳ C0|SXj ,AnB0nXJ 0XT Xj ,AnB0ZXZ 0Xe Pj 4$ $SXj ,A$RXj 0AߌX=c AX ,$DK $P@[ $gk X 4P kA\C X: 0ӳ İҳ XJ @ C0(H]$P  !=Xj \Ic !P #5cA!4$P X: 0ӳ !<$SXj ,A$RXj 0A#
$RcA$SXj ,AXMZJ d  A:XZ P #5Xj \A@C &Xj ,  C0z$7P: \X pɰ #$6P: \HF @ !4$2P: \XZ 0e f#6SXj 0ApXj ,AX\Z LX<  P: ,X 0XJ \K XS P[ P %QcAVC %QALHm$` B0X 0H< 0 B Ӽ #5Ű B0\Xj ,AnC0XJ 0T UB0(d A
Xj 0AZXj ,f A
Xj ,AFC &PJ 4XD PJ 0X 4l A
Xj 4A"P Xj 0A%QXj ,AX: ,P7 ,X 0[ ` &A"&Xj ,AXJ 0d A
Xj 0AXj ,AC XZ 0He Pj ` B085 3B0.ӵ B0$XE  @ !@!+@ !5$cPj `#$bPj `XZ PZ XXj ,H  !$Y `!$$RPZ X8 P: \ !Xj 0A!7XZ \Xj 0AۺXZ \Xj 0AX 0K @ #6XZ \kAXZ 0e Pj \X ,< 0 #5%QlAߌX ,P ,XZ \$bA"&HM$@ B0XZ ,e bZmX  P `!@  C0@eAX9 C00X ,K UH B0 H[ TZX ,Hk dZh ,   #AX: 0ӳ XJ ,T İ [T Xj X` #6XZ \dAXj \A
Xj ,A2Xj 0A*X  B0bH=$0 C0VX ,HK @ B0$Xj \A
XZ \PW ,` A&n` AC "$`Pg , P 0XZ \` $A&` AĞC 
g p 4f!4z  P ,$ X6 P: 0XZ ,AXj 0AXj ,A
Xj AjC  )
w p ,Xj @A$P D#X ,  !4X: 8!5%{ $" w p <X HH< 
P; ,HL PK 0H\ P[ 4$`Pk 8X L< 0 #<3B0L @ #4DB0v0 B0@XL T U#5P B0(Xd  Pk 8P !8$QT $`Pd  #$0< dAϔC "Xi LX  P 8$P  6 0 !4$16 X[ 8\J @P[ 8XJ D!dA$kA2#Xj @A$mA"XY H$a@e H 
B&eAڀ$4P7 ,$@PG 0XY HHU 
$nA
$cA$cAAfXk 8#8Ap$cAARXi HA۔X , #5Xi HAۂX9 HXJ 4@C X[ 4@S Xk 0@c  V <@ {  ŀg p PX C0DA*%1Q=\X LK D#6P kAXY LXi HX P PV 6 &16 z AX HK &A[ E#6`ARF1APk Pj ,`k  P 8H; P: 4HK @ PJ <Hm$` !5 #5X 8B02H P @0 !4&P @X: ,0 #4$P @AX#5AC b%Q\XI HT U!?$RXi LAXi LA͌$mPj 0C P B0D$RXd AX HXl Ad$SXi LAXi LAR$>P: 0H$ð !50 P: 0C Xi L #5P AݜX9 LX HXK PC [ 'QRZX PZ LXh 'dPj 0C D&dPj 0X LX< P: HP lAP$P ,XJ 0PG 0XY LU $bA&Xj HPi LXj 0Uj LB0$RXi LAX L$5< $Ҽ XH PL  $SlAXi LAv$_PZ 0Xi H$ A׺X9 HH 
B.$EPG ,$PPW 0[$nA>$TXi LAܲXi LA0%aQm\#$TcAܚ$bA
$dA
X 0 #4$cA
Xj 0A.$bA
X9 HH 
B>C PG ,HS PW 0XS  c AXi H$ $0P6  $Ҷ @ $cA#$BC $PPS  Xi HAJXi HX 4@ X: <0 @6 X ,ð #4$FF C 
g p 4 P 0A#50 P: 0X K @ B0bXX P ?B0VXk AC0JXj X P ,$06 XZ 0AۀX ,P ,XJ T ` $A"&Xj ,AXZ e A
C @XZ 0Xj ADXm4UmL!9XPX: ӳ #;XJ T PW ,$aA&n#kA
z  n
W  p 0A$RXj AXj  A$SXj  A$TXj ,A,A$bA
$cA
` "A.z  +
W  p ,P Aڞ$PXj  A״Xj  A!7P Xj  AӆX  P ,X: S $gA"&X k A
z  /
W  p 0  B0"X6  U=!=PZ ,Pj  PZ Xhǰ PhXJ  T P B06X4  U=B0*X K D#6P kAXZ $c@e eAC 64 3#5$SdA$RXj Aٺ$SXj  Aٰ$bA
$cA
$iA.X $E@K $T[ $`Ph z  j
W  p 0$PlH6 #40 !6Az eA>#6Xj Af"Xj A>#=Xj  ARXhǰ PhC Xj A!6Xj  A#9XZ  Xj ATC XJ HT P B0XZ  dAP ,XZ  Xj AC t$PdAP Xj Aؾ$PXj  AXj ,` =C0` ##=X  P ,X: S $gA"&#X  P ,XJ T ` A"&XZ e A
C  
g p D` !4$`AJAX HP 8AX9 HP: 4X ð !4$`A"AʮXI HPJ 0AʢXY HPZ ,$TXj ,A$SXj 0A$RXj 4A$UXj 8AXj 0H P <X: 8H P @$dA
Xj ,A@$cA
Xj 0A2$bA
Xj 4A$$eA
Xj 8A$gA.XJ <HZ Cd
eA@Xj ` !4$hA.z  
g p ,X` ,# ,P`Xf  `A^$X[Y $8P7 ,$[ P 0` A&XH @ Bn$PPW ,$gA $hPg , (P 0P $bA&H=$0 C0>X0B06$P0kW   l$cW   <$aA$`A$bW   l$HPG ,XX $aA&nXZ He 
C0n]!6`HDR1AP$P ,$0P7 0VXh AX L$E@K $QPW ,$`Pg 0V$bAǾ$bA
$cAH$  #7X: $@ 
#`A@XM`&C@PM`H]$P  !=` A.Xm`A@$`A@#$`Pg , ,P 0$X$cA&A0X=(0 C0*H$ð C0$OPG ,$\PW 0$]$aA&Xm%P 4X: H 
C0$`!A@$dA.XH <Hd A@XZ $`@e 
H$ @C0NX: =B06X ɰ B*-AXM8PG ,$P$fA ` 2A.$`A@H]$P @P]) 0$4Az 5
w p ,XpU4!4z X9 #:$P ,$\cÂC 60pP9 cAjXH PG ,$XPW 0` A&` Pg ,$Q` A&nX4Pp$0P9 C  ?
g p ,X  .!?H=$0 !:Ӷ ư Ҷ z AC0@XH$QT  Xj   $P$bA$2P8 $`A(X $OK X]@P[  C zP Xj AXm`&a`Pm`X < P7 ,$Q` A&n$P ,@ PG 0$Q$cA&XX PW ,Xm`Pg 0$Q`  A&X X8 < X`P  &P`XJ $U@T `@d $@ C  
g p 8  C0\$0P: 0H 
P ,P8 Ű !8 @6 
#AªAXJ ,
DsD`

$nApz Xj A$QPW ,$`Pg 0V$bAhX HH< 0 #50 B0,$dA$Q$eA$R$eA` A.AĜX H$C@K XY Le A
Xi HH  !5Xi LA$aA4C pP Xi HAtC `Xi HAC TX9 HH P ,cA(XJ ,@ B0fXY He ` C0V` C0NP Xi HAX H$4< $aӼ k  AXI HPG ,T ` A"&XY He A
Xi H$ C $`AAXi HA̠H=$0 C0(Xi LAC0*X LXK  XZ ,E!Xi HIF !($cAArC b$RXi HAv$SXi LAlXi LA%Q\$bA
$cA
` A.X9 Hc 	A@$bA
A"X H$BK $PP[  $a@k #Xi HALXZ ,X9 HӼ  @ ZK  @C C P Xi HAAxP 4aAXY He Pg ,XZ 4` A&nXj 4A
X HX: 4< $@ @ C @ !PJ 4$QPZ ,$bPj 0#$P 4$7P: ,Ȱ P 0P Xi HAf` A
Xj 4A.Xj 0A
A8XI HXZ 0T $a@d X ,@ C $$TXi HA"Xi HA:$%1Q=\A8%Q\$RXi HA $SXi LAXi HA:$Xi LA:$$bA
$cA
$dA
$lA.$bA
$DPG ,$PPW 0$bA8Xi L$@ C X9 HH Ű C0TXJ ,@ !8Zl[  PZ 4#Hc Pj 4Ű !4&aPj 4c A
X H$1@< $Ҽ Ҽ XJ 4PL  C :XY H$dQe  @ $1@5 X ,Ű !8$oA$hA~#A$lArC `  A.$bA
$APG ,$PPW 0$bAhC ` &aPj 4AXj 4`  9A%Q\Xi HA!7P Xi HAΪ%QXi LAX9 Lӳ P ,XC  PG 0P ` A&XY Le A
Xi H P ,X6  P7 0$Q` !A&X LK PG ,X[  PW 0P ` A&Xi HA:$Xi LA:$%aAC $UXi HA$eA
Xi HA:$%aQm\` 1A.C X &P X: ӳ ð !3AXJ T UC0P C0(AP ,$RaA$oPg ,$P 0P ` A&$8P7 ,X P 0$V` A&XH #:$PPW ,PG 0$X$cA&Xj   B0.$>P7 ,X  P 0S` A&@ PG ,T` A&nC PP ,XV  PW 0$T$cA<$hA$cPg ,$P 0$Y` A&0 P7 ,$P 0S` A&Xj ,A^C pXh #:$P ,Pg 0$X$cA&X: Xc  `$RA$P ,$@PG 0P ` A&XX #:$`Pg ,PW 0$X$dA&X < 0 #5X4PpXJ HT 
PX Hd Ph H !4dA:$C 6
g p 0A9P ,%Q\$41 X @ 
#$ɰ #&`CMOPAPaAz  $
W  p 4A#4{ P Xk AX < P; 0A P ,XK XX T P  Xk  @d @ PW ,P 0X[ 0$bA&Xk 0A
H=$0 !7X[ 0Xk AC  GW  p 0A;TX\Z LX<  P; ,X[  cA8%AQM\{  w p PX\Z LX<@P: ,X\Z LXK@PJ 4X]\RZX LXe@Pj 8AjP <X !6`FOR1AP&P0 <Z8 hP8 pXP D%APJ LH]$P #5A P L$QXj 8A$QXj 4AXh pX X: DU=#5XP$P @Xj 4A;T$dAڶXM\BZH LXT  PZ 0Xj ,  !:6 2Z=X  B"H6 P: DAXZ DXj ,AX ,$FK %TQ]\Xj 8AC0xXj 0AC0lXj 4AC0`Xj 4X  C02X: 8X  XJ 0[  P D!XZ DE@ LLUZ D!4$QPZ @X: @!5$bA#X 8X;  XJ 0[4  P: @XZ 0e Pj H` !&AxP H# P HXZ HXj 0A@X: 0ӳ P HXJ @B08H]$P C0,$QcAXj HA
$RXj 8A$SXj 4A` A.Xj @B0<Xj ,A;TXj 0A;T$aA܎Xj HA
X pX=ȳ@@ $APG ,$\kAlXj <A@ ATH]$P @P]Xj ,A;TXj 0A;TXj 4A;T$cAXj 0A:$Xj 4A:$A<XZ HXi HA\$aAXj L!X P ,Pg 0XZ H$bA&X8 pX <@ XJ HC XZ L@S 
Xj ,  X  P  HF C HV @S Xj 8  X  P Xj ,A:$Xj 8A:$z 
C0w p 4X ZX<  C06H$ð C0*XH BZMX]YT  !XH BZMYT  #$$hAXX P #:Xh 
fsF

X  #6 #AHX8 
3sC

XmAbz XmAC ~$aA?P ,"XmAC XmAC ZXmAC XmA@C BXh A=C X P 0$@PJ ,#	&APJ ,$`AXJ ,UJ 0 :C z`ADMPAPAC h 
g p 0Yi ,C 6Pi ,dZh ,Pj ,&$4A$>6 A@ @X ,P  $[  z dZh ,$[  "	 -
$4w p ,X`&P`$4P7 ,$P 0\Xh A< XI L$V@T ` @d   Q`z  *
w p @X l[ hP ,#6X9 x0 !4z 3!4P 0# !2"$P 0XI tPJ <XX 'QPZ 4C  &QPZ 4TZX ,PZ 8Xe  [j 0Pe  XZ 4UZ <B0X p[ 0P pC  I
W  p ) 0$4A$0P9 xP9 P9 P9 $P $P P9 P9 XM4PI P9 %QPY P9 XmpPi \%aPmpXP |P=X9  P9 X`P TXdP X$PdXMPI `X]PY dXMPMPM$`Ph Ph %PPi 8#6`-1 ?APX8 4P9 DX ,P X B@ ,PM`Pm4$QQ](Xm(` #)X !6`AM00APZmd  P Z%1P<  $PX !3AXI B0P$QQ]XmPi ` A/0X  HB0.%1P8X(Ű !<-A$P P Xi DAjC 4!7XH @C Pm`X]`PY h&SPPY lP]`PY pXH 'API tX P W   P X8 
3sC

Aj@|C X\#6`STK?APX d#6`USNGAPXM #6`CLMDAPX]4#`LIT?AP$`Ph Ph XPAjPTH=$0 @C0"X Ű :#4Ű L!5$P#XM#3A.C A0C A=|XY HXe  Ph A=|X HX<  P8 C AjP X\C0ZX8 4ӳ ư ҳ A=|X ɠ B*XI HHT P #Xd  /` X PX8 P=#X HXK  PMC RXX P !7` PmC <P !70P=C *P #9PP#X@ J  XhF X  #5 B0(X8 P9 $P #&P AX U  9C X B0VXH 4T PT XmPd  $04 Ӵ Ű !54 C "Ű !8X !5VcA pXH 4T 'RT C Xh 4$>6 X8P  ɠ BF @F P ,XX $eA C hŠ B0`V P B0"XHT  e&a$QAXm@Pi $`A=#P !$`A?P #`AM01APX 4$?< X P  C AC A>C A>$ҭXHT  PY jPi C "&aPi Zh&6  =L Xi Ui B0A=|C AjP AjX  kaA;C lAh !6$`A;C XX Š A!3C J$BPH $`A?P $TPW ,$`Pg 0Q$oA< X L$7@< C AjP A<X HH Z ,Hj [i A:A<%AQM\XY Le ` C0X H< 0 #40 !>X  Z  P  '4J5 @< C V0 	B0,$7< $@ P lA@ JXI HXY LHe @d C "0 !&H @ #
X  @ H &@ X HXE  PJ  He @j H @ H5 
@: 
X HX LHJ @K HZ @[ j k jA:$C AjaA:X H< 0 C06X Ű pC0*0 B0"X @ XH @L 
J @PH $P C A=0XY HPY PXe A2Xi PAXi PH C0BX8 C0:A;TXi PA:$A<X HH ɠ !@ PH #$RPX Xh k $P  A
X9 Hӳ Ű B0H Š #5Š B0$BC $ҳ XX P SC0P pC0P ?C0Hc ` !: P Ȱ @ #
H Z ,H< P8 X !5Ȱ ,P Xi H$ P  A;T$4P7 ,$P 0[$bA< X HHJ @ !7XY L$e@e #
X L$6@< H @ $aAX Q XI HHT P !4$P@T C DA<$bPh X  VB0nX9 Dӳ ɰ !` Ph C RŰ B0JXi HA>C0>X H$F@J $TZ $hj $P  X9 DH @ jA;T$`A;$aA@A<#Xi HA@ FVXX Xi HA@ D%Q\XH @ VB0XY De ` B0H #-$QX9 DHc A;$kA.C dH$ð C0X` B0&Xh A
X P ,Z` A&n` A.C *` B0"$P ,0 P7 0XX ` $A&` A.AC $P #%P $RXi A;AC $`A܀C $aAvC $gAC $cAC %API #$PPY A=0Xi A;Xi HA;TXi HA:$$dAˮC $iAˤC v$jA˚C l$hAːC b$kAˆC X$lA|C N$eArC D$fAhC :` A\C .$oARC $` AFC A<Xi HA#=P Xi HA@ JAP #P Xi HA@ JAxP A=0Xi H P XX A@ JA@ @P %1P7 ,$UaA@ BZ$`A;Xi HA;TXi HA:$$dAʶA<XY Xi HA@ JXh A^C n$bAC d$aAC Z$`AC P%aAC FX Ű u!5$P #$DPI A<XY HHe Pi H P ` !4&P eA@ E|X9 !6`AM05AP0 !9$aA;$P C  0 !8$bA;$P #cA;$EPI Xi AXi AA<Xi HA@ FXY HXi @e C $P C *$1P8 C  $P #$P #	$DPH #$UPX #AjP XX Z]h$aPg ,aA@ BZ$PhC 2A<X9 HH P cA@ E|Xi LA@ E|X Š B0@XI HT P #>P #;Xi L  #4 !=$jA $hA;$kA$`A;A<X8 P7 ,XY LXi HA%Q\Xi HA:$Xi LA:$C A<Ƞ PhXH PG ,XY HXi LA޶%QQ]\X LX) H$8AaA:$Xi Hf A
C HAjaAߢC :$PpP AAjZ ,P @A=|X9 HX  X @K P !I !`AM10APHJ 
Kd`   A^C AjZ ,P @H]$P  B06A=0$RXi HA@ D$oPg ,X @X<  P7 0$S$aA&` A.C $aA;$kAǬA=0X @X  &HK 
DP Xi HA#;XY HXe  Qi $P #P Xi HA@ JX9 Hӳ P X H$OJ XY Z Xi Pj  $@ $4: P ,\` %A"&$bA
Xi HA:$$P ,[$cA&n$bA
$P ,$R$cA&n$BPG ,$Q` A&nX]4P]pC AjP Xh pE #;$P ,$\aA@ BZC H6 P7 ,$P 0XV  f A< X pj AA=0XI HXX pe @d    U dA@ DX8 pH 
B X P ,P 0S ` A&` A.XH pHT #:eA@ ATXh p$@ X8 pӳ B08X !?c A
XH pT PW ,$aA&n#P ,P 0S ` A&#P ,Xc Pg 0S ` A&$P ,$QXh A@ BZX8 0 :#6`AM15APW   P AjaA@ ATX pH 
BhXM(@ #=XX PW ,P 0$]$bA&C F$oPg ,$P 0[ $aA&X8 P7 ,X pH 
P 0[ $bA&$aXH pT e  AXh p P%1Q=X#`AM20APȠ Z hP pC AjP @!`AM25AP$APG ,$\aA@ BZC ~AjaA$P ,$\aA@ BZC `AjaAaA@ ATC JAjP @!`AM30APaA@ ATC &AC $0P9 A*n%aAC 
A=|X HXk  A@%aAC AjP $@&  !?X Ġ?@&à #5Ơ @&#C Aj@$C %API C (H]$P @#8` 2A.$`A@$`Pi #AjP X\ #$`A;"A=0$SXi HA@ DA=0$RXi HA@ D$QXi A;` A.X=4P=pC (AjP 8W   P AjP X`&İP &P`X P ,XI PG 0$X$bA&$QPW ,$\Xi A@ BZXhPi 0AA@ @P <aA^X P ,X9 P7 0$X$aA&C AjaAC X ȫP AjP #$ #&`AM35APW   P AjP XMx!7XY ,QPY ,#Q A<$`Ph %P H=$0 B0X Ű B0|X LXI HXT  Xj  V B djAC0ZXi HAC0N$P X8 C @0B 8X HX  ɠ B(ɠB  XI LXT  P !P!'Xh `  Ph Xx!5X9 BzX HX  P XI LXT  PX ɥ #&`AM40APA-%bQm\Xi HA:$Xi LA:$XxB0,$?P7 ,X P 0$UeA@ D$eA
X &ĠP C XM`&C@PM`PI &DPM`XX PW ,Xi Pg 0$UeA@ D$eA
$P\X8 
3P9 P C Z&P $Q\A<$eA
P Xi HA@ D$EPG ,X]`[Y PW 0Xi HV $bA&$Q`X9 0 !3Q`U B0` A.Xh A@Xh A@$P\X B0&XH PG ,X]`PW 0$U$cA@ D$cA
$hAXh Pi $P C x&P X=x!<$Q ,X ,Z ,P 4#%AQH XX TZX ,PX 4Xh 4X`P  Ӧ V Ҧ 3B0%A@F 
XX V   @ X8 B0DX #7` A.C .PW ,X`&P 0$U$bA&XH PG ,X]`PW 0$ReA&C xPW ,&P 0$U$bA&Xh C00$P ,$0[8 P7 0$QeA&$P ,X P 0$X$cA&#$@PG ,[H PG 0$QeA&XX PW ,Xm`Pg 0$Q$bA&$Q`C 8$cA8X8 4X8@ 
$ң j[h AbXh AXH #5XX Q]`X U B0C pA<Xi H$@ AjX9 H@ C RX P W   P X8 0 A#80 D#50 KB0:$W$`A;$gA
A<X P W   P X Š AB04XI @ !&P =PY #` <Pi X P ,XY LXi HAC vŠ KB0HP Xi HA@ J%QXi LA@ GX9 L$@ P7 ,X HZ ` 'A"&XI Hd A
C &P W   P XY PW ,XY LXi HA%bQm\Xi HA:$Xi LA:$XY Z]h$aA'8$P ,$1P7 0$W$cA&` A$PL$P ,P 0[$gA< C XH @ BB0JXH PH W   P $[PX $cPh VXh AAHX 4X=4P<  $Ҽ AC @ CB0RA<X HJ @ !6Z UC02` Pi jA#5 P XY Xi HA@ JX9 Hc AC *@ IB0\A<P Xi LA@ D%QXi HA@ GX H$@ P ,XI LT ` (A"&XY He A
Xi H$@ %1Q=\C @ G#5@ HB0d@ H!5AjP X Ű S#=A8Xi LA;TX L$@@J #W   P XX P G!5$`A;#Xi A:$aA@ ^VC TXh ` JB0A<$gA
$RXi HA@ D$SXi LA@ D` #A.X  !%$`A@# !5$bA@#$aA@%2Q=\$P ,$P 0Z$gA< XH !;$PPW ,$aPg 0$W$jA&W   P C ` LB0A=0X HP PA<X9 HH C0JA=0A"Xi HA;TXi HA:$$aA@ ^VX]`P$P ,$@PG 0Xh A< XY L$`@e A<$RXi HA@ J$SXi PA@ DXtZ l  A.W   P #h`I  ?APC X8 P8 W   P X Ű AB0X DP 4XI ,PG ,XY  %bA@C 0Ű B!3C dŰ C#6`AM45APX]`YY p##PY pXY lP]`C %aPmxX ,P ,XY  XmtAC z$0P=xX #C X DJ @ #3C XY ,YY C Xh @j PY X P C L&P Z ,P <%1Q8 X Z ,P 8+$4A$ҫ L @ `!6@JL X U B0XX YY ,#`AM50APXh <  B04H6 0`0 B0$Ӷ #?X DXF  @J 
X8 8ӳ ư ҳ %PXM`PI XY #3C Xi DAC dmPh 4A@ @X 4P  $0P8 P8 P8 X(#>aA;A=0X H$@@J jA~-AXY ,PW ,XY  $`Ar#C .Xh `??  APX(C0JX=pU=4!>X Dӫ B0.HM$@  B0"H]$P @#; !8` 2A.$`A@AnC "Xm8` #4$`AX< #5$PeAX9 Dӳ V ҳ ` A/0AX B0XH @ #7BZM$PPT  %aQm(XdZ(<  P8 C RA X pY`##P`X Š!7XM`PI TC *X]`&SPP]`P #6`AM55APXi DX`@ X9 TP=`X XPdXI \PMpXY P]4Xi |PmXPX9 dP=X `P%PXy 	[R ^[S aW    ]U Q    `W aX 
 Y  bZ c[  \  .dw P (p0NPH 0p2P ,NPH Dp@P @NPH Pp @P LNPH Xp P TNPH lpP hNPH xp xP tN|PH p@P |$P P P N\PHp PNLPHp	`PP P$N<PH,p PP(XX< @=$0  #50@=$$aW   `$bW   l$fW   <$dW   <$S$hAX( ,$4AȰ  @2Ƞ P XPXM%QPT  PT <PT  PT 8PT @e&aPh eZh @X Z @<  P6 X Z TX Z T&P Xh ` B0X @$@PI<XX TPE P HPX \PH d%a&aPh  Z h,$6A`  >$0P=X hP pW   P $P ȝP 4P ,Z$bApA!XM#6$ $$Ax Q$  P, , ,  }$ SELECTINPUT, ,  , +{$  N, , ,  }$  SELECTOUTPUT, ,  , +{$ !N, , ,  }$ !OPENINPUT, ,  , +{$ "N, , ,  $ #FD, 1, ,  }$ "OPENOUTPUT, ,  , +{$ #N, , ,  $ $FD, 1, ,  }$ #CLOSEINPUT, ,  , +{}$ $CLOSEOUTPUT, ,  , +{}$ %RESETINPUT, ,  , +{}$ &RESETOUTPUT, ,  , +{}$ 'TIME, 8, , ;{}$ (DATE, 8, 	, ;{}$ )CPUTIME, , , ;{}$ *COMREG, , , +{$ +N, , ,  }$ +READ, ,  , +{$ ,X, ,  ,  }$ ,PRINT, ,  , +{$ -VAL, !, ,  $ .BEFORE, , ,  $ /AFTER, , ,  }$ -PRINTFL, ,  , +{$                                      $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |               kp
\                                  l                                                                                                         $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |               kp
\                                  l                                                                                                                                                                                                                                   #READSYMFN(0 C  #READSYMFN(0 C  #READSYMFN(0 C  #READSYMFN(0 C                              P                (8 
8L(                  D                                                                                                                                  (4                                                                $    Sd7L'0ternalpredicatespec EXISTS(%string(63) file)
%systemroutinespec     DELETE(%integer quite, %string(63) s)
%externalroutinespec   DOING(%string(15) S)
%externalroutinespec   RUN(%string(63) S)
%externalroutinespec   TO LOWER(%string(*)%name s)
%externalroutinespec   CPU LIMIT(%integer n)

%externalroutine PASCAL %alias "%go"
%conststring(15) pass1       = "pascal:PASS1",
                 pass2       = "imp:PASS2",
                 pass3       = "imp:PASS3",
                 prim file   = "pascal:PRIMS",
                 default ext = ".PAS"
   %integer j, return code, lines
   %string(31) source file, object  file, listing file, source
   %string(31) temp1 = "", temp2 = "", temp3 = ""
   %string(31) work
   %integer options

   ! used for accumulating timing data
   %integer  x1, x2, x3

%integerfn  option bits(%string(63)  opt)
   %integer  initial
   %integer  include, exclude, item , item no, p, no
   %string(15)  item word
   %constinteger  options = 14
   %conststring(8)%array  option word(1:options) =
      "default",      "opt",  "trusted",
   !    512+31       256+0      32
      "capacity",  "assign",    "array",  "extra",
   !      1           2         4        16
      "suppress", "partial", "diags",  "timer",
   !     128         256       512     x'4000'
      "brief",      "trace",  "hide"
   ! x'1000',         64
   %constshortintegerarray  option mask(1:options) =
      X'821F',   X'8100',   X'8020',
            1,         2,         4,       16,
          128,       256,       512,  x'4000',
      x'1000',        64,    x'0900'

   %integerfn  known item
      %integer  n,sym
      %string(15)  s, t

      item word = ""
      opt -> item word.(",").opt
      no = 0
      %if item word -> s.("no").t %start
         %if s = "" %then item word = t %and no = 2
      %finish
      %for n = 1,1,options %cycle
         %result=n %if item word = option word(n)
      %repeat
      %result = 0
   %end {of known item}

   initial = option mask(1)&x'7FFF';      ! default
   include = 0;  exclude = 0
   to lower(opt)
   opt = opt.","
   %while opt # "" %cycle
      item no = known item
      %if item no # 0 %start
         item = option mask(item no)
         %if item < 0 %start;      ! reset completely
            initial = item & x'7FFF'
         %else
            %if no # 0 %start
               exclude = exclude ! item
            %else
               include = include ! item
            %finish
         %finish
      %else %if item word # ""
         print string(item word); print symbol('?')
         newline
      %finish
   %repeat
   %result = (initial & (\exclude)) ! include
%end;      ! 'option bits'

   %routine close in(%integer st)
      select input(st);  close input
   %end
   %routine close out(%integer st)
      select output(st);  close output
   %end
   %string(31)%fn temp file
      %string(1) work
      %record(parmfm) p
      p_dact = 25;  svc(20, p)
      p_p4 = p_p4&x'FFFF'
      %if p_p4 > 26 %then work = tostring(p_p4-27+'0') %c
                    %else work = tostring(p_p4+'a'-1)
      %result = "$tmp.".work
   %end
   %routine print pass(%integer pass, time)
      %if pass = 0 %start
         print string("mean ")
      %else
         print string("pass");  write(pass,-1)
      %finish
      write( (2*time+1)//2000,5);  print string(" secs")
      write(60*1000*lines//time,5);  print string(" statements/min")
      newline
   %end
   %routine show result(%integer n)
      %if n < 0 %start
         printstring("Program contains")
         write(-n, 1)
         printstring(" fault")
         printsymbol('s') %if n # -1
      %else
         write(n, -4)
         printstring(" statements compiled")
      %finish
      newline
   %end
   %routine Fail(%string(63) Why)
      Printstring("PASCAL Fails -- ")
      Printstring(Why)
      Newline
      %stop
   %end

   %on 9,10 %start
      Select Output(0)
      Fail(EVENT_Message)
   %finish

! ******** set compiler options *********
   options = option bits(command_parameter)

   source file = command_in1
   object file = command_out1
   listing file = command_out2
   to lower(source file)
   to lower(object file)
   to lower(listing file)
   object file = "n:" %if object file = "null:"
   listing file = "n:" %if listing file = "null:"
   options = options ! x'1000' %if listing file = "n:"; ! suppress listing to N:

   impcom_flags = options;         ! set compilation options

   %if source file -> source.(".").work %start      {extension given}
      %unless exists(source file) %start
Noex:    Fail(Source file." does not exist")
      %finish
   %else
      source = source file                          {no extenstion}
      %unless exists(source) %start
         work = source file.default ext
         ->noex %unless exists(work)
         source file = work
      %finish
   %finish
   %if source -> work.(":").source %start;  %finish
   %if object file = "" %start
      object file = source.".exe"
   %else %unless object file -> (".")
      object file = object file.".exe" %unless object file = "n:"
   %finish
   %if object file = "n:" %start
      temp1 = "n:"
   %else
      temp1 = temp file
   %finish
   cpu limit(60*10)      {10 minutes}
   x1 = cpu time

   open input(1, source file)
   open input(2, prim file)
   open output(2, listing file)
   open output(1, temp1)
   open output(3, "t:")

   select output(2)
   printstring("Source file: ");  printstring(source file)
   printstring("     compiled on ")
   printstring(date);  printstring(" at ");  printstring(time)
   newline
   printstring("Object file: ");  printstring(object file);  newlines(2)
   doing("First pass")
   run(pass1)
   lines = impcom_statements
   select output(2);  show result(lines)
   select output(0)
   close in(1);  close in(2)
   close out(1);  close out(2);  close out(3)
   ->done1 %if lines < 0


   ->done %if temp1 = "n:"
   x2 = cpu time

   open input(1, temp1)
   temp2 = temp file;  open output(1, temp2)
   temp3 = temp file;  open output(2, temp3)
   doing("Second pass")
   cpu limit(60*5)      {5 minutes}
   run(pass2)

   close in(1)
   close out(1);  close out(2)

   x3 = cpu time

   open input(1, temp2);  open input(2, temp3)
   impcom_file = object file;      ! pass 3 opens its own DA file
   doing("Final pass")
   cpu limit(60*4)         {4 minutes}
   run(pass3)

done:selectoutput(0)
      %if command_modifier # 0 %start
         printstring("Code");  write(impcom_code, 1)
         printstring(" + Perm");  write(impcom_perm, 1)
         printstring(" + Glap");  write(impcom_gla, 1)
         printstring(" + Diags");  write(impcom_diags, 1)
         printstring(" =")
         write(impcom_code+impcom_perm+impcom_gla+impcom_diags, 1)
         printstring(" bytes")
         newline
      %finish
     %if options & x'4000' # 0 %start
        x1 = x2-x1;  x2 = x3-x2;  x3 = cputime - x3
        print pass(1,x1); print pass(2,x2); print pass(3,x3)
        print pass(0,x1+x2+x3)
     %finish
stop:    delete(1, temp2);  delete(1, temp3)
done1:   delete(1, temp1)
         select output(0)
         show result(lines)
         doing("")
%end
%endoffile
 H?   p pJ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!             }V  	          
  V      NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    :X%               }  line PERM     	8aXoy    Duxprim :  :  ORG: block
block io:  
close da:  	open da:                          proc     size     base :                  I    
                          
   *ERROR          &           
                          $C>B>BB.C.CB>C>B.BCC.C=             #0!0!! # #!0#0! !## #  e             U
 ' W z M Szt^n{ C7K*  % H  !34  1  0 !81 !5$$ &#$$ &&  ?1  &034C0  D   D   
C  "H  !34  1  0 !81 !5$$ &$@#0#D   D   &A'1"C  9H  !34  1  0 !81 !5$$ &B  @ !4B ";
C@ !$$ &#$$ &B  C
B$P#E  E  &Q'1"C  $A1    0#
#	QD   RD   ?&A'"3 s_  eX!34RUUh!34dffз  ӳ  Ű !4Գ #9    !8 !5$$ &B$ C08 L  #9&"C  "
  'M  M   >' ("#4\BbD#:  
  nBJ"#<  #M  M  '"DC0  
$#M  M  &'"%ѷ  C $ "ѷ  $$ & ?$$ & '    !8 !5$$ &"#&!2#C$$ &
!  1  #C   C  '1" 2#XC   PC   '4" 	2$ #PC   '4" 1I2 !,K2  !
3s3B  #9
3
>!$$ &!$$ & /З  $1$H  H X [ &B0P  [ ,&' ?P  
*&30H  P  ї  C Kї  $$ & 
Y  #%$$ &
qPr  PB &(pX  ?$PS?PE   &T 4 "#$$ &$$#'!"  $/ #-( $  ?,'"(!j #k 
j 
( + F   A    ("!j #k .  @   H  !34  "#(!B   C $$ & 	X   $$ & ?$$ &   "#:  ! ?$$ & ?$$ & ?$$ & O$$ &   $$ &  ?$$ &  ?&?$$ & X# Y !Y !&\ Z  B!$$ & XC Y B(Y B  \ Y$ !Y$ !'
\ Z  &L!$$ & "XS XE  'AB
B$'DY BY !,
\ &\X  B"Z  E $$ & 
XC \ 
\ Z   GHO  s/ "B
'X=  2 #$$ &&r0U> ?P7D   &D"$  &  ,gp l \ ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n X=  Ho  &_W  ݈/            k$TRACE %GO
   9 H  !34  1  0 !81 !5$$A> rB  @ !4B ";
C@ !$$A> r#$$A> rB  C
B$P#E  E  &Q'1"C  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n$A1    0#
#	QD   RD   ?&A'"3A> r2#XC   PC   '4"2$ #PC   '4"?1  34C0  D   D   
C  Ӏ g p 4 'P ,H9 <  0 P9 00 
#3 0P9 0#3 7P9 0cW   <X ,B0y  .	W  p ,$`W   lW   H$QXi W   T` :W   <$TXi  W   TW  ,$ $AT 5	g p 4W   P ,W   P 0X ,X9 P  y   	w p H$QQ <X9 <P: @Ȱ $Z DP 8+$9AnX=\@; $@@K  3#*$D@K  0 !4$E@K  XX PZ D$`Pj <Pj ,W   P#+ !(
sA

Q$`AW   PU <#5Q$aAAJC mAmAX\ !7X: 8Xa  mAXJ 8X]@T W   $Xj 8@ W   0mAX 8X=@< mAX 8XM@K mAXZ 8Xm@e %QX=!4z X&@ HE #4&@ X]QY @Xj ,C0DX <P$P <X=C0.3Z9 ,P: ,H P X <@ XP <X PC XJ 8XZ ,PT Xh `PF  PH `C ti LAmAX LP#$#%\$cAFZ LP 0X<  C0NX L   !6X]$dAXJ 8XT \C0&PZ 4Xj 4X  U 0#4P 4"	X: 0X  P  #P4 X 0XJ @@K X]@[ Xj 8X P  P C 0 BP=#	$P#@PMmAmAX]#$P#$$eAXm`
!4$fAr&aPmcZi ,Pj ,X <@ XP <@V  X=@6 X@ C mAmAC lmAmAXM
DZH d%R@T  C HmAdXm'aPh $Q X=\0 !?X 8a XH [J D!@ ##a XX PZ D#C Ҁ
g p @f#$` &#%V$iA
fZh dH  !z X8 \H P 8XJ 
DZMdHT  PZ 0
UZ]dHe  Pj 4`   #6&İP 8`Pj 4X 
Z d@  
@ X: 0
6P: <X 0U <C0b&P 0
ZdsK  PJ ,@  @  B0:XZ ,P  C0,$aQj 0X 0
ZdH\  PZ ,
UZX dH5  #Xj ,AC C $ 
g p DX !4z $0P: <P: @X XK PJ 4$QQ]Xj 4X @a H6 0 B0Q]H  Z LP ,HF PJ 8H[ T!T C $aPj <&P @X al X: 4H ư @ XZ ,He dB(d B  ư @ F#$@L@d!%ư @ XJ X P 0X: 0#8H XJ 4I !"#
&@ X3  P: 0C XZ 4He !2#cZi ,Pj 4C X <!2#C C  
W  p PX !7$0P5  z $P D$@PJ HPJ LXZ Xe Pj 8$QX: 8X La HC @ B0QHS  SZX LPZ 0Xj H J P <@ @C0V0 $L5 Z8 DH J P @ɼB4ɼ B ,XJ 8HT P @T l#$d!%P @T C #H J P @X: @X <;!; !#C XJ 8H  B0< @ ;B(; B   @ ;#$ɰd!% @ C J !63!0!, C0.;!; C  3!0!'@ C n @ #C `$P HQ DQ La X6 P: 4X 4HK XZ 8IE !"#
&A@K X  P 4C Xj Pj ,X ,X<  P: ,!2#$a "XJ 8HT !2#SZY ,PZ 8C .Xj H!2#C X  X: DP<  C 
w p 8XP 4$0P: ,C R&1P: ,3Z9 ,H P 0ð  #:XH TZJ ,$PT  C "Xh TZj ,İ Z  XJ 0@ P  X: ,U: 4B0$PCzXmPj 4P ,C T&P ,' B0(W  ,%TXj ,W   TW   HX8 TZ: ,$Rc  W   TX ,U 4B0$bW  8z  
g p 0$&P ,Z LU !6X ,{ X ,B0$ $AT !g p 8$P 40 $6Z8 DP; ,W   H$QXK ,Hd W   TW   H$QXk ,Hf W   TW  ,X ,X< P; 0XK 0C0`dA8$SaW   T` :W   <$PXk 0Hf W   T$Q 4X; 40 !6W  ,XK 0XT  P[ 0C Xk 4` #6W  ,{  w p 4X <P 0$0P: ,C :&1P: ,W  ,W   H$QXj ,W   TXj ,AX: ,U: 0B0z  4
w p PN PI 0pWP	 ,$P <P @$aW   `$P AX8 `$P  W   P L #5Q%aA@h tAh xAh pAmAmAmAzX tU @#6XY @$hA$@&API L
DZH dHT  P!5Xi LA*XI L@ &B0Xh \$a $0#AW   P 8X \P 4X 4XJ  PI 8!3C >dAXY 8He X 4Jl Jl @e H< J< @5 H J  @ PY 4C $P#ADW   P <$`Pi HX \P 4X9 4X  P 4!3C BY DkAX DC0,$AQI HXY 4a PY 8Xi 8X  P 8!2#X9 Da< "C X H!2#C $@#AW   P @AnXX `He Je Ph H J  P |H5 J5 P8 ty 	W  p l* 2Ar
 ,  q
 ,X 8CBX: ' ,AӲ  &@ ?BK   Ҳ  W   HW  ,$ AT ,* L$8AX$^@Z .r
 ,  q
 , L* ,$8AXXj  Pj D$@ .r
 ,  q
 ,X: HB: L* ,$8AX$P D$F@J .r
 ,  q
 ,XZ H!Xj DPmz ' ,fA 4A   W   HW  ,$ AT 
w p LXP D$;@: .r
 ,  q
 ,$PXJ H!z ' ,ZA 4A   W   HW  ,$ AT 8
W  p L&hZmPj @XP DX: X P H@Z .r
 ,  q
 ,XJ H!z ' ,NA 4A   W   H$QXj Xf W   TW  ,$ $AT I
W  p 0X lP  
P l$0P6 PV P6 X ,XF  @K  @; z   
g p 8hPj 4X Ul !5z $1Q=$C(HW   H$QXj 4W   TW  ,XI PJ 0$QQ]Xj 0X  P ,X< U: 4!3C BX  !2#P 0C 3#X: 4P< C "$ZlAXJ ,XZ 4PT $YdAt$aQmX 0X: ,X  P  X P  P9 C : s
w p 4$`A
P ,$C0&ZH9 0#0 0 @1  X ,&ZHI @ #@ @ @K XZ ,&XZ]`C!@e X ,&Z$0@< X ,&Z@; XJ ,&HZM@4 
XZ ,&XZ]@5 Xj ,&hZm@6 %&P 0
X: ,Z X 0
ʹ HK  @L X 0 B0XY PZ ,Xj ,X !$ZALX: ,X  P ,!2#C z  
W  p ,$CV%2BPBW   H$QXj  W   T$VX Xk W   T$QXJ Xd W   TW  ,XZ  Xj YV !YV !&PV z ` A H
W  p 4X  Z P 0i <#4&P 0$0CR%C LXM #6W  ,XZ 0P]$TXj 0W   T>W   HHj AW  ,Xj 0AP ,j 3
fZma H @  X: $Q z  X
g p ,` A!` Z!&{ ` a!` z!$"` 0!` 9!%C ` #!` %!% C `  !4$C %C  8W  p @ 
<  P; ,I F T  P[ 0  <  P; 4Xk ,APXk 0P 8ADX[ 8` (F
QXk 4P[ <A,X; < (,XK  
1@4  {  Ag p 8 H9 P: 4P ,#&P ,ȹ 
@  K  U 4 <HY 'RPZ 4%bPj ,C &cPj ,Z 0A&HZ 0Xj AXj ,Uj 4B0z  =
g p DW   P 4P 8 #$$P 8 P @$P 0C 8&P 0W   P < a! z!%P <9 Z: 0  X 0U @B0X 4[ 8P 4XJ 4#*W   0%QQZ 4"$l@i X  !4z X: 80 !&!4$f@i W   P W   P 4P X 4İ P W   P 0j 4AXJ 0DPI XZ 0P P sj 6
VPY $C' , A:A   W   H$QHi W   T$QXi W   T$TXi W   T$SXi W   T$QXi W   T$QXi W   TW  ,C  
w p @$&P ,
Z dH<  P: 0Bd$C>4W   H$QXj ,W   T`  W   <Xj 0AW  ,XJ ,
DZH dXX \HU JT  i ,AXj ,
fZmdH  P 0
ZdH<  0Z: 0P: <X 0U <C0&P 0
ZdsK  PJ 8@  @  #9XZ 8i ,A6C XZ 8P  !;Xi 8Pi,i ,AC xP P !8PCi ,A#X 8 \PAi ,A$1Q: 0X 0
ZdHK  PJ 8
DZH dHT  PZ 4#XZ ,$oA8Xh \H 
\
\i ,AC &X , &B0xX8 dH LP(z  Հ
w p D$QX8 TZ9ӳ  P 8XICZH LPJ @P $LT ZX DHe Jd ZiPj <ð #4$Qð @!:X
ZtH<  P9 İ 
sK*

$Q|$@PJ 4XZ <[Y 8PZ 0#@ PJ 4$P[Z 0PZ 0P #'XY 8` A>Xi
fZmlH  \ZZ 0i ,Az $1Q=$QXJ <XX \KE 
DPJ 0XY i ,AhXj 8` ` !=s 0 \P@ i ,AD#X: 0!0?#'XY 8` AsZ 2i ,AC $QXI 8&BXZ <T
UPZ 0P !P?#'XY 8` ArXY Pi ,AXZ 0P i ,AC . ـ
w p T$QQ 0 $L9 Z8 DP: 8HS i ,AX 8H[ i LAXJ 8HT i \AXY 8PZ 0$`Pj ,X  C0@j ,AB$aAfX=\C0&X ,P HXM`#4$P H[i LA$i \AC nX=\C0$) A$@ Vi LAi \AAXH \HT JT 'Ri ,ABXY 8[Yi ,AXi 8'aPiP   i ,AW   P L#+ !(
sA

Q$lAW   P HU #5Q$mAX 8P <X9 XP: @X hP DAXZ <i ,AXZ @i LAXZ Di \AC 6%AQMX]C0XY 8[Yi ,AXi 8'aPiX 8H< !;H\ P i ,AC XH\ i ,AX 8H[ i ,AXJ 8HT SZX LHU JT i ,AXj 8H Z LH\ JV i ,A~$0CB$QXi XW   T$QX 8Hk W   T$QXJ 8Hd W   TW  ,X]\P B0XmB0$X \H\ i LAX8 \HS  i \AC 4XY X[Yi LAX X'PXY h[Yi \AXI h'APIXZ 8He Je Pj HX XU H#7$Pi LA"
z X9 8P=X: 4P9 8C X 8P 4XP 8C j PA`$@[J PPMC zj PAJXZ Pi ,ALC bj PA2X]#6'QP]C JXZ Pi <A$C :XY H'Ri lAC (XY H'Qi lA C XY 8'Qi ,A^Xj 8HV i ,AC W   0j PAX P PX: P4P9$PA4C iAW   0i A|W   0iAj$@PIAC W   0i AJW   0j HA8XZ H#$P &#$$oAXY i ,A(Xj H
fZh dHV  
Ui ,AC &W   0iAXZ LH< P: H#7X 8J; P: HSi ,AC j PAXJ P'APH $QQX $`C8W   H$QXh W   T$QXi 8W   TW  ,X 8[ 0P !3C ~X8 [: ,P8 !0 C $X\Ű !;XH 'ATP i LA0$QPX Xm\` !;X \ZX i LAX8 P: ,X 8P 0C $`AXM\@ B0rXY P TXi ` 
VTs 
\PZ HH9 0 #5P PZ HX Ű !5P@ PZ HXi ` #5P  PZ Hi \AsY i \A|i \AC W   P Li AL%aAp$PX: L0 #50 B0lX P H0 B0*X 8P H .A*!;XJ 8HT P@ @T @ XY i |AHi Zi 'aPi XZ Hi |Ai |AvC 0 #50 B0X,C0< .A*B0,XI 8PJ L[i ,AXY H
Ui ,AXZ Li ,AHY ZY PZ Hi AsY$i <A^XY$i <ARXi H'bPi$XZ Hi <A<XY H'Si <A.X L !<%Qi <A%Qi <A#$Pi <A$Pi <A$6P=#S` Ap#C 8
w p@NpPI p@P	 $P PP,$P <&1P90X P ȠZ P %APJ P  0 B0 P lX]$6CP]XMBPMXX x&SPPX xXh \H Q t9 P7 ,X]i |A`ȹ P ,X]i ALȩ P ,X]i lA8I PG ,XX i LA$Y PW ,XX |i \AXh l&c`Ph lZh xPi ,$[ xP 0X8 tP9 4$P 8
cȦĠ P <P @XH pPI DP HP}@Y %a@i X ,@ X8 l@9 Z t@ @I 
Ⱥ P X@ XM@I $bW   `XY XXl A2W   P0'P<$0P90#&1P90Pi <AX90U9< =$Pi <A$Pi <AW   P0 #Q` AP$P %PXH \HT 'QPYHd  'aPiP P$AW   P0 #5Q%bA%Ti ,A$Pi ,AhXY(i ,A\HY i ,APXYi ,ADX\ C02 B0$H9 0 @9 X P#& P#$@ XI@I XY@Y Xi$@i X9 @9 A8Ay 	w P (p NHPH Hp#P DN8PH Pp@P LN(PH Xp
P TNPH hp LP d$&P Z L,$2AnX  >$0&1P8 
3Z8 d%@  X8 0 & =X DȚ $P \)$9AnP `XXX< 80 P=\X İ P`$`W   lW   P ,X\ɠ #$$P\AW   P 0AW   P 4X tZ xXH \K X]X
P Hd 
fPe X p
P X8 Z8 |
3P5 x      DA == DA ++ 1            
 & 128           j   = j - 1
 & 129        %repeat %until j = 0
 & 130  
 & 131        %for j = 1,1,max stream %cycle
 & 132           In stream(j)  == null FD
 & 133           Out stream(j) == null FD
 & 134        %repeat
 & 135  
 & 136         In Stream(0) == tt  in FD;  Select Input(0)
 & 137        Out Stream(0) == tt out FD;  Select Output(0)
 & 138  
 & 139     %end
 & 140  
 & 141     %external %routine PACK (%string(63) filename, %record(file fm)%name packed)
 & 142        %record(parm fm) P
 & 143        string(addr(P_sact)) = filename
 & 144        SVC (17,P)                         {pack}
 & 145        packed = P_file
 & 146        %if P_file_owner < 0 %start
 & 147           EVENT_message = "Illegal filename ".filename
 & 148           %signal 10,1
 & 149        %finish
 & 150     %end
 & 151  
 & 152     %external %routine UNPACK (%record(file fm)%name file, %string(*)%n                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                      Xt                                                                                                 ` _  d ` ) H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           4 C!         (3 }&W  $            &W      NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    :X%        JMgikm{},         Edinburgh IMP77 Compiler - Version  ss =            (                    	
                                    #=)<(>kt             []X/&!%+-*Qx.v'              $w$$[$$$$$$$S$$[                                                       4'  [|  7 *  $//  A3   }kp\   D   f            % !q!!!    !!!!!!!!"!!!!                    !%   !!h!Q  !W!w"f#$$"+"#"!"#!!  #S"!##$$!$4$4$4"p$!A!  $M             Pformat = Format = 	   Papp =App =
   Ptype = Type =   subatom =	  Atom2 =Atom1 =lookup: &           
                     !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ|}~              ! [    9N                    0< *$Q7I#qCR     Y        Y   Y   Y   Y   Y      Y      Y             = End
Procedure  Begin missing format result %finish%repeat%end %begin not a location orderindexbounds size %start %cycle context  contextmatchtype 
duplicate  too complexnot declared atom form access "}" unused	Non-localDubious statementfault      !   %<ENbu~.***  compilation abandoned ***  does not existIncluded file  dictionary fullstring constant too long too many faults! 	 missing?file program%endof input ended: feature not implementedprogram too complextoo many names switch vector too largecompiler error!   	    '/ 7?G[ow            84`   p  8| $ 	   		#	C	K	_                            	g 	K@, @, @1 @2   @+ @  @  ը (@W  ֬  @Y u@  -֬ $۶  @Y q@0 @+ .@+ @  @  =ڱ @1 @1 @* ٱ  2  @4  @3  =@1 @* 	@1 ̄N)R,@ @  D@8  @8    S@  *Y E@ *N#)E@ $ N@J  !"@G  M N T' L@U  * E@?   T@" *N@" "*N@  I'Y&!@# #'"@U ̅ XI"'R&A@#  T@?  D@K  FF PE')G&@L &@M  ) T@S &I E@L  "@D  AI΃'U*C' N@  	 R@=  @  	$$S@E  ) E@F  ) E@P N"" R@ @X *"@V  @> ,AI'O GI@   L@ $*N#)E@ *S@S " L@) A'O*I)O@Q m P@  
A*O@:  "́@ 'U*C' N@  
@  
΅PR'W@" @9 @9 $'O@  @@  "*N@@   REI#  M@I   M@# $ "@ {&@# E*$"@ hACЂ*'R@P'&Uԁ@Nh@O  T@H  )O D@% @)O  T@& 	" C@&  L@ !L'&&A@T 'O G@T ȎɌЅԃW)" M@# *I$C@! AO$# (@$ 0 P@R s*R@C  !@'  'G&A@A  "*N@A  )O T@ *N#)E@ * E@PJ'E@B   N$ L@< ) S@> .$"@; @  =* 3@* @1 @  * 3@* @  @/ @. 3@1          _                                                                                                                                                              	 
 Ҁրр؀           ΀                                                        w   ZZZZZ00hhi]/-.*+,(D7h<](]9Z X                        Z.4mmar VDECmar OWNVDEC EXTVSPECADECSPECOWNADECCEXTASPECPROCSPECPROCSPECFORMDECCSWDECECCLDECCECCFORMSPEC FORMSPEC FORMSPEC FORMSPEC FORMSPEC FORMSPECOPTIONECCOMMANECTOMMANECCOLONNECCOMMENTCLBMMENTCALIASNTCRBIASNTCSUBASNTCARRAYDTCSTYPEDTCARRAYDTCNAMEYDTCPROCDDTCFNMAPDTCSWITCHTCOWNTCHTCEXTERNALSTRINGALRECORDALFORMATALSPECATALMCODETALLABELTALOP1ELTALOP2ELTALOP3ELTALSIGNLTALUOPNLTALMODNLTALDOTNLTALCOMPLTALACOMPTALEQOMPTALEQEQPTALJAMQPTALJUMPPTALRESOPTALANDOPTALORDOPTALNOTOPTALWHILETALUNTILTALFORILTALCWORDTALEXITDTALONITDTALSIGNALALTHENALALSTARTLALELSETLALFINISHALFELSEHALCYCLEHALREPEATALPROGRAMLBEGINAMLENDINAMLENDPROGLENDPERMLFRESULTLMRESULTLBACKULTLMONITORLSTOPTORLLISTTORLREALSLNLCONTROLLINCLUDELMASSUDELRTYPEDELADDOPDELIDENTDELVDENTDELNDENTDELCONSTDELFMNSTDEL FMNSTDELRMNSTDELFMNSTDELMMNSTDELPMNSTDELRPNSTDELFPNSTDELMPNSTDELPPNSTDELLPNSTDELSPNSTDELAPNSTDELANNSTDELNANSTDELNANSTDEL NANSTDEL NANSTDEL NANSTDEL NANSTDEL NANSTDEL NANSTDEL NANSTDEL NANSTDEL NANSTDEL NANSTDEL%MSTARTL%CLEARTL%PREDRTL %PREDRTL%DUBIOUS%DUPIOUS%PINIOUS%POUTOUS%EDUPOUS %EDUPOUSPIDENTUSCIDENTUSOIDENTUSFNAMETUSSWIDETUSDOTLETUSDOTRETUSASEPETUSCSEPETUSOSEPETUSPSEPETUSARBPETUSBPLRBTUSORBRBTUSPRBRBTUSCRBRBTUSRCRBBTUSRECRBTUSRECLBTUSLABLBTUSMLABBTUSSLABBTUSXNAMETUSOWNTETUSDBSEPTUSPCONSTUSCMODSTUSCSIGNTUSCUOPNTUSCOP1NTUSCOP2NTUSCOP3NTUSINDEFTUSXELSETUSCRESOPUSNLABOPUSRUNTILUSACONSTUSORRBSTUSFMANYTUSOSTRINGSFMLBINGSFMRBINGSFMORINGSRANGERBSFSIDERBS FSIDERBS FSIDERBS FSIDERBS FSIDERBS FSIDERBS%DUMMYBS%DECLYBS%TYPEYBS%ZEROYBS%APPLYBS%PROTYBS%SETPROT%PTYPEOT%GAPPEOT%LOCALOT%GUARDOT%MCODEOT%CDUMMYT%SETTYPE%OPERYPE%PARAMPE%BLOCKPE%OTHERPE%COMPILEAPPMPILEBASEAPPEAPP2APPEAPP3APPEAPP4APPEAPP5APPEAPP6APPEADEFNPPENPARMPPESWDEFPPESWIDSPPECIEXPPPERCONSTPESCONSTPEARRAYPPEXIMPYPPEIMPPYPPECONDYPPESCONDPPEEXP1DPPEEXP2DPPESEXPDPPEIEXPDPPEIEXP1PPEIEXP2PPEISEXPPPESEQXPPPEFDEFPPPEEXPFPPPENARRAYPESTRUCTPERESEXPPEBPLEXPPECONSTBPEFITEMBPEMOREABPECLISTBPEFPPSTBPEFPP0TBPEFPP1TBPEFPP2TBPEINITVARERECEXPREEIMPXPREIDENTSRERANGESRERCONSTBEVARPSTBEINITDECE INITDECE INITDECE INITDECEESCDECCEESCPROCEESCARRAYESCRECAY             	                    p                                      2                           Y
	
Y             Y[\h^]idefgjklmY              8.4
   9'H  !34  1  0 !81 !5$$A> rB  @ !4B ";
C@ !$$A> r#$$A> rB  C
B$P#E  E  &Q'1"C  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n$A1    0#
#	QD   RD   ?&A'"3A> r2#XC   PC   '4"2$ #PC   '4"?1  34C0  D   D   
C  Ӏ w p 4XB0L$aW   lX=<P9 0$P ,#&P ,Z k  W   <X ,U 0B0$bW   l$P<y  7	W  p 8dZh H P B0 U#<$1Q=<X Z<Ƞ ?ҫ  y 
Z &P 0U!9W   HC 6L\  
EPI 4P ,#&P ,$aQm<X8 Z=<Ӽ  ҳ  U 4B0C  M	g p 0$P ,X=0 
#6W  ,` *W   <$TXmW   TW  X 
sK

W   HC (W   HC W   HC W   HC W   HC W   HXC0$#` 'W   <#` "W   <C 2W   HXML!W   H#W   HW   HC bpW   HC PVW   HC >FW   HC ,' ,6A 8A   &A   W   HW  ,W   HW  ,XY ,!3C W   $`Pi ,W   lC .X8 #6$ $AT$ AT	W  p ,X Z<l X Z<X\ XX Z]<X   $SQ]<y  "	g p ,X Z<0 N< X Z<l hPi X Z<l hPi X Z<l hPi X Z<l $Q<y  6	w p 4X|!4{ W  $1P; 0XK 0UMt!8` ^W   <X[ 0U]|!3C VZ]e  Pk ,$Q 0` 
#9` %!8X; 0U=|!3C *`  #` !5$jPk ,#`  Pk ,W   <C XM0!$$PP]|C ^ [g p 0XxYt##PtX=0 
#6W  ,$P ,XJ @!4$P ,Xj ,W   lXZ #` ?W   <$`Pmt#` *W   <X ,C02X=0B &XtC0kZmW   W   HC <XMD#8 8W   H$TXmW   TXmW   <W  XZ P!P !(
UsE

W   H$RXj W   TC ~W   H$`PmlC `W   HXhPt$PhC F$PXmtAW   HC .W   HC W   HC  W   HC ~W   HC pW   HC dW   HC XW   H$PXmtAC RW   HC LW   HC xDW   HC f:W   H$PXmAC P2W   HC (*W   HC $W   HX=t!9$QXm$W   TC W   HXX!$QkW   TC W   HC W   HC  W   HC W   HC W   HC nW   HC \W   HC JW   HC 8W   HC <` "W   <$PXmtAr` "W   <W   H#$@PMtAW  ,XZ ,P !2#$RPZ ,C pXj B`X8 #6$ $AT` C0 %1P=X$PP`PPPP$AQM$3Q=Xɰ #$$fAd!#P=XI DPI @X0!/X=0 
#:XPP=$:P=z 7
W  p ,X 0UHC0p&P 0
ZPH<  U: 4B0TXJ 0
DZMHT  U[ B0>Xk  B(X 0
ZH< 6B0"XJ 0
DZMPHT UZ @!8X 0P 4{ C $1Q=HXMH
DZMX[ @T  XmH
fZmPX 4@  XHP 4X;  B"&PH
Z@<  XMH
DZMPXZ @@T  XHP 0C  yg p 8$P @H6 P; ,40 P; 0XK ,@ PK 4XV SSPZ 8BZMXd  Pj <3!=X 4 !8` Pj <$PPZ 8XK ,@ #7X X<  P: @{  Bw p HX 0U!5$z 0P: 0$P 4P DXJ DDZH PJ ,%QQZ DdA4Xj <#$`[j <Pj <XZ 8` A&%P 8XZ 8Xj <AX: DU=!2#%Q` AC XHY,#$$cAX 4C n V
g p 4X 0Y @C rPt'P 0X=t4Z8 P: 0H P ,ð #8ð !5` A&XJ ,@   !=XY !Xm0!'X !4%cAX: 0H 
Z HC @K  C z  I
g p ,fC *` C"W  $9L< Z=@W   H#$SW   T|  (w p 0X=U=|#;XM@ 
#6W  ,X]|P]$SXmW   TW  $iLmrZm@W   HX=0@ #8` "W   <XMH@ PK ,C0,` {W   <$PXk ,W   T` }W   <X]xU]B0 Xm|Um!<X=U=!7XMUMC0b
W   HX]xP]eAXm|PmAX=P=$ScW   TXMPM$UdW   T` ]W   <W  ,{  w p ,W   PX=|0 #4&1P=|Z=  XM0!'aW   <$QQ]{  )w p ,X=0 
B0$AQMX]#7eW   <$`Pm|PmtPmxPmPmPmPmX=0B XMDC0 tW   H%TXmW   T#	$UXmW   TX]P]eW   <W  XmC0J%1Q=W   $@PMX]C0,eW   <$aPm|X=XMC PM$@PMC D$QP]W   PXm|` #4&aPm|Zm  X=0!'aW   <$AQMX]P 
C0P]Xm#4{ P Z]5  P=0 B H3!3C 0 !6$BPMC v0 !7@ +PMC AX]P }!3C RP 
!3C `"
3Z=HC  PM@ B0:X]P B0.Xm` CB0 W   $ 
!9A0 +P=C #@ 'BPMC <XMPMX]!5D!3C ` +PmC  w p ,X=4Z8 XC  PM#P  P]x${ Xm` _!>0 P=XMDZH XT P]$C  /g p HX=0
3Z8 &2P< D f=\ 4P 8XL 8J@ PL 8KPL 4X\ 4
UZX He  Pl ,!3C ,
fZh  X, DA*!3C XX< 4Z< 80P< 4C %AQM\X=\!$$bAJXL 4
DZH X]0@T  
UZX %a@e  X=0P< ,X=pP=0C 8XM!X\ #5Xm$PmX=C06%QP\ DP=tXmtYm#C dZh H6 U< ,!2#%AQMtC #X\ ,
UZX He  PmtYm\!#C X=tP=4Z8 P< @HC PMXS P]Xc  Pm@ PMX=40 P=XM@ ZM`T  P]xXm8` C0hlW   H$SXmxW   T$QXmW   T$SXmW   T$UXmW   T$SXmW   TW  ,X< B0XL @HT P   @T $`PmX]P #;Xm#8At!4| X=0 C0XMB0*X]xP]|'TP]xP a!P b!'P]P [P]xC ^Xm` (B0R$PP]Xmx` jB&
DZMLH4P=@ PMVQe [Pmx#` Pm%4Q=xXMLX]@TXm|PmxC RX=0  C0,XMx@ [B0 P ]P]P]|Xm` !6$0[=P=C XI @UI D#3C X\ P  !<Xl @H6 0   @6 C Xm` C0~P !9X< @@aC C X=0 0 B20 
B *X=0 B060 !<X< @@aC $QP]C X=0 0 !=X< @@ D@C X]PS C \X=0 6!8XMx@ i!3C DXM`!5XMtPM`$PP]P\ 0`  PmxX< !3C 40 P=XL @ PL <ZM`d  PmxX]#Xl ,Pl D$1Q9 0XI 0PMtC "%QP\ DQX xXh xPl 0Q]4X=4P=tP=XL <@ !@ !)X]!4$QP]P]Xm` #&X< 0 #9X]H!6X9 U=@!8X\ P   P\ X=t4Z8 P< @@ !8$QQY 4Xi 4Pl 0X\ 0@S 
Xl ,@c XL @C X]PS  XmPc PmX=tP=XL DBP
DZH X\ @Hd  @e X< D
3Z8 XMt@C  X],PB0 %aQm4X=4P=4Z8 X @#$4AXXI 0YM4!$cANC ˀg p 4$0P< 0XK 4@ 
C0(@ !5$4P< 0#@ !5$3P< 0#@ !4$1P< 0$PP[ 8Xm`!8X=CPL ,#f#X]5P< ,#| XL ,YL !"$QQ[ PX; PXMC  X[ 4P 
B00Xk 8`B"X< ,0 !%`#)$PP[ 4$BPMP[ 8X\ 0!:X; 8\+ 4Z< ,P; 8#	Xk 8e  Zl ,Pk 8AC F g p TX=|P=t$@PMPK @PMX]P!3C `U#C U!:` PmxPM|{ P C0BXm#3C X=0 "!3C >0 '!3C D0 .!>W   $ 0! 9!#C 8XMBPK HA X[ H
UZ]He  Pk D`@ #3C j` Um!4X=#XK D!C $aQk HC BXK DG@ PK LAX[ DC  Xk L#;Um!4X=#C |A$APK LX[ LQ[ HC zXk D` PmxB0.` PmxPm$0P=|XM@ 
!8X]X!C A`C X; D70 P=|XK H
DZMHT P?P]C `  Pmx$0P=|XM|[Mt@ #%X]|P]tC ` [Pmx0 ]P=|$APMP=P P]Xm(Pm` 2!$cAN%1[; @P=C H$@PK 8P 'P]AXm` '!=W   $ '#3C DAX; 80   #<XM|PMtP  
P]xC Xm!3C 28Z=P; 8&aPmC $0P=@  PMX]P 
#3A6Xm(bZh |X; 8P6  $AQM(C `P [P]x` ]Pm|$3P=XJ ,[M(@@ PMPmP P]PMXmPmC ZX=#C XJ ,PK LPK 8X],
UZ]P'RP[ Dd Pk H	V#P[ H0 "P=$APMAX]P "!=W   $ "#3C .An$aQk LX; LXMC  Y; H!X]P]$gAC Xk 8X; L66  XK L&APJ ,$PP]`  PmAXk ANX=x0 0!6XM@ "#3C |C T$:P; 4@ [PMxP ]P]|$aPmX=(P=P]@ PM0 2!$cA4XZ ,P[ P$`Pk <Xk 4AX=0 _!7XK 4#4X[ @#3C "$aQk PX; P@ _C  AtX[ 8P[ 4C Xk @#80 '#3C $ATX=0 .B02$AQK PX[ P` .e  A2$2P=XK 4PK 8$@PK 4Xk 8AJX]P @B0$aQk PX; P@ @C  P; HA$QP]$jPk 4X=0 -!<A$jA$@[K 8PK 8#AX[ H&QP[ PXm(e  bZh |X; 8P6  $AQM(X[ 4!6`  
Pmx$bPmX=0 B0&XJ ,X[ PTT  [M(@  PMXk P&aPj ,#XM(BZH |X[ 8PT  $aQm(C X; 0 !0 )!&$@PMxC $PPX 4Xm0&aPmp
fZh Pk 0Pk ,X8 4Z=Z8 4P8 4$AQK 0X[ 0Xme  AX=!#C XM@ 'B0ZP dP[ @Xh 4` M!3C AX8 40 X!7@ PK 4C 0 K#40 O!6$XP[ 4C 0 B!6$bPk 4C zC 2X[ 0[[ ,P[ 8Xk ,V  &RQZ]pP]pYY ,!$hA0 ZP=|XM!?X]P :!:XmPm\$cAC @ 6!<X]P]\`  AC vX]C0(Xk cB0X=P=XMPM\eAj$PP]#$`Pm\AXC 8g p 0cPl ,#3A$1Q=<XH ZM<X\ P e 0d  |  w p ,X=0#:@   PMx${ X]<P !A$aQm<X8 Z=<@ wC  $QQ]<Xh Zm<X=6  AXM!#C $QQ]<Xh Zm<0 _6  DC0XMC#9P   P]x$C |AXmC0C$`AX=x0   #4$C TXM|@ ]B08X]P B0,Xm#$064Z8 Xc A#bZh |Xf  AC l0 [BT0 mB L0 hB0,X]TZX He `@ !=X=P=@  PMx$C X]TZX HU 
`  A#	0   P=x$C #$aQm<X8 Z=<XMC  AC $QQ]<Xh Zm<0 ;6  C h ހw p TX=!5Ȱ  P$@PMPMPJ @PM8%QP]PPMPMPMXmPmPM|XH
ZP&P(P ,PM(XI DPI @PMX]#5XmXBX=B0.XP DȰ  PXMX!Ȱ +PAXZ DP]C Xm` !!2#%P$`A,XMx@ B04$QP]XmPj DX=0 
#8AX DP"$@PMPMC r$PP]PZ 0P]P]P]PZ 8@Z HP] `	Pm$1P=dȰP,XM#5P]PC P]P]Q=X]H!7X]` OAXmx`   #3C vX=#:Ȱ P%APMPC r
fZmHV  P]!<XH[  P]$@PMPC LUC"UP]$P XH ,$P@T @T ` @d X
ZHK  PMTP]pL@ 'APMPC .XmPmX=P=XP C XM&APJ <#X] TZX ,He &aPj <X: <
3Z=PH  PXJ <
DZMHT  PZ <!3C P P]Xj <cPm X=P: <X#40 !3P=XM C2X]P]PMXm` !70 !4$2P: <X#6P <$PX]U]!8XmUj <#5f#3C UM#6D#4X=!3C C XZ ,P PHK PJ <XY \@ T#3C Xj <d@k X9 XP=P=XI `PM X]P]0 #4%APM C Xm#9` #6` #3C ZX=4Z8 ,P: PH P <@ XJ <@ PJ <!3C L@ !<$QP]e#3f!3C 4C X]P #5U#3C @ !4$aPmC X=80 P: <!7XPxC 0 !:XM@ #3C C 0 !:X]P !3C C 0 !=$`AXm` !3C xC XtY!%XMtPMhC X]P !8XmLH6P=#%P C ~$BPM%QP] C n$cPm%1P= C ^$P%APM C NX]P !3C @P !:XmLH6P=%P P !7XMLHdPmC X= 4Z8 ,H 
ZHK @ PM%QP] C Xm` !4$bPm%1P= C XpP$@PMxX]PZ @Xm`@ B0: HP: LX LHK  PJ <X]P0 #3D!2#` QmX: <4Z8 ,&4P: LC Xm#750 [!3Pm%QQ]X=U= !3C &@;  4Z8 ,P: PX @@ MVJ 0@C  XZ <@S $`Pj 0PmX=
3Z=PH  PXM
DZMHT  P]ePmpX=80 #3AXp!3C Hɰ Cɰ !ZK  PMpX]pP x!C Xmx!4eAX=C0>P=p$0P=Ȱ Q$@PMX] TZX ,e Pj PX=@6 Xt@ C 0XMpUMx#4UM|!3C tX]!C $$aQmC .ɰ B$1Q= X U!3C Z ,P PXM@K X]t@[ Xm @k 
X=@; HJ H@K  X]@[ $@@J HXmp
fZmLHV  P]X=#5P=PMPMX=80 
3sC


sK

$P @HJ HC00DZH ,&DPJ LHT  PZ <XZ @@T  HZ HPZ @XZ <@Z HC Xj @Pm8X= C0XP <4Z8 ,P: P%AQM HS  @Z HH PHc PmH 
P HC PM@ C0$D PMHS P]` Pj 0X: @P=C X#6XJ <@ !5X <PPXMPJ <X]
UZ]He  PmX: <!3C f!C r3 P: <$QC XM`#4$dAX]d!4$mAXmh#4%dA$0P=t%Qz XM@ =#9@ <#6$PP]C Xm` Zm`6  P=xC Ȱ PpXM
DZMPHT  P P]$`PmPmC ^$0P: @H HC00Z ,&P LHK  PJ <XJ @@K  HJ HPJ @XJ <@J HC XZ @P]8Xm#5` AzAX=x0   !3C fC `XŰ #3C XM#$PTTZX Xe Pm$#BZH |X4  P=$XM$#3C C $PPZ @Hj HC00dZh ,&dPj LH6  P: <X: @@6  H: HP: @X: <@: HC X @P8Z ,HK  PMx$PP]|@ a#4@ b!5@ [PMxX= 4Z8 ,P: PH PtHC PMtP]xP]Z X[ P]XmtdZh H6 P: 440 P=X 4İ PXJ 4@ #4$P@ #9U#7A:!3C ,C P P]C Xm` !3C X=P: 8C XP <$`AXM@ !5XZ <P]C A,!3C C AXP <$aAXi @Pi 0X=,
3Z=Hc  Pi @Pm$Q,XM DZH ,HT  TZX ,He PmtdZh X: <P6  C p%Q,XM,YMH!$$bA՘
DZMXY @@T  XY 0PY @P]C <`  
Pj <C :0  P: <C ,  P <$@PMx#P  PZ <#XmxPj <$0P=xX8ð  C0@dW   H$SXmxW   TZW   H$SXm|W   TNW   H$SXmW   TW  ,FW   H$QXmW   T:W   H$QXmW   TW  ,4W   H$QXmW   T*W   H$QXmW   TW  , W   H$QXmW   TW   H$QXm W   TW  ,$ $$ATXM@ 
#:@ ;#7$PP]AR"Xj <`   #5fA"#X: 8U=!5$nA#$`A$PP8PC Հ
g p ,V` :Ax$1P9 L{  w p 0X: DB0,XJ H!7$PPZ \{ DZH ,PK ,H4 P: DHd Pj HX: D4Z8 ,P; ,HC PMtHS  PZ \P #C 2D!7Hc Pj DC Hc #9XJ H@C XJ DPJ HXMtPJ DC Hc Pj DX=80 C0~MD#8$hdW   $YLZ ^Z]@-A$RXmtW   TW  W   HW  %aQmX=!,$5P=$@MW  ,C  g p 0X9 0P; ,XK C 2X[ ,YY @#$ $ATTZX XmPe  %1Q; ,'APK C {  +w p ,%2Q: pXJ pBZM@XT P]8Xj pbZm@X6 P=<5&1#$0P=tXJ HPJ D$kAX]8P]<eAXm<AXj \` #<$1Q=<XH ZM<P bT  {  Gg p ,X9 L#=$@PI 8XY \P #%` AԐXi ,
fZh H6  B&XI ,
DZH HT  P e` Ab$aQi ,C $AQM<XX Z]<` ;e  X; 4!9QM<XH ZM<d  XI THT  VY 8@T  Xi  #9X9 0 #4$`AXK @ #:XY T#5` A#Xi !4$oA$;P={  vg p <X=<#3AF$AQJ dX[ TZX P[ 8$`Pk ,H5 
!!7QI 4X9 4@5 
P=4P; ,X[ ,` $A$QXk AhXK 8HT P[ ,P[ 4P pP `!Xk 4`Pk 4X[ 4P ` ,AX; 8XC PK 0X[ ,P pP @!8DZH Hd 
Pk 0XK 0#HC 
PK 0T` ,AѐX[ ,TP xZ]P[ 0Xj \` }!5P P[ 0X; 8XC  PM#$@ #$$@PMH
T` ,AFX[ ,P !4$`Pj dP P[ 0X; 8HC @ #>P !P 
#%@@C %aPmX$`PmX=0 !?P #7P #4P !6XK 8%QaT {  ˀg p @X=t4Z8 XC PK ,
DZH HT  P[ 0	eBX; ,
3Z8 Ic B ePk 4dZk ,Pk 8X; 40 $AC  PK <
fZh H6 4#:X: p#4$dAѸ{ X: pC0 XK 8
DZH X[ 8
UZX He Vk <@d Xk A`X=t4Z8 HS 
` _A#$lAd$API LC  pw p 0X=t4Z8 P; ,HS 
` @AXK ,HT P@ #4$`Pi LX4  !<$aQm<X8 Z=<@ EC  {  /w p ,X: p2Z=@Xc  AϺ%AQJ p{  w p ,X: p!5$@PM$#2Z=@XS  P]$%aQj p{  g p ,X=Z: <C  @ FC0"XMZJ <X]ZZ <e  ` d  $4Q; XMZJ <T  P #4$aQj 0X=Z: <Xk c $1Q: <{  =g p ,X9 ,
3Z8 HC  PJ ,!@ F#5&hA#$AQI ,%SQY H{  "w p 0P{ ,#X{ ,$iAT 8$cW   x{    ).w p xX=PC X !5$mAπ#
XI L!7$API L%aAlX]8P C0HXm` 
#6W  ,W   H$QXm8W   TW  ,$5P=$ҽXM8PJ D$PPZ pPZ ,PZ HPZ hPZ dPZ 8PZ XXi Pj @X=!$aPj @X DU H#<AXJ \
DsD

X]8P #;Xm` #6W  ,X: ,0 C0:0 #8XY H'Q` BAX ,ð #5Xi HA|XJ ,@ #6Xi H'aAhXZ h!4z Xmx#7`   Pmx"X: @P=dXİ 
ZXM@JK  PM@ ZMhd  PmxXC0X` #4&aPmxŰ B08XM@ PJ T@ C0"X]P P]P P !7X]P  P]#XM@ PMX]P!7` !4$QP]PXM@ #4&aPmx` !8$PP]X` +Pm@ ZMT  UB0RXmd` ` B00XmdZh H6 0 #5XPXU!6@  PMxX]!6`  
PmxC $0P9 LC  XtİPXMt@ PMX]tP qP !!5XMPM$aPj hC X=tP=$P @C XMt
DZMPMC XY &QP]TXmt` 	!7X=0 P=$P @$@PMX]tQ]$aPj hC $0P=$X pC0AXM$#$@ #(P  P]xC Xm$PmX=tQ=$P hC @XMt@ PMt$PP]$Xj pC0A4X=$#$0 #(  
PxC XM$PMX]tP]$aPj hC X=0 P=%PXPTC @ DPM$QP]dXmtPmx` !5@ PMX9 0&1P=C ,$Q 4XMtDZH XY 4@T 
C $aPj hX=t0@P=C p$P xXM4'APM$X]tP]XmPmX=4P=eATC >X D!6$@PMC .A:X]tP]C $aQm<X8 Z=<Ȱ }ҳ  C $AQM<XX Z]<` {e  C A~$1Q=<X Z<@ ~K  Q=<XX Z]<Xj \65  C $[$P$$@PMPPMT$PP]XmdZh X=4P6  XZ XM$PK C rX]tP $!<$aQm<X8 Z=<Ȱ Uҳ  C N$AQM<XX Z]<` \e  C 4$1Q=<X Z<XMZMtT  [  C XmtARC X=Z: <XZ <K  @ C  C P P]tXj \` !9XY H'Q` fA>#Xi H'aAX: ,0 Xt;P: ,XI HPJ 0$QPZ <XmXtİ Ҷ C $`A@XJ ,@  #6Xi H&aAVC <$aA"C \$aAXZ ,P P !4$gA Xj ,` ` Pj ,X9 L#;XY H'Q` FAǖ$P ,Xi HAXJ D#3C XZ ,!:Xi H'aA` Pj ,%1Q9 ,X ,Y0!$$cAL
Z XJ ,@K  $SQY HC JXi ,
fZh H6  #X P#4$mAȂ$API P$PPZ TXj p!6P  PZ TX: pC >AX$ð#4$jAJ$AX]$E  PJ LXj Td#4$1P=lX TP TC XZ T` oAƮXY H` ,AƢ$EPJ ,C X]tTZX HU 
` JAƂ$aPi PC %1Q=$P LP PXMtDZH HT 
` LARC XY ,PZ LXi H'cPi lX: L
3Z8 H  #$gAǌC XJ L
DZH HT  P !2#	$aQj L%3Q9 lC Xmt`  !4$1Q9 lXY l` FAX L
Z XJ L
DZH HT  V]t@[  C $aQm<X8 Z=<Ȱ Cҳ  C 4$AQM<XZ D#=Xh Zm<0 "6  $`AP#	X Z<` ?k  X=Z: <ӳ  ð #7XMt@ PMtXZ <PZ LXj 0Pi lX=Z: Lӳ  ð B0$%AQJ LX]ZZ Le  ` X9 l6P9 lC XMZMtXY ld  AX]ZZ <e  ` #6Xj 0&aAL%1Q: <XZ <K  @ XZ 0TPZ 0C <$`Pi 8$0P9 L$Q<XH ZM<X]tT  C A$X]$` eA~C $aQm<X8 Z=<Ȱ Sҳ  C $AQM<XX Z]<` je  C $1Q=<X Z<@ ZK  C XY !;XmL!%$aPmL#$gAxX9 &1P=T$P,$AQM<XX Z]<` He  C $0P=HP=P=W   $aW   `%Q0XI 0PI @PI DC X]DC0>XmtB06P]$0P=PW   X<P0$@PM@PMD$aW   `C z%aPm8XmtAC hX=t!6X$P4#XM$N@ @ !7X]$P?P]8` zcX]$AC Xm0Zmt'bPm0C X=tP=C XD#6$gATC A~XMt@ ZM(( 8AAZX=P=D$0P=X0P<XI PM@$cW   `C &$QQ]Xm` !4$kAC AC AX=!4$1P=S` dAbXZ d` ,AVX \Ű C0*Xj dAXI ,
DZH HT  #Xi P!4X9 !4$mAÆ$PP dC XJ 4PI 4C X]tP],Xm` !9X9 #6$P` FAX 4P 4XI #C XmtAdC NX]tTZX He ` ` !<X=t4Z8 X$P C  XJ p#5Xm$AXmtA$Q` AAxX]tPZ lC Xj ldZh H6 0 #4$PlC AZC XMtDZH HT 
PZ P#$P[Z P` nA$#` @AC $`ATC $aQm<X8 Z=<Ȱ Gҳ  C :XMt#$PTTZX Xe AC ^@@ C0t$aQm<X8 Z=<Ȱ 'ҳ  XMt@ ZM(PMtT  PZ P$aQm<X8 Z=<S  
TPZ PXtU P!3C &Pt$AQM<XX Z]<k  e  C @  C0D ZM(PMt4  P: PS` DA4$Q<XH ZM<P ,T  XmtQj PX=tU: P!3C &1P=tӳ  P LŰ @!>C BZH |XT  ` @AC b$QQ]<Xh Zm<Ҷ  C BZH |Xd  AC :$1Q=<X Z<@ iK  C  $QQ]<Xh Zm<0 a6  C X<[8&PXXmtA$APMdA&XZ D!=XmX#&V` AA%1P=X#AC XXP$#AXM$#$jA$PP]$A#$aPm$X: p#3AnX]$` AAXX[$PX!XMt#3C d!6%PXC $kA.C X]tTZX HU 
` WA$aPi PC XmtA6X=<[=8&1P: T&?4P: TX0P L
&P0Y ,!$aAXMtDZH XZ LPT 
UZX Xm8@e  X: L
3Z8 X<@ %AQJ TXZ T#C $aQj LX: L
3Z8 $@ C %AQMX]tYY @#$gAC Xj p#9X=@Xc AC XtZ XK  #6$dAC X]tTZX $aPe  X=t4Z8 X P T
Z XJ T
DZH H[ PZ tHd  'aPj L#&aPj LAX=<0 !AXj LUj tB0$P PC b$AQM<XX Z]<` pe  C X8 Z=<Ȱ pҳ XH ZM<P ET $bQm<C X=t#$Z XK PM$#2Z8 |XS  P]$$aQj pX: p2Z=@X$P  C PXJ pBZM@XT  P]$#$P[]$P]$Xj pbZm@PV  C  X: p2Z=@$[  P$XJ pBZM@P  C XZ pRZ]@%a[e  Pm$X: p2Z=@Pc  C %Q pXJ pBZM@XT PZ `Xj pbZm@X6  P=$Xt
sK

X]$\J `P]$C $APJ TXZ `#$jAXj `#+'aPj `X: T\-$P: T"X: TP=$C X$XJ `  P$C zX]$Xj `V  P]$C fX=$T: `P=$C VX `!5$jA#	X]$E@ KP]$C 4XJ `QM$C (X]$[Z `P]$#Xm$Vj `Pm$#X=$W: `P=$X pZ@XM$PK  C X]Xe 8f#4$dAX=t0 Z=(XX+ 8AC z$BPJ 8C p$QQZ 8C fXZ 8` rA$`Pj 8C PXZ 8&T` rA$0P: 8$PtC <XM@Xd A$QQ]<Xh Zm<0 P6  C 	߀
W  p t@ P 8X=0P9 <X 0P @P D$P H$API L$PPY PXi  dZh &hPi TH   P XH6  0 P9 \X  Z X P `XMPI dXY  TZX PY h%Q ,X9 ,
3Z8 @  X0U ,!4$bAX0C fXI C ^$UXmW   TXY $cFeW   X  !9W   H#W   H$PXi  AW  ,X9  C0A"X8#3AX dC0.XI THT  P B0XmL!*X  !5%aPmL#$gAA^P pX=#9X hU  #4$fAX hXI pPJ  XY #$`Ay #$`Pi 8A՚X8!3C \AX=l#4%eAX<ɰ !AXPC 6Š !3C 0XI ,PG ,XY 0PW 0Xi 4Pg 4X],XmTAX8##C X=0C FX C >$UXmW   TX $CkW   W   HW  ,$`AC ,;	w P (p NPH 0p P ,NPH p P |NpPH p P N`PH p2P NPPH p.P N@PH p P Px #Xx $eAX=XX ð #4$P0$bW   `$bW   lX )2 $4An)$4An$G@I %Q&QP]t
UZX $`@e  X]tP =W   HW   H$bW  8$P` lA0pP7 ,$P 0P 4[kAH$Q<X Z<$JI  AX]XXmPe  X=#5$`cPe  x  @ &&ScTdNPH 0p P ,NPH p P |NpPH p P N`PH p2P NPPH p.P N@PH p P Px #Xx $eAX=XX ð #4$P0$bW   `$bW   lX )2 $4An)$4An$G@I %Q&QP]t
UZX $`@e  X]tP =W   HW   H$bW  8$P` lA0pP7 ,$P 0P 4[kAH$Q<X Z<$JI  AX]XXmPe  X=#5$`cPe  x  @ &&       0 4  5  6 D I  P   R V X   [ b  d j p t                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                                                                            
                                                                                                                                                                                                           





































































































































                             00       4579;=2f  Zp* 4>su[	?&B |m       Z    F>EJIKLMG;=H@USW(VT 	P
>C >;<@=  >C@B (  ~ ـC @BD@C> @@   ـG@B  ]  Z @ Z@ @  @   Z@ @ @C@ @  x ؀D@>@ @ƀS@ @ 3@@   @ ހ     ~@@   Z  [\k m3 5 4 4 4   [\ jk lm@-    Y  $ Z       ǀ[`\PN?kmORQ6 A4 Y357 4hi 35 78     4 4 Ő[\ [\ [\$  @  jk jk lm lm       @-$ Y8  @  $ ـC@BC ؀D  C>   B    D  >   ׀ 89     ڐ8  [\:cjklm1  12*+,0 1  [\  z 2@*+,1    Ɛ[\ jklm   ݀*+,1 ƀ01  1  ][ \  y[\.-݀*+,   *+,0     Ɛ[\ ݀*+    ݀*   À[\@/   /ဟ  ဟ  ဟ  @/   [ \  @3 @  -] ] ^@@ @  Z  Z     Z    Z  Z@ @  @ @  @   ~ @ Z Z  Z }     ~    @ @ Z  Z  Z@              34 | \k@mސ[\  @[ Y $ ހ[\@   @  [ \[\jklm [ \ j k l m$ %( ^@( @  "X#&!)  ǐX ǀ ' ǀ ǀ' ǀ' ǐX   @ @  `ab c@   [ \@    [ \@ [\jkl m                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       X G H & . / C C K C   C 3 L O 5 7 P C Q R S C T  ) U V 9 9 Y ] ` a f g h k . C C   n n o 4 1   = C >   C   o p p : q r s @ C B t u D   C z C   I { { C M C ( M C C   |   W V   Z  Y   ^ ]    b  d a    C i h   l k   C C C      v x t  t C G } C   C  U            ;  C w [               c  C                                                                                                   



                     "  $&    )    +-  /  1  3    69:;    <7:  LLH]^____J`f  MU[ghijk  VWY  Z      nastuv  wxylo  zhijU  {|kU  abcw                                            

         "  #$%').*,  *  /0-  3   6485:7<9>;@?  CDPQH ILLLN RRSTUEXVY     ^^_`a]bd            oo rr  rrwyz}~                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 `                        xgxPX0@    $      D    Pform                                                                                                                                                                                                                           `                        xgxPX0@    $      D    Pform        H?   L L                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !   IMP77 compiler  first pass

   %include "Sysinc:com.inc"

!
!            On EMAS all shorts should be changed to integers.
!            Also, the INCLUDE facility will need to be modified.
!
!
         !###################################################
         !            Copyright: 1 January 1980             #
         !     Interactive Datasystems (Edinburgh) Ltd.     #
         !              32 Upper Gilmore Place              #
         !                Edinburgh EH3 9NJ                 #
         !               All Rights Reserved                #
         !###################################################

%BEGIN
   %CONSTSTRING(4) version = "8.4"

   !configuration parameters

   %CONSTINTEGER max int      = ((-1)>>1)//10
   %CONSTINTEGER max dig      = (-1)>>1-maxint*10
   %CONSTINTEGER byte size    = 8;            !bits per byte
   %CONSTINTEGER max tag      = 800;          !max no. of tags
   %CONSTINTEGER max dict     = 6000;         !max extent of dictionary
   %CONSTINTEGER name bits    = 11
   %CONSTINTEGER max names    = 1<<namebits-1
   %OWNINTEGER   spare names  = max names
   %CONSTINTEGER max grammar  = 1720
   %CONSTINTEGER lit max      = 50;           !max no. of constants/stat.
   %CONSTINTEGER rec size     = 520;          !size of analysis record
   %CONSTINTEGER dim limit    = 6;            !maximum array dimension

   !symbols

   %CONSTINTEGER ff     = 12;              !form feed
   %CONSTINTEGER marker = '^';             !marker for faults
   %CONSTINTEGER squote = '"';             !string quote
   %CONSTINTEGER cquote = '''';            !character quote

   !streams

   %CONSTINTEGER report = 0,  source = 1
   %CONSTINTEGER object = 1, listing = 2


   !types

   %CONSTINTEGER integer = 1
   %CONSTINTEGER real    = 2
   %CONSTINTEGER stringv = 3
   %CONSTINTEGER record  = 4

   !forms

   %CONSTINTEGER iform = integer<<4+1

   %CONSTINTEGER var = 91
   %CONSTINTEGER const   = 93
   %CONSTINTEGER swit    = 105
   %CONSTINTEGER comment = 22
   %CONSTINTEGER termin  = 20
   %CONSTINTEGER lab     = 3
   %CONSTINTEGER jump    = 54

   %CONSTINTEGER recfm = 4
   %CONSTINTEGER proc  = 7;                     !class for proc

   !phrase entries

   %CONSTINTEGER escdec   = 252
   %CONSTINTEGER escproc  = 253
   %CONSTINTEGER escarray = 254
   %CONSTINTEGER escrec   = 255

   %RECORDFORMAT arfm(%SHORTINTEGER class,sub,link,ptype,papp,pformat,x,pos);!imp77:
!emas:%RECORDFORMAT arfm(%INTEGER class,sub,link,ptype,papp,pformat,x,pos)

   %RECORDFORMAT tagfm(%INTEGER app, format, %C
                       %SHORTINTEGER flags, index, text, link)

   !flags

!      *===.===.===.===.===.====.====.====.===.======.======*
!      ! u ! c ! c ! p ! s ! a  ! o  ! pr ! s ! type ! form !
!      ! 1 ! 1 ! 1 ! 1 ! 1 ! 1  ! 1  ! 1  ! 1 !  3   !  4   !
!      *===^===^===^===^===^====^====^====^===^======^======*
!        u   c   c   p   s   a    o    p    s    t      f
!        s   l   o   a   u   n    w    r    p    y      o
!        e   o   n   r   b   a    n    o    e    p      r
!        d   s   s   a   n   m         t    c    e      m
!            e   t   m   a   e     
!            d       s   m
!                        e
!
!                             

   %CONSTINTEGER used bit   = b'1000000000000000',
                 closed     = b'0100000000000000',
                 const bit  = b'0010000000000000',
                 parameters = b'0001000000000000',
                 subname    = b'0000100000000000',
                 aname      = b'0000010000000000',
                 own bit    = b'0000001000000000',
                 prot       = b'0000000100000000',
                 spec       = b'0000000010000000'

   %CONSTINTEGER trans bit  = x'4000'
   %CONSTINTEGER error      = x'8000'

   %CONSTINTEGER manifest = 120, figurative = 130
   %CONSTINTEGER actions  = 180, phrasal    = 200

   %CONSTBYTEINTEGERARRAY amap(0:15) = %C
 89, 91, 92, 104, 94, const, swit, 100, 101, 102, 103, 106, 107, 108, 109, 89
!?   v   n   l    fm  const  swit  rp   fp   mp   pp   a    an   na   nan  ?

   %CONSTBYTEINTEGERARRAY atoms(0:15) = 89, 1, 1, 10,  9,  1, 10,  7,
                                         7, 7, 7,  4,  1,  4,  1, 89

   %RECORD(arfm)%ARRAY ar(1:rec size)

   %OWNINTEGER class        = 0;             !class of atom wanted
   %OWNINTEGER x            = 0;             !usually last tag
   %OWNINTEGER atom1        = 0;             !atom class (major)
   %OWNINTEGER atom2        = 0;             !atom class (minor)
   %OWNINTEGER subatom      = 0;             !extra info about atom
   %OWNINTEGER type         = 0,
               app          = 0,
               format       = 0;             !atom info
   %INTEGER hash value
   %OWNINTEGER faulty       = 0;             !fault indicator
   %OWNINTEGER fault rate   = 0;             !fault rate count
   %OWNINTEGER lines        = 0;             !current line number
   %OWNINTEGER text line    = 0;             !starting line for string const
   %OWNINTEGER margin       = 0;             !statement start margin
   %OWNINTEGER error margin = 0,
               error sym    = 0,
               column       = 0
   %OWNINTEGER stats        = 0;             !statements compiled
   %OWNINTEGER mon pos      = 0;             !flag for diagnose
   %OWNINTEGER sym          = nl;            !current input symbol
   %OWNINTEGER symtype      = 0;             !type of current symbol
   %OWNINTEGER quote        = 0;             !>0 strings, <0 chars
   %owninteger end mark     = 0;             !%end flag
   %OWNINTEGER cont         = ' ',
               csym         = ' ';           !listing continuation marker
   %OWNINTEGER decl         = 0;             !current declarator flags
   %OWNINTEGER dim          = 0;             !arrayname dimension
   %OWNINTEGER spec given   = 0

   %OWNINTEGER escape class = 0;             !when and where to escape
   %OWNINTEGER protection   = 0,
               atom flags   = 0
   %OWNINTEGER otype        = 0;             !current 'own' type
   %OWNINTEGER reals ln     = 1;             ! =4 for %REALSLONG
   %OWNINTEGER last1        = 0;             !previous atom class
   %OWNINTEGER gen type     = 0
   %OWNINTEGER ptype        = 0;             !current phrase type
   %OWNINTEGER papp         = 0;             !current phrase parameters
   %OWNINTEGER pformat      = 0;             !current phrase format
   %OWNINTEGER force        = 0;             !force next ptype
   %OWNINTEGER g            = 0,
               gg           = 0,
               map gg       = 0;             !grammar entries
   %OWNINTEGER fdef         = 0;             !current format definition
   %OWNINTEGER this         = -1;            !current recordformat tag
   %OWNINTEGER nmin         = 0;             !analysis record atom pointer
   %OWNINTEGER nmax         = 0;             !analysis record phrase pointer
   %OWNINTEGER rbase        = 0;             !record format definition base
   %OWNINTEGER stbase       = 0;             !constant work area base
   %OWNINTEGER gmin         = max grammar;   !upper bound on grammar
   %OWNINTEGER dmax         = 1
   %OWNINTEGER tmin         = max tag;       !upper bound on tags
   %OWNINTEGER ss           = 0;             !source statement entry
   %STRING(63) include file
   %OWNINTEGER include list = 0,
               include level= 0
   %OWNINTEGER include      = 0;                 !=0 unused, #0 being used
   %OWNINTEGER perm         = 1;             !1 = compiling perm, 0 = program
   %OWNINTEGER progmode     = 0;             !-1 = file, 1 = begin/eop
   %OWNINTEGER sstype       = 0;             !-1:exec stat
                                             ! 0: declaration
                                             ! 1: block in
                                             ! 2: block out
   %OWNINTEGER spec mode    = 0;             !>=0: definition
                                             ! -1: proc spec
                                             ! -2: recordformat
   %OWNINTEGER ocount       = -1;            !own constants wanted
   %OWNINTEGER limit        = 0;             !lookup limit
   %OWNINTEGER copy         = 0;             !duplicate name flag
   %OWNINTEGER order        = 0;             !out of sequence flag
   %OWNINTEGER for warn     = 0;             !non-local flag
   %OWNINTEGER dubious      = 0;             !flag for dubious statements
   %OWNINTEGER dp           = 1
   %OWNINTEGER pos1         = 0,
               pos2         = 0;             !error position
   %OWNINTEGER pos          = 0;             !input line index
   %OWNINTEGER dimension    = 0;             !current array dimension
   %OWNINTEGER local        = 0;             !search limit for locals
   %OWNINTEGER fm base      = 0;             !entry for format decls
   %OWNINTEGER search base  = 0;             !entry for record_names
   %OWNINTEGER format list  = 0;             !size of current format list
   %INTEGER recid
   %OWNBYTEINTEGERARRAY char(0:133) = nl(134);  !input line
   %INTEGERARRAY lit pool(0:lit max)
   %OWNINTEGER lit          = 0;             !current literal (integer)
   %OWNINTEGER lp           = 0;             !literals pointer
   %OWNINTEGER block x      = 0;             !block tag
   %OWNINTEGER list         = 1;             !<= to enable
   %OWNINTEGER control      = 0
   %OWNINTEGER diag         = 0;             !diagnose flags
   %SHORTINTEGERARRAY hash(0:max names)
   %RECORD(tagfm)%ARRAY tag(0:max tag)
   %SHORTINTEGERARRAY dict(1:max dict)
   %BYTEINTEGERARRAY buff(1:512)
   %OWNINTEGER bp           = 0

!*** start of generated tables ***
   %include "tables.imp"
!***  end  of generated tables ***

%ROUTINE flush buffer
   %INTEGER j
   %IF faulty = 0 %START
      select output(object)
      %FOR j = 1, 1, bp %CYCLE
         printsymbol(buff(j))
      %REPEAT
      select output(listing)
   %FINISH
   bp = 0
%END
%ROUTINE print ident(%INTEGER p, mode)
   %INTEGER j, ad
   p = tag(p)_text
   %IF p = 0 %START
      bp = bp+1 %AND buff(bp) = '?' %if Mode # 0
      %RETURN
   %FINISH
   ad = addr(dict(p+1))
   %IF mode = 0 %THEN printstring(string(ad)) %ELSE %START
      %FOR j = ad+1, 1, ad+byteinteger(ad) %CYCLE
         bp = bp+1
         buff(bp) = byteinteger(j)
      %REPEAT
   %FINISH
%END
%ROUTINE abandon(%INTEGER n)
   %SWITCH reason(0:9)
   %INTEGER stream
   stream = listing
   %CYCLE
      newline %IF sym # nl
      printsymbol('*');  write(lines,4);  space
      ->reason(n)
reason(0):printstring("compiler error!");          ->more
reason(1):printstring("switch vector too large");  ->more
reason(2):printstring("too many names");           ->more
reason(3):printstring("program too complex");      ->more
reason(4):printstring("feature not implemented");  ->more
reason(5):printstring("input ended: ")
          %IF quote # 0 %START
            %IF quote < 0 %THEN printsymbol(cquote) %C
                          %ELSE printsymbol(squote)
          %ELSE
             printstring("%endof")
             %IF progmode >= 0 %THEN printstring("program") %C
                               %ELSE printstring("file")
          %FINISH
          printstring(" missing?");                ->more
reason(6):printstring("too many faults!");         ->more
reason(7):printstring("string constant too long"); ->more
reason(8):printstring("dictionary full"); -> more
reason(9):printstring("Included file ".include file." does not exist")
more: newline
      printstring("***  compilation abandoned ***");  newline
      %EXIT %IF stream = report
      close output
      stream = report
      select output(report)
   %REPEAT
   %SIGNAL 15,15 %IF diag&4096 # 0
   %STOP
%END
%ROUTINE op(%INTEGER code, param)
      buff(bp+1) <- code
      buff(bp+2) <- param>>8
      buff(bp+3) <- param
      bp = bp+3
%END
%ROUTINE set const(%INTEGER m)
      buff(bp+1) <- 'N'
      buff(bp+5) <- m;  m = m>>8
      buff(bp+4) <- m;  m = m>>8
      buff(bp+3) <- m;  m = m>>8
      buff(bp+2) <- m
      bp = bp+5
%END



%ROUTINE compile block(%INTEGER level, block tag, dmin, tmax, id)

   %INTEGERFNSPEC gapp
   %ROUTINESPEC delete names(%INTEGER quiet)
   %ROUTINESPEC analyse
   %ROUTINESPEC compile

   %INTEGER open;    open       = closed;      !zero if can return from proc
   %INTEGER dbase;   dbase      = dmax;        !dictionary base
   %INTEGER tbase;   tbase      = tmax;        !tag base
   %INTEGER tstart;  tstart     = tmax
   %INTEGER label;   label      = 4;           !first internal label
   %INTEGER access;  access     = 1;           !non-zero if accessible
   %INTEGER inhibit; inhibit    = 0;           !non-zero inhibits declaratons

   %SHORTINTEGERNAME bflags; bflags      == tag(block tag)_flags
   %INTEGER block type;      block type   = bflags>>4&7
   %INTEGER block form;      block form   = bflags&15
   %INTEGER block fm;        block fm     = tag(block tag)_format
   %INTEGER block otype;     block otype  = otype
   %INTEGERNAME block app;   block app   == tag(block tag)_app

   %INTEGER l, new app

%ROUTINE fault(%INTEGER n)

    ! -5 : -1  - warnings
    !  1 : 22  - errors

    %SWITCH fm(-5:22)
    %INTEGER st

    %ROUTINE print ss
       %INTEGER s, p
       %RETURN %IF pos = 0
       space
       p = 1
       %CYCLE
          printsymbol(marker) %IF p = pos1
          %EXIT %IF p = pos
          s = char(p);  p = p+1
          %EXIT %IF s = nl %OR (s='%' %AND p = pos)
          %IF s < ' ' %START;         !beware of tabs
             %IF s = ff %THEN s = nl %ELSE s = ' '
          %FINISH
          printsymbol(s)
       %REPEAT
       pos = 0 %IF list <= 0
    %END

    pos1 = pos2 %IF pos2 > pos1
    newline %IF sym # nl
    st = report
    st = listing %IF n = -3;              !don't report unused on the console
    %cycle
       SELECT OUTPUT(st)
       %if n < 0 %then printsymbol('?') %and pos1 = 0 %else printsymbol('*')
       %if st # report %start
          %if list <= 0 %and pos1 # 0 %start
             spaces(pos1+margin);  PRINTSTRING("      ! ")
          %finish
       %finish %else %start
          PRINTSTRING(include file) %if include # 0
          write(lines, 4);  printsymbol(csym);  space
       %finish
       ->fm(n) %if -5 <= n <= 22
       PRINTSTRING("fault");  write(n, 2);              ->ps

fm(-5):PRINTSTRING("Dubious statement");  dubious = 0;  ->psd
fm(-4):PRINTSTRING("Non-local")
       pos1 = for warn;  for warn = 0;                  ->ps
fm(-3):print ident(x, 0);  PRINTSTRING(" unused");      ->nps
fm(-2):PRINTSTRING("""}""");                            ->miss
fm(-1):PRINTSTRING("access");                           ->psd

fm(0): PRINTSTRING("form");                             ->ps
fm(1): PRINTSTRING("atom");                             ->ps
fm(2): PRINTSTRING("not declared");                     ->ps
fm(3): PRINTSTRING("too complex");                      ->ps
fm(4): PRINTSTRING("duplicate ");  Print Ident(x, 0);   ->ps
fm(5): PRINTSTRING("type");                             ->ps
fm(6): PRINTSTRING("match");                            ->psd
fm(7): PRINTSTRING("context");                          ->psd
fm(21):PRINTSTRING("context ");  print ident(this, 0);  ->ps
fm(8): PRINTSTRING("%cycle");                           ->miss
fm(9): PRINTSTRING("%start");                           ->miss
fm(10):PRINTSTRING("size");  WRITE(lit, 1) %if pos1 = 0;->ps
fm(11):PRINTSTRING("bounds")
       WRITE(ocount, 1) %unless ocount < 0;             ->ps
fm(12):PRINTSTRING("index");                            ->ps
fm(13):PRINTSTRING("order");                            ->psd
fm(14):PRINTSTRING("not a location");                   ->ps
fm(15):PRINTSTRING("%begin");                           ->miss
fm(16):PRINTSTRING("%end");                             ->miss
fm(17):PRINTSTRING("%repeat");                          ->miss
fm(18):PRINTSTRING("%finish");                          ->miss
fm(19):PRINTSTRING("result");                           ->miss
fm(22):PRINTSTRING("format");                           ->ps
fm(20):printsymbol('"');  print ident(x, 0);  printsymbol('"')
miss:  PRINTSTRING(" missing");                         ->nps
psd:   pos1 = 0
ps:    print ss
nps:   NEWLINE
       %exit %if st = listing
       st = listing
    %repeat
    %if n >= 0 %start
       %signal 15,15 %if diag&4096 # 0
       %if n # 13 %start;           !order is fairly safe
          ocount = -1
          gg = 0
          copy = 0;  quote = 0
          search base = 0;  escape class = 0
          gg = 0
       %finish
       faulty = faulty+1
   
       !check that there haven't been too many faults
   
       fault rate = fault rate+3;  abandon(6) %IF fault rate > 30
       fault rate = 3 %IF fault rate <= 0
    %FINISH
    tbase = tstart
    %IF list <= 0 %AND sym # nl %START
       error margin = column
       error sym = sym;  sym = nl
    %FINISH
%END

   dmin = dmin-1;  dict(dmin) = -1;            !end marker for starts & cycles
   abandon(2) %IF dmax = dmin

   %IF list > 0 %AND level > 0 %START
      write(lines, 5);  spaces(level*3-1)
      %IF block tag = 0 %START
         printstring("Begin")
      %FINISH %ELSE %START
         printstring("Procedure ");  print ident(block tag, 0)
      %FINISH
      newline
   %FINISH

   !deal with procedure definition (parameters)

   %IF block tag # 0 %START;                   !proc
      analyse;  compile %IF ss # 0

      %IF block otype # 0 %START;              !external-ish
         %IF bflags&spec = 0 %START;           !definition
            %IF progmode <= 0 %AND level = 1 %THEN progmode = -1 %C
                                             %ELSE fault(7)
         %FINISH
      %FINISH

      new app = gapp;                          !generate app grammar
      %IF spec given # 0 %START;               !definition after spec
         fault(6) %IF new app # block app;     !different from spec
      %FINISH
      block app = new app;                     !use the latest

      %IF level < 0 %START;                    !not procedure definition
         delete names(0)
         %RETURN
      %FINISH
   %FINISH %ELSE %START
      open = 0;                                !can return from a block?
   %FINISH

   %CYCLE
      analyse
      %CONTINUE %IF ss = 0
      compile
      fault(-5) %IF dubious # 0
      flush buffer %IF bp >= 128
      %IF sstype > 0 %START;                 !block in or out
         %EXIT %IF sstype = 2;               !out
         compile block(spec mode, block x, dmin, tmax, id)
         %EXIT %IF ss < 0;                   !endofprogram
      %FINISH
   %REPEAT
   %IF list > 0 %AND level > 0 %START
      write(lines, 5);  spaces(level*3-1)
      printstring("End")
      newline
   %FINISH
   delete names(0)
   %RETURN

   %INTEGERFN gapp;                            !generate app grammar (backwards)
      %CONSTINTEGER comma = 140;               !psep
      %ROUTINESPEC set cell(%INTEGER g, tt)
      %ROUTINESPEC class(%RECORD(tagfm)%NAME v)
      %RECORD(tagfm)%NAME v
      %INTEGER p, link, tp, c, ap, t

      %RESULT = 0 %IF tmax = local;            !no app needed

      p = gmax1;  link = 0;  t = tmax

      %CYCLE
         v == tag(t);  t = t-1
         class(v);                             !deduce class from tag
         %IF c < 0 %START;                     !insert %PARAM
            c = -c
            set cell(196, tp)
            tp = -1
         %FINISH
         set cell(c, tp)
         %EXIT %IF t = local;                  !end of parameters
         set cell(comma, -1);                  !add the separating comma
      %REPEAT
      abandon(3) %IF gmax > gmin

      %RESULT = link

      %ROUTINE set cell(%INTEGER g, tt)

         !add the cell to the grammar, combining common tails

         %WHILE p # gmax %CYCLE
            p = p+1
            %IF glink(p) = link %AND gram(p) = g %START
               %IF tt < 0 %OR (gram(p+1) = tt %AND glink(p+1)=ap) %START
                  link = p;                    !already there
                  %RETURN
               %FINISH
            %FINISH
         %REPEAT

         !add a new cell

         gmax = gmax+1
         gram(gmax) = g
         glink(gmax) = link
         link = gmax

         %IF tt >= 0 %START;             ! set type cell
            gmax = gmax+1
            gram(gmax) = tt
            glink(gmax) = ap
         %FINISH

         p = gmax
      %END

      %ROUTINE class(%RECORD(tagfm)%NAME v)
         %CONSTINTEGER err    = 89
         %CONSTINTEGER rtp    = 100
         %CONSTINTEGER fnp    = 101
         %CONSTINTEGER mapp   = 102
         %CONSTINTEGER predp  = 103
         %CONSTINTEGERARRAY class map(0:15) = %C
         err,1764, 247, err(4), -rtp, -fnp, -mapp, -predp, err, 214,
         err, 229, err
         %INTEGER tags, type, form
         ap = 0
         tags = v_flags
         type = tags>>4&7;  form = tags&15
         tp = v_format<<3!type
         c = class map(form)
         c = 208 %AND tp = 0 %IF type = 0 %AND form = 2;  !%NAME
         ap = v_app %IF tags&parameters # 0
      %END
   %END

%ROUTINE delete names(%INTEGER quiet)
   %INTEGER flags
   %RECORD(tagfm)%NAME tx
   %WHILE tmax > tbase %CYCLE
      x = tmax;  tmax = tmax-1
      tx == tag(x)
      flags = tx_flags
      fault(20) %IF flags&spec # 0 %and flags&own bit = 0
               {spec with no definition & not external}
      %IF flags&used bit = 0 %AND level >= 0 %AND list <= 0 %START
         fault(-3) %IF quiet = 0;          !unused
      %FINISH
      dict(tx_text) = tx_link
   %REPEAT
%END

%ROUTINE analyse

   %CONSTINTEGER order bits = x'3000', order bit = x'1000'
   %CONSTINTEGER escape     = x'1000'
   %INTEGER strp, mark, flags, prot err, k, s, c
   %OWNINTEGER key = 0
   %SHORTINTEGER node
   %SHORTINTEGERNAME z
   %RECORD(arfm)%NAME arp
!emas:   %INTEGER node
!emas:   %INTEGERNAME z
   %SWITCH act(actions:phrasal), paction(0:15)

   %ROUTINE trace analysis
      !diagnostic trace routine (diagnose&1 # 0)
      %INTEGER a
      %ROUTINE show(%INTEGER a)
         %IF 0 < a < 130 %START
            space
            printstring(text(a))
         %FINISH %ELSE write(a, 3)
      %END
      %OWNINTEGER la1=0, la2=0, lsa=0, lt=0
      newline %IF mon pos # pos %AND sym # nl
      mon pos = pos
      write(g, 3)
      space
      printstring(text(class))
      printsymbol('"') %IF gg&trans bit # 0
      a = gg>>8&15
      %IF a # 0 %START
         printsymbol('{')
         write(a, 0)
         printsymbol('}')
      %FINISH
      %IF atom1 # la1 %OR atom2 # la2 %OR lsa # subatom %C
                      %OR lt # type %START
         printstring(" [")
         la1 = atom1
         show(la1)
         la2 = atom2
         show(la2)
         lsa = subatom
         write(lsa, 3)
         lt = type
         write(lt, 5)
         printsymbol(']')
      %FINISH
      newline
   %END

%ROUTINE get sym
   readsymbol(sym)
   pos = pos+1 %IF pos # 133
   char(pos) = sym
   printsymbol(sym) %IF list <= 0
   column = column+1
%END
%ROUTINE read sym
   %owninteger Last = 0
%CONSTBYTEINTEGERARRAY mapped(0:127) = %C
   0,  0,  0,  0,   0,  0,  0,  0,    0,  0, nl,  0,  3 ,  0,  0,  0,
   0,  0,  0,  0,   0,  0,  0,  0,    0,  0,  0,  0,   0,  0,  0,  0,
  0 ,'!','"','#', '$', 1 ,'&', 39,  '(',')','*','+', ',','-','.','/',
 '0','1','2','3', '4','5','6','7',  '8','9',':',';', '<','=','>','?',
 '@','A','B','C', 'D','E','F','G',  'H','I','J','K', 'L','M','N','O',
 'P','Q','R','S', 'T','U','V','W',  'X','Y','Z','[', '\',']','^','_',
 '`','A','B','C', 'D','E','F','G',  'H','I','J','K', 'L','M','N','O',
 'P','Q','R','S', 'T','U','V','W',  'X','Y','Z', 2 , '|','}','~',  0

!!   0 = space
!!   1 = %
!!   2 = {
!!   3 = ff
!!   other values represent themselves

   %IF sym = nl %START
s1:   lines = lines+1
      printsymbol(end mark) %if end mark # 0
s11:  pos = 0;  pos1 = 0;  pos2 = 0;  margin = 0;  column = 0
      Last = 0
      end mark = 0
      %IF list <= 0 %START
         %IF include # 0 %START
            printstring(" &");  write(lines, -4)
         %FINISH %ELSE  write(lines, 5)
         csym = cont;  printsymbol(csym)
         space
         %IF error margin # 0 %START
            lines = lines-1
            spaces(error margin)
            error margin = 0
            %IF error sym # 0 %START
               printsymbol(error sym)
               pos = 1;  char(1) = error sym
               sym = error sym;  error sym = 0
               ->s5
            %FINISH
         %FINISH
      %FINISH
s2:   symtype = 1
   %FINISH
s3:readsymbol(sym)
   pos = pos+1 %IF pos # 133
   char(pos) = sym
   printsymbol(sym) %IF list <= 0
   column = column+1
s5:%IF sym # nl %START
      Last = Sym
      %RETURN %IF quote # 0;                     !dont alter strings
      sym = mapped(sym&127)
      %IF sym <= 3 %START;                       !special symbol
         ->s2 %IF sym = 0;                       !space (or dubious control)
         symtype = 2 %AND ->s3 %IF sym = 1;      !%
         cont = '+' %AND ->s11 %IF sym = 3;      !ff
         !must be {
         %CYCLE
            get sym
            ->s3 %IF sym = '}'
            ->s4 %IF sym = nl
         %REPEAT
      %FINISH
      key = kdict(sym)
      %IF key&3 = 0 %AND symtype = 2 %START;            !keyword
         %IF sym = 'C' %AND nextsymbol = nl %START;     !%C...
            getsym;  cont = '+';  ->s1
         %FINISH
      %ELSE
         symtype = key&3-2
      %FINISH
      %RETURN
   %FINISH
s4:symtype = quote
   ->S1 %if last = 0 %and Quote = 0
   Cont = '+'
%END

%INTEGERFN format selected
   format list = tag(format)_app;      !number of names
   %IF format list < 0 %START;         !forward ref
      atom1 = error+22
      %RESULT = 0
   %FINISH
   %IF sym = '_' %START
      escape class = esc rec
      search base = tag(format)_format
   %FINISH
   %RESULT = 1
%END

%ROUTINE code atom(%INTEGER target)
   %INTEGER dbase, da
   %INTEGER base, n, mul, pend quote
   %INTEGER j,k,l, pt

   %ROUTINE lookup(%INTEGER d)
      %CONSTINTEGER magic = 6700421
      %INTEGER new name, vid, k1, k2, form
      %RECORD(tagfm)%NAME t
!emas:      %LONGINTEGER k0
      %INTEGER new

      !first locate the text of the name

      new = addr(dict(dmax+1))

            !******** Machine code to inhibit overflow test ********

            *LI_1,magic
            * M_0,hash value
            *ST_1,K2

            {K2 = hash value*magic}

            !*******************************************************

      k2 = k2>>(32-2*name bits)!1
!emas:   k0 = magic
!emas:   k1 = (k0*hash value)&X'7FFFFFFF'
!emas:   k2 = k1>>(32-2*name bits)!1
      k1 = k2>>name bits;                      !giving name bits
      %CYCLE
         newname = hash(k1)
         %EXIT %IF newname = 0;                !not in
         ->in %IF string(addr(dict(newname+1))) = string(new)
         k1 = (k1+k2)&max names
      %REPEAT

      ! not found

      spare names = spare names-1
      abandon(2) %IF spare names <= 0
      hash(k1) = dmax;                               !put it in
      dict(dmax) = -1
      newname = dmax;  dmax = dp;  ->not in

in:   search base = rbase %IF this >= 0 %AND d # 0;  !record elem defn
      %IF search base # 0 %START;                    !record subname
         new = -1
         x = search base
         %CYCLE
            ->not in %IF x < format list
            %EXIT %IF tag(x)_text = new name
            x = x-1
         %REPEAT
      %FINISH %ELSE %START;                   !hash in for normal names
         x = dict(newname)
         ->not in %IF x <= limit;             !wrong level
      %FINISH

      subatom = x;                            !name found, extract info
      t == tag(x)
      atom flags = t_flags
      format = t_format;  app = t_app
      protection = atom flags&prot
      type = atom flags>>4&7;  atom1 = amap(atom flags&15)

      %IF diag&8 # 0 %START
         printstring("lookup:")
         write(atom1, 3)
         write(type, 1)
         write(app, 3)
         write(format, 5)
         write(atom flags, 3)
         newline
      %FINISH

      %IF d = 0 %START;                             !old name wanted
         t_flags <- t_flags!used bit
         search base = 0

         %IF atom flags&subname # 0 %AND format # 0 %START; !a record
            %RETURN %IF format selected = 0
         %FINISH

         %IF atom flags&parameters # 0 %START;      !proc or array

            %IF app = 0 %START;                     !no parameters needed
               atom2 = atom1
               atom1 = atom1-4
               %IF 97 <= atom1 <= 98 %START
                  map gg = atom1;  atom1 = var
               %FINISH
            %FINISH %ELSE %START
               %IF sym = '(' %START
                  search base = 0;                  !ignore format for now
                  %IF atom1 >= 106 %START;          !arrays
                     app = phrase(app+200)
                     escape class = esc array
                     atom1 = (atom1-106)>>1+91;     !a,an->v  na,nan->n
                  %FINISH %ELSE %START;             !procedures
                     escape class = esc proc
                     atom1 = atom1-4
                  %FINISH
                  phrase(200) = app
               %FINISH
            %FINISH
            pos2 = pos;  %return
         %FINISH

         !deal with constintegers etc

         %IF atom flags&const bit # 0 %AND atom1 = var %START
               map gg = const;  atom2 = const
               subatom = -subatom %IF type = integer
         %FINISH
         %RETURN

      %FINISH
                                                 !new name wanted
      ->not in %IF tbase # tstart;               !don't fault proc parm-parm
      %IF d = lab+spec+used bit %START
         t_flags = t_flags!used bit
         %RETURN
      %FINISH
      %IF atom flags&spec # 0 %START;            !a spec has been given
         %IF d = lab %START;                     !define label
            t_flags <- t_Flags-Spec
            %RETURN
         %FINISH
         %IF 7 <= decl&15 <= 10 %AND decl&spec = 0 %START

            !procedure definition after spec

            %IF (decl!!atom flags)&b'1111111' = 0 %START;  !correct type?
               t_flags = t_flags-spec
               spec given = 1
               %RETURN
            %FINISH

            !note that an external procedure must be speced as a
            !non-external procedure.

         %FINISH
         %IF decl&15 = recfm %START;              !recordformat
            t_flags = record<<4+recfm
            t_format = fdef
            %RETURN
         %FINISH
      %FINISH
      %RETURN %IF last1 = jump %AND atom1 = swit
      copy = x %IF copy = 0

notin:app = 0;  vid = 0
      atom1 = error+2

      %return %if d = 0;                         !old name wanted
      type = d>>4&7;  form = d&15;  atom1 = amap(form)

      %IF this < 0 %START;                       !normal scope
         new = newname
         tmax = tmax+1;  x = tmax
      %FINISH %ELSE %START;                      !recordformat scope
         new = -1
         recid = recid-1;  vid = recid
         tmin = tmin-1;  x = tmin
         format list = tmin
      %FINISH

      %IF 11 <= form <= 14 %START;               !arrays
         dim = 1 %IF dim = 0;                    !set dim for owns
         app = dim
      %FINISH

      d = d!used bit %IF (otype > 2 %AND d&spec = 0) %OR perm # 0 %OR
                         Level = Include Level

      !external definitions need not be used in the file in which
      !they are defined, so inhibit a useless unused warning.

      t == tag(x)
      %IF form = lab %START
         id = id+1;  vid = id
      %FINISH
      t_index = vid
      t_text   = new name
      t_flags <- d
      t_app    = app
      t_format = fdef;  format = fdef
      subatom = x

      %IF new >= 0 %START;                             !insert into hash table
         t_link = dict(new);  dict(new) = x
         %IF gmin = max grammar %START;                !proc param params
            tmin = tmin-1;  subatom = tmin
            tag(tmin) = t
         %FINISH
      %FINISH
      abandon(3) %IF tmax >= tmin
   %END



top:  pos1 = pos
      subatom = 0;  pend quote = 0;  atom flags = 0

      !app and format must be left for assigning to papp & pformat

      ->name %IF symtype = -2;                   !letter
      ->number %IF symtype < 0;                  !digit
      %IF symtype = 0 %START
         atom1 = termin;  atom2 = 0
         %RETURN
      %FINISH
      %IF symtype # 2 %START;                    !catch keywords here
         ->text %IF quote # 0;                   !completion of text
         ->strings %IF sym = squote;             !start of string
         ->symbols %IF sym = cquote;             !start of symbol
         ->number %IF sym = '.' %AND '0' <= nextsymbol <= '9'
      %FINISH

                                                 !locate atom in fixed dict
      k = key>>2;  read sym
      %CYCLE
         j = kdict(k)
         %EXIT %IF j&x'4000' # 0
         %IF j&127 # sym %OR symtype < 0 %START
            ->err %UNLESS j < 0
            k = k+1
         %FINISH %ELSE %START
            l = j>>7&127;  read sym
            %IF j > 0 %START
               %IF l # 0 %START
                  ->err %IF l # sym %OR symtype < 0
                  read sym
               %FINISH
               l = 1
            %FINISH
            k = k+l
         %FINISH
      %REPEAT
      atom1 = j&127
      %IF atom1 = 0 %START;                      !comma
         atom1 = 19;  subatom = 19;  atom2 = 0
         %IF sym = nl %START
            %RETURN %IF ocount >= 0

            !special action needs to be taken with <comma nl> as
            !const array lists can be enormous

            read sym
         %FINISH
         %RETURN
      %FINISH
      atom2 = j>>7&127
      subatom = kdict(k+1)&x'3fff'
      !!!!!cont = ' '
      %RETURN

      !report an error. adjust the error marker (pos1) to point
      !to the faulty character in an atom, but care needs to be taken
      !to prevent misleading reports in cases like ...?????

err:  atom1 = error+1;  atom2 = 0
      pos1 = pos %IF pos-pos1 > 2
      %RETURN

        !take care with strings and symbol constants.
        !make sure the constant is valid here before sucking it in
        !(and potentially loosing many lines)

symbols:atom1 = var;  atom2 = const;  type = integer
        map gg = const;  protection = prot
        subatom = lp;  abandon(3) %IF lp >= lit max
        quote = \pend quote
        %RETURN

      !an integer constant is acceptable so get it in and
      !get the next atom

chars:n = 0;  cont = cquote
      %CYCLE
         read sym
         %IF sym = cquote %START
            %EXIT %IF nextsymbol # cquote
            read sym
         %FINISH
         %IF n&(\((-1)>>byte size)) # 0 %START; ! overflow
            pos1 = pos;  atom1 = error+10;  %RETURN
         %FINISH
         ->err %IF quote = 0
         n = n<<byte size+sym
         quote = quote+1
      %REPEAT
      quote = 0;  cont = ' '
      readsym %IF sym # nl
      lit pool(lp) = n;  lp = lp+1
      ->top

        !sniff the grammar before getting the string

strings:atom1 = var;  atom2 = const;  type = stringv
        subatom = (strp-stbase)!x'4000'
        map gg = const;  protection = prot
        quote = subatom
        text line = lines;                         !in case of errors
        %RETURN

      !a string constant is ok here, so pull it in and get
      !the next atom

text: ->chars %IF quote < 0;                       !character consts
      l = strp; n = strp
      j = addr(glink(gmin-1));                     !absolute limit
      k = l+256;                                   !string length limit
      k = j %IF j < k;                             !choose lower

      %CYCLE
         cont = squote;  quote = 1
         %CYCLE
            read sym
            %IF sym = squote %START;               !terminator?
               %EXIT %IF nextsymbol # squote;      !yes ->
               read sym;                           ! skip quote
            %FINISH
            l = l+1;  byteinteger(l) = sym
            lines = text line %AND abandon(7) %IF l >= k; !too many chars
         %REPEAT
         byteinteger(n) = l-n;                            !plug in length
   
         strp = l+1;                                      !ready for next string
         quote = 0;  cont = ' ';  read sym
         code atom(target)
         %RETURN %UNLESS atom1 = 48 %AND sym = squote;    !fold "???"."+++"
      %REPEAT

      %ROUTINE get(%INTEGER limit)
         %INTEGER s, shift
         shift = 0
         %IF base # 10 %START
            %IF base = 16 %START
               shift = 4
            %FINISH %ELSE %START
               %IF base = 8 %START
                  shift = 3
               %FINISH %ELSE %START
                  %IF base = 2 %START
                     shift = 1
                  %FINISH
               %FINISH
            %FINISH
         %FINISH
         n = 0
         %CYCLE
            %IF symtype = -1 %START;            !digit
               s = sym-'0'
            %FINISH %ELSE %START
               %IF symtype < 0 %START;          !letter
                  s = sym-'A'+10
               %FINISH %ELSE %START
                  %RETURN
               %FINISH
            %FINISH
            %RETURN %IF s >= limit
            pt = pt+1;  byteinteger(pt) = sym
            %IF base = 10 %START;            !check overflow
               %IF n >= max int %AND (s > max dig %OR n > max int) %START

                  !too big for an integer,
                  !so call it a real

                  base = 0;  type = real;  n = 0
               %FINISH
            %FINISH
            %IF shift = 0 %START
               n = n*base+s
            %FINISH %ELSE %START
               n = n<<shift+s
            %FINISH
            read sym
         %REPEAT
      %END

number:base = 10
bxk:   atom1 = var;  atom2 = const;  type = integer;  subatom = lp
       map gg = const;  protection = prot
       abandon(3) %IF lp >= lit max
       pt = strp;  mul = 0
       %CYCLE
          get(base)
          %EXIT %UNLESS sym = '_' %AND base # 0 %AND pend quote = 0;    !change of base
          pt = pt+1;  byteinteger(pt) = '_'
          read sym
          base = n
       %REPEAT

       %IF pend quote # 0 %START
          ->err %IF sym # cquote
          readsym
       %FINISH
       %IF sym = '.' %START;                        !a real constant
          pt = pt+1;  byteinteger(pt) = '.'
          read sym
          type = real;  n = base;  base = 0;  get(n)
       %FINISH

       %IF sym = '@' %START;                        !an exponent
          pt = pt+1;  byteinteger(pt) = '@';  k = pt
          readsym
          type = integer;  base = 10
          %IF sym = '-' %START
             read sym;  get(10);  n = -n
          %FINISH %ELSE %START
             get(10)
          %FINISH
          pt = k+1;  byteinteger(pt) = lp;  litpool(lp) = n;  lp = lp+1
          atom1 = error+10 %IF base = 0
          type = real;                              !exponents force the type
       %FINISH

       %IF type = real %START
          byteinteger(strp) = pt-strp
          subatom = (strp-stbase)!x'2000';  strp = pt+1
       %FINISH %ELSE %START
          litpool(lp) = n
          lp = lp+1
       %FINISH
       %RETURN

name: atom1 = 0 %AND %RETURN %IF 27 <= target <= 41
      hash value = 0

      !*****************************
      !*machine dependent for speed*
      !*****************************

      dp = dmax+1
      da = addr(dict(dp));  dbase = da
      %CYCLE
         hash value = hash value+(hash value+sym);        !is this good enough?
         da = da+1;  byteinteger(da) = sym
         read sym
         %EXIT %IF symtype >= 0
      %REPEAT
      %IF sym = cquote %START
         pend quote = 100
         ->symbols %IF hash value = 'M'
         read sym
         %IF hash value = 'X' %THEN base = 16 %AND ->bxk
         %IF hash value = 'K' %C
         %OR hash value = 'O' %THEN base = 8 %AND ->bxk
         %IF hash value = 'B' %THEN base = 2 %AND ->bxk
         ->err
      %FINISH
      n = da-dbase
      byteinteger(dbase) = n
      dp = dp+(n+2)>>1
      abandon(8) %IF dp >= dmin

      atom2 = 90;                                    !ident
      %IF last1 = 0 %AND sym = ':' %START;           !label
         limit = local;  lookup(lab);  %RETURN
      %FINISH
      %IF last1 = jump %START;                       !->label
         limit = local;  lookup(lab+spec+used bit);  %RETURN
      %FINISH
      %IF decl # 0 %AND target = 90 %START;          !identifier
         search base = fm base
         limit = local;  lookup(decl)
         search base = 0
      %FINISH %ELSE %START
         limit = 0;  lookup(0)
      %FINISH
   %END

   %INTEGERFN parsed machine code
      !   *opcode_??????????
      %routine octal(%integer n)
         %integer m
         m = n>>3
         octal(m) %if m # 0
         bp = bp+1;  buff(bp) = n&7+'0'
      %end
      atom1 = error %AND %RESULT=0 %UNLESS symtype = -2;  !starts with letter
      flush buffer %IF bp >= 128
      bp=bp+1 %AND buff(bp)='w'
      %CYCLE
         bp=bp+1 %AND buff(bp)=sym
         read sym
         %EXIT %IF symtype >= 0;                !pull in letters and digits
      %REPEAT
      bp=bp+1 %AND buff(bp)='_'
      %IF symtype # 0 %START;                   !not terminator
         atom1 = error %AND %result=0 %UNLESS sym = '_'
         read sym
         %WHILE symtype # 0 %CYCLE
            %IF symtype < 0 %START;             !complex
               code atom(0);  %result=0 %IF atom1&error # 0
               %IF atom2 = const %AND type = integer %START
                  %IF subatom < 0 %THEN octal(tag(-subatom)_format) %C
                                  %ELSE octal(litpool(subatom))
               %FINISH %ELSE %START
                  %IF 91 <= atom1 <= 109 %START
                     %if atom1 = 104 {label} %and
                         Tag(Subatom)_Flags&Closed = 0 %start
                        This = Subatom;  Atom1 = Error+21
                        %result = 0
                     %finish
                     op(' ', tag(subatom)_index)
                  %FINISH %ELSE %START
                     atom1 = error;  %result=0
                  %FINISH
               %FINISH
            %FINISH %ELSE %START
               bp=bp+1 %AND buff(bp)=sym;  read sym
            %FINISH
         %REPEAT
      %FINISH
      bp=bp+1 %AND buff(bp)=';'
      %RESULT=1
   %END

   cont = ' ' %IF gg = 0
   last1 = 0;  mapgg = 0
   s = 0;  ss = 0;  sstype = -1; fdef = 0
   fm base = 0
   app = 0

   !deal with alignment following an error in one statement
   !of several on a line

   margin = column;                              !start of statement

   pos = 0
   stbase = addr(glink(gmax+1));  strp = stbase;  lp = 0
   tbase = tstart;                               !??????????????
   local = tbase

   %IF gg = 0 %or ocount >= 0 %START;            !data or not continuation(z)
again:%WHILE sym type = 0 %CYCLE;                !skip redundant terminators
         c = cont
         cont = ' ';  cont = '+' %IF ocount >= 0
         read sym
         cont = c
      %REPEAT
      ->skip %IF sym = '!';                      !comment
      this = -1
      code atom(0)
      %IF atom1 = comment %START
skip:    quote = 1
         c = cont
         read sym %AND cont = c %WHILE sym # nl; !skip to end of line
         quote = 0;  symtype = 0
         ->again
      %FINISH
   %FINISH
   decl = 0;  mark = 0
   gentype = 0;  force = 0
   dim = 0;  prot err = 0
   node = 0;  nmax = 0;  nmin = rec size+1
   order = 1;  gmin = max grammar+1
   sstype = 0 %AND ->more %IF gg # 0;            !continuation
   ptype = 0;  spec given = 0

   stats = stats+1;  op('O', lines) %IF perm = 0

   ->fail1 %IF atom1&error # 0;                  !first atom faulty

   %IF escape class # 0 %START;                  !enter the hard way after
      g = imp phrase;  sstype = -1;  ->a3
   %FINISH

   g = initial(atom1);                           !pick up entry point
   %IF g = 0 %START;                             !invalid first atom
      g = initial(0);  sstype = 0;  ->a3;        !declarator?
   %FINISH
   %IF g < 0 %START;                             !phrase imp
      g = g&255
      nmax = 1
      ar(1)_class = 0;  ar(1)_link = 0;  ar(1)_sub = imp phrase
   %FINISH

   gg = gram(g);  class = gg&255;  sstype = gg>>12&3-1
   ->a1

act(194): ptype = type;  papp = app;  pformat = format;  ->more
act(196):k =g+1;  ->a610
act(188):k = ar(nmax)_sub+1
a610:     papp = glink(k)
          k = gram(k)
          ->more %IF k = 0;                        !%NAME
          ptype = k&7;  pformat = k>>3
act(183):k = type;  gentype = k %IF gentype = 0 %OR k = real
          %IF pformat < 0 %START;                  !general type
             app = papp;  format = pformat
             k = real %IF ptype = real %AND type = integer
             k = force %AND force = 0 %IF force # 0
          %FINISH
          ->fail2 %UNLESS papp = app %AND (ptype = k %OR ptype = 0)
          ->more %IF pformat=format %OR pformat = 0 %OR format = 0
          ->fail2
act(197):arp == ar(nmin)
         k = arp_sub
         ->fail3 %UNLESS block form = k&15
         arp_sub = k>>4

         type = block type
         ptype = block type;  pformat = block fm;  papp = app
         pformat = -1 %IF ptype # record
         ->more
act(195):->Fail2 %if Type # 0 %and Type # Integer %and
                                   Type # Real
         arp == ar(nmin)
         k = arp_sub
         arp_sub = k>>2
         k = k&3
                                                      !1 = check integer
                                                      !2 = check real
                                                      !3 = check real + int
          ->more %IF k = 0;                           !0 = no action
          %IF k = 1 %START
             force = integer
             ->more %IF type = integer %OR type = 0
             ->fail2
          %FINISH
          ->fail2 %UNLESS ptype = real %or ptype = 0  {or added?}
          force = integer %IF k = 3
          ->more
act(198):!%OTHER
         k = gg>>8&15
         %IF k = 0 %START;                    !restore atom
            atom1 = last1
            ->more
         %FINISH
         %IF k = 1 %START;                    !test string
            ->fail2 %UNLESS type = stringv
            ->more
         %FINISH
         %if k = 2 %start                     {fault record comparisons}
            ->fail2 %if type = record
            ->more
         %finish
         %if k = 3 %start;                    !check OWN variable coming
            code atom(0)
            ->A7 %if atom flags&own bit = 0
            ->more
         %finish
         for warn = pos1 %IF x <= local;      !%FORTEST
         ->more
paction(1):%IF type = record %THEN g = phrase(242) %ELSE pformat = -1
                                               ->a3
paction(2):ptype = real;     pformat = -1;     ->a3
paction(3):ptype = stringv;  pformat = -1;     ->a3
paction(4):ptype = integer;  pformat = -1;     ->a3
paction(5):->a3 %if ptype = integer
           g = phrase(212) %AND pformat=-1 %IF ptype = real
           g = phrase(213) %IF ptype = stringv
           ->a3
paction(6):ptype = gram(ar(nmax)_sub+1)&7;  pformat = -1;  ->a3
paction(7):ptype=real %IF ptype = integer;  pformat = -1;  ->a3

a1:   last1 = class;  atom1 = 0;  s = subatom

a2:   %IF gg&trans bit = 0 %START;                !insert into analysis record
         z == node
         %CYCLE;                                  !insert cell in order
            k = z
            %EXIT %IF gg&order bits = 0 %OR k = 0
            gg = gg-order bit;  z == ar(k)_link
         %REPEAT
         gg = map gg %IF map gg # 0 %AND gg&255 = var
         nmin = nmin-1;  ->fail0 %IF nmin = nmax
         z = nmin
         arp == ar(nmin)
         arp_sub = s;  arp_class = (gg&255)!mark
         arp_link = k
      %FINISH
      mark = 0;  map gg = 0

more: g = glink(g);                               !chain down the grammar

paction(0):
a3:   gg = gram(g);  class = gg&255
      trace analysis %IF diag&1 # 0
      ->a5 %IF class = 0;                         !end of phrase

      %IF class < actions %START;                 !not a phrase or an action
         class = atomic(class) %IF class >= figurative
         ->a2 %IF class >= manifest
         code atom(class) %IF atom1 = 0
         %IF escape class # 0 %START;             !escape to new grammar
            class = escape class;  escape class = 0
            g = g+escape

            !note that following an escape the next item is
            !forced to be transparent!

esc:        gg = 0
            arp == ar(nmax+1)
            arp_papp = papp;  arp_x = x;  ->a4
         %FINISH

         ->a1 %IF class = atom1 %OR class = atom2

a7:      ->fail1 %IF gg >= 0;                     !no alternative
         g = g+1
         ->a3
      %FINISH

      %IF class >= phrasal %START;                !a phrase
a4:      nmax = nmax+1;  ->fail0 %IF nmax = nmin
         arp == ar(nmax)
         arp_ptype = ptype
         arp_pos = pos1
         arp_pformat = pformat
         arp_link = gentype
         arp_class = node
         arp_sub = g
         node = 0
         g = phrase(class)
         ptype = force %AND force = 0 %IF force # 0
         gentype = 0
         ->paction(gg>>8&15)
      %FINISH

      ->act(class);                               !only actions left

a5:   !reverse links

      s = 0
      %WHILE node # 0 %CYCLE
         z == ar(node)_link
         k = z;  z = s;  s = node;  node = k
      %REPEAT
      ss = s

a6:   %IF nmax # 0 %START
         k = gentype;                             !type of phrase
         arp == ar(nmax);  nmax = nmax-1
         node = arp_class
         gentype = arp_link
         ptype = arp_ptype
         pformat = arp_pformat
         g = arp_sub
         %IF g&escape # 0 %START
            g = g-escape
            papp = arp_papp
            mark = 255
            subatom = s
            ->a3
         %FINISH
         gentype = k %IF gentype = 0 %OR k = real
         type = gen type

         k = gg;                                  !exit-point code
         %CYCLE
            gg = gram(g)
            ->a2 %IF k = 0
            ->fail1 %IF gg >= 0;                  !no alternative phrase
            k = k-order bit
            g = g+1;                              !sideways step
         %REPEAT

      %FINISH

      Fault(4)  %IF copy # 0
      fault(13) %IF order = 0
      fault(-4) %IF for warn # 0
      pos1 = 0
      fault rate = fault rate-1
      %RETURN

act(193):gg = 0 %AND ->a5 %UNLESS sym = '=' %or sym = '<';  !cdummy
act(181):atom1 = amap(decl&15);                             !dummy
         ->more

act(182):class = escdec;  g = glink(g)!escape
         decl = 0;  otype = 0;  ->esc;                      !decl

act(199):                                                   !compile

         s = 0
         %WHILE node # 0 %CYCLE
            z == ar(node)_link
            k = z;  z = s;  s = node;  node = k
         %repeat
         ss = s

         code atom(28) %IF quote # 0;                       !expend
         compile;  ->more %IF atom1&error = 0
         ->fail1

act(184):->fail4 %UNLESS type = integer
         %IF subatom < 0 %THEN lit = tag(-subatom)_format %C
                         %ELSE lit = lit pool(subatom)
         ->fail4 %IF lit # 0
         ->more
act(185):                                                   !apply parameters
         s = 0
         %WHILE node # 0 %CYCLE
            z == ar(node)_link
            k = z;  z = s;  s = node;  node = k
         %REPEAT
         ss = s

         atom1 = ar(s)_class;  atom2 = 0
         atom1 = var %IF atom1 = 97 %OR atom1 = 98
         arp == ar(nmax)
         x = arp_x
         pos1 = arp_pos
         pos2 = 0
         app = 0
         format = tag(x)_format
         flags = tag(x)_flags
         type = flags>>4&7
         protection = flags&prot
         protection = 0 %IF flags&aname # 0

         %IF flags&subname # 0 %AND format # 0 %START
            ->fail1 %if format selected = 0
         %FINISH

         ->a6

act(187):protection = prot;  ->more;            !%SETPROT
act(186):->More %if protection&prot = 0
         prot err = nmin
         ->A7
act(191):k = protection;                        !%GUARD
         code atom(0)
         protection = k %IF atom flags&aname = 0
         ->more

act(192):->fail1 %IF parsed machine code=0
         ->more

act(189):k = gapp;                              !%GAPP
         delete names(1)
         tmax = tbase;  tbase = gram (gmin);    !restore tmax
         local= tbase
         gmin = gmin+1

         x = ar(ar(nmax)_class)_sub
         tag(x)_app = k;                        !update app
         ->more

act(190):gmin = gmin-1;                         !%LOCAL
         abandon(2) %IF gmin <= gmax
         gram (gmin) = tbase;  tbase = tmax
         local = tbase
         ->more

! errors

fail4:k = error+10;            ->failed;        !*size
fail3:k = error+7;             ->failed;        !*context
fail2:k = error+5;  pos2 = 0;  ->failed;        !*type
fail0:k = error+3;             ->failed;        !*too complex
fail1:k = atom1;    pos2 = 0

failed:
      %IF diag&32 # 0 %START
         printstring("Atom1 =");       write(atom1, 3)
         printstring("  Atom2 =");     write(atom2, 3)
         printstring("  subatom =");   write(subatom, 3);  newline
         printstring("Type =");        write(type, 1)
         printstring("   Ptype =");    write(ptype, 1);    newline
         printstring("App =");         write(app, 1)
         printstring("   Papp =");     write(papp, 1);     newline
         printstring("Format =");      write(format, 1)
         printstring("   Pformat =");  write(pformat, 1);  newline
         %SIGNAL 13,15
       %FINISH

       quote = 0 %AND readsym %WHILE sym # nl %AND sym # ';'
       %IF k&error # 0 %START
          fault(k&255)
       %FINISH %ELSE %START
         %IF prot err = nmin %THEN fault(14) %ELSE fault(0)
       %FINISH
       gg = 0;  ss = 0;  symtype = 0
   %END;                                               !of analyse

   %ROUTINE compile

      %CONSTINTEGER then = 4, else = 8, loop = 16

      %SWITCH c(0:actions), litop(1:12)

      %CONSTBYTEINTEGERARRAY operator(1:14) = %C
                         '[',  ']',  'X',  '/', '&',  '!',  '%',  '+',
                         '-',  '*',  'Q',  'x', '.',  'v'

      %CONSTBYTEINTEGERARRAY cc(0 : 7) = '#','=',')','<','(','>', 'k','t'

      %CONSTBYTEINTEGERARRAY anyform(0:15) = 1,0,1,1(4),1,0,1,1,0,1,1,1,1

      %CONSTSHORTINTEGERARRAY decmap(0:15) = %C
         1,             2,
         x'100B',       x'100D',       x'140C',      x'140E',
         3,             4,
         x'1007',       x'1008',       x'1009',      x'100A',
         6,             0,             0,            0
      %OWNBYTEINTEGERARRAY cnest(0:15)
      %INTEGER lmode, clab, dupid
      %INTEGER resln
      %OWNINTEGER last def = 0
      %OWNINTEGER lb, ub
      %INTEGER cp, ord
      %INTEGER next, link, j, k, n, done
      %INTEGER class
      %INTEGER lit2, defs, decs, cident
      %INTEGER pending;  %OWNINTEGERARRAY pstack(1:40)
      %OWNSTRING(8) name = ""
      %OWNINTEGER count = 0

      %ROUTINE def lab(%INTEGER l)
         op(':', l)
         access = 1
      %END

      %ROUTINE get next
         %RECORD(arfm)%NAME p
gn:      %IF next = 0 %START;                        !end of phrase
            class = 0 %AND %RETURN %IF link = 0;     !end of statement
            p == ar(link)
            next = p_link
            link = p_sub
         %FINISH
         %CYCLE
            p == ar(next)
            x = p_sub
            class = p_class
            %EXIT %IF class < actions;               !an atom
            %IF x = 0 %START;                        !null phrase
               next = p_link;  ->gn
            %FINISH
            %IF p_link # 0 %START;                   !follow a phrase
               p_sub = link;  link = next
            %FINISH
            next = x
         %REPEAT
         next = p_link
         %IF diag&2 # 0 %START
            spaces(8-length(name)) %UNLESS name = ""
            name = text(class)
            write(x, 2)
            space
            printstring(name)
            space
            count = count-1
            %IF count <= 0 %START
               count = 5
               name = ""
               newline
            %FINISH
         %FINISH
      %END

      %ROUTINE set subs(%INTEGER n)

         !update the app field in n array descriptors

         %INTEGER p
         p = tmax
         %WHILE n > 0 %CYCLE
            %SIGNAL 15,15 %IF p < tbase
            tag(p)_app = dimension
            p = p-1;  n = n-1
         %REPEAT
      %END

      %ROUTINE set bp

         !define a constant bound pair from the last stacked constants

         pending = pending-2
         lb = pstack(pending+1);  ub = pstack(pending+2)
         %IF ub-lb+1 < 0 %START
            pos1 = 0;  next = link;  fault(11)
            ub = lb
         %FINISH
         set const(lb);  set const(ub)
         bp=bp+1 %AND buff(bp)='b' %UNLESS class = 146
      %END

      %ROUTINE compile end(%INTEGER type)

         ! type = 0:eof, 1:eop, 2:end

         %IF access # 0 %START
            open = 0
            fault(19) %IF block form > proc;           !can reach end
         %FINISH

         %WHILE dict(dmin) >= 0 %CYCLE;                !finishes & repeats
            fault(17+dict(dmin)&1)
            dmin = dmin+1
         %REPEAT
         {delete names(0)}
         bp=bp+1 %AND buff(bp)=';'
         bp=bp+1 %AND buff(bp)=';' %IF type = 1;       !endofprogram

         bflags = bflags!open;                         !show if it returns

         def lab(0) %IF block tag # 0 %AND level # 1;  !for jump around
         %IF type # 2 %START;                          !eop, eof
            fault(16) %IF level # type;                !end missing
         %FINISH %ELSE %START
            %IF level = 0 %START
               fault(15);                              !spurious end
            %FINISH
         %FINISH

         end mark = 11;               !******Mouses specific******
      %END

      %ROUTINE def(%INTEGER p)

         !dump a descriptor

         %INTEGER t, f, type
         %RECORD(tagfm)%NAME v
         flush buffer %if bp # 0
         defs = defs+1
         v == tag(p)
         t = 0
         %UNLESS v_index < 0 %START;                   !no index for subnames
            id = id+1 %AND v_index = id %IF v_index = 0
            last def = v_index
            t = last def
         %FINISH
         op('$', t)
         print ident(p, 1);                            !output the name
         t = v_flags
         type = t
         type = type&(\(7<<4)) %IF type&(7<<4) >= 6<<4;!routine & pred
         op(',', type&b'1111111');             !type & form
         f = v_format
         f = tag(f)_index %IF t&x'70' = record<<4
         f = v_index %IF f < 0
         op(',', f);               !format
         f = otype+t>>4&b'1111000'
         f = f!8 %IF class = 125;              !add spec from %DUP
         dim = v_app;                          !dimension
         dim = 0 %unless 0 < dim <= dim limit
         op(',', f+dim<<8);                    !otype & spec & prot
         defs = 0 %IF t&parameters = 0
         f = t&15
         %IF v_flags&spec # 0 %START
            v_flags = v_flags&(\spec) %UNLESS 3 <= f <= 10
            ocount = -1;                       !external specs have no constants
         %FINISH
         dimension = 0
         %if otype = 2 %and (f=2 %or f=12 %or f=14) %start
            v_flags = v_flags-1;               !convert to simple
         %finish
      %END

      %ROUTINE def s lab(%INTEGER n)

         !define a switch label, x defines the switch tag

         %INTEGER p, l, b, w, bit
         p = tag(x)_format;                               !pointer to table
         l = dict(p);                                     !lower bound
         %IF l <= n <= dict(p+1) %START
            b = n-l
            w = b>>4+p
            bit = 1<<(b&15)
            %IF dict(w+2)&bit # 0 %START;                 !already set
               fault(4) %IF pending # 0
               %RETURN
            %FINISH
            dict(w+2) <- dict(w+2)!bit %IF pending # 0
            set const(n)
            op('_', tag(x)_index)   
         %FINISH %ELSE %START
            fault(12)
         %FINISH
         access = 1
      %END

      %ROUTINE call
         %RECORD(tagfm)%NAME T
         t == tag(x)
         op('@', t_index)
         access = 0 %IF t_flags&closed # 0;                !never comes back
         bp=bp+1 %AND buff(bp)='E' %IF t_app = 0;          !no parameters
      %END

      %ROUTINE pop def
         set const(pstack(pending));  pending = pending-1
      %END

      %ROUTINE pop lit
         %IF pending = 0 %THEN lit = 0 %ELSE %START
            lit = pstack(pending);  pending = pending-1
         %FINISH
      %END


      %IF sstype < 0 %START;                       !executable statement
         %IF level = 0 %START;                     !outermost level
            fault(13);                             !*order
         %FINISH %ELSE %START
            %IF access = 0 %START
               access = 1;  fault(-1);             !only a warning
            %FINISH
         %FINISH
      %FINISH

      %IF diag&2 # 0 %START
         newline %IF sym # nl
         printstring("ss =")
         write(ss, 1)
         newline
         count = 5
         name = ""
      %FINISH

      next = ss
      pending = 0;  lmode = 0
      link = 0;  decs = 0
      defs = 0;  resln = 0;  done = 0
      ord = level
      ord = 1 %IF this >= 0;                       !recordformat declarations
c(0):
top:  %IF next # link %START
         get next;  ->c(class)
      %FINISH

      !all done, tidy up declarations and jumps

      newline %IF diag&2 # 0 %AND count # 5

      %IF lmode&(loop!then!else) # 0 %START;       !pending labels and jumps
         op('B', label-1) %IF lmode&loop # 0;      !repeat
         def lab(label)   %IF lmode&then # 0;      !entry from then
         def lab(label-1) %IF lmode&else # 0;      !entry from else
      %FINISH

      %RETURN %IF decs = 0
      atom1 = error %AND %RETURN %IF atom1 # 0;    !%INTEGERROUTINE
      order = ord
      decl = decl&(\15)+decmap(decl&15);           !construct declarator flags
      atom1 = atoms(decl&15);                      !generate class
      %IF otype # 0 %START;                        !own, const etc.
         atom1 = atom1+1 %IF atom1 # proc
         %IF otype = 2 %START;                     !const
            n = decl&15
            %if n&1 # 0 %start
               decl = decl!prot
               decl = decl!const bit %IF decl&b'1111111' = iform
            %finish
         %else
            decl = decl!own bit
         %FINISH
      %FINISH
      sstype = 1 %IF sstype = 0 %AND atom1 = proc
      atom1 = atom1+1 %IF decl&spec # 0;             !onto spec variant
      ocount = 0 %AND cont = '+' %IF atom1 = 5;      !own array
      %IF anyform(decl&15) = 0 %START;               !check meaningful
         %IF decl>>4&7 = record %START
            this = fdef %IF tag(fdef)_flags&spec # 0
            atom1 = error+21 %IF fdef = this;        !*context for format
         %FINISH
         atom1 = error+10 %IF fdef = 0;              !*size
      %FINISH
      %RETURN

atop:   access = 0;  ->top

! declarators

c(88):                                                !rtype
c(28): decl = x&(\7);                                 !stype
       fdef = x&7;                                    !precision
       fdef = reals ln %IF x&b'1110001' = real<<4+1;  !convert to long
       decs = 1;  ->top
c(34):                                                !own
c(35): otype = x;  ord = 1;  ->top;                   !external
c(152):decl = decl+x<<1;  ->top;                      !xname
c(31):                                                !proc
c(32): spec mode = level+1;                           !fn/map
       decl = decl!prot %IF x = 9;                    !function
c(29): ord = 1;                                       !array
       dim = 0
c(30): decl = decl+x;                                 !name
       decs = 1
       ->top
c(27): lit = 0;                                       ! arrayd
       %IF pending # 0 %START
          pop lit
          %UNLESS 0<lit<=dim limit %START
             atom1 = error + 11;  %RETURN
          %FINISH
       %FINISH
       dim = lit
       decl = decl + x;  decs = 1
       -> top
c(37): x = x!subname;                                 !record
c(36): lit = 0;                                       !string
       %IF pending # 0 %START
         pop lit
          %UNLESS 0 < lit <= 255 %START;              !max length wrong
             atom1 = error+10;  %RETURN
          %FINISH
       %FINISH
       fdef = lit;                                    !format or length
c(33): decl = x;                                      !switch
       decs = 1
       ->top
c(39): decl = decl!spec;                              !spec
       ocount = -1;                                   !no initialisation
       spec mode = -1
       ->top
c(38): decl = 64+4;                                   !recordformat (spec)
       order = 1
       atom1 = x
       decl = decl!spec %if atom1 = 12;               !formatspec
       fdef = tmax+1;                                 !format tag
       %return
c(175):id = id+1;  tag(x)_index = id;  %return;       !FSID
c(41): decs = 1;  decl = x!spec!closed;  ->top;       !label
c(133):recid = 0;  rbase = tmin-1;                    !fname
       this = x
       fm base = fdef;  format list = tmin
       def(this);                      ->top
c(148):fdef = 0 %AND ->top %IF next = 0;              !reclb
       get next;                                      !skip name
       fdef = x
       ->top
c(127):bp=bp+1 %AND buff(bp)='}';  ->top;             !%POUT
c(126):bp=bp+1 %AND buff(bp)='{';  ->top;             !%PIN

c(174):set bp;                                        !rangerb
c(171):                                               !fmlb
c(172):                                               !fmrb
c(173):bp=bp+1 %AND buff(bp)='~';  bp=bp+1 %AND buff(bp)=class-171+'A';  ->top;         !fmor
c(168):rbase = -rbase;                                !orrb
       sstype = 0;  spec mode = 0

c(147):search base = 0;                               !recrb
       tag(this)_app = tmin
       tag(this)_format = rbase
       ->top

c(45):bp=bp+1 %and buff(bp)='U' %IF x = 36;  ->top;   !sign
c(46):bp=bp+1;  buff(bp)='\';  ->top;                 !uop
c(47):                                                !mod
c(48):                                                !dot
c(42):                                                !op1
c(43):                                                !op2
c(44):bp=bp+1;  buff(bp)=operator(x);  ->top;         !op3

!conditions & jumps

      %ROUTINE push(%INTEGER x)
         %IF cnest(cp)&2 # x %START
            cnest(cp) = cnest(cp)!1;  x = x+4
         %FINISH
         clab = clab+1 %IF cnest(cp)&1 # 0
         cnest(cp+1) = x;  cp = cp+1
      %END

      %ROUTINE pop label(%INTEGER mode)
         lmode = dict(dmin)
         %IF lmode < 0 %OR lmode&1 # mode %START
            fault(mode+8)
         %FINISH %ELSE %START
            dmin = dmin+1;  label = label-3
         %FINISH
      %END

c(56):                                         !and
c(57):push(x);  ->top;                         !or
c(58):cnest(cp) = cnest(cp)!!2;  ->top;        !not

c(138):x = 128+32+16+4;                        !csep: treat like %WHILE
c(59):                                         !while
c(60):%IF class = 138 %THEN op('f', label-1) %C
                      %ELSE def lab(label-1);  !until
c(166):                                        !runtil
c(62):lmode = (lmode&(else!loop)) !(x>>3);     !cword
      clab = label;  cp = 1;  cnest(1) = x&7
      ->top
c(72):pop label(0);                            !repeat
      def lab(label+1) %IF lmode&32 # 0;  ->atop
c(69):pop label(1);               ->top;       !finish
c(163):                                        !xelse
c(70):pop label(1);                            !finish else ...
      fault(7) %IF lmode&3 = 3;                !dangling else
c(68):lmode = (lmode&else)!3;                  !...else...
      %IF access # 0 %START
         op('F', label-1);  lmode = else!3
      %FINISH
      def lab(label)
      ->top %IF next # 0

c(120):                                        !%MSTART
c(67):                                         !start
c(71):                                         !cycle
stcy: def lab(label-1) %AND lmode = loop %IF lmode = 0;!cycle
      dmin = dmin-1;  abandon(3) %IF dmin <= dmax
      dict(dmin) = lmode
      label = label+3
      %RETURN

c(64):fault(13) %IF dict(dmin) >= 0 %OR inhibit # 0;  !on event
      inhibit = 1
      n = 0
      n = x'FFFF' %IF pending = 0;             !* = all events
      %WHILE pending > 0 %CYCLE
         pop lit;  fault(10) %IF lit&(\15) # 0;!too big
         j = 1<<lit
         dubious = 1 %IF n&j # 0
         n = n!j;                              !construct bit mask
      %REPEAT
      op('o', n);  op(',', label)
      lmode = then!1;  ->stcy


c(104):op('J', tag(x)_index);                   !l
       inhibit = 1;            ->atop
c(149):stats = stats-1;                         !lab
       access = 1;  inhibit = 1
       op('L', tag(x)_index);  ->top

c(63):j = dmin;  l = label-3;                   !exit, continue
      %CYCLE
         fault(7) %AND ->top %IF dict(j) < 0
         %EXIT %IF dict(j)&1 = 0
         j = j+1;  l = l-3
      %REPEAT
      l = l+1 %IF x = 32;                       !continue
      op('F', l)
      dict(j) = dict(j)!x;                      !show given
      ->atop

c(50):bp=bp+1 %AND buff(bp)='C';  ->cop;        !acomp

c(49): bp = bp+1
       %IF next # 0 %START;                     !comparator
          buff(bp)='"';  push(0);               !double sided
       %FINISH %ELSE %START
          buff(bp)='?'
       %FINISH

cop:   x = x!!1 %IF cnest(cp)&2 # 0;            !invert the condition
       j = cp;  l = clab
       %WHILE cnest(j)&4 = 0 %CYCLE
          j = j-1;  l = l-cnest(j)&1
       %REPEAT
       op(cc(x), l)
       def lab(clab+1) %IF cnest(cp)&1 # 0
       cp = cp-1
       clab = clab-cnest(cp)&1
       ->top

c(78):                                              !fresult
c(79):                                              !mresult
c(80):   open = 0;                                  !return, true, false
c(82):   access = 0;                                !stop
c(89):                                              !addop
c(81):   bp=bp+1 %AND buff(bp)=x;  ->top;           !monitor

c(65):   pop lit;  op('e', lit);  ->atop;           !signal

c(51):   bp=bp+1 %AND buff(bp)='S';  ->top;         !eq
c(53):   bp=bp+1 %AND buff(bp)='j';  ->top;         !jam transfer
c(52):   bp=bp+1 %AND buff(bp)='Z';  ->top;         !eqeq

c(74):%IF level = 0 %START;                         !begin
         %IF progmode <= 0 %THEN progmode = 1 %ELSE fault(7)
         {Permit BEGIN after external defs}
      %FINISH
      spec mode = level+1
      block x = 0
      bp=bp+1 %AND buff(bp)='H';  %RETURN
c(77):perm = 0;  lines = 0;  stats = 0;             !endofperm
      close input
      select input(source)
      list = list-1
      tbase = tmax;  tstart = tmax
      %RETURN
c(76):%IF include # 0 %AND x = 0 %START;            !end of ...
         lines = include;  sstype =  0;             !include
         close input
         list = include list
         include level = 0
         include = 0;  select input(source);  %RETURN
      %FINISH
      ss = -1;                                      !prog/file
c(75):compile end(x);  %RETURN;                     !%END

c(85):%IF x=0 %THEN control=lit %ELSE %START;       !control
         diag = lit&x'3FFF' %IF lit>>14&3 = 1
      %FINISH
      op('z'-x, lit)
      ->top
c(83):list = list+x-2;   ->top;                     !%LIST/%ENDOFLIST
c(84):reals ln = x;      ->top;                     !%REALS long/normal
c(86):%IF include # 0 %START;                       !include "file"
         fault(7);  %RETURN
      %FINISH
      get next;                                     !sconst
      include file = string(x-x'4000'+stbase)
      %begin
         %on 9 %start;  Abandon(9);  %finish
         open input(3, include file)
      %end
      include = lines;  lines = 0
      include list = list;  include level = level
      select input(3)
      ->top

c(154):dimension = dimension+1;                     !dbsep
       fault(11) %IF dimension = dim limit+1
       ->top
c(145):set bp;                       ->top;         !crb
c(146):set bp;                                      !rcrb
c(142):                                             !bplrb
       dimension = 1 %IF dimension = 0
       op('d', dimension);  op(',', defs)
       %IF class # 146 %START
          set subs(defs)
          fault(13) %IF dict(dmin) >= 0 %OR inhibit # 0 %OR level=0
       %FINISH
       dimension = 0;  defs = 0
       ->top
c(128):id = dupid;  ->top;                          !EDUP
c(130):block x = x
       op('F', 0) %IF decl&spec = 0 %AND level # 0; !jump round proc
c(125):dupid = id;                                  !%DUP
       %return %if Level < 0                        {spec about}
c(90): def(x);  ->top;                              !ident
c(131):                                             !cident
       %IF tag(x)_flags&(b'1111111'+const bit) = iform+const bit %START
          tag(x)_format = lit
       %FINISH %ELSE %START
          set const(lit) %IF pending # 0
          def(x)
         op('A', 1)
       %FINISH
       cident = x
       ->top
c(124):dubious = 1 %IF tag(cident)_flags&prot # 0; !%DUBIOUS
       ->top
c(97):                                              !f
c(98):                                              !m
c(99):                                              !p
c(96): call;  ->top;                                !r

c(165):                                             !nlab
c(100):                                             !rp
c(101):                                             !fp
c(102):                                             !mp
c(103):                                             !pp
c(91):                                              !v
c(92):                                              !n
c(106):                                             !a
c(107):                                             !an
c(108):                                             !na
c(109):                                             !nan
      k = tag(x)_index
      %IF k < 0 %THEN op('n', -k) %ELSE op('@', k)
      ->top
c(121):set const(0);  ->top;                        !special for zero
c(167):bp=bp+1;  buff(bp)='G';  ->pstr;             !aconst (alias)
c(const):                                           !const
       %IF x < 0 %START;                            !constinteger
          set const(tag(-x)_format);  ->top
       %FINISH
       %IF x&x'4000' # 0 %START;                    !strings
          bp=bp+1 %AND buff(bp)=''''
pstr:     x = x-x'4000'+stbase
          k = byteinteger(x)
          bp=bp+1 %AND buff(bp)=k
          k = k+x
          %CYCLE
             ->top %IF x = k
             x = x+1;  bp=bp+1 %AND buff(bp)=byteinteger(x)
          %REPEAT
       %FINISH
       %IF x&x'2000' # 0 %START;                    !real
          x = x-x'2000'+stbase
          k = byteinteger(x)
          op('D', k);  bp=bp+1 %AND buff(bp)=','
          k = k+x
          %CYCLE
             ->top %IF x = k
             x = x+1;  j = byteinteger(x)
             %IF j = '@' %START
                op('@', litpool(byteinteger(x+1)));  ->top
             %FINISH
             bp=bp+1 %AND buff(bp)=j
          %REPEAT
       %FINISH
       set const(lit pool(x))
       ->top

c(137):bp=bp+1 %AND buff(bp)='i';               ->top;         !asep
c(141):bp=bp+1 %AND buff(bp)='a';               ->top;         !arb

!own arrays

c(132):ocount = ub-lb+1
       def(x);                               !oident
       dimension = 1;  set subs(1)
       %IF next = 0 %START;                  !no initialisation
          op('A', ocount) %IF ocount > 0
          ocount = -1
       %FINISH %ELSE %START;                 !initialisation given
          get next
       %FINISH
       ->top
c(162):lit = ocount;  ->ins;                 !indef
c(143):pop lit;                              !orb
ins:   fault(10) %AND lit = 0 %IF lit < 0
       get next
       ->inst
c(139):                                      !osep (x=19)
c(153):lit = 1
inst:  pop def %IF pending # 0;              !ownt (x=0)
       op('A', lit)
       ocount = ocount-lit
       %IF ocount >= 0 %START
          ->top %IF x # 0;                          !more coming
          ocount = -1 %AND %RETURN %IF ocount = 0;  !all done
       %FINISH
       fault(11);  %RETURN

c(swit):op('W', tag(x)_index);  inhibit = 1;  ->atop
c(134):def(x);                               !swid
       n = ub-lb+1
       n = (n+15)>>4;                        !slots needed (includes zero)
       j = dmax;  dmax = dmax+n+2
       abandon(1) %IF dmax >= dmin
       tag(x)_format = j
       dict(j) = lb;  dict(j+1) = ub
       %CYCLE
          n = n-1
          ->top %IF n < 0
          j = j+1;  dict(j+1) = 0
       %REPEAT
c(151):stats = stats-1;                      !slab
       fault(7) %AND %RETURN %IF x < tbase
       %IF pending # 0 %START;               !explicit label
          def s lab(pstack(1))
       %FINISH %ELSE %START
          fault(4) %AND %RETURN %IF tag(x)_app # 0
          tag(x)_app = 1
          n = tag(x)_format
          %FOR j = dict(n), 1, dict(n+1) %CYCLE
             def s lab(j)
             flush buffer %IF bp >= 128
          %REPEAT
       %FINISH
       inhibit = 1
       %RETURN

c(140):bp=bp+1 %AND buff(bp)='p';                  ->top;          !psep
c(144):buff(bp+1)='p';  buff(bp+2)='E';  bp=bp+2;  ->top;          !prb

!constant expressions

c(155):                                      !pconst
       %IF x < 0 %THEN lit = tag(-x)_format %c
                 %ELSE lit = lit pool(x)
       pending = pending+1;     pstack(pending) = lit;  ->top
c(156):lit = pstack(pending);  lit = -lit %IF lit < 0
                                pstack(pending) = lit;  ->top;  !cmod
c(157):lit = -pstack(pending);  pstack(pending) = lit;  ->top;  !csign
c(158):lit = \pstack(pending);  pstack(pending) = lit;  ->top;  !cuop
c(159):                                      !cop1
c(160):                                      !cop2
c(161):pending = pending-1;                  !cop3
       lit2 = pstack(pending+1);  lit = pstack(pending)
       ->litop(x>>2)
litop(10):lit = lit*lit2;   ->setl
litop(12):
litop(3):n = 1;                              !lit = lit\\lit2
         fault(10) %IF lit2 < 0
         %WHILE lit2 > 0 %CYCLE
            lit2 = lit2-1
            n = n*lit
         %REPEAT
         lit = n;           ->setl
litop(1):lit = lit<<lit2;   ->setl
litop(2):lit = lit>>lit2;   ->setl
litop(5):lit = lit&lit2;    ->setl
litop(11):
litop(4):%IF lit2 = 0 %THEN fault(10) %ELSE lit = lit//lit2
                            ->setl
litop(8):lit = lit+lit2;    ->setl
litop(9):lit = lit-lit2;    ->setl
litop(6):lit = lit!lit2;    ->setl
litop(7):lit = lit!!lit2

setl: pstack(pending) = lit;  ->top

c(170):Fault(4) %if IMPCOM_Option # ""
       IMPCOM_Option = String(x-x'4000'+Stbase);      !Option string
       ->Top

!string resolution

c(135):resln = 2;                    ->top;           !dotl
c(136):resln = resln+1;              ->top;           !dotr
c(55): op('r', resln);    resln = 0; ->top;           !resop
c(164):op('r', resln+4);  resln = 0;                  !cresop
c(122):x = 6;                        ->cop;           !%PRED
c(87): set const(pstack(1));                          !mass
       bp=bp+1 %AND buff(bp)='P';    ->top
   %END

%END;                                                 !of compile block

   %ON 9 %START
      abandon(5)
   %FINISH

   list = 15 %IF Impcom_Flags&x'1000' # 0

   selectinput(2);  selectoutput(listing)
   tag(max tag) = 0;                       !%BEGIN defn
   tag(0) = 0;  tag(0)_flags = 7;          !%BEGIN tag!
   Hash(x) = 0 %FOR x = 0, 1, max names
   printstring("         Edinburgh IMP77 Compiler - Version ")
   printstring(version);  newlines(2)
   op('l', 0)
   compile block(0, 0, max dict, 0, 0)
   bp=bp+1 %AND buff(bp)=nl                {for bouncing off}
   flush buffer
   Impcom_Statements = stats
   Impcom_Statements = -faulty %IF faulty # 0
%ENDOFPROGRAM
 H?    )                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     ^ C!         ]ab }R  B          
  R      NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    :X%                    579;?ACEGIKMOQSUWY[]_a  BLOCK                                                                                    AAA  AAAA  AAA  ABAA                      	      1  ;;<'</=M==<5<<<<<<<<y<|=<>U=== ASS RH ASS LH   m                                                                                 ,,,,,,,,,,,,,-,--<LOAD 
	              +B++J+J+J+J+B+B+B+B+B+B+B    ,+G  (;(;''((@*#'1'''')(*       	&&[    &}&&&&&ADDRESS     	 	                                                        POP DROP POP LHSBOTH RHS BOTH LHS SET LHSSSET C stackS STACKV stack    0	                         @ @t               Block index A ZN{OO?N{    OOOhON{P  P|        Pe      P       ! GI:HCGGEHHGGQGGGQQQQQQQQQQK^QHHHI!EDJ+HEJF(K.EQNZKDGKSFE:CK~GGHQGGFIGQHVGGGNKIfQGDQL@KKpL@L9GHLHCKEtKH[H`I_KHH`GKtGKKPQPPQ   	  ) ? a   9     3   !               	 	      9  	 	 	                             2                         no RX3 formform?	) missingindex register?no double indexed form base register? displacement?register 2?comma missingregister 1?invalid offset unknown operation  :  ZCY]X\TV[WzjJQ
yiIU	BC5B%BBBEB%C5}mM|lLxhHFD{kKPGe*:&adw)9EA3C#CC%CCB5CCCEC%B5#B3-=/.,<%(8$srBu+;'    p`@gv  ft"##3C#3 !4?>~q^_               A   B   C   D   L   M   N   O   S   X        	                                      D  E  H  R          A  B  D  E  H  I  M  R                                    I  S        H  I  R    R  I M L   ! !R "I #B #H #I #R 0 0 1 1 1 1 3 3E 3R 3 3 3 3 3 3 3 3 4R 5C 6H 6 Q QR RR sR vR  R R Г   R  I L    I I      ! !R " "I #A $ $ $ $ %B %D %E %H %M % 0 0 0 1R 2R 3L 4 5L P RI ` aR bR IIRapppqRRPPQERRR5<RHHAHLHSI2AI2LI3SIPISISBL<rBL<vME%R4SRLSU4E            #0!0!! # #                                    A             -->lineGA CA  defnEN r refN p refN sw ref j reff c reff                         
            	CHEAPENED) =*opt list empty   	    Numerical constant too big Illegal constant exponentNo. of shifts outwith 0..31String constant too long !Invalid parameter for READ SYMBOLNon-local control variable?Illegal FORdivision by zero :  *WARNING: line   oxUSING: STACK: Please seek assistance!! 	' at line*Compiler error '
         +                      x                                      P            <                                                                                  XH  $ % P PS@Q        P
 ZJ  & '  [K  ' & P\SP]S	YI TD   VF   WG                      ( h8 x( `S  pS* j: z+ k; {, l< |- m= })i9yUE C  A PPP/ .  PrPqPPLQLQsQatu         |   	!#(-2070=uC
GKOSW[dfghikl_ino
opqpvxz{         (   $%&                            	
            	
 
               
#READSYMFN $TRACE $%GO
   S"#$$A> $$#'!"C  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n ?&?$$A> $/ #-( $  ?,'"H  !34  1  0 !81 !5$$A> $@#0#D   D   &A'1"C H  !34  1  0 !81 !5$$A> B  @ !4B ";
C@ !$$A> #$$A> B  C
B$P#E  E  &Q'1"C A> 2#XC   PC   '4"2$ #PC   '4"?1  34C0  D   D   
C  g p ,$RHf W   T` :W   <$SX Hl W   T$RX9 c W   T$RX k W   T$SX j W   T$UXI Xd  W   T$SXi Hf W   T$SX Hl W   T$SX9 Hc W   T$SX Hk 
W   T$SX j W   TXI T UC06$Rd W   TW  ,0W   HXi Xf A#W  ,y  	g p 8$`W   lW   H  'P 0X9 <  cW   <X 0B0W   H$QXmTW   TW  ,W   HW  ,X\C0FW   HW  ,X\P 4$@PI 0#&API 0BZH LXd  AXI 0UI 4 >XX dC0>W   HW  ,Xh dPi ,X ,Xl  AX9 ,X P ,!2#"$bW   l$ $A 	g p ,$`W   lW   H$QXmTW   TW   HX 
sL

W   HC zW   HC hW   HC VfW   HC DLW   HC 20W   HC  W   H#	W   H#W  ,$bW   ly  	g ) ,Ap <$`W   l ,W   H` :W   <$i ,lW   Xi A*$bW   ly  5	g p ,H  ! !<6 3#<X H ɠ !%y 0 !%"$"	 %	g p ,X  !<6 3!8Ӷ #8Ű #5$y Ӧ #3$"%"
 !	g p , !56 3#5$y H ɰ ##$"	%" 	W  p 4H P ,#8Z ,s< P9 ,H P 0#8Z ,s P 0XI ,#6X 0#7	#XI 0PI ,D#%y `Rec0A0 6	g p 4$P 0$0&1P9 ,X 0
P 0Y !U !5y %"0 B0%"
 %	W  p ,X  U  B0<6 ӵ ;B0.H E B0"F e F!<X H< E5 !5%y $" -	g p ,  !;6 2Z=X  ɰ #%$y %" 	w p 0XUB0<X=`&30P9 ,&4P=`XŰ <!6X ,y &P
Z tX ,@  &P
Z ts  C  5	w p 4X P ,W   P 0W   P X9 ,8V 0y  "	w p @$P 4/` $P 4/` <AP 4W   P h ` 8+` X8 P8 W   P X Ű .!3C H%Q 4Ű @!3C Ű _!3C ɰ A!'P h l 8K/d*` XY 4!3C C hI <`I ,%aQi 4X 4!3C zX8 P8 W   P X Ű @!3C ,ɰ A!'P h) ,m) 8`) ,ȫ/
,j ` C AP 4   #6  P 4h) 8A l ` XH @ U!=W   P +k ` y  	g p ,` #&`REL1Af#7bZmX  #y X9 2Z=X ZX  'P  XI BZMXT  #`REL2A%aQm C  ;	g p ,` #&`CLM1Af#7bZmX  #y X9 2Z=X ZX  &P  $AQM C  .	g p ,X  %1Q9 ,Ӷ 
sK

XI 4@ B08Xi AfXY PW ,Xj H P 0$aA$1@9 LX XI 0@K C h`HAZ1AXZ Xe  !:Xi 0Pe  $ C 2X: ӳ &ҳ XI 0@C #XZ $de X 0P  H9 L@5 X K @ K z  p
g p \X ZX<  P9 ,!$y P9 4X P X Z$@PJ  AP 0$Q@Y LXi ` !` !$$W@Y LX dP 8X9 8!3C $X  ӫ U !4kAXI 8XT PY 8C Xh @i RX 0P <Ȱ@ Nȩ <P ,XY $bAi <AXI ,#6`HAZ2AC < s	w p 0%aAX #=$0&1P9 ,cAX9 ,0  :y  	w p 0$P 0 P=P$P%P$P(PPK&API ,P TZXXmPe   ZP@ xB0$0&1P9 ,4Z8,$P  X ,Z,P X9 ,0 B0y  N	w p 0$`W   lXP ,!?W   HW  ,C $QX9 ,c W   T$QX ,k W   T$SX ,Xj W   T` (W   <%QXI ,d W   TW   H$QXi ,Hf W   TW  ,X ,X<  P9 ,#3C d$bW   ly  w	W  p 4%Q[Y  PY  XP ,$0P9 0X ,C00X XI W  T  !8[ d V!2#P 0X  P ,C $y X 0#=X9 ,X  P  XP  P=XC  F	w p 8X#7X8(0 B\XP ,$P 0@ PI 4%QQY 4Xi ,X  !2#Pi 0P ,"X9 4#6`OPT1AX 0$P  XP  PmQX(XMPI ,XD  PM$QQX(Xh(` #&`Opt3AX) ,$5Ay  \	W  p 0P !4y $PAP ,!<A P ,XP  P#$aH1 c  AX ,X  @ XI T [ Xd  Pk H  4 ; $ҫ XI    V$P$[ RZ]Xe  !$;   P$C ^ [	W  p < P 4H6 P9 8$PAP ,!4y ӱ Ű !9X J @ J HQ !3C Xi 4` #8 U 8!3PX X9  #` !3C PY 0` B0Pӡ Š B0DŰ B0<XI d AXi 0AtXY Xi 0e $P  $4@5 XY  Xi A.C >ӡ U 8!3#3C @XI d AXi 0A&XY Xi 0e $P  $1@5 H&#Xi AH&à #3AC  	g p 0$SXi AP ,!4y   C  	g p 0X$!4y `Pi %T$P$X=P9 ,fC6X ,C0*$K   T #5@ K $P@[ X  P ,C C BXi ,C0:$6   T #50 6 $H   T #4$@ Xf  Pi ,C XMC02T P B0&PI ,XD  PMXi ,XP  Pm%1Q8(C X(#`Use?AtC  	w p 0XC02P ,%1Q8(X ,X  !2#P ,"XP  XP$PXH(#6`FallA$PPX$y  2	g p 4fC 0$&P 0Z,P ,X<  U9 !5y X 0 B0$"
 $	g p 0fB0"$QX=0 ##PXZ,P X XJ PI ,C0$XY ,Xe  #4Pi ,"XmPe  X Xl PmX9 $P P  P y  B	g p 0f!5$y X!6`EcopAP ,X  PX) ,$5AXf  AX9 ,P  C  ,	g p @XP <i 0A
P ,Xi AP ,!:$0P=P8$P8(C  Xa A`PX ,X P$XK PH(y  5	g p 0f!$y AZP ,aAP ,X P  X8$P1 X(P XmAX ,P C  +	g p 0XP ,X: ,C0X XJ U B0HS ET B0vc  lB0hӳ T B0Zc  lB0Lӳ T B0>Xi 4PF  PI 4X ,$1X ,HK 4  V< $Qk V  5P< $QQ\ z X3  P: ,C ZXj XP  PmC  h
g p PXi A:P ,C0VX P 0$P P P P <9 <P9 4X 0#=X  P 8kAXI 8PI 0"XY 4$`Pe  X ,X9 <P< y  >	w p 8X$P 4$0&1P9 0%Q X !4$P ZJ  PI ,BZMXT  !=$aX ,l  Ti 4!5y 0 B0X9 4!2#$0P9 4C $eA$C  C	w p 8X$P 4$0&1P9 ,%QX!4$PZ J  PI 0BZMXT  B0*Xi 0bZmX !>$3X 0;  T9 4!6 y X9 ,0 B0X 4!2#$P 4C $cA>$dA8$C  R	w p 4X$P 00 &1P9 ,%QXŠ !5Ƞ PZXJ  !6Xy 0 B0XY 0!2#$PPY 0C ` A C  <	g p ,hW   <i W   <y  	w p 0$mW   <X4#`DMP1AX=<P9 ,P<P=4y   	w p 0X4#&`DMP2AX=<P9 ,P<P=4$lW   <y   	g p 4$bW    'P ,X9 <  0 P9 00 	!&3 0P9 0#3 7P9 0cW   <X ,B0y  4	W  p ,$`W   l` *W   <%SXm4W   TX  Z(W   H$QXi W   TW  ,$bW   ly  =	W  p 0$`W   lX CA!=TW   HX=4P9 ,#PW   HX8P ,Xi ,'b%SW   T` :W   <Xi  AW  ,$bW   ly  K	g p ,$gW   <Xi hW   <i W   <$Q4H=&#XY `CAAy  +	g p ,$hW   <Xi hW   <i W   <$Q8H=&#XY `GAAy  +	g p ,` ABXi A:y  	g p ,%[4P4!=$1Q=4X0k
jA#Pm0%AQM4X]4#&`DMP3Ay  )	g p ,` A"si Ay  	g p ,` Asi A` W   <$Qy  	g p ,` Asi A` W   <$Qy  	g p ,%[<P<!=%1Q=8X8k
jAt#Pm8$AQM8y  !	g p ,X8T #5$`A"y  	g p 0$aW   l$aW   <Xi hW   <i W   <X4P ,lhW   <i /W   <$bW   lH=&#$QXi APy  F	W  p 0XTUX#3A@$aW   lXi  W   <Xi hW   <i W   <X=41P9 ,chW   <i /W   <$bW   lH&#XY  Xi AXi  W   <X  Š B0Xi hW   <i W   <y  k	W  p 0X4!X=@#&`DMP4ApX<ð #8AZ$`AA$[@Z Z  %A[I  $PZP]@P]<$`eaPi ,$nW   <Xi ,Ay  A	w p 0X4#y X=T[=X0 #5$:P9 ,#$9P9 ,$aW   lXi ,W   <X ,Ű 
!5XmTAzH&C4$`W   lHW   H$QXmTW   TW  ,$bW   lXi ,W   <XI ,@ 
!5XmTAX]TP]XXm4PmC 6 o	W  p DX ,<  0 #$$<<  cW   <X ,ӫ  P @$@PI 8C &API 8XY ,
Te  W   <XI 8UI @B0Xi #y X P 0X8 P9 40 #X ɰ !#!4$P 03!$$1P9 4'P <$P 8XH #8XX #5Ƞ P 8dW   <Xm@Zi <  V lVi 8W   <X=\Z9 ӳ   X   
P 8k` W   <Xi 8hW   <Xi 8W   <C   	W  p ,$Q=0 #$$Q$kW   <ȭP ,XY  Xi Apy  %	W  p 4` !` #&`DMP5Av` #5$Q#$1Q=` W   <Xi W   <Xi  #&a` A $P 0X Š !4$P 0XY ,#&QP MPG ,kAXY P B0$$`A$`A Xi ` !5$`A#%aAy  e	w p ,$aW   l` W   <XmaAh$[@laAZXm8aAPXmAHXmA@XmA8$`W   <W   $bW   l` W   <W   y  Q	W  p |X4P XX9 ,H P @ӣ P DC PI HXS  PY Lc Pi PX   !$=Q9 X9 
3Z=|H  P 4P 0XMXUMT#3AXY D#5P B0:Xi P#6`RXDxAX LB0fX9 HC0^X Ű C0RŰ C0JŰ C0BX  !5Ű C0&@9 r$@PI \$QY oi \Pg ,ZkAy @ PI 8C X9 0 B0`X  U HB0T B LBD$3P9 #$4P9 $[ LP L$ҩ o@ rP \I \PG ,[cAXi HAC 0 B0@ B08X HB00Xi  AX  @ r$@PI \$QY oi \Pg ,Z$cAPC :X 4ð !?0 #<0 #90 #6`RXD1AP$Q 0$@PI < B 2B*XY HB0"ð` #?!$BPI <#P <[ LP L#
!' !$API <XI 0ZI <
DZMHT  PY 8Xi <` B$X\Z  <  P   4
SeZi LAC @X\Z  ӫ  P   XM\ZI H
ZeT  
eAxXi <!5si LAjXi LAbC :X D B0nX9  #7X H#4X P#6`RXD2AFXI 0
DZMHT  PY 8P  #7P9 TP  P9 HXm\Zi  6  P   4X\Z H
Se[  
eAC Xi  #6X9 H0 !6`RXD3AXHZ @ӫ  P <!6`RXD4AݼXI 0
J
DZMHT  PY 8P TY L#6`RXD5AݔZm\V  Xi 8`   TZ=\
eS  
eA`Xi L!`?!%X PC0 X=\Z9 Pӳ  ` ʰ@ k
jA,Xi LA$XI H#$dAXY P#4eAXi 8` @#:XLZ4[ XPL#` !9X=4P=LX  PPC $	W  p PX ,@ F$0P9 0$@ @P !$@ @$ҩ CI 0PG ,A|y  #	W  p TX ,@ JX9 0P9 4$@ D$ҩ GI 4PG ,A@y  	W  p TX ,@ JX9 0P9 4$@ DP !$@ D$ҩ GI 4PG ,Ay  $	W  p 0P #7Z]  P  f#*` !'X9  !0 #&`SKP1A
3Z=P&aPi ,Hc  Vi ,Ay  /	w * ,Ap,$`W   l` *W   <$SXmTW   TW   ,W   HW   H ,W   HW  ,$bW   lX  ;#>X P W   P C z  Z
w p ,$ ,P 8X8 P8 W   P X Ű _!3C &I ,@ #=XY 8V[PY 8&AҹD  ,I ,C P W   P z  =
w p 8 P ,$1P: 0X ,Y 0BRZ 0P 4ZXXK  UI 8!6X 4z XZ 4RZ]XXe  Yi 8#'X 4'P ,#X: 4&1P: 0C AT$C  D
g p ,$P  X8 0 0!0 7#%z X XK  CXX PEPK  Xh Ph W   P X  0! 7#$%C C  :
g p ,A~!5$z X X<  !0 ##$"%" 
w p 4X  +#8 -#5%z P ,X P W   P j 0A!8AT$C X: ,0 -!6$[ 0P 0XJ 0QI @%C  =
w p X%P <P D$0P9 @AA4P L!4y 
Z`H  P Hð #8İ P TC Bi TA!7AC X Š ,#7AC X P W   P XI H@ #>i <A!7AxC vC XX P  B0A4P PXh Ph W   P X PZ ,P 4X<  P9 @Ӽ Ű B0&c`$RAl$P @$OPI <Af!3C C 6\ U#7Z]\e  Pi <AD!3C X  (!8X9 <##C ~C BC X Ű -!5A#2#i @A`!7AC A!3C X Š (B0XH PH W   P i <A!7A^C \XX P ,B0BXh Ph W   P X H !7A&C $i DAD!7xAC X8 0 )#7nAC X8 P8 W   P X Ű ;#7hAC X <#$P <XI D#$@PI D!8D#6PI <$@PI DXY HP   Xi Td
VeZi <A.X H #7si BAC j #> !;si @Asi BAC J B0BX9 @>!5X DC * !7\A(C &X DsI @ʠ@ Tj
eAsi BAC 	w p 0X [ &P ,$S` AAX=4P8 $aAXh AXh AXh AAXY ,\H PX X \ P y  9	g p 8
fZmpH  P 4X= C0BP ,$P 0X ,C0,à #:XI 0
DZMhHd  AvXY ,QPY ,$aQi 0C X 4X9 40 
P 0lARX 4#X #:$@PG ,P 0$X$cAi $SA4$_PW ,i Pg 0P ` A X 4C X8 #:$P ,P7 0$X$dAȠ,Q y  {	w p ,XTUX#<$0P=` 2AXmTAy  	g p 4$P ,Xj ,W   lXj W   <X: 0 B0<Xi W   <X ,Ű B0XmTA%OPMX]PW ,$P%aAzC Xj ,` B0Xx#&`TAG?AӆXm4aAFXmA>X=`&30P=`Z=dP: ,H$ð  !:2P: ,@  PJ 0#PPZ 03#$Y: 0#&`FRM?A&cAXm\Zh f  W   <Xi 8AXi <AXi 0AX4QX: ,0 !2#$P ,C %APMz  
w p ,H&C@$`W   lW   H$QXi W   TW  ,$bW   l$oW   <z  4
w p |$P PX9 !0 !4$P P$ҽP D$CPJ HA@P B00%QQX Xh Yi ,!&`DFV1AdZh ,Ph 4&$4AC 6Y !`DFV2AZ ,P 4X Y ,#*P ,$1P: D!$4AX P W   P XH @ ,!2#]P #7&QME ]C mf!4$P PAւP 4W   P X: 44P: ,X 4İ P 0AVP 8W   P XJ ,PH XZ 0PX Xj 8Ph @ B0<` C04` !7$CPJ ,$P H` !7$BPJ ,$1P: HZMd  Pj 8C |@ !<$GPJ ,ZMd  Pj 8C `@ B0*$FPJ ,Pj <X 4@k Yi ,!(dZh ,s P 8C .@ !?$EPJ ,$0P: HX 4@k &aPj 8#ZMd  Pj 8XJ ,@ #7Xh 4X 8@ X8 4C 
UZ]|H  @ A<P  P XH HTPZ LXh ` Ph C0d` B\#9-AC 8` B0$' ,AAB -A  #-A` !$$cPh $0=X 0ɰ Bɰ 
B XH PMtXX C0rDC0lP B0<$aQmX 4< 0 < X@ 
Ű #4z $SPX -A$cAXH 4X]8PT  $nd PW ,$P$fAfC XxB0,PX Xj D#7ALX 4P  X8 !7-AC $aPj PP8 $P 8P C XJ 8PH Ű C0$SPZ HXj ,B0&$P PX8 4Xx@ $dPj ,$HPJ 8c C vŰ #4Ű !>$P PP: 8Ű !4$DPH C PŰ #5Ű B0<$P P$HPJ 8PZ HX8 4%@ 
XJ L#$@ #&`DFV3AS TS #$DPJ 8Xh C0` B0@X , !9X: 00 !4$P XJ 0@ #7@ #4@ !5$`Ph #$QPZ P#Xj HAXj P` #6X]8$nAX ,P X: 0P8 0 !7$P $P XH 4%Q@T 
Xh B00 #50 B0$;P8 Ӵ İư AҴ HT C "P!/` Yh !*X !%ư  Ҵ $cAADX8 0 C0*X 4XM8PK  $^[ d [h AXh A6C 8$SXh A*AXh 4X8P  $>6 Xm4[h AXh AAX Ű !:XM8'HPG ,$P$eAC JXX 4He &c` @e X 0 !` @e $>5 $P  XM8&H@E X]8PW ,[$dAC Xj 0` !9AzX 4P  C ` B0X8 4X @ XH K&A@C X]x&Q@S X l 
f$QA8X8 4$ҳ XM@PC  AXh AXh AXX PZ xXh 'aPj @C "&aPj @$Qx$TXmxAXmxA^Xj @Uj xB0AC "` B0(X=x#;X 4HK YM`##PM`#%QP]tPX C X 4X8 < XBL @ `B0\ P !6l ` !;P B0l ` B P  'PP !9` !` !#Ql  @ L $Q H=$0 B0RX 4K J g[ @Z dk @j jX  P T: g0 !7$4: g$@ dXY 'QPZ x$W[Z xj TAC 4Xm`Zj H%[ HlPm`Pi X8 4Pc  Zj 8Pm`X xV HP xXJ P!9XX 4XU  Xh A(C .
g p , #4 !5$z 6 0 #3$"	H Ű #7Ű #4ɰ !%C $C  *
w p 4$Q\X=\0 #&`DSC1AɈX HP 0!6`DSC2AtXH \PJ ,!6`DSC3A`X P HX* 0$8AXD PH \X: ,X dP P8 dP#  z  C
g p 4 `P ,X: ,X P 0!6`DROPAXK  UJ !2#P ,C X P XZ 0Xh \Pe PX \X X8 HP< P Hz  8
g p 0f!` #&`VSTKAȘdZh ,Pj ,AP HX\Z LP  X: ,ӳ ұ XC  PA  HS @Q Hc @a  @ H @ HC 
@A 
$PPQ @ Hc @a    Xj @a H& #7`Xi HA:z  `
g p 0A<P ,X X* ,$8AX\Z LP,  H=&0 #6XbAz  &
g p ,AP L$ X: P1  $@  XM\BZH LP  H]&P #7PXi LAɖz  ,
W  p ,AA&XZ  Xi HAz  
W  p 4ApP LX  X:  P1  $@ XJ ,@A XZ 0@Q $`Pa X\Z LP  H=&0 #7JXi LAz  6
w p ,X\Z LX<  P9 HH&ð #6BcAz  
w p ,X\ !&`SETBAfZ LX<@P9 HX\Z LXK  PI LH]&P #<8cAj.Xi LA^z  5
w p ,X\!&`POPLA Z LX<  P9 H%Q\HM&@ #6&cAz  &
w p ,AH& #7Xi HAXi HA|z  
g p 4f!;X<  c&aPj C <XK  &A	FC ,K  @ !8XXe ` #;$eAƂXX: '1<  X Ű B0:A"XJ 'APJ 0%QPZ ,#&QPZ ,ZXe  AXZ ,UZ 0 =A0C .Xj 'aPj 0%P ,#&P ,Zl  AvX ,U 0 =z  n
w p 0X P ,X8$ҳ  XJ ,C 0'APJ ,W   P XXe  &a  Z  C W   P  AC0 $C0 .B0>X8ӳ  Ű B0.HM$@ B0"XXe ApXi L   z $`ATX9 L$@ $BPH $_S `@c X<  X L&1@; L  D!5X]B0<d&a$QA$Xi LX<P  $`A
X=!=XK  D!7XY LX5  P=#P[  #$`AC h 
g p 4X P 0X8 0 #>$cA4Xj 0AVX8'z fB0BXP ,XMBZMXT  UZ 0!3C fXm&a` PmUj ,!2#C $S$dA`X& PPAX=2Z=X 0P  XM
DZM X]4@T  kALAXm
fZm H  C \ l
w p ,$QxXxz  
w p ,$Q  X9  0 P#&`NLBLAT2Z8 |z  
g p 4X  P ,X: ,U9 C0&2Z8 |P: 0H  U !5z %AQJ ,C $"	 &
g p <$PLP 0f!4z f#P ,$1P: 0C fA~P 4B0&A:P 4X @  AXJ 4@ $QPZ 0C Ha #X !AX: 4@ $P 0XJ 4HT P @T PZ ,Xj 0#<Xj AHP 8#4$P  Xj ,`ADX=pU=4#5Xj AXj A8X#;XH @ :#6@ L#3A$PP]pPY C  
W  p 8$PhP #7Z]5  P:  X ,Bf!4z f#PC zAhP 0B0(A$P 0XJ @A  AXZ 0@ Xj AC 4Ha C X , !<AX: 0@ Xj A#f#%Xj AX 0HK @PH#XZ PXXj  ` !5$P 4#$6P: 4XZ 4XhA٠XXJ  @ k
dA$RQ]LXj  ` B0 X4PpX8 0 :!7H$İ @P#HM$@ @PM$P C  
W  p 0P !5AP  Xj A´C0X X<  B0DXj  AXj  AƨX  P ,[$dArXj  AƐXJ $W@T $ad X   C 2/` $P $`AP ,XJ P@T $g@d $ P  C BP Xj ABX: ӳ P ,XZ  $mAXj  AXJ $QT $g@d X   z  {
W  p ,AX l AbXj Afz  
W  p T* 4$8A$1@: DZ GX ,Һ KX* 0P* 4Vj 4Az  !
g p <H 'P 0H6 P: ,X  P 4F PJ 8H P  $1@6 $TV P ALXj X ,@ X: 00@6 X 4P  z  9
g p 0 
ZhH<  P: ,CxӶ Ű #6`AMAPAPAоP ,$aa  AXJ Xd  `$RA$_PW ,$`Pg 0XZ ,` AX $1@< @< X ,Ҽ $@PL  kAĀz 0 #50 B0"XV  !?0 !5$6P: ,#$4P: ,HV PV  $@ 6 C  m
g p 4H P ,H6 P: 0AX ,Ű #4z XJ T P !dArXj   #4 !5P AX: X 0 Z  P  $EC C  @
g p 8$P ,6 3C0Z0 #50 B0<Xf AC00X XK XT  PZ ,k ` !6$P[Z ,PZ ,$`k dAP Xj AXC <  #5 	B0*H P 4AP Xj A*XJ XZ 4@T $dd X < 
3Z=pH  P 0#`VMAPAPҼ XJ ,QL  z  t
W  p @H& #5AX:  P: 4B .0 P: 4X HK @ #[ U#9kA#5` Pj 4X 4P <X: ӳ C0lŰ B0TXc AC0HXJ HT P B 8Xd X  P 8AX: $ҳ XZ 4cA,XJ XZ 8PT  $ed #XZ 4Xj AC >C PJ 0HS PZ ,@ !cAXXj  P 0H=$0 B0(X <P XZ  Xj AǎXH PJ <XZ e Pj 0X 0 #3!3C  B0$X: ӳ !5$@C #XS  !4$ac C  B0DX: $ҳ $A@C P cALXZ Xj ,@e   @ $0P5  $P 0XMxUJ C0LXJ PMxXZ  B6Hm$` #:H  #5dA!8X: H Ű !7XZ 4Xj A$@PMxXZ <PX z 
g p 0XZ  AX   #5 B0rP ,X;  P  ZXL  @ C0"XZ  RZ]Xe  ` !;X ,< U:  !4{ XK ,@ !6AP  #A0P  QXk A$#ZX\  P #6`PickAPC  \W  p lH& #7Xj AXj A!<X:  0 !0 #$0 !3C XX K PJ T$@K XZ TC02Xk Pj , <!9K 4#5P AXZ T
UsEd

Hk #7` #4` !4kA6XZ  Xj AlX   B0VX: ӳ Ű !4z Ű B0.C BZMXT  P !>Xc  `!` !& P  #AP  C VX: ӳ B0BZXL  @ C .Xj  A
XZ $`e Xj  AXj  A
X X:  < #lAX K 
DsD

` LD1APXZ He ` !` LD2AP P ,X5  P7 0XZ  $aAR$aX  k  ApXJ  XZ e F#6TXj A2X $1@< X $AK XZ  [ $`Pk  eA
C X < U:  !3C P7 ,XZ  $aA٘$aX  k  AXJ XZ  T eA
C xHm$` Pj hX H< 0 C (0 C 0 #90 #6` LD3AP$`Pj hC &Ӽ ð !<lA#8XJ HT P !4$`Pj hX H< 0 B0($2@< P ,XZ  ` %AԜ$aX  k  AHC (P ,XZ  $aA|$aXJ  d  A(XZ  Xj AXZ hC0Xj H  C@$@ X=(0 #;$P ,XZ  ` Ap#$OPG ,$P 0XZ  ` AC  XJ $W@T $oPg ,$P 0XZ  $gAش$?P7 ,P ` A X K @K C 2H]$P B0 Xj , B0XZ  Xj A<X: ,X    B0VXJ T P B0BHd ` #5` B00` !4$Q  X: Ȱ @ Xj ,ANXZ  Xj AC C ~Ű B0vcA,XJ T P B0.Xj  ` !5A\P  X < P7 ,XZ  ` A6C NH Ű !5$cQd  #Ű !4$Q  $@ XZ  dA:C Xj Av$PXj ,ADX: ,P7 ,XZ  Xj TAҒC H$ð B0BXJ ,T UB04Xd  ` B0(XZ  Xj AX < 0 !8H Ű !3C XJ ,T U#>Hm$` #9$SdA` A Xj AX ,< 3!;X  !ɰ #$$fA#0 #6P lA`XJ ,$PPT  Xj , P ,X6  P7 0X [ Xj TABC ` LD4APXJ ,T UB0Xd  A$P dC Xj ADXj A4Xj  P  lA
$1P: XX dɰ #$$2P: X$UcAX$@PG ,%QXj dV  %P 0X: S $cAծ$P ,XJ dPG 0XZ U ` AՐC HXj  ` B0$P dX: T0 !4$P dXj AC0VX K ZM\T  P UZ dB0:k Zm|  ZX<  B0 [ PZ `Xj T` #7Z]|  P `#ANP `C >X=\Z:  ӳ  ð C0"XM|ZJ  T  RZ]Xe  !6X  P `#AP `X=|Z: `ӳ  P dkA
XZ `Xj AXj dA
Xj dAXj dA
XJ TPJ X@ C0:XZ `PW ,XZ d$aAXj `A
$`Pg , P 0XZ d` A@$6P: X$cX dk  A$PXj ,A2XJ ,T U#9P #6Hd ` #6P dAX ,P ,XZ dXj XAZXj dA
X: T0 B08H$ð C0(XJ d@ #<dA
XZ dPW ,$QeAb` AC 00 B0(Xj dA
Xj `A
Xj `Pj XXj dPj `Xj XPj dX X: `< $P  $AL U:  #6XZ  lA4C XZ  Xj  \#6H6 0 !7P AC ($PA$X K @ #;@ #8D#6P kAXZ He ` !4$Q  Xj ,AX: P7 ,XZ  $mA6X XJ  K $PP[  $a@k C d$TXj A$SXj ,A$dA
$cA
$bA$bA
X $2< C *XZ  Xj ArX HK C0XX!5P ,PXXi LPj P$P ,$0P7 0$hAX L$E@K P @[ X PP LXj AXj $ $aA$cA
X: $@ $DC $SS $`Pc   @ 0 Q8X ,K @ C0X * 0$8Aj GA
$S@Z @P j 0Aj GPg ,$P 0VlA|j GA
P Xj ,AXX: Ӻ Gҳ $C@C $TS P7 ,Xj ,V $bA̰X ,l A
X: c A
X $@K P ,Z G$bÀC N$SXj A$RXj ,A$bA
$cA
XZ He Pj d!5` Pj d$fA&Xj dARX $4< X k A
XJ $P@T Xj  ` #?f#=VdAX $0@< $Ҽ Xj ,AC 2XJ  @ !6` LD5APXZ e Pj T$`e X TC0X5 P: ,
sL>

` LD6AP$P TXJ ,HT P ChP dA$aX ,< cB0NX K dC0@H[ P B4Xj T` #5` B0"* 0$8A+$8A 0,$8AXj AX < P:  $PXj ,AX ,P ,XZ  Xj TAC .` LD7APXJ HT P #XZ  dAHXZ  Xj ATXj   B0HX:  0 #5Ӷ !3C cAXJ T PW ,XZ  $aAμXj X   lA
C X:  0 !6AP  #Ӷ ;#4cAXJ  @ !@ #&` LD8APXZ e 
fsF

X ,H< 0 !` LD9APP Xj Af$RXj ,A\` A
$bA
$cAհ` A
X @ K XZ He ` !$$a@e $a l  AXj ,AC 
g p 4$P ,$0P; 0XK ,YK !X 0{ 4$Z%CPK ,$aQk 0X 0 d#&`COP1APC  ,W  p 8X  X<  P: 0X ,XK  PJ 4XZ 
UsE

`COP2APXj 4Qj 0C ~X 0[ 4P 0C nX: 0V: 4P: 0C ^X 0T 4P 0C NXJ 0WJ 4PJ 0C >XZ 0Xj 4V  PZ 0C *XZ 0\J 4PZ 0C X: 0\* 4P: 0C 
X 0X: 4  P 0C X: 0X* 4A  P 0C X 4!7$aA$APJ 4XZ 0E@ ]J 4PZ 0C XZ 4!7$aA$aPj 4X: 0#  ]* 4\* 4X 0P 0C X: 0#$0;cAV\
 4 F#'$gA$@PJ 4XZ 0/%X 4A ` C $Xj 4!7$aA$P 4X: 4/X 0/-` $BPH $`A:P 0XZ  $oe $@ $45 X  XJ 0PK  z  
g p ,A#8P Xk A#P Xk A{  g p L%Q\$0P: <P: @P: DX\Z LXK  PJ ,dA#6$QPZ <C  Xj ,H  #:#86 3!4$PAVX\Z LXK PJ 0dAC0$$QPZ @Xj ` !;$cPj X 0$0[<  P<  X ,K DC0PJ HX[ PZ 4eA#4$aPj DX DT @C0X=Z: XZ HC  [  EPJ 8#;@ B0^Xj Uj HB0RX H !;Xj 4$[  P  $3P: HXj 4Pg ,XZ 0Xj AXj 4AX ,X: 0P< X HҼ C Xj ,AhXJ @C0jXZ <B0.Xj ` B0VX ,H< 0 B0FӼ Ű #5Ű B04Xj ,  !4$ X: 0P7 ,VXj A&Xj 0ANz X 0[ U#6kAC XDC0RXk  ` B0FX  #8 #5 B0. !5$P #$P X ,+$8A$@PJ @k A
X=Z: ӳ  C0rXJ <B02XZ ,e ` C0ZX 0< 0 B0JӼ ZXK  B8XZ 0Xj ,Pe X\Z LP\  X: 5 PZ 4Pj 0PZ ,X <P @#XJ ,XZ T Xj 0Pd X @C0dX: 
3Z=X 0XK  EC  !;XZ ,$`e kAC 8X: 0 B0,H]$P B0 dA$P 8#*Xj ,$ X: 0P  C 
g p t$P hX=\0 #`ASS1AP2Z8 LX  P 0XM\BZH LXT@PZ ,e Pj lH& #<`eAXXj 0AX: CfX ,K @ C02* 8$8AX 0+$8A 8X* 0$8A$PPXz %aak Hk AxX\Z LX<  P: ,ӳ P lXC  PJ pŰ #4$PPZ c ` B0&JC PHHS P !7Ű !4&APHXh Qc  C @ C0$QPZ @S $dc X 0@\ $5< Ӽ #8Ű #5l C vŰ !7@QL  C dX]`&SPPZ \e  Pm`X<  P: `P\  X Ҽ $RcA$P ,$@PG 0P ` AXX PW ,Xj \Pg 0$Y` AƸ%Q\X: 0ӳ ð `C0VXJ ,XT  &XPX$aA%QXj ,AX%QXj 0ANXj 0H 
!?6 P7 ,X  P 0$QeATC DF PG ,XV  PW 0$QeA$nPg ,X 0H< 
P7 0$Q$cAX 0HK 
PK  $^[ Xj ,H  B0&H6 B0$P ,XJ 0HT P PW 0$Q$cAŚ$bAXj , P ,X6  P7 0$Q$bAŴX 0k A
XJ 0T PW ,Xd  &dPg 0$QeAŊX ,l A
X: ,ӳ P ,XC  &DPG 0$Q$bA`Xj ,AؒXj 0A؊C jXZ ,He ` B0XJ #6`ASS2APHS P B0Xj ,A%QXj ,AXj 0A%QXj 0A$aAXj 0 P ,X6  P7 0$QeAX ,K PG ,X[  PW 0$Q$bAľXj ,f A
X 0l A
X: 0ӳ P ,XC  &DPG 0$QeAĈXZ ,e Pg ,X  &P 0$Q$bAjXj ,AלXj 0AהC tPZ `ư ҳ H P XP !4&P XcAP Xj 0AXJ 0T PZ \Xj , P ,X6  P7 0$bAX ,k A
XMlZJ `XZ XTe  
lXZ \AX: ,ӳ P ,XC  &DPG 0XZ \$bAôXj ,AC XJ B0"eA,XZ ,He !6Xj 0A#Xj 0AX ,H< 0 B0\XZ 0lAP XX 0K D#:$RkAP PZ d#kAv` Pj d$SXj ,AXj Xb$TA,Xj dA2C 00 B0Ӽ ð B0XJ C @XZ 0He ` B00eAX ,$3@< lA:Xj ,A$`AxXj A&C H\ PZ \@ C0^XZ 0lAnC0PXj 0 !;Xj ,AվXj 0AնC ,X: \@6 X ,k A
Xj ,AՖXJ 0$P@T dAC <Hm$`  C0X  C0X: 0ӳ C0|SXj ,AnB0nXJ 0XT Xj ,AnB0ZXZ 0Xe Pj 4$ $SXj ,A$RXj 0AߌX=c AX ,$DK $P@[ $gk X 4P kA\C X: 0ӳ İҳ XJ @ C0(H]$P  !=Xj \Ic !P #5cA!4$P X: 0ӳ !<$SXj ,A$RXj 0A#
$RcA$SXj ,AXMZJ d  A:XZ P #5Xj \A@C &Xj ,  C0z$7P: \X pɰ #$6P: \HF @ !4$2P: \XZ 0e f#6SXj 0ApXj ,AX\Z LX<  P: ,X 0XJ \K XS P[ P %QcAVC %QALHm$` B0X 0H< 0 B Ӽ #5Ű B0\Xj ,AnC0XJ 0T UB0(d A
Xj 0AZXj ,f A
Xj ,AFC &PJ 4XD PJ 0X 4l A
Xj 4A"P Xj 0A%QXj ,AX: ,P7 ,X 0[ ` &A"&Xj ,AXJ 0d A
Xj 0AXj ,AC XZ 0He Pj ` B085 3B0.ӵ B0$XE  @ !@!+@ !5$cPj `#$bPj `XZ PZ XXj ,H  !$Y `!$$RPZ 6 0 !<V Xj 0A$P C "XH PJ \ !Xj 0A!7XZ \Xj 0AۚXZ \Xj 0AߦXZ 0e ` #7XZ \Xj 0AlX 0< P: \X ,K @ #5%QkAjXZ ,PW ,XZ \$bA"&Hm$` B0X ,< 2Z=X  P `!`  C0@lAXI C00XZ ,e Uh B0 H Z ,H5 4Z8 ,ӳ ư Ҽ #AXJ 0T Xj , P  X: X0 #5XZ \AXj \A
Xj ,AXj 0A
X Ű B0dHM$@ C0XXZ ,He ` B0&Xj \A
X \P ,\` A&n` AĢC "$0P7 , P 0XZ \` $A&` A|C z
g p 4f!4z  P ,$ X6 P: 0XZ ,AXj 0AXj ,A
Xj AHC  )
w p ,Xj @A$P D#X ,  !4X: 8!5%{ $" w p <X HH< 
P; ,HL PK 0H\ P[ 4$`Pk 8X L< 0 #<3B0L @ #4DB0v0 B0@XL T U#5P B0(Xd  Pk 8P !8$QT $`Pd  #$0< dArC "Xi LX  P 8$P  6 0 !4$16 X[ 8\J @P[ 8XJ D!dAа$kA#Xj @AР$mA XY H$a@e H 
B&eA^$4P7 ,$@PG 0XY HHU 
$nA$cA$cAADXk 8#8AN$cAA0Xi HArX , #5Xi HA`X9 HXJ 4@C X[ 4@S Xk 0@c  V <@ {  ŀg p PX C0DA%1Q=\X LK D#6P kAXY LXi HX P PV 6 &16 z AX HK &A[ E#6`ARF1APk Pj ,`k  P 8H; P: 4HK @ PJ <Hm$` !5 #5X 8B02H P @0 !4&P @X: ,0 #4$P @AX#5AC b%Q\XI HT U!?$RXi LAXi LAj$mPj 0C P B0D$RXd AX HXl AB$SXi LAݲXi LA0$>P: 0H$ð !50 P: 0C Xi L #5P AzX9 LX HXK PC [ 'QRZXPZ LXh'dPj 0C D&dPj 0X LX< P: HP lA.$P ,XJ 0PG 0XY LU $bA&Xj HPi LXj 0Uj LB0$RXi LAX L$5< $Ҽ XHPL  $SlAXi LAT$_PZ 0Xi H$ AטX9 HH 
B.$EPG ,$PPW 0[$nA$TXi LAܐXi LA%aQm\#$TcAx$bA
$dA
X 0 #4$cA
Xj 0A.$bA
X9 HH 
B>C PG ,HS PW 0XS  c AͨXi H$ $0P6  $Ҷ @ $cAn#$BC $PPS  Xi HA(Xi HX 4@ X: <0 @6 X ,ð #4$FF C 
g p 4 P 0A#50 P: 0X K @ B0bXX P ?B0VXk AC0JXj X P ,$06 XZ 0A^X ,P ,XJ T ` $A"&Xj ,AXZ e A
C @XZ 0Xj A"Xm4UmL!9XPX: ӳ #;XJ T PW ,$aA&n#kA
z  n
W  p 0Aմ$RXj AXj  Aբ$SXj  Aں$TXj ,A
A$bA
$cA
` "A.z  +
W  p ,P A|$PXj  AגXj  A!7P Xj  AdX  P ,X: S $gA"&X k A
z  /
W  p 0  B0"X6  U=!=PZ ,Pj  PZ Xhǰ PhXJ  T P B06X4  U=B0*X K D#6P kAXZ $c@e eAC 64 3#5$SdA٢$RXj A٘$SXj  Aَ$bA
$cA
$iA.X $E@K $T[ $`Phz  j
W  p 0$PlH6 #40 !6Az eA>#6Xj Af"Xj A>#=Xj  ARXhǰ PhC Xj A!6Xj  A#9XZ  Xj ATC XJ HT P B0XZ  dAP ,XZ  Xj AC t$PdAP Xj A؜$PXj  AղXj ,` =C0` ##=X  P ,X: S $gA"&#X  P ,XJ T ` A"&XZ e A
C  
g p D` !4$`A(AʴX HP 8AʨX9 HP: 4X ð !4$`A AʌXI HPJ 0AʀXY HPZ ,$TXj ,A$SXj 0A$RXj 4A$UXj 8A׾Xj 0H P <X: 8H P @$dA
Xj ,A$cA
Xj 0A$bA
Xj 4A$eA
Xj 8A$gA.XJ <HZ Cd
eA@Xj ` !4$hA.z  
g p ,X` ,# ,P`Xf  `A^$X[Y $8P7 ,$[ P 0` A&XH @ Bn$PPW ,$gA $hPg , (P 0P $bA&H=$0 C0>X0B06$P0kW   l$cW   <$aA$`A$bW   l$HPG ,XX $aA&nXZ He 
C0n]!6`HDR1AP$P ,$0P7 0VXh AǺX L$E@K $QPW ,$`Pg 0V$bAǜ$bA
$cAH$  #7X: $@ 
#`A@XM`&C@PM`H]$P  !=` A.Xm`A@$`A@#$`Pg , ,P 0$X$cA&A0X=(0 C0*H$ð C0$OPG ,$\PW 0$]$aA&Xm%P 4X: H 
C0$`!A@$dA.XH <Hd A@XZ $`@e 
H$ @C0NX: =B06X ɰ B*-AXM8PG ,$P$fA ` 2A.$`A@H]$P @P]) 0$4Az 5
w p ,XpU4!4z X9 #:$P ,$\cA`C 60pP9 cAHXH PG ,$XPW 0` A&` Pg ,$Q` A&nX4Pp$0P9 C  ?
g p ,X  .!?H=$0 !:Ӷ ư Ҷ z AC0@XH$QT  Xj   $P$bA$2P8 $`AX $OK X]@P[  C zP Xj AXm`&a`Pm`X < P7 ,$Q` A&n$P ,@ PG 0$Q$cA&XX PW ,Xm`Pg 0$Q`  A&X X8 < X`P  &P`XJ $U@T `@d $@ C  
g p 8  C0\$0P: 0H 
P ,P8 Ű !8 @6 
#AAXJ ,
DsD(

$nANz Xj A$QPW ,$`Pg 0V$bAFX HH< 0 #50 B0,$dA$Q$eA$R$eA` A.AzX H$C@K XY Le A
Xi HH  !5Xi LA$aAC pP Xi HARC `Xi HAC TX9 HH P ,cAXJ ,@ B0fXY He ` C0V` C0NP Xi HAX H$4< $aӼ k  AXI HPG ,T ` A"&XY He A
Xi H$ C $`A®AXi HA~H=$0 C0(Xi LAC0*X LXK  XZ ,E!Xi HIF !($cAAPC b$RXi HAT$SXi LAJXi LA%Q\$bA
$cA
` A.X9 Hc 	A@$bA
A X H$BK $PP[  $a@k #Xi HA*XZ ,X9 HӼ  @ ZK  @C C P Xi HAAxP 4aAXY He Pg ,XZ 4` A&nXj 4A
X HX: 4< $@ @ C @ !PJ 4$QPZ ,$bPj 0#$P 4$7P: ,Ȱ P 0P Xi HAD` A
Xj 4A.Xj 0A
AXI HXZ 0T $a@d X ,@ C $$TXi HA Xi HA:*%1Q=\A%Q\$RXi HA$SXi LAXi HA:*Xi LA:*$bA
$cA
$dA
$lA.$bA
$DPG ,$PPW 0$bAXi L$@ C X9 HH Ű C0TXJ ,@ !8Zl[  PZ 4#Hc Pj 4Ű !4&aPj 4c A
X H$1@< $Ҽ Ҽ XJ 4PL  C :XY H$dQe  @ $1@5 X ,Ű !8$oA;$hA\#A;$lAPC `  A.$bA
$APG ,$PPW 0$bAFC ` &aPj 4AXj 4`  9A%Q\Xi HA!7P Xi HAΈ%QXi LA˞X9 Lӳ P ,XC  PG 0P ` A&XY Le A
Xi H P ,X6  P7 0$Q` !A&X LK PG ,X[  PW 0P ` A&Xi HA:*Xi LA:*%aAC $UXi HA$eA
Xi HA:*%aQm\` 1A.C X &P X: ӳ ð !3AXJ T UC0P C0(AìP ,$RaA$oPg ,$P 0P ` A&$8P7 ,X P 0$V` A&XH #:$PPW ,PG 0$X$cA&Xj   B0.$>P7 ,X  P 0S` A&@ PG ,T` A&nC PP ,XV  PW 0$T$cA$hA$cPg ,$P 0$Y` A&0 P7 ,$P 0S` A&Xj ,A^C pXh #:$P ,Pg 0$X$cA&X: Xc  `$RA$P ,$@PG 0P ` A&XX #:$`Pg ,PW 0$X$dA&X < 0 #5X4PpXJ HT 
PX Hd PhH !4dA:*C 6
g p 0A9P ,%Q\$41 X @ 
#$ɰ #&`CMOPAPaAz  $
W  p 4A#4{ P Xk AˮX < P; 0A P ,XK XX T P  Xk  @d @ PW ,P 0X[ 0$bA&Xk 0A
H=$0 !7X[ 0Xk AC  GW  p 0A;ZX\Z LX<  P; ,X[  cA%AQM\{  w p PX\Z LX<@P: ,X\Z LXK@PJ 4X]\RZX LXe@Pj 8AjP <X !6`FOR1AP&P0 <Z8 hP8 pXP D%APJ LH]$P #5A P L$QXj 8A$QXj 4AXh pX X: DU=#5XP$P @Xj 4A;Z$dAڔXM\BZH LXT  PZ 0Xj ,  !:6 2Z=X  B"H6 P: DAXZ DXj ,AX ,$FK %TQ]\Xj 8AC0xXj 0AC0lXj 4AC0`Xj 4X  C02X: 8X  XJ 0[  P D!XZ DE@ LLUZ D!4$QPZ @X: @!5$bA#X 8X;  XJ 0[4  P: @XZ 0e Pj H` !&AxP H# P HXZ HXj 0AX: 0ӳ P HXJ @B08H]$P C0,$QcAXj HA
$RXj 8A$SXj 4A` A.Xj @B0<Xj ,A;ZXj 0A;Z$aAlXj HA
X pX=ȳ@@ $APG ,$\kAJXj <A@ AZH]$P @P]Xj ,A;ZXj 0A;ZXj 4A;Z$cAXj 0A:*Xj 4A:*A<XZ HXi HA:$aAXj L!X P ,Pg 0XZ H$bA&X8 pX <@ XJ HC XZ L@S 
Xj ,  X  P  HF C HV @S Xj 8  X  P Xj ,A:*Xj 8A:*z 
`w p 4X ZX<  C06H$ð C0*XH BZMX]YT  !XH BZMYT  #$$hAXX P #:Xh 
fsF

X  #6 #AHX8 
3sC

XmAbz XmAC ~$aA?P ,"XmAC XmAC ZXmAC XmA@C BXh A=C X P 0$@PJ ,#	&APJ ,$`AXJ ,UJ 0 :C z`ADMPAPAC h 
g p 0Yi ,C 6Pi ,dZh ,Pj ,&$4A$>6 A@ @X ,P  $[  z dZh ,$[  "	 -
w p ,X`&P`$4P7 ,$P 0\Xh A<&XI L$V@T ` @d   Q`z  *
w p @X xP X9 l[9 hP: ,#4 !4z !4P: 0#0 !2"$P 0XI tPJ <XX 'QPZ 4C  &QPZ 4TZX ,PZ 8Xe  [j 0Pe  XZ 4UZ <B0X p[ 0P pC  K
W  p ) 0$4A$0P9 xP9 P9 P9 $P $P P9 P9 XM4PI P9 %QPY P9 XmpPi \%aPmpXP |P=X9  P9 X`P TXdP X$PdXMPI `X]PY dXMPMPM$`PhPh %PPi 8#6`-1 ?APX8 4P9 DX ,P X B@ ,PM`Pm4$QQ](Xm(` #)X !6`AM00APZmd  P Z%1P<  $PX !3AXI B0P$QQ]XmPi ` A/6X  HB0.%1P8X(Ű !<-A$P P Xi DAfC 4!7XH @C Pm`X]`PY h&SPPY lP]`PY pXH 'API tX P W   P X8 
3sC

Aj@|C X\#6`STK?APX d#6`USNGAPXM #6`CLMDAPX]4#`LIT?AP$`Ph PhXPAjPTH=$0 @C0"X Ű :#4Ű L!5$P#XM#3A/C jA0C bA=XY HXe  Ph A=X HX<  P8 C >AjP X\C0ZX8 4ӳ ư ҳ A=X ɠ B*XI HHT P #Xd  /` X PX8 P=#X HXK  PMC RXX P !7` PmC <P !70P=C *P #9PP#X@ J  XhF X  #5 B0(X8 P9 $P #&P AX U  9C X B0NXH 4T PT XmPd  $04 Ӵ Ű !44 #Ű !5VcA pX 4J 'BJ C XX 4$ne X=8P5  ɠ Bӵ İҵ P7 ,XX $eA C hŠ B0`E @ B0"Xӫ  j&a$QAXM@PI $`A=#@ !$`A?P #`AM01APXX 4$oe X P  C RAC JA>C BA>$0=Xӫ  P CPI C "&API ZH]&Qd  mE ]XI UI B0A=C AjP AjX  laA;C Ah !6$`A;C X8 0 A!3C $P $`A?P $P ,$@PG 0Q$oA<&XY L$g@e C |AjP A<X HH< 4Z8 ,Hc [i A:A<%Q\X LJ @ C0XY He ` #4` !>X  Z  P  'dJj @e C X` 	B0.$ge $1@5 P Xi HA@ JX HX LHJ @K C "` !&H @ #
X5  @5 H &@ X9 HX  P  HJ @C HZ @S Hj 
@c 
X HX9 LH @ H @ C L cA:*C hAjaA:XY He ` C06X  pC0*` B0"X8@5 X @ 
ȳ İP $0P8C A=6X HP PXj A4Xi PAXI PHT C0HXh C0@dA;ZXi PA:*A<X HH< 0 !Ȱ P #$P XH L $PP\  dA
Xi H  B0H6 0 #50 B0$Ҷ $ X Š SC0Š pC0Š ?C0HF @ !:P PX  @ #
HV TZX ,He Ph X!5 ,PXI H$XT P  dA;Z$dPg ,$P 0\$bA<&X9 HH Ű !7X L$E@J #
XY L$f@e H @ $aAиX8 Q8X HH Š !4$@ C A<$BPH XX P VB0nXi D  !@ PH C R B0JXi HA>C0>X9 H$@ $ң $HC $PPS  Xi DH @ cA;Z$`A;$aAA<#Xi HA@ F\XX Xi HA@ D%1Q=\X Ű VB0X DJ @ !>HZ #+$QHj A;$kA.C dHm$` C0X@ B0&Xh A
X P ,\` A&n` A.C *@ B0"$PPW , P 0XX ` $A&` A.AC ^$0P9 #%P $RXi A;AC >$`A܂C 4$aAxC *$gAC  $cAC %P #$@PI A=6Xi A;Xi HA;ZXi HA:*$dAˎC $iA˄C $jAzC $hApC $kAfC $lA\C $eARC $fAHC ` A<C $oA2C ` A&C zA<Xi HA#=P Xi HA@ JAP #P Xi HA@ JAxP A=6XY He Pi XX Xi HA@ JA@ @P %P ,$UaA@ B`$`A;Xi HA;ZXi HA:*$dAʒA<XY Xi HA@ JXh A^C $bA;C $aAʹC $`AͪC %aA͠C X8 0 u!5$P #$P A<XI HHT PY Hd Pi P !4&aPi dA@ EX !6`AM05AP !9$aA;$;P9 C   !8$bA;$P #lA;$P Xi AɺXi AɲA<Xi HA@ FXI HXY @T C $`Ph C *$P C  $2P8 #$P #	$P #$EPH #AjP XX Z]h$aPg ,aA@ B`$PhC A<X9 HH P cA@ EXi LA@ EX Š B0@XI HT P #>P #;Xi L  #4 !=$jA$hA;$kA$`A;A<X8 P7 ,XY LXi HA%Q\Xi HA:*Xi LA:*C A<Ƞ PhXH PG ,XY HXi LA޴%QQ]\X LX) H$8AaA:*Xi Hf A
C AjaAߠC $PpP AAjZ ,P @A=X9 HX  X @K P !I !`AM10APHJ 
Kd`   A^C <AjZ ,P @H]$P  B06A=6$RXi HA@ D$oPg ,X @X<  P7 0$S$aA&` A.C $aA;$kAǈA=6X @X  &HK 
DP Xi HA#;XY HXe  Qi $P #P Xi HA@ JX9 Hӳ P X H$OJ XY Z Xi Pj  $@ $4: P ,\` %A"&$bA
Xi HA:*$P ,[$cA&n$bA
$P ,$R$cA&n$BPG ,$Q` A&nX]4P]pC AjP Xh pE #;$P ,$\aA@ B`C H6 P7 ,$P 0XV  f A<&X pj AA=6XI HXX pe @d    U dA@ DX8 pH 
B X P ,P 0S ` A&` A.XH pHT #:eA@ AZXh p$@ X8 pӳ B08X !?c A
XH pT PW ,$aA&n#P ,P 0S ` A&#P ,Xc Pg 0S ` A&$P ,$QXh A@ B`X8 0 :#6`AM15APW   P AjaA@ AZX pH 
BhXM(@ #=XX PW ,P 0$]$bA&C F$oPg ,$P 0[ $aA&X8 P7 ,X pH 
P 0[ $bA&$aXH pT e  AXh p P%1Q=X#`AM20APȠ Z hP pC AjP @!`AM25AP$APG ,$\aA@ B`C AjaA$P ,$\aA@ B`C AjaAaA@ AZC AjP @!`AM30APaA@ AZC AC |$0P9 A*n%aAC hA=X HXk  A@%aAC NAjP $@&  !?X Ġ?@&à #5Ơ @&#C Aj@$C %API C (H]$P @#8` 2A.$`A@$`Pi #AjP X\ #$`A;"A=6$SXi HA@ DA=6$RXi HA@ D$QXi A;` A.X=4P=pC AjP 8W   P AjP X`&İP &P`X P ,XI PG 0$X$bA&$QPW ,$\Xi A@ B`XhPi 0AA@ @P <aA^X P ,X9 P7 0$X$aA&C AjaAC X ȫP AjP #$ #&`AM35APW   P AjP XMx!7XY ,QPY ,#Q A<$`Ph %P H=$0 B0X Ű B0|X LXI HXT  Xj  V B djAC0ZXi HAC0N$P X8 C @0B 8X HX  ɠ B(ɠB  XI LXT  P !P!'Xh `  Ph Xx!5X9 BzX HX  P XI LXT  PX ɥ #&`AM40APA-%bQm\Xi HA:*Xi LA:*XxB0,$?P7 ,X P 0$UeA@ D$eA
X &ĠP C XM`&C@PM`PI &DPM`XX PW ,Xi Pg 0$UeA@ D$eA
$P\X8 
3P9 P C Z&P $Q\A<$eA
P Xi HA@ D$EPG ,X]`[Y PW 0Xi HV $bA&$Q`X9 0 !3Q`U B0` A.Xh A@Xh A@$P\X B0&XH PG ,X]`PW 0$U$cA@ D$cA
$hAXh Pi $P C x&P X=x!<$Q ,X ,Z ,P 4#%AQH XX TZX ,PX 4Xh 4X`P  Ӧ V Ҧ 3B0%A@F 
XX V   @ X8 B0DX #7` A.C .PW ,X`&P 0$U$bA&XH PG ,X]`PW 0$ReA&C xPW ,&P 0$U$bA&Xh C00$P ,$0[8 P7 0$QeA&$P ,X P 0$X$cA&#$@PG ,[H PG 0$QeA&XX PW ,Xm`Pg 0$Q$bA&$Q`C 8$cA8X8 4X8@ 
$ң j[h AbXh AXH #5XX Q]`X U B0C A<Xi H$@ AjX9 H@ C X P W   P X8 0 A!0 Z!(
3sCL

8c`I  ?AP$W$`A;$gA
A<X P W   P X Š AB04XI @ !&P =PY #` <Pi X P ,XY LXi HAC vŠ KB0HP Xi HA@ J%QXi LA@ GX9 L$@ P7 ,X HZ ` 'A"&XI Hd A
C &P W   P XY PW ,XY LXi HA%bQm\Xi HA:*Xi LA:*XY Z]h$aA'8$PhP ,$1P7 0$W$cA&` A$PL$P ,P 0[$gA<&C 0XH PH W   P $[PX $cPh VXh AAHX 4X=4P<  $Ҽ AC A<X HJ @ !6Z UC02` Pi jA#5 P XY Xi HA@ JX9 Hc AC A<P Xi LA@ D%QXi HA@ GX H$@ P ,XI LT ` (A"&XY He A
Xi H$@ %1Q=\C 8X Ű H!5AjP X Š S#=ADXi LA;ZXI L$P@T #W   P Xh ` G!5$`A;#Xi A:$aA@ ^\C A<$RXi HA@ D$SXi LA@ D` #A.X  !%$`A@# !5$bA@#$aA@%2Q=\$P ,$P 0Z$gA<&$gA
XH !;$PPW ,$aPg 0$W$jA&W   P C :A=6X HP PA<X9 HH C0JA=6ABXi HA;ZXi HA:*$aA@ ^\X]`P$P ,$@PG 0Xh A<&XY L$`@e A<$RXi HA@ J$SXi PA@ DXtZ l  A.W   P C A<X=\2Z8 LX LP@X\Z LXI HPJ  C lH]$P C0*A<Xi HAXi Hf A
$P ,P ` A&nC 2$`A;X9 L$ҳ $ң C XH PH W   P XX P AB0*Xi DPh 4X ,P ,XY  %bAX9 xV8 P9 xC 0P B!3C dP C#6`AM45APX`Y p##P pX lP`C %PxXI ,PG ,XY  XmtAC z$PP]xXi #C X D< 0 #3C X ,Y C X @ P XI PI C L&API DZH ,PH <%QQX Xh dZh ,Ph 8&$4A$ 4 0 `!60<4 XI UI B0X Y ,#`AM50APX <J @ B04HZ P`P B0$j f#?X DX:  @< 
XX 8e ` e %PX=`P9 X #3C Xi DAlC dȭP 4A@ @XH 4P  $PPX PX PX Xm(#>aA;A=6X H$0@< lA-bAX ,P ,XY  $`A#C Xh `??  APX(C0JX=pU=4!>X Dӫ B0.HM$@  B0"H]$P @#; !8` 2A.$`A@AC "Xm8` #4$`AX< #5$PeAX9 Dӳ V ҳ ` A/6AX B0XH @ #7BZM$PPT  %aQm(XdZ(<  P8 C RAX pY`##P`X Š!7XM`PI TC *X]`&SPP]`P #6`AM55APXi DX`@ X9 TP=`X XPdXI \PMpXY P]4Xi |PmXPX9 dP=X `P%PXy 	%*  %    6, 
%-  7    ;/ 	50  :    >2 ;    ?A4 	 w P (p4NPH 0p2P ,NPH Dp@P @NPH Pp @P LNPH Xp P TNPH lpP hNPH xp xP tN|PH p@P |$P P P N\PHp PNLPH p	`PP$P(N<PH0p PP,XX< @=$0  #50@=$$aW   `$bW   l$fW   <$dW   <$S$hAX( ,$4AȰ  @2Ƞ P XPXM%QPT  PT <PT  PT 8PT @e&aPh eZh @X Z @<  P6 X Z TX Z T&P Xh ` B0X @$@PI<XX TPE P HPX \PH d%a&aPh  Z h,$6A`  >$0P=X hP pW   P $P ȝP 4P ,Z$bAA!XM#6$ $$Ax Q ,+$8A$@PJ @k A
X=Z: ӳ  C0rXJ <B02XZ ,e ` C0ZX 0< 0 B0JӼ ZXK  B8XZ 0Xj ,Pe X\Z LP\  X: 5 PZ 4Pj 0PZ ,X <P @#XJ ,XZ T Xj 0Pd X @C0dX: 
3Z=X 0XK  EC  !;XZ ,$`e kAC 8X: 0 B0,H]$P B0 dA$P 8#*Xj ,$ X: 0P  C 
g p t$P hX=\0 #`ASS1AP2Z8 LX  P 0XM\BZH LXT@PZ ,e Pj lH& #<`eAXXj 0AX: CfX ,K @ C02* 8$8AX 0+$8A 8X* 0$8A$PPXz %aak Hk A(X\Z LX<  P: ,ӳ P lXC  PJ pŰ #4$PPZ c ` B0&JC PHHS P !7Ű !4&APHXh Qc  C @ C0$QPZ @S $dc X 0@\ $5< Ӽ #8Ű #5l C vŰ !7@QL  C dX]`&SPPZ \e  Pm`X<  P: `P\  X Ҽ $RcA$P ,$@PG 0P ` AƈXX PW ,Xj \Pg 0$Y` An%Q\X: 0ӳ ð `C0VXJ ,XT  &XPX$aA%QXj ,A%Q                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |               kp
\                                  l                                                                                                                                                                                                                                   #READSYMFN      #READSYMFN      #READSYMFN      #READSYMFN                                  P                (8 
8L(    ht                                                                                                                                                (                                                                    ,zipd $gk X 4P kA
C X: 0ӳ İҳ XJ @ C0(H]$P  !=Xj \Ic !P #5cAx!4$P X: 0ӳ !<$SXj ,Aެ$RXj 0Aޢ#
$RcAޘ$SXj ,AގXMZJ d  AXZ P #5Xj \A@C $Xj ,  C0z$7P: \X pɰ #$6P: \HF @ !4$2P: \XZ 0e f#6SXj 0AXj ,AӜX\Z LX<  P: ,X 0XJ \K XS P[ P %QcA H?   d d                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %include "Sysinc:com.inc"
!   **************************************************************
!   *                                                            *
!   *          PERKIN-ELMER 32-bit series IMP compiler           *
!   *               Intermediate-code Assembler                  *
!   *                                                            *
!   *                 (General Service Version)                  *
!   *                                                            *
!   *          Interactive Datasystems (Edinburgh) Ltd.          *
!   *                 32, Upper Gilmore Place,                   *
!   *                    Edinburgh  EH3 9NJ                      *
!   *                                                            *
!   *                 Copyright (c) MAY 1st. 1980                *
!   *                     All Rights Reserved                    *
!   *                                                            *
!   **************************************************************





! Known faults:

! Outstanding:
!      %longreal is currently treated as %real
!      statically sized arrays within stack frame
!
! Optimisations:  (intended complete list)
!      integer constant folding                          *done*
!      real folding: integer/integer, integer^integer    *done*
!      literals in shareable code segment                *done*
!      special treatment of null string                  *done*
!      special treatment of simple append (S = S.T)      *done*
!      special treatment of S=S.tostring(x)              *done*
!      suppression of redundant capacity checks          *done*
!      suppression of redundant unassigned checks        *done*
!      register usage                                    *done*
!      register environments                             *done*
!      k*2 -> k+k, k^2 -> k*k, k^^2 -> k*k               *done*
!      Pass last param = string or record %value as %name then
!         copy within routine *done* (for strings only)
!      Detect and omit redundant array bound checks

!                   ABORT CODES
!                   ===========
! code    routine             reason
!
! ?? x:   assemble:  faulty intermediate code operation 'x'

! ADMP:   adump:  constant record ?
! AM00:   assemble:  static block nesting > 5 levels
! AM01:   assemble:  ('A') unknown constant type
! AM05:   assemble:  ('u', 'q')  unspecified length in ++, --
! AM10:   assemble:  ('_')  switch label outwith declared vector
! AM15:   assemble:  ('B')  intermediate code faulty at %repeat tag
! AM25:   assemble:  ('F')  user label out of range
! AM30:   assemble:  (':')  user label out of range
! AM35:   assemble:  ('d')  wrong no. of dimensions specified
! AM40:   assemble:  ('d')  %const/%own array inside out
! AM45:   assemble:  ('~')  faulty intermediate code in alternate record format

! AM50:   assemble:  ('}')  symbol table overflow (inserting formal parameter specs)
! AM55:   assemble:  ('}') (OUT:)  %record format > 64k bytes
! AMAP:   amap:  impossible form
! ARF1:   array ref:  no. of subscripts doesn't match declaration
! ASS1:   assign:  not at least two items on operand stack
! ASS2:   assign:  general %name not a %name
! ASS3:   assign:  record length undefined in 'record = record'
! CLM1:   claim:  reg > fr14
! CLMD:   assemble:  ('O')  registers still claimed at line flag
! COP1:   cop:  exponent overflow in folding integer^integer
! COP2:   cop:  inappropriate operator
! DMP1:   select literal area:  literal area already selected
! DMP2:   select code area:  code area already selected
! DMP3:   lit byte:  literal area not selected
! DMP4:   claim literal:  literal area currently selected
! DMP5:   external link:  non-existent reference type
! DROP:   drop:  descriptor not in use
! DSC1:   descriptor:  operand stack overflow
! DSC2:   descriptor:  descriptor free-list empty
! DSC3:   descriptor:  link-block ('using') free-list empty
! DFV1:   define var:  symbol table overflow (inserting record element name)
! DFV2:   define var:  symbol table overflow (inserting non-format item)
! FOR1:   compile for:  too many nested %for...%cycle .....%repeat pairs
! HAZ1:   hazard:  attempt to hazard a constant
! HAZ2:   hazard:   a use is still outstanding
! HDR1:   header:  %string parameter in %begin ?
!  LD1:   load:  ADDRESS failed to simplify non-trivial address mode
!  LD2:   load:  real variable/integer register
!  LD3:   load:  inappropriate type
!  LD4:   load:  not/neg implemented in operate
!  LD5:   load:  load floating variable into 'any' ?
!  LD6:   load:  real operand with and/or/xor
!  LD7:   load:  real 'neg' implemented in operate
!  LD8:   load:  not a floating register
!  LD9:   load:  real exponent ?
! LIT?:   assemble:  ('O')  literal area still selected at line flag
! NLBL:   new label:  no free labels
! PICK:   pickup (in LOAD) incompatible uses of a register
! POPL:   pop lhs:  operand stack is already empty
! REL1:   release:  reg > fr14
! REL2:   release:  reg not claimed
! RXD1:   rxd:  no immediate form of instruction
! RXD2:   rxd:  faulty register specification
! RXD3:   rxd:  faulty register specification
! RXD4:   rxd:  non-elementary operand type supplied to 'RXD'
! RXD5:   rxd:  displacement not aligned on 'type' boundary
! SETB:   set both:  not at least two items on operand stack
! STK?:   assemble:  ('O')  operand stack not empty at line flag.
! TAG?:   block mark:  more than 32767 third pass tags generated. See c('_'):
! USNG:   assemble:  ('O')  'using' list not empty at line flag.
! VMAP:   vmap:  impossible form
! VSTK:   vstack:  variable no (symbol table index) out of bounds







! ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  == 
! Known Faults:
!      READ SYMBOL is not implemented properly
!      external linkage dumping is too indiscriminate
!      general name parameter types don't match old subsystem
! ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  == 
!*****************************************************************************
!
! Options:     (enabled when control bit = 1)
!
!       1: Capacity check on all store operations
!          Overflow check on integer multiply
!       2: Unassigned check on %string, %integer, %real & %longreal operands
!       4: Array bound checking
!          Checks for integrity of %for construction
!      16: Assorted extra checks:
!                              complete arithmetic overflow checking (*not yet*)
!      32: Permit removal of ALL diagnostic code and optimisations which are
!          not 100% safe.
!               Diagnostic code removed: 
!                                    Unassigned check on P in R string parameter
!                                    Stack limit check
!               Risky optimisations:
!                                    Remembering pointers over an assignment via
!                                    another pointer.  Aliasing might JUST occur.
!      64: Enable trace option
!     128: No register optimisation: primarily for suppressing compiler faults
!
! NOTE:
!          Switch references are always checked
!          Stack overflow is checked unless 'TRUSTED' is specified.
!
!******************************************************************************
!         N.B.  The bit positions in CONTROL corresponding to 256 and 512
!               are reserved to control the dumping of diagnostic tables
!               by PASS 3.
!
!               OPT is set (implicitly) by disabling all explicitly settable
!               checks (bits 1,2,4,8,16)
!
!               TRUSTED disables all checks and also sets the '32' bit.
!******************************************************************************





%begin;            !    7/32 DIAGNOSTIC ASSEMBLER
!SIZE CONSTANTS
%constinteger  max vars = 800
%constinteger  max labels = 80
%constinteger  max depth = 16
%constinteger  max stack = 25
%constinteger  max labdef = 7999
%constinteger  max refs = 2000
%constinteger SetLen = 32           {bytes per set}
%constinteger  max prim = 23
%constinteger  max cycle = 30
%constinteger  max temps = 60
%constinteger max use = 20;              !limit for klist
%constinteger max envirs = 5;            !Environments
%constinteger max knowledge = max use*(max envirs+1)
%conststring(3)  program ep = "%GO";     ! Main program external name
%conststring(1)  system prefix = "$";    ! prefixed to %system routine idents
%conststring(6)  trace routine = "$TRACE";   ! external called by trace option
%conststring(10)  read sym fn = "#READSYMFN";   ! linkage name of "read symbol" perm
%constinteger    ident len = 19;          ! Significant chars in internal idents
%constinteger    extern len = 12;        ! Max. length of names in diags/link

!Input/output streams
%constinteger  in=1
%constinteger  report=0, direct=1, object=2


! Language mask bits (generally =0 for 'obvious' or IMP interpretation)
! Note that each bit controls compilation of a particular source level
! abstraction and each first pass can select any convenient combination
! of options.
%constinteger    UNUSED            = 1,      {currently not used - IMP pass1!!}
               non IMP for         = 2    {exit on >= final value (zero trip)}

!CONTROL BITS
%constinteger  check capacity=1
%constinteger  check unass=2
%constinteger  check array=4,  check for = 4
%constinteger  check extra=16
%constinteger  trusted=32
%constinteger  trace=64
%constinteger  suppress=128
%constinteger  check bits = check capacity+check unass+check array+check extra

%constinteger  bit15 = -32768;          !  halfword sign-bit

!SPECIAL ADDRESSES
%constinteger  unass = 12;           ! unassigned pattern at unass(code)
%constinteger  init gla = 12;        ! first usable displacement into gla
%constinteger  init lit = 8;        ! first literal ends at  -INITLIT(CODE)

! Derived constants
%constinteger  for lab base = 8000;   ! = MAX LABDEF+1


!REGISTERS
%constinteger  R0 = 1
%constinteger  R1 = 2;     ! Fn/map result, @final string result
%constinteger            p3 = R1;    ! SPECIAL STRING PARAMETER
%constinteger  R2 = 3
%constinteger  R3 = 4
%constinteger  R4 = 5
%constinteger  R5 = 6,            p2 = R5
%constinteger  R6 = 7,            p1 = R6
%constinteger  R7 = 8,            wsp = R7
%constinteger  R8 = 9,    base1 = R8
%constinteger  R9 = 10,   base2 = R9
%constinteger  R10 = 11,  base3 = R10
%constinteger  R11 = 12,  base4 = R11
%constinteger  R12 = 13,  base5 = R12;   ! (unassigned pattern for levels 1:4)
%constinteger  R13 = 14,            gla = R13
%constinteger  R14 = 15,            code = R14
%constinteger  R15 = 16,            link = R15
%constinteger  FR0 = 17;       ! FN RESULT
%constinteger  FR2 = 18
%constinteger  FR4 = 19
%constinteger  FR6 = 20
%constinteger  FR8 = 21
%constinteger  FR10 = 22
%constinteger  FR12 = 23
%constinteger  FR14 = 24
!PSEUDO REGISTERS
%constinteger  any = 25
%constinteger  anyf = 26
%constbyteintegerarray  actual(0:fr14) = 0,
      0,   1,   2,   3,   4,   5,   6,    7,
!     R0   R1   R2   R3   R4   P2   P1   WSP

      8,   9,  10,  11,  12,  13,   14,   15,
!     R8   R9  R10  R11  R12  GLA  CODE  LINK

      0,   2,   4,   6,   8,   10,   12,   14
!    FR0  FR2  FR4  FR6  FR8  FR10  FR12  FR14
%constbyteintegerarray  breg(-1:5) =
      0,  0,  base1,  base2,  base3,  base4,  base5
!DATA FORMS
       ! EXTERNAL
%constinteger  recordformat = 4
%constinteger  switch = 6
%constinteger  array = 11
%constinteger  arrayname = 12
%constinteger  namearray = 13
%constinteger  namearrayname = 14
      ! INTERNAL
%constinteger  constant = 0
%constinteger  v in r = 1
%constinteger  av in r = 2
%constinteger  a in r = 3
%constinteger  v in s = 4
%constinteger  av in s = 5
%constinteger  a in s = 6
%constinteger  v in rec = 7
%constinteger  av in rec = 8
%constinteger  a in rec = 9
%constinteger  pgm label = 14
!!N.B. FORM=15 denotes %record format
! Flag bits used in conjunction with form:
%constinteger  quick conc   = 1,      {optimise:  S = S.tostring(symbol) }
               P in R       = 2,      {parameter-in-register}
               prim bit     = 4,      {primitive known to compiler}
               assigned     = 8,      {assigned and known to be}
               proc bit     = 16,     {routine/fn/map/predicate}
               abit         = 32,     {array by value}
               anbit        = 64,     {array by name}
               label bit    = 128     {data is an address}
%constinteger  array bits = abit ! anbit;      ! for convenience

! All arrays are in fact treated as by name (i.e. with a dope vector) and
! the ABIT bit is misused to indicate that an array is a candidate for
! subscript scaling by the use of 'multiply halfword'
%constinteger  cheap array bit = abit

! 'FLAG' byte of 'xform':

      !=======================================================================!
      !  label      AN      A   proc   assigned     prim   P in R    ------   !
      !   bit       bit    bit   bit                bit                       !
      ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - !
      !   128       64     32    16        8         4       2         1      !
      !=======================================================================!
!                                              :                              !
!                                              :    D I M E N S I O N S       !
!                                              :       (if %array)            !
!                                              :______________________________!
! N.B.
!      In 'varfm' the 4,2,1 bits are used to hold the number of dimensions
!      when the table entry represents an array object.  This field is
!      unpacked into the 'DIM' field of 'stackfm' by 'VSTACK'

!LABEL CONSTANTS
%constinteger  define new = 0
%constinteger  redefine old = 1
%constinteger  internal tag = -1;   ! N.B. This must be <0 and others >=0
!DATA TYPES
%constinteger  integers = 1
%constinteger  short = 2
%constinteger  byte = 3
%constinteger  general = 4
%constinteger  strings = 5
%constinteger  records = 6
%constinteger  reals = 7
%constinteger  reall = 7;   ! (SET TO 8 FOR LONG REALS)
!Figurative data types used internally (reduce to INTEGERS)
!!  %constinteger  pointer = -1
!!  %constinteger  in store const = -2
!LENGTHS
%constinteger  single=4;     ! bytes in single precision %real
%constinteger  double = single*(reall-reals+1)
%constinteger  align = 3;      ! Basic alignment mask
%constinteger  reglen=4;           !  no. of bytes in GP register
%constinteger  basic frame = (link-p2+1)*reglen
!OWN INFO
%constinteger  own = 1
%constinteger  con = 2
%constinteger  external = 3
%constinteger  system = 4
%constinteger  dynamic = 5
%constinteger  primrt = 6
%constinteger  permrt = 7


! Constants used to define sizes of various objects known to pass 3
%constinteger  short ident = 6;   ! characters: related to 'extern len' !!
%constinteger  basic vdiag = 4;   ! halfwords:  no. req'd for 'short ident'
%constinteger  extra vdiag = 2;   ! halfwords:  basic+extra == extern len




! Define type codes known externally (to pass 3 and user):
%constbyteintegerarray  gen map(integers:reals+1) =
      1,      6,      5,      0,      3,      4,      2,      8
! integer  short   byte   general  string  record  reals   reall

!PERM ROUTINES
!  ** UNASSIGNED CHECK as a special at 0(code) **
%constinteger  asschk=1

%constinteger  iexp=2
%constinteger  fexp=3;     ! floating exponent
%constinteger  smove=4
%constinteger  sjam=5
%constinteger  sconc=6
%constinteger  sresln=7;   !  conditional resolution
%constinteger  sresv=8;    !  check SRESLN succeeded
%constinteger  scomp=9
%constinteger  frac part = 10;  !  IMP 'frac pt' function
%constinteger  sfcap=11;   !  string capacity exceeded
%constinteger  substr = 12;    !  substring
%constinteger  aref1=13;   !  1-D with checks
%constinteger  aref2=14;   !  2-D with checks
%constinteger  aref3=15;   !  n-D with checks
%constinteger  aref4=16;   !  2-D without checks
%constinteger  set dv=17;  !  set dope vector
%constinteger  alloc=18;    !  claim array space
%constinteger  swjump=19
%constinteger  signal=20
%constinteger  mulchk=21;   ! check for 32-bit result from integer multiply
%constinteger  cap16=22;   !  check for 16-bit signed overflow
%constinteger  cap8=23;    !    . . .    8-bit unsigned   . .
%constinteger  fchk1=24;   !  %for loop parameter check
%constinteger  fchk2=25;   !  check for %for loop counter fiddling
%constinteger  pentc=26;    !  checked procedure entry
%constinteger  rcopy=27;   !  record copy
%constinteger  rzero=28;   !  clear record
%constinteger  vschk=29;    !  variable shift parameter check
%constinteger  smovopt=30;   ! fast unchecked string move (also see P in R string)
%constinteger  chmap=31;   !  IMP 'charno' %map
%constinteger  freesp=32;   !  IMP 'free space' function
%constinteger  int fn=33;   !  IMP 'int' function
%constinteger  rcomp = 34     {record compare}
%constinteger set comp = 35,
              set union = 36,
              set difference = 37,
              set intersection = 38

%constbytearray Set ops(1:3) = Set union, Set Difference, Set intersection

%constinteger  iocp = 49
%constinteger  enter trace = 50

!OPERATIONS
!            logical   => both <=  code generator
%constinteger  not = 1,             lw = 1
%constinteger  neg = 2,             st = 2
%constinteger            add = 3
%constinteger            sub = 4
%constinteger            mul = 5
%constinteger            div = 6
%constinteger  conc = 7,            cmp = 7
%constinteger            and = 8
%constinteger            or  = 9
%constinteger            xor = 10
%constinteger            lsh = 11
%constinteger            rsh = 12
%constinteger           mult16 = 13
%constinteger  rem = 14
%constinteger  exp = 15
%constinteger  rexp = 16
%constinteger  rdiv = 17

!CODE GENERATOR TABLES
!  mask bits in 'op index' array
%constinteger  fw imm=2048, hw imm=4096, sf imm=8192, inv imm=16384
%constinteger  fw rr=256, fw rx=512, short rx=1024, byte rx=32768
%constinteger  fp base = rem-1
%constshortintegerarray op index(1:40) =
      x'FF01',;  ! LW: load - 1 + all formats
      x'8609',;  ! ST: store - 9 + full/half word + byte
      x'7F11',;  ! ADD: add  - 17 + all but byte
      x'7F18',;  ! SUB: subtract - 24 + all but byte
      x'031F',;  ! MUL: multiply - 31 + full word formats
      x'0321',;  ! DIV: divide - 33 + full word formats
      x'1F23',;  ! CMP: compare - 35 + all but byte and short immediate
      x'1F28',;  ! AND: and - 40 +              .....
      x'1F2D',;  ! OR:  or - 45 +              ......
      x'1F32',;  ! XOR: xor - 52 +            ........
      x'3037',;  ! LSH: left shift - 55 + halfword and shortform
      x'303D',;  ! RSH: right shift - 61 + halfword and shortform
      x'0775',;  ! MULT16: 117 + rr + rx + short rx
! ** floating point formats **
      x'0F43',;  ! LW: load - single and double
      x'0A47',;  ! ST: store - store reference formats only
      x'0F4B',;  ! ADD: add - 75 + all formats
      x'0F4F',;  ! SUB: subtract - 79 + ...
      x'0F53',;  ! MUL: multiply - 83 + ...
      x'0F57',;  ! DIV: divide - 87 + ...
      x'0F5B',;  ! CMP: compare - 91 + ...
! ** specials **
   x'0364', ;                 ! JMP
   x'0366', ;                 ! BAL
   x'0267', ;                 ! LA
   x'0268', ;                 ! LM
   x'0269', ;                 ! STM
   x'016B', ;                 ! FLR
   x'016C', ;                 ! FXR
   x'1F5F', ;                 ! CLW
   x'1069', ;                 ! SRA
   x'016E', ;                 ! CHVR
   x'016F', ;                 ! LBR
   x'040A', ;                 ! STH
   x'026F', ;                 ! SVC
   x'0270', ;                 ! LME
   x'0271', ;                 ! STME
   x'1870', ;                 ! TEST  (TI/THI)
   x'0476', ;                 ! LHL (short rx only)
   x'0678', ;                 ! AM (fullword and short rx only)
   x'027A', ;                 ! TBT
   x'027B'  ;                 ! SBT


! Each halfword below is treated as 4 groups of 4 bits  [a:b:c:d] with the
! following significance.
! a,b:  8-bit machine op-code
! c:    special function bits
!                     1:  this operation sets condition code other than relative
!                                                                     to zero.
!                     2:  invert order of operands to provide for example
!                               STR x,y => LR y,x
!                     4:  this operation doesn't affect condition code
! d:    mask to check alignment of displacement required by this instruction.

%constshortintegerarray  op code(1:124) =
x'0800', x'5803', x'4801', x'F800', x'C800', x'2400', x'2500', x'D350',
!   LR       L        LH       LI      LHI      LIS      LCS      LB
x'0820', x'5053', x'4051',     0,       0,       0,       0,   x'D250',
!   STR      ST      STH       --       --       --       --      STB
x'0A00', x'5A03', x'4A01', x'FA00', x'CA00', x'2600', x'2700',
!   AR       A        AH       AI      AHI      AIS      SIS
x'0B00', x'5B03', x'4B01', x'FB00', x'CB00', x'2700', x'2600',
!   SR       S        SH       SI      SHI      SIS      AIS
x'1C50', x'5C53',
!   MR       M
x'1D50', x'5D53',
!   DR       D
x'0910', x'5913', x'4911', x'F910', x'C910',
!   CR       C        CH       CI      CHI
x'0400', x'5403', x'4401', x'F400', x'C400',
!   NR       N        NH       NI      NHI    
x'0600', x'5603', x'4601', x'F600', x'C600',
!   OR       O        OH       OI      OHI
x'0700', x'5703', x'4701', x'F700', x'C700',
!   XR       X        XH       XI      XHI
    0,       0,       0,       0,   x'ED00',  x'1100',
!   --       --       --       --      SLL      SLLS   
    0,       0,       0,       0,   x'EC00',  x'1000',
!   --       --       --       --      SRL      SRLS   
x'2800', x'6803', x'3800', x'7803',
!  LER       LE      LDR       LD
x'2820', x'6053',     0,   x'7053',
! STER      STE      --       STD
x'2A00', x'6A03', x'3A00', x'7A03',
!  AER       AE      ADR       AD
x'2B00', x'6B03', x'3B00', x'7B03',
!  SER       SE      SDR       SD
x'2C00', x'6C03', x'3C00', x'7C03',
!  MER       ME      MDR       MD
x'2D00', x'6D03', x'3D00', x'7D03',
!  DER       DE      DDR       DD
x'2910', x'6913', x'3910', x'7913',
!  CER       CE      CDR       CD 

! Special purpose entries.
x'0510', x'5513', x'4511', x'F510', x'C510',
!  CLR      CL      CLH      CLI      CLHI
x'0300', x'4300',
! BFCR     BFC
x'0100', x'4100',
! BALR     BAL
         x'E650',
!           LA   
         x'D150',
!           LM
         x'D050',
!          STM
x'2F00',
! FLR
x'2E00',
! FXR
                            x'EE10',
!                             SRA
x'1200',
! CHVR  
x'9350',
! LBR
         x'E110',
!          SVC
         x'7250',
!          LME
         x'7150',
!          STME
                           x'F310', x'C310',
!                            TI       THI
x'0C50', x'4C51', x'4C51',
! MHR     M(H)      MH
                  x'7301',
!                   LHL
         x'5113', x'6111',
!          AM      AHM
         x'7401', x'7501'
!          TBT      SBT

!Non-uniform operations for special situations
%constinteger  jmp=21, always=r0;   !  RR(JMP,always,LINK)
%constinteger  bal=22;      ! Branch-and-link
%constinteger  la =23;      ! Load Address (RX format)
%constinteger  lm=24, stm=25;       ! Load/Store Multiple
!   ** FLR below is really 25-fpbase **
%constinteger  flr=26-fpbase, fxr=27;      ! Float/Fix (RR format only)
%constinteger  clw=28;      ! Compare Logical  (same formats as AND)
%constinteger  sra=29;      ! Shift Right Arithmetic (HW IMM only)
%constinteger  chvr=30;     ! Convert to halfword value (RR only)
%constinteger  lbr=31;      ! Load Byte Register (RR only)
%constinteger  sth=32;      ! Store half-word (Short RX only)
%constinteger  svc=33;      ! Supervisor call (RX format)
%constinteger  lme=34-fpbase;      ! Used in conjunction with SVC
%constinteger  stme=35-fpbase;     !     .... ditto ....
%constinteger  test=36;     !  test halfword? immediate
%constinteger  LHL=37;      ! load unsigned halfword (for switch)
%constinteger  AM=38;        ! add-to-memory (see ASSIGN)
%constinteger TBT = 39, SBT = 40


%constbytearray Inverted(16:21) =
      0,  1,  3,  2,  5,  4
   {  =   #   <   >   <=  >= }

!ASSORTED FUNNY CONSTANTS
%constinteger  jump=12;   ! logical condition code == unconditional jump
%constinteger  not equal=1; !       . . .             branch not equal
%constinteger  less than=2,     greater than=3
%constinteger  less or equal=4, greater or equal=5

!CODES USED IN OUTPUT FOR 3RD. PASS
%constinteger  tag def = 1
%constinteger  r ref = 2;   ! Routine/fn/map/predicate reference
%constinteger  p ref = 3;   ! Prim reference
%constinteger  sw ref = 4;  ! Switch reference
%constinteger  j ref = 5;   ! Jump reference
%constinteger  c ref = 6;   ! Conditional (jump) reference
%constinteger  code item = 7
%constinteger  gla  item = 8
%constinteger  line flag = 9
%constinteger  line reset = 10
%constinteger  var diag = 11
%constinteger  code area  = 12
%constinteger  lit area  = 13
%constinteger  lit  org  = 14
%constinteger  frame patch = 15
%constinteger  block start = 16
%constinteger  block end = 17
%constinteger  prog end = 18
%constinteger  c rel    = 19
%constinteger  g rel    = 20
%constinteger  extern   = 21
!          (external references)
%constinteger  data ref = 4,  data defn = 5
%constinteger   ep  ref = 6,   ep  defn = 7


%recordformat  varfm(%integer  disp, %c
                     %shortinteger  format,extra,length,header,  %c
                     (%shortinteger  xform %or %byteinteger  flag,form),
                     %byteinteger   base,type)
%record(varfm)%array  var(0:max vars)
%record(varfm)%name   decvar
%record(varfm)%name   fp, ap
%ownrecord(varfm)     begin = 0

%recordformat  stackfm(%integer  disp,
                     %shortinteger  format, extra, length, header, rt,
                     %shortinteger  var no, type,
                     (%shortinteger  xform %or %byteinteger flag,form),
                     (%short xbase %or %byte index, base),
                     %byte dim, oper,
                     %record(stackfm)%name  link)
%record(stackfm)%array  stak(0:max stack)
%record(stackfm)%name   desc asl

%recordformat sptfm(%record(stackfm)%name  v)
%record(sptfm)%array  stacked(1:max depth)

! elements of USING list
%recordformat  dfm(%record(stackfm)%name  d,  %record(dfm)%name  link)
%record(dfm)%array  dlist(0:max stack)
%record(dfm)%name   dasl
%record(dfm)        using

! for compiling %for/%repeat pairs
%recordformat  cyclefm(%integer  cv disp, fv disp,  %c
                       %shortinteger  lab, shadow, initial, cv form, %c
                       %byteinteger   reg, cv type, cv base,  %c
                                      fv base, temp base)
%record(cyclefm)%array  for stk(0:max cycle)
%record(cyclefm)%name   for;       !  points to currently active level
%owninteger  for stp=0

! mechanism to minimise no of temporaries allocated
%shortintegerarray  temps(1:max temps)
%owninteger  temp base = 0, next temp = 0,  new temp = 0

! list terminator
%constrecord(*)%name  null == (0)

%recordformat  labelfm(%shortinteger  id, tag)
%record(labelfm)%array  labels(1:max labels)

%ownintegerarray  activity(0:fr14) = 0(*)
%owninteger  claimed = 0


%ownshortinteger  control = check bits & (\check extra)
%ownshortinteger  diagnose = 0
      !   1:  trace calls on descriptor stack handling primitives
      !   2:  . . . . . . . . . LOAD
      !   4:  . . . . . . . . . ASSIGN
      !   8:  . . . . . . . optimisation routines and display generated code
      !  16:  dump 'knowledge' list every time CHEAPEN is called with '8' bit on

%owninteger  level = -1
%owninteger  main ep = 0;             ! non-zero if compiling main program
%owninteger  unassigned rtn = 0;      ! non-zero if unassigned check routine pr in

%integer     j,k,len,n,val,aparm,opr
%owninteger  ca = 0;               ! CODE ADDRESS
%owninteger  ga = init gla;        ! GLA ADDRESS
%owninteger  lita = 0;   ! Literal address: current address
%owninteger  litmax=0;   !                : limit of area claimed so far
%owninteger  diag1 = 0;            ! DIAG TABLES 1
%owninteger  diag2 = 0;            ! DIAG TABLES 2
%owninteger  cc ca=0, cc reg=0;    ! to remember condition code

%integer     sym, next;            ! CODE SYMBOL, NEXT SYMBOL
%integer     vlb,vub;              ! VECTOR LOWER/UPPER BOUND
%integer     Allocate;              ! Flag for array(#0) or arrayformat (=0)
%integer     Falign                 {alignment of internal formats}
%owninteger  current line = 0;     ! SOURCE LINE NUMBER
%owninteger  last line = 0
%owninteger  stp = 0;              ! STACK POINTER
%integer     data size;            ! CURRENT DATA ITEM SIZE
%owninteger  frame = 0;            ! LOCAL STACK FRAME EXTENT
%owninteger  extra frame = 0;      ! ALLOW EXTRA FRAME FOR STATIC ARRAYS
%integer     parms;                ! START OF PARAMETER STACK
%integer     local;                ! LOCAL BASE REGISTER
%owninteger  invert = 0, swopped = 0;   ! CONDITION INVERSION FLAGS
%owninteger  uncond jump = 0;      ! ADDRESS OF CODE HOLE
%owninteger  gtype = 0;            ! 0=RECORDS, 1=PROCEDURE
%owninteger  gmode = 0;            ! NON-ZERO INSIDE PARAMETER LISTS
%integer     decl;                 ! LAST-DEFINED DESCRIPTOR
%ownshortinteger  language mask = 0;   ! selects language specific options
%integer cheap reg;                !Preferred register after ADDRESS
%integer  otype, owntype, ownform, spec, frozen, potype
%integer  diag type=0, diag form=0, diag size=0;   ! external form/type/size 
%longreal    rvalue
!! Initialised to suppress critical unassigned check when compiling itself
%owninteger  ownval = 0, mantissa = 0;  ! *order critical*
%integer  oarea
%integer  dim,dv
%integer     wdisp, pdisp, gdisp

%owninteger  block no = 0;       ! Ordered by block head
%owninteger  defns=0, specs=0, relocations=0, var diags=0
%owninteger  total ca = 0
%owninteger  last ca = -1;      ! Used by 'set line'
%owninteger  trace flag = 0;    ! controls calling of DUMP TRACE routine

%integer     jtag;                 ! Set by 'JUMP TO'
%ownstring(ident len)  external id = "", alias = "", block name = ""
%ownstring(ident len)  internal id = ""
%owninteger  faulty=0
%owninteger  null string = 0

%byteintegername   cslen
%byteintegerarray  current string(0:255)

! Register optimisation scratch pad

%owninteger Last Gpr = 1,
            Last Fpr = Fr0,
            Last EO  = 1

%recordformat  kfm(%record(kfm)%name  link, array,
                  %integer  disp,
                  %shortinteger reg,
                  %byteinteger  type, form, base, ktype)
%record(kfm)%array  knowledge(1:max knowledge)
%ownrecord(kfm)%name   klist == (0), kasl == (0)
%integer known regs = 0;      ! bit mask: must contain at least ANYF+1 bits
%integer in use = 0;          !counter to limit active uses

!Environment control

%recordformat envfm(%integer label, in use, known, %record(kfm)%name link)
%record(envfm)%array envir(1:max envirs)
%owninteger envp = 0


! Code generation routine specs
%routinespec  rr(%integer  op,r1,r2)
%routinespec  rx(%integer  op,r1,base,disp)
%routinespec  rxi(%integer  op,r1,base,disp)
%routinespec  rxd(%integer  op,r1,%record(stackfm)%name  v)
%routinespec set line

!                                                             >> SHOW <<
%routine  show(%record(stackfm)%name  v)
   write(v_varno,2);  print symbol(':')
   write(v_type,3);  write(v_form,2);  write(v_flag,2)
   write(v_base,3);  write(v_disp,5)
   write(v_length,3)
   write(v_extra,3);  write(v_format,3)
   write(v_header,3);  write(v_dim,3)
   %if v_oper # 0 %start
      write(v_oper,2);  newline
      print string("         +")
      show(v_link)
   %else
      newline
   %finish
%end

!                                                            >> ABORT <<
%routine  abort(%integer  code)
%record(dfm)%name  dd
%integer  j
   select output(report)
   print string("*Compiler error '")
   print symbol( (code>>j)&255 ) %for j = 24,-8,0
   print string("' at line");  write(current line,1)
   newline
   print string("Please seek assistance!!");  newline
   %if stp # 0 %start
      print string("STACK:");  newline
      show(stacked(j)_v) %for j = 1,1,stp
   %finish
   %unless using_link == null %start
      print string("USING:");  newline
      dd == using_link
      %cycle
         show(dd_d)
         dd == dd_link;  %exit %if dd == null
      %repeat
   %finish
   select output(object)
   %signal 15,15;         ! %IF diagnose < 0
%end;          !  abort

!                                                             >> WARN <<
%routine  warn(%integer  n)
%switch  w(1:8)
   select output(report)
   print string("*WARNING: line")
   write(current line, 1);  print string(": ")
   -> w(n)
w(1): print string("division by zero");  -> at
w(2): print string("Illegal FOR");  -> at
w(3): print string("Non-local control variable?");  -> at
w(4): print string("Invalid parameter for READ SYMBOL");  -> at
w(5): print string("String constant too long");  -> at
w(6): print string("No. of shifts outwith 0..31");  -> at
w(7): print string("Illegal constant exponent");  -> at
w(8): print string("Numerical constant too big");  -> at
at: newline
   select output(object)
%end

!                                                          >> MONITOR <<
%routine  monitor(%record(stackfm)%name  v, %string(15) text)
   select output(report)
   print string(text);  print symbol(':')
   spaces(9-length(text))
   show(v)
   select output(object)
%end

!                                                         >> FLOATING <<
%predicate  floating(%record(stackfm)%name v)
! check descriptor for floating point quantity
   %true %if (v_type >= reals %and v_type # 255) %or (v_oper # 0  %c
                                     %and v_link_type >= reals)
   %true %if v_oper >= rexp
   %false
%end

!                                                             >> ZERO <<
%predicate  zero(%record(stackfm)%name  v)
! CHECK DESCRIPTOR FOR (INTEGER) ZERO
   %false %if v_disp # 0 %or v_base # 0 %or constant # v_form # AV in S
   %false %if v_oper # 0
   %true
%end

!                                                            >> CONST <<
%predicate  const(%record(stackfm)%name  v)
! CHECK DESCRIPTOR FOR CONSTANT (INTEGER) VALUE
   %false %unless v_form = constant %and v_oper = 0
   %false %if v_type > byte
   %true
%end

%integerfn Min Record Size(%record(stackfm)%name A, B)
   %integer N, M
   N = A_Format;  N = Var(N)_Length&x'FFFF' %if N # 0
   M = B_Format;  M = Var(M)_Length&x'FFFF' %if M # 0
   N = M %if N = 0 %or (M # 0 %and M < N)
   %result = N %if N > 0
   Abort(m'Rec0')
%end
!                                                             >> SAME <<
%integerfn POWER(%integer n)
   %integer j, ref
   ref = 1
   %for j = 1, 1, 14 %cycle
      ref = ref<<1
      %if ref >= n %start
         %if ref = n %then %result = j %else %result = -1
      %finish
   %repeat
   %result = -1
%end

%predicate  same(%record(stackfm)%name  v,w)
! Test whether or not V and W describe the same object.
   %true %if v_disp = w_disp %and v_base = w_base      %c
         %and v_type = w_type %and v_form = w_form %and v_extra = w_extra
   %false
%end

!                                                      >> IN FREE REG <<
%predicate in free reg(%record(stackfm)%name  v)
!  TRUE if v is in a useable register
   %false %unless v_form = v in r %and activity(v_base) <= 1
   %true
%end

!                                                             >> TEMP <<
%integerfn  temp
! Allocate a temporary 4 bytes long
%integer t
   %if next temp = new temp %start;            ! no spare temps outstanding
      t = (frame+3)&(\3)
      frame = t+4
      %result = t %if new temp = max temps;    ! temp buffer overflow
      new temp = new temp + 1
      temps(new temp) = t
   %finish
   next temp = next temp + 1
   %result = temps(next temp)&x'FFFF'
%end

!                                                              >> TAG <<
%integerfn  tag
   %integer s1, s2
   s1 = next
   readsymbol(s2)
   readsymbol(next)
   %result = s1<<8!s2
%end

!                                                            >> GET D <<
%routine  get d
   %longreal p
   %integer  i, n
   %real ten,one
   n = 10 ; rvalue = n    {initial base}
   n = 1; one = n
   n = tag;  read symbol(next);    ! Skip comma
BASE:
   ten = rvalue
   rvalue = 0
   %cycle
      sym = next;  read symbol(next)
      %exit %if sym = '.'
      n = n-1
      -> power %if sym = '@'
      -> base  %if sym = '_'
      sym = sym-'A'+'0'+10 %if sym >= 'A'
      rvalue = rvalue*ten+(sym-'0')
      -> SIGN %if n = 0
   %repeat
   p = one
   %cycle
      n = n-1;  -> SIGN %if n = 0
      sym = next;  read symbol(next)
      -> POWER %if sym = '@'
      sym = sym-'A'+'0'+10 %if sym >= 'A'
      p = p/ten
      rvalue = rvalue + (sym-'0')*p
   %repeat
POWER:
   n = tag
   n = n ! 16_FFFF0000 %if n&16_8000 # 0
   rvalue = rvalue * (ten^n)
SIGN:               ! sign of whole value
   %if next = 'U' %start
      read symbol(next)
      rvalue = -rvalue
   %finish
%end

!                                                          >> RELEASE <<
%routine  release(%integer  reg)
! Hazard the value in a register
   abort(m'REL1') %if reg > fr14
   %return %if reg = 0 %or activity(reg) < 0;  ! LOCKED
   activity(reg) = activity(reg)-1
   abort(m'REL2') %if activity(reg) < 0
   claimed = claimed - 1
%end

!                                                            >> CLAIM <<
%routine  claim(%integer  reg)
! Cherish the value in a register
   abort(m'CLM1') %if reg > fr14
   %return %if reg = 0 %or activity(reg) < 0
   activity(reg) = activity(reg)+1
   claimed = claimed+1
%end

%routinespec  forget reg(%integer  mask)
%routinespec  forget all
%routinespec forget var(%record(stackfm)%name v)
!                                                           >> HAZARD <<
%routine  hazard(%integer  reg)
! Protect the value in register REG by storing in a temporary.
%integer  n, t, tot
%record(dfm)%name  p
%record(stackfm)  u
         %routine  mod(%record(stackfm)%name  v)
            %switch  sw(0:a in rec)
            v_base = local
            n = n-1
            -> sw(v_form)
         sw(a in rec):
         sw(av in rec):
         sw(v in rec):
            %if tot = 1 %start
               claim(reg);  rx(lw,reg,reg,v_extra)
               u_type = integers
               v_extra = t
               -> OUT2
            %finish
         sw(constant): abort(m'HAZ1')
         sw(v in s):   %if v_disp = 0 %start
                          v_disp = t;  v_form = a in s;  ->out1
                       %finish
         sw(a in s):
         sw(av in s):
      !  change (X in S) to (X in REC)
            v_form = v_form + 3;  v_extra = t;  -> OUT1
         sw(v in r): v_form = v in s;  v_disp = t
            v_type = u_type
         OUT1:
            v_flag = v_flag ! assigned
         OUT2:
         %end

   n = activity(reg);  %return %if n <= 0;  ! NOT IN USE OR CLAIMED
   tot = n
   claimed = claimed - n
   activity(reg) = 0
   t = temp;      ! ** needs a parameter to deal with 8-byte reals **
   u_type = integers
   u_type = reals %if FR0 <= reg <= FR14
   p == using_link
   %cycle
      %exit %if p == null
      mod(p_d) %if p_d_base = reg
      p == p_link
   %repeat
   u_xbase = local;  u_disp = t
   u_xform = V in S ! (assigned << 8)
   rxd(st,reg,u)
   forget var(u)
   abort(m'HAZ2') %if n # 0;      ! USE STILL OUTSTANDING
%end

!                                                       >> HAZARD ALL <<
%routine  hazard all
%integer  j
   forget reg(-1) 
   %if claimed # 0 %start;            ! at least one register claimed
      hazard(j) %for j = r0,1,fr14
   %finish
%end

! REGISTER OPTIMISATION ROUTINES
%constinteger  register contents = 1

   %routine Reset Optimisation Data
      %integer J
      Last Gpr = 1
      Last Fpr = Fr0
      Last EO  = 1
      Envp    = 0
      Known Regs = -1
      In Use = 0
      Kasl == Null
      Klist == Null
      %for j = 1,1,max knowledge %cycle
         knowledge(j)_Link == Kasl
         Kasl == knowledge(j)
      %repeat
      %for j = 1,1,max envirs %cycle
         Envir(j)_Label = 0
         Envir(j)_Link == Null
      %repeat
   %end

!                                                            >> DUMP OPT LIST <<
%routine  dump opt list
   %record(kfm)%name  p
   select output(report)
   p == klist
   %if p == null %start
      print string("*opt list empty")
      newline
   %else
      %cycle
         write(p_type,1);  write(p_form,1)
         write(p_disp,3);  print symbol('(')
         write(p_base,-1);  print string(") =")
         write(p_reg,1);  newline
         p == p_link
      %repeat %until p == null
   %finish
   select output(object)
%end;         ! dump opt list

!                                                                  >> K ENTRY <<
%record(kfm)%map  k entry(%record(stackfm)%name  v, %integer  fuzz)
   %record(kfm)%name  p,q
   fuzz = \fuzz
   p == k list
   q == null
   %while %not p == null %cycle
      -> FOUND %if (p_disp!!v_disp)&fuzz = 0 %and p_base = v_base
      q == p
      p == p_link
   %repeat
   %result == null;      ! failure
FOUND:
   %if %not q == null %start;         ! promote if not first item already
      q_link == p_link
      p_link == klist
      klist == p
   %finish
   %result == klist
%end;      ! k entry

!                                                                >> NEW KCELL <<
%record(kfm)%map  new kcell
   %record(kfm)%name  p, q
   %integer  n
   %if kasl == null %or in use >= max use %start;            ! no free cells left
      ! In extremis so reclaim last item from KLIST.
      p == klist;  q == null
      n = max use
      %cycle
         n = n-1
         %exit %if p_link == null
         q == p
         p == p_link
      %repeat
      abort(m'OPT1') %if n # 0
      q_link == null;      ! truncate KLIST
      p_link == kasl;  kasl == p;         !give on back
      in use = in use-1
   %finish
   p == kasl;  kasl == kasl_link
   in use = in use+1;  abort(m'Opt3') %if in use > max use
   p = 0
   %result == p
%end;      ! new kcell

!                                                                >> ASSOCIATE <<
%routine  associate(%record(stackfm)%name  v, %integer  reg)
   %record(kfm)%name  p
   %return %if reg = R0 %or V_Base = Reg
   p == k entry(v,0)
   %if p == null %start;      ! new entry
      p == new kcell
      p_link == klist
      klist == p
   %else;      ! re-use this cell
      forget reg(1<<p_reg)
   %finish
   p_reg = reg
   p_base = v_base
   p_disp = v_disp
   p_type = v_type
   p_form = v_form
   p_ktype = register contents
   known regs = known regs ! (1<<reg)
   known regs = known regs ! (1<<p_base) %if activity(p_base) >= 0;   ! unlocked ?
%end;      ! associate

!                                                                  >> CHEAPEN <<
%routine  cheapen(%record(stackfm)%name  v, %integer  mode)
!! modes:  >= 0:  looking for value
!           < 1:  looking for address
   %record(kfm)%name  p
   %integer  reg, form, type
   form = v_form;  type = v_type
   p == k entry(v,0)
   %return %if p == null
   v_flag = v_flag ! assigned %if p_form = V in S;      ! it's at least assigned
   %return %if p_reg = 0;                     !*psr* Nothing known
   cheap reg = p_reg %if form # AinS %and p_type = Type
   %return %if mode < 0 %and form = V in S;   !  V in S on left-hand side
   reg = p_reg
   %if form = A in S %and p_type = integers %and p_form = V in S %start
      release(v_base);  claim(reg)
      v_base = reg;  v_disp = 0;  v_Xform = V in S  {changed to Xform - PSR}
      cheapen(v,mode)
   %else
      %return %if p_type # type %or p_form # form
      release(v_base);  claim(reg)
      v_base = reg;  v_disp = 0;  v_Xform = V in R {changed to Xform - PSR}
   %finish
   %if diagnose < 0 %start
      monitor(v, "CHEAPENED")
      dump opt list %if diagnose & 16 # 0
   %finish
%end;         ! cheapen

!!! * * * * * This needs to be a bit brighter * * * * *
!                                                               >> FORGET VAR <<
%routine  forget var(%record(stackfm)%name  v)
   %record(kfm)%name  p
!!!!!   p == k entry(v, align)
!!!!!   forget reg(1<<p_reg) %unless p == null

   %cycle
      p == k entry(V, align)
      %return %if p == null
      p_base = anyf+1            {invalid entry}
   %repeat

%end;      ! forget var

!                                                               >> FORGET REG <<
%routine  forget reg(%integer  reg mask)
   %record(kfm)%name  p
   %return %if known regs & reg mask = 0;   ! for speed:  nothing to do
   reg mask = reg mask & (\1);      ! R0 = 1 not 0
   known regs = known regs & (\reg mask)
   p == klist
   %if reg mask < 0 %start;         ! forget the lot
      %while %not p == null %cycle
         p_base = anyf+1 %if regmask & (1<<p_base) # 0;   ! invalidate entry
         p_reg = 0
         p == p_link
      %repeat
   %else;                           ! selective forget
      %while %not p == null %cycle
         p_base = anyf+1 %if reg mask & (1<<p_base) # 0;   ! invalidate entry
         p_reg = 0 %if reg mask & (1<<p_reg) # 0;       ! forget reg association
         p == p_link
      %repeat
   %finish
   ! Clean up any old kcells which can be recovered easily
   %while klist ## null %and klist_base = anyf+1 %cycle
      p == klist;  klist == klist_link
      p_link == kasl
      kasl == p
      in use = in use-1
   %repeat
   abort(m'Use?') %if in use < 0
%end;         ! forget reg

!                                                               >> FORGET ALL <<
%routine  forget all
   %record(kfm)%name  p
   %if %not klist == null %start
      p == klist
      %cycle
         in use = in use-1
         %exit %if p_link == null
         p == p_link
      %repeat
      p_link == kasl
      kasl == klist
      klist == null
   %finish
   abort(m'Fall') %unless in use = 0
   known regs = 0
%end;      ! forget all
!environment control

   %record(envfm)%map environment(%integer label)
      %record(envfm)%name E
      %integer j
      %if label > 0 %start
         %for j = 1,1,max envirs %cycle
            E == envir(j)
            %result == E %if E_label = label
         %repeat
      %finish
      %result == null
   %end
   %record(envfm)%map new env(%record(envfm)%name E)
      %record(kfm)%name K
      %if E == null %start
         envp = envp+1;  envp = 1 %if envp > max envirs
         e == envir(envp)
      %finish
      k == E_link
      %unless k == null %start
         k == k_link %while k_link ## null
         k_link == kasl
         kasl == E_link
      %finish
      E_in use = 0
      E_label = 0
      E_link == null
      %result == E
   %end
   %record(kfm)%map Ecopy(%record(kfm)%name L)
      %record(kfm)%name K
      %result == null %if l == null
      abort(m'Ecop') %if kasl == null
      k == kasl;  kasl == k_link
      k = l
      k_link == Ecopy(l_link)
      %result == k
   %end
   %routine restore environment(%integer label)
      %record(envfm)%name E
      %record(envfm) temp
      temp_link == klist
      e == new env(temp)            {release current environment}
      E == environment(label)
      %if E == null %start
         klist == null
         known regs = 0
         in use = 0
      %else
         klist == Ecopy(E_link)
         known regs = E_known
         in use = E_in use
      %finish
   %end
   %routine remember environment(%integer label)
      %record(envfm)%name E
      %return %if label <= 0
      E == environment(label)
      E == new env(E)
      E_label = label
      E_known = known regs
      E_in use = in use
      E_link == Ecopy(klist)
   %end
   %routine merge environment(%integer label)
      %record(ENVFM)%name e
      %record(kfm)%name K, end, X
      %record(kfm) khead
      %routine MERGE(%record(kfm)%name K)
         %record(kfm)%name p
         p == klist
         %while p ## null %cycle
            %if p_disp = k_disp %and
                p_reg  = k_reg  %and
                p_base = k_base %and
                p_form = k_form %and
                p_type = k_type %and
                p_ktype= k_ktype  %start
                  {*****Beware when array opt is put in***}
                end_link == k
                end == k
                E_known = E_known ! (1<<p_reg) ! (1<<p_base)
                E_in use = E_in use+1
                %return
            %finish
            p == p_link
         %repeat
         k_link == kasl;  kasl == k
      %end
      E == environment(label)
      %if E ## null %start
         k == E_link
         e_link == null
         e_in use = 0
         e_known = 0
         khead_link == null;  end == khead
         %while k ## null %cycle
            x == k_link
            merge(k)
            k == x
         %repeat
         end_link == null
         e_link == khead_link
      %finish
   %end

!                                                              >> GPR <<
%integerfn  gpr
! Get a general (integer) register
%constinteger nregs=8
%constbyteintegerarray  pref(1:nregs) =
         P1, P2, R4, R9, R10, R11, R3, R12
%integer  r,j,mask
   mask = known regs
   %cycle
      %for j = 1,1,nregs %cycle
         Last Gpr = Last Gpr-1;  Last Gpr = nregs %if Last Gpr = 0
         r = pref(Last Gpr)
         %result = r %if activity(r) = 0 %and mask & (1<<r) = 0
      %repeat
      %exit %if mask = 0
      mask = 0
   %repeat
   hazard(R4)
   %result = R4
%end

!                                                    >> EVEN/ODD PAIR <<
%integerfn even odd pair
! Get an even/odd (integer) register pair
! the odd register is returned
! registers are hazarded here
%constinteger  regs = 3
%constbyteintegerarray  even(1:regs) = r2, r10, r4
%integer j,r,mask
   mask = known regs
   %cycle
      %for j = 1,1,regs %cycle
         Last EO = Last EO-1;  Last EO = regs %if Last EO = 0
         r = even(Last EO)
         %result = r+1 %if activity(r) = 0 %and activity(r+1) = 0 %c
                                                      %and mask & (3<<r) = 0
      %repeat
      %exit %if mask = 0
      mask = 0
   %repeat
   hazard(r2);  hazard(r3);  %result = r3
%end

!                                                              >> FPR <<
%integerfn  fpr
! get a floating point register
%integer  j,mask
   mask = known regs
   %cycle
      %for j = fr0,1,fr14 %cycle
         Last Fpr = Last Fpr-1;  Last Fpr = fr14 %if Last Fpr = fr0-1
         %result = Last Fpr %if activity(Last Fpr) = 0
      %repeat
      %exit %if mask = 0
      mask = 0
   %repeat
   hazard(fr0)
   %result = fr0
%end

!OBJECT FILE HANDLING ROUTINES
!                                                              >> PUT <<
%routine put(%integer n)
   print symbol(n>>8);  print symbol(n&255)
%end

!                                              >> SELECT LITERAL AREA <<
%routine  select literal area
%integer  k
   print symbol(lit area)
   abort(m'DMP1') %if ca < 0
   k = lita;  lita = ca;  ca = k
%end

!                                                 >> SELECT CODE AREA <<
%routine  select code area
%integer  k
   abort(m'DMP2') %if ca > 0
   k = lita;  lita = ca;  ca = k
   print symbol(code area)
%end

   %routine  phex(%integer  n)
   %integer  j,k
      spaces(2)
      %for j = 12,-4,0 %cycle
         k = (n>>j)&15
         %if k <= 9 %then k = k+'0' %else k = k-10+'A'
         print symbol(k)
      %repeat
   %end

!                                                         >> DUMP TAG <<
%routine  dump tag(%integer  tag, type)
%conststring(7)%array  s(tag def:c ref) =
      " defn", " r ref", " p ref", " sw ref", " j ref", " c ref"
   select output(report)
   print symbol('*');  write(ca,-3) 
   print string(s(type))
   write(tag,1) 
   newline
   select output(object)
%end;       !   dump tag

!                                                             >> DUMP <<
%routine  dump(%integer  p,val)
%integer  k
   select output(report)
   %if p = m'CA' %start
      print string("CA ");  k = ca
   %else
      print string("GA ");  k = ga
   %finish
   write(k-2,-3);  print symbol(':')
   phex(val)
   newline
   select output(object)
%end;            !  dump

!                                                            >> CPUT <<
%routine  cput(%integer  n)
! Output one halfword to code area
   print symbol(code item)
   print symbol(n>>8);  print symbol(n&255)
   ca = ca+2
   dump(m'CA',n) %if diagnose < 0
%end

!                                                            >> GPUT <<
%routine  gput(%integer  n)
! Output one halfword to gla area
   print symbol(gla item)
   print symbol(n>>8);  print symbol(n&255)
   ga = ga+2
   dump(m'GA',n) %if diagnose < 0
%end

!                                                            >> CWORD <<
%routine  cword(%integer  n)
   cput(n>>16);  cput(n)
%end

!                                                            >> LIT BYTE <<
%routine  lit byte(%integer  n)
%owninteger  v=0,f=0
   f = \f
   %if f=0 %start
      ca = ca+1;  cput(v<<8 + n&255)
   %else
      v = n;  ca = ca-1
   %finish
   abort(m'DMP3') %unless ca <= 0
%end

!                                                            >> GWORD <<
%routine  gword(%integer  n)
   gput(n>>16);  gput(n&x'FFFF')
%end

!                                                         >> GWORD REL <<
%routine  gword rel(%integer  n)
   ! Word in GLA modified at load-time by gla base address - used to relocate
   ! %ownarray headers.
   gput(n>>16);  gput(n&x'FFFF')
   print symbol(g rel);  relocations = relocations + 1
%end;         ! gword rel

!                                                              >> GWORD CREL <<
%routine  gword crel(%integer  n)
   ! Word in GLA modified at load-time by code base address - used to relocate
   ! %constarray headers
   gput(n>>16);  gput(n&x'FFFF')
   print symbol(c rel);  relocations = relocations+1
%end;            ! GWORD CREL

!                                                            >> GBYTE <<
%routine  gbyte(%integer  n)
%owninteger  v=0, f=0
   f = \f
   %if f = 0 %start
      ga = ga-1;  gput(v<<8 + n&255)
   %else
      v = n;  ga = ga+1
   %finish
%end

!                                                             >> GFIX <<
%routine  gfix(%integer align)
   gbyte(0) %while ga&align # 0
%end

!                                                       >> DEFINE TAG <<
%routine  define tag(%integer ref)
%integer  k
   select output(direct)
   print symbol(tag def)
   print symbol(ref>>8);  print symbol(ref&255)
   k = ca>>1;               ! ******* Halfword units
   print symbol(k>>8);   print symbol(k&255)
   select output(object)
   dump tag(ref,tag def) %if diagnose < 0
%end;      ! define tag

!                                                 >> DEFINE REFERENCE <<
%routine  define reference(%integer  ref, type)
%integer  k
   set line %if current line # last line
   select output(direct)
   print symbol(type)
   print symbol(ref>>8);  print symbol(ref&255)
   k = ca>>1;               ! ******** Halfword units
   print symbol(k>>8);   print symbol(k&255)
   select output(object)
   dump tag(ref,type) %if diagnose < 0
   print symbol(type)
   %if type = r ref %start
      print symbol(ref>>8);  print symbol(ref&255)
   %finish
%end;           ! define reference

!                                                    >> CLAIM LITERAL <<
%routine  claim literal(%integer  size,align)
%integer  k
   abort(m'DMP4') %if ca < 0 %or litmax > 0
   %if lita&1 # 0 %start;       ! odd no. of bytes
      select literal area
      lit byte(0)
      select code area
   %finish
   litmax = -((-litmax+size+align)&(\align))
   lita = litmax
   k = (-lita)>>1
   print symbol(lit org);  put(k);         ! Tell pass 3
%end;          !  claim literal

!                                                         >> SET LINE <<
%routine  set line
   %integer  flag
      %return %if ca < 0;         !in literal area
      %if current line-last line # 1 %then flag = line reset %c
                                                   %else flag = line flag
      select output(direct)
      print symbol(flag);  put(current line) %if flag = line reset
      %if diagnose < 0 %start
         select output(report)
         print string("-->line");  write(current line,1)
         newline
      %finish
      select output(object)
      print symbol(flag);  put(current line) %if flag = line reset
      last line = current line;  last ca = ca
%end;         ! set line

!                                                         >> DESCRIBE <<
%routine  describe(%integer  base,disp, %string(ident len)%name  xsym)
! Generate a full description of the variable specified by (base,disp)
! Assumes that DIAG SIZE, DIAG TYPE, DIAG FORM, OTYPE are appropriately set.
%integer  size,type
%integer  j,k
%constbyteintegerarray  compressed type(0:13) =
      1,      2,     3,       4,    5,  0(3),    6,    0(4),  7
!  integer  real  string  record   byte         short      long real
   length(xsym) = extern len %if length(xsym) > extern len
    print symbol(length(xsym))
    print symbol(charno(xsym,j)) %for j = 1,1,length(xsym);  ! name
    %return %if base < 0
    size = diag size;  type = diag type
    size = 1 %if diag type >= 3 %or diag form > 2 %or size = 0
    type = 1 %if diag type <= 0
    k = (size-1) << 2 + (type-1)
    j = 0
    j = x'80' %if Otype # 0 %and Spec # 0    {external data spec}
    print symbol(otype)
    print symbol( compressed type(k) << 4 ! DIAG FORM ! J)
    j = actual(base)<<20 + disp&x'000FFFFF'
    print symbol(j>>16);  print symbol(j>>8);  print symbol(j)
%end;         !  describe

!                                                        >> SET DIAG <<
%routine  set diag(%integer  base,disp)
! Implicit parameters:     DIAG TYPE   DIAG FORM  DIAG SIZE  OTYPE
   var diags = var diags + basic vdiag
   var diags = var diags + extra vdiag %if length(internal id) > short ident
   print symbol(var diag);  describe(base,disp,internal id)
%end

!                                                >> EXTERNAL LINK <<
%routine  external link(%integer  ref type,data size,addr)
   !Note that ADDR is ignored when defining procedure entry points
   !     it is assumed that the link is set IMMEDIATELY before the entry point.
   %integer  k
   abort(m'DMP5') %unless data ref <= ref type <= ep defn
   %if ref type&1 # 0 %then defns = defns+1 %else specs = specs+1
   print symbol(extern)
   print symbol(ref type)
   put(data size//2);      ! Halfwords for pass3
   k = gla;  k = code %if ref type = ep defn
   describe(k,addr//2,external id)
   %if ref type&1 = 0 %start;               !a spec
      gword(0);  gword(0)
      %if ref type = ep ref %then gword(0) %else gword(-1)
   %finish
%end

!                                                      >> CLOSE FILES <<
%routine  close files
   select output(direct)
   print symbol(prog end)
   put(total ca>>1);  put((-litmax)>>1);  put(ga>>1);   ! Halfword units
   put(defns);  put(specs);  put(relocations)
   print symbol(0);      ! to prevent potential trouble with binary 4 = EOF
   close output
   select output(object);  print symbol(prog end) 
   close output
%end;    !  close files

! code generation routines
!                                                                        >>  RXD  <<
! = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
!                  B a s i c   C o d e  G e n e r a t o r
!
%routine  RXD(%integer  op, r1, %record(stackfm)%name  v)
%integer  index, mask, code, format
%integer  type, form, base, disp, x
%integer  k, old ca
%record(stackfm)  u
%constbyteintegerarray  type index(integers:reals+1) =
         1,      2,     7,       0(3),          1,      0
!      integer  short   byte                   reals  reall
   old ca = ca
   type = v_type;  form = v_form
   base = v_base;  disp = v_disp;  x = v_index
   op = op + fp base %if r1 >= FR0
   mask = op index(op);  index = mask&255
   set line %if last line # current line

   %if form = constant %or form = AV in S %start;      ! RXI
      abort(m'RXDx') %if x # 0
      %if disp = 0 %and base # 0 %and LSH # op # RSH %and op # SRA %start
         ! optimise:  LHI x,0(y)    =>  LR x,y
         ! remove:    LHI x,0(x)
         %if r1 # base %or op # LW %start
            u_xbase = base;  u_disp = 0;   ! **** u_disp otherwise unassigned ****
            u_form = V in R;  rxd(op,r1,u)
            %return
         %finish
         code = x'10';             !(psr) preserve CC at end - see later
      %else %if op = LW %and r1 = base %and 15 >= disp >= -15
         ! LHI x, 15(x)   =>  AIS x,15
         ! LHI x,-15(x)   =>  SIS x,15
         op = add
         %if disp < 0 %start
            op = sub;  disp = -disp
         %finish
         u_form = constant;  u_xbase = 0;  u_disp = disp;  rxd(op,r1,u)
         release(base)
         %return
      %else %if op = LSH %and disp = 1 %and base = 0
         ! SLLS x,1   =>  AR x,x
         claim(r1)
         u_xbase = r1;  u_disp = 0
         u_form = V in R;  rxd(add,r1,u);  %return
      %else;                                    ! general case (RXI)
         abort(m'RXD1') %if mask&FWIMM = 0 %and  LSH # op # RSH %and op # SRA
         index = index + 3;            ! fullword immediate
         format = 0
         %if 15>=disp>=-15 %and base=0 %and (SF IMM+INV IMM)&mask # 0 %start
            %if disp >= 0 %start
               format = 2
            %else
               format = 3;  disp = -disp
            %finish
         %else %if 32767 >= disp >= -32768
            format = 1
         %finish
         code = op code(index + format)
         %if format >= 2 %start
            cput(code&x'FF00' + actual(r1)<<4 + disp)
         %else
            cput(code&x'FF00' + actual(r1)<<4 + actual(base))
            cput(disp>>16) %if format = 0;   ! fullword immediate ?
            cput(disp)
         %finish
      %finish
   %else %if form = V in R;                  !   register-register operation
      abort(m'RXD2') %if r1 = 0 %or base = 0 %or x # 0
      code = op code(index);      ! ** N.B.  op code(index + 0) really ......
      %if code&x'20' # 0 %start;      ! STR => LR etc.
         k = r1;  r1 = base;  base = k
      %finish
      cput(code&x'FF00' + actual(r1)<<4 + actual(base))
   %else;                                    ! RX (integer,real,short,byte)
      abort(m'RXD3') %if r1 = 0 %or base = R0
      format = type index(type);  abort(m'RXD4') %if format = 0
      code = op code(index + format)
      abort(m'RXD5') %if (code&15)&disp # 0
      cput(code&x'FF00' + actual(r1)<<4 + actual(base))
      %unless 0 <= disp <= 16383 %and x = 0 %start
         cput(x'4000' + actual(x)<<8 + (disp>>16)&255)
      %finish
      cput(disp)
   %finish
   release(base) %if base > 0;      !(PSR)
   release(x) %if x # 0
   %if code&x'40' # 0 %start;      ! leaves cond code completely unchanged
      cc ca = cc ca + ca - old ca 
   %else %if code&x'10' = 0;      ! cond code relative to zero ?
      cc ca = ca;  cc reg = r1
   %finish
%end;               ! of 'RXD'
! = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

!                                                                        >>  RR  <<
%routine  rr(%integer  op,r1,r2)
   %record(stackfm)  v
   v_xbase = r2;  v_disp = 0
   v_type = integers;  v_type = reals %if r1 >= FR0
   v_form = V in R;  rxd(op, r1, v)
%end

!                                                                     >>  RXI  <<
%routine  rxi(%integer  op, r1, base, disp)
   %record(stackfm)  v
   v_xbase = base;  v_disp = disp
   v_type = integers
   v_form = constant;  rxd(op, r1, v)
%end

!                                                                     >>  RX  <<
%routine  rx(%integer  op, r1, base, disp)
   %record(stackfm)  v
   v_xbase = base;  v_disp = disp
   v_type = integers;  v_type = reals %if r1 >= FR0
   v_form = V in S;  rxd(op, r1, v)
%end

!                                                                  >> SKIP <<
%routine  skip(%integer  half words, condition)
! Plant a short forward jump to skip over unwanted code sequence:
!      skips forward the number of halfwords specified NOT COUNTING the
!      code dumped to effect the skip
! Must be used with care as it doesn't account automatically for register
! contents.
   %constshortintegerarray  jump(0:5) =
      x'2330',   x'2130',   x'2110',   x'2120',   x'2320',   x'2310'
      !  BES        BNES       BMS        BPS        BNPS       BNMS
   Condition = Inverted(Condition) %if Condition&16 # 0
   abort(m'SKP1') %unless 0 < halfwords <= 14 %and 0 <= condition <= 5
   cput( jump(condition) ! (halfwords + 1) )
%end

!                                                            >> MACHINE CODE <<
%routine machine code
   %constinteger branch = 1
   %constinteger rr = 2
   %constinteger indexed = 4
   %constinteger ri1 = 8
   %constinteger ri2 = 16
!*delete*
%constinteger mc entries = 204
%constintegerarray mcop(1:mc entries) =
    x'00000041', x'00000042', x'00000043', x'00000044', x'0000004C',
!        A            B            C            D            L      
    x'0000004D', x'0000004E', x'0000004F', x'00000053', x'00000058',
!        M            N            O            S            X      
    x'00001004', x'00001005', x'00001008', x'00001009', x'0000100C',
!        AD           AE           AH           AI           AL     
    x'0000100D', x'00001012', x'00001084', x'00001085', x'00001088',
!        AM           AR           CD           CE           CH     
    x'00001089', x'0000108C', x'00001092', x'000010C3', x'000010C5',
!        CI           CL           CR           BC           BE     
    x'000010C7', x'000010CC', x'000010CD', x'000010CF', x'000010D0',
!        BG           BL           BM           BO           BP     
    x'000010D2', x'000010DA', x'00001144', x'00001145', x'00001148',
!        BR           BZ           DD           DE           DH     
    x'00001152', x'00001304', x'00001305', x'00001308', x'00001312',
!        DR           MD           ME           MH           MR     
    x'00001341', x'00001342', x'00001344', x'00001345', x'00001348',
!        LA           LB           LD           LE           LH     
    x'00001349', x'0000134D', x'00001352', x'00001383', x'00001388',
!        LI           LM           LR           OC           OH     
    x'00001389', x'00001392', x'000013C8', x'000013C9', x'000013D2',
!        OI           OR           NH           NI           NR     
    x'00001484', x'00001485', x'00001488', x'00001489', x'00001492',
!        SD           SE           SH           SI           SR     
    x'00001493', x'00001494', x'000014C2', x'000014C4', x'000014C8',
!        SS           ST           RB           RD           RH     
    x'00001549', x'00001553', x'00001582', x'00001584', x'00001588',
!        TI           TS           WB           WD           WH     
    x'00001648', x'00001649', x'00001652', x'000400CC', x'00040112',
!        XH           XI           XR          ABL          AER     
    x'00040152', x'00040213', x'00040249', x'0004024D', x'0004054C',
!       ADR          AIS          AHI          AHM          ATL     
    x'000420D4', x'00042112', x'00042152', x'00042249', x'00042342',
!       CBT          CER          CDR          CHI          CLB     
    x'00042348', x'00042349', x'00042352', x'0004300C', x'00043092',
!       CLH          CLI          CLR          BAL          BCR     
    x'00043112', x'00043185', x'00043192', x'000431C3', x'00043312',
!       BER          BGE          BGR          BFC          BMR     
    x'00043345', x'00043352', x'00043392', x'000433C3', x'000433C5',
!       BLE          BLR          BOR          BNC          BNE     
    x'000433CC', x'000433CD', x'000433CF', x'000433D0', x'000433DA',
!       BNL          BNM          BNO          BNP          BNZ     
    x'00043452', x'00043543', x'00043648', x'000436D2', x'00045112',
!       BPR          BTC          BXH          BZR          DER     
    x'00045152', x'00045252', x'00047352', x'00047652', x'0004C112',
!       DDR          DHR          FLR          FXR          MER     
    x'0004C152', x'0004C252', x'0004D093', x'0004D0D2', x'0004D112',
!       MDR          MHR          LCS          LBR          LER     
    x'0004D152', x'0004D213', x'0004D249', x'0004D24C', x'0004D304',
!       LDR          LIS          LHI          LHL          LMD     
    x'0004D305', x'0004E092', x'0004E249', x'0004F249', x'0004F390',
!       LME          OCR          OHI          NHI          NOP     
    x'00052090', x'000520D4', x'00052112', x'00052152', x'00052213',
!       SCP          SBT          SER          SDR          SIS     
    x'00052249', x'00052341', x'00052492', x'000524C1', x'000524CC',
!       SHI          SLA          SSR          SRA          SRL     
    x'000524D2', x'00052542', x'00052544', x'00052545', x'00052548',
!       SRR          STB          STD          STE          STH     
    x'0005254D', x'000525C3', x'000530CC', x'000530D2', x'000530D4',
!       STM          SVC          RBL          RBR          RBT     
    x'00053152', x'00053252', x'0005334C', x'000534CC', x'0005354C',
!       RDR          RHR          RLL          RRL          RTL     
    x'000550D4', x'00055249', x'000560D2', x'00056152', x'00056252',
!       TBT          THI          WBR          WDR          WHR     
    x'00059249', x'010895D2', x'0108D249', x'010C0352', x'010C6112',
!       XHI          CHVR         CLHI         BALR         BGER    
    x'010C7092', x'010C7092', x'010C70D3', x'010C71D3', x'010CD112',
!       BFCR         BFCR         BFBS         BFFS         BLER    
    x'010CF092', x'010CF112', x'010CF312', x'010CF352', x'010CF392',
!       BNCR         BNER         BNMR         BNLR         BNOR    
    x'010CF452', x'010CF6D2', x'010D5092', x'010D50D3', x'010D51D3',
!       BNPR         BNZR         BTCR         BTBS         BTFS    
    x'010D9345', x'01111492', x'011190D2', x'01119252', x'011CD152',
!       BXLE         EPSR         EXBR         EXHR         FLDR    
    x'011D9152', x'01351497', x'013CE452', x'014883D4', x'0148D241',
!       FXDR         LPSW         NOPR         SINT         SLHA    
    x'0148D24C', x'0148D353', x'01493241', x'0149324C', x'01493353',
!       SLHL         SLLS         SRHA         SRHL         SRLS    
    x'014950D2', x'01495304', x'01495305', x'424C3C72', x'424C3C76',
!       STBR         STMD         STME        CRC12        CRC16    
    x'4D452592', x'52349353', x'524C9353', x'55340545'
!      LPSWR        SLHLS        SRHLS        TLATE    
%constshortintegerarray opflags(1:mc entries) =
    x'5A04', x'4305', x'5904', x'5D04', x'5804', x'5C04', x'5404', x'5604',
!      A        B        C        D        L        M        N        O    
    x'5B04', x'5704', x'7A04', x'6A04', x'4A04', x'FA10', x'D501', x'5104',
!      S        X        AD       AE       AH       AI       AL       AM   
    x'0A02', x'7904', x'6904', x'4904', x'F910', x'5504', x'0902', x'4285',
!      AR       CD       CE       CH       CI       CL       CR       BC   
    x'4335', x'4225', x'4285', x'4215', x'4245', x'4225', x'0303', x'4335',
!      BE       BG       BL       BM       BO       BP       BR       BZ   
    x'7D04', x'6D04', x'4D04', x'1D02', x'7C04', x'6C04', x'4C04', x'1C02',
!      DD       DE       DH       DR       MD       ME       MH       MR   
    x'E604', x'D304', x'7804', x'6804', x'4804', x'F810', x'D104', x'0802',
!      LA       LB       LD       LE       LH       LI       LM       LR   
    x'DE04', x'4604', x'F610', x'0602', x'4404', x'F410', x'0402', x'7B04',
!      OC       OH       OI       OR       NH       NI       NR       SD   
    x'6B04', x'4B04', x'FB10', x'0B02', x'DD04', x'5004', x'D704', x'DB04',
!      SE       SH       SI       SR       SS       ST       RB       RD   
    x'D904', x'F310', x'E004', x'D604', x'DA04', x'D804', x'4704', x'F710',
!      RH       TI       TS       WB       WD       WH       XH       XI   
    x'0702', x'6504', x'2A02', x'3A02', x'2602', x'CA08', x'6104', x'6404',
!      XR      ABL      AER      ADR      AIS      AHI      AHM      ATL   
    x'7704', x'2902', x'3902', x'C908', x'D404', x'4504', x'F510', x'0502',
!     CBT      CER      CDR      CHI      CLB      CLH      CLI      CLR   
    x'4104', x'0281', x'0333', x'4315', x'0223', x'4304', x'0213', x'4325',
!     BAL      BCR      BER      BGE      BGR      BFC      BMR      BLE   
    x'0283', x'0243', x'4385', x'4235', x'4385', x'4315', x'4345', x'4325',
!     BLR      BOR      BNC      BNE      BNL      BNM      BNO      BNP   
    x'4235', x'0223', x'4204', x'C004', x'0333', x'2D02', x'3D02', x'0D02',
!     BNZ      BPR      BTC      BXH      BZR      DER      DDR      DHR   
    x'2F02', x'2E02', x'2C02', x'3C02', x'0C02', x'2502', x'9302', x'2802',
!     FLR      FXR      MER      MDR      MHR      LCS      LBR      LER   
    x'3802', x'2402', x'C808', x'7304', x'7F04', x'7204', x'9E02', x'C608',
!     LDR      LIS      LHI      LHL      LMD      LME      OCR      OHI   
    x'C408', x'4205', x'E304', x'7504', x'2B02', x'3B02', x'2702', x'CB08',
!     NHI      NOP      SCP      SBT      SER      SDR      SIS      SHI   
    x'EF00', x'9D02', x'EE00', x'EC00', x'ED00', x'D204', x'7004', x'6004',
!     SLA      SSR      SRA      SRL      SRR      STB      STD      STE   
    x'4004', x'D004', x'E104', x'6704', x'9702', x'7604', x'9B02', x'9902',
!     STH      STM      SVC      RBL      RBR      RBT      RDR      RHR   
    x'EB00', x'EA00', x'6604', x'7404', x'C308', x'9602', x'9A02', x'9802',
!     RLL      RRL      RTL      TBT      THI      WBR      WDR      WHR   
    x'C708', x'1202', x'C508', x'0102', x'0313', x'0302', x'1302', x'2202',
!     XHI      CHVR     CLHI     BALR     BGER     BFCR     BFCR     BFBS  
    x'2302', x'0323', x'0383', x'0233', x'0313', x'0383', x'0343', x'0323',
!     BFFS     BLER     BNCR     BNER     BNMR     BNLR     BNOR     BNPR  
    x'0233', x'0202', x'2002', x'2102', x'C104', x'9502', x'9402', x'3402',
!     BNZR     BTCR     BTBS     BTFS     BXLE     EPSR     EXBR     EXHR  
    x'3F02', x'3E02', x'C205', x'0203', x'E201', x'CF08', x'CD08', x'1102',
!     FLDR     FXDR     LPSW     NOPR     SINT     SLHA     SLHL     SLLS  
    x'CE08', x'CC08', x'1002', x'9202', x'7E04', x'7104', x'5E04', x'5F04',
!     SRHA     SRHL     SRLS     STBR     STMD     STME    CRC12    CRC16  
    x'1801', x'9102', x'9002', x'E704'
!    LPSWR    SLHLS    SRHLS    TLATE  

!*end*
%string(7) opcode
%record(varfm)%name  v
   %integer op, base, disp, index, flags, p, n, reg
   %routine mc error(%string(255) s)
      selectoutput(0)
      printsymbol('*')
      write(current line, 3)
      space
      printstring(opcode)
      printstring(": ")
      printstring(s)
      newline
      selectoutput(object)
      %while sym # ';' %cycle
         sym = next;  readsymbol(next)
      %repeat
   %end
   %routine get opcode
      opcode = "";  op = 0
      %cycle
         sym = next;  readsymbol(next)
         %exit %if sym = '_'
         %if length(opcode) # 6 %start
            op = op<<6!!sym
            opcode = opcode.tostring(sym)
         %finish
      %repeat
      sym = next;  readsymbol(next)
   %end
   %integerfn find opcode
      %integer high, low, p
      high = mc entries;  low = 1
      %while high >= low %cycle
         p = (high+low)>>1
         %result = p %if mcop(p) = op
         %if mcop(p) > op %then high = p-1 %else low = p+1
      %repeat
      mc error("unknown operation")
      %result = 0
   %end
   %predicate value(%integername n)
      n = 0
      %false %unless '0' <= sym <= '7'
      %cycle
         n = n<<3!(sym-'0')
         sym = next;  readsymbol(next)
         %true %unless '0' <= sym <= '7'
      %repeat
   %end
   %predicate register(%integername r)
      %false %unless value(r)
      %false %unless 0 <= r <= 15
      %true
   %end
   %predicate deal with plus minus
      %integer sign, n
      %true %unless sym = '+' %or sym = '-'
      sign = sym;  sym = next;  readsymbol(next)
      %unless value(n) %start
         mc error("invalid offset")
         %false
      %finish
      n = -n %if sign = '-'
      disp = disp+n
      %true
   %end

   base = -1;  index = -1;  disp = 0
   get opcode
   p = find opcode;  %return %if p = 0
   flags = opflags(p)

   %if flags&branch # 0 %start
      reg = flags>>4&15;               !cond-code
   %else %unless register(reg)
      mc error("register 1?");  %return
   %else %if sym # ','
      mc error("comma missing");  %return
   %else
      sym = next;  readsymbol(next)
   %finish
   %if flags&rr # 0 %start
      %unless register(base) %start
         mc error("register 2?");  %return
      %finish
   %else %if sym = ' ';                  !named operand
      n = tag
      sym = next;  readsymbol(next)
      v == var(n)
      disp = v_disp
      %if v_form = pgm label %start;   !%label
         define reference(disp&X'FFF', r ref);   !make it look like a routine
         disp = 0;  Base = Code
         %return %unless deal with plus minus
      %else
         base = actual(v_base) %unless v_base = 0
         %return %unless deal with plus minus
         %if sym = '(' %start
            ->ix %if base > 0
            ->ib
         %finish
      %finish
   %else
      %if sym = '-' %and deal with plus minus %start
         !only needs the side-effect of deal with ..
      %else %unless value(disp)
         mc error("displacement?");  %return
      %finish
      %return %unless deal with plus minus
      %if sym = '(' %start
ib:      sym = next;  readsymbol(next)
         %unless register(base) %start
            mc error("base register?");  %return
         %finish
         %if sym = ',' %start
ix:         sym = next;  readsymbol(next)
            %if flags&indexed = 0 %start
               mc error("no double indexed form");  %return
            %finish
            %unless register(index) %start
               mc error("index register?");  %return
            %finish
         %finish
         %if sym # ')' %start
            mc error(") missing");  %return
         %finish
         sym = next;  readsymbol(next)
      %finish
   %finish
   %if sym # ';' %start
      mc error("form?");  %return
   %finish

   base = 0 %if base < 0
   index = 0 %if index < 0
   base = index %and index = 0 %if base = 0 %and index # 0

   cput(flags&x'FF00'+reg<<4+base)
   %if flags&ri1 # 0 %start
      cput(disp&x'FFFF')
   %else %if flags&ri2 # 0 %and flags&branch = 0
      cput(disp>>16);  cput(disp&x'FFFF')
   %else %if flags&rr = 0
      %if disp>>14 # 0 %or index > 0 %start
         mc error("no RX3 form") %and %return %if flags&indexed = 0
         cput(x'4000'+index<<8+disp>>16&x'FF')
      %finish
      cput(disp&x'FFFF')
   %finish
%end

!                                                  >> SET DOPE VECTOR <<
%routine  set dope vector
%integer  t
   t = vub-vlb+1
   claim literal(4*reglen,3)
   select literal area
   dv = ca
   cword(1)
   cword(vlb);  cword(vub)
   cword(data size)
   select code area
   vub = t*data size;  vlb = vlb*data size
%end

!                                                             >> PERM <<
%routine  perm(%integer  n)
%constinteger  g0=1, g1=2, g2=4, g3=8, g4=16, g5=32, g6=64;  ! General Registers
%constinteger f0=128, f2=256;                                ! Floating Registers
%constinteger  prot = (-1)<<15;                     ! protect stack around call
%constshortintegerarray  rmap(0:8) = R0, R1, R2, R3, R4, P2, P1, FR0, FR2
%integer  k,r,h
!
! **** N.B.  The following table must match the properties of the perm
!            routines in use.
%constinteger perm routines = 50
%constshortintegerarray  hazard reg(1:perm routines) =
      0,                                      ; !    1: ASSCHK
      G0+G3,                                  ; !    2: IEXP
      G0+F0+F2,                               ; !    3: REXP
      G0+G3+G4,                               ; !    4: SMOVE
      G0+G3+G5,                               ; !    4: SJAM
      G0+G1+G2+G3+G4+G5,                      ; !    6: SCONC
      G0+G5+G6,                               ; !    7: SRESLN
      0,                                      ; !    8: SRESV
      G0+G3+G4+G5,                            ; !    9: SCOMP
      F0+F2,                                  ; !   10: FRAC PT
      0,                                      ; !   11: SFCAP
      G0+G1+G2+G3+prot,                       ; !   12: SUBSTR
      G0+G1+G2,                               ; !   13: AREF1
      G0+G1+G4,                               ; !   14: AREF2
      G0+G1+G4+G5,                            ; !   15: AREF3
      G0+G1+G4,                               ; !   16: AREF4
      G0+G1+G2+G3,                            ; !   17: SETDV
      G0+G5,                                  ; !   18: ALLOC
      0,                                      ; !   19: SWJMP
      0,                                      ; !   20: SIGNAL
      0,                                      ; !   21: MULCHK
      0,                                      ; !   22: CAP16
      0,                                      ; !   23: CAP8
      G0+G1,                                  ; !   24: FCHK1
      0,                                      ; !   25: FCHK2
      G2+G3+G4,                               ; !   26: PENTC
      G0+G3,                                  ; !   27: RCOPY
      G0+G3,                                  ; !   28: RZERO
      0,                                      ; !   29: VSCHK
      G0+G3+G4,                               ; !   30: SMOVOPT
      G0+G1,                                  ; !   31: CHMAP
      G1,                                     ; !   32: FREESP
      G1+F2,                                  ; !   33: INT
      G0+G3+G4+G5,                            ; !   34: RECORD COMPARE
      G0+G1+G2+G3+G4+G5+G6,                   ; !   35: SET COMPARE
      G0+G3,                                  ; !   36: SET UNION
      G0+G3,                                  ; !   37: SET DIFFERENCE
      G0+G3,                                  ; !   38: SET INTERSECTION
      0,                                      ; !   39:
      0,                                      ; !   40:
      0,                                      ; !   41:
      0,                                      ; !   42:
      0,                                      ; !   43:
      0,                                      ; !   44:
      0,                                      ; !   45:
      0,                                      ; !   46:
      0,                                      ; !   47:
      0,                                      ; !   48:
      G0+G1+G2+G3+G4+G5+G6+F0+F2,             ; !   49: IOCP
      G0+G1+G2+G3+G4+G5+G6+F0+F2              ; !   50: ENTER TRACE

   h = hazard reg(n);                     ! property mask for nth. perm routine
   %if claimed # 0 %start;      ! maybe something to do .. perhaps
      k = h&x'7FFF';                  ! register mask
      r = 0
      %while k # 0 %cycle
         hazard(rmap(r)) %if k&1 # 0
         k = k>>1
         r = r+1
      %repeat
   %finish

   ! forget all registers which are at risk
   r = ( ((h&(F0+F2)) << (FR0-P1))  !  (h&127) ) << 1;   ! ** N.B. P1 == G6
   forget reg(r)

   rxi(ADD,wsp,0,wdisp) %if h < 0 %and wdisp # 0
   define reference(n&255,p ref)
   rx(bal,link,code,n&255)
   %if h < 0 %start
      rxi(SUB,wsp,0,wdisp) %if wdisp # 0
      wdisp = wdisp + basic frame + 256;       ! protect it
   %finish
%end

!                                                      >> DUMP TRACE <<
%routine  DUMP TRACE
   %if current line # last line %start
      trace flag = 0
      perm(enter trace);  cput(current line)
   %finish
%end

!                                                         >> ASSEMBLE <<
! AMODE:
!  -2: alternate record format
!  -1: record format
!   0: procedure
!   1: %spec
!   2: initial call

%routine Assemble(%integer  amode, labs, names)
   %switch c(33:127), Pc('A':'Z')
   %recordformat  evfm(%integer  low, high, events, label)
   %record(evfm)  event = 0
   %record(varfm)%name  v
   %record(varfm)%name  gvar             {procedure var}
   %record(stackfm)%name  lhs, rhs, x
   %integer  old frame, old extra frame, old jump
   %integer  old temp base, old next temp
   %integer true frame base, putative frame base, max frame, alt first, alt align=0
   %integer  old var diags
   %integer  gstart                      {first descriptor at this level}
   %integer  label start                 {first label for this level}
   %owninteger  free tag   = 0
   %integer  max local     = 0
   %integer  max parm      = 0
   %integer  min parm      = 0           {P1, P2 parameter registers used ?}
   %integer  mark assigned = 1           {mark VAR table entries as 'assigned' if # 0}
   %integer  Closed        = Assigned    {assume it can't return}
   %integer  Return Label  = 0           {label on return code}
   %integer  px            = 0
   %integer  proc ca       = ca
   %integer  sw list       = 0
   %integer  last a        = -1
   %integer  line size     = 0
   %integer  block index
   %integer  j, k, t

   %routinespec compile to string(%record(stackfm)%name v)
   %routinespec  pop lhs
   %routinespec  lrd(%record(stackfm)%name  v, %integer  reg)
   %routinespec  load(%record(stackfm)%name  v, %integer  reg)
   %routinespec  assign(%integer  assop)
   %routinespec  array ref(%integer  mode)
   %routinespec  operate(%integer  n)
   %routinespec  compare(%record(stackfm)%name  l,r, %integer next)
   %routinespec test zero(%record(stackfm)%name v)
   %routinespec  header(%record(varfm)%name  v)
   %routinespec  block mark(%integer mark)
   %integerfnspec  new tag

   old jump = uncond jump;  uncond jump = -1
   old var diags = var diags;  var diags = 0
   label start = labs
   old frame = frame;  old extra frame = extra frame;  extra frame = 0
   old temp base = temp base;  old next temp = next temp
   temp base = new temp;  Next Temp = New Temp
forget the lot:
   pdisp = 0;  wdisp = 0;  gdisp = -1;  event_events = 0
    abort(m'-1 ?') %unless gdisp = -1;   !************????????????
   gvar == decvar;  gstart = names
   %if amode >= 0 %start;            ! NOT A RECORDFORMAT
      frame = basic frame;  ca = 0
      level = level+1;  abort(m'AM00') %if level > 5 %and spec = 0
      local = breg(level)
      activity(local) = -1
      gdisp = (p1-p2)*reglen
      Reset Optimisation Data %if Spec = 0
      %if amode = 0 %start;        ! procedure, proc. parameter, %begin block
         block no = block no + 1;  block index = block no
         block mark(block start)
         %if sym = 'H' %start;                ! %BEGIN block
            gdisp = -1
            %if level = 1 %start;      ! Initial %begin ?
               external id = program ep;      ! linkage to program entry
               otype = external;  potype = otype
            %finish
            header(gvar)
         %finish
      %finish
   %else
      %if amode = -1 %start;            ! record format
         gvar_extra = parms
         frame = 0
      %finish
      true frame base = frame
      putative frame base = (frame+align)&(\align)
      frame = putative frame base
      max frame = frame
      alt first = parms-1;       ! note start of this alternative list
   %finish


!                                                       >> BLOCK MARK <<
%routine  block mark(%integer mark)
%integer  k, limit
   k = direct
   %cycle
      select output(k)
      print symbol(mark)
      %if mark = block start %start
         print symbol(block index)
         %if k = object %start;      ! procedure head diagnostics
            put(current line);  last line = -15;  !force a reset
            describe(-1,0,block name);      ! internal name for procedure
         %finish
      %else %if k = direct;       ! %and mark = block end (by implication)
         abort(m'TAG?') %if free tag > 32767;   ! too many pass3 tags
         put(ca>>1);            ! code size for this block (half words)
         put(var diags);         ! var. diags local to this block
         frame = (frame+align)&(\align)
         k = frame + extra frame;      ! include in-frame array space
         %if control & trusted = 0 %start
            ! using checked (perm) entry sequence
            k = k>>2;            ! to full word units
            limit = 65535;       ! treated as unsigned 16 bits by perm
         %else
            ! in-line entry sequence
            limit = 32767;       ! must be positive 2's complement (byte units)
         %finish
         abort(m'FRM?') %unless 0 < k <= limit
         put(k)
         print symbol(actual(local));   ! current display register
         put(event_events);             ! events-trapped mask
         put(event_label);                  ! Event block ep
         put(event_low);                    ! Event block %finish
         total ca = total ca + ca
      %finish
      %exit %if k = object
      k = object
   %repeat
   last ca = -1
%end;           ! block mark

!                                                  >> SET FRAME PATCH <<
%routine  set frame patch
   %if diagnose < 0 %start
      select output(report)
      print string("  Block index");  write(block index,1)
      newline
      select output(object)
   %finish
   print symbol(frame patch)
%end;         ! set frame patch

!                                                       >> DEFINE VAR <<
%routine  define var
   %integer  type, form, tf, size, format, s, new, round, dimension
   %integer  ignore;         ! ** used to control dumping of diags **
   %record(stackfm)  temp
   %integer  k
!!!*** N.B. On machines with the PDP-11/VAX perversion relating to the order
!            of register bytes in store, the following table will have to
!            be changed as will a few constants in this routine.
!            The relevant piece of record format to consider is:
!               (%shortinteger xform %or %byteinteger  flag,form)
!            which must have the effect of mapping 'flag' onto the
!            more significant byte of 'xform'.
   %constshortintegerarray  fmap(0:18) = 0,
      V in S,                           {simple variable}
      A in S,                           {name: pointer variable}
      pgm label,                        {label ** SPECIAL **}
      15,                               {record format **SPECIAL**}
      0,                                   {unused}
      0,                                {switch}
      proc bit<<8 + 0,                  {routine}
      proc bit<<8 + V in R,             {function}
      proc bit<<8 + V in S,             {map}
      proc bit<<8 + 5,                  {predicate}
      abit<<8 + V in S,                 {array}
      anbit<<8 + V in S,                {array name}
      (abit+label bit)<<8 + V in S,     {name array}
      (anbit+label bit)<<8 + V in S,    {name array name}
   ! external manifestations of array forms
      abit<<8 + V in REC,               {external array}
      anbit<<8 + V in REC,              {external array name}
      (abit+label bit)<<8 + V in REC,   {external name array}
      (anbit+label bit)<<8 + V in REC   {external name array name}
   %constbyteintegerarray  vsize(0:8) = 0,4,2,1,8,0,0,4,8
   %owninteger  prim no = 0
   ignore = 0
   ignore = 1 %if amode < 0 %or amode = 1;   ! no diags for specs of any kind!!
   internal id = "";  new = 0;  round = align
   decl = tag
   %if decl = 0 %start;         ! RECORD FORMAT ELEMENT NAME
      parms = parms-1;  abort(m'DFV1') %if parms <= names
      decvar == var(parms)
      decvar = 0;    !(psr)
   %else
      abort(m'DFV2') %if decl >= parms
      decvar == var(decl)
      %if decl > names %start
         names = decl;  new = 1
         decvar = 0
      %finish
   %finish
   %cycle
      sym = next;  read symbol(next);  %exit %if sym = ','
      %if length(internal id) # extern len %start
         internal id = internal id.to string(sym)
      %finish
   %repeat
   ignore = 1 %if internal id = ""
   tf = tag;  read symbol(next)
   type = tf>>4;  form = tf&15
   size = tag;  read symbol(next)
   diag type = type;  diag form = form;  diag size = size
   %if type = integers %and size # 1 %start;    ! INTEGER
      type = byte  %and round = 0 %if size = 2
      type = short %and round = 1 %if size = 3
      size = vsize(type)
   %else %if type = 2;                                        ! REAL
      type = reals
      ! *** for 8/32, 'round = 3' below should be changed to 'round = 7'
!?????????????      type = reall %and round = 3 %if size = 4;               ! LONG REAL
      size = vsize(type)
   %else %if type = 4;                             ! record
      type = records
      format = size
      decvar_format = format;  size = var(format)_length&x'FFFF' %if format <= names
   %else %if type = 3;                 !  string
      type = strings
      round = 0
      decvar_length = size
      size = size + 1
   %else
      size = vsize(type)
   %finish
   decvar_length = size %if type # strings
   decvar_type = type;  decvar_xform = fmap(form)
   otype = tag
   spec = (otype>>3)&1;  dimension = otype>>8&255;  otype = otype&7
   %if otype # 0 %start;      ! Set external linkage name if appropriate
      %if otype >= external %start
         %if alias # "" %start
            external id = alias
         %else %if otype = system
            external id <- system prefix.internal id
         %else
            external id = internal id
         %finish
         otype = external %if otype <= dynamic      {external, system, dynamic}
      %finish
   %finish
   alias = ""
   %if 7 <= form <= 10 %start;        ! PROCEDURE
      gtype = spec
      %if otype # 0 %and spec # 0 %start;     ! external spec
         %if otype = primrt %start
            primno = primno + 1
            decvar_flag = decvar_flag ! prim bit
            decvar_header = prim no;   ! *** THIS NEEDS FIXING ***
            %return %if prim no # 2;      ! not READ SYMBOL
            otype = external;  external id = read sym fn;   ! see "CALL"
         %finish
         gfix(align)
         decvar_disp = ga;  decvar_base = gla
         external link(ep ref, 0, ga)
         %return
      %finish
      %if gmode = 0 %start;              ! NOT A PARAMETER
         potype = otype
         %if new # 0 %start;             ! NEW NAME
            decvar_disp = new tag;       ! Procedure ID
         %finish
         block name = internal id %if spec = 0
         %return
      %finish
      ignore = 1
      otype = 0;  size = 4;  data size = 4;  ! procedure parameter
   %else
      data size = size
      %if form # 1 %start
         Round = Align
         %if type = 0 %start;                  ! General %name
            ignore = 1
            decvar_extra = gmode;        ! FOR LABELS
            type = general;  size = 8
            decvar_type = general
         %else %if form = array %or form = name array 
            ignore = 1
            size = 0
            data size = reglen %if form = name array
         %else %if form = array name %or form = name array name 
            ignore = 1
            size = 2*reglen;  round = align;         ! array header
            decvar_header = -1
            abort(m'DFV3') %unless 0 < dimension <= 7
            decvar_flag = decvar_flag ! dimension;   ! 'dim' in low order 3 bits
         %else
            size = 4;                       ! integer (etc) %name
         %finish
      %finish
   %finish

   %if otype # 0 %start;      ! OWN DATA
      %if otype = con %start;      ! CONST INTEGER ETC.
         data size = 0 %if type=strings %and form=1;    ! use actual size
         %if form = 2 %or form = arrayname %or form = namearrayname %start
            otype = 0;        ! Treat as special later
         %else
            ignore = 1;      ! no diags for named constants
         %finish
      %else
         gfix(round)
         set diag(gla,ga) %if ignore # 1
      %finish
      own type = type;  own form = form
      own type = integers %and data size = 4 %if form = 2
      decvar_header = -1
      %if spec = 0 %start
         %if form = array %or form = name array %start
            own form = array;         ! to simplify subsequent test at 'A'
            decvar_flag = decvar_flag&(\array bits)!(anbit!1);   ! 1-D %name
            ! mark as candidate for MHR subscript scaling if bounds do not
            ! exceed -32768 <= x <= 32767 and  data size <= 32767
            decvar_flag = decvar_flag ! cheap array bit %if   %c
                              0 < decvar_length <= 32767 %and %c
                              -32768 <= vlb {<= 32767}  %and  %c
                              {-32768 <=} vub <= 32767
                              {Note: vlb <= vub-1}
            gfix(align)
            set dope vector;      ! N.B.  changes vlb, vub
            %if otype # con %start
               decvar_disp = ga;  decvar_base = gla
               gword rel(ga+8-vlb);        ! @A(0)          (in gla area)
               gword crel(dv);              ! @dope vector   (in code area)
            %else;          !  %const ...... %array
               claim literal(vub,align);  ! no header this time (it's in GLA)
               select literal area
               decvar_disp = ga;  decvar_base = gla
               gword crel(ca-vlb)
               gword crel(dv)
               select code area
            %finish
            external link(data defn,0,ga-8) %if otype = external
         %finish
      %else
               {to RECORD variant with 1-dim bit set, if nesc}
         decvar_xform = (decvar_xform+3) ! (assigned<<8)
         decvar_xform = decvar_Xform!1<<8 %if Form >= Array
         decvar_base = gla;  decvar_disp = 0;  decvar_extra = ga+8
         external link(data ref,0,ga)
      %finish
      %return
   %finish

   %if form = 3 %start;         !%label
      decvar_disp = new tag
      %return
   %finish

   %if form = switch %start
      decvar_extra = vlb;  decvar_length = vub-vlb+1
      decvar_format = free tag + 1;       ! base tag
      claim literal((vub-vlb+1+2)*2,1)
      decvar_base = code;  decvar_disp = litmax
      select literal area
      cput(vlb);  cput(vub);            ! switch bounds
      %for s = vlb,1,vub %cycle
         free tag = free tag + 1
         define reference(free tag,sw ref)
         cput(free tag)
      %repeat
      select code area
      %return
   %finish

   %if form = record format %start
      %if gmode # 0 %start
         frame = decvar_length %if decvar_length > frame
      %else
         gtype = -1;  spec = -1
      %finish
      %return
   %finish

   decvar_base = local
   %if gdisp >= 0 %and decvar_flag & array bits = 0   %c
                  %and ( (decvar_form = a in s %and decvar_type # general)    %c
                    %or (decvar_form = v in s %and decvar_type <= byte) ) %start
      decvar_disp = gdisp;  gdisp = gdisp - reglen
      decvar_disp = decvar_disp + decvar_type %if    %c
                        decvar_form = v in s %and short <= decvar_type <= byte
      decvar_flag = decvar_flag ! P in R;      ! Parameter in Register
      min parm = min parm + 1;                 ! for use by 'HEADER'
      %if control & suppress = 0 %start
         temp_form = decvar_form;  temp_type = decvar_type
         temp_xbase = decvar_base;  temp_disp = decvar_disp
         %if temp_form = A in S %start
            temp_form = V in S;  temp_type = integers
         %finish
         associate(temp, p1 - (min parm-1))
      %finish
   %else
      frame = (frame+round)&(\round)
      max local = frame
      decvar_disp = frame
      frame = frame + size
      alt align = alt align ! round
   %finish
   set diag(local,decvar_disp) %if ignore = 0
%end;        !    define var

!                                                               >> CHECKABLE <<
%predicate  checkable(%record(stackfm)%name  v)
   ! Presumes test on 'CONTROL&CHECK UNASS' in line for speed
   ! Note that a string temporary (v_type = 0) yields FALSE
   %false %if v_form = constant %or v_form = AV in S
   %false %if v_flag & assigned # 0
   %true %if v_type = integers %or v_type = strings %or v_type >= reals
   %false
%end;            ! checkable

!                                                       >> DESCRIPTOR <<
! N.B.  Note that the record zero operation is used, among
!       other things, to set the link field to NULL. This
!       equivalence between binary zero and NULL links must
!       be maintained.
%record(stackfm)%map  descriptor
%record(dfm)%name  d
%record(stackfm)%name  v
   stp = stp+1;  abort(m'DSC1') %if stp > max depth

   v == desc asl;  abort(m'DSC2') %if v == null
   d == dasl;  abort(m'DSC3') %if d == null
   desc asl == v_link;  v = 0
   dasl == d_link;  d_link == using_link;  using_link == d
   d_d == v
   %result == v
%end

!                                                             >> DROP <<
%routine  drop(%record(stackfm)%name  descriptor)
%record(dfm)%name  p,q
   p == using
   %cycle
      q == p_link
      abort(m'DROP') %if q == null
      %exit %if q_d == descriptor
      p == q
   %repeat
   p_link == q_link
   q_link == dasl;  dasl == q
   descriptor_link == desc asl;  desc asl == descriptor
%end

!                                                           >> VSTACK <<
%routine  vstack(%integer  var no)
%record(varfm)%name  w
   abort(m'VSTK') %unless 0 <= var no <= max vars
   w == var(varno)
   lhs == descriptor
   stacked(stp)_v == lhs
   lhs_base = w_base
   lhs_disp = w_disp
   lhs_format = w_format
   lhs_extra = w_extra
   lhs_type = w_type
   lhs_length = w_length
   lhs_header = w_header
   lhs_link == null
   lhs_type = w_type;  lhs_xform = w_xform
   lhs_dim = w_flag&7;      ! in case it's an array
   lhs_varno = varno
   monitor(lhs, "V stack") %if diagnose&1 # 0
%end

!                                                           >> SSTACK <<
%routine  sstack(%record(stackfm)%name  v)
%record(stackfm)%name  t
   t == descriptor;  t = v
   stacked(stp)_v == t
   monitor(t, "S STACK") %if diagnose&1 # 0
%end

!                                                          >> C STACK <<
%routine  c stack(%integer  n)
   rhs == descriptor
   rhs_base = 0
   rhs_disp = n
   rhs_type = integers
   rhs_form = constant
   stacked(stp)_v == rhs
   monitor(rhs, "C stack") %if diagnose&1 # 0
%end

!                                                           >> C LOAD <<
%routine  cload(%integer  value, reg)
   c stack(value)
   pop lhs
   lrd(lhs,reg)
%end

!                                                             >> SSET <<
%routine  sset(%integer  base, disp, xform, extra)
   rhs == descriptor
   rhs_base = base
   rhs_disp = disp
   rhs_type = integers
   rhs_xform = xform
   rhs_extra = extra
   rhs_link == null
   stacked(stp)_v == rhs
   monitor(rhs, "SSET") %if diagnose&1 # 0
%end

!                                                          >> SET LHS <<
%routine  set lhs
   lhs == stacked(stp)_v
   monitor(lhs, "SET LHS") %if diagnose&1 # 0
%end

!                                                         >> SET BOTH <<
%routine  set both
   abort(m'SETB') %if stp <= 1
   lhs == stacked(stp-1)_v
   rhs == stacked(stp)_v
   %if diagnose&1 # 0 %start
      monitor(lhs, "BOTH LHS")
      monitor(rhs, "BOTH RHS")
   %finish
%end

!                                                          >> POP LHS <<
%routine  pop lhs
   abort(m'POPL') %if stp <= 0
   lhs == stacked(stp)_v
   stp = stp-1
   monitor(lhs, "POP LHS") %if diagnose&1 # 0
%end

!                                                         >> POP DROP <<
%routine  pop drop
   pop lhs
   monitor(lhs, "POP DROP") %if diagnose&1 # 0
   drop(lhs)
%end

!STRING PROCESSING
!                                                      >> DUMP STRING <<
%routine  dump string(%integer  max)
%integer  j
   %if max = 0 %start;       ! DUMP AS MUCH AS NEEDED
      max = cslen+1
   %else;                    ! DUMP NO MORE THAN MAX
      %if cslen+1 > max %start
         ! String constant too long - warn and truncate
         %if cslen # x'80' %or current string(1) # x'80' %start
            warn(5);  current string(0) = max-1
         %finish
      %finish
   %finish
   %if otype = con %start
      select literal area
      lit byte(current string(j)) %for j = 0,1,max-1
      select code area
   %else;        !  %own
      gbyte(current string(j)) %for j = 0,1,max-1
   %finish
%end

!                                                       >> GET STRING <<
%routine  get string
   %integer  l
   l = next;                  !length
   cslen = 0
   %while l > 0 %cycle
      l = l-1
      read symbol(next)
      cslen = (cslen+1)&255;  current string(cslen) = next
   %repeat
   readsymbol(next)
   %if next # 'A' %and next # '$' %start
      %if next = '.' %and cslen = 1 %and
                            control&(check capacity!check unass) = 0 %start
         cstack(current string(1))
         Rhs_Flag = Rhs_Flag!Quick Conc
         %return
      %finish
      cstack(0);  rhs_type = strings
      otype = con;        ! anonymous %const
      rhs_base = code;  rhs_xform = VinS!(assigned<<8);  rhs_format = cslen+1
      %if cslen # 0 %or null string = 0 %start
         claim literal(cslen+1,1);   ! Alignment req'd for buffer flushing
         rhs_disp = lita;  dump string(0)
         null string = rhs_disp %if null string = 0 = cslen
      %else
         rhs_disp = null string
      %finish
   %else
      cstack(0);         ! explicit string initialisation
   %finish
%end

!                                                    >> REAL CONSTANT <<
%integerfn  real constant(%integer  force)
%owninteger  last = 0, next = 0
%integer  j,k
%ownintegerarray  val(0:31) = 0(32)
%ownshortintegerarray  index(0:31) = 0(32)
   k = integer(addr(rvalue))
   %if otype # con %start
      gfix(3);  gword(k)
      %result = ga-4
   %finish
! deal with %const anonymous or not
   %if force = 0 %start
      j = last
      %cycle
         -> FOUND %if val(last) = k
         last = (last+1)&31
         %exit %if last = j
      %repeat
      claim literal(single,single-1);      ! anonymous value not in cache
   %finish
   next = (next+1)&31;  last = next
   select literal area
   val(last) = k;  index(last) = ca
   cword(k)
   select code area
FOUND:
   %result = index(last)
%end;                  ! real constant

!LABEL PROCESSING
!                                                          >> NEW TAG <<
%integerfn  new tag
   free tag = free tag + 1
   %result = free tag
%end

!                                                        >> NEW LABEL <<
%record(labelfm)%map  new label
   labs = labs+1;  abort(m'NLBL') %if labs > max labels
   %result == labels(labs)
%end

!                                                             >> FIND <<
%record(labelfm)%map  find(%integer  label)
%integer  lp
%record(labelfm)%name  l
   lp = labs
   %while lp # label start %cycle
      l == labels(lp)
      %result == l %if l_id = label
      lp = lp-1
   %repeat
   %result == null
%end

!                                                     >> DEFINE LABEL <<
%routine  define label(%integer  label)
   %integer ltag, new
   %record(labelfm)%name  l
   %record(envfm)%name E
   cc ca = 0               {must forget condition code}
   new = 0
   %return %if label = 0;      ! JUMP AROUND PROCEDURE
   %if label < 0 %start
      ltag = -label
      new = 1
   %else
      l == find(label)
      %if l == null %start
         l == new label
         l_id = label;  l_tag = new tag
         new = 1
      %else
         %if l_tag < 0 %and label >= 0 %start
            l_tag = new tag
            new = 1
         %finish
      %finish
      l_tag = l_tag ! bit15
      ltag = l_tag
   %finish
   %if new # 0 %start
      e == environment(label)
      e_label = 0 %if e ## null
   %finish
   define tag(ltag & x'7FFF')
   merge environment(label) %if uncond jump # ca
   restore environment(label)
   %if trace flag # 0 %start
      dump trace %if next # ':' %and next # 'L'
   %finish
   uncond jump = 0;            ! YOU CAN GET HERE !
   mark assigned = 0;      ! can't be sure any more
%end;       ! define label

!                                                          >> JUMP TO <<
%routine  jump to(%integer  label, cond, def)
%record(labelfm)%name  lab
%integer  ref
   invert = 0
   Cond = Inverted(Cond) %if Cond&16 # 0
   %if def >= 0 %start;         ! Compiler defined label
      %return %if label = 0;        ! jump round routine
      %if label < 0 %start
         j tag = -label
      %else
         lab == find(label)
         %if lab == null %start
            lab == new label
            lab_id = label;  lab_tag = new tag
            remember environment(label)
         %else %if lab_tag < 0 %and def = redefine old
            lab_tag = new tag
            remember environment(label)
         %else
            merge environment(label) %if lab_tag > 0
         %finish
         j tag = lab_tag&x'7FFF'
      %finish
   %else;                        ! Tag internal to pass 2
      jtag = label;      ! *** N.B. This is %not a pass1-visible label ***
   %finish
   %if cond = jump %then ref = j ref %else ref = c ref
   define reference(j tag,ref)
   cput(jtag<<4 + cond&15);  cc ca = cc ca + 2;   ! these two bytes can't change CC
   %if cond = jump %start
      uncond jump = ca;      ! no way past here
      trace flag = control&trace %if next = ':';   ! to catch 'else', 'repeat' etc
   %else
      trace flag = control&trace;   ! maybe trace flow on next line
   %finish
   mark assigned = 0
%end;            ! jump to

!                                                            >> FLOAT <<
%routine  float(%record(stackfm)%name  v, %integer r)
! Convert 'v' into floating point form
%integer  k
!!!!!%longreal  x
   r = fpr %if r = anyf
   %if const(v) %start
      %if v_disp = 0 %start
         hazard(r);  claim(r)
         rr(sub,r,r);  claim(r)
         v_type = reall;  v_form = v in r;  v_base = r
      %else
         rvalue = v_disp;       ! ** IMPLICIT FLOATING **
         otype = con;  k = real constant(0)
         v_xform = (assigned<<8) ! V in S;  v_type = reals
         v_base = code;  v_disp = k
      %finish
   %else
      load(v,any)
      rr(flr,r,v_base);  claim(r)
      v_form = v in r;  v_type = reall
      v_base = r
   %finish
%end

!                                                              >> LRD <<
%routine  lrd(%record(stackfm)%name  v, %integer  reg)
! load, release and drop
   load(v,reg)
   release(v_base)
   drop(v)
%end

!                                                           >> QUICK LOAD <<
%routine QUICK LOAD(%integer reg, form, base, disp)
   %record(stackfm) v
   v = 0
   v_type = integers;  v_form = form
   v_base = base;      v_disp = disp
   load(v, reg)
%end

!                                                           >> REDUCE <<
%routine  reduce(%record(stackfm)%name  v)
%integer  type, xform, disp, base
   xform = v_xform - 3;         ! X in REC => X in S
   type = v_type
   disp = v_disp;  base = v_base
   v_disp = v_extra;  v_type = integers;  v_form = v in s
   load(v,any)
   v_type = type;  v_xform = xform & (\(assigned<<8))
   v_disp = disp
%end

!                                                             >> AMAP <<
%routine  amap(%record(stackfm)%name  v)
! convert V into a descriptor for the address of V
%integer f
%constshortintegerarray  map(0:15) =
   -1, -2, -3, -4, av in s, -5, v in s, av in rec, -6, v in rec,
   -7, -8, -9, -10, -11 {PGM LABEL}, -12 {record format}
   f = map(v_form)
   %if f < 0 %start
      abort(m'AMAP') %unless v_form = pgm label
      ! Deal with ADDR(pgm label)
      f = gpr;  forget reg(1<<f)
      define reference(v_disp&x'FFF',r ref)
      rx(LA,f,code,0)
      v_type = integers;  v_xform = VinR
      v_base = f; v_disp = 0
      claim(f)
      %return
   %finish
   %if (f = VinREC %or f = AVinREC) %and v_disp = 0 %start     {eliminate redundant LOAD}
      %if f = VinREC %then f = AinS %else f = VinS
      v_disp = v_extra
   %finish
   v_type = integers;  v_form = f
%end

!                                                                 >> AMAPS <<
%routine  amaps(%record(stackfm)%name  v)
%integer  t,l
   t = v_type;  l = v_length
   amap(v)
   %return %if t # strings;      ! put length in top byte
   reduce(v) %if v_form >= V in REC
   load(v,any) %if v_form = V in S %or v_Form = AinS
   !! It must be:   const, V in R or AV in S
   v_disp = v_disp + l<<24
   v_form = AV in S
%end

!                                                             >> VMAP <<
%routine  vmap(%record(stackfm)%name  v)
   ! The inverse of AMAP:  i.e. vmap(amap(x)) => x
   %integer  mod, f, t
   %constshortintegerarray  map(0:8) =
         v in s, v in s, -1, -2, a in s, v in s, -3, a in rec, v in rec
   mod = 0
   %if v_oper # 0 %start
      %if (v_oper=add %or v_oper=sub) %and const(v_link) %start
         mod = v_link_disp 
         mod = -mod %if v_oper = sub
         v_oper = 0;  drop(v_link)
      %finish
      load(v,any)
   %else %if v_form = a in s %or v_form = a in rec
      T = V_Type
      Amap(V)
      load(v,any)
      V_Type = T;  V_Form = VinS
   %finish
   f = map(v_form);  abort(m'VMAP') %if f < 0
   v_form = f
   v_disp = v_disp + mod
%end;            !  v map

!                                                          >> ADDRESS <<
%routine  address(%record(stackfm)%name  v, %integer  mode)
! convert V into a form in which it is directly addressable
! MODE parameter specifies what type of result is required.
!            >= 0 : a value (RHS)
!             < 0 : a name  (LHS)
! Further, if MODE > 0, the value is taken to specify the target register
! for any LOAD which may be generated.
%integer  type, form, reg, d, cr
%ownrecord(stackfm)%name  last == (0);   ! ***** null actually ****** UGH 
   monitor(v, "ADDRESS") %if diagnose&2 # 0
   reg = mode
   %if reg <= 0 %start
      reg = any
      reg = anyf %if v_type >= reals %or (v_oper # 0 %and floating(v))
   %finish
   cr = reg;               !*psr*
   %if v_oper # 0 %start;         ! compound object
      %if v_oper = ADD %and const(v_link) %and v_type <= BYTE %start
         d = v_link_disp;  drop(v_link)
         v_oper = 0
         load(v,reg)
         v_disp = d;  v_form = AV in S
      %else
         load(v,reg)
      %finish
      ->SET CR
   %finish
   form = v_form;  type = v_type
   %if form >= V in REC %start
      reduce(v);  form = v_form
   %finish
   %if control & suppress = 0 %start
      cheap reg = cr
      cheapen(v,mode)
      cr = cheap reg
      form = v_form
   %finish
   ->SET CR %if form = V in R %or form = constant
   %if form = AV in S %start
      %if v_base = 0 %start
         v_form = constant
      %else %if v_disp = 0
         v_form = V in R
      %finish
      ->SET CR
   %finish
   %if form = A in S %start
      v_form = V in S;  v_type = integers
      load(v,any)
      v_type = type;  v_xform = (v_flag&(\assigned))<<8 ! V in S;  v_disp = 0
      form = V in S
   %finish
   %if %not last == v %start;      ! *** FRIG: to prevent mutually recursive loop
      last == v
      %if mode >= 0 %and ((control&check unass#0 %and v_type#strings  %c
                                 %and checkable(v)) %or v_type = byte) %start
         load(v,reg)
      %finish
      last == null
   %finish

SET CR:

   cheap reg = cr
%end;            ! address

!                                                             >> LOAD <<
%routine  load(%record(stackfm)%name  v, %integer  r)
! load the entity described by V into register R

%record(stackfm)%name  w
%switch  f(constant:a in rec), iop(not:rdiv), rop(not:rdiv)
%record(stackfm)  z
%record(stackfm)%name  temp rhs
%integer  op, d, type, temp, n, uflag

      %constbyteintegerarray  twin(R0:R15) =
               R1,R0, R3,R2, R5,R4, R7,R6, R9,R8, R11,R10, R13,R12, R15,R14


   %routine PICKUP(%record(stackfm)%name V)
      %integer  old
      load(v, r)
      %if R = Any %or R = AnyF %start
         old = R;   R = V_Base
         %return %if Activity(R) = 1 %or (Activity(R)=2 %and W_Base = R)
         %if old = Any %then R = Gpr %else R = Fpr
         Load(V, R)
      %else
         abort(m'Pick') %if activity(r) # 1
      %finish
   %end

   monitor(v, "LOAD") %if diagnose&2 # 0
   -> realv %if floating(v) %or fr0 <= r <= fr14 %or r = anyf
   op = v_oper;  v_oper = 0
   %if op # 0 %start
      w == v_link;  {address(w,0)};   ! records reduced here
      load(w,any) %if w_base = r # v_base;   ! *** FRIG: to avoid problem
                                          ! with HAZARD and e.g.  -> sw( -A(j) )
      -> iop(op)
   %finish
   amap(v) %if v_type = 0 %or v_type = strings %or v_type = records
   address(v,r)
   %if r = any %start
      %return %if v_form = VinR
      %if v_form = AV in S %and activity(v_base) = 1 %and -15 <= v_disp <= 15 %start
         r = v_base
      %else
         r = gpr
      %finish
   %else
      %if v_base = r %start
         %if activity(r) > 1 %start      {protect other uses}
            release(r);  v_base = 0
            hazard(r)
            claim(r);    v_base = r
         %finish
      %else
         hazard(r)
      %finish
   %finish
   -> f(v_form)

f(av in rec):
f(a in rec):
f(v in rec):
f(A in S):
   abort(m'LD1');         ! These forms should have been simplified by ADDRESS

f(av in s):
f(constant):
   abort(m'LD2') %if v_type >= reals
   rxi(lw,r,v_base,v_disp)
   forget reg(1<<r);  associate(v,r) %if r # v_base;   ! e.g.LHI 12,1(12)
CSETI:
   v_type = integers
CSET:
   v_form = v in r
   v_base = r;  v_disp = 0
   claim(r)
   %return

f(v in r):
   %return %if v_base = r
   rr(lw,r,v_base);  forget reg(1<<r) 
   v_base = r
   claim(r)
   %return

f(v in s):
   uflag = control & check unass
   %if integers < v_type < reals %start
      abort(m'LD3') %if short # v_type # byte
      uflag = 0
   %else
      uflag = 0 %if v_Flag&assigned # 0 %or %not checkable(v) %or v_Type = 255
   %finish
   %if V_Type = 255 %start
      V_Type = Short
      Rxd(LHL, r, v)
      Forget reg(1<<r)
   %else
      rxd(lw,r,v)
      forget reg(1<<r);  associate(v,r)
   %finish
   %if uflag # 0 %start
      %if v_type < reals %start
         v_type = integers
         %if level # 5 %start
            rr(clw,r,r12)
         %else
            rx(clw,r,code,unass)
         %finish
      %else
         v_type = reall
         rx(cmp,r,code,unass)
      %finish
      rr(bal,link,code)
      v_flag = v_flag & (\assigned);   ! only one level remembered (1 bit !!)
   %finish
   -> CSET

! integer operations
iop(and):
   %if control&check unass = 0 %and w_form = constant %start
      address(v, r)
      %if w_disp = x'FFFF' %start
         %if v_form = VinS %and (v_type = integers %or v_type = short) %start
            v_disp = v_disp+2 %if v_type = integers
LOADL:
            v_type = 255
            drop(w)
            Load(V, R)
            %return
         %finish
      %else %if w_disp = 255
         drop(w)
         %if v_form = VinR %start
            r = gpr %if r = any
            rr(LBR, r, v_base)
            ->CSETI
         %finish
         %if v_type = integers %start
            v_disp = v_disp+3
         %else %if v_type = short
            v_disp = v_disp+1
         %finish
         v_type = byte
         load(v, r)
         %return
      %finish
   %finish
   {** Drops through **}
iop(add):
iop(sub):
iop(or):
iop(xor):
   pickup(v)            {sets R}
   address(w, 0)        {**Moved down one line**}
   rxd(op,r,w)
   -> end op

iop(rsh):
   %if control&check unass = 0 %and w_form = constant %and w_disp = 16 %start
      address(v, r)
      ->LOADL %if v_form = VinS %and v_type = integers
   %finish
iop(lsh):
   %if w_form # constant %and control&check capacity # 0 %start
      load(w,r2);  perm(vschk)
   %finish
   pickup(v)               {sets R}
   %if w_form = constant %start
      warn(6) %unless 0 <= w_disp <= 8*reglen-1
   %else;         !  variable shift
      load(w,any) %if w_form # V in R
      w_disp = 0
   %finish
   rxi(op,v_base,w_base,w_disp)
   -> end op

! these operations are changed immediately into binary subtracts
! and should themselves never appear in LOAD
!         -x   =>   0 - x
!         \x   =>  -1 - x   (assumes 2's complement)
iop(not):
iop(neg):
   abort(m'LD4')

iop(div):
   %if w_form = constant %start
      n = power(w_disp)
      %if n > 0 %start
         Pickup(V)         {make sure it's in the correct register}
         Test Zero(v);  r = v_base
         claim(r)
         d = 1;  d = 2 %if n > 4;   ! 1 or 2 halfwords
         skip(d, greater or equal)
         rxi(ADD, v_base, 0, \((-1)<<n))
         rxi(SRA, v_base, 0, n)
         ->END OP
      %finish
   %finish
   {** Drops through **}

! *** N.B. ***
!   The multiply routine below is not intended for use in array subscript
!   calculation as it will include an overflow check.  Currently all in-line
!   subscript scaling uses shift or 'multiply halfword' instructions.
iop(mul):
iop(rem):
   %if r = any %start
      n = 0;  n = 1 %if op = MUL
      %if in free reg(v) %and actual(v_base)&1 = n      %c
                         %and activity(twin(v_base)) = 0 %start
         temp = v_base
         temp = twin(temp) %if op # MUL
      %else
         temp = even odd pair
      %finish
   %else
      %if actual(r)&1 # 0 %and activity(twin(r)) = 0 %start
         temp = r
      %else
         temp = even odd pair
      %finish
   %finish
   n = twin(temp)
   claim(n);  load(v,temp)
   release(n);  hazard(n);  claim(n)
   d = op
   %if op # MUL %start
      rr(lw,n,temp);  claim(temp)
      rxi(sra,n,0,31);        ! propagate sign
      d = div
   %finish
   forget reg( (2+1)<<n );               ! forget N,TEMP (adjacent)
   address(w, 0)
      ! Note complication below because machine op-code only caters
      ! for the cases INTEGER*INTEGER, INTEGER//INTEGER,  rem(INTEGER,INTEGER)
      ! Short, byte and constant multipliers must therefore be preloaded
      ! into a register
   load(w,any) %if w_form = constant %or w_form = AV in S %or w_type # integers
   rxd(d,n,w)
   release(n)
   %if op = MUL %start
      %if control & check capacity # 0 %start;   ! overflow check
         %if n # R0 %start
            claim(n);  rr(LW,r0,n)
         %finish
         perm(mulchk)
      %finish
   %else %if op = rem
      ! Interested in remainder not dividend
      claim(n);  release(temp)
      d = temp;  temp = n;  n = d
   %finish
   v_base = temp;  v_disp = 0;  v_form = v in r
   load(v,r) %if temp # r
   -> end op

! Special multiply routine used for array subscript scaling where all values
! involved are in range: -32768 <= x <= +32767
iop(mult16):
   %if r = v_base %or v_type = byte %start
      load(v,any)
   %else
      address(v,0)
      load(v,any) %if v_form # V in S %and v_form # V in R %and v_form # constant
   %finish
   v_disp = v_disp+reglen//2 %if v_type = integers;   !  ** halfword instruction!! **
   pickup(w);                       ! scale factor (data size) - & sets R
   rxd(mult16,r,v)
   v_base = r;  v_disp = 0;  v_xform = V in R
   -> end op

iop(exp):
   load(v,r3);   load(w,r2)
   release(r3);  release(r2)
   perm(iexp)
   claim(r1);  v_base = r1
   -> end op

iop(conc):
   address(v, r)
   %if v_type # 0 %start
      pdisp = basic frame %if pdisp = 0
      ! N.B.  Must %not corrupt LHS/RHS in LOAD
      temp rhs == rhs
      sset(wsp,pdisp,V in S,0);  rhs_type = strings;  rhs_length = 255
      rhs == temp rhs
      sstack(v);  v_Base = 0
      assign(1)
      claim(r2)
      v_type = strings;  v_form = VinS
      v_base = r2;       v_disp = 0
      v_length = 255;           ! it's a temporary now
      pdisp = pdisp + 256;      ! ... so protect it
   %finish
   %if w_flag & quick conc # 0 %start;      ! S = S.tostring(sym)
      z = v;  claim(z_base);  z_type = byte
      load(z, any)
      rxi(LW, z_base, z_base, 1);  claim(z_base)              {length+1}
      load(w, any)                                            {character}
      v_index = z_base;  v_type = byte;  v_form = VinS
      rxd(ST, w_base, v);  release(w_base)
      claim(v_base);  v_index = 0
      rxd(ST, z_base, v)
   %else
      load(v, r2)
      load(w,r1);  release(r1);  release(r2)
      n = v_length;  n = 255 %if n = 0
      perm(sconc);  cput(n)
      v_form = VinS
   %finish
   claim(v_base)
   v_type = 0
   %if r # any %and r # 0 %start;       ! not from OPERATE
      load(v,r);  v_type = 0;  v_form = v in s
   %finish
   drop(w)
   %return         {Note: nothing to forget}

! floating operations
REALV:
   abort(m'LD5') %if r = any;     ! should be floating register
   op = v_oper;  v_oper = 0
   %if op # 0 %start
      w == v_link
      -> rop(op)

rop(not):
rop(lsh):
rop(rsh):
rop(and):
rop(or):
rop(xor):
rop(conc):
rop(mult16):
      abort(m'LD6');              !  inappropriate operator

rop(rdiv):
      op = div
rop(div):
rop(add):
rop(sub):
rop(mul):
      %if w_type < reals %start
         float(w, anyf)
         %if w_form = V in R # v_form %and v_type >= reals    %c
                                           %and (op = add %or op = mul) %start
            z = v;  v = w;  w = z;      ! interchange
         %finish
      %finish
      Pickup(v);  r = v_base
      Address(W, 0)
      rxd(op,r,w)
      -> end op

rop(neg):
      abort(m'LD7');               ! should have been modified by OPERATE

   %finish
   float(v, r) %if v_type < reals
   address(v, r)                  {AFTER float to prevent optimising constants}
                                   {e.g. I=0;  R=0}
   %if v_form = v in r %start
      %return %if r = anyf %or v_base = r
      hazard(r);  rr(lw,r,v_base)
      v_base = r;  claim(r)
      %return
   %finish
   %if r = anyf %start
      r = fpr
   %else
      hazard(r) %unless r = v_base
   %finish
   abort(m'LD8') %unless fr0 <= r <= fr14
   -> f(v_form)

rop(rexp):
   abort(m'LD9') %if w_type >= reals
   load(v,fr2);  load(w,r1)
   release(fr2);  release(r1)
   perm(fexp);         ! floating exponent
   claim(fr0);  v_base = fr0

END OP:
   V_Type = Integers %if V_Type <= Byte
   forget reg(1<<v_base) 
   drop(w)
%end;            ! load

!                                                              >> COP <<
%routine  cop(%integer  op, %record(stackfm)%name  lh,rh)
! perform a compile-time operation
%constinteger  fp tens=70;      ! max powers of ten available in floating point
%integer  l,r
%switch  s(1:rdiv)
   %integerfn  p10(%integer  n);      ! approximate powers of ten in 'n'
   %integer  value, power
      value = 1;  power = 0
      %cycle
         %result = power %if value >= n
         value = value*10
         power = power+1
         abort(m'COP1') %if power > 100
      %repeat
   %end
   l = lh_disp;  r = rh_disp
   -> s(op)
s(NEG):
s(NOT):
s(CONC): abort(m'COP2')

s(ADD):  l = l+r;   -> EXIT
s(SUB):  l = l-r;   -> EXIT
s(OR):   l = l!R;   -> EXIT
s(AND):  l = l&r;   -> EXIT
s(XOR):  l = l!!R;  -> EXIT
s(LSH):  l = l<<r;  -> EXIT
s(MUL):  l = l*r;   -> EXIT
s(MULT16):  l = l*r;   -> EXIT
s(RSH):  l = l>>r;  -> EXIT
s(EXP):  l = l^^r;  -> EXIT
s(DIV):  warn(1) %and r = 1 %if r = 0
         l = l//r;  -> EXIT
s(REM):  warn(1) %and r = 1 %if r = 0
         l = l-l//r*r;  -> EXIT
s(REXP):
         warn(7) %and r = 0 %if p10(|l|) * r > fp tens
         rvalue = l^r;     !  **** implicit floating ****
         -> REAL
s(RDIV):
         warn(1) %and r = 1 %if r = 0
         rvalue = l/r;      !  **** implicit floating ****
REAL:
   otype = con;  l = real constant(0)
   lh_base = code
   lh_type = reall;  lh_form = V in S
EXIT:
   lh_disp = l
%end
!                                                          >> OPERATE <<
%routine  operate(%integer  oper)
! perform the operation OPER on the top two elements of the stack.
!   (single element for unary operators)
%record(stackfm)%name  lh,rh,with
%integer  key,lcon,rcon,wcon,lop
%constbyteintegerarray  transitive(add:rdiv) =
         0,0,1,15(2),1(3),15(2),1,15(4)
%constbyteintegerarray  commutative(add:rdiv) =
         1,0,1,0,0,1(3),0(2),1,0(4)
%constshortintegerarray  nop value(add:rdiv) =
         0,0,1(2),0,-1,0(4),1,1(4)
   %routine  pickup(%record(stackfm)%name  v)
      %if floating(v) %then load(v,anyf) %else load(v,any)
   %end

   stp = stp-1
   lcon = 0;  rcon = 0;  wcon = 0
   lh == stacked(stp)_v
   %if const(lh) %start
      lcon = 1
   %else %if lh_type # strings %and lh_type # 0
      address(lh, 0) %if lh_oper = 0
   %finish
   rh == stacked(stp+1)_v
   %if const(rh) %start
      rcon = 1
      %if oper = sub %start
         oper = add;  rh_disp = -rh_disp
      %finish
   %finish
   %if lh_oper # 0 %start
      lop = lh_oper
      with == lh_link
      wcon = 1 %if const(with)
      %if wcon&rcon # 0 %start;     !!  fold
         key = transitive(oper)!transitive(lop)
         %if key = 0 %or (key = 1 %and oper = lop) %start
            with_disp = -with_disp %and lop = add %if lop = sub
            cop(oper,rh,with);  drop(with)
            lh_link == rh
            lh_oper = lop
            -> STRIP NOP
         %finish
      %finish
      pickup(lh)
   %finish
   %if rcon # 0 %start
      %if lcon#0 %or (oper=ADD %and lh_type=INTEGERS %and
                                 (lh_form=VinR %or lh_form=AVinS)) %start
         lh_form = AV in S %if lh_form = VinR
         cop(oper,lh,rh);  drop(rh)
         %return
      %finish
   %finish
   %if rh_oper # 0 %start
      pickup(rh)
   %else %if rcon # 0 %and rh_disp = 2
      ! treat *2 (real & integer) and ^2, ^^2 specially
      %if oper = mul %or oper = exp %or oper = rexp %start
         %if oper = mul %then oper = add %else oper = mul
         rh = lh;  rcon = 0;  claim(rh_base)
      %finish
   %finish
   %if commutative(oper) # 0 %and  ( lcon # 0      %c
            %or  ( lh_form # VinR %and rh_form = VinR %and
                                       activity(rh_base) >= 0 ) ) %start
      rh_link == lh
      stacked(stp)_v == rh
      rh_oper = oper
      ! keep various items valid for use at STRIP NOP:
      with == rh;  rh == lh;  lh == with
      rcon = lcon
   %else
      lh_oper = oper;  lh_link == rh
   %finish
STRIP NOP:
   %if rcon # 0 %start
      %if rh_disp = nop value(oper) %start
         lh_oper = 0;  drop(rh)
      %else %if oper = MUL %and control&check capacity = 0
         key = power(rh_disp)
         %if key > 0 %start
            lh_oper = lsh;  rh_disp = key
         %finish
      %finish
   %finish
%end;        !     operate

!                                                           >> ASSIGN <<
%routine  assign(%integer  assop)
! ASSOP =   -1:  parameter assignment
!            0:  == assignment
!            1:  =  assignment
!            2:  <- assignment
!            3:  Unchecked string move - either for speed or P in R
%constbyteintegerarray  string move(-1:3) =    SMOVE, 0, SMOVE, SJAM, SMOVOPT
%record(stackfm)%name  lh,rh,x
%record(stackfm)  temp
%integer  n,p,t,op,insert,form,lhdisp
   insert = 0
   abort(m'ASS1') %if stp < 2
   rh == stacked(stp)_v
   lh == stacked(stp-1)_v
   form = lh_form;        ! to avoid the ravages of amap, load etc
   %if diagnose&4 # 0 %start
      monitor(lh, "ASS LH")
      monitor(rh, "ASS RH")
   %finish
   
   %if assop < 0 %start;           ! Parameter
      %if lh_flag & prim bit # 0 %start;     ! Special - prim routine
         temp = lh;  lh = rh;  rh = temp
         p disp = 0
         %return
      %finish
      lh_extra = lh_extra - 1
      vstack(lh_extra);  lh == stacked(stp)_v
      form = lh_form;  lh disp = lh_disp;   ! preserve original values
      assop = 0 %if lh_form # v in s
      %if lh_flag & p in r = 0 %start;   ! not an in-register parameter
         p disp = lh_disp + lh_length
         p disp = p disp+1 %if lh_type = strings %and Form = VinS
         lh_disp = lh_disp + wdisp;   ! adjust for nested calls
      %finish
      %if lh_flag & proc bit # 0 %start;       ! Procedure parameter
         assop = 1
         lh_type = integers;  lh_form = v in s
         rh_type = integers;  rh_form = av in s
         %if rh_base # 0 %and rh_base # gla %start;    !  param already
            rh_form = v in s
         %else %if rh_base = gla;      ! non-local external
            rh_disp = rh_disp-5*reglen;  !dummy environment
         %else;                          ! local routine
            p = (frame+3)&(\3)
            frame = p+8*reglen
            t = rh_disp;                     !proc tag
            rh_disp = p;  rh_base = local
            define reference(t, r ref)
            rx(la, link, code, 0)
            rx(stm, r8, local, p)
         %finish
      %finish
   %finish
   stp = stp-2

   %if rh_flag & array bits # 0 %start;       ! Arrayname
      p disp = lh_disp + 2*reglen
      hazard(r0)
      address(lh,-1);  address(rh,-1)
      %if rh_header = -1 %start;              ! Simple case
         rx(lw,r0,rh_base,rh_disp);          ! @A(0)
      %else;                                   ! Array-in-record
         rxi(lw,r0,rh_base,rh_disp)
         rx(add,r0,gla,rh_header)
         rh_disp = rh_header;  rh_base = GLA
      %finish
      %if lh_type = strings %and lh_length = 0 %start;   ! %string(*)%arrayname
         RXI(ADD,r0,0,rh_length<<24);         ! length in top byte
      %finish
      forget reg(1<<r0)
      rx(st,r0,lh_base,lh_disp)
      claim(rh_base);  rx(lw,r0,rh_base,rh_disp+reglen)
      claim(lh_base);  rx(st,r0,lh_base,lh_disp+reglen)
      drop(lh);  drop(rh)
      %return
   %finish

   %if lh_type = general %start;     ! general %name parameter
      abort(m'ASS2') %unless assop = 0
      %if rh_type = general %start
         amap(lh);  address(lh,-1)
         amap(rh);  address(rh,-1)
         hazard(r0)
         rx(lw,r0,rh_base,rh_disp)
         rx(st,r0,lh_base,lh_disp)
         claim(lh_base);  claim(rh_base)
         rx(lw,r0,rh_base,rh_disp+reglen)
         rx(st,r0,lh_base,lh_disp+reglen)
         drop(lh);  drop(rh)
         %return
      %finish
      t = rh_type
      rh_flag = rh_flag ! assigned;   ! pointer proper may never be used !!!!!
      n = rh_length; n = n+1 %if t = strings;   ! logical => physical length
      amaps(rh);  lrd(rh,any);  p = rh_base
      rx(st,p,lh_base,lh_disp)
      claim(lh_base)
      cload((n<<4) + genmap(t),p)
      rx(st,p,lh_base,lh_disp+reglen)
      drop(lh)
      %return
   %finish

   %if assop = 0 %start;        ! ==
      amap(lh);      ! destination
      %if lh_length = 0 %then amaps(rh) %else amap(rh);   ! %string(*)%name ?
   %finish

   %if Lh_Type = Records %start
      n = Min Record Size(Lh, Rh)
      %if rh_Form # Constant %start
         lrd(rh,r1);        ! source area
         op = rcopy;        ! copy record
      %else
         drop(rh)
         op = rzero;        ! clear record
      %finish
      lrd(lh,r2);          ! destination area
      cload(n>>2,R3);         ! R3 = no. of WORDS to copy/zero
      perm(op)
      %return
   %finish

   %if lh_type = strings %and lh_flag & p in r = 0 %start
      %if assop > 0 %and rh_format = 1 %start;    ! null string as zero byte ?
         drop(rh)
         lh_type = byte;  sstack(lh);  drop(lh)
         cstack(0);  assign(assop)
         %return
      %finish
      p = lh_length
      %if assop # 2 %and same(lh,rh) %start;            ! S = S  or S = S.T
         %if rh_oper = 0 %start
            drop(lh);  drop(rh);      ! S = S
         %else
            rh_length = p
            release(lh_base);  drop(lh)
            rh_type = 0{;  address(rh,-1)};  lrd(rh,0)   {0 = special for CONC}
         %finish
      %else %if Control&Trusted # 0   %and
                assop # 2             %and
                Rh_Oper # 0           %and
                %not Same(Lh, Rh)     %and
                %not Same(Lh, Rh_Link)
         x == Rh_Link;  Rh_Oper = 0
         Load(Lh, R2);  Lrd(Rh, R1)
         Perm(String Move(3))
         Lh_Form = VinS;  Lh_Type = 0
         Lh_Oper = Conc;  Lh_Link == X
         Lrd(Lh, 0)
      %else;         ! general case

         rh_flag = rh_flag&(\quick conc);      ! quicky not possible after all.

         ! use fast string move if 'trusted' or capacity exceeded is impossible
         ! and unassigned is not requested or impossible.
         %if assop # 2 %start;               ! not jam transfer
            assop = 3 %if control & trusted # 0    %c
                      %or ( p >= rh_length   %c
                          %and (control&check unass = 0 %or %not checkable(rh)) )
         %finish
         %if rh_oper = 0 %start;   !simple, so protect lhs first: s(j)=t
            lrd(lh, r2);  lrd(rh, r1)
         %else;                    !simplify rh first: s = t.u
            lrd(rh, r1);  lrd(lh, r2)
         %finish
         perm( string move(assop) )
         cput(p) %if assop # 3;         ! max. length of destination for check ?
      %finish
      %return
   %finish

   %if lh_flag & p in r # 0 %start
      p = p1;  p = p2 %if lh disp < reglen;  p = p3 %if lh_type = strings
      load(rh,p) %if rh_oper # 0
      drop(lh)
      lh == stacked(stp)_v
      rh_oper = p;           ! target register
      rh_link == lh_link;  lh_link == rh
      address(lh, -1)
   %else
      ! Test for case where add-to-memory can profitably be used.
      ! Note that the effective no-op of self-assignment can be detected easily
      address(lh, -1)
      %if control & check bits = 0 %and rh_type <= short %C
                  %and (rh_oper = 0 %or rh_oper = ADD) %and same(lh,rh)  %start
         %if rh_oper = 0 %start;            ! assignment-to-self
            release(rh_base);  drop(rh)
            release(lh_base);  drop(lh)
            %return
         %finish
         ! General case: add-to-memory
         x == rh;  rh == rh_link
         release(x_base);  drop(x)
         load(rh,any)
         address(lh,-1);  rxd(AM,rh_base,lh)
         forget var(lh)
         release(rh_base);  drop(rh);  drop(lh)
         %return
      %finish
      ! test for assignment of small constants to %short and %byte
      t = rh_type
      %if rh_base = 0 %and rh_form = constant %and rh_Oper = 0 %start
         %if -32768 <= rh_disp <= 32767 %start
            %if rh_disp&(\255) = 0 %start
               t = byte
            %else
               t = short
            %finish
         %finish
      %finish
      ! . . . then suppress capacity check if LH is real or length RH is
      ! not greater than length LH.
      n = assop
      assop = 2 %if lh_type > byte %or lh_type <= t

      %if Lh_Form = VinR %start      {special by PSR - is it safe????}
         Load(Rh, Lh_Base)
         Assop = 2
      %else
         p = cheap reg                            {preferred register}
         float(rh, p) %if lh_type >= reals %and %not floating(rh)
                  {Float here to prevent optimising the integer value}
         address(rh, p)                           {see where it is}
         load(rh, p) %unless rh_form = VinR
         p = rh_base
         address(lh, -1) %unless lh_form = VinS
         rxd(ST, p, lh)

         %if control & suppress = 0 %start
            t = activity(lh_base)
            %if t < 0 %or control&trusted # 0 %start
               forget var(lh)
               %if mark assigned # 0 %and lh_base = local %start;   ! set 'assigned' ?
                  var(lh_varno)_flag = var(lh_varno)_flag ! assigned
               %finish
            %else
               forget all
            %finish
            lh_flag = lh_flag ! (rh_flag & assigned)
            associate(lh,p) %if n # 2;            ! not jam transfer
         %finish
         release(p)
      %finish
      drop(lh);  drop(rh)
   %finish
   %if assop = 1 %and control&check capacity # 0 %start
      %if lh_type = short %start
         claim(p);  rr(chvr,p,p)
         perm(cap16);       ! Test for 16-bit overflow
      %else
         rxi(TEST,p,0,\255);                ! should give zero result
         perm(cap8);                        ! Test for 8-bit overflow
      %finish
   %finish
%end;            !  assign

!                                                      >> LOAD PARAMS <<
%routine load params(%record(stackfm)%name v)
! called at c('E') to load in-register parameters set by ASSIGN above
%integer reg
%record(stackfm)%name  next
   %return %if v == null
   reg = v_oper
   v_oper = 0
   next == v_link
   load(v,reg)
   load params(next)
   release(reg)
   drop(v)
%end;         ! load params

!                                                        >> ARRAY REF <<
%routine  array ref(%integer mode)
   ! Array references are by perm call except in the case of unchecked 1-D arrays
   ! which either:
   ! (i) have a data size which is an integral power of 2, not greater than 16384.
   !           or:
   ! (ii) have data size <= 32768 and constant bounds -32768 <= x <= 32767.
   %integer  flags, p, type, base, assbit
   %integer  mult, shift;      ! ** PRESUMED SET BY 'UNCHECKED REF'
   %record(stackfm)%name  temp

   %predicate  special case
      shift = power(mult)
      %true %if shift >= 0 %or flags & cheap array bit # 0 %or Base = 0
      %false
   %end;         ! special case

   %routine  unchecked ref
      %integer  header, length, format, extra
      header = lhs_header;  length = lhs_length;  format = lhs_format
      extra = 0
      %if rhs_oper = ADD %or (rhs_oper = 0 %and
                             (rhs_form = AV in S %or rhs_form = Constant)) %start
         %if rhs_oper = ADD %start
            %if rhs_link_form = constant %or rhs_link_form = AV in S %start
               extra = rhs_link_disp
               %if rhs_link_form = AV in S %start;   ! => VinR + const (see below)
                  rhs_link_form = VinR
                  rhs_link_disp = 0
               %else;                  ! simple constant
                  rhs_oper = 0
                  drop(rhs_link)
               %finish
            %finish
         %else;                          ! AV in S  (treat as VinR + constant)
            extra = rhs_disp;  rhs_disp = 0
            rhs_form = VinR %if rhs_form = AVinS
         %finish
         extra = extra * mult
      %finish
      %if shift >= 0 %start
         cstack(shift);  operate(lsh)
      %else
         cstack(mult);  operate(mult16)
      %finish
      lhs_type = integers;    ! address calculation
      %if lhs_header >= 0 %start;   ! array-in-record
         amap(lhs);          ! address of record containing array
         sset(gla,lhs_header,v in s,0)
         operate(add)
      %finish
      operate(add)
      set lhs
      !                                         ! ***** F R I G *****
      !      load(lhs,any) %if lhs_oper = 0;   ! Force load: zero subscript folded out
      !                                         ! ***** F R I G *****
      !      vmap(lhs)
      !      lhs_disp = lhs_disp + extra
      !      lhs_type = type
      !      lhs_format = format;  lhs_length = length
      !      lhs_xform = assbit ! V in S
      !      lhs_form = A in S %if flags & label bit # 0

      %if Extra # 0 %start
         Cstack(Extra);  Operate(Add)
         Set Lhs
      %finish
      Vmap(Lhs)
      Vmap(Lhs) %if Flags&Label Bit # 0            {namearray}
      Lhs_Type   = Type
      Lhs_Format = Format
      Lhs_Length = Length
      Lhs_Xform  = Lhs_Form!Assbit
   %end

   %if mode # 0 %start;   ! multi-dimensional:  ingest non-terminal subscripts
      set both;  stp = stp-1
      load(rhs,any) %if rhs_oper # 0
      rhs_link == lhs_link
      lhs_link == rhs
      lhs_oper = lhs_oper+1
      %return
   %finish

   set both
   abort(m'ARF1') %if lhs_oper+1 # lhs_dim;      ! No. of subscripts ?

   flags = lhs_flag;                           ! protect from ravages of AMAP
   lhs_flag = lhs_flag &  (\(label bit + array bits))

   base = lhs_base;  type = lhs_type;  assbit = lhs_xform & (assigned<<8)

   %if (control & check array = 0 %and lhs_oper = 0) %or
                                       Base = 0  %start;   ! unchecked 1-D
      mult = lhs_length
      mult = mult+1 %if lhs_type = strings
      mult = 4 %if Flags&Label Bit # 0;            !namearray
      %if special case %start;      ! sets 'shift' as a side-effect
         unchecked ref;  %return
      %finish
   %finish

   stp = stp-1
   %if lhs_oper = 0 %start;      ! 1-D
      load(rhs,r1);  drop(rhs)
      p = aref1
   %else %if lhs_oper = 1;       ! 2-D
      load(lhs_link,r1);  drop(lhs_link)
      load(rhs,r2);       drop(rhs)
      p = aref2
      p = aref4 %if control & check array = 0
   %else;                        ! 3-D or more
      load(rhs, any) %if rhs_oper # 0         {**psr**}
      rhs_link == lhs_link;   ! tack on last subscript
      %for p = pdisp,reglen,pdisp+(lhs_oper-1)*reglen %cycle
         temp == rhs_link
         lrd(rhs,any)                  {**psr**}
         rx(ST,rhs_base,wsp,p)         {**psr**}
         rhs == temp
      %repeat
      load(rhs,r1);            ! r1 = first subscript
      rhs_form = AV in S;  rhs_base = wsp;  rhs_disp = pdisp
      load(rhs,r2);            ! r2 = addr(subscript list)
      drop(rhs)
      p = aref3
   %finish
   lhs_oper = 0
   amap(lhs)
   %if lhs_header >= 0 %start;         ! array-within-record
      sset(gla,lhs_header,av in s,0)
      load(rhs,r3);  drop(rhs);  stp = stp-1
   %else
      load(lhs,r3)
   %finish
   release(r1);   release(r3)
   release(r2) %unless p = aref1
   perm(p)
   claim(r1)
   %if lhs_header >= 0 %start;         ! array-in-record
      sset(lhs_base,lhs_disp,lhs_form,lhs_extra);   ! address of record
      lhs_base = r1;  lhs_disp = 0;  lhs_form = VinR;    ! array component
      lhs_type = integers;            ! an address to be amapped
      operate(add);                     ! record address + array component
   %else
      lhs_base = r1;  lhs_disp = 0
   %finish
   vmap(lhs)
   lhs_type = type
   lhs_xform = assbit ! V in S
   lhs_form = A in S %if flags & label bit # 0
%end;       !  array ref

!                                                        >> TEST ZERO <<
%routine  test zero(%record(stackfm)%name  v)
%record(stackfm)%name w
%integer  cr
   cr = any
   cr = anyf %if floating(v)
   %if v_oper = AND %and sym = '?' %and const(v_link) %start
      ! if x & const = 0 . . . . . . .
      w == v_link;  v_oper = 0
      load(v,cr)
      rxd(TEST,v_base,w)
      drop(w);  release(v_base)
   %else
      load(v,cr)
      %if ca # cc ca %or cc reg # v_base %start
         rr(lw,v_base,v_base)
      %else
         release(v_base)
      %finish
   %finish
%end;      ! test zero

%routine Compare Records(%record(stackfm)%name L, R, %integer N)
   Amap(l);  Load(l, R1)
   Amap(r);  Load(r, R2)
   Cload(n, R3);  Set Both           {***beware of CLOAD and Lhs}
   Release(R1);  Release(R2)
   Perm(Rcomp)
%end

!                                                    >> COMPARE REALS <<
%routine  compare reals(%record(stackfm)%name  l,r)
   load(l,anyf)
   address(r,0)
   float(r, anyf) %unless floating(r)
   rxd(cmp,l_base,r)
   release(l_base)
%end;        ! compare reals

!                                                  >> COMPARE STRINGS <<
%routine  compare strings(%record(stackfm)%name  l,r)
%record(stackfm)%name  temp
   %if l_base = code %and l_disp = null string %start
      temp == r;  r == l; l == temp
      invert = invert !! 16
   %finish
   %if r_base = code %and r_disp = null string %start
      load(l,any) %if l_oper # 0
      l_type = byte
      test zero(l)
   %else
      load(r,r2) %if r_oper # 0
      load(l,r1);  load(r,r2)
      release(r1);  release(r2)
      perm(scomp)
   %finish
   l_type = strings;  l_form = v in s
   p disp = 0
%end;       ! compare strings

!                                                          >> COMPARE <<
%routine  compare(%record(stackfm)%name  l,r, %integer next)
   swopped = 0
   %if l_type = 0 %or l_type = strings %start
      compare strings(l,r);  %return
   %finish
   %if zero(r) %start
      test zero(l);  %return
   %finish
   %if zero(l) %start
      test zero(r);  invert = invert !! 16
      %return
   %finish
   %if floating(l) %or floating(r) %start
      compare reals(l,r);  %return
   %finish
   %if L_Type = Records %start
      Compare Records(L, R, Min Record Size(L, R))
      %return
   %finish
   address(l,0);  load(l,any)
   address(r,0)
   %if '=' # next # '#' %start
      rxd(cmp,l_base,r)
   %else
      rxd(clw,l_base,r)
   %finish
   release(l_base)
%end;        ! compare

!                                                          >> RESOLVE <<
%routine  resolve(%integer  flag)
!S -> A.(B).C
%record(stackfm)%name  s,a,b,c
%integer  p,q
   cstack(0) %if flag&1 = 0;         ! C missing
   pop lhs;  c == lhs
   pop lhs;  b == lhs
   cstack(0) %if flag&2 = 0;         ! A missing
   pop lhs;  a == lhs
   pop lhs;  s == lhs
   load(s,r3);  load(a,r2);  load(b,r1);  load(c,r4)
   p = a_length;   !!!!!  p = 255 %if p = 0
   q = c_length;   !!!!!  q = 255 %if q = 0
   release(r3);  drop(s)
   release(r2);  drop(a)
   release(r1);  drop(b)
   release(r4);  drop(c)
   perm(sresln);  cput( (p<<8) + (q&255) );          ! conditional resolution
   %if flag&4 = 0 %start;          ! unconditional
      perm(sresv);                 ! verify it succeeded
   %finish
%end;           ! resolve

!                                                           >> HEADER <<
%routine  header(%record(varfm)%name  v)
   frame = basic frame %if frame < basic frame
   define tag(v_disp&x'FFF')
   rx(stm, p2+2-minparm, wsp, (2-minparm)*reglen)
   %if potype >= external %start

      !===== the order of the next two statements is critical =====

            external link(ep defn,0,0)
            rx(st,link,wsp,(link-p2)*reglen)

      %if control&unass # 0 %and unassigned rtn = 0 %start
         ! Force inclusion of unassigned check routine if not already present
         unassigned rtn = 1
         select output(direct)
         print symbol(p ref);  put(asschk);  put(0)
         select output(object)
      %finish
   %finish
   rr(lw,local,wsp)
   %if v_header # 0 %start;            ! special string parameter (P in R)
      abort(m'HDR1') %if v == begin
      sset(local,v_header,V in S,0);  rhs_type = strings
      sset(p3,0,VinR,0)
      claim(P3);            ! parameter nominally at 0(P3)
      assign(3);            ! SMOVOPT
      %if control&trusted # 0 %start;   ! suppress check if 'TRUSTED'
         v_header = 0
      %else
         Cput(x'0812')                  {preserve R2 for later}
      %finish
   %finish
   frame = (frame+align)&(\align);   ! ensure non-parameter locals are aligned
   %if control & trusted = 0 %start;         ! stack overflow check
      perm(pentc);       ! checked procedure entry   *** mustn't corrupt R2 ***
      cput(frame);       ! parameter size
      cput(0);           ! padding:-  gets overwritten
   %else
      rxi(add,wsp,0,basic frame);      ! 2nd. halfword gets overwritten
   %finish
   set frame patch;      ! Total size
   ! Use base reg(5) to hold unassigned pattern ( except at level 5 !! )
   %if level # 5 %and control & check unass # 0 %start
      rx(lw,base5,code,unass)
      activity(base5) = -1;             !  lock it
   %finish
   %if v_header # 0 %start;      ! check P in R string
      Cput(x'0821')               {*LR_2,1}
      perm(smove)
      cput(ap_length);         ! 'AP' set at '}'
      v_header = 0
   %finish
   %if control&trace # 0 %start;      ! trace option enabled
      %if v == begin %and potype >= external %start;   ! main program %begin
         external id = trace routine
         external link(ep ref,0,ga)
         perm(enter trace);  cput(0);      ! initialise user-supplied routine
      %finish
      trace flag = control&trace
   %finish
   event = 0
%end;      ! header

!                                                           >> RETURN <<
%routine  return
   %return %if uncond jump = ca;          !  can't get here ?
   %if Return Label # 0 %start
      Jump To(Return Label, Jump, Define New)
   %else
      Return Label = x'7001'              {something positive and unique}
      Define Label(Return Label)
      rx(lm,wsp,local,(wsp-p2)*reglen)
      rr(jmp,always,link)
   %finish
   uncond jump = ca
   Closed = 0            {can get back now}
%end;          ! return

%routine  compile to string(%record(stackfm)%name  v)
   {Delay if possible so S = S.tostring(k) can be optimised in LOAD}
   %if next = '.' %and control&(check capacity!check unass) = 0 %start
      v_flag = v_flag ! quick conc
      %return
   %else %if const(v)
      current string(0) = 1;  current string(1) = v_disp&255
      claim literal(2,0);  otype = con;  dump string(0)
      v_base = code;  v_disp = litmax
   %else
      load(v,any)
      frame = (frame+1)&(\1)
      rr(lbr,R0,v_base)
      rxi(add,R0,0,1<<8)
      rx(sth,R0,local,frame)
      v_base = local;  v_disp = frame;  frame = frame+2
   %finish
   v_type = strings;  v_xform = VinS ! (assigned<<8);  v_length = 1
%end
!                                                             >> CALL <<
%routine  call(%record(stackfm)%name  v)
%switch  b(1:max prim)
!  1 = rem
!  2 = read symbol
!  3 = float
!  4 = to string
!  5 = substring
!  6 = free space
!  7 = SVC;      ! *** MOUSES specific ***
!  8 = addr
!  9 = integer
! 10 = short integer
! 11 = byte integer
! 12 = string
! 13 = record
! 14 = real
! 15 = long real
! 16 = length
! 17 = charno
! 18 = int
! 19 = int pt
! 20 = IOCP;      ! *** temporary ***
! 21 = type of;   ( type of general name parameter )
! 22 = size of;   ( physical length in bytes )
! 23 = frac pt;    ! *** replaces IOCP above in the fullness of time ***
   %constbyteintegerarray  new type(9:17) =
         integers, short, byte, strings, records, reals, reall, byte, byte
   %constbytearray New Size(integers:reall) = 4,2,1,8,255,0,4
   %integer  t,l,p

   %if v_flag & prim bit # 0 %start;         !  built-in primitive
      l = 0;  t = v_header;  sym = 0;      ! 'sym=0' used as flag elsewhere
      %if t = 2 %start;      ! 'read symbol'
         v_flag = v_flag & (\prim bit)
         v_header = 0;      ! otherwise looks like "P in R" in "HEADER" q.v.
      %else
         drop(v)
      %finish
      set lhs
      -> b(t)
b(1):                             ! REM
      operate(rem);  %return
b(2):                             ! READ SYMBOL
      call(v)
      sset(r1,0,VinR,0)
      %if lhs_type = records %or lhs_type = general %start
         warn(4)
         ! *** subsequently, force a call on external routine form of
         !     read symbol and leave it to generate the error
         ! *** FRIG ***
            cload(5,r0); cload(5,r1); perm(signal)
            set lhs;  lhs_type = byte;   ! to prevent compiler failing
         ! *** FRIG ***
      %finish
      claim(rhs_base)
      compile to string(rhs) %if lhs_type = strings
      assign(1)
      %return
b(3):                             ! FLOAT
      float(lhs, anyf);  %return
b(4):                             ! TO STRING
      compile to string(lhs)
      %return
b(8):                             ! ADDR
      t = Lhs_Type
      amap(lhs)
      %if T = Strings %and Lhs_Form # AVinS %and Lhs_Form # AVinRec %start
         Load(Lhs, Any)
         Lhs_Form = VinS
         Forget Reg(1<<Lhs_Base)
         Rxd(LA, Lhs_Base, Lhs);  Claim(Lhs_Base)
         Lhs_Form = VinR
      %finish
      %return

b(16):                            ! LENGTH
      cstack(0)
b(17):                            ! CHARNO
      set both
      amap(lhs)
      %if control&check array = 0   %c
                  %or (const(rhs) %and t-16 <= rhs_disp <= lhs_length) %start
         operate(add);  set lhs;  !LHS&RHS reversed in operate??
      %else
         load(lhs,r1);  load(rhs,r2)
         drop(rhs);  stp = stp-1
         release(r1);  release(r2)
!!**** charno(s,j) where S is %String(*)%name won't work:  change  perm as well
         perm(chmap);  cput(lhs_length & 255)
         claim(r1)
         set lhs;  lhs_base = r1;  lhs_disp = 0;  lhs_xform = VinR
      %finish
      -> map it
b(12):                            ! STRING
!!!!!      l = 255
b(9):b(10):b(11):                 ! INTEGER, SHORT, BYTE
b(13):                            ! RECORD
b(14):b(15):                      ! REAL, LONG REAL
map it:
      vmap(lhs);  lhs_type = new type(t)
      lhs_length = new size(Lhs_Type)
      %return
b(19):                             ! INT PT
      load(lhs,anyf)
      p = gpr;  hazard(p)
      rr(fxr,p,lhs_base);  claim(p)
      lhs_base = p;  lhs_type = integers;  lhs_xform = VinR
      %return
b(18):                              ! INT
      p = intfn;         ! perm routine
      t = integers;      ! resulting type
      l = R1;            ! result register
      -> PERM1823
b(23):                              ! FRAC PT
      p = frac part
      t = reall
      l = FR2
PERM1823:
      load(lhs,fr2);  release(fr2)
      perm(p)
      claim(l);            ! result register
      set lhs
      lhs_base = l;  lhs_xform = VinR;  lhs_type = t
      %return
b(5):                               ! substring(S,from,to)
      load(lhs,r3);  drop(lhs);  stp = stp-1
      set both;  stp = stp-2
      load(lhs,r1);  load(rhs,r2);  drop(lhs);  drop(rhs)
      release(r1);  release(r2);  release(r3)
      perm(substr);  claim(r1)
      sset(r1,0,v in s,0);  rhs_type = strings
      %return
b(21):                              ! type of(..)
b(22):                              ! size of(..)
      %if lhs_type # general %start;      ! type explicitly specified
         %if t = 21 %start;      ! type of
            p = gen map(lhs_type)
         %else
            p = lhs_length;  p = p+1 %if lhs_type = strings
         %finish
         release(lhs_base)
         lhs_type = integers;  lhs_form = constant
         lhs_base = 0;  lhs_disp = p
      %else
         lhs_disp = lhs_disp + reglen;      ! reference property-word
         lhs_xform = (assigned<<8) ! V in S;  lhs_type = integers
         %if t = 21 %start;         ! type of
            cstack(15);  operate(and)
         %else;                     ! size of
            cstack(4);  operate(rsh)
         %finish
      %finish
      %return
b(6):                               !  free space
      perm(freesp);  claim(r1)
      sset(r1,0,VinR,0)
      %return
b(7):                              ! SVC (MOUSES SPECIFIC)
      hazard(p) %for p = fr0,1,fr14
      set both;  stp = stp-2
      load(lhs,any) %unless const(lhs);
      address(rhs,-1)
      rx(lme,fr0,rhs_base,rhs_disp);  claim(rhs_base)
      rx(svc,r0,lhs_base,lhs_disp)
      rx(stme,fr0,rhs_base,rhs_disp)
      drop(lhs);  drop(rhs)
      forget reg(-1)
      %return
b(20):                              ! IOCP    *** temporary ***
      load(lhs,r4);            ! required function
      release(r4);  drop(lhs);  stp = stp-1
      perm(iocp)
      %return

   %finish
   !   -- normal routine calls --
   wdisp = (wdisp+align)&(\align);      !keep WSP aligned
   hazard all %if V_Flag&Assigned = 0         {beware - it returns}
   %if v_base # 0 %start;             ! non-local
      %if v_base # gla %start
         t = new tag;  define reference(t, r ref)
         rx(la, link, code, 0)
      %finish
      rx(STM,p2,wsp,wdisp)
      rxi(ADD,wsp,0,wdisp) %if wdisp # 0
      %if v_base = gla %start;        ! external
         rx(lm,gla,gla,v_disp)
         rr(bal, link, link)
      %else;                          ! procedure-as-parameter
         quick load(r2, VinS, v_base, v_disp);  forget reg(1<<R2)
         rx(lm,r8,r2,0)
         rx(bal, link, link, 4);      !skip initial STM
         define tag(t)
      %finish
   %else;                             ! local routine
      rxi(ADD,wsp,0,wdisp) %if wdisp # 0;      ! protect stacked parameters ?
      define reference(v_disp&x'FFF',r ref)
      rx(bal,link,code,0)
      rxi(SUB,wsp,0,wdisp) %if wdisp # 0;      ! reset protection
      Uncond Jump = Ca %if V_Flag&Assigned # 0      {it doesn't return}
   %finish
   wdisp = v_header;  p disp = v_rt
   drop(v) %if v_type = 0;            ! not function or map
%end;            !  call

!                                                     >> COMPILER OP <<
!***** RE=ORGANISE  'call', 'prim' and this routine *****
%routine  compiler op(%integer  n)
   %record(stackfm)%name  p
   p == descriptor;  stp = stp-1 {DESCRIPTOR increments it!!}
   p_flag= prim bit;  p_header = n
   abort(m'CMOP') %unless 0 < n <= max prim
   call(p)
%end

!                                                      >> COMPILE FOR <<
%routine  compile for
%record(stackfm)%name  cv, iv, inc, fv
%integer  lab, safe, n, reg, shadow
   %routine  stab(%record(stackfm)%name  v,  %integer  type)
   %integer  t,r
      %return %if const(v)
      load(v,any);  r = v_base
      t = temp
      v_base = local;  v_disp = t
      v_type = type;  v_xform = (assigned<<8) ! V in S
      rx(ST,r,local,t);  release(r)
      associate(v,r) %if control & suppress = 0
   %end
   %routine  set(%record(stackfm)%name  v,%integer  reg)
   %record(stackfm)%name  r
      sstack(v);  r == stacked(stp)_v
      lrd(r,reg)
      stp = stp-1
   %end
   cv == stacked(stp-3)_v
   inc == stacked(stp-2)_v
   fv == stacked(stp-1)_v
   lab = tag
   abort(m'FOR1') %if for stp = max cycle
   for stp = for stp + 1;  for == for stk(for stp)
   n = next temp;                        ! remember current point in temp stack
   shadow = -1;  shadow = temp %if control & check for # 0
   stab(fv,integers);  stab(inc,integers)
   for_temp base = temp base
   %if n # next temp %start;             ! protect shadow, FV, INC ?
      temp base = new temp
   %finish
   safe = 0
   sstack(inc);  operate(sub)
   iv == stacked(stp)_v;         ! iv = iv - inc
   %if cv_form # v in s %or activity(cv_base) >= 0 %start
      n = cv_type
      amap(cv)
      stab(cv, n)
      cv_form = a in s
   %finish
   stp = stp-4
   %if const(fv) %and const(iv) %and const(inc) %start
      %if inc_disp # 0 %start
         n = fv_disp-iv_disp
         %if n !! inc_disp >= 0 %and (n//inc_disp)*inc_disp = n %start
            safe = 1
         %finish
      %finish
      %if safe = 0 %start
         warn(2);            !  constant faulty %for parameters
      %else
         safe = fv_disp - iv_disp;           ! null cycle ?
      %finish
   %finish
   reg = iv_base
   %if reg <= r2 %start
      reg = gpr                              {**cannot return r0,r1,r2}
   %else
      reg = any
   %finish
   load(iv,reg);  reg = iv_base
   %if safe = 0 %and control & check for # 0 %start
      set(iv,r0);  claim(reg)
      set(fv,r1);  set(inc,r2)
      perm(fchk1);            ! Check %for parameters before entry
   %finish
   %if safe = 0 %start;   ! non-constant or null cycle
      sstack(cv);  sstack(iv);  assign(1);  claim(reg)
      for_initial = for lab base + for stp
      jump to(for_initial,jump,redefine old)
   %finish
   define label(lab);  trace flag = control&trace
   sstack(cv)
   sstack(iv);  sstack(inc);  operate(add);        ! CV + INC
   drop(iv);  drop(inc)
   set lhs;  load(lhs,reg);   ! to make sure ASSIGN doesn't use wrong register
   assign(1)
   rx(st,reg,local,shadow) %if shadow >= 0
   for_lab = lab;  for_reg = reg;  for_shadow = shadow
   for_cvbase = cv_base;  for_cvdisp = cv_disp 
   for_cvtype = cv_type;  for_cvform = cv_xform
   for_fvbase = fv_base;  for_fvdisp = fv_disp
   drop(cv);  drop(fv)
%end;            ! for


   %cycle;            !  --- main loop ---
      sym = next;  read symbol(next)
      -> c(sym)

c('l'): language mask = tag;  %continue;      ! Select language dependent options

c('O'):
      abort(m'STK?') %if stp # 0
      abort(m'USNG') %unless using_link == null
      abort(m'CLMD') %if claimed # 0
      abort(m'LIT?') %if ca < 0;   ! 'select code/literal area' misused
      wdisp = 0;  p disp = 0
      next temp = temp base
      current line = tag
      %if control&trace # 0 %start
         %if next = ':' %or next = 'L' %start
            trace flag = 1
         %else %if trace flag # 0
            dump trace
         %finish
      %finish
      %continue

c('$'): define var;  %continue

c('b'):
      pop drop;  vub = lhs_disp
      pop drop;  vlb = lhs_disp
      %continue

         %routine  adump
            %switch c(integers:8),g(integers:8);  ! 8 =REALS+1 !!!!!
            %constintegerarray  low(integers:8) =   0,-32768,   0, 0(*)
            %constintegerarray  high(integers:8) = 0, 65535, 255, 0(*)
            %integer  j
               %if high(owntype) # 0 %and control & check capacity # 0 %start
                  warn(8) %unless low(owntype) <= ownval <= high(owntype)
               %finish
               -> g(owntype) %if otype # con
               select literal area %if strings # owntype < reals
               -> c(owntype)
            g(integers):      gword(ownval);           %return
            c(integers):      cword(ownval);     -> exit
            c(reals):c(8):
            g(reals):g(8):    j = real constant(1);    %return
            g(byte):          gbyte(ownval);           %return
            c(byte):          lit byte(ownval);  -> exit
            g(short):         gput(ownval);            %return
            c(short):         cput(ownval);      -> exit
            c(strings):
            g(strings):       dump string(data size);  %return
            g(records):       gput(0) %for j = 1,1,data size>>1
                              %return
            c(records):       abort(m'ADMP')
         exit:                select code area
         %end;       ! adump
c('A'):
      aparm = tag
      %if stp # 0 %start
         decvar_flag = decvar_flag ! assigned;      ! explicit initialisation
         pop drop
         %if own type >= reals %start
            rvalue = lhs_disp %if lhs_type < reals
            ownval = integer(addr(rvalue))
            mantissa = integer(addr(rvalue)+4)
         %else
            ownval = lhs_disp;      ! a string
         %finish
      %else;            ! initialise to UNASSIGNED pattern
         %if own type = byte %start
            own val = x'80'
         %else %if own type = short
            own val = x'FFFF8080'
         %else %if owntype # strings
            ownval = x'80808080';  mantissa = x'80808080'
         %else
            cslen = x'80';  current string(1) = x'80'
         %finish
      %finish
      %if own form = array %or own form = name array %start
         adump %for j = 1,1,aparm
      %else
         %if otype = 0 %start
            decvar_flag = decvar_flag & (\assigned);   ! %const .... %name
            decvar_disp = ownval;  decvar_base = 0
            ! %CONSTINTEGERNAME    ->   INTEGER
            ! A in S -> V in S, A in REC -> VinREC
            %if Decvar_Form = VinS %start
               Decvar_Form = Constant
            %else
               Set Diag(0, Ownval) %if Decvar_Form = AinS
               decvar_form = decvar_form + (v in s - a in s)
            %finish
         %else
            decvar_base = gla;  decvar_disp = ga
            %if otype >= external %start
               decvar_flag = decvar_flag & (\assigned)
               external link(data defn,data size,ga)
            %else %if otype = con ;      ! %const
               %if decvar_type = strings %start
                  claim literal(cslen+1,1)
                  j = litmax;  dump string(0)
               %else %if decvar_type >= reals
                  j = real constant(0);   ! ** N.B.  %fn + side-effect **
               %else
                  abort(m'AM01')
               %finish
               decvar_base = code;  decvar_disp = j
               %continue
            %finish
            adump
         %finish
      %finish
      %continue

c(''''): get string;  %continue
c('G'):  get string
         alias = ""
         %for j = 1, 1, cslen %cycle
            alias = alias.tostring(current string(j))
         %repeat
         pop drop
         %continue
c('N'):  cstack(tag<<16!tag);  %continue
c('D'):
      get d
      cstack(0) %and %continue %if rvalue = 0
      %continue %if next = 'A'
      otype = con;          !  anonymous %const
      j = real constant(0);    !  N.B. ** %fn + side-effect **
      sset(code,j,v in s,0);  rhs_type = reals
      %continue

c('n'):
      j = tag;  set lhs
      vstack( var(lhs_format)_extra - j )
      set both;  stp = stp-1
      %if rhs_form # 15 %start;       !  not record format
         %if lhs_form = v in s %or lhs_form = VinRec %start
            rhs_disp = lhs_disp + rhs_disp
            lhs_xform = lhs_form - v in s + rhs_xform
         %else
            %if lhs_form = a in rec %start
               lhs_form = VinRec;  lhs_type = integers
               load(lhs,any)
               lhs_xform = rhs_xform
            %else
               %if lhs_form <= VinR %start
                  lhs_xform = rhs_xform;    ! ????
               %else
                  lhs_extra = lhs_disp
                  lhs_xform = rhs_xform+3
               %finish
            %finish
         %finish
         lhs_disp = rhs_disp
         lhs_type = rhs_type
         lhs_rt = rhs_rt
         lhs_header = rhs_header
      %finish
      lhs_length = rhs_length;  lhs_format = rhs_format
      lhs_dim = rhs_dim
      drop(rhs)
      %continue

c('@'):
      vstack(tag)
      %if lhs_flag & proc bit # 0 %and next # 'p'   %c
                                              %and lhs_flag&prim bit = 0 %start
         lhs_rt = p disp
         lhs_header = wdisp
         w disp = (p disp+align)&(\align)
         p disp = 0
      %finish
      %continue
c('E'):
      pop lhs;  x == lhs
      load params(x_link)
      call(x)
      %if x_type # 0 %and sym # 0 %start;      ! fn/map - SYM=0:  see 'CALL'!?!?!?!?
         sstack(x);  drop(x);  set lhs
         %if lhs_type >= reals %then opr = fr0 %else opr = r1
         lhs_base = opr;  lhs_disp = 0
         claim(opr)
         %if lhs_form = VinR   %c
                        %and (lhs_type = strings %or lhs_type = records) %start
            lhs_base = R1;  lhs_form = V in S
            %if next # 'S' %and next # 'p' %and next # '?' %start
               %if lhs_type = strings %start
                  n = 256;  lhs_length = 255
               %else
                  n = var(lhs_format)_length
               %finish
               pdisp = basic frame %if pdisp = 0
               lhs_base = wsp;  lhs_disp = pdisp
               sstack(lhs);             ! a copy for 'ASSIGN' below
               sset(r1,0,V in S,0);     ! N.B. sets RHS implicitly
               %if lhs_type = strings %start
                  rhs_type = strings
               %else
                  rhs_type = records;  rhs_format = lhs_format
               %finish
               assign(1)
               pdisp = pdisp + n;      ! protect stacked temporary
               lhs_type = 0 %if lhs_type = strings
            %finish
         %finish
      %finish
      %continue

c('M'):
c('V'):
      set lhs
      opr = r1
      %if sym = 'V' %start
         %if gvar_type >= reals %start
            opr = FR0
         %else %if gvar_type = records %and zero(lhs);   ! recordfn result = 0
            lhs_type = records;  lhs_form = V in S
            lhs_base = wsp;      lhs_disp = 0
            lhs_format = gvar_format
            sstack(lhs);            ! duplicate
            cstack(0)
            assign(1);               ! construct zero record
            set lhs
         %finish
      %else
         amaps(lhs)
      %finish
      lrd(lhs,opr);  stp = stp-1
      %if sym = 'V'  %start
         %if gvar_type = strings %and gvar_length > 0 %start
            cload(gvar_length,r0)
            perm(sfcap);        ! string function capacity
         %else %if control & check capacity # 0
            %if gvar_type = short %start
               claim(opr);  rr(CHVR,opr,opr)
               perm(cap16)
            %else %if gvar_type = byte
               rxi(TEST,opr,0,\255)
               perm(cap8)
            %finish
         %finish
      %finish
c('R'):
      return
      %continue
c('K'):                     ! %false
      k = 0;  -> true false
c('T'):                     ! %true
      k = -1
true false:
      cload(k,r1)
      return
      %continue

c('a'):  array ref(0);   %continue
c('i'):  array ref(1);   %continue
c('.'):  operate(conc);  %continue
c('+'):  operate(add);   %continue
c('\'):  k = -1;  -> not neg;         ! NOT
c('U'):  k = 0;                       ! NEG
not neg:
         pop lhs;  cstack(k);  sstack(lhs);  drop(lhs)
c('-'):  operate(sub);   %continue
c('!'):  operate(or);    %continue
c('%'):  operate(xor);   %continue
c('&'):  operate(and);   %continue
c('['):  operate(lsh);   %continue
c(']'):  operate(rsh);   %continue
c('*'):  operate(mul);   %continue
c('/'):  operate(div);   %continue
c('Q'):  operate(rdiv);  %continue
c('X'):  operate(exp);   %continue
c('x'):  operate(rexp);  %continue

c('v'):
      set lhs
      %if floating(lhs) %start
         load(lhs,anyf);  opr = fpr
      %else
         load(lhs,any);  opr = gpr
      %finish
      pop lhs
      k = lhs_base
      load(lhs,opr)
      n = new tag
      jump to(n,greater or equal,internal tag)
      cstack(0);  sstack(lhs);  drop(lhs)
      operate(sub)
      set lhs;  load(lhs,k)
      define tag(n)
      %continue

c('j'):  assign(2);   %continue
c('S'):  assign(1);   %continue
c('Z'):  assign(0);   %continue
c('p'):  assign(-1);  %continue

c('u'):            !++
c('q'):            !--
         %if sym = 'u' %then k = add %else k = sub
         set both
         t = lhs_type;  j = lhs_length
                        j = j+1 %if t = strings
         amap(lhs)
         abort(m'AM05') %if j = 0
         %if j = 2 %start
            cstack(1);  j = lsh
         %else %if j = 4
            cstack(2);  j = lsh
         %else
            cstack(j);  j = mul
         %finish
         operate(j)
         operate(k)
         set lhs
         vmap(lhs);  lhs_type = t
         %continue

c('='):
c('k'):  opr = 0;   -> cond
c('#'):
c('t'):  opr = 1;   -> cond
c('<'):  opr = 2;   -> cond
c('>'):  opr = 3;   -> cond
c('('):  opr = 4;   -> cond
c(')'):  opr = 5;   -> cond
cond:
      val = tag
      jump to(val,opr+invert,redefine old);  invert = 0
      %continue

c('C'):
      set both
      t = lhs_type
      amap(lhs);  amap(rhs)
      %if t = strings %and (lhs_form = V in S %or lhs_form = VinREC %c
                        %or rhs_form = V in S %or rhs_form = VinREC) %start
         operate(xor)
         cstack(8);  operate(lsh)
         cstack(0)
      %finish
c('?'):
      set both
      compare(lhs,rhs, next);  stp = stp-2
      drop(lhs);  drop(rhs)
      %continue
c('"'):
      set both;  invert = 16
      compare(rhs,lhs, next)
      stp = stp-1;  lhs = rhs;  drop(rhs)
      claim(lhs_base)
      %continue

c('r'):  resolve(tag);  %continue
c('_'):
      uncond jump = 0;  mark assigned = 0
      forget all 
      v == var(tag);  pop drop
      j = lhs_disp - v_extra;      !  this label - lower bound
      abort(m'AM10') %unless 0 <= j < v_length;    ! within vector ?
      define tag((v_format + j)!x'8000');   ! N.B. marked as a switch defn.
      %continue
c('W'):
      v == var(tag)
      %if control & trusted = 0 %start;         ! checked switch via PERM
         pop lhs
         lrd(lhs,r1)
         rxi(lw,r2,code,v_disp)
         perm(swjump)
      %else
         cstack(1);  operate(lsh);         ! subscript X 2
         pop lhs
         k = v_disp+2*2-v_extra*2
         %if const(lhs) %start
            k = k+lhs_disp
            j = 0
         %else
            load(lhs, Any)
            j = Lhs_Base
         %finish
         lhs_base = code;  lhs_index = j;  lhs_disp = k
         lhs_type = short;  lhs_form = V in S
         rxd(LHL,r1,lhs);  claim(r1)
         drop(lhs)
         rr(ADD,r1,r1);  claim(r1)
         rr(ADD,r1,code)
         rr(JMP,always,r1)
      %finish
      uncond jump = ca
      %continue
c('B'):
      val = tag
      %if val # for_lab %start;      ! not %for .... %repeat 
         jump to(val,jump,define new)
      %else
         sset(for_cvbase,for_cvdisp,for_cvform,0)
         hazard(for_reg)
         pop lhs
         lhs_type = for_cvtype;  lhs_flag = lhs_flag ! assigned
         lrd(lhs,for_reg)
         %if for_shadow >= 0 %start
            rx(clw,for_reg,local,for_shadow)
            perm(fchk2)
         %finish
         %if for_initial # 0 %start
            define label(for_initial);  for_initial = 0
         %finish
         %if for_fvbase = 0 %start;       !  constant
            %if for_fvdisp = 0 %start;      ! zero
               claim(for_reg);  rr(lw,for_reg,for_reg)
            %else
               rxi(clw,for_reg,for_fvbase,for_fvdisp)
            %finish
         %else
            rx(clw,for_reg,for_fvbase,for_fvdisp)
         %finish
         jump to(val,not equal,define new)
         abort(m'AM15') %if next # ':'
         read symbol(next);  define label(tag)
         %if for_shadow >= 0 %start
            %if level # 5 %start
               rx(st,r12,local,for_shadow)
            %else
               rx(lw,for_reg,code,unass)
               rx(st,for_reg,local,for_shadow)
               forget reg(1<<for_reg)
            %finish
         %finish
         temp base = for_temp base;         ! unprotect shadow, FV, INC
         for stp = for stp-1;  abort(m'AM20') %if for stp < 0
         for == for stk(for stp)
      %finish
      %continue
c('F'):
      val = tag;  abort(m'AM25') %if val >= for lab base
      jump to(val,jump,redefine old)
      %continue

         %integerfn user label(%integer lab)
            %record(varfm)%name v
            %if lab > names %start
               names = lab
               v == var(lab)
               v = 0
               v_form = pgm label
               v_disp = new tag
               %result = -v_disp
            %finish
            %result = -var(lab)_disp
         %end
c('J'):
      jump to(user label(tag),jump,define new)
      %continue
c('L'):
      define label(user label(tag))
      %continue
c(':'):
      j = tag;  abort(m'AM30') %if j >= for lab base
      define label(j);  %continue
c('f'):
      compile for;  %continue
c('w'): mark assigned = 0;  machine code;  forget reg(-1);  %continue
c('P'):
      pop drop;  cput(lhs_disp);  forget reg(-1)
      %continue
c('y'):                         ! %diagnose n
      j = tag
      diagnose = 0
      %if (j>>14)&3 = 2 %start;         ! it's for pass 2
         diagnose = j&x'3FFF'
         diagnose = diagnose ! ((-1)<<15) %if diagnose&4 # 0;   ! only for speed
      %else
         !***** should pass onto next pass ******
      %finish
      %continue
c('z'):
      control = tag;  %continue
c('m'):
      j = -1;  -> SIGNAL EVENT
c('s'):
      %if control&trace # 0 %start
         perm(enter trace);  cput(0);     ! close off user-supplied routine
      %finish
      j = 0;  -> SIGNAL EVENT
c('e'):
      j = tag
SIGNAL EVENT:
      cstack(0) %while stp < 2
      pop lhs;  lrd(lhs,r2)
      pop lhs;  lrd(lhs,r1)
      cload(j,R0)
      perm(signal)
      uncond jump = ca
      %continue
c('o'):
      event_events = tag;        !  events trapped
      read symbol(next);  k = tag
      j = (frame+align)&(\align);  frame = j+reglen
      rx(ST,wsp,local,j);            ! for use below
      jump to(k,jump,redefine old);  event_low = j tag;   ! skip event body
      forget all
      event_label = new tag
      define tag(event_label);                ! entry point
      rx(LW,wsp,local,j)
      %continue
c('h'):   ! compiler op(n)
      compiler op(tag)
      %continue
c('g'):    !array formats
c('d'):
      ! array allocation and dope vector dumping.
      Allocate = Sym-'g'         {0=format}
      ! GMODE:  =0 -> simple array,  # 0 -> array-in-record
      !       When OPT is specified, in-line code is dumped to
      !      allocate 1-D constant-bounded arrays
      dim = tag;  abort(m'AM35') %unless 0 < dim <= 7
      read symbol(next);  n = tag
      %if gmode = 0 %then names = names-n %else parms = parms+n
      set both
      dv = 0;                     ! used as a flag subsequently
      t = -1
      ! **** The test for OPT must come out once this optimisation is
      !      implemented correctly ****
      %if control&checkbits=0 %and dim = 1 %and lhs_disp <= rhs_disp+1 %start
         %if const(rhs) %and const(lhs) %start
            t = 0;               ! candidate for cheap allocation at least
            %if 0 < data size <= 32767 %c
                  %and -32768 <= lhs_disp <= 32767 %c
                  %and -32768 <= rhs_disp <= 32767 %start
               dim = dim ! cheap array bit;               ! stuffed in below
            %finish
         %finish
      %finish
      %if gmode # 0 %or t >= 0 %start
         vlb = lhs_disp;  vub = rhs_disp
         abort(m'AM40') %if vlb > vub+1;   ! null array, A(1:0) allowed
         set dope vector
         stp = stp-2;  drop(lhs);  drop(rhs)
         %if gmode = 0 %start;            ! constant-bounded 1-D simple array
            quick load(R4, AVinS, code, dv);  release(R4)
            vub = (vub+align) & (\align);    ! to preserve stack-front alignment
         %finish
      %else
         frame = (frame+align)&(\align);  k = frame;  Frame = Frame+Reglen
         quick load(R4, AVinS, local, K);  release(R4)
         stp = 0
         %for j = 1,1,dim<<1 %cycle;   ! N.B. not changed above on this path
            stp = stp+1;  set lhs
            claim(r4);  lrd(lhs,any)
            rx(st,lhs_base,r4,frame-k);  frame = frame+reglen
            frame = frame+reglen %if j&1 = 0;  ! LEAVE HOLE FOR MULTIPLIER
         %repeat
         perm(set dv)
         cput(dim);  cput(data size)
         stp = 0
      %finish
      %if dv = 0 %start
         quick load(R2, AVinS, local, frame)
         release(R2)
         forget reg(1<<r2)
      %finish
      %for j = 1,1,n %cycle
         %if gmode = 0 %start
            names = names+1;  decvar == var(names)
         %else
            parms = parms-1;  decvar == var(parms)
         %finish
         decvar_disp = frame
         decvar_flag = decvar_flag ! dim;      ! may also set 'cheap array bit'
         %if gmode = 0 %start;      !  array not in record
            decvar_header = -1;  decvar_base = local
            decvar_flag = decvar_flag ! anbit;          ! force arrayname
            %if dv = 0 %start
               %if Allocate # 0 %start
                  perm(alloc);         ! general method of allocation
               %else
                  RX(ST, R4, Local, Frame+Reglen)
                  RX(ST, R1, Local, Frame+0)
               %finish
            %else
               ! dope-vector was dumped statically above
               ! Note that the data area for each array is allocated within
               ! the high address end of the static frame startingat the top
               ! and working downwards.  Pass3 patches in the displacement req'd
               ! from 'local'
               rx(ST,r4,local,frame+reglen);        ! @DV
               %if Allocate # 0 %start
                  rxi(LW,r0,wsp,-vlb);     ! @A(0) for Jth array
                  rxi(ADD,wsp,0,vub);            !****temp fix****
               %else
                  rxi(LW,R0,0,-vlb)
               %finish
               rx(ST,r0,local,frame+0);             ! plug into header
            %finish
            frame = frame + 2*reglen;  ! 2-word header
         %else;          ! array-in-record
            gfix(align);                     !*****psr*****
            decvar_header = ga;  decvar_base = 0
            gword(-vlb);              ! relative to start of array
            gword crel(dv);           ! relative to code base
            frame = frame+vub %if Allocate # 0
         %finish
      %repeat
      %continue

c('^'):   {Set Format}
      Set Lhs
      Lhs_Type   = Records
      Lhs_Format = Tag
      %continue


         %routine Temp Set
            Frame = (Frame+Align)&(\Align)
            Sset(Local, Frame, VinS, 0)
            Rhs_Type = Records
            Rhs_Format = Max Vars
            Frame = Frame+SetLen
         %end

c('I'):   {ESCAPE for Pascal etc.}
      sym = next;  readsymbol(next)
      ->Pc(Sym) %if 'A' <= Sym <= 'Z'
      Abort(M'I  ?' - ' '<<8 +Sym<<8)
Pc('A'):   {Compare}
Pc('D'):   {Compare records}
Pc('K'):   {Test set membership}
         cload(0, R6);  claim(R6)
         set both
         j = next;  readsymbol(next)
         %if Sym = 'A' %start
            %if j <= 1 %then k = '=' %else k = '<'
            compare(lhs, rhs, k)
         %else %if Sym = 'K'
            Load(Lhs, Any);  Address(Rhs, -1)
            Rhs_Type = Integers
            Rxd(Tbt, Lhs_Base, Rhs)
            Release(Lhs_Base)
         %else
            k = next;  readsymbol(next)
            Compare Records(Lhs, Rhs, K)
         %finish
         stp = stp-2;  drop(lhs);  drop(rhs)
         skip(1, j+invert);                  ! short forward jump
         Invert = 0
         rxi(ADD, R6, 0, 1);        ! reduces to halfword: AIS R6,1
         forget reg(1<<r6);  CC CA = 0
         sset(R6, 0, VinR, 0)
         %continue

Pc('B'):   {Create space}
         sym = next;  readsymbol(next)
         ownform = array;  Owntype = byte
         Claim Literal(Sym, Align)
         Select Literal Area
         Decvar_Disp = Ca;  Decvar_Base = Code
         Select Code Area
         %continue

Pc('C'):
         ! 'refer to' FORTRAN parameter in CALL
         ! If parameter is not a simple variable, then store into a
         ! temporary to make it so.  Either way, convert to descriptor for
         ! address of simple variable for final parameter
         set lhs
         %unless lhs_form = VinS %and lhs_oper = 0 %start
            t = any;  t = anyf %if floating(lhs)
            load(lhs,t)
            hazard(lhs_base);      ! force into store temporary
         %finish
         %continue

Pc('I'):   {Add to set}
         Set Both
         Lrd(Rhs, Any)
         Address(Lhs, -1)
         Lhs_Type = Integers
         Rxd(Sbt, Rhs_base, Lhs);  Claim(Lhs_Base)
         Lhs_Type = Records
         Stp = Stp-1
         %continue

Pc('G'):   {Make set null}
Pc('H'):   {assign set}
         k = Tag %if Sym = 'H'
         %if Next # 'S' %start
            Temp Set
            Sstack(Rhs)
            Rhs_Type = 0         {show it's a temporary}
         %else
            Readsymbol(Next)
         %finish
         %if Sym = 'G' %then Cstack(0) %else Vstack(k)
         Assign(1)
         %continue

Pc('J'):   {Compare sets}
         Set Both
         Lrd(Lhs, R1)
         Lrd(Rhs, R2)
         Perm(Set Comp)
         %if Next <= 1 %start    {#, =}
            cput(0)
         %else %if Next = 3     {<=}
            cput(2)
         %else    {Next = 2}    {>=}
            cput(1)
         %finish
         Stp = Stp-2
         Sset(R6, 0, VinR, 0);  Claim(R6)
         Rxi(Xor, R6, 0, 1) %if Next = 0 {#}
         Readsymbol(Next)
         %continue

Pc('L'):   {Set operation}
         Pop Lhs;  X == Lhs
         Set Lhs
         %if Lhs_Type # 0 %start      {needs to be made temporary}
            Pop Lhs
            Temp Set
            Sstack(Lhs);  Drop(Lhs)
            Assign(1)
            Sset(Local, Frame-SetLen, VinS, 0)
            Rhs_Type = 0
            Set Lhs
         %finish
         Load(Lhs, R1)
         Lrd(X, R2)
         Perm(Set Ops(next));  Readsymbol(Next)
         %continue

Pc('S'):   {Swop top of stack elements}
         Set Both
         Stacked(Stp-1)_V == RHS
         Stacked(Stp)_V   == LHS
         %continue

Pc('N'):   {check not NIL}
         %if Control&Check Unass # 0 %start
            Set Lhs;  Test Zero(Lhs);  Claim(Lhs_Base)
            RR(Bal, Link, Code)
         %finish
         %continue

Pc('W'):   {Stack WSP}
         Cstack(0)
         Rhs_Form = VinR
         Rhs_Base = Wsp
         %continue

c('~'):                  ! alternate record format
      sym = next;  read symbol(next)
      %if sym = 'A' %start;            ! alt start
         decvar == gvar
         assemble(-2,labs,names)
         Alt Align = Alt Align!Falign
      %else %if sym = 'B';             ! alt end
         -> OUT
      %else
         abort(m'AM45') %if sym # 'C';         ! faulty intermediate code
         max frame = frame %if frame > max frame
         frame = putative frame base
      %finish
      %continue
c('{'):
      gmode = -1
      assemble(gtype,labs,names)
      %continue
c('}'):
      gmode = 0
      -> OUT %if amode < 0;         ! end of %record %format defn.
      -> OUT %if gvar_flag & primbit # 0;   ! prim routine reference
      %if names > gstart %start
         gvar_extra = parms
         %for j = gstart+1,1,names %cycle
            ap == var(j)
            parms = parms-1;  fp == var(parms)
            fp = ap;  fp_base = wsp
            ap_flag = ap_flag & (\p in r) ! assigned %if ap_flag&array bits = 0
         %repeat
         abort(m'AM50') %if parms < names
         %if ap_type = strings %and ap_xform & (array bits<<8 + 255) = V in S %c
                                                    %and ap_base # 0 %start
            gvar_header = ap_disp
            fp_flag = fp_flag ! P in R;     ! mark as 'in-register' param
         %finish
      %finish
      gdisp = -1;         ! so locals are properly placed
      max parm = frame;   !start of local space
      -> OUT %if amode # 0
      header(gvar)
      %continue
c('H'):
      decvar == begin;  decvar_disp = new tag
      otype = 0;  spec = 0;  potype = 0
      %if level # 0 %start;  ! not outermost %begin
         cstack(decvar_disp)
         pop lhs;  lhs_type = 0;  call(lhs)
      %finish
      block name = "BLOCK";         ! Fix up diagnostic name for "%begin" block
      assemble(0,labs,names)
      %continue

   %repeat;           ! --- end of main loop ---

   ! To catch the sinners!!
C(*):
      abort(m'?? '<<8 ! sym)

   %routine ALIGN ALTERNATIVES
   ! Routine to fix up alternate record definitions - implicit parameters in:
   !  true frame base, putative frame base, max frame, alt first, alt align
      %integer  n, mod, j
      %record(varfm)%name  v
      Falign = Alt Align
      n = putative frame base - true frame base
      %return %if n = 0 %or alt align = align;   ! no padding or fullword req'd
      %if alt align = 0 %start;                  ! byte alignment possible
         mod = n
      %else;                                     ! at least %short req'd
         %return %if n = 1;   ! can't move it back
         mod = 2;             ! n = 2,3
      %finish
      ! now strip out extra unnecessary alignment
      %for j = parms,1,alt first %cycle
         v == var(j)
         v_disp = v_disp - mod
      %repeat
      max frame = max frame - mod
   %end;         ! align alternatives

c(';'):
   %if level # 0 %start
      %if uncond jump # ca %or (gvar_type = 0 %and control&trusted = 0) %start
         %if control&trace # 0 %and level = 1 %start
            perm(enter trace); cput(0);      ! close down user-supplied routine
         %finish
         return
      %finish
   %else;      ! level 0:  flush literals and gla
      gbyte(0) %if ga&1 # 0
      claim literal(0,0) %if lita&1 # 0
   %finish
   Gvar_Flag = Gvar_Flag!Closed
   block mark(block end)
   Reset Optimisation Data
OUT:
   %if amode >= 0 %start;         ! end of declarative block
      activity(local) = 0 %unless local = base5;  ! release old base register
      level = level-1;  local = breg(level)
   %else;                        ! end of record format defn
      align alternatives
      frame = max frame %if max frame > frame
      %if amode = -2 %start;                  ! end of alternative only
         old frame = frame
      %else
         frame = (frame+align)&(\align);   ! **** temporary ****
         abort(m'AM55') %unless frame>>16 = 0      {only 16 bits worth}
         gvar_length <- frame
      %finish
   %finish
   frame = old frame;  extra frame = old extra frame
   uncond jump = old jump;  ca = proc ca
   var diags = old var diags
   new temp = temp base
   next temp = old next temp
   temp base = old temp base
   last line = -15

%end;           !  assemble


!              -------- it all starts here ---------

   control = IMPCOM_flags & 255;         ! set compilation options
   control = control & (\check bits) %if control & trusted # 0; ! force OPT

   select input(in)
   select output(object) 
   print symbol(init gla>>1);          ! Initial GLA allocation
   print symbol(init lit>>1);          ! specify literal area available to pass 3
   claim literal(init lit,align);      ! set literal base and initialise pass 3

   var(0) = 0;              !  for %RECORD(*) . . . . .
   var(max vars)_Length = SetLen       {for sets}
   parms = max vars
   cslen == current string(0)
   activity(wsp) = -1;  activity(code) = -1;  activity(0) = -1
   activity(gla) = -1;  activity(link) = -1

   %for j = 0,1,max stack-1 %cycle
      stak(j)_link == stak(j+1)
      dlist(j)_link == dlist(j+1)
   %repeat
   stak(max stack)_link == null
   dlist(max stack)_link == null
   desc asl == stak(0);  dasl == dlist(0)
   using_link == null

   for stk(j) = 0 %for j = 0,1,max cycle
   for stp = 0;  for == for stk(0)

   read symbol(next);          !  Prime SYM/NEXT pair
   Spec = 0
   decvar == begin
   assemble(2,0,0)
   close files
   %signal 15,3 %if faulty # 0
%endofprogram
 H?  {{.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!         4v  }m  	          
  m      NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    :X%             
 ^ line PERM      Oxo    [prim :  :  ORG: block
block io:  
close da:  	open da:                          proc     size     base :                  M                              T   *ERROR          4           T                          $C>B>BB.C.CB>C>B.BCC.C             #0!0!! # #!0#0! !## #              o$ 5 d  Z 2`
5x QQeD                    8? H  !34  1  0 !81 !5$$ 4#$$ 4&  ?1  34C0  D   D   
C  "H  !34  1  0 !81 !5$$ 4$@#0#D   D   &A'1"C  9H  !34  1  0 !81 !5$$ 4B  @ !4B ";
C@ !$$ 4#$$ 4B  C
B$P#E  E  &Q'1"C  $A1    0#
#	QD   RD   ?&A'"3 s_  eX!34RUUh!34dffз  ӳ  Ű !4Գ #9    !8 !5$$ 4B$ C08 L  #9&"C  "
  'M  M   >' ("#4\BbD#:  
  nBJ"#<  #M  M  '"DC0  
$#M  M  &'"%ѷ  C $ "ѷ  $$ 4 ?$$ 4 '    !8 !5$$ 4"#&!2#C$$ 4
!  1  #C   C  '1" 2#XC   PC   '4" 	2$ #PC   '4" DD   D   ?&AC 9 1I2 !,K2  !
3s3B  #9
3
>!$$ 4!$$ 4 /З  $1$H  H X [ &B0P  [ ,&' ?P  
*&30H  P  ї  C Kї  $$ 4 
Y  #%$$ 4
qPr  PB &(pX  ?$PS?PE   &T 4 "#$$ 4$$#'!"  $/ #-( $  ?,'"(!j #k 
j 
( + F   A    ("!j #k .  @   H  !34  "#(!B   C $$ 4 	X   $$ 4 ?$$ 4   "#:  ! ?$$ 4 ?$$ 4 ?$$ 4 O$$ 4   $$ 4  ?$$ 4  ?&?$$ 4 X# Y !Y !&\ Z  B!$$ 4 XC Y B(Y B  \ Y$ !Y$ !'
\ Z  &L!$$ 4 "XS XE  'AB
B$'DY BY !,
\ &\X  B"Z  E $$ 4 
XC \ 
\ Z   GHO  s/ "B
'X=  2 #$$ 4&r0U> ?P7D   &D"$  4  ,gp l \ ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n X=  Ho  &_W  ݈/ $ 0 XAC   XRC   ed	d#3  	e#3  '4C$`E  !2$aC  0 XC   VC   PC   '4" 0 %WC   TC   PC   '4" 0 XC   TC   PC   '4"            |$TRACE %GO
   9H  !34  1  0 !81 !5$$A> rB  @ !4B ";
C@ !$$A> r#$$A> rB  C
B$P#E  E  &Q'1"C  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n$A1    0#
#	QD   RD   ?&A'"3A> r2#XC   PC   '4"2$ #PC   '4"?1  34C0  D   D   
C  Ӏ g p 4 'P ,H9 <  0 P9 00 
#3 0P9 0#3 7P9 0cW   <X ,B0y  .	W  p ,$`W   lDW   H$QXi W   T` :W   <$TXi  W   TW  ,$ $AT 5	g p 4W   P ,W   P 0X ,X9 P  y   	w p H$QQ <X9 <P: @Ȱ $Z DP 8+$9AnX: @@; "XM\@K $P@[  D#*$T@[  @ !4$U@[  Xh Pj D$P <P ,W   P#+ !(
sA

Q$`AW   PU <#5Q$aAAC mAmAX=\0 !7X 8XMaK  mAXZ 8Xm@e W   $X 8@ W   0mAX: 8X@ mAXJ 8X]@T mAxXj 8X@ %1Q=X!4z XM&B@F HV #4&C@F XmQi @X ,C0DX: <P=$0P: <XC0.Z ,P ,HK PH XJ <@K XMPJ <XH PMC XZ 8Xj ,Pe X `P\  PX `C ti LAmAX9 L0P=#$0#%S$cA>3Z8 LP: 0X  C0NXI L@   !6X]$dAXZ 8Xe cC0&Pj 4X 4X<  U: 0#4P: 4"	X 0X;  P<  #P XJ 0XZ @@T Xm@d X 8X< P4  PL C Ȱ BP#	$APM#PP]mAmAXm#$`#%V$eAxXT!5V$fAf&PZ ,P ,X: <@< X=P: <@l  X@ XM@L C mAmAC lmA|mAtX]
UZX d%b@e  C HmAXX'P $1Q8 X\Ű !?XJ 8a4 XX [Z D!P ##a4 Xh Pj D#C ؀
g p @f#$` 4#%V$iA
fZh dH  !z X8 \H P 8XJ 
DZMdHT  PZ 0
UZ]dHe  Pj 4`   #6&İP 8`Pj 4X 
Z d@  
@ X: 0
6P: <X 0U <C0b&P 0
ZdsK  PJ ,@  @  B0:XZ ,P  C0,$aQj 0X 0
ZdH\  PZ ,
UZX dH5  #Xj ,A^C C $ 
g p DX !4z $0P: <P: @X XK PJ 4$QQ]Xj 4X @a H6 0 B0Q]H  Z LP ,HF PJ 8H[ T!T C $aPj <&P @X al X: 4H ư @ XZ ,He dB(d B  ư @ F#$@L@d!%ư @ XJ X P 0X: 0#8H XJ 4I !"#
&@ X3  P: 0C XZ 4He !2#cZi ,Pj 4C X <!2#C C  
W  p TX !7$0P5  z $P D$@PJ HPJ LXZ Xe Pj 8H "P P$1Q=X 8XJ LaK H[ P B0Q=Hk  cZh LPj 0X H< J; P: <H U P!9XJ 8HT P @C0Z@ $KZH DHT JV PZ @SB:S B 2Xj 8H  @ 5#$0;0d!% @  #3C  #HL JF PJ @XZ @Xj <V!V !#C X 8H< 0 B0<0 @< VB(V B  0 @< e#$`k`d!%0 @< C J0 !6U!P!,0 C0.V!V C  U!P!'0@< C r0 @< #C d$APJ HQJ DQJ LXj aF X P 4XJ 4HT Xj 8IV !"#
&Q@T XD  PJ 4C X P ,X: ,X  P ,!2#$AaK "XZ 8He !2#cZi ,Pj 8C X H!2#C X:  X DP  C &
w p 8XP 4$0P: ,C R&1P: ,3Z9 ,H P 0ð  #:XH TZJ ,$PT  C "Xh TZj ,İ Z  XJ 0@ P  X: ,U: 4B0$PCzXmPj 4P ,C T&P ,' B0(W  ,%TXj ,W   TW   HX8 TZ: ,$Rc  W   TX ,U 4B0$bW  8z  
g p 0$&P ,Z LU !6X ,{ X ,B0$ $AT !g p 8$P 40 $6Z8 DP; ,W   H$QXK ,Hd W   TW   H$QXk ,Hf W   TW  ,X ,X< P; 0XK 0C0`dA8$SaW   T` :W   <$PXk 0Hf W   T$Q 4X; 40 !6W  ,XK 0XT  P[ 0C Xk 4` #6W  ,{  w p 4X <P 0$0P: ,C :&1P: ,W  ,W   H$QXj ,W   TXj ,AX: ,U: 0B0z  4
w p PN4PI 0pZP	 ,$P <P @$aW   `$P AX8 `$P  W   P L #5Q%aAh tAth xAlh pAdmA\mATmALX tU @#6XY @$hA$@&API L
DZH dHT  P!5Xi LAXI L@ 4B0Xh \$a $0#AW   P 8X \P 4X 4XJ  PI 8!3C >dAXY 8He X 4Jl Jl @e H< J< @5 H J  @ PY 4C $P#ADW   P <$`Pi HX \P 4X9 4X  P 4!3C BY DkAX DC0,$AQI HXY 4a PY 8Xi 8X  P 8!2#X9 Da< "C X H!2#C $@#AW   P @AnXX `He Je Ph H J  P |H5 J5 P8 ty 	W  p l* 2Ar
 ,  q
 ,X 8CBX: ' ,AӲ  &@ ?BK   Ҳ  W   HW  ,$ AT ,* L$8AX$^@Z .r
 ,  q
 , L* ,$8AXXj  Pj D$@ .r
 ,  q
 ,X: HB: L* ,$8AX$P D$F@J .r
 ,  q
 ,XZ H!Xj DPmz ' ,A 4A   W   HW  ,$ AT 
w p LXP D$;@: .r
 ,  q
 ,$PXJ H!z ' ,A 4A   W   HW  ,$ AT 8
W  p L&hZmPj @XP DX: X P H@Z .r
 ,  q
 ,XJ H!z ' ,A 4A   W   H$QXj Xf W   TW  ,$ $AT I
W  p 0X lP  
P l$0P6 PV P6 X ,XF  @K  @; z   
g p 8hPj 4X Ul !5z $1Q=$C(|W   H$QXj 4W   TW  ,XI PJ 0$QQ]Xj 0X  P ,X< U: 4!3C BX  !2#P 0C 3#X: 4P< C "$ZlAXJ ,XZ 4PT $YdAt$aQmX 0X: ,X  P  X P  P9 C : s
w p 4$`A
P ,$C0&ZH9 0#0 0 @1  X ,&ZHI @ #@ @ @K XZ ,&XZ]`C!@e X ,&Z$0@< X ,&Z@; XJ ,&HZM@4 
XZ ,&XZ]@5 Xj ,&hZm@6 %&P 0
X: ,Z X 0
ʹ HK  @L X 0 B0XY PZ ,Xj ,X !$ZALX: ,X  P ,!2#C z  
W  p ,$CV%2BPvW   H$QXj  W   T$VX Xk W   T$QXJ Xd W   TW  ,XZ  Xj YV !YV !&PV z ` A^ H
W  p 4X  Z P 0i <#4&P 0$0CR%C LXM #6W  ,XZ 0P]$TXj 0W   TrW   HHj AW  ,Xj 0AP ,j 3
fZma H @  X: $Q z  X
g p ,` A!` Z!&{ ` a!` z!$"` 0!` 9!%C ` #!` %!% C `  !4$C %C  8W  p @ 
<  P; ,I F T  P[ 0  <  P; 4Xk ,APXk 0P 8ADX[ 8` (F
QXk 4P[ <A,X; < (,XK  
1@4  {  Ag p 8 H9 P: 4P ,#&P ,ȹ 
@  K  U 4 <HY 'RPZ 4%bPj ,C &cPj ,Z 0A&HZ 0Xj AXj ,Uj 4B0z  =
g p DW   P 4P 8 #$$P 8 P @$P 0C 8&P 0W   P < a! z!%P <9 Z: 0  X 0U @B0X 4[ 8P 4XJ 4#*W   0%QQZ 4"$l@i X  !4z X: 80 !&!4$f@i W   P W   P 4P X 4İ P W   P 0j 4AXJ 0DPI XZ 0P P sj 6
VPY $C' , AnA   W   H$QHi W   T$QXi W   T$TXi W   T$SXi W   T$QXi W   T$QXi W   TW  ,C  
w p @$&P ,
Z dH<  P: 0Bd$C>hW   H$QXj ,W   T`  W   <Xj 0AW  ,XJ ,
DZH dXX \HU JT  i ,AXj ,
fZmdH  P 0
ZdH<  0Z: 0P: <X 0U <C0&P 0
ZdsK  PJ 8@  @  #9XZ 8i ,A6C XZ 8P  !;Xi 8Pi,i ,AC xP P !8PCi ,A#X 8 \PAi ,A$1Q: 0X 0
ZdHK  PJ 8
DZH dHT  PZ 4#XZ ,$oA
Xh \H 
\
\i ,AC &X , 4B0xX8 dH hP(z  Հ
w p D$QX8 TZ9ӳ  P 8XICZH LPJ @P $LT ZX DHe Jd ZiPj <ð #4$Qð @!:X
ZtH<  P9 İ 
sK^

$Q|$@PJ 4XZ <[Y 8PZ 0#@ PJ 4$P[Z 0PZ 0P #'XY 8` AXi
fZmlH  \ZZ 0i ,Az $1Q=$QXJ <XX \KE 
DPJ 0XY i ,AhXj 8` ` !=s 0 \P@ i ,AD#X: 0!0?#'XY 8` AsZ 2i ,AC $QXI 8&BXZ <T
UPZ 0P !P?#'XY 8` ADXY Pi ,AXZ 0P i ,AC . ـ
w p T$QQ 0 $L9 Z8 DP: 8HS i ,AX 8H[ i LAXJ 8HT i \AXY 8PZ 0$`Pj ,X  C0@j ,A$aAfX=\C0&X ,P HXM`#4$P H[i LA$i \AC nX=\C0$) (A$@ Vi LAi \AAXH \HT JT 'Ri ,ABXY 8[Yi ,AXi 8'aPiP   i ,AW   P L#+ !(
sA0

Q$lAW   P HU #5Q$mAX 8P <X9 XP: @X hP DAXZ <i ,AXZ @i LAXZ Di \AC 6%AQMX]C0XY 8[Yi ,AXi 8'aPiX 8H< !;H\ P i ,AC XH\ i ,AX 8H[ i ,AXJ 8HT SZX LHU JT i ,AXj 8H Z LH\ JV i ,A~$0CB$QXi XW   T$QX 8Hk W   T$QXJ 8Hd W   TW  ,X]\P B0XmB0$X \H\ i LAX8 \HS  i \AC 4XY X[Yi LAX X'PXY h[Yi \AXI h'APIXZ 8He Je Pj HX XU H#7$Pi LA"
z X9 8P=X: 4P9 8C X 8P 4XP 8C j PA2$@[J PPMC zj PAXZ Pi ,ALC bj PAX]#6'QP]C JXZ Pi <A$C :XY H'Ri lAC (XY H'Qi lA C XY 8'Qi ,A^Xj 8HV i ,AC W   0j PAX P PX: P4P9$PA4C iA`W   0i ANW   0iA<$@PIAC W   0i AW   0j HA
XZ H#$P 4#$$oAXY i ,A(Xj H
fZh dHV  
Ui ,AC &W   0iAXZ LH< P: H#7X 8J; P: HSi ,AC j PAXJ P'APH $QQX $`C8"W   H$QXh W   T$QXi 8W   TW  ,X 8[ 0P !3C ~X8 [: ,P8 !0 C $X\Ű !;XH 'ATP i LA0$QPX Xm\` !;X \ZX i LAX8 P: ,X 8P 0C $`AXM\@ B0rXY P TXi ` 
VTs 
\PZ HH9 0 #5P PZ HX Ű !5P@ PZ HXi ` #5P  PZ Hi \AsY i \A|i \AC W   P Li A%aAp$PX: L0 #50 B0lX P H0 B0*X 8P H .A*!;XJ 8HT P@ @T @ XY i |AHi Zi 'aPi XZ Hi |Ai |AvC 0 #50 B0X,C0< .A*B0,XI 8PJ L[i ,AXY H
Ui ,AXZ Li ,AHY ZY PZ Hi AsY$i <A^XY$i <ARXi H'bPi$XZ Hi <A<XY H'Si <A.X L !<%Qi <A%Qi <A#$Pi <A$Pi <A$6P=#S` AB#C 8
w p@NPI p@P	 $P PP,$P <&1P90X P ȠZ P %APJ P  0 B0 P lX]$6CP]XMBPMXX x&SPPX xXh \H Q t9 P7 ,X]i |A`ȹ P ,X]i ALȩ P ,X]i lA8I PG ,XX i LA$Y PW ,XX |i \AXh l&c`Ph lZh xPi ,$[ xP 0X8 tP9 4$P 8
cȦĠ P <P @XH pPI DP HP}@Y %a@i X ,@ X8 l@9 Z t@ @I 
Ⱥ P X@ XM@I $bW   `XY XXl A2W   P0'P<$0P90#&1P90Pi <AX90U9< =$Pi <A$Pi <AW   P0 #Q` A"$P %PXH \HT 'QPYHd  'aPiP P$AW   P0 #5Q%bA%Ti ,A$Pi ,AhXY(i ,A\HY i ,APXYi ,ADX\ C02 B0$H9 0 @9 X P#& P#$@ XI@I XY@Y Xi$@i X9 @9 A8Ay 	w P (p N|PH Hp#P DNlPH Pp@P LN\PH XpTP TNLPH hp hP d$&P Z L,$2AnX  >$0&1P8 
3Z8 d%@  X8 0 4 =X DȚ $P \)$9AnP `XXX< 80 P=\X İ P`$`W   lW   P ,X\ɠ #$$P\AW   P 0AW   P 4X tZ xXH \K X]X
P Hd 
fPe X p
P X8 Z8 |
3P5 x  %repeat
 & 135  
 & 136         In Stream(0) == tt  in FD;  Select Input(0)
 & 137        Out Stream(0) == tt out FD;  Select Output(0)
 & 138  
 & 139     %end
 & 140  
 & 141     %external %routine PACK (%string(63) filename, %record(file fm)%name packed)
 & 142        %record(parm fm) P
 & 143        string(addr(P_sact)) = filename
 & 144        SVC (17,P)                         {pack}
 & 145        packed = P_file
 & 146        %if P_file_owner < 0 %start
 & 147           EVENT_message = "Illegal filename ".filename
 & 148           %signal 10,1
 & 149        %finish
 & 150     %end
 & 151  
 & 152     %external %routine UNPACK (%record(file fm)%name file, %string(*)%n                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                                                                                                       ` _  d ` - H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          !! 28-JAN-81
!   **************************************************************
!   *                                                            *
!   *          PERKIN-ELMER 32-BIT SERIES IMP COMPILER           *
!   *               INTERMEDIATE CODE ASSEMBLER                  *
!   *                                                            *
!   *                 (GENERAL SERVICE VERSION)                  *
!   *                                                            *
!   *                       C.H. WHITFIELD                       *
!   *                     19, REDFORD TERRACE                    *
!   *                          COLINTON,                         *
!   *                     EDINBURGH  EH13-0BT                    *
!   *                                                            *
!   *                 COPYRIGHT (c) MAY 1ST. 1980                *
!   *                     ALL RIGHTS RESERVED                    *
!   *                                                            *
!   **************************************************************


! Pass 3 for 7/32 Imp

!  ===========
! N.B.  All loader-visible addresses generated by pass2 are in units
!       of halfwords.
!  ===========

! ****Compatibility header:  to disappear with old-format EXE files
%constinteger  h8 = 8

!
%begin
%include "Sysinc:Com.inc"
%constinteger  direct=1, object=2
%constinteger  report=0

! N.B. <0 for diagnostic tracing, >0 for extra details of dumped code
%constinteger  diagnostic = 0

%constinteger  register template = x'7DEF';   ! wsp, code, gla, link

%constinteger  max tag=2050
%constinteger  max ref=2900
%constinteger  max proc=255

%constinteger  bmax = 8;      ! no. of DA buffers available to phase 2
%constinteger  safe pc rel = 6500;   ! 'SAFE' limit in stretch routines q.v.


! Parameters related to diagnostic table generation
%constinteger  indirect = x'4000'
%constinteger  line diag limit = 31
%constinteger  proc header=1, diag entry=0, linkage name=-1;   ! 'descriptions'
%constinteger  none = 0,  partial = 1, full = 2
%owninteger  diags = full, hide = 0

%constinteger  main prog = x'4000';   ! main program marker in event chain
%conststring(3) main ep = "%GO";      ! must match pass 2
%conststring(6)  trace ep = "$TRACE";      !   likewise
%constinteger  init lit = 4;      ! halfwords:  must not exceed pass 2 value


!********
%constshortinteger  max prim = 52
%constshortintegerarray prim(1:1018) = %c
x'026F',x'0215',x'0224',x'0035',x'0064',x'0087',x'00D7',x'015A',x'00C1',
x'0232',x'029A',x'0160',x'02B3',x'02C7',x'02E7',x'030A',x'01C5',x'01F5',
x'01AB',x'0335',x'02AA',x'0294',x'028E',x'0278',x'0288',x'0315',x'0188',
x'0194',x'02A2',x'0051',x'0251',x'0265',x'0244',x'019E',x'03AF',x'03CD',
x'03DC',x'03EC',x'0000',x'0000',x'0000',x'0000',x'0000',x'0000',x'0000',
x'0000',x'0000',x'0000',x'039C',x'03A3',x'0338',x'033F',x'001B',x'480F',
x'0000',x'2133',x'3402',x'9400',x'9300',x'D331',x'0000',x'C530',x'0080',
x'2138',x'D431',x'0001',x'2135',x'2408',x'2411',x'8883',x'0034',x'0503',
x'2385',x'2401',x'2417',x'8883',x'0034',x'26F2',x'8888',x'001E',x'0012',
x'0512',x'033F',x'D331',x'0000',x'9433',x'3443',x'F830',x'FF00',x'0001',
x'D301',x'4400',x'0000',x'D202',x'4400',x'0000',x'0A43',x'2087',x'030F',
x'0022',x'480F',x'0000',x'2133',x'3402',x'9400',x'9300',x'D331',x'0000',
x'C530',x'0080',x'2138',x'D431',x'0001',x'2135',x'2408',x'2411',x'8883',
x'0034',x'2440',x'0503',x'2383',x'0830',x'2304',x'D301',x'4400',x'0000',
x'D202',x'4400',x'0000',x'2641',x'2731',x'2218',x'430F',x'0002',x'0039',
x'480F',x'0000',x'2133',x'3402',x'9400',x'9300',x'D331',x'0000',x'C530',
x'0080',x'2138',x'D431',x'0001',x'2135',x'2408',x'2411',x'8883',x'0034',
x'D342',x'0000',x'C540',x'0080',x'2134',x'D442',x'0001',x'223B',x'0A43',
x'C540',x'0100',x'2185',x'2401',x'2413',x'8883',x'0034',x'0B04',x'2315',
x'2401',x'2417',x'8883',x'0034',x'D242',x'0000',x'0B43',x'0A42',x'2450',
x'2308',x'D301',x'4500',x'0001',x'D204',x'4500',x'0001',x'2651',x'2731',
x'2218',x'430F',x'0002',x'0015',x'2441',x'D331',x'0000',x'D302',x'0000',
x'0B30',x'231B',x'0A03',x'2309',x'D351',x'4400',x'0000',x'D452',x'4400',
x'0000',x'023F',x'2641',x'2701',x'2219',x'0833',x'030F',x'0082',x'735F',
x'0000',x'9465',x'1058',x'2133',x'3452',x'9455',x'9355',x'1068',x'2133',
x'3464',x'9466',x'9366',x'D0B7',x'0000',x'D3B3',x'0000',x'C5B0',x'0080',
x'2134',x'D4B3',x'0001',x'2339',x'D301',x'0000',x'C500',x'0080',x'2138',
x'D401',x'0001',x'2135',x'2408',x'2411',x'8883',x'0034',x'0BB0',x'4210',
x'80A8',x'24C0',x'0800',x'4330',x'8038',x'D301',x'0001',x'D403',x'4C00',
x'0001',x'2339',x'26C1',x'05BC',x'2286',x'4300',x'808A',x'D301',x'0001',
x'2207',x'08E3',x'0AEC',x'D3D1',x'0000',x'27D1',x'D30E',x'4D00',x'0001',
x'D401',x'4D00',x'0001',x'203E',x'27D1',x'2028',x'0822',x'2334',x'055C',
x'4280',x'8062',x'08DC',x'0844',x'233A',x'D301',x'0000',x'0AC0',x'D3E3',
x'0000',x'0BEC',x'056E',x'4280',x'804A',x'0822',x'233C',x'D2D2',x'0000',
x'2307',x'D303',x'4D00',x'0001',x'D202',x'4D00',x'0001',x'27D1',x'2217',
x'0844',x'4330',x'801C',x'D2E4',x'0000',x'0AC3',x'24D0',x'2308',x'D30C',
x'4D00',x'0001',x'D204',x'4D00',x'0001',x'26D1',x'27E1',x'2218',x'2501',
x'D1B7',x'0000',x'430F',x'0002',x'2400',x'2205',x'D1B7',x'0000',x'2401',
x'2417',x'8883',x'0034',x'0005',x'023F',x'2407',x'2410',x'8883',x'0034',
x'0027',x'D301',x'0000',x'C500',x'0080',x'2138',x'D401',x'0001',x'2135',
x'2408',x'2411',x'8883',x'0034',x'0822',x'2326',x'0503',x'2184',x'CB32',
x'FFFF',x'2316',x'0843',x'2405',x'2414',x'8883',x'0034',x'0A21',x'C817',
x'0000',x'D231',x'0000',x'2307',x'D302',x'4300',x'0000',x'D201',x'4300',
x'0001',x'2731',x'2217',x'030F',x'000B',x'1132',x'2307',x'5801',x'4300',
x'0000',x'5002',x'4300',x'0000',x'2734',x'2217',x'030F',x'0009',x'1132',
x'2400',x'2304',x'5002',x'4300',x'0000',x'2734',x'2214',x'030F',x'000C',
x'0B44',x'D301',x'4400',x'0000',x'D402',x'4400',x'0000',x'023F',x'2641',
x'0543',x'2039',x'030F',x'0019',x'0831',x'4932',x'0002',x'212C',x'4B32',
x'0000',x'2119',x'0A33',x'7333',x'4200',x'0004',x'2339',x'0A33',x'0A3E',
x'0303',x'0821',x'2406',x'2413',x'8883',x'0034',x'0821',x'2408',x'2412',
x'8883',x'0034',x'002F',x'D097',x'0000',x'2431',x'2410',x'489F',x'0000',
x'08B4',x'48AF',x'0002',x'58CB',x'0008',x'5BCB',x'0004',x'26C1',x'4210',
x'8030',x'50CB',x'0000',x'1C0C',x'5B1B',x'0004',x'1C2C',x'26BC',x'2791',
x'203F',x'50AB',x'0000',x'1C0A',x'1C2A',x'2633',x'C430',x'FFFC',x'48CF',
x'0000',x'50C4',x'0000',x'D197',x'0000',x'430F',x'0004',x'084B',x'D197',
x'0000',x'2405',x'2413',x'8883',x'0034',x'001F',x'0807',x'0A03',x'590D',
x'0000',x'2325',x'2402',x'2411',x'8883',x'0034',x'0A71',x'5072',x'0000',
x'5042',x'0004',x'2628',x'0870',x'580E',x'000C',x'F500',x'8080',x'8080',
x'023F',x'2450',x'0B53',x'033F',x'5007',x'4500',x'0000',x'2654',x'2034',
x'030F',x'000E',x'0822',x'2315',x'2405',x'2412',x'8883',x'0034',x'2401',
x'2411',x'2302',x'1C03',x'2721',x'2212',x'8888',x'0015',x'000D',x'2401',
x'2F00',x'0801',x'2316',x'2D02',x'2820',x'2400',x'CB01',x'0001',x'033F',
x'2C02',x'2701',x'2203',x'8010',x'2802',x'2114',x'6A00',x'8010',x'2305',
x'6B00',x'800A',x'6A20',x'800A',x'2800',x'2B20',x'030F',x'4600',x'0000',
x'4110',x'0000',x'0000',x'800C',x'2822',x'2114',x'6A20',x'800C',x'2303',
x'6B20',x'8006',x'2E12',x'030F',x'0000',x'4080',x'0000',x'0013',x'480F',
x'0000',x'2133',x'3401',x'9400',x'9300',x'0822',x'2328',x'0502',x'2186',
x'E611',x'4200',x'0000',x'430F',x'0002',x'2406',x'2415',x'8883',x'0034',
x'0009',x'581D',x'0000',x'CB17',x'0200',x'031F',x'2402',x'2411',x'8883',
x'0034',x'0008',x'023F',x'2408',x'2411',x'8883',x'0034',x'0000',x'8080',
x'8080',x'000F',x'0822',x'233A',x'0B10',x'0801',x'EE00',x'001F',x'1D02',
x'0811',x'2113',x'0800',x'033F',x'2405',x'2411',x'8883',x'0034',x'0005',
x'033F',x'2404',x'2412',x'8883',x'0034',x'0005',x'033F',x'2401',x'2415',
x'8883',x'0034',x'0005',x'034F',x'2401',x'2415',x'8883',x'0034',x'0007',
x'D401',x'0000',x'038F',x'2401',x'2417',x'8883',x'0034',x'0007',x'C320',
x'FFE0',x'033F',x'2405',x'2416',x'8883',x'0034',x'0008',x'0800',x'033F',
x'2601',x'033F',x'2401',x'2411',x'8883',x'0034',x'0013',x'5823',x'0004',
x'5912',x'0004',x'2119',x'5912',x'0008',x'2126',x'5C02',x'000C',x'5A13',
x'0000',x'030F',x'0842',x'0821',x'2406',x'2412',x'8883',x'0034',x'001F',
x'5843',x'0004',x'5914',x'0004',x'4210',x'8028',x'5914',x'0008',x'4220',
x'8020',x'5C04',x'000C',x'5924',x'0010',x'211A',x'5924',x'0014',x'2127',
x'0A12',x'5C04',x'0018',x'5A13',x'0000',x'030F',x'0812',x'264C',x'0821',
x'2406',x'2412',x'8883',x'0034',x'0022',x'5853',x'0004',x'5845',x'0000',
x'2741',x'1142',x'0A42',x'0801',x'2410',x'2744',x'5905',x'0004',x'4210',
x'801C',x'5905',x'0008',x'212C',x'0A10',x'5C05',x'000C',x'265C',x'5804',
x'0000',x'0542',x'228F',x'5A13',x'0000',x'030F',x'0845',x'0820',x'2406',
x'2412',x'8883',x'0034',x'000A',x'5843',x'0004',x'5C04',x'000C',x'0A12',
x'5C04',x'0018',x'5A13',x'0000',x'030F',x'001F',x'0847',x'484F',x'0000',
x'732F',x'0002',x'1122',x'0B42',x'0A27',x'583D',x'0000',x'C532',x'0200',
x'2385',x'2402',x'2411',x'8883',x'0034',x'26F4',x'0872',x'F830',x'8080',
x'8080',x'553E',x'000C',x'023F',x'5037',x'4400',x'0000',x'2644',x'2224',
x'030F',x'0002',x'8883',x'0034',x'0006',x'D007',x'002C',x'0867',x'CA70',
x'006C',x'8102',x'005C',x'D007',x'002C',x'584D',x'0008',x'2337',x'5004',
x'0000',x'5014',x'0004',x'5024',x'0008',x'C8A7',x'0040',x'0810',x'2441',
x'ED41',x'0000',x'0813',x'4120',x'805C',x'0855',x'2315',x'083F',x'0813',
x'4120',x'8050',x'4826',x'0002',x'9352',x'1152',x'585A',x'45FF',x'FFEC',
x'0822',x'4210',x'8022',x'7316',x'0008',x'0A11',x'0A1E',x'0931',x'232C',
x'4816',x'0004',x'0414',x'2338',x'D17A',x'0008',x'7316',x'0006',x'0A11',
x'0A1E',x'0301',x'C320',x'4000',x'2138',x'5835',x'0028',x'58E5',x'0024',
x'08A5',x'4300',x'FFB0',x'D107',x'002C',x'8101',x'736E',x'40FF',x'FFFE',
x'0A66',x'0B1E',x'7306',x'4E00',x'0000',x'0A00',x'0856',x'0B50',x'0916',
x'2123',x'0915',x'2128',x'0865',x'221B',x'D107',x'002C',x'2400',x'241F',
x'8101',x'0855',x'0212',x'0A6E',x'0302',x'0006',x'583D',x'0004',x'08C8',
x'0183',x'088C',x'030F',x'000B',x'486F',x'0000',x'26F2',x'085F',x'D057',
x'0000',x'D1DD',x'8887',x'082F',x'08F5',x'0302',x'001D',x'2400',x'C830',
x'001C',x'5841',x'4300',x'0000',x'5852',x'4300',x'0000',x'0865',x'0464',
x'0964',x'2333',x'C600',x'0001',x'0965',x'2333',x'C600',x'0002',x'2734',
x'4310',x'FFDA',x'2460',x'450F',x'0000',x'2132',x'2461',x'430F',x'0002',
x'000E',x'C830',x'001C',x'5801',x'4300',x'0000',x'5602',x'4300',x'0000',
x'5001',x'4300',x'0000',x'2734',x'221A',x'030F',x'000F',x'C830',x'001C',
x'2501',x'5702',x'4300',x'0000',x'5401',x'4300',x'0000',x'5001',x'4300',
x'0000',x'2734',x'221B',x'030F',x'000E',x'C830',x'001C',x'5801',x'4300',
x'0000',x'5402',x'4300',x'0000',x'5001',x'4300',x'0000',x'2734',x'221A',
x'030F'

!********

!   ==== control codes ====
%constinteger  tag defn = 1
%constinteger  r ref = 2
%constinteger  p ref = 3
%constinteger  sw ref = 4
%constinteger  j ref = 5
%constinteger  c ref = 6
%constinteger  code item = 7
%constinteger  gla  item = 8
%constinteger  line diag = 9
%constinteger  line reset = 10
%constinteger  var diag = 11
%constinteger  code area = 12
%constinteger  lit area = 13
%constinteger  lit org = 14
%constinteger  frame patch = 15
%constinteger  proc head = 16
%constinteger  proc end = 17
%constinteger  prog end = 18
%constinteger code rel = 19
%constinteger  gla rel = 20
%constinteger  extern = 21

! external reference sub-types
%constinteger  data spec = 4, data defn = 5
%constinteger   ep  spec = 6,  ep  defn = 7


! ======== constants associated with code generation ========
%constinteger  align=3;      ! single word alignment (literal area)
%constinteger  emark = x'8880',  tmark = x'8887'
 %constinteger backwards = X'0100';      ! short jump modifier
%constinteger  code base = 14;           ! code base register

%constinteger  BZ = X'433E', BZS = X'2330'
%constinteger  BNZ = X'423E', BNZS = X'2130'
%constinteger  BM = X'421E', BMS = X'2110'
%constinteger  BP = X'422E', BPS = X'2120'
%constinteger  BNP = X'432E', BNPS = X'2320'
%constinteger  BNM = X'431E', BNMS = X'2310'
%constinteger  JMP = X'430E', JMPS = X'2300'
%constinteger  BAL = X'410E'

%constshortintegerarray short jump(0:12) =
         BZS,  BNZS, BMS, BPS, BNPS, BNMS,
         BNZS, BZS,  BPS, BMS, BNMS, BNPS, JMPS
%constshortintegerarray long jump(0:12) =
         BZ,  BNZ, BM, BP, BNP, BNM,
         BNZ, BZ,  BP, BM, BNM, BNP, JMP

!     == flag bits used in 'REF' table ==
%constinteger  short=1
%constinteger  long=2
%constinteger  pc rel=4
%constinteger  very=8
%constinteger  invert=16
%constinteger  remove=32
%constinteger  rcall=64
%constinteger  safe=128
%constinteger  conditional=256


!   == values used in code generation phase ( reftype(k)=0 -> 'REMOVE' ) ==
%constinteger  sf=1
%constinteger  rx1=2
%constinteger  rx2=3
%constinteger  rx3=4

%constinteger  sign bit = x'80000000'
%constinteger  halfword sign = x'FFFF8000'

! ** Purely for accumulating jump instruction statistics
%owninteger  sfjump=0, rx1jump=0, rx2jump=0, rx13jump=0
! ** For accumulating counts in various bits of program
%owninteger  localtot=0,localnonsafe=0, globaltot=0,globalnonsafe=0
%owninteger  buff miss1=0, buff miss2=0, buff miss3=0
! ** for recording timings
%integer t0,t1,t2;         ! phase 1, phase 2 timing
%integer  t10, t11, t12;   ! local, global stretch timing (inside phase 1)



%recordformat  reffm(%shortinteger  tag, link, flags, ca)
%recordformat  deffm(%record(deffm)%name  link, %shortinteger proc,ca)
%recordformat  procfm(%record(procfm)%name  link,
                      %record(reffm)%name   ref list,
                      %record(deffm)%name   def list,
                      %shortinteger  base,  ca,
                                     static frame, event mask,
                                     display reg, event start,
                                     event finish, ld base,
                                     ld size, vd base,
                                     vd size, Me)

%record(procfm)%array  proc(1:max proc)
%record(deffm)%array  tagdef(1:max tag)
%byteintegerarray  reftype(1:max ref)
%owninteger  refs = 0
%constrecord(*)%name  null == (0)

%record(procfm)%name  proc1, last proc;   ! ** N.B. proc1 ultimately is prim **
%shortintegerarray  prim entry(1:max prim)
%integer  header size, gla size, code size, literal size
%integer  var diags, line diags
%owninteger  defns = 0, specs = 0, relocations = 0
%integer current line, line incr, ca incr
%integer  j,k,l
   tagdef(j) = 0 %for j = 1,1,max tag
   prim entry(j) = -1 %for j = 1,1,max prim
   proc1 == proc(1);  proc1 = 0
   last proc == proc1

%routine  phex(%shortinteger n)
%integer  j,k
   %for j = 12,-4,0 %cycle
      k = (n>>j)&15
      %if k < 10 %then k = k+'0' %else k = k-10+'A'
      print symbol(k)
   %repeat
%end

%routine  error(%integer  n,p)
   select output(report)
   print string("*ERROR"); write(n,1)
   print symbol(':');  write(p,4)
   newline
   %signal 15,15
%end

%routine  get(%integername  n)
%integer  j,k
   read symbol(j);  read symbol(K)
   n = j<<8 ! k
%end


%routine  phase one;        ! Input directives and expand jumps
%record(reffm)%array  ref(1:max ref)
%record(procfm)%name  pp, qq
%integer  procs;  procs = 0
%integer  ca total;  ca total = 0
%integer  extra, n
%integer  j

%routine  input directives
%owninteger  depth = 0
%owninteger  code = 0,  n = 0,  ca = 0
%record(reffm)%name  r
%record(deffm)%name  d, dd
%record(procfm)%name  p
%integer last ref, this proc, last line
%switch  dir(1:extern)
   depth = depth+1
   procs = procs+1
   this proc = procs;  p == proc(procs);  p = 0
   P_Me = This proc
   p_ld size = diags;   ! FRIG: 0 = none, 1 = partial, 2 full
                        !       0 +  (   ( line org  + ( link )? )?
   p_vd size = 0
   %if diags > none %start;   ! p_vd size set = zero above
      p_vd size = 4;   ! procedure identifier
      p_vd size = 5 %if diags = full;      ! link required as well
   %finish
   last line = current line;         ! ???????
   last ref = 0;  r == null
   %cycle
      read symbol(code)
      -> dir(code) %if 0 < code <= extern
!!dir(*):
      error(0,code)

dir(proc head):    ! <proc index>
      read symbol(n);  error(1,n) %unless n = procs
      input directives
      %continue

dir(proc end):  ! <code size> <no. var diags> <static frame size> 
!      <local display register> <event mask> <event start> <event finish>
      get(ca)
      get(n)
      p_vd size = p_vd size + n %if diags = full;   ! header+local idents
      get(n);  p_static frame <- n
      p_display reg = next symbol;  skip symbol;   ! avoid any limited 'read symbol'
      get(n);  p_event mask <- n
      get(n);  p_event start = n;    ! tag no
      get(n);  p_event finish = n;   ! tag no
      depth = depth-1;  %return %if depth = 0
      p_ca = ca+2;                           ! size + basic event header
      p_ca = p_ca+3 %if p_event mask # 0;   ! full form required
      ca total = ca total + ca
      ! *** reverse reference list - should grow it forwards ***
      %if %not r == null %start
         n = last ref;  last ref = 0
         %while  n # 0 %cycle
            r == ref(n)
            k = r_link;  r_link = last ref
            last ref = n
            n = k
         %repeat
      %finish
      p_ref list == r
      last proc_link == p;  last proc == p
      %return

dir(tag defn):   ! <tag no>  <ca>   *N.B. switch defns. have x'8000' bit set*
      get(j);  get(ca)
      n = j&x'7FFF';         ! mask out 'switch' bit
      error(3,n) %unless 0 < n <= max tag
      d == tag def(n)
      %if %not d_link == null %start;   ! already defined
         error(4,n) %if j&x'8000' = 0;   ! not a switch tag so it's an error
         ! remove existing entry so it can be redefined
         %if %not p_def list == d %start
            dd == p_def list
            dd == dd_link %while %not dd_link == d
            dd_link == d_link
         %else
            p_def list == d_link
         %finish
      %finish
      d_proc = this proc;  d_ca = ca
      d_link == p_def list
      p_def list == d
      %continue

dir(r ref):   ! <n>  <ca>
      code = r call + long;  -> ref ref
dir(j ref):
      code = short;  -> ref ref
dir(c ref):
      code = short + conditional
ref ref:
      get(n);  get(ca)
      error(5,n) %unless 0 < n <= max tag
      error(6,n) %if refs = max ref
      refs = refs+1
      r == ref(refs)
      r_link = last ref;  last ref = refs
      r_tag = n
      r_ca = ca
      r_flags = code
      %continue

dir(sw ref):  ! <n>  <ca>     * * *  IGNORED  * * *
      get(n);  get(ca)
      %continue

dir(p ref):  ! <n>  <ca>
      get(n);  get(ca)
      prim entry(n) = -2
      %continue

dir(line reset):
      get(n);  current line = n-1
dir(line diag): 
      current line = current line+1
      %if diags = full %start
         p_ld size = p_ld size + 1
         p_ld size = p_ld size + 1 %unless     %c
                                 0 <= current line-last line <= line diag limit
      %finish
      last line = current line
      %continue

   %repeat

%end;          ! input directives

%routine  set prim(%integer  n)
%integer  a,j,k,base,to
   error(9,n) %unless 0 < n <= max prim
   %return %if prim entry(n) >= 0
   base = proc1_ca;          ! current size of prim package
   j = prim(n);              ! entry to pointer table
   k = prim(j);              ! size of this prim routine
   %if k&x'8000' # 0 %start;      ! routine to be full-word aligned
      base = (base+1)&(\1)
   %finish
   k = k & x'7FFF';          ! strip 'align' bit
   prim entry(n) = base
   proc1_ca = base + k*(2//2);      ! halfwords
   to = j+k;                 ! N.B.  j+1:to  inclusive
   %while j # to %cycle
      j = j+1;  a = prim(j)&x'FFFF'
      %if a&x'FFF0' = emark %and a # tmark %start
         j = j+1;  a = prim(j)
         set prim(a) %if prim entry(a) < 0
      %finish
   %repeat
%end;            ! set prim

%routine  local stretch(%record(procfm)%name  p)
%record(deffm)%name  d,dd
%record(reffm)%name  r
%integer  j,n,mod
   %return %if p_ref list == null;      ! no references !!
   %cycle
      n = 0;  mod = 0
      r == p_ref list
      %cycle
         local tot = local tot+1;         ! *** monitoring only ***
         r_ca = r_ca + mod
         %if r_flags&(long!rcall!safe) = 0 %start
            local nonsafe = local nonsafe+1;      ! *** monitoring only ***
            d == tagdef(r_tag)
            j = r_ca
            %unless j-30//2 <= d_ca <= j+30//2 %start
               n = 1; mod = mod + (2//2)
               p_ca = p_ca + (2//2)
               r_flags = r_flags ! long
               %if j+2-16384//2 <= d_ca <= j+2+16384//2-1 %start
                  r_flags = r_flags ! pc rel
                  r_flags = r_flags ! safe %if |(j-d_ca)| <= safe pc rel
               %finish
               dd == p_def list
               %cycle
                  %exit %if dd == null %or dd_ca <= r_ca
                  dd_ca = dd_ca+(2//2)
                  dd == dd_link
               %repeat
            %finish
         %finish
         %exit %if r_link = 0
         r == ref(r_link)
      %repeat
      %exit %if n = 0
   %repeat
%end;                ! local stretch

%routine  global stretch(%record(procfm)%name  p, %integername  extra)
   %record(procfm)%name  pp
   %record(deffm)%name  d,dd
   %record(reffm)%name  r
   %integer  j,k,x,n,mod,me
   extra = 0 %and %return %if p_ref list == null
   x = 0
   %cycle
      n = 0;  mod = 0
      r == p_ref list;  Me = P_Me
      %cycle
         global tot = global tot+1;         ! *** monitoring only ***
         r_ca = r_ca + mod
         %if r_flags&(safe!very) = 0 %start
            global nonsafe = global nonsafe+1;      ! *** monitoring only ***
            d == tagdef(r_tag)
            j = p_base + r_ca
! ****** This wants cleaning up ******
            %if D_Proc # Me %or R_Flags&rcall # 0 %start
               k = proc(d_proc)_base + d_ca
               %if j+2-16384//2 <= k <= j+2+16384//2-1 %start
                  r_flags = r_flags ! pc rel
                  r_flags = r_flags ! safe %if |(j-k)| <= safe pc rel
                  -> NEXT %if R_Flags&Long # 0
               %finish
            %else
               k = p_base + d_ca
            %finish
            -> NEXT %if j-30//2 <= k <= j+30//2;      ! short form adequate
            %if r_flags&long = 0 %start
               r_flags = r_flags ! long
               %if j+2-16384//2 <= k <= j+2+16384//2-1 %start
                  r_flags = r_flags ! pc rel
                  r_flags = r_flags ! safe %if |(j-k)| <= safe pc rel
               %finish
            %else %if (r_flags & pc rel = 0 %and %not 0 <= k <= 16383//2) %c
                  %or (r_flags & pc rel # 0 %c
                         %and %not j+2-16384//2 <= k <= j+2+16384//2-1)
               %if 0 <= k <= 16383//2 %start
                  r_flags = r_flags & (\pc rel)
                  -> NEXT
               %finish
               r_flags = r_flags ! very
            %else
               -> NEXT
            %finish
!************************************
            n = 1;  x = x+(2//2);  mod = mod+(2//2)
            p_ca = p_ca + (2//2)
            dd == p_def list
            %cycle
               %exit %if dd_ca <= r_ca
               dd_ca = dd_ca + (2//2)
               dd == dd_link
            %repeat
            pp == p
            %cycle
               pp == pp_link;  %exit %if pp == null
               pp_base = pp_base+(2//2)
            %repeat
         %finish
NEXT:
         %exit %if r_link = 0
         r == ref(r_link)
      %repeat
      %exit %if n = 0
   %repeat
   extra = x
%end;              ! global stretch

%routine  condense
%constbyteintegerarray  m(0:15) =
   SF,  SF,
!   0    1
   RX1, RX1,
!   2    3    
   RX2, RX2, RX2, RX2,
!   4    5    6    7    
   RX3, RX3, RX3, RX3, RX3, RX3, RX3, RX3
!   8    9    10   11   12   13   14   15
%integer  j,f
   %for j = 1,1,refs %cycle
      f = ref(j)_flags
      %if f&remove # 0 %start
         reftype(j) = 0
      %else
         reftype(j) = m(f&15) ! ( f & (invert+rcall) )
      %finish
   %repeat
   %if diagnostic < 0 %start
      %for j = 1,1,refs %cycle
         %if (j-1)&15 = 0 %start
            newline;  write(j,-4);  print string(": ")
         %finish
         write(reftype(j),2)
      %repeat
      newlines(2)
   %finish
%end;      ! condense

! === for diagnostics only ===
%routine  dump tags
%integer  k
   %integerfn  tagno(%record(deffm)%name  d)
   %integer  k
      %for k = 1,1,max tag %cycle
         %result = k %if tagdef(k) == d
      %repeat
      %signal 15,15
   %end
   %routine  dump proc(%integer  n)
   %record(procfm)%name  p
   %record(deffm)%Name  d
   %integer  k;  k = 0
      p == proc(n)
      print string("    base");  write(p_base,1)
      print string("    size");  write(p_ca,1)
      newline
      d == p_deflist
      %while %not d == null %cycle
         write(tagno(d),3);  print symbol(':')
         write(d_ca,0)
         k = k+1
         newline %if k&7 = 0
         d == d_link
      %repeat
      newline %if k&7 # 0
   %end
   %for k = 1,1,procs %cycle
      newline;  print string("proc"); write(k,1)
      dump proc(k)
   %repeat
%end;        ! dump tags

   select input(direct)
   current line = 0
   input directives
   last proc_link == null
   readsymbol(j)
   error(-1, j) %unless j = prog end
   ! read next six halfwords defining  various sizes for last block:
   !   <code size> <literal size> <gla size> <defns> <specs> <relocations>
   !===== size in halfwords
   get(code size);  get(literal size);  get(gla size)
   !===== no. of items
   get(defns);  get(specs);  get(relocations)
   error(8,ca total) %if code size # ca total

   %for j = 1,1,max prim %cycle
      set prim(j) %if prim entry(j) = -2
   %repeat
   proc1_ca = proc1_ca+2;            !event marker+link

   dump tags %if diagnostic < 0

   t10 = cpu time;               ! *** monitoring only ***

! Initial stretching and block allocation
      ! no diags in perm == proc1
!!!   proc1_ld size = 0
!!!  proc1_vd size = 0
   pp == proc1
   %cycle
      qq == pp_link;  %exit %if qq == null
      local stretch(qq)
      qq_base = qq_base + pp_base + pp_ca
      qq_ld base = pp_ld base + pp_ld size
      qq_vd base = pp_vd base + pp_vd size
      pp == qq
   %repeat

   dump tags %if diagnostic < 0

   t11 = cpu time;            ! *** monitoring only ***

! Routine calls and final stretch
   %cycle
      n = 0
      pp == proc1
      %cycle
         pp == pp_link;  %exit %if pp == null
         global stretch(pp,extra)
         %if extra # 0 %start
            n = n+1
            pp_ca = pp_ca + extra
            qq == pp
            %cycle
               qq == qq_link;  %exit %if qq == null
               qq_base = qq_base + extra
            %repeat
         %finish
      %repeat
      %exit %if n = 0
   %repeat

   dump tags %if diagnostic < 0

   t12 = cputime;            ! *** monitoring only ***

   condense;        ! from ref(k)_flags -> reftype(k)

   line diags = last proc_ld base + last proc_ld size
   var diags = last proc_vd base + last proc_vd size
   code size = last proc_base + last proc_ca

%end;        !   phase one

%routine  phase two
!     generate final object file using 'tag defn' and 'ref type' tables
%recordformat  bfm(%record(bfm)%name  link, %integer  block,   %c
                                %shortintegerarray  b(0:255))
%recordformat  sfm(%integer  zero addr, lower, upper, ca)
%record(sfm)  code, gla, ldiag, vdiag, reloc, defn, spec
%constinteger  bmax = 8;          ! no. of da buffers (at least 2 !!)
%record(bfm)%array  buffpool(1:bmax)
%record(bfm)%name  buff list, bp

%recordformat  hdfm(%shortinteger  p1,p2)
%recordformat  headerfm(%shortinteger  pure size,gla size, code disp,  %c
                         lit disp,  registers, main ep, %c
                        %record(hdfm)  reloc, defn, spec, ldiag, vdiag)
%record(headerfm)  header;  %constinteger  basic header=18;  ! ** halfwords **

! formats associated with external linkage
%recordformat  namefm(%shortinteger  n1a,n1b,n2a,n2b)
%recordformat  xdeffm(%record(namefm)  n,  %integer  ep)
%recordformat  specfm(%integer  code, gla, link)
%recordformat  descriptionfm(%integer  base,disp,type,size,form,otype, %c
                        data size, %shortinteger  ident len, %string(12)  sym)
%record(descriptionfm)  xd

%integer  this proc;  this proc = 0
%integer  total blocks
%integer  op, cond, tag, extra
%integer  ref;  ref = 0
%integer  event link, ldiag link, vdiag link, defn link, spec link, asynch link
%integer  trace patch = 0;      ! point in perm to patch in jump to $TRACE
%integer  j,k,l

! =================== SYSTEM DEPENDENT =====================
%recordformat  parmfm(%shortinteger  dsno,dact,ssno,sact,   %c
                              %integer  p1,p2,p3,p4,p5,p6)
%owninteger    da key = 0
%constinteger  da read = 9,  da write = 10

%routine  open da(%string(31)%name  fd,  %integer  blocks)
%record(parmfm)  p,q
   string(addr(p_sact)) = fd;  svc(17,p);   ! pack
   %if p_p2 < 0 %start
      print string(fd."?");  newline
      %stop
   %finish
   q = p
   p_dact = 14;  svc(20,p);        ! delete
   p = q;  p_p5 = blocks
   p_dact = 2;  svc(20,p);         ! create
   %if p_p6 >= 0 %start
      p = q
      p_p5 = 1;                    !permit write
      p_dact = 6;  svc(20,p);      ! open da
      da key = p_p5 %and %return %if p_p6 >= 0
   %finish
   print string("open da: ".string(addr(p_p1)));  newline
   %stop
%end

%routine  close da
%record(parmfm)  p
   p_p5 = da key
   p_dact = 11;  svc(20,p)
   da key = 0
   %return %if p_p6 >= 0
   print string("close da: ".string(addr(p_p1))); newline
   %stop
%end
%routine  block io(%record(bfm)%name  block, %integer  iofn)
%record(parmfm)  p
   p_p4 = addr(block_b(0))
   p_p5 = da key
   p_p6 = block_block;    ! block number req'd
   p_dact = iofn;  svc(20,p)
   %return %if p_p6 >= 0
   print string("block io: ".string(addr(p_p1)));  write(block_block,1)
   newline
   %signal 15,15
%end
! ==========================================================

!  Initialise buffer pool
   buff list == null
   %for j = 1,1,bmax %cycle
      bp == buff list
      buff list == buffpool(j)
      buff list_block = -1;  buff list_link == bp
   %repeat

!  Initialise control records
%routine  set section(%record(sfm)%name  sect, %integer sect size,  %c
                      %record(hdfm)%name  hd)
   sect_zero addr = header size;  header size = header size + sect size
   sect_lower = 0
   sect_upper = sect size
   sect_ca = 0
   hd_p1 = sect_zero addr;  hd_p2 = 0
%end;     ! set section


   header size = basic header
   defns = defns*(3*2);                 ! 3 fullwords each
   specs = specs*(2*2);                  ! 2 fullwords each
   relocations = relocations*((2//2));     ! 1 halfword each
   literal size = (literal size + 3)&(\3);     ! double word align
   code size = code size + proc1_ca;   ! allow for prim

! N.B. == defn and spec are fullword aligned in output file ==
   set section(defn,defns,header_defn)
   set section(spec,specs,header_spec)
   set section(reloc,relocations,header_reloc)
   set section(ldiag,line diags,header_ldiag)
   set section(vdiag,var diags,header_vdiag)

   header size = (header size+3)&(\3);    ! align literals + code

   code_zero addr = header size + literal size
   code_lower = -literal size
   code_upper = code size
   code_ca = 0

   gla_zero addr = (code_zero addr + code size + h8 + 255)&(\255);  ! block align
   gla_lower = 0
   gla_upper = gla size
   gla_ca = 0

   header_registers = register template
   header_main ep = -1;      ! default: reset if a main program
   header_code disp = code_zero addr;   ! within-file disp.
   header_lit disp = header size;       ! within-file disp.
   header_pure size = code_zero addr + code size
   header_gla size = gla size 

   total blocks = (gla_zero addr + gla size + 255) >> 8

   header_reloc_p2 = relocations;      ! no. of halfwords
   header_defn_p2 = defns


%record(bfm)%map   buff(%integer addr)
%record(bfm)%name  this,last
%integer  block
   block = addr>>8;     ! ** N.B. halfword addressing units, 512 byte block **
   %result == buff list %if block = buff list_block
   buff miss1 = buff miss1+1;         ! *** monitoring only ***
   %if diagnostic < 0 %start
      printstring("block"); write(block,1); newline
   %finish
   last == buff list
   %cycle
      buff miss3 = buff miss3+1;      ! *** monitoring only ***
      this == last_link
      -> promote %if this_block = block
      %exit %if this_link == null
      last == this
   %repeat
   %if this_block < 0 %start;      ! buffer still free
      this_block = block
   %else
      block io(this,da write)
      this_block = block
      block io(this,da read)
      buff miss2 = buff miss2+1;      ! *** monitoring only ***
   %finish
promote:
   last_link == this_link
   this_link == buff list
   buff list == this
   %result == buff list
%end;          !  of 'buff'

%routine  flush buffers
%record(bfm)%name  this
%integer k
   this == buff(0)
   %if h8 # 0 %start
      this_b(0) = (header_pure size + h8 + 255)//256
      this_b(1) = (header_gla size + 255)//256
      this_b(2) = x'4321';         ! new format identifier
      this_b(3) = 0;  this_b(4) = 0;  this_b(5) = 0
      this_b(6) = 0;   ! flags
      this_b(7) = 0;   ! stack
   %finish
   %for k = 0,1,basic header-1 %cycle
      this_b(k+h8) = short integer(addr(header)+k*2)
   %repeat
   this == buff list
   %cycle
      block io(this,da write) %if this_block >= 0
      this == this_link
      %exit %if this == null
   %repeat
%end;      ! flush buffers

%routine  origin(%record(sfm)%name  section, %integer  org)
   %if diagnostic < 0 %start
      %if diagnostic <= -2 %start
         print string("ORG:");  write(org,1)
         write(section_lower,6);  write(section_upper,1)
         newline
      %finish
   %finish
   section_ca = org %and %return %if section_lower <= org <= section_upper
   error(25,org)
%end

%routine  put(%record(sfm)%name  section, %shortinteger  item)
%record(bfm)%name  bp
%integer addr
%owninteger  last = -1
   addr = section_zero addr + section_ca
   addr = addr + h8 %unless section == gla
   %if diagnostic < 0 %start
      %if diagnostic < -2 %start;      ! two-stage test for speed
         newline %if addr # last+1
         last = addr
         write(addr,4);  print string(":  ");  phex(item)
         newline
      %finish
   %finish
   bp == buff(addr)
   bp_b(addr&255) = item
   section_ca = section_ca + 1
%end;     ! of 'put'

%routine  put name(%record(sfm)%name  sect)
%integer  j;  %shortinteger  half
   %integerfn  ch(%integer  sym)
      %result = sym-'A'+1 %if 'A' <= sym <= 'Z'
      %result = sym-'a'+1 %if 'a' <= sym <= 'z';   ! ** lower case alphabet **
      %result = sym-'0'+27 %if '0' <= sym <= '9'
      %result = sym-'#'+37 %if '#' <= sym <= '%';  ! 37='#', 38='$', 39='%'
      %result = 0 %if sym = ' '
      %result = -1
   %end;      ! ch
   %routine  pack3(%integer  k, %shortintegername  n)
   %integer  p,q,r
      p = charno(xd_sym,k);  q = charno(xd_sym,k+1);  r = charno(xd_sym,k+2)
      n <- ( (ch(p)*40 + ch(q))*40 + ch(r) );      ! ugh!!!
   %end;      ! pack3
   charno(xd_sym,j) = ' ' %for j = length(xd_sym)+1,1,xd_ident len
   %for j = 1,3,xd_identlen-2 %cycle
      pack3(j,half);  put(sect,half)
   %repeat
%end;      ! put name

%routine  set description(%integer  desc type)
%integer  sym,j,k,l, char
   read symbol(k)
   l = k;  l = 12 %if l > 12
   length(xd_sym) = l
   %for j = 1,1,l %cycle
      readsymbol(char)
      char = char - 'a' + 'A' %if    %c
                                          'a' <= char <= 'z'
      charno(xd_sym,j) = char
   %repeat
   k = k-l
   skip symbol %and k = k-1 %while k > 0
   xd_ident len = 12;            ! assume full 12-character ident.
   %return %if desc type = proc header;      ! only ident. present
   xd_identlen = 6 %if l <= 6 %and desc type = diag entry
   read symbol(xd_otype)
   read symbol(k)
   xd_type = k>>4;  xd_form = k&15
   read symbol(j);  get(k)
   xd_base = j>>4
   xd_disp = (j&15)<<16 + (k&x'FFFF')
   %if diagnostic < 0 %start
      print string(xd_sym.": ");  write(xd_identlen,1)
      write(xd_base,1); write(xd_disp,4)
      write(xd_type,3); write(xd_form,1); write(xd_otype,1)
      newline
   %finish
%end;      ! set description

%routine  insert prims
%integer  j,k,l,m,to
   %for j = 1,1,max prim %cycle
      k = prim entry(j)
      %if k >= 0 %start
         %if diagnostic < 0 %start
            print string("prim");  write(j,1);  print symbol(' '); phex(k)
            newline
         %finish
         origin(code,proc1_base + prim entry(j))
         k = prim(j)
         to = k + prim(k) & x'7FFF';      ! strip 'align' bit
         %while k # to %cycle
            k = k+1;  m = prim(k)&x'FFFF'
            %if m&x'FFF0' # emark %start
               put(code,m)
            %else %if m = tmark;         ! trace routine external call
               trace patch = code_ca
               put(code,m)
            %else
               %if m&15 = 8 %start
                  put(code, jmp)
               %else
                  put(code, bal + (m&15)<<4)
               %finish
               k = k+1;  m = prim(k)
               l = prim entry(m);      ! pointer to referenced routine
               error(15,j) %if l < 0
               put(code,(proc1_base+l)*2);   ! byte displacement
            %finish
         %repeat
      %finish
   %repeat
   asynch link = prim entry(max prim);   ! *** must be last entry in perms ***
%end;       ! 'insert prims'

%routine  plant code ref
%integer  j,k,l,t,there
%record(deffm)%name  d
%switch format(SF:RX3)
   ref = ref+1;  t = reftype(ref)
   d == tagdef(tag)
   there = proc(d_proc)_base + d_ca + extra
   cond = cond+6 %if t&invert # 0
   op = long jump(cond) %if t&rcall = 0
   -> format(t&7)
format(SF):      ! short format
   sfjump = sfjump+1
   l = 0;  k = there-code_ca;   ! halfword disp. req'd here
   %if k < 0 %start
      l = backwards;  k = -k
   %finish
   error(200,code_ca) %if k > 15;   ! error in reference table
   put(code,(short jump(cond) !! l) + k)
   %return
format(RX1):
   rx1jump = rx1jump+1
format(RX3):
   rx13jump = rx13jump+1
   k = (there - proc1_base)*2;      ! byte disp. from code base
   put(code, op)
   %if t&7 = RX3 %start
      put(code, x'4000'!((k>>16)&15))
   %else
      error(201,code_ca) %unless 0 <= k <= 16383
   %finish
   put(code,k&x'FFFF')
   %return
format(RX2):
   rx2jump = rx2jump+1
   k = (there - (code_ca+4//2))*2
   error(202,code_ca) %unless -16384 <= k <= 16383
   put(code, op&(\15))
   put(code,halfword sign ! k)
%end;      ! 'plant code ref'

%routine  dump code
%owninteger  depth = 0
%integer  last line, last ca
%integer  code reset
%owninteger  lit reset;      ! no recursion!! - literals are not exbedded
%owninteger  last spec = 0, gla skip = 0
%record(procfm)%name  p
%integer  cca, lca, vca
%integer  k,c,half
%switch  dir(1:extern)
   depth = depth+1
   this proc = this proc+1
   p == proc(this proc)
   origin(code,p_base);  origin(ldiag,p_ldbase);  origin(vdiag,p_vdbase)
   last ca = code_ca;  last line = 0
   %if this proc # 1 %start;      ! its a recursive call
         ! DIAGS:  dump procedure line origin and identifier
      get(last line);  set description(proc header)
      %if diags # none %start
         k = last line
         k = 0 %if hide # 0
         put(ldiag,k);  put name(vdiag)
      %finish
   %else;   ! initial (non-recursive) call
      %if diags # none %start
         xd_sym = "PERM";  xd_identlen = 12
         put(ldiag,0);  put name(vdiag)
      %finish
      insert prims
      origin(code,proc1_base+proc1_ca-2)
      put(code,code_ca - event link);      ! link round perm
      event link = code_ca - 1
      put(code,x'8000');         ! dummy event mask
   %finish

   %cycle
      read symbol(c)
      -> dir(c) %if 0 < c <= extern
!!dir(*):
      error(12,c)

dir(proc head):
      read symbol(k);  error(13,k) %unless k = this proc
      cca = code_ca;  lca = ldiag_ca;  vca = vdiag_ca
      dump code
      origin(code,cca);  origin(ldiag,lca);  origin(vdiag,vca)
      %continue
dir(proc end):
      depth = depth-1
      %if depth # 0 %start;            !not in perm
            ! dump event chain
         put(code,code_ca-event link);   ! here relative link to preceding block
         event link = code_ca-1
         %if p_event mask = 0 %start
            put(code,p_display reg ! halfword sign)
         %else
            put(code,p_display reg)
            put(code,p_event mask)
            put(code,tagdef(p_event start)_ca + p_base)
            put(code,tagdef(p_event finish)_ca + p_base)
         %finish
      %finish
         ! dump line diag. table link
!!!!!!!!!!      last line = -line diag limit-1
      %if diagnostic < 0 %start
         write(ldiag_ca,1)
         write(p_ldbase,1);  write(p_ldsize,1); newline
      %finish
      %if diags = full %start
         %if depth = 0 %start;                  !special for perm
            put(ldiag, proc1_ldsize)
            put(vdiag, proc1_vdsize)
         %else
            put(ldiag, ldiag_ca-ldiag link);      ! relative to here
            ldiag link = ldiag_ca - 1
            put(vdiag, vdiag_ca-vdiag link);      !  ... ditto ...
            vdiag link = vdiag_ca - 1
         %finish
         k = p_ld base + p_ld size;  put(ldiag,0) %while ldiag_ca # k;   ! zero
      %finish
      %return
dir(code area):
      lit reset = code_ca
      code_ca = code reset
      %continue
dir(lit area):
      code reset = code_ca
      code_ca = lit reset
      %continue
dir(lit org):
      get(half)
      lit reset = -half
      %continue
dir(code item):
      get(half)
      put(code,half)
      %continue
dir(gla item):
      get(half)
      gla skip = gla skip-1 %and %continue %if gla skip # 0
      put(gla,half)
      %continue
dir(gla rel):
      ! Assumed to immediately follow the dumping of the GLA full-word to
      ! which it refers.
      put(reloc,gla_ca-2);      ! N.B. -2 halfwords = -4 bytes
      %continue
dir(code rel):
      ! As for GLA REL but modifies a word in gla according to the value of
      ! code base at load time
      put(reloc,(gla_ca-2)+1);   ! N.B ** odd-numbered halfword => code seg **
      %continue
dir(frame patch):
      origin(code,code_ca-1)
      put(code,p_static frame);      ! bytes if TRUSTED else fullwords
      %continue
dir(c ref):
dir(j ref): ! jumps
      skip symbol;      ! 'code item'
      get(half)
      cond = half&15;  tag = half>>4
      extra = 0;   ! to match r ref path!!
      plant code ref
      %continue
dir(r ref): ! procedure calls (including %begin-%end blocks)
      get(tag)
      skip symbol;      ! 'code item'
      get(op)
      skip symbol;      ! 'code item'
      get(extra)
      cond = 0
      plant code ref
      %continue
dir(p ref):      ! prim call
      skip symbol;      ! 'code item'
      get(op)
      skip symbol;      ! 'code item'
      get(k)
      error(15,k) %unless 0 < k <= max prim
      put(code,op)
      put(code,prim entry(k)*2 );      ! byte disp.
      %continue
dir(sw ref):
      skip symbol;      ! 'code item'
      get(tag)
      k = tag def(tag)_ca;  k = k + p_base %if k # 0
      put(code,k);                  ! N.B. halfwords relative to code base
      %continue

dir(line reset):
      get(half)
      current line = half-1;      ! * see below *
dir(line diag):
      current line = current line + 1
      %if diagnostic < 0 %start
         print string("line");  write(current line,1);  write(code_ca,1)
         newline
      %finish
      ca incr = code_ca - last ca
      %continue %if ca incr = 0
      line incr = current line - last line
      %unless 0 <= line incr <= line diag limit %start
         put(ldiag, (current line-1) ! halfword sign ) %if diags = full
         line incr = 1
      %finish
      put(ldiag, ca incr*(line diag limit+1) + line incr) %if diags = full
      last line = current line
      last ca = code_ca
      %continue

dir(var diag):
      set description(diag entry)
      %if diags = full %start
         k = ((xd_type&7)<<4 + xd_base&15)<<4 + (xd_disp>>16)
         k = k!halfword sign %if xd_identlen # 12;      ! ...%if a short ident
         k = k!indirect %if xd_form = 2;         ! %name variable
         k = k!x'2000' %if xd_type&8 # 0
         put(vdiag,k);  put(vdiag,xd_disp&x'FFFF')
         put name(vdiag)
      %finish
      %continue

dir(extern):

!                 <=== word 1 =====> <======== word 2 ======> <== word 3 =>
!                 ------------------ ------------ ----------- -------------
!   Proc spec:   | link to previous | identifier : self-link | x'00000000' |
!                 ------------------ ------------ ----------- -------------

!                 ------------------ ------------ ----------- -------------
!   Data spec    | link to previous | identifier : ????????? | x'80000000' |
!                 ------------------ ------------ ----------- -------------

      read symbol(c);      ! type of cross reference
      get(xd_data size)
      set description(linkage name)
      gla skip = 0
      %if c = ep defn %or c = data defn %start
         k = xd_disp
         %if c = ep defn %start
            k = code_ca
            %if xd_sym = main ep %start
               p_display reg = p_display reg ! main prog
               header_main ep = k
            %finish
         %finish
         put(defn, defn link);  defn link = header_defn_p1 + defn_ca-1;   ! file relative
         put(defn, k)
         put name(defn)
      %else %if c = ep spec %or c = data spec
         %if trace patch # 0 %and xd_sym = trace ep %start
            c = code_ca
            origin(code,trace patch)
            put(code,gla_ca*2);      !halfwords note.
            origin(code,c)
         %finish
         k = header_spec_p1 + spec_ca;      ! file relative
         put name(spec)
         put(gla,spec link>>16);  put(gla,spec link);   ! gla relative back link
         spec link = gla_ca - 2
         put(gla,k)
         put(gla,gla_ca-3);         ! halfword disp. of this block into GLA
         %if c = data spec %start
            put(gla, -1);  put(gla, -1)
         %else
            put(gla, 0);  put(gla, 0)
         %finish
         gla skip = 6;              ! half words
      %else
         error(170,c)
      %finish
      %continue

   %repeat
%end;           ! of 'dump code'

   select input(object)
   open da(IMPCOM_file,total blocks)
!!!!   read symbol(j);  put(gla,x'7FFF') %for j = 1,1,j;      ! init gla
! Dual standard meantime for first words in gla
   read symbol(j);  put(gla,x'7FFF') %for j = 1,1,j-2
   put(gla,0); put(gla,0)

   read symbol(j);  error(17,j) %if j < init lit;   ! pass2 INIT LIT value
   current line = 0
   event link = -1
   ldiag link = proc1_ldsize-1
   vdiag link = proc1_vdsize-1
   defn link = 0
   spec link = 0
   dump code
   readsymbol(j)
   error(-2,j) %unless j = prog end
   origin(code,-init lit);      ! = -4:  must always dump the exact number
   put(code,0);                  ! *** padding ***
   put(code,asynch link);      ! signal relative to code base
   put(code,header_code disp);      ! code base addr - file start addr
   put(code,event link)
   %if diags # full %start;         ! no links embedded in tables!!!
      %if diags = partial %start
         header_ldiag_p1 = header_ldiag_p1 ! halfword sign
         ldiag link = this proc*(2//2);            ! halfword size: for use below
         vdiag link = this proc*8//2;            ! ditto
      %else;                             !  'none'
         header_ldiag_p1 = 0;            ! no diag tables present
      %finish
   %finish
   header_ldiag_p2 = ldiag link;   ! ldiag_p1+ldiag_p2 => start of chain
   header_vdiag_p2 = vdiag link
   header_spec_p2 = spec link;                     ! GLA relative
   header_defn_p2 = defn link;                     ! N.B. FILE relative
   flush buffers
   close da
%end;           !   phase two

!========================================================================
   diags = (IMPCOM_flags >> 8)&7;      ! * * * * SYSTEM DEPENDENT * * * *
   hide  = IMPCOM_flags&x'0800'
!========================================================================


   select output(report)
   t0 = cpu time;      ! *** monitoring only ***
   diags = full %if diags > full
   phase one
   t1 = cpu time;      ! *** monitoring only ***
   phase two
   t2 = cpu time;      ! *** monitoring only ***
   IMPCOM_code = (code size+literal size-proc1_ca)*2
   IMPCOM_perm = proc1_ca*2
   IMPCOM_gla = gla size*2
   IMPCOM_diags = (line diags+var diags)*2

!   print string("Jumps:")
!   write(sfjump,1); print string(" SF +")
!   write(rx1jump,1); print string(" RX1 +")
!   write(rx2jump,1); print string(" RX2 +")
!   write(rx13jump-rx1jump,1); print string(" RX3 =")
!   write(sfjump+rx2jump+rx13jump,1)
!   newline;  print string("Diagnostic Tables (bytes):")
!   print string("  line");  write(line diags*2,1)
!   print string(", ident");  write(var diags*2,1)
!   newlines(2)
!   print string("Millisecs: phase1 ");  write(t1-t0,1)
!   print string("  phase2");  write(t2-t1,1)
!   newline
!   %if local tot # 0 %and global tot # 0 %start
!      print string("Stretching - safe/total (%)  local:")
!      write( (local tot-local nonsafe)*100//local tot, 4)
!      print string("  global:")
!      write( (global tot-global nonsafe)*100//global tot,4)
!      newline
!   %finish
!   spaces(15)
!   print string("millisecs:");  write(t11-t10,14);  write(t12-t11,13)
!   newline
!   print string("Total output (halfwords):")
!   write(code size+literal size+gla size+var diags+line diags, 1)
!   newline
!   print string("Disc buffer: searches");  write(buff miss1,1)
!   print string("  cache misses");  write(buff miss2,1)
!   newline
!   print string("Mean search length=");  print(buff miss3/buff miss1,1,2)
!   newline

%endofprogram
 H?   b b                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !!!!!   19/6/79

!  Program to generate numerical form of perm to be edited onto
!  the start of third phase of IMP compiler.
!
%begin
   %constinteger  input=1, output=1
   %constinteger  record length = 126
   %owninteger f = 0
   %integer ca, c,j,k,count
   %shortintegerarray core(-1:2000)
!
%routinespec  new record
!
   %integerfn  byte
   %integer  s
      new record %if count = 0
      count = count-1;  read symbol(s)
      %result = s
   %end
   %routine skip(%integer n)
      %integer k
      %while n > 0 %cycle
         k = byte;  n = n-1
      %repeat
   %end
   %integerfn word
      %result = byte<<8+byte
   %end
   %routine new record
      %integer s
      s = byte %while count > 0
      count = record length
      f = 0
      s = word&x'FFFF';  s = word&x'FFFF';  ! ...sequence and checksum
   %end
   %routine hex(%integer n)
      %integer j,k
      printstring('x''')
      %cycle j  = 1,1,4
         k = n>>12&15;  n = n<<4
         %if k > 9 %then k = k-10+'A' %else k = k+'0'
         printsymbol(k)
      %repeat
      printsymbol('''')
   %end
   %routine dump
      %integer j,k
      j = 1
      %cycle
         %cycle k = 1,1,9
            hex(core(j));  j = j+1
            %return %if j = ca
            printsymbol(',')
         %repeat
         newline
      %repeat
   %end
   %switch lc(0:x'60')
   selectinput(input);  selectoutput(output)
   ca = -1
   count = 0;  new record
   %cycle
      c = byte
      %if c >= x'20' %start
         k = c-x'1F'
         c = 16
      %finish
      ->lc(c)
lc(0):new record;  %continue
lc(5):skip(3);  %continue
lc(15):skip(8);  %continue
lc(24):skip(6);  %continue
lc(10):core(ca) = word&x'FFFF';  ca = ca+1
lc(28):
lc(7):core(ca) = word&x'FFFF';  ca = ca+1
      %continue
lc(16):%cycle j = 1,1,k
      core(ca) = word&x'FFFF';  ca = ca+1
      %repeat
   %repeat
lc(1):
   printstring('%constshortinteger  max prim =');  write(core(0),1)
   print string('
%constshortintegerarray prim(1:');  write(ca-1,0);  printstring(') = %c
')
   dump
   newline
   selectoutput(0)
   printstring('code =');  write((ca-1)*2,1);  printstring(' bytes
')
%endofprogram
 H?    	.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ** 8-MAR-81
IMPPERM PROG IMP PERM FOR MOUSES      V1.02
 SPACE
*************************************************************
*
*   BECAUSE OF BRILLIANT HARDWARE DESIGN BY INTERDATA INC. IN THE 
* AREA OF THE CONDITION CODE SETTING FOLLOWING AN UNSIGNED ('LOGICAL') 
* COMPARISON, THE SEQUENCE:
*         CLR  INDEX,LIMIT
*         BNP  AGAIN
* WON'T WORK AND CANNOT BE MADE TO IN ANY SENSIBLE FASHION.  THE
* FRIG APPLIED UNIFORMLY THROUGHOUT IS TO PERVERT THE ABOVE INTO:
*         CLR  LIMIT,INDEX
*         BNL  AGAIN
*
*************************************************************
 SPACE 4
* CONVENTIONS:
* 1)   ALL STRING ROUTINES CHECK THE LENGTH OF THEIR RESULT AGAINST A
*      LIMIT HELD AT 0(LINK).  A ZERO VALUE HERE IS TAKEN TO SIGNIFY A 
*      %NAME TYPE PARAMETER WITH THE LIMIT PACKED IN THE TOP BYTE.
*      IT IS LEFT TO INDIVIDUAL ROUTINES TO EXTRACT THIS BYTE.
 EJECT
 SQUEZ 99
 CROSS
 PURE
 SPACE
ALIEN EQU 1 * ASSEMBLE FOR OLD IMP STANDARDS
 SPACE
R0 EQU 0
R1 EQU 1
R2 EQU 2
R3 EQU 3
R4 EQU 4
R5 EQU 5
R6 EQU 6
R7 EQU 7
R8 EQU 8
R9 EQU 9
R10 EQU 10
R11 EQU 11
R12 EQU 12
R13 EQU 13
R14 EQU 14
R15 EQU 15
 SPACE
FPR0 EQU 0
FPR2 EQU 2
 SPACE 3
* COMPILER REGISTER CONVENTIONS
* -----------------------------
WSP EQU R7 * WORK SPACE (STACK) POINTER
CODE EQU R14 * CODE BASE REGISTER
GLA EQU R13 * STATIC DATA BASE REGISTER
LINK EQU R15 * SUBROUTINE LINK REGISTER
P1 EQU R6
P2 EQU R5
* ---THE FOLLOWING ARE DISPLACEMENTS ABOVE (WSP)---
P3 EQU 4*11
P4 EQU 4*12
P5 EQU 4*13
P6 EQU 4*14
 SPACE
FRAME EQU 44 * BASIC STACK FRAME SIZE
 SPACE
* PRE-ALLOCATED GLA LOCATIONS
* ---------------------------
STKLIMIT EQU 0 * WORK-SPACE UPPER BOUND
DUMMY EQU 4 * USED MEANTIME BY IOCP
EVENTREC EQU 8 * POINTER TO EVENT RECORD(=0 IF NONE)
INITGLA EQU 12 * FIRST COMPILER-GENERATED ENTRY
 SPACE
* SOME EXTRA REGISTER NAMES
* -------------------------
COUNT EQU R0
INDEX EQU R1
DATA EQU R1
RHS EQU R1
LHS EQU R2
 SPACE 2
* ASSORTED CONSTANTS
* ------------------
NL EQU 10 * ASCII NEWLINE CHARACTER
MINFREE EQU 512 * MINIMUM USEABLE VALUE OF (LIMIT-WSP)
 SPACE
UNASS1 EQU X'80' * 1-BYTE UNASSIGNED PATTERN
UNASS2 EQU X'8080' * 2-BYTE UNASSIGNED PATTERN
UNASS4 EQU Y'80808080' * 4-BYTE UNASSIGNED PATTERN
 SPACE
TMARK EQU X'8887' * [$]TRACE'S EXTERNAL REFERENCE IN GLA
 EJECT
$DEF,RTN,[--------];
$DEF,ROUTINE,[@\1 DC Z(.\1)$UPDATE,RTN,\1;];
$DEF,ALIGNEDROUTINE,[
 IFZ *-PERMBEG&3 * TO ENSURE ERROR-FREE ASSEMBLY
 DC Z(0)
 ENDC
@\1 DC Z(.\1+X'8000')$UPDATE,RTN,\1;];
$DEF,END,[.$RTN; EQU *-@$RTN;-2/2
[$]$RTN; EQU @$RTN;-PERMBEG/2-1
 SPACE 3];
$DEF,CHAINTO,[ DC X'8888' * ..ENTER '@\1'
 DC Z(\1)];
$DEF,CALL,[ DC Z(X'8880'+\1) * CALL '\2'
 DC Z(\2)];
$DEF,PRIM,[
\1 EQU *-PVECTOR/2 *  PRIM ENTRY \2
 DC Z([$]\1)];
$DEF,DUMMY,[ DC H'0' *         DUMMY ENTRY \1];
$DEF,PERM,[
\1 EQU *-PVECTOR/2 * USER-CALLABLE PERM ROUTINE
 DC Z([$]\1)];
$DEF,EVENT,[
\1 EQU \2*256+\3];
$DEF,ENTER,[ LHI R4,\1 *    %-- ENTER \1 ---
 L R3,SIMEP(GLA)
 BR R3
];
$DEF,IF,[$\1,$DEF,\1,\3;$DEF,\2,\4;;];
$DEF,SIGNAL,[ LI R0,\1/256
 LI R1,\1&255
 $CALL,R3,ASYNCH1;
];
* DEFINE SIGNAL CODE NOS.
* -----------------------
 SPACE
* OVERFLOW:
$EVENT,IOV,1,1; * INTEGER OVERFLOW
$EVENT,FLOV,1,2; * FLOATING POINT OVERFLOW
$EVENT,STOV,1,3; * STRING OVERFLOW
$EVENT,ZDIV,1,4; * ZERO DIVIDE
$EVENT,ICEX,1,5; * INTEGER CAPACITY EXCEEDED
$EVENT,FCEX,1,6; * FLOATING . . . . . . .
$EVENT,SCEX,1,7; * STRING . . . . . .
 SPACE
* EXCESS RESOURCE:
$EVENT,EXB,2,1; * NOT ENOUGH STORE
$EVENT,EXO,2,2; * OUTPUT EXCEEDED
$EVENT,EXT,2,3; * TIME EXCEEDED
 SPACE
* DATA ERROR:
$EVENT,SID,3,1; * SYMBOL IN DATA
 SPACE
* CORRUPT DATA:
$EVENT,DTE,4,1; * DATA TRANSMISSION ERROR
$EVENT,FVC,4,2; * %FOR CONTROL VARIABLE CORRUPT
$EVENT,CDE,4,3; * CORRUPT DOPE VECTOR
 SPACE
* INVALID ARGUMENTS:
$EVENT,FPI,5,1; * %FOR PARAMETERS ILLEGAL
$EVENT,EXPI,5,2; * ILLEGAL EXPONENT
$EVENT,AIO,5,3; * ARRAY INSIDE-OUT
$EVENT,SSE,5,4; * SUBSTRING() ERROR   (LENGTH<0)
$EVENT,IPRM,5,5; * ILLEGAL PARAMETER
$EVENT,ISP,5,6; * ILLEGAL SHIFT PARAMETER
 SPACE
* OUT-OF-RANGE:
$EVENT,ABE,6,2; * ARRAY BOUNDS EXCEEDED
$EVENT,SBE,6,3; * SWITCH BOUNDS EXCEEDED
$EVENT,EVI,6,4; * ILLEGAL EVENT SIGNAL
$EVENT,CLEX,6,5; * CHARNO: LENGTH EXCEEDED
$EVENT,TOST,6,6; * TOSTRING: SYMBOL OUT OF RANGE
 SPACE
* RESOLUTION:
$EVENT,SRF,7,0; * STRING RESOLUTION FAILED
 SPACE
* UNDEFINED VALUE:
$EVENT,UAV,8,1; * UNNASSIGNED VARIABLE
$EVENT,SLNS,8,2; * SWITCH LABEL NOT SET
 SPACE
* I/O ERROR:
$EVENT,INE,9,1; * INPUT ENDED
$EVENT,SND,9,2; * STREAM NOT DEFINED
 SPACE
* 10:  LIBRARY PROCEDURE ERROR
* 11-15: GENERAL PURPOSE
 SPACE
$EVENT,MISSING,11,11; * PERM ROUTINE MISSING
$DEF,MISSING,[
 SPACE 2
* ======= UNDEFINED ========
 $SIGNAL,MISSING;
* =========================
 SPACE
];
 SPACE 10
* EXTRACODES INTERPRETED BY RUN-TIME SYSTEM
* -----------------------------------------
CALLDIAG EQU X'8101' * FORCE ENTRY TO DIAGNOSTIC PACKAGE
RECOVER EQU X'8102' * ENTER EXTERNALLY-SUPPLIED 'ASYNCH' ROUTINE
 EJECT
* PERM HEADER CELLS AND ENTRY VECTOR
* ----------------------------------
PERMBEG DC Z(PERMSIZE)
PVECTOR DC Z(MAXEP) * NO. OF CELLS IN ENTRY VECTOR
* ------START OF ENTRY VECTOR PROPER------
*  **** 'ASSCHK' MUST BE FIRST IN ENTRY LIST BELOW ****
$PERM,ASSCHK;
$PERM,IEXP;
$PERM,FEXP;
$PERM,SMOVE;
$PERM,SJAM;
$PERM,SCONC;
$PERM,SRESLN;
$PERM,SRESV;
$PERM,SCOMP;
$PERM,FRCPT;
$PERM,SFCAP;
$PERM,SUBSTR;
$PERM,AREF1;
$PERM,AREF2;
$PERM,AREF3;
$PERM,AREF4;
$PERM,SETDV;
$PERM,ALLOC;
$PERM,SWJUMP;
$PERM,SIGNAL;
$PERM,MULCHK;
$PERM,CAP16;
$PERM,CAP8;
$PERM,FCHK1;
$PERM,FCHK2;
$PERM,PENTC;
$PERM,RCOPY;
$PERM,RZERO;
$PERM,VSCHK;
$PERM,SMOVOPT;
$PERM,CHMAP;
$PERM,FREESP;
$PERM,INT;
$PERM,RCOMP;
$PERM,SETCOM;
$PERM,SETUNI;
$PERM,SETDIF;
$PERM,SETINT;
$DUMMY,39;
$DUMMY,40;
$DUMMY,41;
$DUMMY,42;
$DUMMY,43;
$DUMMY,44;
$DUMMY,45;
$DUMMY,46;
$DUMMY,47;
$DUMMY,48;
$PERM,IOCP;
$PERM,TRACE;
* **** N.B.  THESE LAST ENTRIES ARE INVISIBLE TO COMPILER CODE ****
$PERM,ASYNCH2;
$PERM,ASYNCH1;
MAXEP EQU *-PVECTOR/2-1
 EJECT
* SOURCE: 0(R1)   DEST: 0(R2), 0(LINK) = MAX. LENGTH OF RESULT
* CORRUPTS: R0,R3,R4
$ROUTINE,SMOVE;
 LH R0,0(LINK) * LIMIT FOR RESULT LENGTH
 BNZ SMOVE.0 * NOT %NAME
 EXHR R0,R2 * EXTRACT TOP BYTE
 EXBR R0,R0
SMOVE.0 LBR R0,R0 * LENGTH TO 8 BITS
 LB R3,0(R1)
 CLHI R3,UNASS1
 BNE SMOVE.1
 CLB R3,1(R1)
 BNE SMOVE.1
 $SIGNAL,UAV;
SMOVE.1 CLR R0,R3 * LIMIT >= ACTUAL ?
 BNL SMOVE.2 * %NOT NO (== YES)  ->
 $SIGNAL,SCEX;
SMOVE.2 AIS LINK,2 * SKIP OVER MAX LENGTH
 $CHAINTO,SMOVOPT;
$END;
* FAST STRING MOVE:  NO CHECK ON PARAMETERS.  CALLED DIRECTLY WHERE IT
* IS KNOWN AN ERROR ISN'T POSSIBLE AND ALSO BY OPTIMIZER.
* USED AS A 'BRAINLESS' COPY ROUTINE WHEN PASSING 'P IN R' STRING
* PARAMETER IN CONJUNCTION WITH 'SPCHK' BELOW.
* NO STRING COPY IS PERFORMED IF R1 = R2:
* AS WELL AS THE OBVIOUS SPEED UP WHEN THE STRING IS ALREADY
* IN THE RIGHT PLACE THIS ALLOWS 'SMOVE' WITH R1=R2 TO BE USED
* TO PERFORM THE CHECKS WITH NO UNDUE OVERHEAD.
* SOURCE: 0(R1)  DEST: 0(R2)
* CORRUPTS: R0,R3,R4
$ROUTINE,SMOVOPT;
 CLR R1,R2
 BER LINK * FASTER - ALSO PERMITS CHECK ONLY
 LB R3,0(R1) * LOGICAL LENGTH OF STRING
* 'BC' BELOW RESULTS IN JUMP ON 0 TO -1 TRANSITION!!
* AIS R3,1 * INCLUDE LENGTH CELL
 EXBR R3,R3
 EXHR R4,R3 * LENGTH << 24
 LI R3,Y'FF000001' * DECREMENT COUNT, INCREMENT ADDRESS
SMVOPT.1 LB R0,0(R1,R4)
 STB R0,0(R2,R4)
 AR R4,R3
 BC SMVOPT.1
 BR LINK * N.B. NO LENGTH CHECK HALF WORD IF OPTIMISING
$END;
*  SOURCE:  0(R1)     DEST: 0(R2)   0(LINK) = MAX LENGTH OF RESULT
*  CORRUPTS:  R0, R3, R4
$ROUTINE,SJAM;
 LH R0,0(LINK)
 BNZ SJAM.0
 EXHR R0,R2
 EXBR R0,R0
SJAM.0 LBR R0,R0
 LB R3,0(R1)
 CLHI R3,UNASS1
 BNE SJAM.1
 CLB R3,1(R1)
 BNE SJAM.1
 $SIGNAL,UAV;
SJAM.1 LIS R4,0
 CLR R0,R3
 BNL SJAM.2
 LR R3,R0 * TRUNCATE
 B SJAM.3
SJAM.2 LB R0,0(R1,R4) * --- COULD BE TIGHTER ---
SJAM.3 STB R0,0(R2,R4)
 AIS R4,1
 SIS R3,1
 BNM SJAM.2
 B 2(LINK)
$END;
* SOURCE:  0(R1), R0 = MAX. LENGTH OF RESULT
* DEST:    0(R2)
* CORRUPTS: R0,R1,R3,R4,R5
$ROUTINE,SCONC;
 LH R0,0(LINK)
 BNZ SCONC.0
 EXHR R0,R2
 EXBR R0,R0
SCONC.0 LBR R0,R0
 LB R3,0(R1)
 CLHI R3,UNASS1
 BNE SCONC.2
 CLB R3,1(R1)
 BNE SCONC.2
SCONC.1 $SIGNAL,UAV;
SCONC.2 LB R4,0(R2)
 CLHI R4,UNASS1
 BNE SCONC.3
 CLB R4,1(R2)
 BE SCONC.1
SCONC.3 AR R4,R3 * TOTAL RESULT LENGTH
 CLHI R4,256 * TOO LONG TO REPRESENT ?
 BL SCONC.31 * NO    ->
 $SIGNAL,STOV;
SCONC.31 SR R0,R4 * WILL FIT IN L.H.S ?
 BNM SCONC.4 * YES   ->
 $SIGNAL,SCEX;
SCONC.4 STB R4,0(R2) * SET FINAL LENGTH
 SR R4,R3 * RESTORE R4 FOR BELOW
 AR R4,R2 * POINT TO APPEND CHARACTERS
 LIS R5,0
 B SCONC.6
SCONC.5 LB R0,1(R1,R5)
 STB R0,1(R4,R5)
 AIS R5,1
SCONC.6 SIS R3,1
 BNM SCONC.5
 B 2(LINK)
$END;
* SOURCE:  0(R1), 0(R2)
* DEST:    SETS CONDITION CODE
* CORRUPTS: R0,R3,R4,R5
$ROUTINE,SCOMP;
 LIS R4,1 * USED WAY DOWN BELOW
 LB R3,0(R1)
 LB R0,0(R2)
 SR R3,R0
 BNM SCOMP2
 AR R0,R3
 B SCOMP2
SCOMP1 LB R5,0(R1,R4)
 CLB R5,0(R2,R4)
 BNER LINK
 AIS R4,1
SCOMP2 SIS R0,1
 BNM SCOMP1
 LR R3,R3 * ...SET CONDITION CODE ACCORDING TO LENGTHS
 BR LINK
$END;
* REGISTER ASSUMPTIONS
*       R1:   = @B
*       R2:   = @A
*       R3:   = @SOURCE
*       R4:   = @C
*       R5:   = MAX. LENGTH OF 'A'
*       R6:   = MAX. LENGTH OF 'C'
* CORRUPTS:  R0, R5, R6, 0(WSP):15(WSP)
$ROUTINE,SRESLN;  * STRING RESOLUTION
LIMIT EQU 11
J EQU 12
K EQU 13
L EQU 14
*  *** LINK MUST BE UNCHANGED SO DIAGS WORK ***
 LHL R5,0(LINK) * R5 = LIMIT(A)<<8 + LIMIT(C)
 EXBR R6,R5 * R6 = LIMIT(C)<<8 + LIMIT(A)
 SRLS R5,8
 BNZ SRES.A * VALUE PARAMETER: LENGTH SPECIFIED IN-LINE
 EXHR R5,R2 *  NAME PARAMETER: EXTRACT LENGTH FROM TOP BYTE
 EXBR R5,R5
SRES.A LBR R5,R5
 SRLS R6,8
 BNZ SRES.C
 EXHR R6,R4
 EXBR R6,R6
SRES.C LBR R6,R6
 STM LIMIT,0(WSP)
 LB LIMIT,0(R3) * SOURCE LENGTH
 CLHI LIMIT,UNASS1
 BNE SRES.1
 CLB LIMIT,1(R3)
 BE SRES.UN * SOURCE STRING UNASSIGNED
SRES.1 LB R0,0(R1) * LENGTH OF 'B'
 CLHI R0,UNASS1
 BNE SRES.2
 CLB R0,1(R1)
 BNE SRES.2 * 'B' ISN'T UNASSIGNED
 SPACE
SRES.UN $SIGNAL,UAV;
 SPACE
SRES.2 SR LIMIT,R0 * LIMIT = LENGTH(SOURCE) - LENGTH(B)
 BM SRES.ERR
 SPACE
 LIS J,0
 LR R0,R0 * = LENGTH(B)
 BZ SRES.4 * B = "" GIVES IMMEDIATE MATCH
SRES.30 LB R0,1(R1) * = CHARNO(B,1)
SRES.31 CLB R0,1(R3,J) * CHARNO(SOURCE,J) = CHARNO(B,1) ?
 BE SRES.32 * YES  ->
SRES.98 AIS J,1
 CLR LIMIT,J * ANOTHER CHARACTER LEFT
 BNL SRES.31 * YES
 B SRES.ERR * NO  -> FAIL
SRES.99 LB R0,1(R1) * RELOAD FIRST CHAR. TO MATCH
 B SRES.98 * GO TRY NEXT 
SRES.32 LR L,R3 * REDUCE TRIPLE ...
 AR L,J * ... TO DOUBLE INDEXING BELOW
 LB K,0(R1) * K = LENGTH(B): (K>0)
 SIS K,1
SRES.33 LB R0,1(L,K) * = CHARNO(SOURCE,J+K)
 CLB R0,1(R1,K) * = CHARNO(B,K)
 BNE SRES.99
 SIS K,1
 BP SRES.33
 SPACE
SRES.4 LR R2,R2 * 'A' SPECIFIED ?
 BZ SRES.41 * NO  ->
 CLR R5,J * 'A' TOO BIG FOR DESTINATION ?
 BL SRES.CAP * YES  ->
 SPACE
SRES.41 LR K,J * LENGTH(A) -> K
 LR R4,R4 'C' SPECIFIED ?
 BZ SRES.42 * NO  ->
 LB R0,0(R1) * NOW CHECK 'C' ...
 AR J,R0 * J = J + LENGTH(B)
 LB L,0(R3)
 SR L,J * L = L + LENGTH(SOURCE) - J
 CLR R6,L * 'C' TOO BIG ?
 BL SRES.CAP * YES  ->
SRES.42 EQU *
 SPACE
SRES.5 LR R2,R2 * 'A' SPECIFIED ?
 BZ SRES.6 *  NO     ->
 STB K,0(R2) * LENGTH(A)
 B SRES.52
SRES.51 LB R0,1(R3,K) * MOVE 'A'
 STB R0,1(R2,K)
SRES.52 SIS K,1
 BNM SRES.51
 SPACE
SRES.6 LR R4,R4 * MUST COPY FORWARD IN CASE C == SOURCE
 BZ SRES.7 * NO DESTINATION SPECIFIED
 STB L,0(R4) * LENGTH(C) = L
 AR J,R3 * TRIPLE INDEXING AGAIN
 LIS K,0
 B SRES.62
SRES.61 LB R0,1(J,K) * = CHARNO(SOURCE,J+K)
 STB R0,1(R4,K) * = CHARNO(C,K)
 AIS K,1
SRES.62 SIS L,1
 BNM SRES.61
 SPACE
SRES.7 LCS R0,1 * NON-ZERO COND CODE => SUCCESS
SRES.71 LM LIMIT,0(WSP)
 B 2(LINK)
 SPACE
SRES.ERR LIS R0,0 * ZERO COND CODE => FAILURE
 B SRES.71
 SPACE
SRES.CAP LM LIMIT,0(WSP)
 $SIGNAL,SCEX;
$END;
* TESTS FOR ZERO CONDITION CODE
* CORRUPTS NOTHING
$ROUTINE,SRESV;
 BNZR LINK * SUCCESS:    ->
 $SIGNAL,SRF;
$END;
* IN:
*      R1 = @SOURCE STRING, R2 = FIRST INDEX, R3 = SECOND INDEX
* OUT:
*      RESULT STRING AT  0(R1)
* CORRUPTS:
*      R0, R1, R2, R3, COND CODE
$ROUTINE,SUBSTR;
 LB R0,0(R1)
 CLHI R0,UNASS1
 BNE SUBSTR.1
 CLB R0,1(R1)
 BNE SUBSTR.1
 $SIGNAL,UAV;
SUBSTR.1 LR R2,R2 * FROM <= 0
 BNP SUBSTR.2 * YES  ->
 CLR R0,R3 * TO > CURRENT SOURCE LENGTH ?
 BL SUBSTR.2 * YES   ->
 SHI R3,-1(R2) * N  (=FROM-TO+1)  >= 0 ?
 BNM SUBSTR.3 * YES  ->
SUBSTR.2 LR R4,R3
 $SIGNAL,SSE;
SUBSTR.3 AR R2,R1
 LHI R1,0(WSP)
 STB R3,0(R1)
 B SUBSTR.5
SUBSTR.4 LB R0,0(R2,R3)
 STB R0,1(R1,R3)
SUBSTR.5 SIS R3,1
 BNM SUBSTR.4
 BR LINK
$END;
* SOURCE: (4*R3) BYTES AT 0(R1)      (SPECIFIED IN 4-BYTE UNITS)
* DEST:   0(R2)
* CORRUPTS: R0, R3
$ROUTINE,RCOPY;
 SLLS R3,2 * WORDS => BYTES
   B RCOPY.2
RCOPY.1 L R0,0(R1,R3)
 ST R0,0(R2,R3)
RCOPY.2 SIS R3,4
 BNM RCOPY.1
 BR LINK
$END;
* DEST: (4*R3) BYTES AT 0(R2)
* CORRUPTS: R0, R3
$ROUTINE,RZERO;
 SLLS R3,2
 LIS R0,0
 B RZERO.2
RZERO.1 ST R0,0(R2,R3)
RZERO.2 SIS R3,4
 BNM RZERO.1
 BR LINK
$END;
$ROUTINE,RCOMP;
 SR R4,R4
RCOMP.1 LB R0,0(R1,R4)
 CLB R0,0(R2,R4)
 BNER LINK
 AIS R4,1
 CLR R4,R3
 BNE RCOMP.1
 BR LINK
$END;
* R1 = INDEX, R2 = @SWITCH VECTOR
* N.B. TRANSFERS CONTROL SO REGISTER CORRUPTION IS IRRELEVANT
$ROUTINE,SWJUMP;
 LR R3,INDEX
 CH R3,2(LHS) * ...UPPER BOUND
 BP SWJUMP1
 SH R3,0(LHS)
 BM SWJUMP1
 AR  R3,R3 * DOUBLE THE DISPLACEMENT
 LHL R3,4(R3,LHS) * GET VECTOR ELEMENT
 BZ SWJUMP2 * ...NOT SET?   --  YES   ->
 AR R3,R3 * DOUBLE IT: HALFWORDS -> BYTES
 AR R3,CODE * ADD IN CODE BASE
 BR R3
SWJUMP1 LR R2,INDEX * FOR DIAGNOSTICS
 $SIGNAL,SBE;
SWJUMP2 LR R2,INDEX * FOR DIAGNOSTICS
 $SIGNAL,SLNS;
$END;
*          IN                 OUT
* R1    ------             @A(0) - @A(FIRST)
* R3    ------             TOTAL SIZE (BYTES, ROUNDED UP TO FULLWORD)
* R4     @DV                 @DV
* 0(LINK) DIMENSION          -----
* 2(LINK) ELEMENT SIZE       -----
* CORRUPTS: R0,R2
* DV = <DIMENSION><LB1><UB1><MULT1><LB2><UB2><MULT2> ....<LBN><UBN><DATA SIZE>
*         ?                   ?                ?                       ?
*  ? = FILLED IN BY SETDV ROUTINE
$ROUTINE,SETDV;
 STM R9,0(WSP)
 LIS R3,1 * FOR TOTAL SIZE
 LIS R1,0 * FOR DISP OF A(0)
 LH R9,0(LINK) * DIMENSION
 LR R11,R4 
 LH R10,2(LINK) * ELEMENT SIZE
SETDV.1 L R12,8(R11)
 S R12,4(R11)
 AIS R12,1
 BM SETDV.9 * NULL ARRAY PERMITTED
 ST R12,0(R11)
 MR R0,R12
 S R1,4(R11)
 MR R2,R12
 AIS R11,3*4
 SIS R9,1 * DONE ?
 BNZ SETDV.1 *  NO:    ->
 ST R10,0(R11) * LAST MULTIPLIER IS DATA SIZE
 MR R0,R10
 MR R2,R10
 AIS R3,3
 NHI R3,-4
 LH R12,0(LINK) * DIMENSION
 ST R12,0(R4) * PLUG INTO DV
 LM R9,0(WSP)
 B 4(LINK)
SETDV.9 LR R4,R11 * FOR DIAGNOSTICS
 LM R9,0(WSP) * RESTORE TEMPS
 $SIGNAL,AIO;
$END;
*           IN                     OUT
* R1    @A(0) - @A(FIRST)        UNCHANGED
* R2    @HEADER                  UNCHANGED
* R3    TOTAL SIZE(BYTES)        UNCHANGED
* R4    @DV                      UNCHANGED
* CORRUPTS R0, R5
$ROUTINE,ALLOC;
 LR R0,WSP
 AR R0,R3
 IFZ ALIEN * RUNNING IN NATIVE SUBSYSTEM 
 L R5,STKLIMIT(GLA)
 C R0,0(R5)
 ELSE
 C R0,STKLIMIT(GLA)
 ENDC
 BNP ALLOC.1
 $SIGNAL,EXB;
ALLOC.1 AR WSP,R1
 ST WSP,0(R2) * @A(0)
 ST R4,4(R2) * @DV
 AIS R2,2*4 * PROTECT THIS HEADER
 LR WSP,R0
 L R0,UNASS(CODE)
 CLI R0,UNASS4 * UNASSIGNED CHECK ON ?
 BNER LINK * NO   ->
 LIS R5,0 * YES  - CLEAR OUT ARRAY
 SR R5,R3 * NEGATE
 BZR LINK * NOTHING TO DO
ALLOC.2 ST R0,0(WSP,R5)
 AIS R5,4
 BNZ ALLOC.2
 BR LINK
$END;
 EJECT
* INTEGER EXPONENT:
*      R1 = R3\\R2
*   CORRUPTS: R0,R1,R2
$ROUTINE,IEXP;
 LR R2,R2
 BNM IEXP1
* EXPONENT IS IN 'R2' AT THIS POINT
 $SIGNAL,EXPI;
IEXP1 LIS R0,1
 LIS R1,1
 B IEXP3
IEXP2 MR R0,R3
IEXP3 SIS R2,1
 BNM IEXP2
 $CHAINTO,MULCHK;
$END;
* FLOATING EXPONENT:
*      FR2 = FR2**R1
*   CORRUPTS: R0,FR0,FR2
$ROUTINE,FEXP;
 LIS R0,1
 FLR FPR0,R0
 LR R0,R1 * ...NO. OF ITERATIONS IN R0
 BNM FEXP.1 * ...TO ZERO OR +VE POWER   ->
 DER FPR0,FPR2
 LER FPR2,FPR0
 LIS R0,0
 SHI R0,1(R1)
* NOTE THAT THE LOOP COUNT IS REDUCED BY ONE TO ALLOW FOR THE
* FACT THAT 'FPR0' = 1/X NOT 1 WHEN THIS PATH IS TAKEN.
FEXP.1 BZR LINK
 MER FPR0,FPR2
 SIS R0,1
 B FEXP.1
$END;
* IMP 'FRAC PT' ROUTINE:
* INPUT PARAMETER:   FPR2
* OUTPUT:            FPR2
* CORRUPTS:  FPR0, FPR2
* NOTE THAT THIS MUST BE ALIGNED IN FINAL PRIM PACKAGE, NOT
* NECESSARILY IN TERMS OF ASSEMBLER OUTPUT.  (SEE PASS 3)
$ALIGNEDROUTINE,FRCPT;
 LER FPR0,FPR2
 BM FRCPT.1
 AE FPR0,UNZERO * GET RID OF FRACTION BITS
 B FRCPT.2
FRCPT.1 SE FPR0,UNZERO
 AE FPR2,FPONE
FRCPT.2 LER FPR0,FPR0 * RE-NORMALISE
 SER FPR2,FPR0 * FRAC PT
 BR LINK
* PAD HERE IF NEED BE TO KEEP THESE CONSTANTS ALIGNED
UNZERO DC X'4600',X'0000' * UN-NORMALISED ZERO
FPONE DC X'4110',X'0000' * =E'1'
$END;
* IMP 'INT' ROUTINE:
* INPUT PARAMETER:     FPR2
* OUTPUT:                R1
* CORRUPTS:            R1, FPR2
*    ALIGNMENT IS REQUIRED AS IN 'FRAC PT' ABOVE.
$ALIGNEDROUTINE,INT;
 LER FPR2,FPR2
 BM INT.1
 AE FPR2,POINT5
 B INT.2
INT.1 SE FPR2,POINT5
INT.2 FXR R1,FPR2
 BR LINK
 DC Z(0)   * PADDING
POINT5 DC X'4080',X'0000'
$END;
* CHECKED IMP CHARNO MAP:
*      SOURCE: STRING AT 0(R1), R2=INDEX
*              0(LINK) = MAX STRING LENGTH
*      DEST:   RESULT STRING AT 0(R1)
*      CORRUPTS: R0, R1
$ROUTINE,CHMAP;
 LH R0,0(LINK)
 BNZ CHMAP.1
 EXHR R0,R1
 EXBR R0,R0
CHMAP.1 LBR R0,R0
 LR R2,R2
 BNP CHMAP.9
 CLR R0,R2
 BL CHMAP.9
 LA R1,0(R1,R2) * REMOVE LENGTH BITS
 B 2(LINK)
CHMAP.9 $SIGNAL,CLEX;
$END;
* RESULT:   ADDR IN R1
* CORRUPTS: R1
$ROUTINE,FREESP;
 L R1,STKLIMIT(GLA)
 IFZ ALIEN
 L R1,0(R1) * GLA HOLDS POINTER TO POINTER
 ENDC
 SHI R1,MINFREE(WSP)
 BNMR LINK
 $SIGNAL,EXB;
$END;
 EJECT
* DIAGNOSTIC-RELATED ITEMS
* ------------------------
 SPACE 2
* UNASSIGNED CHECK ROUTINE:    *** MUST BE AT 0(CODE) ***
* CORRUPTS NOTHING
$ROUTINE,ASSCHK;
ASSCHK.0 BNER LINK
 $SIGNAL,UAV;
 DC Z(0) * *****PADDING *******
ASSCHK.1 DC Y'80808080'
UNASS EQU ASSCHK.1-ASSCHK.0 * DISPLACEMENT INTO CODE OF UNASS. PATTERN
$END;
* CHECK '%FOR' PARAMETERS:
* R0 = INITIAL VALUE, R1 = FINAL VALUE, R2 = INCREMENT
* ** N.B. THE  R0  VALUE IS IN FACT (IV-INC)
* CORRUPTS: R0,R1,CONDITION CODE
$ROUTINE,FCHK1;
 LR R2,R2 * INC = 0 ?
 BZ FTEST1 * YES  ->
 SR R1,R0 *  FV - (IV-INC)
 LR R0,R1
 SRA R0,31
 DR R0,R2 * (FV - IV + INC)/INC
 LR R1,R1 * QUOTIENT (+1)  < 0    ?
 BM FTEST1 *  ... < 0    ->
 LR R0,R0 * ...REMAINDER
 BZR LINK * ... = 0   ->
FTEST1 $SIGNAL,FPI;
$END;
* TEST CORRUPTION OF '%FOR' CONTROL VARIABLE:
*      TESTS FOR ZERO CONDITION CODE
*      CHANGES NOTHING
$ROUTINE,FCHK2;
 BER LINK
 $SIGNAL,FVC;
$END;
* TRUNCATION CHECK FOR BYTE ASSIGNMENT:
*      TESTS FOR ZERO CONDITION CODE
*      CHANGES NOTHING
$ROUTINE,CAP8;
 BZR LINK
 $SIGNAL,ICEX;
$END;
* TRUNCATION CHECK FOR HALF-WORD ASSIGNMENT - NO REGISTERS CHANGED
$ROUTINE,CAP16;
 BNOR LINK
 $SIGNAL,ICEX;
$END;
* STRING FUNCTION CAPACITY TEST:
*      CORRUPTS CONDITIONS CODE
$ROUTINE,SFCAP;
 CLB R0,0(R1)
 BNLR LINK
 $SIGNAL,SCEX;
$END;
* CHECK VARIABLE SHIFT
* TEST 0 <= R2 <= 31:  CORRUPTS NOTHING
$ROUTINE,VSCHK;
 THI R2,-32
 BZR LINK
 $SIGNAL,ISP;
$END;
* CHECK FOR OVERFLOW ON INTEGER MULTIPLY
*      INPUT:     VALUE IN (R0)
*      CORRUPTS:  R0
$ROUTINE,MULCHK;
 LR R0,R0
 BZR LINK * BITS 64:32 = 0 ?
 AIS R0,1
 BZR LINK * BITS 64:32 = ALL 1'S ?
 $SIGNAL,IOV;
$END;
 EJECT
* CHECKED 1-D ARRAY REF:  R0,R1,R2 CHANGED
$ROUTINE,AREF1;
 L R2,4(R3) * @ DOPE VECTOR
 C R1,4(R2) * TEST LOWER BOUND
 BM AREF1.9
 C R1,8(R2) * TEST UPPER BOUND
 BP AREF1.9
 M R0,12(R2) * MULTIPLY BY DATA SIZE
 A R1,0(R3)
 BR LINK
AREF1.9 LR R4,R2 * FOR DIAGNOSTICS
 LR R2,R1 * DITTO
 $SIGNAL,ABE;
$END;
* CHECKED 2-D ARRAY REF:  CHANGES R0,R1,R4
$ROUTINE,AREF2;
 L R4,4(R3)
 C R1,4(R4)
 BM AREF2.8
 C R1,8(R4)
 BP AREF2.8
 M R0,12(R4) * FIRST MULTIPLIER
 C R2,16(R4)
 BM AREF2.7
 C R2,20(R4)
 BP AREF2.7
 AR R1,R2
 M R0,24(R4) *  ...*DATA SIZE ( AS SECOND MULTIPLIER )
 A R1,0(R3) *  ... + @A(0,0)
 BR LINK
AREF2.7 LR R1,R2
 AIS R4,12 * POINT DIAGS TO RIGHT BIT OF DV
AREF2.8 LR R2,R1
 $SIGNAL,ABE;
$END;
* GENERAL ARRAY ACCESS:
* R1 = FIRST SUBSCRIPT
* R2 = ADDR(SUBSCRIPTS 2:N) IN STORE (BACKWARDS)
* R3 = ADDR(HEADER)
* CORRUPTS:  R0,R1,R4,R5
$ROUTINE,AREF3;
 L R5,4(R3) * POINT TO DOPE VECTOR
 L R4,0(R5) * DIMENSION
 SIS R4,1 * DIM-1
 SLLS R4,2 *    X 4
 AR R4,R2 * POINT PAST END OF SUBSCRIPT LIST
 LR R0,R1
 LIS R1,0 * CLEAR ACCUMULATOR
AREF3.1 SIS R4,4 * POINT TO SUBSCRIPT FOR %NEXT ITERATION
 C R0,4(R5) * CHECK %THIS SUBSCRIPT
 BM AREF3.9
 C R0,8(R5)
 BP AREF3.9
 AR R1,R0
 M R0,12(R5)
 AIS R5,12
 L R0,0(R4) * SUBSCRIPT FOR NEXT ITERATION
 CLR R4,R2 * OFF END OF SUBSCRIPT LIST ?
 BNL AREF3.1 * NO      ->
 A R1,0(R3) *    + @A(0)
 BR LINK
AREF3.9 LR R4,R5 * FOR DIAGNOSTICS
 LR R2,R0 * DITTO
 $SIGNAL,ABE;
$END;
* UNCHECKED 2-D ARRAY REF:  CORRUPTS R0,R1,R4
$ROUTINE,AREF4;
 L R4,4(R3)
 M R0,12(R4)
 AR R1,R2
 M R0,24(R4)
 A R1,0(R3)
 BR LINK
$END;
* CHECKED PROCEDURE ENTRY:
* INPUT:  TWO DISPLACEMENTS INTO NEW STACK FRAME DEFINE START AND END OF
*         NON-PARAMETER LOCAL VARIABLES.
*         0(LINK):  START DISP:  (IN BYTES)
*         2(LINK):  END DISP:    (IN FULL WORDS) ***** N.B. ******
*      CORRUPTS R2, R3, R4
$ROUTINE,PENTC;
 LR R4,WSP
 LH R4,0(LINK) * LOWER (BYTES)
 LHL R2,2(LINK) * UPPER (FULL WORDS)
 SLLS R2,2 *  ... BYTES NOW
 SR R4,R2 * - SIZE OF AREA TO CLEAR
 AR R2,WSP * WSP-TO-BE
 L R3,STKLIMIT(GLA)
 IFZ ALIEN
 L R3,0(R3)
 ENDC
 CLI R3,MINFREE(R2)
 BNL PENTC.1
 $SIGNAL,EXB;
PENTC.1 AIS LINK,4
 LR WSP,R2
  LI R3,UNASS4
 CL R3,UNASS(CODE)
 BNER LINK
PENTC.2 ST R3,0(WSP,R4)
 AIS R4,4
 BNP PENTC.2
 BR LINK
$END;
* USER PROGRAM SIGNAL ROUTINE
* REGISTERS:  R0: EVENT
*             R1: SUB-EVENT
*             R2: EXTRA
$ROUTINE,SIGNAL;
 $CALL,3,ASYNCH1;
$END;
 EJECT
* ITEMS WHICH INTERFACE WITH OPERATING SYSTEM
* -------------------------------------------
* BASIC ROUTINE TO PASS SIGNAL PARAMETERS ON TO A SINGLE INSTANCE OF
* THE ROUTINE BELOW (ASYNCH1) CONTAINED IN THE STANDARD RUN-TIME SUBSYSTEM.
$ROUTINE,ASYNCH2;
 STM R0,FRAME(WSP)
 LR P1,WSP
 AHI WSP,16*4+FRAME * PROTECT IT
 DC Z(RECOVER)
$END;
* ROUTINE TO HANDLE (POTENTIALLY) ASYNCHRONOUS EVENTS AND SEARCH FOR
* APPROPRIATE EVENT RECOVERY BLOCK:
*    ASSUMED LAYOUT OF EVENT BLOCK:   (HALFWORDS)
*               0:  LINK
*               2:  DISPLAY REG (X'8000' => NO TRAPS HERE)
*                               (X'4000' => LAST BLOCK)
*               4:  EVENT MASK
*               6:  %START OF EVENT BLOCK (HALFWORD DISP FROM CODE BASE)
*               8:  %FINISH . . . . . . . . . . . . . . . . . . . . .
* ON ENTRY PARAMS ARE AS FOLLOWS:
*      R0, R1, R2:   EVENT, SUB-EVENT, EXTRA
*              R3:   PC AT POINT OF FAILURE
*        R7 - R15:   AS ACCORDING TO COMPILER STANDARDS
 SPACE
AD EQU R3
EV EQU R4
NEXT EQU R5 * (ALSO MISUSED AS LOCAL FRAME BASE)
THIS EQU R6
NEWWSP EQU R10
$ROUTINE,ASYNCH1;
 STM R0,FRAME(WSP)
 L R4,EVENTREC(GLA)
 BZ NOREC
 ST R0,0(R4)
 ST R1,4(R4)
 ST R2,8(R4)
NOREC LHI NEWWSP,5*4+FRAME(WSP)
 LR R1,R0 * EVENT NO
 LIS EV,1
 SLL EV,0(R1) * SET MASK BIT
* ** N.B. R3 (AD) SET TO FAILURE PC BY ENVIRONMENT **
 LR R1,AD
 BAL R2,FIND
 LR NEXT,NEXT * TRAP FROM WITHIN PERM ?
 BNM SIGN.0 * NO   ->
 LR AD,LINK * YES: USE LINK (R15) INSTEAD OF PC
 SPACE
SIGN.1 LR R1,AD
 BAL R2,FIND
SIGN.0 LH R2,2(THIS) * DISPLAY REG + FLAGS
 LBR NEXT,R2 * ISOLATE CURRENT FRAME BASE REGISTER
 SLLS NEXT,2 *     X 4
 L NEXT,-5*4(NEWWSP,NEXT) * VALUE OF FRAME BASE POINTER
 LR R2,R2
 BM SIGN.2 * NOTHING TRAPPED IN THIS BLOCK
 LHL R1,8(THIS)
 AR R1,R1 * TO BYTES
 AR R1,CODE
 CR AD,R1 * ABOVE %FINISH OF EVENT BLOCK ?
 BNP SIGN.2 * YES:  ->  **PSR**
 LH R1,4(THIS) * EVENTS-TRAPPED-HERE MASK
 NR R1,EV * ANY USE ?
 BZ SIGN.2 * NO:  ->
 SPACE
* ENTER REQUIRED %EVENT BLOCK
 LM R7,8(NEWWSP) * REQUIRED CONTEXT
 LHL R1,6(THIS) * EVENT %START DISP.
 AR R1,R1 * TO BYTES
 AR R1,CODE * RELATIVE TO CODE BASE
 BR R1 * ENTER EVENT BLOCK
 SPACE
SIGN.2 THI R2,X'4000' * MAIN PROGRAM: TIME TO STOP ?
 BNZ SIGN.4 * YES:  ->
SIGN.3 L AD,LINK-R5*4(NEXT) * FOLLOW RETURN LINK
 L CODE,CODE-R5*4(NEXT)
 LR NEWWSP,NEXT
 B SIGN.1
 SPACE
* ENTER MDIAGS
SIGN.4 LM R0,FRAME(WSP)
 DC Z(CALLDIAG) * TRAP THIS AS ILLEGAL INSTRUCTION
 SPACE
* 'FIND' ROUTINE USED BY 'ASYNCH' TO LOCATE BLOCK CONTAINING ABSOLUTE
* ADDRESS HELD IN R1.  SETS R5 (NEXT) TO TOP AND R6 (THIS) TO BOTTOM
* ABORTS BY SIGNALLING 'BLOCK CANNOT BE LOCATED' IF THIS IS THE CASE.
* RETURN LINK IN R2.
FIND LHL THIS,-2(CODE)
 AR THIS,THIS * TO BYTES
 SR R1,CODE * CONVERT PARAM TO BYTE DISP FROM CODE
FIND.1 LHL R0,0(THIS,CODE)
 AR R0,R0 * BYTE DISP
 LR NEXT,THIS
 SR NEXT,R0
 CR R1,THIS * R1 > THIS ?
 BP FIND.2 * YES:   ->
 CR R1,NEXT * R1 > NEXT
 BP FIND.3 * SUCCESS:  IN PERM IFF NEXT < 0
FIND.2 LR THIS,NEXT
 BNM FIND.1
 SPACE
* FAILURE:  FORCE ENTRY TO MDIAG:   EVENT 0,15
 LM R0,FRAME(WSP)
 LIS R0,0
 LIS R1,15
 DC Z(CALLDIAG) * FORCE DIAG ENTRY: EVENT 0,15
 SPACE
* SUCCESS
FIND.3 LR NEXT,NEXT
 BMR R2 * IN PERM
 AR THIS,CODE * BACK TO ABSOLUTE ADDRESSES
 BR R2
$END;
* TEMPORARY I/O INTERFACE ROUTINE:
*       ASSUME IT CORRUPTS EVERYTING
$ROUTINE,IOCP;
 L R3,DUMMY(GLA)
 LR R12,R8 * **** ASSUMES NOT CALLED FROM LEVEL 5 ****
 BALR R8,R3
 LR R8,R12
 BR R15
$END;
* CALL A USER-SUPPLIED TRACE ROUTINE.
* ON ENTRY: P1 (R6) = LINE NO. IN SOURCE PROGRAM,
*           P2 (R5) = CORRESPONDING ADDRESS IN CODE
* USER ROUTINE SHOULD THEREFORE HAVE THE HEADING:
*   %SYSTEMROUTINE  TRACE(%INTEGER LINE NO, ADDRESS)
$ROUTINE,TRACE;
 LH P1,0(LINK) * PICK UP LINE NO
 AIS LINK,2
 LR P2,LINK * TRACE ENTERED FROM ADDRESS...
 STM 5,0(WSP) * FUDGE UP EXTERNAL CALL
 DC Z(X'D1D0'+GLA) *  LM R13, ???? (GLA)
 DC Z(TMARK) *  = = = = PATCHED IN BY PASS 3 = = = =
 LR R2,R15
 LR R15,P2 * FIX UP FINAL RETURN ADDRESS
 BR R2 * GO ENTER USER TRACE ROUTINE
$END;
$ROUTINE,SETCOM;
*SET COMPARISON
*ENTRY:   LHI R1,LHS
*         LHI R2,RHS
*         BAL LINK,SETCOM
*         <MASK>       0=,  1>=,  2<
**
*REPLY:   R6 = FALSE/TRUE
**
 LIS R0,0 *CLEAR MASK
 LHI R3,28 *TO COUNT ROUND 8 WORDS (256 BITS)
SETC.0 L R4,0(R1,R3)   *LHS BITS
       L R5,0(R2,R3)   *RHS BITS
       LR R6,R5
       NR R6,R4 * A&B
       CR R6,R4
       BE SETC.1
       OHI R0,1   * A # A&B
SETC.1 CR R6,R5
       BE SETC.2
       OHI R0,2   * B # A&B
SETC.2 SIS R3,4   *BACK FOR NEXT WORD
       BNM SETC.0
       LIS R6,0   * FALSE
       CLH R0,0(LINK)
       BNE SETC.3
       LIS R6,1   * TRUE
SETC.3 B 2(LINK)   * RETURN
$END;
$ROUTINE,SETUNI;
*SET UNION: A = A!B
*ENTRY:   LHI R1,A
*         LHI R2,B
*         BAL LINK,SETUNI
**
         LHI R3,28
SETU.0   L R0,0(R1,R3)
         O R0,0(R2,R3)
         ST R0,0(R1,R3)
         SIS R3,4
         BNM SETU.0
         BR LINK
$END;
$ROUTINE,SETDIF;
*SET DIFFERENCE: A = A-B
*ENTRY:   LHI R1,A
*         LHI R2,B
*         BAL LINK,SETDIF
**
         LHI R3,28
SETD.0   LCS R0,1
         X R0,0(R2,R3)
         N R0,0(R1,R3)
         ST R0,0(R1,R3)
         SIS R3,4
         BNM SETD.0
         BR LINK
$END;
$ROUTINE,SETINT;
*SET INTERSECTION
*CALL:    LHI R1,A
*         LHI R2,B
*         BAL LINK,SETINT
**
         LHI R3,28
SETI.0   L R0,0(R1,R3)
         N R0,0(R2,R3)
         ST R0,0(R1,R3)
         SIS R3,4
         BNM SETI.0
         BR LINK
$END;
PERMSIZE EQU *-PERMBEG/2-1
 END
$*END*;
$*END*;
 H?   5 5	4                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %constinteger  nl=10
%conststring(1) snl="
"
%primintegerfnspec rem(%integer p,q)
%primroutinespec  readsymbol(%name p)
%primrealfnspec float(%integer n)
%primstring(1)%fnspec tostring(%integer p)
%primstring(255)%fnspec substring(%string(255) s,%integer f,t)
%primintegerfnspec  free space
%primroutinespec  svc(%integer n,%record(*)%name r)
%primintegerfnspec addr(%name p)
%primintegermapspec integer(%integer n)
%primshortintegermapspec shortinteger(%integer n)
%primbyteintegermapspec byteinteger(%integer n)
%primstring(*)%mapspec  string(%integer n)
%primrecord(*)%mapspec record(%integer n)
%primrealmapspec real(%integer n)
%primlongrealmapspec longreal(%integer n)
%primbyteintegermapspec length(%string(255) s)
%primbyteintegermapspec charno(%string(255) s,%integer n)
%primintegerfnspec int(%real x)
%primintegerfnspec intpt(%real x)
%primroutinespec  iocp(%integer n)
%primintegerfnspec typeof(%name n)
%primintegerfnspec sizeof(%name n)
%primrealfnspec fracpt(%real x)
%externalroutinespec prompt(%string(15)  S)
%externalintegerfnspec next symbol
%externalroutinespec  skip symbol
%externalroutinespec  print symbol(%integer sym)
%externalroutinespec  print string(%string(255)  s)
%externalroutinespec  write(%integer  v,p)
%externalroutinespec  select input(%integer  n)
%externalroutinespec  select output(%integer  n)
%externalroutinespec  open input(%integer  n, %string(31) fd)
%externalroutinespec open output(%integer  n,%string(31) fd)
%externalroutinespec  close input
%externalroutinespec  close output
%externalroutinespec reset input
%externalroutinespec reset output
%externalstring(8)%fnspec  time
%externalstring(9)%fnspec  date
%externalintegerfnspec  cpu time
%externalintegermapspec comreg(%integer  n)
%externalroutinespec read(%name  x)
%externalroutinespec  print(%real  val, %integer  before, after)
%externalroutinespec  print fl(%real val, %integer  places)
%externalroutinespec space
%externalroutinespec  spaces(%integer  n)
%externalroutinespec  newline
%externalroutinespec  newlines(%integer n)
%recordformat  filefm(%integer  unit,owner,N1,N2)
%recordformat  parmfm(%short dsno,dact,ssno,sact, 
                        (%string(23) text %or
                        (%record(filefm) file %or %integer  P1,P2,P3,P4),
                         %integer P5,P6) )
%recordformat  eventfm(%integer  event, sub, extra,
                       %string(63)  message,
                       %integer  pc, x)
%externalrecord(eventfm)%spec  event
%endofperm
 H?    	j                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    permgen perms.rel/$perm
permit pass3.imp=d
e pass3.imp,$perm/pass3.imp
f/max prim/pkpk
(v/x/k)0
%s
m0
%c
permit pass3.imp=g
delete perms.rel
purge
sysexe:imp(trusted) pass3.imp
 H?    	p                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       %endoflist
%conststring(8)%array text(0:255) = %c
"Z","VDEC","OWNVDEC","EXTVSPEC","ADEC","OWNADEC",
"EXTASPEC","PROC","PROCSPEC","FORMDEC","SWDEC","LDEC",
"FORMSPEC","","","","","",
"OPTION","COMMA","T","COLON","COMMENT","LB",
"ALIAS","RB","SUB","ARRAYD","STYPE","ARRAY",
"NAME","PROCD","FNMAP","SWITCH","OWN","EXTERNAL",
"STRING","RECORD","FORMAT","SPEC","MCODE","LABEL",
"OP1","OP2","OP3","SIGN","UOP","MOD",
"DOT","COMP","ACOMP","EQ","EQEQ","JAM",
"JUMP","RESOP","AND","OR","NOT","WHILE",
"UNTIL","FOR","CWORD","EXIT","ON","SIGNAL",
"THEN","START","ELSE","FINISH","FELSE","CYCLE",
"REPEAT","PROGRAM","BEGIN","END","ENDPROG","ENDPERM",
"FRESULT","MRESULT","BACK","MONITOR","STOP","LIST",
"REALSLN","CONTROL","INCLUDE","MASS","RTYPE","ADDOP",
"IDENT","V","N","CONST","FM","",
"R","F","M","P","RP","FP",
"MP","PP","L","S","A","AN",
"NA","NAN","","","","",
"","","","","","",
"%MSTART","%CLEAR","%PRED","","%DUBIOUS","%DUP",
"%PIN","%POUT","%EDUP","","PIDENT","CIDENT",
"OIDENT","FNAME","SWID","DOTL","DOTR","ASEP",
"CSEP","OSEP","PSEP","ARB","BPLRB","ORB",
"PRB","CRB","RCRB","RECRB","RECLB","LAB",
"MLAB","SLAB","XNAME","OWNT","DBSEP","PCONST",
"CMOD","CSIGN","CUOP","COP1","COP2","COP3",
"INDEF","XELSE","CRESOP","NLAB","RUNTIL","ACONST",
"ORRB","FMANY","OSTRING","FMLB","FMRB","FMOR",
"RANGERB","FSID","","","","",
"","%DUMMY","%DECL","%TYPE","%ZERO","%APPLY",
"%PROT","%SETPROT","%PTYPE","%GAPP","%LOCAL","%GUARD",
"%MCODE","%CDUMMY","%SETTYPE","%OPER","%PARAM","%BLOCK",
"%OTHER","%COMPILE","APP","BASEAPP","APP2","APP3",
"APP4","APP5","APP6","ADEFN","NPARM","SWDEF",
"SWIDS","CIEXP","RCONST","SCONST","ARRAYP","XIMP",
"IMP","COND","SCOND","EXP1","EXP2","SEXP",
"IEXP","IEXP1","IEXP2","ISEXP","SEQ","FDEF",
"EXP","NARRAYP","STRUCT","RESEXP","BPL","CONSTB",
"FITEM","MOREA","CLIST","FPP","FPP0","FPP1",
"FPP2","INITVAR","RECEXP","EIMP","IDENTS","RANGE",
"RCONSTB","VARP","INITDEC","","","",
"ESCDEC","ESCPROC","ESCARRAY","ESCREC"
%constinteger gmax1=719
%owninteger gmax=719
%constinteger imp phrase =25

%ownshortintegerarray phrase(200:255) = %C
   0, 564, 565, 567, 569, 571, 573, 562,
 614, 203, 200, 602, 478, 480, 624, 298,
 206, 308, 318, 433, 426, 437, 444, 458,
 453, 461, 467, 482, 402, 627, 629, 603,
 521, 511, 486, 502, 575, 527, 528, 543,
 550, 578, 397, 287, 197, 636, 516, 621,
 167,   0,   0,   0, 640, 693, 701, 709

%constbyteintegerarray atomic(130:179) = %c
  90,  90,  90,  90,  90,  48,  48,  19,
  19,  19,  19,  25,  25,  25,  25,  25,
  25,  25,  23, 104, 104, 105,  30,  20,
  21,  93,  47,  45,  46,  42,  43,  44,
  40,  68,  55, 104,  60,  93,  25,  40,
  93,  23,  25,  57,  25,  90, 176, 177,
 178, 179

!  FLAG<1> 0<1> SS<2> 0<3> T<1> LINK<8>
%constshortintegerarray initial(0:119) = %c
      24,       0,       0,       0,       0,       0,       0,       0,
       0,       0,       0,       0,       0,       0,       0,       0,
       0,       0,      23,       0,       0,       0,       0,       0,
       0,       0,       0,       0,       0,       0,       0,       0,
       0,       0,       0,       0,       0,       0,       0,       0,
      20,       0,       0,       0,       0,       0,       0,       0,
       0,       0,       0,       0,       0,       0,  -32551,       0,
       0,       0,       0,      13,       0,      14,       4,  -32557,
      16,  -32550,       0,       0,       5,       6,       3,      12,
      15,       8,       7,       9,      10,      11,  -32558,  -32554,
  -32559,  -32552,  -32553,      18,      22,      17,      21,      19,
       0,       0,       0,  -32562,  -32560,       0,       0,       0,
  -32561,       0,       0,       0,       0,       0,       0,       0,
       1,       2,       0,  -32556,       0,  -32555,       0,       0,
       0,       0,       0,       0,       0,       0,       0,       0

!  MORE<1> 0<1> ORDER<2> TYPE<4> CLASS<8>
%ownshortintegerarray gram(0:max grammar) = %c
       0,  -28523,  -28521,  -28602,  -32706,  -28509,  -28603,  -24502,
  -24503,  -20405,  -20404,  -28595,  -32697,  -32709,  -16323,  -28600,
  -32704,  -28587,  -28589,  -32681,  -16344,  -28586,  -28588,  -12270,
  -32586,     216,  -12287,  -16380,   -8185,   -8184,  -12285,  -12286,
  -12283,  -12282,  -12279,  -12276,  -16373,   20490,  -32706,  -32701,
     216,  -16364,  -28610,  -28613,  -28612,   16445,     217,  -16364,
      62,  -32701,   16450,  -16364,    5346,  -16364,     166,  -16344,
    4332,     130,  -16360,  -16361,     126,     217,  -32701,     216,
  -16364,   16450,  -32700,   16404,  -32701,  -32706,     216,   16405,
   16407,  -16222,    8414,     130,     217,  -32697,   16450,    1250,
    4307,    4318,     192,      93,     170,      90,     207,  -16365,
   16404,      90,  -16360,  -16365,   16404,     241,  -16365,   16404,
     132,     132,  -16360,    4329,  -16365,   16404,     133,     175,
      90,  -16365,   16404,     209,  -16365,   16404,    4313,     217,
   16451,    4263,   16384,   16384,     120,     216,  -32700,   16404,
  -32706,   16404,     243,   16409,     454,  -32685,   16404,     454,
     248,  -16365,   16404,    4263,     194,  -16360,    4329,  -32717,
   16404,    4263,   16407,     454,     237,     127,     215,     454,
    4263,   16384,  -16364,    1502,  -32629,  -16361,     153,  -32606,
     222,     143,  -32629,     153,     454,     126,   16409,     454,
   16384,     234,  -16365,  -32595,     147,  -32678,     234,     193,
  -32677,  -32676,  -32661,     109,  -32717,      53,      52,      52,
      52,     194,     194,     194,  -28581,    4188,     194,  -28566,
    4203,     194,  -28564,    4205,    4580,   16429,     183,     183,
     186,     186,  -28583,       0,    9437,      90,  -16365,       0,
     134,  -16365,       0,     210,    4329,     199,  -32677,  -32672,
  -32676,  -32688,  -32690,  -32705,  -32661,  -32659,  -32689,  -32686,
  -32687,  -16330,      65,  -32716,     186,  -28583,  -32717,  -32715,
  -32713,      52,  -32664,    4201,     186,  -32717,  -32715,      55,
  -16328,       0,     197,     197,      52,      52,     197,  -28581,
  -28580,     186,  -28581,    4188,    4318,     194,  -28581,    4188,
    9437,     194,     194,     454,   16407,     216,     194,  -28566,
  -28565,     186,  -28566,    4203,     194,  -28564,  -28563,     186,
  -28564,    4205,     183,     183,     186,     183,  -16365,       0,
     183,    4580,   16429,    5095,    9444,    5348,     186,  -28583,
  -16328,       0,   16409,  -16365,       0,    9437,    5348,     217,
  -32701,   16450,  -32701,     216,  -32700,       0,  -32701,  -32706,
     216,     243,     217,  -16318,       0,  -32552,       0,  -32700,
       0,  -32706,       0,     215,  -32550,     228,  -28616,  -28615,
       0,    4096,     218,     218,  -28616,       0,  -32677,  -32676,
  -16361,  -32710,  -32669,  -32662,  -32661,  -32660,  -32659,     740,
  -32039,     740,  -32719,    4096,     194,  -32719,  -32718,  -32604,
  -32726,  -32725,  -32724,  -32720,    4096,     710,    6116,  -32719,
       0,     710,    6116,  -28581,    4188,     218,     122,      50,
   16409,  -32726,  -32725,  -32724,  -32719,    4096,     710,     454,
     195,     195,     195,     454,  -28581,    4188,     194,  -28566,
  -28565,  -28564,    4205,     195,     195,     195,     710,    4836,
    5095,    4829,  -32726,  -32725,  -32724,  -32719,    4096,    4827,
    4828,     454,  -32720,  -32719,    4096,    4829,    4827,    4828,
     194,  -32719,       0,     710,    4836,  -16291,  -32677,      92,
     184,     121,  -28581,  -28580,  -32722,  -32723,    4317,  -32726,
  -32725,  -32724,       0,     183,  -32726,  -32725,  -32724,  -32720,
       0,    4316,     195,     195,     195,     454,  -28581,    4188,
    4315,     183,    4317,  -32726,  -32725,       0,     195,     195,
    4315,    4317,  -32726,       0,     195,  -32677,  -32676,  -16361,
   16431,     228,     228,      47,  -32610,  -32611,    5345,  -32609,
  -32608,  -32607,       0,    4320,    4319,    5345,  -32609,  -32608,
       0,    4319,    5345,  -32609,       0,  -32613,  -16361,   16431,
     222,     222,     156,  -32677,      92,     183,     186,    1222,
   16435,     228,   16403,    4324,     138,    8420,  -32723,    4189,
      93,     454,     148,  -32674,   16546,   16409,  -32597,     182,
  -16383,   16388,     234,  -16365,  -32595,     172,  -32678,     234,
      90,     244,     246,  -16365,       0,     235,  -32678,     234,
  -16365,     246,  -16365,       0,  -32678,     234,      90,   16407,
     222,   16405,     222,     145,   16407,     222,   16405,     222,
     146,   16407,    1252,     154,    5348,  -16365,     142,     126,
     182,  -16383,   16391,      90,  -16365,     127,  -32678,     238,
      90,     125,     239,  -16365,    8319,    8430,     128,     126,
  -16361,     127,     190,     240,     189,   16409,     182,  -16383,
   16391,      90,  -16365,       0,  -32678,     240,      90,   16623,
  -16365,       0,     244,     232,    1252,    1252,     137,    1252,
     137,    1252,     137,    1252,     137,    1252,     137,     222,
  -16365,       0,     131,     194,  -16360,  -16333,  -16332,     124,
     181,  -16292,  -16277,   16493,  -31802,    5342,  -28581,    4188,
    4263,     181,     186,     454,   16475,     183,  -28583,     199,
    5598,    9438,     222,  -32677,  -32676,   16407,     186,     228,
     135,   16409,  -32632,       0,  -32677,      92,  -32677,  -32676,
  -32662,  -32661,  -32660,  -32659,     165,  -32677,      92,     188,
  -32662,     107,     188,  -32660,     109,  -32732,      37,  -16344,
    4318,     148,  -32674,   16424,     222,   16405,     222,     174,
  -28644,  -32734,  -32680,  -28641,  -32733,  -32730,  -32735,  -32727,
  -32738,    4326,  -32738,  -32739,  -32741,  -32736,     199,  -28644,
  -32680,  -28641,    4326,  -32739,  -32741,     199,  -32738,  -32739,
  -32741,  -32736,  -32729,     199,  -32616,     199,  -32739,  -32741,
  -32729,     199,  -32616,  -32729,     199,  -28644,  -32680,    4326,
  -32738,  -32739,  -32741,     199,     245,    4318,     245,   16409,
     152,    4318,   16409,     152,     245,  -32672,  -32671,  -32670,
      99,   16407,     200,     144,     185,  -32677,      92,   16407,
  -32582,     200,     200,     187,     141,  -32677,      92,   16410,
     191,  -32677,  -32676,  -32662,  -32661,  -32660,     109,     198,
0(max grammar-719)

%ownshortintegerarray glink(0:max grammar) = %c
      -1,      71,      72,      38,      46,      47,      67,      67,
      75,      67,       0,      67,      51,      76,      79,      53,
      55,      80,      67,      81,      82,      83,      67,      84,
      26,      41,      85,      86,      57,      57,      89,      93,
      96,      97,     102,     103,     104,     107,      46,      67,
      67,       0,     110,     110,     111,      52,      49,       0,
      61,      67,      62,       0,      67,       0,     111,     112,
     112,      58,     113,     114,     115,      64,      67,      66,
     116,     117,      68,       0,      67,     122,      67,       0,
      73,     123,     123,      67,      77,      67,      40,      77,
      67,      67,       0,     124,     127,     128,      87,      86,
       0,      90,     131,      89,       0,      94,      93,       0,
     132,      98,     137,     100,      97,       0,     138,      67,
     105,     104,       0,     108,     107,       0,      67,      67,
      67,     139,     140,     141,       0,     118,     120,     116,
     142,     116,      67,      71,     125,      67,       0,      67,
     129,      85,       0,     143,     133,     144,     135,     145,
       0,     156,     157,      59,     158,      67,     119,      91,
     159,     146,     145,     148,     146,     151,       0,     153,
     153,     154,     146,       0,      99,     160,      67,     134,
     161,     162,     165,     161,     141,     162,     162,     168,
     172,     174,     175,     176,     177,     178,     179,     182,
     185,     188,     189,     180,     190,     190,     183,     191,
     191,     186,     191,     191,       0,     188,     192,     193,
     194,       0,     196,       0,       0,     198,     197,       0,
     201,     200,       0,     204,     205,       0,     228,     232,
     219,     234,     235,       0,     236,     237,     238,       0,
     232,     226,     244,     245,     221,     248,     249,     250,
     251,     245,       0,     252,     229,     249,     250,     251,
     253,       0,       0,     188,     254,     260,     239,     269,
     269,     242,     191,     191,     270,     246,     272,     272,
     229,     273,     274,     275,     276,       0,     255,     266,
     266,     258,     267,     267,     261,     266,     266,     264,
     267,     267,     232,     268,     232,       0,     277,       0,
     278,     232,     273,     232,     282,     283,     279,     285,
     253,       0,       0,     286,       0,     232,       0,     288,
       0,     290,       0,     292,     294,       0,       0,     297,
       0,       0,     299,     301,       0,     303,       0,     305,
       0,     307,       0,       0,     310,     313,     314,     315,
       0,       0,     316,     311,     314,       0,     332,     332,
     328,     349,     350,     351,     351,     351,     351,     330,
     282,     352,     358,       0,     333,     341,     347,     359,
     360,     361,     362,     363,       0,     342,     343,     345,
       0,     346,       0,     269,     269,       0,       0,     366,
     353,     371,     372,     373,     374,       0,     375,     376,
     377,     383,     384,     364,     385,     385,     367,     269,
     269,     269,     269,     389,     390,     391,     392,     393,
       0,     378,     360,     361,     362,     341,       0,     379,
     380,     386,     363,     341,       0,     353,     354,     355,
     375,     395,       0,     396,       0,     400,     269,     269,
     401,       0,     411,     411,     406,     417,     407,     418,
     419,     420,       0,     412,     418,     419,     420,     421,
       0,     409,     406,     424,     417,     422,     425,     425,
     408,     415,     427,     430,     431,       0,     426,     432,
     428,     434,     436,       0,     433,     269,     269,     441,
     442,     282,     443,       0,     446,     451,     447,     446,
     452,     451,       0,     449,     448,     454,     453,     457,
       0,     455,     459,     458,       0,     269,     464,     465,
     282,     466,       0,     469,     469,     470,     471,     472,
     473,     474,     475,     476,     477,       0,     479,     269,
     481,       0,     483,     485,     485,     205,     490,     488,
     496,     497,     491,     494,     490,       0,     491,     491,
       0,     498,     499,     501,       0,       0,     504,     506,
     510,     499,     508,       0,     506,     506,     504,     512,
     513,     514,     515,       0,     517,     518,     519,     520,
       0,     522,     523,     524,     525,     522,       0,     528,
     529,     531,     536,     532,     534,       0,     532,       0,
     537,     538,     539,     541,     542,     542,       0,     544,
     546,       0,     547,     548,     549,     533,     551,     553,
     558,     554,     556,       0,     554,       0,     559,     560,
     557,       0,     563,     205,       0,     566,     564,     568,
     565,     570,     567,     572,     569,     574,     571,     576,
     575,       0,     579,     580,     592,     593,     584,     205,
     585,     588,     588,     588,     590,     205,     594,     594,
     595,     596,     597,     581,     600,     598,     601,       0,
     205,     205,     205,     606,     606,     607,     608,     609,
     605,     610,     612,       0,     193,     193,     193,     193,
     193,     193,     193,     193,       0,     623,     623,     192,
     626,     626,       0,     626,     626,     631,     633,     282,
     282,     634,     282,     282,     637,     638,     639,       0,
     650,     677,     684,     666,     655,     205,     205,     205,
     205,     650,     659,     668,     685,     666,       0,     662,
     686,     666,     662,     668,     685,       0,     670,     674,
     689,     666,     205,       0,     205,       0,     674,     689,
     205,       0,     666,     205,       0,     680,     692,     680,
     659,     668,     685,       0,     650,     687,     662,     688,
     205,     690,     691,     666,     680,     697,     697,     697,
     697,     698,     699,     700,       0,     703,     703,     704,
     706,     707,     708,     708,     700,     711,     711,     712,
     713,     719,     719,     719,     719,     719,     719,       0,
0(max grammar-719)

%constshortintegerarray kdict(32:607) = %c
       0,     511,     131,     531,     131,     551,     559,     131,
     567,     575,     583,     603,     623,     631,     663,     671,
     129,     129,     129,     129,     129,     129,     129,     129,
     129,     129,     691,     698,     707,     751,     795,     131,
     131,     824,     900,     960,    1076,    1120,    1280,     128,
     128,    1392,     128,     128,    1460,    1556,    1592,    1660,
    1748,     128,    1828,    2044,    2240,    2272,     128,    2312,
     128,     128,     128,    2331,    2339,    2371,    2379,    2399,
     131,     131,     131,     131,     131,     131,     131,     131,
     131,     131,     131,     131,     131,     131,     131,     131,
     131,     131,     131,     131,     131,     131,     131,     131,
     131,     131,     131,     131,    2407,     131,    2379,  -32351,
   16428,      25,   16428,      29,  -32349,   16433,       1,   16434,
       1,  -16127,       0,   16427,      21,   16407,       0,   16409,
       0,  -32323,  -10840,      40,   16471,       0,  -32341,  -10580,
      32,   16473,     117,   16384,      19,  -31955,  -32322,  -10580,
      36,   -9290,       0,   16473,     113,   16432,      13,  -32337,
   16427,      46,   16427,      17,   16405,       0,   16404,       0,
  -31556,  -31939,  -32322,   -9551,       2,   16433,       1,   16433,
       5,   16426,       5,  -31606,  -32323,   -9807,       0,  -32374,
   -9678,       0,   16436,       0,   16435,       0,  -31939,  -32322,
   16433,       4,   16426,       9,   16433,       3,  -30772,  -31666,
   10578,   11457,  -32344,   16413,       2,   16411,       2,      68,
  -32374,   16440,       0,   16440,       0,    8393,      83,   16408,
       0,  -31291,   10841,      69,  -32311,   16412,      18,   10830,
    9157,   10565,   16412,      18,    9415,      78,   16458,       0,
  -32049,    8665,    8908,   16455,       0,  -30131,      78,  -31277,
      84,  -32055,   10194,      76,   16469,       0,   10958,      69,
   16447,      32,      84,  -32319,   16418,       2,   10830,   16418,
       2,    8909,   10830,   16406,       0,  -31927,   10073,    9921,
    8649,   16419,       5,    9153,   10190,    8915,   16469,       1,
  -27956,  -31282,      88,  -31927,    8916,   10066,    9793,   16419,
       3,      84,   16447,       4,      68,  -32305,   16459,       2,
      70,  -30650,  -31284,      80,  -31931,   10194,   10567,    9921,
   16460,       1,    9938,   16461,       0,   10697,      84,   16467,
       3,    9801,      69,   16460,       0,    8915,   16452,       0,
  -29631,  -30903,  -31282,  -31793,   10069,   10819,   10185,      78,
   16416,       9,      82,   16445,       0,   16416,       9,    9422,
    9299,  -32315,   16453,       0,   10700,      69,   16454,       0,
   10700,      69,   16464,    1210,  -30778,      78,  -31549,    8916,
    8903,      82,  -32344,   16412,      17,   16472,      17,   10956,
    8900,   16470,       0,   16446,      44,  -30143,  -30647,   10063,
      71,  -31671,  -32302,   16412,      20,    8389,      76,   16412,
      36,   10830,    9157,   10565,   16412,      20,   10835,   16467,
       1,    8898,      76,   16425,       6,  -31935,   10063,   10825,
   10575,   16465,     109,      80,   16416,      10,  -32191,   10831,
   16442,       0,    8909,  -32314,   16414,       1,  -31794,   10069,
   10819,   10185,      78,   16416,      10,   16416,      10,  -30770,
  -31408,  -32174,   10071,   16418,       1,  -32374,   16441,       2,
   16441,       2,    9428,   10063,   16402,       0,  -32315,   16448,
       0,    8918,   10830,   16448,       0,  -30523,      82,  -31419,
  -31927,    9167,    8402,      77,   16457,       0,      77,   16419,
       6,    9412,    8387,    8916,   16415,     123,    9938,   16419,
       7,  -31931,   10959,    9428,    8910,   16415,     104,  -28351,
  -30397,  -31024,  -32045,   10964,   10066,   16464,    1319,    9813,
    7892,  -32323,   16462,    1384,   16463,    1241,    8389,      84,
   16456,       0,   10575,      68,  -32314,   16421,      64,   10575,
    8397,      84,  -32301,   16422,       9,    8912,      67,   16422,
      12,      76,  -32301,   16412,      33,  -31924,   10190,    9938,
    9793,   16468,       1,   10063,      71,   16468,       4,  -27704,
  -28983,  -29488,  -31276,  -31913,   10713,    8916,      77,   16419,
       4,   10825,    9283,   16417,      12,  -31423,  -31921,    9426,
    9166,      40,   16420,      48,      80,   16466,     115,   10834,
   16451,       0,    8645,   16423,       0,   10055,    9793,  -32315,
   16449,       0,    8918,   10830,   16449,       0,   10575,      84,
  -32311,   16412,      19,   10830,    9157,   10565,   16412,      19,
  -32056,   10962,      69,   16464,    1354,   10053,   16450,       0,
      78,  -32052,    9428,      76,   16444,     182,   10693,      83,
   16446,      46,    9416,    8908,   16443,     180,   16407,       0,
  -31939,  -32292,  -10454,      51,   16426,      13,   16433,       1,
   16409,       0,  -32290,  -10454,      51,   16426,      13,   16410,
       0,   16431,      14,  -32323,   16430,      51,   16433,       1
   %list
%endoffile
 H?   , ,	r                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %begin; !takeon: convert imp grammar 31/1/77
%constinteger gra=1, old=2;                   !in streams
%constinteger err=0, new=1, glist=2, dlist=3; !out streams
%constinteger first phrase = 200
%constinteger ident=90
%owninteger charmax=0, nmax=-1, inits=0
%owninteger newname=0, outstring=-1
%integer sym,count,gmin,gmax,kmax
%byteintegerarray char(1:1400)
%ownbyteintegerarray tran(0:255) = 0(*)
%integerarray index(0:255)
%integerarray item,next(-1:800), atomic(130:179), phrase(200:255)
%integerarray initial,initnext(0:255)
%integerarray keydict(32:1023)

%routine hwrite(%integer n, m)
   n = n!x'FFFF0000' %if n&x'8000' # 0
   write(n, m)
%end
%routine read sym
   %cycle
       read symbol(sym) %until sym # ' '
      %return %if sym # '&' %or nextsymbol # nl
      skipsymbol
   %repeat
%end

%routine print chars(%integer p)
   %integer flag
   flag = outstring
   %if p # 0 %start
      %while char(p) # 0 %and flag # 0 %cycle
         flag = flag-1
         printsymbol(char(p)&127)
         p = p+1
      %repeat
   %finish
%end

%routine print name(%integer n)
    print chars(index(n&255))
    %while n&x'300' # 0 %cycle
       print symbol('<');  n = n-256
    %repeat
   %if outstring < 0 %start
     printsymbol('"') %if (n&x'800' # 0 %or tran(n&255) # 0)
      n = n>>16
      %if n # 0 %start
         printsymbol('[');  hwrite(n, 0);  printsymbol(']')
      %finish
   %finish
%end

%routine read name(%integername n)
%integer i,j,k,m
    i = charmax
    %cycle
       i = i+1;  char(i) = sym
       read symbol(sym)
       %exit %unless 'A'<=sym<='Z' %or '0'<=sym<='9'
    %repeat
    i = i+1;  char(i) = 0
    read sym %if sym = ' '
    m = nmax
    %while m >= 0 %cycle
       j = index(m);  k = charmax+1
       %while j # 0 %and char(j)&127 = char(k) %cycle
         ->Lok %if char(k) = 0
         j = j+1;  k = k+1
       %repeat
       m = m-1
    %repeat
Lok: %if newname # 0 %start
       %if m >= 0 %start
          printstring("DUPLICATE: ")
          print chars(charmax+1)
          newline
       %finish
       index(n) = charmax+1;  charmax = i
       tran(n) = 1 %and read sym %if sym = '"'
       nmax = n %if nmax < n
    %else
       %if m < 0 %start
          printstring("UNKNOWN: ")
          print chars(charmax+1)
          newline
          m = 0
       %finish
       n = m
    %finish
%end

%routine read grammar
%integer i,j,k,l,p,min,max,exp,end
%integerarray converted(-200:350), head,tail(-200:-1), token,link(1:350)
%integerarray map(0:800)

%integerfn cell(%integer h,t)
!creates a list cell, if necessary, with head h and tail t
%integer i
    i = t;  i = 0 %if i > 0
    %while i # min %cycle
       i = i-1
       %result = i %if head(i) = h %and tail(i) = t
    %repeat
    min = min-1;  head(min) = h;  tail(min) = t
    converted(min) = 0
    %result = min
%end

%integerfn union(%integer x,y)
%integer hx,hy
    %result = x %if x = y
    hx=x %and x=y %and y=hx %if x < y
    %if x >= 0 %start
       %result = cell(x,y) %if y >= 0
       hy = head(y)
       %result = cell(x,y) %if x > hy
       %result = cell(hy,union(x,tail(y))) %if x # hy
       %result = y
    %finish
    hx = head(x);  hy = head(y)
    %result = cell(hx,union(tail(x),y)) %if hx > hy
    %result = cell(hy,union(x,tail(y))) %if hx # hy
    %result = cell(hx,union(tail(x),tail(y)))
%end

%routine concatenate(%integer x,y)
%integer i,j
    i = x
    %cycle
       j = link(i);  link(i) = y;  i = j
      %exit %if i = x
    %repeat;!   %until i = x
%end

%routine accept exp(%integername exp,exp end)
!inputs a regular expression and creates intermediate graph representation
%integer i,string,string end,unit,unit end, n
    exp = 0
Ls:  string = 0
Lu:  %if sym = '(' %start
       read sym
       accept exp(unit,unit end)
       ->Lerr %if unit = 0 %or sym # ')'
       read sym
    %else
       %if 'A' <= sym <= 'Z' %or sym = '%' %start
          read name(i)
          char(index(i)) = char(index(i))!128 %if i # 0
          i = i!tran(i)<<11
          i = i+256 %and read sym %while sym = '<'
          %if sym = '"' %start;! force transparent
             readsym
             i = i!1<<11
          %finish
          %if sym = '[' %start
             read(n);  ->Lerr %if n>>4 # 0
             i = i+n<<16
             readsym;  ->Lerr %if sym # ']'
             read sym
          %finish
       %else
          ->Lerr %if sym # '+'
          i = 0
          i = i+256 %and read sym %while sym = '+'
       %finish
       max = max+1;  token(max) = i;  link(max) = max
       unit = max;  unit end = max
    %finish
    %if sym = '*' %or sym = '!' %start
       max = max+1;  token(max) = -1;  link(max) = max
       min = min-1;  head(min) = max;  tail(min) = unit
       concatenate(unit end,min);  unit end = max
       unit = min %if sym = '*'
       read sym
    %finish
    %if sym = '?' %start
       max = max+1;  token(max) = -1
       link(max) = link(unit end);  link(unit end) = max
       min = min-1;  head(min) = max;  tail(min) = unit
       unit = min
       read sym
    %finish
    %if string=0 %then string=unit %else concatenate(string end,unit)
    string end = unit end
    ->Lu %unless sym = ',' %or sym = ')' %or sym = nl
    %if exp = 0 %start
       exp = string
       exp end = string end
    %else
       exp = union(string,exp)
       i = link(exp end)
       link(exp end) = link(string end)
       link(string end) = i
    %finish
    %return %unless sym = ','
    read sym %until sym # nl
    ->Ls
Lerr:exp = 0
%end

%routine convert
%integer i,j,k,m,n,gmax1,loopstop

%routine tcount(%integer x)
%integer t
    %cycle
       %return %if x = 0
       %if x < 0 %start
          tcount(tail(x))
          x = head(x)
       %finish
       t = token(x)
       %exit %if t >= 0
       %return %if t = loopstop
       token(x) = loopstop
       x = link(x)
    %repeat
    k = k-1
%end

%routine add components(%integer x)
%owninteger i=0,k=0,t=0,u=0
    %while x # 0 %cycle
       %if x < 0 %start
          add components(tail(x))
          x = head(x)
       %finish
       t = token(x)
       %exit %if t >= 0
       %return %if t = loopstop
       token(x) = loopstop
       x = link(x)
    %repeat
    %if x # 0 %then x = link(x) %else t = 0
    u = t&(x'F0000'+15<<11+255)
    i = gmax1
    %cycle
       i = i+1
       %exit %if i > gmax
       k = item(i)
       next(i)=union(next(i),x) %and %return %if k = t
       %if k&(x'F0000'+15<<11+255) = u %start
         print name(p) %unless p = 0
          printstring("-CLASH: ");
          print name(k);  space;  print name(t)
          newline
       %finish
       k = k&255
       %if u = ident %or (u&255<k %and k>=180) %or k = 0 %start
          %cycle i = gmax,-1,i
             item(i+1) = item(i)
             next(i+1) = next(i)
          %repeat
          %exit
       %finish
    %repeat
    gmax = gmax+1
    item(i) = t;  next(i) = x
%end

    loopstop = -1;  gmin = gmax+1
    %cycle i = min,1,max
       converted(i) = 0
    %repeat
    n = next(0)
L1:  gmax1 = gmax
    loopstop = loopstop-1
    add components(n)
    item(gmax) = item(gmax)+1024
    %if gmax1 = 0 %start
       inits = gmax
       inits = inits-1 %while inits # 0 %and item(inits)&255 >= first phrase
    %finish
    converted(n) = gmax1+1
    m = 0
    %cycle i = gmin,1,gmax
       j = next(i)
       %if j # 0 %start
          k = converted(j)
          %if k = 0 %start
              loopstop = loopstop-1
              tcount(j)
              converted(j) = k
          %finish
          %if k < m %start
              m = k;  n = j
          %finish
       %finish
    %repeat
    ->L1 %if m # 0
    %cycle i = gmin,1,gmax
       k = next(i)
       k = converted(k) %if k # 0
       next(i) = k
    %repeat
%end;  !convert

%routine minimize
%integer i,j,k,m,n
%integerarray stack(1:150)

%integerfn ult map(%integer i)
%integer j
    j=i %and i=map(i) %until i = j %or i = 0
    %result = j
%end

%integerfn equivalent(%integer nn,mm)
%integer i,j,k,pos1,pos2
    pos1 = 0;  pos2 = 0
L1:  %cycle
       k = item(mm)
       ->L9 %unless item(nn) = k
       i = next(nn);  j = next(mm)
       ->L9 %if (i=0 %and j#0) %or (i#0 %and j=0)
       pos1 = pos1+1;  stack(pos1) = nn;  map(nn) = mm
       nn = nn+1;  mm = mm+1
       %exit %if k&1024 # 0;                 !last alternative
    %repeat
L2:  %result = 1 %if pos2 = pos1
    pos2 = pos2+1;  i = stack(pos2)
    nn = ult map(next(i));  mm = ult map(next(map(i)))
    ->L2 %if nn = mm
    %if nn < mm %start
       i = nn;  nn = mm;  mm = i
    %finish
    ->L1 %if nn > n
L9:  %while pos1 # 0 %cycle
       i = stack(pos1);  map(i) = i
       pos1 = pos1-1
    %repeat
    %result = 0
%end

    %cycle i = 0,1,gmax
       map(i) = i
    %repeat
   %return %if gmin > gmax
    %cycle n = gmin,1,gmax
       %if map(n) = n %start
          %if n = gmin %or item(n-1)&1024 # 0 %start
             m = 1
             %while m # n %cycle
                %exit %if map(m) = m %and equivalent(n,m) # 0
                m = m+1
             %repeat
          %finish
       %else
          map(n) = ult map(n)
       %finish
    %repeat
    j = gmin-1
    %cycle i = gmin,1,gmax
       k = map(i)
       %if k = i %start
          j = j+1;  map(i) = j
          item(j) = item(i);  next(j) = next(i)
       %else
          map(i) = map(k)
       %finish
    %repeat
    gmax = j
    %cycle i = gmin,1,gmax
       k = next(i)
       next(i) = map(k) %if k # 0
    %repeat
%end;  !minimize

    gmax = 0
L1:  read sym %until sym # nl
    ->L10 %if sym = '/'
    %if sym = 'S' %and next symbol = 'S' %start
       skip symbol;  p = 0
    %else
       read name(p);  %stop %if p = 0
    %finish
    min = 0;  max = 0
    read sym %until sym#nl %and sym#'-' %and sym#'>'
    accept exp(exp,end)
    ->L9 %if exp = 0 %or sym # nl
    concatenate(end,0)
    item(0) = 2047;  next(0) = exp
    convert
    i = gmin
    minimize
    i = map(gmin)
    %if p = 0 %start;                      !ss
!!!          j = item(i);!  k = next(i)
!!!             k = k-inits;!  %stop %if k <= 0
!!!          %if i <= inits %start
!!!             ->L99 %if l >= first phrase
!!!             %signal 0,25 %if initial(l) # 0
!!!          %else
!!!          %finish
!!!       gmax = gmax-inits
       %cycle i = 1, 1, inits
          l = item(i)&255
          %continue %if l >= 200
          l = atomic(l) %if 130 <= l < 180
          %signal 0,25 %if initial(l) # 0
          initial(l) = i;  initnext(l) = item(i)
       %repeat
       select output(glist)
       newline
    %else
       phrase(p) = i
       select output(glist)
       newline
       print name(p);  printstring(" =>")
       hwrite(i,1)
    %finish
    k = 1024
    %cycle i = gmin,1,gmax
       %if k&1024 # 0 %start
          newline;  hwrite(i,3);  j = 0
       %finish
       j = j+1
       %if j > 5 %start
          newline;  spaces(4);  j = 1
       %finish
       spaces(3)
       k = item(i)
       %if k&255 # 0 %start
          print name(k)
       %else
          printstring("*E")
          print symbol('+') %and k=k-256 %while k&x'300' # 0
       %finish
       hwrite(next(i),1)
    %repeat
    select output(err)
    ->L1
L9:  printstring("WRONG FORMAT AT: ")
    %while sym # nl %cycle
       print symbol(sym);  read sym
    %repeat
    newline
    ->L1
    !deal with initial phrase
    !assumes exactly one (imp)
L10: %if inits = 1 %start;    ! not imp!!!
       selectoutput(err)
       printstring("NOT AN IMP GRAMMAR");  newline
       %return
     %finish
    p = phrase(item(inits+1)&255)
    %signal 0,26 %if p = 0
    %cycle
       j = item(p);  k = j&255
       %signal 0,27 %if k >= 160
       k = atomic(k) %if k >= 120
       %signal 0,28 %if initial(k) # 0
       initial(k) = p!x'8000';  initnext(k) = j
       %exit %if j&1024 # 0
       p = p+1
    %repeat
    initial(0) = initial(182);      !%decl
    select output(glist)
    newlines(2)
    %cycle i = 0,1,119
       k = initial(i)
       %if k # 0 %start
          hwrite(i,2);  printstring(":  ")
          print name(initnext(i))
          hwrite(k&255, 3)
          printsymbol('`') %if k < 0
          newline
       %finish
    %repeat
    select output(err)
%end;  !read grammar

%routine read atoms
%integer i,j,k,dict,dmax,code,class,sub
%integerarray char,cont,alt(0:1000)

%routine read code
   %integer n
    code = next symbol;  sub = 0
    %if code # ',' %and code # nl %start
       skip symbol
      %if code = '$' %start
         read(code);  %return
      %finish
       %return %unless code = '('
       read(sub)
       %while nextsymbol = '+' %cycle
         skipsymbol;  read(n);  sub = sub+n
      %repeat
       skip symbol
    %finish
    code = class+128
%end

%routine insert in(%integername x)
    %cycle
       %while char(x) < code %cycle
          cont(x) = sub %if cont(x) = 0
          x == alt(x)
       %repeat
       %if char(x) # code %start
          dmax = dmax+1;  char(dmax) = code
          cont(dmax) = 0;  alt(dmax) = x;  x = dmax
       %finish
       %exit %if code&128 # 0
       read code
       x == cont(x)
    %repeat
    sub = cont(alt(x)) %if sub = 0 %and alt(x) # 0
    cont(x) = sub
%end

%routine store(%integer x)
%integer m,n,v, mm, q
    %cycle
       kmax = kmax+1;  n = kmax
       m = alt(x);  mm = m
       store(m) %and m=x'8000' %if m # 0
       v = char(x);  x = cont(x)
       %exit %if v&128 # 0
       %if m = 0 %start;  !no alternatives
          %if alt(x) = 0 %and char(x)&128 = 0 %start
             v = char(x)<<7+v;  x = cont(x)
          %finish
       %else
         q = kmax-n+1
         %if q>>7 # 0 %start
            selectoutput(0)
            printstring("Keydict overflow!");  newline
            %signal 15,15
            %stop
         %finish
          v = q<<7+v!x'8000'
       %finish
       keydict(n) = v
    %repeat
   %if mm = 0 %start
      kmax = kmax+1;  keydict(kmax) = 0
   %else
      kmax = kmax-1
   %finish
   keydict(n) = m + x'4000' + (keydict(n+1)&127)<<7 + v&127
   keydict(n+1) = x
%end

    dict = 0;  dmax = 0;  char(0) = 999
L1:  %cycle
       sym = next symbol
       %exit %unless sym = '[' %or sym = nl
       read symbol(sym) %until sym = nl
    %repeat
    ->L10 %if sym = '/'
    read(class)
    newname = 1
    read sym;  read name(class)
    newname = 0
    %if class < 130 %start
       %if sym # '[' %start
          read(sym) %if sym = '$'
          %cycle
             code = sym;  insert in(dict)
             read symbol(sym)
             %exit %if sym # ','
             read symbol(sym) %until sym # ' ' %and sym # nl
          %repeat
       %finish
    %else
       %if class <= first phrase %and sym = '=' %start
          read sym;  read name(atomic(class))
       %finish
    %finish
    read symbol(sym) %while sym # nl
    ->L1

%routine display(%integer i,s)
%integer j
   %routine show(%integer sym)
      sym = '$' %if sym = nl
      printsymbol(sym)
   %end
L1:  j = keydict(i)
    %if j&x'4000' = 0 %start
       show(j&127)
       %if j&x'8000' = 0 %start
          j = j>>7
          show(j) %and s=s+1 %if j # 0
          space
          i = i+1;  s = s+2
          ->L1
       %finish
       space
       display(j>>7&127+i,s+2)
    %else
       print symbol(':');  print name(j&127)
       space %and print name(j>>7&127) %unless j>>7&127 = 0
       j = keydict(i+1)&x'3FFF'
       hwrite(j, 4) %unless j = 0
       newline
       %return
    %finish
    %return %if j>>15 = 0
    spaces(s);  i = i+1
    ->L1
%end

L10: select output(dlist);  newlines(2)
    kmax = 126;  keydict(32) = 0
    %cycle i = 33,1,126
       print symbol(i);  space
       %if char(dict) = i %start
          j = (kmax+1)<<2
          store(cont(dict))
          dict = alt(dict)
          display(j>>2,2)
       %else
          print symbol('?');  newline
          j = 32<<2
       %finish
      !let:0  dig:1  term:2  other:3 
       j = j+3 %unless 'A'<=i<='Z'
       j = j-2 %if '0'<=i<='9'
       j = j-1 %if i = ';'
       keydict(i) = j
    %repeat
    keydict('~') = keydict('^')
    newlines(2)
    select output(err)
%end

%integer i,j,k
    charmax = 0
   item(i) = 0 %and next(i) = 0 %for i = -1, 1, 800
   index(i) = 0 %for i = 0, 1, 255
   atomic(i) = i %for i = 130, 1, 179
   phrase(i) = 0 %for i = first phrase, 1, 255
   initnext(i) = 0 %and initial(i) = 0 %for i = 0, 1, 255
    select output(err)
    read symbol(i) %until i = '/'
    read symbol(i) %until i = nl
    read atoms
    read symbol(i) %until i = nl
    read grammar
!write required values
    select output(new)
   printstring("   %endoflist");  newline
    printstring("%conststring(8)%array text(0:255) = %c
""Z"",")
    k = 5;  outstring = 8
    %cycle j = 1, 1, 255
       printsymbol('"');  PRINT NAME(J);  PRINTSYMBOL('"')
       printsymbol(',') %unless j = 255
       k = k-1;  k = 6 %and newline %if k <= 0
    %repeat
    newline
    outstring = -1
    printstring("%constinteger gmax1=");  hwrite(gmax,0)
    newline
    printstring("%owninteger gmax=");  hwrite(gmax,0);  newline
    printstring("%constinteger imp phrase =");  hwrite(inits+1, 0)
    newlines(2)
    printstring("%ownshortintegerarray phrase(200:255) = %C")
    %for i = 200, 1, 255 %cycle
       newline %if i&7 = 0
       hwrite(phrase(i),3)
       print symbol(',') %unless i = 255
    %repeat
    newlines(2)
    printstring("%constbyteintegerarray atomic(130:179) = %c")
    k = 0
    %cycle i = 130,1,179
       newline %if k&7 = 0
       k = k+1
       hwrite(atomic(i),3)
       print symbol(',') %unless i = 179
    %repeat
    newlines(2)

%integerfn packed(%integer j,k)
   j = (j&1024)<<5 + (j&x'0300')<<4 + (j>>3&x'0100')<<6 + (j>>8&x'F00')
   %result = j+k&255
%end

   printstring("!  FLAG<1> 0<1> SS<2> 0<3> T<1> LINK<8>");  newline
    printstring("%constshortintegerarray initial(0:119) = %c")
    %cycle i = 0,1,119
       newline %if i&7 = 0
       hwrite(initial(i), 7)
       print symbol(',') %unless i = 119
    %repeat
    newlines(2)
   printstring("!  MORE<1> 0<1> ORDER<2> TYPE<4> CLASS<8>");  newline
    printstring("%ownshortintegerarray gram(0:max grammar) = %c")
    %cycle i = 0,1,gmax
       newline %if i&7 = 0
       k = 0
       k = packed(item(i)!!1024,item(i)) %if i # 0
       hwrite(k,7)
       print symbol(',')
    %repeat
   newline;  printstring("0(max grammar-")
   write(gmax, 0);  printsymbol(')')
   newlines(2)
   printstring("%ownshortintegerarray glink(0:max grammar) = %c")
   %cycle i = 0, 1, gmax
      newline %if i&7 = 0
      hwrite(next(i), 7)
      printsymbol(',')
   %repeat
   newline;  printstring("0(max grammar-")
   write(gmax, 0);  printsymbol(')')
   newlines(2)
    printstring("%constshortintegerarray kdict(32:");  hwrite(kmax,0)
    printstring(") = %c")
    %cycle i = 32,1,kmax
       newline %if i&7 = 0
       hwrite(keydict(i),7)
       print symbol(',') %unless i = kmax
    %repeat
    newline
   printstring("   %list");  newline
   printstring("%endoffile");  newline
   selectoutput(0)
   printstring("Grammar complete");  newline
%endofprogram
 H?   & &	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "       2W  p,P ,P  0m$A?,tAC W  p ,`   #6`  Pi A|y W  p ,#Xo 0`  !6AP 0"	` &!6A 
#4y AC W  p 0X 0P ,fC00Xi 
oӶ CC0 XY ,#>'QPY ,k` A$aQi C y W  p ,fb
oXfAsi ` #:` <A` Qi "X 0C@` !8Y 
]ӥ L#5` "Asi Pi #>` [Ax$PXi A` ]Afy W  p <X  P ,$aQi ,X ,
X_ 0[ CAP 0 A! Z#( 0! 9#"#C $aQi ,X ,
$P[ C  !3AXm $Pi 8Xi 8BRb
oXP 0X]  &QPY 4Xi 0C0*X 4

oV CP ӫ CZ!:#=$QQY 0QY 4C %aQi 8C Xm ,C0xX 8B"ADUPLICATE: Aj$aZm  A8ARXi X  
X]  &QP[X ,P  X 0 "!9XF  
M$14 LAX Xk  Ym $##Pm $C :X 8C&A
	UNKNOWN: A$aZm  AA$`Pi 8Xi X 8P  y W  p&C ~W  p 0PZ ,U#$$P ,Xi @Uj ,C00%Q ,XZ ,R
YX U!;XJ  UE,!6X ,z C 'aPi @b
iX PXZ  PV,$PpX @z W  p 4e!5z 	e#Pj ,PZ Pj  Xj BVX  ![AHz 
X[PZ 0	e#(XZ  A*z e#=X[,AQXj 0Az X  z b
iXP ,XZ  R
YXP 0	#/XZ  Xf,APQXj ,Az #?XU,Xj A0QXj 0Az XU,Xf,AQXj ,Az W  p 4Pj ,Xj ,b
iXP 0XZ  PVP ,U B0z W  p D$P  $`Pj 0Xo 0` (B0,AZ <j 8AXj 8#6X 0Ű )#3C A^C ` A!` Z#%` %B0j ,ALXj ,#<b
oX
[ CP [ CXj ,
mӶ LV ,P ,Xo 0` <!8Ȱ Q ,A"` "!9AXj ,` Pj ,Xo 0` [B0>Ⱥ @P ,Ȱ P 0AXj @dB0Xj @` Qj ,AXo 0` ]B0AC &` +B0$P ,Xo 0` +!8Ȱ Q ,An"$aQi DX D
XZ ,P[(X DPP 8P <Xo 0` *#5` !B0^$Q DXY DR
Y%P(XI DPEQ @X9 @2
9PCX 8P,XY @Xj <AXi DPj <X 0Ű *!5XY @PZ 8AXo 0` ?B0P$Q DXY DR
Y%P(XJ <B
IX4P5X DPQ @X) @"
)PX 8P,X	 @P
 8AzXj 0!6X 8P 0#XZ 8Xj 4A~Xj <Pj 4X 0Ű ,#8Ű )#5Ű 
B0X X\  !;XJ 0PL  X:  Pc  C 8Xj 0A<Xj P  X  X[  R
YXP ,XJ 4B
IX4P5PXo 0` ,#4z #Xo 0` 
!4A"C *Xj $P  z W  p TC  W  p 0Xk !4{ f#b
iXf,AXk b
iXVP[ Xk b
iXV(P[ ,C UZ D!4{ X DP(XFPK C %Q 4{ W  p 4Xk C0R#b
iXf,AXk b
iXVP[ Xk b
iXV(P]C UZ D!4{ X DP(XFPK C Xk #8b
iXVP[ #$PP]Xm` xPmXZ @P]$aQmX_ <Y]BX
XL	PMUMB0X[ XlHP ,AXk ,PH{ @ xUMB06XI <#4dAA
-CLASH:  AXmAA^XmAAjmPmX]P Z#:U	V#` #fB0>XmPk 0X_ <&QP]XmUk 0C0'aPmb
oXV	PV	XHPLC #C $aQo <X]R
_XP	XK PEH{ %aPj DX <&P 8XY DPZ HZi @Pj ,Xj ,Uj H#:&aPj ,b
i$Pp"XHP <Xo <Pj @%Q DXj <AXo <b
oȰ Q	XZ @B0$X <P (Xm (#<b
oӶ	ɰ !%QQ] ("Xj <b
iX @&Pp$PPZ 8X <P LXO 8'APJ ,Xj ,Uj LC0b&aPj ,b
oXHP 0C0H
X[pPZ 4B0%Q DXj 0AXj 0b
iX 4PpXj 8Yj 4#)X 4P 8Xj 0Pj <C X 8B0X_ <PZ PX 8'P ,Xj ,Uj PC0,&aPj ,b
oXHP 4#7
X[pPZ 4X 4PHC z W  pC zW  p 0#
Xk ,Uk C0X[ #=Xk Pk ,b
iXVP[ C { W  p @$P 8P <Xk  b
oXV	P[ 4X 
U\	B0XLHPK ,X6HP; 0D!33!5D#53!3C $Q 8X+ 8"
*X P <
X  PQ 
P  P C0Xk 8Uk <!5${ $QQ[ <X <
XL <PK ,B
OXdHAP Xk ,b
iXVR
_XeHAP  U C0Y #)Xk Pk ,P Pk  Xj <Yk B
Xk 8C0"b
jXV <P[ ,R
YX ,P%AQK 8C ${ Xo <Pj%P ,Xj ,Uj#;&aPj ,b
iX ,P"X <Y 8#z PX_ 8'QPZ <Xj <UjC0z&aPj <b
iX <UB0NU 8#9
s[	P C06$P 8Xj <Uj 8C0$X 8
XZ 8U[!5A!6$aQj 8C #
PjkAXjPC zX 8'P 0X_ <PZX 8'P ,Xj ,UjC0V&aPj ,b
iXP 4U ,B0,$QQZ 0X 0P
XJ ,B
OX4	P<	XHPH#
X[PVC X 0P <PX_ 8'QPZ ,Xj ,UjC0$&aPj ,b
oXHP 4#7
X[PVHC z $`Po <#Xo 0` 
!4A"` /C0~` S!<A S!7A$`Pi <#i <AXi <!5A$P @P D#Xo 0` 
#7` -#4` >!4Ad"Y Li HAXi H#6X 0Ű 
#3C $PXi LAX`Po	X HPHArXo 8Pi ,AXo 8b
iXP ,XY <B0X (P&PY ,Xi ,Ui&C0^&aPi ,b
oӶ	P 8ɰ Cɰ !ɰ #
X[ PY 8X 8
X[$t#6$  A2X ,P$tXV	P[(tC $bAAC 0R
_P t$bAzAXi <AA =>A$QXi ,A&` Pi 4X <P&X_ 8'QPY ,Xi ,Ui&C0&aPi ,s 6ð #;An$SXi ,A$`Pi 0$aQi 0X 0ɰ #)AJ$dA$aPi 0$cAXi ,b
oX	P 4ð #6kALC (A*E>Asi 6` #:` +A` Qi 4"Xi ,b
o$QXfHA\C L$`AC AWRONG FORMAT AT: AXo 0` 
#6AAH"	AC hXm (` B0,$`A8ANOT AN IMP GRAMMARAvAhy b
oӶ	
X[ tPY <!6$  AzXi <b
oX	P 0P 4ɰ !$  ATɰ x!
X[ PY 4X 4
X[$t#6$  A*X <   P$tXY 0P[(tP !6$Q <C X'LP$t$bAn$bA%aPi ,Xi ,` wC0\&aPi ,b
oX$tP 4C0B$RXi ,AA:  AXi ,b
oXf(tA$Si 7AXi 4#` `AdANC $`Ay W  p/8C W  p 0AP @$`Pi H ,C0 
C0|AXi @` $!>ȹ @P ,Ȱ P 0Az ` (#4z ȹ HP ,Ȱ P 0AxA +B0$Azj ,Pg ,` Pg 0ATXj ,Qi HC AVXi D` Pi @z W  p ,Xj X  
XY @Y[ L#.X!5XI HPKP C U[ LC0($Q <XI <B
IPT L$0P4X  PX) <P&  P !?AXj X  
[PZ C ~X H!>X  
XL#7B
IX4P9 HX  
X HPz W  p @$aQo @X @P 0XZ R
YXP ,P 8XJ ,#9dA`   Pj ,Xj b
iX LP 4XVPZ ð B0Xj ,B0.R
YXB0sE N@ !;X5 L7
;P: 4XP C ZX @[ 0&P <C04$`AAKeydict overflow!AA$A$ AX <
   P 4XZ 0RZ_,tX 4P  C Xj 8!<$Q @XO @BZO,tPd  #%Q @X 0Z,tXJ 0BZO,ts4 0 X ,@ 7
İ 
P  X 0Z,tP[ z $`Pi 8Pi <ȰP LAP 0 [#4 
!>#Xo 0` 
#6AP 0"	C  /C0i DPg ,` Pg 0A$aPm ,Ai DA$`Pm ,X Dɰ CjX_ 0P [C0ZP $!;ȯ 0P ,Ƞ P 0AZXo 0Pi @i 8AA6P 0 ,B0 #	Xo 0`  #4` 
!6AP 0"C C &ɰ B X_ 0P =!;AXi Db
of AXo 0` 
#6AP 0"	C C *W  p 0C &W  p ,` 
!5P $P[ Xk A { Xj bZo,tX  P ,ð@ B0b` kAsj .` B0,X ,P ,#7kA$aQj  A$aQj $Q  C ApXj ,g` Zj $RZZ  ATC Z` :Av` kAXj ,g` #:A2Xj ,g` AlXj bZo,ts İ?P ,#5$TkAAz Xj ,o!4z Xj  A$aQj C 
$cA$bA` ~Po @X,t$PP[ Ƞ  P ,Xi ,` ~C0&aPi ,AAXi 8b
iX ,U LB02X_ @&QRPY 0XfAXi 8b
iXP 8Xi 0b$RAR#` ?AvA`` Pi 0Xi ,` A!` Z#$$Q 0` 0!` 9!$%Q 0` ;!4%Q 0bZo,tX 0P  C FX,tX[xP[$bA$`Ay $`Pm  %P,|Xo,|` #<&aPo,|b
o$P	PH"%P,|Xo,|` #:&aPo,|b
o$P"Ȱ P,|Xo,|` #;&aPo,|b
oX,|P "Ȱ P,|Xo,|` #:&aPo,|b
o$P t"%P,|Xo,|` #<&aPo,|b
o$P(tP$t"$`A#Xo,|` /#6AP,|"	#Xo,|` 
#6AP,|"	A#Xo,|` 
#6AP,|"	A"$aAA   %endoflistAAA,+%conststring(8)%array text(0:255) = %c
"Z",A$ePo,$P 0$P,Xo,` C0F&aPo,` "AxXo,A` "AhXo,` #5` ,AV%aQo,!&$P,A2C A*%aPm 0A%constinteger gmax1=yA$PXo <AzAA%owninteger gmax=A$PXo <ARAA%constinteger imp phrase =(A$aZm ($PA$bAA,*%ownshortintegerarray phrase(200:255) = %C,Ap` Po,|Xo,|` C08&aPo,|` !3ABXo,|b
o$SXf tAXo,|` #5` ,A0C $bAA,+%constbyteintegerarray atomic(130:179) = %cA$`Po,Ȱ P,|Xo,|` C0B&aPo,|s,ð !3A$aQo,X,|
$SXk AXo,|` #5` ,AC $bArC FW  p ,` s İ eX Ġ 
kX 
jİ 
kPi U
y A('!  FLAG<1> 0<1> SS<2> 0<3> T<1> LINK<8>AA A,+%constshortintegerarray initial(0:119) = %cA%aPo,|Xo,|` wC08&aPo,|` !3AXo,|b
o$WXf$tAXo,|` w#5` ,AC $bApA*)!  MORE<1> 0<1> ORDER<2> TYPE<4> CLASS<8>ATAFA0.%ownshortintegerarray gram(0:max grammar) = %cLAXo <Po,%P,|Xo,|Uo,C0J&aPo,|` !3A$`Po,X,|#=
` Wk	X[	AJP,$WXo,A4` ,AC AA0(max grammar-eA$PXo <A` )A$bAjA0/%ownshortintegerarray glink(0:max grammar) = %cAHXo <Po,%P,|Xo,|Uo,C0.&aPo,|` !3AXo,|b
o$WXfHA` ,AC AA0(max grammar-eA$PXo <A` )A$bAA"!%constshortintegerarray kdict(32:A$PXo @AA) = %csAXo @Po,Ȱ P,|Xo,|Uo,C0:&aPo,|` !3ARXo,|bZo,t$WXf  AXo @Uo,|#5` ,A>C A$A
   %listoAAA
%endoffiletAA$`AAGrammar completeeAAX , $@X= P P6 PV  5!%$$C !$  Ps  Q  Pc '
qX=  s #'q!$$C X^ P8PQB' 5$BX= $JX= Xg ,XW 0@ X= $DX= $CX= V`  $GX= `  $EX= V$j$GX= $j$EX= $FX= $EX= $HX= rnalroutinespec readF    (%name it)
   %externalroutinespec writeF   (%name it)
   %externalroutinespec stop     (%integer code)
   %string(72) FORMAT
   %integer status
   Initialise
   %cycle
      prompt ("FORMAT ")
      read (FORMAT)
      FORMAT = FORMAT . to string (128)
      Stah .                                         x                                                                                                                                                                                                                                                                                                                                  8  ^   8        ^                                               %begin
   %externalroutinespec initialise
   %externalroutinespec start IO (%integer lu, rec, rw, 
                                  %integer %name IO status,
                                  %byte    %name FORMAT)
   %externalroutinespec readF    (%name it)
   %externalroutinespec writeF   (%name it)
   %externalroutinespec stop     (%integer code)
   %string(72) FORMAT
   %integer status
   Initialise
   %cycle
      prompt ("FORMAT ")
      read (FORMAT)
      FORMAT = FORMAT . to string (128)
      Start IO (0,0,0,status,byte integer(addr(FORMAT)+1))
   %repeat
   Stop (0)
%endofprogram
 H?    	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %begin; !takeon: convert imp grammar 31/1/77
%constinteger gra=1, old=2;                   !in streams
%constinteger err=0, new=1, glist=2, dlist=3; !out streams
%constinteger first phrase = 200
%constinteger ident=90
%owninteger charmax=0, nmax=-1, inits=0
%owninteger newname=0, outstring=-1
%integer sym,count,gmin,gmax,kmax
%byteintegerarray char(1:1400)
%ownbyteintegerarray tran(0:255)
%integerarray index(0:255)
%integerarray item,next(-1:800), atomic(130:179), phrase(200:255)
%integerarray initial,initnext(0:255)
%integerarray keydict(32:1023)

%routine hwrite(%integer n, m)
   n = n!x'FFFF0000' %if n&x'8000' # 0
   write(n, m)
%end
%routine read sym
   %cycle
       read symbol(sym) %until sym # ' '
      %return %if sym # '&' %or nextsymbol # nl
      skipsymbol
   %repeat
%end

%routine print chars(%integer p)
   %integer flag
   flag = outstring
   %if p # 0 %start
      %while char(p) # 0 %and flag # 0 %cycle
         flag = flag-1
         printsymbol(char(p)&127)
         p = p+1
      %repeat
   %finish
%end

%routine print name(%integer n)
    print chars(index(n&255))
    %while n&x'300' # 0 %cycle
       print symbol('<');  n = n-256
    %repeat
   %if outstring < 0 %start
     printsymbol('"') %if (n&x'800' # 0 %or tran(n&255) # 0)
      n = n>>16
      %if n # 0 %start
         printsymbol('[');  hwrite(n, 0);  printsymbol(']')
      %finish
   %finish
%end

%routine read name(%integername n)
%integer i,j,k,m
    i = charmax
    %cycle
       i = i+1;  char(i) = sym
       read symbol(sym)
       %exit %unless 'A'<=sym<='Z' %or '0'<=sym<='9'
    %repeat
    i = i+1;  char(i) = 0
    read sym %if sym = ' '
    m = nmax
    %while m >= 0 %cycle
       j = index(m);  k = charmax+1
       %while j # 0 %and char(j)&127 = char(k) %cycle
         ->ok %if char(k) = 0
         j = j+1;  k = k+1
       %repeat
       m = m-1
    %repeat
ok: %if newname # 0 %start
       %if m >= 0 %start
          printstring("DUPLICATE: ")
          print chars(charmax+1)
          newline
       %finish
       index(n) = charmax+1;  charmax = i
       tran(n) = 1 %and read sym %if sym = '"'
       nmax = n %if nmax < n
    %else
       %if m < 0 %start
          printstring("UNKNOWN: ")
          print chars(charmax+1)
          newline
          m = 0
       %finish
       n = m
    %finish
%end

%routine read grammar
%integer i,j,k,l,p,min,max,exp,end
%integerarray converted(-200:350), head,tail(-200:-1), token,link(1:350)
%integerarray map(0:800)

%integerfn cell(%integer h,t)
!creates a list cell, if necessary, with head h and tail t
%integer i
    i = t;  i = 0 %if i > 0
    %while i # min %cycle
       i = i-1
       %result = i %if head(i) = h %and tail(i) = t
    %repeat
    min = min-1;  head(min) = h;  tail(min) = t
    converted(min) = 0
    %result = min
%end

%integerfn union(%integer x,y)
%integer hx,hy
    %result = x %if x = y
    hx=x %and x=y %and y=hx %if x < y
    %if x >= 0 %start
       %result = cell(x,y) %if y >= 0
       hy = head(y)
       %result = cell(x,y) %if x > hy
       %result = cell(hy,union(x,tail(y))) %if x # hy
       %result = y
    %finish
    hx = head(x);  hy = head(y)
    %result = cell(hx,union(tail(x),y)) %if hx > hy
    %result = cell(hy,union(x,tail(y))) %if hx # hy
    %result = cell(hx,union(tail(x),tail(y)))
%end

%routine concatenate(%integer x,y)
%integer i,j
    i = x
    %cycle
       j = link(i);  link(i) = y;  i = j
      %exit %if i = x
    %repeat;!   %until i = x
%end

%routine accept exp(%integername exp,exp end)
!inputs a regular expression and creates intermediate graph representation
%integer i,string,string end,unit,unit end, n
    exp = 0
s:  string = 0
u:  %if sym = '(' %start
       read sym
       accept exp(unit,unit end)
       ->err %if unit = 0 %or sym # ')'
       read sym
    %else
       %if 'A' <= sym <= 'Z' %or sym = '%' %start
          read name(i)
          char(index(i)) = char(index(i))!128 %if i # 0
          i = i!tran(i)<<11
          i = i+256 %and read sym %while sym = '<'
          %if sym = '"' %start;! force transparent
             readsym
             i = i!1<<11
          %finish
          %if sym = '[' %start
             read(n);  ->err %if n>>4 # 0
             i = i+n<<16
             readsym;  ->err %if sym # ']'
             read sym
          %finish
       %else
          ->err %if sym # '+'
          i = 0
          i = i+256 %and read sym %while sym = '+'
       %finish
       max = max+1;  token(max) = i;  link(max) = max
       unit = max;  unit end = max
    %finish
    %if sym = '*' %or sym = '!' %start
       max = max+1;  token(max) = -1;  link(max) = max
       min = min-1;  head(min) = max;  tail(min) = unit
       concatenate(unit end,min);  unit end = max
       unit = min %if sym = '*'
       read sym
    %finish
    %if sym = '?' %start
       max = max+1;  token(max) = -1
       link(max) = link(unit end);  link(unit end) = max
       min = min-1;  head(min) = max;  tail(min) = unit
       unit = min
       read sym
    %finish
    %if string=0 %then string=unit %else concatenate(string end,unit)
    string end = unit end
    ->u %unless sym = ',' %or sym = ')' %or sym = nl
    %if exp = 0 %start
       exp = string
       exp end = string end
    %else
       exp = union(string,exp)
       i = link(exp end)
       link(exp end) = link(string end)
       link(string end) = i
    %finish
    %return %unless sym = ','
    read sym %until sym # nl
    ->s
err:exp = 0
%end

%routine convert
%integer i,j,k,m,n,gmax1,loopstop

%routine tcount(%integer x)
%integer t
    %cycle
       %return %if x = 0
       %if x < 0 %start
          tcount(tail(x))
          x = head(x)
       %finish
       t = token(x)
       %exit %if t >= 0
       %return %if t = loopstop
       token(x) = loopstop
       x = link(x)
    %repeat
    k = k-1
%end

%routine add components(%integer x)
%owninteger i,k,t,u
    %while x # 0 %cycle
       %if x < 0 %start
          add components(tail(x))
          x = head(x)
       %finish
       t = token(x)
       %exit %if t >= 0
       %return %if t = loopstop
       token(x) = loopstop
       x = link(x)
    %repeat
    %if x # 0 %then x = link(x) %else t = 0
    u = t&(x'F0000'+15<<11+255)
    i = gmax1
    %cycle
       i = i+1
       %exit %if i > gmax
       k = item(i)
       next(i)=union(next(i),x) %and %return %if k = t
       %if k&(x'F0000'+15<<11+255) = u %start
         print name(p) %unless p = 0
          printstring("-CLASH: ");
          print name(k);  space;  print name(t)
          newline
       %finish
       k = k&255
       %if u = ident %or (u&255<k %and k>=180) %or k = 0 %start
          %cycle i = gmax,-1,i
             item(i+1) = item(i)
             next(i+1) = next(i)
          %repeat
          %exit
       %finish
    %repeat
    gmax = gmax+1
    item(i) = t;  next(i) = x
%end

    loopstop = -1;  gmin = gmax+1
    %cycle i = min,1,max
       converted(i) = 0
    %repeat
    n = next(0)
1:  gmax1 = gmax
    loopstop = loopstop-1
    add components(n)
    item(gmax) = item(gmax)+1024
    %if gmax1 = 0 %start
       inits = gmax
       inits = inits-1 %while inits # 0 %and item(inits)&255 >= first phrase
    %finish
    converted(n) = gmax1+1
    m = 0
    %cycle i = gmin,1,gmax
       j = next(i)
       %if j # 0 %start
          k = converted(j)
          %if k = 0 %start
              loopstop = loopstop-1
              tcount(j)
              converted(j) = k
          %finish
          %if k < m %start
              m = k;  n = j
          %finish
       %finish
    %repeat
    ->1 %if m # 0
    %cycle i = gmin,1,gmax
       k = next(i)
       k = converted(k) %if k # 0
       next(i) = k
    %repeat
%end;  !convert

%routine minimize
%integer i,j,k,m,n
%integerarray stack(1:150)

%integerfn ult map(%integer i)
%integer j
    j=i %and i=map(i) %until i = j %or i = 0
    %result = j
%end

%integerfn equivalent(%integer nn,mm)
%integer i,j,k,pos1,pos2
    pos1 = 0;  pos2 = 0
1:  %cycle
       k = item(mm)
       ->9 %unless item(nn) = k
       i = next(nn);  j = next(mm)
       ->9 %if (i=0 %and j#0) %or (i#0 %and j=0)
       pos1 = pos1+1;  stack(pos1) = nn;  map(nn) = mm
       nn = nn+1;  mm = mm+1
       %exit %if k&1024 # 0;                 !last alternative
    %repeat
2:  %result = 1 %if pos2 = pos1
    pos2 = pos2+1;  i = stack(pos2)
    nn = ult map(next(i));  mm = ult map(next(map(i)))
    ->2 %if nn = mm
    %if nn < mm %start
       i = nn;  nn = mm;  mm = i
    %finish
    ->1 %if nn > n
9:  %while pos1 # 0 %cycle
       i = stack(pos1);  map(i) = i
       pos1 = pos1-1
    %repeat
    %result = 0
%end

    %cycle i = 0,1,gmax
       map(i) = i
    %repeat
   %return %if gmin > gmax
    %cycle n = gmin,1,gmax
       %if map(n) = n %start
          %if n = gmin %or item(n-1)&1024 # 0 %start
             m = 1
             %while m # n %cycle
                %exit %if map(m) = m %and equivalent(n,m) # 0
                m = m+1
             %repeat
          %finish
       %else
          map(n) = ult map(n)
       %finish
    %repeat
    j = gmin-1
    %cycle i = gmin,1,gmax
       k = map(i)
       %if k = i %start
          j = j+1;  map(i) = j
          item(j) = item(i);  next(j) = next(i)
       %else
          map(i) = map(k)
       %finish
    %repeat
    gmax = j
    %cycle i = gmin,1,gmax
       k = next(i)
       next(i) = map(k) %if k # 0
    %repeat
%end;  !minimize

    gmax = 0
1:  read sym %until sym # nl
    ->10 %if sym = '/'
    %if sym = 'S' %and next symbol = 'S' %start
       skip symbol;  p = 0
    %else
       read name(p);  %stop %if p = 0
    %finish
    min = 0;  max = 0
    read sym %until sym#nl %and sym#'-' %and sym#'>'
    accept exp(exp,end)
    ->9 %if exp = 0 %or sym # nl
    concatenate(end,0)
    item(0) = 2047;  next(0) = exp
    convert
    i = gmin
    minimize
    i = map(gmin)
    %if p = 0 %start;                      !ss
!!!          j = item(i);!  k = next(i)
!!!             k = k-inits;!  %stop %if k <= 0
!!!          %if i <= inits %start
!!!             ->99 %if l >= first phrase
!!!             %signal 0,25 %if initial(l) # 0
!!!          %else
!!!          %finish
!!!       gmax = gmax-inits
       %cycle i = 1, 1, inits
          l = item(i)&255
          %continue %if l >= 200
          l = atomic(l) %if 130 <= l < 180
          %signal 0,25 %if initial(l) # 0
          initial(l) = i;  initnext(l) = item(i)
       %repeat
       select output(glist)
       newline
    %else
       phrase(p) = i
       select output(glist)
       newline
       print name(p);  printstring(" =>")
       hwrite(i,1)
    %finish
    k = 1024
    %cycle i = gmin,1,gmax
       %if k&1024 # 0 %start
          newline;  hwrite(i,3);  j = 0
       %finish
       j = j+1
       %if j > 5 %start
          newline;  spaces(4);  j = 1
       %finish
       spaces(3)
       k = item(i)
       %if k&255 # 0 %start
          print name(k)
       %else
          printstring("*E")
          print symbol('+') %and k=k-256 %while k&x'300' # 0
       %finish
       hwrite(next(i),1)
    %repeat
    select output(err)
    ->1
9:  printstring("WRONG FORMAT AT: ")
    %while sym # nl %cycle
       print symbol(sym);  read sym
    %repeat
    newline
    ->1
    !deal with initial phrase
    !assumes exactly one (imp)
10: %if inits = 1 %start;    ! not imp!!!
       selectoutput(err)
       printstring("NOT AN IMP GRAMMAR");  newline
       %return
     %finish
    p = phrase(item(inits+1)&255)
    %signal 0,26 %if p = 0
    %cycle
       j = item(p);  k = j&255
       %signal 0,27 %if k >= 160
       k = atomic(k) %if k >= 120
       %signal 0,28 %if initial(k) # 0
       initial(k) = p!x'8000';  initnext(k) = j
       %exit %if j&1024 # 0
       p = p+1
    %repeat
    initial(0) = initial(182);      !%decl
    select output(glist)
    newlines(2)
    %cycle i = 0,1,119
       k = initial(i)
       %if k # 0 %start
          hwrite(i,2);  printstring(":  ")
          print name(initnext(i))
          hwrite(k&255, 3)
          printsymbol('`') %if k < 0
          newline
       %finish
    %repeat
    select output(err)
%end;  !read grammar

%routine read atoms
%integer i,j,k,dict,dmax,code,class,sub
%integerarray char,cont,alt(0:1000)

%routine read code
   %integer n
    code = next symbol;  sub = 0
    %if code # ',' %and code # nl %start
       skip symbol
      %if code = '$' %start
         read(code);  %return
      %finish
       %return %unless code = '('
       read(sub)
       %while nextsymbol = '+' %cycle
         skipsymbol;  read(n);  sub = sub+n
      %repeat
       skip symbol
    %finish
    code = class+128
%end

%routine insert in(%integername x)
    %cycle
       %while char(x) < code %cycle
          cont(x) = sub %if cont(x) = 0
          x == alt(x)
       %repeat
       %if char(x) # code %start
          dmax = dmax+1;  char(dmax) = code
          cont(dmax) = 0;  alt(dmax) = x;  x = dmax
       %finish
       %exit %if code&128 # 0
       read code
       x == cont(x)
    %repeat
    sub = cont(alt(x)) %if sub = 0 %and alt(x) # 0
    cont(x) = sub
%end

%routine store(%integer x)
%integer m,n,v, mm, q
    %cycle
       kmax = kmax+1;  n = kmax
       m = alt(x);  mm = m
       store(m) %and m=x'8000' %if m # 0
       v = char(x);  x = cont(x)
       %exit %if v&128 # 0
       %if m = 0 %start;  !no alternatives
          %if alt(x) = 0 %and char(x)&128 = 0 %start
             v = char(x)<<7+v;  x = cont(x)
          %finish
       %else
         q = kmax-n+1
         %if q>>7 # 0 %start
            selectoutput(0)
            printstring("Keydict overflow!");  newline
            %signal 15,15
            %stop
         %finish
          v = q<<7+v!x'8000'
       %finish
       keydict(n) = v
    %repeat
   %if mm = 0 %start
      kmax = kmax+1;  keydict(kmax) = 0
   %else
      kmax = kmax-1
   %finish
   keydict(n) = m + x'4000' + (keydict(n+1)&127)<<7 + v&127
   keydict(n+1) = x
%end

    dict = 0;  dmax = 0;  char(0) = 999
1:  %cycle
       sym = next symbol
       %exit %unless sym = '[' %or sym = nl
       read symbol(sym) %until sym = nl
    %repeat
    ->10 %if sym = '/'
    read(class)
    newname = 1
    read sym;  read name(class)
    newname = 0
    %if class < 130 %start
       %if sym # '[' %start
          read(sym) %if sym = '$'
          %cycle
             code = sym;  insert in(dict)
             read symbol(sym)
             %exit %if sym # ','
             read symbol(sym) %until sym # ' ' %and sym # nl
          %repeat
       %finish
    %else
       %if class <= first phrase %and sym = '=' %start
          read sym;  read name(atomic(class))
       %finish
    %finish
    read symbol(sym) %while sym # nl
    ->1

%routine display(%integer i,s)
%integer j
   %routine show(%integer sym)
      sym = '$' %if sym = nl
      printsymbol(sym)
   %end
1:  j = keydict(i)
    %if j&x'4000' = 0 %start
       show(j&127)
       %if j&x'8000' = 0 %start
          j = j>>7
          show(j) %and s=s+1 %if j # 0
          space
          i = i+1;  s = s+2
          ->1
       %finish
       space
       display(j>>7&127+i,s+2)
    %else
       print symbol(':');  print name(j&127)
       space %and print name(j>>7&127) %unless j>>7&127 = 0
       j = keydict(i+1)&x'3FFF'
       hwrite(j, 4) %unless j = 0
       newline
       %return
    %finish
    %return %if j>>15 = 0
    spaces(s);  i = i+1
    ->1
%end

10: select output(dlist);  newlines(2)
    kmax = 126;  keydict(32) = 0
    %cycle i = 33,1,126
       print symbol(i);  space
       %if char(dict) = i %start
          j = (kmax+1)<<2
          store(cont(dict))
          dict = alt(dict)
          display(j>>2,2)
       %else
          print symbol('?');  newline
          j = 32<<2
       %finish
      !let:0  dig:1  term:2  other:3 
       j = j+3 %unless 'A'<=i<='Z'
       j = j-2 %if '0'<=i<='9'
       j = j-1 %if i = ';'
       keydict(i) = j
    %repeat
    keydict('~') = keydict('^')
    newlines(2)
    select output(err)
%end

%integer i,j,k
    charmax = 0
   item(i) = 0 %and next(i) = 0 %for i = -1, 1, 800
   index(i) = 0 %for i = 0, 1, 255
   atomic(i) = i %for i = 130, 1, 179
   phrase(i) = 0 %for i = first phrase, 1, 255
   initnext(i) = 0 %and initial(i) = 0 %for i = 0, 1, 255
    select output(err)
    read symbol(i) %until i = '/'
    read symbol(i) %until i = nl
    read atoms
    read symbol(i) %until i = nl
    read grammar
!write required values
    select output(new)
   printstring("   %endoflist");  newline
    printstring("%conststring(8)%array text(0:255) = %c
""Z"",")
    k = 5;  outstring = 8
    %cycle j = 1, 1, 255
       printsymbol('"');  PRINT NAME(J);  PRINTSYMBOL('"')
       printsymbol(',') %unless j = 255
       k = k-1;  k = 6 %and newline %if k <= 0
    %repeat
    newline
    outstring = -1
    printstring("%constinteger gmax1=");  hwrite(gmax,0)
    newline
    printstring("%owninteger gmax=");  hwrite(gmax,0);  newline
    printstring("%constinteger imp phrase =");  hwrite(inits+1, 0)
    newlines(2)
    printstring("%ownshortintegerarray phrase(200:255) = %C")
    %for i = 200, 1, 255 %cycle
       newline %if i&7 = 0
       hwrite(phrase(i),3)
       print symbol(',') %unless i = 255
    %repeat
    newlines(2)
    printstring("%constbyteintegerarray atomic(130:179) = %c")
    k = 0
    %cycle i = 130,1,179
       newline %if k&7 = 0
       k = k+1
       hwrite(atomic(i),3)
       print symbol(',') %unless i = 179
    %repeat
    newlines(2)

%integerfn packed(%integer j,k)
   j = (j&1024)<<5 + (j&x'0300')<<4 + (j>>3&x'0100')<<6 + (j>>8&x'F00')
   %result = j+k&255
%end

   printstring("!  FLAG<1> 0<1> SS<2> 0<3> T<1> LINK<8>");  newline
    printstring("%constshortintegerarray initial(0:119) = %c")
    %cycle i = 0,1,119
       newline %if i&7 = 0
       hwrite(initial(i), 7)
       print symbol(',') %unless i = 119
    %repeat
    newlines(2)
   printstring("!  MORE<1> 0<1> ORDER<2> TYPE<4> CLASS<8>");  newline
    printstring("%ownshortintegerarray gram(0:max grammar) = %c")
    %cycle i = 0,1,gmax
       newline %if i&7 = 0
       k = 0
       k = packed(item(i)!!1024,item(i)) %if i # 0
       hwrite(k,7)
       print symbol(',')
    %repeat
   newline;  printstring("0(max grammar-")
   write(gmax, 0);  printsymbol(')')
   newlines(2)
   printstring("%ownshortintegerarray glink(0:max grammar) = %c")
   %cycle i = 0, 1, gmax
      newline %if i&7 = 0
      hwrite(next(i), 7)
      printsymbol(',')
   %repeat
   newline;  printstring("0(max grammar-")
   write(gmax, 0);  printsymbol(')')
   newlines(2)
    printstring("%constshortintegerarray kdict(32:");  hwrite(kmax,0)
    printstring(") = %c")
    %cycle i = 32,1,kmax
       newline %if i&7 = 0
       hwrite(keydict(i),7)
       print symbol(',') %unless i = kmax
    %repeat
    newline
   printstring("   %list");  newline
   printstring("%endoffile");  newline
   selectoutput(0)
   printstring("Grammar complete");  newline
%endofprogram
 H?   & &	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %begin
   %begin
      %begin
         %begin
            %begin
               %integer x,y
               %integerarray a(1:X+y)
               x=a(a(x*(Y+1)))
            %end
         %end
      %end
   %end
%endofprogram
 H?    
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!          0   }^           )     ^      NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z         A    ! E    ! G    ! I    a K   dQ@    D"Z 	ox     ,    0@   ox     ox     ox     ox      \ 	   
    l?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nX# Y !Y !&\ Z  B!$$A> З  $1$H  H X [ &B0P  [ ,&' ?P  
*&30H  P  ї  C Kї  $$A> 
Y  #%$$A> 
qPr  PB &(pX  ?$PS?PE   &T 4 ?&?$$A> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$  w A , X< ,U> L 4$QPT Xl 0Un 
6P4 A   , DALX ,&aA< DA X  U A XQ  U^ P\ ,|  >w A , X An{  w A , X Az  
w A , X Ay  	w P (A , X Ax          ?| @      H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |             
     #p"Process started 23-NOV-81 20:35:02   318	8 	
   M00        (  h            3 0d    "   "       2 d 
0         
      H?    
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !! %option stack=40
!!!!!!  19-Feb-82!!!! 26/6/78 - IMPASEMS412
{Modified to run on new subsystem so that old supervisor can be supported}

%OWNSTRING(4) P2VERSION = "4.13"


!!!!!!%CONTROL 3;                     ! CHECK SWITCHES AND STACK LIMIT
%BEGIN;                         ! INTERDATA 7/32 IMP ASSEMBLER !

! SIZE CONSTANTS

   %CONSTINTEGER MAX ENVIRS = 13
!  %CONSTINTEGER MAX VARS   = 490
   %CONSTINTEGER MAX LABELS = 80
   %CONSTINTEGER MAX DEPTH  = 16
   %CONSTINTEGER MAX STACK  = 31
   %CONSTINTEGER INIT GLA   = 32;    !  **USED LOCALLY AND IN PASS 3**
   %CONSTINTEGER LAST PERM  = -24;   ! MUST MATCH PERM TABLE IN PASS 3

!  STATIC GLA LAYOUT
!
!     0:  STACK LIMIT
!     4:  @diag tables (zero if missing)
!     8:  IOCP switch base
!    12:  IOCP gla base
!    16:  IOCP code base
!    20:  IOCP base level locals
!    24:  -spare-
!    28:  -spare-
!


   %CONSTINTEGER INITIAL FREE = 5120;  ! INITIAL FREE STACK(BYTES)
   %CONSTINTEGER MIN FREE = 600;   ! LOWER LIMIT ON FREE STACK SPACE

! ON THE 32-BIT SERIES, EFFICIENT(RX1) BASE+DISPLACEMENT ADDRESSING
! IS ONLY AVAILABLE FOR VALUES OF DISPLACEMENT < 16*1024.
! ARRAYS WITH FIXED BOUNDS ARE PUT INTO THE STATIC STACK FRAME
! UNTIL THE FRAME SIZE > 'MAX STATIC' LEAVING [16*1024 - MAX STATIC]
! BYTES AVAILABLE FOR SCALARS.  THERE MAY STILL BE PROBLEMS WITH
! LARGE RECORDS (WHICH CAN CONTAIN ARRAYS).

   %CONSTINTEGER  MAX STATIC = 13000



! WORDLENGTH DEPENDENT VALUES:

   %CONSTINTEGER  REGLEN=4;     ! REGISTER LENGTH(IN 8-BIT BYTES)



!  COMPILER CONTROL OPTIONS (DEFAULT MARKED *)
   %CONSTINTEGER TEST SWITCH = 1;   !* CHECK SWITCH JUMPS
   %CONSTINTEGER STKDIAG     = 2;   !* CHECK EXTENT OF STACK
   %CONSTINTEGER ARRAY DIAG  = 4;   !* CHECK ARRAY BOUNDS
   %CONSTINTEGER FORDIAG     = 8;   !* VALIDATE %FOR PARAMETERS
   %CONSTINTEGER ASS DIAG    =16;   !* TEST FOR TRUNCATION
   %CONSTINTEGER UNASS DIAG  =32;   !* CHECK FOR UNASSIGNED VARIABLES
   !
   %CONSTINTEGER TRUSTED     =4096; !  ENABLE DIRTY OPTIMISATIONS

! %CONTROL 0 GIVES TIGHTEST CODE (NO CHECKING AT ALL!)




!  COMPILER ERROR CODES
!  --------------------
!  CODE      ROUTINE                    MEANING
!  ----      -------                    -------
!    1       RELEASE                    TOO MANY CALLS ON 'RELEASE'
!    2       CHECK RELEASED             TOO FEW CALLS ON 'RELEASE'
!    3       HAZARD                     FAULTY PARAM. SUPPLIED TO HAZARD??
!    4       ""                         "" ????
!    5       RX, RI2, RI3               ILLEGAL ADDRESS FIELD GENERATE
!    6       LOOKUP                     UNDEFINED NAME IN INTERMEDIATE COD
!    7       STACK, SSTACK ETC          DESCRIPTOR STACK OVERFLO
!    8       SET BOTH, POP LHS, ASSIGN  DESCRIPTOR STACK UNDERFLO
!    9       AMAP                       FAULTY PARAM. SUPPLIED TO 'AMAP'
!    10      LOAD                       'REAL' AS ADDRESS?
!    11      LOAD                       FLOATING REG. REQ'D
!    12      "                          "
!    13      COP                        FAULTY PARAM. SUPPLIED TO 'COP'
!    14      ASSEMBLE                   DESCRIPTOR STACK NON-EMPTY AT 'O
!    15      ASSIGN                     FAULTY PARAM. SUPPLIED TO 'ASSIGN'
!    16      LOAD                       'REAL', INTEGER REQ''D
!    17      DESCRIPTOR                 NO FREE DESCRIPTORS
!    18      DROP                       DESCRIPTOR NOT IN USE
!    19      ASSEMBLE                   DANGLING DESCRIPTOR

! REGISTERS

   %CONSTINTEGER R0   = 1
   %CONSTINTEGER R1   = 2
   %CONSTINTEGER R2   = 3
   %CONSTINTEGER R3   = 4
   %CONSTINTEGER R4   = 5
   %CONSTINTEGER P2   = 6
   %CONSTINTEGER P1   = 7
   %CONSTINTEGER R9   = 8
   %CONSTINTEGER R10  = 9
   %CONSTINTEGER R11  = 10
   %CONSTINTEGER R12  = 11
   %CONSTINTEGER LINK = 12
   %CONSTINTEGER FPR0 = 13
   %CONSTINTEGER FPR2 = 14
   !             FPR4 = 15
   !             FPR6 = 16
   !             FPR8 = 17
   !             FPR10= 18
   !             FPR12= 19
   %CONSTINTEGER FPR14= 20

   !   21 - 40 ARE STORE EQUIVALENTS OF ABOVE

   %CONSTINTEGER R15  = 41
   %CONSTINTEGER GLA  = 42
   %CONSTINTEGER WSP  = 43
   %CONSTINTEGER CODE = 44

   %CONSTINTEGER ANY  = 45
   %CONSTINTEGER ANY0 = 46
   %CONSTINTEGER ANYF = 47
   %CONSTINTEGER PARAM= 48

   %CONSTINTEGER STORE= 20

   %CONSTBYTEINTEGERARRAY BASE REG(0:5) = R0, R15, R9, R10, R11, R12
   %CONSTBYTEINTEGERARRAY ACTUAL(0:44) = 0,
                                     0, 1, 2, 3, 4, 5, 6, 9,
                                    10,11,12, 8,
                                     0, 2, 4, 6, 8,10,12,14,
                                     0(20), 15, 13, 7, 14


! DATA FORMS

   !  EXTERNAL

   %CONSTINTEGER SWITCH    = 6
   %CONSTINTEGER ARRAY     = 11
   %CONSTINTEGER ARRAYNAME = 12

   !  INTERNAL

   %CONSTINTEGER CONSTANT = 0
   %CONSTINTEGER V IN R   = 1
   %CONSTINTEGER A IN S   = 2
   %CONSTINTEGER V IN S   = 3
   %CONSTINTEGER A IN REC = 4
   %CONSTINTEGER V IN REC = 5
   %CONSTINTEGER AV IN S  = 6
   %CONSTINTEGER AV IN REC= 7

!  LABEL CONSTANTS

   %CONSTINTEGER DEFINE   = 0
   %CONSTINTEGER REDEFINE = 1

! DATA TYPES

   %CONSTINTEGER INTEGER = 1
   %CONSTINTEGER BYTE    = 2
   %CONSTINTEGER SHORT   = 3
   %CONSTINTEGER STRING  = 4
   %CONSTINTEGER RECORD  = 5
   %CONSTINTEGER REALS   = 6
   %CONSTINTEGER LONG    = 7

   %CONSTINTEGER UNSIGNED HALFWORD = 255;   ! INTERNAL TO PASS 2

! OWN INFO

!  %CONSTINTEGER OWN    = 1
   %CONSTINTEGER CON    = 2
   %CONSTINTEGER PERMRT = 7

! PROC INFO

   %CONSTINTEGER FORMATS   = '2'
   %CONSTINTEGER PROCEDURE = '1'
   %CONSTINTEGER SPEC      = '0'

!  OBJECT FILE DIRECTIVES

   %CONSTINTEGER START     = 1
   %CONSTINTEGER LOAD CODE = 2
   %CONSTINTEGER LOAD GLA  = 3
   %CONSTINTEGER LINE FLAG = 4
   %CONSTINTEGER C END     = 5
!  %CONSTINTEGER L DATA    = 6
   %CONSTINTEGER DLINE     = 10
   %CONSTINTEGER DIAGS     = 11

! DIRECTIVE FILE COMMANDS

   %CONSTINTEGER TAG DEF   = 1
   %CONSTINTEGER C REF     = 2;  ! CONDITIONAL JUMP REF.
   %CONSTINTEGER J REF     = 3;  ! UNCONDITIONAL JUMP REF.
   %CONSTINTEGER R REF     = 4;  ! ROUTINE REF. (UNCONDITIONAL)
   %CONSTINTEGER P REF     = 5;  ! PERM REF. (UNCONDITIONAL)
   %CONSTINTEGER PATCH GLA = 6
   %CONSTINTEGER PATCHCODE = 7
   %CONSTINTEGER D END     = 8;  ! END OF DIRECTIVES FILE

! FILE DEFINITION

   %CONSTINTEGER INSTREAM = 2
   %CONSTINTEGER REPORT   = 0;    ! ...ERROR MESSAGE STREAM
   %CONSTINTEGER LIST     = 1
   %CONSTINTEGER OBJECT   = 2
   %CONSTINTEGER DIRECT   = 3


! SYMBOLS

   %CONSTINTEGER COMMA = ','
   %CONSTINTEGER MINUS = '-'

! PERM ROUTINES (FPR4,  FPR2,P1,P2,R4,  R3,R2,R1,R0)

   %CONSTINTEGER MONITOR    = X'1EF01'
   %CONSTINTEGER R COPY     = X'00902'
   %CONSTINTEGER R CLEAR    = X'00903'
   %CONSTINTEGER SWJUMP     = X'1EF04'
   %CONSTINTEGER ASET       = X'06F05'
   %CONSTINTEGER IEXP       = X'00B07'
   %CONSTINTEGER REXP       = X'18108'
   %CONSTINTEGER ALLOC      = X'02E09'
   %CONSTINTEGER SMOVE      = X'0090B', CONC1 = X'0090B'
   %CONSTINTEGER CONC2      = X'0630C'
   %CONSTINTEGER SCOMP      = X'06B0D'
   %CONSTINTEGER RSYM       = X'1EF0E'
! PERM ITEMS TO PERFORM VARIOUS RUN-TIME CHECKS
   %CONSTINTEGER EXBUNASS   = X'01112'
   %CONSTINTEGER EXB        = X'00113'
   %CONSTINTEGER A REF      = X'00314'
   %CONSTINTEGER STRINGASS  = X'00015';      ! ASSIGN TEST FOR STRINGS
   %CONSTINTEGER ASSTH      = X'00016';      ! ASSIGN TEST FOR SHORTS
   %CONSTINTEGER ASSTB      = X'00017';      ! ASSIGN TEST FOR BYTES
   %CONSTINTEGER FORTEST    = X'1EF18'

!   FIXED GLA WORDS

   !    (WORD 0 IS STACK LIMIT POINTER)
   %CONSTINTEGER SIGNAL EP = 4;       ! ADDRESS OF %SIGNAL


!   NOTEWORTHY CODE BLOCK DISPLACEMENTS

   %CONSTINTEGER UNASS PAT = 16;       ! UNASSIGNED VARIABLE PATTERN (80808080)

! OPERATIONS

   %CONSTINTEGER NOT = 1
   %CONSTINTEGER NEG = 2
   %CONSTINTEGER ADD = 3
   %CONSTINTEGER SUB = 4
   %CONSTINTEGER MUL = 6
   %CONSTINTEGER DIV = 7
   %CONSTINTEGER AND = 8
   %CONSTINTEGER IOR = 9
   %CONSTINTEGER XOR = 10
   %CONSTINTEGER LSH = 11
   %CONSTINTEGER RSH = 12
   %CONSTINTEGER EXP = 13
   %CONSTINTEGER CONC= 14
   %CONSTINTEGER SADD= 15;                !  SPECIAL ADD (V=V+??)
   %CONSTINTEGER RDIV= 16
   %CONSTINTEGER REM = 17

! OPCODES

   %CONSTINTEGER LIS = X'2400', LCS = X'2500'
   %CONSTINTEGER LR  = X'0800'
   %CONSTINTEGER LH  = X'4800', STH = X'4000'
   %CONSTINTEGER LHI = X'C800'
   %CONSTINTEGER LM  = X'D100', STM = X'D000'
   %CONSTINTEGER LHL = X'7300'


   %CONSTINTEGER AIS=X'2600', AHI=X'CA00', AH=X'4A00', AR=X'0A00'
   %CONSTINTEGER SIS=X'2700', SHI=X'CB00', SH=X'4B00', SR=X'0B00'
   %CONSTINTEGER AM  = X'5100'
   %CONSTINTEGER AHM = X'6100'

   %CONSTINTEGER C   = X'5900',  CH =X'4900', CI =X'F900', CR =X'0900'
   %CONSTINTEGER CL  = X'5500',  CLH=X'4500', CLI=X'F500', CLR=X'0500'
   %CONSTINTEGER                 CHI=X'C900'
   %CONSTINTEGER                CLHI=X'C500'
   %CONSTINTEGER CHVR = X'1200'




   %CONSTINTEGER TI  = X'F300', THI = X'C300'

   %CONSTINTEGER LBR = X'9300', LB  = X'D300', STB = X'D200'
   %CONSTINTEGER CLB = X'D400'

   %CONSTINTEGER SRA = X'EE00'

   %CONSTINTEGER BAL = X'4100'
   %CONSTINTEGER JUMP= 12
   %CONSTINTEGER BFCR= X'0300'

   %CONSTINTEGER SVC = X'E100'
   %CONSTINTEGER LME = X'7200', STME= X'7100'
   %CONSTINTEGER LER = X'2800'
   %CONSTINTEGER LE  = X'6800', STE = X'6000'
   %CONSTINTEGER CER = X'2900'
   %CONSTINTEGER CE  = X'6900'
   %CONSTINTEGER AER=X'2A00', SER=X'2B00', MER=X'2C00', DER=X'2D00'
   %CONSTINTEGER AE =X'6A00', SE =X'6B00', ME =X'6C00', DE =X'6D00'
   %CONSTINTEGER FXR = X'2E00', FLR = X'2F00'

!   FULLWORD OPCODES
   %CONSTINTEGER LW  = X'5800', ST = X'5000'
   %CONSTINTEGER LI  = X'F800'
   %CONSTINTEGER LA  = X'E600'

   %CONSTINTEGER SLLS= X'1100'
   %CONSTINTEGER SRLS= X'1000'
   %CONSTINTEGER SLL = X'ED00'
   %CONSTINTEGER SRL = X'EC00'

   %CONSTINTEGER AW  = X'5A00'
   %CONSTINTEGER SW  = X'5B00'
   %CONSTINTEGER AI  = X'FA00'
   %CONSTINTEGER SI  = X'FB00'

   %CONSTINTEGER MW  = X'5C00'
   %CONSTINTEGER MR  = X'1C00'
   %CONSTINTEGER DW  = X'5D00'
   %CONSTINTEGER DR  = X'1D00'

   %CONSTINTEGER OR=X'0600', OW=X'5600', OH=X'4600', OI=X'F600'
   %CONSTINTEGER XR=X'0700', XW=X'5700', XH=X'4700', XI=X'F700'
   %CONSTINTEGER NR=X'0400', NW=X'5400', NH=X'4400', NI=X'F400'
   %CONSTINTEGER OHI = X'C600', XHI = X'C700', NHI = X'C400'


   %RECORDFORMAT VARFM(%INTEGER DISP, %SHORTINTEGER FORMAT, EXTRA,  %C
                   ID, LENGTH,  %BYTEINTEGER BASE, TYPE, FORM, SIZE)
   %RECORDFORMAT  STACKFM(%INTEGER  DISP, FORMAT, EXTRA, LENGTH, DV,  %C
                          %SHORTINTEGER  BASE, LOP,TYPE, FORM,  %C
                        %RECORD(STACKFM)%NAME  LINK)
   %RECORDFORMAT SPTFM(%RECORD(STACKFM)%NAME V)
   %RECORDFORMAT LABELFM(%SHORTINTEGER ID, TAG, %C
                         %BYTEINTEGER REG, BASE, %C
                         %INTEGER LIMIT, DISP)
   %RECORDFORMAT USEFM(%INTEGER  DISP, CA, %C
                       %SHORTINTEGER BASE, %C
                       %BYTEINTEGER TYPE,FORM)
   %RECORDFORMAT ENVFM(%INTEGER LABEL, LIMEN, %C
                                 %RECORD(USEFM)%ARRAY E(1:40))

!  DATA ARRAYS

   %RECORD(USEFM)%ARRAY USE(1 : 44);! REGISTER USAGE
   %RECORD(USEFM) KNOWN
   %INTEGERARRAY ACTIVITY(0 : 44);! REGISTER ACTIVITY
   %RECORD(LABELFM)%ARRAY LABELS(1 : MAX LABELS)
   %RECORD(SPTFM)%ARRAY STACKED(1 : MAX DEPTH);! MAIN STACK
   %RECORD(STACKFM)%ARRAY STAK(0 : MAX STACK); ! STACK ELEMENTS
   %INTEGERARRAY USED(0:20)
   %RECORDFORMAT DFM(%RECORD(STACKFM)%NAME D, %RECORD(DFM)%NAME LINK)
   %RECORD(STACKFM)%NAME DESC ASL
   %RECORD(DFM)%ARRAY DLIST(0:MAX STACK)
   %RECORD(DFM)%NAME DASL
   %RECORD(DFM) USING

   %OWNBYTEINTEGERARRAY VBUF(1:10)
   %OWNINTEGER VP = 0
   %OWNINTEGER XLEVEL = 0
   %INTEGER BLOCK WORD
   %OWNRECORD(VARFM) BEGIN
   %RECORD(ENVFM) NULL ENV
   %constrecord(*)%name null == (0)      {   %OWNRECORD(STACKFM) NULL   }
   %RECORD(VARFM)%NAME DECVAR

   %OWNINTEGER CONTROL = B'11111111'; ! ALL CHECKS ENABLED INITIALLY
   %OWNINTEGER PERMS = LAST PERM
   %INTEGER DYNAMIC, DOPE
   %SHORTINTEGER HALF
   %INTEGER J
   %INTEGER CA;           !  CODE ADDRESS
   %INTEGER GA, DIAG GLA; !  GLA ADDRESS
   %INTEGER DA
   %INTEGER LINE SIZE
   %OWNINTEGER REALGA;   ! FRIG FOR OWNREALARRAY
   %INTEGER LIMEN;      !  BACKWARD EXTENT OF KNOWLEDGE
   %INTEGER CURRENT LINE
   %INTEGER ENVP;       !  LAST ENVIRONMENT USED (CIRCULAR)
   %INTEGER STP;        ! STACK POINTER
   %INTEGER STACK ASL;  ! STACK DESCRIPTOR POINTER
   %ownINTEGER FRAME = 0;      ! LOCAL STACK FRAME EXTENT
   %OWNINTEGER  MIN TEMP = 0
   %INTEGER PARMS;      ! START OF PARAMETER STACK
   %INTEGER LOCAL
   %INTEGER INVERT,SWOPPED;!  CONDITION INVERSION FLAG
   %INTEGER UNCOND JUMP;      !  ADDRESS OF CODE HOLE
   %RECORD(LABELFM)%NAME FLAB;    ! %FOR LABEL
   %INTEGER GTYPE,GMODE;      ! PARAMETER FLIP-FLOP
   %INTEGER OTYPE=0, OWNTYPE, OWNFORM, OWNVAL
   %INTEGER  FAULTY, ENTER UNASS

   %RECORD(STACKFM) ST WORK
   %RECORD(STACKFM) CCV
   %INTEGER CCREG, CCCA=-1;      !  CONDITION-CODE INFO

   %RECORD(STACKFM)%NAME ACTIVE STRING
   %BYTEINTEGERNAME CSLEN
   %BYTEINTEGERARRAY CURRENT STRING(0 : 255)

   %RECORD(ENVFM)%ARRAY ENVIR(0:MAX ENVIRS);! WELL AWAY FROM ALL

   %INTEGER  MAX VARS;  MAX VARS = FREE SPACE - INITIAL FREE
   %BEGIN
      MAX VARS = MAX VARS + INITIAL FREE//4 %IF MAX VARS <= 0
      MAX VARS = 16 %IF MAX VARS <= 0
      MAX VARS = MAX VARS>>4;  ! BYTE LENGTH OF 'VARFM'
!      SELECT OUTPUT(LIST)
!      PRINTSTRING("PASS 2 VERSION ");!  PRINTSTRING(P2VERSION)
!      WRITE(MAX VARS, 1);!  PRINTSTRING(" VARS");!  NEWLINE
   %END

   %RECORD(VARFM)%ARRAY  VAR(1:MAX VARS)


%ROUTINESPEC  RX(%INTEGER  OP, R, X, D)


%ROUTINE PHEX(%INTEGER N)
   %INTEGER J,K
   %CYCLE J = 1,1,4
      K = (N>>12)&15;  N = N<<4
      %IF K > 9 %THEN K = K-10+'A' %ELSE K = K+'0'
      PRINTSYMBOL(K)
   %REPEAT
%END

%ROUTINE DECODE(%INTEGER WORD)
   %OWNINTEGER LAST,N
   SELECTOUTPUT(LIST)
   %IF LAST # CURRENT LINE %START
      LAST = CURRENT LINE
      NEWLINE %UNLESS N = 0
      N = 16
      WRITE(CURRENT LINE, 4);  SPACE
      PHEX(CA);  PRINTSYMBOL(':')
   %ELSE
      SPACES(11) %IF N = 16
   %FINISH
   SPACES(2);  PHEX(WORD)
   N = N-1
   N = 16 %AND NEWLINE %IF N <= 0
   SELECTOUTPUT(OBJECT)
%END
   %ROUTINE SHOW(%RECORD(STACKFM)%NAME V)
      SELECTOUTPUT(REPORT) %IF CONTROL < 0
      WRITE(V_TYPE, 1);  WRITE(V_FORM, 2)
      WRITE(V_BASE, 2);  WRITE(V_DISP, 5)
      WRITE(V_EXTRA, 5);  WRITE(V_LENGTH, 5)
      %IF V_LOP # 0 %START
         WRITE(V_LOP, 2);  PRINTSYMBOL(':')
         SHOW(V_LINK)
      %ELSE
         NEWLINE
      %FINISH
      SELECTOUTPUT(OBJECT) %IF CONTROL < 0
   %END
   %ROUTINE ABORT(%INTEGER CODE)
      %INTEGER I,J,L,FATAL
      %SWITCH SW(-15:0)
      %RECORD(DFM)%NAME DD
      I = REPORT;  FATAL = 1
      CONTROL = 0
      %CYCLE
         SELECT OUTPUT(I)
         %IF CODE > 0 %START;      ! ... IT'S A COMPILER FAULT
            PRINT STRING("*COMPILER ERROR"); WRITE(CODE,1)
            PRINT STRING(" AT LINE");  WRITE(CURRENT LINE,1)
            NEWLINE
            %IF STP > 0 %START
               PRINT STRING("STACK"); NEWLINE
               SHOW(STACKED(J)_V) %FOR J = 1,1,STP
            %FINISH
            %UNLESS USING_LINK == NULL %START
               PRINTSTRING("USING:");  NEWLINE
               DD == USING_LINK
               %CYCLE
                  SHOW(DD_D);  DD == DD_LINK
                  %EXIT %IF DD == NULL
               %REPEAT
            %FINISH
            ->CONT %IF I = REPORT
            %SIGNAL 15,1;            ! ... SIGNAL COMPILER FAULT
         %FINISH
         PRINT SYMBOL('*');  WRITE(CURRENT LINE,1);  PRINT STRING(": ")
         -> SW(CODE)

SW(0):
   PRINT STRING("MORE STORE PLEASE!!");  -> CONT
SW(-1):
SW(-2):
   PRINT STRING("MORE STORE REQ'D FOR THIS COMPILATION");  -> CONT
SW(-3):
   PRINT STRING("BLOCKS TOO DEEPLY NESTED");  -> CONT
SW(-4):
   PRINT STRING("TOO MANY NAMES");  -> CONT
SW(-5):
   PRINT STRING("TOO MANY LABELS");  -> CONT
SW(-6):
   PRINT STRING("DIVISION BY ZERO");  -> NON FATAL
SW(-7):
SW(-8):
   PRINT STRING("ARRAY INSIDE OUT");  -> NON FATAL
SW(-9):
   PRINT STRING("DECLARATION OUT OF CONTEXT");  -> NON FATAL
SW(-10):
   PRINT STRING("FAULTY SWITCH DECLARATION");  -> NON FATAL
SW(-11):
   PRINT STRING("%RESULT UNSPECIFIED");  -> NON FATAL
SW(-12):
   PRINT STRING("ILLEGAL %FOR PARAMETERS");  ->WARNING
SW(-13):
   PRINTSTRING("STRING CONSTANT TOO LONG");  ->WARNING
SW(-14):
   PRINTSTRING("UNASSIGNED CHECK INHIBITED")
   CONTROL = CONTROL&(\UNASS DIAG);  ->WARNING
SW(-15):
   PRINTSTRING("LOCALS > 16K ???")

WARNING:
      L = 0

NON FATAL:
      FATAL = 0
CONT:
      NEWLINE
      %IF I = LIST %START
         %SIGNAL 15,2 %IF FATAL # 0
         FAULTY = FAULTY+L;  SELECT OUTPUT(OBJECT); %RETURN
      %FINISH
      I = LIST

      %REPEAT
   %END
   %ROUTINE DISPLAY VAR(%RECORD(VARFM)%NAME V)
      SELECTOUTPUT(LIST)
      WRITE(V_ID, 3);  PRINTSYMBOL(':')
      WRITE(V_TYPE, 2);  WRITE(V_FORM, 2)
      WRITE(V_BASE, 3);  WRITE(V_DISP, 4)
      WRITE(V_EXTRA, 4);  WRITE(V_FORMAT, 4)
      NEWLINE
      SELECTOUTPUT(OBJECT)
   %END
   %ROUTINE REAL ERROR(%INTEGER N)
      %INTEGER I
      %CONSTSHORTINTEGERARRAY SYM(1:14) = '\', '?', '?', '?', '@',
                                          '?', '?', '&', '!',-'!',
                                         -'<', -'>', '?', '.'
      I = REPORT
      %CYCLE
         SELECT OUTPUT(I)
         PRINTSYMBOL('*');  WRITE(CURRENT LINE, 4)
         PRINTSTRING(" ILLEGAL REAL OPERATION '")
         N = SYM(N)
         PRINTSYMBOL(-N) %IF N < 0
         PRINTSYMBOL(|N|);  PRINTSYMBOL('''');  NEWLINE
         %EXIT %IF I = LIST
         I = LIST
      %REPEAT
      FAULTY = FAULTY+1
      SELECTOUTPUT(OBJECT)
   %END
   %PREDICATE FLOATING(%RECORD(STACKFM)%NAME V)
      %TRUE %IF V_TYPE = REALS %OR (V_LOP # 0    %C
             %AND (V_LOP = RDIV %OR (v_link ## NULL %and V_LINK_TYPE = REALS)))
      %FALSE
   %END
   %PREDICATE SAME(%RECORD(STACKFM)%NAME L, R)
      %FALSE %IF L_BASE # R_BASE %OR L_DISP # R_DISP
      %FALSE %IF L_TYPE # R_TYPE %OR L_FORM # R_FORM
      %FALSE %IF L_EXTRA # R_EXTRA
      %TRUE
   %END
   %PREDICATE ZERO(%RECORD(STACKFM)%NAME V)
      %FALSE %IF V_DISP # 0 %OR V_BASE # 0 %OR V_FORM # CONSTANT
      %FALSE %IF V_LOP # 0
      %TRUE
   %END
   %PREDICATE CONST(%RECORD(STACKFM)%NAME V)
      %FALSE %UNLESS V_FORM = CONSTANT %AND V_LOP = 0
      %FALSE %IF V_TYPE > SHORT
      %TRUE
   %END
   %INTEGERFN POWER(%INTEGER N)
      %INTEGER MASK, J
      MASK = 1
      %FOR J = 0, 1, 14 %CYCLE
         %RESULT = J %IF N = MASK
         MASK = MASK<<1
      %REPEAT
      %RESULT = -1
   %END
   %INTEGERFN TEMP
      %INTEGER T
      T = (FRAME+(REGLEN-1))&(\(REGLEN-1))
      FRAME = T+REGLEN
      %RESULT = T
   %END
   %INTEGERFN TAG
      %INTEGER N, S
      N = 0
      %CYCLE
         S = NEXTSYMBOL
         %RESULT = N %UNLESS '0' <= S <= '9'
         N = N*10+S-'0'
         SKIPSYMBOL
      %REPEAT
   %END
   %INTEGERFN EVAL(%INTEGER L)
      %INTEGER J, N, B, S, MOD
      %CONSTBYTEINTEGERARRAY BASIS('V' : 'Z') = 3, 1, 8, 4, 0
      %RESULT = 0 %IF L < 2
      READSYMBOL(B);  B = BASIS(B)
      N = 0
      %IF B = 0 %START
         %FOR J = 2,1,L %CYCLE
            READ SYMBOL(S)
            N = (N*4+N)*2 + S-'A'
         %REPEAT
      %ELSE
         MOD = 'A';  MOD = 0 %IF B = 8
         %FOR J = 2,1,L %CYCLE
            READ SYMBOL(S)
            N = N<<B + (S-MOD)
         %REPEAT
      %FINISH
      %RESULT = N
   %END
   %REALFN  REAL CONSTANT
   %INTEGER  I,L,S,J,M
   %REAL  N,FACTOR,TEN,ONE
      I = 10;  TEN = I;   ! ...TO PREVENT COMPILE-TIME FLOATING
      I = 1;  ONE = I;   ! ... AND AGAIN
      M = 0;  N = 0;  L = TAG;  SKIP SYMBOL
      %CYCLE  J = 1,1,L
         READ SYMBOL(S)
         %IF S = '.' %START
            FACTOR = 1;  M = 1
         %ELSE
            I = S-'A'
            %IF M = 0 %START
               N = N*TEN + I
            %ELSE
               FACTOR = FACTOR/TEN
               N = N + I*FACTOR
            %FINISH
         %FINISH
      %REPEAT
      %RESULT = N
   %END
   %ROUTINE RELEASE(%INTEGER REG)
      %RETURN %IF REG = 0 %OR ACTIVITY(REG) < 0;!  LOCKED
      ACTIVITY(REG) = ACTIVITY(REG)-1
      ABORT(1) %IF ACTIVITY(REG) < 0
   %END
   %ROUTINE CLAIM(%INTEGER REG)
      %RETURN %IF REG = 0 %OR ACTIVITY(REG) < 0
      USED(REG) = CA
      ACTIVITY(REG) = ACTIVITY(REG)+1
   %END
   %ROUTINE FORGET(%INTEGER REG)
      USE(REG)_CA = LIMEN;  USE(REG+STORE)_CA = LIMEN
   %END
   %ROUTINE FORGET DEST(%RECORD(STACKFM)%NAME V)
      %CONSTBYTEINTEGERARRAY BITS(0:7) = 15,15,8,12,12,12,15,15
      %INTEGER R, MASK, ADDR, TYPE
      %RECORD(USEFM)%NAME U

      ADDR = V_DISP!3;  MASK = BITS(V_TYPE)>>(V_DISP&3)

      %FOR R = 1, 1, 40 %CYCLE
         U == USE(R)
         %IF U_CA > LIMEN %START
            %IF U_BASE&255 = V_BASE %AND U_FORM # A V IN S %START
               %IF U_DISP!3 = ADDR %START
                  TYPE = U_TYPE
                  TYPE = 7 %IF U_FORM&128 # 0
                  type = 0 %if type = 255      {unsigned halfword}
                  %IF BITS(TYPE)>>(U_DISP&3) & MASK # 0 %START
                     U_CA = LIMEN;        ! FORGET IT
                  %FINISH
               %FINISH
            %FINISH
         %FINISH
      %REPEAT
   %END
   %ROUTINE HAZARD(%INTEGER REG)
      %RECORD(DFM)%NAME P
      %INTEGER N, T, OP
      %ROUTINE MOD(%RECORD(STACKFM)%NAME V)
         %SWITCH S(0:7)
               N = N-1
               ->S(V_FORM)
S(CONSTANT):
S(A IN REC):
S(V IN REC):
S(AV IN REC):  ABORT(3)
S(A IN S):     V_FORM = A IN REC;  V_EXTRA = T;  ->DONE
S(AV IN S):    V_FORM = AV IN REC;  V_EXTRA = T;  ->DONE
S(V IN S):     V_FORM = V IN REC;  V_EXTRA = T;  ->DONE
S(V IN R):     V_FORM = V IN S;  V_DISP = T
DONE:          V_BASE = LOCAL
      %END
      N = ACTIVITY(REG)
      %RETURN %IF N <= 0
      ACTIVITY(REG) = 0
      T = TEMP
      %IF FPR0 <= REG <= FPR14 %THEN OP = STE %ELSE OP = ST
      RX(OP, REG, LOCAL, T)
      P == USING_LINK
      %CYCLE
         %EXIT %IF P == NULL
         MOD(P_D) %IF P_D_BASE = REG
         P == P_LINK
      %REPEAT
      ABORT(4) %IF N # 0
   %END
   %ROUTINE HAZARD ALL
      %INTEGER J
      HAZARD(J) %FOR J = 1, 1, 20
   %END
   %ROUTINE REMEMBER(%INTEGER REG, %RECORD(STACKFM)%NAME V)
      %RECORD(USEFM)%NAME U
      REMEMBER(REG+STORE,V) %IF REG <= STORE
      U == USE(REG)
      U_BASE = V_BASE
      U_DISP = V_DISP
      U_TYPE = V_TYPE
      U_FORM = V_FORM
      U_CA   = CA
      %IF CONTROL < 0 %START
         SELECTOUTPUT(LIST)
         PRINTSTRING(" REMEMBER:")
         WRITE(U_TYPE, 1);  WRITE(U_FORM, 1);  WRITE(U_BASE, 3)
         WRITE(U_DISP,5)
         NEWLINE
         SELECTOUTPUT(OBJECT)
      %FINISH
   %END
   %INTEGERFN FIND USE(%INTEGER TYPE, FORM, BASE, DISP)
      %RECORD(USEFM)%NAME U
      %INTEGER J, B, BB, BCA, BBCA
      B = BASE&255;  BB = BASE>>8
      %IF ACTIVITY(B) < 0 %THEN BCA = LIMEN+1 %ELSE BCA = USE(B)_CA
      %IF ACTIVITY(BB)< 0 %THEN BBCA= LIMEN+1 %ELSE BBCA= USE(BB)_CA
      %RESULT = 0 %IF BCA <= LIMEN %OR BBCA <= LIMEN
      %FOR J = 1, 1, 40 %CYCLE
         U == USE(J)
         %IF BCA < U_CA %AND BBCA < U_CA %START
            %IF U_BASE = BASE  %AND U_DISP = DISP %START
               %IF U_TYPE = TYPE %AND U_FORM = FORM %START
                  %IF J > STORE %START
                     J = J-STORE
                     USE(J) = U %IF USE(J)_CA <= LIMEN
                  %FINISH
                  CLAIM(J)
                  RELEASE(B);  RELEASE(BB)
                  %RESULT = J
               %FINISH
            %FINISH
         %FINISH
      %REPEAT
      %RESULT = 0
   %END
   %INTEGERFN GPR(%INTEGER ADDR)
      %RECORD(USEFM)%NAME UR, US
      %INTEGER R, BESTR, BESTCA, BOOTR, BOOTCA, REG, MAXCA
      %CONSTBYTEINTEGERARRAY PREF(0:11) =
                  P1, R11, R9, P2,
                  R10, R12, R4, R3, R1, R2, LINK, R0

      BESTR = -1;  BOOTR = -1
      BESTCA = CA;  BOOTCA = CA

      %CYCLE R = 0, 1, 11-ADDR
         REG = PREF(R)
         %IF ACTIVITY(REG) = 0 %START;! FREE
            UR == USE(REG);  US == USE(REG+STORE)
            MAXCA = UR_CA
            MAXCA = US_CA %IF US_CA > MAXCA
            %RESULT = REG %IF MAXCA <= LIMEN;! NOT KNOWN
            %IF MAXCA < BESTCA %START
               BESTCA = MAXCA;  BESTR = REG
            %FINISH
         %ELSE %IF 0 < ACTIVITY(REG) < 2 %AND USED(REG) < BOOTCA
            BOOTR = REG;  BOOTCA = USED(REG)
         %FINISH
      %REPEAT
      %RESULT = BESTR %IF BESTR >= 0
      !  NONE FREE SO BOOT ONE OUT
      BOOTR = R1 %IF BOOTR < 0;! NONE BETTER
      HAZARD(BOOTR);  USED(BOOTR) = CA
      %RESULT = BOOTR
   %END
   %INTEGERFN EVEN ODD PAIR
      %CONSTBYTEINTEGERARRAY PAIRS(1:5) = R0, R10, R2, R4, LINK
      %CONSTBYTEINTEGERARRAY NEXT(1:5)  = R1, R11, R3, P2, R9
      %INTEGER J, BEST, BESTCA, MAX, HELP, REG, NREG
      %RECORD(USEFM)%NAME U1, U2
      BEST = 0;  BESTCA = CA;  HELP = 0
      %CYCLE J = 1, 1, 5
         REG = PAIRS(J);  NREG = NEXT(J)
         U1 == USE(REG);  U2 == USE(NREG)
         %IF ACTIVITY(REG) = 0 %START
            %IF ACTIVITY(NREG) = 0 %START
               MAX = U1_CA
               MAX = U2_CA %IF U2_CA > MAX
               %IF MAX < BESTCA %START
                  BESTCA = MAX;  BEST = J
               %FINISH
            %ELSE
               HELP = J
            %FINISH
         %ELSE
            HELP = J %IF ACTIVITY(NREG) = 0
         %FINISH
      %REPEAT
      %RESULT = NEXT(BEST) %IF BEST # 0
      HELP = 2 %IF HELP = 0
      REG = PAIRS(HELP);  NREG = NEXT(HELP)
      HAZARD(REG);  HAZARD(NREG)
      %RESULT = NREG
   %END
   %INTEGERFN FPR
      %RECORD(USEFM)%NAME UR, US
      %INTEGER R, BESTR, BESTCA, BOOTR, BOOTCA, MAXCA, BOOTA
      BESTR = -1;  BESTCA = CA
      BOOTR = -1;  BOOTCA = CA;  BOOTA = CA
      %CYCLE R = FPR0, 1, FPR14
         UR == USE(R);  US == USE(R+STORE)
         %IF ACTIVITY(R) = 0 %START
            MAXCA = UR_CA;  MAXCA = US_CA %IF US_CA > MAXCA
            %RESULT = R %IF MAXCA <= LIMEN
            %IF MAXCA < BESTCA %START
               BESTR = R;  BESTCA = MAXCA
            %FINISH
         %ELSE %IF 0 < ACTIVITY(R) < 2 %AND USED(R) < BOOTCA
            BOOTCA = USED(R);  BOOTR = R
         %FINISH
      %REPEAT
      %RESULT = BESTR %UNLESS BESTR < 0
      BOOTR = FPR0 %IF BOOTR < 0
      HAZARD(BOOTR)
      %RESULT = BOOTR
   %END
   %ROUTINE CHECK RELEASED
      %INTEGER J
      %FOR J = 1, 1, 20 %CYCLE
         ABORT(2) %IF ACTIVITY(J) > 0
      %REPEAT
   %END


! OBJECT FILE HANDLING ROUTINES

   %ROUTINE COUNT DIAGS
      %OWNINTEGER HERE = 0
      LINE SIZE = LINE SIZE+4 %IF HERE # CURRENT LINE
      HERE = CURRENT LINE
   %END

   %ROUTINE  PUT(%SHORTINTEGER  N)
      PRINT SYMBOL(N>>8);  PRINT SYMBOL(N&255)
   %END
   %ROUTINE  DUMP(%SHORTINTEGER  N)
      PRINT SYMBOL(LOAD CODE);  PUT(N)
      DECODE(N) %IF CONTROL < 0
      CA = CA+2
   %END
   %ROUTINE  GHALF(%SHORTINTEGER  N)
      PRINT SYMBOL(LOAD GLA);  PUT(N)
      GA = GA+2
   %END
   %ROUTINE  GWORD(%INTEGER  N)
      GHALF(N>>16);  GHALF(N&X'FFFF')
   %END
   %ROUTINE  GBYTE(%SHORTINTEGER  N)
   %OWNINTEGER  V=0, F=0
      F = \F
      %IF F=0 %START
         PRINT SYMBOL(LOAD GLA);  PUT(V<<8+N)
      %ELSE
         V = N
      %finish
      GA = GA+1
   %END
   %ROUTINE  PATCH(%INTEGER  WHAT, WHERE)
      SELECT OUTPUT(DIRECT)
      PRINT SYMBOL(PATCH CODE);  PUT(WHAT);  PUT(WHERE)
      SELECT OUTPUT(OBJECT)
   %END
   %ROUTINE  GPATCH(%INTEGER  WHAT, WHERE)
      SELECT OUTPUT(DIRECT)
      PRINT SYMBOL(PATCH GLA);  PUT(WHAT);  PUT(WHERE)
      SELECT OUTPUT(OBJECT)
   %END
   %ROUTINE  GFIX(%INTEGER  ALIGNMENT)
      GBYTE(0) %WHILE GA&(ALIGNMENT-1) # 0
   %END
   %ROUTINE  SF(%SHORTINTEGER OP, R, L)
      DUMP(OP + ACTUAL(R)<<4 + L)
   %END
   %ROUTINE  RR(%SHORTINTEGER  OP, R1, R2)
      DUMP(OP + ACTUAL(R1)<<4 + ACTUAL(R2))
      RELEASE(R2)
   %END
   %ROUTINE  RX(%INTEGER  OP, R, X, D)
      ABORT(5) %IF X=R0 %OR D<0 %OR D>X'3FFF'
      RELEASE(X)
      DUMP(OP + ACTUAL(R)<<4 + ACTUAL(X));  DUMP(D)
      COUNT DIAGS %IF OP = BAL
      %IF CONTROL&UNASS DIAG # 0 %START
         %RETURN %IF OP # LW %AND OP # LE
         %RETURN %IF X = LOCAL %AND D >= MIN TEMP
         %IF OP = LW %THEN OP = CL %ELSE OP = CE
         DUMP(OP+ACTUAL(R)<<4+ACTUAL(CODE))
         DUMP(UNASS PAT)
         PRINTSYMBOL(DLINE);          ! INFORM DIAGS OF 'BALR'
         DUMP(ENTER UNASS)
         COUNT DIAGS
      %FINISH
   %END
   %ROUTINE  RI2(%INTEGER  OP, R, X, D)
      ABORT(5) %IF X=R0
      RELEASE(X)
      DUMP(OP + ACTUAL(R)<<4 + ACTUAL(X));  DUMP(D)
      COUNT DIAGS %IF OP = BAL;     ! IF PERM REFERENCE
   %END
   %ROUTINE  RI3(%INTEGER  OP, R, X, D)
      ABORT(5) %IF X=R0
      RELEASE(X)
      DUMP(OP + ACTUAL(R)<<4 + ACTUAL(X)); DUMP(D>>16); DUMP(D&X'FFFF')
   %END
   %ROUTINE  DEFINE TAG(%SHORTINTEGER  REF)
      SELECT OUTPUT(DIRECT)
      PRINT SYMBOL(TAG DEF);  PUT(REF);  PUT(CA)
      SELECT OUTPUT(OBJECT)
   %END
   %ROUTINE  DEFINE REFERENCE(%INTEGER  REF, TYPE)
      SELECT OUTPUT(DIRECT)
      PRINT SYMBOL(TYPE);  PUT(REF);  PUT(CA)
      SELECT OUTPUT(OBJECT)
   %END
   %ROUTINE  SET LINE
   %OWNINTEGER  HERE = 0
      CURRENT LINE = TAG
      %WHILE CURRENT LINE > HERE %CYCLE
         HERE = HERE+1;  PRINT SYMBOL(LINE FLAG)
      %REPEAT
   %END

! ENVIRONMENT CONTROL

   %RECORD(ENVFM)%MAP ENVIRONMENT(%SHORTINTEGER LABEL)
      %INTEGER J
      %RECORD(ENVFM)%NAME E
      %RESULT == NULL ENV %IF LABEL <= 0
      %FOR J = MAX ENVIRS, -1, 0 %CYCLE
         E == ENVIR(J)
         %RESULT == E %IF E_LABEL = LABEL
      %REPEAT
      %RESULT == NULL ENV
   %END
   %ROUTINE REMEMBER ENVIRONMENT(%SHORTINTEGER LABEL)
      %INTEGER K
      %RECORD(ENVFM)%NAME E
      %RETURN %IF LABEL <= 0
      E == ENVIRONMENT(LABEL)
      E_LABEL = 0
      ENVP = ENVP+1;  ENVP = 0 %IF ENVP > MAX ENVIRS
      E == ENVIR(ENVP)
      E_LABEL = LABEL
      E_LIMEN = LIMEN
      E_E(K) = USE(K) %FOR K = 1, 1, 40
   %END
   %ROUTINE MERGE ENVIRONMENT(%SHORTINTEGER LABEL)
      %INTEGER J
      %RECORD(ENVFM)%NAME E
      %RECORD(USEFM)%NAME U, V
      E == ENVIRONMENT(LABEL)
      %UNLESS E == NULL ENV %START
         %FOR J = 1, 1, 40 %CYCLE
            U == USE(J)
            V == E_E(J)
            V_CA = E_LIMEN %UNLESS U_BASE = V_BASE %C
                              %AND U_DISP = V_DISP %C
                              %AND U_FORM = V_FORM %C
                              %AND U_TYPE = V_TYPE %C
                              %AND U_CA   > LIMEN
         %REPEAT
      %FINISH
   %END
   %ROUTINE RESTORE ENVIRONMENT(%SHORTINTEGER LABEL)
      %INTEGER J
      %RECORD(ENVFM)%NAME E
      E == ENVIRONMENT(LABEL)
      %IF E == NULL ENV %START
         LIMEN = CA
      %ELSE
         E_LABEL = 0
         LIMEN = E_LIMEN
         USE(J) = E_E(J) %FOR J = 1, 1, 40
      %FINISH
   %END

   %ROUTINE PERM(%INTEGER N)
      %INTEGER MASK, J, R
      %CONSTBYTEINTEGERARRAY REG(1:15) =
         R0, R1, R2, R3, R4, P2, P1, FPR0, FPR2,15,16,17,18,19,20
      MASK = X'80'
      N = N!X'FFFF0000'
      %CYCLE J = 1, 1, 15
         MASK = MASK<<1
         %IF N&MASK # 0 %START
            R = REG(J)
            HAZARD(R);  FORGET(R)
         %FINISH
      %REPEAT
      HAZARD(LINK);  FORGET(LINK)
      DEFINE REFERENCE(N&255, P REF)
      RI2(BAL, LINK, CODE, N&255)
   %END
   %ROUTINE SET DIAG(%INTEGER BASE, DISP, TYPE, FORM)
      !! PROC<1><1>LEVEL<3>NAME<1>BASE<3>TYPE<3>DISP<20>
      %INTEGER V1, V2, P, MARK
      %ROUTINE FILL(%INTEGERNAME V)
         %INTEGER SHIFT
         SHIFT = 0;  V = 0
         %CYCLE
            %RETURN %IF P = VP %OR SHIFT = 30
            P = P+1
            V = V+(VBUF(P)-32)<<SHIFT
            SHIFT = SHIFT+6
         %REPEAT
      %END
      P = 0;  MARK = 0
      FILL(V1);  FILL(V2)
      %IF FORM = 0 %START;          ! NON-VARIABLE
         PRINT SYMBOL(DLINE)
         MARK = 16;  FORM = 1
         %IF BASE = 0 %START;       ! %BEGIN
            V2 = 0;  V1 = BLOCK WORD;! 'BLOCK'
         %FINISH
      %FINISH
      BASE = ACTUAL(BASE)
      BASE = BASE-8 %IF BASE >= 8
      PRINTSYMBOL(DIAGS)
      %IF FORM = -1 %START;                ! END OF BLOCK
         PUT(-1);  PUT(-1);  DA = DA+4;  %RETURN
      %FINISH
      PUT(((((MARK+XLEVEL)<<1+FORM-1)<<3+BASE)<<3+TYPE)<<4)
      PUT(DISP)
      PUT(V1>>16);  PUT(V1&X'FFFF')
      PUT(V2>>16);  PUT(V2&X'FFFF')
      DA = DA+12
   %END
   %ROUTINE ASSEMBLE(%SHORTINTEGER AMODE, LABS, NAMES)
      %OWNINTEGER ASS LEVEL = 0
      %SWITCH Z(33:126)
      %RECORD(VARFM)%NAME V, GVAR, FP, AP
      %RECORD(STACKFM)%NAME LHS, RHS, X
      %INTEGER SYM;            ! CURRENT CODE ITEM
      %INTEGER VLB, VUB
      %INTEGER DATA SIZE, OLD FRAME, GSTART, WDISP, NEW DISP, SDISP
      %INTEGER OPR, N
      %INTEGER SIZE PATCH, WARNING
      %OWNINTEGER GG = 0
      %INTEGER J,K, LEN, VAL, APARM, SPS
      %INTEGER LABEL START;! FIRST LABEL FOR THIS LEVEL
      %INTEGER RT LAB;     ! ROUTINE JUMP ADDRESS

      %CONSTBYTEINTEGERARRAY COMM(1:17)= 0, 0, 1, 0, 1, 1, 0,
                                         1, 1, 1, 0, 0, 0, 0, 1, 0, 0

   %ROUTINESPEC AMAP(%RECORD(STACKFM)%NAME V)
   %ROUTINESPEC LOAD(%RECORD(STACKFM)%NAME V, %INTEGER REG)
   %INTEGERFNSPEC NEW TAG
   %ROUTINESPEC JOIN(%RECORD(STACKFM)%NAME W)
   %ROUTINESPEC OPERATE(%INTEGER N)
   %ROUTINESPEC COMPARE(%RECORD(STACKFM)%NAME L, R)
   %ROUTINESPEC HEADER(%RECORD(VARFM)%NAME V)

   ABORT(-1) %IF FREE SPACE < MIN FREE;  !  ...STACK OVERFLOW?

   XLEVEL = XLEVEL+1
   RT LAB = 0;  LABEL START = LABS; OLD FRAME = FRAME
   WDISP = 0;  WARNING = 0
   GVAR == DECVAR;  GSTART = NAMES
   %IF AMODE > 0 %START
      %IF AMODE = 1 %THEN FRAME = REGLEN %ELSE FRAME = 11*REGLEN
      ABORT(-3) %IF ASS LEVEL = 5
      ASS LEVEL = ASS LEVEL+1;  LOCAL = BASE REG(ASS LEVEL)
      ACTIVITY(LOCAL) = -1
      %IF AMODE = 2 %START
         SET DIAG(R15, 0, 0, 0)
      %FINISH
      %IF OTYPE = PERMRT %START
         PERMS = PERMS-1;  GVAR_DISP = PERMS
      %FINISH
      SET DIAG(LOCAL, 0, 0, 0) %IF GG = PROCEDURE
   %ELSE %IF AMODE < 0
      FRAME = 0
   %ELSE
      SET DIAG(0, 0, 0 ,0);      ! BLOCK
   %FINISH

   ! DESCRIPTOR PROCESSING

   %INTEGERFN LOOKUP(%INTEGER NAME)
      %INTEGER P, P1, P2
      %RECORD(VARFM)%NAME V
      P1 = 1;  P2 = NAMES
      %WHILE P2 >= P1 %CYCLE
         P = (P1+P2)>>1
         V == VAR(P)
         %RESULT = P %IF V_ID = NAME
         %IF V_ID > NAME %THEN P2 = P-1 %ELSE P1 = P+1
      %REPEAT
      ABORT(6)
      %STOP
   %END
   %ROUTINE DEFINE VAR
      %CONSTBYTEINTEGERARRAY VSIZE(0:7) = 0, 4, 1, 2, 0, 4, 4, 0
      %CONSTBYTEINTEGERARRAY ROUND(0:7) = 3,3,0,1,1,3,3,3
      %INTEGER TYPE, FORM, TF, F, SIZE, FORMAT, S
      %OWNINTEGER PERM NO = -1

      NAMES = NAMES+1;  ABORT(-4) %IF NAMES >= PARMS
      DECVAR == VAR(NAMES);  DECVAR = 0
      DECVAR_ID = TAG
      VP = 0
      %CYCLE
         READSYMBOL(S);  %EXIT %IF S = COMMA
         %IF VP # 10 %START
            VP = VP+1;  VBUF(VP) = S
         %FINISH
      %REPEAT

      TF = TAG;  TYPE = TF>>4;  FORM = TF&15;  SKIPSYMBOL
      %IF TYPE = LONG %START
         TYPE = REALS
      %FINISH
      SIZE = TAG
      DECVAR_TYPE = TYPE
      DECVAR_FORM = FORM
      SKIPSYMBOL
      OTYPE = TAG
      %IF NEXTSYMBOL = COMMA %START
         SKIPSYMBOL
         FORMAT = TAG;  F = LOOKUP(FORMAT)
         DECVAR_FORMAT = F;  SIZE = VAR(F)_LENGTH;! IN BYTES
         DECVAR_LENGTH = SIZE
      %ELSE %IF TYPE = STRING
         DECVAR_SIZE = SIZE
         SIZE = SIZE+1
         SIZE = (SIZE+1)&(\1) %IF FORM = ARRAY
      %ELSE
         SIZE = VSIZE(TYPE)
      %FINISH
      %IF 7 <= FORM <= 10 %START;! PROCEDURE
         GTYPE = 1
         F = LOOKUP(DECVAR_ID)
         %IF F # NAMES %START;! SPEC GIVEN
            NAMES = NAMES-1;  DECVAR == VAR(F);  %RETURN
         %FINISH
         %IF OTYPE # 0 %AND OTYPE # 7 %START;! TREAT AS INTRINSIC
            PERMNO = PERMNO+1
            DECVAR_DISP = PERMNO;  DECVAR_BASE = LINK
            %RETURN
         %FINISH
         DECVAR_DISP = NEW TAG!X'4000'
         DECVAR_BASE = CODE
         DECVAR_TYPE=INTEGER %IF FORM=8 %AND (TYPE=BYTE %OR TYPE=SHORT)
         %RETURN %UNLESS AMODE = 1 %AND GMODE # 0;! PARAMETER
         OTYPE = 0;  TYPE = 0;  FORM = 1;  SIZE = 2*REGLEN
      %FINISH

      DATA SIZE = SIZE
      DECVAR_LENGTH = DATA SIZE

      %IF FORM # 1 %START
         %IF TYPE = 0 %START
            TYPE = 10;  SIZE = 2*REGLEN;  DECVAR_TYPE = 10
         %ELSE %IF FORM = ARRAYNAME
            SIZE = 2*REGLEN;  DECVAR_EXTRA = -1
         %ELSE %IF FORM = ARRAY
            SIZE = 0
         %ELSE
            SIZE = REGLEN
         %FINISH
      %FINISH
      %IF OTYPE # 0 %START;! OWN DATA
         %IF OTYPE = CON %START;! CONSTINTEGER ETC.
            DATA SIZE = 0 %IF TF = X'41';! CONSTSTRING
            OTYPE = 0 %IF (TYPE<=SHORT %AND (FORM<=2 %OR FORM = 5)) %C
                      %OR TF = X'52' %OR FORM = ARRAYNAME
         %FINISH
         OWNTYPE = TYPE;  OWNFORM = FORM
         %IF FORM = ARRAY %START
            GFIX(4)
            DECVAR_EXTRA=GA;  GWORD(VLB);  GWORD(VUB);  GWORD(DATASIZE)
            DECVAR_BASE = GLA;  DECVAR_DISP = GA-VLB*DATASIZE
         %ELSE
            OWNTYPE = INTEGER %AND DATA SIZE = REGLEN %IF FORM # 1
            %IF OTYPE # 0 %START
               %IF TF # X'21' %START
                  %IF TF = X'31' %OR TF = X'41' %THEN GFIX(2) %C
                                                %ELSE GFIX(4)
               %FINISH
               %IF OWNFORM <= 2 %AND TYPE # RECORD %START
                  SET DIAG(GLA, GA+DIAG GLA, TYPE, FORM)
                  DIAG GLA = DIAG GLA+DATA SIZE
               %FINISH
            %FINISH
         %FINISH
         %RETURN
      %FINISH

      %IF FORM = SWITCH %START
         GFIX(2)
         DECVAR_BASE = GLA;  DECVAR_DISP = GA
         GHALF(VLB);  GHALF(VUB)
         DECVAR_EXTRA = GA-VLB*2
         GHALF(0) %FOR F = VLB, 1, VUB
         %RETURN
      %FINISH

      %IF FORM = 4 %START
         GTYPE = -1;  %RETURN
      %FINISH

      %IF FORM = 1 %THEN F = ROUND(TYPE) %ELSE F = REGLEN-1
      FRAME = (FRAME+F)&(\F)
      %IF FRAME <= REGLEN %START;!  SPECIAL PARAMETER ?
         %IF AMODE = 1 %AND GMODE # 0 %START;!  IN FP LIST
            %IF (FORM = 2 %AND TYPE # 10) %OR TF = X'11' %C
                                          %OR TF = X'31' %START;! TO A REG
               DECVAR_BASE = PARAM;  DECVAR_DISP = FRAME
               DECVAR_DISP = DECVAR_DISP+(REGLEN-2) %IF TF = X'31'
               FRAME = FRAME-REGLEN;  FRAME = 11*REGLEN %IF FRAME < 0
               -> DECD;   ! ...GO DUMP DIAG. ENTRY
            %FINISH
         %FINISH
         FRAME = 11*REGLEN %IF AMODE >= 0
      %FINISH
      DECVAR_BASE = LOCAL;  DECVAR_DISP = FRAME
      FRAME = FRAME+SIZE
DECD: %IF AMODE = 0 %OR (AMODE = 1 %AND GG # SPEC) %START
         %IF TYPE # RECORD %AND TYPE # 10 %START
            %IF FORM = 1 %OR FORM = 2 %START
               SET DIAG(LOCAL, DECVAR_DISP, TYPE, FORM)
            %FINISH
         %FINISH
      %FINISH
   %END
   %RECORD(STACKFM)%MAP DESCRIPTOR
      %RECORD(STACKFM)%NAME V;  %RECORD(DFM)%NAME D
      V == DESC ASL;  ABORT(17) %IF V == NULL
      D == DASL;      ABORT(17) %IF D == NULL
      DESC ASL == V_LINK;  V = 0
      DASL == D_LINK;  D_LINK == USING_LINK;  USING_LINK == D
      D_D == V
      V_LINK ==NULL
      %RESULT == V
   %END
   %ROUTINE DROP(%RECORD(STACKFM)%NAME D)
      %RECORD(DFM)%NAME P, Q
      P == USING
      %CYCLE
         Q == P_LINK
         ABORT(18) %IF Q == NULL
         %EXIT %IF Q_D == D
         P == Q
      %REPEAT
      P_LINK == Q_LINK
      Q_LINK == DASL;  DASL == Q
      D_LINK == DESC ASL;  DESC ASL == D
   %END
   %ROUTINE STACK(%INTEGER DISP, BASE, TYPE, FORM, FORMAT, EXTRA, LENGTH)
      %CONSTBYTEINTEGERARRAY FMAP(0:15) = CONSTANT, V IN S, A IN S,0(4),
                                      16,17,19,19,
                                      !0, V IN R, V IN S, V IN S,
                                      V IN S, A IN S,
                                      0(3)
      %RECORD(STACKFM)%NAME V
      STP = STP+1;  ABORT(7) %IF STP > MAX DEPTH
      V == DESCRIPTOR
      V_BASE = BASE
      V_DISP = DISP
      V_FORMAT = FORMAT
      V_EXTRA = EXTRA;  V_DV = EXTRA
      V_TYPE = TYPE
      V_LENGTH = LENGTH
      V_FORM = FMAP(FORM)
      STACKED(STP)_V == V
      LHS == V
      SHOW(V) %IF CONTROL < 0
   %END
   %ROUTINE VSTACK(%RECORD(VARFM)%NAME V)
      STACK(V_DISP, V_BASE, V_TYPE, V_FORM, V_FORMAT, V_EXTRA, V_LENGTH)
   %END
   %ROUTINE SSTACK(%RECORD(STACKFM)%NAME V)
      %RECORD(STACKFM)%NAME T
      STP = STP+1;  ABORT(7) %IF STP > MAX DEPTH
      T == DESCRIPTOR;  T = V
      STACKED(STP)_V == T;  CLAIM(T_BASE)
      SHOW(T) %IF CONTROL < 0
   %END
   %ROUTINE C STACK(%INTEGER N)
      RHS == DESCRIPTOR
      RHS_BASE = 0
      RHS_DISP = N
      RHS_TYPE = INTEGER
      RHS_FORM = CONSTANT
      STP = STP+1;  ABORT(7) %IF STP > MAX DEPTH
      STACKED(STP)_V == RHS
      SHOW(RHS) %IF CONTROL < 0
   %END
   %ROUTINE  FP CSTACK(%REAL X, %RECORD(STACK FM)%NAME  R)
      %RECORDFORMAT  F(%INTEGER  VAL, GDISP)
      %CONSTINTEGER  L=31;    ! ... MUST BE 2\\N - 1
      %OWNRECORD(F)%ARRAY CONST LIST(0:L)
      %OWNSHORTINTEGER  LAST PNTR = 0, NEXT PNTR = 0
      %INTEGER  N;  %SHORTINTEGER I
!!!      %RECORDFORMAT  FI(%INTEGER X)
!!!      %RECORDFORMAT  FR(%REAL X)
!!!      %RECORD(FR) RV;  %RECORD(FI)%NAME  IV
!!!      RV_X = X;  IV == RV;  N = IV_X

      %recordformat  convfm(%integer  n %or %real x)
      %record(convfm)  conv
      conv_x = x;  n = conv_n

      OWNVAL = N;  REALGA = GA
!
      I = NEXT PNTR
      %WHILE  I # LAST PNTR %CYCLE
         I = (I-1)&L
         -> FOUND IT %IF CONST LIST(I)_VAL = N
      %REPEAT
      GFIX(4);  I = GA;    ! FULLWORD ALIGN AND REMEMBER ADDR.
      GWORD(N)
      CONST LIST(NEXT PNTR)_VAL = N
      CONST LIST(NEXT PNTR)_GDISP = I
      I = NEXT PNTR;   ! ...FOR USE AT 'FOUND IT:'
      NEXT PNTR = (NEXT PNTR+1)&L
      LAST PNTR = (LAST PNTR+1)&L %IF LAST PNTR = NEXT PNTR
FOUND IT:
      R_BASE = GLA
      R_DISP = CONST LIST(I)_GDISP
      R_TYPE = REALS
      R_FORM = V IN S
      STP = STP+1;  ABORT(7) %IF STP > MAX DEPTH
      STACKED(STP)_V == R
   %END
   %ROUTINE SSET(%INTEGER BASE, DISP, FORM, EXTRA)
      RHS == DESCRIPTOR
      RHS_BASE = BASE
      RHS_DISP = DISP
      RHS_TYPE = INTEGER
      RHS_FORM = FORM
      RHS_EXTRA = EXTRA
      STP = STP+1;  ABORT(7) %IF STP > MAX DEPTH
      STACKED(STP)_V == RHS
   %END
   %ROUTINE SET LHS
      LHS == STACKED(STP)_V
   %END
   %ROUTINE SET BOTH
      ABORT(8) %IF STP <= 1
      LHS == STACKED(STP-1)_V
      RHS == STACKED(STP)_V
   %END
   %ROUTINE POP LHS
      ABORT(8) %IF STP <= 0
      LHS == STACKED(STP)_V
      STP = STP-1
   %END

 ! STRING PROCESSING

   %ROUTINE DUMP STRING(%INTEGER MAX)
      %INTEGER J
      GFIX(2)
      %IF MAX <= 0 %START
         ->OUT %IF ACTIVE STRING == NULL %OR (MAX < 0 %AND CSLEN = 0)
         ACTIVE STRING_BASE = GLA;  ACTIVE STRING_DISP = GA
         ACTIVE STRING_FORM = V IN S
         MAX = CSLEN
      %ELSE
         MAX = MAX-1
         ABORT(-13) %IF MAX < CSLEN
      %FINISH
      GBYTE(CURRENT STRING(J)) %FOR J = 0, 1, MAX
      CSLEN = 0
OUT:  ACTIVE STRING == NULL
   %END
   %ROUTINE GET STRING
      %INTEGER L, S
      DUMP STRING(0) %UNLESS ACTIVE STRING == NULL
      L = TAG;  SKIPSYMBOL %IF L # 0
      CSLEN = 0
      %WHILE L > 0 %CYCLE
         L = L-1
         READSYMBOL(S)
         CSLEN = CSLEN+1;  CURRENT STRING(CSLEN) = S
      %REPEAT
      STACK(0, 0, STRING, 0, 0, 0, 0)
      ACTIVE STRING == STACKED(STP)_V
   %END

! LABEL PROCESSING

      %INTEGERFN NEW TAG
         %OWNINTEGER TAG = 0
         TAG = TAG+1
         %RESULT = TAG
      %END
      %RECORD(LABELFM)%MAP NEW LABEL
         LABS = LABS+1;  ABORT(-5) %IF LABS > MAX LABELS
         FLAB == LABELS(LABS)
         %RESULT == FLAB
      %END
      %RECORD(LABELFM)%MAP FIND(%INTEGER LABEL)
         %INTEGER LP
         LP = LABS
         %WHILE LP # LABEL START %CYCLE
            FLAB == LABELS(LP)
            %RESULT == FLAB %IF FLAB_ID = LABEL
            LP = LP-1
         %REPEAT
         %RESULT == NULL
      %END
      %ROUTINE DEFINE LABEL(%INTEGER LABEL)
         %RECORD(ENVFM)%NAME E
         %RECORD(LABELFM)%NAME L
         L == FIND(LABEL)
         %IF L == NULL %START
            %IF CONTROL < 0 %START
               SELECTOUTPUT(REPORT)
               PRINTSTRING(" DEF:");  WRITE(LABEL, 2)
               PRINTSTRING("  LABS =");  WRITE(LABS, 2);  NEWLINE
               SELECTOUTPUT(OBJECT)
            %FINISH
            L == NEW LABEL
            L_ID = LABEL;  L_TAG = NEW TAG;  L_REG = 0
            LIMEN = CA
            E == ENVIRONMENT(LABEL);  E_LABEL = 0
         %ELSE %IF L_TAG < 0 %AND LABEL >= 0
            L_TAG = NEW TAG;  L_REG = 0
            E == ENVIRONMENT(LABEL);  E_LABEL = 0
         %FINISH
         L_TAG = L_TAG!X'8000'
         DEFINE TAG(L_TAG&X'7FFF')
         MERGE ENVIRONMENT(LABEL) %IF UNCOND JUMP # CA
         RESTORE ENVIRONMENT(LABEL)
         RT LAB = CA %IF LABEL = 0
         CCCA = 0
         UNCOND JUMP = 0;! YOU CAN GET HERE!
      %END
      %ROUTINE JUMP TO(%INTEGER LABEL, COND, DEF)
         %INTEGER REF, LTAG
         %RECORD(LABELFM)%NAME LAB
         %RECORD(USEFM)%NAME U
         INVERT = 0;! EXPEND CONDITION INVERSION
         LAB == FIND(LABEL)
         %IF LABEL = 0 %AND RT LAB = CA %START;! JUMP ROUND ROUTINE
            LAB_TAG = LAB_TAG&X'7FFF';  %RETURN
         %FINISH
         %IF LAB == NULL %START
            LAB == NEW LABEL
            LAB_ID = LABEL;  LAB_REG = 0
            LAB_TAG = NEW TAG
            REMEMBER ENVIRONMENT(LABEL)
         %ELSE %IF LAB_REG # 0 %AND SYM # 'B'
            LAB_BASE = LAB_BASE!128
            JUMP TO(LABEL+3, COND, DEF)
            %RETURN
         %ELSE %IF LAB_TAG < 0 %AND DEF = REDEFINE
            LAB_REG = 0;  LAB_TAG = NEW TAG
            REMEMBER ENVIRONMENT(LABEL)
         %ELSE
            MERGE ENVIRONMENT(LABEL) %IF LAB_TAG >= 0
         %FINISH
         LTAG = LAB_TAG&X'7FFF'
         %IF LAB_REG # 0 %START
            DEFINE LABEL(LABEL+3) %IF LAB_BASE&128 # 0
            SSET(LAB_BASE&127, LAB_DISP, V IN S, 0)
            LHS == RHS;  LOAD(LHS, LAB_REG)
            SSET(0, LAB_LIMIT, CONSTANT, 0)
            COMPARE(LHS, RHS);  COND = 1
            STP = STP-2;  DROP(LHS);  DROP(RHS)
         %FINISH
         %IF COND = JUMP %THEN REF = J REF %ELSE REF = C REF
         DEFINE REFERENCE(LTAG, REF)
         DUMP(COND+X'8000');  CCCA = CCCA+2
         UNCOND JUMP = CA %IF COND = JUMP;! NO WAY PAST HERE
         %IF KNOWN_CA = 0 %START;! SOMETHING TO LEARN
            KNOWN_CA = 1
            U == USE(KNOWN_BASE)
            U_TYPE = KNOWN_TYPE;  U_FORM = CONSTANT
            U_BASE = 0;  U_DISP = KNOWN_DISP
            U_CA = CA
         %FINISH
      %END
   %ROUTINE FLOAT(%RECORD(STACKFM)%NAME V, %INTEGER REG)
      %INTEGER  D
      %IF V_FORM = CONSTANT %START
      !  FLOAT CONSTANTS AT COMPILE-TIME
         D = V_DISP
         %IF D = 0 %START
            REG = FPR %IF REG = ANYF
            CLAIM(REG)
            RR(SER, REG, REG);  CLAIM (REG)
            V_BASE = REG;  V_DISP = 0;  V_TYPE = REALS;  V_FORM = V IN R
         %ELSE
            FP CSTACK(D,V);  ! ...N.B. 'D' FLOATED BY PARAMETER PASSING
            STP = STP-1;      ! ...WE DON'T WANT A NEW STACK ITEM
         %FINISH
         %RETURN
      %FINISH
      LOAD(V, REG) %AND %RETURN %IF V_LOP # 0
      LOAD(V, ANY)
      REG = FPR %IF REG = ANYF
      RR(FLR, REG, V_BASE)
      CLAIM(REG)
      V_TYPE = REALS;  V_FORM = V IN R
      V_BASE = REG;  V_DISP = 0
   %END
   %ROUTINE LRD(%RECORD(STACKFM)%NAME V, %INTEGER REG)
      LOAD(V, REG)
      RELEASE(V_BASE)
      DROP(V)
   %END
   %ROUTINE REDUCE(%RECORD(STACKFM)%NAME V)
      %INTEGER TYPE, FORM, DISP
      TYPE = V_TYPE;  FORM = V_FORM - 2
      FORM = AV IN S  %IF FORM = AV IN REC-2
      DISP = V_DISP
      V_DISP = V_EXTRA;  V_TYPE = INTEGER;  V_FORM = V IN S
      LOAD(V, ANY0)
      V_TYPE = TYPE;  V_FORM = FORM
      V_DISP = DISP
   %END
   %ROUTINE VMAP(%RECORD(STACKFM)%NAME V)
      %INTEGER N
      %CONSTBYTEINTEGERARRAY MAP(0:15) =
         V IN S, V IN S, V IN S, A IN S, V IN S,
         A IN REC, V IN S, V IN REC, 0(8)
      LOAD(V, ANY0) %IF V_FORM = AINS %OR V_FORM = AINREC
      %IF V_LOP # 0 %START
         %IF V_LOP = ADD %AND CONST(V_LINK) %START
            N = V_LINK_DISP
            V_LOP = 0;  DROP(V_LINK)
            %IF V_FORM = AVINS %OR V_FORM = AVINREC %START
               V_DISP = V_DISP+N
            %ELSE
               LOAD(V, ANY0);  V_DISP = N
            %FINISH
         %ELSE
            LOAD(V, ANY0)
         %FINISH
      %FINISH
      V_FORM = MAP(V_FORM)
   %END
   %ROUTINE AMAP(%RECORD(STACKFM)%NAME V)
      %CONSTSHORTINTEGERARRAY MAP(0:7) =
            -1, -1, V IN S, AV IN S, V IN REC, AV IN REC, -1, -1
      V_FORM = MAP(V_FORM)
      %IF  V_FORM = AV IN S %START
         %IF  V_BASE = 0 %THEN  V_FORM = CONSTANT  %ELSE %START
            V_FORM = V IN R %IF V_DISP = 0
         %FINISH
      %FINISH
      ABORT(9) %IF V_FORM < 0
      V_TYPE = INTEGER
   %END
   %ROUTINE OPTIMISE(%RECORD(STACKFM)%NAME V)
      %INTEGER R
      %RETURN %IF V_FORM = V IN R %OR V_LOP # 0
      REDUCE(V) %IF V_FORM >= A IN REC %AND V_FORM # AV IN S
      R = FIND USE(V_TYPE, V_FORM, V_BASE, V_DISP)
      %IF R # 0 %START
         V_BASE = R;  V_DISP = 0;  V_FORM = V IN R
      %ELSE %IF V_FORM = A IN S
         R = FIND USE(INTEGER, V IN S, V_BASE, V_DISP)
         %RETURN %IF R = 0
         V_BASE = R;  V_DISP = 0;  V_FORM = V IN S
         OPTIMISE(V)
      %FINISH
   %END
   %ROUTINE RANGE(%SHORTINTEGERNAME BASE, %INTEGERNAME DISP)
      %RECORD(STACKFM) V
      %RETURN %IF 0 <= DISP <= X'3FFF'
      V_TYPE = INTEGER;  V_FORM = AV IN S
      V_BASE = BASE;  V_DISP = DISP&(\X'3FFF')
      DISP = DISP-V_DISP
      V_LOP = 0
      LOAD(V, ANY0)
      BASE = V_BASE
   %END
   %ROUTINE ADDRESS(%RECORD(STACKFM)%NAME V)
      %INTEGER TYPE, FORM
      FORM = V_FORM;  TYPE = V_TYPE
      %IF FORM = V IN REC %OR FORM = A IN REC %START
         REDUCE(V);  FORM = V_FORM
      %FINISH
      %UNLESS FORM = V IN S %OR FORM = V IN R %START
         %IF FORM = A IN S %START
            FORM = V IN S;  V_FORM = FORM
            V_TYPE = INTEGER
            LOAD(V, ANY0)
         %ELSE
            LOAD(V, ANY)
            FORM = V IN R;  TYPE = INTEGER
         %FINISH
      %FINISH
      RANGE(V_BASE, V_DISP)
      V_TYPE = TYPE;  V_FORM = FORM
   %END
   %ROUTINE LOAD(%RECORD(STACKFM)%NAME V, %INTEGER R)
      %RECORD(STACKFM) H
      %CONSTSHORTINTEGERARRAY OP KEY(1:17) = -1, 0, 0, 6, 4, 2, 0,
                                              0, 5,10, 0, 2, 0, 0, 0,0 ,0
      %CONSTSHORTINTEGERARRAY PM(0:11) =
                      AR, AIS, AHI, AW, AH, AI,
                      SR, SIS, SHI, SW, SH, SI
      %CONSTSHORTINTEGERARRAY MULDIV(0:5) = DR, DW,
                                            MR, MW,
                                            MR, MW
      %CONSTSHORTINTEGERARRAY LOGICAL(0:14) =
                                           NR, NHI, NW, NH, NI,
                                           OR, OHI, OW, OH, OI,
                                           XR, XHI, XW, XH, XI

      %CONSTSHORTINTEGERARRAY SHIFT(0:3) = SLLS, SLL, SRLS, SRL

      %CONSTSHORTINTEGERARRAY REAL OP(3:14) = AER, SER, 0,
                                              MER, DER, 0, 0,
                                              AE, SE, 0,
                                              ME, DE
      %INTEGERFN PRED(%INTEGER R)
         %CONSTBYTEINTEGERARRAY INV(0:15) = R0, R1, R2, R3,
                                            R4, P2, P1, WSP,
                                            LINK, R9, R10, R11,
                                            R12, GLA, CODE, R15
         %RESULT = INV(ACTUAL(R)!!1)
      %END
      %RECORD(STACKFM)%NAME W
      %SWITCH F(0:8), IOP(1:17), ROP(1:17)
      %INTEGER OP, T, D, TYPE, FORM, KEY, TEMP, N
      %OWNINTEGER  ADDXCA=0, ADDXD=0, ADDXS=0, ADDXKEY=0

      ABORT(-2) %IF FREE SPACE < MIN FREE;   ! ...STACK OVERFLOW?
      ->REALZ %IF FLOATING(V) %OR FPR0 <= R <= FPR14 %OR R = ANYF
      OP = V_LOP;  V_LOP = 0
      %IF OP # 0 %START
         W == V_LINK
         OPTIMISE(V);  OPTIMISE(W) %UNLESS W == NULL
         %IF OP = SUB %AND W_FORM = CONSTANT %START
            OP = ADD;  W_DISP = -W_DISP
         %FINISH
         %IF COMM(OP) # 0 %START;! SWOP OPERANDS ?
            T = 0
            T = 1 %IF W_BASE = R %OR (W_FORM = V IN R %AND V_FORM # V IN R)
            T = 1 %IF V_TYPE # BYTE %AND W_TYPE = BYTE %AND V_BASE # R
            T = 1 %IF W_FORM = CONSTANT %AND R < ANY %AND R # V_BASE %C
                                        %AND V_TYPE # BYTE
            T = 0 %IF V_BASE = R %C
                  %OR (W_FORM = V IN R %AND ACTIVITY(W_BASE) < 0)
            %IF T # 0 %START
               H = W;  W = V;  V = H
            %FINISH
         %FINISH
         %IF CONTROL&UNASS DIAG # 0 %START
            LOAD(W, ANY0) %UNLESS W_FORM = CONSTANT %C
                              %OR (W_TYPE # INTEGER %AND W_TYPE # REALS)
         %FINISH
         KEY = OP KEY(OP)
         ->IOP(OP)
      %FINISH
      %IF V_TYPE = STRING %OR V_TYPE = 0 %START
         AMAP(V)
      %FINISH
      %IF  V_FORM > V IN S  %AND  V_FORM # AV IN S  %THEN REDUCE(V)
      OPTIMISE(V)
      %IF R >= ANY %START
         %RETURN %IF V_FORM = V IN R %AND (R = ANY %OR V_BASE # R0) %C
                                     %AND ACTIVITY(V_BASE) >= 0
         R = GPR(R-ANY)
      %ELSE
         HAZARD(R) %UNLESS V_BASE = R %AND ACTIVITY(R) = 1
      %FINISH
      ->F(V_FORM)
F(AV IN REC):
F(A IN REC):
F(V IN REC):
      CLAIM(R);  REDUCE(V);  RELEASE(R)
      ->F(V_FORM)
F(AV IN S):
      ABORT(10) %IF V_TYPE = REALS
      %IF V_BASE # R0 %START
         %IF -X'8000' <= V_DISP <= X'7FFF' %START
            %IF V_DISP # 0 %START
               RI2(LHI, R, V_BASE, V_DISP)
            %ELSE
               RR(LR,R,V_BASE)
            %FINISH
         %ELSE
            RI3(LI, R, V_BASE, V_DISP)
         %FINISH
         CLAIM(R)
         REMEMBER(R, V)
         V_BASE = R;  V_DISP = 0
         V_TYPE = INTEGER;  V_FORM = V IN R
         %RETURN
      %FINISH
F(CONSTANT):
      ABORT(16) %IF V_TYPE = REALS
      D = V_DISP
      %IF -15 <= D <= 15 %START
         %IF D >= 0 %START
            SF(LIS, R, D)
         %ELSE
            SF(LCS, R, -D)
         %FINISH
      %ELSE
         %IF -X'8000' <= D <= X'7FFF' %START
            RI2(LHI, R, 0, D)
         %ELSE
            RI3(LI, R, 0, D)
         %FINISH
      %FINISH
      CLAIM(R);  REMEMBER(R, V)
      V_BASE = R;  V_DISP = 0
      V_TYPE = INTEGER;  V_FORM = V IN R
      %RETURN
F(V IN R):
      OP = LR
      %RETURN %IF V_BASE = R
      OP = LER %IF V_TYPE = REALS
      RR(OP, R, V_BASE);  CLAIM(R)
      CCREG = R;  CCCA = CA
      FORGET(R)
      USE(R) = USE(V_BASE)
      V_BASE = R
      %RETURN
F(A IN S):
      TYPE = V_TYPE
      V_TYPE = INTEGER;  V_FORM = V IN S
      CLAIM(R);  LOAD(V, ANY0);  RELEASE(R)
      V_TYPE = TYPE;  V_FORM = V IN S
F(V IN S):
      RANGE(V_BASE, V_DISP)
      CCREG = R;  CCCA = CA+4
      %IF V_TYPE = INTEGER %START
         OP = LW
      %ELSE %IF V_TYPE = SHORT
         OP = LH
      %ELSE %IF V_TYPE = BYTE
         OP = LB;  CCCA = 0
      %ELSE %IF V_TYPE = REALS
         OP = LE
      %ELSE
         OP = LHL;        ! INTERNALLY GENERATED 'UNSIGNED HALFWORD'
      %FINISH
      RX(OP, R, V_BASE, V_DISP)
      CLAIM(R);  REMEMBER(R, V)
      V_BASE = R;  V_DISP = 0
      V_FORM = V IN R
      %RETURN
IOP(ADD):
      %IF W_FORM = V IN R %AND W_BASE # R %AND V_FORM = CONSTANT %START
         D = V_DISP
         %IF (USE(W_BASE)_CA > LIMEN %OR USE(W_BASE+STORE)_CA > LIMEN %C
               %OR D < -15 %OR D > 15) %AND CA # ADDXCA %START
            %IF R >= ANY %START
               R = GPR(R-ANY)
            %ELSE %IF W_BASE # R %OR ACTIVITY(R) # 1
               HAZARD(R)
            %FINISH
            %IF -X'8000'<=D<=X'7FFF' %THEN RI2(LHI,R,W_BASE,D) %C
               %ELSE RI3(LI,R,W_BASE,D)
            CCREG = R;  CCCA = CA
            V_DISP = 0;  V_FORM = V IN R
            V_BASE = R;  CLAIM(R)
            ->END OP
         %FINISH
      %FINISH
IOP(SADD):
IOP(SUB):
      LOAD(V, R);  R = V_BASE
      LOAD(W, ANY) %IF W_TYPE = BYTE %OR W_TYPE = UNSIGNED HALFWORD
      %IF W_FORM = CONSTANT %START
         D = W_DISP
         %IF -15 <= D <= 15 %START
            D = -D %AND KEY = 6-KEY %IF D < 0
            SF(PM(KEY+1), R, D)
         %ELSE
            %IF -X'8000' <= D <= X'7FFF' %START
               %IF CA = ADDXCA %AND R = ADDXD %START
                  D = -D %IF ADDXKEY # KEY
                  DUMP(D)
                  PATCH(PM(ADDXKEY+2)+ACTUAL(R)<<4+ACTUAL(ADDXS),   %C
                                                               ADDXCA-2)
               %FINISH %ELSE RI2(PM(KEY+2), R, 0, D)
            %ELSE
               RI3(PM(KEY+5), R, 0, D)
            %FINISH
         %FINISH
      %ELSE %IF W_FORM = V IN R
         RR(PM(KEY), R, W_BASE)
         ADDXCA = CA;  ADDXD = R;  ADDXKEY = KEY;  ADDXS = W_BASE
      %ELSE %IF W_FORM = AV IN S
         RI2(PM(KEY+2), R, W_BASE, W_DISP)
      %ELSE
         ADDRESS(W)
         KEY = KEY-1 %IF W_FORM = V IN R
         KEY = KEY+1 %IF W_TYPE = SHORT
         RX(PM(KEY+3), R, W_BASE, W_DISP)
      %FINISH
      ->SET CC
IOP(MUL):
IOP(DIV):
IOP(REM):
      %IF R >= ANY %START
         %IF KEY = 0 %THEN N = 0 %ELSE N = 1
         %IF V_FORM = V IN R %AND ACTUAL(V_BASE)&1 = N %C
                             %AND ACTIVITY(PRED(V_BASE)) = 0 %START
            TEMP = V_BASE
            TEMP = PRED(TEMP) %IF KEY = 0
         %ELSE
            TEMP = EVEN ODD PAIR
         %FINISH
      %ELSE %IF ACTUAL(R)&1 = 0 %OR ACTIVITY(PRED(R)) # 0
         TEMP = EVEN ODD PAIR
      %ELSE
         TEMP = R
      %FINISH
      N = PRED(TEMP);  HAZARD(N)
      %IF KEY # 0 %START
         CLAIM(N);  LOAD(V, TEMP)
      %ELSE
         CLAIM(TEMP);  LOAD(V, N)
         RR(LR, TEMP, N)
         USE(TEMP) = USE(N);  USE(TEMP+STORE) = USE(N)
         CLAIM(N)
         RX(SRA, N, 0, 31);  FORGET(N)
      %FINISH
      LOAD(W,ANY) %IF W_FORM = CONSTANT %OR W_TYPE # INTEGER
      ADDRESS(W)
      %IF W_FORM = V IN R %START
         RR(MULDIV(KEY), N, W_BASE)
      %ELSE
         RX(MULDIV(KEY+1), N, W_BASE, W_DISP)
      %FINISH
      %IF OP = REM %START
         D = TEMP;  TEMP = N;  N = D
      %FINISH
      RELEASE(N)
      FORGET(N);  FORGET(TEMP)
      V_BASE = TEMP;  V_DISP = 0;  V_FORM = V IN R
      LOAD(V, R) %IF TEMP # R
      ->END OP
IOP(AND):
      %IF V_FORM = CONSTANT %AND V_DISP = 255 %START
         %IF W_FORM = V IN R %START
            %IF R >= ANY %START
               %IF ACTIVITY(W_BASE) = 1 %THEN R = W_BASE %C
                                        %ELSE R = GPR(R-ANY)
            %ELSE %IF R # W_BASE %OR ACTIVITY(R) # 1
               HAZARD(R)
            %FINISH
         %ELSE
            LOAD(W,R);  R = W_BASE
         %FINISH
         CLAIM(R)
         RR(LBR,R,W_BASE)
         V_BASE = R;  V_DISP = 0;  V_FORM = V IN R
         -> FEND
      %FINISH
IOP(IOR):
IOP(XOR):
      %IF W_FORM = CONSTANT %AND -15 <= W_DISP <= 15 %START
         %IF V_FORM # V IN R %OR (R < ANY %AND V_BASE # R) %START
            H = W;  W = V;  V = H
         %FINISH
      %FINISH
      LOAD(V, R);  R = V_BASE
      LOAD(W, ANY) %IF W_TYPE = BYTE
      %IF W_FORM = CONSTANT %START
         %IF KEY = 0 %AND W_DISP = 255 %START;!  N&255
            CLAIM(R)
            RR(LBR, R, R);  -> FEND
         %FINISH
         %IF -X'8000' <= W_DISP <= X'7FFF' %START
            RI2(LOGICAL(KEY+1), R, 0, W_DISP)
         %ELSE
            RI3(LOGICAL(KEY+4), R, 0, W_DISP)
         %FINISH
      %ELSE %IF W_FORM = V IN R
         RR(LOGICAL(KEY), R, W_BASE)
      %ELSE
         ADDRESS(W)
         KEY = KEY+1 %IF W_TYPE = SHORT %OR W_TYPE = UNSIGNED HALFWORD
         RX(LOGICAL(KEY+2), R, W_BASE, W_DISP)
      %FINISH
      ->SET CC
IOP(RSH):
IOP(LSH):
      LOAD(V, R);  R = V_BASE
      !  IGNORE ANY VALUE IN A REGISTER WHICH HAPPENS TO BE THE
      !  SAME AS A CONSTANT SHIFT COUNT <=15 AS OTHERWISE THE LONG FORM
      !  OF SHIFT INSTRUCTION WILL BE GENERATED NEEDLESSLY.
      %IF W_FORM = V IN R %AND USE(W_BASE)_CA > LIMEN  %C
                          %AND USE(W_BASE)_FORM = CONSTANT  %C
                          %AND 0 <= USE(W_BASE)_DISP <= 15  %START
         W_DISP = USE(W_BASE)_DISP
         W_FORM = CONSTANT
         RELEASE(W_BASE)
      %FINISH
      %IF W_FORM = CONSTANT %START
         %IF KEY = 0 %AND W_DISP = 1 %START
            CLAIM(R)
            RR(AR, R, R)
         %ELSE %IF W_DISP > 15
            RX(SHIFT(KEY+1), R, 0, W_DISP)
         %ELSE
            SF(SHIFT(KEY), R, W_DISP&15)
         %FINISH
      %ELSE
         LOAD(W, ANY0)
         RX(SHIFT(KEY+1), R, W_BASE, 0)
      %FINISH
      ->SET CC
IOP(NEG):
IOP(NOT):
      %IF V_BASE = R %START
         LOAD(V, R)
         RI2(XHI, V_BASE, 0, -1)
         SF(AIS, V_BASE, 1) %IF KEY = 0
      %ELSE
         W == RHS;  CSTACK(KEY);  RHS == W
         SSTACK(V);  RELEASE(V_BASE);  V_BASE = 0
         OPERATE(SUB);  STP = STP-1
         V = STACKED(STP+1)_V;  DROP(STACKED(STP+1)_V)
         LOAD(V, R)
      %FINISH
      FORGET(V_BASE)
      CCREG = V_BASE;  CCCA = CA
      %RETURN
IOP(EXP):
      LOAD(V, R2);  LOAD(W, R3)
      RELEASE(R2);  RELEASE(R3)
      PERM(IEXP)
      CLAIM(R1);  V_BASE = R1
      ->END OP
IOP(CONC):
      %IF V_TYPE # 0 %START
         LOAD(V, R1);  RELEASE(R1)
         HAZARD(R2)
         %IF WDISP = 0 %START
            RR(LR , R2, WSP)
         %ELSE
            RI2(LHI, R2, WSP, WDISP)
         %FINISH
         FORGET(R2)
         WDISP = WDISP+256
         PERM(CONC1)
      %ELSE
         LOAD(V, R2);  RELEASE(R2)
      %FINISH
      JOIN(W)
      CLAIM(R2)
      V_TYPE = 0;  V_FORM = V IN S
      V_BASE = R2;  V_DISP = 0
      %IF R # ANY %START;! NOT FROM OPERATE
         LOAD(V, R);  V_TYPE = 0;  V_FORM = V IN S
      %FINISH
      %RETURN
REALZ:ABORT(11) %IF R = ANY;     ! ...SHOULD BE FLOATING REGISTER!!!
      OP = V_LOP;  V_LOP = 0
      %IF OP # 0 %START
         -> ROP NEG %IF OP = NEG
         W == V_LINK
IOP(RDIV):
         FLOAT(W, ANYF) %IF W_TYPE # REALS %AND OP # EXP
         FLOAT(V, R) %IF V_TYPE # REALS
         %IF OP = ADD %OR OP = MUL %START
            OPTIMISE(V);  OPTIMISE(W) %UNLESS W == NULL
            %IF W_BASE=R %OR (V_FORM # V IN R %AND W_FORM = V IN R) %START
               H = W;  W = V;  V = H
            %FINISH
         %FINISH
         ADDRESS(W) %UNLESS W == NULL
         ->ROP(OP)
ROP(NOT):ROP(LSH):  ROP(RSH):
ROP(AND):ROP(IOR):    ROP(XOR):
         REAL ERROR(OP)
ROP(RDIV):OP = DIV
ROP(ADD):
ROP(SUB):
ROP(MUL):
         LOAD(V, R);  R = V_BASE
         %IF W_FORM = V IN R %START
            RR(REALOP(OP), R, W_BASE)
         %ELSE
            RX(REALOP(OP+7), R, W_BASE, W_DISP)
         %FINISH
         ->SET CC
ROP NEG:
ROP(NEG):LOAD(V, ANYF) %IF V_BASE = R
         R = FPR %IF R = ANYF
         HAZARD(R)
         CLAIM(R);  RR(SER, R, R);  CLAIM(R)
         ADDRESS(V)
         %IF V_FORM = V IN R %START
            RR(SER, R, V_BASE)
         %ELSE
            RX(SE, R, V_BASE, V_DISP)
         %FINISH
         CCREG = R;  CCCA = CA
         FORGET(R)
         V_BASE = R;  V_DISP = 0
         V_FORM = V IN R
         %RETURN
      %FINISH
      FLOAT(V, R) %IF V_TYPE # REALS
      OPTIMISE(V)
      %IF V_FORM = V IN R %START
         %RETURN %IF R = ANYF %OR V_BASE = R
         RR(LER, R, V_BASE);  USE(R) = USE(V_BASE)
         V_BASE = R;  CLAIM(V_BASE)
         CCREG = R;  CCCA = CA
         %RETURN
      %FINISH
      R = FPR %IF R = ANYF
      ABORT(12) %UNLESS FPR0 <= R <= FPR14
      ->F(V_FORM)
ROP(EXP):
      REAL ERROR(1) %AND W_TYPE = INTEGER %IF W_TYPE = REALS
      LOAD(V, FPR2);  LOAD(W, R1)
      RELEASE(FPR2);  RELEASE(R1)
      PERM(REXP)
      CLAIM(FPR0);  V_BASE = FPR0
      ->ENDOP
SET CC:
      CCCA = CA;  CCREG = R
FEND: FORGET(R)
END OP:DROP(W)
   %END
      %ROUTINE COP(%INTEGER OP, %INTEGERNAME L, %INTEGER R)
         %SWITCH S(1:17)
         ->S(OP)
S(SADD):
S(RDIV):
S(NEG):
S(NOT):
S(CONC):    ABORT(13)
S(ADD):     L = L+R;    %RETURN
S(SUB):     L = L-R;    %RETURN
S(IOR):     L = L!R;    %RETURN
S(AND):     L = L&R;    %RETURN
S(XOR):     L = L!!R;   %RETURN
S(LSH):     L = L<<R;   %RETURN
S(MUL):     L = L*R;    %RETURN
S(RSH):     L = L>>R;   %RETURN
S(EXP):     L = L\\R;   %RETURN
S(DIV):     ABORT(-6) %AND R = 1 %IF R = 0
            L = L//R;   %RETURN
S(REM):     ABORT(-6) %AND R = 1 %IF R = 0
            L = L-L//R*R
      %END
      %ROUTINE JOIN(%RECORD(STACKFM)%NAME W)
         %RECORD(STACKFM)%NAME QW
         %CYCLE
            QW == W_LINK;  W_LOP = 0
            LRD(W, R1);  PERM(CONC2)
            %EXIT %IF QW == NULL
            W == QW
         %REPEAT
      %END
      %ROUTINE OPERATE(%INTEGER OPER)
         %CONSTINTEGERARRAY NULL OP(3:17) = 0,0,1,1,1,-1,0(4),1,0,0,1,1
         %INTEGER RCON, LCON, WCON, LOP
         %INTEGER KEY, D, S
         %RECORD(STACKFM)%NAME WITH, LH, RH
         %CONSTBYTEINTEGERARRAY TRANS(1:17) = 2,2,0,0,1(6),2(4),0,15,15

         %ROUTINE  SWOP
            WCON = LCON;  LCON = RCON;  RCON = WCON
            WITH == LH;  LH == RH;  RH == WITH
            STACKED(STP)_V == LH
         %END
         %ROUTINE  PICKUP(%RECORD(STACKFM)%NAME  V)
            %IF FLOATING(V) %THEN LOAD(V,ANYF) %ELSE LOAD(V,ANY)
         %END

         %IF OPER <= NEG %START;! UNARY
            LH == STACKED(STP)_V
            %IF CONST(LH) %START
               LH_DISP = \LH_DISP+OPER-1
            %ELSE
               PICKUP(LH) %IF LH_LOP # 0
               LH_LOP = OPER;  LH_LINK == NULL
            %FINISH
            %RETURN
         %FINISH
         STP = STP-1
         LCON = 0;  RCON = 0;  WCON = 0
         LH == STACKED(STP)_V
         RH == STACKED(STP+1)_V
         LCON = 1 %IF CONST(LH)
         RCON = 1 %IF CONST(RH)
         %IF OPER = SUB %AND RCON # 0 %START
            OPER = ADD;  RH_DISP = -RH_DISP
         %FINISH
         %IF LH_LOP # 0 %START
            LOP = LH_LOP
            %IF OPER = CONC %START
               WITH == LH
               WITH == WITH_LINK %WHILE WITH_LOP # 0
               WITH_LINK == RH
               WITH_LOP = CONC
               %RETURN
            %FINISH
            WITH == LH_LINK
            WCON = 1 %IF OPER > NEG %AND CONST(WITH)
            %IF LOP = NEG %AND OPER = ADD %START
               RH_LOP = SUB;  RH_LINK == LH
               LH_LOP = 0
               STACKED(STP)_V == RH
               %RETURN
            %FINISH
            DUMP STRING(0) %IF WITH_TYPE = STRING
            %IF WCON&RCON # 0 %START
               KEY = TRANS(OPER)!TRANS(LOP)
               %IF KEY = 0 %OR (KEY = 1 %AND OPER = LOP) %START
                  COP(OPER, WITH_DISP, RH_DISP);  DROP(RH)
                  %IF WITH_DISP = NULL OP(OPER) %START
                     LH_LOP = 0;  DROP(WITH)
                  %FINISH
                  %RETURN
               %FINISH
            %FINISH
            PICKUP(LH)
         %FINISH
         %IF LCON&RCON # 0 %AND OPER # RDIV %START
            COP(OPER, LH_DISP, RH_DISP);  DROP(RH);  %RETURN
         %FINISH
         %IF LCON # 0 %AND COMM(OPER) # 0 %START
            SWOP
            PICKUP(LH) %IF LH_LOP # 0
         %FINISH
         %IF RCON # 0 %AND (OPER = AND %OR OPER = RSH) %C
                %AND (CONTROL&UNASS DIAG = 0 %OR LH_TYPE = SHORT) %START
            OPTIMISE(LH)
            %IF LH_FORM # V IN R %AND (LH_TYPE = INTEGER %OR  %C
                                           LH_TYPE = SHORT) %START
               ADDRESS(LH)
               %IF OPER = AND %START
                  S = LH_TYPE;  D = 0
                  D = REGLEN//2 %IF LH_TYPE = INTEGER
                  %IF RH_DISP = 255 %START
                     S = BYTE;  D = D + REGLEN//4
                  %ELSE %IF RH_DISP>>16 = 0
                     RH_DISP = RH_DISP!X'FFFF0000' %IF RH_DISP>>15#0
                     LH_TYPE = UNSIGNED HALFWORD
                     LH_DISP = LH_DISP+D
                     D = -1
                  %ELSE
                     D = -1
                  %finish
                  %IF D >= 0 %START
                     LH_TYPE = S;  LH_DISP = LH_DISP + D
                     DROP(RH);  %RETURN
                  %FINISH
               %ELSE;                !...'OPER' MUST BE RSH
                  %IF RH_DISP = (8*REGLEN)//2 %C
                     %AND LH_TYPE # SHORT %START
                     S = UNSIGNED HALFWORD
                  %ELSE %IF RH_DISP = 8*(REGLEN-1)
                     S = BYTE
                  %ELSE
                     S = -1
                  %finish
                  %IF  S >= 0 %START
                     LH_TYPE = S;  DROP(RH);  %RETURN
                  %FINISH
               %FINISH
            %FINISH
         %FINISH
         PICKUP(RH) %IF RH_LOP # 0
         %IF LCON!RCON # 0 %AND OPER = MUL %START
            SWOP %IF LCON # 0
            %IF FLOATING(LH) %THEN KEY = -1 %C
                              %ELSE KEY = POWER(RH_DISP)
            %IF KEY >= 0 %START
               RH_DISP = KEY;  OPER = LSH
            %ELSE
               SWOP
            %FINISH
         %FINISH
         DROP(RH) %AND %RETURN %IF RCON # 0 %AND RH_DISP = NULL OP(OPER)
         LH_LOP = OPER;  LH_LINK == RH
      %END
      %PREDICATE DIFFERENT(%RECORD(STACKFM)%NAME A, B)
         %WHILE %NOT B == NULL %CYCLE
            %FALSE %IF SAME(A, B)
            B == B_LINK
         %REPEAT
         %TRUE
      %END
      %ROUTINE ASSIGN(%INTEGER ASSOP)
         %RECORD(STACKFM)%NAME LHS, RHS, W
         %RECORD(STACKFM) TEMP, HOLD
         %INTEGER N, P, T, OP, VAL, SIZE
         ABORT(8) %IF STP < 2
         RHS == STACKED(STP)_V
         LHS == STACKED(STP-1)_V
         %IF ASSOP < 0 %START
            %IF LHS_BASE = LINK %START;! INTRINSIC
               TEMP = LHS;  LHS = RHS;  RHS = TEMP
               NEW DISP = 0
               %RETURN
            %FINISH
            LHS_EXTRA = LHS_EXTRA-1
            V == VAR(LHS_EXTRA)
            DISPLAY VAR(V) %IF CONTROL < 0
            VSTACK(V);  LHS == STACKED(STP)_V
            ASSOP = 0 %IF V_FORM > 1
            NEW DISP = LHS_DISP+LHS_LENGTH
            %IF LHS_FORM&16 # 0 %START;! PROCEDURE PARAMETER
               FORGET(LINK);  HAZARD(R0)
               NEW DISP = LHS_DISP+2*REGLEN
               %IF RHS_DISP&X'4000' # 0 %START
                  RX(ST, WSP, WSP, LHS_DISP);! ENVIRONMENT REF
                  DEFINE REFERENCE(RHS_DISP&X'FFF', R REF)
                  RX(LA, LINK, CODE, 0);       !  ADDRESS OF ROUTINE
                  RX(ST, LINK, WSP, LHS_DISP+REGLEN);  ! ENVIRONMENT
               %ELSE
                  RX(LW, LINK, RHS_BASE, RHS_DISP)
                  RX(ST, LINK, WSP, LHS_DISP)
                  RX(LW, LINK, RHS_BASE, RHS_BASE+REGLEN)
                  RX(ST, LINK, WSP, LHS_DISP+REGLEN)
               %FINISH
               DROP(RHS);  DROP(LHS)
               STP = STP-2
               %RETURN
            %FINISH
         %FINISH
         %IF LHS_DV < 0 %AND CONTROL&ARRAYDIAG # 0 %START;! ARRAYNAME
            LHS_DV = 0
            HOLD = LHS;  TEMP = RHS
            HOLD_DISP = HOLD_DISP+4
            %IF TEMP_DV < 0 %START
               TEMP_DISP = TEMP_DISP+4;  TEMP_FORM = A IN S
            %ELSE
               TEMP_BASE = GLA;  TEMP_DISP = TEMP_DV
               TEMP_FORM = V IN S
            %FINISH
            SSTACK(HOLD);  SSTACK(TEMP)
            ASSIGN(0)
         %FINISH
         STP = STP-2
         %IF LHS_TYPE = 10 %START;! NAME PARAMETER
            ABORT(15) %UNLESS ASSOP = 0
            T = RHS_TYPE<<13!(RHS_LENGTH&X'1FFF')
            AMAP(RHS);  LRD(RHS, ANY)
            RX(ST, RHS_BASE, LHS_BASE, LHS_DISP)
            RI2(LHI, RHS_BASE, 0, T)
            CLAIM(LHS_BASE); RX(ST, RHS_BASE, LHS_BASE, LHS_DISP+REGLEN)
            FORGET(RHS_BASE)
            DROP(LHS)
            %RETURN
         %FINISH
         %IF ASSOP = 0 %START
            DUMP STRING(0) %IF RHS_TYPE = STRING %AND RHS_FORM = CONSTANT
            AMAP(LHS);  AMAP(RHS)
         %FINISH
         %IF LHS_TYPE = RECORD %START
            AMAP(LHS);  LOAD(LHS, R2)
            N = LHS_LENGTH>>1
            %IF RHS_TYPE = RECORD %START
               AMAP(RHS);  LOAD(RHS, R1);  RELEASE(R1)
               P = R COPY
            %ELSE
               P = R CLEAR
            %FINISH
            DROP(RHS);  DROP(LHS)
            CSTACK(N);  STP = STP-1;  LRD(STACKED(STP+1)_V, R0)
            RELEASE(R2)
            PERM(P)
            %RETURN
         %FINISH
         %IF LHS_TYPE = 15 %START;        ! STRING PARAM (FINAL)
            %IF RHS == ACTIVE STRING %START
               HAZARD(R1)
               RHS_BASE = 17;  REMEMBER(R1, RHS);  ! DISCRIMINATE
               ACTIVE STRING == NULL
               T = NEW TAG;  DEFINE REFERENCE(T, R REF)
               RX(BAL, R1, CODE, T)
               N = 0
               %CYCLE
                  DUMP(CURRENTSTRING(N)<<8+CURRENTSTRING(N+1))
                  N = N+2
                  %EXIT %IF N > CSLEN
               %REPEAT
               CSLEN = 0
               DEFINE TAG(T)
               RHS_FORM = V IN S;  RHS_BASE = R1;  RHS_DISP = 0
               CLAIM(R1)
            %FINISH
            DUMP STRING(0)
            WDISP = 44 %IF WDISP = 0
            LRD(RHS, R1)
            DROP(LHS)
            %RETURN
         %FINISH
         %IF LHS_TYPE = STRING %START
            SIZE = LHS_LENGTH-1
            SIZE = 0 %IF SIZE < 0 %OR SIZE = 255 %OR CONTROL&ASSDIAG=0
            DUMP STRING(-1)
            %IF RHS_FORM = CONSTANT %START;! NULL STRING!!
               RHS_TYPE = INTEGER;  LHS_TYPE = BYTE
            %ELSE
               WDISP = WDISP-256 %IF RHS_TYPE = 0
               %IF RHS_LOP # 0 %AND SIZE = 0 %START
                  W == RHS_LINK;  RHS_LOP = 0
                  %IF SAME(LHS, RHS) %AND DIFFERENT(LHS, W) %START;! S = S.T
                     RELEASE(LHS_BASE)
                     LOAD(LHS, R2);  RELEASE(R2)
                     DROP(RHS);  JOIN(W)
                     DROP(LHS)
                     %RETURN
                  %FINISH
                  %IF DIFFERENT(LHS, W) %START;  ! S = P.Q
                     LRD(RHS, R1);  LRD(LHS, R2);  PERM(CONC1)
                     JOIN(W)
                     %RETURN
                  %FINISH
                  RHS_LOP = CONC
               %FINISH
               WDISP = 44 %IF WDISP = 0 %AND LHS_BASE = WSP
               LRD(RHS, R1);  LRD(LHS, R2)
               %IF SIZE # 0 %START
                  CSTACK(SIZE);  STP = STP-1;  LRD(STACKED(STP+1)_V, R0)
                  PERM(STRING ASS)
               %FINISH
               PERM(SMOVE)
               %RETURN
            %FINISH
         %FINISH
         ADDRESS(LHS)
         %IF (LHS_TYPE = INTEGER %AND CONTROL&UNASS DIAG = 0) %C
         %OR LHS_TYPE = SHORT %START
            %IF RHS_LOP = ADD %START
               T = ADD;  T = SADD %IF SAME(LHS, RHS)
               RHS_LOP = 0;  OPTIMISE(RHS);  RHS_LOP = T
               %IF SAME(LHS, RHS) %START
                  W == RHS_LINK
                  LOAD(W, ANY)
                  RELEASE(LHS_BASE)
                  CCV = LHS;  CCREG = -2
                  %IF LHS_TYPE = SHORT %THEN P = AHM %C
                                       %ELSE P = AM
                  RX(P, W_BASE, LHS_BASE, LHS_DISP)
                  PERM(ASSTH) %IF CONTROL&ASSDIAG # 0 %C
                                   %AND P = AHM
                  FORGET DEST(LHS)
                  RELEASE(W_BASE)
                  DROP(RHS);  DROP(W);  DROP(LHS)
                  CCCA = CA
                  %RETURN
               %FINISH
            %FINISH
         %FINISH
         %IF LHS_BASE = PARAM %START
            NEW DISP = 0
            P = LHS_DISP
            LOAD(RHS, P) %IF RHS_LOP # 0;  DROP(LHS)
            LHS == STACKED(STP)_V
            RHS_LINK == LHS_LINK;  RHS_LOP = LHS_LOP
            LHS_LINK == RHS;  LHS_LOP = P
         %ELSE
            P = ANY;  VAL = 0
            %IF LHS_TYPE = INTEGER %START
               OP = ST
            %ELSE %IF LHS_TYPE = SHORT
               OP = STH;  VAL = X'FFFF';  T = ASSTH
            %ELSE %IF LHS_TYPE = BYTE
               OP = STB;  VAL = 255;      T = ASSTB
            %ELSE
               OP = STE;  P = ANYF
            %FINISH
            %IF VAL # 0 %START;          ! POSSIBLE TEST REQUIRED
               %IF RHS_LOP = 0 %START
                  VAL = 0 %IF (VAL = X'FFFF' %AND RHS_TYPE # INTEGER) %C
                        %OR RHS_TYPE = BYTE
               %ELSE %IF RHS_LOP = AND
                  %IF RHS_LINK_FORM=CONSTANT %AND RHS_LINK_DISP=VAL %START
                     DROP(RHS_LINK)
                     RHS_LOP = 0;  VAL = 0;   ! DISPENSE WITH TEST
                  %FINISH
               %FINISH
            %FINISH
            %IF CONTROL&ASSDIAG # 0 %AND RHS_FORM = CONSTANT %START
               VAL = 0 %IF VAL = 255 %AND RHS_DISP>>8 = 0
               VAL = 0 %IF VAL = X'FFFF' %C
                              %AND X'FFFF8000'<=RHS_DISP<=X'10000'
            %FINISH
            LOAD(RHS, P)
            FORGET DEST(LHS)
            RX(OP, RHS_BASE, LHS_BASE, LHS_DISP);  CCCA = CCCA+4
            REMEMBER(RHS_BASE+STORE, LHS);            !MOVED ONE LINE DOWN??
            %IF VAL = 0 %OR CONTROL&ASSDIAG = 0 %START;! NO STORE TEST
               RELEASE(RHS_BASE)
            %ELSE
               %IF T = ASSTH %START
                  RR(CHVR, RHS_BASE, RHS_BASE)
               %ELSE
                  HAZARD(R0)
                  RR(LBR, R0, RHS_BASE)
                  CLAIM(RHS_BASE);  RR(CR, R0, RHS_BASE)
               %FINISH
               PERM(T)
            %FINISH
            DROP(RHS);  DROP(LHS)
         %FINISH
      %END
      %ROUTINE ARRAY REF
         %RECORD(STACKFM)%NAME A
         %ownRECORD(STACKFM) T=0   {to prevent unassigned problems}
         %INTEGER R, D
         SET BOTH
         T_BASE = CODE
         A == LHS
         REDUCE(A) %IF A_FORM > V IN S %AND A_FORM # AV IN S
         D = 0
         %IF RHS_LOP=ADD %AND CONST(RHS_LINK) %START
            D = RHS_LINK_DISP*A_LENGTH
            RHS_LOP = 0
            DROP(RHS_LINK)
         %FINISH
         %IF A_FORM = V IN S %START
            %IF RHS_LOP = 0 %AND A_LENGTH <= 256 %START
               ADDRESS(RHS) %UNLESS RHS_FORM = CONSTANT
               T_BASE = RHS_BASE+A_BASE<<8
               T_DISP = RHS_DISP
               T_TYPE = A_LENGTH
               T_FORM = RHS_FORM ! 128
               R = FIND USE(T_TYPE, T_FORM, T_BASE, T_DISP)
               %IF R # 0 %START
                  STP = STP-1
                  A_BASE = R;  A_DISP = A_DISP+D;  A_FORM = V IN S
                  DROP(RHS)
                  %RETURN
               %FINISH
            %FINISH
         %FINISH
         CSTACK(A_LENGTH)
         OPERATE(MUL);  LHS == STACKED(STP)_V
         SSET(A_BASE, A_DISP, V IN S, 0)
         %IF A_FORM = V IN S %START;! ARRAY
            D = D+RHS_DISP;  RHS_DISP = 0
            RHS_FORM = V IN R
         %FINISH
         %IF CONST(LHS) %START
            LOAD(RHS, ANY0) %IF RHS_FORM = V IN S
            D = D+LHS_DISP;  LHS_BASE = RHS_BASE
            STP = STP-1
         %ELSE %IF RHS_BASE = 0 %AND RHS_FORM = V IN R
            LOAD(LHS, ANY0)
            STP = STP-1
         %ELSE
            OPERATE(ADD);  LHS == STACKED(STP)_V;  RHS == LHS
         %FINISH
         LOAD(LHS, ANY0) %IF LHS_LOP # 0
         STP = STP-1
         REMEMBER(LHS_BASE, T) %IF LHS_FORM = V IN R
         A_FORM = V IN S;  A_BASE = LHS_BASE;  A_DISP = D
         %IF D < 0 %START
            R = A_TYPE;  AMAP(A);  LOAD(A, ANY0)
            A_TYPE = R;  A_FORM = V IN S
         %FINISH
         DROP(RHS) %UNLESS RHS == LHS
         DROP(LHS)
      %END
      %ROUTINE CHECKED ARRAY REF
         %INTEGER D, FLAG
         SET BOTH;  STP = STP-2
         REDUCE(LHS) %IF LHS_FORM > V IN S %AND LHS_FORM # AV IN S
         LRD(RHS, R1)
         HAZARD(R2);  FORGET(R2)
         %IF LHS_DV < 0 %START
            FLAG = 0;  D = 0;  RX(LW, R2, LHS_BASE, LHS_DISP+REGLEN)
            CLAIM(LHS_BASE)
         %ELSE
            FLAG = 1;  D = LHS_DISP;  RI2(LHI, R2, GLA, LHS_DV)
         %FINISH
         PERM(A REF);  FORGET(R1)
         %IF FLAG # 0 %START
            RR(AR, R1, LHS_BASE)
         %ELSE
            RX(AW, R1, LHS_BASE, LHS_DISP)
         %FINISH
         LHS_BASE = R1;  LHS_DISP = D;  LHS_FORM = V IN S;  LHS_DV = 0
         SSTACK(LHS)
         DROP(LHS)
      %END
      %ROUTINE KNOW(%INTEGER REG, VALUE, TYPE)
         KNOWN_BASE = REG+STORE;  KNOWN_DISP = VALUE
         KNOWN_TYPE = TYPE
         KNOWN_CA = 0 %IF USE(KNOWN_BASE)_CA < LIMEN %C
                      %OR USE(KNOWN_BASE)_CA = USE(KNOWN_BASE-STORE)_CA
      %END
      %ROUTINE TEST ZERO(%RECORD(STACKFM)%NAME V)
         %RECORD(STACKFM)%NAME W
         %INTEGER OP, COP, CR, CT, NOT
         NOT = NEXTSYMBOL-'#'
         OP = V_LOP
         COP = LR ;  CR = ANY;  CT = INTEGER
         %IF FLOATING(V) %START
            COP = LER;  CR = ANYF;  CT = REALS
         %ELSE %IF OP # 0 %AND SYM = '?'
            W == V_LINK;  V_LOP = 0
            %IF OP = AND %AND (W_FORM = CONSTANT %OR W_FORM = V IN R) %C
                                             %START
               %IF V_FORM # V IN R # W_FORM %AND V_TYPE = INTEGER %START
                  %IF W_DISP&X'FFFF' = 0 %OR W_DISP>>16 = 0 %START
                     ADDRESS(V)
                     V_TYPE = UNSIGNED HALFWORD
                     W_TYPE = UNSIGNED HALFWORD
                     %IF W_DISP&X'FFFF' = 0 %START
                        W_DISP = W_DISP>>16
                     %ELSE
                        V_DISP = V_DISP+2
                     %FINISH
                  %FINISH
               %FINISH
               LOAD(V, ANY)
               W_DISP = 0 %AND W_TYPE = 0 %IF W_FORM = V IN R
               %IF -X'8000' <= W_DISP <= X'7FFF' %C
                  %OR W_TYPE = UNSIGNED HALFWORD %START
                  RI2(THI,V_BASE,W_BASE,W_DISP)
               %ELSE
                  RI3(TI,V_BASE,W_BASE,W_DISP)
               %FINISH
               RELEASE(V_BASE);  DROP(W)
               %RETURN
            %FINISH
            %IF W_FORM = CONSTANT %AND OP = ADD %C
                           %AND (W_DISP < -15 %OR W_DISP > 15) %START
               W_DISP = -W_DISP
               COMPARE(V, W);  DROP(W)
               %RETURN
            %FINISH
            V_LOP = OP
         %FINISH
         %IF OP = 0 %AND CCCA = CA %AND LIMEN # CA %START
            %IF CCREG < 0 %AND SAME(CCV, V) %START
               RELEASE(V_BASE);  %RETURN
            %FINISH
            OPTIMISE(V)
            %IF V_FORM = V IN R %AND V_BASE = CCREG %START
               RELEASE(V_BASE)
               KNOW(V_BASE, 0, CT) %IF NOT = 0
               %RETURN
            %FINISH
         %FINISH
         LOAD(V, CR)
         %UNLESS CCREG = V_BASE %AND CCCA = CA %START
            RR(COP, V_BASE, V_BASE)
         %ELSE
            RELEASE(V_BASE)
         %FINISH
         KNOW(V_BASE, 0, CT) %IF NOT = 0
      %END
      %ROUTINE COMPARE REALS(%RECORD(STACKFM)%NAME L, R)
         %RECORD(STACKFM) H
         FLOAT(L, ANYF) %UNLESS L_TYPE = REALS
         FLOAT(R, ANYF) %UNLESS R_TYPE = REALS
         LOAD(L,ANYF) %IF L_LOP # 0
         LOAD(R,ANYF) %IF R_LOP # 0
         %IF L_FORM # V IN R %AND R_FORM = V IN R %START
            H = L;  L = R;  R = H
            INVERT = INVERT!!6;  SWOPPED = SWOPPED!!1
         %FINISH
         LOAD(L, ANYF)
         LOAD(R, ANYF) %IF CONTROL&UNASS DIAG # 0
         ADDRESS(R)
         %IF R_FORM = V IN R %START
            RR(CER, L_BASE, R_BASE)
         %ELSE
            RX(CE, L_BASE, R_BASE, R_DISP)
         %FINISH
         RELEASE(L_BASE)
      %END
   %ROUTINE COMPARE STRINGS(%RECORD(STACKFM)%NAME L, R)
      %ROUTINE TEST NULL(%RECORD(STACKFM)%NAME R)
         ACTIVE STRING == NULL
         LOAD(R, ANY) %IF R_LOP # 0
         R_TYPE = BYTE
         TEST ZERO(R)
      %END
      SDISP = 256 %IF L_TYPE = 0 %OR R_TYPE = 0 %C
                  %OR L_LOP # 0 %OR R_LOP # 0
      %IF CSLEN = 0 %START
         %IF R_FORM = CONSTANT %START
            TEST NULL(L);  L_TYPE = STRING;  L_FORM = V IN S;  %RETURN
         %FINISH
         %IF L_FORM = CONSTANT %START
            TEST NULL(R);  INVERT = INVERT!!6;  %RETURN
         %FINISH
      %FINISH
      DUMP STRING(0)
      LOAD(R, R1);  LOAD(L, R2);  LOAD(R, R1);! IN CASE OF HAZARD!
      RELEASE(R1);  RELEASE(R2)
      PERM(SCOMP)
      L_TYPE = STRING;  L_FORM = V IN S
      WDISP = 0
   %END
      %ROUTINE COMPARE(%RECORD(STACKFM)%NAME L, R)
         %RECORD(STACKFM) T
         %INTEGER OP, ARITH
         %PREDICATE CHANCED
            %FALSE %UNLESS L_LOP = ADD %AND SYM # 126
            %FALSE %UNLESS L_LINK_FORM = CONSTANT %AND L_BASE # 0
            %FALSE %UNLESS -X'8000' <= L_LINK_DISP <= X'7FFF'
            %FALSE %IF L_TYPE = REALS
            INVERT = INVERT!!6;  SWOPPED = SWOPPED!!1
            T = L;  L = R;  R = T
            R_LOP = 0
            LOAD(L, ANY)
            LOAD(R, ANY0)
            %IF -X'8000' <= R_LINK_DISP <= X'7FFF' %START
               %IF ARITH # 0 %THEN OP = CLHI %ELSE OP = CHI
               RI2(OP,L_BASE,R_BASE,R_LINK_DISP)
            %ELSE
               %IF ARITH # 0 %THEN OP = CLI %ELSE OP = CI
               RI3(OP,L_BASE,R_BASE,R_LINK_DISP)
            %FINISH
            RELEASE(L_BASE)
            DROP(R_LINK)
            %TRUE
         %END
         SWOPPED = 0;  SDISP = 0
         %IF LHS_TYPE = 0 %OR LHS_TYPE = STRING %START
            COMPARE STRINGS(L, R);  %RETURN
         %FINISH
         %IF ZERO(R) %START
            TEST ZERO(L);  %RETURN
         %FINISH
         %IF ZERO(L) %START
            TEST ZERO(R);  INVERT = INVERT!!6;  %RETURN
         %FINISH
         ARITH = NEXTSYMBOL
         ARITH = 0 %IF ARITH # '#' %AND ARITH # '=' %AND SYM # 'F'+32
         %RETURN %IF CHANCED
         OPTIMISE(R);  OPTIMISE(L)
         COMPARE REALS(L ,R) %AND %RETURN %IF FLOATING(L) %OR FLOATING(R)
         %IF CONST(L) %OR R_FORM = V IN R %OR L_TYPE = BYTE %C
                      %OR R_LOP # 0 %START
            T = L;  L = R;  R = T
            INVERT = INVERT!!6;  SWOPPED = SWOPPED!!1
            %RETURN %IF CHANCED
         %FINISH
         LOAD(L, ANY)
         %IF R_LOP # 0 %OR R_TYPE = BYTE %OR R_TYPE = UNSIGNED HALFWORD %C
            %OR (CONTROL&UNASS DIAG # 0 %AND (R_FORM=VINS %OR %C
                  R_FORM=AVINS)) %START
            LOAD(R, ANY)
         %FINISH
         REDUCE(R) %IF R_FORM = AV IN REC
         %IF (R_FORM = CONSTANT %OR R_FORM = AV IN S) %START
            %IF -X'8000' <= R_DISP <= X'7FFF' %START
               %IF ARITH # 0 %THEN OP = CLHI %ELSE OP = CHI
               RI2(OP,L_BASE,R_BASE,R_DISP)
            %ELSE
               %IF ARITH # 0 %THEN OP = CLI %ELSE OP = CI
               RI3(OP,L_BASE,R_BASE,R_DISP)
            %FINISH
            KNOW(L_BASE, R_DISP, INTEGER) %IF R_FORM = CONSTANT %C
                                        %AND ARITH = '#'
         %ELSE
            ADDRESS(R)
            %IF R_FORM = V IN R %START
               %IF ARITH # 0 %THEN OP = CLR  %ELSE OP = CR
               RR(OP, L_BASE, R_BASE)
            %ELSE
               %IF R_TYPE = BYTE %START
                  OP = CLB
               %ELSE %IF ARITH # 0
                  %IF R_TYPE = SHORT %THEN OP = CLH %ELSE OP = CL
               %ELSE
                  %IF R_TYPE = SHORT %THEN OP = CH %ELSE OP = C
               %FINISH
               RX(OP, L_BASE, R_BASE, R_DISP)
            %FINISH
         %FINISH
         RELEASE(L_BASE)
      %END
      %ROUTINE CLAIM WSP(%INTEGERNAME SIZE)
         SIZE = (WDISP+(REGLEN-1))&(\(REGLEN-1));  %RETURN %IF SIZE = 0
         WDISP = 0
         RI2(AHI, WSP, 0, SIZE) %IF SIZE > 15
      %END
      %ROUTINE RELEASE WSP(%INTEGER SIZE)
         WDISP = SIZE
         RI2(SHI, WSP, 0, WDISP) %IF WDISP > 15
      %END
      %ROUTINE HEADER(%RECORD(VARFM)%NAME V)
         LIMEN = CA-2
         FRAME = 11*REGLEN %IF FRAME < 11*REGLEN
         DEFINE TAG(V_DISP&X'FFF') %UNLESS V == BEGIN
         RX(STM, P2, WSP, 0)
         RR(LR , LOCAL, WSP)
         %IF CONTROL&(UNASS DIAG!STKDIAG) # 0 %START
            %IF CONTROL&UNASS DIAG # 0 %START
               PERM(EXBUNASS);  DUMP(FRAME)
            %ELSE
               PERM(EXB)
            %FINISH
         %ELSE
            DUMP(AHI+ACTUAL(WSP)<<4)
         %FINISH
         SIZE PATCH = CA
         DUMP(0)
      %END
      %ROUTINE RETURN
         %RETURN %IF UNCOND JUMP = CA
         RX(LM, WSP, LOCAL, 2*REGLEN)
         CLAIM(LINK);  RR(BFCR, 0, LINK)
         UNCOND JUMP = CA
      %END
      %ROUTINE CALL(%RECORD(STACKFM)%NAME V)
         %SWITCH B(0:15)
         %OWNINTEGER INT G = 0, FRACPT G = 0
         %INTEGER WORK, AWORK, REG, AREG
         %INTEGER ADDR, T, L
         %INTEGERFN SET(%INTEGER H, L)
            GFIX(4)
            GHALF(H);  GHALF(L)
            %RESULT = GA-4
         %END
         ADDR = V_DISP
         %IF ADDR < 0 %START
            PERM(X'1EF00'-ADDR)
         %ELSE
            %IF V_BASE = LINK %START;      ! INTRINSIC
               V_DV = 0;  DROP(V)
               SET LHS
               L = 0;  T = V_DISP;  SYM = 0
               ->B(T)
B(12):! FRACPT
               LOAD(LHS, ANYF)
               REG = LHS_BASE;  AREG = ACTUAL(REG)
               WORK = FPR;      AWORK = ACTUAL(WORK)
               DUMP(LER+AWORK<<4+AREG)
               %IF FRACPT G = 0 %START
                  FRACPT G = SET(X'4600', 0);  ! UNNORM. ZERO
                  ADDR = SET(X'4110', 0);! 1.0
               %FINISH
               DUMP(AE+AWORK<<4+ACTUAL(GLA));  DUMP(FRACPT G)
               DUMP(LER+AWORK<<4+AWORK)
               DUMP(SER+AREG<<4+AWORK)
               DUMP(X'2313');     ! BNMFS .+3
               DUMP(AE+AREG<<4+ACTUAL(GLA));  DUMP(FRACPT G+4)
               FORGET(REG);  FORGET(WORK)
               %RETURN
B(11):! INT
               INT G = SET(X'4080', 0) %IF INT G = 0;!  =0.5
               STACK(INT G, GLA, REALS, 1, 0, 0, 0);  OPERATE(ADD)
               SET LHS
B(10):! INTPT
               LOAD(LHS, ANYF)
               L = GPR(0);   RR(FXR, L, LHS_BASE)
               CLAIM(L);  LHS_BASE = L;  LHS_TYPE = INTEGER
               %RETURN
B(0):! ADDR
               AMAP(LHS);  %RETURN
B(7):! LENGTH
               CSTACK(0)
B(8):! CHARNO
               SET BOTH
               LHS_TYPE = BYTE;  LHS_LENGTH = 1;  ARRAY REF
               %RETURN
B(4):! STRING
               L = 255
B(1):! INTEGER
B(2):! BYTEINTEGER
B(3):! SHORTINTEGER
B(5):! RECORD
B(6):! REAL
               VMAP(LHS);  LHS_TYPE = T;  LHS_LENGTH = L
               %RETURN
B(9):! REM
               SET BOTH
               OPERATE(REM);  %RETURN
B(13):! READSYMBOL
               LIMEN = CA;            !SPECIALLY HERE
               PERM(RSYM);  CLAIM(R1)
               SSET(R1, 0, V IN R, 0)
               ASSIGN(1);  %RETURN
B(14):! TOSTRING
               CSTACK(255);  OPERATE(AND)
               CSTACK(256);  OPERATE(ADD)
               SET LHS
               %IF CONST(LHS) %START
                  GFIX(2);  ADDR = GA;  GHALF(LHS_DISP)
                  LHS_TYPE = STRING;  LHS_FORM = V IN S
                  LHS_BASE = GLA;  LHS_DISP = ADDR
               %ELSE
                  SSTACK(LHS);  SET BOTH
                  LHS_LOP = 0;  RELEASE(LHS_BASE)
                  FRAME = (FRAME+1)&(\1)
                  LHS_TYPE = SHORT;  LHS_FORM = V IN S
                  LHS_BASE = LOCAL;  LHS_DISP = FRAME
                  ASSIGN(1)
                  SSET(LOCAL, FRAME, V IN S, 0);  RHS_TYPE = STRING
                  FRAME = FRAME+2
               %FINISH
               %RETURN
B(15):! SVC(N, P)
               SET BOTH;  STP = STP-2
               REG = 0;  WORK = LHS_DISP
               %UNLESS CONST(LHS) %START
                  LOAD(LHS, ANY0);  WORK = 0;  REG = LHS_BASE
               %FINISH
               ADDRESS(RHS)
               RX(LME, FPR0, RHS_BASE, RHS_DISP)
               RX(SVC, 0, REG, WORK)
               CLAIM(RHS_BASE)
               RX(STME, FPR0, RHS_BASE, RHS_DISP)
               DROP(RHS);  DROP(LHS)
               LIMEN = CA;   !FORGET EVERYTHING
               %RETURN
            %FINISH
            HAZARD ALL
            %IF ADDR&X'4000' = 0 %START;   ! PARAMETER
               ADDR = NEW TAG;  DEFINE REFERENCE(ADDR, R REF)
               RX(LA, LINK, CODE, 0);! RETURN ADDRESS
               RX(STM, P2, WSP, 0)
               RX(LW, R2, V_BASE, V_DISP)
               RX(LW, R3, V_BASE, V_DISP+REGLEN)
               CLAIM(R2);  RX(LM, R9, R2, 4*REGLEN)
               CLAIM(R3);  RX(BAL, LINK, R3, 4)
               DEFINE TAG(ADDR)
            %ELSE
               DEFINE REFERENCE(ADDR&X'FFF', R REF)
               RX(BAL, LINK, CODE, ADDR&X'FFF')
            %FINISH
            LIMEN = CA-1
         %FINISH
         DROP(V) %IF V_TYPE = 0
      %END
      %ROUTINE FOR
         %RECORD(STACKFM)%NAME CV, IV, INC, FV
         %INTEGER LAB, REG, SPECIAL
         %ROUTINE  STAB(%RECORD(STACKFM)%NAME  V,  %INTEGER  TYPE)
            %INTEGER T, R
            %RETURN %IF CONST(V)
            LOAD(V, ANY);  R = V_BASE
            T = TEMP;  RX(ST, R, LOCAL, T)
            RELEASE(R)
            V_BASE = LOCAL;  V_DISP = T
            V_TYPE = TYPE;  V_FORM = V IN S
            REMEMBER(R, V)
         %END
         %PREDICATE  CHECK REQD
         %INTEGER I
            %TRUE %UNLESS CONST(FV) %AND CONST(IV) %AND CONST(INC)
            %IF INC_DISP # 0 %START
               I = (FV_DISP - IV_DISP)//INC_DISP + 1
               %FALSE %IF I >= 0 %AND IV_DISP + (I-1)*INC_DISP = FV_DISP
            %FINISH
            ABORT(-12);    ! ...FAULTY, CONSTANT, %FOR PARAMETERS
            %TRUE;         ! ...INCLUDE RUN-TIME CHECK FOR SAFETY
         %END
         %ROUTINE  SET(%RECORD(STACKFM)%NAME  V, %INTEGER  REG)
         %RECORD(STACKFM)%NAME  R
            SSTACK(V);  R == STACKED(STP)_V
            LRD(R, REG)
            STP = STP-1
         %END

         SPECIAL = 0
         CV == STACKED(STP-3)_V
         IV == STACKED(STP-2)_V
         INC== STACKED(STP-1)_V
         FV == STACKED(STP  )_V
         SKIPSYMBOL;  LAB = TAG
         STAB(INC,INTEGER);  STAB(FV,INTEGER)
         %IF CONTROL&FORDIAG # 0 %AND CHECK REQD %START
            STAB(IV,INTEGER)
            SET(IV,R0);  SET(FV,R1);  SET(INC,R2)
            PERM(FORTEST)
         %FINISH
         %IF CV_FORM # V IN S %OR ACTIVITY(CV_BASE) >= 0 %START
            AMAP(CV)
            STAB(CV, CV_TYPE)
            CV_FORM = A IN S
         %FINISH
         SPECIAL = CONTROL&512 %IF CONST(FV) %AND CONST(INC) %C
                              %AND CONST(IV) %AND FV_DISP+INC_DISP # IV_DISP
         STP = STP-4
         SSTACK(CV);  SSTACK(IV);  RELEASE(IV_BASE);  SSTACK(INC)
         DROP(IV)
         OPERATE(SUB)
         %IF SPECIAL # 0 %START
            REG = GPR(0);  SET LHS;  LOAD(LHS, REG)
         %ELSE
            ASSIGN(1);    ! CV = CV-INC
         %FINISH
         DEFINE LABEL(LAB)
         %IF SPECIAL # 0 %START
            FLAB_BASE = CV_BASE;  FLAB_DISP = CV_DISP
            FLAB_REG = REG
            FLAB_LIMIT = FV_DISP
            SSTACK(INC);  OPERATE(ADD);  ASSIGN(1)
            USE(REG) = USE(REG+STORE);   ! REMEMBER CONTROL VAR
         %ELSE
            SSTACK(CV);  SSTACK(CV)
            COMPARE(CV, FV)
            JUMP TO(LAB-2, 0, REDEFINE)
            SSTACK(INC);  OPERATE(ADD);  ASSIGN(1)
         %FINISH
         DROP(CV);  DROP(FV);  DROP(INC)
      %END;        ! ... OF 'FOR'
      %ROUTINE  ADUMP
      %IF OWNTYPE = INTEGER  %START
         GWORD(OWNVAL)
      %ELSE %IF OWNTYPE = SHORT
         GHALF(OWNVAL)
      %ELSE %IF OWNTYPE = BYTE
         GBYTE(OWNVAL)
      %ELSE %IF OWNTYPE = STRING
         DUMP STRING(DATA SIZE)
      %ELSE %IF OWNTYPE = REALS
         GWORD(OWNVAL) %IF REALGA = GA
         REALGA = GA
      %ELSE
         GHALF(0) %FOR VAL = 1,1,DATA SIZE >> 1
      %FINISH
   %END

NEXT: READSYMBOL(SYM);  ->Z(SYM)
Z('O'):ABORT(14) %IF STP # 0
       ABORT(19) %UNLESS USING_LINK == NULL
       CHECK RELEASED
       SET LINE
       MIN TEMP = FRAME
       DIAG GLA = 0;  WDISP = 0
       %IF FRAME >= X'4000' %AND WARNING = 0 %START
WARN:     WARNING = -15;  ABORT(-15)
       %FINISH
       ->NEXT
Z('$'):DEFINE VAR;  ->NEXT
Z(98):APARM = TAG;    ! LOWER CASE 'B'
Z(119):STP = STP-2;    !  LOWER CASE 'W'
       VLB = STACKED(STP+1)_V_DISP
       VUB = STACKED(STP+2)_V_DISP
       DROP(STACKED(STP+1)_V);  DROP(STACKED(STP+2)_V)
      ! IMP SWITCH BOUNDS MUST BE AS BELOW -- POTENTIAL ALGOL PROBLEM???
       %IF VLB < -32768 %OR VUB > 32767 %START
          ABORT(-10);  VUB = 0;  VLB = 0
       %FINISH
       ->NEXT
Z('I'):VAL = (VUB-VLB+1)*DATA SIZE
       VAL = DATA SIZE %AND ABORT(-8) %IF VAL <= 0
       GBYTE(0) %FOR J = 1, 1, VAL
       ->NEXT
Z('A'):APARM = 1
       SKIPSYMBOL %AND APARM = TAG %IF NEXTSYMBOL = COMMA
       %IF OWNFORM = ARRAY %START
          OWNVAL = 0
          %IF STP # 0 %START
             POP LHS;  OWN VAL = LHS_DISP;  DROP(LHS)
          %FINISH
          %IF STP # 0 %START
             APARM = OWN VAL
             POP LHS;  OWNVAL = LHS_DISP;  DROP(LHS)
          %FINISH
          %IF OWNTYPE = REALS %START
             %IF LHS_TYPE = INTEGER %START
                REAL(ADDR(OWNVAL)) = OWNVAL
             %ELSE
                DECVAR_DISP = DECVAR_DISP-4
             %FINISH
          %FINISH
          APARM = VUB-VLB+1 %IF APARM = 0
          %IF APARM <= 0 %START
             VUB = VLB;  APARM = 1;  ABORT(-8)
          %FINISH
          %FOR J = 1, 1, APARM %CYCLE
             VLB = VLB+1
             ADUMP
          %REPEAT
       %ELSE
          OWNVAL = 0
          %IF STP # 0 %START
             POP LHS;  OWN VAL = LHS_DISP;  DROP(LHS)
          %FINISH
          NAMES = NAMES-APARM
          ->NEXT %IF OWNFORM = 5
          %FOR J = 1, 1, APARM %CYCLE
             NAMES = NAMES+1;  DEC VAR == VAR(NAMES)
             %IF OTYPE = 0 %START
                DECVAR_DISP = OWNVAL;  DECVAR_BASE = 0
                DECVAR_FORM = DECVAR_FORM-1
             %ELSE
                DECVAR_DISP = GA;  DECVAR_BASE = GLA
                %IF OWNTYPE = REALS %AND LHS_TYPE = REALS %START
                   DECVAR_DISP = DECVAR_DISP-4
                %FINISH
                ADUMP
             %FINISH
          %REPEAT
       %FINISH
       ->WARN %IF GA > X'4000' %AND WARNING = 0
       ->NEXT
Z(''''):GET STRING;  ->NEXT
Z('N'):LEN = TAG;  SKIPSYMBOL
       CSTACK(EVAL(LEN));  ->NEXT
Z('D'): RHS == DESCRIPTOR; FP CSTACK(REAL CONSTANT,RHS); -> NEXT

Z('@'):%IF NEXTSYMBOL = MINUS %START
          SKIPSYMBOL;  LEN = TAG;  SET LHS
          V == VAR(VAR(LHS_FORMAT)_EXTRA+LEN-1)
          DISPLAY VAR(V) %IF CONTROL < 0
          VSTACK(V);  SET BOTH
          STP = STP-1
          %IF LHS_FORM = V IN S %OR LHS_FORM = V IN REC %START
             RHS_DISP = LHS_DISP+RHS_DISP
             LHS_FORM = LHS_FORM-V IN S+RHS_FORM
          %ELSE %IF LHS_FORM = A IN REC
            LHS_FORM = V IN REC;  LHS_TYPE = INTEGER
            LOAD(LHS, ANY0)
            LHS_FORM = RHS_FORM
          %ELSE %IF LHS_FORM <= V IN R
             LHS_FORM = RHS_FORM
          %ELSE
             LHS_EXTRA = LHS_DISP
             LHS_FORM = RHS_FORM+2
          %FINISH
          LHS_DISP = RHS_DISP
          LHS_TYPE = RHS_TYPE;  LHS_LENGTH = RHS_LENGTH
          LHS_FORMAT = RHS_FORMAT;  LHS_DV = RHS_DV
          DROP(RHS)
       %ELSE
          V == VAR(LOOKUP(TAG))
          VSTACK(V)
          CLAIM WSP(LHS_DV) %IF LHS_FORM&16 # 0 %AND  %C
                            LHS_BASE # LINK %AND NEXTSYMBOL # 'P'+32
       %FINISH
       ->NEXT
Z('E'):POP LHS
       OPR = LHS_LOP;  LHS_LOP = 0;  J = 0
       %WHILE OPR # 0 %CYCLE
          X == LHS_LINK;  LHS_LINK == X_LINK
          N = X_LOP;  X_LOP = 0
          LOAD(X, OPR)
          DROP(X);  J = J<<8!OPR
          OPR = N
       %REPEAT
       RELEASE(J&255);  RELEASE(J>>8)
       X == LHS;  CALL(X);  DOPE = X_DV
       %IF X_TYPE # 0 %AND SYM # 0 %START;! FN/MAP
         SSTACK(X);  DROP(X);  SET LHS;  RELEASE(LHS_BASE)
          %IF LHS_TYPE = REALS %THEN OPR = FPR0 %ELSE OPR = R1
          LHS_BASE = OPR;  LHS_DISP = 0;  LHS_FORM = LHS_FORM&15
          CLAIM(OPR)
          %IF LHS_TYPE = STRING %AND LHS_FORM = V IN R %START
             LHS_FORM = V IN S
             SYM = NEXTSYMBOL
             %IF SYM # 'S' %AND SYM # 'P'+32 %AND SYM # '?' %START
                N = X_LENGTH;  N = 256 %IF N = 0
                FRAME = (FRAME+1)&(\1)
                LHS_FORM = V IN S;  LHS_BASE = LOCAL;  LHS_DISP = FRAME
                FRAME = FRAME+N
                SSET(LOCAL, LHS_DISP, V IN S, 0)
                RHS_TYPE = STRING;  RHS_LENGTH = N
                SSET(R1, 0, V IN S, 0);  RHS_TYPE = STRING
                ASSIGN(1)
             %FINISH
          %FINISH
       %FINISH
       RELEASE WSP(DOPE) %IF SYM # 0;  !NOT IF BUILT-IN
       ->NEXT
Z('R'):RETURN;  ->NEXT
Z('V'):POP LHS
      DUMP STRING(0)
       %IF GVAR_TYPE = REALS %THEN OPR = FPR0 %ELSE OPR = R1
       LRD(LHS, OPR);  RETURN;  ->NEXT
Z('M'):POP LHS;  AMAP(LHS);  LRD(LHS, R1);  RETURN;  ->NEXT
Z('T'):DUMP(X'2411');  RETURN;     !  *LIS R1, 1
       ->NEXT
Z('K'):DUMP(X'2410');  RETURN;     !  *LIS R1, 0
       ->NEXT
Z(97):%IF CONTROL&ARRAY DIAG # 0 %THEN CHECKED ARRAY REF %C
                                 %ELSE ARRAY REF
       ->NEXT
Z('.'):OPR = CONC;  ->ARITH
Z('+'):OPR = ADD;   ->ARITH
Z('-'):OPR = SUB;   ->ARITH
Z('!'):OPR = IOR;   ->ARITH
Z('%'):OPR = XOR;   ->ARITH
Z('&'):OPR = AND;   ->ARITH
Z('['):OPR = LSH;   ->ARITH
Z(']'):OPR = RSH;   ->ARITH
Z('*'):OPR = MUL;   ->ARITH
Z('/'):OPR = DIV;   ->ARITH
Z('Q'):OPR = RDIV;  ->ARITH
Z('U'):OPR = NEG;   ->ARITH
Z('\'):OPR = NOT;   ->ARITH
Z('X'):
Z(120):OPR = EXP;   ! LOWER CASE 'X'

ARITH: OPERATE(OPR);  ->NEXT

Z(118):SET LHS;    ! LOWER CASE 'V'
       CCREG = 0 %IF CCREG < 0
       %IF FLOATING(LHS) %THEN K = ANYF %ELSE K = ANY
       LOAD(LHS,K)
       TEST ZERO(LHS)
       K = LHS_BASE
       JUMP TO(3, 5, REDEFINE)
       CLAIM(LHS_BASE)
       OPERATE(NEG);  SET LHS
       LOAD(LHS,K)
       DEFINE LABEL(3)
       FORGET(LHS_BASE)
       ->NEXT

Z('S'):ASSIGN(1);  ->NEXT
Z('Z'):ASSIGN(0);  ->NEXT
Z(112):ASSIGN(-1);  WDISP = NEW DISP; ->NEXT;      ! LOWER CASE 'P'

Z(107):KNOW(R1, 1, INTEGER)
Z('='):OPR = 0;  ->COND;     !  LOWER CASE  'K'
Z(116):KNOW(R1, 0, INTEGER)
Z('#'):OPR = 1;  ->COND;       ! LOWER CASE 'T'
Z('<'):OPR = 2;  ->COND
Z('>'):OPR = 3;  ->COND
Z('('):OPR = 4;  ->COND
Z(')'):OPR = 5

COND:  VAL = TAG
       JUMP TO(VAL, OPR+INVERT, REDEFINE)
       ->NEXT
Z('C'):SET BOTH
       AMAP(LHS);  AMAP(RHS)
Z(126):! FIRST OF DOUBLE SIDED
Z('?'):SET BOTH
       COMPARE(LHS, RHS);  STP = STP-2
       DROP(RHS);  DROP(LHS)
       ->NEXT
Z('"'):ST WORK = STACKED(STP+SWOPPED+1)_V
       SSTACK(ST WORK)
       WDISP = SDISP
       ->NEXT
Z('_'):LIMEN = CA
       UNCONDJUMP = 0
       V == VAR(LOOKUP(TAG));  POP LHS;  DROP(LHS)
       GPATCH(CA, V_EXTRA+LHS_DISP*2)
       ->NEXT
Z('W'):V == VAR(LOOKUP(TAG))
       %IF CONTROL&TEST SWITCH # 0 %START
          HALF = GLA;  K = V_DISP
          RANGE(HALF, K)
          POP LHS;  LRD(LHS, R1)
          RI2(LHI, R2, HALF, K)
          PERM(SWJUMP)
       %ELSE
          CSTACK(1);  OPERATE(LSH)
          POP LHS;  LRD(LHS, ANY0)
          J = ACTUAL(LHS_BASE)
          DUMP(LHL+J<<4+ACTUAL(GLA))
          K = V_EXTRA
          DUMP(X'4000'+J<<8+K>>16&255)
          DUMP(K&X'FFFF')
          DUMP(AR+J<<4+ACTUAL(CODE))
          DUMP(BFCR+J)
          LIMEN = CA;  UNCOND JUMP = CA
       %FINISH
       ->NEXT
Z('B'):
Z(113):       ! LOWER CASE 'Q'
      JUMP TO(TAG, JUMP, DEFINE);  ->NEXT
Z('F'):
Z(117):      ! LOWER CASE 'U'
      JUMP TO(TAG, JUMP, REDEFINE);  ->NEXT
Z('J'):JUMP TO(-TAG, JUMP, DEFINE);  ->NEXT
Z('L'):DEFINE LABEL(-TAG);  ->NEXT
Z(':'):DEFINE LABEL(TAG);  ->NEXT
Z(102):FOR;  ->NEXT;      !  LOWER CASE 'F'

Z('P'):POP LHS;  DROP(LHS);    DUMP(LHS_DISP);  LIMEN = CA;  ->NEXT
Z(122):POP LHS;  DROP(LHS);  CONTROL = LHS_DISP
       %IF CONTROL&UNASS DIAG # 0 %START
          ACTIVITY(R4) = -1
          ABORT(-14) %IF ENTER UNASS = 0
       %FINISH %ELSE ACTIVITY(R4) = 0
       ->NEXT

Z(100):ABORT(-9) %IF TAG # 1;    ! LOWER CASE 'D'
       SET BOTH
       DOPE = 0
       %UNLESS CONST(LHS) %AND CONST(RHS) %START
          LOAD(LHS, P2);  LOAD(RHS, R3)
          DOPE = -FRAME;  FRAME = FRAME+12
          DYNAMIC = -1
       %ELSE
          DYNAMIC = 0
          VLB = LHS_DISP;  VUB = RHS_DISP
          ABORT(-7) %AND VUB = VLB %UNLESS VLB <= VUB
       %FINISH
       STP = STP-2
       DROP(RHS);  DROP(LHS)
       ->NEXT
Z(104):%IF DYNAMIC # 0 %START;   ! LOWER CASE 'H'
          %IF DYNAMIC < 0 %START
             RI2(LHI, P1, LOCAL, -DOPE)
BIG STATIC:  CSTACK(DATA SIZE);  POP LHS;  LRD(LHS, R1)
             RELEASE(P2);  RELEASE(R3)
             PERM(ASET)
             DYNAMIC = 1
          %FINISH
          DECVAR_FORM = ARRAYNAME;  DECVAR_DISP = FRAME
          FRAME = FRAME+8
          RI2(LHI, R3, LOCAL, DECVAR_DISP);  PERM(ALLOC)
       %ELSE
          %IF DOPE = 0 %START
             GFIX(4);  DOPE = GA
             GWORD(VLB);  GWORD(VUB);  GWORD(DATA SIZE)
          %FINISH
          K = (VUB-VLB+1)*DATA SIZE + FRAME
          %IF K > MAX STATIC %AND GMODE = 0 %START;    ! TOO BIG FOR LOCALS
             CSTACK(VLB);  CSTACK(VUB);  SET BOTH
             LOAD(LHS, P2);  LOAD(RHS, R3)
             DROP(RHS);  DROP(LHS);  STP = STP-2
             RI2(LHI, P1, GLA, DOPE);  FORGET(P1)
             DOPE = -DOPE
             -> BIG STATIC
          %FINISH
          DECVAR_DISP = FRAME-VLB*DATA SIZE
          FRAME = K
       %FINISH
       DECVAR_EXTRA = DOPE
Z(99):->NEXT;    ! LOWER CASE 'C'
Z('G'):READSYMBOL(GG)
       GMODE = \GMODE
       %IF GMODE # 0 %START
          ASSEMBLE(GTYPE, LABS, NAMES)
       %ELSE
          SPS = 0;  N = P1
          GVAR_LENGTH = (FRAME+(REGLEN-1))&(\(REGLEN-1)) %IF GG=FORMATS
          LEN = NAMES-GSTART
          J = 0;  J = LEN %IF GG = FORMATS
          %IF LEN > 0 %START
             LEN = 0
             GVAR_EXTRA = PARMS-J
             %FOR J = GSTART+1, 1, NAMES %CYCLE
                PARMS = PARMS-1
                FP == VAR(PARMS);  AP == VAR(J)
                FP = AP
                %IF GG # FORMATS %START
                   %IF FP_BASE = PARAM %START
                      AP_BASE = LOCAL;  FP_DISP = N
                      %IF GG = PROCEDURE %START
                         VSTACK(AP);  POP LHS;  DROP(LHS)
                         %IF LHS_FORM # V IN S %START
                            LHS_TYPE = INTEGER;  LHS_FORM = V IN S
                         %FINISH
                         REMEMBER(N, LHS)
                      %FINISH
                   %ELSE
                      FP_BASE = WSP;  N = P2
                   %FINISH
                %FINISH
                %IF CONTROL < 0 %START
                   DISPLAY VAR(FP);  DISPLAY VAR(AP)
                %FINISH
                N = N-1
             %REPEAT
             ABORT(-4) %IF PARMS <= NAMES
             %IF GG # FORMATS %START
                %IF FP_TYPE = STRING %AND FP_FORM = 1 %START
                   FP_TYPE = 15;  N = 0
                %FINISH
             %FINISH
          %FINISH
          ->OUT %IF GG # PROCEDURE
          HEADER(GVAR)
          %IF N = 0 %START
             RX(LHI, R2, LOCAL, AP_DISP)
             %IF CONTROL&ASSDIAG # 0 %AND AP_SIZE # 255 %START
                CSTACK(AP_SIZE);  POP LHS;  LRD(LHS, R0)
                PERM(STRING ASS)
             %FINISH
             PERM(SMOVE)
          %FINISH
       %FINISH
       ->NEXT
Z('H'):
       %IF CA = 0 %START;           ! INITIAL BEGIN
          ENTER UNASS = 0
          %IF CONTROL&UNASS DIAG # 0 %START
             ENTER UNASS = X'0140'+ACTUAL(CODE)
             DUMP(X'0234');  DUMP(X'0884');  DUMP(X'2401')
             DUMP(X'2410');  DUMP(X'2440')
             DUMP(X'583D');  DUMP(SIGNAL EP)
             DUMP(X'0303')
             DUMP(X'8080');  DUMP(X'8080')
             DUMP(X'8080');  DUMP(X'8080')
          %FINISH
          HEADER(BEGIN)
       %FINISH
       N = TEMP
       HALF = LOCAL;  K = N;  RANGE(HALF, K)
       RX(ST, WSP, HALF, K)
       DECVAR == BEGIN
       ASSEMBLE(0, LABS, NAMES)
       HALF = LOCAL;  K = N;  RANGE(HALF, K)
       RX(LW, WSP, HALF, K)
       ->NEXT

Z(115):                     ! LOWER CASE 'S'  -  %STOP
       CSTACK(0);  CSTACK(0)
Z(101):     !  LOWER CASE 'E' -- %SIGNAL EVENT,SUBEVENT,EXTRA
       N = STP+R0-1
       %WHILE STP # 0 %CYCLE
          POP LHS;  LRD(LHS, N-STP)
       %REPEAT
       PERM(MONITOR)
       UNCOND JUMP = CA;  STP = 0
       -> NEXT

Z(';'):%IF AMODE = 0 %START
          OLD FRAME = FRAME
       %ELSE
          PATCH((FRAME+(REGLEN-1))&(\(REGLEN-1)), SIZE PATCH)
          %IF UNCOND JUMP # CA %START
             %IF GVAR_TYPE # 0 %START
                ABORT(-11);       ! ...%RESULT MISSING
             %ELSE
                RETURN
             %FINISH
          %FINISH
       %FINISH
       SET DIAG(0, 0, 0, -1)
OUT:   FRAME = OLD FRAME
       %IF AMODE > 0 %START
          ACTIVITY(LOCAL) = 0
          ASS LEVEL = ASS LEVEL-1;  LOCAL = BASE REG(ASS LEVEL)
       %FINISH
       XLEVEL = XLEVEL-1
   %END;! OF ASSEMBLE


   FAULTY = 0

   ABORT(0) %IF MAX VARS = 1;    ! ----COMPILER CAN'T RUN AT ALL----

   SELECT INPUT(INSTREAM)
   SELECT OUTPUT(DIRECT);  PRINT SYMBOL(INIT GLA)
   SELECT OUTPUT(OBJECT);  PRINT SYMBOL(START)
   BLOCK WORD = 'B'-32+('L'-32)<<6+('O'-32)<<12 %C
                      +('C'-32)<<18+('K'-32)<<24
   CA = 0;  LIMEN = 0;  GA = INIT GLA;  DA = 0;  LINE SIZE = 0
   STP = 0;  STACK ASL = 0;  ENVP = 0;  GMODE = 0
   UNCOND JUMP = 0;  CURRENT LINE = 0
   INVERT = 0;  SWOPPED = 0
   PARMS = MAX VARS
   CSLEN == CURRENT STRING(0);  CSLEN = 0;  ACTIVE STRING == NULL
   ACTIVITY(J) = 0 %FOR J = 0, 1, 44
   USED(J) = 0 %FOR J = 0, 1, 20
   ACTIVITY(WSP) = -1;  ACTIVITY(GLA) = -1;  ACTIVITY(CODE) = -1
   ACTIVITY(0) = -1;  KNOWN_CA = -1
   ACTIVITY(R4) = -1 %IF CONTROL&UNASS DIAG # 0
   ENTER UNASS = -1
   ENVIR(J) = 0 %FOR J = 0, 1, MAX ENVIRS
   %for j = 1,1,44 %cycle
      use(j) = 0
      USE(J)_CA = -8
   %repeat
   %FOR J = 0, 1, MAX STACK-1 %CYCLE
      STAK(J)_LINK == STAK(J+1)
      DLIST(J)_LINK == DLIST(J+1)
   %REPEAT
   STAK(MAX STACK)_LINK == NULL;  DLIST(MAX STACK)_LINK == NULL
   DESC ASL == STAK(0);  DASL == DLIST(0)
   USING_LINK == NULL
   DECVAR == BEGIN

   ASSEMBLE(2, 0, 0);           ! ASSEMBLE THE OUTER BLOCK (+REST)

   GFIX(4)
   PRINTSYMBOL(CEND)
   SELECTOUTPUT(DIRECT);  PRINTSYMBOL(DEND)
   PUT(CA);  PUT((GA+1)&(\1));  PUT(LINE SIZE);  PUT(DA)

   %SIGNAL 15,3 %IF FAULTY # 0

%ENDOFPROGRAM
 H?    
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     @?   @  `      `:    `Wz    GćWz    g}  9     2@TG;     KWzD     KgI  :  @:     5:(     5Wz     5:-     5Wz     5@:     5@Wz	-   H$KWz	3     g@T	i    g  	o   XyH$G	q    
f`Wz	    ;M  	    ;M:	    ;MWz
     m  
     m:
                                                                                                                                                                                                   u C!         (tG`}Y0  5     

	2     Y0      NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z                         	   !   d   "   	  " a Aa  !A A    !!AA ! !   $  B  !     a B   #""""#""""""    c b   b .  (! aA     1% b ! A  a A     D!   I!a   O!    T!A    Y" a ! A 	  b"  a   h" b a  	  r#  a aa ! A!a    #  a  a A  a A!    !!   !a   !!   %b  aAA    E   "   aaaa!   1 ! ! A A    "   " A        #a  A  b A    ' a! a b     ,%a AAA   ! B !b A!   I#!  A a b   a   _"    i" A   o!   r!A     w!A    {!a   ~"  A ! B  
  !     !     !   !   !A    ! !  a    B   ! !    ! A   !     ! !    "  a A   #   !a 	  #   a  A   $       #  a  A aA   $     !"     "  a  	  -     a#A   ! Aa    f#    !a A a   s&a b  BA  b   ! !!A  !" aA a  BA!c "  A  a ! c  A  a A!  d C aAa C a a "AA C !aD c  "   
  " A  A AA   '  a     $!   '"a!   .!  a  !   8-   A AA      ]!   a   g!   j!A!   o!!    w" a A  ! ab  a   "!a   a  A   "    !a   " !  a A 
  #  a    ! !AA"aA ! a A   $ a " a a  a AA  ! A AbAa  aa!B (  "   a   !   b  ! A   ! A    "!   A   %a A !    /#AA #A  
  ;"a a     I"   a     S" BA    !     {%   f!Aa Aab aAa   a   B  ADBA Aa ! !b  A CA A !B A  !AA B a!aA a  BAa!       ! AA  B   A BA E! A A ab A#A A A aB D a ! A  ! a  A ! A A a BA  b A ! D  A  A aaB Cc  !A! A A b CA !a AAaAa  B  A B  a ! ! a  !   a b Aa  BaAc!  dAA AB B! ! !A AA aA  B AaA B!aBa  A "A  6  "  aa!!!!   +#!  A A 	  ;!   @!   40   AAB b  aA A A  A   B A!  Baa! C ! AB b a a a  a a ! b  A   a ! b %A!  ! ! C W  ! AA A   $Aa  ! a b  a  a Aaa  C! aA  A !  b b A a!  B AAaA  ! A a  B a a a b ! A a  b aA   BA  a A Aaa!A  BA  B a    C BAaAA  A  DA a  A      ! "  aDCA a A A a    	$ A  a aAA aBA A ! a a   dA!AA    Ab !   2  	"!  a A   Ab     	!!   	#!a a"! A  !d a! A" b"  BbB a a C a! !  0  
$"!! a A A   
9! a      
8'!  a   a   
S!!a a  ! A!A   
P8 A"     AA   a! A! A A A   ABC .  
! a   
! A   
! !  a !  A  a   
!a    
! a   
*A A  A   A !!a a    bA B!AA B" b A B  B A  A    Aa A  a  B!  aAa  B A a  A  A \  ="  A   G"!a a 	  Q"     :> aAA!!AA   ! b   a A ! b  A A !B )  !           A   2: a A a B b! a A !a!A A A  !  A   b A a A a! a   !  !ca A  A A a !!! ! A!b B A !a!a!  A A!  A A  Aa a A A aaA  AaaaA  a  !!! d A  A a  A  AB A              b" A!a   a a B  b        b  A A A! A a  A  aa Aa A !  A AAa Cca  AA !! B A aA a A ab  A  A   b A A !BaAaa B  A  ! A !!A a AA     !BB !  a A     a   B  a   AB  A ! C   A A ! B a  AA a ! DA  a v   	ia"!!!#! e d  I1! b     AAaa aA ! aA a   a  :  dQ@    D"ZPh"#:   ox     eE      W   ,>   0D   ^e     * K;} W   x    Đ    	s     @ ,8@   0>   4K    8% Đ <   {e៱pĐ    	qIKr   W   ,8@   'o	iX  Đ    	v@    Đ K   Đ  p   Z]    Đ    	&y    Đ    	fo"     W   ,Q{D 0>   }d      ,}    	}/       ,W   0v   "K      K    ,>   0W   4   8v   <S   qIKZ ,8@   0K    4v   8>   <Q@   @W   D%j H}   L_   )qT{@   qO   	:H     qO   	',     qO   	',} Đ    ,p   0Q{D 4p 8@Đ <@   S      Ġ    	2B	     qO  Đ ,d    0W   4}    8`@   2B	,   ,>   	qU!J"   qO  Đ    Đ ,@   &[@   @  'Q@ ,@ 0{d Đ 4@   8>   <   @   D   H@ -.R       pĐ ,  Đ 08   4p   8[Ё <[}y @Ё D}y HqO   LQ -"Y; ,>   0[}  4[}y 8Q   <2d  @qO   DZU+Đ H  Đ L   )(      Đ ,  Đ 08   4p   8[Ё <[}y @Ё D}y HQ聐 L}( )!%	= ,>   	-Z8ov2@ 	g\       W   	Ud      W   	-K     W   	/gq      W   	,)}     W  쉀  %   d<      }   qH .A}     }   qH ,      )-!   w       `@   p   ,K    sP       `@   t   ,u   t@       `@    p   ,    0    r       `@    p   ,    0    r       `@    p   ,    0    :u}/   qN   	:uqN" qN    @ wLv@  2@ 	!;YZ K*!  ,>  Đ 0@   qU!J"Z K*!  ,D  Đ 0@   R,Zr憐 K*!  ,>  Đ 0@  Đ 4@  Đ 8   q[j  K*!  ,>  Đ 0@   dQ@     W   ,Q{D 0>   4p   &K         ,x	( wi+   @  {d  ,@ 0'Q@ 4   8   <d    @QzD %MgH     W@ ,d    0h`   4h  Ġ 8   :u   ,@ 0'Q@ 4}   8%   <xB@ @'Q| Dv   dS %g/pĠ ,  Ġ 0    d     Ġ    Ġ ,d   Ġ 0j@   yx     {d   @ ,@ 0'Q@ 4'Q| 8#p <K.Ġ @   %    Ġ    	y    Ġ   Ġ ,}         W   	(yx   ,   Ġ p  4K;  6X`   0W   48@   8& %y}      @  {d  ,'Q@ 0#p wLS     w2    fhLS     Ugq+ Q   ,>   ,y:w   ,K    0v   X_}/    8}/   	X_K*!    &      K*!  ,M   :uK*!  K*! Ġ ,@  Ġ 0K    Ag/     K*!   &  ,   0qN   4N!+Ġ 8K*  Ġ <@   !'o	`    Ġ     qO   ,    M      Ġ     qO   qL    Ġ    ,@ 0'Q@ 4{d  d     Ġ    ,W   Id     Ġ    	`T:Qw  Ġ    ,p   p,    Ơ @  {d  ,   q[v  Ġ    ,@ 0'Q@ f      p   	MY     Ġ     p   ,2   Ġ L   P`@   T}    X    \@ `'Q@ dE   h}d  lW  y䖠䗽@   G(       `@    K    ,p   @W    Ġ   Ġ ,m   zgd      ekH    İ    	`Ep@   `Ep ,qW 0KW 4GW 8Mh   <E   @    Dv  Ġ H<2 Ġ LL@  Ġ Pq   1n&Z!  Ġ @  Ġ     	K9f     	K`@Ġ ,LS  Ġ 0q  Ġ 4   8}d  X4d  xW   |d    }    `@      xB@ 5	"
: 0  Ġ ,@  }    0p   4    }:p ,    0'a+ F     qO     ,@ }ہr  Ġ   Ġ ,   0`@   4(   8   <   @Y   !%d:"3Ġ K   Ġ  p   ,2    }EL  İ p   	%d:"LqĠ K   Ġ  p   W    %d:@  Ġ K   Ġ  p   ,}    L`@   P	~@ :_y@   xB@ 	qT{"d  xB@ 	2    Ġ    	q\     w       2     K    K     Ġ   :+(QT+   ,*D 0	r8 4qO   8	+ <p @}    DK    /y    İ     @ ,}    0p   !   ,8@   	w      İ     qO  İ ,p   '      Ġ ,0  Ġ 0;  Ġ 4:s  Ġ 8(   <K*   @qO   DyE)K    #S     	K!JK   WȆ K*v ,W"8 	KK!   Đ 0  Đ 4/1pĐ 8(   Đ <  Đ @LS  Đ Dq  Đ H    Lz   Pb   T   X<	AH   \_(QR   `.	$ diy@ hX_{d    lwiy@ p`R   tW   xxB!}   |X+  ,   >   D   K      r yS   K*!3}:}  s ox     DFD K   Ā ;K  AX   T o`  O:p ZK։     ZK Āˉ&K   dT8Q  h@24%>    +  i,@  (   Lv"AH  qILLu!pqV~XH!d y  yyx  (QRR}d   d:T8M[  :"$$zgf   (s_Ad Ā,'a0.dȁ4-ȁ8`d<af@  @af'Q@  DafH%N9L!"%WvPy`pN  J X;@D;y:wŀ!pQv      FFFFFFFFFFFpFNEFGG                                                                                  /=/=/@/M  ///d/X/p/|///=/=/=/  ----  -  -----.    -    ++%n&4  '')?))**,M,o&4-'   #$u$$#g#g#}#g  +	
*,)             * +   , -     j k   l m                                T D    V F    W G                  ]  \  \              
 &  Z J   '  [ K                            
             AN                                                    LABS =  DEF:                                                                           NN             ! ~R$SCRLR)R.NRRR=R  RRRB                    TvXRRRS"OMTLSOPOTWVYWMDTbRTnQNLTRGQRQRLQSRT  RR3RPR8  Sf  R	LVWTXT}  U?    R        RTL  XRTWR`LRT  T      S"             
               	  M            
	             
 REMEMBER:    	             A            V   Z   TT ILLEGAL REAL OPERATION ' \ ? ? ? @ ? ? & ! ? .              LOCALS > 16K ??? UNASSIGNED CHECK INHIBITED STRING CONSTANT TOO LONG ILLEGAL %FOR PARAMETERS%RESULT UNSPECIFIEDFAULTY SWITCH DECLARATIONDECLARATION OUT OF CONTEXT ARRAY INSIDE OUT DIVISION BY ZERO TOO MANY LABELSTOO MANY NAMES BLOCKS TOO DEEPLY NESTED %MORE STORE REQ'D FOR THIS COMPILATIONMORE STORE PLEASE!!:  USING: STACK AT LINE *COMPILER ERROR  
         
            (     	
 
                                ,   )	
               
   `[?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n"#$$A> $$#'!"C  ?&?$$A> X# Y !Y !&\ Z  B!$$A> З  $1$H  H X [ &B0P  [ ,&' ?P  
*&30H  P  ї  C Kї  $$A> 
Y  #%$$A> 
qPr  PB &(pX  ?$PS?PE   &T 41I2 !,K2  !
3s3B  #9
3
>!$$A> !$$A> A> O$$A> ?$$A> "#:  ! ?$$A> ?$$A> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$2#XC   PC   '4"2$ #PC   '4" ?$$A> X   $$A> X w A( , X X8!%3 P83!%0 P84P8y  	g A( , X $0&1P9 ,P9 4X İ P 0X P ɰ 	#&Ȼ 7P 0#Ȼ 0P 0kW   <X9 ,U9 4A0 B0P 4y  >	g A( , X $aW   lX=<X;C0\PX#6W  ,@ PM$TXhlW   TW  XhlA` :W   <#X]\P !7$kW   $bW   Xi AXml'aPm!*` PmW  ,$bW   ly  {	g A( , X X=#$`W   l$QX Hk W   T$RX Hj W   T$RXI LHd W   T$UXi lXf  lW   T$UX9 <Xc lW   T$UX Xk lW   TX HJ C02$RdW   T` :W   <XY \Xe lA #W  ,Xm#$bW   ly  	g A( , X $0P9 ,$API 8P=Xi ,W   lXY C @HW   H$QXi W   T>W   H$QXhlW   TW  ,XhlfC p8W   HW  ,X8<P9 D$$!A P 0C ,&P 0P @8 A Xa  lAX 0U @AU DB0P @X C0V0W   HW  ,XH LPI <XY <\Xe  lAXi <lX6 <P9 <3!2#C X ,!3C T$ $$A` *W   <$QXhlW   T,W   HX .XAW   HC W   HC W   HC W   HC W   HC W   HC W   HC xW   HC x^W   HC fJW   HC T2W   HC <W   HC *W   HXĠP#W   H$@PI 4$PPY 8W  ,Xi ,` B08X9 8#6$ $$AXHX 4
PH$bW   ly $aPi ,C 	g A( , X $aW   l$SX9 <Hc W   T` :W   <$RX k W   T$RX j W   T$SXI Ld W   T$TXi lXf  lW   T$TX9 <Hc W   T$TX Hk W   TW  ,$bW   ly  |	g A( , X $0P9 ,Xi ,W   l` *W   <$TXhlW   TW   HX =A H  P #$`kW   <X J#$jW   <` 'W   <W  ,XY ,P !2#$QPY ,C XXhHl&aPhH$bW   ly  r	g A( , X H6 0 C0$HF C0$@ #<XV \U#:He ` !5%y $" )	W  A( , X H6 E5 !;XF  LXe  lF#5$y X9 H E !6H E #4$C XC LXe lF#4$C %C  =	g A( , X X6  <3!7HF !4HV #5$y H6 #3$"%"	 "	g A( , X H6 !4HF #5$y HV P ##$"	%" 	g A( , X $1P9 ,%A&API 0PI 4XY UY ,!5y Xi ,
fPi ,UI 4A@ B0P 4%C  /	w A( , X X=&30P9 ,&4P=X ,y  	w A( , X $0P9 ,W   $P 0 0! 9#&X ,y XY ,$KA 
QȥP ,W   0C  3	g A( , X ` #$y W   P 4=A ӱ  P 4$P 0B0rXI PI D$Q%A PY ,C F&QPY ,PY @W   P 8Xi 0lV$4CA 
V
U
QePi 0XY ,UY @AUY DB0P @C @ API <Ű !3P <XY PY D$a&A Pi ,C L&aPi ,Pi @W   P 8X9 0<X) 4,A2  X <
1P9 0Xi ,Ui @AUi DB0P @X 0C  	w A( , X $:P9 ,/` H$1P9 ,/` L$@PI <+` @AP 0W   0XY 0PY T$`$!A Pi 8C ~&aPi 8Pi PW   P 4 .!;hn@`i D$1P9 <C @ȱP ,X <!;hI @lI H/+*B`I @C h	 Di m	 H`	 D/,j @` @Xi 8Ui PAUi TB0zP Ph	 @y  ~	g A( , X f#<8 `A XA  LD#y A P ,A XQ  \Xi ,'QPV  X 8 `A X  #$aAC  =	g A( , X f#<8 `A XA  LD#y 8 A XX\PQ  X 8 `A P ,X A Xa  lX ,&aPk  C  =	g A( , X 8 <A XHLPA X  8 <A XX\PQ y  '	g A( , X X6  <0 P9 4H =A A  XV  P %AB  PI 0$P&QPY ,PY @8 <A P <Xa lX	kC H Ġ XI LE B0rӡ Š C0fXA  L@ UI 4B0RA 
PI 8à #4$GPI 8@ !4$@PI 8=A XY <Xe  l1  ` &A2  T9 0#3P XY ,UY @AP (B04P @y  	g A( , X X9 0<'1P9 0H .XA$cAX $D@K XZ \Xi 4lPe C nX: <$@ XJ LXY 4\PT C HXj l$5@6 X XI 4LPK C "XZ \$c@e X: <X 4P  XJ LXX\@T UAz  u
g A( , X X 8 `A X1  <P9 03!$y X 8 `A $P  A~P 4X ɠ !ɠ !&@` PI 8#PP PY 8XhlPg ,P 0ZXi 8lA^X8 <P9 ,X ,!3C 0X  HJ UI !4jATXY ,\Xe lPi ,C X9 0#4$dA>C D w	w A( , X $0&1P9 ,P9 0cAX9 ,U9 0A0 B0P 0y  #	W  A( , X ` !%f AX 8 <A P ,X  H @ XI ,LXY  \Xe  lPd  X9 ,<X  H ң 
à AXI ,LXY  \He d ` AX9 ,<XP XC$aW   lLW   H$QXI ,Ld 
W   T$QXi ,lf W   T$SX9 ,<Hc W   T$UX ,Xk  lW   TW  ,$bW   ly  	W  A( 4 X X9 ,0 P9 <XI ,HPI @8 `A XQ  \U#Xhl&aPi D#X <8 <A X1 <P9 D8 `A X  #X&P H#8 <A XQ \PY HXi DlX8<	c#'X H	!%$y $&P 8P L8 <A P 4XI DLXQ \	ECXi Hl	eCH U ,B0X  U 0B0A 
UI B0vQ UY  B0jXi 8` C >fPi 8A X1 <X	;!/8 <A P PX 4X) P$3AfAXi <AXi @AX 8C X 8U LAŠ (B0P L$C   	g A( , X %1P9 8P9 @XHLPI <PI D$[VPY Tc$!A Pi 4C &aPi 4Pi P=A ӱ  P H8 `A X  B0n8 <A P , A P 0XI ,XT \PY LXa l	e##Pi LX9 L<X	;!&X Hy Y9 <#P9 <X HP 8C JA XA  LDC 6@ C.8 A XQ  \YY D#P @A Xa  lPi DXi 4Ui PAUi TB0 P PX9 8!C vX @#$P @kADX @8 A XP  X @C D ǀ	w A( , X $0P9 0XHLPI 4P9 <S&QPY ,PY P=A a  Pi @=A ӱ  P D8 <A P HA P L8 `A X  B0ZA XA  LDB0@XY HXe lPi 8X9 LX 	##P 8X 8Y 4#P 4XI ,PI 0#PY <#A XA  LD!3PY <XY ,UY PAP B0P PXY 0#;=A   y Xi <!4$bPi <=A ӱ  P @=A ӡ  P DkAXi DlAX DC  	w A( , X %1P9 8XHLPI <P9 @PI DPI L$\&QPY 4PY P8 <A P , A P 08 `A Xa  lfB0XX ,X P HXI 0XT \	Z##PY HXi HlX8<	c!&X 4y Yi <#X 4P 8Pi <C JA X  C 6ɠ C.8 A XA  LYI D#A X  P DPY @XY 4UY PAP B0P PX 8!C vXI @#$MPI @dA^X @C \ 	w A( , X $0&1P9 ,P9 08 `A X  #$$bA<X9 ,U9 0A0 B0P 0y  .	w A( , X X=XHL4#8XX \&TPX PMy  	g A( , X hW   <Hi ` W   <y  	g A( , X $bW   <Hi AX=#Hi APX&Py  &	g A( , X $cW   <Hi ATX8<&2P8y  	g A( , X ` AXi `  Ay  	g A( , X %1[=P=B0$cW   <XkJi A#PmX&Py  -	W  A( , X $cW   l$gW   <Xi A~Xi  Av$bW   ly  (	W  A( , X $cW   l$fW   <Xi A.Xi  A&$bW   ly  (	g A( , X X8<X ';#5$`A"y  	W  A( 0 X =`A A  D
dJi ,Ay  	W  A( 0 X =`A A  DH ,A 
dA  
dAHi ,Ay  $	W  A( 4 X X9 ,0 #7XI 0!@?#$$eA
Xi ,AX  =`A Q  TX ,A ZY eӱ  
kA6Xi 0A.X ŠA !3AXM@  C0XY PX #7Ph #4y Xi ,X8<c!8X 0Y!C PX !6PU PY #Pi PY X  =`A ӡ   ,A 
ZeQ  
eA` A$jW   <XhLlAAC t 	W  A( 4 X X9 ,0 !4$eAXi ,AxX  =`A ӱ  X ,A Z kӡ  
jA Xi 0AXI @A !3Ay  :	W  A( 4 X X9 ,0 !4$eAXi ,AX  =`A ӱ  X ,A Z kӡ  
jAXi 0` AXi 0`  Ay  <	g A( , X $cW   l$aW   <Hi AXhlA$bW   ly  *	W  A( , X $cW   lXi  W   <Xi AXhlA$bW   ly  +	w A( , X ABPX8<Y=#.X&P$dW   <C y  &	g A( , X f!& y $>'1P9 ,P9 48A P 0X  E !3C X9 ,U9 4A3B0P 4 C  7	g A( , X f!$y ArP 0$0P1  X&Pɰ #$$P8A P 0H P  XI 0LXX\PT $`&aPi ,Pi 4=hA X 0 P 88 <A X) 8$3AfUi 4A` (B0P 4C V b	g A( , X AP 0 C0$0&1P9 ,P9 <8 <A P 4X ,=hA X 0 P 8X 4HJ EA B0DXZ  \Xa  lVB0.: ӱ ;B0 J 
Q 
E!;Xj lX8<	c!+X 0XK LPA X9 ,U9 <A0 (B0PP <y  q	g A( , X AP 0 !9X8<P8C h$P  X 0XJ LPH$P&QPY ,PY 48 <A P 8=hA Xi 0l X) 8$3AfUY 4AP (B0P 4y  Q	g A( , X 0 P9 ,`  Pi $@&API 0PI 8XY ,
UPY ,Xi eC0$=A ӱ  P 4kAXi 4lAXI 0UI 8A@ B0P 8$lA$lArXi ` $UAȠ ,P ,XI @ PG 0$\`A Ay  a	g A( , X $0P: ,P6  X <U#6XJ ,@ !4z &P <=pA Q  PXj X6  <$AR  
5P6  X ,&P ,C  @
W  A( 4 X $0P9 <P9 @i 4A\i 8ATX 0B02$jW   <Ƞ P @$API 0XY !:$`Pi 8X8 <P9 4X =`A ӱ  P ɰ !'P $kW   <X 0ŠB0 %aA%aAXHL&DPHy XY @Z]
U
Z'QSZY SZY ,edAXi  AxXi 4l` AhX9 4<c`  ATX 8k` ABX 8j`  A.XHL&LPHC t 	g A( , X $1P: 0HI ,PJ 4XZ 4YZ 0BFXj 0
eaPj ,8A P 8H U !5z Y #&VPZ 4#&aPj 0C $fA|$ A C
w A( , X H9 ,&1@9 ,XHL	4!%dA@H ,8A P!$4A|AXX\@ A$`PmW   P D ,!3C 0X=0 
C0 &1P==pA X Dұ  ð AC AP 4P ,XJ 4@ PJ 0W   0XZ ,\P !4$VPZ ,A`P <XhlX: ,<6 0 AXXJ 0LK @ AW   0AP8W   $ ,B0\W   0AP @aAP 8XX\@ AX 88A Ha 
Pj <X@k 
fAC fXJ ,L@ B0DXX\Xj <le ` AX: <<&1P: <X 0Ű !6&10P: <#
=A Q  PZ <Xj 0l` B` 
B $1P80XHk ADP 8E ,#?HI ,'A@I ,8A Pz XX8C00P C0(Xm &aPm X8<Pc  X$LK C A$XX\@ P  Xhl0 ,6 X 0Ű B0"XJ ,L@ #4@ !8XX\$ae H9 0 !7X4!3C R$@PH8PJ ,$QPZ 0$hPj <X: <<P9 XX@; 
3AXJ 0L@ C0XXZ ,\U!?$ZPZ ,$hPj <X8<S C 0@ !<$hPj <X8<%@ #@ !5$`Pj <#$dPj <X88C00 B0PX 4Ű A!4$@PI XXZ ,\P !+Xj 0l` #.` #;Ű R#8XJ 0L@ !4$0P88XZ ,\PX<Xj 0lPh@` B0$dA\X8<X@ AXi PlA
Xi TlAXi XlAXHLP *T Xi PlX8<VX XKA XHL5P4  C ` #7$QPX<$4P9 XX8C0XJ 4L@ !#>@ 1#4@ A!5$bA#$dAXX@\P B RXj ,l` C0BX8<SX
[Pg ,XJ 0LPG 0` *AXX\Xi Xl
VPXC X: 0<0 B0$bAX@ *K XX\XhlPe  Xi PlAXi TlAvX9 P<X
3XHL@ AXY T\PZ LXi Pl'a$!A Pj 8#&aPj 8Pj H$`AXj 8Uj HAUj LB0P HC <0 !6%P0C ,0 !>X ,=A A  PJ 8#$SPZ 8XmX: 8<
c%kPm` B HI @ B0XX4\UC0X 0Ű !8XJ ,L@ 
!<XJ 4L@ #5@ 1B0\XHLP 0T XhlX=P6  X 4Ű 1!<XHLXT  \&RPT  Xm'dPm#` ,PmC LH !` ,PmXHLXX\T P AXhlX=P6  XXJ <L
PHY #;P B0^Xm` 0C0RX: ,<0 C0B0 
C0:X 0Ű #5Ű B0$P7 ,P 0XHLXT  \XhlAbC 
w A( , X X8 <P: ,3!5` AlX P 0!5` ATXJ ,LXT \PX $$8A|Xj 0lX6 <P8 X8 <P6 X 0P XJ ,PK  XZ ,\$`Pe X ,z  W
g A( , X 8 P: ,X ,XK LPJ 0D!5` AծXZ 0\Xe  lUj !2#PZ ,C X: ,<X P XJ 0LXX \PT Xj 0lPh X: <X P XJ PH z  Z
W  A( @ X X8<&1P80 #$$gAAnP @X  @ AXJ @LXZ PT  Xj @lX: 4P6 X @XJ 8PK XZ @\Xj 8Pe X: @<X ,@ AXJ @LXZ <PT X 0=$A Xj @lӱ  @ X8 A XJ @LPA  XZ @\PY @Xm#eAz  
g A( , X 6 P7 ,F PG 0HV PW 4H6 P7 8H 
P <V Xf  lAz  *
g A( , X X8<&1P80 #$$gAӲAP ,X X* ,$8AfX8 A X ,P  XJ ,LHd AzX]#Xj ,lA:z  C
g A( , X AP D$0@1 X DXJ PK  XY D\$a@e X9 D<$@ XHL&APH@ #$$gAX8 A XY D\PQ  Xm#Xi DlAќz  O
g A( 0 X h ,` 8X: 8P: 0P8DXHLPMH]6@Z 4Hj 4Em4C00'a` @j 4fA=,A X  U 0!3C |C $dARXHL@J 4DAXj 0AH6=,A XZ 0PQ  H6=,A Hj 4Pa H=6@: 4&10 @=63AH4!9&İ @4AXJ LP *@T H 4=,A Xj lX P  XJ L$V@T Xj l$3@6 X&Pɰ #$$gAfX8 A XJ PA  z  
W  A( 4 X AP DX: @1 3AX DXJ  PK  XY D\$a@e X9 D<X ,@ AXI DLXZ 0PT Xhl&aPh` #$$gAоX8 A X DP  z  V
w A( , X X8 A XA  LPI @z  
w A( , X X8<0 !$$hA:X8 A XA  LPI @A XQ  \PY Dz  1
w A( , X X8<3!$$hAX8 A X  P @XH'APHz  *
g A( , X $bAX: B `X#;3#XHLT  U!3C ` *@k X8<XHLPC  XX\$c@e X8<ӳ  P #'1P: XHLT  	5#%mAXj Pj 4%1$!A P: ,C (&1P: ,P: 08A a  AX: ,U: 0AU: 4B0P 0X$@K  $PPXz  
w A( , X X8<3#4$`AAPP ,#6W   0X$@K  XZ ,\UC R'QPZ ,W   P 0Xhl6  &16  X  8A XJ 0LA  @ AC $dPg ,$0P7 0P7 4P7 8P7 <ScAX8 A X  Pz  w
w A( , X X=8&1P=8z  
w A( , X H9 &1@9 0 P#$%eAbH 8 xA P,z  !
g A( , X H9 P: ,X ,XI LC0(8 xA P,HQ  UZ !4z 'P ,C $"	 .
g A( , X AP 0B0X=C^$`W   lW   H$RXj W   TW   H$RHi W   TW  ,$bW   lAP 0X @  AAXJ 0L@ AXZ 0\$`e X8<P8Xj AP ,$P  C FHA C>XZ B6ADXj 0l@ AX: 0<$ҳ Xj AP ,$@PA  XZ 0\He `   @e X: 0<Hc `ApX(XHL#5Xj A|Xj AVXZ !7XhlPi $0P8P8(z  ΀
W  A( 0 X $0P8 AP 8X B0&XI LXX\E!:Ha `@a z B0FAnP 8X: @1  3AX 8$@K A"XZ 8\@ AXj AC a fC06X9 L<0 BC0&A @ A Xj &cXZ ,PW ,XZ  A*C nH1 C2XJ ,@ B0&$`a AXZ 8\@ AXj Ax#3!kA0Xj 8lH6 0P: 4Ӷ C0F @ #6Xj &cAXZ 8\e ` $3P7 ,$P 0XU \AXI DLPI @XZ 8\U dA$`Pg ,Pg 0X: 8<XS \AXXY D\Xi @lA@ $P  XHL'BPHXi @lA~Xi DlArXZ  P !5$cPj 0#$2P: 0XZ 0\Xj 4lAXXj  `   A~X&PXJ  @ !7XX\PX(Xh HlfB0b$aPh HH L8 <A P <X NQ 
Xj <l$06 X <$@@K XZ <\Xh DlPe  X: <<XP C d
 ,W  A( , X H6 B0XF  LPJ ,DB0pP /!5A܈P  Xj  AJXZ  @W ,`+ AXj  A2Xj lX:  @6 3AX $@PK  XZ \$f@e X: <$@ #/` ,A&XHL'APHz HF #4A"P -AXZ  P /!5AP  Xj lH6 @7 ,XZ  `/ A
Xj  AшX $F@K XZ \$a@e X: <X  @ AXJ L$PPT  C l 
W  A( , X A6X: <Hc AРXj A$z  
g A( , X H6 P: ,HF 'BPJ 0@ !4$FPJ 0XV  \PZ 4XV \PV  X: <$@ XJ L$S@T P .Xj AXj lX: ,@6 3AX XJ 0@K DAXZ \Xj 4lPe  z  ]
g A( , X H6 0 #40 !5P .A0X HK C0@ B0Xk lAC0XZ \Xe lX6  <P: ,$@ XJ LXd lAXZ \He ` #4` !>X5  <X ,
;P5  C  P .Xj AXJ LXZ ,\PT  #P .Xj ArXj lH =<A ӱ  @ z  
g A( , X H =DA HA  @F XZ \H5 0 B0 H !5$0@5 #
XE  LD!4$1@5 Xj lH #$iAXJ L$Q@T z  C
g A( , X H6 0 #4HF #4z 0 !0 #3AzXZ \He Pg ,X5  <P7 0HU X Hk AӶP ,C02XJ L@ AXZ \$`Pe  X: <$@ C rXJ LHT P B0^Hd Pg ,X4  <P7 0$S$aAJP ,!3C FX @ AXJ L$PPT  Xj l$3@6 Xj AC  
W  A( , X X5  <3!0?!$z $@ D$F@J FHV  @Z @Xj  X6  <0 P: ,X  P  $@@J BP .j ,A>XZ Hj @@e  C  A
g A( , X H6 P: 0HF PJ ,0 #40 !;AXZ \He Pj 0X: 00 C0Z0 C0R0 B04$3P: 0X @; 3AXJ L$Q@T P .Xj A#P -Xj A$aPj 0Pj ,XZ \e AX: <X ,@ AXJ LXZ 0@T UAz  w
g A( , X =`A A   =|A   {  W  A( , X AX#%bAXj Aƾ!<X:  0 !0 #$0 /!3C X HK PJ P$@@K XZ P\UC0Xj lX6 <P: LAX L#4kAXJ PL@ B0$XZ L\He !<$CPJ P$0X  ;P5  X P=A A  DC0$PPZ TXj LlH U  #?HF @ !=XZ \He ` #4$P TXJ LHT P C0"Xj LlH Ű !9HT UZ  #4$aPj TX LH[ B0 Xj  ` -#Ed #9H4 0 #4$P THT UZ  C0,Xj LlH6 0 B0H 8 `A X  #$`Pj TX: T<3C0*X L* ,$8AfX* L$8Af ,$$8AfXð  C0(XJ LLHT #>Hd ` #4` !6P .dAX P=LA H  P dX P.AXJ LHT P #3U!5Xj AFXj lH6 0 #&0 #3AbXj AX  ɰ -BTXJ LHT P B00Ű -#7Hd ` C0H 8 `A Xa  lf!z kA2P  C .X: <HC K!=8 `A XQ  \P #4kA˪Xj lH ..AXj  AȸXj AXj  A.X: <H ..AX HK @ !4$jAXZ \He ` C0X5  <0 BB0B :3#=Pg ,P7 0XZ  `   A#X HK @G ,XZ  ` A֒#Pg ,P7 0XZ  `   AXXj  AXZ Xj  AXZ \Xj  @e fAX: <$P  XJ L$Q@T Xj l$1@6 C X HK @ !5` AXZ \Xe  lPj X`B6` B .f!@g ,XZ  `$ A՚#$06@7 ,XZ  `% AՄC @` B `!.$P ,Pg 0XZ  `   A#$@PG ,Pg 0XZ  `   ATXj  AXZ Xj  AXZ \Xj  @e fAX: <$P  XJ L$Q@T Xj l$1@6 C Ȱ P PXJ LHT UZ  !3C nHd ` !5Ȱ( P P@W ,XZ  kAXj  A^X:  P8XPcAƾX  8 <A XJ LP pH A X* p$3AfXZ  @T UAC Xj lH6 P: \$1@6 X $C@K Xj  AP .Xj AXj  ANXZ \Xj \l@e fAX: <$@ XZ \e AXJ  PHXX\&TPXXj lH6 0 !7ȰX P PC B0 !7ȰH P PC 00 !:   P P$PPX#0 !6Ȱh P P#Ȱs P PHF PG ,XV  \PW 0XZ  kAӾXj  AXZ Xj  AXj lX:  @6 3AX $@PK  XZ \$a@e C X: L<H Ű B0xHC UJ  C0lXZ \He B0\X5  <P: XX LH 8 <A XA LXX\	EB *H  A Xa l	e!*X: X0!0 C  XHLUMC0Xj  ` -!fA,P  C $H; 6!=8 `A X  Ű #3AƮXJ XL@ B.@B &XZ L\He Pg ,PG 0XZ  `   AӂC "X: L<H P ,PG 0XZ  `   AXJ  PHXX\PXXj l$0P6  X $A@K XZ \Xj  @e fAXj  A*C XZ  Xj A&X: <H P  XJ LLHT P #4P !6P -dAXj LlH6 B0\X  P XɰBNɰ B F#$[ XP X$FXZ d\EPJ dXJ dL =TA @ ,XZ  Ha  AоC ɰ BɰB XX\U]B0vXJ  UMB0jX]Xj dlV#6$[ XP XkA΂X&=TA P pX  =`A ӱ  XJ pXA J  kQ  
eX]'RARC *XJ dL =TA $PPW ,P 0XZ  Ha  AњC 2Xj dl =TA $P ,XJ XLPG 0XZ  Ha  AC XZ L\He ` B0XX d=TA H @ ,XZ  Ha  AϾXHLPMXZ  P]Xj dlPmX: L<H PC ` B08XJ dL =TA H P ,XE  LPG 0XZ  Ha  AиC reAXZ L\He ` !8X: d<'1P: dH Ű !8XJ dL&APJ dX: d< =TA HE PG ,Xe  lPg 0XZ  Ha  A C X:  0 -BX d!5$@PJ l#$QPZ lXj lHF @ B0lH =`A Q  P Xj llVB0JXZ He A8 `A Xa  lfB0(X HK PJ hXZ d\U!6dAP h#AfP hC B=`A a  ` #?Xj  A\8 `A X  #6A*P h#XJ  PJ hXj hlA*P laA&XZ d\UC0 Xj llAXZ h\Xj A2C Xj hlAXZ l\Xj AXj ll@g ,XZ h\` AdX h8 <A P pX lA X* p$3AfX h 8 <A P pX lA X* p$3AfXj lA$0P7 ,Ȱ P 0XZ l\`   A4Xj llAXJ LLHT #6Hd ` #6P -dAPXj LlAX: L<H Ű B00X d=\A XJ LHT @W ,XZ l\Ha  ArC <Xj dl =\A XJ LHT PW ,Xd  lPg 0XZ l\Ha  AzX: P<0 B0 X hP XX lP hX XP lXj llAXj llAXj hlAXJ LXZ h\@T UAXj l$0P6  X $A@K XZ h\UZ  #7XZ  Xj A C Xj lH6 B0X  Ű B0XJ LLHT P B0tXj  ` -B4H 8 `A X1  <0 !6Hd Pj  #fAP  C 0X  XJ LLE !=8 `A XQ  \P #4kAdC  XZ  Xj LlAdXj LlH6 P:  Xj  AX LHK @G ,XZ  `   AʜXZ \Xj  @e fAX: <$P  XJ L$Q@T C Xj LlH6 B0jX  ɰBZɰ B RXJ LHT P !<Xj  ` -C4H4 6C0*X L* ,$8AfX* L$8Af ,$$8AfXZ  Xj ArX HK PJ  XZ L\He ` !7P -Xj LADX: L<H B0XJ dLDB00XS  \P B0 Xj  AXj  @g ,V`   AhC XS  \P B:PB 2 =dA $`Pg ,X: LX  P 0XZ  Ha  AʈC . =dA $`Pg ,X: LX  P 0XZ  Ha  AC Ű B0,X d=dA XJ LHT @W ,XZ  Ha  AȸC `cAXj LlH6 0 #40 !8X d&P dXJ dL =dA HV PW ,X  P 0XZ  Ha  AȜC vXZ  Xj AXJ LHT PZ  Xj LlH6 0 B0H 8 <A X XHL	C nH A Q UB0\H A Xa  lfBF` B >X: LH 8 <A X LXA  LPK  XZ L\$`@e X: L<Hc AX LHK B0XZ d\UB0.Xk  l` B0Xj  AX:  @7 ,S`
 AHC TXk  l` C & =lA $0P7 ,Pg 0XZ  Ha  AZC =lA ` @g ,XZ  Ha  AƺC @P .kAtX d =lA XJ LLHT PW ,$`Pg 0XZ  Ha  AC X: <H U  B0VXZ  cA$@PG ,%QPW 0Xj lHV `   AX: d<3!>$@ ,XJ LHT `& AC XY D\PZ LXj dlANXj LlPi DXj AٴX: <Hc AX $@@K $dAXX\'QPX 8 A X  X* $8Af 8 A Xa  lABXZ  Xj A0Xj lHf AX: <H PXHLPHC $SXj A$TXj LlA$cA$dA`AD$bAXZ \$b@e C lX: <H C0l$RcA$bA$cAdXI dLD!;P +@W ,$S` A#` +Pg ,PG 0$S`   A8$cAX9 d<3 P9 d`	Aʲ#$ScA8$cAXj LlAz$cAX $@@K XZ \$c@e X: <$@ XJ L$PPT  Xj  ` -C0&VXj AX: <$@ XJ L$S@T C Xj  ` -!4$kAX: <H P P$@ XJ PLDC0@ !3C XZ \Xe lPj LX: L<H Ű #=XJ PL@ #6P /cAXZ \He ` #7XZ  Xj AX: P<0 #50 B0tXj A4X L#4kA"XJ LLHT UZ  C0 Xj lH6 0 C02H Ű B0&* ,$8AfX $$8Af ,X* $8AfXJ LLD#4dARX P.AXj PlA	$WPZ PXZ  Xj ANXj lH6 P:  X LHK @ B0(X P=tA H[ @W ,XZ  Ha  AtC 4XZ P\ =tA Hk Pg ,X;  <P7 0XZ  Ha  AC ^X HK UJ  !6P /kAXZ  P /!5AP  Xj  AdXj  AXj  @g ,V`+ AXj  AXj A@X: <H Ű !=HC @G ,XZ  `+ AC  HS PW ,Xc  lPg 0XZ  `k AX:  P8XPcAXJ LXZ  @T UAXj l$0P6  X $A@K C XZ \He ` #7XZ  Xj AXj AX: <H Ű B0XJ  @ /#5HS T!3C \@W ,T`( AX  8 <A Xj lP pH A X* p$3AfX:  @6 3AX Hk AXJ  PHXX\PXC Xj  ` /!5AP  X:  0 !0 #$$lAX H ..AXJ LLHT P !;$aA	Xj Ll$1@6 $^Xj A$RXj LlA$nA$bA` A$mAX $M@K #XX\PXXj  PhXj  AXj LlAJC b
W  A( 0 X .A$mAX:  X  Z ,P  z XJ  XT  \[Z ,PT  "Xj  X6  <V: ,P6  C X  XK  LTJ ,PK  C XZ  Xe  lWj ,Pe  C X:  X  X* ,A  P  C |XJ  XT  \5\* ,A SPT  C ZXj  X6  <X* ,A2  P6  C :X  XK  L4X* ,A P  C XZ ,!7%fA$aPj ,X:  X  [E@ ]J ,P  C XJ ,!7%fA$QPZ ,Xj  X6  <SE@ ]J ,\J ,A 5P6  C  Ȁ
g A( , X X: <X P ,$@@C $RXj A*`cAXZ ,\U!2#PZ C z  /
w A( , X X: 0<P: 4X: ,<P: 0X: 4P: ,XJ LLPJ HXJ PLPJ LXJ HPJ PX8 A XZ LPQ  {  :g A( , X A
#8P /Xk A#P -Xk A{  g A( , X X: 0 B X8 A X  P LkAC0$%AXZ L\Xe  lFZJ dPe  C 8X: L<H #4cAHXJ LLXZ @T UAXj Ll$0P6 z X'P$@PJ 0PJ ,PJ 48 A XQ  \PZ L A Xa  lPj PeA#4$1P: 0Xj PlA#4$P ,XJ @ B0,XZ ,\UC0$CPJ Xj Pl$0X  ;P6  XJ LLHT C0PZ 8Xj ` B0>PJ HX: H<H #8X3 <P: H"XJ PLPC XZ H\$n@e C X4 <P: H` #(cA#4$P 4XJ 8L@ B0\XZ P B0PXj Pl$4@6 X PXJ LLPK XZ L\$`@e X8 A X PP  C pXZ H\He ` !4$`AҚX: 4<X ,;C0X =A P TX 8A XJ TT  a  VPZ <#;P B0|X: U: 8B0pX: P<X  P ,XZ H\Xj AXj PlAX =A XJ HLXT  \UQ  !>Xj Ll$@ Xj HlA˖C Xj LlAXJ 0LXZ ,\EC0<Xj ` C00X: P<X  P ,XZ L\AXj PlA8C 0XJ 0C0,X =A a  f#=AX: L<H #4cA XJ ,LDC0XZ P #5P B0Xm`  #;X: L<H Ű B0Xj LlAXJ LLHT P C0Hd ` #5` B0dAZX: 0 B0X LHK PJ D$PPZ @@ !4$RPZ @Xj PlX6  <0 !9$BPJ D&QPZ @C Z0 B0LX6  ?#8X6  0  P6  X L@ @K XZ L\Xe  lX: @<
cPe  %P @#%QPZ @XJ @LDBHXZ L\Xj Dl@e fAX: L<X  XJ @L
P  Xj PlAɊC C vXZ P\Xe  l` !?X LHK @ #6P PZ D#` !5$P D#%APJ DXZ D\UB"Xj Ll@V UAXj PlAC X: P<H #4cAXJ 0LXZ ,\EC0hXj ` B0\X: 0#3AxXj LlA
#5%P <#XJ PLXd  lAP <XZ <\U!Xj PlPV  $;P: #A&X ,C0,X =A XJ PLXT  \UQ  !6dADC <Xj LlX: @6 3AX LXJ PLPK C K
W  A( , X X:  C0,SXj A
#5$z X  XK LPJ  C %C  (
g A( , $X X8<0 #$hAX8 A X  P 0X'A XA  LPJ ,XZ C6Hd ` B0.* 8$8Af$$8Af 8+$8Af$0P9 hz X 'P XZ ,\X 8A P 0Xm#aAXi 0lAȘX8 A X  P ,XI 0LT P #$$`Pj Xk  lX; <
cPi hHK @ C0d$lA$aAdXZ ,\Xe  l&hPi hX: 0<X  ð@ C0|@ +PG ,Xe  Pg 0T`P APX: 0<X  k`$TA @ ,PG ,$PPW 0$\`   AP` +Pg ,X: ,<X  &P 0$\`P APC HC PG ,P 0$\`X APP +PW ,Xj ,lX6  <P7 0$\`P APX 0HK PG ,&DPG 0$\`X APP +PW ,Xj ,lX6  <&4P7 0$\`P APXj 0lAFXj ,lA:X'PC XJ ,LXT \UCXm` C0$PPT X ,* X$8AfX 0* 8$8AfX: X<&4P: XX H#Xj 8l&dPj 8$2@: R#
` *@j LP 8$3@: Rj XAƜj 8AƔ$`AX'PXJ ,LHT P 
B0Xj #4$oAX: 0<X HC MİKPJ cAP -Xj 0lAXZ ,\He Pg ,X5  <P7 0X 0H[ `P AP$@PG ,XZ \PW 0Xj 0lHV `   ArX: ,<Hc AX ,HK PG ,X[  \&TPW 0Xj 0lHV `P APX: 0<Hc AXj ,lAjC <Xj B06X: 0<H Ű !7HC !4$`A~Xj ,lAXj 0lAXZ ,\He ` B0eAӼ$SXj ,lAX: ,<X P xXJ 0LHT P B0$dA~$RXj 0lAּ$bA`	Pj |#`	Pj |Xj 0lAXj ,lAXj xlAX8<'1P8 8 A $QXa  lA$cAXj |lA$
C ` B0<X 0XHLB0$bAdXZ 0\` @e XZ 0\$bA$0P8A2P $TaA Ȱ ,P ,XJ LPG 0$R`A AP$PPZ xX x8A a  X x&A hӱ  
kAXJ xL&BPJ xXX\e  	F#"#C $`e  Xj lA ^X: 0<$@ XJ 0L$R@T Xj 0l$0P6  $bA$`AtX d!5Ȱ ,P d$RXj 0lAXj ,lAC XJ ,LHT P B0Xd l'aPj !` #6X=0 !4$`Pj %aAX 0HK !=$Q@[ Xj ,l$2@6 C H[ !9Xi dlf Pi dH; C0Xj lfB0X; <P: 4$@@K XZ 0\Xj ,lA
C0dXZ 4\Xj ,lA&C0LXZ ,\He A$SXj ,lA$cAXj 0lA Xj 4lABXj ,lA/C XZ 4\Xj ,lAC04$RXj 0lAl$SXj ,lA^`	A$
Xj 4lAC nXj 0l$>@6 X d!>XJ ,LHT P +!5Ȱ ,P d$RXj 0lA$SXj ,lAXj lfC04AX8<'1P8 8 A $QXa  lAͼ` A$
`	A$
C Xj ,lAѾX ,HK @ !6X]P  #5@ B0tXj 0lH6 0 B0`$SPZ VkA
#4$oPj X: 0<$@ Xj 0lAϺXJ 0LXZ \@T UAXZ 0\Xj ,lA
C0Xj 0lX6 <P: 4P -cA0X ,Hk AX ,(p$8Af%BPHHQ P !6`a Pj |#0Q P: |H P ,Xa  lPg 0X: 4<HS Xj |lAPXð #<XJ |L@a !5` A$
Xj ,lAVXZ 4\He AXj 0lA/Xj 4lA/Xj ,lA/XhlPhC ,X: ,<H Ű 0B0$@PI hXS  \PZ |Xj 0lH6 #3AXj ,lA/X8 A X  P ,XJ 0LX[ \PT Xj 0lX: ,<H @ XJ ,LXZ 0\PT Xj ,lX: |<@6 3AC @ -PJ |$PPZ Hc ` !70P P: C X` B0Ȱ@ P P  PZ @ PJ C 2` !?P   PZ ` Pj 0 P: #	Ȱ` P @ /PJ |XJ LDC0vXZ 0\He B0&@  !6H5 0 !6H Ű !4$@PJ C @` B08X5 <H B0(XC  LUJ !>cA/XZ 0\$`@e $0P: Xð C0TXJ 0LHT B0DXj l` !:X4  <8!4$`Pj `  !?X4  <0 !0   !$$`Pj XZ |\Xj 0lAXj ,lAVX ,HK PG ,X[  \PW 0Xj 0lHV Xj lAPX8&4P8X 0Hk ` XZ ,\AXJ LD#6X]P !;Xj 0lHf AC X: <0 B0X 0Hk @g ,V` AC L$aAdX: 0<H @ ,$Q`   AXJ 0LHd AXZ 0\He @g ,$Q`	 AXj lA$
Xj 0lA/Xj ,lA/C 
w A( , X A5(0 ,@=X @P ,HK @ #'@ #4kAȔ$PPZ 4Xi DlH6 0 B0^Xf lAC0NX DXK LXT  \Xj ,lX6 <CA PZ 4$@@K XY D\Xe lA/Xj ,lH6 0 B0X DHK B0XV \P B Hk #4kAX: ,<X DHC HJK @MDAX[  \P]Xc l@mfAH; 0 @=PG ,PW 0SHmAP 0C0^X'PXJ ,L@ AXZ ,\Xe  lX: 4<
cPe  X ,$C@K Xi DlA/z XZ ,\Xe lA20$fApX8 A Xa  lPi @$P ,$@PG 0XZ ,\XU  \Xj ,Hf A4DX: ,<H Ű B02XJ 4LXY D\Xe  l
FPJ 4$`Pe  X9 D<$@ Xi @lAC0\XI DLHT P !6P .dAXXj 4lX9 @<X  
kPj 4XI DLHT @S Xhl'aPhC dX9 D<H B0.HC @ B0"P .Xi @lAXX\'QPXC &$cA6X8 A Xa  lPi @Pi DX9 @<H #6P .cAʜXHL'APHXY @\He ` !9]X9 @Hc AX ,$C@K XZ ,\Xi @lH6 @5 X ,XJ 4LPK  XZ 4\UCHXj ,lH6 P: 0AP .Xj ,AX ,XJ 0L@K DAXZ ,\$c@e X9 D<X @;#4cA/Xi @lA/C 
w A( , X A5(X8<'2P8X @HK @ #'@ #4kAX$RXi DlA$cAd$cAXY @\Xe lfC>$0P: 0P: ,H P ,XE  L&DPG 0$S`X APXY @\He AC *$1P: 0X  P ,@ *PG ,Pg 0$S`   Ar`A$
$bAXZ 0\UC0Xi @lH6 @7 ,$R`
 AC &X @HK PG ,Xk  lPg 0$R`Z APX9 @<$@ XI @LXZ ,\PT  Xi @l$3@6 X @$@PK Xi @lA1Xi @lA/z  ̀
W  A( 0 X 6 @8 L3APX DXJ ,H N@ AH L8 <A XQ \Xhl	VB0H LA P 0H LA X: 0X XA L!4$PPX Hz  K
g A( , X W   $1P: @X HK PJ 0P PZ 4` -Pj 8$1P: <kA
#>Ȱ( P 4@ /PJ 8$VPZ <C $Xj 0C0X9 L<0 ?B0X XK LPJ ,$P@[ Xj 0` B0tX: ,<HC #5@ B0^$QXj lEV C0TC0H6 5B0xX ,XK  L@  #5@ B0\ARXZ \` @e X: ,<Ȱ @ XJ ,LXT  \P  !6P PT  #Xj lX6  <&2P6  P -Xj AX ,HK @ !;$PP[  Xj ,l$0@6 X ,XK  L@ !@#'H[ P B0&Hk Pg ,PG 0X: <HS `   ArC "Hk Pg ,PG 0X: <HS `   AX Hk AXj ,lA/z XJ ,LHT B0LXj 0` B0@X4  <0!0 C *$0[4  P4  XZ ,\Xj A&Xj ,lA/C X Xj 0@k fAX: 0B0XXHLB0XX\TC0XhlfC"XZ hpA
#;X: <Hc AC 0Xj AX HK @ B0<H[ XhlVB0*eAX: @!>X <P ,$PXJ LHd A.C XZ 8Xj A2XX\Xj lEV !9X8X;#;HF @G ,TXj 4A#Hf AXZ @!>Xj <Pg ,$PX: <Hc AC fۀ
W  A( , X H6 0 #5P /A=X  HK @ #6P /kA=XZ \He #7P /Xj AnX:  <H #6P /cAVXJ LHT P C0VXj  lH6 0 B0B* ,$8Af$$8Af ,&$8AfX ǰ P X8$<0 P8$P /dAXð  #7P /Xj  AXj  AXJ  LHT P B0 Hd @g ,X: <HS `) AC (H P ,Xd  lPg 0X: <HS `i APX Hk Az  
g A( , X $0P8HF #5P -A(X[ \$b@e Xk A{  #W  A( , X X: <H #>XJ  LHT #7Hc !4H4 #5Ȱ P lXHLT  UB0`Xj  lH6 B0*Xj ANX $D@K XZ \$c@e z X HK !=AXX \P PX C $`A5$RXj  AD$SXj A:$RXj  A0$bA$cA`kA$
Xj l$4@6 X $C@K $PPY dC v 
w A( , X X: <HC @ !8XY L\P ~!5${ Xc lH6 !6XJ HT !4$C Xd lX6  <0 !0#$$C HT P !4$C Xh l` Ph X8$<0 P8$* ,$8AfX  $$8Af ,X*  $8Af$0@2 P -Xj AP .Xj  AXJ  LXT \Xe  l` Bj`B bX: P<3#7@   PJ L#P   PZ LXj  lHF PG ,XV \Xe  lPg 0X: <HS Xj LlArC ^X: P<3#7@   PJ L#P   PZ LXj  lHF PG ,XV \Xe  lPg 0X: <HS Xj LlAXJ LHd AXZ  \Xe lA/%C 4W  A( , X $0P8$P9 lX @HK #4@ !:XZ  Xj Az Xj  AN#6Xj A"Xj AN#?Xj  AXX \P PX C W   $P P ##> =#;Xi Ll` f#4$P PAN#3C Xj  A@ @Xj A@ @Xj A
!6Xj  A
#9XZ  Xj A>C PXj AB0,X:  <H Ű #>XJ LHT P #5Hc C0TX * ,$8AfX  X* $8Af ,X*  $8AfX8 <0 P8 X$ǰ P$A#3C P -Xj A@ CXJ  LHT B0,Hd ` C0 ` #>X=0  #?H Ű #4Ű !7P -dA@ CXJ  LHT P !4dA>Xj  lH6 #50 B0X  ɰ BNɰB FXJ PLD#7P   PZ L#P   PZ LH6 P7 ,P 0X H[ Xj LArC BXJ PLD#7P   PZ L#P   PZ LH6 P7 ,P 0X H[ Xj LAXJ  LHT B0.Xj Pl` #B0$1P7 ,XT  \X Hk A C Xj  A@ BpXJ  LHT P B0BXj Plf#60 P: L#Ȱ	 P LH4 @7 ,X H[ Xj LlAC Hd ` !80   P: LC LX P#?` !60E P: L#0U P: LC $X  HK @ !6PI PZ L#`Y Pj LX:  <H P ,XC  LPG 0XZ \HU Xj LlAPXj lHf AC R
 A( ,g A( , X X9 d<&30P6  X XK  LD!4z $PPY d@ #,PW ,PG 0P +`   ArC  7
g A( , X Pi d` #-$0P7 ,Pg 0P +`   Arz  
g A( , X X8<'2P8XM@ ,#@ ,PMm#:XV  \e`A ^` +Pg ,$0P7 0$V`   APȰ +@ ,XX\` AXM@ "C0$@  #:`A$
XmA#`A$
C  +=`A Q  Te`   AXhlPi x$`Az  s
w A( , X X8(<XHL4!4z XX\PW ,$hPg 0P +`   AP$lA$<@7 ,$P` AXP(C  ;
W  A( , X $dAXk A2Xk  A2X8<{  g A( , X X: <X  P <#`  kA$
C HC @ B0`$PPS Xj A/A4$`Pj DX: <X  P @Pi L.(AP /Xi @lA@ CXI @LHT PZ 4=`A a  Pj 8AP ,=`A ӱ  P 0ʰ( kXJ 8L
dAX]!?$P`F AP$P`AAP <Xj 0ld *=`A `j ӱ  
kAXmAXJ 0LD@( dZj 0AXZ 8\TP+ eX: 0<
cA`#AX 8 *=`A ʰj kA  
dAXm&dAXj 4lAXj ,lAz X]!8$P`@AP$fPg ,$1P7 0$P 4P 8P <P *XmA0T$cA A4P /Xi @lA@ C$`AP DXI @LHT @W ,Q`. AXj DlAXi @lX: D<@6 3AX @$A@K C HXi @lA@ @NC 6$`A20A5(XY @\$b@e X9 @<$P A(C @ PJ DXi @lA?@XY @\Xj @l@e fAX9 @<X DP C A5(` AC XHLPH` A$
$bA$QPW ,$`Pg 0V$bA4D$aAC x` A20$hA` A20$cAA4Xi @lAC0f$bAX8<P: <X @Xk  lA2XI @L$T@T Xi @l$3@6 X @@ *@K XY @\Xj <Pe  C Xi @lA1A5(X9 @<$@ XI @LHd AX]&QPP]Xi @l$3@6 X @$C@K XY @\Xhl@e fAX9 @<XP  $aAئ$CPG ,$PPW 0X]XhlA4DXi Dl$4@6 X&PC "A5(XHL'BPH$PPZ 4Xi @lX6  <P: ,AB0(P .Xi @lA@ C$P ,XI @LHT PZ 4Xi DlA@ BpXi DlH6 P7 ,X  P 0$]`r APXJ 4LPG ,XZ ,\PW 0$P`   APXi DlHf AX9 D<H P ,XC  LPG 0$]`q APXi DlA/Xi @lA/XX\PXC ARXj <`@ B0A7P <$TaA 0 ,P7 ,$P 0$\`   AP@ +PG ,$PPW 0$V`   APXj lH6 P7 ,X  P 0$S`X APXJ LHT PW ,Xd  l&dPg 0$T`X AP$cA$3P7 ,Ȱ P 0$X`   AP$dA$DPG ,PG 0$\`A APXj <A ^C (`$TA P ,PW ,Xj <`Pg 0$\`A APX8<'1P8X HK !4kA/C p
  A( ,W  A( , X A#4{ P -Xk A@ CX; <HC PK 0A,P ,XX\PW ,P 0X[ 0\`P APXk 0lAXk lX8<@6 3AXK LX[ ,\PT  Xk lX;  @6 3AXK L$S@T X[ Xk 0lAC B r ,w A( , X Xj 8lA#?Xj 0lA#8Xj 4lA!5%{ X: 4<XC  LDC0~XZ 8\Xe  lX: 0<XC  LdVE@ Xj 4X6  <C&QP[ ,B<XJ 0Xd  l5XJ 4XT  \%A 
cX: 8XC  Ld!4$C f%lA%C Z uW  A( , X A1X8 A XA  LPK ,X[  dA>NXX\'QPX{  *w A( , X $0P: DX8 A XA  LPJ ,A XQ  \PZ 0A Xa  lPj 4A X1  <P: 8W   0A`P <$QXj 4AZ$QXj 8APXð C0:AC02$QXj 0A2$QXj 0A$RXj 8A$SXj 4A` A$
XJ ,LHT P !>H 8 `A Xa  lfB(dA@ @NX: ,<HS cAX ,$B@K Xj 8AC0ZXj 4AC0NXj 0AC0BXZ 8\Xe  lX: 4<X  
kXJ 0LXT  \e#7Xm` Pj DX8<'4P8Xj ,A1Xj 0A1X 0Hk AXj 4A1Xj 0A/$dA>XJ DC0&$`AP @A4XZ @\Xi @lA@ C#$aAXj <A8XZ DC0Xh,lX: ,<H Ҷ ð AXH,LXZ ,\X5  <P4 X,XZ @\[ P AXh,lX: 8<XC  LPF Xj 4A1$cAx$aAXX @8 <A P HX @ A X* H$3AfC BXj ,A1Xj ,A1XZ 8Xj ,AXj <'b$QPW ,$PA:8Xj 4A1$cA$aAXj ,A/Xj 8A/Xj 4A/z 
( ,w A( , X X8<<0 !9XhDlApC 0 !9XhDlA2C 0 !9XhDlAC 0 !9Xi XlA5C 0 B00XMLXX\E!7XhDlApXhlPmC HXI XLAPJ 0$P$!A PY #&QPY PZ ,$`A2XY UZ ,AUZ 0B0P ,z  
W  A( 0 *X AX#%aAX=&1P=$P H P XMPI \P dP |XX\PY 4Hi ,Pi `H9 C 0 !5$DPM#@ ,PMX Ű !4%cAX &P =XA A  PH8 `A %QPQ  Hi ` !;$0P7 ,P7 0S` )A%LX8Ű !<X'PXI 4LP  X]P 1!=$`Pg ,Pg 0VXhlA%L#3#P#	P ,P 0[kA%LW   P L. AX8<3#4$nAX #5` AAA!XP$@PHPI dɠ@ !XY |\U!6%oPi |AC A'C A`P X8<'2P8 8 A X  X  P PX&A XA  LXT  \PY TX&A Xa  lA/Xhl 8 A Xa  lA/X9 P<0 !X Tɰ#)%jA$P TP PC XI TLXY P\Eȴ Xi Xl
A P !&Pi %hAX9 <P9 $$!A P #&P P $`AX U AU B0P C F$P W   $ ,!:W   0A`P XH@L@ B0L$PPXDXhlfC0A5X9 @<X  PDcA/XC0*XHDLPI A5XY @\Xe  lPhDeA/X8<<0 B08X @H Š !9XHDL/`D#XX\Xe  l'dPe  X9 <3!>X TX P; P9 3!-XI PLPI T$1P9 %hAXY \PY $`$!A Pi C (&aPi Pi X9 P<&1P9 PAXi Ui AUi B0P C 8$PDXC0A5XI @LXT  \PXDdA/Hi ,X9 <c@i ,X@Ű !3C lP9 $
$!A P C &P P HI ,&A@I ,8A PXX8B00XhDlPa  X8<$ҳ XJ 'AJ C XXhlPa  X8<Ȱ *ҳ X<Š B0(XI @LHT P !<XhlX6  <'4P6  ArX U AU B0:P Xɰ@ #)X |!3C C hA6C `A`P W   0Xi lAaA20C 8A.P DA` ,Xi DlA2C W   $ -B0W   0A`P A4XI @LX 8A HQ Xi l
VA P 0X#aAXi 0lA1VA5(X'PXI @LHT P #5P B0FXd  lX9 D<X  
kPc  X @HJ 'CXY D\JE @J DAC P B0B$U@T Xi @l$1@6 P .Xi @lA@ CX @X DHJ @K C @P !+Xi DlHV @T C &X4  <P4 X DX @H[ &R@Z Xi @lX9 D<X  P  X @XI DLHT @Z Xi @lX9 D<X P X @XI DLXT \PZ Xi @lX9 D<X P Xi DlA/C \A`aA&8A P 0aA1VX @HJ @ C0,HZ P C0 W   $ p#9Xi @lf A
C A5X9 @<H P p$@ $P XI pLDC0XY @\Xe lPi HXf lPe X9 H<H P t$@ XY p\Xi HlA@ CXi HlA/X XI pLP XI tLPI pC rXY \e` AXi lhAX9 @<P9 HcAbX HX PHK C0XY L\UC0kA1Xi HlA/A4Xi @lHf AX9 @H Ű !5$P p#$BPI pXY p\@S UAXi @l$P  X @HJ @ @J Xi plAXY @\He ` B0"H5 0 B0$3@5 W   $P L SC0 pC0 ?C0X HX P t!5Ƞ P tXM&A@PMXY @\$c@e X9 @<X@ AX @XMPJ  X]Xi tl
VP]$3P7 ,$P 0X @XZ  \XhlA4DXI DL$T@T Xi DlX9 t<P6 $P ,$P 0Z$bA4DXI DL$T@T $aAĂXi Llf#7XhlAC AC A5$`A5X9 4<ӳ Ű !5$P p#$BPI pXY p\Xi @lA>NAfC A5Xi @lA@ @N$RXi @lA>NA>C ^`$AA.C N`$AAC >X]P #4A#AьC &$nPi pC z$3P9 pC p$P pC f$P pC \$JPI pC R$XPY pC H$kPi pC >$<P9 pC 4$P pC *$P pC  @ PI p#$RPY p#$aPi p#$=P9 pXi plA@ `C A4X#$PXi @lA
#6Ƞ /P #@ -PI XY \Xi @lA@ CXi @lAXY @\He Pi $1P7 ,$U$cA:8X @Hk A$bA@ `A4XY \Xi @lA@ C$cA8X @Hj AC $aAZC $`APC %aAFXI hLPI dC $QPW ,$bA$`Pi pC 6$1P7 ,$P$bAն$P pC $P p#$CPI p#$TPY p#$ePi pA`P X9 p<SX 
[$P ,aA:8C ,A5(Xi @lA@ @NXi DlA@ @NA5(XY D\Xi @lAPXHL'BPHXi DlA/Xi @lA/C XX\Xh$l
V 8 A X  (P$8AfbA1X9 l<P9 dC XP$P(A`aA&8A P 0A5Xi @lA/XI @LXT  \Xi 0l
UJV XhlALC A`aA&8A P 0Xð C0bȠ *@XA  LPI Y hA@ AA5$RXi @lA>NHXPW ,Xi lPg 0$S`   Ar` A$
C $aA20$kA@ `A5P .Xi @lA>NX9 @<H =`A ӱ  P  *A ʰs kӡ  
jAXI 0LHT PY Xi lhP `@ P 
eAX9 <c`  AX  ,=`A ʰ
 kӡ  
jAXi l` AXHLPHPH(C A`$PPW ,$\aA:8C A`$aPg ,$\aA:8C A`$`a$0P7 ,$\A:8C tA`$`aA8C dA`aA8C VAC NA5Xi @lA/X @Xk  lAXPC A5Xi @lA/XI @LXT  \P]P  C0$$8 `A %aPa  X8L<3!4%nA#	$8 `A $P  C A` #4%iAA5($PXi @lA#9Xi DlAB0>$VXi @lA@ C$TXi DlA@ C$@[MPHX]&\P]%aPhC D$0P8X @X  P PXI DLXT  \PY T	#*%gAXi PlPi TX8<'2P8Xi DlA/Xi @lA/C XC0C`XP ,$@XX\EPG 0$W`   ArXi XlA20A5$RXi @lA>N$fA$dA`oA$
$aPhX8<$ҳ XXMPJ  X]&XP]XhlPg ,X8<X  P 0$T`   Ar`.	A$
C DXB06$dAXHLPHXi PlApXi TlApXi XlApXY T\Xi PlV5 X X+A Z=P9 02C X4B0A20Xi TlA20A5($VXi @lA@ C$TXi DlA@ CXi DlA/Xi @lA/XHL'BPHP *PW ,XhlPg 0$W`   Ar$gA$0X;P8C LVKA XXMEPJ  XY \P]XhlX8<@6 3AC W   P%X4P4#?HI ,@G ,HY Xh0lA2C $PPY $gPi t 2!?X=&3XI 4L0@4 
3AHY ,Xi `lVPY $0P9 XŰ 2!3PY UC P9 XXI 4LXY \@ AXi `lH9 ,P9 $!A Pi C $&aPi Pi X'P8A P 8A P <X) 8$4AfXŠ 2C0B @ 0B0XX\Q P AXi 8lX9 t<P6  XŰ 1B0VXi <lA1VA5Xi @lA/X @HJ @ #;$Q@Z Xi @l$3@6 XY @\Xi tlA#@ +B $P tX#Xi 8lAXi <lAXI tL'API tXi Ui AUi B0P XX\IY ,!$%dAXm` 2C0(X9 8<ӳ Ű !<ӣ Š !7$ҳ $@PI tX]P 1#3C Xi 4lA"Xi tlfB0rX8<P7 ,X <X  P 0$S`   APXM@ C02XY <\e ` C0A20A5$QXi @lA>N` A$
`	A$
C X8<3B0$PLXà  C0~ ,=`A ӱ  Ȼ@PL`4A`A`$A`$A`$@A`X=A$dA`A`  A`  A`  A`  AmAA,P tXHL@HDAP Y hA@ AHXPW ,Xi lPg 0P +`P AP=P8H ,@ ,HY $`AhX@AXI tLPI Y hA@ AHXPW ,Xi lPg 0P +`X APC L$`A20$`A20X8<P9 tXC0(A5X tZXHLTXi @lA>NC ` A$
XX\PX($`PhC H9 !7XP \C HX&j`XY x\AXH(LXX\E#?Xi 4l6 3#5%kA#A`$P ,%P 0[kA%LXI \LPMHY C 2X8 `A $`Pa  X= '1P= =XA ӱ  PX'Py 	  1 C     H !w P (A( , X H ,$1P4 Ȱ ,P A  ( <AxH P$PPT P A  ( `AxH h$1P4 P PPT A  ( xAxH $1P4 P PT A  ( AxH $0P4 P PT A   ( AxH $0P4 P PT A  ( AxH $0P4 P PT A  ( Ax$0P88%QPXHP4 ` Pd A  (AxH$0P4 $]PT A (AxA1 P8AH$1P4 XP A  (Ax$0P8HXŰ !4cA$bW   `$cW   l`  W   <$bW   l$aW   <+"P $PP@  PHPP PPPP4P(PP P$XXPX8A Pґ  $`Ph%1&1P8P88 `A $P  X8U8A0 ,B0P%&PP8 A $P  XUAŠ B0P +8 `A %APA   *8 `A %QPQ   ,8 `A %aPa  $8 `A %P  %P HXÐ  #8$8 `A P  %APHLT&QPXPX8A !0 zA|UXAP B0P$`&aPhPh8 <A !$3A|8 <A %P XhUhA` ,B0P%&PP8 A P A XP X8 A PX&A XHP XUAŠ B0P 8 A $PPQ  8 A $`Pa $8 A P $8 A P $P ȭP@ ,[$bA|$dA$eW   <$cW   l$hW   <XhlAXi `AXh lAXhlAXHH#6$ $$Ax qlAXXH#6$ $$Ax       5  238   BUIST DAVID M S                 5  238   BUIST DAVID M S              21/12/65

   6  239   CAMPBELL MORAG L                6  239   CAMPBELL MORAG L                6  239   CAMPBELL MORAG L             17/08/65

   7  245   CRAIGIE BRIAN S                 7  245   CRAIGIE BRIAN S                 7  245   CRAIGIE BRIAN S              31/10/64

   8  248   DEWAR MICHAEL C                 8  248   DEWAR MICHAEL C                 8  248   DEWAR MICHAEL C              03/02/66

   9  251   DRYSDALE DAVID J                9  251   DRYSDALE DAVID J                9  251   DRYSDALE DAVID J             22/07/65

  10  254   GARDNER JACQUELINE A           10  254   GARDNER JACQUELINE A           10  254   GARDNER JACQUELINE A         04/09/65

  11  256   GAUR ANJILA                    11  256   GAUR ANJILA                    11  256   GAUR ANJILA                  27/10/65

  12  257   GAUR SUDHA                     12  257   GAUR SUDHA                     12  257   GAUR SUDHA                                                  $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |          4.13     w|                             耀        2lt0<                           4                                                                                                                                                                                                                                                                        l|L\<^|DT                dK`                                         W                20  284   KNIGHT STEVEN W          H?   x x
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !!! %option  stack=30
!!!  19-Feb-82         !!!! 15/5/78
{Modified run under new subsystem so that it can support its own supervisor}

!!!!!!!!!!!%CONTROL 1;   ! ... TEST ONLY SWITCHES
%CONSTSTRING(5) VERSION = "4.12"

%CONSTINTEGER GBASE= 426
%CONSTINTEGER  GMAX = 512;   !???

   {Changed from %CONST to %OWN to get 8.1 pass1 to accept source}
%ownSHORTINTEGERARRAY PHRASE(132:255) = 326, 137, 219,   0,
 386, 164, 242, 246, 216, 210, 229,  98,
 378, 183, 310, 292, 268, 259, 349, 221,
 367, 364, 410, 413, 416, 419, 422, 391,
 405, 199, 236, 158, 382, 357,   0, 278,
 285, 307, 302, 318, 321, 346, 341, 370,
 425, 426,   0,   0,   0,   0,   0,   0,
   0,   0,   0,   0,   0,   0,   0,   0,
   0,   0,   0,   0,   0,   0,   0,   0,
   0,   0,   0,   0,   0,   0,   0,   0,
   0,   0,   0,   0,   0,   0,   0,   0,
   0,   0,   0,   0,   0,   0,   0,   0,
   0,   0,   0,   0,   0,   0,   0,   0,
   0,   0,   0,   0,   0,   0,   0,   0,
   0,   0,   0,   0,   0,   0,   0,   0,
   0,   0,   1,   7,  40,  49,  96,   0

%CONSTBYTEINTEGERARRAY ATOMIC(105:130) =
  14,   9,   4,  20,   6, 110, 111,  30,
   3,  80,  59,  59,  13,   4,  13,  59,
  43,  73,  79,  72,  71,   4,   2,   2,
   4,   2

%OWNSHORTINTEGERARRAY GRAM(0:GMAX) =
       0,  -32765,       4,       5,     511,    8198,       4,  -32748,
  -32747,  -32741,  -32740,  -32739,  -32738,  -32737,      15,  -32736,
  -32750,     511,  -32257,      15,      27,      22,  -32744,     511,
    8217,  -32747,     511,     511,     511,      27,      33,      37,
      36,    8226,  -32750,     511,      16,    8230,  -32737,     511,
  -32726,     511,      43,      44,  -32725,  -32721,      27,  -32725,
      44,  -32708,  -32706,  -32698,  -32689,  -32688,  -32687,  -32741,
  -32675,  -32686,  -32741,      66,  -32706,     511,  -32698,  -32695,
  -32257,      27,  -24482,  -24482,  -32673,     511,      71,  -32694,
  -32695,     511,  -32695,  -32257,      77,  -32681,     511,      89,
  -32257,    4187,  -32685,      84,  -32685,  -32695,     511,  -32695,
      27,  -32703,      73,  -32695,     511,    8219,    8219,   12315,
      97,      27,  -32657,  -32647,  -32655,  -32654,  -32647,  -32660,
  -32653,  -32651,  -32646,     122,  -32645,  -32649,     120,  -32644,
     121,  -32643,     126,  -32645,     119,  -32641,     128,  -24576,
    8192,     129,     130,       0,    8192,    8192,    8192,    8192,
     131,     132,     133,     134,     114,     115,     135,  -32649,
     123,  -32768,  -32622,  -32621,  -32620,  -32624,  -32619,     150,
  -32623,    8344,    8192,     126,     125,     154,  -32613,       0,
  -32612,       0,     157,       0,   20480,     150,  -32607,  -32606,
     163,    4096,    4608,    2048,  -32594,  -32768,  -32768,  -32594,
  -32594,  -32593,  -32593,  -32591,  -32591,     177,     178,  -32589,
       0,     180,     181,       0,     182,       0,     175,  -32594,
  -32768,  -32768,  -32594,  -32594,  -32594,  -32574,  -32574,  -32573,
  -32573,     195,     196,     197,       0,     198,     194,  -32564,
  -32564,  -32562,  -32562,     206,  -32561,       0,     208,       0,
     209,     204,  -32555,  -32768,       0,     214,   12503,       0,
    8409,  -32552,       0,  -24576,    8192,  -32542,     223,  -32541,
  -32540,     174,       0,     215,       0,  -32532,  -32536,     241,
  -32529,  -24576,  -32533,    8192,  -32533,  -32533,    8192,  -24576,
    8192,       0,     243,  -32526,  -32768,     243,  -32520,     249,
     250,     254,  -32516,       0,  -32518,     250,    8447,     256,
  -32510,       0,       0,  -32507,     262,    4608,    2311,     264,
   18697,  -32501,       0,   10240,  -32498,     271,     272,     273,
     274,     125,   16659,  -32491,       0,    8192,  -32768,  -32486,
  -32485,       0,     215,    8476,       0,  -32768,  -32768,  -32478,
  -32477,       0,     215,     284,  -32468,  -32474,    8487,  -32474,
  -32467,  -32468,  -32468,       0,    8489,    8488,    8495,  -32466,
  -32462,       0,    8496,    8500,  -32461,       0,  -32452,    8504,
  -32457,  -32451,  -32452,       0,    8506,    8505,    8511,  -32450,
       0,    8514,  -32447,  -32443,       0,    8515,  -32434,  -32440,
    8521,  -32440,  -32430,  -32429,  -32429,       0,    8527,  -32428,
  -32428,       0,    8522,    8523,    8527,    8534,  -32427,  -32423,
       0,    8535,    8539,  -32422,       0,     350,  -24223,  -24222,
       0,     355,     351,  -24223,       0,    8550,     359,    8552,
     361,    8554,     363,    8192,     365,    4462,       0,     368,
  -32401,       0,     371,    4468,     373,   12662,  -32392,     377,
     371,       0,     379,    8572,  -32390,       0,     383,    8576,
     385,    8407,  -32380,       0,  -32378,    8448,     388,  -32768,
  -32768,  -32370,  -32370,  -32369,  -32369,     399,     401,  -32366,
       0,       0,     403,     404,     398,     406,    4503,  -32359,
     377,     406,     411,    4508,     365,     414,    4511,     411,
     417,    4514,     414,     420,    4517,     417,     423,    4520,
     420,       0,       0,       0,       0,       0,       0,       0,
       0,       0,       0,       0,       0,       0,       0,       0,
       0,       0,       0,       0,       0,       0,       0,       0,
       0,       0,       0,       0,       0,       0,       0,       0,
       0,       0,       0,       0,       0,       0,       0,       0,
       0,       0,       0,       0,       0,       0,       0,       0,
       0,       0,       0,       0,       0,       0,       0,       0,
       0,       0,       0,       0,       0,       0,       0,       0,
       0,       0,       0,       0,       0,       0,       0,       0,
       0,       0,       0,       0,       0,       0,       0,       0,
       0,       0,       0,       0,       0,       0,       0,       0,
       0

%OWNBYTEINTEGERARRAY GCLASS(0:GMAX) =
     255,     114,     116,       1,      89,     162,       2,      53,
      54,      49,      50,      51,      52,      57,     142,       1,
     118,     117,      13,     142,     152,     152,       6,     117,
     142,     118,     117,      13,      59,     144,      59,     152,
      83,     164,       6,     117,     128,     164,       4,      13,
       1,      13,      56,      59,      56,       4,       2,      56,
      59,      34,      35,      28,      29,      10,      11,      33,
      42,      19,      48,     133,      35,      13,      28,      12,
     119,     133,      28,      29,      11,      13,     150,       5,
      12,     119,      12,     119,     133,      35,      13,     150,
     119,     165,      15,      83,       4,      12,     119,      12,
     133,       5,      10,      10,     119,      83,     150,     165,
       1,     138,      63,      62,      61,      60,      64,      75,
      74,      77,      78,      76,      94,     109,      20,      20,
      95,      20,     109,      94,     109,      20,      95,      83,
     161,     101,     101,     143,     159,     137,     163,     166,
     101,     153,     153,     153,     102,     102,     102,     109,
      94,      23,       8,      22,      21,      24,      73,     143,
      15,      83,     141,      90,      91,     101,     112,       0,
       4,       0,     153,     133,     147,     102,      86,      87,
      88,     147,     146,     140,      70,      67,      68,      69,
      71,      74,      75,      76,      77,      78,     101,      94,
       0,     101,     153,     137,     153,     102,     102,      70,
      67,      68,      69,      72,      71,      74,      75,      76,
      77,      78,      94,     101,     145,     153,     102,      74,
      75,      76,      77,      78,      94,       0,     101,     161,
     153,     102,      80,      81,     115,       1,     147,       2,
     134,     105,       0,      82,     145,      99,     100,       1,
      32,      79,     149,     150,     151,      86,      87,      88,
      43,      84,      45,      83,      43,      45,      83,      84,
      83,      82,     139,       4,       2,     139,      53,      51,
      59,     152,       4,       0,      59,     139,     164,      97,
       4,       0,     136,      99,     100,     148,     140,      46,
     140,      46,       0,     140,      99,     100,     132,     137,
      46,     108,     132,      46,       0,     132,      83,       1,
       9,     145,     147,     167,     106,      84,      83,       1,
       9,     145,     132,     168,      43,      45,     167,      36,
      38,      39,      40,       0,     170,     169,     167,      36,
      38,       0,     169,     167,      36,       0,      43,     168,
      37,      41,      40,       0,     172,     171,     168,      37,
       0,     168,      37,      41,       0,     171,      43,      45,
     168,      36,      38,      39,      40,       0,     174,      39,
      40,       0,     173,     174,     172,     168,      36,      38,
       0,     173,     168,      36,       0,     151,      30,      31,
       0,     151,     151,      30,       0,     137,       6,     147,
       4,     147,     126,     147,       1,     147,     127,      59,
       4,       0,       1,     147,     113,     147,       4,       2,
      98,      97,     152,     175,       4,       0,       1,     162,
     113,     162,      59,     139,       4,     164,      59,      70,
      69,      74,      75,      76,      77,      78,      94,      95,
       0,     159,     101,     153,     102,       1,     147,       4,
     127,      98,       1,     147,     107,       1,     147,     107,
       1,     147,     107,       1,     147,     107,       1,     147,
     107,     124,     125,     147,     107,     147,     107,     147,
     107,     147,     127,       0,       0,       0,       0,       0,
       0,       0,       0,       0,       0,       0,       0,       0,
       0,       0,       0,       0,       0,       0,       0,       0,
       0,       0,       0,       0,       0,       0,       0,       0,
       0,       0,       0,       0,       0,       0,       0,       0,
       0,       0,       0,       0,       0,       0,       0,       0,
       0,       0,       0,       0,       0,       0,       0,       0,
       0,       0,       0,       0,       0,       0,       0,       0,
       0,       0,       0,       0,       0,       0,       0,       0,
       0,       0,       0,       0,       0,       0,       0,       0,
       0

%CONSTSHORTINTEGERARRAY KDICT(32: 538) =
       0,     511,     131,     527,     131,     131,     531,     131,
     535,     539,     543,     551,     555,     559,     575,     579,
     129,     129,     129,     129,     129,     129,     129,     129,
     129,     129,     591,     594,     599,     619,     635,     131,
     131,     652,     724,     752,     840,     876,    1020,     128,
     128,    1084,     128,     128,    1296,    1320,    1344,    1384,
    1408,     128,    1460,    1824,    2056,    2080,     128,    2112,
     128,     128,     128,     131,    2127,     131,     131,    2151,
     131,     131,     131,     131,     131,     131,     131,     131,
     131,     131,     131,     131,     131,     131,     131,     131,
     131,     131,     131,     131,     131,     131,     131,     131,
     131,     131,     131,     131,    2155,     131,     131,  -32351,
  -16119,   16679,   16743,   18734,   16614,   16385,   16386,  -16282,
   16489,   17128,   16388,  -32322,  -15576,   17195,   16392,   21710,
  -32465,   19369,   16550,   16387,   16397,  -32196,  -32451,   18542,
   18798,   16804,  -32323,  -14138,   18670,   19284,  -32195,  -32450,
   18606,   16868,   18862,  -30642,   10578,   11457,  -31922,  -32429,
   16823,    8912,      67,   16951,    9921,      69,  -32429,   16887,
    8912,      67,   17079,      68,   18910,  -32187,   10841,      69,
   16896,    9415,      78,   17393,  -30070,  -32177,    8665,    8908,
   16394,  -31027,      78,  -31533,      84,  -32183,   10194,      76,
   17386,   10958,      69,   18135,      84,   16512,    8909,   10830,
   16391,   16384,  -32055,   10073,    9921,    8649,   16704,    9153,
   10190,    8915,   17322,  -28340,  -31026,  -31530,      88,  -32055,
    8916,   10066,    9793,   16768,      84,   18071,   10053,      84,
   16399,      68,  -32433,   21873,      70,  -31034,  -31540,      80,
  -32059,   10194,   10567,    9921,   22001,    9938,   22065,   10697,
      84,   17904,    9801,      69,   21937,    8915,   19171,  -31039,
  -31543,  -32306,   10575,   16395,  -32429,   17143,    8912,      67,
   17207,    9422,    9299,   19106,   10700,      69,   17623,  -26042,
   10830,    9157,   10565,  -28607,  -29626,  -30643,  -31794,  -32301,
  -15243,   17528,    8912,      67,   23416,    9921,      69,  -32301,
  -15179,   17592,    8912,      67,   23480,   10305,  -32301,  -14734,
   18040,    8912,      67,   24306,      78,  -32301,  -14798,   17976,
    8912,      67,   24370,   10578,   11457,  -31922,  -32429,   18163,
    8912,      67,   23539,    9921,      69,  -32301,  -14539,   18232,
    8912,      67,   23608,   18204,  -32183,   10063,      71,   17024,
   10835,   17840,   10305,  -32429,   16631,    8912,      67,   16695,
  -32319,   10831,   18464,    8909,  -32301,  -16201,   16568,    8912,
      67,   17015,  -32050,  -32302,   10071,   16448,   18975,   19219,
  -31291,    8914,    9412,    8387,    8916,  -32301,  -15694,   17080,
    8912,      67,   24050,    9938,   16832,  -31419,   10959,    9428,
    8910,  -32301,  -15886,   16888,    8912,      67,   24114,  -29759,
  -30909,  -31408,  -32173,   10964,   10066,   17495,    9813,    7892,
  -32451,   17430,   17045,    8389,      84,   19041,   10575,      68,
  -32088,   10182,    9938,   10817,   21810,   21521,      76,  -27455,
  -28474,  -29491,  -30642,  -32301,  -10123,   22648,  -31540,  -32178,
    8912,      67,   23672,   10575,    8397,      76,   18032,   10063,
      71,   17968,    9921,      69,  -32301,  -10059,   22712,    8912,
      67,   23736,   10305,  -32301,   -9614,   23160,    8912,      67,
   24178,      78,  -32301,   -9678,   23096,    8912,      67,   24242,
   10578,   11457,  -31922,  -32429,   23283,    8912,      67,   23795,
    9921,      69,  -32301,   -9419,   23352,    8912,      67,   23864,
  -25656,  -26167,  -26672,  -31532,  -32041,   10713,    8916,      77,
   16640,   10825,    9283,   16825,  -28223,  -28593,    9426,    9166,
  -29144,  -30015,  -31034,  -32051,    8398,    8909,  -12107,   20664,
   10305,  -32301,  -11662,   21112,    8912,      67,   24498,      78,
  -32301,  -11726,   21048,    8912,      67,   23922,   10578,   11457,
    8398,    8909,  -11467,   21304,   20496,      80,   17751,   10834,
   16396,    8645,   -8206,   24567,   10055,    9793,   17688,   10575,
      84,   16960,  -32184,   10962,      69,   17559,   10053,   16389,
      78,  -32180,    9428,      76,   18397,   10693,      83,   18268,
    9416,    8908,   18333,  -32067,  -32292,  -15771,   17005,   17252,
   18734,   16402,   16649

!*******************************************
!*                                         *
!*        TRANSPORTABLE IMP COMPILER       *
!*                                         *
!*      COPYRIGHT   PETER S. ROBERTSON     *
!*      DEPARTMENT OF COMPUTER SCIENCE     *
!*         UNIVERSITY OF EDINBURGH         *
!*           ALL RIGHTS RESERVED           *
!*                                         *
!*******************************************
!
! THROUGHOUT THE SOURCE TEXT OF THIS PROGRAM, THE LOWER CASE
! ALPHABET IS REPRESENTED BY LETTER+32 E.G.  'A'+32

%CONSTINTEGER SS0=250, SS1=251, SS2=252, SS3=253, SS4=254
%CONSTINTEGER NULL=512;    !???
%CONSTINTEGER TRANSP = 18
%CONSTINTEGER PHRASES = 132
%CONSTINTEGER EQUIVS = 105
%CONSTINTEGER DIRECTIVES = 86
%CONSTINTEGER ANAPP=160
%CONSTINTEGER GLOBAL=0
%CONSTINTEGER ICONST=83, RCONST=84, SCONST=82
%CONSTINTEGER LB=1, RB=2
%CONSTINTEGER PRE1=49, PRE2=57
%CONSTINTEGER OWN1=53, OWN2=51
%CONSTINTEGER SET1=60, SET2=64
%CONSTINTEGER CHECK1=66, CHECK2=72
%CONSTINTEGER DEF1=60, DEF2=79
%CONSTINTEGER IDENT=59, SWITCH=80, COMMENT=7
%CONSTINTEGER TERMIN=13
%CONSTINTEGER APPEP=153
%CONSTINTEGER PAGE SIZE = 64
%CONSTINTEGER STX = 2
%CONSTINTEGER PAGE = 12
!*********************************************
!* OTYPE * MOD * SPECD * FORMAT * APP * LINK *
!*********************************************
!    3      2      1       1       1      8
!
! OTYPE : 1 OWN
!         2 CONST
!         3 EXTRINSIC
!         4 SYSTEM
!         5 DYNAMIC
!         6 EXTERNAL
!         7 PERM
!
!*******************************
!* LENGTH * USED * TYPE * FORM *
!*******************************
!     8       1      3      4
!
%BEGIN
! ------I/O STREAM ASSIGNMENTS CHANGED TEMPORARILY------
%CONSTINTEGER PRIM = 2, PROG = 1;           ! INPUT STREAMS
%CONSTINTEGER REPORT=3,OBJ=2, LISTING=1;    ! OUTPUT STREAMS
%CONSTINTEGER EOP=87;                       ! ENDOFPROGRAM SUBATOM
%CONSTINTEGER EOF=86;                       ! ENDOFFILE SUBATOM
%CONSTINTEGER TEXT LIMIT=255;               ! MAX STRING LENGTH
%CONSTBYTEINTEGERARRAY CMAP(0 : 15)= 0, 67, 68, 81, 65, 83, 80, 73,
                                    72, 71, 79, 69, 7 0, 66, 0, 0
%CONSTINTEGER STRING = 16, RECORD=17;       ! STRING/RECORD SUBATOMS
%CONSTINTEGER SPECIAL=55;                   ! SPECIAL DECLARATOR
%CONSTINTEGER RFN=65;                       ! RECORDFORMAT NAME CLASS
%CONSTINTEGER ULINE=18;                     ! CLASS FOR '_'
%CONSTINTEGER NULL STRING=401
%OWNINTEGER PERMIN = 1;                     ! PERM/PROG SWITCH
%OWNINTEGER DIAG = 0, CONTROL = 0
%OWNINTEGER BPT=0;                          ! CODE BUFFER POINTER
%OWNSHORTINTEGERARRAY BUFFER(1 : 401)
%CONSTINTEGER MCODE = 38

   !  %DIAGNOSE FLAGS (2\\N)
   !
   !  0  -  GRAMMAR TRACE
   !  1  -  RECORD USE
   !  2  -  APP DEFN.
   !  3  -  RECORD DEFN.
   !
   %ROUTINESPEC FAULT(%INTEGER N)
!*********************************************
!* ALMOST THE WHOLE COMPILER ASSUMES A 16 BIT WORD. *
!*********************************************
%OWNINTEGER MARK = ' '
%OWNINTEGER FILE = 0;                       ! BEGIN OR EXTERNAL FILE ?
%CONSTINTEGER DICT END = 2750
%INTEGERARRAY DICT(0:DICT END)
%CONSTINTEGER MAX LAB = 80
%BYTEINTEGERARRAY LABINF(1 : MAX LAB)
%INTEGER LIST, LREALS;                      ! OPTION FLAGS
%INTEGER STATS;                             ! NUMBER OF STATEMENTS
%ownINTEGER CODE = 0;                              ! OBJECT FILE SIZE
%INTEGER LINES;                             ! LINES ON LISTING PAGE
%INTEGER LINENUM;                           ! CURRENT LINE NUMBER
%INTEGER LIT;                               ! LAST LITERAL POS
%INTEGER LIT POS;                           ! LITERAL TEXT POINTER
%INTEGER LIMIT;                             ! DIGIT SEARCH LIMIT
%INTEGER DIGIT;                             ! CURRECT DIGIT
%INTEGER OLD SYM;                           ! FIRST SYM OF NAME
%INTEGER LABEL;                             ! CURRENT LABEL
%INTEGER X;                                 ! CURRENT TAG APP/FORMAT
%ownINTEGER SYM = 0;                               ! CURRENT INPUT SYMBOL
%INTEGER ATOM1;                             ! CURRENT ATOM
%INTEGER ATOM2;                             ! VARIANT OF ATOM1
%INTEGER SUBATOM;                           ! EXTRA INFO
%INTEGER LAST;                              ! LAST ATOM TYPE
%INTEGER SS TYPE;                           ! 0 LABEL, 1 DECLARATION,
                                            ! 2 FORMAL PARAMS, 3 STATEMENT
%INTEGER SYMTYPE;                           ! -2:LETTER, -1: DIGIT
                                            ! 0:TERMINATOR, 1: OTHER
%INTEGER TYPE;                              ! VARIABLE TYPE WANTED
%INTEGER VAR TYPE;                          ! VARIABLE TYPE FOUND
%ownINTEGER POS = 0;                               ! CURRENT INPUT POSITION
%INTEGER ATOM POS;                          ! CURRENT ATOM START POSN.
%INTEGER DUP;                               ! DUPLICATE FLAG
%INTEGER OUT;                               ! CURRENT OUTPUT STREAM
%INTEGER PREFIX, SPREFIX;                   ! OWN, BYTE, EXTERNAL ETC.
%INTEGER CONST INT
%INTEGER O TYPE
%INTEGER DEC TYPE;                          ! CURRENT DECLARATOR
%OWNINTEGERARRAY CNEST(0 :10);              ! STACK FOR CONDITIONS
%OWNBYTEINTEGERARRAY LINE(1 : 73);          ! INPUT LINE BUFFER
%CONSTINTEGER RECLEN = -300;     ! -(MAX LENGTH OF ANALYSIS RECORD)
%INTEGERARRAY REF, CO, SUB, LOC(RECLEN : -1)
%INTEGER SS;                                ! SOURCE STATEMENT ENTRY
%INTEGER A;                                 ! ATOM POINTER
%INTEGER P;                                 ! PHRASE POINTER
%INTEGER FAULTY;                            ! FAULT INDICATOR
%INTEGER F TYPE;                            ! TYPE OF FAULT
%INTEGER G LIMIT;                           ! END OF GRAM POINTER
%INTEGER T LIMIT;                           ! MAX EXTENT OF DICTIONARY
%INTEGER TMAX;                              ! CURRENT MAX TAG (FREE)
%INTEGER T BASE;                            ! FIRST NAME AT CURRENT LEVEL
%INTEGER DP;                                ! END OF CURRENT NAME
%INTEGER RELOCATE;                          ! RELOCATION FOR FORMATS
%INTEGER APP
%SHORTINTEGERNAME PAPP;                     ! ==PHRASE(APPEP)
%INTEGER EILAB;                             ! %ELSEIF LABEL
%ownINTEGER MARGIN = 0
%INTEGER INHIBIT;                       ! FLAG FOR DECLARATIONS MISPLA

%ROUTINE SEND
   %INTEGER J
   %RETURN %IF BPT <= 0
   FAULT(22) %IF BPT >= LITPOS
   %IF FAULTY = 0 %START
      SELECTOUTPUT(OBJ)
      PRINTSYMBOL(BUFFER(J)) %FOR J = 1,1,BPT
      SELECTOUTPUT(LISTING)
   %FINISH
   BPT=0
%END
%ROUTINE PUT(%INTEGER N)
   CODE = CODE+1
   SEND %IF BPT > 71
   BPT=BPT+1; BUFFER(BPT)=N
%END
%ROUTINE ADDR(%INTEGER N)
   %INTEGER V
   V=N//10
   ADDR(V) %UNLESS V=0
   PUT(N-V*10+'0')
%END
%ROUTINE OP(%INTEGER C, A)
   PUT(C); ADDR(A)
%END
%ROUTINE PRINT NAME(%INTEGER N)
   %INTEGER D, FLAG
! ----- 'UNPACK' USES AT LEAST A 30-BIT WORD ----
   %ROUTINE UNPACK(%INTEGER V)
      %INTEGER J, N, C
      %CYCLE  J = 24,-6,0
         C = (V>>J)&63
         %IF C # 0 %START
            C = C+32;   ! ADD IN 32 REMOVED WHEN PACKING
            %IF FLAG # 0 %START
               %IF FLAG < 0 %THEN PUT(C) %ELSE PRINT SYMBOL(C)
               FLAG = FLAG+1
            %FINISH
         %FINISH
      %REPEAT
   %END
   %IF N < 0 %THEN N = -N %AND FLAG = -13 %ELSE FLAG = 1
   D=DICT(N)
   UNPACK(DICT(D-2)) %FOR D = N-D&255, 1, N-D>>11&3
%END

%ROUTINE FAULT(%INTEGER N)
      %INTEGER  ERROR POS, STREAM, SPACING
      %SWITCH FM(-1 : 24)
      STREAM = REPORT;  SELECTOUTPUT(REPORT)
      ATOM POS = DUP %IF DUP # 0
      ERROR POS = ATOM POS
      ERROR POS = 0 %IF ERROR POS = POS %AND N > 1
      FAULTY=FAULTY+1
      SPACING = MARGIN+ERROR POS+8 -2
      %CYCLE
         %IF POS > 0 %AND (LIST # 0 %OR STREAM = REPORT) %START
            WRITE(LINE NUM, 4) %AND SPACE %IF STREAM # REPORT
            %CYCLE POS = 1,1,POS
               PRINTSYMBOL('|') %IF POS = ERROR POS %AND STREAM=REPORT
               PRINTSYMBOL(LINE(POS))
            %REPEAT
            SYM=LINE(POS)
         %FINISH
         NEWLINE %IF SYM # NL
         PRINTSYMBOL('*')
         %IF STREAM = REPORT %START
            WRITE(LINE NUM, 4);  SPACE
         %ELSE
            SPACE
            %IF ERROR POS # 0 %START
               SPACES(SPACING-1);  PRINTSTRING("! ")
            %FINISH
         %FINISH
         ->FM(N)
FM(24):   PRINTSTRING("COMPILER ERROR!");  ->F
FM(20):   PRINTSTRING("TEXT TOO LONG");  ->F
FM(21):   PRINTSTRING("TOO MANY NAMES");  ->F
FM(22):   PRINTSTRING("TOO MANY LONG NAMES");  ->F
FM(23):   PRINTSTRING("PROGRAM TOO COMPLEX");  ->F
FM(18):   PRINTSTRING("ACCESS")
         FAULTY = FAULTY-1 %IF STREAM = REPORT
         ->F
FM(0):    PRINTSTRING("FORM");      ->F
FM(1):    PRINTSTRING("ATOM");      ->F
FM(2):    PRINTSTRING("TYPE");      ->F
FM(3):    PRINTSTRING("NAME");      ->F
FM(4):    PRINTSTRING("SIZE");      ->F
FM(5):    PRINTSTRING("CONTEXT");   ->F
FM(6):    PRINTSTRING("MATCH");     ->F
FM(7):    PRINTSTRING("COPY");      ->F
FM(8):    PRINTSTRING("SPEC");      ->F
FM(9):    PRINTSTRING("%END");      ->MISS
FM(10):   PRINTSTRING("%CYCLE");    ->MISS
FM(11):   PRINTSTRING("%REPEAT");   ->MISS
FM(12):   PRINTSYMBOL('"');  PRINT NAME(X); PRINTSYMBOL('"');  ->MISS
FM(13):   PRINTSTRING("%START");    ->MISS
FM(14):   PRINTSTRING("%FINISH");   ->MISS
FM(15):   PRINTSTRING("ORDER");     ->F
FM(16):   PRINTSTRING("BOUNDS");     ->F
FM(17):   PRINTSTRING("RESULT")
MISS:     PRINTSTRING(" MISSING")
F:        NEWLINE
         %EXIT %IF STREAM = LISTING
         STREAM = LISTING;  SELECTOUTPUT(LISTING)
      %REPEAT
      MARGIN = MARGIN+POS %AND SPACES(MARGIN+8) %IF SYM # NL
      POS = 0;  OUT = 0
      %SIGNAL 0,10 %IF N >= 20
%END

! ---- 'C GEN' DEPENDS ON A 32-BIT WORD ----
%ROUTINE C GEN(%INTEGER N)
      %INTEGER J, M, L
      M = N;  N = |M|
      %IF N>>16 = 0 %THEN L = 4 %ELSE L = 8
      PUT('N');  PUT(L+1+'0');  PUT(',');  PUT('Y')
      PUT( (N>>J)&15+'A' ) %FOR J = (L-1)*4, -4, 0
      PUT('U') %IF M < 0
      LIT = CODE
%END
%INTEGERFN EVAL(%INTEGER P)
   %CONSTBYTEINTEGERARRAY BASIS('V' : 'Z')=3,1,8,4,0
   %INTEGER N, J, B, S, L, MOD
   N=0
   %RESULT = DICT(-P) %IF P < 0
   L=BUFFER(P);  %RESULT=0 %IF L=0 %OR L=1
   B=BUFFER(P-1);  %RESULT=B %IF L < 0
   B=BASIS(B)
   MOD='A'; MOD=0 %IF B=8
   %CYCLE J=P-2,-1,P-L
      S=BUFFER(J)-MOD
      %IF B=0 %THEN N=N*10 %ELSE N=N<<B
      N=N+S
   %REPEAT
   %RESULT=N
%END

   %ROUTINE COMPILE BLOCK(%INTEGER LEVEL, BLOCK TYPE, %C
      %INTEGERNAME FPP)
      %INTEGER J, K, XX, COUNT, ACCESS = 0
      %INTEGER FP;                         ! START OF FORMAT
      %INTEGER FORMAT;                     ! CURRENT FORMAT POINTER
      %INTEGER A CHAIN;                    ! ARRAY CHAIN
      %INTEGER OLD LABEL
      %INTEGER APARM, OLD T BASE, OLD T LIMIT
      %OWNINTEGER SPEC=1
      OLD T BASE=T BASE
      T BASE=T MAX
      OLD T LIMIT=T LIMIT;  OLD LABEL = LABEL
      INHIBIT = INHIBIT<<1

      %ROUTINE DEF LAB(%INTEGER L)
         INHIBIT = INHIBIT!1
         PUT(':');  ADDR(L)
         ACCESS = 1
      %END
      %ROUTINE ANALYSE SS(%INTEGER CONT)
      %INTEGER CLASS;                      ! CLASS OF ATOM WANTED
      %INTEGER LIM;                        ! LOOKUP LIMIT
      %OWNINTEGER TAG=0;                   ! CURRENT VAR TAG
      %OWNINTEGER DELIM = '"'
      %OWNINTEGER QUOTE=0;                 ! TEXT MODE FLAG
      %OWNINTEGER KEY=0;                   ! SYMBOL DICT KEY

      %ROUTINE DECLARE IDEN
         %INTEGER EXTRA, FF
         %INTEGERNAME FLAG
         %IF SUBATOM#0 %START;             ! ALREADY EXISTS
            FLAG == DICT(SUBATOM)
            TAG=DICT(SUBATOM-1)
            %IF FLAG&1024#0 %START;        ! SPEC GIVEN
               %IF TAG&15=3 %START;        ! LABEL REF
                  FLAG=FLAG!!1024 %IF DECTYPE=3
                  %RETURN
               %FINISH
               %IF DECTYPE = TAG&(\128) %OR DECTYPE=1 %START;! SAME TYPE
                  %IF (7 <= TAG&15 <= 10 %AND SPEC > 0) %C
                  %OR TAG&15 = 4 %OR DECTYPE=1 %START;   ! VALID REDEFINITION
                     FLAG = FLAG!!1024;    ! REMOVE SPEC BIT
                     DECTYPE = TAG&(\128)
                     %RETURN
                  %FINISH
               %FINISH
            %FINISH
            DUP=ATOM POS %IF DUP=0
            %RETURN %IF DECTYPE=0;         ! LABEL
         %FINISH
         EXTRA=DP;                         ! APP + FORMAT
         TAG=DECTYPE
         FF=0
         %IF DECTYPE = 0 %START
            TAG = 3;  FF = 1024
         %ELSE
            FF = FF!SPREFIX<<13
         %FINISH
         %IF TAG&15 >= 7 %START;           ! APP NEEDED
            FF = FF!1024 %IF SSTYPE = 2 %AND TAG&15 <= 10
            CONST INT = 0
            %UNLESS 11#TAG&15#13 %START
               %IF SPREFIX=1 %OR SPREFIX=2 %C
               %THEN DICT(DP)=APP %ELSE %START
                  APARM=1; DICT(DP)=A CHAIN
                  A CHAIN=DP
               %FINISH
            %FINISH %ELSE DICT(DP)=0
            DP=DP+1;  FF=FF!256;           ! SET APP BIT
            FF=FF!1024 %IF SPEC < 0 %AND SPREFIX < 3
         %FINISH
         %IF TAG&X'70'=X'50' %START;       ! RECORD
            DICT(DP)=FORMAT; DP=DP+1
            FF=FF!512;                     ! SET FORMAT BIT
         %FINISH
         %IF TAG&15=6 %START;              ! SWITCH
            DICT(DP)=0
            DP=DP+1
         %FINISH
         TAG = TAG!128 %IF SPREFIX > 3 %OR PERMIN# 0
         %IF CONST INT # 0 %START
            DICT(DP) = 0;  DP = DP+1
            TAG = TAG&X'FFF0'+5
         %FINISH
         EXTRA=DP-EXTRA;                   ! 1=APP, 2=APP+FORMAT, 0=NEITH
         DICT(DP) = TAG; TYPE=TAG>>4&7
         DP=DP+1
         DICT(DP) = FF!(DP-T MAX-2)!EXTRA<<11
         SUBATOM=DP; TMAX=DP+1
         X=DP
   %END

   %ROUTINE READ SYM
      %IF SYM<32 %START
         LINE NUM = LINE NUM+1
         ATOM POS = 0;  POS = 0;  MARGIN = 0
         %IF LIST = 0 %START
            WRITE(LINE NUM, 5)
            %IF QUOTE # 0 %THEN PRINT SYMBOL('"') %ELSE %START
               PRINT SYMBOL(MARK);  MARK = ' '
            %FINISH
            SPACE
         %FINISH
         SYM TYPE=1
      %FINISH
      %CYCLE
         %CYCLE
            READSYMBOL(SYM)
            %IF SYM = PAGE %START
               LINES = 0 %AND %CONTINUE %IF QUOTE = 0
               LINES = PAGE SIZE
            %FINISH
            PRINTSYMBOL(SYM) %IF LIST = 0
            POS=POS+1 %AND LINE(POS)=SYM %UNLESS POS >= 73
            %RETURN %IF QUOTE#0
            %EXIT %IF SYM#' '
            SYM TYPE=1
         %REPEAT
         %EXIT %UNLESS SYM='%'
         SYM TYPE=2
      %REPEAT
      %IF SYM<32 %THEN SYMTYPE=0 %AND MARK='+' %ELSE %START
         SYM=SYM-32 %IF 'A'+32 <= SYM <= 'Z'+32; ! ...CONVERT LOWER CASE
         KEY=KDICT(SYM)
         SYM TYPE=KEY&3-2 %UNLESS KEY&3=0 %AND SYMTYPE=2
      %FINISH
   %END

   %ROUTINE LOOKUP(%INTEGER P)
      %INTEGER OLD, NEW, L, DISP, D, SIZE, FIRST
      COUNT=0;  SIZE = DP-TMAX+1;  FIRST = DICT(T MAX)
      %WHILE P > LIM %CYCLE
         COUNT = COUNT-1
         P=P-1
         D=DICT(P)
         DISP=D&255+2
         L=D>>11&3; OLD=P-DISP; X=P; P=OLD
         %IF SIZE+L-DISP=0 %AND DICT(OLD) = FIRST %START
            NEW=T MAX
            %CYCLE
               NEW = NEW+1;  OLD = OLD+1
               %IF NEW=DP %START;           ! FOUND IT
                  O TYPE = D>>13
                  TAG = DICT(X-1)
                  ATOM2=CMAP(TAG&15);       ! FORM -> CLASS
                  SUB ATOM=X; VAR TYPE=TAG>>4&7
                  ATOM2 = 66 %IF VARTYPE = 0 %AND ATOM2 = 68
                  ATOM1 = ATOM2 %AND SUBATOM = -OLD %IF ATOM2 = ICONST
                  %IF D&256#0 %START;       ! SET APP
                     PAPP=|DICT(OLD)|
                     %IF PAPP=0 %START
                        %IF 11 <= TAG&15 <= 12 %START
                           PAPP=PHRASE(ANAPP)
                           APARM=OLD<<3+1;  ! 1 DIMEN
                        %ELSE
                           F TYPE=8
                           %RETURN %IF SPEC < 0
                           ATOM1=0; ATOM2=0
                        %FINISH
                     %FINISH
                     OLD=OLD+1
                  %FINISH %ELSE PAPP=APP;   ! DEFAULT APP
                  FORMAT=0
                  %IF D&512#0 %START
                     %IF ATOM2=RFN %THEN FORMAT=SUBATOM %ELSE %START
                        FORMAT=DICT(DICT(OLD)-2)
                        ATOM2=ATOM2+7
                     %FINISH
                  %FINISH
                  DICT(X-1)=DICT(X-1)!128 %UNLESS SPEC < 0
                  SUBATOM=COUNT %IF LIM > T MAX
                  %RETURN
               %FINISH
               %EXIT %IF DICT(NEW) # DICT(OLD)
            %REPEAT
         %FINISH
      %REPEAT
   %END

   %ROUTINE CODE DIGIT
      %IF LIMIT=0 %START;                  ! MULTI CHAR
         DIGIT = SYM
         %IF DIGIT = '''' %START
            QUOTE = 0
            READSYM
            DIGIT = -1 %AND %RETURN %UNLESS SYM = ''''
            QUOTE = 1
         %FINISH
         READSYM
      %ELSE
         %IF '0' <= SYM <= '9' %OR 'A' <= SYM <= 'F' %START
            %IF SYM <= '9' %THEN DIGIT = SYM-'0' %C
                           %ELSE DIGIT = SYM-'A'+10
               %IF DIGIT <= LIMIT %START
                  DIGIT = DIGIT+'A'
                  READ SYM
                  %RETURN
               %FINISH
         %FINISH
         DIGIT=0;  QUOTE=0
         %IF SYM='''' %START
            %IF LIMIT # 9 %START
               DIGIT = -1;  READSYM
            %FINISH
         %FINISH
      %FINISH
   %END

   %ROUTINE CODE ATOM
      %INTEGER TP
      %ROUTINE TPUT(%INTEGER S)
         POS = 0 %IF S < 32
         FAULT(20) %IF TP = TEXT LIMIT
         TP = TP+1;  BUFFER(LITPOS-TP) = S
      %END
      %INTEGERNAME SS
      %INTEGER DTYPE, XTYPE, SRMOD, SLEN, PREFIX
      %INTEGER J, K, L, S, LP
      %CONSTBYTEINTEGERARRAY BASE SYM(1 : 4)= 'X', 'M', 'B', 'K'
      %CONSTSHORTINTEGERARRAY BASE INF(1:4)=
                                        X'590F',X'5800',X'5701',X'5607'
      %CONSTSHORTINTEGER SPS=117;          ! START OF SPEC SUB
      %CONSTBYTEINTEGERARRAY SPEC SUB(SPS : 127)=%C
                                    8,9,10,7,105,104,25,24,72,73,1
      %CONSTSHORTINTEGERARRAY P VALUE(0 : 10)=%C
                                    0,
                              X'1827'(2), X'1067', X'0127'(2),X'10A7',
                              X'00A7',X'2418',X'4418',
                              X'2218'
      %CONSTSHORTINTEGERARRAY SATOMS(1 : 12) =
!         SPEC,     NAME,     MAP,      MAPSPEC,    <NULL>,
          X'0035',  X'3835',  X'3238',  X'0032',    X'3835',
!         ARRAY     ARRAYNAME ARRAYSPEC NAMESPEC    ARRAYNAMESPEC,
          X'0033',  X'3835',  X'0033',  X'3835',    X'3835',
!         FN,       FNSPEC
          X'3238',  X'0032'

      %CONSTBYTEINTEGERARRAY SCLASS(1 : 12) =
!         SPEC,     NAME,     MAP,      MAPSPEC,    <NULL>,
          109,      2,        9,        118,        1,
!         ARRAY,    ARRAYNAME,ARRAYSPEC,NAMESPEC,   ARRAYNAMESPEC,
          11,       12,       111,      110,        112,
!         FN,       FNSPEC
          8,        117
      %CONSTINTEGER XSPS = 109
      %CONSTINTEGERARRAY XMOD(XSPS : 116) = 17,18,27,28,97,98,107,108
      LP=LIT POS
      ATOM POS=POS; LAST=ATOM1
      %IF QUOTE#0 %START;                  ! CONTINUATION OF STRING CONST
         TP=0
         TPUT(QUOTE>>8); TPUT(QUOTE&255)
         %CYCLE
            READSYM
            %IF SYM= DELIM %START
               QUOTE=0
               READSYM; %EXIT %IF SYM# DELIM
               QUOTE=1
            %FINISH
            TPUT(SYM)
         %REPEAT
         BUFFER(LIT POS)=TP
         LITPOS=LITPOS-TP-1
      %FINISH
      SLEN=0; XTYPE=0; SRMOD=0; PREFIX=0
      %CYCLE
         ATOM1=0; ATOM2=0; SUB ATOM=0; TAG=0
         ATOM1=TERMIN %AND %RETURN %IF SYMTYPE=0
         %IF SYMTYPE=-1 %START;             ! DIGIT
            %UNLESS (LAST=0 %AND OUT=0) %OR LAST=8%START
               LIMIT=9; DIGIT='Z'
NEW BASE:      ATOM1=ICONST;  ATOM2 = ICONST
               %CYCLE
                  LIT POS=LIT POS-1
                  BUFFER(LIT POS)=DIGIT
                  CODE DIGIT
                  %IF DIGIT <= 0 %START
                     %IF LIMIT = 9 %AND SYM = '.' %AND ATOM1 = ICONST %START
                        DIGIT = '.'
                        ATOM1 = RCONST;  ATOM2 = RCONST
                        LP = LP-1
                        READ SYM
                     %ELSE
                        ATOM1=0 %IF LIMIT#9 %AND DIGIT=0
                        BUFFER(LP)=LP-LITPOS
                        LIT POS=LIT POS-1
                        SUBATOM=LP
                        FAULT(23) %IF LITPOS <= 0
                        %RETURN
                     %FINISH
                  %FINISH
               %REPEAT
            %FINISH
         %FINISH
         %IF SYM TYPE < 0 %START;           ! LETTER
            DP=T MAX
            OLD SYM=SYM
! ---- THE FOLLOWING PACKING ROUTINE IS WORD-LENGTH DEPENDENT BUT CAN
!      BE MODIFIED WITH NO OTHER SIDE-EFFECTS PROVIDED COMPLEMENTARY
!      ALTERATIONS ARE MADE TO  'UNPACK'  IN ROUTINE 'PRINT NAME' ----
            %CYCLE
               SS == DICT(DP)
               SS = SYM-32
               READ SYM; %EXIT %IF SYM TYPE >= 0
               OLD SYM=0
               SS = (SS<<6) + (SYM-32)
               READ SYM;  %EXIT %IF SYM TYPE >= 0
               SS = (SS<<6) + (SYM-32)
               READ SYM;  %EXIT %IF SYM TYPE >= 0
               SS = (SS<<6) + (SYM-32)
               READ SYM;  %EXIT %IF SYM TYPE >= 0
               SS = (SS<<6) + (SYM-32)
               READ SYM;  %EXIT %IF SYM TYPE >= 0
               DP=DP+1
            %REPEAT
            %IF SYM='''' %AND OLD SYM # 0 %START
               DELIM = ''''
               %CYCLE J=1,1,4
                  %IF OLD SYM=BASE SYM(J) %START
                     QUOTE = 1
                     K=BASE INF(J)
                     DIGIT=K>>8; LIMIT=K&255
                     READSYM
                     -> NEW BASE
                  %FINISH
               %REPEAT
            %FINISH
            DP=DP+1
            FAULT(21) %IF DP >= T LIMIT
            ATOM1=IDENT; ATOM2=IDENT
            LIM=T BASE; LOOKUP(T MAX)
            %RETURN
         %FINISH
         %IF SYM='''' %OR SYM = '"' %START
            DELIM = SYM
            QUOTE=1;                        ! INTO TEXT MODE
            ATOM1=SCONST;                   ! SYMBOL, OR
            ATOM2=ICONST;                   ! STRING
            READSYM;  SUB ATOM=SYM;         ! FIRST CHAR
            QUOTE=0 %IF SUBATOM=DELIM
            READSYM
            %IF SUBATOM=DELIM %START;       ! ' ' FOUND
               %IF SYM#DELIM %START;        ! NULL SYMBOL OR STRING
                  SUB ATOM=NULL STRING; %RETURN
               %FINISH
                                          ! ' ' ' FOUND
               QUOTE=1
            READSYM;                      ! '' -> '
            %FINISH
            %IF SYM=DELIM %START;           ! FOUND DELIM %OR '?'
               QUOTE=0
               READ SYM;                    ! SKIP QUOTE
               %IF SYM#DELIM %START
                  LITPOS=LITPOS-2
                  BUFFER(LITPOS+2)=-1
                  BUFFER(LITPOS+1)=SUBATOM
                  SUBATOM=LITPOS+2
                  %RETURN
               %FINISH
            %FINISH
            QUOTE=SUBATOM<<8+SYM;           ! PRESERVE SYMBOLS
            ATOM2=SCONST;                   ! IT MUST BE A STRING
            SUBATOM=LITPOS
            %RETURN
         %FINISH
         DP=KEY>>2;                         ! INDEX INTO DICT
         READ SYM;                          ! GET NEXT SYMBOL
         %CYCLE
            S=KDICT(DP)
            %EXIT %IF S&X'4000'#0;          ! END OF LIST MARKER
            %IF S&127#SYM %OR SYMTYPE < 0 %START
               ATOM POS=POS %AND %RETURN %IF S >= 0
               DP=DP+1;                     ! ONTO ALTERNATIVE
            %ELSE
               K = S>>7&127;  READ SYM
               %IF S > 0 %START
                  %IF K # 0 %START
                     ATOM POS = POS %AND %RETURN %IF K#SYM %OR SYMTYPE<0
                     READ SYM
                  %FINISH
                  K = 1
               %FINISH
               DP = DP+K
            %FINISH
         %REPEAT
         ATOM1=S&63;                        ! PICK OFF CLASS
         SUB ATOM=S>>6&255
         %EXIT %IF ATOM1#0
         L=P VALUE(SUBATOM)
         %IF L#0 %START
            %RETURN %IF PREFIX&L&63 # 0 %OR (LAST # 0 %AND L&1 # 0)
            PREFIX=PREFIX!L>>6
            XTYPE=SUBATOM %IF SUBATOM <= 7
         %FINISH
         ATOM POS=POS
      %REPEAT;                             ! ROUND FOR ANOTHER
      ATOM2=KDICT(DP+1)&63 %IF S < 0;      ! VARIANT
      %IF ATOM1=STRING %OR ATOM1=RECORD %START
         DTYPE=ATOM1
         CODE ATOM
         %IF DTYPE=STRING %START
            ATOM1=0 %AND %RETURN %UNLESS ATOM1=ICONST
            SLEN=EVAL(SUBATOM);            ! STRING LENGTH
            %UNLESS 0 < SLEN <= TEXT LIMIT %START
               ATOM1=0; F TYPE=4
               %RETURN
            %FINISH
            SRMOD=X'40';                   ! TYPE FOR STRING
         %ELSE
            %IF ATOM2=IDENT %START
               LIM=GLOBAL; LOOKUP(T BASE)
            %FINISH
            %UNLESS ATOM2 = RFN %START
               F TYPE = 3
               ATOM1 = 0;  ATOM2 = 0
               %RETURN
            %FINISH
            SRMOD=X'50';                   ! TYPE FOR RECORD
         %FINISH
         CODE ATOM
         ATOM1=0 %AND %RETURN %IF ATOM1#RB
         %IF SYM TYPE=2 %START;            ! KEYWORD FOLLOWS
            CODE ATOM
            %IF ATOM1 # SPECIAL %AND ATOM2 # SPECIAL %START
               ATOM1 = 0;  ATOM2 = 0;  %RETURN
            %FINISH
            SUBATOM = 1 %IF SUBATOM = 127;! SPEC
         %FINISH %ELSE SUBATOM=5;          ! NULL SPECIAL
         ATOM1=0 %AND %RETURN %C
         %IF DTYPE=RECORD %AND SUBATOM >= 11
         K=SATOMS(SUBATOM)
         ATOM1=K&255; ATOM2=K>>8&255
         SUBATOM=SCLASS(SUBATOM)
      %ELSE
         %UNLESS PRE1 <= ATOM1 <= PRE2 %START
            ATOM1=0 %IF PREFIX#0
            %RETURN
         %FINISH
      %FINISH
      %IF SUBATOM >= SPS %START
         SPEC = -1;  SUBATOM = SPEC SUB(SUBATOM)
      %ELSE %IF SUBATOM >= XSPS
         %IF XTYPE # 6 %START
            ATOM1 = 0;  ATOM2 = 0;  %RETURN
         %FINISH
         XTYPE = 3;                         ! EXTRINSIC!!
         SUBATOM = XMOD(SUBATOM)
         SRMOD = SRMOD-X'10' %IF SRMOD # 0
      %FINISH
      %IF PREFIX&64#0 %START;              ! OWN DATA
         %UNLESS ATOM1 = OWN1 %OR ATOM1 = OWN2 %START;! NON-DATA
            %IF XTYPE <= 3 %START;          ! CONSTROUTINE ?
               ATOM1 = 0;  %RETURN
            %FINISH
         %ELSE
            ATOM1=ATOM1+1;                 ! ONTO '%OWN' VARIANT
            OUT=(SUB ATOM+SRMOD)>>4
            %IF SUBATOM&1 = 0  %START;     ! CONSTNAME ?
               OUT = 1;                    ! ADDRESSES ARE INTEGERS
            %ELSE
               CONST INT = 1 %IF XTYPE = 2 %C
                           %AND (SUBATOM+SRMOD)&X'70' <= X'30'
            %FINISH
            OUT = 15 %IF XTYPE = 3;        ! DON'T INITIALIZE EXTRINSICS
         %FINISH
      %FINISH
      SUBATOM=SUBATOM+LREALS %IF SUBATOM&X'70'=X'60'
      SUBATOM=SUBATOM+SLEN<<8+SRMOD+(PREFIX>>3&X'70')
      DEC TYPE=SUBATOM
      SPREFIX=XTYPE
      PREFIX=0
   %END
!*************************************************************
!* DEC TYPE: <EXT><EXTR><CONST><OWN><DYN><SYS><FLAG1><FLAG2> *
!*************************************************************
   %INTEGERFN GAPP
      %CONSTINTEGER PSEP = 129, PCALL = 130
      %INTEGER L, P, TYPE, NEXT, C
      %INTEGERFN CLASS(%INTEGER T)
         %CONSTBYTEINTEGERARRAY EXPS(0 : 7)=0,147(3),140,0,146(2)
         %CONSTBYTEINTEGERARRAY PARM MAP(0 : 15)=0,0,137,0,0,0,0,122,
                                             176,177,123,0,159,0,0,0
         %CONSTBYTEINTEGERARRAY TMOD(0:7) = 0,8(3),4,0,9,9
         TYPE = T>>4
         TYPE = TMOD(TYPE) %AND %RESULT = EXPS(T>>4) %IF T&15 = 1;! EXPRN
         TYPE = 10 %IF TYPE = 0
         %RESULT=PARM MAP(T&15);           ! CORRECT CLASS FOR NAMES
      %END
      %ROUTINE SET GCELL(%INTEGER C, GC, LEN)
         C = C<<9;  C = C+L %UNLESS GC = PCALL
         %WHILE L#GLIMIT %CYCLE
            L=L+1
            %RETURN %IF GRAM(L)=C %AND GCLASS(L) = GC %C
            %AND (TAG&X'70'#X'40' %OR GRAM(L-1)=LEN)
         %REPEAT
         %IF TAG&X'70'=X'40' %START
            GLIMIT=GLIMIT+1;  GRAM(GLIMIT)=LEN;  ! SET STRING LE
         %FINISH
         GLIMIT=GLIMIT+1; GRAM(GLIMIT)=C;  GCLASS(GLIMIT) = GC
         L=GLIMIT
         %IF DIAG&4 # 0 %START
            PRINTSTRING("SET");  WRITE(L, 3)
            WRITE(C, 3);  WRITE(GC, 3);  WRITE(LEN, 3)
            NEWLINE
         %FINISH
      %END

      %RESULT = NULL %IF TBASE=TMAX
      L = GBASE;  P = TMAX
      SET GCELL(0, PCALL, 0)
      %CYCLE
         P = P-1
         NEXT = P-DICT(P)&255-2
         TAG = DICT(P-1)
         C = CLASS(TAG&127)
         SET GCELL(TYPE, C, TAG>>8&255)
         %EXIT %IF NEXT <= TBASE
         P = NEXT
         SET GCELL(0, PSEP, 0)
      %REPEAT
      SET GCELL(0, LB, 0)
      FAULT(23) %IF GLIMIT >= GMAX
      %RESULT=L
   %END

   %ROUTINE HEX(%INTEGER N)
      %INTEGER J,K
      %CYCLE J = 1, 1, 4
         K = N>>12;  N = N<<4
         %IF K > 9 %THEN K = K-10+'A' %ELSE K = K+'0'
         PRINTSYMBOL(K)
      %REPEAT
   %END
   %ROUTINE ANALYSE(%INTEGER G)
      %SWITCH DIR(86:102)
      %INTEGER EXTEND, AMBIG, SUB LOCK, DOWN LOCK
      %INTEGER J, K, L, N, A1, NODE, NEW TYPE, T

      %ROUTINE REORDER
         %INTEGERNAME X, Y
         %INTEGER R
         K=0
         %WHILE N < 0 %CYCLE
            R=REF(N); J=CO(N)
            %IF LOC(N)&X'FF' > TRANSP %START;! DROP TRANSPARENT
               X == K;  R=R&X'6000';         ! PICK OFF ORDER
               %WHILE X#0 %CYCLE
                  Y == REF(X)
                  %EXIT %IF Y&X'6000' <= R
                  Y=Y-X'2000';               ! DECREMENT ORDERING CODE
                  X == CO(X);                ! ON DOWN THE CHAIN
               %REPEAT
               CO(N)=X; X=N
            %FINISH
            N=J
         %REPEAT
         %IF DIAG&8 # 0 %START
            PRINTSTRING("REORDER N =");  WRITE(N, 3);  NEWLINE
         %FINISH
      %END
      %ROUTINE SHOW(%INTEGER Z)
         WRITE(Z, 3)
         PRINTSTRING(" [")
         HEX(REF(Z))
         SPACE;  HEX(CO(Z))
         SPACE;  HEX(SUB(Z))
         SPACE;  HEX(LOC(Z))
         PRINTSYMBOL(']');  NEWLINE
      %END
      EXTEND=0;  SUB LOCK = 0;  DOWN LOCK = 0
      A=0; A1=0; N=0; NODE=0
      AMBIG=0
      P = RECLEN
L1:     J=GRAM(G);  K = GCLASS(G);  ->EOP %IF K = 0
      NEW TYPE = J>>9&15
      NEW TYPE = TYPE %IF NEW TYPE = 0
      %IF DIAG&1 # 0 %START
         WRITE(G, 4);  WRITE(K, 3)
         WRITE(ATOM1, 3);  WRITE(ATOM2, 3);  WRITE(SUBATOM, 3)
         WRITE(TYPE, 2);  WRITE(FORMAT, 3)
         NEWLINE
      %FINISH
      %IF K >= PHRASES %START;             ! PHRASE
         P=P+1; F TYPE=4 %AND -> ERROR %IF P=A
         REF(P)=J; CO(P)=N
         LOC(P)=TYPE<<8+K
         TYPE=NEW TYPE
         SHOW(P) %IF DIAG&8 # 0
         N=-P
         G=PHRASE(K)
         -> L1
      %FINISH
      CLASS=K
      CLASS=ATOMIC(CLASS) %IF CLASS >= EQUIVS
      ->DIR(CLASS) %IF CLASS >= DIRECTIVES
      %IF ATOM2=IDENT %AND (DEF1 <= CLASS <= DEF2 %OR  CLASS = ICONST)%START
         LIM=GLOBAL; LOOKUP(T BASE)
      %FINISH
      %IF SET1 <= CLASS <= SET2 %AND %C
                              (OTYPE#2 %OR ATOM2=68 %OR ATOM2=70) %START
         CLASS = CLASS+7;  TYPE = TAG>>4&7
      %FINISH
      NEW TYPE=TYPE
      %IF CLASS=ATOM1 %OR CLASS=ATOM2 %START
         %IF CLASS = IDENT %START
            DECLARE IDEN
            TYPE = 15 %IF NEWTYPE = 15
         %FINISH
         %IF CHECK1 <= CLASS <= CHECK2 %START
            %IF VAR TYPE#TYPE %START
               %UNLESS VARTYPE <= 3 %AND (TYPE=8 %OR TYPE=9) %START
                  %UNLESS VARTYPE >= 6 %AND TYPE=9 %START
                     %UNLESS TYPE = 10 %START
                        F TYPE = 2;  ->ALT
                     %FINISH
                  %FINISH
               %FINISH
            %FINISH
            F TYPE=0
         %FINISH
ENTRY:    A=A-1; F TYPE=4 %AND -> ERROR %IF A=P
         REF(A)=J; CO(A)=N
         LOC(A)=TYPE<<8+K
         TYPE=NEW TYPE
         SUB(A)=SUBATOM
         SHOW(A) %IF DIAG&8 # 0
         ->DONE %IF J&511 = 511;           ! END OF SS
         -> NEXT %IF AMBIG=0;              ! NOT AMBIGUOUS
         G=AMBIG; AMBIG=0; -> L1
      %FINISH
ALT:   G=G+1;  -> L1 %IF J < 0;              ! TRY ALTERNATIVE
NEXT:  %IF NODE=A1 %START;                  ! LAST NODE FOR THIS ATOM
         EXTEND=0; SUB LOCK=0;  DOWN LOCK = 0
         -> ERROR %IF NODE=A;              ! NO NEW NODES
         A1=A
         CODE ATOM %IF CLASS < DIRECTIVES; ! GET NEXT ATOM
      %FINISH
      NODE=NODE-1; N=NODE
      %IF EXTEND#0 %START
         K = LOC(N)&255
         %IF K # 0 %START
            J=REF(N)
            TYPE = LOC(N)>>8
            N=CO(N);                       ! WELL ?
            -> ENTRY
         %FINISH
      %FINISH
      -> SKIP
EOP:   REORDER
      N=-N; SUB(N)=K
SKIP:                                       ! ON DOWN CHAIN
      G=REF(N)&511; -> EOP %IF G=0
      TYPE=LOC(N)>>8
      -> L1
DIR(89):                                    ! %COLON
      -> ERROR %UNLESS ATOM1=3;            ! LOOK FOR COLON
DONE:  N=A; REORDER; SS=K
      %RETURN %IF DUP=0
      F TYPE=7
ERROR:
      QUOTE=0 %AND READSYM %WHILE NL#SYM#';'
      %IF F TYPE=0 %START
         %IF ATOM1=IDENT %AND LIM=GLOBAL %START
            F TYPE=3
         %ELSE %IF ATOM1 = 0
            FTYPE = 1
         %ELSE %IF SCONST <= ATOM1 <= RCONST
            FTYPE = 2
            FTYPE = 5 %IF TYPE = 15
         %FINISH
      %FINISH
      FAULT(F TYPE)
      QUOTE=0; SYMTYPE=0; DEC TYPE=0
      PREFIX=0; SPREFIX=0;  CONST INT = 0
      %RETURN
DIR(86):                                    ! %INT
      -> ALT %IF TYPE > 3 %AND TYPE#8;     ! NOT INTEGER
DCONT:
      G = J&511
      -> EOP %IF G=0;                      ! END OF PHRASE
      -> L1
DIR(87):                                    ! %REAL
      -> ALT %IF TYPE < 6 %OR TYPE=8 %OR TYPE = 15;! NOT REAL
      -> DCONT
DIR(88):                                    ! %STR
      -> ALT %IF TYPE#4;                   ! NOT STRING
      -> DCONT
DIR(90):                                    ! %FN
      %IF BLOCK TYPE&15 # 8 %START;        ! NOT A FUNCTION
         ->DALT %IF DIAG >= 0 %OR BLOCKTYPE&15 # 9;  ! OR A FUNNY MAP
      %FINISH
      TYPE=BLOCK TYPE>>4&7
      %IF TYPE <= 3 %THEN TYPE=8 %ELSE %START
         TYPE=9 %IF TYPE >= 6
      %FINISH
      -> DCONT
DIR(91):                                    ! %M
      -> DALT %IF BLOCK TYPE&15#9;         ! NOT A MAP
      TYPE=BLOCK TYPE>>4&7
      -> DCONT
DIR(94):                                    ! %SUB
      -> DCONT %IF SUB LOCK#0
      -> ALT %UNLESS ATOM1=U LINE
      -> ERROR %IF SYMTYPE # -2
      L=FORMAT
      CODE ATOM
      ATOM2=0
      F TYPE=8 %AND -> ERROR %IF L <= 0
      LIM=DICT(L);                         ! ONTO THE END
      LOOKUP(L);                           ! LOOK FOR SUBNAME
      F TYPE=3 %AND -> ERROR %IF ATOM2=0
                                          ! NOT FOUND
      SUB LOCK=1
      -> DCONT
DIR(95):                                    ! %APP
      -> ALT %UNLESS ATOM1=LB
      -> DCONT
DIR(97):                                    ! %SETPLUS
      PAPP = APP
      L = PHRASE(152+APARM&7)
      DICT(APARM>>3)=L %IF APARM&X'FFF8'#0
      %WHILE A CHAIN#0 %CYCLE
         T=A CHAIN; A CHAIN=DICT(T); DICT(T)=L
      %REPEAT
                                          ! SET APP FOR ARRAY
      -> DCONT
DIR(98):                                    ! %PLUS
      F TYPE=4 %AND -> ERROR %IF APARM&7=6
      APARM=APARM+1
      -> DCONT
DIR(99):                                    ! %AMBIG
      AMBIG=J&511
      -> ALT
DIR(100):                                   !  %DUMMY
         EXTEND = 1 %IF A1 # A
         A1 = A1-1;  K = 0
         ->ENTRY
DIR(101):                                   ! %LUP
      DICT(T LIMIT-2)=APARM
      DICT(T LIMIT-1)=FORMAT
      ->DCONT %UNLESS NODE = A1
      TLIMIT = TLIMIT-2;  FAULT(23) %IF T LIMIT <= T MAX
      -> DCONT
DIR(102):                                   ! %LDOWN
      ->DCONT %IF DOWN LOCK # 0
      DOWN LOCK = 1
      APARM=DICT(T LIMIT  )
      FORMAT=DICT(T LIMIT+1)
      T LIMIT = T LIMIT+2 %IF NODE = A1
      -> D CONT
DALT:  F TYPE=5;                            ! CONTEXT
      -> ALT
   %END;                                   ! OF ANALYSE
      FORMAT=0; APARM=0; RELOCATE=0
      LITPOS=400
      SS=0; DEC TYPE=0; DUP=0;  CONST INT = 0
      PREFIX=0; SPREFIX=0
      A CHAIN=0; F TYPE=0; MARK = ' '
      %IF CONT=0 %START
         MARGIN = MARGIN+POS
         %IF SYM TYPE=0 %START
            POS=0; READ SYM
         %FINISH
         ATOM1=0
         %IF SYMTYPE=0 %OR SYM='!' %START
SKIP:        READSYM %WHILE SYMTYPE#0
            %RETURN
         %FINISH
         CODE ATOM; -> SKIP %IF ATOM1=COMMENT
         STATS=STATS+1
         OP('O',LINE NUM) %IF  PERMIN = 0; ! DUMP LINE NUMBER
         %IF ATOM1 =  MCODE %AND SUBATOM = 1 %START
            CODE ATOM
            %IF ATOM2 = IDENT %START
               LIM = GLOBAL;  LOOKUP(T BASE)
            %FINISH
            FAULT(0) %IF ATOM2 # ICONST
            CGEN(EVAL(SUBATOM));  PUT('P')
            %RETURN
         %FINISH
         TYPE=0
         %IF ATOM1=IDENT %AND (SYM=':' %OR ATOM2=SWITCH) %START
            DEC TYPE=3
            SS TYPE=0; ANALYSE(PHRASE(SS0));!  LABEL
         %ELSE
            %IF DEC TYPE#0 %OR OUT#0 %START
               TYPE=OUT
               SS TYPE=1;  ANALYSE(PHRASE(SS1));! DECLARATION
            %ELSE
               SS TYPE=3;  ANALYSE(PHRASE(SS3));! STATEMENT
            %FINISH
         %FINISH
         %RETURN
      %FINISH
      CODE ATOM
      %IF CONT > 0 %START;                 ! APP
         SS TYPE=2;  ANALYSE(PHRASE(SS2)); ! FORMAL PARAMETER
         J=GAPP
         FAULT(6) %IF 0#|FPP|#J
         FPP=J*SPEC
      %ELSE;                               ! RECORDFORMAT
         FP=TMAX;                          ! REMEMBER START OF NAMES
         SS TYPE=4; ANALYSE(PHRASE(SS4))
         %IF SS#0 %AND TMAX > FP %START
            J=T LIMIT+TBASE-TMAX-1
            FAULT(21) %IF J <= TMAX
            FPP=T LIMIT-1;                 ! FILL IN FORMAT REFERENCE
            DICT(FPP)=J;                   ! END OF FORMAT
            RELOCATE=J-FP
            %CYCLE K=J,1,FPP-1
               DICT(K)=DICT(FP)
               FP=FP+1
            %REPEAT
            T LIMIT=J
         %FINISH
      %FINISH
   %END;                                   ! ANALYSE SS
   %ROUTINE COMPILE SS
      %CONSTBYTEINTEGERARRAY RCOMP(33:40)=34,33,35,36,38,37,39,40
      %CONSTBYTEINTEGERARRAY COMP(33:40)='>','<','=','#',')','(',116,107
      !  116 = LOWER CASE 'T',  107 = LOWER CASE 'K'
      %CONSTBYTEINTEGERARRAY CON OP(82 : 84)='''', 'N', 'D'
      %CONSTBYTEINTEGERARRAY OPCODE(1:10)='*','/','&','!',
                                          '%','[',']','.','\',120
      ! 120 = LOWER CASE 'X'
      %SWITCH C(1 : 130), D(50 : 57)
      %BYTEINTEGERNAME MM
      %INTEGERNAME M
      %INTEGER L, DIM, K
      %OWNINTEGER OWN DEF=0
      %OWNINTEGER BP SIZE=0
      %INTEGER CALL PENDING, PRED PENDING, PRED OP
      %INTEGER GLOBAL NOT, LOCAL NOT
      %INTEGER CLAST, CMOD, OPS, BIT, CLEVEL, DOUBLE
      %INTEGER PLAB, LOOP LAB, ULAB, CONDS, ELSE
      %INTEGER  LIT1, LIT2, STARTT
      %INTEGER NEXT, CLASS, DCLASS, LINK

      %ROUTINE AOP(%INTEGER C, A)
         PUT(C)
         %IF A < 0 %START
            A = -A;  PUT('-')
         %ELSE
            A = A//2
         %FINISH
         ADDR(A)
      %END

      %ROUTINE EXTRA(%INTEGER N)
         PUT(','); ADDR(N)
      %END

      %ROUTINE DEF(%INTEGER N)
         %INTEGER K
         N=N+RELOCATE
         AOP('$',N);  PRINT NAME(-N)
         K=DICT(N-1)
         EXTRA(K&127);                     ! TYPE!FORM
         EXTRA(K>>8&255);                  ! MAX STRING LENGTH
         EXTRA(DICT(N)>>13&7);             ! OTYPE
                                          ! RECORD
         AOP(',',DICT(N-2)) %IF K&X'70'=X'50' %AND K&127#84
      %END

      %ROUTINE CALL
         %INTEGER P
         CALL PENDING = 1
         AOP('@',X)
         P = X
         P = P-1 %IF DICT(X)&512 # 0
         %IF |DICT(P-2)| = NULL %START
            PUT('E');  CALL PENDING = 0
         %ELSE
            PRED PENDING = PRED PENDING<<1
         %FINISH
      %END
      %ROUTINE SET SIZE
         BP SIZE=LIT1-LIT2+1
         %IF BPSIZE <= 0 %START
            ATOM POS=0; FAULT(4)
            BP SIZE=1
         %FINISH
         PUT('B'+32);  ADDR(BP SIZE)
      %END

      %ROUTINE POP LAB(%INTEGER MODE)
         %INTEGER L
         %IF LABEL > OLD LABEL %START
            L = LAB INF(LABEL>>2)
            %IF (L!!MODE)&1 # 0 %START
               LABEL = LABEL-4;  P LAB = LABEL
               EILAB = PLAB+1 %IF L&4 # 0
               P LAB = P LAB+1 %IF L&3 = 3
               PLAB = 0 %IF L&8 = 0;        ! NO EXIT CONDITION
               %RETURN
            %FINISH
         %FINISH
         %IF MODE = 0 %THEN MODE = 13 %ELSE MODE = 10
         FAULT(MODE);  ACCESS = 1
      %END

      %ROUTINE C END
         %INTEGER L, T,LIM, FLAG
         %IF X=88 %START;                  ! ENDOFPERM
            STATS=0; LINE NUM=0
            LIST=LIST&1; DEC TYPE=0
            SELECTINPUT(PROG);             ! ONTO SOURCE PROGRAM
            PERMIN = 0;                    ! SHOW NOT IN PERM
            %RETURN
         %FINISH
         ATOM POS = 0;  FLAG = SYM
         %IF LEVEL = 1 %AND X # EOP %AND FILE = 2 %START
            DEC TYPE = EOP;  FAULT(5)
         %FINISH
         LIM = T BASE
         %IF X=EOP %OR X=EOF %START;       ! EOP
            X = X-EOF;    ! EOF -> 0,  EOP -> L1
            FAULT(5) %UNLESS X = LEVEL
            PUT(';')
            %WHILE LEVEL > 1 %CYCLE
               FAULT(9)
               LEVEL=LEVEL-1
            %REPEAT
            LIM = GLOBAL;                  ! GIVE UNUSED FOR GLOBALS
         %ELSE
            FAULT(5) %IF LEVEL <= 1 %AND FILE = 2
            PUT(';')
         %FINISH
         %WHILE LABEL > OLD LABEL %CYCLE
            L=LABINF(LABEL>>2)
            %IF L&7=2 %THEN L=11 %ELSE L=14
            LABEL=LABEL-4
            FAULT(L)
         %REPEAT
         FAULT(17) %IF ACCESS # 0 %AND 8 <= BLOCKTYPE&15 <= 10
         X=T MAX-1
         %WHILE X > LIM %CYCLE
            T=DICT(X)
            %IF DICT(X-1)&128=0=LIST %AND T&X'400' = 0  %START
               %IF CONTROL&X'1000' = 0 %START
                  %IF FLAG # NL %START
                     MARGIN = MARGIN+POS
                     NEWLINE
                     FLAG = 0
                  %FINISH
                  PRINTSTRING("? ")
                  PRINT NAME(X)
                  PRINTSTRING(" UNUSED
")
               %FINISH
            %FINISH
            FAULT(12) %IF T&X'400'#0
            X=X-T&255-3
         %REPEAT
         printsymbol(11)
         SPACES(MARGIN+8) %IF FLAG = 0
      %END
      FAULT(24) %IF LABEL < 4 %OR LABEL > MAX LAB<<2
      %IF ACCESS = 0 %AND SSTYPE = 3 %AND 33 # LOC(-1)&255 # 34 %START
         FAULT(18) %IF CONTROL&X'1000' = 0;  ACCESS = 1
      %FINISH
      CONDS=0; DIM=0;  PRED PENDING = 0;  PRED OP = 0
      STARTT=0;                            ! DEFAULT TO CYCLE
      PLAB=0; ULAB=0; LOOP LAB=0;  ELSE = 0;  EILAB = 0
      LIT1=0; LIT2=0
      NEXT=SS; LINK=0
      LIT=0
      DCLASS = 0
TOP:   %CYCLE
         X=SUB(NEXT)
         %EXIT %UNLESS X < 0 %AND NEXT <= P
         %IF CO(NEXT)#0 %START
            SUB(NEXT)=LINK; LINK=NEXT
         %FINISH
         NEXT=X
      %REPEAT
      CLASS=LOC(NEXT)&255
      %IF DIAG&2 # 0 %START
         PRINTSTRING("C =");  WRITE(CLASS, 3)
         PRINTSTRING("  X =");  WRITE(X, 3)
         PRINTSTRING("  NEXT =");  WRITE(NEXT, 3)
         NEWLINE
      %FINISH
      NEXT=CO(NEXT)
      -> C(X) %IF CLASS < PRE1
      -> CONT %IF CLASS=APPEP
      -> C(CLASS) %UNLESS CLASS=IDENT
      -> D(DCLASS)
ACONT: ACCESS = 0
C(112):                                     ! %AND (UI)
CONT:  %CYCLE
         ->TOP %IF NEXT#0
         ->RETURN %IF LINK=0
         NEXT=CO(LINK); LINK=SUB(LINK)
      %REPEAT
C(9):                                       ! '\'
      %IF CLASS = 45 %START;! LOGICAL NOT
         LIT1=\LIT1 %AND LIT = LIT+1 %IF LIT=CODE
      %ELSE
         X = 10
      %FINISH
C(1):                                       ! '*'
C(2):                                       ! '/'
C(3):                                       ! '&'
C(4):                                       ! '!'
C(5):                                       ! '!!'
C(6):                                       ! '<<'
C(7):                                       ! '>>'
C(8):                                       ! '.'
      PUT(OPCODE(X)); -> CONT
C(46):PUT('Q');  ->CONT;!    REAL DIVIDE
C(10): PUT('M');  -> ACONT;                  ! %RESULT==
C(11): PUT('+') %UNLESS CLASS=44;           ! UNARY PLUS
      -> CONT
C(12): %IF CLASS#43 %THEN PUT('-') %ELSE %START
         LIT1=-LIT1 %AND LIT = LIT+1 %IF LIT=CODE
         PUT('U')
      %FINISH
      -> CONT
C(13): PUT('X');  ->CONT;                   ! \\
C(14): PUT('Y'+32);  DIAG = LIT1;  -> CONT;    ! DIAG
C(15): PUT('Z'+32);  CONTROL = LIT1;  -> CONT; ! CONTROL
C(16): PUT('V');  -> ACONT;                 ! %RESULT=
C(17): %IF BLOCKTYPE # 7 %START
          FAULT(5) %UNLESS DIAG < 0 %AND BLOCKTYPE&15 = 8
       %FINISH
       PUT('R');  -> ACONT;                 ! RETURN
C(18): PUT('T');  -> PREDT;                 ! TRUE
C(19): PUT('K');                            ! FALSE
PREDT: FAULT(5) %UNLESS BLOCKTYPE = 10
       ->ACONT
C(20): PUT(101);  -> ACONT;                 ! %SIGNAL
C(44):LIT2 = 0;                             ! %ON %EVENT
      FAULT(15) %IF INHIBIT&1 # 0
      INHIBIT = INHIBIT!1
      %CYCLE
         %EXIT %IF NEXT = 0
         X = SUB(NEXT)
         %EXIT %IF (X < 0 %AND NEXT <= P) %OR LOC(NEXT)&255 # ICONST
         NEXT = CO(NEXT)
         LIT1 = EVAL(X)
         FAULT(16) %AND LIT1 = 0 %UNLESS 0 <= LIT1 <= 15
         LIT2 = LIT2!(1<<LIT1)
      %REPEAT
      FAULT(16) %IF LIT2 = 0
      STARTT = 1+8
      OP(111, LIT2);  OP(',', LABEL)
      ->CONT
C(21): PUT('S'+32);  -> ACONT;                 ! %STOP
C(22): LIST=LIST&2;  -> CONT;               ! %LIST
C(23): LIST=LIST!1;  -> CONT;               ! %ENDOFLIST
C(24): LREALS=16;  -> CONT;                 ! %REALSLONG
C(25): LREALS=0;  -> CONT;                  ! %REALSNORMAL
C(109):PUT('S');  -> CONT;                  ! 'EQ'
C(45): PUT('Z');  -> CONT;                  ! EQEQ
C(26):                                      ! EXIT
C(27):                                      ! CONTINUE
      L=LABEL
      %WHILE L > OLD LABEL %CYCLE
         %IF LABINF(L>>2)&7=2 %START;! CYCLE FOUND
            %IF X = 26 %START
               MM == LABINF(L>>2)
               MM = MM!8
               L = L-2;  X = 'F'
            %ELSE
               X = 113
            %FINISH
            OP(X,L-2)
            -> ACONT
         %FINISH
         L=L-4
      %REPEAT
      FAULT(10);  ->CONT
C(31): ULAB=LABEL+3;  OP(117,ULAB);         ! UNTIL
C(30): LOOP LAB=LABEL+2;  DEF LAB(LOOP LAB);! WHILE
C(28):                                      ! IF
C(29):                                      ! UNLESS
      EILAB = PLAB %IF ELSE # 0
      INHIBIT = INHIBIT!1
      CONDS=1; DOUBLE=0
      STARTT=(X-26)>>1+8
      GLOBAL NOT=0; C LAST=1
      CMOD=0; CLEVEL=1; OPS=1
      LOCAL NOT=X&1; P LAB=LABEL
      CNEST(0)=P LAB; CNEST(1)=P LAB
      -> CONT
C(32): LOCAL NOT=LOCAL NOT!!1;  -> CONT;    ! %NOT
C(79):
      CALL;                                ! P
      PRED OP = 4
      ->PAC %IF CALL PENDING = 0
      PRED PENDING = PRED PENDING!2
      ->CONT
C(108): PUT('C');                           ! ACOMP
PAC:   X=35;                                ! '='
      CONDS = CONDS-1
      -> COP
C(33):                                      ! <
C(34):                                      ! >
C(35):                                      ! =
C(36):                                      ! #
C(37):                                      ! <=
C(38):                                      ! >=
      CONDS=CONDS-1
      %IF NEXT#0    %START;                ! DOUBLE SIDED
         PUT(126);                         ! SHOW DOUBLE SIDED
         DOUBLE=1;  BIT=1;                 ! PSEUDO %AND
         -> ANDOP
      %FINISH
      %IF DOUBLE # 0 %START
         DOUBLE = 0;  X = RCOMP(X)
      %FINISH
      PUT('?')
COP:  LOCAL NOT=(LOCAL NOT!!GLOBAL NOT)&1
      X=X!!7 %IF LOCAL NOT#0
      %IF CLAST#0 %START
         X=X!!7 %IF OPS&1#0
         OP(COMP(X+PRED OP),CNEST(CLEVEL))
      %ELSE
         %WHILE CMOD&1#0 %CYCLE
            CMOD=CMOD>>1; OPS=OPS>>1
            CLEVEL=CLEVEL-1
            GLOBAL NOT=GLOBAL NOT>>1
         %REPEAT
         CMOD=CMOD>>1; OPS=OPS>>1; CLEVEL=CLEVEL-1
         GLOBAL NOT=GLOBAL NOT>>1
         X=X!!7 %IF OPS&1#0
         OP(COMP(X+PRED OP),CNEST(CLEVEL))
         DEF LAB(LABEL) %UNLESS LABEL=CNEST(CLEVEL)
         LABEL=CNEST(CLEVEL)
      %FINISH
      CLAST=0; LOCAL NOT=0;  PRED OP = 0
      DEF LAB(ULAB) %IF CONDS <= 0 %AND ULAB#0
      PUT('"') %IF DOUBLE # 0
      -> CONT
C(39):                                      ! AND
C(40):                                      ! OR
      BIT=X&1;                             ! 1=AND, 0=OR
ANDOP: CONDS=CONDS+1
      LOCAL NOT=(LOCAL NOT!!GLOBAL NOT)&1
      BIT=BIT!!LOCAL NOT
      %IF BIT=OPS&1 %START
         %IF CLAST#0 %START
            CMOD=CMOD<<1
            CNEST(CLEVEL+1)=CNEST(CLEVEL)
            CLEVEL=CLEVEL+1
            OPS=OPS<<1!BIT
            GLOBAL NOT=GLOBAL NOT<<1!LOCAL NOT
         %FINISH
      %ELSE
         CMOD=CMOD<<1
         %IF CLAST#0 %START
            LABEL=LABEL+4
            CLEVEL=CLEVEL+1; CNEST(CLEVEL)=LABEL
         %ELSE
            CMOD=CMOD!1
            %IF OPS>>1&1 = BIT %START
               L = CNEST(CLEVEL-1)
            %ELSE
               LABEL=LABEL+4; L=LABEL
            %FINISH
            CLEVEL=CLEVEL+1; CNEST(CLEVEL)=L
         %FINISH
         OPS=OPS<<1!BIT
         GLOBAL NOT=GLOBAL NOT<<1!LOCAL NOT
      %FINISH
      CLAST=1; LOCAL NOT=0
      -> CONT %IF DOUBLE=0
      -> COP;                              ! REJOIN CONDITIONS
C(119):                                     ! STARTT
      STARTT = 2 %AND DEF LAB(LABEL+2) %IF STARTT = 0
      LABEL = LABEL+4
      FAULT(23) %IF LABEL>>2 > MAX LAB
      LABINF(LABEL>>2) = STARTT+ELSE
      LOOP LAB = 0;  P LAB = 0;            ! LABEL NO LONGER PENDING
      ELSE = 0;  EILAB = 0
      ->CONT
C(41): OP('B',LABEL-2);                     ! REPEAT
      ACCESS = 0
C(42): POP LAB(X&1);  ->CONT;               ! FINISH
C(43):                                      ! ELSE
      POP LAB(0) %IF P LAB = 0;            ! (FINISH) ELSE ...
      FAULT(5) %AND -> RETURN %IF PLAB&1#0
      OP('F',PLAB+1) %UNLESS ACCESS = 0
      DEF LAB(PLAB)
      PLAB=PLAB+1
      STARTT=3+8;                          ! SHOW ELSE
      ELSE = 4
      -> CONT
C(54): OWN DEF=0;  OUT=0;                   ! OWNVTYPE
C(51):                                      ! ATYPE
C(52):                                      ! OWN ATYPE
C(53):                                      ! VTYPE
C(56):                                      ! TYPE
      FAULT(15) %IF INHIBIT&1 # 0 %AND SPEC > 0
C(50):                                      ! RTYPE
C(57):                                      ! SWITCH
      DCLASS=CLASS; -> CONT
C(60):                                      ! VSET
C(61):                                      ! NSET
C(67):                                      ! V
C(68):                                      ! N
C(74):                                      ! RECV
C(75):                                      ! RECN
C(122):                                     ! RTP
C(123):                                     ! PP
C(124):                                     ! FNP
C(125):                                     ! MP
C(77):                                      ! RECAN
C(63):                                      ! ANSET
C(70):                                      ! AN
C(62):                                      ! ASET
C(69):                                      ! A
C(76):                                      ! RECA
      AOP('@', X);  ->CONT
C(65):                                      ! RFN
C(66):                                      ! AFN
      -> CONT
C(71):                                      ! M
C(72):                                      ! F
C(73):                                      ! RT
C(78):                                      ! RECORDMAP
C(64):                                      ! MSET
      CALL;  -> CONT
C(83): LIT2=LIT1;  LIT1=EVAL(X);            ! 'ICONST'
      CGEN(LIT1) %AND ->CONT %IF X < 0
C(82):                                      ! SCONST
C(84):                                      ! 'RCONST'
      L=BUFFER(X)
      %IF L <= 0 %AND CLASS=ICONST %START; ! SYMBOL
         OP('N',3); L=BUFFER(X-1)
         PUT(','); PUT('Z')
         X=L//10
         PUT(X+'A')
         PUT(L-X*10+'A')
      %ELSE
         L=|L|
         OP(CONOP(CLASS),L)
         %IF L > 0 %START
            PUT(',')
            %CYCLE X=X-1,-1,X-L
               PUT(BUFFER(X))
            %REPEAT
         %FINISH
      %FINISH
      LIT=CODE
      -> CONT
C(105):PUT('.');  -> CONT;                  ! '.'
C(106):PUT('V'+32); -> CONT
C(126):PUT('F'+32);                            ! COM
      STARTT=2+8;                          ! PSEUDO %CYCLE
      P LAB=LABEL; LOOP LAB=P LAB+2
      DEF LAB(LOOP LAB)
      -> CONT
C(113):                                     ! BSEP
      %IF SPREFIX=0 %THEN DIM=DIM+1 %ELSE SET SIZE
      -> CONT
C(116): AOP('L',X)
      ACCESS = 1
      INHIBIT = INHIBIT!1; -> CONT
C(80): INHIBIT = INHIBIT!1;         ! SWITCH
      AOP('W',X);  ->ACONT
C(114):INHIBIT = INHIBIT!1;        ! SLAB
      ACCESS = 1
      AOP('_',X)
      L=DICT(X-2);                         ! POINTER TO TABLE
      K=DICT(L);                           ! LOWER BOUND
      FAULT(16) %AND ->CONT  %UNLESS K <= LIT1 <= DICT(L-1)
      K=LIT1-K
      L=L-K>>4;                            ! ENTRY POINT
      K=1<<(K&15);                         ! REQUISITE BIT
      M == DICT(L-2)
      FAULT(7) %IF M&K#0
      M = M!K
      -> CONT
C(81): INHIBIT = INHIBIT!1;         ! 'BL'
C(115): AOP('J',X);  -> ACONT;               ! 'FL'
C(128):LIT1 = BPSIZE %IF LIT1 = 0
      BPSIZE=BP SIZE-LIT1+1;               ! ORB
      -> OF %IF LIT1 <= 0
      -> CONT
C(129):PUT('P'+32);  ->CONT;                   ! PSEP
C(130):PUT('P'+32);  PUT('E')
      PRED PENDING = PRED PENDING>>1
      PRED PENDING = PRED PENDING-1 %AND ->PAC %IF PRED PENDING&1 # 0
      ->CONT
C(107): PUT('I'+32);  ->CONT;                  ! ASSEP
C(118): %IF DCLASS#54 %START;               ! OSEP
         BP SIZE=BP SIZE-1
         %IF BP SIZE <= 0 %START
OF:          ATOM POS=0; FAULT(16)
            OUT=0
            -> RETURN
         %FINISH
      %FINISH
OSEP:  PUT('A')
      EXTRA(OWN DEF) %IF OWN DEF > 1
      OWN DEF=0;  LIT1 = 0
      -> CONT
C(117): BP SIZE=BP SIZE-1 %IF OUT#0;        ! OWNT
      OUT=0
      -> OSEP %IF BP SIZE=0
      BP SIZE=0
      -> OF %IF BUFFER(BPT)='A' %OR LIT = CODE
      PUT('I');                            ! INDICATE CLEAR
      -> CONT
C(110):                                     ! LRB
C(111):                                     ! RRB
      -> CONT
C(127):PUT('A'+32);  -> CONT
D(54): OWN DEF=OWN DEF+1;                   ! OWNVTYPE
      DICT(X-2) = LIT1 %IF CONST INT # 0
      -> DDD
D(57):                                      ! SWITCH
      %IF LIT=CODE %THEN %START;           ! SWITCH DEF
         PUT('W'+32)
         DICT(X-2)=T LIMIT-1
         DICT(TLIMIT-1)=LIT2;              ! LOWER BOUND
         DICT(TLIMIT-2)=LIT1;              ! UPPER BOUND
         %IF LIT1 < LIT2 %START;           ! BOUNDS INSIDE-OUT
            ATOM POS=0; FAULT(4)
            LIT1=LIT2
         %FINISH
         K=LIT1-LIT2+1
         K=(K+15)>>4;                      ! ENTRIES NEEDED
         TLIMIT=TLIMIT-K-3
         FAULT(23) %IF T LIMIT <= TMAX
         DICT(L)=0 %FOR L = TLIMIT,1,TLIMIT+K
      %FINISH
D(50):                                      ! RTYPE
      OP('F',0) %IF DCLASS=50 %AND DEC TYPE#84 %AND SPEC >= 0 %C
                              %AND LEVEL # 0
                                          ! JUMP ROUND ROUTINE
D(56):                                      ! TYPE
D(53):                                      ! VTYPE
DDD:   DEF(X)
      -> CONT
D(51):                                      ! ARRAY DEC
      %IF DIM#0 %START;                    ! SET UP DOPE VECTOR
         OP('D'+32, DIM);  DIM = 0
      %FINISH
      DEF(X);  PUT('H'+32)
      PUT('C'+32) %IF DICT(X-1)&15#13;        ! NO SPACE FOR FORMATS
      -> CONT
D(52): DEF(X);  OUT=TYPE;                   ! OWNARRAY
      BPSIZE = 1 %IF TYPE = 15;            ! EXTRINSICS
      ->CONT
C(49):                                      ! BEGEND
      %IF X=15 %THEN PUT('H') %AND XX=NULL STRING %ELSE C END
RETURN:
                                          !
                                          ! DEAL WITH LABELS
                                          !
      OP('B',LOOP LAB) %IF LOOP LAB#0
      DEF LAB(EILAB) %IF EILAB # 0 %AND EILAB # PLAB
      DEF LAB(P LAB) %IF P LAB#0
   %END;                                   ! OF COMPILE SS
   %IF BLOCK TYPE=0 %START;                ! RECORD FORMAT
      ANALYSE SS(-1)
      XX=X-2
      OP('G', 2)
      COMPILE SS %IF SS#0
      OP('G',2);                           ! FORMAT END
      -> L9
   %FINISH
   %IF BLOCKTYPE&15#15 %START;             ! NOT BEGIN
      ANALYSE SS(1);                       ! FORMAL PARAMETERS
      %IF SPEC < 0 %THEN K = 0 %ELSE K = 1
      OP('G', K)
      COMPILE SS %IF SS # 0
      OP('G', K)
      -> L9 %IF K = 0
   %FINISH
   ACCESS = 1
   %CYCLE
      ANALYSE SS(0)
      XX=X-2
      COMPILE SS %IF SS#0
      COMPILE BLOCK(0,0,DICT(XX)) %IF DEC TYPE=84
      %EXIT %IF DECTYPE=85 %OR DEC TYPE=EOP %C
      %OR DEC TYPE=EOF
      %IF 7 <= DECTYPE&15 <= 10 %OR DECTYPE=15 %START
         XX=XX-1 %IF DECTYPE&X'70'=X'50';  ! RECORDMAPS
         %IF LEVEL = 0 %AND DECTYPE = 15 %START
            %IF FILE = 0 %THEN FILE = 2 %ELSE FAULT(5)
         %FINISH
         %IF SPEC > 0 %AND SPREFIX > 3 %AND SPREFIX # 7 %START
            %IF LEVEL # 0 %THEN FAULT(15) %ELSE FILE = 1
         %FINISH
         COMPILE BLOCK(LEVEL+1,DECTYPE,DICT(XX))
         POS=0 %AND %EXIT %C
         %IF DEC TYPE=EOP %OR DEC TYPE=EOF;! PREMATURE END
         %FINISH
   %REPEAT
! POINT TO JUMP ROUND ROUTINE
   DEF LAB(0) %UNLESS BLOCK TYPE=15 %OR LEVEL = 0
L9:  SPEC=1; TMAX=T BASE; T BASE=OLD T BASE
   LABEL = OLD LABEL
   T LIMIT=OLD T LIMIT %IF BLOCK TYPE#0
   INHIBIT = INHIBIT>>1
%END;                                       ! COMPILE BLOCK

%ROUTINE  SUMMARISE(%INTEGER STREAM)
   SELECT OUTPUT(STREAM)
   %IF FAULTY = 0 %START
      WRITE(STATS,5);  PRINT STRING(" STATEMENTS COMPILED
")
   %ELSE
      PRINT STRING("PROGRAM CONTAINS");  WRITE(FAULTY,1)
      PRINT STRING(" FAULT");  PRINT SYMBOL('S') %IF FAULTY # 1
      NEWLINE
   %FINISH
   CLOSE OUTPUT;        !  TO ENSURE BUFFER FLUSHING
%END

!!!!!   COMREG(0) = -1;      !IN CASE IT BOMBS OUT
   SELECTOUTPUT(LISTING);  SELECT INPUT(PRIM)

   NEWLINE;  SPACES(5)
   PRINT STRING("EDINBURGH C.S. IMP COMPILER  VERSION ")
   PRINT STRING(VERSION)
   NEWLINES(2)

   control = 0;      ! **** optimise only:  for supervisor maintenance
   {CONTROL = COMREG(14)};  CGEN(CONTROL);  PUT('Z'+32)
   LIST = 2
   CODE=0
   LREALS=0;                                ! REALSNORMAL
   FAULTY=0
   OUT = 0
   SYMTYPE=0; PAPP == PHRASE(APPEP);  APP = PAPP
   STATS=0; LINE NUM=0
   BUFFER(NULL STRING)=0
   T LIMIT=DICT END-1; G LIMIT=GBASE; LABEL=4
   T MAX=GLOBAL; T BASE=GLOBAL
   X=0; ATOM1=0; LAST=0;  INHIBIT = 0
   COMPILE BLOCK(0,15,DICT(TLIMIT));        ! COMPILE A BEGIN TO START
   PUT(';')
   PUT(4);                                  ! TO TERMINATE
   SEND;                                    ! CLEAR THE BUFFER
   SUMMARISE(LISTING)
!!!!   COMREG(0) = -FAULTY
!!!!   COMREG(0) = STATS %IF COMREG(0) = 0
   %signal 15,1 %if faulty # 0
%ENDOFPROGRAM
 H?    f                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     : C!         9xt	}(  0        	  (      NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z      )+,/259;=?HK/1=?ACEGIKMOQSUWY[]_acegikmoqs   x" A  a  a 
  !  !   "    !    " a A  a a   0a   #! a  aABA   A  C !!!!!  A!!!!!!!!!!!!!!!    ! A! A <  "AA   
  # a!A!!A   ! a   #  aA a bA  D   a A  ! A aa a  Aa! !  3  ^!     ab  d  a    a A  a AA!   "A!  aa A   a A A ! a    a c B B A ,  !    a Aa b A A   A C  a a      A   ҂! A  a" A  a b  A!"! !    A     A AA    C C   A A aAAA!  A   a!! A BB A  B! A a     A   a B  a A  !a  C!   B  B !  A!   B bb A  ! Aa    A  A A   B  A "  a  B  A A A baA AA! C     a!Ba   A   a ACA! A  a     a      a A  A    ܃!   !a a A  A a   " A  	    a   A  A    1   AAA   9!  A    A A a B A!"B  a ABaA  a  bA aa     A"   Aa C A A! B!! b  a  a! aC a   B a B B! B     B!  B !!  A aaa ab a B! B!  B B  B Ba  B ! B  aaA A a   !        aa! ba a A "A B a! a A  ! B A   A A !aA   ;  G! A a! !   
  Q!   U" A    a" a   !    m! !  b 	  v"A   c!    " A  a b   a     a  ! a A A a  A! aa     b   A A  2  2!! AA  A B"  A !!!   c BA ! j  a AA  A   b    A  aAaa  AA a A AA       a !  B  A a# A  !A AB A a  A    G     B  ! A AA   A! a A C  !    A    A  !"B  B! !   A! ab!!   a a A C F cAa A A   A!  A    a! a B A a!A a!   ! AAA   A   A   !  a C   Aa a  A  C A   B !A   AE  B  A A  BEa4  " g  M   a    B  aA b a !BBa Ba    ,  {!  " A!     @a"e!a    a  a a A A A a a  a A c "    dQ@    D"Z 	w      ,>   	g\       W   	p     W   ,   `@           @           ,>   0W   4   fZM   W   ,    0'a+ %N      W   ,""``   0yu 4yA6+   W     W   ,>   0Q@   4K    "K      d    ,W   0>   4   8v   <K    @S   !K*     K    	K: !p ,#p 0&p   4'a+ qIQ@   MgH     d    ,_   0X_   4K    8{d  <    @xB@ D&y %-<   }      v   	|_   ,   0y   49dȁ 89dȁ <y^` @xW Df'  H>   LD   PK    Tv   XM   5y     }    	w,=L       ,8   ,K   +d      ,K    0d    4@ 8X`}  <   2       W   ,>   0D   qWq%p   ,    0@   4p   x        	qN@   +   ,#!t 0J9X 4z
M[D   8oYox   <>   @D   DK    HW   L
   PY@ TX_@   X}    ?qN"K   &}  ,y 0Lu  h}/  l:Hpm}ȁtE   !           @   #p     W   	       W   ,D   K      ,d    	wxB@   fhK*     S@ ,K          ,K    0}    4Lu   8'a+ %et"K  Š ,SH   0Q@   4K    8u   <D  af΁<U @MX)X DfX)X Hfh L-Y   PM[.`   Ty X  \`S   `   dT hme le pMge   t! x& |!3@ L|  L|@ ys X`}  y 	K LvD %et^C K!   o   ,(   0>   4D   8   <-Z @"K D(    H'Q| L P_K*!    Tr X_}Qw   \_~R  dyE MzQz;=   yu 	ox    dRi+&K     QzD&@ \L{}  `M3 dy@ hLv"8 lLv!Q@   pL|   tL|fk xLu;` |o;` _z K*!     z   	oU 	oU z
	oQ@   K;}  y̞ z@   @ @  fk   	oSv   X   a   f'  yR 9    &yZ   `d ˀ@   y   @  d   %N9(dȁ-R~R	 }Qw   $qT^9}  (  ƀ,d8d 0 XQz-64:x8}    %EDINBURGH C.S. IMP COMPILER  VERSION  FAULT PROGRAM CONTAINS  STATEMENTS COMPILED
  NEXT =   X =C = UNUSED
 ?   2 9&F&h&&`%  &`%  17Dio{IOYcizz 4 e e e e e e!!"""t+    &#*####  ##*    #2#2#2#2#>#<#<#2#2#2#2#>#>#>#2#2#2#2#> >$I$#[#B#[                                        $$% Tn%{%{$#$[$$5%L%"    #2#2#2#2$%}$$% */&!%[].\xX9         
   'ND       R   T   ><=#)(tk      !   (   "!#$&%'(      !   (     [ REORDER N = V fIbs~      ]r|SET  		                   z{                                               a   b   k   l      m   t   m	vonpu             58528 285 385 3858528 2              ''g'' $D".          
   	
ihHI       u      YX WV            XMBK                    V   Z    MISSING RESULT BOUNDS ORDER%FINISH%START %REPEAT%CYCLE %END SPEC COPY MATCHCONTEXTSIZE NAME TYPE ATOM FORM ACCESS PROGRAM TOO COMPLEXTOO MANY LONG NAMESTOO MANY NAMES TEXT TOO LONGCOMPILER ERROR!!      )2;QZclt           I             
               CDQASPIHGOEFB                     '+/?C          ORWk{  Hl  <  (@h    @    O  g                            k  	A'AgI.@@@f@iB@(C+@T΁/K@@@<=HnInAHKT=>HAIN)R,NSA" CB7& ESA" CB DIނE*Y EB $ NC񊊂O!"@
 N TI' LC* EF T@"*N@@ 'Y&!A@#'"CL΄ X"'R&AA TF'E T@ DOUq FƄ P')G&U&V1) TE&I EU"JɁ)O@SB" CC7$$SJ) EDךF*N#)EAFM΁uDx" C[x& EĵD" C[(ArFx" C^ N2F8" C_2)R,NSF" C[& E5G8" C\8GI'O GB*SE(AS@" CA7*OH "́@" CBw΁'W@@JK"$ "ԁ²B" C]&AE*$"΁A" C^2CPS*'RDW&Uԁ=DB  TJa)O D'&*AU2T Lƌ͈NuXx̂N" C\x)O  LFp'O GF0& EصX" C\(ArZx" C^r N2Z8" C^)R,NSZ" C\& E5[8" C]8șɗЄԂ)" MA *I$CAO$#Ύ(Ƃ "еP(ArRx" C_ N2R8" C]r)R, "5S8P PEW*R@!_'G&AE)O TB@H* ED'E@ NL$ LG) SG\$"GeBmCdI.@A	                                       	noP;;;+IOHG      i                  4.12 
   t)o?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nX# Y !Y !&\ Z  B!$$A> З  $1$H  H X [ &B0P  [ ,&' ?P  
*&30H  P  ї  C Kї  $$A> 
Y  #%$$A> 
qPr  PB &(pX  ?$PS?PE   &T 41I2 !,K2  !
3s3B  #9
3
>!$$A> !$$A> A>  ?&?$$A> O$$A> ?$$A> "#:  ! ?$$A> ?$$A> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$ ?$$A> - w A , X X=!$y XH tL	4!` AXX\UB0n$bW   lXmPi 4$0$!AP9 ,C .&1P9 ,P9 0=A Ha  W   <X9 ,U9 0AU9 4B0P 0$aW   l$PC ` ^	g A , X X=&1P=XM@ G##AX]&QP]=A Xi @a  fAy  +	g A , X 6#  $J$P9 ,3#4cAXY ,$jFAX9 5c 0Aby  )	W  A , X ABXi  Ay  	g A , X 0 '6P: ,P: 8#AJX   İ ?P 4C0:Ȼ  P 4XI 0LDC0$#kA#kW   <XY 0\&QPY 0X: ,U: 8A3B0P 8z  J
g A , X X9 #$0[9 P9 %P 0#$P 08 <A XA  LPI ,K@ XY ,P Xi dPi 8X '$!AP ,C .&P ,P 48 <A Xa  lAX ,U 4AU 8B0P 4y  ^	g A , X $3P9 0cW   lX #3P X P ,U!9XI @ #$$P ,XX\&QPXXmX
j&fPi 4X=C X \!7X 0Š B0XI 0@ C0$TXh llW   TW  X]PY <$`$!APmC T&aPmPi 8X9 ,<c!=X 0Ű !8` |W   <X=A a  W   <XmUi 8AUi <B0P 8X=A ӡ  PXM@ 
#6W  ,` *W   <XY 0P B0"$TXh llW   TW  C <W  Xi ,lfC0$X9 4<cW    W   HX .AW   HC W   HC W   HC W   HC W   HC W   HX 0Ű !8X'PC fW   HC TW   HC BW   HC 0W   HC W   HC |W   HC vW   HC pW   HC jW   HC dW   HC \W   HC TW   HC ` "W   <Xh lA` "W   <C TLW   HC BDW   HC 0>W   HC ,6W   H#.W   H$W   HW  ,XI 0@ !2#$API 0dW   lC xX]P 
#=XmXZmPmX&hW   $0P=P8 X ɰ !#$Ay !	g A , X Pi 06#$`cPi ` !5$DPI 4#$hPi 4` NA`X9 4<c 1AP` ,AH` YA@X 4[$JA&T$%$APY ,C 0'TPY ,PY 8%AJXI B  @ d AAXY ,UY 8AUB0P 8XY 0#` UAXmPh py  q	g A , X $0P9 ,f#8 <A X  y =A HA  PI <#4@ !4$C A HQ  PY 4D#C =\A Q  PY 4` APi @P !4$`Pi @X P HX '
%!AP 0C r'P 0P D=A HA  XY @\EPI 8Xi 4lf!;XY ,$KAPY ,#
&AJX ,  P ,XI ,XY 8\
EPI ,U DAU HB0P DX ,C  	g A , X X84<0 P84` :APXj A$P @z  !
w A , X X8 <3C08 <A P 4X 'A XA  LPMhX[ 4Xe  l` C0@ @ !?XH L@ !5` Pe  { XH LX]hPE#5@ B0TX]hP P !P 
!$X]d!,X]hP P #5@ B0$X[ 4Xe  l` Pe  X=h0P8 C XH LD!7XH LPH XX \U!3C bXh lPk ,X8 <P=h$@PK 03!9$3P=h@ PK 0#	XX \]EPK 00 0 BX8 <0 !<X]hP P 
!%@ PK 0$PPX Xmh` ` #5` B0\Xh l` #4` !?X 8 <A X8(<P1  C *$API TX 8 <A XY L\PQ  Xh lPi L#X 8 <A $@PA  XX \&QPX Xk 0l` Pk 0X=d#XH L@ #` Pk 0X]hP pP PB0:X 8 <A Xi HlPa  X8 <&1P8 XK 0L@ PK 0X]hP P B0$X 8 <A $`Pa  X8 <&1P8 XH L@ !$X]#7Xmh` PmhX8 <3C04X 8 <A $PPQ  Xh l&aPh X=h0  &5P=hXH LX[ ,\EPK ,X 8 <A XmhPa  X=h40 P8 XH L&APH 8 <A XX\EXk 0lX; ,<d;cPa  XH LPH &APHXX PX C w A , X X=0  CtXH lL&APH l$PPX P]P]XXh \lfB0D$UdW   TX=p#9` "W   <#XmW   <@  PMW  $QPX W   P !=Xmp!6$0P8 hC j@ @PH hXX \\U!7aW   <Xm` IC &aPm=A XMA  @ AX]p#4{ Xm`  #2#$1P8 C n` %#2#$BPH C \`  #$0P8 @ +PMC D` a!` z!%fPm=pA HA  PMt@ !8XX \P #6@ 'BPH C r ̀g A , X $0P9 <XH LXX\E&APK @8 <A Xa  lPk DX; XJ 0L	4C XY <\'QPY <'1P; 8 <A Xa  lPk <` &bPk 8X; <;0 P; 4XK FPK ,X[ PX PK Xk @
c[k 8B08 <A Xa  lUk DB0~X8<P; 0XK 0L&APK 0X[ ,\&QP[ ,Xh lFB0
X; <<=P8 XH L8 <A XQ  \P]h =xA a  Ph PH TP PX !8` D!5` BPh ` S!8Ph $@[K ,PH X; <0 C0X ,8 <A XA  LT#$@EXX,\@E  DAXh,lH6  B0ZXMh@ @ B.@ B & =PA HA  @F  X[ ,\S&QPY T#$HPHX]d#{ $`Ph Ph X; ,<&1P; ,#XH,LXX(\@T  UA$`Pi HX; <<0 C0PXH L@ A!9Xh lPi HC 2X ,8 <A XQ  \A Xa  lPi H&GPH X=dB4XH L8 <A P HA XQ  \Xk HP PV  X: 0<XHL	4#'XY <\PX C  X 08 <A P HX ,A Xk HXF  LXQ  \E#2#C C C w A , X X8 x<3B0>XMPH |@ 'B0&$PP]pAXm` '#7%1P8 |{ $APMpAC tXM@ 0!@ 9#)@ AB<@ FB 4@ 9!&TPX |#dPh |XX |\	S!)U APX |AVC $`Ph |Pmp@ '!90 	#6%aPh |A2C t mg A , `  #$0P=XK ,UN @ !5` AX[ ,U^ &QP[ ,Xh tUn =A XL @A  DA|  8w A , X X8 t<P; XXMPH XX \PX XmpC0$0P; ,hAJXmp` A>AdXMUMl!?$PP]pAPXmUml#2#
$1P=pXmAC X t=A XK ,L@A  DAXX t\Xk ,lV'QPX t$0P; @P; 8P; <P; D$@PH PH PH PMhXX \U!7$MPH { PB0(Xh lf!8X8 <3C0` C0$9P8 x@ ZPH |P SPX PX Xh tl'aPh t=A XH |L@A  DAAFXX |\UB Xh xl` 	B0BX=0 .B06XH L@ SB0&P .PX |@ TPH PH X[ X'QP[ XAC Z` 	#6U!4$0P8 X X=A XK XXX t\E@A  DAXh tl'aPh tX; XP8 f!%` A$C C XH LDCXX\PX XmPh X 8 <A P 0XMTPQ  AFXh lf!C $0P8 XK 0LXT  \VXm`
VPT  AX8 <3!C XK 0LXT  \VXm`
VPT  AX8 <3!C xXK 0LXT  \VXm`
VPT  AX8 <3!C DXK 0LXT  \VXm`
VPT  ApX8 <3!#
XH L&APH C X]P 'B0Xh lfC0v0 'P=l$@&APK HPK \=xA XX \a  VB02$1P=p=A HA  PK LHPH |X[ LP PX xAC PUK \A@ B0P \Xh l&aPh X8<	c!` A.@ ;PH PH XX\PZ 0XhlAC Xm` '#5` "B0
Pml$1P=pP RPX ` SPh AFX=P8 U=l!4$@PMpA.XX \U]lB0 XmUml#7PPX C F$1P=pAXMUMlB0n$PP]pAXmUmlC0XX8 t<'2P8 t =A %A@A  XX t\ =A Xh l@a  fAX8 t<&2P8 C XH LHZMPMpP RPX Xh tlPh C X=t2P8 ALX =pA HA  PK T@@ #3C @ UM!8XX \UC Xk T!XMPH C >XX &QPX C lXk Tg` Pk LAX; T<3C 6XK LLDC0"UM!7XX \U#XmPh C A$1P; LXH LX[ L\
EPH C 6Xk Tl` ?Ph X; T60 P8 f#3C `=A HA  PK PC0>X[ D\TP ?!:XX \U#6@ #3C ^FVK DPK DXh ` !#Pk 8XMPH C X[ TC XH L =pA HQ  P ?PX ` #5` B0Pk 4AXk 4l` B0NX8 <0 S#6$0P8 C Xh lA>P @#$ #)$@PH $TPXC ` @Pk <C JX8 <0 ;!:$@PJ 0XhlAXX \P A#;$cPh$0P8 P8 C \@ PPK <AXXX \P #6$PPX C 8Xh l` B0DA,X8 <0 7#?XH L@ 7#8$0P8 P8 C XX \P !4$QPX #$5P8 XK 4L@ !=XX \P !$`Ph C X =A HQ  P[ LP PX Xk Lh` Ph X =A 1  P8 C *XH L@ 1!@ 9#,X[ D\U#4$@PH C HXh l` u!%1P=d=A a  Ph C P` mBHXK 8L@ #8$PPX PX C $CPK 8=A Xa  Ph X[ <\U#5UP[ <X; D<0 @C0XH L@ 5C0"@ 3#?X[ 8\P !&$@PH C C nXh l&aPh X8 <XK <L
44P8 XX P !6$1P8 C  Xk 8l` !:
TP pP 0!$$QPX Xk 8l` !4$?P8 X8 <0 p0 `!:XH XX `\
EPH Xk @lX8 <h
6XK DLCX[ <\
5@ p
4P8 P8 Xk 8lPh $@PK DC 'g A , dPk 4X< 0 0 B0*=A a  Pk 4X =A   | f!4$jPk 4X  =A   C  :W  A 0 iPl P #9X; ,U> 
cPl XK ,UN XXU^ EC0b&APK ,=XA Ha  Ul B0B=dA 1  U<  B0,XMh@ p@ @!=X ,'=XA HA  UL ,!4| C Xmh` p` @B0&QPX=XA Xl ,@a  fAX8U> &1P8=XA XL @A  DAXU =dA X\  Q  P AXhUn Pk ,X=0 C0^W   H$SXk ,Un W   T$SXl W   T$SXl  W   T$SXl ,W   TW  ,C  πw A , X X8<XHL4!6 { PP[ ,PK 0$`Pg ,P AX; 0<'1P; 08 <A XA  L@ X[ 0T'RP[ 8X 0'A Xa  lPmh` AVP <X=h80 P7 ,QXk 4lAXK 8LXX\	E!"#PK 0$`Pg ,P AC f$0P7 ,$QcApXHL@ !` AX ,C  g A , X $0&1P; ,P; 4XK LPK 0X[ TP[ @ 	#&D 7PK 0#D 0PK 0dW   <X; ,U; 4A0 B0P 4{  <w A , $0P; @XK HUN DC8 A XQ  U^ P\ 48 A Xa  Un Pk <8 A X1  U> 0 0 C ; @P< ,P` P\ 4XL ,UN XT  U^ UC0^8 A P 0Xa  Un `` X< 4U> 	c!#C 0Xa  6 P1  XL ,UN X  U 8 A P ,C X HU 8 A PQ  Xl ,Un X; HU> P6  XK <UN PK HC X]P C0.W   H$SXk HUn W   TW  ,|  g A , $SW   TW   HX 8 A Xa  Un AW  X 8 A Xa  Un AW  X 8 A Xa  Un A~W  X 8 A Xa  Un AZ` ]W   <W  ,|  hg A , X $0P; ,P; 4P; 8P8 P; LP; HP; PP; 0@PHX =XA HQ  P[ <X =dA a  Pk @f!3C YP P[ T!7XX \P[ TXM@ C0$TXk W   T$SXk @lW   T$SXh lW   T$SXh lW   T$SXh lW   T$RXh lW   T$SXi HlW   TW  ,X[ @\P BXhl&aPhX8 <c!6$DPHC f8 A XK <LPA  X8 A X[ HPQ  X8 A Xh lhXK @L
dPa  X[ T\PX X=0 #7XhlAb$@XX\EPK HX @=PA Ha  Pk C BPZ ,P i!=PA Q  PZ ,P V!.AX8 <0 ;B0$P <!P O#$P S!:$@PJ 0XhlAXZ ,\P <B>P @B 6Xh l` !;X8 <0 D#40 F!;&WPZ ,XMhD@ PH Xh lPk TX8 <S#8XH LTB0hP ;!=AX[ T\P !4$oPh X: ,<0 BBT0 HB LXH LXX \EC00@ !(P C0"P 	#?@ !P 	#9P 
#6$bPhC $0P8XH L'APH XX\E!6$dPhC H8 A Xk <lPa  X 8 A XK HPA  X 8 A XX \XXk @l
VPQ  X; T<P8 X 8 A XH LPA  X]P #7Xh lA(Xk <l``!3C jX; 0!3C (P; $0P; 0C XK &APK X[ <\U#C Xk PUk LB04$0P; ,P; 4P; 8XH Ld!3C BPK LXZ ,\P V#A0Xk P'aPk PPk HX; ,C0h8 A XA  L@ PK @C0J8 A XQ  \P[ <8 A Xa  lhPh X H8 A X1  <P; HC BC $A$@[K HPK H8 A X[ @\PQ  X H8 A Xa  l`Pk !3C X H8 A XA  LHPH C XX \P #3C 4Xh lPk HAX; @<P8 XH LD!4{ $WPXXm` 
#:` ;#7$0P=pA"XHLDB0ZXX \P ;!<X: 0<3!6$CPHC 6U!6$APHC (P RB P T!.$BPHX8 <0 !4$EPHdA$@PMpPH PH PH PH PH C LXX \P #&P #3C Xk <l`Pk !3C C X8 <0 !0 #40 !3C C XH L@ #3C lC XY  P P #=Xm#X9  0 0 	#3C XI  D@ PH @ !%$HPH #@ !$IPH C \XY  P P 	#3C Xi  d` Ph C 8X; 4#3C .XH L@ #3C XX \P#3C JXi HlPk DA>$0P8 XK DLD!&$XPXC 8 <A Xa  lPj 0dAZX8 <3!6$CPHC $QP[ 4C Xh l` #3C JC X8,<XH(L@C  DAXY T\P  =PA Ha  Pk DXY TP  #98 <A Pa  Xi LlfC02Pk X8 <A Xa  lPi LX XA XK DLPA  C C XY T\P P !6$dPhC X9 T&1P9 TC XK <L@PK 0C lX[ LXh lV#4$1P; ,'QP[ L$@PK @C `XX\8 <A Xi TlPa  X8<8 <A XI HLPA  X[ PU[ L#3C >Xhl'bPhX8<	c!%` AժC XK 8#3C $APK 8X8 <A XQ  \PY TX
A Xa  lPi HX; PU; L!6XH&BPHC $UPXC ng A , X $0P9 HP9 TP8$ȰP tP8 P8 P8 P8 P8 P8 P9 LP8@  PMXZ B0XmXZmPmXX8 <3!6$PA4$@PH XX \U#6Xm` !!=X8 <3#4A"z ABX Ű !3C XH dL&APH dX]!9XX l\` OAXh l` &B0fX8 <0 B0VAX Ű ;!:$@PJ 0XhlAXX \P S#4$`AXh lAaA.` PAC J$0P8 ` ;B0<XŰ :#9XH L@ PB0"$SPX P8  =PA Ha  AC \X !8XH LDC0(X8 <P8 $QPX  =PA Ha  AL#$SPX  =PA Ha  A0C AXj C b$2P8  =PA Ha  AA"P 0X ,XK  LT#$@E#6A#4$fAXi 0lX9 ,V\MdAPS  C HXP D$DPH  =PA Ha  AXX \UC0XhlX9 D<	cC XXHL
'P 0	!%` AXXX\Xi ,'QPV  X9 ,X  8 <A X 0P  XI 0LXY D\EPH$Xi ,X6  <'1P: 8X 0'$!AP 4C N&P 4P 48 <A P <X DA XJ <XQ  \PT  Xi Dl&aPi DX 4U 4AU 8B0P 4X9 0<P8C 
W  A , X ABX;  #$0[;  P;  ` -A*#3#&10 P;  Xk  Ah{  (g A , X ` ,AXk A<{  g A , X X8$<
cPk V` $AZ$`[k AX '8 <A XA  LPK ,d` A|X[ ,Xe` AlX 8 <A Xa  lm` ANX; ,0 p0 PB0.XK ,@ @ TC0X '8 <A XQ  \` ,A{  gw A , X $1P: @XX \` @AXH LPK ,8 <A XQ  \P #4'APK ,A Xa  l6#$`c` !9` EA͖$@PJ @#Xj Dl
fPj D{  Lw A , X X: <XJ L4&1P=!*$PPX $dA^$aPm` bA0XmA~{  ,g A , X X8 <Y9 PC j8 TA A  PK ,F@ C0LXH 'DPH PJ lX[ ,P #4&APH0P P !8XJ lL&APJ lX[ ,P !4$@PJ l{ f!5$mPk #$jPk AΜ$QPY @C  Xw A , X X8 <0 XB06$@PH dPH lXX \\P PX \PH $aW   `$`Pm{ $@PH X]P[ 8Xi ` B00 W#=X=0 !8@ WPH $eAXX\P[ 4Xh l` W#5` VB0BfPh Ui #4$eA` ;AˠX9 0 #*$iAͰXI 'API "$PP[ 4C "X9 0 !)XM@ !4$eÀ` ;AXXX \YY PC B8 TA a  Pk ,` ` !5$KPK ,#$nPk ,'TPX Xk ,lA*C X9 @#?XI  @ @ !@ 
!%` AXX\'QPX Xh lX; 4<	cC 8 <A XA  LPK 0A XQ  \P B0tXX \\UB0f@ B0^Xm` B0RX; 8<0 
#?XMXZMPMXW  ,$PP[ 8W   HXh lAːW   HXk 0l` #4$lA*X; 0<XH L0 C'CPH C $kW   <X[ 8\U!9XmX&hW   C Zw A , )X X8 <0 !0@#%` AˬX @B0LXH L@ B0<%8 A XQ  \P P !C0P "#=Xm` !5` A^$1P9 @$P xP 8P DP HP P lP tP pP |P0P P XH LPJ P P pP X 8 A XQ  \PX U#Xj X	k##C J8 A XA  LDC0"8 A XZ \PQ  Xj lPj Xh lPj C X 8 A X  İ P XM@ C0pW   H$SXj lW   TW   H$SXh lW   TW   H$SXj lW   TW  ,X 8 A XQ  \PZ Xj l` 1#X .4A` !3C &` ;#6.4AX . A$0P9 @X #3C lXJ LD!3C 8 A X  P 8 A XA  LPJ C XZ \P -B0&Xh plUm!<%1X ;P: &aPh p#$JPH X =A a  AC X` QAƺC L` MAƮC :XZ \P ,#5` +AƔC &Xj l` +#7` -AzC ,X8 p<U=!<$XJ LP &1P8 p` UAJC ` XA>C ` yA2XZ \P]C ` zAXj lPmC ` VAC X9  0 #<X#0 0 #4$eA` RAC b` TA#` KAXI  @ 
#4$eAC <` eAŤC 0$PPZ Xh4l` #4$oAǦX84<0 P84X !3C 8 A XA  LPH D#XX\	#/8 A Xa  l` ` S#3C \8 A X  P dAHP ! #(` A$0P: X X* ,AJ$AB  P C NXZ \U!5` A$iPj XZ \` oABXX \` ,A2C ` sA~C 
X8 \<0 P8 \C X \ư P \C @ PH `C $PPX `C ` SA4C ` ZA(C Xh lPj 4X: 4<Y9 PC 8 TA ӱ  İ Ű B0fXH L@ B02X 4A P ,Q  P Q  Xj 4l'bPj 40 FP8 #@ qPH X 4[Xh lA2C XJ 4'DPJ 4C `$jAŒC XX \&SPZ t` uA Xh l&bPj pAX: |<3#7X lP0XH4L@ PH4$QPZ x$`Pj hX KA&HPJ Pj LPZ TPj XPZ dPZ \P PXX \PZ l=A PQ  $=A Xj llPa  C FX: P<0 P: PC 2A$P HXJ @LD!2#XZ D\P PZ DC ` CAh` #Ph X: x<'1P: xC dX x'P xXJ LD#<` ~A,$QPZ hPZ `C 6Xj hlfC0$`Pj hX =A Q  PX ` ?AXj PlX: L<c` Pj P#9X ǰ P XJ TLDC0fXZ \\P #9X ǰ P X XJ HL
=A P X d=A XQ  \Xj f  AC X: X<0 C041P: XX \P \XJ dL'APJ dXZ L\QPZ LC 1P: XXj \laPj \X d'P dXJ LLAPJ L` #9XX \P PX XX \Xj Hl
=A P =A XQ  \X: c  A*X d=A X XA  L#4kAX d=A XQ  \PX $`Pj TPj PPj HX: x<3!*X t#4kAȖXJ hLD#5` "AC XX \P PZ `Xj xl&aPj xX: P<X L;0 P: PXJ `LCPJ `XZ \\P EB0XZ T\UC0|Xj Xl
fPj XX: d< =A P X dA X XA  LPK  XZ d\&QPZ dXj \l
fX: `<cPj \X L
XJ PLP LC XZ X\
UPZ XXj TlfC02X8 <&4P8 X d&P d=A XH PA  C pP PZ XXZ \QP TB0"XZ d\=A Xa  lPj 4#
X8 <&4P8 P: 4X d&P d=A XJ 4LPA  XZ \\
UXj `lVPZ \X: L<
3X P;P: L$APJ T$PPZ PXj hlf!3C C X: <3!<$2P: X k AhXH L&DPH B@ P#%` A8XX \8 TA Xj lX |
ka  ` A$@PJ pPJ lPJ |PH0C XX \'R` BA$`Pi @X8 <c` A4C X l!4$`AXJ lL@ #6$eA8C XY @#7T ` FAXj llAŌXj ll&aPj l$;P: $P |C ~$@PMPH XX4\P #7Xmd#$$oA8X: <P: C JXX \` @ALC 6C 2AC *X P Xh lAP XH LD#aAC X =A HQ  PZ 4B Xj l` SB0~$S` NAX8 <=A H  P 4` ,A` ZAXJ 4LTE@ $jFPX e AAX8 <X 4$J$Ak AAC e#$PVPZ 4X =A a  AX: 4<3C f` ,AX KXZ 4\EPJ %!AP C ('P P =A Ha  AX U AU B0P XmPh pC ` .AC ` vAC ` fA$:P: X P l&P pkA\C hXH LD!9XZ 8\&QPZ 8#A<C DXX \` LAF$aPi @X84<6P84C X4ư P4XX \` WAC XH4L@ PH4$QPY @XX \` _AXh l8 <A X  P 4A XA  LPJ <XZ \	T!A Xa  l	V#'` A8C tE[J <PJ <DP 4XJ <@ $AJ$AB  PJ <A P 0XQ  \T#4$gA8Xj 0lX6  <X <;P6  C 
XH4L@ PH4XX \` JAC XZ \U!5X]PZ Xme&aPmU!#C jC ` pAC ` pA` EAX: D<1P: D0 #6'1P: DC C |` iAC pX Ű 6C0$XM'APM!-$PPX ` A8$`Ph C 
` AAX=0 #$cA$PP C XH LD#6X]'QP]$@PH Xm!3C PMX=A H  Ű A#8XX p\U]!3C p` IAC C ` aAC Xm&aPmX8 <3C0 X 8 <A XJ LPA  C ~XX p\U]B0:` wAXh l8 <A X'P  XHL8 <A XZ \PQ  Xhl8 <A X P  XJ LXZ \	E#$`Ph $dA8X: <P: X XJ L&P <&P <XX\['SPXXhl	V!%` A8X8<X <
;P: XH'A$!APJ 4C &&APJ 4PJ 8 <A $PPQ  XJ 4UJ AUJ B0P Xj l` 2B0$X8 <0 T#<Xd!XI #6$P` FAXh lApC XZ 8\U#8` dA$`Pj 8Xh lAF` hAX8 <8 <A X  İ Ű #5` cAC ~Xh lA XH LPH @ !4$QP]C VXh l` !:` HA0P9 8#A.X p#6[` BAXH0LD#:XZ l\E#4dAXj llf#3Az 
6
W  A 0 X $0P9 @XHLPI XXHLPHXX\PY \Xh lPi PX84<
3P84X9  B0<%aAX 'P 8$R` GAX #3A$R` GAC 0 0 C0Z$aAXMd#$PPY 4#$aPi 4XY 4\` GAX8 <3#3AXY 4\` GAX 4!3C `$P @$`A$XH L'BPI 8XX \U#3AjXh l` T!?X 88 <A P ,$PeAX8 <0 U#70 W#40 V!3C 0 0 !0 
#'X Ű B0X Ġ pŠ P!8XI 8L'API 8XY B0Xh ` !;X=!5$2P=#$eA8XdC (X ɠ #.Š #;XI #5$oA8#$QP]Xi &aX 88 <A P ,XX \AXh l` W#4` V!5$0P=#C X  Ű #7X #4$`A$APMdXX\PXXY XPXXi PPh X9  #5X \PX4P4y T	g A , X W   lX8<3B0&$UXh dlW   TW   HC VW   H$QXhlW   TW   HXŰ #8` SW   <W  ,W   y  ]	w P (A , NX H ,$0P4 Ȱ
P A   ( <ALH D$QPT 0 PP4 A   ( TALH PPT %1P4 A   ( ALALALAL$aW   l$bW   `W  ,$eW   W   HW   H$bW  8$0P=cA	z` zA$P \$PP `PP P  =PA P,H  P(P dP l=A @  @
PHPPX$dPh $0P8P8P8 P8 P8 P848 <A P ,$_$`A` ;A$dAA\$aAX#6$ $$Ax  x  A @  @
PHPPX$dPh $0P8P8 P8 P8 P8 P888 <A P ,$_$`A ` ;A$dAA\$aAX#6$ $$Ax  $P8 P8 P8 P8@8 <A P ,$_$`A ` ;A$dAA\$aAX#6$ $$Ax  !7XI 0@ B0XY 0P C0$TXh plW   TW  Xh lPi <$0$!AP8 C X&1P8 P9 8X ,;!=X 0Š !8` |W   <X =A a  W   <X8 U9 8AU9 <B0P 8X =A A  PH XX \P 
#6W  ,` *W   <Xi 0` B0"$TXh plW   TW  C <W  X9 ,<3C0$X 4kW    W   HX .AW   HC W   HC W   HC W   HC W   HC W   HX 0Š !8XHL'APHC fW   HC TW   HC BW   HC 0W   HC W   HC |W   HC vW   HC pW   HC jW   HC dW   HC \W   HC TW   HC ` "W   <Xh lA` "W   <C TLW   HC BDW   HC 0>W   HC ,6W   H                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |             PF           bz 6$] ol   ~e  3.>AZUr                                                                                                                                                   ( 1 `  K  `              ! % $ "  &* + ,+/ + ,<>FOPQ]R B>FI ^^_ GJII MW Y[S TSII A II  0 a oyqrylsuz z{w x| y} ~{ w                     r s w {      ~ }        P                      À       ̀̀΀ ΀       ̀Հ    0   ـ      ߀                                 	I	  (  }A        !    "#   ,&!'&-,,  !)!(!/.2  !0!43  <!87=<  !:!9!?>  !BAE  !CNH!IHRSS  !OTT  !J!K!O!VUY  !W![Z  ^ab  c_a  !fg!hi!jk  mn  po  stu1vxys  {!|z  ! ׁ  !       ym                                                                                                                                                                                    lrtY5612349vuuvu;;Su8;88;"#
!*0#www#wSw

wS?>=<@KJMNL^m_m^m_Seeefffm^ISZ[ep  fVWXFCDEGJKLMNe^ effFCDEHGJKLMN^efJKLMN^ efPQsi Rcd OVWX+T-S+-STSR53; ;a cd.. cd.l. S	jTS	+-$&'( $& $ +%)( % %) +-$&'( '( $& $   ~; qba q;;FEJKLMN^_ efbkkkkk|}kkk                                                                                 Ll|                 \                        L  <                 "        OrWdtH cKt\;H        @ !5` A6X[ ,U^ &QP[ ,Xh xUn =A XL @A  DA|  8w A , X X8 x<P; XXH LPH XX \PX Xm`C0$0P; ,hAFXm`` A:ADXH LUM\B0 $PP]`A*Xh lUm\#2#$1P=`Xh lAC X x=A XK ,L@A  DAXX x\ H?   D D                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !!! %option  stack=40
!! 17/1/78
{Modified 25-Feb-82 to run on new subsystem}

!!!!  %CONTROL 1;        ! CHECK SWITCHES ONLY

! PASS 3 OF 7/32 IMP COMPILER - VERSION FOR MOUSES AND OS-32MT SUBSYSTEM

%CONSTINTEGER  MAX PERM = 54
%CONSTINTEGERARRAY PERMS(1: 733) = %C
X'0037',X'018E',X'019A',X'01A4',X'01B8',X'024B',X'01EE',X'01FB',X'01CF',
X'0000',X'0084',X'00A3',X'00C6',X'0046',X'00DB',X'0000',X'0000',X'02C4',
X'02B5',X'02A6',X'029E',X'0298',X'0292',X'0282',X'0210',X'003C',X'005E',
X'0059',X'0218',X'0141',X'0184',X'0050',X'004B',X'0077',X'0070',X'0069',
X'0063',X'007F',X'0041',X'0169',X'0220',X'0225',X'022A',X'022F',X'024E',
X'0055',X'0057',X'0235',X'023A',X'023F',X'0245',X'016E',X'017A',X'026F',
X'0004',X'2440',X'583D',X'0004',X'0303',X'0004',X'2441',X'583D',X'0004',
X'0303',X'0004',X'2445',X'583D',X'0004',X'0303',X'0004',X'2442',X'583D',
X'0004',X'0303',X'0004',X'2443',X'583D',X'0004',X'0303',X'0004',X'2444',
X'583D',X'0004',X'0303',X'0001',X'0000',X'0001',X'0000',X'0004',X'2449',
X'583D',X'0004',X'0303',X'0004',X'244A',X'583D',X'0004',X'0303',X'0005',
X'246A',X'2445',X'583D',X'0004',X'0303',X'0006',X'0856',X'246A',X'2447',
X'583D',X'0004',X'0303',X'0006',X'C860',X'0020',X'2445',X'583D',X'0004',
X'0303',X'0007',X'0856',X'C860',X'0020',X'2447',X'583D',X'0004',X'0303',
X'0004',X'2446',X'583D',X'0004',X'0303',X'001E',X'4801',X'0000',X'C500',
X'8080',X'2135',X'2401',X'2410',X'8888',X'0001',X'9400',X'9330',X'1001',
X'2188',X'D301',X'4300',X'0000',X'D202',X'4300',X'0000',X'2308',X'2731',
X'4801',X'4300',X'0000',X'4002',X'4300',X'0000',X'2732',X'2217',X'0308',
X'0022',X'4801',X'0000',X'C500',X'8080',X'2135',X'2401',X'2410',X'8888',
X'0001',X'9400',X'9300',X'D352',X'0000',X'0865',X'0A62',X'0A50',X'C550',
X'00FF',X'2325',X'2405',X'241C',X'8888',X'0001',X'D252',X'0000',X'2701',
X'0218',X'2661',X'2611',X'D331',X'0000',X'D236',X'0000',X'2208',X'0014',
X'0862',X'D301',X'0000',X'D352',X'0000',X'0B50',X'2318',X'0A05',X'2306',
X'D336',X'0000',X'D431',X'0000',X'0238',X'2611',X'2661',X'2701',X'2218',
X'0855',X'0308',X'005D',X'D0B7',X'0100',X'08B2',X'48D1',X'0000',X'C5D0',
X'8080',X'2338',X'94DD',X'93DD',X'4802',X'0000',X'C500',X'8080',X'2135',
X'2401',X'2410',X'8888',X'0001',X'9400',X'9300',X'0B0D',X'4210',X'8022',
X'08CB',X'08E1',X'08FD',X'27F1',X'4210',X'801E',X'26C1',X'26E1',X'D33C',
X'0000',X'D43E',X'0000',X'2239',X'26B1',X'2701',X'4300',X'FFDA',X'D1B7',
X'0100',X'0801',X'0308',X'0866',X'2135',X'05B2',X'2037',X'4300',X'801C',
X'083B',X'0B32',X'D236',X'0000',X'08CC',X'05BC',X'2338',X'2661',X'26C1',
X'D336',X'0000',X'D23C',X'0000',X'2208',X'0855',X'2136',X'0800',X'4230',
X'FFC6',X'4300',X'8022',X'0ABD',X'D302',X'0000',X'0A02',X'0830',X'0B3B',
X'D235',X'0000',X'05B0',X'2338',X'26B1',X'2651',X'D335',X'0000',X'D23B',
X'0000',X'2208',X'D1B7',X'0000',X'05DD',X'0308',X'0007',X'0827',X'C810',
X'0100',X'9261',X'4012',X'0000',X'0308',X'0027',X'4836',X'0000',X'C530',
X'8080',X'2135',X'2401',X'2410',X'8888',X'0001',X'9433',X'9333',X'0855',
X'2328',X'5807',X'002C',X'0503',X'2124',X'0B05',X'2601',X'2315',X'2405',
X'2419',X'8888',X'0001',X'C837',X'002C',X'0813',X'D203',X'0000',X'0A65',
X'2701',X'0218',X'2631',X'D326',X'0000',X'D223',X'0000',X'2661',X'2208',
X'0004',X'2448',X'583D',X'0004',X'0303',X'000B',X'6827',X'002C',X'5867',
X'0030',X'5857',X'0034',X'C840',X'0016',X'583D',X'0004',X'0303',X'0009',
X'6827',X'002C',X'5867',X'0030',X'C840',X'0017',X'583D',X'0004',X'0303',
X'0009',X'5867',X'002C',X'5857',X'0030',X'C840',X'0015',X'583D',X'0004',
X'0303',X'000B',X'0830',X'0A33',X'2734',X'0218',X'5801',X'4300',X'0000',
X'5002',X'4300',X'0000',X'2208',X'0009',X'0830',X'0A33',X'2400',X'2734',
X'0218',X'5002',X'4300',X'0000',X'2205',X'0013',X'0831',X'4932',X'0002',
X'212B',X'4B32',X'0000',X'2118',X'0A33',X'7333',X'4200',X'0004',X'2333',
X'0A3E',X'0233',X'0821',X'2405',X'2414',X'8888',X'0001',X'0016',X'5016',
X'0008',X'5036',X'0004',X'5056',X'0000',X'CB35',X'FFFF',X'2125',X'2405',
X'2416',X'8888',X'0001',X'1C21',X'1C05',X'2400',X'0B01',X'C813',X'0003',
X'C410',X'FFFC',X'0308',X'001E',X'5073',X'0000',X'5103',X'0000',X'5063',
X'0004',X'0827',X'0A71',X'583D',X'0000',X'C973',X'FE00',X'2327',X'0B71',
X'0821',X'2402',X'2410',X'8888',X'0001',X'585E',X'0010',X'F550',X'8080',
X'8080',X'0238',X'5051',X'42FF',X'FFFC',X'2714',X'2035',X'000C',X'0833',
X'2316',X'0823',X'2405',X'241A',X'8888',X'0001',X'2411',X'2731',X'0218',
X'1C02',X'2203',X'000D',X'2401',X'2F00',X'0801',X'2316',X'2D02',X'2820',
X'2400',X'CB01',X'0001',X'0338',X'2C02',X'2701',X'2203',X'0002',X'0816',
X'0308',X'0003',X'0816',X'0A15',X'0308',X'0007',X'C817',X'002C',X'C840',
X'0011',X'583D',X'0004',X'0303',X'0007',X'C817',X'002C',X'C840',X'0012',
X'583D',X'0004',X'0303',X'0004',X'244D',X'583D',X'0004',X'0303',X'0004',
X'244E',X'583D',X'0004',X'0303',X'0004',X'244F',X'583D',X'0004',X'0303',
X'0005',X'C840',X'0010',X'583D',X'0004',X'0303',X'0004',X'244B',X'583D',
X'0004',X'0303',X'0004',X'244C',X'583D',X'0004',X'0303',X'0005',X'C840',
X'0013',X'583D',X'0004',X'0303',X'0005',X'C840',X'0014',X'583D',X'0004',
X'0303',X'0002',X'2F01',X'0308',X'0008',X'581D',X'0000',X'0B17',X'0318',
X'2402',X'2410',X'8888',X'0001',X'000B',X'6807',X'002C',X'F810',X'4080',
X'0000',X'5017',X'002C',X'6A07',X'002C',X'2E10',X'0308',X'0004',X'6807',
X'002C',X'2E10',X'0308',X'0006',X'6807',X'002C',X'2E10',X'2F21',X'2B02',
X'0308',X'0012',X'5817',X'002C',X'C460',X'000F',X'1164',X'C660',X'E101',
X'4067',X'0000',X'2460',X'4067',X'0002',X'C860',X'0308',X'4067',X'0004',
X'4307',X'0000',X'000F',X'0822',X'233A',X'0B10',X'0801',X'EE00',X'001F',
X'1D02',X'2611',X'2113',X'0800',X'0338',X'2405',X'2411',X'8888',X'0001',
X'0005',X'0338',X'2406',X'2411',X'8888',X'0001',X'0005',X'0348',X'2406',
X'2411',X'8888',X'0001',X'0007',X'D401',X'0000',X'0388',X'2406',X'2411',
X'8888',X'0001',X'000E',X'5912',X'0000',X'2117',X'5912',X'0004',X'2124',
X'5C02',X'0008',X'0308',X'0821',X'2406',X'2412',X'8888',X'0001',X'000E',
X'4A78',X'0000',X'580D',X'0000',X'C507',X'0200',X'4388',X'0002',X'4B78',
X'0000',X'2402',X'2410',X'8888',X'0001',X'0019',X'0847',X'4A48',X'0000',
X'4A78',X'0002',X'580D',X'0000',X'C507',X'0200',X'2387',X'4B78',X'0002',
X'2402',X'2410',X'8888',X'0001',X'580E',X'0010',X'5004',X'0000',X'2644',
X'0547',X'2224',X'4308',X'0004'
!
!  FAULT MESSAGES
!   1  -  NO CODE REFS LEFT
!   2  -  TOO MANY LABELS
!   3  -  SPURIOUS PERM CALL
!   4  -  TOO MANY PATCHES
!   5  -  CORRUPT JUMP
!   6  -  CORRUPT PERM ROUTINE
!   7  -  PHASE ERROR
!   8  -  CORRUPT PERM ADDRESS
!   9  -  CODE INCOMPLETE
!  10  -  GLAP INCOMPLETE
!
%CONSTINTEGER PSEUDO OBJ = 2, DIRECT = 3;! INPUT STREAMS
%CONSTINTEGER  REPORT = 0, OBJECT = 2;      ! OUTPUT

%CONSTINTEGERARRAY NOT(0:12) = 1,0,5,4,3,2,7,6,11,10,9,8,12
%CONSTINTEGERARRAY SB(0:12) =
X'2230', X'2030', X'2010', X'2020', X'2220', X'2210',
X'2230', X'2030', X'2020', X'2010', X'2210', X'2220', X'2200'
%CONSTINTEGERARRAY SF(0:12) =
X'2330', X'2130', X'2110', X'2120', X'2320', X'2310',
X'2330', X'2130', X'2120', X'2110', X'2310', X'2320', X'2300'
%CONSTINTEGERARRAY LJ(0:12) =
X'433E', X'423E', X'421E', X'422E', X'432E', X'431E',
X'433E', X'423E', X'422E', X'421E', X'431E', X'432E', X'430E'
%CONSTINTEGER MAX PATCH = 450
%CONSTINTEGER MAX JUMPS = 3000
%CONSTINTEGER MAX LABELS= 2000
%BEGIN
   %RECORDFORMAT PFM(%INTEGER WHAT, WHERE)
   %RECORDFORMAT LFM(%INTEGER LAB, CA)
                    !  LAB =  MODE(3)+LABEL(12)
                    !  MODE= LONG+CONDITIONAL+PERM+RT
   %RECORD(LFM)%ARRAY JUMP(1 : MAXJUMPS+1)
   %RECORD(PFM)%ARRAY PATCH(1 : MAX PATCH)
   %INTEGERARRAY LAB(0 : MAXLABELS)
   %INTEGERARRAY LTEMP(0:9)
   %INTEGERARRAY PEP, PADDR(1:MAX PERM)
   %INTEGER CA, GA, LA, DA
   %INTEGER LINE SIZE
   %INTEGER CODE SIZE, GLA SIZE, LOAD SIZE, PERM SIZE, DIAG SIZE
   %CONSTINTEGER EMARK = X'8888'
   %CONSTINTEGER NEVER = X'7FFF'
   %CONSTINTEGER LONG = X'800000'
   %CONSTINTEGER COND = X'400000'
   %CONSTINTEGER PERM = X'200000'
   %CONSTINTEGER RT   = X'100000'
   %CONSTINTEGER VERY = X'080000'
   %CONSTINTEGER LABEL= X'FFFF'
   %OWNINTEGER MAX LABEL = 1
   %OWNINTEGER INIT GLA = 0
   %INTEGER REF EXTRA, IGNORE, FLAG
   %INTEGER REFS, CURRENT LINE
   %INTEGER J,K,L,z
   %INTEGER CP, GP, CODE, TAG, EXTRA
   %RECORD(PFM)%NAME PAT
   %INTEGER CTAG, CCA, UCA, DEFMOD, LAST
   %INTEGER MODE, CADDR, CVAL, GADDR, GVAL
   %SWITCH D(1:8), C(2:11)
   %RECORD(LFM)%NAME UREF, CREF
   %RECORD(LFM)%NAME  R,B
   %INTEGERNAME V
   %INTEGER PHASE
   %INTEGER  RX1,RX2,RX3,SJ;  RX1=0;  RX2=0;  RX3=0;  SJ=0
   %INTEGER RTNCALLS, PERMCALLS;  RTNCALLS=0;  PERMCALLS=0
!
!
!
%SHORTINTEGER  CBP, GBP, LBP, DBP, TBP

!  N.B.   'GLABUFFSIZE' MUST BE A POWER OF 2 -- SEE LINE 562 ISH
%CONSTINTEGER  CODEBUFFSIZE=200, GLABUFFSIZE=256, LD BUFF SIZE=200
%CONSTINTEGER DIAG BUFF SIZE = 256
%SHORTINTEGERARRAY TBUFF,DBUFF(1:DIAG BUFF SIZE)
%SHORTINTEGERARRAY CBUFF(1:CODE BUFFSIZE), GBUFF(1:GLA BUFFSIZE)
%SHORTINTEGERARRAY LBUFF(1:LD BUFFSIZE);   ! ... LD = 'LOADER DATA'
!
!   -------OBJECT BLOCK TYPE CODES-------
%CONSTINTEGER END OF FILE BLOCK = 0
%CONSTINTEGER NONDIAG CODE BLOCK = 1
%CONSTINTEGER DIAG CODE BLOCK = 2
%CONSTINTEGER STATIC DATA BLOCK = 3;  ! ...'GLA' IN IMP CONTEXT
%CONSTINTEGER DIAGS DATA BLOCK = 4
%CONSTINTEGER DIAG TABLE     = 5
%CONSTINTEGER ENTRY POINT BLOCK = 6
%CONSTINTEGER EXTERNAL REF BLOCK = 7
%CONSTINTEGER SEGMENT SIZE BLOCK = 15
!
   %ROUTINE  GET(%INTEGERNAME  N)
      %INTEGER S
      READSYMBOL(N);  READSYMBOL(S)
      N = N<<8!S
   %END
!
%ROUTINE  PUT HALF(%SHORTINTEGER N)
   PRINT SYMBOL((N>>8)&255)
   PRINT SYMBOL(N&255)
%END
!
%ROUTINE  PUT BLOCK(%SHORTINTEGER HEADER, %SHORTINTEGERARRAYNAME BLOCK)
%SHORTINTEGER I,J
   PUT HALF(HEADER)
   %CYCLE I = 1,1,(HEADER>>4)&X'0FFF';   ! ...EXTRACT LENGTH
      J = BLOCK(I)
      HEADER = HEADER+J;    ! ...ACCUMULATE CHECKSUM
      PUT HALF(J)
   %REPEAT
   PUT HALF(-HEADER-1);   ! ...CHECKSUM
%END
!
%ROUTINE  COPY BLOCK(%SHORTINTEGER  HEADER)
%SHORTINTEGER I;  %INTEGER N
   PUT HALF(HEADER)
   %CYCLE I = 1,1,(HEADER>>4)&X'0FFF'
      GET(N); HEADER = HEADER+N
      PUT HALF(N)
   %REPEAT
   PUT HALF(-HEADER-1)
%END
%ROUTINE  CFLUSH
!   OUTPUT BUFFER IF THERE IS ANYTHING IN IT -- OTHERWISE JUST
!   INITIALISE.   BUFFER IS EMPTY IF CBP=1
   PUT BLOCK( (CBP<<4)!DIAG CODE BLOCK, CBUFF ) %IF CBP # 1
   CBP = 1;  CBUFF(1) = CURRENT LINE
%END
!
%ROUTINE  GFLUSH
   PUT BLOCK( (GBP<<4)!STATIC DATA BLOCK, GBUFF) %UNLESS GBP = 0
   GBP = 0
%END
!
%ROUTINE  LFLUSH
   PUT BLOCK( (LBP<<4)!EXTERNAL REF BLOCK, LBUFF) %IF LBP # 0
   LBP = 0
%END
!
%ROUTINE DFLUSH
   %RETURN %IF DBP = 0
   PUT BLOCK(DBP<<4+DIAGS DATA BLOCK, DBUFF)
   DBP = 0
%END
%ROUTINE T FLUSH
   PUT BLOCK((TBP<<4)!DIAG TABLE, T BUFF) %UNLESS TBP = 0
   TBP = 0
%END
%ROUTINE  CPUT(%SHORTINTEGER  N)
   CBP = CBP+1;  CBUFF(CBP) = N
   CA = CA+2
%END
!
%ROUTINE  GPUT(%SHORTINTEGER  N)
   GFLUSH %IF GBP = GLA BUFF SIZE
   GBP = GBP+1;  GBUFF(GBP) = N
   GA = GA+2
%END
!
%ROUTINE  LPUT(%SHORTINTEGER  N)
   LFLUSH %IF LBP = LD BUFFSIZE
   LBP = LBP+1;  LBUFF(LBP) = N
   LA = LA+2
%END
!
%ROUTINE  LSYM(%SHORTINTEGER N)
%OWNINTEGER  FLAG,V
   FLAG = \FLAG
   %IF FLAG = 0 %START
      LPUT(N<<8+V)
   %ELSE
      V = N
   %FINISH
%END
!
%ROUTINE DPUT(%SHORTINTEGER N)
   DBP = DBP+1;  DBUFF(DBP) = N
   DFLUSH %IF DBP = DIAG BUFF SIZE
   DA = DA+2
%END
%ROUTINE  DIAG LINE
%OWNINTEGER  HERE = 0
   %RETURN %IF HERE = CURRENT LINE
   HERE = CURRENT LINE
   DPUT(CURRENT LINE);  DPUT(CA)
%END
%ROUTINE T PUT(%SHORTINTEGER V)
   TBP = TBP+1;  TBUFF(TBP) = V
   T FLUSH %IF TBP = DIAG BUFF SIZE
%END
%ROUTINE  CLOSE OBJECT FILE
   CFLUSH;  GFLUSH;  LFLUSH
   DPUT(0);  DPUT(0);  D FLUSH ;  ! ... MARK END OF TABLE THEN FLUSH
   TPUT(X'8800');  TPUT(CA+2)
   TPUT(0);  TPUT(0)
   TPUT(0);  TPUT(0)
   TPUT(0);  TPUT(0); T FLUSH;   ! .... DITTO ....
   PUT HALF( (0<<4)!END OF FILE BLOCK );  ! ...ZERO DATA CONTENT
   PUT HALF(-END OF FILE BLOCK-1);   ! ...CHECK SUM
%END
!
!
!
!
!
   %ROUTINE MONITOR(%INTEGER N)
      SELECTOUTPUT(REPORT)
      PRINTSTRING("FAULT");  WRITE(N, 1)
      PRINTSTRING("   PHASE");  WRITE(PHASE, 1);  NEWLINE
      WRITE(REFS, 1);  PRINTSTRING(" REFS");  NEWLINE
      PRINTSTRING("MAX LABEL");  WRITE(MAX LABEL, 1);  NEWLINE
      %SIGNAL 15,15
   %END
!
   %ROUTINE SORT(%INTEGER FROM, TO)
      %INTEGER FLAG, J, T
      %RECORD(PFM)%NAME A, B
      %WHILE TO > FROM %CYCLE
         FLAG = 0
         A == PATCH(FROM)
         %CYCLE J = FROM+1, 1, TO
            B == PATCH(J)
            %IF A_WHERE > B_WHERE %START
               T = A_WHERE;  A_WHERE = B_WHERE;  B_WHERE = T
               T = B_WHAT;  B_WHAT = A_WHAT;  A_WHAT = T
               FLAG = 1
            %ELSE %IF A_WHERE = B_WHERE
               FLAG = 1
               A_WHERE = -10
            %FINISH
            A == B
         %REPEAT
         %EXIT %IF FLAG = 0
         TO = TO-1
      %REPEAT
   %END
   %ROUTINE NEXT CODE
      %OWNINTEGER P = 1, J = 1
      %INTEGER C, BV
      %RECORD(PFM)%NAME PP
      C = NEVER;  BV = NEVER;  MODE = NEVER
      %IF P <= CP %START;! CODE PATCHES LEFT
         %CYCLE
            PP == PATCH(P)
            %EXIT %IF PP_WHERE # -10
            P = P+1
         %REPEAT
         C = PP_WHERE>>1
      %FINISH
      %IF J < REFS %START;!  JUMPS LEFT
         B == JUMP(J)
         BV = B_CA>>1
      %FINISH
      CADDR = NEVER
      %RETURN %IF BV = NEVER = C
      %IF BV > C %START
         P = P+1
         CADDR = PP_WHERE;  CVAL = PP_WHAT
         %RETURN
      %FINISH
      %IF C > BV %START
         J = J+1
         MODE = 0;  CADDR = B_CA
         %RETURN
      %FINISH
      MONITOR(1)
   %END
   %ROUTINE NEXT GLA
      GADDR = NEVER %AND %RETURN %IF GP > MAX PATCH
      PAT == PATCH(GP) %AND GP = GP+1 %UNTIL PAT_WHERE >= 0
      GADDR = PAT_WHERE;  GVAL = PAT_WHAT
   %END
   %ROUTINE SET PERM(%INTEGER N)
      %INTEGER J,K
      %RETURN %UNLESS PEP(N) = 1
      PEP(N) = 2
      K = PERMS(N)
      %IF K = 0 %START
         SELECTOUTPUT(REPORT)
         PRINTSTRING("NO ENTRY FOR PERM");  WRITE(N, 1);  NEWLINE
         PEP(N) = 0
         SELECTOUTPUT(OBJECT)
         %RETURN
      %FINISH
      %CYCLE J = 1, 1, PERMS(K)
         K = K+1
         %IF PERMS(K) = EMARK %START
            N = PERMS(K+1)
            %IF PEP(N) # 2 %START
               PEP(N) = 1;  SET PERM(N)
            %FINISH
         %FINISH
      %REPEAT
   %END

%ROUTINE  PLANT LONG JUMP
   %INTEGER N
!  PLANT A BRANCH OR BAL INSTRUCTION WHICH IS ASSUMED TO BE DESCRIBED
!  BY 'L'(OP CODE + BASE REG), 'TAG'(DESTINATION ADDRESS),
!  'B'(NAME OF RECORD CONTAINING FLAG BITS) AND 'CA'(CURRENT CODE
!  ADDRESS).
   %IF B_LAB&VERY = 0 %START;    ! ...CAN USE A 32 BIT FORM
      N = TAG-(CA+4)
      %IF -16*1024 <= N < 16*1024 %START;      ! USE PC RELATIVE
         L = L&X'FFF0';          ! STRIP OFF BASE REGISTER
         CPUT(L);  CPUT(N!X'8000' )
         RX2 = RX2+1
      %ELSE;          !USE BASE+DISP
         CPUT(L);  CPUT(TAG)
         RX1 = RX1+1
      %FINISH
   %ELSE;                        ! ...48 BIT ADDRESS REQ'D
      CPUT(L)
      CPUT((TAG>>16&X'FF')+X'4000')
      CPUT(TAG);      ! ...N.B. 'CPUT' ONLY PUTS 16 BITS
      RX3 = RX3+1
   %FINISH
%END



!
! PHASE 1 - INPUT PROGRAM & GENERATE JUMP TABLES + PATCH TABLES
!
   PHASE = 1
   PEP(J) = 0 %AND PADDR(J) = 0 %FOR J = 1, 1, MAX PERM
   CP = 0;  GP = MAX PATCH+1
   REFS = 0;  DEFMOD = 0;  UCA = 0;  CCA = 0;  CTAG = 0
   LAB(J) = 0 %FOR J = 1,1,MAX LABELS
   SELECTINPUT(DIRECT)
   READ SYMBOL(INIT GLA);  ! MINIMUM POSSIBLE SIZE OF GLA - FROM PASS 2
   %CYCLE
      READSYMBOL(CODE);  ->D(CODE)
D(1):! TAG DEF <REF>, <CA>
      GET(TAG);  GET(CA)
      MONITOR(2) %IF TAG > MAX LABELS
      MAX LABEL = TAG %IF TAG > MAX LABEL
      %IF TAG = CTAG %AND CCA = CA %AND UCA = CA %START
         DEFMOD = DEFMOD+2
         UREF_LAB = UREF_LAB!PERM!COND
         CREF_LAB = CREF_LAB!VERY!RT
         CTAG = UREF_LAB&LABEL
         CREF == UREF
         CCA = CA+2
      %ELSE
         CTAG = 0
      %FINISH
      LAB(TAG) = CA
      %CONTINUE
D(2):! CREF <REF>, <CA>
      FLAG = COND;  ->CURP
D(3):! UREF <REF>, <CA>
      FLAG = 0;     ->CURP
D(4):! RREF <REF>, <CA>
      FLAG = RT+LONG
      RTNCALLS = RTNCALLS+1
      -> CURP

D(5):! PREF <REF>, <CA>
      FLAG = PERM+LONG
      PERMCALLS = PERMCALLS+1

CURP: GET(TAG);  GET(CA)
      REFS = REFS+1;  R == JUMP(REFS)
      MONITOR(1) %IF REFS > MAX JUMPS
      R_LAB = TAG+FLAG
      R_CA = CA
      %IF FLAG = 0 %START;       ! UNCONDITIONAL
         UCA = CA+2;  UREF == R
      %ELSE %IF FLAG = COND;     ! CONDITIONAL
         CCA = CA+4;  CTAG = TAG;  CREF == R
      %FINISH
      %IF FLAG&PERM # 0 %START
         %IF TAG > MAX PERM %OR PERMS(TAG) = 0 %START
            SELECTOUTPUT(REPORT)
            PRINTSTRING("NO PERM");  WRITE(TAG, 1);  NEWLINE
            SELECTOUTPUT(OBJECT)
         %ELSE
            PEP(TAG) = 1
         %FINISH
      %FINISH
      %CONTINUE
D(6):! GPATCH <WHAT>, <WHERE>
      GP = GP-1;  PAT == PATCH(GP);  ->PWW
D(7):! CPATCH <WHAT>, <WHERE>
      CP = CP+1;  PAT == PATCH(CP)
PWW:  GET(TAG);  GET(CA)
      PAT_WHAT = TAG;  PAT_WHERE = CA
      MONITOR(4) %IF CP = GP
   %REPEAT
D(8):! END MARKER
   GET(CODE SIZE);  GET(GLA SIZE);  GET(LINE SIZE);  GET(DIAG SIZE)
   CODE SIZE = CODE SIZE-DEF MOD
   REFS = REFS+1;  JUMP(REFS) = 0
   %IF DEF MOD # 0 %START
      REF EXTRA = 0
      %CYCLE L = 1, 1, REFS-1
         R == JUMP (L)
         R_CA = R_CA-REF EXTRA
         %IF R_LAB&COND # 0 %AND R_LAB&RT # 0 %START
            REF EXTRA = REF EXTRA+2
            %CYCLE K = 1, 1, CP
               PAT == PATCH(K)
               PAT_WHERE = PAT_WHERE-2 %IF PAT_WHERE > R_CA
            %REPEAT
            %IF GP <= MAX PATCH %START
               %CYCLE K = GP, 1, MAX PATCH
                  PAT == PATCH(K)
                  PAT_WHAT = PAT_WHAT-2 %IF PAT_WHAT > R_CA
                  PAT_WHERE = PAT_WHERE-2 %IF PAT_WHERE&1 # 0 %AND  %C
                                           PAT_WHERE > R_CA
               %REPEAT
            %FINISH
            %CYCLE K = 1, 1, MAX LABEL
               LAB(K) = LAB(K)-2 %IF LAB(K) > R_CA
            %REPEAT
            DEFMOD = DEFMOD-2
         %FINISH
      %REPEAT
      MONITOR(5) %IF DEFMOD # 0
   %FINISH


! IDENTIFY THOSE PERM ROUTINES WHICH ARE REQUIRED.
   PERM SIZE = 0
   SET PERM(J) %FOR J = 1,1,MAX PERM
   %CYCLE  J = 1,1,MAX PERM
      %IF PEP(J) # 0 %START
         PADDR(J) = CODE SIZE
         L = PERMS(PERMS(J))*2
         CODE SIZE = CODE SIZE + L
         PERM SIZE = PERM SIZE + L
      %FINISH
   %REPEAT


! PHASE 2 - IDENTIFY LONG JUMPS
!
   PHASE = 2
   %IF REFS > 1 %START
   %CYCLE
      FLAG = 0;  REF EXTRA = 0
      %CYCLE L = 1, 1, REFS-1
         R == JUMP(L);! JUMP REFERENCE
         R_CA = R_CA+REF EXTRA
         %CONTINUE %IF R_LAB&VERY # 0;! ALREADY VERY LONG
         EXTRA = 0
         J = R_LAB&LABEL
         %IF R_LAB&PERM = 0 %OR R_LAB&COND # 0 %C
                %THEN K = LAB(J) %ELSE K = PADDR(J)
         %UNLESS -30 <= K-R_CA <= 30 %START;  ! ...CAN'T BE SHORT
            %IF R_LAB&LONG=0 %START;          ! ...BUT IT IS...
               %IF K < 16*1024 %OR -16*1024<=K-(R_CA+4)<16*1024 %START
               ! 32 BIT FORM:  BASE+DISPLACEMENT  OR  PC RELATIVE
                  EXTRA = 2;  R_LAB = R_LAB!LONG;  ! SHORT -> LONG
               %ELSE
               ! 48 BIT FORM REQ'D:  BASE+DISP
                  EXTRA = 4;  R_LAB = R_LAB!VERY;  ! SHORT -> VERY
               %FINISH
            %ELSE
               %UNLESS K<16*1024 %OR -16*1024<=K-(R_CA+4)<16*1024 %START
                  EXTRA = 2;  R_LAB = R_LAB!!(LONG!VERY); ! LONG -> VERY
               %FINISH
            %FINISH
            %CONTINUE %IF EXTRA = 0;  ! ...NO CHANGES REQ'D
            FLAG = 1
            ! ADJUST PATCHES
            %IF CP > 0 %START
               %CYCLE K = 1, 1, CP
                  PAT == PATCH(K)
                  PAT_WHERE = PAT_WHERE+EXTRA %IF PAT_WHERE > R_CA
               %REPEAT
            %FINISH
            %IF GP <= MAX PATCH %START
               %CYCLE K = GP, 1, MAX PATCH
                  PAT == PATCH(K)
                  PAT_WHAT = PAT_WHAT+EXTRA %IF PAT_WHAT > R_CA
               %REPEAT
            %FINISH
            ! ADJUST REMAINING REFS
            %CYCLE K = 1, 1, MAX LABEL
               V == LAB(K)
               V = V+EXTRA %IF V > R_CA
            %REPEAT
            %CYCLE K = 1, 1, MAX PERM
               PADDR(K) = PADDR(K)+EXTRA %IF PADDR(K) # 0
            %REPEAT
            REF EXTRA = REF EXTRA+EXTRA
            CODE SIZE = CODE SIZE+EXTRA
         %FINISH
      %REPEAT
   %REPEAT %until flag = 0
   %FINISH
!
! PHASE 3 - GENERATE OBJECT FILE
!
   PHASE = 3
   J = MAX PATCH+1;  K = J
   %WHILE J > GP %CYCLE
      J = J-1
      PAT == PATCH(J)
      %IF PAT_WHERE&1 # 0 %START
         PAT_WHERE = PAT_WHERE&(\1)
         CP = CP+1;  PATCH(CP) = PAT
      %ELSE
         K = K-1;  PATCH(K) = PAT
      %FINISH
   %REPEAT
   GP = K
   SORT(1, CP)
   SORT(GP, MAX PATCH)
!
!
   SELECT OUTPUT(OBJECT);  PUT HALF(X'8282')
!
! OUTPUT A CONTROL BLOCK GIVING CODE  AND GLA SEGMENT SIZES(IN
! HALF-WORDS).  OTHER PARAMETERS MAY BE ADDED AS REQ'D.
!  USES 'GBUFF' AS WORKSPACE.
   GBUFF(1) = (CODE SIZE + 1)>>1
   GBUFF(2) = (GLA SIZE + 1)>>1
   GBUFF(3) = (DIAG SIZE+16)>>1;    ! ... +16 FOR EXTRA WORD AS TERMINATOR
   GBUFF(4) = (LINE SIZE+16)>>1
! -------REQUIRES LOADER DATA SIZE-----------
   PUT BLOCK((4<<4)!SEGMENT SIZE BLOCK,GBUFF)
!
   SELECT INPUT(PSEUDO OBJ)
   CA = 0;  GA = INITGLA;  LA = 0;  DA = 0
   CURRENT LINE = 0;  CBP = 1;  CFLUSH
   GBP = INIT GLA>>1;  LBP = 0;  DBP = 0;  TBP = 0
   NEXT CODE;  NEXT GLA

   READSYMBOL(CODE);! = 1
   IGNORE = 0;  LAST = 0
   %CYCLE
      READ SYMBOL(CODE);  -> C(CODE+IGNORE)
C(2):! CODE <VAL>
      GET(L)
      %IF CA = CADDR %START
         %IF MODE # 0 %START;! CODE PATCH
            CPUT(CVAL)
         %ELSE;!  JUMP+PERM+RT
            TAG = LAB(B_LAB&LABEL)
            %IF B_LAB&(PERM!RT) = 0 %OR B_LAB&COND # 0 %START;! JUMP
               %IF B_LAB&(PERM!RT) # 0 %START
                  %IF B_LAB&RT # 0 %START
                     LAST = L %IF LAST = 0
                     LAST = NOT(LAST&15)!X'8000'
                     NEXT CODE
                     %CONTINUE
                  %FINISH
                  L = LAST;  LAST = 0
               %FINISH
               L = L&15
               %IF B_LAB&(LONG!VERY) = 0 %START;! LEAVE IT SHORT
                  J = (TAG-CA)//2
                  MONITOR(5) %UNLESS -15 <= J <= 15
                  %IF J < 0 %THEN CPUT(SB(L)-J) %C
                            %ELSE CPUT(SF(L)+J)
                  SJ = SJ+1
               %ELSE;               ! MAKE IT LONG
                  L = LJ(L);  PLANT LONG JUMP
               %FINISH
            %ELSE;! PERM OR ROUTINE
               DIAG LINE
               IGNORE = 5
               TAG = PADDR(B_LAB&LABEL) %IF B_LAB&PERM # 0
               PLANT LONG JUMP
            %FINISH
         %FINISH
         NEXT CODE
      %FINISH %ELSE CPUT(L)
      %CONTINUE
C(11):GET(J)
      %IF J = X'FFFF' %START
         GET(J)
         TPUT(X'4000');  TPUT(CA)
         %CONTINUE
      %FINISH
      TPUT(J)
      GET(K)
      K = CA %IF J&X'8000' # 0
               TPUT(K)
      GET(K);  TPUT(K)
      GET(K);  TPUT(K)
      GET(K);  TPUT(K)
      GET(K);  TPUT(K)
      %CONTINUE
C(10): DIAG LINE;  %CONTINUE
C(4):
C(9):CURRENT LINE = CURRENT LINE+1;  CFLUSH
     %CONTINUE;! LINE FLAG
C(7):IGNORE = 0;  GET(L);  %CONTINUE
C(6):L = NL
     J = 0
     %CYCLE K = 1, 1, 9
        %IF L # 0 %START
           READSYMBOL(L)
           J = J+1;  LTEMP(J) = L
        %FINISH
     %REPEAT
     READSYMBOL(L) %WHILE L # 0
     J = J-1;  LTEMP(0) = J
     LSYM(LTEMP(J)) %FOR J = 0, 1, 8
     GET(K);  READSYMBOL(L)
     LSYM(L);  LPUT(K)
     %CONTINUE
C(8):
C(3):! GLA <VAL>  -- SWITCH VECTOR ELEMENT
      GET(L)
      %IF GA = GADDR %START
         L = GVAL
         NEXT GLA
      %FINISH
      GPUT(L)
   %REPEAT
C(5):! END
   %CYCLE J = 1, 1, MAX PERM
      %IF PEP(J) # 0 %START
         K = PERMS(J);  MONITOR(6) %IF K = 0
         L = PADDR(J)
         MONITOR(7) %IF CA # L
         CFLUSH %IF CBP+PERMS(K) > CODE BUFF SIZE
{         %CYCLE L = K+1, 1, K+PERMS(K)      L is corrupted below!! }
         l = k;  z = k + perms(k)
         %while l # z %cycle
            l = l+1
            TAG = PERMS(L)
            %IF TAG = EMARK %START
            !  USE PC RELATIVE UNCONDITIONAL BRANCH FOR INTERNAL
            !  LINKING BETWEEN PERM ROUTINES.
               CPUT(X'4300')
               L = L+1;  CPUT((PADDR(PERMS(L))-CA-2)!X'8000')
            %ELSE
               CPUT(TAG)
            %FINISH
         %REPEAT
      %FINISH
   %REPEAT
!
   CLOSE OBJECT FILE
!
   MONITOR(9) %UNLESS CADDR = NEVER
   MONITOR(10) %UNLESS GADDR = NEVER
   SELECTOUTPUT(REPORT)
   DA = DA+DIAG SIZE
   PRINTSTRING("CODE");  WRITE(CODE SIZE-PERM SIZE, 1)
   PRINTSTRING(" + GLA");  WRITE(GLA SIZE, 1)
   PRINTSTRING(" + PERM");  WRITE(PERM SIZE, 1)
   PRINTSTRING(" + DIAGS");  WRITE(DA, 1)
   PRINTSTRING(" =")
   WRITE(CODE SIZE+GLA SIZE+DA, 1)
   PRINTSTRING(" BYTES")
   NEWLINE
%ENDOFPROGRAM;     !**REMOVE FOR EXTRA MONITORING**
! ------TEMPORARY EXTRA MONITORING-------
   NEWLINE
   PRINT STRING("JUMPS:")
   WRITE(SJ,1);  PRINT STRING(' SHORT,')
   WRITE(RX1,1); PRINT STRING(' RX1,')
   WRITE(RX2,1); PRINT STRING(' RX2,')
   WRITE(RX3,1); PRINT STRING(' RX3')
   NEWLINE
   PRINT STRING('...INCLUDING')
   WRITE(PERMCALLS,1); PRINT STRING(' PERMCALLS AND')
   WRITE(RTNCALLS,1); PRINT STRING(' CALLS ON USER-DEFINED ROUTINES')
   NEWLINES(2)
%ENDOFPROGRAM
%ENDOFPROGRAM;     !**REMOVE FOR EXTRA MONITORING**
! ------TEMPORARY EXTRA MONITORING-------
   NEWLINE
   PRINT STRING('JUMPS:')
   WRITE(SJ,1);  PRINT STRING(' SHORT,')
   WRITE(RX1,1); PRINT STRING(' RX1,')
   WRITE(RX2,1); PRINT STRING(' RX2,')
   WRITE(RX3,1); PRINT STRING(' RX3')
   NEWLINE
   PRINT STRING('...INCLUDING')
   WRITE(PERMCALLS,1); PRINT STRING(' PERMCALLS AND')
   WRITE(RTNCALLS,1); PRINT STRING(' CALLS ON USER-DEFINED ROUTINES')
   NEWLINES(2)
%ENDOFPROGRAM
   NEWLINE
   PRINT STRING('JUMPS:')
   WRITE(SJ,1);  PRINT STRING(' SHORT,')
   WRITE(RX1,1); PRINT STRING(' RX1,')
   WRITE(RX2,1); PRINT STRING(' RX2,')
   WRITE(RX3,1); PRINT STRING(' RX3')
   NEWLINE
   PRINT STRING('...INCLUDING')
 H?   4 4A                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!         ( |}  
     ~   	        NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z                  "A    !!    " A!  a     " A a  
   #a!    !! a    !! a    !  a    !! a    !     !      !      " ! ! B 	  
!     "a A!   !    !    a a   (!  	  1#  a  a a a b    A   G$"  A b   !   B  a B   f!   k" A A !  B C   &!  A  A       ze!!!z! a! a AA  bA !  A  ! b B     #   aA  b    ! B Ba a a aA  ! !a % a a!   a  a a "  " A b !  a  !a  a a a   Ab A  e!" a     a   A!   A B"  !  ! A A aA C A  A ! A B A  AAAA A ! A! a a   a! C A  B  B a!a a!  A ! b B BAA a!!!       dQ@    D"Z 	,       W   ,v   g\24%   W   	g\ox   2چ 48@   6>   (^C   2چ ,8@   0W   @     ,@     K@     @     }@     U}      W   	.U}      W   	M}      W   	NQ@     W  'a+   }      W   	i-XH  2@ 	}         	w S;op   W   	y*}      (_Q@  X   ,'a+ 0>   4}   Đ 8@  Đ <   !X`}  d   >   ,   0  Đ 4f   X`~$@   wdQ@   W   ,>   0D   eZ_AՁ ,W   	ox        +   K(   (   Lv"AH   "AH   -xB@   MYH   dTAH   i.H  xQK*!   |:y~$@   qN#p   9f` 'a+ qNv qV~XH >   D   K       @   .@   @}/  #pĀd<  +9    S K;} $S@(Ё,1K 0+Ё4/1K Ā8%Ā<%Ā@p  ĀD  H  LeAwPt\  Tt]  Xt^  \xP  `sM  ddQL  h   j,   lK`  n`  p}`    BYTES  BYTES  =  + DIAGS  + PERM + GLA CODE NO PERMNO ENTRY FOR PERM	MAX LABEL REFS   PHASE FAULT  Q2P24  )	f	u	  C>  B>  B  B.  C.  C  C>  B>  B.  B  C  C.  C               #0  !0  !  !   #   #  #0  !0  !   !  #  #   #                "0   0         "   "  "0   0         "  "   "                                             
   	                      7          K                      F                              <   ^   Y    A     P   K   w   p   i   c      A  i     %  *  /  N   U   W  5  :  ?  E  n  z  o     $@  X=          $A  X=          $E  X=          $B  X=          $C  X=          $D  X=                        $I  X=          $J  X=          $j  $E  X=          V  $j  $G  X=          `      $E  X=          V  `      $G  X=          $F  X=          H           !5  $  $          0    !    C         C       #  '1  H  C       @  C       '2  "     "  H           !5  $  $             R      e  
b  
P  P     #%  $  $       R      '    &a  &  1      6      "     b        R      P  #  
  #  6      1      8  &  &a  '  "  U     ]  з       H          #8      H           !5  $  $               B  "        '  B    &  &  <      >      "9  &  '  C     ѷ         f  !5     7  C     ;  2  6          #8  &a  &  6      <      "  U  !6     B0    C   "  
        
  0  ;  5        #8  &  &Q  5      ;      "  ѷ             '       a  @         '  H6      0    !5  $  $       3  3  U  #(  X   ,    !$    &  #  $  $       7   ,          
e  '    &1  &      #      &a  "     $H  X=          h'   ,  Xg   0  XW   4  @     X=        	  h'   ,  Xg   0  @     X=        	  Xg   ,  XW   0  @     X=          0  
3  '4    X  C       P  C       "   	  0  
3  $   '4    P  C       "     1  I2     !+  K2      !  
3  s3  B      #3  
>  3  !  $  $          P     P6     PV      5    !%  $  $       !    $                   Ps      Q      Pc     '  
q  X=      s     #'  q  !  $  $       X^     P      8  PQ  B    '   5     3  #  #  $  $       $  '1      "     $  /     #  -  (   $        8  ,  '  "              
          ,  @     X=             ,  @     X=          $M  X=          $N  X=          $O  X=          @     X=          $K  X=          $L  X=          @     X=          @     X=          /       X          $  $          h   ,    @      P   ,  j   ,  .       h   ,  .       h   ,  .  /!  +       X   ,  `     d  `    @g      $`  @g     `    @g     C         "  #:              &  !     8  $  $          8  $  $          H  $  $                  $  $          Y      !  Y     !$  \       !  $  $          Jx      X           C     Kx      $  $          G  JH      Jx     X           #  Kx     $  $       X     P      &D  G  "$  C               
   ?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nX# Y !Y !&\ Z  B!$$A> З  $1$H  H X [ &B0P  [ ,&' ?P  
*&30H  P  ї  C Kї  $$A> 
Y  #%$$A> 
qPr  PB &(pX  ?$PS?PE   &T 41I2 !,K2  !
3s3B  #9
3
>!$$A> !$$A> A> O$$A> "#:  ! ?$$A> ?$$A> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$2#XC   PC   '4"2$ #PC   '4"- g A , X W   X9 P  W   P ,X X  P  y  (	g A , X h` W   <Hi ` W   <y  	g A 4 X AH9 40P9 <$$!A@ 4AC >&@ 4AP 89 ,A H  @ 6HI 
J@I jARH 4U 8AU <B0P 8$PKY eA,y  P	g A , X AH9 40P9 8$$!A@ ,AC <&@ ,AP 4i 0A|H XI 0L
@ dAH ,U 4AU 8B0P 4$PKY eAy  O	w A , X H8h0 #?4c` XP ,XP 0A$@h8A X @  Ay  2	w A , X H8j#?4c` XP ,XP 0A*$@jy  "	w A , X H8l#?4c` XP ,XP 0A$@ly  "	w A , X H8n!4y 4XP ,XP 0c A$@nC  #	w A , X H8p#?4c` XP ,XP 0A\$@py  "	g A , X H8h&1@8h8A @a  X &P y  !	g A , X H8j0 !3AHj&@j8A H @  XH L&BPH y  *	g A , X H8l0 !3A|Hl&@l8A H @  XH L&BPH y  *	g A , X %1XML4P=!:hX]\
eAx#Pmy  "	g A , X H8n&1@8n8A @a  HnŰ !3AX &P y  (	w A , X X=XH L4!4y PMdA~Xh lAr" "	g A , X H8p&1@8p8A @a  HpŰ !3Ay  !	w A , X ApAA$`A$`A AD`   AX8 <c Av$`Ap$`Aj$`Ad$`A^$`AX$`ARAH$`A%aAy  C	g A , X $`W   l.W   H$QXi W   T$W   H$QXhLlW   TW  ,$QXh lW   TW   HW  ,W   H$QXmxW   TW  ,$ $A e	W  A , X X9  Y9 C $P ,X 8 TA P 8X  P DXI $!API 0C &API 0PI @8 TA P <XY 8\Xe lX 	kC `Pi 4P X <XI 4LPJ XY <\Xe  lPi 4X9 8<Xc  lPe  X 8X 4P  $API ,#	k!7$P ,%jPe XI <LPI 8XI 0UI @AUI DB0:P @XY ,\U!2#Xi  'aPi  C y  	w A , X 0P9 ,P9 0P8$XMXX \	EB 4X8 TA P 4Xa l`#2#X&PC aPi ,XXH L	#8 <A PDXQ \QPY 0`Ph(Ui 0!7Ui ,!4y X9 0Y9 ,C .X&PXY 4\Xe lPh(Xe  lPh,C X ,	C $&P$PPX$XhDlXf lPh(C $aA 	w A , X X8 <0#(@PH0y X 8 TA PXX &QPX Xa lf#C Ph0X  P4C  :	g A , X 8 A XA  L@ #4y A $RPQ  X =PA Xa  Pi 0B0V$`W   lW   H$QXi W   TW  ,X 8 A $P  $bW   lC A X  P 8$@$!API ,C x&API ,PI 4XY 0\&QPY 0=PA Xa  `  B0< A X  P 8 A X  Š #;A $APA  Xi AXI ,UI 4AUI 8B0P 4C  	w A , X X8D<XC  L@   B0XX \Xhle Pi ,` BB`@ C:X8 <0  P8 cAX ,k`   AXT&PTC "Xh lAXhlAXHP&APHPC :Xh lAXX\P P e@ AXhlAXhX&aPhXy  |	w P (A , X H ,$1P4 ȰP A   ( <ALH D$QPT 0P4 A   ( TALH \$PPT 0P4 A   ( lALH t$PPT $9P4 A   ( ALH $QPT 0 6P4 A   ( ALAL$PPXPPXTPXXPX\PX`PXdHt$1P4 Ȱ P A   (ALALH$QPT 0 P4 A   (ALH$QPT P A   (ALH$1P4 P PT A   (AL$1P8L$&P P8 A $P  X 8 A $P  X UAŰ 6B0P$@PH PPX PH PHPHPHPHd&aPh Ph8 lA $P  Xh UhA`B0P$cW   `W   P|W   P .LAhAh AXɠ#$$bAYx##PxXB0XHLXX \EB0~XhleB0pX8<&2P8X8X   `  P  X<XI  L@   PI  XX8\Xe  l`  PhPX<X8 <&2P8#$PX8 lA X P  C  @  P C 4$P C *@   PH XX`&QPX`#`   Ph X8d&1P8dhAh AX &P 8 <A P@ɰ#$$aAfXX 
P  XH@LXX \PT Xh lfB0X8 <&2P8X@P8C 0` @  B0&X &PXPX8@<P8<`    C0vXɰ 6!*=PA X  B0F$`W   lW   H$QXhlW   TW  ,$bW   l#	8 A $P  C XH L'APH 8 TA P#XX \&QPX 8 TA PhANh AFXhlX8<P6  XX P X XH L!4$dAC h Ah Ah Ah AXX \XhlVPX X8 <&1P8 8 <A !$2AFfC0^$P X 'P	$!AP C &P P8 <A P@XA LXX \EPA Xh@lX6  <0 @  C00   C0X &P X P$	$!AP C F&P P8 TA PXA LXX@\Xe l	F#$'BPA X UAUB0PX8 <0B '1$!AP8 C v&1P8 P88 TA PX  X@X 	#$'P  XHLXT \P #>Xh@lX6 <	S#$'RPT X8 U8A0B0PXxP$
$!AP C `&P P8 lA X  XH@LXT \	C "A PA Xa  lX'bPk  X UAUB0PX'PX UAUB0PX#4$eA$@PH T&QPX PXeAXX UXAP 6B0P$`&aPh Ph8 A X  C0T8 A X P  X =PA X  A X  
P XH L
IPH XX \
YPX Xh UhA` 6B0vP$bPhLX8 <0 C $P P X 'P	$!AP C T&P P8 <A P@XA LXX \
EPA Xh@lX6  <0   #3C $P0  P8 X      #5 @  #=8 lA X  P #8 A XQ  \PX X8 <X 90!0 C    B0@XX P@ !Y P !P@ #$P   P  #	$P   P  C ,X8 0@ B 9 0 !0@ !$P   P  X!3C $P XH LDC rPH$P)APX C N&QPX PX8 TA PXa lX@X 	j#(X
iPa XX UXAUXB0PXH L@B p'A$!APH C N&APH PH8 TA PXQ  \Xh@lX 	[#(X
ZPQ  XH UHA@B0PXxP$@$!APH C N&APH PH8 lA PHXQ  \Xh@lX 	[#(X
ZPQ  XH UHAUHB0P$&P P8 A XA  LDC0*A PA XQ  \XhX
[PV  X UAŐ 6B0PX X
P XH L
IPH X UAUB0PXX \U#3C d$cPhL0P8 P8 X X 	C 'P 8 TA PX Ð C0:ĐP XH L&APH 8 TA PXX($2A0C &XX \'QPX A PXX($2A0C bX P XX \$aAPXh lA$bW   l`  A4$8A Xh l&aa@a  fA$8A X &@  A$8A X Ț @  A$8A XH LT Q@Q  UAXP ,XP 0` OA$bW   `$`Ph X=|P8 Ph Ph Ph $@hAX|@jA$@l@n@pAAW   P $@PH PH W   P XX \
.4Ah AXh lX8(<cB0X$#9Xh,lAC vXDX    8 lA XA  LPH 0  #6 @  C0 0  C0X   C0<XX \U!7XX \PX  =XA XQ  P   PX AC 2XX \PX $PPX XX \P PX    B0ZF#&A@ PH @!@ #$$eArD#=`A Xa  dA#=hA Xa  
dAXh\&aPh\#X =pA X  P AC BA$P XDXI  L@    #?  8 A XQ  \PXAA#Xh lA:C 4h AXh l`  B0 h A`@ AXh lAC Ah AX8 <0   #7X P Xh lAh A~Xh lAvh AjXh lAbh AVXh lANh ABXh lA:C rAC jX &P AC T$P h AC B$JPH $PPX e&aPh PhX8 <3C0.W   P X &P 8 A X P  Xh UhA` 	B0PX #9W   P "XH L'APH $8 A PA  %Q&QPX PX8 A Xa  lAhXX UXAP B0Ph AW   P aA4Xh lAC 8h AXh lX80<c!9X4P AXh lADC $&P P8 A X  C0=PA XA  PH !4$fAJ8 A XQ  \PX Xh le#4$gA"=PA HhZ  ɰ ##AX P =PA Z  P X XH LC0z&P =PA XQ  PXP  B0N`C AXh l&aPh =PA X  8 A X  X k`   A#eAC pX UAŠ 6B0PAX(Ő#4$iA(XH0L@#4$jA$`W   lXX \Xh l
VPX W   HX8 <cX k$QW   TW   H$QXh lW   TW   H$QXh lW   TW   H$QXh lW   TW   HX X 
jXH L
d$QW   TW   HW  ,x 
x 
           brn     link
                                   48  ;
 044A:  9AED                       49  outch:   outb    dev,char
 044C:  9DEC                       50  outr:    ss      dev,dum        ; Wait till not busy
 044E:  2091                       51           bt      9,outr
 0450:  C5D0 000D                  52           cl      char,#CR
 0454:  023F                       53           bne     link
 0456:  24DA                       54           ld      char,#NL
 0458:  2207                       55           brn     outch
                                   56  ;
                                   57  ; Get a line, store at buffer pointed to                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |          l,``                   S g T  d i U | j V  c W   h X  e     m Z  n [ $ n \ ( 1 ]  4 1 ^  > o _  E 1 `  K            63           ss      dev,dum
 046E:  2014                       64           bt      1,comm1
 0470:  41F0 048C                  65  inr:     bal     link,inch      ; Get a char
 0474:  D2D1 0000                  66           stb     char,(point)   ; Store in buffer
 0478:  2611                       67           add     point,#1
 047A:  C5D0 000D                  68           cl      char,#CR       ; Was it a CR?
 047E:  2037                       69           bne     inr            ; No
 0480:  07DD                       70           xor     char,char      ; Yes - store a 0
 0482:  D2D1 0000                  71           stb     char,(point)
 0486:  D1C0 0418                  72           ldm     dum,savreg     ; and stop
 048A:  030F                       73           brn     link
                                   74  ;
 048C:  9DEC                       75  Inch:    ss      dev,dum
 048E:  2091                       76           bt      9,inch
 0490:  98ED                       77           inb     dev,char
 0492:  9AED                       78           outb    dev,char
 0494:  44D0 007F                  79           and     char,16_7F
 0498:  030F                       80           brn     link
                                   81  .end
                                   82  ;
 049A:                             83  .section finish
 049A:  0000                       84  finish:   .word   0
                                   85  .end
                                   86  .stop


 *** Table of names ***

 Global names

    CR     000D  =                NL     000A  =                

 Section: TEST   Data half: 0400   Program half: 040E

    BUFF   0400                   RND    040E  P                

 Section: NIMCON   Data half: 0418   Program half: 0424

    SAVREG 0418                   RESET  0420                   READ   0421                   WRITE  0422                   
    CONSOL 00C0  =                LINK   000F  R=               DEV    000E  R=               CHAR   000D  R=               
    DUM    000C  R=               POINT  0001  R=               OUTLN  0424  P                OUTRN  0434  P                
    RET    0444  P                OUTCH  044A  P                OUTR   044C  P                INLN   045A  P                
    COMM1  0466  P                INR    0470  P                INCH   048C  P                

 Section: FINISH   Data half: 049A   Program half: 0000

    FINISH 049A                   

Finished: No errors.

*L 0 40E 400 49A
*400
48
41
4C
4C
4F
20
54
48
45
52
45
D
A
0
*40E
C8
10
4
0
41
F0
4
24
22
4
*418
*420
3
82
2
*424
D0
C0
4
18
C8
E0
0
C0
DE
E0
4
20
DE
E0
4
22
D3
D1
0
0
8
DD
23
35
41
F0
4
4A
26
11
22
7
D1
C0
4
18
3
F
9A
ED
9D
EC
20
91
C5
D0
0
D
2
3F
24
DA
22
7
D0
C0
4
18
C8
E0
0
C0
DE
E0
4
20
DE
E0
4
21
98
ED
9D
EC
20
14
41
F0
4
8C
D2
D1
0
0
26
11
C5
D0
0
D
20
37
7
DD
D2
D1
0
0
D1
C0
4
18
3
F
9D
EC
20
91
98
ED
9A
ED
44
D0
0
7F
3
F
*49A
0
0
.Title Test of NIM
;
.load 0,test,16_400,finish_finish
;
CR=13
NL=10
;
.section test .at 16_400
buff:      .byte "HALLO THERE",CR,NL,0
.program
rnd:   ld      r1,#buff
      bal     r15,nimcon_inln
      ld      r1,#buff
      bal     r15,nimcon_outln
      brn     rnd
.end
;
.section nimcon
;
;
; Nim console routines. Non-interrupt.
savreg:  .block  8
reset:   .byte   16_03
read:    .byte   16_82
write:   .byte   16_02
console=16_C0
link=r15
dev=r14
char=r13
dum=r12
point=r1
;
.program
;
; Send a line pointed to by r1
outln:   stm     dum,savreg
         ld      dev,#console
         outc    dev,reset
         outc    dev,write      ; Select write mode
outrn:   ldb     char,(point)   ; Next char
         ld      char,char
         bz      ret            ; Char was 0 - stop
         bal     link,outch     ; Send char
         add     point,#1
         brn     outrn
ret:     ldm     dum,savreg
         brn     link
;
outch:   outb    dev,char
outr:    ss      dev,dum        ; Wait till not busy
         bt      9,outr
         cl      char,#CR
         bne     link
         ld      char,#NL
         brn     outch
;
; Get a line, store at buffer pointed to by r1
inln:    stm     dum,savreg
         ld      dev,#console
         outc    dev,reset
comm1:   outc    dev,read
         inb     dev,char       ; Extra char to prime
         ss      dev,dum
         bt      1,comm1
inr:     bal     link,inch      ; Get a char
         stb     char,(point)   ; Store in buffer
         add     point,#1
         cl      char,#CR       ; Was it a CR?
         bne     inr            ; No
         xor     char,char      ; Yes - store a 0
         stb     char,(point)
         ldm     dum,savreg     ; and stop
         brn     link
;
Inch:    ss      dev,dum
         bt      9,inch
         inb     dev,char
         outb    dev,char
         and     char,16_7F
         brn     link
.end
;
.section finish
finish:   .word   0
.end
.stop
 H?   , ,v                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
> <=     W  p1 P ,P%1m$A?0A?0A?0AC jW  p 4Xm!$y Yo+!` AXo0B08$bAXmPi 0$P ,Xi ,Ui 0#;&aPi ,
f
mHfA0"$aA$`Pmy W  p ,$Q+X]P G##Ar$aQmX

XY @[y W  p 0  $P ,#4aA$\	 ,Xi aAy W  p ,A|Xi  Ay W  p 8C bW  p 8Ȱ P ,Xj ,C0B'fPj ,X   İ ?P 4C0$ʰ  P 4XY 0#<#kA#kA*$aQi 0C z Xi #$P %mPi 0#$P 0Xi b
oX 0P ,XY ,[P X P 4XY ['QPY ,Xi ,Ui 4#;&aPi ,b
oXf (A4"y W  p <$P 0kAJXo+#3Po+X_+PY ,U_+!9X ɠ #$$P ,$Q0X0Z ,&P 4Xo+C ~X+|!7XY 0P B0lXY 0P #8$TXo+A0AXo+Pi 8$PP_+Xo+Ui 8C00&aPo+Ui ,!:X 0Ű !5` |AXo+
mf7AC 
mӶ7P+Xo+` 
#3A` *AXi 0` !:$TXo+AAxC  ApXi ,#<%aZi 4ARA! 1AvX -AACOMPILER ERROR!ARC ATEXT TOO LONGA8C ATOO MANY NAMES!AC ATOO MANY LONG NAMESAC APROGRAM TOO COMPLEXAC AACCESSMAXi 0` !4%Q0C jAFORMSAC XAATOMSAC FATYPESAC 4ANAMESApC "ASIZESA^C ACONTEXTAJC AMATCHA8C ACOPYHA&C ASPECHAC A%ENDHAC A%CYCLETAC A%REPEATAC z` "AXo+AD` "AC ^A%STARTTAC JA%FINISHAC 6AORDERAC 6ABOUNDSHApC "ARESULTHA\A
 MISSINGTAJA<Xi 0` #9$P 0kAC X+Ű 
#:X_+Q_0$hZo0A$`Po+Po+XY P !$Ay W  p 8Pi 0f#`&aPi ` !5$P 4#$hPi 4` NA` 1Zi 4A` ,A` YAXi 4'ab&dPi ,Xi ,C0'dPi ,X   İ k AAVC X 0#` UADXo+Po+y W  p H$P ,f#
X 0y 
f
mHVPY <#4P !5y HP 4U#y 
~P 4Ƞ AP @ !3P @XI EPI DX9 '1P9 0Xi 0Ui DC0<'aPi 0
f
mH[ @P 8XY 4!7$\	 ,P ,#X ,  P ,Q ,C X ,y W  p `X0P XX0P0X0P \XO+PI PX?0
3P?0C W  p ,$V0P0` :AXj A>$aPi @z W  p 8C W  p 8Xo+C0b
oV 0P[ 4X ,PsE @ C0  !=U+!7X5  0 P5  { XU+#7X+ B0N$D ! 
!$X!-$D #7X+ B0X   P  XM@PO+{ X+!5X?+P?+X+!4{ Xo0Pk ,X_+P]$P 0U!9$CPM0 P; 0#XO+MP 0$D BX+ !=$ODM@ 
!'XK 0@ PK 0$@PO+$?D=0 #50 B0:X?+0 #40 !8b
oX0P 0#$P Tb
oX) LP& 0X0P L#b
oPF 0$1Q?0Xk 0` Pk 0X#X/+  #` Pk 0sm` p` PB0"X0
XI HPL 0$1Q?0X 0 P 0$oDm` !;X0
$@PL 0$1Q?0Xo+` !$X#7X PX+C0"XO0B
O$0P4 0$Q0sM@&EPMXO0[K ,PK ,X?02
?XP 0 P+$!Q/0X?02
?X0[0'V 0KP 0XO0PO+
BPO0X0P+{ W  p ,Xo+`  CP$QQ_+$P+P+P0XO+|B0.$UXo+AXm#6` "A#	XmA`  PmA$aPo+AP+ !;Xm!4Po+"P @P_+Xo+|!4aAXo+` I#&aPo+
mX_+V7Xm#4{ X_+P  !6$P+C P %!6$P+C P  #$P+@ +PMC :P a!P z!%PP_+
U
]H@P !6XO+@ #6 'P+{ W  p H$PPY <X0[0&P @XO0B
OX4 0P; DXj 0Yk C%QQY <Q[ X 
XL 0PK <D&BPK 8X; <;0 P; 4X P ,X+ P/+P Z; @4B0
X DU 0B0X0P 0$aQk 0Qk ,X_0U[ 0B0`X <P+XO+B
OX4 ,P=0 
=P+X/+P/+XĀ P+!8 D!5  BP+X+  S!8P+$`[k ,Po+sk >` C0nX[ ,R
_X 0#&XO0@  B0D$?D=0 !0 !,H= l@4  X ,&P T#$8P?0X#{ P+$ P/+$Q ,#X_0X0@  $PPY H` C04X+ A!7XO+PI HC XK ,B
OX4 02
?X (P H&P+X!XO+B
OX4 ,0 P4 ,XO0YJ 0#X9 <P?+{ Xk ,b
oX[ 0R
_X 0U 0C0nC { W  p ,Xo+B0<X_+P_+P 'B0$PmAbXo+` '#7%QP_+{ $QP]ABC rX_+P 0!P 9#)P AB6P FB .P 9!&PP_+#PP_+	V!*P AP_+A{ $PP_+P]X+ '!9` 	#6%APO+A{ W  p \C HW  p ,`  #$PP_+X[ ,P !5` A.$aQk ,X_+[[ ,
U
]XL @E| Xo+Pk XX_+P_+X+P+XMC0f$0P; ,dhAmAA6XmUo+!>$PP]A"XmUo+!:$QP]Xo+ARC X_+
U
]X ,@XO+L'APO+$`Pk @Pk 8Pk <Pk D$`Po+Po+Po+PmX_+!7$P+{ PB0X+!5XO+C0 C0$IPO+0 ZP?+` SPo+Po+%aQo+X_+
U
]X+@AXo+B X_+P 	B06X+ .B0*XO+@ SB0P+` TPo+Po+%1Q; XAC DP 	#5f!3Po+X X

XK X[O+@L%1Q?+X XP+X/+!%` Ax{ C TUCX0P0XO+PO+Xo0b
oV 0P[ 0X+P  AXo+C$PP_+XK 0X  X?+0
P  ApXo+CtX 0X\  VXO+@
TP\  ALXo+CPX 0X\  VXO+@
TP\  A(Xo+C,X 0X\  VXO+@
TP\  AXo+#$QQ_0C :X_+P 'B0dX+C0\P]$@PK HXk H` C0F&aPk H
mX_+\B0,$APMX; H
3
=H
P LP++ OP/+AC  C $aQo0X_0Y_0!%` A
` ;Po+Po+X_0PZ 0Xo0A{ X+ '#5 "B0P$APM0 RP?+ SP+AXo+Po+Um!4$PP]AXmUo+B0Uo+#8PP_+{ $QP]AXmUo+B0B$PP]AXmUo+C0,%RQ_+X+

%A@LX?+@<X+&P+{ X_+XZ_+P] RP+XO+PO+{ XMBPO0AXXo0
f
mHV@P[ TP@ B0P U_+!5X_+CX[ T!X+P+{ $Q0C NX T P LAXk TC ,X[ LC0U_+!4X+#X+P+{ A$aPk LXk LQo0C fP ?P_+X TƓP+UB0X

HL8PK PC0<TK D@ ?!9XO+#9s; R0 #4{ X; P6V; DP; DX+ !#P 8XO+PO+C tXK T#s6B0 ?P?+P #5P B0XP[ 4A^Xk 4` B0JX_+P S#7$P+{ Xo+AP @#$ #*$`Po+$TP_0{ ` @Pk <C @X_+P ;!8$P 0Xo0AXo+` A#<$SP_0$P+P+{ P PP[ <AXo+` #7$PP_+{ X_+P B0:AXo+` 7#>X_+P 7#9$P+P+{ X_+P !4$P+#$P+X[ 4P !<X+ !$@PO+{ X+

HLZPK LDPO+Xk LhfPo+X?+
=P+C "Xo+` 1!` 9#*X[ D#4$P+{ Xo+` u!%QP]
mP+C B` mB:X[ 8P #9$P+P+{ $P 8b
mXVP_+Xk <#5`Pk <sk F` @C0X_+P 5C0 P 3#>X 8 !'$@PO+{ C Z&QP_+X+Z <P+sO+@ !6$1P?+C "X; 80 !=X+Z < p 0!$$P+X 8 !4$?P?+s_+P pP `!5X+Q+X[ @XZ_+X DZ[ < p
\P_+P_+X 8P+$@PK D{ W  p @C bW  p ,dPk 4$_D\ P !?
mFPK 4Xl d
m| f!4$ZP[ 4$oDl 
m| W  p 0iPl P #5Zk ,Pl Xo0Uk ,C0P$QQ[ ,XK ,
D
MX< E4`B02X ,
X,  Ӂp(B0s  p  @!6Xl ,Ed^!4| C s]P pP @!:&aPo0
f
mXL ,@F`$aQo0X_0
U
]XL @E`X?0
=X  pX/0P+ ,sÀ C06ASETAr$SXk ,Ax$SdAp$SXl  Af$SXl ,A\A>| Xo0Uo0!6 { PP[ ,Pk 0$P ,P lA%aQk 0X[ 0R
_X 0E 3'P 8X5 ,P=` cA>P <XmhfPg ,QXk 4AxXo0Yk 8#X[ 8P[ 0$P ,P lAVC $PPW ,$Q$`ADXo0` !` AX ,{ W  p 4$PP[ ,Xk ,` C0<&aPk ,X[ \P[ 0X P P 	#&P 7P[ 0#P 0P[ 0eA,C { W  p \C vW  p 8$`Pk @Xk HCb
oXV0P\ 4XK HBZO0X4  P; <X HZ0!   C jȋ @P ,P` P\ 4X\ ,Xe  C04b
oF0PL 0s4 0` Y< 4#.0 Q4  X  Z0P ,C Xk HbZo0XE  PF  X; HP5  Xk <Pk HC Ns]P C0"AREORDER N =A*$SXk HA0A| W  p ,$SAA [OAXl b
oXf0ArAXl bZo0Xf  A\AXl bZo0Xf  AFAXl bZo0Xf  A0` ]AA| $`Pk ,Pk 4Pk 8Po0Pk LPk HPk PPk 0PP_0Xk 
f
mHV`P[ <X 
LpPK @DC0tYP P[ T!5X?+P; Ts]P C0H$TXk A.$SdA&$SXo+A$SXo+A$SXo+A$RXo+A$SXi HAA@ B$aQo0X_0U_0!6$4P?0C hX?02
?X <P0X/0"Z/0X HP  X0Z0X+
P  XK TPO+sm` #5Xo0AT$`[o0Pk HX[ @
U
],HL  PK C PJ ,@ i!
Md Pj ,Xj ,` V!-AJXo+` ;B0$XZ ,P <!P O#$P S!8$@PJ 0Xo0AXj ,` <B6` @B .X_+P !9X+ D#4 F!;&gPj ,X P+X_+P[ TUo+#5Uo+B0` ;!:AXk T` !3Po+Xj ,` BBN` HB FX_+U_+C04X+ !(P C0"P 	#? !P 	#9P 
#6$BPO0C $P0%aQo0X_0U_0!6$P0C X0
XK <PL0X?02Z?0X HP  X/0"Z/0X+Z @P  X TP+Xo0bZo0X_+PV  s #5Xo0Ask >``C0Xk 0#?Pk $PP[ 0C $aQk X[ <BXk LUk PB0,$PP[ ,P[ 4P[ 8X0U PC0P LXj ,` V#A8%aQk PX[ PP[ HX ,C0PRZ_0E PK @DC0<X; H2
?X0P <X+ H"Z/0X  P+X H`Zo0X  P HC #A$`[k HPk HbZo0X[ @PV  Xk Hb
osV0PP[ C0X HZ0XL  HPO+C Xo+` B0&Xo0Pk HAdXk @Po0X_+!4{ $P0Xo+` 
#:` ;#7$PP]A"X_0B0JX+ ;!9XJ 0!6$3P?0C 0!6$APO0C " R! T!,$BPO0X?+0 !4$P0Xo0A@$`PmPo+Po+Po+Po+Po+{ Xo+` #%` B0,sk >`Pk C0C .Xo+` !` #4` !3C C Xo+` B0C $oDi ` #<Xm#$_DY P 	#3C Xi  d` Po+` !%$XP_+#` !$YP_+C p$oDi ` 	B0Xi  d` Po+C PXk 4B0HX_+P B0hX+B0XI HPK DA$`Po+X[ D!&$P0C fR
_X 0P 0Xk DAXo+!6$SP_0C B$QP[ 4C Xo+` B0 C Xo0X_0@V  $D V

HL \PK Ds9 V0#8X T
PA 0Xi L#>Pk Xb
oXV 0PY LX DP 0"C v$gDi V` !6$TP_0C $aQi TC Vsk >`Pk 0C rXo0Uk L#4$QP[ ,%QQ[ L$P @C Xo0b
oXY TPV (X HP ,XK LUK PB0%2Q?0Xo0Yo0!` AC Xk 8B0$QP[ 8Xo0b
oX 0P TXF 4PI HX; LU; P!4$Q0C $ePo0C $`Pi HPi TPo0ȰP+Po0Po+Po+Po+Po+Po+Pi LPo0P  P]X B04XO+QO0X?+!5Po+A$`Po+X+#6X_+P !!:Xo+#4A"z AXo+` "?$Q+X]!7X_+` OAXo+` &B0TX+Ű B0HAXo+` ;!8$P 0Xo0AjXo+` S#4$`AXo+AaAf` PA8z $P+` ;B0*X_+P :#6X+ P!<$P+P+Hm AC 2X_+!4X+#=X+P+$APO+Hm"A#$CPO+Hm&Az AXj C H$P+Hm$AAP 0X ,Xk  #`&af#6#4$fAXi ,X 0\P  C X0P D$TP_+Hm(ARXo0C0X DY0CX_0Z_0[_0'QPY 0Y_0!%` AݘXi ,X0'P  
XY 0P[ 0[Y DP_0X  'P 4XI 0'API 4Xi 4Uj 4C0$&aPi 4b
oX D
X[ 0PV 0$Q DC X 0P0z W  p C pW  p ,A۔Xk  #$PVP[  ` -A~#	  $RP  Xk  A۞{ W  p ,` ,ALXk A~{ W  p 0Zo0Pk V` $A$`[k A۪Xk b
oXV ,P[ ,` eAXk ,hfAXk b
oXV 0]$geA~sk .` p` PB0"s[ .P P T#;X[ R
_XU (` ,A{ W  p 0$aPj @X_+` @AXo+Pk ,b
osV 2P #4%Q ,X ,
XL (#@&A@ !9` EAJ$`Pj @#XJ D
DPJ D{ W  p ,Xj [j &aPm!*$PP_+$dAۀ$aPm` bAXmA0{ W  p 0XY PY_+C^X+
L++PK ,F@ C0D%DQO+X?+P: ls . #4&1P?0  !4$1Q: ls; .0 !4$P l{ f!5$P #$P lA$aPi @{ W  p <Xo+` XB0*$PP_+P_+$D+~P+|P_+$aA $`Pm{ $PP_+X+P 8XI @ B0` W#=X=0 !8 WP+$eATXo0Pk 4X_+P W#5P VB0>PP_+UY #4$eA&` ;AتXi ` #($iA%aQi "$PP[ 4C "X  !)XM@ !4$eA` ;AfXi PYo+C:X_+R
_++P ,  !5$KPK ,#$P ,%Q+Xk ,A٘C XY @#>$D  ! 
!%` AtXo0'aPo+Xk 4Yo+CX_+R
_X 0P 0sE .@ B0\X?+|B0T B0Ls B0@X+ 8  
#9X+Q0APK 8A? OAXo+AA
 UNUSED
NAsk 2` #4$lAXo+[ 3e'cPo+C X$kAdXk 8!6$hZo0A{ Xo+` !`@#%` A؎Xi @B0BX+Ű B06X_0@ !< CC0  "#=s-  !5` AJ$aPi @$`Pj xPj 8Pj DPj HPj Pj lPj tPj pPj |Po0Pj Pj X0P Pj Po+Pj Xj bZo0X  P+#X_0YZ #C 2X Z0XL  #>X: 2Z?0X P  X* P* P C XZ RZ_0 P sM@ C0JAC =A $SlA(A  X =A
$SkAA
  NEXT =NA$SXj AAXj bZo0XV  PZ  1#-rA C0" ;#6-rAX -zA$`Pi @Xj B0X C0Z0X[  PZ Xj bZo0X  P C Xj ` -!?X+U+!9%Q[Z PZ $Q+#$P+Xo+
mfgAC ` QAC ` MAC pXj ` ,#5` +AC `Xj ` +#7` -AC "X+U+!9$P[Z PZ $Q+` UAԪC $` XAԞC ` yAԒXj PmC ` zA~Xj PmC ` VAjC Xi  ` #<X#` ` #4$eAպ` RA>C ` TA2#` KA(Xi  ` 
#4$eAՌC ` eAC $`Pj s0ð #4$oAf$aVo0Po0Xj C0|bZo0X  P+#X_0YZ #XZ RZ_0  S#3C JXJ BZO0X4  P: kA`P ! #(` A$`Pj $aX k  Vj Pj C |Xj !5` A$iPj XZ ` oAӺX_+` ,AӮC ` sA,C $bDo+~Po+|C $aVo+|Po+|C ` Po+C ~$`Po+C t` SAC h` ZAC \Xo+Pj 4Xi PYj 4CtX 4
$W++\P B0RXO+@ B0,X: 42
?++P ,$(Ӂ  (!  %Q 4  FP+#0 qP?+%RZZ 4Xo+AC %TQZ 4C $jAC Xo+&cPj tV` uAҮXo+&bPj pAXj |#5X lP0$V0P0$QPZ x$P hXO+@A&HPJ P LPZ TP XPZ dPZ \D_+PZ PX?+P: lP= X lPC @$aWj PPj PC 2A$dPj HX @#<$RVZ DPZ DC ` CAю` #Po+%Q xC D%aQj xX #<` ~Ah$aPj hPj `C hXZ h#;$P hX_+
]EPO+` ?A8Xj PWj L` Pj P#6$W+P+X TC06sZ ^P #6$W+P+X+Z H
XJ dB
MXT l#AXC sj Z` C0(X XP XXj \aPj \%QQZ dX LP LC X XP XXj \aPj \%QQZ dX LP L` #6$GWO+PO+XO+ZJ H
MX: d2
=XS d#AXj db
mX U+#5Xo+AXj db
mX P+$`Pj TPj PPj HX x!'XZ t#4eAXj h#5` "A C z$aDo+Pj `$aQj xX PW LP PW `P `Dj ^B0FXj TC0:XZ X
UPZ XX d
XL PL$1Q: dX \
P \X L
V PP LC Xj X
fPj XXZ TC0 $Q+$AQJ dX: d2
=X+P C H` Pj XX \ !:X d
XLPJ 4#$Q+XO+PJ 4$Q dX: d2
=PC X \
P \XJ L
DVJ PPJ L$aPj T$PPZ PX hC0\C Xj !9$P kZo+A՜$dQo+X+ɰ P#%` AXo+b
oX Z |Ҷ++$PPZ pPZ lPZ |P_0C %RZ_+` BA$`Pi @$aDo+ArC Xj l!3Adsj n` #6$eAϸC X @#8$QZZ l` FA΢Xj lA$aQj l$P $TPZ |C $`PmPo+so0` #7X#$$oAbXj Pj C `X_+` @A4C PC LA&C DXj Pj Xo+AӀP Xo+#aAC  Xo+
f
mHP 4B fXZ P SB0Z$S` NAXo+
f
mHP 4` ,A`` ZAXX
 4  $jP+a AA>$:\/+Xj 4cA,C h#ǰ&P 4XZ 
]PZ [X lAxXj 4C :` ,AXo+[j 4Pj X+P+Xo+Uj #;'aPo+
f
mHfA"Xo+Po+C 2` .A̬C &` vA̠C ` fA̔$jPj X+P l&P pkARC Xo+!5$Q 8#A2C X_+` LA$aPi @Vo0Po0C $aVo0Po0X_+` WAC $aVo0Po0$P @X_+` _AjXo+b
oX (P 4
X[ 0PZ <YZ !&X Y ,#'` ALC RP <XJ 4LPJ 4$D >$  P <B
Oȴ (P 0T  #4$gAXj 0X  V <P  C $aVo0Po0X_+` JAC Xj !5XP Xm[j &aPmX C ^C ` pA<C ` pA0` EA(Xj DaPj D` #6'aPj DC C ` iAC |Xj ` 6C0 %Q!-$`Po+` AP$`Po+C ` AAXm` ##A^$`PmPj C ,Xo+#4%Q$P+XmC0PXm
f
mHVP A#6X+U+!3C ` IAhC C ` aAXC $aQmX+#9X_+R
_X P (C Xo+Uo+B0` wA Xo+b
oX0'P (X_0R
_X P ,XJ PE (	L#$0P?+$dAZXj Pj Xj [j &aPj <&odPj <X0'P0Y0!%` A"Xo0Zj <Pj X0'P 4Xj 4Uj #:&aPj 4b
o$P 0"Xj ` 2B0 X+Ű T#<X]!X #6$P` FAXo+A
C Xj 8#9V` dAɪ$`Pj 8Xo+A` hAXo+b
o$D .Ű #5` cAC |Xo+AXo+Po+` !4$PC \Xo+` !:` HA`Pi 8#AfXj p#6V` BA$Xo0#6Uj l#3AvXj l#3Alz Xi  B02%aAψXo+'bPi 8$R` GAXo0#3A$R` GAC |` ` C0B$aAJXm#$P 4#$P 4[` GAȚXo0#3AjXY 4` GAȄXi 4C0.$aPi @$`AXo+'bPi 8X0#3A6Xo+` T!=X 8
[ 0PW ,$PeAdXo+` U#7` W#4` V!3C ` ` !` 
#'Xo+` B0so+` p` P!4%Q 8Xi B0X+Ű !;X]!5$P#$eAXmC $X+ɰ #.Ű #;XY #5$oAȤ#$P$aZi X 8
[ 0PW ,X_+AͪXo+` W#4` V!5$P+#C X  Ű #7XY #4$`AͰ$aPmX0P0XY XP_0X PP+X  #5XI \PO0XO0APO0y W  p ,AbXo0B0,$UXo+AA STATEMENTS COMPILED
ArC JAPROGRAM CONTAINSIAT$QXo0AZA FAULTMA:Xo0` #5` SA0AA8y $`A4%aPa  $aA$bAA$eAA&%EDINBURGH C.S. IMP COMPILER  VERSION A  A$bA$nAXa  PmAʼ` zAŎ$bPo+|$P+P+P0P+P+ȝ ^P0HY  P_0P+P+@Ƞ
P0P0$DPO+P0P0P+P+P+P0
: 0P7 ,$_kA˴` ;A$dAAĒ$aA`$`A*$`[o0Pa  $`AXa  !7AXo+Pa  X , $@X= 1I2 !+K2  !
3s3B  #3
>3!$$C P P6 PV  5!%$$C !$  Ps  Q  Pc '
qX=  s #'q!$$C X^ P8PQB' 5$BX= $JX= $IX= V`  $GX= `  $EX= V$j$GX= $j$EX= $FX= $EX= $HX= $NX= @ X= 82 By %o 2C  -X   A@ ` R` AV B$a@mx B$d@mx RȰ Pl b]'QP]h rP ` Ar8 By %b B$b@mu rX]l` AZ By %_ -X   A@ T R` A B$a@mn B$@ By %Y t	Ln4.12            F           bz 6$] ol   ~e  3.>AZUr                                                                                                                                                   ( 1 `     i      	noP;;;+IOHG                          ! % $ "  &* + ,+/ + ,<>FOPQ]R B>FI ^^_ GJII MW Y[S TSII A II  0 a oyqrylsuz z{w x| y} ~{ w                     r s w {      ~ }        P                      À       ̀̀΀ ΀       ̀Հ    0   ـ      ߀                                 	I	  (  }A        !    "#   ,&!'&-,,  !)!(!/.2  !0!43  <!87=<  !:!9!?>  !BAE  !CNH!IHRSS  !OTT  !J!K!O!VUY  !W![Z  ^ab  c_a  !fg!hi!jk  mn  po  stu1vxys  {!|z  ! ׁ  !       ym                                                                                                                                                                                            rtY5612349vuuvu;;Su8;88;"#
!*0#www#wSw

wS?>=<@KJMNL^m_m^m_Seeefffm^ISZ[ep  fVWXFCDEGJKLMNe^ effFCDEHGJKLMN^efJKLMN^ efPQsi Rcd OVWX+T-S+-STSR53; ;a cd.. cd.l. S	jTS	+-$&'( $& $ +%)( % %) +-$&'( '( $& $   ~; qba q;;FEJKLMN^_ efbkkkkk|}kkk                                                                                                '+/?C          ORWk{  Hl  <  (@h    @    O  g                            k  	A'AgI.@@@f@iB@(C+@T΁/K@@@<=HnInAHKT=>HAIN)R,NSA" CB7& ESA" CB DIނE*Y EB $ NC񊊂O!"@
 N TI' LC* EF T@"*N@@ 'Y&!A@#'"CL΄ X"'R&AA TF'E T@ DOUq FƄ P')G&U&V1) TE&I EU"JɁ)O@SB" CC7$$SJ) EDךF*N#)EAFM΁uDx" C[x& EĵD" C[(ArFx" C^ N2F8" C_2)R,NSF" C[& E5G8" C\8GI'O GB*SE(AS@" CA7*OH "́@" CBw΁'W@@JK"$ "ԁ²B" C]&AE*$"΁A" C^2CPS*'RDW&Uԁ=DB  TJa)O D'&*AU2T Lƌ͈NuXx̂N" C\x)O  LFp'O GF0& EصX" C\(ArZx" C^r N2Z8" C^)R,NSZ" C\& E5[8" C]8șɗЄԂ)" MA *I$CAO$#Ύ(Ƃ "еP(ArRx" C_ N2R8" C]r)R, "5S8P PEW*R@!_'G&AE)O TB@H* ED'E@ NL$ LG) SG\$"GeBmCdI.@A	             CDQASPIHGOEFB                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
         P          
                                                     I                                                                                     
.@Rdx,>R  pT   V   Z                 "                 XMBK         YX WV   u      	
ihHI        
     ''g'' $D"            58528 285 385 3858528 2         m	vonpu   m   t                  a   b   k   l                            z{                		 V f $ B6 R      !0  !@!!!!"*     !   (   "!#$&%'(   !   (   ><=#)(tk   R   T   'ND       
   */&!%[].\x  +++++++++\+++,,,$,8,D,p,z,-v------...r.^././././././.002*2>2L,-+    722222  22    2222222222222222222.4h5$323                                        345/-6F6F+(4445.4J551    222246J5>5f5r 2 97.7f77Z6V  7Z6v           P@#Ȱ 0P@P$ B>$cANN BA$oPm} BC%aQm{ 2DB 6K EAretry failsA= bF%gPi ,C u rHXŰ B0FE IX]!6%P ,C 8?bJHmA") dA@ VH) HA@ V dA@ Id BKAjv BL%a@m" 2OA BQ$jPi 0i rUX0Ű B0z; VH](G]$P#4%Q@]"	 RWH](@]$cP rYY <Xm0A㮫 rZsi >` B0Z B[%Q 0 2\B 63 ]Astatus loop!iA R^` Pi < r`si >` C0"T aAoverrunA֩ bb$XXm0AP Bc%a@m"j "d#v 2fC  rkY <Hm(A<< rlsi >` C02mHm(A0)dA@ V' ,A@ VRA@ Azv 2nC |1 2p` 4 2qB0~ Rr` C0@qi Bs$@*:6@nELUT\do*rDtXwf{T\l$R.t(b	. "XZ^f*uy:r0Pjt@V`r~  B z !&!0%!+!?"<Q"X"Y# ]#f#g#l#v#y#{$$$($:$F$R$\$j$|$$$$%L&6&z>(|E(J(K(O) Y):])Ta)~b)k)m)t*
 bt$PHm(A` ruP Hm(A8 Bv%a@m"W wAseek incompleteA, Bxy # r}H"E&C0$ r~H]&Hm(A6 rP BHm(Aw B$c@m*C By # RHm&@m"c bVHm(A}+ rH] Xm0A& 2C 4A R$QkA⺧- rP Xm0A^7 2A? rsi F`  C0D[ rP( ` AB B%aQi 02 2B *5 b$PXm0A~Q Aseek incompleteAxr 2AlL 2C v2 2C  R` @C0$q  Atelefile not ready*AH53 2A<v 2C F2 rs Bð C06\ B%QQY 0D 2B (5 b$PXm0AQ Astatus locked eAP 2A "#6 2C > rP Xm0Aᐝ P` J]&Xm0AU HmfZm<Jm Pm< rXoYm4C $j Aoverwrite system!A㪴 b%iPi ,C л Rm0A B$a@m* By # Xi X #5P ,C  bH]*P #? Akick rejectedAZy C 2C r 2AҾ rHm*` C0" "Aspurious selch int*A$y ?f rX0Ű B0( bY <kA bsi >` #; AoverrunAC m? By #f RHm*B0 Aspurious cont intAy  rY <Xm0A8 rsi >`  C0 A XŰ !:A
	bad trackAkJ 2C P R` C0pXŰ B00Xi <A)dA@ V^' ,A@ VdA@ A@+ rY <Hm(A߼L rsi >` C0JHm(Aְ)dA@ V' ,A@ VnA@ A ` Pg ,$W$bA aO r$b@m*y , rP Hm(A b$XXm0A߶S 2C  rHK@ "#. RH]Q],Q BYQ]4 RP @] 2C  2C 3 rHm*` C0 ` !:X %RD](U[ C08/8X Xk A)dA@ V' ,A@ VA@ AB|o By #@ rY <Hm(A޸5 rsi >` C0. R`  B02qHm(Aդ)dA@ V' ,A@ VA@ A 2C Aillegal disc address*A@} b%hPi ,C  rP ` AT5 rY <` AނE rsi >`P C0ά rXŰ B0lbXi <A)dA@ V' ,A@ VdA@ Ab9 rY <` A.EXi <A)dA@ V' ,A@ VdA@ A& 2	C D B$cA܆H Xi Ȱ A@  $W@V 0 bAXy . B%aPm & B$cA^j Xi H @  HV @V  B$@ _ 2A( By # Xi H@  H]@V u b$@ @Kx rX ,P A27s`	` @#;Adisc>>>Xi A6RF B$cA B$`@m* By # b W  p 8S RDH PW Eɰ #)sV P U]B00 Fɰ !ɰ 
!'
sK 
B GABad MT activityAog bIXi %P (d JXi H @  HV @V r BK$@ ( RLXP F 2MA@ BNy "/id    !-s  	c4[    +"   3 /9s   2"48l 8r$&8l [)&+    ( f    *%3    , I!    0     4%3    84l    <0    @0s     <53   3 @2m     D2m     H 9m     $(4Ig ]!@ $\ $\2	r4L!@ , Ӊt    @ $ $433% 4  @ $@ //!xm  	p      8s    43    3f   ( H?   4 4                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     C        W  A@ ,$P ,A@  P,P,!% P,!%` Po,Xo,dPo,X,$Q6o, A@ ?,A@ C@ &W  A@  4$P ,Xi ,` C0B&aPi ,X İ P 0XY TPY ɰ 	#&ʰ 7P 0#ʰ 0P 0kA@ C y W  A@  ,$aA@ :XoUm<C0>Pm<X@#4A@ t` Pm@$TXoA@ A@ hXoAD` :A@ #
X@Ű !5$kA@ Z$bA@ ZXi A%aQm@!(Ȱ P@A@ t$bA@ :y W  A@  ,X#$`A@ :$QXi Hf A@ $RXi Hf A@ $RXi Hf A@ $UXi Xf  A@ $UXi Xf A@ $UXi Xf A@ Xi HV C0$$RHf A@ ` :A@ Xi Xf AV#A@ tXm#$bA@ :y W  A@  D$P ,$QPY 8PXi ,A@ :Xi C A*COMPILER ERRORA@ ~$QXi A@ A
 AT LINERA@ ~$QXoA@ A@ tXoC BASTACKA@ ~A@ tXoPi @$P 0Xi 0Ui @#;&aPi 0b
oXfAv"Xom C0>AUSING:NA@ ~A@ tXoPi <Xi <Xf  A<Xi <X P <Ž  >Xi ,C0T$$A@ @` *A@ $QXoA@ A: IA@ ~X -DA@ pAMORE STORE PLEASE!!A@ ~C A&%MORE STORE REQ'D FOR THIS COMPILATIONA@ ~C ABLOCKS TOO DEEPLY NESTEDSA@ ~C ATOO MANY NAMESPA@ ~C |ATOO MANY LABELSA@ ~C ^ADIVISION BY ZEROYA@ ~C 8AARRAY INSIDE OUTYA@ ~C ADECLARATION OUT OF CONTEXTCA@ ~C AFAULTY SWITCH DECLARATIONA@ ~C A%RESULT UNSPECIFIEDA@ ~C AILLEGAL %FOR PARAMETERSA@ ~C xASTRING CONSTANT TOO LONGNA@ ~C PAUNASSIGNED CHECK INHIBITEDCA@ ~Xm`Pm#ALOCALS > 16K ??? A@ ~$`Pi 4$`Pi 8A@ tXi ,` B0&X 8#6$$A@ @XY 4Q_ $bA@ :y $P ,C pW  A@  ,$aA@ :$SXi Hf A@ ` :A@ $RXi f A@ $RXi f A@ $SXi f A@ $TXi Xf  A@ $TXi Hf A@ $TXi Hf A@ A@ t$bA@ :y W  A@  0$P ,Xi ,A@ :` *A@ $TXoA@ A ILLEGAL REAL OPERATION 'A@ ~Xi 
f
mHrP #$`kA@ #ǰ&kA@ ` 'A@ A@ tXi ,` #6$P ,C jQo $bA@ :y W  A@  ,H Ű #>HV #?P #8X H  !5$y $y W  A@  ,H E !6X  U  #5$y H E !6HE EF #5$y X5 U6 #5$y $y W  A@  ,X  !7HV !4H #5$y H #5$y $y W  A@  ,H !4HV #5$y H ɠ #%$y $y W  A@  4$P ,%QPY 0Xi 0` C0"&aPi 0X ,U !5y 
P ,C %y W  A@  0Xo&c`Pi ,&dPoX ,y W  A@  4$`Pi ,A@ RP 0 0! 9#&X ,y $\ ,ʱP ,A@ JC W  A@  H` #$y A@ P 4
aFPi 4$P 0fB0FXY PY @$P ,Xi ,Ui @C0(&aPi ,A@ P 8Xi 0bZi 0
faPi 0C C VP APY <` !3P <X P D$P ,Xi ,Ui DC0*&aPi ,A@ P 8Xi 0X 4k  [ <
aPi 0C X 0y W  A@  T$jPi ,/`	 H$P ,/+`) L$PPY <+D`I @AP 0A@ JXi 0Pi P$P 8Xi 8Ui PC0d&aPi 8A@ P 4 .!:h`	 D$aPi <C 8P ,Xi <!:h	 @l	 H/!*`	 @#h	 Dm	 H`	 D/!, j) @`) @C h	 @y W  A@  ,f#6b
oXL#y 'PL#$aA4y W  A@  ,f#6b
oXL#y X_PV@&PLy W  A@  ,6$+
?X_PS (PSy W  A@  @$V  P 4HV 
]$D   P 0$P ,Xi ,` (C0&aPi ,6$+
?S $PY <XY C`X HL  	AB0N%   C0B$V  U 4B04Ӆ 
P 8  #4$P	 8Xi 8
m$D Ӷ0  T 0#3P C ny W  A@  <C W  A@  ,%Q 0H -A@ p$cAXj $@ XY 4PV C <Xj $@ XY 4PV C &Xj $@ XY 4PV #
Xj $@ XY 4PV  Xj X@ z Xi b
oXLP 0!$y $PPVLAP 4Xi ` !` !&Ȱ` P 8#ȰP P 8X_PW ,P 0VkA.XoPi ,Xi ,m C0$X  XY E[ !4kAXi ,X P ,C X 0#4$dAy W  A@  0$`Pi ,Xi ,` #7&aPi ,A"
y W  A@  0` !%` A$\	 
a $Pi ,X  H[ @V X  P  H  
HK F X?P6 X-Cl$aA@ :A
 REMEMBER:EA@ ~$QXi ,f 
A@ $QXi ,f A@ $SXi ,Hf A@ $UXi ,Xf  A@ A@ t$bA@ :y W  A@  Lӹ /P <X ,P @
XL#XO&API D#	$<\) <
?XC (PI D
X:L#X&P H#	$\	 @
X! (P) HYO#&XY H!$y $ P) 8Xi 8` (C0&aPi 8V$K
_ȥ $P 4X Y DC Y HC XI ,EJ B0tX9 0U:  B0hX * 
B0ZX  
 B0L` C &`Pi 8
X_Y[ (!+ $X 4$A@ HAhXi <A*Xi @A"X 8y C F$y W  A@  T%P 8P @X_PY <PY D$P PP 4Xi 4Ui PC0&aPi 4
mӶP H
X[LB0`$<\) H
?ȣ $P ,P 0XJ PI LYL #X P LXY L!X Hy X) <Y) L#)X LP <X) HP) 8C &UC  P #X DY@#)X HP @XK@PI DC NX 8!y XY @#$P @Xi @AjXi @b
oXP@X @y W  A@  P$`Pi 0XP 4Pi <Pi ,Xi ,` C0&aPi ,
mӶP @VPY D$
ȫ $P H<%
?C $PI LX @
X!LB0HR
_XLB02X
 P	 8Y #Xd Pi 8Xi 4Yi 8#)X 8P 4Xi ,Pi 0#X	 ,P	 <#
R
_XL!5X	 ,P	 <C RX 0#7
y XY <!4$P <XY <
]ӥP @P DjADXi DA<X Dy W  A@  P%aPi 8XP <Pi @P DP L$\PY 4Xi 4` C0&aPi 46$+
?S $PY ,ȣP 0b
oXLB0HXE PI HYJ #X P HXY H!X 4y X) <Y) H#)X 4P 8X	 HP	 <C &C   #XI DYF@#)X@P DXI 4PI @C XX 8!y XY @#$P @Xi @A:X @y W  A@  0$`Pi ,Xi ,` #>&aPi ,b
oXL#$$bAC y W  A@  ,XoUm#4$QPmy W  A@  ,hA@ i A@ y W  A@  ,$bA@ Hi AXm#Hi A$bQoy W  A@  ,$cA@ Hi A$bQoy W  A@  ,` Asi Ay W  A@  ,%[P!=$cA@ XmhJi A$#Pm$aQoy W  A@  ,$cA@ :$gA@ Xi AXi  A$bA@ :y W  A@  ,$cA@ :$fA@ Xi AXi  A$bA@ :y W  A@  ,Xi 'aXö  #5$`A""y W  A@  0
]ӵ 4
kJi ,Ary W  A@  0
]ӵ 4H ,

kӺ 4
kABHi ,A|y W  A@  4X ,Ű #7X 0!ɠ?#$$eAXi ,ADXi  
mӶ 4XY ,
]Z kӵ 4
kAXi 0AXi `A !3A|sm`  C0~X ŰX #7Űh #4y X_UY ,!9X Y 0!$y ŰX !6ȠU P #Ƞi P X  
 4
l `
lA\` AT$jA@ XoADAy W  A@  4X ,Ű !4$eAXi ,AVXi  
mӶ 4XY ,
]Z kӵ 4
kAXi 0AXi `A !3Ay W  A@  4X ,Ű !4$eA^Xi ,AXi  
mӶ 4XY ,
]Z kӵ 4
kAsi 0Asi 2A~y W  A@  ,$cA@ :$aA@ Hi A,XoA$$bA@ :y W  A@  ,$cA@ :Xi  A@ Xi AXoA$bA@ :y W  A@  ,A8PXmYo#&aPm$dA@ "y W  A@  4f!&y $P ,Xi ,C0.'aPi ,6Ȱ+
?SXPY 0H U  !5y C y W  A@  4f!$y AP 0$`Pa  $QX_P ##Po0\/
?SXPY 0H P  XP Pi ,Xi ,` (C0,&aPi ,X 0$\
ȡF
_* $$A@ HC y W  A@  <AP 0C0$`Pi ,Xi ,` (C0n&aPi ,6$+
?S $PY 4X 0
P 8HL EE B0.X,  U%  B0"Ӆ  !<e 
Ӽ 
k!6X?Y5 !Xj Pl C y W  A@  4AJP 0!7XoPoC J$`Pa  X PPi ,Xi ,` (C0,&aPi ,6$+
?XY 0
ȫ# $$A@ HC y W  A@  8Ȱ P ,`  Pi $PPY 0Xi 0` C02&aPi 0X ,
P ,T #=
mӶ+P 4kAXi 4AC $lA$lA$Ui A` ,Pg ,ӹ P 0$\`A Ay W  A@  DC \W  A@  0$P ,P  Xm Ui <#6X ,Ű !4z $QQY <X <
L @K  X: QC  &P ,C $`Pi <Pi @i 4Ai 8AXi 0B0($jA@ ` Pi @$P 0XY !7PY 8XP 4Xi 
mӶ 4P ɰ !'P $kA@ Xi 0`!<A%aA$dQoy XY @Z] 
U
V'QS
[SZY ,edAXi  Asi 4Asi 6Asi 8Asi :A$lQoy W  A@  A@ X#%aAJ$aQm $P HY PY XP \P dP |XP 4HI ,PI `H9 C 6!5$P# ,PX-<  !4%cA$aQm<X<
[  P_R
_%PLH  !;$@PG ,PG 0T` )AXo` !:%QXY 4XP  X Ű 1!:$PPW ,PW 0XoA#3#P#	P ,P 0[eAC@ plW  A@  <$P 0HY ,PZ 4Xj 0Yj 4B HZj 4aPj ,dZo,Pj 8X E !6X ,z I #XZ ,'QPZ 4#XZ ,&QPZ 0C $fA$ A@ @W  A@  L$aai ,XI ,!$%dAHi ,dZo,Po&$A@ ^A:Xo@ $P A@ P D ,#>Xm ` 
#7&aPm 
m C AP 4P ,$oDj 6Pj 0A@ JXj ,` !4$P ,AP <XoX ,Ҷ XZ 0V A@ JAPA@ R ,B06A@ JAP @aAP 8Xo@ Z,H 
P <@ 
C >Xj ,` B0(XXZ <[ &QPZ <X 0 !6&QPPZ <#
mӶ0P <Xj 0` B` 
B $PX_He AP 8E ,#<%aai ,Z,Pz XoC0&` C0$QLX_XLP  $LE z AXo@ P  Ȱ ,Ҷ XZ 0P !<X , #4 !4$AF H  !4XO!4z $0P?P: ,P 0$XPZ <Xj <Pi XX@k 
XZ 0P C0BX ,!;$JPJ ,$8P: <K C (P !8$HPJ <%1@; #P !5$@PJ <#$DPJ <XC0 B06XJ 4@ A!4$0P9 XX: ,0 !&	\#*P #7@ R#4P !4$PX ,PP_P B0L$dAXoX@ Xi PAXi TAXi XAXoȰ *Ҷ X P\	 XX_QPV  C zP #7$APO$4P9 XXOC0`X: 40 !#>0 1#40 A!5$bA#$dAXo` B 0X ,Ű C0$X_Z_P ,X 0P 0` *A~Xi XQoz Xj 0` B0n$bAXoȰ *Ҷ X_PV  Xi PAXi TAXi P
fXX_V@[ Xi TPj HX P'P 8Xj 8Uj H#8&aPj 8$`AH"z ` !7%Pz ` !9X ,
[DPZ 8#$P 8XZ 8%Q[Z 8Pɰ B vHY P B0^XC0V` !6XJ ,@ 
!:XJ 4@ #5@ 1B04XO0 04 P  X 4 1!4&P  %$Q/#Ȁ ,PC (U! ,PXX_[ XP  Z <PHi #;` B0HX Ű 0C0<X ,Ű C00Ű 
C0(XZ 0P #4P !=P ,PW 0XX\  XoAz W  A@  4XoPj ,m !5` ARXoPj 0m !5` A<Xj ,X P&  A@ ^XZ 0X PXOPE P_P%  = P2 z W  A@  4ȿP ,Xj ,X P 0Ž !5` AXj 0X  U #5Pj ,C XZ ,X P XOPF PoX: XP P?z W  A@  D$QX #$$gA`AP @Xj  @a X P  XZ 4PQ X 8P P XJ ,@A X: <P1 X* 0
-ӂ\@ X
X
 @PP	 @Xm#`A.z W  A@  ,Ӷ P ,V PW 0H P 4HF PG 8H6 
P7 <V Xf  A(z W  A@  0$QX_P #$$gA݂AP ,!X   A@ HXob
oP&Hb A(Xm#Xj ,A܂z W  A@  ,AP D$`@a X P  $Q@Q @a Q_X #$$gA Xob
oX DPX]#kAz W  A@  Dh
 ,`
 <j <Pj @X  P 4PX_P]Hz@ 8HmxEj 8C0"H 8'İ @ 8
XZ 4U[xC0XC $dA
Xo@j 8Xj 4AHmzc
mX 4PxHZ 8PV|Hz@ 8& @zEx!8Hmx&a` @mxXj 0Ȱ *@ HZ 8S
]X|P  $F@F $3@6 $QX/  #$$gAXob
oX 0Pz W  A@  4AFP DXj @a X  P  $Q@Q X ,@ XJ 0PA Q_X?0 #$$gA~Xob
oX DPz W  A@  ,Xob
oXP @z W  A@  ,Xo` !$$hA&Xob
oXP @XVPY Dz W  A@  ,Xo!$$hAXob
oXP @%QQ_z W  A@  4$bAXXj B BXPŽ #9f#XT\  U!3C pP *@[ XP  $C@K XT1  P: #'aPj X_Tӵ  	k#%mA\Xj Pj 0%P ,Xj ,Uj 0#:&aPj ,
ofXA"XT$P[  m PoPz W  A@  4XoPm #4$`A*AP ,#4A@ JXoT$Ҷ  Xj ,C ('aPj ,A@ P 0XoTӶ  &Ҷ  
XC $P ,$PPW 0PW 4PW 8PW <eAXob
oXPPz W  A@  ,$aQm|X|z W  A@  ,$aai H ɰ P#$%eA:Hi d
oȶPz W  A@  0H P ,Xi Uj ,C0,X ,
[P_X E  !5z %AQJ ,C  z W  A@  4AP 0 B0XmCR$`A@ :A DEF:A@ ~$RXj A@ A
  LABS =RA@ ~$RHi A@ A@ t$bA@ :AP 0Xj @a  AXj 0@ $Ҷ X_P_Xj AP ,$`Pa  C 4Ha C,X B$AXj 0@ $Ҷ Xj AzP ,$`Pa  Xj 0H    @ `kAXoUo#5Xj ABXj AXj !5XP $PLPz W  A@  @$PAPP 8Xj !?XU !:sQ P@Q z  B0.AP 8Xj @a  $ұ AXj 8@ Xj AC tӱ C04XY LP BC0(   &cXJ ,PG ,XZ  AXz C 6HQ C&X , !?$@A A@Xj 8@ Xj A#U!A4Xj 8s İP 4V UC0  #6$cZj AXj 8f ` $P ,$PPW 0X 8X\ AXi DPi @X 8[ AL$`Pg ,Pg 0X 8X[ AXXY DXi @A8$aPj  %QXi @AXi DAXj  ` !5$P 0#$P 0[Xj 4A`   Zj  A($bQoLX  Ű !5X_P_X_DB08$PD$HOH
1 $P: </J# 
S @S X@P  XP z W  A@  0H B0vX  P ,B0PP /!5AP  Xj  A
Xj  @g ,V`+ AXj  AXj X  @ $PPV  $@ $A@F #/` ,Pg 0A%aQoz H #6Az P -AXj  ` /!5AP  Xj H @ ,XZ  `/ AXj  AlXj $@ $Q@V X  @ $@PF  z W  A@  ,AtXj Hf AXj AXz W  A@  8H P ,HV 'RPZ 0P !4$P 0XV  PZ 4X P  $A@F $3@6 P .A
Xj X ,@ XZ 0@V X 4P  z W  A@  0H Ű #4Ű !5P .AXj H C0pŰ B0\Xf AلC0PXj X X[  PZ ,$@ kA~Xj H Ű #4Ű !6XZ ,QV  #P .A`Xj X ,P  #P .Xj AFXj H 
[@V z W  A@  ,H 

H[@V P !=H !4@ #X  !4$A@F H #$iAXj $@ z W  A@  0H Ű #4HV #4z ɰ !Ű #3AHXj H P ,XV  PW 0HV Hf A޶P ,#=Xj @ $P  $Q@V C NXj H Ű B0>HV PW ,X  P 0$S$aAnP ,!4z Xj @ $P  $S@V A>z W  A@  LX  !ɰ?!$z $@ D$F@J FH6  @: @İ P ,X  P  $ @* BP .j ,AXj H @@  z W  A@  4H P 0HV PZ ,Ű #4Ű !9AXj H P 0Ű C0:Ű C02Ű !>$SPZ 0@V $@ P .A<#
P -A2$aPj 0Pj ,Xj Vf AXj X ,@ XZ 0@V z W  A@  C $W  A@  ,
m$Q 4\
]{ A@ X#%bAШXj Aծ!<Xj  ` !` #$` /!3C X H[ PZ P@ C0bX P LkAXj Lm #3AXj P` !=X LH[ !8$P P[[  P[  Xj P
mӶC0$PPZ TX LXJ  EL #;H< 0 !9X E1 #4$1P: TX: H  #<H,   !7EC #4$P TH, !=@ -#EC #7 #4$P TEC #;  !:H 
XL#PZ TX TC00* ,  A@ H!X   A@ H! ,  A@ Hs]P  C0$X LHL #>H< 0 #40 !6P .lA<Xj P
f
mHP dX P-A@ pXj H Ű #3!3AXj H ɰ #&Ű #3AXj AXj  ` -B@X H[ P B0 ` -#4E[ #;H 
XLL!z `A$P  C  X Ek !8b
oXVLP #5Xj  AjXj H -A@ pXj  A$Xj A Xj  AXj H -A@ pXj H Ű !4$jAXj H Ű C0XV  P B6PB .U#=P ,PW 0XZ  `   A#	@ ,XZ  ` A#P ,PW 0XZ  `   A8Xj  A~XZ Xj  AXj X  @ $PPV  $@ @ z Xj H Ű !5` AhXj X  P XɰB6ɰ B .!@ ,XZ  `$ A#$P[@W ,XZ  `% AC @ɰ B ɰ!.$PPW ,P 0XZ  `   A#$PPW ,P 0XZ  `   AbXj  AըXZ Xj  A<Xj X  @ $PPV  $@ @ z ` Pj PX XZ  E[ !4z H  !5@( PJ PHK @G ,Xj PAXXj  A4Xj  PoHXPLAV$\
  
Xj $<H +
?! $ $$A@ HXZ  @V z Xj H P \$Q@V $@ Xj  AP .Xj AXj  AԂXj X \@ $S@V Xj Vf AXj  PoHX&PLXZ H  !7@X PJ PC B !7@H PJ PC 0 !:@   PJ P$0P?L# !6@h PJ P#@s PJ PH P ,X5  P7 0VdAfXj  A
XZ Xj  A֞Xj X  @ $PPV  $@ z Xj LH Ű B0XZ  EV C0X HL B0X<  P: X$H& 
XY (!Y!0!0 C XUC0P -!eA,P  #%!6R
_UL#5Xj  A~Xj X` B*`B "X LH[ PW ,Pg 0XZ  `   AnC X LH[ PW ,Pg 0XZ  `   AްXj  PoHXPLXZ $P  $A@E @e AC XZ  Xj AXj H P  XZ LH  #4 !7P -Xj LAXj LH B0XV  PZ XPB<P B 4U#P X$[ dP dX d

X X@ ,XZ  HkA:C P BPB XUB0VXMUJ  B0JX: dU=#4P XXj XAڊXm
f
mX  
[ 4TX
JVe\ 4
e%RZ]A"#XJ d
D
MP ,PW 0XZ  HdA#X d

P ,PW 0XZ  HlAHC Ű B0NXZ d[  
]H @ ,PZ pXZ  XJ pHdAۀXoPmX  PXZ dP]X LHL PMC Ű B00XZ d
U
]H P ,XF  PG 0PZ tXZ  X: tHcAVC LAXj LH Ű !4%QQZ dHV P !4$Q dX d

HF PG ,X6  P7 0XZ  HlAC nXj  ` -BtX d!4P l#$QPZ lXZ H  B0FHE 
M4 4U lB02He A
XaLB0X H[ PZ hX d!6eAP h#AP hC 0
mӶ 4ð #:Xj  Ap
XaL#6AP h#X  P hXj hALP laAXj d#=Xj lAXZ hXj AC Xj hAXZ lXj AXj l@g ,XZ h` A$<\* h
?$\
 l
# $ $$A@ H$\\J h
_$<\* l
?% $$A@ HXj lAd$`Pg ,Ȱ P 0XZ l`   AٜXj lAvXj LH #6HV P #5P -AbXj LAXj LH Ű B0*XZ d[  
]H @ ,PZ xXZ lXJ xHdAC ,XZ d
U
]H P ,XF  PG 0PZ |XZ lX: |HcA
Xj P` !;X hP XXZ lPZ hP lXj lAZXj lAξXj hAζXj X h@ $PPV  $@ U  #5XZ  AC (Xj H B0XV  P B0X LHL @ B0LX:  0 -B&H 
UAL!6H, P*  #cAP  #E< !62
?UCL#5Xj  A#XZ  lAXj LH P  Xj  AXj LH @ ,XZ  `   AXj X  @ $PPV  $@ C XXj LH B0dXV  PBXP B PX HL @ !;X:  0 -C6E< C0.* ,  A@ H!  A@ H! ,  A@ HXZ  Xj APXj H P  XZ LH  !7P -Xj LA*Xj LH B0XZ dB0,X   B0 Xj  AXj  @g ,V`   AC vX   B,B $
U
]P ,P 0PZ XZ  XJ Hd2AC  
U
]P ,P 0PZ XZ  XJ Hd8AC |Ű B0*XZ d[  
]H @ ,PZ XZ  XJ Hd0A>C JAXj LH Ű #4Ű !4$QQZ dXZ d
U
]H P ,XF  PG 0PZ XZ  X: Hc4A(C XZ  Xj AXj H P  XZ LH  B08$HE 
X?Y1 (C"! /"!>X $!ɀ !(P  @% dA:Xj LH B0XZ dB0*X   B0Xj  AHXj  @g ,V`
 ARC PX   C $
U
]P ,P 0PZ XZ  XJ Hd^AZC  
U
] @ ,PZ XZ  XJ Hd\AC .P .AXj d
f
mX LH[ PW ,$P 0XZ  Hf^AC fXj X  E B0D[A$`Pg ,%P 0XZ HU `   AXj d!<$@ ,XZ HU `& APC nXY DPZ LXj dA4Xj LPi DXj AXj Hf AXj $@ $dA%aQoX
X* X   A@ HaA,XZ  Xj A(Xj Hf AXj H PHX_P_Lz $SXj A$TXj LA$cAt$dAn`Ax$bAɖXj $@ C ZXj H C0\$RA$bA:$cAʖXi d!;Ȱ +@ ,$S` An#Ȱ +P ,Pg 0$S`   AԆ$cAh` Qi d`	A#$SAX$cAXj LA6$cAXj $@ $S@V @V P  X   -#<\AXj $@ $S@V z Xj  ` -!4$kA@Xj H P P$P@V C0,Ű C0XX P LXj LH Ű #:XZ PP #5P /A.Xj H Ű #5XZ  AXj P` #5` B0pXj AXj Lm #3AXj LX  E #?XZ H  C0<HF @ B00* ,  A@ H!X   A@ H! ,  A@ HXj Lm #3AdX P-A@ pXj PA4$gPj PXZ  Xj AXj H P  XZ LH  B0 XJ PL  
MH5 @7 ,[HdjAцC "XJ P
D
MH5 P7 ,X  P 0[HdxAјC Xj X  E !5P /AhXj  ` /!5AP  Xj  A<Xj  AXj  @g ,V`+ AXj  AXj AXj H Ű !<HV @W ,XZ  `+ A#HV PW ,X  P 0XZ  `k AXj  PoHXPLAXj X  @ $PPV  $@ z Xj H Ű #5XZ  AXj AXj H Ű B0nXZ  P /#4EV !4z H @ ,`( A<$\
  
Xj $<H +
?! $ $$A2XZ  @V eAXj  PoHXPLz XZ  P /!5AP  Xj  ` !` #$$lA@Xj H -AXj LH Ű !9$aAXj L$@ $^Xj A$RXj LA$nA2$bA,` A4$mARXj $@ #XoPoLX  PHXj  AdXj LA\z W  A" 0-Ah$mA@Xj  X ,Q  z Xj  X  [ ,P  z Xj  X  V ,P  z Xj  X  T ,P  z Xj  X  W ,P  z Xj  X  XZ ,  P  z Xj  X  \
 ,P  z Xj  X  XZ ,  P  z Xj  X&  X: ,AP  z Xj ,!7%fA@$aPj ,X  X    P  z Xj ,!7%fA@$aPj ,X  X    X[  QP[  z W  A 0Xj X P ,$P@V $RAj`cA҆Xj ,m #5Pj C z W  A TC xW  A ,Xj 0Pj 4XZ ,PZ 0Pj ,X LP HXJ PPJ LP PX?2
?PC{ W  A> ,AN#8P /Xk A\#P -Xk AN{ Xj ` B XX
X[PZ LeA#=Xj L%[  Z 'P  C "Xj LH #3AXj LX @ ] PV z %Q$PPZ 0PZ ,PZ 4X
XLPJ LX< P: PdA.#3P 0Xj PA.#3P ,Xj ` !>X ,#;$SPZ X P$@[L  PL  Xj LH C0@P 8XZ P B0,Pj HXj HH #6XV PZ H"	XZ PPV $@ z X P HP #'lA.#3P 4Xj 8` B08X Ű B0,XZ P$@ XJ LPE $0@4 X  
PQz X HH[ P !4$`AXj 4Tj ,C0~Xj 
mX 8
V\PZ <#;P B0ZXJ 8UJ B0NXJ PX4  P7 ,X HQXj AXj PAZXj b
mX HXV@U[  !9X L$@@L kA4z Xj LAXj 0Tj ,C00Xj ` C0$X PX[  PW ,X L\AXj PAz Xj 0C0 X 
[U#:AXj LH #3APXj ,C0TX Ű #5Ű B0Bs]P  #9X LHL @ B0(Xj LAXj LH Ű C0HV P #5P B0AXj ` B0X LH[ PZ D$P @P !4$BPJ @XJ PX4  0 !9$P D$!Q* @C <0 B0.X  #8X    P   @ X* @Q+  %P @#%1P: @XZ @!X: D@; Q[  dAz C TX PX[  P !=X LHL @ #60 P: D#P !5$P D#%P DX D!XJ L@ kAlz Xj PH #3AXj 0Vj ,C0RXj ` B0FX 0#3A~Xj LAN#5%aPj <#	Xj PXf  AjP <Xj <!X PPk  $[PZ #ABXj ,C0"X 
XZ PX@U  !7eAz X LXZ @[ X PP z W  A ,Xj  m C0$VXj A#5$z Xj  X P  C $z W  A> Xɰ #$hA@Xob
oXP 0XVPZ ,X CHE @ B04* 8  A%  A+ 8  A$0P9 hz %1Q5 X Z,P 0X-#aAXi 0AXob
oXP ,XY 0  #$$@PJ XK  ZK PI hs; 0 C0$$lAH$aA>Xj ,X  &P hXZ 0s @ C0j@ +PG ,X6  P7 0T`P AlXj 0sf `$TAR` ,Pg ,$P 0$\`   A@` +Pg ,X ,X[  &TPW 0$\`P A C tHE PG ,X5  P7 0$\`X A` +Pg ,X ,X[  PW 0$\`P AXj 0H P ,&P 0$\`X A` +Pg ,X ,X[  &TPW 0$\`P AƨXj 0AԂXj ,Az%bQoz XZ ,X CpsM@ C0d$0P5 * X  AB* 8X 0  A2$Q XX: H#Q 8$@ R#
Ȁ *@ LP: 8$@
 Rj XARj 8AJ$`A%bQoX ,H[ P 
B0X #4$oA@Xj 0H sV PP AߎP -Xj 0A*Xj ,H P ,XV  PW 0X 0H\ `P AŢ$`Pg ,X P 0XZ 0HU `   A|Xj ,Hf AXj ,H P ,XV  &TPW 0X 0H\ `P APXj 0Hf AHXj ,Az X B0*XJ 0H4 0 !7H !4aAXj ,AXj 0AXj ,H Ű B0Aެ$SXj ,AXj ,X P xXZ 0H  B0 eA~$RXj 0A$bA
`	Pj |#@	PJ |Xj 0AzXj ,ArXj xA %aQoX
$QXk A$cA
Xj |Az Ű B0XZ 0U_PB0$bA>Xj 0Ȱ @ V$bAm PoPA׀P $TaA` ,Pg ,X P 0$R`A A$`Pj xXj x
oӶXfY
kA$bQj xX xXT\  	C $@L  Xj AvXj 0$@ $R@V $P  eA$`AՠXi d!5Ȱ ,P d$RXj 0AXj ,AZz Ű B0rXV 'QPZ !P #6s !4$P %aAJXj 0H !;$Q@V X ,$B@L C ,HV !5 Q dH C0XJ B0X6 P: 4@F VXj ,AC0JXZ 4Xj ,AC0:Xj ,Hf A
$SXj ,Aް$cA
Xj 0AКXj 4AXj ,AЊz XZ 4Xj ,AC0*$RXj 0A$SXj ,A`	AXj 4ADz Xj 0$@ X d!<XZ ,H  +!5@ ,PI d$RAڠ$SXj ,AږXj C0$AѾ%aQoX
$QXk Ar` AƎ`	AƆz Xj ,A6Xj ,H Ű !6s]P  #5Ű B0XZ 0H  B0P A#4$oPj Xj 0$@ A۶Xj 0X @ VXj ,AC0Xj 0X P 4P -kA\Xj ,Hf A
/(X ,  A8%bPoHH Ű !6Pa PZ |#PQ PZ |H P ,XA  PG 0X: 4HS Xj |Asm` #:X |Űa !5` AŀXj ,ApXj 4Hf A
Xj 0AξXj 4AζXj ,AήXoPoLz Xj ,H Ű 0B0\$PPY hX  P |XJ 0H4 #5\dAxXj ,AhXob
oXP ,XZ 0X P HK @E P[ X: |@; C P -PZ |$P HF @ !70P P: C X@ B00@ P:   P   P* C 2@ !?0   P:  P   P* #	0` P:  /P |X C0ZX* 0H B0$  !6H   !6H   !3P C *ŀ B0"Xb H !=U  !:AdXj 0$@ P sm` C0DX 0H[ B08X  !7XK  H!3PJ X   !<XK  @ !@   !#PZ XZ |Xj 0AXj ,ApXj ,H P ,XV  PW 0X 0H\ Xj Af$dQoLX 0` Jk XZ ,AXj #6sð !9X 0Hk A
C lXZ P !>X 0HL @G ,T` A.C @$aA>Xj 0H @ ,$Q`   A.Xj 0Hf AXj 0H @ ,$Q`	 A.Xj AXj 0A Xj ,Az W  A XA϶` ,@j DX @P ,H[ P #'P #4kA֊$`Pj TX DH[ P B00Xk A.C0$Xi DX XZ ,X  \ P T$@ kA˖Xj ,H Ű B0XY DH B0XF @ B H5 #4eAXj ,H XY DJ @ DX  P 0XF @J HH5 0 @: JP ,P 0SdAP PC0*%aQoX ,@ XZ TQ[  $@ Xi DAz Xj ,Xf A̖$fAXob
oXP @$SPW ,$P 0XJ ,XT  Hd AXj ,H Ű !=XY DX  Q T$@PE  $@ Xi @A.C08Xi DH Ű !5P .AnXi @X  Q TXY DH @ %AQOC DXi DH B0HV P !;P .Xi @A*%aQo#$cALXob
oXP @P DXi @H #5P .A%aQoX @H[ P !7Z 0Hk AXj ,$@ XY @H @ XJ TPF  C*H6 P: PAzP .Xj ,AלXj ,X P@ $S@V X DU @#4kArXi @Ajz W  A0 4A%bQoX @H[ P #'P #4kA$RXi DAӬ$cA>$cAHXi @X C6$PPZ 0PZ ,H P ,XF  &DPG 0$S`X AfXi @Hf AC &$QPZ 0X  P ,@ *PG ,P 0$S`   A``A$bAHXj 0#>X @H[ @W ,$R`
 A.C X @H[ PW ,X  P 0$R`Z AfXi @$@ XZ ,PV  $@ $@PF AɚXi @A@z W  A 0` @oHP_@X ,ҿJ6$,
?XOYC (!( X?8U (!4$PDz W  A DAP @Xj H P 0P PZ 4 -P 8$APJ <AN#>`( Pj 4Ȱ /P 8$VPZ <C xXj 0C0pX LŰ ?B0dXZ X P ,$@@E ` B0H< #50 B0H  C0R0 C0JH%   B0>s #5s  B00eAԈXj Ȱ @ XZ ,@ s !6sE  PE  #$BQF  P -Xj AXj ,H Ű !6$PPV  @V XV  P !P#'H  B0"H P ,PW 0XJ HT `   A`C HF PG ,PW 0X: HS `   AXj Hf A
Xj ,Afz H< B08` B00X  ! C APL  \Xj ADXj ,A&z @e Xj 0B0XULB0~UC0vX_HC XZ o(A#:Xj Hf A
z Xj AXj H Ű B06X_HEV B0*Hf A
Xj @!<X <P ,VX Hl AVz XZ 8Xj AӆXj H UH!6X_U_L#9@ ,[Xj 4A.#kA
Xj @!<X <P ,VX Hl Az W  A LH Ű #5P /AΘXj  H Ű #5P /A΂Xj H #5P /AXj  H #5P /AXj H Ű C0JXZ  H  B0:* ,  A!  A! ,  A$FWOPOWPP /A|sm`  #7P /Xj  AfXj  AѺXj  H Ű !?HV @W ,X H\ `) A.C  HV PW ,X  P 0XJ HT `i AfXj Hf A
z W  A ,C 6W  A ,] P_PH #5P -AXk $R@V A{ Xj H #<XZ  H #7HF !4H5 #5P PY lXT\  UB0@XJ  H4 !>AXj $@ $S@V z H !<dAd$fWoPoz $`A^$RXj  A6$SXj A,$RXj  A"$bA
$cA
`kAXj $@ $S@V $P dz W  A TC xW  A ,Xj HV P !6X L ~!5${ XF H4 !4H !5${ X$    ! #%${ H ŀ !5${ $WP$aWoPo* ,X   AH!X    A:! ,  A,$0@2 P -Xj A"P .Xj  AXj  XV X   BBB :XJ P#70   P: L#0   P: LH P ,P 0X* HR cA`C 6XJ P#70   P: L#0   P: LH P ,P 0X* HR cAXj Hf A
Xj  Xf Aj${ $`PoPi lX @H[ #4P !:XZ  Xj ABz Xj  A#8Xj A6z Xj A#=Xj  A$fWoPoz AP P ##< =#9Xi L` f#4$P PA#4z Xj  AXj AXj AN!6Xj  AN#:XZ  Xj Anz Xj A.B0$Xj  H Ű #<XZ H  #5HF C0L* ,X   AV!X    AH! ,  A:$fWoPo$WPAH#4z P -Xj AXj  H B0,HV P C0 P #>s  #=HF @ #4@ !5P -AXj  H Ű !3AjXj  H #5Ű B0XV  P BBPB :X P#7@   PJ L#@   PJ LH6 P7 ,PW 0X HQ dA`C 6X P#7@   PJ L#@   PJ LH6 P7 ,PW 0X HQ dAXj  H B0 XZ PP #!<$P ,XV  XJ Hd AC AVXj  H Ű B02XZ P#6 P L#	 P LHF @G ,X: HS lA.C pHV P !8   P LC 8X P#>P !6@E PJ L#@U PJ L#P !6@I PJ L#@Y PJ LH P ,XF  PG 0X: HS Xj LAfXj Hf A
z W  A ,X d&İP  !4z $PPY dɰ #,PW ,P 0P +`   A`z W  A ,Pi d` #-$P ,Pg 0P +`   A`z W  A| ,X'PX_P ,# ,Pm #7sf `A"` +Pg ,$P 0$V`   Af` +@g ,X_` A.sm` "C0"`  #:`AXoA#`A#
ӽ _k`   AXoPi x$`Az W  A ,XoUo!4z XP ,$XPW 0P +`   Af$lA$l@g ,$P` A.XoPoz W  Ad HC .W  AT ,$dAXk AXk  A%Z{ Xj X  P <#`  kAC HV P B0$P A#HA&$`Pj DX X[  PZ @Pi L-A*P /Xi @AXi @H P 4
[ 4PZ 8AP ,
a 4Pj 0d`( Zj 8AXm!?V`F A(P$P`AAP <Xj 0d`j ӽ ^
kAXmAXj 0d`( Zj 0AXj 8d`+ Zj 0A`#AXj 8d`j ӽ ^
kA$dZmAXj 4AHXj ,AHz Xm!8V`@AP$fPg ,$P 0$PPW 4PW 8PW <P *XmA#$cAA&P /Xi @A$`AP DXi @H @ ,Q`. A.Xj DAXi @X D@ $Q@V z Xi @Adz $`A$A&Xi @$@ $QPV ATz ` Pj DXi @ApXi @X @@ XZ DPV z A&` Abz XoPo` A$bA$aPg ,$P 0[$bA&r$aAz ` A$$hA` A$$cAA&Xi @A.C0>$bAXoPj <X @Xk  AXi @$@ $S@V  *@ XJ <PF  C tXi @A$A&Xi @$@ Hf A
Xo&a`PoX @$S@[ @[ X@ Pk  $aA$cPg ,$P 0X_XoA&rXi D$@ $RQ_z A&%bQo$P 4XY @X  P ,eA.B0P .Xi @A$`Pj ,X @H[ PZ 4Xi DA Xi DH P ,XV  PW 0$]`r AfXj 4Pg ,X ,P 0$P`   AfXi DHf AXi DH P ,XV  PW 0$]`q AfXi DA#HXi @A#HXoPoz Asj >`@ B0A(P <$TaA^` ,Pg ,$P 0$\`   Af` +Pg ,$P 0$V`   AfXj H P ,XV  PW 0$S`X AfXj H P ,XV  &TPW 0$T`X Af$cA$cPg ,Ȱ P 0$X`   Af$dA$dPg ,Pg 0$\`A AfXj <A"C (`$TA^` ,Pg ,s >İP 0$\`A AfXo'aPoXj H !3A#Hz W  A HC FW  A 4A.#4{ P -Xk AXk HV P[ 0AP ,XoPg ,P 0X[ 0`P AfXk 0A
Xk X_@V X ,P  XK  @F $3@6 VXk 0A{ W  AN 0Xj 8A.#;Xj 0A.#6Xj 4A.!5${ Xj 4XV  C08X 8XJ 0X<  [4    &P ,!'Z  U  !5${ %lA@${ W  A 0A$Xob
oXVP[ ,X[  Xk ,AT%aQo{ $`Pj DX
X[PZ ,XP 0XKPJ 4X;P: 8AAP <$QXj 4Av$QXj 8Alsm` C0:AC02QXj 0AN$QXj 0AR$RXj 8AH$SXj 4A>` AXj ,H Ű !8HV R
_XL!AXj ,HV AXj ,$@ Xj 8A.C0>Xj 4A.C02Xj 0A.C0&Xj 0X 8XZ 4X  Z  U  #7s P D%dQoXj ,A$Xj 0A$Xj 0Hf A
Xj 4A$Xj 0A#H$dAزXj D#?$`AP @A&XZ @Xi @Ab#$aAXj <A)vXj DC0ZXXZ ,H  XE  PK X: @; X 8X!  P+ Xj 4A$$cA@$aAݐ$\\J @
_% $$AC BXj ,A$Xj ,A$XZ 8Xj ,A%bZj <$P ,$PA*Xj 4A$$cA$aA4Xj ,A#HXj 8A#HXj 4A#Hz W  AT 0Xo` !7XoAC ` !7XoAC r` !7XoA C `` !7Xi XA'nC N` B0XU!5XoAXoPmC (X XP ,$PPY Xi Uj ,#8&aPi $`A"z AP L-@AXo#4$nA@Xom #5` A@AAXoPm $PP d`@ !XY |!6%oPi |A@C AlC AP %bQoX
X[ X  P PXXL  PI TeA#HXob
oXfA#HXi P` !X Tɰ#)%jA@$`Pi TPi PC *Xi T[i P&a\	 XP !(Xi XPi %hA@Xi Pi $P Xi Ui #8&aPi $`A "C $aPi A ,!7AAP Xo` B0$PX_#;A'8Xi @X  PA#HXo#?XP A'8Xi @X  PA#HXo` B0$X @H[ P !7X/
`#X%Q  X !8XY T[Y P&QPY X !+XY PPY T$P %hA@Xi Pi $P Xi Ui #:&aPi $Q PA>"C $PX_#;A'8Xi @X  PA#HHi ,[i @i ,XŰ C0XY PY $P Xi Ui C0l&aPi $a ,HY ,TZ_,P_X!>XP  ҥ E 'AE C .XP  @ *E X?0 !9X @E1 !4'P  A~C Xɰ@ #%XY |C0hC A(&C AP AXi A	2aA$C A"P DA
` ,Xi DPg 0A%bC A -B0AAP A&Xi @X Z,H[ ZY TZ_,ȥP 0X#jAXi 0A$RA&%aQoX @H[ P #5P B0X DX  Z  P  'SJZ @[ C \P B0*$@ $@ P .kA1PXi @X DH[ @V C *P !(X DH @ #X  P X DHL &B@K Xi @X DX[  PV  H @ X P XK PF X; P6 kA#HC JAaAZ,P 0aA$RXi @s ð C0 HV P #<AP p#7Xi @f AC TA'8Xi @H P p$P@V PY Xi pC0NX @X[ PY HX P H P t$@@E VXi HA1PXi HA#HXi hVi pPi X tP pC i A
Xi hA
Xi @Pi HA
Xi HX PHV C0&X LC0A$Xi HA#HA&Xi @Hf A
Xi @H Ű !5$]PY p#$RPY p@V $P  $D @ eAXi @H Ű B0HV P B0$@ AP L SC0 pC0 ?C0Xi HXV PY t!5 P tX&PXI @@ X?@4 P  Z tPP ,$ P' 0XT  cA&rXi D$@ XY tPV $P ,$P 0\$bA&rXi D$@ $aAXi L#5XoAvC zA^C rA'8$`A'nXi 4Ӷ Ű !5$]PY p#$RPY pXi @A-A(C <A'8Xi @A/"$RXi @A-A
C `$AAC `$AAC sm` #4Ah#AߴC $nPi pC z$cPi pC p$dPi pC f$iPi pC \$jPi pC R$hPi pC H$kPi pC >$lPi pC 4$fPi pC *$gPi pC  ` Pi p#$bPi p#$aPi p#$mPi pXi pAnC VA&XoH#$PHXi @AN#6` /Pi #` -Pi VXi @A1PXi @AXi @H P $QPW ,$U$cA*Xi @Hf A$bA A&XY Xi @A1P$cA)vXi @Hf AHC $aA*C $`A C %aAXi hPi dC $aPg ,V$bA4$`Pi pC 6$aPg ,$P$bA$aPi pC $bPi p#$cPi p#$dPi p#$ePi pAP XY pZ_$aPg ,aA*C 2A&Xi @A/"Xi DA/"A&XY DXi @A %bQoXi DA#HXi @A#HC XoZob
o/X   AbA$Xi lPi dC XoPo$PAaAZ,P 0A'8Xi @A#HXi @X  
XY 0HU 
[XoAC xAaAZ,P 0sm` C0TȰ *@XQ  PY Y oA0BA'8$RXi @A-HoPg ,X P 0$S`   A`` AC $aA$$kAA'8P .Xi @A-Xi @H 
[ 4PY TPs m ^
eAXi 0H P XY X P@ e
kAsi AXi d`
 ӽ `
kA` Zi AXoPoPoC jA$`Pg ,$\aA*C TA$aPg ,$\aA*C >A$`a$P ,$\A*C &A$`aA)vC AaA)vC AC  A'8Xi @A#HXi @Xf  AXoPoC A'8Xi @A#HXi @X  Pð  #;%QP_`X!4%nA@#$PP_`C A #4%iA@A&$`PoXi @A.#7Xi DA.B0.$VXi @A1P$TXi DA1P$`[oPo$Q%QP_C 0$`PoX @X[  PY PX DX  P T	\#(%gA@Xi PPi T%bQoXi DA#HXi @A#HC XoC0CNXP ,$P[_PW 0$W`   A`Xi XA$A'8$RXi @A-$fA
$dA
`oA$aPoX$\[ XP  &PXP ,XK  PG 0$T`   A``.	AC XB0&$dAXoPoXi PAXi TAXi XAXi T[i P&a\	 XZP 2C vXoB0nXi PA$Xi TA$A&$VXi @A1P$TXi DA1PXi DA#HXi @A#H%bQoȰ *P ,X_PW 0$W`   A`$gAH$`[oPoC X P\ XXoX_[PV  PXoX@ C pAP %a[oPo#=H ,@ ,HY XoAC $P $WPY t 2!:X&X 4Ġ@ 
H ,[ `P P  2!3P X C 2P X 4X[ @ HI ,PI X9 `P9 Xi Ui C0&aPi %QX_TZ_,PY 8dZo,Pi <%$A|X Š 2C0h  0B0NXOF X9 tP5  Š 1B04A$RA'8Xi @A#HXi @H Ű #7$Q@V $@ VXi tA#@ +E $P tXm#Xi 8AXi <A%aQi tC 2H ,Y!%dA@Xm ` 2C0$X 8[ P !<ӫ Š !7$ $@PI tXm ` 1B0<Xi 4AXi tB0^XP ,XY <X  P 0$S`   Afsm` C0*X <[ P #?eA$A'8$QXi @A-` A`	AC NXoB0Posð  C0r] `P@P_`4A`A`$A`$A`$@A`X=A$dA`A`  A`  A`  A`  Am AAP tXo@oP Y oA0BHoPg ,X P 0P +`P Afm PoH ,@ ,HY $`AXo@oX tP Y oA0BHoPg ,X P 0P +`X AfC *$`A$$`A$XoPi tXo#<A'8XY t[_Xi @A-"` AXoPo$PC Hi !7XP \C 4X&%dkXY xAbXoUo#=X 4[ U#5%kA@#A$`Pg ,%P 0VeAXi \PoH C "X_R
_$PL%Q<XM<
M4  P?%QQ] y $`Po X,Ű !3A@$bA$cA`  A8$bA$aA,`+"Po$PPȐ  PPPPPPPPPPPX_,P_ȯXPTҺ   PP%APOXo` ,#:&aPob
o$PL"%PXo` #:&aPob
o$P@"%PPPPLPDsÐ  #3P`PPXo` C0 &aPoȰ
!X  AC $PXo` ,#<&aPo$
%P ("%PXo` C0&&aPoe
oȶ`P\X
YPYC Ƚ P<Pȟ@P_P_Pȭ P$@ ,\$bA$dA$eA$cA>$hAXoAtXo&a`AtXoAtXoAtXo #5$$A
X , $@X= 0
3'4XC   PC   "0
3$ '4PC   "1I2 !+K2  !
3s3B  #3
>3!$$C P P6 PV  5!%$$C !$  3##$$C p$'1"Ps  Q  Pc '
qX=  s #'q!$$C @X^ P8PQB' 5$BX= Jx  X   C Kx  $$C $JX= $IX= $DX= $CX= V`  $GX= `  $EX= $j$EX= $FX= $EX= $HX= X  $$C 
   636        P == P_LINK
   637     %REPEAT
   638     U_BASE = LOCAL;  Bj" 	  4.13             )	
         ,     	
 
                             (         ,          ,         P                                                 
                                                                                                               P(nnN0          \ ? ? ? @ ? ? & ! ? .   V   Z       A               rxrrr          
	         	            
                                  ! ~wyxxpwws\yyww  www                    {VxxyyNsq{y:su{}qB{.w^{Fw0sdp|{lwvxwNwvyx  xwww  y  wnp}{́N{d  |t    x        x{  Bx{xpx  {      yN                                                                                                                                                                                                                                                                                                                                                                                                            
                         
 &  Z J   '  [ K             ]  \  \             T D    V F    W G                           * +   , -     j k   l m           +	
*,)   456&6l3343    @f@f728@  :^:^<==?B?BANA8@B:^  CVCCdCd  Cd  CVCVCVCVCVEr    C^                      FFFF   FFFLF6FbFxFFFFFG                                                                             hhhhhhhhhihjh&gFi$i\j@           686  %INTEGERFN  FPR
   687  ! get a floating point register
   688  %OWNINTEGER  LAST = FR0
   689  %INTEGER  J
   690     %FOR J = FR0,1,FR14 %CYCLE
   691        LAST = LAST-1;  LAST = FR14 %IF LAST = FR0-1
   692        %RESULT = LAST %IF ACTIVITY(LAST) = 0
   693     %REPEAT
   694     HAZARD( H?   H H                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             W  p2lP ,$Q0m$A? 0AB$`Po0Po0Po0Po0Po0Po0$Q0 m$A?2(A$Q0 m$A?20A$Q0 m($A?28A$Q0 m4$A?2@AC W  p 0AXi P  AP ,X Xk  haPk  y W  p ,hfAi Ay W  p <AHi d`Pi 8$@ 4Hi 4Ui 8C0"&a@i 4
fZi ,H  @ 6a kAC %aKi Ay W  p 8ArHi d`Pi 4$@ ,Hi ,Ui 4C0&a@i ,i 0AXi 0ai A8C %aKi A*y W  p ,Ho0` #:d` X20P ,A$a@o0X20X_/@[ y W  p ,Ho0#:d` X28P ,A$`@o0y W  p ,Ho0 #:d` X2@P ,A$`@o0 y W  p ,Ho0"!4y d&dX2(P ,A$`@o0"y W  p ,Ho0$#:d` ȿ0&P ,AV$`@o0$y W  p ,$a0H_0
UZ_20@e  $Q/dy W  p ,H0Ű !3A$aao0H0
Z28HY @[  $Q/hy W  p ,H0 Ű !3A$aao0 H0 
Z2@HY @[  $Q/ly W  p ,%[@P@!7hZmDA#PmDy W  p ,$a0"H_0"
UZ_2(@e  H0"Š !3A$bQo/py W  p ,Xo/UmH!4y PmHAXo/dAy W  p ,$a0$H_0$
U
_@e0&H0$Š !3Ary W  p ,AAA$`AL$`AFA`   A$bZo/dA$`A$`A$`A$`A~$`Ax$`ArA
$`A\%aAVy W  p ,$`AAFAULTA $QXi A&A
   PHASE A$QXo0 A
A$QXo/AA REFSAAA
	MAX LABELA$QXmAA$AW  p DXi Yi  C$P ,c
oV 0PY 8X  P @X P 0Xi 0Ui @C0h&aPi 0c
oȶ 0P <XY 8X Y C,X P 4P P XK  PI 4X5  P;  PE  $P ,#
U !7$P ,%JPE P 8C X ,#6%QQY  C Ny W  p 8`Pi ,Pi 0Po/X/YLB*XmLc
oȶ 0P 4X[ P!6$QLC QPY ,Xo/YmP#-XPZ 0P/X[ QPY 0ȰP/U 0!7U ,!4y XY ,YY 0C $QLX 4XL PO/X<  P?/y YY 0C $QP$P/XO/X4 P?/y $aAy W  p ,Xo/`#(ȰP/y #Xo/X #Xo/c
oȶ 0P/$QQ_/C P/XV  P_/y W  p 8b
oX-Ű #4y $RPV-X 
X (P 0B0H$`ATANO ENTRY FOR PERMAT$QXi AZA<Xi b
o$PPV-$bAy 
X (P 4$@PI ,Xi ,Ui 4C0H&aPi ,$Q 0XY 0R
]X (  B0"X ,P 
XL-@ #7P-Xi AC y W  p 0Xo/s  ð B0bX_/d&TX/P ,ɠ B0ɠ@ C(s_/PP_/eA\`   Vi ,AN$aQo0#Xo/A>Xo/A6$aQo0C $Xo/A$so/f`@ AXo/A$aQo0y $aPo0 $P/Xo/` 6#<&aPo/b
o$P-P."$P/ȐP/P/P/P/P/P/P/Xo/`#:&aPo/b
o$PH"$cAAPAxP/-Ao/Ado/dA\Xo/`#$$bA0XmYo/#X/PXo/Uo/B0TX/dU/B0HU/B0@$Q/X_/X   `  P  X/XL  @   PL    P/P_/
P/#$P/Xo/b
oX/dPHC D` @  Po/C ,$`Po/C "`   Po/$Q0#	`   Po/$Q0o/A~o/dAv$aQo/X/Z 0P/X/ɐ##A8Xo/X/Z/P  X/dP X_/!7&P/Po/#P @  !:&P/X/P/Po/P    C0PX/ɐ 6!'
X (B0,$`AANO PERMA$QXo/AA$bA#X/
$APL-C 6%aQo/X/
ț 0P/#$aQo/X/
ț 0P/o/A|o/dAtXo/X/P  X/dP X_/U_/!4$dA4C o/xADo/|A<o/tA4o/A,Xo/x[o/Po/x$Q/X/Z 0)$AhX_/C0J$P/X/'P2HP/Xo/Uo2HC0&aPo/cZo 0Po/X [/P s  Ð @C0Ð C0$RQ_/X/P2L$P/Xo/Uo2LC0*&aPo/c
oȶ 0P/X/XY Y[ #%Q C X/ɰB R'P/Xo/`C0@&aPo/c
oȶ 0P/X/XY Y[  #%Q  s à #7Y[ #%Q C XP2P$P/Xo/Uo2PC0"&aPo/b
oX/X YH#%RQVHC %Q/C X/#4$eA$`Po/Po/Xo/` 6#7&aPo/A"
$P/Xo/` 6C0B&aPo/b
oX-C0,X/xP.X_/R
]X (
X (
P/
P/xQ/C $P0 X/ɐ C F#Xo/C0<$`Po/Po/X/'P2TPo/Xo/Uo2TC0&aPo/cZo 0Po/X/Q s  Ð B0$PP_/s P/Ð  #4Ð @#8
XHP/#
X.P/[ ! C Ð B0LX/@ !XF &D !@ #$P/XF  @   PF  #$P/XF  @   PF  C 4X/@ B(XF &D !@ !$P/XF  @   PF  X/C0$P/XO/C @PO2XP_/Xo/Uo2XC0,&aPo/c
oȶ 0P/X/XY Y[ #X/Q C Xo/`B >'aPo/Xo/`C0,&aPo/c
oȶ 0P/X/XY Y[  #X/Q  C XmPo2\$P/Xo/Uo2\C0,&aPo/b
oȶHP/X/XY Y[  #X/Q  C $P/Xo/` 6#?&aPo/b
oX.#5Z/P.C X/Q/Q/xC C $cPo0 ȰP/P/Xo/Yo/Cd%Q/X/
Y 0P_/s à C0&%T P $Q/XO/C
O$ 0$A#Q/X/
, 0$AC X/P/X_/$aAPXo/A$bAL`  AnXo28X/x&@ X/|&@ X_/P Q@V X/tʠ @ Pg ,` OAJ$bA $`Po/dXP/hPo/lPo/pPo/$@0AXma@o0$@0 @0"@0$AAAP/$`Po/Po/AP/Z/-Ao/A~Xo/Uo/dB0@X/#7Xo/AnC (X/sY R
_XHP/s   0#5 @C0 0C0D C0.XO/!5X?/P?/$ODO/B
MX40   P?/A2C bXO/PO/$0P?/$ODO/PO/ B0d[/dP2`X2` $2P/ɰ!ɰ #$$eAXo/#X/
Po2dXk[o2dA#	X/
Zk,A$aQo0#	B
MX4lP?/AC ,Ap$ePo/X/s  Ð  #9s[ R
_X.P/AAf#Xo/A4C o/AXo/`  !?o/A
`@ ABXo/dA:C \A2o/Aso/` #5X/dP/Xo/Ao/AXo/A o/AXo/Ao/AXo/Ao/AXo/AC AC $aQo/AC $`Po/o/AhC $jPo/$P/P/Xo/` 	C0*&aPo/X/#>A8P/$aQo/X/
P-C Xo/#6AP/"%Q/X/P-P/Xo/` #;&aPo/b
oXf-A"o/AAP/aAtXo/A0C "o/AXo/Uo/h!7X/P/AXo/AC $`Po/Xo/` 6C0&aPo/b
oX-C0X/
XY (P_/!4$fA:Xo/b
oX.P/U/d#4$gAXo/b
mH0Z (ɰ ##A0Xo/b
mX/Z (P2hX/P/Xo/Uo2hC0\&aPo/b
mX (P/  B06`C A$aQo/X/
X (
XY.[_/d'R`   eA#kAC C AXo/`#4$iAhXo/`#4$jAX$`AvXo/Qo/pACODEEAzXo/x[o/$QA|A + GLAMA\$QXo/|AbA + PERMAB$QXo/AHA
 + DIAGS A&$QXo/pA,A = AXo/xZo/|Zo/p$QAA BYTESGAAX , $@X= 0
3'4XC   PC   "0
3$ '4PC   "1I2 !+K2  !
3s3B  #3
>3!$$C P P6 PV  5!%$$C !$  Ps  Q  Pc '
qX=  s #'q!$$C XX^ P8PQB' 5$BX= $JX= $IX= $j$EX= $FX= $EX= $HX= GESSTT      =ETHIOPIAEHTSRGESSTT      =EUR COURT HUMAN RTS      =EUR COURT OF JUSTICE     =EURODOLLARSF JUSTICE     =EUROPELLARSF JUSTICE     =EUROPEAN COMMISSIONE     >QEUROPEAN PARLIAMENTE     >h
EUTHANASIAARLIAMENTE     >EXHAUST FUMESIAMENTE     >    oW  ,$W   T           7          K                      F                              <   ^   Y    A     P   K   w   p   i   c      A  i     %  *  /  N   U   W  5  :  ?  E  n  z  o     $@  X=          $A  X=          $E  X=          $B  X=          $C  X=          $D  X=                        $I  X=          $J  X=          $j  $E  X=          V  $j  $G  X=          `      $E  X=          V  `      $G  X=          $F  X=          H           !5  $  $          0    !    C         C       #  '1  H  C       @  C       '2  "     "  H           !5  $  $             R      e  
b  
P  P     #%  $  $       R      '    &a  &  1      6      "     b        R      P  #  
  #  6      1      8  &  &a  '  "  U     ]  з       H          #8      H           !5  $  $               B  "        '  B    &  &  <      >      "9  &  '  C     ѷ         f  !5     7  C     ;  2  6          #8  &a  &  6      <      "  U  !6     B0    C   "  
        
  0  ;  5        #8  &  &Q  5      ;      "  ѷ             '       a  @         '  H6      0    !5  $  $       3  3  U  #(  X   ,    !$    &  #  $  $       7   ,          
e  '    &1  &      #      &a  "     $H  X=          h'   ,  Xg   0  XW   4  @     X=        	  h'   ,  Xg   0  @     X=        	  Xg   ,  XW   0  @     X=          0  
3  '4    X  C       P  C       "   	  0  
3  $   '4    P  C       "     1  I2     !+  K2      !  
3  s3  B      #3  
>  3  !  $  $          P     P6     PV      5    !%  $  $       !    $                   Ps      Q      Pc     '  
q  X=      s     #'  q  !  $  $       X^     P      8  PQ  B    '   5     3  #  #  $  $       $  '1      "     $  /     #  -  (   $        8  ,  '  "              
          ,  @     X=             ,  @     X=          $M  X=          $N  X=          $O  X=          @     X=          $K  X=          $L  X=          @     X=          @     X=          /       X          $  $          h   ,    @      P   ,  j   ,  .       h   ,  .       h   ,  .  /!  +       X   ,  `     d  `    @g      $`  @g     `    @g     C         "  #:              &  !     8  $  $          8  $  $          H  $  $                  $  $          Y      !  Y     !$  \       !  $  $          Jx      X           C     Kx      $  $          G  JH      Jx     X           #  Kx     $  $       X     P      &D  G  "$  C                                            
   	                  "0   0         "   "  "0   0         "  "   "             #0  !0  !  !   #   #  #0  !0  !   !  #  #   #             C>  B>  B  B.  C.  C  C>  B>  B.  B  C  C.  C                                	         6            	8			


X   @. ~                                                      LAND UETSCITYLAND     YN
IMMIGRANTSTSCITYLAND     YIMMIGRATIONSCITYLAND     ZPIMPORTSTIONSCITYLAND     ZINCOMESTIONSCITYLAND     ZINDEPENDENCECITYLAND     [O  '  'INDEPENDENT RADIOAND     [INDEPENDENT RADIONND     [INDEPENDENT T VIONND     [INDIAENDENT T VIONND     [INDIAN OCEANT VIONND     \	INDONESIAEANT VIONND     \INDUSTRIAL ESTATESND     \INDUSTRIAL GASESESND     \INDUSTRIAL RELATIONS     \
INDUSTRIES RELATIONS     ]	INFLATIONS RELATIONS     b		INQUIRIESS RELATIONS     b	INSURANCES RELATIONS     dYINTEREST RATESATIONS     dINTERGOVT COOP 	L      dINTERNAT CRT JUSTICE     dINTERNAT MONETARY SY     dINTERNATIONAL AID SY     d  .T  - H?    !                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    set time=1000
imps:comp412  @1.imp,imps:prims.imp/@2,$icode,t:
imps:asems412  ,$icode/t:,$object,$direct
imps:gens400   ,$object,$direct/t:,@1.obj
 H?    :                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %CONSTINTEGER NL = 10;  ! PRIMS.400 - 24/8/77
! THE ORDER OF THESE DYNAMICS IS CRITICAL *************
%DYNAMICINTEGERFNSPEC ADDR(%NAME N)
%DYNAMICINTEGERMAPSPEC INTEGER(%INTEGER ADDR)
%DYNAMICBYTEINTEGERMAPSPEC BYTEINTEGER(%INTEGER ADDR)
%DYNAMICSHORTINTEGERMAPSPEC SHORTINTEGER(%INTEGER ADDR)
%DYNAMICSTRING(255)%MAPSPEC STRING(%INTEGER ADDR)
%RECORDFORMAT O0(%INTEGER VAL)
%DYNAMICRECORD(O0)%MAPSPEC RECORD(%INTEGER ADDR)
%DYNAMICREALMAPSPEC REAL(%INTEGER ADDR)
%DYNAMICBYTEINTEGERMAPSPEC LENGTH(%STRING(255)%NAME S)
%DYNAMICBYTEINTEGERMAPSPEC CHARNO(%STRING(255)%NAME S, %INTEGER C)
%DYNAMICINTEGERFNSPEC REM(%INTEGER A, B)
%DYNAMICINTEGERFNSPEC INTPT(%REAL X)
%DYNAMICINTEGERFNSPEC INT(%REAL X)
%DYNAMICREALFNSPEC FRACPT(%REAL X)
%DYNAMICROUTINESPEC READ SYMBOL(%NAME  S)
%DYNAMICSTRING(1)%FNSPEC TO STRING(%INTEGER S)
%DYNAMICROUTINESPEC SVC(%INTEGER N, %RECORD(O0)%NAME P)
%PERMSTRING(8)%FNSPEC  TIME
%PERMROUTINESPEC PROMPT(%STRING(63) S)
%PERMROUTINESPEC SELECTOUTPUT(%INTEGER N)
%PERMROUTINESPEC SELECTINPUT(%INTEGER N)
%PERMSTRING(8)%FNSPEC DATE
%PERMSTRING(255)%FNSPEC SUBSTRING(%STRING(255)%NAME S, %INTEGER X, Y)
%PERMROUTINESPEC READ(%NAME N)
%PERMROUTINESPEC SKIPSYMBOL
%PERMINTEGERFNSPEC NEXTSYMBOL
%PERMROUTINESPEC SPACES(%INTEGER N)
%PERMROUTINESPEC SPACE
%PERMROUTINESPEC NEWLINES(%INTEGER N)
%PERMROUTINESPEC NEWLINE
%PERMROUTINESPEC PRINTSTRING(%STRING(255) S)
%PERMROUTINESPEC PRINTSYMBOL(%INTEGER N)
%PERMROUTINESPEC WRITE(%INTEGER J,K)
%PERMROUTINESPEC CLOSE INPUT
%PERMROUTINESPEC CLOSE OUTPUT
%PERMROUTINESPEC RESET INPUT
%PERMROUTINESPEC RESET OUTPUT
%PERMINTEGERFNSPEC FREE SPACE; ! BYTES OF STACK SPACE REMAINING
%permroutinespec load file(%integer reg ad, %string(63) file)
%permroutinespec enter(%integer reg ad)
%PERMROUTINESPEC OPEN INPUT(%INTEGER N, %STRING(63) FD)
%PERMROUTINESPEC OPEN OUTPUT(%INTEGER N, %STRING(63) FD)
%PERMINTEGERFNSPEC CPUTIME
%PERMINTEGERMAPSPEC COMREG(%INTEGER N)
%PERMROUTINESPEC PRINT(%REAL X,%INTEGER BEFORE,AFTER)
%PERMROUTINESPEC PRINTFL(%REAL X,%INTEGER PLACES)
%ENDOFPERM
 H?    <                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !Temporary direct-access package till new subsystem arrives.

%const %integer to director = 20         {SVC#}
%const %integer status = 18              {DACTs for DIRECTOR calls}
%const %integer create = 2
%const %integer extend file = 3
%const %integer open DA file = 6
%const %integer DA read = 9
%const %integer DA write = 10
%const %integer close = 11
%const %integer delete = 14
%const %integer rename = 15
%const %integer pack filename = 17       {SVC#s}
%const %integer unpack filename = 18
%const %integer max chan = 5

!Event name
%const %integer DA error = 12;           !signalled on invalid read blk#.

{system message block format}

%record %format parm fm (%short dsno, dact, ssno, sact,
                         %integer p1,p2,p3,p4,p5,p6)

%own %integer %array key (0:max chan) = 0(*) {DIRECTOR key for each open file}

%external %integer %function SIZE OF (%real d1,d2)
   %integer dum1,dum2
   %result = integer(addr(d2))>>4
%end

%routine check (%integer chan)
   %unless 0 <= chan <= max chan %start
      select output (0)
      print string ("Invalid DA channel no. ")
      write (chan,0);  newline
      %monitor;  %stop
   %finish
%end

%external %routine test (%record(parm fm)%name P)
   %if P_p6 # 0 %start
      select output (0)
      print string ("DA i/o fails -- " . string(addr(P_p1)))
      newline
      %monitor;  %stop
   %finish
%end

%external %string(15) %fn ITOS (%integer x)
   %integer n = | x |
   %string(15) s = ""
   %cycle
      s = to string (rem(n,10)+'0') . s
      n = n // 10
   %repeat %until n = 0
   s = "-" . s %if x < 0
   %result = s
%end

%external %integer %fn STOI (%string(15) s)
   %byte %name b
   %integer j, n = 0, sign = 1
   %for j = 1,1,length(s) %cycle
      b == char no (s,j)
      %continue %if b <= ' '
      %if b = '-' %then sign = -sign %else %if '0' <= b <= '9' %start
         n = 10*n + (b-'0')
      %finish %else %signal 15
   %repeat
   %result = sign*n
%end

%external %record(parm fm) %fn packed (%string(25) file name)
   %record(parm fm) P = 0
   string(addr(P_sact)) = file name
   SVC (pack filename,P)
   test (P)
   %result = P
%end

%recordformat packfm (%integer disc,user,n1,n2)
%external %record(pack fm) %function PACK (%string(31) filename)
   %record(parm fm) P = packed (filename)
   %record(pack fm) r
   r_disc = P_p1
   r_user = P_p2
   r_n1   = P_p3
   r_n2   = P_p4
   %result = r
%end

   %external %string(31) %fn unpacked (%integer disc,user,n1,n2)
      %record(parm fm) P
      P_p1 = disc;  P_p2 = user;  P_p3 = n1;  P_p4 = n2
      SVC (unpack filename,P)
      %result = string(addr(P_sact))
   %end

%external %routine DELETE FILE (%string(25) file name)
   %record(parm fm) P = packed (file name)
   P_dact = delete
   SVC (to director,P)
   test (P)
%end

%external %routine RENAME FILE (%string(25) old name, new name)
   %record(parm fm) P = packed (old name),
                    Q = packed (new name)
   P_p5 = Q_p3;  P_p6 = Q_p4
   P_dact = rename
   SVC (to director,P)
   test (P)
%end

%external %routine CREATE FILE (%string(25) file name, %integer init size)
   %record(parm fm) P = packed (file name)
   init size = 1 %if init size <= 0;     !DIRECTOR doesnt like empty files
   P_dact = create;  P_p5 = init size
   SVC (to director,P)
   comreg (0) = 0                        { => CREATE FILE failed }
   comreg (0) = 1 %if P_p6 = 0           {success => new file created}
%end

%external %routine OPEN DA (%integer chan, %string(25) filename)
   %record(parm fm) P = 0
   P = packed (filename)
   P_dact = open DA file
   SVC (to director,P)
   %if P_p6 # 0 %start
      select output (0)
      print string ("*open DA fails -- " . string(addr(P_p1)))
      newline
      %monitor
   %finish
   check (chan)
   key(chan) = P_p5
%end

   %external %predicate EXISTS (%string(25) filename)
      %record(parmfm) P = packed (filename)
      P_dact = status;  SVC (to director,P)
      %true %if P_p6 = 0
      %false
   %end

%external %routine extend DA (%integer chan, extent)
   %record(parm fm) P = 0
   check (chan)
   P_p5 = key(chan);  P_p6 = extent
   P_dact = extend file
   SVC (to director,P)
   test (P)
%end

%external %routine read DA (%integer chan, block no, %record(*)%name buffer)
   %record(parm fm) P = 0
   check (chan)
   P_p4 = addr (buffer);  P_p5 = key(chan);  P_p6 = block no
   P_dact = DA read
   SVC (to director,P)
   %signal DA error %unless P_p6 = 0
%end

%external %routine write DA (%integer chan, block no, %record(*)%name buffer)
   %record(parm fm) P = 0
   check (chan)
   P_p4 = addr (buffer);  P_p5 = key(chan);  P_p6 = block no
   P_dact = DA write
   SVC (to director,P)
   test (P)
%end

%external %routine close DA (%integer chan)
   %record(parm fm) P = 0
   %return %if key(chan) = 0
   P_p5 = key(chan);  P_dact = close
   SVC (to director,P);  test (P)
   key(chan) = 0
%end


%end %of %file
 H?   
 
A                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     @?   @g@  
  g@:e   W@     W@:@   gi  u   gi:     	:     	r:      	:9     	gG;    gWz@                                                                                                                                                                                                                                                                                                                                                                                      !IMP-77 heap package

   %record %format parm fm (%short dsno, dact, ssno, sact,
                            %integer p1,p2,p3,p4,p5,p6)
   %const %integer create seg = 8,
                         word = 4 {bytes},
                         true = 0, false = 1,
                         trap = {event} 11
   %const %record(*)%name null == (0)
   %record %format block fm (%integer size,
                             %record(block fm)%name link,
                             %byte %array B(1:0))
   %own %record(block fm)%name free list
   %own %integer initialised = false,  free size,  free link,
                 heap size = 2^^16 {bytes}

   %external %integer %map frig %alias "HEAP SIZE"
      %result == heap size
   %end

   %external %routine initialise
      %record(parm fm) P
      P_p2 = heap size;  P_p3 = -1;  SVC (create seg,P)
      %if P_p1 < 0 %start
         select output (0)
         print string ("*No space for heap");  newline
         %stop
      %finish
      free list == record(addr(free size))
      free list_link == record(P_p1<<16);   !pointer to heap seg
      free list_link_size = heap size
      free list_link_link == null
      initialised = true
   %end

   %external %routine free vec (%record(*)%name it)
      %record(block fm)%name b == record(addr(it) - 2*word), f
      %unless initialised = true %start
         select output (0)
         print string ("FREEVEC called before GETVEC?")
         newline
         %stop
      %finish
      %unless b_size > 2*word %start
         select output (0)
         print string ("*Heap corrupt");  newline
         %stop
      %finish
      b_link == free list_link
      free list_link == b
   %end

   %external %record(*)%map get vec (%integer bytes)
      %record(block fm)%name free, prev
      %integer j
      %if bytes <= 0 %start
         select output (0)
         print string ("*GETVEC less than 0?")
         newline
         %stop
      %finish
      bytes = bytes + 2*word;            !bookkeeping info
      bytes = bytes + 1 %while bytes&(word-1) # 0;   !WORD must be 2^^N
      print string ("GETVEC"); write (bytes,1); printstring(" bytes
")
      initialise %unless initialised = true
      prev == free list
      %cycle
         free == prev_link
         %if free == null %start
            select output (0)
            print string ("*Heap exhausted")
            newline
            %stop
         %finish
         !Merge any adjacent free blocks
         %while free_link == record(addr(free) + free_size) %cycle
            free_size = free_size + free_link_size
            free_link == free_link_link
         %repeat
         %if free_size {exactly} = bytes %start;   !take off ASL
            prev_link == free_link
         %else %if free_size >= bytes + 2*word;    !split block in two
            free_size = free_size - bytes
            free == record(addr(free) + free_size)
         %else
            prev == free
            %continue
         %finish
         free_size = bytes
         free_B(j) = x'80' %for j = 1,1,bytes - 2*word
         %result == record(addr(free) + 2*word)
      %repeat
   %end

   %external %record(*)%name %function new (%name template)
      %external %integer %function %spec size of (%name area)
      %result == get vec (size of(template))
   %end

   %external %routine dispose (%record(*)%name it)
      free vec (it)
   %end

%end %of %file
 H?    M                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %begin;                                  !Heap test
   %const %record(*)%name null == (0)
   %string(255) s
   %integer j,k
   %record %format sfm (%record(sfm)%name link, %string(255) s)
   %record(sfm)%name list,p,q
   %externalrecord(*)%mapspec getvec (%integer bytes)
   %externalroutinespec freevec (%record(*)%name it)
   %const %integer input ended = {event} 9
   %routine read string (%string(*)%name s)
      %integer j
      s = ""
      skip symbol %while next symbol <= ' '
      %while next symbol > ' ' %cycle
         s = s . to string (next symbol)
         skip symbol
      %repeat
   %end
   %on input ended %start
      %stop
   %finish
   prompt (":");  list == null
   %cycle
      read string (s); print string (s); newline
      %if s = "?" %start
         print string ("List:");  newline
         p == list
         j = 0
         %while p ## null %cycle
            j = j + 1;  write (j,3);  space
            print string (p_s);  newline
            p == p_link
         %repeat
      %else %if s = "!";                 !delete entry (by copying)
         read (j)
         p == list;  list == null
         %while p ## null %cycle
            j = j - 1
            %if j # 0 %start
               k = 4 + 1 + length(p_s)
               q == getvec (k)
               q_s = p_s
               q_link == list
               list == q
            %finish
            freevec (p)
            p == p_link
         %repeat
      %else %if s = ":"
         %stop
      %else;                             !insert 's' as hd of list
         j = 4 + 1 + length(s)
         p == getvec (j)
         p_s = s
         p_link == list
         list == p
      %finish
   %repeat
%endofprogram
 H?    U                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !
! IAN:MATHS
!
! Maths procedures for BASIC programs.
!

%const %integer excess      = 64
%const %integer exp mask    = 2_ 0111 1111
%const %integer sign mask   = 2_ 1000 0000
%const %integer b           = 16
%const %integer b shift     = 4
%const %integer k           = b shift
%const %integer k shift     = 2

%const %real half           = 2_0.1
%const %real inv ln 2       = 1.4426 95041
%const %real ln2 high       = 8_0.543
%const %real ln2 low        = -2.1219 444 @ -4
%const %real pi             = 16_ 0.324 3f7 @ 1
%const %real pi by 2        = 16_ 0.192 1fb @ 1
%const %real two by pi      = 16_ 0.A2F 983
%const %real inv pi         = 16_ 0.517 cc1

%const %real %array twopow ( -(k-1) : (k-1) ) =
      2_0.001, 2_0.01, 2_0.1, 1, 2, 4, 8

!
! >> TC <<
!
%real %function TC ( %integer flag, %real x )
  {%const %real p0         =  1.00000 0000 }
   %const %real p1         = -0.95801 7723 @ -1
  {%const %real q0         =  1.00000 0000 }
   %const %real q1         = -0.42913 5777
   %const %real q2         =  0.97168 5835 @ -2
   %const %real pi by 2 hi = 8_1.444
   %const %real pi by 2 lo = 4.8382 67948 97 @ -4
   %const %real eps        = 0.000244141
   %const %real ymax       = 6434
   %const %real eps1       = 1.383 @ -76
   %real y = |x|
   %if flag = 1 %and y < eps1 %then %signal 10, 1, 6
   %signal 10, 1, 5 %if y > ymax
   %integer n = int(x*two by pi)
   !
   ! NB The following line must be altered on a machine
   ! with no guard digits.
   !
   %real f = (x-n*pi by 2 hi)-n*pi by 2 lo
   %real den, num, g
   %if |f| < eps %start
      num = f
      den = 1
   %finish %else %start
      g = f*f
      num = p1*g*f+f
      den = (q2*g+q1)*g+half+half
   %finish
   %if n&1 # 0 %start
      num = -num
      flag = flag !! 1
   %finish
   %if flag = 0 %start
      %result = num/den
   %finish %else %start
      %result = den/num
   %finish
%end

!
! >> TAN <<
!
%real %function tan ( %real x )
   %result = TC ( 0, x )
%end

!
! >> COT <<
!
%real %function cot ( %real x )
   %result = TC ( 1, x )
%end

!
! >> SC <<
!
! Used only by the SIN and COS procedures.
!
%real %function SC ( %integer sgn, %real x, y )
   %const %real ymax  = 13000   {arg significance lost above this}
   %const %real pi hi = 8_3.11
   %const %real pi lo = 0.96765 35897 93 @ -3
   %const %real eps   = 16_1           @ -3
   %const %real r1    = -0.16666 65668
   %const %real r2    =  0.83330 25139 @ -2
   %const %real r3    = -0.19807 41872 @ -3
   %const %real r4    =  0.26019 03036 @ -5
   %integer n = int(y/pi)
   %real xn = n
   %real f, g, rg
   %signal 10,1,5 %if y >= ymax
   sgn = -sgn %if n&1 # 0
   xn = xn-half %if |x| # y
   ! Modify following line if no guard digit
   f = (|x|-xn*pi hi)-xn*pi lo
   %if |f| >= eps %start
      g = f*f
      rg = (((r4*g+r3)*g+r2)*g+r1)*g
      f = f+f*rg
   %finish
   f = -f %if sgn # 1
   %result = f
%end

!
! >> SIN <<
!
%real %function SIN ( %real x )
   %if x < 0 %start
      %result = sc(-1,x,-x)
   %else
      %result = sc(1,x,x)
   %finish
%end

!
! >> COS <<
!
%real %function COS ( %real x )
   %result = SC(1,x,|x|+piby2)
%end

!
! >> EXP <<
!
%real %function EXP ( %real x )
   %const %real bigx = 174.6730895
   %const %real smlx = -180.21827
   %const %real eps  = 3 @ -8
   %const %real p0   = 0.2499999995
   %const %real p1   = 0.41602 88626 @ -2
 { %const %real q0   = half }
   %const %real q1   = 0.49987 17887 @ -1
   %real g, z, gpz, qz, rg
   %integer n
   %signal 10,1,4 %if x > bigx
   %result = 0 %if x < smlx
   %result = 1 %if |x| < eps
   n = int(x*inv ln2)
   !
   ! NB the next line must be modified if the
   ! machine in use has no guard digits.
   !
   g = (x-n*ln2 high)-n*ln2 low
   z = g*g
   gpz = (p1*z+p0)*g
   qz  = (q1*z+{q0}half)
   rg  = gpz/(qz-gpz)+half
   n   = n+1
   !
   ! %result = rg * 2\n
   ! NB rg known to be positive.
   !
   rg  = rg * twopow(rem(n,k))
   byte integer(addr(rg)) = byte integer(addr(rg)) + n//k
   %result = rg
%end

!
! >> LOG <<
!
%real %function LOG ( %real f )
   %const %real a0 = -0.55270 74855
   %const %real b0 = -6.63271 8214
   %const %real c0 =  0.70710 67812
   %real znum, zden, w, z, r
   %signal 10, 1, 3 %if f <= 0
   %integer n = byteinteger(addr(f))-excess
   byteinteger(addr(f)) = excess
   n = n*k
   %while f < half %cycle
      f = f+f
      n = n-1
   %repeat
   %if f > c0 %start
      znum = f-half-half
      zden = f*half+half
   %finish %else %start
      n = n-1
      znum = f-half
      zden = znum*half+half
   %finish
   z = znum/zden
   w = z*z
   r = (w*a0/(w+b0))*z+z
   %result = (n*ln2 low+r)+n*ln2 high
%end

!
! >> LOG10 <<
!
%real %function LOG10 ( %real x )
   %const %real c3 = 8_0.33626 75425
   %result = c3 * LOG(x)
%end

!
! SQRT
!
%real %function sqrt ( %real x )
   %real y, f
   %integer n
   %result = 0 %if x = 0
   %signal 10,1,2 %if x < 0
   n = byteinteger(addr(x))-64
   byteinteger(addr(x)) = 64
   f = x
   !
   ! y <- initial estimate (linear poly)
   !
   y = 0.894427*f + 0.223607
   !
   ! 3 N-R iterations for 31 bits accuracy (24 needed)
   ! First two are Y = 0.5*(y+f/y)
   !
   y = (y + f/y)/2
   y = (y + f/y)/2
   !
   ! last is special
   !
   y = y+(f/y-y)/2
   !
   ! Now, for ODD N
   !
   %if n&1 # 0 %start
      y = y/4
      n = n+1
   %finish
   byteinteger(addr(y)) = byteinteger(addr(y)) + n//2
   %result = y
%end

!
! >> RAN <<
!
!
! Return a random real number in the range [0..1)
! Roughly 29 bits random part, so should NOT be
! used in tests of systems with > 29 bits of FP
! significand.
!
%real %function ran
   %own %integer y, called = 0
   %record(parm fm) p
   %const %integer m = 2796203
   %if called = 0 %start
      !
      ! Random initialisation from system time
      !
      called = 1
      svc(19,p)
      y = rem(p_p1 {system up time}, m)
   %finish
   y = rem(y*125,m)
   %result = y/m
%end

!
! >> RANDL <<
!
%real %function randl ( %real x )
   %external %real %function %spec exp ( %real x )
   %result = exp(x*ran)
%end

!
! >> POW <<
!
%real %function pow ( %real b, e )
   %result = exp(e*log(b))
%end

%end %of %file
 H?    Z                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !!! 16-JUN-80    Program to merge output from profiler
      ! 21-Oct-81:  event 9 trap inserted
%begin
   %integer  j, first line, last line, n
   %owninteger  eof=0
   %routine  copy line(%integer  n)
      %integer  sym
      %on %event 9 %start
         eof = 1
         %return
      %finish
      write(n,6);  spaces(2)
      select input(1)
      %cycle
         read symbol(sym);  print symbol(sym)
         %exit %if sym = NL
      %repeat
      eof = 1 %if next symbol < 0
   %end
   open input(2,"profiler.frq");  select input(2)
   j = 0
   %cycle
      j = j+1
      select input(2);  read(n)
      %if n # 0 %start
         print symbol('(');  write(n,-5);  print symbol(')')
      %else
         spaces(1+5+1)
      %finish
      copy line(j)
   %repeat %until eof # 0
%endofprogram
 H?    g                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !! 16-JUN-80  Program Profiler (First resricted version)
%systemroutine  trace(%integer  line, pc)
%recordformat  parmfm(%shortinteger  dsno, dact, ssno, sact,
                      %integer  p1,p2,p3,p4,p5,p6)
%owninteger  state=0, first line, last line
%owninteger  table0, table end
%integername  p
%routinespec initialise
%routinespec  close down

   %if line # 0 %start
      p == integer( (line-1)<<2 + table0 )
      p = p+1 %if line < last line
   %else
      %if state = 0 %start
         initialise
      %else
         close down
      %finish
      state = \state
   %finish

%routine  initialise
%record(parmfm)  p
   %integer  j
   select input(0);  select output(0)
   first line = 1;         ! ***** grubby assumption *****
   prompt("Last line? :");   read(last line)
   prompt("Data:")
   j = ((last line - first line + 1)*4 + 511) & (\511)
   p_p2 = j;  p_p3 = -1;  p_sact = 1;  svc(8,p)
   %if p_p1 < 0 %start
      newline
      print string("Profiler can't get segment")
      newline
      %stop
   %finish
   table0 = p_p1<<16;   ! segno => address
   table end = table0 + j - 4
   integer(j) = 0 %for j = table0,4,table end
   select input(1);  select output(1)
%end

%routine  close down
   %integer  j,n
   select output(3);  close output
   open output(3,"profiler.frq")
   select output(3)
   n = 1
   %for j = table0,4,table end %cycle
      n = n-1
      %if n = 0 %start
         newline
         n = 10
      %finish
      write(integer(j),6)
   %repeat
   newline
   close output
%end

%end;      ! profile

%endoffile
 H?    j                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !Fixed-length record IO package for MOUSES
!Requires IMP-77 compiler V7.1 minimum.
%own %string(15) version = "V1.01"
!Fixes:
!  At V1.01 - Implementation of RESET CHAN procedure.

%const %integer max chan = 5             {Max # of concurrently open channels}
%const %integer file increment = 10      {files are extended in 10 block units}
%const %integer RMS error = 12           {Event %SIGNALled on errors}
%const %integer to director = 20         {supervisor call number}
%const %integer get status = 18          {DACTs for DIRECTOR calls}
%const %integer create = 2

!Error signals produced by RMS.
!
!  EVENT SUBEVENT EXTRA                  MEANING
!     12       1  channel#               Channel# not in range {0,..,maxchan}
!              2  channel#               (from OPEN): Channel already open
!              3  channel#               Channel not open
!              4     -                   Can't open file
!              5     -                         -
!              6  record#                no such record in file
!              7  record length          record length not in range {1,..,512}
!              8  record#                (in READSEQ or SKIP).  End of file.
!              9     -                   Can't BACKSPACE past record 0



{RMS channel descriptor block}

%record %format block      (%byte %array B(1:512))
%record %format channel fm (%integer rec len,     {bytes}
                                     recs per block,
                                     records {in file},
                                     blocks {in file},
                                     next rec,
                                     last block,  {block# of block in BUF}
                                     %record(block) buf)

%own %record(channel fm)%array channel (0:max chan) = 0(*)
%own %record(channel fm)%name C                {currently selected channel}
%own %integer chan no = 0

%include "sysinc:DA.INC"

%external %routine OPEN (%integer chan, record length, %string(25) filename)
   %integer xxx
   %signal RMS error,1,chan %unless 0 <= chan <= max chan
   %record(channel fm)%name C == channel(chan)
   %signal RMS error,2,chan %if {already open} C_reclen # 0
   C_rec len = record length
   C_recs per block = 512 // C_rec len
   %signal RMS error,7,record length %unless C_recs per block > 0
   open DA (chan, 1, filename)
   %signal RMS error,4 %if {OPENDA failed} comreg(0) < 0
   %record(parm fm) P = packed (filename);  P_dact = get status
   SVC (to director,P)
   C_blocks = P_p2
   C_records= C_blocks*C_recs per block
   C_last block = -1                     {force read if first BLOCKNO=0}
%end

%routine SELECT CHAN (%integer chan)
   %signal RMS error,1,chan %unless 0 <= chan <= max chan
   C == channel (chan);  chan no = chan
   %signal RMS error,3,chan %if {not open} C_reclen <= 0
%end

%external %routine MOVE REC (%integer rec len {bytes},
                             %record(*)%name from, to)
   %byte %name F == byte integer (addr(from)),
               T == byte integer (addr(to))
   %integer j
   %for j = 1,1,rec len %cycle
      T = F                              {move byte}
      F == F ++ 1
      T == T ++ 1
   %repeat
%end

%external %record(*) %map REC (%integer chan, rec no)
   {Returns pointer to record #RECNO (in buffer) of}
   {the currently selected channel.  Reference remains}
   {valid ONLY UNTIL BUFFER CONTENTS CHANGE (i.e. up to}
   {the next call on REC, READ REC etc)}
   %integer extent,j, xxx
   select chan (chan)
   %integer block no = rec no // C_recs per block,
            offset   = rem (rec no,C_recs per block)
   %if rec no {numbered from zero}  >=    %c
       C_records {no of recs in file} %start
      C_records = (rec no + 1)           {RECNO numbered from zero}
      %if block no >= C_blocks %start    {Claim more space for file}
         extent {additional blocks to be added to file} =
                block no {starting at 0} - C_blocks {in file} + 1
         {Convert extent to integral no of FILE INCREMENTS}
         extent = (extent + (file increment - 1)) // file increment
         extent = file increment * extent {blocks}
         C_blocks = C_blocks + extent
         extend DA (chan no,extent, xxx)
      %finish
   %finish
   C_next rec = rec no + 1
   %if block no # C_last block %start
      write DA (chan no,C_last block,C_buf) %unless C_last block < 0
      read DA (chan no,block no,C_buf)
      C_last block = block no
   %finish
   %result == record (addr(C_buf) + offset * C_reclen)
%end

%external %routine READ REC (%integer chan, rec no, %record(*)%name buffer)
   select chan (chan)
   %signal RMS error,6,rec no %unless 0 <= rec no < C_records
   move rec (C_reclen,REC(chan,recno),buffer)
%end

%external %routine WRITE REC (%integer chan, rec no, %record(*)%name buffer)
   select chan (chan)
   move rec (C_rec len,buffer,REC(chan,recno))
%end

%external %routine READ SEQ (%integer chan, %record(*)%name buffer)
   select chan (chan)
   %signal RMS error,8,C_next rec %unless 0 <= C_next rec < C_records
   move rec (C_reclen,REC(chan,C_next rec),buffer)
%end

%external %routine WRITE SEQ (%integer chan, %record(*)%name buffer)
   select chan (chan)
   move rec (C_reclen,buffer,REC(chan,C_next rec))
%end

%external %routine backspace (%integer chan)
   select chan (chan)
   %signal RMS error,9 %unless C_next rec > 0
   C_next rec = C_next rec - 1
%end

%external %routine reset chan (%integer chan)
   select chan (chan);  C_next rec = 0
%end

%external %routine skip (%integer chan)
   select chan (chan)
   %signal RMS error,8,C_next rec %if C_next rec >= C_records - 1
   C_next rec = C_next rec + 1
%end

%external %routine CLOSE (%integer chan)
   %integer xxx
   select chan (chan)
   write DA (chan no,C_last block,C_buf) %if c_last block >= 0
   %integer blocks = C_records // C_recs per block + 1
   extend DA (chan no, blocks - C_blocks, xxx)   {-ve extn: truncate file}
   close DA (chan no)
   C = 0
%end


%end %of %file
 H?    o                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !Fixed-length record IO package for MOUSES
!Requires IMP-77 compiler V7.1 minimum.
%own %string(15) version = "V1.02"
!Fixes:
!  At V1.01 - Implementation of RESET CHAN procedure.
!     V1.02 - FREE CHANNEL, UPDATE added

%const %integer max chan = 5             {Max # of concurrently open channels}
%const %integer file increment = 10      {files are extended in 10 block units}
%const %integer RMS error = 12           {Event %SIGNALled on errors}
%const %integer to director = 20         {supervisor call number}
%const %integer get status = 18          {DACTs for DIRECTOR calls}
%const %integer create = 2

!Error signals produced by RMS.
!
!  EVENT SUBEVENT EXTRA                  MEANING
!     12       1  channel#               Channel# not in range {0,..,maxchan}
!              2  channel#               (from OPEN): Channel already open
!              3  channel#               Channel not open
!              4     -                   Can't open file
!              5     -                         -
!              6  record#                no such record in file
!              7  record length          record length not in range {1,..,512}
!              8  record#                (in READSEQ or SKIP).  End of file.
!              9     -                   Can't BACKSPACE past record 0



{RMS channel descriptor block}

%record %format block      (%byte %array B(1:512))
%record %format channel fm (%integer rec len,     {bytes}
                                     recs per block,
                                     records {in file},
                                     blocks {in file},
                                     next rec,
                                     last block,  {block# of block in BUF}
                                     %record(block) buf)

%own %record(channel fm)%array channel (0:max chan) = 0(*)
%own %record(channel fm)%name C                {currently selected channel}
%own %integer chan no = 0

%include "DA.INC"

%external %integer %function FREE CHANNEL
   %integer j
   %for j = 0,1,max chan %cycle
      %result = j %if channel(j)_rec len = 0   {not open}
   %repeat
   %result = -1                          {all channels open}
%end

%external %routine OPEN (%integer chan, record length, %string(25) filename)
   %signal RMS error,1,chan %unless 0 <= chan <= max chan
   %record(channel fm)%name C == channel(chan)
   %signal RMS error,2,chan %if {already open} C_reclen # 0
   C_rec len = record length
   C_recs per block = 512 // C_rec len
   %signal RMS error,7,record length %unless C_recs per block > 0
   open DA (chan,filename)
   %signal RMS error,4 %if {OPENDA failed} comreg(0) < 0
   %record(parm fm) P = packed (filename);  P_dact = get status
   SVC (to director,P)
   C_blocks = P_p2
   C_records= C_blocks*C_recs per block
   C_last block = -1                     {force read if first BLOCKNO=0}
%end

%routine SELECT CHAN (%integer chan)
   %signal RMS error,1,chan %unless 0 <= chan <= max chan
   C == channel (chan);  chan no = chan
   %signal RMS error,3,chan %if {not open} C_reclen <= 0
%end

%external %routine MOVE REC (%integer rec len {bytes},
                             %record(*)%name from, to)
   %byte %name F == byte integer (addr(from)),
               T == byte integer (addr(to))
   %integer j
   %for j = 1,1,rec len %cycle
      T = F                              {move byte}
      F == F ++ 1
      T == T ++ 1
   %repeat
%end

%external %record(*) %map REC (%integer chan, rec no)
   {Returns pointer to record #RECNO (in buffer) of}
   {the currently selected channel.  Reference remains}
   {valid ONLY UNTIL BUFFER CONTENTS CHANGE (i.e. up to}
   {the next call on REC, READ REC etc)}
   %integer extent,j
   select chan (chan)
   %integer block no = rec no // C_recs per block,
            offset   = rem (rec no,C_recs per block)
   %if rec no {numbered from zero}  >=    %c
       C_records {no of recs in file} %start
      C_records = (rec no + 1)           {RECNO numbered from zero}
      %if block no >= C_blocks %start    {Claim more space for file}
         extent {additional blocks to be added to file} =
                block no {starting at 0} - C_blocks {in file} + 1
         {Convert extent to integral no of FILE INCREMENTS}
         extent = (extent + (file increment - 1)) // file increment
         extent = file increment * extent {blocks}
         C_blocks = C_blocks + extent
         extend DA (chan no,extent)
      %finish
   %finish
   C_next rec = rec no + 1
   %if block no # C_last block %start
      write DA (chan no,C_last block,C_buf) %unless C_last block < 0
      read DA (chan no,block no,C_buf)
      C_last block = block no
   %finish
   %result == record (addr(C_buf) + offset * C_reclen)
%end

%external %routine UPDATE (%integer chan)
   {Force disc write-back}
   %signal RMS error,1,chan %unless 0 <= chan <= max chan
   %record(channel fm)%name C == channel(chan)
   %signal RMS error,3,chan %if C_rec len = 0
   write DA (chan,C_last block,C_buf) %if C_last block >= 0
%end

%external %routine READ REC (%integer chan, rec no, %record(*)%name buffer)
   select chan (chan)
   %signal RMS error,6,rec no %unless 0 <= rec no < C_records
   move rec (C_reclen,REC(chan,recno),buffer)
%end

%external %routine WRITE REC (%integer chan, rec no, %record(*)%name buffer)
   select chan (chan)
   move rec (C_rec len,buffer,REC(chan,recno))
%end

%external %routine READ SEQ (%integer chan, %record(*)%name buffer)
   select chan (chan)
   %signal RMS error,8,C_next rec %unless 0 <= C_next rec < C_records
   move rec (C_reclen,REC(chan,C_next rec),buffer)
%end

%external %routine WRITE SEQ (%integer chan, %record(*)%name buffer)
   select chan (chan)
   move rec (C_reclen,buffer,REC(chan,C_next rec))
%end

%external %routine backspace (%integer chan)
   select chan (chan)
   %signal RMS error,9 %unless C_next rec > 0
   C_next rec = C_next rec - 1
%end

%external %routine reset chan (%integer chan)
   select chan (chan);  C_next rec = 0
%end

%external %routine skip (%integer chan)
   select chan (chan)
   %signal RMS error,8,C_next rec %if C_next rec >= C_records - 1
   C_next rec = C_next rec + 1
%end

%external %routine CLOSE (%integer chan)
   select chan (chan)
   write DA (chan no,C_last block,C_buf) %if c_last block >= 0
   %integer blocks = C_records // C_recs per block + 1
   extend DA (chan no, blocks - C_blocks)   {-ve extn: truncate file}
   close DA (chan no)
   C = 0
%end


%end %of %file
 H?    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %externalintegerfn itoe(%integer s)
%constbyteintegerarray atoe(0:255) =
0,1,2,3,
55,45,46,47,
22,5,37,11,
12,13,14,15,
16,17,18,19,
60,61,50,38,
24,55,63,39,
28,29,30,31,
64,79,127,123,
91,108,80,125,
77,93,92,78,
107,96,75,97,
240,241,242,243,
244,245,246,247,
248,249,122,94,
76,126,110,111,
124,193,194,195,
196,197,198,199,
200,201,209,210,
211,212,213,214,
215,216,217,226,
227,228,229,230,
231,232,233,74,
224,90,95,109,
121,129,130,131,
132,133,134,135,
136,137,145,146,
147,148,149,150,
151,152,153,162,
163,164,165,166,
167,168,169,192,
106,208,161,7,
32,33,34,35,
36,21,6,23,
40,41,42,43,
44,9,10,27,
48,49,26,51,
52,53,54,8,
56,57,58,59,
4,20,62,225,
65,66,67,68,
69,70,71,72,
73,81,82,83,
84,85,86,87,
88,89,98,99,
100,101,102,103,
104,105,112,113,
114,115,116,117,
118,119,120,128,
138,139,140,141,
142,143,144,154,
155,156,157,158,
159,160,170,171,
172,173,174,175,
176,177,178,179,
180,181,182,183,
184,185,186,187,
188,189,190,191,
202,203,204,205,
206,207,218,219,
220,221,222,223,
234,235,236,237,
238,239,250,251,
252,253,254,255
   %result = atoe(s&255)
%end
%externalintegerfn etoi(%integer n)
%constbyteintegerarray etoa(0:255) =
  0,  1,  2,  3,
156,  9,134,127,
151,141,142, 11,
 12, 13, 14, 15,
 16, 17, 18, 19,
157,133,  8,135,
 24, 63,146,143,
 28, 29, 30, 31,
128,129,130,131,
132, 10, 23, 27,
136,137,138,139,
140,  5,  6,  7,
144,145, 22,147,
148,149,150, 25,
152,153,154,155,
 20, 21,158, 26,
 32,160,161,162,
163,164,165,166,
167,168, 91, 46,
 60, 40, 43, 33,
 38,169,170,171,
172,173,174,175,
176,177, 93, 36,
 42, 41, 59, 94,
 45, 47,178,179,
180,181,182,183,
184,185,124, 44,
 37, 95, 62, 63,
186,187,188,189,
190,191,192,193,
194, 96, 58, 35,
 64, 39, 61, 34,
195, 97, 98, 99,
100,101,102,103,
104,105,196,197,
198,199,200,201,
202,106,107,108,
109,110,111,112,
113,114,203,204,
205,206,207,208,
209,126,115,116,
117,118,119,120,
121,122,210,211,
212,213,214,215,
216,217,218,219,
220,221,222,223,
224,225,226,227,
228,229,230,231,
123, 65, 66, 67,
 68, 69, 70, 71,
 72, 73,232,233,
234,235,236,237,
125, 74, 75, 76,
 77, 78, 79, 80,
 81, 82,238,239,
240,241,242,243,
 92,159, 83, 84,
 85, 86, 87, 88,
 89, 90,244,245,
246,247,248,249,
 48, 49, 50, 51,
 52, 53, 54, 55,
 56, 57,250,251,
252,253,254,255
   %result = etoa(n&255)
%end
%endoffile
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        !Virtual memory support for visual ECCE
!A.D. Culloch.  March 1981
!Large byte address space mapped over a large
!temporary DA file.

%const %integer CR = 13
%const %integer maxname=127;         !max file name length
%recordformat file(%string(maxname) name, %integer chan,
                    %integer top,lim,vmtop,vmlim,flag)


%include "Sysinc:Command.INC"
%include "sysinc:DA.inc"

   %own %integer maxVM = 400 {blocks}
   %ownintegerarray bitmap(0:50) = 0(*)

   %routine set bit (%integer index)
      %integer j = index>>5, k = index&31
      bitmap(j) = bitmap(j) ! 1<<k
   %end

   %predicate bit set {?} (%integer index)
      %integer j = index>>5, k=index&31
      %true %if bitmap(j) & 1<<k # 0
      %false
   %end

   %routine clear bit (%integer index)
      %integer j = index>>5, k = index&31
      bitmap(j) = bitmap(j) & (\(1<<k))
   %end


   %record %format blockfm (%byte %array B(0:511))

   %record %format buffm(%integer from,to,  {block maps these V.addrs}
                         %integer chan,     {paged in from here}
                         %integer block,    {block in paging file}
                         %record(buffm)%name link,   {circular list}
                         %record(blockfm) blk)

   %const %integer max con = 3;          !max files in VM: IN,OUT,SEC
   %const %integer sec chan = 3
   %own %integer %array base(1:max con) = 512,0(*);!base V.addr of file (j)
   %own %integer connected = 1;          !no of files currently mapped
   %const %integer paging file = {channel} 1
   %own %string(31) page file name;      !tmp file in current directory
   %external %integer %spec buffers
   %external %record(buffm) %array %name %spec buffer
   %external %record(buf fm)%name %spec buf
   %own %integer free VM = 512;          !bytes of VM connected (must be >0)

   %string(4) %function Unique Extension
      %record(parm fm) P
      P_dact = 25;  SVC (20,P);          !Director call for unique ext
      P_p4 = P_p4&x'FFFF'
      SVC (18,P);                        !Unpack filename -> ".EXT"
      %result = string(addr(P_sact))
   %end
   

   %external %byte %map byte integer (%integer index);!into notional VM in DA file
      %integer block = index>>9, offset = index&511, chan
      %record(buffm)%name prev, p
      p == buf_link;                     !hd of circ. list
      %cycle;                            !id BLOCK in buffer chain?
         %if p_from <= index <= p_to %start
            !promote this buffer to hd of list
            !(most recently used)
            %if p == buf %start;         !tl becomes hd
               buf == prev
            %else %if p ## buf_link;     !already hd?
               prev_link == p_link
               p_link == buf_link
               buf_link == p
            %finish
            %result == p_blk_B(offset)
         %finish
         %exit %if p == buf
         prev == p
         p == p_link
      %repeat
      !block not in store.. replace last page in list
      %if buf_block >= 0 %and buf_chan # sec chan %start
         write DA (paging file, buf_block, buf_blk)
      %finish
      !promote last buffer
      buf == prev
      chan = paging file
      %if %not bit set (block-1) %start;   !not in paging file - which chan?
         chan = chan + 1 %until chan={last}connected %or index < base(chan+1)
      %finish
      p_from = 512*block
      p_to   = p_from + 512 - 1
      p_chan = chan
      read DA (chan,(p_from - base(chan))>>9,p_blk)
      p_block = block - 1 {offset for initial free VM=512}
      set bit (p_block);  !used
      %result == p_blk_B(offset)
   %end
   %external %routine connect input (%record(file)%name f)
      %own %integer first {call} = 1 {nonzero: true}
      %integer j,k, size
      %const %integer to Director = 20,
                      pack filename = 17,
                      get status = 18;  !magic nos for svcs
      %recordformat parmfm ( %c
            %short dsno,dact, %short ssno, sact, %integer p1,p2,p3,p4,p5,p6 %or
               %integer frig, %short ssno2,sact2,%string(23) text         %or   
               %integer frig2,%short ssno3,%string(25) fname)
      %record(parm fm) Q
      %if f_top # 0 %start;              !previous secondary input file
         %for j = 1,1,buffers %cycle;    !free any buffers in use
            buffer(j)_to = -1 %if buffer(j)_from >= f_top
         %repeat
         close DA (f_chan)
         connected = connected - 1
      %finish
      !get size of file (blocks) from Director
      %if f_name = "" %then size = 0 %else %start
         Q_fname = f_name
         SVC (pack filename,Q)
         Q_text = "illegal filename" %and ->fail %if Q_p1 < 0 %or Q_p2 < 0
         Q_dact = get status
         SVC (to Director,Q)
         %if Q_p6 # 0 %start
fail:       print symbol (CR);  print symbol (NL);         !cr/lf
            print string ("*Edit " . f_name . " fails -- " . Q_text)
            %stop
         %finish
         size = Q_p2;                       !blocks
      %finish
      %record(buffm) %name p
      %if first # 0 %start
         first = 0
         %for j = 1,1,buffers %cycle
            p == buffer(j)
            p_from = 0;  p_to = -1; p_chan = -1; p_block = -1
            %if j = buffers %then p_link == buffer(1) %c
                            %else p_link == buffer(j+1)
            p_blk_B(k) = '@' %for k = 0,1,511;   !warning of problems
         %repeat
         page file name = "$ECCE" . unique extension
         New file (page file name, max VM, max VM)
Write(Max VM, 1);  Printstring(" blocks created");  Newline
         open DA (paging file, 1, page file name)
      %finish
      f_flag = -1 %and %return %if size < 0
      connected = connected + 1
      f_chan = connected
      open DA (f_chan,0,f_name) %if f_name # ""
      %monitor %if f_chan > max con
      base(f_chan) = free VM;  f_top = free VM
      f_lim = free VM + 512*size
      free VM = free VM + 512*(size + f_flag)
      %if f_flag # 0 %start;              !mark extra pages as 'in file'
         set bit (j-1) %for j = f_top>>9 + size, 1, free VM>>9 - 1
      %finish
      f_flag = 0
      f_VM top = f_top;  f_VM lim = free VM - 1;  !VAX
      f_lim = f_lim - 1 %while f_lim # f_top %and byte integer (f_lim-1) # NL
   %end
   %external %routine move (%integer length, from, to)
      %return %if from = to
      %if to <= from %start
         %while length > 0 %cycle
            byte integer (to) = byte integer (from)
            from = from + 1
            to = to + 1
            length = length - 1
         %repeat
      %else
         from = from + length;            !move from back to front
         to   = to   + length
         %while length > 0 %cycle
            from = from - 1
            to   = to   - 1
            byte integer (to) = byte integer (from)
            length = length - 1
         %repeat
      %finish
   %end
   %external %routine close off
      %external %record(file) %spec in, out, sec
      %integer flim = out_lim, size
      %record(buffm)%name this
      %integer k
      %integer j = flim - out_top;   !out size
      %const %integer eot = 4
!      Dump last couple of blocks on the console
!      k = flim - 1024;  k = 512 %if k < 512
!      %while k # flim %cycle
!         print symbol (byteinteger(k))
!         k = k + 1
!      %repeat
       %while j&511 # 0 %cycle;     !fill last block
         j = j + 1
         byte integer (flim) = EOT
         flim = flim + 1
       %repeat
       size = j>>9 {blocks}
       !fill paging file
       %for j = 512,512,512*size %cycle
         %unless bit set (j>>9-1) %start;   !block not used yet
            k = byte integer (j);           !access it
         %finish
       %repeat
       %for j = 1,1,buffers %cycle;        !flush buffers
         this == buffer(j)
         write DA (paging file,this_block,this_blk) %if this_block >= 0
       %repeat
       extend DA (paging file,size - max VM,size);   !truncate
       close DA (j) %for j = 1,1,max con
       delete file (out_name) %if out_name # "" %and exists (out_name)
       rename file (page file name,out_name)
       write (size,0);  print string (" block")
       print symbol ('s') %if size # 1;  print symbol (':');  space
   %end
%end %of %file
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        !Virtual memory support for visual ECCE
!A.D. Culloch.  March 1981
!Large byte address space mapped over a large
!temporary DA file.

%const %integer CR = 13
%const %integer maxname=127;         !max file name length
%recordformat file(%string(maxname) name, %integer chan,
                    %integer top,lim,vmtop,vmlim,flag)


%include "ACCNT:DA.inc"

   %const %integer maxVM = 400 {blocks}
   !%integer %array bitmap (0:(maxVM+31)//32)
   %ownintegerarray bitmap(0:50) = 0(*)

   %routine set bit (%integer index)
      %integer j = index>>5, k = index&31
      bitmap(j) = bitmap(j) ! 1<<k
   %end

   %predicate bit set {?} (%integer index)
      %integer j = index>>5, k=index&31
      %true %if bitmap(j) & 1<<k # 0
      %false
   %end

   %routine clear bit (%integer index)
      %integer j = index>>5, k = index&31
      bitmap(j) = bitmap(j) & (\(1<<k))
   %end


   %record %format blockfm (%byte %array B(0:511))

   %record %format buffm(%integer from,to,  {block maps these V.addrs}
                         %integer chan,     {paged in from here}
                         %integer block,    {block in paging file}
                         %record(buffm)%name link,   {circular list}
                         %record(blockfm) blk)

   %const %integer max con = 3;          !max files in VM: IN,OUT,SEC
   %const %integer sec chan = 3
   %own %integer %array base(1:max con) = 512,0(*);!base V.addr of file (j)
   %own %integer connected = 1;          !no of files currently mapped
   %const %integer paging file = {channel} 1
   %const %string(31) page file name = "$ECCE.VM";   !tmp file in cur dir
   %const %integer buffers = 3
   %own %record(buffm) %array buffer(1:buffers)
   %own %record(buf fm)%name buf
   %own %integer free VM = 512;          !bytes of VM connected (must be >0)
   

   %external %byte %map byte integer (%integer index);!into notional VM in DA file
      %integer block = index>>9, offset = index&511, chan
      %record(buffm)%name prev, p
      p == buf_link;                     !hd of circ. list
      %cycle;                            !id BLOCK in buffer chain?
         %if p_from <= index <= p_to %start
            !promote this buffer to hd of list
            !(most recently used)
            %if p == buf %start;         !tl becomes hd
               buf == prev
            %else %if p ## buf_link;     !already hd?
               prev_link == p_link
               p_link == buf_link
               buf_link == p
            %finish
            %result == p_blk_B(offset)
         %finish
         %exit %if p == buf
         prev == p
         p == p_link
      %repeat
      !block not in store.. replace last page in list
      %if buf_block >= 0 %and buf_chan # sec chan %start
         write DA (paging file, buf_block, buf_blk)
      %finish
      !promote last buffer
      buf == prev
      chan = paging file
      %if %not bit set (block-1) %start;   !not in paging file - which chan?
         chan = chan + 1 %until chan={last}connected %or index < base(chan+1)
      %finish
      p_from = 512*block
      p_to   = p_from + 512 - 1
      p_chan = chan
      read DA (chan,(p_from - base(chan))>>9,p_blk)
      p_block = block - 1 {offset for initial free VM=512}
      set bit (p_block);  !used
      %result == p_blk_B(offset)
   %end
   %external %routine connect input (%record(file)%name f)
      %own %integer first {call} = 1 {nonzero: true}
      %integer j,k, size
      %const %integer to Director = 20,
                      pack filename = 17,
                      get status = 18;  !magic nos for svcs
      %recordformat parmfm ( %c
            %short dsno,dact, %short ssno, sact, %integer p1,p2,p3,p4,p5,p6 %or
               %integer frig, %short ssno2,sact2,%string(23) text         %or   
               %integer frig2,%short ssno3,%string(25) fname)
      %record(parm fm) Q
      %if f_top # 0 %start;              !previous secondary input file
         %for j = 1,1,buffers %cycle;    !free any buffers in use
            buffer(j)_to = -1 %if buffer(j)_from >= f_top
         %repeat
         close DA (f_chan)
         connected = connected - 1
      %finish
      !get size of file (blocks) from Director
      %if f_name = "" %then size = 0 %else %start
         Q_fname = f_name
         SVC (pack filename,Q)
         Q_text = "illegal filename" %and ->fail %if Q_p1 < 0 %or Q_p2 < 0
         Q_dact = get status
         SVC (to Director,Q)
         %if Q_p6 # 0 %start
fail:       print symbol (CR);  print symbol (NL);         !cr/lf
            print string ("*Edit fails -- " . Q_text)
            %stop
         %finish
         size = Q_p2;                       !blocks
      %finish
      %record(buffm) %name p
      %if first # 0 %start
         first = 0
         %for j = 1,1,buffers %cycle
            p == buffer(j)
            p_from = 0;  p_to = -1; p_chan = -1; p_block = -1
            %if j = buffers %then p_link == buffer(1) %c
                            %else p_link == buffer(j+1)
            p_blk_B(k) = '@' %for k = 0,1,511;   !warning of problems
         %repeat
         buf == buffer(1)
         delete file (page file name) %if exists (page file name)
         create file (page file name, max VM)
         open DA (paging file, page file name)
      %finish
      f_flag = -1 %and %return %if size < 0
      connected = connected + 1
      f_chan = connected
      open DA (f_chan,f_name) %if f_name # ""
      %monitor %if f_chan > max con
      base(f_chan) = free VM;  f_top = free VM
      f_lim = free VM + 512*size
      free VM = free VM + 512*(size + f_flag)
      %if f_flag # 0 %start;              !mark extra pages as 'in file'
         set bit (j-1) %for j = f_top>>9 + size, 1, free VM>>9 - 1
      %finish
      f_flag = 0
      f_VM top = f_top;  f_VM lim = free VM - 1;  !VAX
      f_lim = f_lim - 1 %while f_lim # f_top %and byte integer (f_lim-1) # NL
   %end
   %external %routine move (%integer length, from, to)
!      %return %if from = to
!      %if to <= from %start
!         %while length > 0 %cycle
!            byte integer (to) = byte integer (from)
!            from = from + 1
!            to = to + 1
!            length = length - 1
!         %repeat
!      %else
!         from = from + length;            !move from back to front
!         to   = to   + length
!         %while length > 0 %cycle
!            from = from - 1
!            to   = to   - 1
!            byte integer (to) = byte integer (from)
!            length = length - 1
!         %repeat
!      %finish
       %monitor %and %stop
   %end
   %external %routine close off (%record(file)%name out)
      %integer flim = out_lim, size
      %record(buffm)%name this
      %integer k
      %integer j = flim - out_top;   !out size
      %const %integer eot = 4
!      Dump last couple of blocks on the console
!      k = flim - 1024;  k = 512 %if k < 512
!      %while k # flim %cycle
!         print symbol (byteinteger(k))
!         k = k + 1
!      %repeat
       %while j&511 # 0 %cycle;     !fill last block
         j = j + 1
         byte integer (flim) = EOT
         flim = flim + 1
       %repeat
       size = j>>9 {blocks}
       !fill paging file
       %for j = 512,512,512*size %cycle
         %unless bit set (j>>9-1) %start;   !block not used yet
            k = byte integer (j);           !access it
         %finish
       %repeat
       %for j = 1,1,buffers %cycle;        !flush buffers
         this == buffer(j)
         write DA (paging file,this_block,this_blk) %if this_block >= 0
       %repeat
       extend DA (paging file,size - max VM) %if size > 0;   !truncate
       close DA (j) %for j = 1,1,max con
       delete file (out_name) %if out_name # "" %and exists (out_name)
       %if out_name = "" %then delete file (page file name) %else %c
          rename file (page file name,out_name)
   %end
%end %of %file
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        c sys8_libsrc:@1/@1
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        %begin;                        !MOUSES mail system V0.0;   A. Culloch
   %include "Sysinc:command.inc"
   %external %string(17) %spec command prompt
   %record %format parm fm (%shortinteger dsno,dact,ssno,sact, %c
                            %integer p1,p2,p3,p4,p5,p6)
   %record(parm fm) P
   %integer del
   %integer exclam = command_modifier
   %const %integer status = 18
   %const %integer process info = 14
   %const %integer pack filename = 17
   %const %integer unpack filename = 18
   %const %integer to director = 20
   %const %integer delete = 14
   %const %integer become = 27
   %const %integer input ended = 9
   %externalpredicatespec Exists(%string(31) File)
   %string(*)%name sn
   %routine stop
      %record(parm fm) P
      P_p2 = 0;  P_p6 = 0;  P_dact = become
      SVC (to director,P)
      command prompt = "Command:";   !save confusion for BECOME's users
      %stop
   %end
   P_p1 = 0;  P_p2 = x'D417A';  P_p3 = x'1BE81D81';  P_p6 = 0
   select input (0);  select output (0)
   P_dact = become;  SVC (to director,P)
   P_p1 = 0;  SVC (process info,P);      !find out own process name
   P_p1 = 0;  P_p3 = 0;  P_p4 = 0
   SVC (unpack filename,P)
   sn == string(addr(P_sact));           !unpacked proc nam.
   length(sn) = length(sn) - 1;          !kill ':'
   %if %not exists (sn) %start
      print string ("No mail.")
      newline
      stop
   %finish
   select output (0)
   open input (2,sn)
   %if exclam # 0 %start;            !MAIL?
      %begin
         %integer n
         %on input ended %start
            %if n = 1 %then print string ("One") %else write (n,0)
            print string (" message")
            print symbol ('s') %if n # 1
            print string (" pending")
            newline
            stop
         %finish
         select input (2);  skip symbol %if next symbol = '*'
         n = 0
         %cycle
            %while next symbol # NL %cycle
               print symbol (next symbol) %if exclam = '?'
               skip symbol
            %repeat
            newline %if exclam = '?'
            n = n + 1
            skip symbol %while next symbol # 0
            skip symbol
         %repeat
      %end
   %finish
   open output (2,sn)
   open input (3,sn);  !look at MAIL:ME
   del = 1
   %begin
      %on input ended %start; %return; %finish
      select input (2);  skip symbol %if next symbol = '*'
      select input (3);  skip symbol %if next symbol = '*'
      %cycle
         %if next symbol = 0 %start;         !NULL separates messages
            newline
            prompt ("Delete? ")
            select input (0)
            skip symbol %while next symbol <= ' '
            %if 'y' # next symbol # 'Y' %start
               !Don't delete this message
               del = 0;                      ! => don't delete file at close
               select input (2)
               select output(2)
               %while next symbol # 0 %cycle;!copy mess into new file
                  print symbol (next symbol)
                  skip symbol
               %repeat
               print symbol (0)
               skip symbol; !0
            %else
               select input (2)
               skip symbol %while next symbol # 0;   !delete message
               skip symbol
            %finish
            select input (0)
            skip symbol %while next symbol # NL
            select input (3)
            select output(0)
            skip symbol; !0
            %continue
         %finish
         print symbol (next symbol)
         skip symbol
      %repeat
   %end
   close input; !3
   select input (2)
   close input
   select output (2)
   close output
   SVC (pack filename,P)
   P_dact = delete;  SVC (to director,P) %if del # 0
   stop
%end %of %program
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         @?   @     )K     UWzT   mEmWzY     2f  f  F@_Wzi  1aWzn   bpQWz{   bpQ    g                     G                                                                                                                                                                                                                                                                                                                                                                            C!          / l8}`        _  @   	  `      NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    %Qv   %Qv_#	y           "!      *"     Ba b!  AA      E!ab    a  a  A   A       Ba  "   gRA!       B  a X ai A       !  dQ@    D"Z 	yd      ,d    	ox     ,W   	ox     ox    $h%Qv   #t%Qv_؄ ,d    L   P#K5À Tx   !]b   
  Delete?   pending  message OneNo mail. Command:                            
   l(?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nA> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$?1  34C0  D   D   
C   w A  , X $0P9 8P9 H@ @I .r	 ,  q	 ,X-|A
$ A  %	w A  , X Py 0C vXy 0X9 ,<0 !9W   H#$PcW   TW   HX ,Ű #8` sW   <W   HW  ,A&$bW   `W   $ *!6W   0$P ,W   $ 
C0.XH P@ ?!<W   $aW   <W   0C XX PP ?!6W  ,Xi ,l&aPi ,W   $#7W   0"W   0C v  	  w A  , X Py ,#Xy ,y $bW   `W   $ *!6W   0$cW   `W   $ *!6W   0W   $B0DW  ,W   $`W   `W   $  !'W   0"W   $ yC0t YC0l$0P8 L$bW   `$bW   lW   $C0$W   $aW   <W   0C $`W   <W   0C 0$bW   `W   $#7W   0"W   0$`W   `W   $ 
#7W   0"$cW   `$`W   lW   0C  W   $aW   <W   0C   	 rww P (A  , X X=p<XC LPH P$0P8 4 AzP 8P <P8 HcW   `$`W   lȐ @ .r ,  q ,$@PH 4r ,  q ,$PPX 4PX <PX @r ,  q ,h  2Ph T6  '16  X TW  !?W   HW  ,A$`W   lX T$bW   xX P#3AX T$bW   X T$cW   x$1P8 LAW   $bW   `W   $bW   lW   r ,  q ,$>@8 .X L#7r ,  q ,A                                                                           @                                                         |                                                          H8 .U8 4A U8 8P 4
 ~' ,$A $P 4P 8[Xh 0l A  	$c A  s  spoollp	' ,A  A   l' ,P 4A $P 4P 8ZXh 4 A  p  spoolpp	' ,A  A   p' ,P 4A $P 4P 8YXh 4 A  p  spoolcr	' ,A  A   c' ,P 4A $@PG 4PG 8TXh 4 A  r  ini	' ,                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                              8P <r ,  q ,XXPlXP  H\#3A6AXH#tA X]`P @#5h lA`C Vi                            A  W   H
 x K   6@ s	}    W    #p ,z   sQ@     ;L"     z   	w	} ð v   ,#   v@     ,v   	_       @ ,&@,Zx   u!:   (_TL    W.İ ,   0  İ H   ư L@   PZ!3 T~Iz
 'ox     0X   4(_Q@ #    Š   Ơ ,@   0h{   4W   8x/W <x/\ @lwW   Dz   H^  E L!%R}   C PfkyS  Ġ ly@  Ġ pq  D t:t#    x:t#	Ġ |  Ġ %   - <   8@   t   u   u0   p  à {   à {H   }:,    H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        %begin;                                  !TELL program.  A. Culloch
   %option "Nostack,Noopen,Upper"
   %include "Sysinc:command.inc"
   %routinespec stop
   %conststring(3) TTY dev = "T:"
   %record %format parm fm (%shortinteger dsno,dact,ssno,sact, %c
                           %integer p1,p2,p3,p4,p5,p6)
   %const %integer locate process = 5
   %const %integer process info = 14
   %const %integer pack filename = 17
   %const %integer unpack filename = 18
   %const %integer to director = 20;     !svc#
   %const %integer to accnt = 36;         !pass message to accountant process
   %const %integer status = 18
   %const %integer become = 27;          !dact
   %const %integer input ended = 9;      !event #
   %externalpredicatespec Exists(%string(31) File)
   !%option "NOstack,NOopen,Upper"
   %record(parm fm) P, Q
   %string(63) in1, out1
   %string(63)%name parm
   %external %string(17) %spec command prompt
   command prompt = "Command:";          !save confusing already BECOMEd users
   parm == Command_parameter
   %string(63) subj
   %integer j,c
   subj = ""
   %integer exclam = 0
   %for j = length(parm),-1,1 %cycle
      c = char no (parm,j)
      %if c = ')' %or c = ']' %or c = '}' %start
         subj = sub string (parm,1,j-1)
         j = j + 1 %until j > length(parm) %or char no (parm,j) > ' '
         parm = sub string (parm,j,length(parm))
         %exit
      %finish
   %repeat
   %if parm # "" %and char no (parm,length(parm)) = '!' %start
      length (parm) = length (parm) - 1
      exclam = 1
   %finish
   %if parm -> in1 . ("/") . out1 %start
   %finish %else in1 = "" %and out1 = parm
   P_p1 = 0;  P_p2 = x'D417A';  P_p3 = x'1BE81D81';  P_p6 = 0
   P_dact = BECOME;  SVC (to director,P)
   %if P_p6 # 0 %start
      print string ("TELL fails -- " . string(addr(P_p1)));  newline
      stop
   %finish
   %if out1 = "" %start
      print string ("TELL file / user")
      newline
      stop
   %finish
   length (out1) = length (out1) - 1 %if char no (out1,length(out1)) = ':'
   string (addr(P_sact)) = out1 . ":"
   SVC (pack filename,P)
   %if P_p2 < 0 %or P_p1 # 0 %or P_p4 & x'FFFF' # 0 %start
      print string ("*Invalid username - " . out1)
      newline
      stop
   %finish
   %if exclam # 0 %start
      %if length (subj) > 19 %start;   ! > 1 message
         length (subj) = 19
         print string ("Message truncated to '".subj."'
");   %finish
      SVC (locate process,P);          !POWNER => DSNO
      P_p6 = P_p1;  string (addr(P_p1)) = subj
      SVC (to accnt,P);                !relay message -> console
      stop
   %finish
   %if exists (out1) %start
      open input (1,out1)
   %else
      open input (1,"Null:")
   %finish
   select output (0)
   in1 = TTY dev %if in1 = ""
   %if in1 = TTY dev %start
      print string ("Enter message.  Type CTRL/D to stop")
      newline
   %finish
   open output (1,out1)
   select output (1)
   !append new text to file
   select input (1)
   %begin
      %on input ended %start
         %return
      %finish
      print symbol ('*')
      skip symbol %if next symbol = '*'
      %cycle
         print symbol (next symbol)
         skip symbol
      %repeat
   %end
   P_p1 = 0;  SVC (process info,P)
   P_p1 = 0;  P_p3 = 0;  P_p4 = 0;  SVC (unpack filename,P)
   print string ("From ")
   print string (string(addr(P_sact)))
   string (addr(Q_p1)) = "mail from " . string (addr(P_sact))
   length(string(addr(Q_p1))) = length(string(addr(Q_p1))) - 1
   space;  print string (date);  space;  print string (time);  space
   print string (" Subject:" . subj) %if subj # ""
   newline
   prompt ("")
   open input (1,in1)
   select input (1)
   %begin
      %integer ch
      %on input ended %start; %return; %finish
      %cycle
         read symbol (ch)
         %if NL # ch < ' ' %then print symbol ('?') %else print symbol (ch)
      %repeat
   %end
   print symbol (0);   !invisible frig seps messages
   close input
   close output
   string (addr(P_sact)) = out1 . ":";   !dest user
   SVC (pack filename,P)
   SVC (locate process,P)
   Q_p6 = P_p1;                          !dest service no
   SVC (to accnt,Q) %if P_p1 > 0;       !relay message if dest logged on
   !Back with P_p1 < 0 => no accountant there
   !If he was there, he sent a notify to "TO"
   stop
   %routine stop
      P_dact = become;  P_p2 = 0;  P_p6 = 0
      SVC (to director,P)
      %stop
   %end
%end %of %program
 H?   	 	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     	 C!       
   P}b        g  P   	  b      NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    %Qv   #	y    %Qv_       X!  b a  	   o"     !!     v  a A!AA! "A! a bA  B    B! !  B      B ! A      K!   a    H   A    F P  dQ@    D"Z 	ox     ox     ,    	yd      ox    $h%Qv    ,d    Lj@   l:   a À d:Q@#%Qv_؃ z
>0>  4  8#K5 5ay:	 Subject:
mail from  From #Enter message.  Type CTRL/D to stopNull:'
 Message truncated to ' *Invalid username -  :TELL file / user TELL fails --  /  Command: T:                           .
   ?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nH  !34  1  0 !81 !5$$A> #$$A> &C ?1  34C0  D   D   
C H  !34  1  0 !81 !5$$A> B  @ !4B ";
C@ !$$A> #$$A> B  C
B$P#E  E  &Q'1"C s_  eX!34RUUh!34dffз  ӳ  Ű !4Գ #9    !8 !5$$A> B$ C08 L  #9&"C  "
  'M  M   >' ("#4\BbD#:  
  nBJ"#<  #M  M  '"DC0  
$#M  M  &'"%ѷ  C $ "ѷ  $$A> $A1    0#
#	QD   RD   ?&A'"3    !8 !5$$A> "#&!2#C$$A> 
!  1  #C   C  '1"A> "#:  ! ?$$A> ?$$A> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$H  !34  "#(!B   C $$A> р w A< , X Py ,#Xy ,y ` *W   <W   $ *!6W   0W   $aW   <W   0C  9 	 w A< , X Py 0#Xy 0y W   P , 
#<  #` ?W   <#aW   <C  3 	 w A< , X 0 @8 .$@PH 8PH Hr ,  q ,$ A "	w P (A< , PX X-A X=p<C PH $PX PX8d  &a$%!APh0C 'aPh0Ph<X &Az ?1  P840 )#80 ]#50 }B0Z6X $!A( A  ?X0&P0X Ӛ  	!-+Az ?A  @  !#C 9+A*A  ?#	Uh<A2` B0dP<XX e  fC0 &Az ?1  0 !!7'ae  $P8X8 ( lH A??#2#$Ҩ l$A $P 4@ AzPH 8PPX <P H` @h .r ,  q ,X8 H<3C00' ,A  4A" W   HW  ,AӸ !?W   HW  ,A ( Az ?ӡ  Š :!4'!( ' , A A" ( 2A  r ,  q ,X 8BXH 4LD!:XX @\P  C00' ,A  A" W   HW  ,A<Xh8C0t8 0 C 40 8 ' ,pA  A" lA" W   Hr ,  q ,X 4P H( 4 A r ,  $q ,A W  t#: $aW   x#	f$aW   x$`W   lӨ l!7( lA  l.A!=BW   HW  , $aW   $aW   l$aW   `A>$0P8 4r ,  q ,$P 4P <P @r ,  q ,<W   H 2W   H' ,0A  2A" ( TA Ӣ  'Ң  W  W   W   HW  W   W   HW  Ә C0"' ,&A  A" W   HW  ,W    l$aW   x$aW   `A$`W   <W   W   ' , A  $A" ( 2A  r ,  q ,r ,  q ,X8 4<P8 h3#'r L  $q LAx  lD   eE      W    d    !         @ y8@     ,v   lW   pd    tK     newline
         printstring("GPR 0-7:")
         dump line(addr(pr_user_gpr))
         printstring("GPR 8-F:")
         dump line(addr(pr_user_gpr)+32)
         newline
         printstring("FPR:    ")
         dump line(addr(pr_user_fpr))
         newline
         printstring("SEG 0-7:");  dump line(addr(pr_segs))
         spaces(7)
         %for k = 0, 1, 15 %cycle
            space %if k = 4 %or k = 12
            newline %and spaces(7) %if k = 8
            write(get(pr_page(k)), 8)
         %repeat
         newline
         printstring("    8-F:");  dump line(addr(pr_segs)+32)
         newline
         printstring("Status:")
         k = get(pr_status)
         printstring(" Stopping") %if k&stopping # 0
         printstring(" Cont load") %if k&cont load # 0
         printstring(" Activated") %if k&activated # 0
         printstring(" On runq") %if k&on runq # 0
         printstring(" On CPU") %if k&on cpu # 0
         printstring(" Waiting") %if k&waiting # 0
         printstring(" Incomplete") %if k                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                A A   A    ! c    a   E  A   A A !  dA  a A !  C a a   A ! a  a I   H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         H?    +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     H?    2 P                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 H?   # #Q                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         @?   @   Az       Az:     A       A:                                                                                                                                                                                                                                                                                                                                                                                                                                                                          %externalstring(31)%fnspec ITOS     (%integer I,places)
%externalintegerfnspec     IN POS
%external %routine %spec   SEEKINPUT(%integer byte)
%external %routine %spec   TO UPPER (%string(*)%name s)
%external %predicate %spec EXISTS   (%string(31) filename)
%external %routine %spec   ALIAS    (%string(*)%name s)
%system   %routine %spec   LET      (%string(63) old, new)
%system %integer %spec     SKIPPING      {Set nonzero to turn off BCI}
%system %integer %spec     ECHO OBEY

%own %integer level = 0                  { $IF nesting level }
%own %integer active level               { level of last cond tested }

!Batch command processor procedures,  ADC

%integer %fn StoI (%string(31) s)
   %integer j, k = 0, d
   %for j = 1,1,length(s) %cycle
      d = char no(s,j)
      k = 10*k + (d-'0') %if d # ' '
   %repeat
   %result = k
%end

%predicate true cond (%string(63)%name cond)
   %string(63) x
   cond = x.cond %while cond -> x.(" ").cond
   To upper (cond)
   %if cond -> ("EXISTS").cond %start
      %true %if exists(cond)
      %false
   %finish
   %if cond -> x.(".EQ.").cond %start
      %true %if x = cond
      %false
   %finish
   Print string (cond."
Syntax?")
   %false
%end

%system %routine EXIT (%string(63) parm)
   %signal 9                             {Simulate end of obeyfile}
%end

%System %routine IF (%string(63) parm)
   %if skipping = 0 %start
      skipping = -1 %unless true cond(parm)
      active level = level
   %finish
   level = level + 1
%end

%System %routine UNLESS (%string(63) parm)
   %if skipping = 0 %start
      skipping = -1 %if true cond(parm)
      active level = level
   %finish
   level = level + 1
%end

%System %routine ELSE (%string(63) parm)
   skipping = ~skipping %if active level = level-1
%end

%System %routine FINISH (%string(63) parm)
   level = level - 1
   skipping = 0 %if level = active level
%end

%System %routine INC (%string(63) parm)
   %string(63) var
   To upper(parm)
   var = parm
   Alias(parm)
   parm = ItoS(StoI(parm)+1,0)
   Let (var,parm)
%end

%System %routine DEC (%string(63) parm)
   %string(63) var
   To upper(parm)
   var = parm
   Alias(parm)
   parm = ItoS(StoI(parm)-1,0)
   Let (var,parm)
%end

%System %routine REPORT (%string(63) parm)
   Print string (parm)
   Newline
%end

%System %routine VERIFY (%string(63) parm)
   To upper (parm)
   ECHO OBEY = 0
   ECHO OBEY = 1 %if parm = "ON"
%end

%const %integer max label = 50
%own %integer %array lab def(1:max label) = -1(*)
%own %string(7) %array lab text(1:max label) = ""(*)
%own %integer defined = 0
%own %integer pend jump = 0

%integer %map lookup (%string(63)%name L)
   %integer j
   To upper (L)
   %for j = 1,1,defined %cycle
      %result == lab def(j) %if lab text(j) = L
   %repeat
   defined = defined + 1
   lab text(defined) = L
   %result == lab def(defined)
%end

%System %routine LABEL (%string(63) parm)
   %integer %name L == look up(parm)
   %if L < 0 %start
      L = in pos                      {Define L as here in command stream}
      SKIPPING = 0 %if addr(L) = pend jump  {Got there}
   %else
      Print string (parm." already defined")
      Newline
      %signal 9
   %finish
%end

%System %routine GOTO (%string(63) parm)
   %integer %name L == look up(parm)
   %if L < 0 %start                      {Undefined as yet}
      SKIPPING = 1                       {Till we hit it}
      pend jump = addr(L)
   %else                                 {Jump backwards}
      Seek input (L)
   %finish
%end

%end %of %file
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        %begin
   %record(parmfm) p
   %string(15) owner name
   %integer unit, owner, pass
   %include "newsrc:command.inc"
   %externalstring(17)%spec Command prompt
   owner name = command_in1
   %if owner name = "" %start
      p_dact = 27;  p_p2 = 0;  p_p6 = 0;  svc(20, p)
      %if p_p6 # 0 %start
         printstring("*Be fails -- ".p_text)
         newline
      %else
         Command prompt = "Command: "
      %finish
      %stop
   %finish
   owner name = owner name.":"
   string(addr(p_sact)) = owner name
   svc(17, p)
   unit = p_p1;  owner = p_p2
   %if owner <= 0 %start
      printstring("Invalid owner name ")
      printstring(ownername)
      newline
      %stop
   %finish
   pass = 0
   %if command_in2 # "" %start
      string(addr(p_sact)) = command_in2.":"
      svc(17, p)
      pass = p_p2
      %if pass <= 0 %start
         printstring("Illegal password ")
         newline
         %stop
      %finish
   %finish
   p_p1 = unit;  p_p2 = owner;  p_p3 = pass;  p_p6 = 0
   p_dact = 27;  svc(20, p)
   %if p_p6 # 0 %start
      printstring("*Become fails -- ".p_text)
      newline
   %else
      Command prompt = owner name
   %finish
%endofprogram
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        c pss3_Nsrc:batch/batch
c pss3_Nsrc:be/be
c pss3_Nsrc:clean/clean
c pss3_Nsrc:compare/compare
c pss3_Nsrc:dt/dt
c pss3_Nsrc:dump/dump
c pss3_Nsrc:entries/entries
c pss3_Nsrc:imp.imp/imp.imp
c pss3_Nsrc:layout/layout
c pss3_Nsrc:let/let
c pss3_Nsrc:mail/mail
c pss3_Nsrc:mdiag.imp/mdiag.imp
c pss3_Nsrc:page/page
c pss3_Nsrc:permit/permit
c pss3_Nsrc:set.imp/set.imp
c pss3_Nsrc:standard/standard
c pss3_Nsrc:subinit/subinit
c pss3_Nsrc:tell/tell
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        !@GENERAL
!The commands available within CLEAN are as follows.
!(Commands may be abbreviated to their first letter).
!   <cr>        Move on to the next file in the directory.
!   HELP <cmd>  Generate more information about any particular command.
!   DELETE      Mark a file for deletion when the program stops.
!   SAVE        Unmark a file.  (To prevent the program deleting it).
!   COPY <n>    Copy the first <n> lines of the file to the console.
!   FILE <fn>   The file called <fn> becomes the current file.
!   RENAME <fn> The name of the file is changed to <fn>
!   ANALYSE     Display information about the size of the file etc.
!   PERMIT <ap> The access permissions on the file are changed to <ap>
!   TOP         Move back to the top of the directory
!   UP or LAST  Move back up to the previous file.
!   NEXT        Equivalent to <cr>
!   STOP        Stops the program.
!   QUIT        Equivalent to STOP.
!   EXIT        Identical to QUIT and STOP.
!Note that the directory is circular: moving past the end brings the
!current file up to the top of the directory and moving up past the
!top takes the current file down to the bottom.
!@FILE
!Format:       FILE  <filename>
!Effect:
!  <Filename> immediately becomes the current file, without having
!to step one by one through the files in the directory.
!@HELP
!
!   The basic command information can be printed by typing
!
!               HELP
!
!The second form is used to ask for more information about a
!particular command:
!
!               HELP  command-name
!
!Examples:
!               HELP
!               HELP  QUIT
!               HELP  DELETE
!
!@DELETE
!Format:        DELETE
!Effect:
!The current file is "marked for deletion" and the next file becomes the
!current file.  When CLEAN stops, the file will be physically deleted.
!(This is so that a file mistakenly DELETED my be rescued.  See HELP SAVE).
!   To indicate which files a user has asked to have deleted,
!when CLEAN prompts for a marked file, it prints a '>' character
!before the filename.  E.g.
!
!               Command:clean
!                       JIM.EXE:d
!                       JIM.IMP:
!                      SORT.EXE:top
!                               *TOP*
!               >       JIM.EXE:
!                       JIM.IMP:
!                      SORT.EXE:quit
!               Command:
!
!@SAVE
!Format:     SAVE
!Effect:
!   If the current file has been marked for deletion, it is unmarked
!and will not be deleted, otherwise the command has no effect.
!Any change in the status of a file (marked/unmarked) is indicated
!by the presence or absence respectively of the '>' marker beside
!the filename prompt for marked files.
!
!@PERMIT
!Format:     PERMIT new-permissions
!
!where "new-permissions" are any of:
!
!            ALL
!            NONE
!            list of letters in the range A to H
!Effect:
!   The access permissions on the current file are changed to
!the "new-permissions".  ALL is equivalent to ABCDEFGH and allows
!any user to access the file.  NONE is equivalent to an empty list
!of permissions and prevents all users but its owner from accessing
!the file (and event the owner may not delete the file without first
!altering the permissions on the file to include 'D' access).
!Users in groups 'A', 'B', 'C' etc. may be independently granted
!or withheld access to the file by using the third form.
!
!Examples:   PERMIT ABH                   access for A,B and H users only
!            PERMIT ALL                   access for everybody
!            P NONE                       no one else may access the file
!            PERMIT D                     allow deletion of the file
!
!@COPY
!Format:     COPY <n>
!Effect:
!   The first <n> lines of the file are copied onto the console.
!<n> defaults to the entire file.
!   The listing may be interrupted at any time, and the user
!returned to the CLEAN prompt level, by typing the <esc> <esc>
!sequence ("Int:!").
!
!Examples:
!            COPY                         list all of the current file
!            COPY 10                      list the first 10 lines
!            C22                          copy the first 22 lines
!
!@TOP
!Format:
!           TOP
!Effect:
!  The first file in the directory becomes the current file.
!
!@NEXT
!Format:     NEXT
!Effect:
!   The current file becomes the next file in the directory. If
!the current file is the last file in the directory and the NEXT
!(or <cr>) command is given, the current file position wraps round
!to the top of the directory again.
!
!@UP
!Format:
!            LAST
!Effect:
!   The current file becomes the previous current file.  (I.e.
!moves back up one position in the directory).  Moving back up past
!the top of the directory causes the current file position to
!'wrap around' to the bottom again.  (C.f. the NEXT command).
!
!@RENAME
!Format:     RENAME <filename>
!  where     <filename> is a valid MOUSES filename.  I.e. FILE.EXT.
!            Any UNIT_ or USER: parts will be ignored.
!Effect:
!   The current file is renamed immediately as <filename>.
!
!@ANALYSE
!Format:
!            ANALYSE
!Effect:
!   The following information about the current file is displayed.
!
!BLOCKS:  The number of disc blocks (512 bytes each) presently
!         occupied by the file.
!EXTENTS: The number of distinct contiguous groups of blocks
!         making up the file.  (Max 126).  This is a measure
!         of how fragmented the file is.
!CREATED: The date the file was created in the form dd-mmm-yy.
!
!If the program was invoked using the CLEAN! form the disc address
!of the file's spine block is also displayed
!
!@QUIT
!Stop the program.
!
!@EXIT
!Stops the program.
!$
!$
!Program for fiddling MOUSES directories
!Alan Culloch,    August 1980

!System message block format

%recordformat parmfm(%short dsno, dact,
          (%short ssno, sact,(%integer p1,p2,p3,p4,p5,p6 %or
                              %string(23) text)          %or
           %short xsno, %string(25) fname))

!Magic numbers for system calls

%const %integer kill TTY IO = 6;         !svc# to throw away console output buf
%const %integer unpack date = 13;        !svc#
%const %integer to director = 20;        !svc# pass message to the file system
%const %integer pack filename = 17;      !svc#s to convert filename strings to
%const %integer unpack filename = 18;    !      and from the packed system form

!destination activity (DACT) values
!for file system (DIRECTOR) operations.

%const %integer delete = 14;             !delete <packed filename>
%const %integer rename = 15;             !<packed oldname> <packed newname>
%const %integer files  = 17;             !read dir blk <packed user> <buf addr>
%const %integer status = 18;             !of file: <blocks><extents><created>
%const %integer set file access = 22;    !alter protections on file
%const %integer become = 27;             !change hats: <packed new dir name>

!Directory format

%record %format filef     (%integer name1, name2,   {packed filename}
                           %short spine block,      {disc block number}
                           %short day)              {creation date + achive}
                                                    {info in the top 2 bits}
%record %format directoryf(%short files,            {No. of files in directory}
                           %byte access rights,     {of the directory's owner}
                           %byte check,             {always '?'}
                           %short spare, %byte spare1,
                           %byte permissions,       {required to access dir}
                           %record(filef) %array file(1:42))

%begin
   %include "Sysinc:command.inc"
   %externalstring(17)%spec Console int
   %externalstring(63)%fnspec ItoS(%integer N, P)
   %externalstring(8)%fnspec XtoS(%integer N, P)
   %const %string(31) program source = "Newsrc:CLEAN.IMP"
   %const %integer infinity = 16_7FFFFFFF
   %own %string(31) version = "(pre-release) vsn 0.00";   !%OWN shows in diags
   %const %integer non zero = 1


   !Events

   %const %integer input ended = 9;      !end-of-file on current input stream
   %const %integer fault = 11;           !user event, signalled on input errors
   %own %integer XEVENT = input ended
   %routine FAULTS
      Xevent = fault
      %signal fault
   %end

   %record(parm fm) %fn packed (%string(31) filename)
      %record(parm fm) P
      P_fname = filename;  SVC (pack filename,P)
      %result = P
   %end

   %routine report (%string(63) message)
      print string (message);  newline
   %end

   %routine say (%string(63) message)
      spaces (15);  print string (message);  newline
   %end

   %string(15) %fn access (%integer mask);  !translate access bits
      %string(15) s = ""
      %integer j
      mask = mask & 255
      %result = "*NONE*" %if mask = 0
      %result = "*ALL*" %if mask = 255
      %for j = 0,1,7 %cycle
         s = s . to string ('A'+j) %if mask & 1<<j # 0
      %repeat
      %result = s
   %end

   %string(15) %fn sys date (%integer packed form)
      %record(parm fm) P
      P_p1 = packed form
      SVC (unpack date,P)
      %result = P_text
   %end

   %integer %fn stoi (%string(15) s)
      %byte %name b
      %integer j = 0, k, sign = 1
      %result = 0 %if s = ""
      sign = -sign %if s -> ("-") . s
      %for k = 1,1,length(s) %cycle
         b == char no (s,k)
         report (s . "?") %and %signal fault %unless '0' <= b <= '9'
         j = 10*j + (b-'0')
      %repeat
      %result = sign*j
   %end

   %routine test (%string(63) context, %record(parm fm)%name P)
      !log a parameterised error message if the
      !director call failure parameter is set in P (P_P6).
      %return %if P_p6 = 0
      report ("*" . context . " -- " . P_text)
      %signal fault
   %end

   %integer %fn upper (%integer sym)
      %result = sym %unless 'a' <= sym <= 'z'
      %result = sym - 'a' + 'A'
   %end

   %routine get (%string(*)%name s)
      %integer sym
      skip symbol %while next symbol = ' '
      s = ""
      %cycle
         sym = next symbol
         %exit %if sym <= ' '
         s <- s . to string (sym)
         skip symbol
      %repeat
   %end

   %routine get alpha (%string(*)%name s)
      %integer sym
      skip symbol %while next symbol = ' '
      s = ""
      %cycle
         sym = upper (next symbol)
         %exit %unless 'A' <= sym <= 'Z'
         s <- s . to string (sym)
         skip symbol
      %repeat
   %end

   %routine drain input line
      %string(63) s = """"
      %if next symbol # NL %start
         %while next symbol # NL %cycle
            s <- s . to string (next symbol)
            skip symbol
         %repeat
         s <- s . """ ignored"
         report (s)
      %finish
      skip symbol;                       !past NL
   %end

   %string(15) %array unpacked (1:42)
   %byte %array pos (1:42);              !map n -> nth dir entry (sorted)
   %record(directoryf) D

   %routine sort dir;                    !set up POS and UNPACKED
      %integer j, k, flag, swap, no files = 0
      %record(parm fm) P
      %record(filef)%name f
      %for j = 1,1,42 %cycle;            !unpack directory entries
         pos(j) = j
         f == D_file(j)
         %if f_name2 = 0 %start
            unpacked(j) = ""
         %else
            no files = no files + 1
            P = 0;  P_p3 = f_name1;  P_p4 = f_name2
            SVC (unpack filename,P)
            unpacked(j) = P_fname
         %finish
      %repeat
      %if no files = 0 %start
         report ("No files")
         %stop
      %finish
      %for j = 1,1,42 %cycle;            !do the sort
         flag = 0
         %for k = 1,1,42-j %cycle
            %if unpacked(pos(k)) > unpacked(pos(k+1)) %start
               flag = non zero
               swap = pos(k);  pos(k) = pos(k+1);  pos(k+1) = swap
            %finish
         %repeat
      %repeat %until flag = 0
   %end

   %own %byte %array del(1:42) = 0(*);   !#0 => file#n is to be deleted
   %record(filef)%name f
   %string(63) s, fname, topic
   %integer j, k, m, sym, lines, flag
   %byte %name b
   %record(parm fm) P, Q

   %on %event input ended, fault %start
      %if EVENT_event = input ended %start
         !Kill all files which were marked for deletion
         %for j = 1,1,42 %cycle
            f == D_file(pos(j))
            %if del(j) # 0 %start
               P = 0
               P_dact = DELETE;  P_p3 = f_name1;  P_p4 = f_name2
               SVC (to director,P)
               s = unpacked (pos(j))
               %if P_p6 # 0 %start
                  s = "*cannot delete " . s . " -- " . P_text
               %else
                  s = s . " deleted"
               %finish
               report (s)
            %finish
         %repeat
         %if command_parameter # "" %start;           !return to home directory
            P = 0;  P_dact = BECOME
            SVC (to director,P);            !and we're ourselves again
            test ("Become fails",P);        !maybe
         %finish
         %stop
      %finish
      drain input line
      XEVENT = input ended; !again
      -> RECOVER
   %finish

   !Main program

   select input (0);  select output (0)

   %if command_parameter # "" %start;                 !CLEAN someone else's directory,
      command_parameter = command_parameter . ":";                 !syntax id CLEAN(UNIT_USER)
      P = packed (command_parameter);  P_dact = BECOME;  P_p6 = 0;!me
      SVC (to director,P)
      %if P_p6 # 0 %start
         report ("CLEAN fails -- " . P_text)
         %stop
      %finish
   %finish

   P_p1 = 0;  P_p2 = 0;                  !read current default directory block
   P_p6 = addr(D)
   P_dact = FILES;  SVC (to director,P)
   test ("CLEAN fails",P)
   %if command_modifier # 0 %start
      say ("Directory on unit " . itos(p_p1,0) . " block " . %c
           itos(p_p2,0) . " (X'" . xtos(p_p2,4) . "')")
   %finish
   j = 0;                                !index into directory
   sort dir

RECOVER:
   %cycle
      %if j < 0 %or j >= 42 %start
         j = 0
         say ("*TOP*")
      %finish
      j = j + 1;  f == D_file(pos(j))
      %continue %if f_name2 = 0;         !unused directory slot?
      !prompt user with filename
      P = 0;  P_p3 = f_name1;  P_p4 = f_name2; !unpack it first
      fname = unpacked (pos(j))
      s = fname;  s = " " . s %while length(s) < 14
      s = s . ":";  char no (s,1) = '>' %if del(j) # 0
      prompt (s)
      get alpha (s);                     !user gives command to act on file
      %if s # "" %or next symbol = '?' %start
         skip symbol %while next symbol = ' '
         skip symbol %and -> HELP %if next symbol = '?'
         -> STOP %if s = "STOP";         !one-off frigs
         P = 0;                          !set up P for all commands to use
         P_p3 = f_name1;  P_p4 = f_name2
         sym = char no (s,1);            !only 1st char of command significant

         %if sym = 'D' %start;           !mark file for deletion at the end
            del(j) = non zero
            say ("marked for deletion")
         %else %if sym = 'S';            !retain file previously marked
            del(j) = 0
            say ("saved!")
         %else %if sym = 'H';            !HELP
            get alpha (s);               !topic
HELP:       s = "GENERAL" %if s = ""
            j = j - 1
            open input (3,program source)
            select input (3)
            flag = 0
            %cycle
               skip symbol;              !past '!'
               %if next symbol = '$' %start
                  say ("Nothing about " . s) %if flag = 0
                  %exit
               %finish
               %if next symbol = '@' %start;   !start of new topic
                  skip symbol
                  get alpha (topic)
                  %exit %if flag # 0;          !end of one we wanted
                  flag = non zero %if char no(s,1) = char no (topic,1)
                  skip symbol;           !past nl
               %else
                  %while next symbol # NL %cycle
                     print symbol (next symbol) %if flag # 0
                     skip symbol
                  %repeat
                  newline %if flag # 0
                  skip symbol;           !past nl
               %finish
            %repeat
            close input
            select input (0)
         %else %if sym = 'C'; !COPY file on T:
            j = j - 1
            get (s);                     !only the 1st n lines
            lines = stoi (s);  lines = infinity %if lines <= 0
            open input (3,fname)
            select input (3)
            console int = ""
            %begin
               %on input ended %start
                  %return; !to enclosing block
               %finish
               %for k = 1,1,lines %cycle
                  %while next symbol # NL %cycle
                     %if console int # "" %start; !user has caused "Int:!"
                        P_p1 = 0;  P_p2 = non zero;  P_p3 = 0
                        SVC (kill TTY IO,P);   !chuck content of TT output buf
                        close input;  select input (0)
                        newline
                        FAULTS
                     %finish
                     print symbol (next symbol)
                     skip symbol
                  %repeat
                  newline;                  !in output
                  skip symbol;              !past NL
               %repeat
            %end
            close input
            select input (0)
         %else %if sym = 'P';            !set protection mask
            j = j - 1
            get alpha (s);               !new mask (ALL,NONE, or A..H)
            %if s = "ALL" %start
               k = 255
            %else %if s = "NONE"
               k = 0
            %else
               k = 0
               %for m = 1,1,length(s) %cycle
                  b == char no (s,m)
                  say (to string(b)."?") %and FAULTS %unless 'A' <= b <= 'H'
                  k = k ! 1<<(b-'A')
               %repeat
            %finish
            P_p6 = k;  P_dact = set file access
            SVC (to director,P)
            test ("Change access fails",P)
         %else %if sym = 'F';            !find <filename>
            get (s)
            say ("filename?") %and j = j - 1 %and FAULTS %if s = ""
            P = packed (s)
            %if P_p1 # 0 %or P_p2 < 0 %start;  !bad fname
               say (s . "?")
               j = j - 1
               FAULTS
            %finish
            SVC (unpack filename,P)
            s = P_fname
            %for k = 1,1,42 %cycle
               %if unpacked(pos(k)) = s %start
                  j = k
                  %exit
               %finish
               %if k = 42 %start
                  say (s . " not found")
                  j = j - 1
                  FAULTS
               %finish
            %repeat
            j = j - 1
         %else %if sym = 'R';            !rename <new name>
            get (s);  Q = packed (s)
            %if Q_p1 # 0 %or Q_p2 < 0 %start
               j = j - 1
               say (s . "?")
               FAULTS
            %finish
            P_p5 = Q_p3;  P_p6 = Q_p4
            P_dact = RENAME;  SVC (to director,P)
            test ("Rename fails",P)
            f_name1 = Q_p3;  f_name2 = Q_p4;   !make our copy of dir consistent
            SVC (unpack filename,Q);  unpacked (pos(j)) = Q_fname
            s = unpacked (pos(j))
            say (fname . " renamed " . s)
            j = j - 1
         %else %if sym = 'T';            !move to first file in directory
            j = -1
         %else %if sym = 'U' %or sym = 'L'; !move  back up to last file
            j = j - 1;                   !back 1 past this one
            j = j - 1 %while j > 0 %and D_file(pos(j))_name2 = 0; !find valid
            j = 42 %and say ("*END*") %if j = 0;            !wrap
            j = j - 1;                   !& back off one
         %else %if sym = 'N';            !move to NEXT file (for completeness)
         %else %if sym = 'A';            !analyse file
            j = j - 1
            P_dact = status;  SVC (to director,P)
            test ("analyse fails",P)
            s <- itos (P_p2,0) . " block";  s <- s . "s" %if P_p2 # 1
            s <- s . " "
            s <- s . itos (P_p3,0) ." extent"; s <- s . "s" %if P_p3 # 1
            s <- s . " "
            s <- s . " access " . access(P_p4) . ", created on "
            s <- s . sys date(P_p5&16_3FFF)
            say (s)
            %if command_modifier # 0 %start
               s <- "spine block at " . itos(f_spine block,0) . %c
                    " (X'" . xtos(f_spine block,4) . "')"
               say (s)
            %finish
         %else %if sym = 'Q' %or sym = 'E'
STOP:       xEVENT = input ended;         !!!TEMP
            %signal input ended
         %else
            report (s . "?  Try HELP")
         %finish
      %finish

DRAIN:
      drain input line
   %repeat

%end %of %program
, topic
   %integer j, k, m, sym, lines, flag
   %byte %name b
   %record(parm fm) P, Q

   %on %event input ended, fault %start
      %if EVENT_event = input ended %start
         !Kill all files which were marked for deletion
         %for j = 1,1,42 %cycle
            f == D_file(pos(j))
            %if del(j) # 0 %start
               P = 0
               P_dact = DELETE;  P_p3 = f_name1;  P_p4 = f_name2
               SVC (to director,P)
               s = unpacked (pos(j))
               %if P_p6 # 0 %start
                  s = "*cannot delete " . s . " -- " . P_text
               %else
                  s = s . " deleted"
               %finish
               report (s)
            %finish
         %repeat
         %if command_parameter # "" %start;           !return to home directory
            P = 0;  P_dact = BECOME
            SVC (to director,P);            !and we're ourselves again
            test ("Become fails",P);        !maybe
         %finish
         %stop
      %finish
      drain input line
      XEVENT = input ended; !again
      -> RECOVER
   %finish

   !Main program

   select input (0);  select output (0)

   %if command_parameter # "" %start;                 !CLEAN someone else's directory,
      command_parameter = command_parameter . ":";                 !syntax id CLEAN(UNIT_USER)
      P = packed (command_parameter);  P_dact = BECOME;  P_p6 = 0;!me
      SVC (to director,P)
      %if P_p6 # 0 %start
         report ("CLEAN fails -- " . P_text)
         %stop
      %finish
   %finish

   P_p1 = 0;  P_p2 = 0;                  !read current default directory block
   P_p6 = addr(D)
   P_dact = FILES;  SVC (to director,P)
   test ("CLEAN fails",P)
   %if command_modifier # 0 %start
      say ("Directory on unit " . itos(p_p1) . " block " . %c
           itos(p_p2) . " (X'" . xtos(p_p2,4) . "')")
   %finish
   j = 0;                                !index into directory
   sort dir

RECOVER:
   %cycle
      %if j < 0 %or j >= 42 %start
         j = 0
         say ("*TOP*")
      %finish
      j = j + 1;  f == D_file(pos(j))
      %continue %if f_name2 = 0;         !unused directory slot?
      !prompt user with filename
      P = 0;  P_p3 = f_name1;  P_p4 = f_name2; !unpack it first
      fname = unpacked (pos(j))
      s = fname;  s = " " . s %while length(s) < 14
      s = s . ":";  char no (s,1) = '>' %if del(j) # 0
      prompt (s)
      get alpha (s);                     !user gives command to act on file
      %if s # "" %or next symbol = '?' %start
         skip symbol %while next symbol = ' '
         skip symbol %and -> HELP %if next symbol = '?'
         -> STOP %if s = "STOP";         !one-off frigs
         P = 0;                          !set up P for all commands to use
         P_p3 = f_name1;  P_p4 = f_name2
         sym = char no (s,1);            !only 1st char of command significant

         %if sym = 'D' %start;           !mark file for deletion at the end
            del(j) = non zero
            say ("marked for deletion")
         %else %if sym = 'S';            !retain file previously marked
            del(j) = 0
            say ("saved!")
         %else %if sym = 'H';            !HELP
            get alpha (s);               !topic
HELP:       s = "GENERAL" %if s = ""
            j = j - 1
            open input (3,program source)
            select input (3)
            flag = 0
            %cycle
               skip symbol;              !past '!'
               %if next symbol = '$' %start
                  say ("Nothing about " . s) %if flag = 0
                  %exit
               %finish
               %if next symbol = '@' %start;   !start of new topic
                  skip symbol
                  get alpha (topic)
                  %exit %if flag # 0;          !end of one we wanted
                  flag = non zero %if char no(s,1) = char no (topic,1)
                  skip symbol;           !past nl
               %else
                  %while next symbol # NL %cycle
                     print symbol (next symbol) %if flag # 0
                     skip symbol
                  %repeat
                  newline %if flag # 0
                  skip symbol;           !past nl
               %finish
            %repeat
            close input
            select input (0)
         %else %if sym = 'C'; !COPY file on T:
            j = j - 1
            get (s);                     !only the 1st n lines
            lines = stoi (s);  lines = infinity %if lines <= 0
            open input (3,fname)
            select input (3)
            console int = ""
            %begin
               %on input ended %start
                  %return; !to enclosing block
               %finish
               %for k = 1,1,lines %cycle
                  %while next symbol # NL %cycle
                     %if console int # "" %start; !user has caused "Int:!"
                        P_p1 = 0;  P_p2 = non zero;  P_p3 = 0
                        SVC (kill TTY IO,P);   !chuck content of TT output buf
                        close input;  select input (0)
                        newline
                        FAULTS
                     %finish
                     print symbol (next symbol)
                     skip symbol
                  %repeat
                  newline;                  !in output
                  skip symbol;              !past NL
               %repeat
            %end
            close input
            select input (0)
         %else %if sym = 'P';            !set protection mask
            j = j - 1
            get alpha (s);               !new mask (ALL,NONE, or A..H)
            %if s = "ALL" %start
               k = 255
            %else %if s = "NONE"
               k = 0
            %else
               k = 0
               %for m = 1,1,length(s) %cycle
                  b == char no (s,m)
                  say (to string(b)."?") %and FAULTS %unless 'A' <= b <= 'H'
                  k = k ! 1<<(b-'A')
               %repeat
            %finish
            P_p6 = k;  P_dact = set file access
            SVC (to director,P)
            test ("Change access fails",P)
         %else %if sym = 'F';            !find <filename>
            get (s)
            say ("filename?") %and j = j - 1 %and FAULTS %if s = ""
            P = packed (s)
            %if P_p1 # 0 %or P_p2 < 0 %start;  !bad fname
               say (s . "?")
               j = j - 1
               FAULTS
            %finish
            SVC (unpack filename,P)
            s = P_fname
            %for k = 1,1,42 %cycle
               %if unpacked(pos(k)) = s %start
                  j = k
                  %exit
               %finish
               %if k = 42 %start
                  say (s . " not found")
                  j = j - 1
                  FAULTS
               %finish
            %repeat
            j = j - 1
         %else %if sym = 'R';            !rename <new name>
            get (s);  Q = packed (s)
            %if Q_p1 # 0 %or Q_p2 < 0 %start
               j = j - 1
               say (s . "?")
               FAULTS
            %finish
            P_p5 = Q_p3;  P_p6 = Q_p4
            P_dact = RENAME;  SVC (to director,P)
            test ("Rename fails",P)
            f_name1 = Q_p3;  f_name2 = Q_p4;   !make our copy of dir consistent
            SVC (unpack filename,Q);  unpacked (pos(j)) = Q_fname
            s = unpacked (pos(j))
            say (fname . " renamed " . s)
            j = j - 1
         %else %if sym = 'T';            !move to first file in directory
            j = -1
         %else %if sym = 'U' %or sym = 'L'; !move  back up to last file
            j = j - 1;                   !back 1 past this one
            j = j - 1 %while j > 0 %and D_file(pos(j))_name2 = 0; !find valid
            j = 42 %and say ("*END*") %if j = 0;            !wrap
            j = j - 1;                   !& back off one
         %else %if sym = 'N';            !move to NEXT file (for completeness)
         %else %if sym = 'A';            !analyse file
            j = j - 1
            P_dact = status;  SVC (to director,P)
            test ("analyse fails",P)
            s <- itos (P_p2) . " block";  s <- s . "s" %if P_p2 # 1
            s <- s . " "
            s <- s . itos (P_p3) ." extent"; s <- s . "s" %if P_p3 # 1
            s <- s . " "
            s <- s . " access " . access(P_p4) . ", created on "
            s <- s . sys date(P_p5&16_3FFF)
            say (s)
            %if command_modifier # 0 %start
               s <- "spine block at " . itos(f_spine block) . %c
                    " (X'" . xtos(f_spine block,4) . "')"
               say (s)
            %finish
         %else %if sym = 'Q' %or sym = 'E'
STOP:       xEVENT = input ended;         !!!TEMP
            %signal input ended
         %else
            report (s . "?  Try HELP")
         %finish
      %finish

DRAIN:
      drain input line
   %repeat


{just a dummy comment}
%endofprogram
 H?   ; ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ! file compare program (with profuse apologies to H.M. Dewar esq.)

%begin
%include "Sysinc:command.inc"
%externalroutinespec CPU LIMIT(%integer n)
%owninteger  max=8;          !  minimum acceptable lookahead
%constinteger  linemax=127;  !  maximum line length
%constinteger  astream=1, bstream=2;      !  input streams
%constinteger  out=1;        !  output stream
%constinteger  skip=0;       !  set non-zero to skip blank lines
                             !  (but then line numbers are incorrect)

%owninteger  abase=0, bbase=0, acount=0, bcount=0
%integer  anum, bnum, aline, bline
%integer  aeof, beof
%integer  mismatch

%begin;            ! set 'max' to use all available store
%constinteger  spare=512
%integer  lim
   lim = (free space - spare)//(2*(line max + 1))
   %if lim < max %start
      print string("* More store required")
      newline
      %stop
   %finish
   max = max << 1 %while max <= lim
   max = max >> 1
%end

%string(127)%array  aa,bb(0:max-1)

%string(*)%map a(%integer  i)
   %result == aa((abase+i)&(max-1))
%end

%string(*)%map b(%integer  i)
   %result == bb((bbase+i)&(max-1))
%end

%routine  replenish(%string(*)%map  x(%INTEGER N), %integername  xline,  %c
                          %integer n, %integername count, eof)
   %integer  i,j,k,last
   %string(*)%name  p
   %on 9 %start
      eof = 1;  %return
   %finish
   %for i = max-n+1, 1, max  %cycle
      p == x(i)
      %cycle
         last = 0;  j = 0
         %return %if eof # 0
         %cycle
            read symbol(k)
            j = j+1;  charno(p,j) = k
            %exit %if k = nl %or j = linemax
            last = j %if k # ' '
         %repeat
         read symbol(k) %while k # nl;  ! ...skip any remaining chars
         xline = xline + 1;    ! ...within-file line no.
         %exit %if last # 0 %or skip = 0;  ! ...blank line?
      %repeat
      length(p) = last+1;  charno(p,last+1) = nl
      count = count+1;   ! ...within-buffer line count
   %repeat
%end


%routine  PRINT(%string(*)%map  X(%integer N),
                %integer  XBASE, N,
                %string(*)%name  ID)
   %integer  i
   PRINT STRING("** ");  printstring(id)
   PRINT STRING(" at line");  WRITE(XBASE+1,1)
   newline
   %return %if n <= 0
   %for I = 1,1,n %cycle
      %if i=n %then printstring("  ") %else printstring(" |")
      print string(x(i))
   %repeat
%end

%predicate  same(%integer  al, bl)
   %if al > acount %or bl > bcount %start
      %true %if al > acount %and bl > bcount
      %false
   %finish
   %true %if a(al) = b(bl)
   %false
%end


%routine  find match(%integername  an, bn)
   %integer i,j
   %for i = 1,1,max %cycle
      an=i %and bn=i %and %return %if same(i,i)
      %if i # 1 %start
         %for j = 1,1,i-1 %cycle
            an=i %and bn=j %and %return %if same(i,j)
            an=j %and bn=i %and %return %if same(j,i)
         %repeat
      %finish
   %repeat
   an = max+1;  bn = max+1
%end


!    ------- it all starts here --------
   cpu limit(10000)
   select output(out)
   anum = max;  bnum = max
   aline = 0;  bline = 0
   aeof = 0;  beof = 0
   mismatch = 0
   %cycle
      select input(a stream);  replenish(a,aline,anum,acount,aeof)
      select input(b stream);  replenish(b,bline,bnum,bcount,beof)
      %exit %if acount<=0 %and bcount<=0
      find match(anum,bnum)
      %if anum # 1 %or bnum # 1 %start
         mismatch = mismatch + 1
         print(a,abase,anum,command_in1)
         print(b,bbase,bnum,command_in2)
         newline
      %finish
      abase = abase+anum;  acount = acount-anum
      bbase = bbase+bnum;  bcount = bcount-bnum
   %repeat

   newline
   print string("  Complete -")
   %if mismatch = 0 %start
      print string(" Files identical (")
      write(aline,0);  print string(" lines)")
   %else
      write(mismatch,1);  print string(" mismatch")
      print string("es") %if mismatch # 1
   %finish
   newline

%endofprogram
 H?    3                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %string(9)%fnspec Weekday(%integer N)
   %conststring(9)%array day(0:6) = "Sunday", "Monday", "Tuesday",
                                    "Wednesday", "Thursday", "Friday",
                                    "Saturday"
   %record(parmfm) p
   %integer d
   svc(19, p)
   d = rem(p_p4+3, 7)
   %result = Day(d)
%end
%begin
   printstring(Weekday(d));  space
   printstring(date);        space
   printstring(time);        newline
%endofprogram
 H?    <                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !MOUSES file dumper utility.
%own %string(31) version = "(pre-release) vsn 2.1"
!%OPTION "NOopen,NOspaces,NOstack,Upper"
!Alan Culloch,    August 1980.

%include "Sysinc:Command.inc"
%externalroutinespec Open Da(%integer Chan, Mode, %string(31) File)
%externalroutinespec Read Da(%integer Chan, Block, %name To)
%externalroutinespec Close Da(%integer N)
%externalroutinespec Phex(%integer N, P)
!system calls
%const %integer disc read = 101
%const %integer to director = 20
%const %integer pack filename = 17
%const %integer find unit = 45

%begin
   %external %string(63) %fn %spec ITOS (%integer I,places)
   %integer %fn STOI (%string(15) s)
      %byte %name b
      %integer j, n = 0, Base = 10
      %for j = 1,1,length(s) %cycle
         b == char no (s,j)
         %continue %if b <= ' '
         %if '0' <= b <= '9' %start
            b = b-'0'
         %else %if 'A' <= B&95 <= 'Z'
            b = b&95-'A'+10
         %else
            %result = -1 %unless b  = '_'
            Base = n;  N = 0
            %continue
         %finish
         %result = -1 %if B >= Base
         n = Base*n + b
      %repeat
      %result = n
   %end
   %const %integer non zero = 1
   %const %integer infinity = 16_7FFFFFFF
   %const %integer FF = 12;              !ASCII formfeed character
   %record %format block fm (%integer %array word(0:512//4 - 1))
   %record(block fm) block
   %record(parm fm) P
   %integer offset;                      !word index in BLOCK

   %string(63) parm = Command_parameter
   %integer exclam = Command_modifier

   !Events
   %const %integer DA trap = 9;          !signalled on READ DA bad block#
                                         !(used as E-O-F trap on seq. read).
   !Output display characteristics
   %integer page ht = 60,line width = 80;!defaults
   %integer j
   %for j = 1,1,length(command_out1) %cycle
      line width = 132 %if char no (command_out1,j) = ':';   !assume LP:
   %repeat
   %integer N words;                     !# of 32-bit words per dump line
   %integer firsttry;                    !!!!!!
   %integer rows;                        !# of dump lines per block
   %integer N fields;                    !# of (hex,oct,..) fields wanted
   %integer first = 0, last = infinity;  !default range of blocks to dump
   %integer physical = 0;                !0:from file; #0:direct disc reads
   %integer unit;                        !physical unit no.
   %integer squeeze = non zero;          !to suppress formfeeds
   %integer decoding = 0

   !Dump format is any comb. of hex, octal and straight ASCII
   !side-by-side on the page, with each dump line optionally
   !follwed by an ASCII decode of the words.

   %const %integer hex = 1<<1,
                 octal = 1<<2,
                 ASCII = 1<<3,
               decoded = 1<<4,
               formats = 3
   %integer wants = 0;                   !gets undecoded hex dump by default

   %routine report (%string(63) message)
      print string (message);  newline
   %end

   %integer lines = 0

   %routine break;                       !keeps track of lines for formfeeds
      newline;  lines = lines + 1
   %end

   %routine decode parm;                 !interprets program parameter
      %string(63) s, t
      %integer j
      wants = wants ! decoded %if exclam # 0
      parm = parm . ","
      %while parm -> s . (",") . parm %cycle
         %continue %if s = ""
         %if s = "HEX" %start
            wants = wants ! hex
         %else %if s = "OCTAL"
            wants = wants ! octal
         %else %if s = "ASCII"
            wants = wants ! ASCII
         %else %if s = "PAGED"
            squeeze = 0
         %else %if s -> s . ("..") . t
            t = itos(infinity,0) %if t = ""
            first = stoi (s);  last = stoi (t)
            %if first < 0 %or last < 0 %start
               report (s . ".." . t . "?")
               %stop
            %finish
         %else %if stoi(s) >= 0
            first = stoi(s);  last = first; !single block
         %else %if s -> s . ("=") . t
            %if s = "PAGE" %start
               page ht = stoi (t)
            %else %if s = "WIDTH"
               line width = stoi (t)
            %else %if s = "DISC"
               physical = non zero
               %if t -> ("#") . t %start;   !unit #n
                  unit = stoi (t)
               %else
                 String(Addr(P_sact)) = t . "_:";  SVC (pack filename,P)
                  P_dact = find unit;  SVC (to director,P)
                  %if P_p6 # 0 %start
                     print string (P_text)
                     newline
                     %stop
                  %finish
                  unit = P_p1
               %finish
               print string ("Dumping unit #");  write(unit,0);  newline
            %else
               report (s . "=?")
               %stop
            %finish
            report (t."?") %and %stop %if line width < 0 %or
                                             page ht < 0;   !STOI faults?
         %else
            report (s . "?")
            %stop
         %finish
      %repeat
      wants = wants ! hex %if wants & (hex!octal!ASCII) = 0;   !hex default
      N fields = 0
      %for j = 1,1,formats+4 %cycle
         N fields = N fields + 1 %if wants & 1<<j # 0
      %repeat
   %end

   %routine dump ASCII (%integer word, sp); !SP = padding per character
      %routine do (%integer word)
         %integer j,k
         %for j = 1,1,3 %cycle
            k = rem (word,37);  word = word//37
            %if k = 0 %then space %else %start
               %if k <= 26 %start
                  print symbol (k + 'A' - 1)
               %else
                  print symbol (k - 27 + '0')
               %finish
            %finish
         %repeat
      %end
      %integer j, k
      %if decoding = 0 %or exclam # '?' %start;   !straight ASCII
         %for j = 1,1,4 %cycle
            spaces (sp)
            k = (word>>(3*8)) & 127;  word = word<<8
            %if k < ' ' %or k = 127 %then space %else print symbol (k)
         %repeat
      %else;                             !packed decode
         spaces (4*sp + 4 - 6)
         do (word>>16);  do(word&X'FFFF')
      %finish
   %end

   %routine poct (%integer n)
      %integer j
      print symbol (n>>j & 7 + '0') %for j = 30, -3, 0
   %end

   %routine print decoded (%integer n, from)
      !dump the ASCII translation of the N words
      !starting at FROM under each of the format
      !part of the last dump line
      %integer j,k
      decoding = non zero
      spaces (4);  print symbol ('|')
      %for j = 1,1,formats %cycle
         %if wants & 1<<j # 0 %start
            spaces (2) %if 1<<j = octal
            %for k = from, 1, from + n - 1 %cycle
               %if 1<<j = hex %start
                  space
                  dump ASCII (block_word(k),1)
               %else %if 1<<j = octal
                  dump ASCII (block_word(k),2);   !4*(2+1) = 12 = octal field
               %else; !ASCII - dont do it again
                  spaces (4)
               %finish
            %repeat
         %finish
      %repeat
      decoding = 0
   %end

   %routine read block (%integer block no)
      %record(parm fm) P
      read DA (1,block no,block) %and %return %if physical = 0
      P_p1 = block no;  P_p2 = addr(block);  P_p3 = unit;  P_p4 = 0
      SVC (disc read,P)
      %if P_p1 # 0 %start
         print string ("*cannot read block")
         write (block no,1);  print string (" from unit")
         write (unit,1);  print string (", status:")
         write (P_p1,1);  newline
         %stop
      %finish
   %end
   %owninteger opened = 0

   !Main program

   %on DA trap %start
      %if opened = 0 %start
         printstring("*Dump ".command_In1. " fails -- ".event_message)
         newline
      %else
         close DA (1)
      %finish
      close output
      %stop
   %finish

   %integer len, block ht, block no
   %integer k, m, save

   !Calc no. of words per row of dumped block,
   !fitting in all required output formats for
   !each word

   decode parm
   len = 0;  len = len + 9 %if wants & hex # 0
             len = len +12 %if wants & octal # 0
             len = len + 4 %if wants & ASCII # 0
   N words = (line width - 5 { nnn|} - N fields) // len

   !Turn NWORDS down till a block will be printed
   !as an integral number of full rows

   first try = N words;                  !!!!
   %cycle
      %if N words = 0 %start
         report ("Won't fit!")
         %stop
      %finish
      %exit %if rem (512//4,N words) = 0
      N words = N words - 1
   %repeat

   !Now we can find the number of lines the dump
   !of a single block will occupy

   rows = (512//4) // N words
   block ht = rows
   block ht = 2*rows %if wants & decoded # 0;  !ASCII decode under each line
   block ht = 3 {header lines} + block ht
   squeeze = non zero {ignore PAGED option} %if block ht >= page ht

   open DA (1,0,command_in1) %if physical = 0
   opened = 1
   open output (1,command_out1)
   select output (1)
   print symbol (FF)
   break

   block no = first - 1
   %cycle
      block no = block no + 1
      %exit %if block no > last
      read block (block no); !%SIGNAL when it falls off
      %if lines + block ht >= page ht %start
         print symbol (FF) %and newline %if squeeze = 0
         lines = 0
      %finish
      break;  print string ("Block #");  write (block no,0)
      break
      break
      offset = 0
      %for j = 1,1,rows %cycle
         Phex(4*offset, 4);  printsymbol('|')
         %for k = 1,1,formats %cycle
            space %if 1<<k = ASCII %and wants&(\(ASCII!decoded)) # 0
            !(don't jam ASCII dump up against octal one)
            %if wants & 1<<k # 0 %start
               space
               save = offset
               %for m = 1,1,N words %cycle
                  %if 1<<k = hex %start
                     space
                     phex (block_word(offset), 8)
                  %else %if 1<<k = octal
                     space
                     poct (block_word(offset))
                  %else %if 1<<k = ASCII
                     dump ASCII (block_word(offset),0)
                  %finish %else %monitor %and %stop
                  offset = offset + 1
               %repeat
               offset = save
            %finish
         %repeat
         break
         print decoded (N words,offset) %and break %if wants & decoded # 0
         offset = offset + N words
      %repeat
   %repeat

%end %of %program
 H?    >                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %begin
   %include "SYSINC:COMMAND.INC"
   %integer col
   %constinteger h = X'FFFF'
   %string(63) file, output
   %recordformat parmfm(%shortinteger dsno, dact, ssno, sact, %c
                        %integer p1,p2,p3,p4,p5,p6)
   %recordformat  pgmfm(%integer  limit,stack,gla,code base,ep,code,   %c
                                                %shortinteger  options)
   %ownrecord(parmfm) p, q
   %recordformat loadfm(%integer code, gla, specs, defs, when, file)
   %recordformat textfm(%integer n1, n2)
   %recordformat specfm(%integer gla, code, ep)
   %recordformat hdfm(%shortinteger base, n)
   %recordformat headfm(%shortinteger pure size, gla size, code disp, %C
                                      lit disp, registers, mainep, %C
                        %record(hdfm) reloc, defs, specs, ldiag, vdiag)
   %recordformat deffm(%shortinteger link, ep, %integer n1, n2)
   %ownrecord(headfm)%name head
   %record(specfm)%name spec
   %record(deffm)%name def
   %record(textfm)%name sp
   %integer base, code, gla, specs, defs

   %routine qsort(%string(15)%array %name p, %integer a, b)
      %string(15) dump
      %integer l, u
      %while a < b %cycle
         l = a;  u = b
         dump = p(u);  ->find

up:      l = l+1;  ->found %if l = u
find:    ->up %unless p(l) > dump
         p(u) = p(l)
down:    u = u-1;  ->found %if l = u
         ->down %unless p(u) < dump
         p(l) = p(u)
         ->up

found:   p(u) = dump
         l = l-1;  u = u+1
         %if l-a > b-l %start
            qsort(p,u, b);  b = l
         %else
            qsort(p,a, l);  a = u
         %finish
      %repeat
   %end

%string(15) %fn entry(%integer n1, n2)
   %string(15) s
   %integerfn  ch(%integer  n)
      %result = n-1+'A' %if n <= 26
      %result = n-27+'0' %if n <= 36
      %result = n-37+'#'
   %end
   %routine unpack(%integer k)
      %return %if k = 0
      unpack(k//40)
      k = rem(k, 40)
      s = s. to string(ch(k)) %unless k = 0
   %end
   s = ""
   unpack(n1>>16);  unpack(n1&X'FFFF')
   unpack(n2>>16);  unpack(n2&X'FFFF')
   %result = s
%end

   %integer max = (free space - 1024) >> 4
   %string(15) %array slots(1:max)
   %integer used = 0, j

   %routine Print slots
      %integer j, col = 0
      Spaces (4)
      %for j = 1,1,used %cycle
         Print string (slots(j))
         Spaces (14 - length(slots(j)))
         col = col + 1
         newline %and spaces(4) %if col&3 = 0
      %repeat
   %end

   file = command_in1
   file = file.".exe" %unless file -> (".")
   output = command_out1
   string(addr(p_sact)) = file
   svc(10, p)
   %if p_p1 # 0 %start
      printstring("Cannot load ".file)
      newline
      %stop
   %finish
   code = p_p2;  base = code-16
   gla = p_p3
   %if shortinteger(base+4) # X'4321' %start
      printstring(file." is an old format file")
      newline
      %stop
   %finish
   output = "T:" %if output = ""
   open output(1, output)
   select output(1)
   head == record(code)
   code = code+head_code disp&H*2
   specs = head_specs_n
   defs = head_defs_n

!!!   %if specs # 0 %start
!!!      printstring("External references:")
!!!      newline
!!!      %cycle
!!!         spec == record(gla+2*specs)
!!!         sp == record(base+spec_code>>16*2+16)
!!!         print entry(sp_n1, sp_n2)
!!!         specs = spec_gla&h
!!!         %exit %if specs = 0
!!!      %repeat
!!!      newline
!!!   %finish
   %if defs # 0 %start
      printstring("External entry points:");  newline
      %cycle
         def == record(base+2*defs+16)
         used = used + 1
         %if used > max %start
            Print string ("Too many entries")
            Newline
            %stop
         %finish
         slots(used) = entry(def_n1, def_n2)
         defs = def_link&h
      %repeat %until defs = 0
      Qsort (slots,1,used) %if command_modifier = 0
      Print slots
      newline
   %finish
%endofprogram
 H?    T                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !IMP driver

%recordformat impcomfm(%integer statements, flags, code, gla, diags, perm,
                    %string(31) file)
%externalrecord(impcomfm) IMPCOM
%include "Sysinc:command.inc"

%externalpredicatespec EXISTS(%string(63) file)
%systemroutinespec     DELETE(%integer quite, %string(63) s)
%externalroutinespec   DOING(%string(15) S)
%externalroutinespec   RUN(%string(63) S)
%externalroutinespec   TO LOWER(%string(*)%name s)
%externalroutinespec   CPU LIMIT(%integer n)

%externalroutine IMP %alias "%go"
%conststring(15) pass1       = "newexe:PASS1",
                 pass2       = "newexe:PASS2",
                 pass3       = "newexe:PASS3",
                 prim file   = "newsrc:PRIMS",
                 sprim file  = "Newsrc:sprims",
                 default ext = ".IMP"
   %string(31) prim = prim file
   %integer j, return code, lines
   %string(31) source file, object  file, listing file, source
   %string(31) temp1 = "", temp2 = "", temp3 = ""
   %string(31) work
   %integer options

   ! used for accumulating timing data
   %integer  x1, x2, x3

%integerfn  option bits(%string(63)  opt)
   %integer  initial
   %integer  include, exclude, item , item no, p, no
   %string(15)  item word
   %constinteger  options = 14
   %conststring(8)%array  option word(1:options) =
      "default",      "opt",  "trusted",
   !    512+31       256+0      32
      "capacity",  "assign",    "array",  "extra",
   !      1           2         4        16
      "suppress", "partial", "diags",  "timer",
   !     128         256       512     x'4000'
      "brief",      "trace",  "hide"
   ! x'1000',         64
   %constshortintegerarray  option mask(1:options) =
      X'821F',   X'8100',   X'8020',
            1,         2,         4,       16,
          128,       256,       512,  x'4000',
      x'1000',        64,    x'0900'

   %integerfn  known item
      %integer  n,sym
      %string(15)  s, t

      item word = ""
      opt -> item word.(",").opt
      no = 0
      %if item word -> s.("no").t %start
         %if s = "" %then item word = t %and no = 2
      %finish
      %for n = 1,1,options %cycle
         %result=n %if item word = option word(n)
      %repeat
      %result = 0
   %end {of known item}

   initial = option mask(1)&x'7FFF';      ! default
   include = 0;  exclude = 0
   to lower(opt)
   opt = opt.","
   %while opt # "" %cycle
      item no = known item
      %if item no # 0 %start
         item = option mask(item no)
         %if item < 0 %start;      ! reset completely
            initial = item & x'7FFF'
         %else
            %if no # 0 %start
               exclude = exclude ! item
            %else
               include = include ! item
            %finish
         %finish
      %else %if item word = "SHORTPRIM"
         prim = sprim file
      %else %if item word # ""
         print string(item word); print symbol('?')
         newline
      %finish
   %repeat
   %result = (initial & (\exclude)) ! include
%end;      ! 'option bits'

   %routine close in(%integer st)
      select input(st);  close input
   %end
   %routine close out(%integer st)
      select output(st);  close output
   %end
   %string(31)%fn temp file
      %string(1) work
      %record(parmfm) p
      p_dact = 25;  svc(20, p)
      p_p4 = p_p4&x'FFFF'
      %if p_p4 > 26 %then work = tostring(p_p4-27+'0') %c
                    %else work = tostring(p_p4+'a'-1)
      %result = "$tmp.".work
   %end
   %routine print pass(%integer pass, time)
      %if pass = 0 %start
         print string("mean ")
      %else
         print string("pass");  write(pass,-1)
      %finish
      write( (2*time+1)//2000,5);  print string(" secs")
      write(60*1000*lines//time,5);  print string(" statements/min")
      newline
   %end
   %routine show result(%integer n)
      %if n < 0 %start
         printstring("Program contains")
         write(-n, 1)
         printstring(" fault")
         printsymbol('s') %if n # -1
      %else
         write(n, -4)
         printstring(" statements compiled")
      %finish
      newline
   %end
   %routine Fail(%string(63) Why)
      Printstring("IMP Fails -- ")
      Printstring(Why)
      Newline
      %stop
   %end

   %on 9,10 %start
      Select Output(0)
      Fail(EVENT_Message)
   %finish

! ******** set compiler options *********
   options = option bits(command_parameter)

   source file = command_in1
   object file = command_out1
   listing file = command_out2
   to lower(source file)
   to lower(object file)
   to lower(listing file)
   object file = "n:" %if object file = "null:"
   listing file = "n:" %if listing file = "null:"
   options = options ! x'1000' %if listing file = "n:"; ! suppress listing to N:

   impcom_flags = options;         ! set compilation options

   %if source file -> source.(".").work %start      {extension given}
      %unless exists(source file) %start
Noex:    Fail(Source file." does not exist")
      %finish
   %else
      source = source file                          {no extenstion}
      %unless exists(source) %start
         work = source file.default ext
         ->noex %unless exists(work)
         source file = work
      %finish
   %finish
   %if source -> work.(":").source %start;  %finish
   %if object file = "" %start
      object file = source.".exe"
   %else %unless object file -> (".")
      object file = object file.".exe" %unless object file = "n:"
   %finish
   %if object file = "n:" %start
      temp1 = "n:"
   %else
      temp1 = temp file
   %finish
   cpu limit(60*10)      {10 minutes}
   x1 = cpu time

   open input(1, source file)
   open input(2, prim)
   open output(2, listing file)
   open output(1, temp1)
   open output(3, "t:")

   select output(2)
   printstring("Source file: ");  printstring(source file)
   printstring("     compiled on ")
   printstring(date);  printstring(" at ");  printstring(time)
   newline
   printstring("Object file: ");  printstring(object file);  newlines(2)
   doing("First pass")
   run(pass1)
   lines = impcom_statements
   select output(2);  show result(lines)
   select output(0)
   close in(1);  close in(2)
   close out(1);  close out(2);  close out(3)
   ->done1 %if lines < 0


   ->done %if temp1 = "n:"
   x2 = cpu time

   open input(1, temp1)
   temp2 = temp file;  open output(1, temp2)
   temp3 = temp file;  open output(2, temp3)
   doing("Second pass")
   cpu limit(60*5)      {5 minutes}
   run(pass2)

   close in(1)
   close out(1);  close out(2)

   x3 = cpu time

   open input(1, temp2);  open input(2, temp3)
   impcom_file = object file;      ! pass 3 opens its own DA file
   doing("Final pass")
   cpu limit(60*4)         {4 minutes}
   run(pass3)

done:selectoutput(0)
      %if command_modifier # 0 %start
         printstring("Code");  write(impcom_code, 1)
         printstring(" + Perm");  write(impcom_perm, 1)
         printstring(" + Glap");  write(impcom_gla, 1)
         printstring(" + Diags");  write(impcom_diags, 1)
         printstring(" =")
         write(impcom_code+impcom_perm+impcom_gla+impcom_diags, 1)
         printstring(" bytes")
         newline
      %finish
     %if options & x'4000' # 0 %start
        x1 = x2-x1;  x2 = x3-x2;  x3 = cputime - x3
        print pass(1,x1); print pass(2,x2); print pass(3,x3)
        print pass(0,x1+x2+x3)
     %finish
stop:    delete(1, temp2);  delete(1, temp3)
done1:   delete(1, temp1)
         select output(0)
         show result(lines)
         doing("")
%end
%endoffile
 H?    ]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !!!! 14-NOV-80

! EMAS VERSION OF LAYOUT, ALTERED FOR INTERDATA
! CHANGED AGAIN TO DO SINGLE PAGES ON DEMAND.
! 19-9-80:  changed so Pragma printer will underline properly
!           CAP,CAPO,CAPSH,CAPSHO,INVERT,INVERTO defaulted out
! 4-11-80:   'include' option implemented
!            ASSIGN parameter lookup changed to strings from packed chars
!           PSR modification to look for input.LAY if input not found.

%BEGIN
!*  DOCUMENT LAYOUT PROGRAM
!* SYMBOLIC CONSTANTS
%CONSTINTEGER  command stream = 0
%OWNINTEGER  SIN = 1;           ! SOURCE INPUT STREAM
%CONSTINTEGER  LSIN = 3;         !   DITTO
%CONST %INTEGER ERR=0,out=1

! Define various types of output possible - only one per run
%constinteger output types = 4;      ! no. of types
%constinteger  printer = 1, update = 2, merge = 3, index = 4, daisy = 5
%conststring(11)%array  operating mode(1:5) =
      "PRINTER",  "UPDATE",  "MERGE",  "INDEX",  "DAISY"
%owninteger  output type = printer;   ! default
%owninteger  inclusion mode = 1;   ! 0 => merge, 1 => copy INCLUDE references by name

%include "Sysinc:command.inc"
%externalpredicatespec Exists(%string(31) File)

%string(63) parm = command_parameter;   ! start parameter:- MOUSES dependent
%string(31)  IN1= command_in1
%string(31) OUT1= command_out1

%CONST %INTEGER LBOUND=200;             !LINE BUFF BOUND
%CONST %INTEGER ABOUND=200;             !ATOM BUFF BOUND
%CONST %INTEGER SBOUND=200;             !SOURCE LINE BUFF BOUND
%CONST %INTEGER TBOUND=25;              !TAB BOUND
%CONST %INTEGER ESCBIT=256,UNDBIT=128,CASEBIT=32
%CONST %INTEGER CHARMASK=255,BASICMASK=127,LETMASK=95
%CONST %INTEGER SENTSP=544;             !512+' '
%CONSTINTEGER JUSTBIT = X'8000'
                                        !LAYOUT PARAMETERS
%OWN %INTEGER TOP=2,BOTTOM=4,LEFT=0,PAGE=60,LINE=72
%OWN %INTEGER SLINE=80,NLS=1,SGAP=2,PGAP=3
%OWN %INTEGER INDENT=0,PAGENO=0,START=1,FINISH=9999
!!!!%OWN %INTEGER CAP='@',UND='_',CAPSH='.',UNDSH='%',INVERT=32
%owninteger  cap=0, und='_',capsh=0,undsh='%',invert=0
%integer     capo = cap, undo = und, capsho = capsh, undsho = undsh
%integer     inverto = invert
%owninteger at line = 1, old at line
%string(35)  include file = "";  %integer  include stream
%string(35)  output ident
%OWN %INTEGER ASCII=1,JUST=0,MARK=0,ESCAPE='$'
%OWN %INTEGER IGNORE=0, SECTNO=0
%OWNINTEGER DLPI=6, DCPI=10, DPAGE=1700
%OWNINTEGER DLEFT=250, DTOP=250
%OWN %INTEGER %ARRAY TAB(0:25)=  %C
1,9,17,25,33,41,49,57,65,73,81,
89,97,105,113,121,129,137,145,153,161,169,177,185,193,
201
%OWN %INTEGER XLINES=0,LINECAPIND=0,LINEUNDIND=0,LINEMIDIND=0
%OWNINTEGER DBUFFP=0
%OWN %INTEGER INDENTIND=1,ERRIND=0,XPAGE=1
%OWN %INTEGER COLS=0;                   !COLUMNS USED ON CURRENT LINE
%OWNINTEGER LHM=1
%OWN %INTEGER TEXTCOLS=0;               !LAST COL OCCUPIED
%OWN %INTEGER LINES=0;                  !LINES PRINTED ON CURRENT PAGE
%OWN %INTEGER PAGES=0;                  !TOTAL PAGES PRINTED
%OWN %INTEGER FIXED=0;                  !FIXED COLUMNS
%OWN %INTEGER GAPS=0,SGAPS=0;           !TOTAL GAPS, SENTENCE GAPS
%OWN %INTEGER SIZE=0;                   !SIZE OF CURRENT ATOM
%OWN %INTEGER SMAX=0;                   !UPDATED SOURCE POINTER
%OWN %INTEGER INDENTCOL=1
%OWN %INTEGER NEXT=0
%INTEGER DIRECTIVE,RELIND,FREELIST,NUM
%INTEGERARRAY DBUFF(1:LBOUND);          !DIABLO BUFFER
%INTEGER %ARRAY BUFF(1:LBOUND);         !LINE BUFFER
%INTEGER %ARRAY ABUFF(1:ABOUND);        !ATOM BUFFER
%INTEGER %ARRAY SBUFF(1:SBOUND);        ! SOURCE LINE (UPDATED)

! VARIABLES ASSOCIATED WITH SINGLE PAGE PRINTING
%CONSTINTEGER  PPS = 1024;  ! PAGES PER SECTION
%CONSTINTEGER  PRINT MAX = 30
%RECORDFORMAT  PRINTFM(%SHORTINTEGER  SECTION, PAGE)
%RECORD(PRINTFM)%ARRAY  PRINT LIST(1:PRINT MAX)
%OWNINTEGER  LAST PRINT = 0, NEXT PRINT = 1

%INTEGER %ARRAY TYPE(0:127);            ! FOR SYMBOL INPUT.
%INTEGER %ARRAY LINK(1:65),HEAD,TAIL(1:500)




   %PREDICATE  TO BE PRINTED(%INTEGER  LINE)
      %RECORD(PRINTFM)%NAME  P;  %OWNINTEGER  PRINT=0
      %TRUE %IF LAST PRINT = 0;       ! PRINT LIST EMPTY
      %IF LINE # 0 %START;  ! FOR SPEED:-  NOT AT START OF PAGE SO
         %FALSE %IF PRINT = 0;   ! SIMPLY REPEAT PREVIOUS DECISION
         %TRUE
      %FINISH
      P == PRINT LIST(NEXT PRINT)
      %IF SECTNO*PPS+PAGENO > P_SECTION*PPS+P_PAGE %START
         NEXT PRINT = NEXT PRINT+1
         %STOP %IF NEXT PRINT > LAST PRINT
         P == PRINT LIST(NEXT PRINT)
      %FINISH
      %IF P_SECTION = SECTNO %AND (P_PAGE = PAGENO %OR P_PAGE = PPS-1) %START
         PRINT = 1;  %TRUE
      %FINISH
      PRINT = 0;  %FALSE
   %END

   %ROUTINE READCH(%INTEGERNAME CH)
      %OWNINTEGER E = 0
      %on 9 %start
         ->ended
      %finish
      %CYCLE
         %if e = 0 %start
            read symbol(ch)
            at line = at line+1 %if ch = nl
            %return
         %finish
Ended:   at line = 1
         %if include file # "" %start
            close input;  select input(sin)
            include file = ""
            at line = old at line
            inclusion mode = |inclusion mode|
            %continue
         %finish
         %IF SIN#LSIN %START
            SIN = SIN+1; SELECTINPUT(SIN)
         %ELSE
            E =     NL %IF E='E'
            E =    'E' %IF E=escape
            E = escape %IF E=0
            CH = E; %RETURN
         %FINISH
      %REPEAT
   %END
  %ROUTINE FAULT(%INTEGER N)
  %SWITCH S(1:17)
    SELECTOUTPUT(ERR)
   print symbol('*')
   %if include file # "" %start
      print string("file ");  print string(include file)
      space
   %finish
   print string("line");  write(at line,3);  print string(": ")
    ->S(N)
S(1):
    PRINTSTRING("FAULTY FORMAT AT ")
    PRINTSYMBOL(NEXT)
    ->A9
S(2):
    PRINTSTRING("INVALID ASSIGNMENT TO SYMBOL PARAMETER");  ->A9
S(3):
    PRINTSTRING("UNKNOWN NAME");  ->A9
S(4):
    PRINTSTRING("SCALAR/VECTOR MISMATCH");  ->A9
S(5):
    PRINTSTRING("UNKNOWN DIRECTIVE ");  ->A8
S(6):
    PRINTSTRING("SPURIOUS DIRECTIVE ");  ->A8
S(7):
    PRINTSTRING("OUT OF BOUNDS ");  ->A8
S(8):
    PRINTSTRING("OFF PAGE ");  ->A8
S(9):
    PRINTSTRING("OVER TEXT ");  ->A8
S(10):
    PRINTSTRING( %C
       "TOO MANY PARAMETER VALUES NESTED - RUN ABANDONED")
    ->A9
S(11):
    PRINTSTRING("NO VALUE STORED ");  ->A9
S(12):
    PRINT STRING("MISPLACED DIRECTIVE ");  -> A8
S(13):
   PRINT STRING("TOO MANY PRINT VALUES");  -> A9
S(14):
   PRINT STRING("DUPLICATE PRINT REQUEST");  -> A9
s(15):
   print string("Unknown output type = ");  print string(output ident)
   -> A9
s(16):
   print string("Nested - INCLUDE=");  print string(include file)
   -> A9
s(17):
   print string("$X:  index atom missing?")
   -> A9
A8: PRINTSYMBOL(DIRECTIVE)
    PRINTSYMBOL(RELIND) %IF RELIND#0
A9: ERRIND=1
    NEWLINE
  %END
   %integerfn  output name(%string(35)  name)
      %integer  j,k,sym
      j = 0
      %for k = 1,1,length(name) %cycle
         sym = charno(name,k)
         %if sym # ' ' %start
            sym = sym-'a'+'A' %if 'a' <= sym <= 'z'
            j = j+1;  charno(name,j) = sym
         %finish
      %repeat
      length(name) = j
      %result = printer %if j = 0
      %for k = 1,1,output types %cycle
         %result = k %if operating mode(k) = name
      %repeat
      fault(15);               ! unknown output type
      %result = printer;       ! default it
   %end
  %ROUTINE READ ATOM OR DIRECTIVE
  %INTEGER K,C,U,ATOMCAPIND,ATOMUNDIND
  %INTEGER STATOM
  %SWITCH SW(0:8)
    %IF NEXT=0 %THEN READCH(K) %ELSE K=NEXT %AND NEXT=0
    DIRECTIVE=0;  SIZE=0
    %IF IGNORE#0 %THEN %START
      %CYCLE
        READCH(K) %WHILE K#ESCAPE
        READCH(K)
        DIRECTIVE=K&LETMASK
        %IF DIRECTIVE='A' %OR DIRECTIVE='E' %C
           %THEN READCH(NEXT) %AND %RETURN
        READCH(K)
      %REPEAT
    %FINISH
    %IF K&ESCBIT#0 %THEN %START;        ! DIRECTIVE READ IN LAST CALL.
      DIRECTIVE=K&LETMASK
      READCH(NEXT)
      %RETURN
    %FINISH
    ATOMCAPIND=LINECAPIND;  ATOMUNDIND=LINEUNDIND;  STATOM=0
    U=ATOMUNDIND;  C=ATOMCAPIND
    %CYCLE
      ->SW(TYPE(K&BASICMASK)&15)
SW(1):                                  ! CAPSH.  RECOGNISED AT START OF ATOM O
      ->TOBUFF %UNLESS STATOM=0;  STATOM=1
      ATOMCAPIND=CASEBIT;  C=CASEBIT
      ->LOOP
SW(2):                                  ! ESCAPE
      READCH(K);  K=K+ESCBIT
      ->TOBUFF %UNLESS 'A'<=K&LETMASK<='Z' %OR K&LETMASK = NL
      %EXIT %IF SIZE#0
      DIRECTIVE=K&LETMASK
      READCH(NEXT)
      %RETURN
SW(3):                                  ! CAP
      C=CASEBIT;  STATOM=1
      ->LOOP
SW(4):                                  ! UND
      U=UNDBIT;  STATOM=1
      READCH(K);  ->TOBUFF %IF K&BASICMASK=' '
      ->SW(TYPE(K&BASICMASK)&15)
SW(6):                                  ! UNDSH
      STATOM=1
      ATOMUNDIND=UNDBIT
      U=UNDBIT
      ->LOOP
SW(7):                                  ! SPACE OR NEWLINE
      %EXIT %IF K=NL %OR K!LINEUNDIND=' ';  ->TOBUFF
SW(8):                                  ! LETTERS
      K=K!!INVERT
      K=K-C %IF 'a'<=K&BASICMASK<='z'
!* NOTE THAT HERE 'a' AND 'z' ARE LOWER CASE.
SW(0):                                  ! EVERYTHING ELSE
TOBUFF:
      STATOM=1;  SIZE=SIZE+1;  ABUFF(SIZE)=K!U
      U=ATOMUNDIND;  C=ATOMCAPIND
LOOP: READCH(K)
    %REPEAT
    NEXT=K
    %RETURN %IF ATOMUNDIND=0 %OR SIZE=0
!* REMOVES UNDERLINE FROM TERMINATING PUNCTUATION - BUT NOT IF SET BY UND
    K=ABUFF(SIZE)!!UNDBIT
    ABUFF(SIZE)=K %IF K='.' %OR K=',' %OR K=':' %OR K=';' %C
       %OR K=')' %OR K='!' %OR K='?'
  %END
  %ROUTINE PRINTSOURCELINE
  %INTEGER I
    %IF ERRIND#0 %START
      SELECTOUTPUT(ERR)
      I=0
      I=I+1 %AND PRINTSYMBOL(SBUFF(I)) %WHILE I#SMAX
      NEWLINE
      ERRIND=0
    %FINISH
    SMAX=0 %AND %RETURN %IF output type # update %or inclusion mode < 0
    SELECTOUTPUT(out)
    I=0
    I=I+1 %AND PRINTSYMBOL(SBUFF(I)) %WHILE I#SMAX
    NEWLINE;  SMAX=0
  %END
  %ROUTINE STORE(%INTEGER K)
    SMAX=SMAX+1;  SBUFF(SMAX)=K
  %END
%routine nstore(%integer  n)
   %routine strip
      %integer  k
      k = rem(n,10)
      n = (n-k)//10
      strip %if n # 0
      store(k+'0')
   %end
   strip;  store(' ')
%end;      !  ... of NSTORE
  %ROUTINE STORESOURCEATOM
!* IN GENERAL, THE UNDERLINE AND CAPITALISE OUTPUT PARAMETERS ARE USED
!* IF NOT DISABLED.  ALL LETTERS ARE SET TO LOWER CASE, WITH
!* APPROPRIATE SYMBOL PARAMETERS, AND THEN INVO IS APPLIED.  THIS
!* SWITCHES THEM BACK, IF INVO IS NON-ZERO, TO U.C.
!* IF AN OUTPUT DEVICE ACCEPTED THE 8TH BIT SET AS SIGNIFYING UNDERLINING,
!* SETTING UNDO AND UNDSHO TO 0 WOULD CAUSE THE 8TH BIT TO BE SET TO
!* SIGNIFY UNDERLINING.
  %INTEGER I,K,ATOMCAPIND,ATOMUNDIND
    %ROUTINE TRANSLATEUNDERLINE
    %INTEGER P,Q
      K=K-UNDBIT %AND %RETURN %IF LINEUNDIND#0
      ->ONE %IF K-UNDBIT=' '
      K=K-UNDBIT %AND %RETURN %IF ATOMUNDIND#0
      ->ONE %IF UNDSHO=0
      P=I
      %WHILE P#SIZE %CYCLE
        P=P+1;  Q=ABUFF(P)
        ->ONE %IF Q&UNDBIT=0 %AND (P#SIZE %OR (Q#'.' %C
           %AND Q#',' %AND Q#':' %AND Q#';' %AND Q#')' %C
           %AND Q#'!' %AND Q#'?'))
      %REPEAT
      STORE(UNDSHO);  K=K-UNDBIT;  ATOMUNDIND=1
      %RETURN
ONE:  %RETURN %IF UNDO=0
      STORE(UNDO);  K=K-UNDBIT
    %END
   %return %if output type # update %or inclusion mode < 0
    %IF SMAX#0 %AND XLINES=0 %START
      %IF SMAX+SIZE+1<=SLINE %THEN STORE(' ') %C
         %ELSE PRINTSOURCELINE
    %FINISH
    ATOMCAPIND=0;  ATOMUNDIND=0
    %IF LINECAPIND=0 %AND CAPSHO#0 %AND SIZE>=2 %START
      %CYCLE I=1,1,SIZE
        K=ABUFF(I)&BASICMASK
        ATOMCAPIND=0 %AND %EXIT %IF 'A'<=K-CASEBIT<='Z'
                                        !LC
        ATOMCAPIND=1 %IF 'A'<=K<='Z';   !UC
      %REPEAT
    %FINISH
    STORE(CAPSHO) %IF ATOMCAPIND#0
    %CYCLE I=1,1,SIZE
      K=ABUFF(I)
      TRANSLATEUNDERLINE %IF K&UNDBIT#0
      K=K+CASEBIT %IF 'A'<=K<='Z' %AND (LINECAPIND#0 %C
         %OR ATOMCAPIND#0)
      STORE(CAPO) %AND K=K+CASEBIT %IF 'A'<=K<='Z' %AND CAPO#0
      K=K!!INVERTO %IF 'A'<=K&LETMASK<='Z'
      STORE(ESCAPE) %IF K&ESCBIT#0
      STORE(K&CHARMASK)
    %REPEAT
  %END
  %ROUTINE SETCOLUMN(%INTEGER M)
!* THIS MOVES TO COL M-1 SO THAT THE NEXT ATOM STARTS AT COL M.
!* FIXED IS SET TO SUPPRESS A SPACE BEING INSERTED BEFORE THAT ATOM, AND
!* TO INHIBIT JUSTIFICATION TO THE LEFT OF THIS POINT.
!* ON ENTRY, COLS GIVES THE LAST COLUMN USED.
    %IF 1<=M<=LINE %START
      M=M-1
      %IF M>COLS %START
        COLS=COLS+1 %AND BUFF(COLS)=' ' %UNTIL COLS=M
      %FINISH %ELSE %START
        %WHILE COLS#M %CYCLE
          FAULT(9) %AND %EXIT %IF BUFF(COLS)#' '
          COLS=COLS-1
        %REPEAT
        LHM = COLS+1
      %FINISH
    %FINISH %ELSE %START
      FAULT(8);  INDENTCOL=1 %IF INDENTCOL=M
    %FINISH
    FIXED=COLS;  GAPS=0;  SGAPS=0
  %END
  %ROUTINE MARKDOC
 %INTEGER  J;  %CONSTINTEGER  BELL = 7
    %IF MARK=1 %START
      PRINTSYMBOL('=');  SPACES(LINE-2);  PRINTSYMBOL('=')
      NEWLINE
   %ELSE %IF MARK = 2
      PRINTSYMBOL(12)
   %ELSE %IF MARK = 3
      SELECT OUTPUT(ERR)
      J = 8
      PRINT SYMBOL(BELL) %AND J = J-1 %UNTIL J = 0;  NEWLINE
      SELECT OUTPUT(out)
      SELECT INPUT(command stream)
      SKIP SYMBOL %WHILE NEXT SYMBOL # NL
      SKIP SYMBOL
      SELECT INPUT(SIN)
   %FINISH
  %END
  %ROUTINE RESETDOCLINE
    %IF XLINES#0 %START
      XLINES=XLINES-1
      %IF XLINES=0 %START
        LINECAPIND=0;  LINEUNDIND=0
        LINEMIDIND=0;  INDENTIND=1
      %FINISH
    %FINISH
   LHM = 1
    TEXTCOLS=0;  COLS=0;  FIXED=0;  XPAGE=0
    SETCOLUMN(INDENTCOL) %IF INDENTIND#0
  %END
  %ROUTINE PRINTLPLINE
  %CONST %INTEGER CR=13
  %INTEGER I,J,K,L,M,U,V
   ! method of underlining changed to suit Pragma printer
   %integer  ul = 0
    %IF PAGES+1>=START %AND TO BE PRINTED(LINES-NLS) %START
      SELECTOUTPUT(out)
      %IF LINES=NLS %START
        MARKDOC %IF MARK#0
        NEWLINES(TOP)
      %FINISH
      %IF TEXTCOLS#0 %START
        L=LEFT
        L=L+(LINE-COLS)//2 %IF LINEMIDIND#0
        SPACES(L)
        U=UNDBIT;  V=BASICMASK
        U=0 %AND V=CHARMASK %IF ASCII=0
        %CYCLE I=1,1,COLS
          K=BUFF(I)
          ul = i %if k & undbit # 0
          PRINTSYMBOL(K&V)
        %REPEAT
        %if ul # 0 %start
           printsymbol(CR)
           spaces(l)
           %for i = 1,1,ul %cycle
              k = ' '
              k = '_' %if buff(i) & undbit # 0
              print symbol(k)
           %repeat
        %finish
      %FINISH
      NEWLINES(NLS)
      %IF LINES>=PAGE %AND BOTTOM#0 %START
        %IF PAGENO=0 %START
          NEWLINES(BOTTOM)
        %FINISH %ELSE %START
          I=BOTTOM//2
          NEWLINES(I)
          SPACES(LEFT+LINE//2-4)
         %IF SECTNO#0 %START
            WRITE(SECTNO,1); WRITE(-PAGENO,1)
         %FINISHELSE WRITE(PAGENO,1)
          NEWLINES(BOTTOM-I)
        %FINISH
      %FINISH
    %FINISH
  %END
  %ROUTINE PRINTDIABLOLINE
%endoflist
!!    %INTEGER LI,L,K,I,J,DIR,P,PLAST
!!    %OWNINTEGER VDIFF=0, HDIFF=0, VPOS=0, HPOS=0, OLDCOL=0
!!   %CONSTINTEGER HOLD = 240;   ! 128+64+48
!!   %CONSTINTEGER MLEFT=212;   !128+64+16+4
!!   %CONSTINTEGER MRIGHT= 208;   !128+64+16
!!   %CONSTINTEGER DOWN= 224;   !128+64+32
!!%CONSTINTEGER  ESC=27, HT=9, VT=11, FF=12, GRAPHICS ON='6'
!!   %ROUTINE SET GRAPHICS MODE
!!      PRINT SYMBOL(ESC);  PRINT SYMBOL(GRAPHICS ON)
!!   %END
!!   %ROUTINE MOVE
!!      %IF HDIFF#0 %START
!!         HPOS = HPOS+HDIFF;  HDIFF = 0
!!         PRINT SYMBOL(ESC);  PRINT SYMBOL(HT);  PRINT SYMBOL(HPOS)
!!      %FINISH
!!      %IF VDIFF#0 %START
!!         VPOS = VPOS+VDIFF;  VDIFF = 0
!!         PRINT SYMBOL(ESC);  PRINT SYMBOL(VT);  PRINT SYMBOL(VPOS)
!!      %FINISH
!!   %END
!!   %ROUTINE DRESET
!!      PRINTSYMBOL(MRIGHT); PRINTSYMBOL(0)
!!      PRINTSYMBOL(DOWN); PRINTSYMBOL(0)
!!   %END
!!   %ROUTINE DSPACES(%INTEGER N)
!!      HDIFF = HDIFF+(60//DCPI)*N
!!   %END
!!   %ROUTINE DNEWLINES(%INTEGER N)
!!      VDIFF = VDIFF+N*(48//DLPI)
!!   %END
!!   %ROUTINE DCR
!!      HDIFF = -HPOS
!!   %END
!!   %ROUTINE DNEWPAGE
!!      HDIFF = -HPOS
!!      VDIFF = (DPAGE*12)//25-VPOS
!!      VDIFF = 0 %IF VDIFF<0
!!      MOVE
!!      VPOS = 0
!!      PRINTSYMBOL(HOLD) %IF PAGES#FINISH
!!   %END
!!   %ROUTINE DINCSP(%INTEGER N)
!!      HDIFF = HDIFF+N
!!      HDIFF = HDIFF-N-N %IF DIR<0
!!   %END
!!   %ROUTINE DPRINTCH(%INTEGER C)
!!      %IF DIR<0 %THEN HDIFF = HDIFF-60//DCPI
!!      %IF C#' ' %START
!!         MOVE; PRINTSYMBOL('_') %IF C&UNDBIT#0
!!         C = C&127
!!         PRINTSYMBOL(C) %IF C#' '
!!      %FINISH
!!      %IF DIR>0 %THEN HDIFF = HDIFF+60//DCPI
!!   %END
!!   %ROUTINE DWRITE(%INTEGER N)
!!      %INTEGER M
!!      M = N//10; N = N-M*10
!!      DWRITE(M) %IF M#0; DPRINTCH('0'+N)
!!   %END
!!
!!   LI = LINES+NLS; DIR = 1
!!   %IF PAGES+1>=START %AND TO BE PRINTED(LINES) %START
!!      SELECTOUTPUT(out)
!!      %IF LI=NLS %START
!!         %IF PAGES = 0 %START
!!            PRINT SYMBOL(FF);  SET GRAPHICS MODE
!!         %ELSE
!!            DNEWPAGE
!!         %FINISH
!!         DRESET; OLDCOL = 0
!!         VDIFF = (DTOP*48)//100
!!         DNEWLINES(TOP)
!!      %FINISH
!!      %IF TEXTCOLS#0 %START
!!         DCR; HDIFF = HDIFF+(DLEFT*60)//100
!!         L = LEFT
!!         %IF LINEMIDIND#0 %START
!!            L = LINE-COLS
!!            DINCSP(30//DCPI) %IF L&1#0
!!            L = LEFT+L//2
!!         %FINISH
!!         DSPACES(L)
!!         %IF LHM-OLDCOL>OLDCOL-COLS %START
!!            DIR = 1; P = LHM; PLAST = DBUFFP+1
!!            DSPACES(LHM-1)
!!            %IF PLAST=1 %THEN PLAST = COLS+1
!!         %ELSE
!!            DIR = -1; P = DBUFFP; PLAST = LHM-1
!!            %IF P=0 %THEN P = COLS %AND DSPACES(P) %C
!!            %ELSE DSPACES(LINE)
!!         %FINISH
!!         %WHILE P#PLAST %CYCLE
!!            %IF DBUFFP=0 %THEN K = BUFF(P) %ELSE K = DBUFF(P)
!!            OLDCOL = P
!!            P = P+DIR
!!            %IF K&JUSTBIT#0 %THEN DINCSP(K-JUSTBIT) %C
!!            %ELSE DPRINTCH(K&511)
!!         %REPEAT
!!      %FINISH
!!      DNEWLINES(NLS)
!!      DIR = 1
!!      %IF LI>=PAGE %AND BOTTOM#0 %START
!!         %IF PAGENO#0 %START
!!            DNEWLINES(BOTTOM//2); DCR; HDIFF = HDIFF+(DLEFT*60)//100
!!            I = 1; I = 2 %IF PAGENO>=10
!!            I = 3 %IF PAGENO>=100; I = 4 %IF PAGENO>=1000
!!            I = I+2 %IF SECTNO#0; I = I+1 %IF SECTNO>=10
!!            DSPACES(LEFT); DSPACES((LINE-I)//2)
!!            DINCSP(30//DCPI) %IF I&1#0
!!            %IF SECTNO#0 %START
!!               DWRITE(SECTNO); DPRINTCH('-')
!!            %FINISH
!!            DWRITE(PAGENO)
!!         %FINISH
!!      %FINISH
!!   %FINISH
!!   DBUFFP = 0
%list
%END
  %ROUTINE PRINTDOCLINE
      lines = lines + nls
      %if output type = printer %start
         print LP line
      %else %if output type = daisy
         print diablo line
      %finish
      %if lines >= page %start
         lines = 0;  pages = pages+1
         page no = page no + 1 %if page no # 0
      %finish
      reset doc line
   %END
  %ROUTINE JUSTIFY
  %OWN %INTEGER FLIP=0
  %INTEGER I,J,K,L,MIN,COUNT,SCOUNT,AWAIT,SWAIT,AGAPS
  %INTEGER DX1,DX2,DX3
    COUNT=LINE-COLS
    %RETURN %IF COUNT<=0 %OR GAPS=0
%endoflist
!!!! JUSTIFY FOR DIABLO
!!!    SCOUNT = COUNT*(60//DCPI);        !EXTRA SIXTIETHS
!!!    DX1 = SCOUNT//GAPS;               !EXTRA PER GAP
!!!    DX2 = SCOUNT-DX1*GAPS;            !REMAINDER
!!!    DX3 = 0
!!!    %IF DX2>SGAPS %START;             !CANT FIT REST IN SGAPS
!!!       DX3 = DX2-SGAPS; DX2 = SGAPS
!!!    %FINISH
!!!    AGAPS = GAPS
!!!    %CYCLE I = COLS,-1,1
!!!       K = BUFF(I)
!!!       %IF AGAPS>0 %START
!!!          %IF K=SENTSP %OR K=' ' %START
!!!             AGAPS = AGAPS-1
!!!             J = JUSTBIT+DX1+60//DCPI
!!!             %IF K=SENTSP %AND DX2>0 %START
!!!                DX2 = DX2-1; J = J+1
!!!             %FINISH
!!!             %IF DX3>0 %START
!!!                DX3 = DX3-1; J = J+1
!!!             %FINISH
!!!             K = J
!!!          %FINISH
!!!       %FINISH
!!!       DBUFF(I) = K
!!!    %REPEAT
    DBUFFP = COLS
%list
    AGAPS=GAPS-SGAPS;                   ! ATOM GAPS
    MIN=COUNT//GAPS;                    ! MIN NO OF SPACES TO BE ADDED TO EVERY
    COUNT=COUNT-MIN*GAPS;               ! SPACES TO BE ADDED AS WELL AS MIN AT 
!* SENTENCE GAPS ARE FILLED IN PREFERENCE TO ATOM GAPS.
    SCOUNT=SGAPS;  SCOUNT=COUNT %IF COUNT<SGAPS
    COUNT=COUNT-SCOUNT;                 ! COUNT IS NOW NO OF SPACES FOR ATOM GA
    FLIP=1-FLIP
    %IF FLIP#0 %START;                  ! EXTRA SPACES FROM RH END.
      AWAIT=0;  SWAIT=0
!* NOS OF ATOM AND SENTENCE GAPS TO BE PASSED BEFORE INSERTION BEGINS.
    %FINISH %ELSE %START
      AWAIT=AGAPS-COUNT;  SWAIT=SGAPS-SCOUNT
    %FINISH
    J=LINE;                             ! BUFF(J) TO BE OUTPUT TO.
    %CYCLE I=COLS,-1,1
      K=BUFF(I)
      %IF (K=SENTSP %OR K=' ') %AND BUFF(I-1)#K %START
!* SECOND TEST PREVENTS GAPS FROM BEING PADDED MORE THAN ONCE.
        L=J-MIN
        %IF K=SENTSP %START;            ! SENTENCE GAPS
          %IF SWAIT=0 %START
            L=L-1 %AND SCOUNT=SCOUNT-1 %IF SCOUNT#0
          %FINISH %ELSE SWAIT=SWAIT-1
        %FINISH %ELSE %START;           ! ATOM GAP
          %IF AWAIT=0 %START
            L=L-1 %AND COUNT=COUNT-1 %IF COUNT#0
          %FINISH %ELSE AWAIT=AWAIT-1
        %FINISH
        BUFF(J)=' ' %AND J=J-1 %WHILE J#L
                                        ! SPACES INSERTED
        COLS=LINE %AND %RETURN %IF J=I
      %FINISH
      BUFF(J)=K;  J=J-1
    %REPEAT
  %END
  %ROUTINE PLACEATOM
  %INTEGER I,L,S
    %IF COLS#FIXED %AND XLINES=0 %START
      L=COLS+1;  S=' '
      %IF (BUFF(COLS)='.' %OR BUFF(COLS)='?' %C
         %OR BUFF(COLS)='!') %AND 'A'<=ABUFF(1)<='Z' %START
        L=COLS+SGAP;  S=SENTSP
      %FINISH
      %IF L+SIZE<=LINE %START
        COLS=COLS+1 %AND BUFF(COLS)=S %WHILE COLS#L
        GAPS=GAPS+1;  SGAPS=SGAPS+1 %IF S=SENTSP
      %FINISH %ELSE %START
        JUSTIFY %IF JUST#0
        PRINTDOCLINE
        PRINTSOURCELINE %IF SMAX#0
      %FINISH
    %FINISH
    I=0
    %WHILE I#SIZE %CYCLE
      COLS=COLS+1;  I=I+1
      BUFF(COLS)=ABUFF(I)
    %REPEAT
    TEXTCOLS=COLS
  %END
  %ROUTINE PROCESSDIRECTIVE
  %INTEGER C,T
  %SWITCH S('A':'Z')
  %ROUTINE %SPEC ASSIGN
    %ROUTINE SKIP
      SMAX=SMAX+1;  SBUFF(SMAX)=NEXT
      READCH(NEXT)
    %END
    %ROUTINE READNUM
      RELIND=0;  NUM=1
      RELIND=NEXT %AND SKIP %IF NEXT='+' %OR NEXT='-'
      %IF '0'<=NEXT<='9' %START
        NUM=NEXT-'0';  SKIP
        NUM=10*NUM-'0'+NEXT %AND SKIP %WHILE '0'<=NEXT<='9'
      %FINISH
      NUM=-NUM %IF RELIND='-'
    %END
    %IF XLINES#0 %START
      FAULT(6) %IF XLINES>0 %OR TEXTCOLS#0
!* I.E. FAULT IF $L NOT FINISHED OR, WITH $L0, OFF LHM, WHEN
!*      DIRECTIVE ENCOUNTERED.
      XLINES=1;  RESETDOCLINE
    %FINISH
      %IF DIRECTIVE = NL %START
         STORE(' ') %IF SMAX # 0;  STORE(ESCAPE)
      %FINISH
    %IF TEXTCOLS#0 %AND 'C'#DIRECTIVE#'T' %and directive # 'X' %START
      JUSTIFY %IF JUST#0 %AND DIRECTIVE='J'
      PRINTDOCLINE
      PRINTSOURCELINE %IF SMAX#0
    %FINISH
    PRINTSOURCELINE %IF SMAX+5>SLINE
   %RETURN %IF DIRECTIVE = NL
    STORE(' ') %IF SMAX#0
    STORE(ESCAPE);  STORE(DIRECTIVE)
    READNUM %if directive # 'X';      !cross-ref?
    ->S(DIRECTIVE)
S('A'):                                 !ASSIGN
    %CYCLE
      ASSIGN
      SKIP %WHILE NEXT#';' %AND NEXT#NL
      %EXIT %IF NEXT=NL
      SKIP
    %REPEAT
    INVERT=32 %IF INVERT#0;  INVERTO=32 %IF INVERTO#0
    PAGE=9999 %IF PAGE<=0
    FAULT(7) %AND INDENT=0 %UNLESS 0<=INDENT<=TBOUND
    INDENTCOL=TAB(INDENT)
    SETCOLUMN(INDENTCOL)
    ->S('N') %IF IGNORE#0
    %RETURN
S('B'):                                 !BLANKS
    %IF LINES#0 %OR XPAGE#0 %START;     ! NOTE XPAGE SET BY $N TO 1.
      NUM=(NUM-xpage)*NLS;      ! n-1 IFF after forcible page turn
      NUM=PAGE-LINES %IF PAGE-LINES<NUM
      PRINTDOCLINE %AND NUM=NUM-NLS %WHILE NUM>0
    %FINISH
    %RETURN
S('C'):                                 !COL
    NUM=COLS+1+NUM %IF RELIND#0
    SETCOLUMN(NUM)
    %RETURN
S('E'):                                 !END
    PRINTDOCLINE %WHILE LINES#0 %AND PAGE<999
    FINISH=PAGES;  NEXT=NL
    %RETURN
S('I'):                                 !INDENT
    NUM=INDENT+NUM %IF RELIND#0
    FAULT(7) %AND NUM=0 %UNLESS 0<=NUM<=TBOUND
    NUM=TAB(NUM)
    SETCOLUMN(NUM)
    %RETURN
S('J'):                                 !JUSTIFY (DONE)
    %RETURN
S('L'):                                 !LINES
    XLINES=NUM;  XLINES=-1 %IF XLINES=0
    INDENTIND=0
    %WHILE NEXT#NL %CYCLE
      LINECAPIND=CASEBIT %IF NEXT&LETMASK='C'
      LINEUNDIND=UNDBIT %IF NEXT&LETMASK='U'
      LINEMIDIND=1 %IF NEXT&LETMASK='M'
      INDENTIND=1 %IF NEXT&LETMASK='I'
      SKIP
    %REPEAT
    COLS=0 %AND FIXED=0 %IF INDENTIND=0
    %RETURN
S('N'):                                 !NEWPAGE
S('S'):
    %RETURN %IF PAGE>=999
    PRINTDOCLINE %WHILE LINES#0
    XPAGE=1
    %IF DIRECTIVE='S' %AND SECTNO # 0 %START
      SECTNO = SECTNO+1 %IF SECTNO # 0; PAGENO=1
    %FINISH
    %RETURN
S('P'):                                 !PARAGRAPH
    %IF LINES#0 %START
      NUM=NUM*NLS
      NUM=PAGE-LINES %IF PAGE-LINES<NUM+2
      PRINTDOCLINE %AND NUM=NUM-NLS %WHILE NUM>0
    %FINISH
    SETCOLUMN(COLS+1+PGAP)
    %RETURN
S('T'):                                 !TAB
    %IF RELIND#0 %START
      T=0;  C=COLS+1
      %IF RELIND='+' %START
        %WHILE NUM>0 %CYCLE
          T=T+1 %UNTIL T>TBOUND %OR TAB(T)>C
          FAULT(7) %AND %RETURN %IF T>TBOUND
          C=TAB(T)
          NUM=NUM-1
        %REPEAT
      %FINISH %ELSE %START
        T=T+1 %UNTIL T>TBOUND %OR TAB(T)>=C
        %WHILE NUM<0 %CYCLE
          T=T-1 %UNTIL T<0 %OR TAB(T)<C
          FAULT(7) %AND %RETURN %IF T<0
          C=TAB(T)
          NUM=NUM+1
        %REPEAT
      %FINISH
    %FINISH %ELSE %START
      FAULT(7) %AND %RETURN %UNLESS 0<=NUM<=TBOUND
      C=TAB(NUM)
    %FINISH
    SETCOLUMN(C)
    %RETURN
S('V'):                                 !VERIFY
    %IF PAGE-LINES<NUM*NLS %START
      PRINTDOCLINE %WHILE LINES#0
      XPAGE=1
    %FINISH
    %RETURN
s('X'):                  !INDEX
      smax = smax-2 %if output type # update;   ! delete '$X'
      next = 0 %if next = ' ' %or next = NL
      read atom or directive;         ! get index atom
      fault(17) %and %return %if directive # 0;      ! it's missing
      %if output type = index %start
         smax = 0;            ! ensure this 'source' output is blank
         nstore(sect no);  nstore(page no)
         output type = update
         store source atom;  print source line
         output type = index
      %else %if output type = update
         store source atom
      %finish
      size = 0 %if output type # update;      ! delete index atom
      %return
S('D'):               ! ***** change to DUMP DEFAULTS ******
S('F'):
S('G'):
S('H'):
S('K'):
S('M'):
S('O'):
S('Q'):
S('R'):
S('U'):
S('W'):
S('Y'):
S('Z'):
    FAULT(5)
    %ROUTINE NEWCELL(%INTEGER H, %INTEGER %NAME T)
    %INTEGER P
      %IF FREELIST=0 %START
        FAULT(10)
        PRINTSOURCELINE
        %STOP
      %FINISH
      P=FREELIST;  FREELIST=HEAD(FREELIST)
      HEAD(P)=H;  TAIL(P)=T
      T=P
    %END
    %ROUTINE POP(%INTEGER %NAME L)
      HEAD(L)=FREELIST;  FREELIST=L
      L=TAIL(L)
    %END
    %ROUTINE ASSIGN
    %CONST %INTEGER NAMEMAX=40
    %INTEGER I,J,K,L,M,SWOP
   %RECORD(PRINTFM)%NAME  P,Q
    %ROUTINE %SPEC READNAME(%INTEGER %NAME ORDINAL)
    %INTEGER %MAP %SPEC MAP(%INTEGER I)
   %ROUTINESPEC  READ N(%SHORTINTEGERNAME  N)
   %routinespec  read string(%string(35)%name  s)
      READNAME(I);  %RETURN %IF I=0
      SKIP %WHILE NEXT=' '
   %IF LINES # 0 %START;        ! LINES ON CURRENT PAGE
      %IF 11 <= I <= 16 %START
         FAULT(12);           ! MISPLACED DIRECTIVE
      %FINISH
   %FINISH
   %IF I = 36 %START;           ! PRINT
      FAULT(1) %AND %RETURN %IF NEXT # '='
      %CYCLE
         SKIP;            ! either = or ,
         %IF LAST PRINT = PRINT MAX %THEN FAULT(13) %ELSE  %C
                                 LAST PRINT = LAST PRINT + 1
         P == PRINT LIST(LAST PRINT)
         READN(P_SECTION)
         SKIP %WHILE NEXT = ' '
         %IF NEXT = '-' %START
            SKIP %UNTIL NEXT # ' '
            %IF NEXT = '*' %START
               SKIP;  P_PAGE = PPS-1
            %ELSE
               READN(P_PAGE)
            %FINISH
         %ELSE
            P_PAGE = P_SECTION
            P_SECTION = 0
         %FINISH
         SKIP %WHILE NEXT = ' '
         %EXIT %IF NEXT # ','
      %REPEAT
      %CYCLE
         SWOP = 0;  Q == PRINT LIST(1)
         %FOR K = 2,1,LAST PRINT %CYCLE
            P == Q;  Q == PRINT LIST(K)
            %IF P_SECTION*PPS+P_PAGE >= Q_SECTION*PPS+Q_PAGE %START
               L = P_SECTION;  M = P_PAGE
               P_SECTION = Q_SECTION;  P_PAGE = Q_PAGE
               Q_SECTION = L;  Q_PAGE = M
               SWOP = 1
            %FINISH
         %REPEAT
         %EXIT %IF SWOP = 0
      %REPEAT
      %FOR J = 1,1,LAST PRINT-1 %CYCLE
         P == PRINT LIST(J);  Q == PRINT LIST(J+1)
         %IF P_SECTION = Q_SECTION %AND P_PAGE = Q_PAGE %START
            FAULT(14);  %RETURN
         %FINISH
      %REPEAT
      %RETURN
   %else %if i = 37;               ! INCLUDE file
      fault(1) %and %return %if next # '=';  skip
      fault(16) %if include file # "";      ! already including
      read string(include file)
      include stream = lsin;  include stream = 1 %if sin # 1;  !**** LSIN > 1???
      open input(include stream, include file)
      select input(include stream)
      old at line = at line;  at line = 1
      %if inclusion mode = 0 %start;         ! literal merge into update
         smax = 0;   ! delete INCLUDE line
      %else
         print source line;     ! copy INCLUDE line
         inclusion mode = -1;   ! don't copy body to update
      %finish
      %return
   %else %if i = 38;               ! define OUTPUT type
      fault(1) %and %return %if next # '=';  skip
      read string(output ident)
      %if pages = 0 = lines %start
         output type = output name(output ident)
      %else
         fault(12);               ! misplaced directive
      %finish
      %return
   %FINISH
      %IF NEXT='<' %OR NEXT='>' %START
        J=I
        %CYCLE
          %IF NEXT='<' %START
            NEWCELL(MAP(J),LINK(J))
          %FINISH %ELSE %START
            FAULT(11) %AND %RETURN %IF LINK(J)=0
            %IF 1<=J<=6 %AND TYPE(MAP(J))&15=J %START
              K=MAP(J)
              %CYCLE
                TYPE(K)=TYPE(K)>>4
                %EXIT %IF TYPE(K)=0 %OR MAP(TYPE(K)&15)=K
              %REPEAT
            %FINISH
            MAP(J)=HEAD(LINK(J))
            TYPE(MAP(J))=TYPE(MAP(J))<<4!J %IF 1<=J<=6
            POP(LINK(J))
          %FINISH
          J=J+1
          %EXIT %IF J<NAMEMAX %OR J>=65
        %REPEAT
        SKIP %UNTIL NEXT#' '
        %RETURN %IF NEXT=';' %OR NEXT=NL
      %FINISH
      FAULT(1) %AND %RETURN %IF NEXT#'='
      %CYCLE
        SKIP %UNTIL NEXT#' '
        %IF 'A'<=NEXT&LETMASK<='Z' %START
                                        ! RHS ALSO PARAMETER.
          READNAME(J);  %RETURN %IF J=0
        %FINISH %ELSE %START
          J=0
          %IF NEXT='''' %START
            SKIP;                       !QUOTEMARK
            NUM=NEXT;  SKIP;            !QUOTED SYMBOL
            SKIP;                       !QUOTEMARK (PRESUMABLY)
          %FINISH %ELSE %START
            READNUM
            NUM=MAP(I)+NUM %IF RELIND#0
          %FINISH
        %FINISH
        %IF 1<=I<=6 %AND TYPE(MAP(I))&15=I %START
          K=MAP(I)
!* MAP(I) IS CURRENTLY ACTIVE, I.E. ITS ENTRY IN TYPE REFERS TO IT.
          %CYCLE
            TYPE(K)=TYPE(K)>>4
            %EXIT %IF TYPE(K)=0 %OR MAP(TYPE(K)&15)=K
          %REPEAT
        %FINISH
        %CYCLE
          MAP(I)=MAP(J);                ! N.B. MAP(0)==NUM.
          TYPE(MAP(I))=TYPE(MAP(I))<<4!I %IF 1<=I<=6
          I=I+1;  J=J+1
          %EXIT %IF J<NAMEMAX
          %EXIT %IF I<NAMEMAX %OR I=65
        %REPEAT
        %EXIT %UNLESS NEXT=',' %AND I>NAMEMAX
      %REPEAT
      FAULT(1) %UNLESS NEXT=';' %OR NEXT=NL
      %routine read string(%string(35)%name  s)
         %integer  k,sym
         s = ""
         %cycle
            sym = next & 127;  %exit %if sym = ';' %or sym = NL
            skip
            %if sym # ' ' %start
               sym = sym-'a'+'A' %if 'a' <= sym <= 'z'
               s = s.tostring(sym) %if length(s) # 35
            %finish
         %repeat
      %end;      ! read string
      %routine  get(%integername  k)
         k = 0 %and %return %unless 'A' <= next & let mask <= 'Z'
         k = next & let mask;  skip
      %end
      %ROUTINE READNAME(%INTEGER %NAME ORDINAL)
      %string(7) ident
      %integer  sym
      %conststring(7)%array  name(1:name max) =
         "CAPSH",  "ESCAPE",  "CAP",    "UND",  "spare",   "UNDSH",
         "NLS", "SGAP",   "PGAP",    "INDENT", "TOP", "BOTTOM",
         "LEFT", "PAGE", "LINE", "SLINE", "INVERT", "CAPO",
         "UNDO", "CAPSHO", "UNDSHO", "INVERTO", "ASCII", "JUST",
         "MARK",  "START",  "FINISH",  "PAGENO", "IGNORE", "SECTNO",
         "DLPI", "DCPI", "DLEFT",  "DPAGE", "DTOP" ,"PRINT",
         "INCLUDE",      "OUTPUT",    "SPLAT",   "TAB"

         skip %while next=' '
         ident = ""
         %cycle
            get(sym);  %exit %if sym = 0
            ident = ident.tostring(sym) %if length(ident) # 7
         %repeat
         fault(1) %and ordinal = 0 %and %return %if ident = ""
         %for ordinal = 1,1,name max %cycle
            %return %if name(ordinal) = ident
         %repeat
         fault(3);  ordinal=0
      %END;                             !READ NAME
      %INTEGER %MAP MAP(%INTEGER I)
      %SWITCH S(0:NAME MAX)
        %RESULT ==TAB(I-(NAMEMAX-1)) %IF I>=NAMEMAX
        ->S(I)
S(0):   %RESULT ==NUM
S(1):   %RESULT ==CAPSH
S(2):   %RESULT ==ESCAPE
S(3):   %RESULT ==CAP
S(4):   %RESULT ==UND
S(6):   %RESULT ==UNDSH
S(7):   %RESULT ==NLS
S(8):   %RESULT ==SGAP
S(9):   %RESULT ==PGAP
S(10):  %RESULT ==INDENT
S(11):  %RESULT ==TOP
S(12):  %RESULT ==BOTTOM
S(13):  %RESULT ==LEFT
S(14):  %RESULT ==PAGE
S(15):  %RESULT ==LINE
S(16):  %RESULT ==SLINE
S(17):  %RESULT ==INVERT
S(18):  %RESULT ==CAPO
S(19):  %RESULT ==UNDO
S(20):  %RESULT ==CAPSHO
S(21):  %RESULT ==UNDSHO
S(22):  %RESULT ==INVERTO
S(23):  %RESULT ==ASCII
S(24):  %RESULT ==JUST
S(25):  %RESULT ==MARK
S(26):  %RESULT ==START
S(27):  %RESULT ==FINISH
S(28):  %RESULT ==PAGENO
S(29):  %RESULT ==IGNORE
S(30):  %RESULT ==SECTNO
S(31):  %RESULT == DLPI
S(32):  %RESULT == DCPI
S(33):  %RESULT == DLEFT
S(34):  %RESULT == DPAGE
S(35):  %RESULT == DTOP
   ! 36 = PRINT
   ! 37 = INCLUDE
   ! 38 = OUTPUT
s(39):   %signal 15,15
   ! 40 = TAB
s(*):   %result == num;           !  all the odds and sods
      %END;                             !MAP
      %ROUTINE  READ N(%SHORTINTEGERNAME  N)
         SKIP %WHILE NEXT = ' '
         N = 0
         %IF NEXT = '?' %START
            SKIP
         %ELSE
            %WHILE '0' <= NEXT <= '9' %CYCLE
               N = 10*N + NEXT - '0'
               SKIP
            %REPEAT
         %FINISH
      %END;            ! READ N
    %END;                               !ASSIGN
  %END;                                 !PROCESS DIRECTIVE

! =================== IT ALL STARTS HERE =====================
   %unless exists(in1) %start
      %if exists(in1.".lay") %start
         in1 = in1.".lay"
      %else
         printstring("* LAYOUT fails -- ".in1." does not exist")
         newline
         %stop
      %finish
   %finish
   open input(1, in1);  open output(1, out1)
   select input(1);  select output(1)
   output type = output name(parm)
   %if output type = printer %start
      print symbol(12);      ! initial page throw
   %else %if output type = merge
      inclusion mode = 0
      output type = update
   %else %if output type = index
      inclusion mode = 0
   %finish
   PROMPT(">")
  %CYCLE NUM=0,1,127;  TYPE(NUM)=0
  %REPEAT
  %CYCLE NUM='A',1,'Z';  TYPE(NUM)=8
  %REPEAT
  %CYCLE NUM='A'!32,1,'Z'!32;  TYPE(NUM)=8
  %REPEAT
  TYPE(CAPSH)=1;  TYPE(ESCAPE)=2;  TYPE(CAP)=3
  TYPE(UND)=4;  TYPE(UNDSH)=6
  TYPE(' ')=7;  TYPE(NL)=7
  SELECTINPUT(SIN)
  SELECTOUTPUT(out)
  %CYCLE FREELIST=1,1,65
    LINK(FREELIST)=0
  %REPEAT
  %CYCLE FREELIST=1,1,500
    HEAD(FREELIST)=FREELIST-1
  %REPEAT
  %WHILE PAGES<FINISH %CYCLE
    READATOMORDIRECTIVE
    %IF DIRECTIVE#0 %START
      PROCESSDIRECTIVE
    %FINISH %ELSE %START
      %IF SIZE#0 %START
        PLACEATOM
        STORESOURCEATOM
        NEXT=0 %IF NEXT=NL %AND XLINES=0
      %FINISH
      %IF XLINES#0 %START
        %IF NEXT=' ' %START
          STORE(NEXT)
          COLS=COLS+1;  BUFF(COLS)=' '
        %FINISH
        PRINTDOCLINE %IF NEXT=NL
      %FINISH
    %FINISH
    PRINTSOURCELINE %IF NEXT=NL
    NEXT=0 %IF NEXT=' ' %OR NEXT=NL
  %REPEAT
  PRINTDOCLINE
   %if output type = index %start
      print string("-1 -1  *end*");  newline;   ! a comprehensive terminator!
   %finish
%END %OF %PROGRAM
= 2,1,LAST PRINT %CYCLE
            P == Q;  Q == PRINT LIST(K)
            %IF P_SECTION*PPS+P_PAGE >= Q_SECTION*PPS+Q_PAGE %START
               L = P_SECTION;  M = P_PAGE
               P_SECTION = Q_SECTION;  P_PAGE = Q_PAGE
               Q_SECTION = L;  Q_PAGE = M
               SWOP = 1
            %FINISH
         %REPEAT
         %EXIT %IF SWOP = 0
      %REPEAT
      %FOR J = 1,1,LAST PRINT-1 %CYCLE
         P == PRINT LIST(J);  Q == PRINT LIST(J+1)
         %IF P_SECTION = Q_SECTION %AND P_PAGE = Q_PAGE %START
            FAULT(14);  %RETURN
         %FINISH
      %REPEAT
      %RETURN
   %else %if i = 37;               ! INCLUDE file
      fault(1) %and %return %if next # '=';  skip
      fault(16) %if include file # "";      ! already including
      read string(include file)
      include stream = lsin;  include stream = 1 %if sin # 1;  !**** LSIN > 1???
      open input(include stream, include file)
      select input(include stream)
      old at line = at line;  at line = 1
      %if inclusion mode = 0 %start;         ! literal merge into update
         smax = 0;   ! delete INCLUDE line
      %else
         print source line;     ! copy INCLUDE line
         inclusion mode = -1;   ! don't copy body to update
      %finish
      %return
   %else %if i = 38;               ! define OUTPUT type
      fault(1) %and %return %if next # '=';  skip
      read string(output ident)
      %if pages = 0 = lines %start
         output type = output name(output ident)
      %else
         fault(12);               ! misplaced directive
      %finish
      %return
   %FINISH
      %IF NEXT='<' %OR NEXT='>' %START
        J=I
        %CYCLE
          %IF NEXT='<' %START
            NEWCELL(MAP(J),LINK(J))
          %FINISH %ELSE %START
            FAULT(11) %AND %RETURN %IF LINK(J)=0
            %IF 1<=J<=6 %AND TYPE(MAP(J))&15=J %START
              K=MAP(J)
              %CYCLE
                TYPE(K)=TYPE(K)>>4
                %EXIT %IF TYPE(K)=0 %OR MAP(TYPE(K)&15)=K
              %REPEAT
            %FINISH
            MAP(J)=HEAD(LINK(J))
            TYPE(MAP(J))=TYPE(MAP(J))<<4!J %IF 1<=J<=6
            POP(LINK(J))
          %FINISH
          J=J+1
          %EXIT %IF J<NAMEMAX %OR J>=65
        %REPEAT
        SKIP %UNTIL NEXT#' '
        %RETURN %IF NEXT=';' %OR NEXT=NL
      %FINISH
      FAULT(1) %AND %RETURN %IF NEXT#'='
      %CYCLE
        SKIP %UNTIL NEXT#' '
        %IF 'A'<=NEXT&LETMASK<='Z' %START
                                        ! RHS ALSO PARAMETER.
          READNAME(J);  %RETURN %IF J=0
        %FINISH %ELSE %START
          J=0
          %IF NEXT='''' %START
            SKIP;                       !QUOTEMARK
            NUM=NEXT;  SKIP;            !QUOTED SYMBOL
            SKIP;                       !QUOTEMARK (PRESUMABLY)
          %FINISH %ELSE %START
            READNUM
            NUM=MAP(I)+NUM %IF RELIND#0
          %FINISH
        %FINISH
        %IF 1<=I<=6 %AND TYPE(MAP(I))&15=I %START
          K=MAP(I)
!* MAP(I) IS CURRENTLY ACTIVE, I.E. ITS ENTRY IN TYPE REFERS TO IT.
          %CYCLE
            TYPE(K)=TYPE(K)>>4
            %EXIT %IF TYPE(K)=0 %OR MAP(TYPE(K)&15)=K
          %REPEAT
        %FINISH
        %CYCLE
          MAP(I)=MAP(J);                ! N.B. MAP(0)==NUM.
          TYPE(MAP(I))=TYPE(MAP(I))<<4!I %IF 1<=I<=6
          I=I+1;  J=J+1
          %EXIT %IF J<NAMEMAX
          %EXIT %IF I<NAMEMAX %OR I=65
        %REPEAT
        %EXIT %UNLESS NEXT=',' %AND I>NAMEMAX
      %REPEAT
      FAULT(1) %UNLESS NEXT=';' %OR NEXT=NL
      %routine read string(%string(35)%name  s)
         %integer  k,sym
         s = ""
         %cycle
            sym = next & 127;  %exit %if sym = ';' %or sym = NL
            skip
            %if sym # ' ' %start
               sym = sym-'a'+'A' %if 'a' <= sym <= 'z'
               s = s.tostring(sym) %if length(s) # 35
            %finish
         %repeat
      %end;      ! read string
      %routine  get(%integername  k)
         k = 0 %and %return %unless 'A' <= next & let mask <= 'Z'
         k = next & let mask;  skip
      %end
      %ROUTINE READNAME(%INTEGER %NAME ORDINAL)
      %string(7) ident
      %integer  sym
      %conststring(7)%array  name(1:name max) =
         "CAPSH",  "ESCAPE",  "CAP",    "UND",  "spare",   "UNDSH",
         "NLS", "SGAP",   "PGAP",    "INDENT", "TOP", "BOTTOM",
         "LEFT", "PAGE", "LINE", "SLINE", "INVERT", "CAPO",
         "UNDO", "CAPSHO", "UNDSHO", "INVERTO", "ASCII", "JUST",
         "MARK",  "START",  "FINISH",  "PAGENO", "IGNORE", "SECTNO",
         "DLPI", "DCPI", "DLEFT",  "DPAGE", "DTOP" ,"PRINT",
         "INCLUDE",      "OUTPUT",    "SPLAT",   "TAB"

         skip %while next=' '
         ident = ""
         %cycle
            get(sym);  %exit %if sym = 0
            ident = ident.tostring(sym) %if length(ident) # 7
         %repeat
         fault(1) %and ordinal = 0 %and %return %if ident = ""
         %for ordinal = 1,1,name max %cycle
            %return %if name(ordinal) = ident
         %repeat
         fault(3);  ordinal=0
      %END;                             !READ NAME
      %INTEGER %MAP MAP(%INTEGER I)
      %SWITCH S(0:NAME MAX)
        %RESULT ==TAB(I-(NAMEMAX-1)) %IF I>=NAMEMAX
        ->S(I)
S(0):   %RESULT ==NUM
S(1):   %RESULT ==CAPSH
S(2):   %RESULT ==ESCAPE
S(3):   %RESULT ==CAP
S(4):   %RESULT ==UND
S(6):   %RESULT ==UNDSH
S(7):   %RESULT ==NLS
S(8):   %RESULT ==SGAP
S(9):   %RESULT ==PGAP
S(10):  %RESULT ==INDENT
S(11):  %RESULT ==TOP
S(12):  %RESULT ==BOTTOM
S(13):  %RESULT ==LEFT
S(14):  %RESULT ==PAGE
S(15):  %RESULT ==LINE
S(16):  %RESULT ==SLINE
S(17):  %RESULT ==INVERT
S(18):  %RESULT ==CAPO
S(19):  %RESULT ==UNDO
S(20):  %RESULT ==CAPSHO
S(21):  %RESULT ==UNDSHO
S(22):  %RESULT ==INVERTO
S(23):  %RESULT ==ASCII
S(24):  %RESULT ==JUST
S(25):  %RESULT ==MARK
S(26):  %RESULT ==START
S(27):  %RESULT ==FINISH
S(28):  %RESULT ==PAGENO
S(29):  %RESULT ==IGNORE
S(30):  %RESULT ==SECTNO
S(31):  %RESULT == DLPI
S(32):  %RESULT == DCPI
S(33):  %RESULT == DLEFT
S(34):  %RESULT == DPAGE
S(35):  %RESULT == DTOP
   ! 36 = PRINT
   ! 37 = INCLUDE
   ! 38 = OUTPUT
s(39):   %signal 15,15
   ! 40 = TAB
s(*):   %result == num;           !  all the odds and sods
      %END;                             !MAP
      %ROUTINE  READ N(%SHORTINTEGERNAME  N)
         SKIP %WHILE NEXT = ' '
         N = 0
         %IF NEXT = '?' %START
            SKIP
         %ELSE
            %WHILE '0' <= NEXT <= '9' %CYCLE
               N = 10*N + NEXT - '0'
               SKIP
            %REPEAT
         %FINISH
      %END;            ! READ N
    %END;                               !ASSIGN
  %END;                                 !PROCESS DIRECTIVE

! =================== IT ALL STARTS HERE =====================
   %unless exists(in1) %start
      %if exists(in1.".lay") %start
         in1 = in1.".lay"
      %else
         printstring("* LAYOUT fails -- ".in1." does not exist")
         newline
         %stop
      %finish
   %finish
   open input(1, in1);  open output(1, out1)
   select input(1);  select output(1)
   output type = output name(parm)
   %if output type = printer %start
      print symbol(12);      ! initial page throw
   %else %if output type = merge
      inclusion mode = 0
      output type = update
   %else %if output type = index
      inclusion mode = 0
   %finish
   PROMPT(">")
  %CYCLE NUM=0,1,127;  TYPE(NUM)=0
  %REPEAT
  %CYCLE NUM='A',1,'Z';  TYPE(NUM)=8
  %REPEAT
  %CYCLE NUM='A'!32,1,'Z'!32;  TYPE(NUM)=8
  %REPEAT
  TYPE(CAPSH)=1;  TYPE(ESCAPE)=2;  TYPE(CAP)=3
  TYPE(UND)=4;  TYPE(UNDSH)=6
  TYPE(' ')=7;  TYPE(NL)=7
  SELECTINPUT(SIN)
  SELECTOUTPUT(out)
  %CYCLE FREELIST=1,1,65
    LINK(FREELIST)=0
  %REPEAT
  %CYCLE FREELIST=1,1,500
    HEAD(FREELIST)=FREELIST-1
  %REPEAT
  %WHILE PAGES<FINISH %CYCLE
    READATOMORDIRECTIVE
    %IF DIRECTIVE#0 %START
      PROCESSDIRECTIVE
    %FINISH %ELSE %START
      %IF SIZE#0 %START
        PLACEATOM
        STORESOURCEATOM
        NEXT=0 %IF NEXT=NL %AND XLINES=0
      %FINISH
      %IF XLINES#0 %START
        %IF NEXT=' ' %START
          STORE(NEXT)
          COLS=COLS+1;  BUFF(COLS)=' '
        %FINISH
        PRINTDOCLINE %IF NEXT=NL
      %FINISH
    %FINISH
    PRINTSOURCELINE %IF NEXT=NL
    NEXT=0 %IF NEXT=' ' %OR NEXT=NL
  %REPEAT
  PRINTDOCLINE
   %if output type = index %start
      print string("-1 -1  *end*");  newline;   ! a comprehensive terminator!
   %finish
%END %OF %PROGRAM
ion
            %if X = 0 %start
               ! Null phrase
               Next = P_Link ; -> GN
            %finish
            %if P_Link # 0 %start
               ! Follow a phrase
               P_Sub = Link
               Link  = Next
            %finish
            Next = X
         %repeat
         Next = P_Link
         %if Diag&Diag Compiler # 0 %start
            Spaces(8-Length(Name)) %unless Name = ""
            Name = Text(Class)
            Write(X, 2)
            Space
            Print String(Name)
            Sm
    read item;  -> er1 %if type # 1
    -> restore
  %finish
  %if sym = '%' %start
    read sym;  -> erq %if sym < 'A'
    code = sym&95;                      !upper-case
    read sym
    -> pc(symtype(code)>>4&7)
  %finish
  dir = 0
  %if video > 0 %start
    clear line;  print symbol('=')
    print symbol(sym)
    echo = 1
  %finish
! C o m m a n d   i n p u t:  m a i n   l o o p
more:                                   !(command code has been read)
  hold = type;  -> er2 %if hold < 4
  -> er0 %if hold < 8 %and newtop = 0;  !no changes when Showing
  ci = ci+1;  -> er6 %if ci >= cbound-3
  code = sym;                           !command letter
  ref = 0;  num = 1;  scope = 1;        !default values
  read item
  -> c(hold)
c(8):                                   !Find
  minus
  scope = 0
c(4):                                   !+ Delete, Uncover
c(9):                                   !+ Traverse, Verify
  %if type = 0 %start;                  !followed by number
    scope = num
    read item
  %finish
  num = 0;                              !as indicator (not I,S)
c(5):                                   !+ Insert, Substitute
  hold = sym;  -> er4 %if type # 3;     !not valid quote mark ->
  ti = ti+1;  ref = ti;                 !REF indexes first quoted symbol
  %cycle
    read sym
    %if sym = nl %start;                !closing quote omitted
      -> er4 %if num = 0;               !allowed only for I,S
      pend = sym;  sym = hold
    %finish
    %exit %if sym = hold
    -> er6 %if ti > tbound-2
    sym = sym&casemask %if 'a' <= sym <= 'z' %and num = 0
    text(ti) = sym;  ti = ti+1
  %repeat
  -> er4 %if ti = ref %and num = 0;     !null allowed only for I,S
  text(ti) = 0;                         !end-marker
  num = 1;                              !restore default
  read item
  -> nput
c(6):                                   !Erase
c(10):                                  !+ Move, Print
  minus
c(7):                                   !+ Get, Kill, etc
c(11):                                  !+ Left, Right, etc
  -> er1 %if type = 3;                  !(redundant, but better report)
  -> nput
c(12):                                  !open bracket
  code = '['
  -> comma
c(13):                                  !comma
  code = '^'
! read item %if type = 1;               !permit line break (better not?)
comma:
  ref = chain;  chain = ci
  -> put
c(14):                                  !close bracket
  unchain;  -> er3 %if ref = 0
  code = ']';  r(ref)_count = num
nput:
  read item %if type = 0;               !get %own %string(*)%name line             {Current command line}
%own %integer inp                     {Position in line}
%own %integer sym, sym type           {Last char extracted from line}
!
! Symbol types:
!
!  0   a   A   .  SP  NL   o  (
!  :   :   :   #           t  [
!  9   z   Z   $           h  {
!              :           e  <
!              _           r  -
!  
!  0   1   2   3   4   5   6  128+closing bracket
!                            (128+NL for '-')
!
%constbytearray Type(0:127) =
   6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?},
   6 {?}, 6 {?}, 5 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?},
   6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?},
   6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?},
   4 { }, 6 {!}, 6 {"}, 3 {#}, 3 {$}, 6 {%}, 6 {&}, 6 {'},
 128+')', 6 {)}, 9 {*}, 9 {+}, 6 {,},128+NL, 3 {.}, 6 {/},
   0 {0}, 0 {1}, 0 {2}, 0 {3}, 0 {4}, 0 {6}, 0 {0}, 0 {7},
   0 {8}, 0 {9}, 3 {:}, 6 {;},128+'>',6 {=}, 6 {>}, 6 {?},
   6 {@}, 2 {A}, 2 {B}, 2 {C}, 2 {D}, 2 {E}, 2 {F},  %cycle
         print symbol (sym)
         get sym
      %repeat
      print symbol ('?');  newline
      %return
   %finish
   {Do the command}
   %if skipping = 0 %or char no(command_command,1) = '$' %start
      %if flag = 0 %start                {Executable program}
         Run Program (Program)           {Loaded before command parse}
      %else %if flag < 0                 {An obeyfile}
         Obey (Obey File,"Out:",Command_Parameter)
      %else
         LoadX (Command_Command,Program_Spec)   {load external}
         Run Program (Program)
      %finish
   %finish
   Close All(0)
%end
%externalroutine DO(%string(127) What)
   DoIt(What)
%end

%system %integer ECHO OBEY = -1
   !Normally 0 (no echo) or 1 (echo on).  Only negative at very beginning,
   !to let SUBSYSTEM (at label STARTUP) decide whether it has just started
   !or just come back from an Int:.

%routine Show Elapsed
   %owninteger Elapsed = 0
   Printstring(Time)
   N = Cputime
   Print((N-Elapsed)//1000, 5,1)
   Elapsed = N
   Printstring(" CPU seconds")
   Newline
%end
%external %routine OBEY (%string(31) from,to, %string(63) params)
   %own %string(127) line
   %record(FD fm)%name FD, old command, old report
   %record(Parmpfm) Parm
   %integer j, nparms, old echo Obey = ECHO Obey, old skip = SKIPPING
   %integer Old Segs      = Current Segs,
            Old work segs = Work Segs,
            Base Load
   %record(Progfm) Prog

   %on stream error %start               {End of .COM file or $EXIT}
      Obey Level   = Obey Level-1
      Work Segs    = Old work segs
      Current Segs = Old segs
      Close in (0);  Close out (0,0)
      In  stream(0) == old command
      Out stream(0) == old report
      select input(0);  select output(0)
      {Restore buffers, which were saved in the files}
      Read block (old command_key, old command_Bn, addr(old command_buf)) %c
         %if old command_key # 0
      Read block (old report_key, old report_Bn+1, addr(old report_buf))  %c
         %if old report_key # 0
      SKIPPING = old skip
      ECHO Obey = old echo Obey
      %return
   %finish

   Parmp == Parm
   %if Obey Level = 1 %start
      Relocate(Loaded(Loaded Files)) %if Loadup(Prog, Batch File)
   %finish
   Obey Level = Obey Level+1
   Base Load  = Loaded Files+1
   %if Echo Obey < 0 %start            {first entry}
      Echo Obey = 0
      Run(Subinit)
   %finish

   %routine Get Line
      %integer Sym
      Prompt(Command Prompt)
      Line = ""
      %cycle
         Sym = Readsymbol;  %exit %if Sym = Nl
         %if Sym = '&' %and Nextsymbol = Nl %start
            Skipsymbol
         %else
            Line = Line.Tostring(Sym)
         %finish
      %repeat
      Console(Prompt Text.Line) %if Echo Obey # 0
   %end

   %own %byte %name len, p, limit
   params = params.","
   limit == char no(params,length(params))
   Nparms = 0
   p == length(params)
   %cycle
      len == p;  j = 0
      %cycle
         p == p ++ 1;  j = j + 1
      %repeat %until p = ','
      len = j - 1
      Nparms = Nparms + 1
      Parm_Parm(Nparms) == string(addr(len))
   %repeat %until p == limit

   old command == in stream(0)
   in stream(0)== null FD
   {Must clear INSTREAM(0), or OPENIN will return the FD pointed at by
   {OLD COMMAND to the free list when it calls CLOSE IN(0)
   Open in (0,from)
   old report   == out stream(0)
   out stream(0)== null FD
   {for output must save half-written buffer in file..}
   FD == out stream(0)
   %if FD_key # 0 %start              {forget about NULL:, T:}
      Write block (FD_key, FD_Bn+1, addr(FD_buf))
   %finish
   Open out (0,to)

   Current Segs = Current Segs&(~Work Segs)
   Work Segs    = 0
   %cycle
      Select input (0);  Select output (0)
      Unload(Base Load)
      Tlib_Name = ""
      Unstack Conts(1)
      Tidy Segs
      Console Int = ""
      Terminal Mode(0) %if TT Mode # 0
      Break output
      Get Line  %until Line # ""
      DoIt (Line)
      Show Elapsed %if Options&Opt Monitor # 0
   %repeat
%end

%end %of %file
ng(Intpt(R)+'0')
   %repeat
%end

%externalstring(64)%fn FtoS(%real r, %integer p)
   %string(64) S = ""
   %integer    Exp, Sym
   P = 7 %if P > 7
   %if R < 0 %then Sym = '-' %and R = -R  %c
             %else Sym = ' '
   %if R = 0 %start
      Exp = -99
   %else
      Exp = 0
      Exp = Exp+1 %and R = R/10 %while R >= 10
      Exp = Exp-1 %and R = R*10 %while R < 1
   %finish
   Round(R, P)
   Exp = Exp+1 %and R = R-1 %if R >= 10
   S = S.Tostring(Intpt(R)+'0')
   Fraction(R, P, S)
   S = S."@".ItoS(Exp, 0)
   %result = S
%end
%externalroutine PrintFl(%real R, %integer Places)
   Printstring(Ftos(R, Places))
%end

%externalstring(63)%fn RtoS(%real R, %integer A, B)
   %integer Before
   %real    Rm
   %string(63) S = ""
   %constinteger Max Int = (-1) >> 1
   A = 63-8 %if A > 63-8
   B =  7   %if B > 7
   Round(R, B)
   Rm = |R|
   %result = FtoS(R, A+B) %if Rm > Max Int
   Before = Intpt(R)
   %if Before = 0 %and r < 0 %start
      %while A > 0 %cycle
         A = A-1
         S = S." "
      %repeat
      S = S."-0"
   %else
      S = ItoS(Before, A)
   %finish
   Fraction(Rm, B, S)
   %result = S
%end
%externalroutine Print(%real R, %integer B, A)
   Printstring(RtoS(R, B, A))
%end

%externalstring(8)%fn XTOS(%integer n, p)
   %string(8) s = ""
   %integer k
   p = 8 %if p > 8
   N = N<< ( 4*(8-P) )
   %cycle
      k = n>>28&15;  n = n<<4
      %if k > 9 %then k = k-10+'A' %else k = k+'0'
      s = s.tostring(k)
      p = p-1
      %result = s %if p <= 0
   %repeat
%end

%externalroutine PHEX(%integer n, p)
   printstring(XTOS(n, p))
%end

%externalroutine READ(%name NN)
   %string(255)  st
   %integer sign, n, len, adr, type, s, base, Flag
   %real  r, exp, f
   %constinteger  integers=1,
                  reals=2,
                  strings=3,
                  records=4,
                  bytes=5,
                  shorts=6,
                  long reals=7
   %switch  TP(integers:longreals)
   len = size of(NN);  adr = addr(NN)
   len = adr>>24+1 %if len = 0
   type = type of(NN)
   %unless  integers <= type <= longreals %and type # records %start
TP(records):      %signal 5,5,type
   %finish
   skip symbol %while next symbol = ' ' %or next symbol = NL
   %if type = strings %start
      st = ""
      %cycle
         s = next symbol
         %exit %if s = ' ' %or s = NL
         st = st.tostring(s)
         skip symbol
      %repeat
      %signal 1,3 %if len <= length(st)
      string(adr) = st
      %return
   %finish

   ! read a number
   sign = 0;  Base = 10
   sign = readsymbol %if next symbol = '-' %or next symbol = '+'
   %cycle
      n = 0;  Flag = 0
      %cycle
         s = next symbol
         %if '0' <= s <= '9' %start
            s = s-'0'
         %else %if 'A' <= S&95 <= 'Z'
            s = s&95-'A'+10
         %finish %else %exit
         %exit %if s >= Base
         Flag = 1
         skip symbol
         n = n*Base + s
         s = next symbol
      %repeat
      %exit %if S # '_' %or N = 0
      Base = N
      skipsymbol
   %repeat
   r = n
   %if s = '.' %and (type = reals %or type = longreals) %start
      F = 0
      Exp = 10;  skip symbol
      %cycle
         s = next symbol
         %exit %unless '0' <= s <= '9'
         Flag = 1
         f = f + (s-'0')/Exp
         Exp = Exp*10
         skip symbol
      %repeat
      R = R+F
   %finish
   %if sign = '-' %start
      n = -n;  r = -r
   %finish
   %signal 3,1,s %if Flag = 0
   -> TP(type)
TP(integers):  integer(adr) = n;  -> RETURN
TP(shorts):    %signal 1,1,n %unless x'FFFF8000' <= n <= x'00007FFF'
               shortinteger(adr) = n;  -> RETURN
TP(bytes):     %s
 H?   p pm                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !OPTION(UPPER,NODECODE)
%begin
   %systembytearrayspec Alias Text (0:255)
   %systemintegerspec   Alias Limit;     !one past last used addr
   %systemroutinespec let(%string(63) old, new)
   %externalroutinespec Alias (%string(*)%name it)
   %include "Newsrc:command.inc"
   %string(63) old, new
   %byte %integer %name b, last == byte integer(alias limit)
   %integer j, k
   Old = Command_Parameter
   %unless Old -> old.("=").new %start
      %if Old = "" %or Old = "?" %start
         J = 0
         b == alias text(0)
         %while b ## last %cycle
            %for k = 1,1,b %cycle
               b == b ++ 1
               Print symbol (b)
            %repeat
            b == b ++ 1;              !to next length byte
            %if j = 0 %start;         !toggle thru table: <sym><translation>
               Print string (" = ");  ! pairs. (Both terminated by 0's).
            %else;                    !..after <trans>..
               Newline
            %finish
            j = ~j;                   !toggle j
         %repeat
      %else
         Print string (old . " = ")
         Alias (old);                    !force translation in place
         Print string (old)
         Newline
      %finish
   %else
      Let(Old, New)
   %finish
%endofprogram
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        %begin;                        !MOUSES mail system V0.0;   A. Culloch
   %include "Sysinc:command.inc"
   %external %string(17) %spec command prompt
   %record %format parm fm (%shortinteger dsno,dact,ssno,sact, %c
                            %integer p1,p2,p3,p4,p5,p6)
   %record(parm fm) P
   %integer del
   %integer exclam = command_modifier
   %const %integer status = 18
   %const %integer process info = 14
   %const %integer pack filename = 17
   %const %integer unpack filename = 18
   %const %integer to director = 20
   %const %integer delete = 14
   %const %integer become = 27
   %const %integer input ended = 9
   %externalpredicatespec Exists(%string(31) File)
   %string(*)%name sn
   %routine stop
      %record(parm fm) P
      P_p2 = 0;  P_p6 = 0;  P_dact = become
      SVC (to director,P)
      command prompt = "Command:";   !save confusion for BECOME's users
      %stop
   %end
   P_p1 = 0;  P_p2 = x'D417A';  P_p3 = x'1BE81D81';  P_p6 = 0
   select input (0);  select output (0)
   P_dact = become;  SVC (to director,P)
   P_p1 = 0;  SVC (process info,P);      !find out own process name
   P_p1 = 0;  P_p3 = 0;  P_p4 = 0
   SVC (unpack filename,P)
   sn == string(addr(P_sact));           !unpacked proc nam.
   length(sn) = length(sn) - 1;          !kill ':'
   %if %not exists (sn) %start
      print string ("No mail.")
      newline
      stop
   %finish
   select output (0)
   open input (2,sn)
   %if exclam # 0 %start;            !MAIL?
      %begin
         %integer n
         %on input ended %start
            %if n = 1 %then print string ("One") %else write (n,0)
            print string (" message")
            print symbol ('s') %if n # 1
            print string (" pending")
            newline
            stop
         %finish
         select input (2);  skip symbol %if next symbol = '*'
         n = 0
         %cycle
            %while next symbol # NL %cycle
               print symbol (next symbol) %if exclam = '?'
               skip symbol
            %repeat
            newline %if exclam = '?'
            n = n + 1
            skip symbol %while next symbol # 0
            skip symbol
         %repeat
      %end
   %finish
   open output (2,sn)
   open input (3,sn);  !look at MAIL:ME
   del = 1
   %begin
      %on input ended %start; %return; %finish
      select input (2);  skip symbol %if next symbol = '*'
      select input (3);  skip symbol %if next symbol = '*'
      %cycle
         %if next symbol = 0 %start;         !NULL separates messages
            newline
            prompt ("Delete? ")
            select input (0)
            skip symbol %while next symbol <= ' '
            %if 'y' # next symbol # 'Y' %start
               !Don't delete this message
               del = 0;                      ! => don't delete file at close
               select input (2)
               select output(2)
               %while next symbol # 0 %cycle;!copy mess into new file
                  print symbol (next symbol)
                  skip symbol
               %repeat
               print symbol (0)
               skip symbol; !0
            %else
               select input (2)
               skip symbol %while next symbol # 0;   !delete message
               skip symbol
            %finish
            select input (0)
            skip symbol %while next symbol # NL
            select input (3)
            select output(0)
            skip symbol; !0
            %continue
         %finish
         print symbol (next symbol)
         skip symbol
      %repeat
   %end
   close input; !3
   select input (2)
   close input
   select output (2)
   close output
   SVC (pack filename,P)
   P_dact = delete;  SVC (to director,P) %if del # 0
   stop
%end %of %program
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        {   **************************************************************
{   *                                                            *
{   *          PERKIN-ELMER 32-BIT SERIES IMP COMPILER           *
{   *                   Master Diagnostic Routine                *
{   *                                                            *
{   *                 (GENERAL SERVICE VERSION)                  *
{   *                                                            *
{   *                       C.H. WHITFIELD                       *
{   *                     19, REDFORD TERRACE                    *
{   *                          COLINTON,                         *
{   *                     EDINBURGH  EH13-0BT                    *
{   *                                                            *
{   *                 COPYRIGHT (c) MAY 1ST. 1980                *
{   *                     ALL RIGHTS RESERVED                    *
{   *                                                            *
{   **************************************************************

%begin
   {Note: as MDIAG runs on the user's stack in front of the program
   {      it is diagnosing, care must be taken to minimise the amount
   {      of stack it uses. Gla space is unlimited}

   %externalroutinespec Terminal mode(%integer n)
   %externalroutinespec phex(%integer n, p)
   %externalroutinespec store dump(%integer from, size)
   %externalpredicatespec valid(%integer a, n)

%recordformat  pgmfm(%integer  limit, stack, gla, code base, ep, code,     %c
                                                   %shortinteger  options)
%ownrecord(pgmfm)  reg

%recordformat  rfm(%integer  ps,pc,%integerarray gpr(0:15), fpr(0:7) )
%recordformat  contfm(%integer  ps,pc,%integerarray gpr(0:15),  %c
                                      %record(rfm)  old)

! Constants known to third pass.
%constinteger  line diag limit = 31
%constinteger  indirect = x'4000'

%routine hex(%integer n)
   printstring(" x'");  phex(n, 8);  printsymbol('''')
%end

%ownrecord(rfm)%name error context
%ownrecord(contfm)%name c
%owninteger contingency =-1,
            diag char
%owninteger k
%conststring(27)%array Cont Mess(0:17) =
            "Termination Requested",            {0}
            "Illegal interrupt",                {1}
            "Illegal SVC",                      {2}
            "Illegal instruction",              {3}
            "Arithmetic fault",                 {4}
            "Address error",                    {5}
            "Time excceded",                    {6}
            "Insufficient privilege",           {7}
            "Invalid PON service",              {8}
            "Vague SVC error",                  {9}
            "Invalid SVC address",              {10}
            "Console failure",                  {11}
            "Console buffer failure",           {12}
            "Invalid contingency buffer",       {13}
            "Demon dead",                       {14}
            "God knows what",                   {15}
            "Transfer failure",                 {16}
            "Unknown contingency"               {17}

   c == record(EVENT_x)
   error context == c_old
   %if EVENT_event = 16 %start         {contingency}
      contingency = EVENT_sub
      contingency = 17 %unless 0 <= Contingency <= 16
   %finish

   ! Register definitions
   %constinteger  p2=5, p1=6, wsp=7, gla=13, code=14, link=15

   ! layout of first 44 bytes of stack frame
   %recordformat  framefm(%integerarray  reg(p2:link))

   ! Description of object file header block
   %recordformat  hdfm(%shortinteger  p1,p2)
   %recordformat  headerfm(%shortinteger  pure size, gla size, code disp,
                                          lit disp, registers, mainep,
               %record(hdfm)  reloc, defn, spec, ldiag, vdiag )
   %constinteger  basic header=18;         ! *** halfwords ***

   %ownrecord(headerfm)%name  hdr
   %ownrecord(framefm)%name  f
   %owninteger gla mark = 0

   %owninteger  code base, gla base, file base, ca;      ! absolute byte addresses
   %owninteger  event head, event end, line head, line end, id head, id end; ! ditto

   ! Pointers set by 'set pointers' routine
   %owninteger  epntr, block no, block addr, block line no, line no
   %owninteger  id from, id to;      ! limits of interest in ident. tables
   %owninteger  display reg,  main prog, diags
   %owninteger stop line = 0

   %constinteger  full=0, partial=1, H = x'FFFF'

%routine  fail(%integer  fail no, p)
   %constinteger  fmax=1
   %switch  f(0:fmax)
   newline
   -> f(fail no) %if 0 <= fail no <= fmax
        print string("*Mdiag - internal error");          -> exit
f(0):   print string("*Cannot give further diagnostics"); -> exit
f(1):   print string("*Unknown PC ");  Phex(p,1);         -> exit

EXIT:   newlines(2)
        %stop
%end


%predicate  ok(%integer from, bytes)
   %true %if valid(from, bytes)
   print string(" illegal reference");  hex(from)
   %false
%end;      ! 'ok'

%routine  initialise
! Initialise for this code segment.  Where external linking occurs, must
! be called every time a segment switch occurs. i.e. when new code base is
! different than old code base.
   %integer  k

   %return %if code base = f_reg(code)
   code base = f_reg(code)
   gla base = f_reg(gla)
   fail(1, ca) %unless ok(codebase, 4) %and ok(glabase, 4)
   file base = code base - ((shortinteger(code base-4))&H)*2
   
   hdr == record(file base)

   diags = full
   k = hdr_ldiag_p1
   diags = partial %if k < 0;      ! ldiag_p1 sign bit
   k = (k & x'7FFF')*2
   %if k = 0 %start
      fail(0,ca-file base);      ! No diag tables - return address of smash
   %finish
   line head = k + hdr_ldiag_p2*2 + file base
   line  end = (k-2) + file base;            ! convention
   k = (hdr_vdiag_p1 & H)*2
   id head = k +hdr_vdiag_p2*2 + file base
   id  end = (k-2) + file base;              ! convention
   event head = (shortinteger(code base-2)&H)*2 + code base;   ! N.B. absolute
   event  end = code base - 2;               ! convention

%end;         ! initialise

%routine  set pointers(%integer  ca);   ! N.B. parameter is absolute address
   %owninteger  k, n, here, next, lpntr, vpntr, ad

   block no = 0
   epntr = event head
   %while epntr # event end %and ok(epntr, 2) %cycle
      next = epntr - (shortinteger(epntr)&H)*2
      -> FOUND %if next < ca <= epntr
      epntr = next;  block no = block no+1
   %repeat
   fail(1,ca);      ! *** error address not found ***

FOUND:
   %if next = code base - 2 %and ca # codebase!1 %start;  ! trapped from perm
      block no = -1
      %return
   %finish
   display reg = short integer(epntr+2)&15
   %if ca # codebase!1 %start
      main prog = short integer(epntr+2)&x'4000'! main prog
   %finish
   block addr = next+2
   block addr = block addr+6 %if shortinteger(block addr)&x'8000' # 0
   block addr = block addr+2;         !+previous: skip event info
   %if diags = full %start
      lpntr = line head;  vpntr = id head
      next = block no
      %while next # 0 %cycle
         lpntr = lpntr - (shortinteger(lpntr)&H)*2
         vpntr = vpntr - (shortinteger(vpntr)&H)*2
         next = next-1
      %repeat
      k = lpntr - (shortinteger(lpntr)&H)*2
      k = k+2 %until shortinteger(k) # 0;   ! skip any empty space
      block line no = shortinteger(k)&H
      here = block line no;  ad = block addr
      k = k+2
      %while ad < ca %cycle
         line no = here
         n = shortinteger(k)
         %if n >= 0 %start
            here = here + (n & line diag limit)
            ad   = ad + (n>>5)*2;            ! ** N.B   //(line diag limit + 1)
         %else
            here = n&x'7FFF'
         %finish
         %exit %if k = lpntr
         k = k+2
      %repeat
      id from = vpntr - (shortinteger(vpntr)&H)*2 + 2
      id to   = vpntr
   %else;            ! partial diags
      block line no = shortinteger(line head - 2*(block no+1))&H
      line no = block line no
      id from = id head - 8*(block no+1)
      id to   = id from + 7
   %finish
%end;            ! set pointers

%string(12)%fn  varname(%integer  where, bytes)
   %ownstring(12)  s
   %owninteger  k, end

   %routine  unpack(%integer  x)
      %owninteger  k,sym

      k = 3
      %cycle
         sym = rem(x,40)
         %if sym = 0 %start
            sym = ' '
         %else %if sym <= 26
            sym = sym - 1 + 'A';       ! 1:26 => A:Z
         %else %if sym <= 36
            sym = sym - 27 + '0';      ! 27:36 => 0:9
         %else
            sym = sym - 37 + '#';      ! 37 => #, 38 => $, 39 => %
         %finish
         charno(s, length(s)+k) = sym
         k = k-1;  %exit %if k = 0
         x = x//40
      %repeat
      length(s) = length(s) + 3
   %end

   end = where + bytes
   end = end-2 %until shortinteger(end) # 0
   s = ""
   unpack(shortinteger(k)&H) %for k = where,2,end
   length(s) = length(s) - 1 %while charno(s,length(s)) = ' '
   %result = s
%end;            ! varname

%routine  dump locals
   %owninteger  disp, type, base reg, extra ident
   %ownstring(12)  ident
   %owninteger  k, pntr

   !**** Note that the reduced types used by the diagnostics are, for reasons of
   !     economy, generated in Pass TWO %not 3 (%routine describe)
   !****

   %routine output(%integer  n)
      %integer  j,k

      write(n,1)
      %if 32 <= n&(\128) <= 126 %start;      ! ignore parity bit
         spaces(5)
         print symbol('''');  print symbol(n);  print symbol('''')
      %else %if |n| > 256
         spaces(4);  hex(n)
      %finish
   %end;      ! 'output'

   %routine  print value
      %switch  s(0:15)
      %integer  p, q
      %constinteger  unass = x'80808080'

      p = disp
      p = p + f_reg(base reg) %if base reg # 0
      %if type&16 # 0 %start      {external spec}
         p = p+8                  {skip linkage info}
         ->out %unless VALID(p, 4)
         p = integer(p)
         type = type&15
      %finish
      -> s(type)
   s(0):
   s(8):   ! unused
           print string(" *unknown type"); write(type,1)
           -> OUT
   s(9):   !integername
   s(10):  !realname
   s(15):  !longrealname
   s(11):  !stringname
   s(12):  !recordname
   s(13):  !byteintegername
   s(14):  !shortintegername
           %if ok(p,4) %start
              p = integer(p);   ! fetch pointer
              %if p = unass %start
                 print string(" unassigned pointer")
              %else
                 -> s(type&7)
              %finish
           %finish
           -> OUT
s(1):      !integer
s(2):      !real
s(7):      !longreal
           %if ok(p,4) %start
              %if integer(p) # unass %start
                 %if type&7 = 1 %start
                    output(integer(p))
                 %else
                    print(real(p),1,6)
                 %finish
              %else
                 -> UNA;      ! print "unassigned" message
              %finish
           %finish
           -> OUT
s(3):      ! string
           %if ok(p,1) %and ok(p+byteinteger(p),1) %start
              %if byte integer(p) # x'80' %or byte integer(p+1) # x'80' %start
                 print symbol('"');  print string(string(p));  print symbol('"')
              %else
                 -> UNA
              %finish
           %finish
           -> OUT
s(4):      ! record
           q = p + 6*4
           %while ok(p, 4) %cycle
              Space
              phex(integer(p),8)
              p = p+4
           %repeat %until p = q
           -> OUT
s(5):      ! byte
           %if ok(p,1) %start
              output(byteinteger(p))
              -> MAYBE %if byteinteger(p) = x'80';   ! possibly unassigned
           %finish
           -> OUT
s(6):     ! shortinteger
           %if ok(p,2) %start
              output(shortinteger(p))
              -> MAYBE %if shortinteger(p)&x'FFFF' = x'8080'
           %finish
           -> OUT
MAYBE:     print string("  ?")
UNA:       print string(" unassigned")
OUT:
   %end;      !of 'print value'

   pntr = id from + 4*2;      ! skip over procedure ident
   %while pntr # id to %cycle
      k = shortinteger(pntr)
      disp = (k&15) << 16;         ! top 4 bits of disp
      base reg = (k>>4)&15
      type = (k>>8)&7
      type = type+8 %if k&indirect # 0;      ! ... basic type 0:7, indirect 8:15
      type = type+16 %if k&x'2000' # 0       {external spec}
      extra ident = 4
      extra ident = 0 %if k < 0
      disp = disp ! (shortinteger(pntr+2)&H)
      ident = varname(pntr+4,4+extra ident)
      pntr = pntr + 8 + extra ident
      spaces(3+12-length(ident));  print string(ident)
      print string(" = ");  print value
      newline
   %repeat
%end;         ! dump locals

%routine  print happening
   %constinteger  messages = 25
   %constinteger  UAV  = X'081', SLNS = X'163', ABE  = X'262',
                  CDV  = X'043', INE  = X'091', EXB  = X'021',
                  SID  = X'831', SND  = X'492', CEX  = X'013',
                  SSE  = X'667', AIO  = X'353', EXPI = X'452',
                  FPI  = X'051', FVC  = X'042', ISP  = X'567',
                  SRF  = X'070', BADI = X'000', FLOV = X'011',
                  SEGR = X'023', TEX  = X'024', SIGF = X'464',
                  LODF = X'00E', RDP  = X'055', CLEX = X'765',
                  MISSING = X'0BB'

   !Flag fields 0 = no action
   !            1 = output switch index (r2)
   !            2 = output array  index (R2) and array  bounds (R4)
   !            3 = output array bounds (R4)
   !            4 = output exponent (R2)
   !            5 = output shift count (R2)
   !            6 = output substring limits (R2, R4)
   !            7 = output charno index (R2)
   !            8 = output symbol in R2
   %conststring(27)%array  message text(1:messages) =
         "Unassigned variable",    "No switch label (",
         "Array index (",          "Corrupt array",
         "Input ended",            "Not enough store",
         "Symbol in data",         "Error on stream ",
         "Capacity exceeded",      "Invalid substring (",
         "Array inside-out:",      "Illegal exponent",
         "Illegal %FOR parameters","Control variable corrupt",
         "Illegal shift",          "String resolution failed",
         "Illegal Instruction",    "Value too large",
         "Segment Error",          "Time Exceeded",
         "%event failure",         "External not found",
         "READ: parameter type ??","No charno (",
         "Perm routine missing"
   %constshortintegerarray  code(1:messages) =
               UAV,                     SLNS,
               ABE,                     CDV,
               INE,                     EXB,
               SID,                     SND,
               CEX,                     SSE,
               AIO,                     EXPI,
               FPI,                     FVC,
               ISP,                     SRF,
               BADI,                    FLOV,
               SEGR,                    TEX,
               SIGF,                    LODF,
               RDP,                     CLEX,
               MISSING
   %owninteger  event no,subevent,extra,message, flag, r2, r4
   %switch action(0:8)

   %routine  find message
      %integer  k
      k = event no<<4 ! subevent
      k = 1<<4!3 %if k = 1<<4!5 %or k = 1<<4!7
      k = 6<<4!3 %if k = 8<<4!2
      k = 1<<4!1 %if k = 1<<1!2
      message = messages
      %while message # 0 %cycle
         flag = code(message)
         %exit %if flag&255 = k
         message = message-1
      %repeat
   %end

   event no = EVENT_EVENT
   subevent = EVENT_sub
   extra = EVENT_extra
   %if Contingency >= 0 %start
      Printstring(Cont Mess(Contingency))
   %else
      find message %if sub event <= 15
      printstring("*Event ")
      write(eventno, 0);  printsymbol(',')
      write(subevent,0);  printsymbol(',')
      write(extra, 0)
      space %and printstring(EVENT_Message) %if EVENT_Message # ""
      print string("   ")
      message = 22 %if Eventno=0 %and Subevent=14 {external not found}
      %if message # 0 %start
         %if Message = 22 %start
            Printstring(EVENT_Message)
         %else
            print string(message text(message))
         %finish
         r2 = error context_gpr(2);  r4 = error context_gpr(4)
         ->action(flag>>8)
action(1):     !switch
action(7):     !charno
      write(r2, 0);  printsymbol(')');  ->done
action(2):     !array
      write(r2, 0)
      printstring(") not in")
action(3):     !inside-out
      printstring(" bounds (")
      %if ok(r4, 12) %start
         write(integer(r4+4), 0);  printstring(" to ");  write(integer(r4+8), 0)
      %finish
BRACKET:
      printsymbol(')')
      ->done
action(4):     !exponent
action(5):     !shift
      write(r2, 0)
      -> DONE
action(6):      ! substring
      write(R2,0);  print string(" to");  write(R4,1)
      -> BRACKET
action(8):      !symbol in data
      printstring(" '");  printsymbol(Extra);  printsymbol('''')
action(0):
done:
      %else %if event no=0=sub event
         printstring("Termination Requested")
      %finish
   %finish
   newline
%end;            ! print happening

%routine  print out(%string(13)  prefix)
   %integer g, old display

   newline
   print string(prefix)
   %if diags = full %and line no # 0 %start
      stop line = line no %if stop line = 0
      print string("line");  write(line no,1)
      print string(" in ")
   %finish
   print string(varname(id from,8))
   %if block line no # 0 %start
      print string(" starting at line"); write(block line no,1)
      newline
   %finish
   %if diags = full %start
      dump locals
      old display = display reg
      set pointers(codebase!1);      !look for globals
      display reg = old display
      %if id from+4*2 # id to %start
         g = f_reg(gla)
         %if integer(g+4) # gla mark %start
            integer(g+4) = gla mark
            newline
            printstring("Environmental variables");  newline
            dump locals
         %finish
      %finish
   %finish
%end;      ! print out

!      ------- M A I N    L O O P -------

   %on 9 %start;  %return;  %finish
   Newline
   terminal mode(0)            {in case of binary I/O to terminal}
   main prog = 0
   gla mark = gla mark+1       {to enable repeated printing of globals}
   print happening
   f == record(addr(error context_gpr(p2)))
   code base = -1              {force first initialisation to occur}
   initialise
   set pointers(error context_pc)
   set pointers(f_reg(link)) %if block no < 0;      ! pc in perm
   print out("Executing ")
   %cycle
      %exit %if main prog # 0
      f == record(f_reg(display reg))
      initialise
      set pointers(f_reg(link))
      print out("called from ")
   %repeat

   %if stop line # 0 %start
      newline
      print string("Stopped at line");  write(stop line,1);  newlines(2)
   %finish
%endofprogram
 H?   % %                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %begin                  {copy program for decwriter}
   %record(parmfm) p
   %constinteger page size = 66
   %constinteger margin    = 6
   %constinteger ff = 12, vt = 11
   %integer lines left = page size-margin
   %integer s
   %routine NEWLINE
      lines left = lines left-1
      printsymbol(nl)
   %end

   %on 9 %start
      ->Eof
   %finish

   p_p1 = 1;  p_p2 = 0;  p_p3 = 0;  svc(29, p);      {width=0}
   p_p1 = 2;  p_p2 = 0;  p_p3 = 0;  svc(29, p);      {lines=0}

   %cycle
      %cycle
         readsymbol(s);  ->eof %if s < 0
         %exit %if s = nl %or s = ff %or s = vt
         printsymbol(s)
      %repeat
      %if s = nl %start
         newline
         s = ff %if lines left <= 0
      %finish
      %if s = vt %start
         newline
         s = ff %if lines left < 6
      %finish
      %if s = ff %start
         newline %while lines left > 0
         newlines(6)
         lines left = page size-margin
      %finish
   %repeat
eof:
   newlines(3)
%endofprogram
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        %begin;     !file/directory access setting prog
   %record(parmfm) p
   %string(63) parm, perms
   %integer ep,n,l, dact
   %externalroutinespec tolower(%string(*)%name s)
   %include "Sysinc:command.inc"
   parm = command_parameter
   to lower(parm)
   %unless parm -> parm.("=").perms %start
      printstring("=permission ?");  newline;  %stop
   %finish
   %if parm = "directory" %start
      dact = 24;               !set directory access
   %else
      dact = 22;                !set file access
      string(addr(p_sact)) = parm
      svc(17, p)
      %if p_p2 < 0 %start
         printstring("Invalid filename ")
         printstring(parm);  newline
         %stop
      %finish
   %finish
   p_p6 = 0
   ep = 0
   %while ep # length(perms) %cycle
      ep = ep+1;  n = charno(perms, ep)
      %unless 'a' <= n <= 'h' %start
         printstring("Invalid permission: ")
         printsymbol(n);  newline;  %stop
      %finish
      p_p6 = p_p6! 1<<(n-'a')
   %repeat
   p_dact = dact;  svc(20, p)
   %if p_p6 # 0 %start
      printstring("Permit ".parm." fails -- ")
      printstring(string(addr(p_p1)))
   %else
      printstring("Permissions set")
   %finish
   newline
%endofprogram
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        %begin
   %include "sysinc:command.inc"
   %record(parmfm) P
   P_p1 = Command_modifier - '!' + 1
   SVC (37,P)
%endofprogram
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        %systemroutine Set(%string(63) Param)
   %constinteger Opt Monitor = 1,
                 Opt Dump    = 2,
                 Opt Verify  = 4,
                 Opt Xdump   = 64,
                 Opt Quick   = 512,
                 Opt Trace   = 1024
   %constinteger lower = -17
   %constinteger upper = 10
   %conststring(9)%array keyword(lower:upper) =
      "VERIFY",              {-17}
      "NOVERIFY",            {-16}
      "QUICK",               {-15}
      "NOQUICK",             {-14}
      "TRACE",               {-13}
      "NOTRACE",             {-12}
      "XDUMP",               {-11}
      "NOXDUMP",             {-10}
      "TABS",                {-9}
      "NOTABS",              {-8}
      "MONITOR",             {-7}
      "NOMONITOR",           {-6}
      "DUMP",                {-5}
      "NODUMP",              {-4}
      "ERASE",               {-3}
      "NOERASE",             {-2}
      "ACCESS",              {-1}
      "TIMELIMIT",           {0}
      "STACK",               {1}
      "PASSWORD",            {2}
      "PAGE",                {3}
      "TIME",                {4}
      "WIDTH",               {5}
      "PROMPT",              {6}
      "SEARCH",              {7}
      "TAB",                 {8}
      "SPEED",               {9}
      "ERRORFILE"             {10}
   %record(parmfm) pfile
   %string(72) key
   %integer sym, p
   %ownshortinteger shift = 32
   %systemintegerspec options, default stack, default time
   %externalstring( 7)%spec Search owner
   %externalstring(17)%spec Command prompt
   %externalstring(31)%spec Error File
   %integerfn next
      %integer char
      %cycle
         %result = 0 %if p = length(param)
         p = p+1;  char = charno(param, p)
         %exit %unless char = ' ' %and shift # 0
      %repeat
      char = char-shift %if 'a' <= char <= 'z'
      %result = char
   %end
   %integerfn packed(%string(*)%name s)
      %record(parmfm) p
      string(addr(p_sact)) = s.":"
      svc(17, p)
      %result = p_p2
   %end
   %routine read key
      key = ""
      %cycle
         sym = next;  %return %if sym = 0
      %repeat %until 'A' <= sym <= 'Z'
      %cycle
         key = key.tostring(sym)
         sym = next
         %return %if sym = 0 %or sym = '=' %or sym = ',' %or sym = ':'
      %repeat
   %end
   %routine skip
      sym = next %until sym = 0 %or sym = ','
   %end
   %routine pack key
      string(addr(pfile_sact)) = key
      svc(17, pfile)
   %end
   %integerfn number
      %integer n
      n = 0
      %cycle
         sym = next
         %result = n %unless '0' <= sym <= '9'
         n = n*10+sym-'0'
      %repeat
   %end
   %routine set(%integer what, value)
      %record(parmfm) p
      %string(72) st
      %integer n, here
      %switch s(lower:upper)
      p_p3 = 0;   !console number
      ->s(what)
s(-17):   options = options!Opt Verify;      %return
s(-16):   options = options&(\Opt Verify);   %return
s(-15):   options = options!Opt Quick;       %return
s(-14):   options = options&(\Opt Quick);    %return
s(-13):   options = options!Opt Trace;       %return
s(-12):   options = options&(\Opt Trace);    %return
s(-11):   options = options!Opt Xdump;       %return
s(-10):   options = options&(\Opt Xdump);    %return
s(- 7):   options = options!Opt Monitor;     %return
s(- 6):   options = options&(\Opt Monitor);  %return
s(- 5):   options = options!Opt Dump;        %return
s(- 4):   options = options&(\Opt Dump);     %return
s(-9):!tabs
s(-8):!notabs
      p_p1 = 6;  p_p2 = 0;  p_p3 = (-8-what)<<4;  svc(29, p)
      %return
s(-3):!erase
s(-2):!noerase
      p_p1 = 3;  p_p2 = 0;  p_p3 = (-2-what)<<3;  svc(29, p)
      %return
s(-1):!level
      %if sym # ':' %start
         printstring(":Filename ?");  newline
         skip;  %return
      %finish
      read key;            !filename
      %if key = "DIRECTORY" %start
         p_dact = 24
      %else
         pack key
         %if pfile_p2 < 0 %start;     !bum filename
            printstring("Filename ".key." ?");  newline
            skip;  %return
         %finish
         p_dact = 22;  p_p3 = pfile_p3;  p_p4 = pfile_p4
      %finish
      %if sym # '=' %start
         printstring("= ?");  newline
         skip;  %return
      %finish
      p_p6 = 0
      %cycle
         sym = next
         %exit %if sym = 0 %or sym = ','
         %unless 'A' <= sym <= 'H' %start
            printstring("Illegal access ")
            printsymbol(sym);  newline
            skip;  %return
         %finish
         p_p6 = p_p6!1<<(sym-'A')
      %repeat
      p_p6 = p_p6!!255
      svc(20, p)
      %if p_p6 # 0 %start
         printstring("Set level fails: ")
         printstring(string(addr(p_p1)))
      %else
         printstring("Access level set")
      %finish
      newline
      %return
s(0):!TIME limit
s(4):!TIME
      %if sym = '?' %and value = 0 %start
         sym = next
         value = default time
      %else
         value = 1 %if value <= 0
         default time = value
      %finish
      printstring("Time limit set to")
      write(value, 1);  printstring(" seconds")
      newline
      %return
s(1):!stack
      %if sym = '?' %and value = 0 %start
         sym = next
         value = default stack
      %else
         value = 1 %if value <= 0
         value = 350 %if value > 350
         default stack = value
      %finish
      printstring("Stack set to")
      write(value, 1)
      printstring("K bytes")
      newline
      %return
s(2):!password
      %routine get st
         st = ""
         st = tostring(sym) %if sym # 0
         %cycle
            sym = next;  %return %if sym = 0 %or sym  = ','
            st = st.tostring(sym)
         %repeat
      %end

      get st
      p_p3 = packed(st)
      %if p_p3 <= 0 %start
         printstring("Invalid new password")
         newline;  %return
      %finish
      p_dact = 23;  svc(20, p)
      %if p_p6 # 0 %start
         printstring("Set password fails: ")
         printstring(string(addr(p_p1)))
      %else
         printstring("New password set")
      %finish
      newline
      %return
s(7):!search
      get st
      length(st) = 6 %if length(st) > 6
      %if st = "" %start
         Search owner = ""
      %else %if st # "?"
         %if packed(st) <= 0 %start
            printstring("Invalid username ")
            printstring(st);  newline
            %return
         %finish
         st = st.":"
         Search owner = st
      %finish
      %if Search owner = "" %start
         printstring("No extra search")
      %else
         printstring("Load search includes ")
      %finish
      printstring(Search owner)
      newline
      %return
s(5):!width
   value = 80 %if value < 0
   p_p1 = 1;  p_p2 = 0;  p_p3 = value
   p_p2 = number %if sym = ':'
   svc(29, p)
   printstring("Terminal width set to")
   %if value = 0 %start
      printstring(" infinity")
   %else
      write(value, 1);  printstring(" characters")
   %finish
   newline
   %return
s(6):!prompt
      shift = 0
      get st
      shift = 32
      length(st) = 15 %if length(st) > 15
      charno(st, 1) = nl %if charno(st,1) = 13
      Command prompt = st
      %return
s(8):!tab
      here = 0
      %for n = 0, 1, 9 %cycle
         here = here+value
         byteinteger(addr(p_p3)+n) = here
         %if sym = '+' %then value = number %else value = 3
      %repeat
      p_p1 = 5;  p_p2 = 0;  svc(29, p)
      %return
s(9):!speed
      p_p1 = 7;  p_p2 = 0;  p_p3 = value
      p_p2 = number %if sym = ':'
      svc(29, p)
      %return
s(3):!page
   value = 0 %if value < 0
   p_p1 = 2;  p_p2 = 0;  p_p3 = value
   p_p2 = number %if sym = ':'
   svc(29, p)
   printstring("Page length set to")
   %if value = 0 %start
      printstring(" infinity")
   %else
      write(value, 1);  printstring(" lines")
   %finish
   newline
   %return
s(10):Get St
      Length(St) = 15 %if Length(St) > 15
      Error File = St
      %return
%end
   %routine set value
      %integer j, v
      %for j = lower, 1, upper %cycle
         %if keyword(j) = key %start
            %if j < 0 %start;          !takes no param
               %if sym = '=' %start
                  printstring(key."= ?");  newline
                  sym = next %until sym = 0 %or sym = ','
                  %return
               %finish
               set(j, 0)
            %else %if sym # '='
               printstring("Value for ".key."?");  newline
               sym = next %while sym # 0 %and sym # ','
            %else
               v = number
               set(j, v)
            %finish
            %return
         %finish
      %repeat
      printstring(key."?");  newline
   %end
   p = 0
   %cycle
      read key;  %exit %if key = ""
      set value
      %exit %if sym = 0
      %if sym # ',' %start
         %cycle
            printsymbol(sym);  sym = next
            %exit %if sym = 0 %or sym = ','
         %repeat
         printstring(" ?");  newline
      %finish
   %repeat
%end
%begin
   %include "Sysinc:Command.inc"
   Set(Command_Parameter)
%endofprogram
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
                  !###############################
                  !# Standard subsystem commands #
                  !###############################

%include "SysInc:command.inc"

%external %string(31)  %spec Command prompt
%external %integer %fn %spec SET STREAMS (%record(command fm)%name command,
                                      %string(*)%name input line,
                                      %integer start pos)
%external %routine %spec Open All    (%record(command fm)%name command)
%external %routine %spec Echo        (%integer on off)
                                      %const %integer off = 1
%external %routine %spec To upper    (%string(*)%name s)
%external %routine %spec To lower    (%string(*)%name s)
%external %routine %spec Pack        (%string(31) f, %record(filefm)%name x)
%external %routine %spec Unpack      (%record(filefm)%name x,%string(*)%name s)

%string(8) %fn access (%integer access)
   %string(8) res
   %short s
   %integer j
   res = ""
   %for j = 'A',1,'H' %cycle
      s = ' '
      s = j %if access&1 # 0
      res = res . to string (s)
      access = access>>1
   %repeat
   %result = res
%end

%external %predicate PRIVILEGED
   %record(parm fm) P
   P_p1 = 0;  SVC(14,P)
   %true %if P_p4 < 0
   %false
%end

%external %routine READ LINE (%string(*)%name s)
   %integer sym
   s = ""
   %cycle
      Read symbol (sym)
      %exit %if sym = NL
      s = s . to string(sym)
   %repeat
%end

%external %routine BECOME (%string(63) parm)
   %record(parm fm) P
   %byte %name c
   %string(63) pass
   %integer Ppass = 0, who
   %Label OK
   %unless parm = "" %or parm -> parm.(",").pass %start
      -> OK %if privileged
      Echo (off)
      Prompt ("Pass:")
      Read line (pass)
      Pack (pass.":", P_file)
      Ppass = P_file_owner
   %finish
OK:%if parm # "" %and char no(parm,length(parm)) = ':' %start
      length(parm) = length(parm) - 1
   %finish
   parm = parm.":"
   Pack (parm, P_file)
   who = P_file_owner
   P_p3 = Ppass;  P_p6 = 0
   P_dact = 27
   SVC (20, P)
   %if P_p6 # 0 %start
      Print string ("*Become fails -- ".P_text)
      Newline
   %else
      To lower (parm)
      c == char no(parm,1)
      c = c - 'a' + 'A' %if 'a' <= c <= 'z'
      parm = "Command:" %if who = 0
      Command prompt = parm
   %finish
%end

%external %routine COPY (%string(63) parm)
   %integer str = 0, sym
   %on 9 %start                      {End of input}
      %return %if str = 3
   %else
      %if Set streams(command,parm,0) # 0 %start
         Print string (parm)
         Print symbol ('?')
         Newline
         %return
      %finish
      %if command_in1 = "" %and command_out1 = "" %start
         Print string ("*Copy fails -- dubious input and output")
         Newline
         %return
      %finish
      Open All (command)
   %finish
   str = str + 1
   Select input (str)
   %cycle
      Read symbol (sym)
      Print symbol(sym)
   %repeat
%end

%external %routine FILES (%string(63) parm)
!
! MOUSES 'Files' program
! A.D. Culloch
!
! Altered: March 81 - wildcard processing
!
!
%const %integer to director = 20;         ! SVC numbers.
%const %integer unpack date = 13
%const %integer get dir = 17;             ! Director call nos.
%const %integer file status = 18
!                                           System record formats..
%record %format file fm  (%integer name1, name2,
                          %short %integer spine, day    %or
                          %integer name, pass,
                          %short   dir block, spare)
%record %format dir fm   (%short %integer mark,
                          %byte %integer rights, check,
                          %short %integer chain,
                          %byte %integer spare, perms,
                          %record(file fm) %array f(1:42))
!
!   Prog builds table of unpacked filenames as follows.
!
%record %format fd fm    (%string(13) name, %byteinteger p)
   %const %integer H = 16_FFFF
   %const %integer dollar bit = 1<<30, hash bit = 1<<31
   %const %integer max unit = 12;      !till Director will say dynamically
   %const %integer Pack error = 10;    !event#
   %const %integer non zero = 1
   %shortinteger flag, dollar, hash, star = 0
   %string(63)%name mess == Event_message
   %record(parm fm) P,Q
   %record(dir fm) D
   %record(fd fm) %array fd(1:42)
   %routine %spec Show files (%integer unit,user)

   %routine qsort(%record(fd fm) %array %name p, %integer a, b)
      %record(fdfm) dump
      %integer l, u
      %while a < b %cycle
         l = a;  u = b
         dump = p(u);  ->find

up:      l = l+1;  ->found %if l = u
find:    ->up %unless p(l)_name > dump_name
         p(u) = p(l)
down:    u = u-1;  ->found %if l = u
         ->down %unless p(u)_name < dump_name
         p(l) = p(u)
         ->up

found:   p(u) = dump
         l = l-1;  u = u+1
         %if l-a > b-l %start
            qsort(p,u, b);  b = l
         %else
            qsort(p,a, l);  a = u
         %finish
      %repeat
   %end

   %integer total = 0, j,k,m, ex, ifid, iext
   %integer unit, user
   %integer blocks, extents;               ! Statistics on disc use.
   %integer pos, files
   %string(*) %name id, fn
   %string(63) junk
   %string(8) acc
   %string(63) fid,ext
   %string(13) f
   %string(8) last; ! .EXT
   %record(fd fm) %name slot
   %record(file fm)%name u
   %integer exclam = 0, disc
   parm = parm.junk %while parm -> parm.(" ").junk
   to upper (parm)
   %if parm # "" %start
      exclam = char no (parm,length(parm))
      %if exclam = '!' %or exclam = '?' %then length(parm) = length(parm)-1 %c
                                        %else exclam = 0
   %finish
   !
   !   Read directory block.
   !
   unit = 0;  user = 0;               ! Default to requesting process.
   %if parm -> f . (":") . parm %start
      %if f = "*" %start;             ! all discs, all users
         star = non zero
         %for j = 1,1,max unit %cycle
            P_p1 = j;  P_dact = 1;    ! name of disc j
            SVC (To Director,P)
            disc = P_p1
            %continue %if P_p6 # 0 %or disc = 0;   !not loaded?
            P_p1 = j;  P_dact = 20;   ! read catalog block
            P_p6 = addr(D);  SVC (To Director,P)
            %continue %if P_p6 # 0
            %for k = 1,1,42 %cycle
               u == D_f(k);     ! kth user slot
               %continue %if u_name = 0
               Show files (disc,u_name)
            %repeat
         %repeat
      %else
         %begin
            %on %event pack error %start
               print string ("*".event_message)
               newline
            %finish
            Pack (f.":",P_file)
            Show Files (P_p1,P_p2)
            %stop
         %end
      %finish
      %if total > 0 %start
         newline;  print symbol ('(')
         write (total,0)
         print string (" files total)")
         newline
      %finish
   %finish
   Show files (0,0) %if total = 0
   %if total = 0 %start
      print string ("No files")
      newline
   %finish
   
   %routine Show files (%integer {packed} unit, user)
      %record(dir fm) D
      %record(parm fm) P
      %string(63) f, junk
      %integer j,k
      %on Pack error %start
         print string ("*" . event_message)
         newline
         %return
      %finish
      files = 0
      P_p1 = unit;  P_p2 = user;  P_dact = get dir;  P_p6 = addr(D)
      SVC (to director,P)
      %if P_p6 # 0 %start
         %return %if P_p6 = -3 {access restricted} %and star # 0
         print string ("*Files fails -- ".P_text);  newline
         %return
      %finish
      !
      !   Pack filename with "wild" '*' fields represented
      !   by zeros. 
      !
      parm = parm . "." %unless parm -> (".")
      parm -> fid . (".") . ext
      dollar = 0;  hash = 0
      ifid = 0;  iext = 0
      dollar = 1 %if fid -> ("$") . fid
      hash   = 1 %if (fid -> fid . ("#") . junk %or
                      ext -> ext . ("#") . junk) %and junk = ""
      Pack(fid,P_file) %and ifid=P_p3 %and iext=iext!(P_p4&(\H)) %if fid # "*"
      Pack (".".ext,P_file) %and iext = iext ! (P_p4&H) %if ext # "*"
      !
      !   Build table (FD) of directory entries
      !   which match the wildcard specification
      !   in parameter (PARM) - default "" is *.*
      !
      %for j = 1,1,42 %cycle
         %if D_f(j)_name2 # 0 %start;    ! Dir. entry in use?
            P_p1 = 0;  P_p2 = 0;  P_p3 = D_f(j)_name1;  P_p4 = D_f(j)_name2
            %continue %unless ifid = iext = 0 {*.*} %or
                              (ifid = 0 = iext>>16 {*.IMP} %and P_p4&H=iext&H) %or
                              (iext&H = 0 {X.*} %and P_p3=ifid %and
                                                     P_p4>>16 = iext>>16) %or
                              (ifid = P_p3 %and iext = P_p4)
            %continue %if (hash # 0 %and P_p3&hash bit = 0) %or
                          (dollar#0 %and P_p3&dollar bit=0)
            Unpack (record(addr(P_p1)),f)
            files = files + 1
            to lower (f)
            %if 'a' <= char no (f,1) <= 'z' %start
               char no (f,1) = char no (f,1) - 'a' + 'A'
            %finish
            fd(files)_name = f
            fd(files)_p = j;             ! actual directory slot
         %finish
      %repeat
      total = total+files
      !
      Qsort (fd,1,files)
      !
      !   Display the information.
      !
      %routine show(%integer n)
         %integer m
         %string(31) file
         %return %if n > files
         flag = 1
         m = 1
         file = fd(n)_name
         m = m+1 %while m <= length(file) %and charno(file, m) # '.'
         file = file." " %while length(file)-m < 4
         spaces(16-length(file))
         printstring(file)
      %end
      !
      %return %if files = 0
      write (files,0);  print string (" file")
      print symbol ('s') %unless files = 1
      %unless unit = user = 0 %start
         print string (" owned by ")
         P_p1 = unit;  P_p2 = user;  P_p3 = 0;  P_p4 = 0
         unpack (record(addr(P_p1)),junk)
         print string (junk)
      %finish
      newline
      %if exclam = '?' %start;   ! FILES?
         last = ""; ! Prev filename.
         %for j = 1,1,files %cycle
            id == fd(j)_name
            %for k = length(id),-1,0 %cycle
               %if k = 0 %start; ! no .EXT
                  k = length(id) + 1
                  %exit
               %finish
               %exit %if char no (id,k) = '.'
            %repeat
            %if substring(id,1,k-1) # last %start
               last = substring(id,1,k-1)
               new line
               id = id."." %if k > length(id)
               id = id." " %while length(id) - k < 3
               spaces (14 - length(id))
               print string (id)
               %continue
            %finish
            spaces (6 - (length(id) - k))
            print string (substring(id,k,length(id))); ! .EXT
         %repeat
         newline
      %else %if exclam = 0;     ! FILES
         ex = (files+3)>>2
         %for j = 1,1,ex %cycle;        ! Rows.
            flag = 0
            show(j);  show(j+ex);  show(j+ex+ex);  show(j+ex+ex+ex)
            newline %if flag # 0
         %repeat
      %else;                             ! FILES!
         print string ("
Filename              created   permissions  flags    blocks(extents)
")
         blocks = 0;  extents = 0
         %for j = 1,1,files %cycle
            slot == fd(j)
            print string (slot_name);  spaces (20 - length(slot_name))
            P_p1 = unit;  P_p2 = user
            P_p3 = D_f(slot_p)_name1
            P_p4 = D_f(slot_p)_name2
            P_dact = file status
            SVC (to director,P)
            %if P_p6 # 0 %start
               print string (P_text)
               newline
               %continue
            %finish
            Q_p1 = P_p5 & (\(3<<14));    ! Date file last used.
            SVC (unpack date,Q)
            print string (Q_text)
            spaces (12 - length(Q_text))
            acc = access(P_p4);          ! File access permissions.
            print string (acc)
            spaces (15 - length(acc))
            %if P_p5&X'4000' # 0 %then print symbol ('a') %else space
            %if P_p5&X'8000' # 0 %then print symbol ('u') %else space
            write (P_p2,11);              ! Blocks.
            blocks = blocks + P_p2
            print symbol ('(')
            write (P_p3,0);              ! Extents.
            extents = extents + P_p3
            print symbol (')')
            newline
         %repeat
         newline
         print string ("Access rights: ".access(D_rights).    %c
                       ",  directory permissions: ".access(D_perms))
         newline
         write (blocks,0); print string (" blocks in")
         write (extents,1);print string (" extents")
         newlines (2)
      %finish
      newline
   %end;   !Show files
%end {of FILES}

%external %routine PURGE (%string(63) parm)
   %record(parmfm) p
   p_dact = 16;  svc(20, p)
   %if p_p6 # 0 %start
      printstring("Purge fails -- ")
      printstring(string(addr(p_p1)))
   %else %if p_p1 = 0
      printstring("No files deleted")
   %else
      write(p_p1, 1);  printstring(" file")
      printsymbol('s') %if p_p1 # 1
      printstring(" deleted")
   %finish
   newline
%end

%external %routine RENAME (%string(63) parm)
   %string(63) in1, out1
   To upper (parm)
   parm = parm.in1 %while parm -> parm.(" ").in1
   %unless parm -> in1.("/").out1 %start
      Print string ("*Form is  RENAME oldname/newname")
      Newline
      %return
   %finish

   %record %format slot fm      (%integer name1, name2,   {packed filenames}
                                 %short   spine block,    {disc addr of spine}
                                 %short   day)            {usage/archive inf}
   %record %format directory    (%short   files,          {dir slots in use}
                                 %byte    access rights,  {of owner}
                                 %byte    check,          {'?'}
                                 %short   spare, %byte spare2,
                                 %byte    access permissions,
                                 %record(slot fm)%array f(1:42))
   %record(directory) D
   %const %integer H = 16_FFFF, To Director = 20, files = {dact} 17
   %const %integer pack fail = {event} 10
   %record %format pack file (%integer unit,name,name1,name2)
   %integer j, iin1, iout1, iinext, ioutext
   %record(slot fm)%name f
   %record(parmfm) P
   %string(15) in ext, out ext

   %routine rename (%record(parm fm) P)
      %const %integer rename = 15;       !Director DACT, SVC#
      %record(filefm) f1, f2
      %string(31) fn1, fn2
      f1 = record(addr(P_p1));  f1_unit = 0;  f1_owner = 0
      f2 = record(addr(P_p3));  f2_unit = 0;  f2_owner = 0
      unpack (f1,fn1);  unpack (f2,fn2)
      P_dact = rename;  SVC (To Director,P)
      %if P_p6 = 0 %start
         print string (fn1 . " renamed " . fn2)
      %else
         print string ("*cannot rename " . fn1 . " as " . fn2 . %c
                       " -- " . P_text)
      %finish
      newline
   %end

   %routine hashfile (%string(63)%name s);         !FRED# -> FRED.#  ?
      %return %if s -> (".")
      %if char no (s,length(s)) = '#' %start
         length(s) = length(s) - 1
         s = s . ".#"
      %finish
   %end

   %on %event pack fail %start
      print string ("*rename fails -- " . event_message)
      newline
      %stop
   %finish

   P_dact = files;  P_p1 = 0;  P_p2 = 0;  P_p6 = addr(D)
   SVC (to Director,P);                 !Read our directory block
   %if P_p6 # 0 %start
      print string ("*Rename fails -- " . P_text)
      newline
      %stop
   %finish
   %if in1 = "*.*" %or out1 = "*.*" %start
      %stop %if in1 = out1;             !RENAME *.*/*.*?
Bad Wild:
      print string ("Incorrect wildcard usage")
      newline
      %stop
   %finish
   hashfile (in1);  hashfile (out1)
   in1 = in1."." %unless in1 -> (".")
   out1=out1."." %unless out1-> (".")
   in1  -> in1 . (".") . in ext;        !Peel off extensions
   out1 -> out1. (".") . out ext
   %if in1 = "*" %start;                !RENAME *.IMP/*.OLD
      ->Bad Wild %unless out1 = "*" %and outext # "*"
      Pack (".".out ext, P_file);  ioutext = P_p4
      Pack (".".in ext, P_file);   iin ext = P_p4
      %for j = 1,1,42 %cycle
         f == D_f(j)
         %continue %if f_name2 = 0 %or iinext&H # f_name2&H
         P_p3 = f_name1;  P_p4 = f_name2
         P_p5 = P_p3;     P_p6 = (P_p4&(\H)) ! ioutext&H
         Rename (P)
      %repeat
   %else %if in ext = "*";              !RENAME FRED.*/JIM.*
      ->Bad Wild %unless out ext = "*" %and out1 # "*"
      Pack (in1,P_file)
      iin1 = P_p3;  iinext = P_p4
      Pack (out1,P_file)
      iout1 = P_p3; ioutext= P_p4
      %for j = 1,1,42 %cycle
         f == D_f(j)
         %continue %if f_name2 = 0 %or f_name1 # iin1 %or
                                       f_name2>>16 # iinext>>16
         P_p3 = f_name1;  P_p4 = f_name2
         P_p5 = iout1;    P_p6 = (ioutext&(\H)) ! f_name2&H
         Rename (P)
      %repeat
   %else;                               !RENAME FRED.IMP/JIM.IMP
      out1 = in1 %if out1 = "*"
      out ext = in ext %if out ext = "*";  !RENAME FRED.IMP/*.XXX etc
      Pack (in1.".".in ext,P_file)
      iin1 = P_p3;  iinext = P_p4
      Pack (out1.".".outext,P_file)
      P_p5 = P_p3;  P_p6 = P_p4
      P_p3 = iin1;  P_p4 = iinext
      Rename (P)
   %finish
%end                                     {RENAME}

%external %routine DELETE (%string(63) parm)
   %string(63) xparm
   parm = xparm.parm %while parm -> xparm.(" ").parm
   To upper (parm)

   !file system formats
   %record %format file fm   (%integer name1, name2,   {packed filename}
                              %short   spine block,    {disc addr of spine}
                              %short   day)            {last used/archive inf}
   %record %format directory (%short files,            {no of slots in use}
                              %byte  access rights,    {rights of dir's owner}
                              %byte  check,            {'?'}
                              %short spare, %byte spare2,
                              %byte  access permissions, {who can see dir?}
                              %record(file fm) %array file(1:42))
   %record(directory) D
   parm = parm . ","
   %string(63) file, extn
   %record(parm fm) P
   %integer fx;                           !index in D
   %record(file fm)%name f;               !points to corr. file slot
   %const %integer H = 16_FFFF;           !Halfword mask for extension
   %const %integer delete = 14, files = 17;!Director DACTs

   %routine To Director (%record(parm fm) P);!P is request to Director
      %const %integer To Director = 20;   !SVC number
      %string(63) filename
      UNPACK (record(addr(P_p1)),filename)
      SVC (To Director,P)
      %if P_p6 = 0 %start;                !OK
         print string (filename." deleted")
      %else
         print string ("*cannot delete " . filename . " -- " . P_text)
      %finish
      newline
   %end

   P_dact = files;  P_p1 = 0;  P_p2 = 0;  P_p6 = addr(D)
   SVC (20,P)
   %if P_p6 # 0 %start
      print string ("FILES fails -- " . P_text)
      newline
      %stop
   %finish
   %while parm -> file . (",") . parm %cycle;   !pick off file ids
      %continue %if file = ""
      %begin
         %const %integer PACK fails = 10
         %on %event PACK fails %start
            print string ("*" . event_message)
            newline
            %return
         %finish
         file = file . "." %unless file -> (".");  !make extn explicit
         file -> file . (".") . extn;     !split filename
         %if extn = "*" %start;           !FRED.*
            %if file {also} = "*" %start
               print string ("*.* -- No!")
               newline
               %return;                   !to peel off next file id
            %finish
            PACK (file,P_file);  P_dact = delete
            %for fx = 1,1,42 %cycle
               f == D_file (fx)
               %if f_name2 # 0 %and
                   f_name1 = P_p3 %and 
                   f_name2&(\H) = P_p4&(\H) %start
                  P_p4 = (P_p4&(\H)) ! f_name2&H
                  To Director (P);                !dump success/fail message
               %finish
            %repeat
         %else %if file = "*";            !*.EXE
            PACK (".".extn,P_file);  P_dact = delete
            %for fx = 1,1,42 %cycle
               f ==  D_file(fx)
               %if f_name2#0 %and f_name2&H = P_p4&H %start; !extensions match
                  P_p3 = f_name1
                  P_p4 = (P_p4&H) ! (f_name2&(\H))
                  To Director (P)
               %finish
            %repeat
         %else;                          !plain FRED.IMP
            file = file . "." . extn %if extn # ""
            PACK (file,P_file)
            P_dact = delete
            To Director (P)
         %finish
      %end
   %repeat
%end

%external %routine ANALYSE (%string(63) filename)
   %routine single(%integer n, %string(23) s)
      write(n, 3)
      printstring(s)
      printsymbol('s') %unless n = 1
      spaces(2)
   %end
   %record(parmfm) p
   %record(file fm) f
   %integer j
   %on 10 %start
      Print string("*".EVENT_message);  newline
      %return
   %finish
   Pack (filename,P_file)
   P_dact = 18
   SVC (20, p)
   %if p_p6 # 0 %start
      Print string (string(addr(P_p1)));  newline
      %return
   %finish
   printstring(filename)
   single(p_p2, " block")
   single(p_p3, " extent")
   printstring("  Access: ".access(P_p4))
   printstring("   Created:")
   p_p1 = p_p5;  svc(13, p)
   printstring(string(addr(p_p1)))
   newline
%end

%external %routine STATE (%string(63) parm)
   %record(parmfm) p
   %string(15) who, version
   %integer unit, owner, console, priv, users, process
   %integer svcs, pons
   %routine show access(%integer N)
      Print string (access(N))
   %end
   svc(19, p)
   users = p_p2
   version = string(addr(p_p6))
   p_p1 = 0;  svc(14, p)
   process = p_dsno&31
   unit = p_p1
   owner = p_p2
   priv = p_p4>>31
   console = p_p6
   p_p3 = 0;    p_p4 = 0
   svc(18, p)
   who = string(addr(p_sact))
   printstring("Mouses V");  printstring(version);  space
   printstring(who)
   printstring(" console");  write(console, 1)
   printstring(", process");  write(process, 1)
   printstring(" *privileged*") %if priv # 0
   %if users > 1 %start
      printsymbol(',')
      write(users-1, 1)
      printstring(" other user")
      printsymbol('s') %unless users = 2
   %finish
   newline
   p_dact = 26;  p_p1 = 0;  p_p2 = 0;  svc(20, p)
   %if p_p6 = 0 %start
      printstring("User access:".access(P_p1))
      printstring("   Directory access:".access(P_p2))
      newline
   %finish
%end

%external %routine Z (%string(63) parm)   {V200 clear screen}
   %constinteger ESC = 27, NUL = 0
   %integer j
   print symbol (ESC);  print symbol ('v')
   print symbol (NUL) %for j = 1,1,20
%end

%end %of %file
 H?   - --                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %begin
   %externalpredicatespec Exists(%string(31) File)
   %externalroutinespec Obey(%string(31) In, Out, %string(63) Param)
   %systemroutinespec Let(%string(31) Old, New)
   %externalroutinespec Do(%string(127) What)
   Print string ("Process started ".DATE." ".TIME);  Newline
   Let("C", "Copy")
   Let("E", "Edit")
   Let("V", "Ecce:ecce")
   Let("I", "Imp")
   Let("F", "Files")
   Do("Lib Nexe:Standard")
   Do("Lib Nexe:Batch")
   Obey("Startup.com", "Out:", "LOGIN") %if Exists("Startup.com")
%endofprogram
 H?    [                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %begin;                                  !TELL program.  A. Culloch
   %option "Nostack,Noopen,Upper"
   %include "Sysinc:command.inc"
   %routinespec stop
   %conststring(3) TTY dev = "T:"
   %record %format parm fm (%shortinteger dsno,dact,ssno,sact, %c
                           %integer p1,p2,p3,p4,p5,p6)
   %const %integer locate process = 5
   %const %integer process info = 14
   %const %integer pack filename = 17
   %const %integer unpack filename = 18
   %const %integer to director = 20;     !svc#
   %const %integer to accnt = 36;         !pass message to accountant process
   %const %integer status = 18
   %const %integer become = 27;          !dact
   %const %integer input ended = 9;      !event #
   %externalpredicatespec Exists(%string(31) File)
   !%option "NOstack,NOopen,Upper"
   %record(parm fm) P, Q
   %string(63) in1, out1
   %string(63)%name parm
   %external %string(17) %spec command prompt
   command prompt = "Command:";          !save confusing already BECOMEd users
   parm == Command_parameter
   %string(63) subj
   %integer j,c
   subj = ""
   %integer exclam = 0
   %for j = length(parm),-1,1 %cycle
      c = char no (parm,j)
      %if c = ')' %or c = ']' %or c = '}' %start
         subj = sub string (parm,1,j-1)
         j = j + 1 %until j > length(parm) %or char no (parm,j) > ' '
         parm = sub string (parm,j,length(parm))
         %exit
      %finish
   %repeat
   %if parm # "" %and char no (parm,length(parm)) = '!' %start
      length (parm) = length (parm) - 1
      exclam = 1
   %finish
   %if parm -> in1 . ("/") . out1 %start
   %finish %else in1 = "" %and out1 = parm
   P_p1 = 0;  P_p2 = x'D417A';  P_p3 = x'1BE81D81';  P_p6 = 0
   P_dact = BECOME;  SVC (to director,P)
   %if P_p6 # 0 %start
      print string ("TELL fails -- " . string(addr(P_p1)));  newline
      stop
   %finish
   %if out1 = "" %start
      print string ("TELL file / user")
      newline
      stop
   %finish
   length (out1) = length (out1) - 1 %if char no (out1,length(out1)) = ':'
   string (addr(P_sact)) = out1 . ":"
   SVC (pack filename,P)
   %if P_p2 < 0 %or P_p1 # 0 %or P_p4 & x'FFFF' # 0 %start
      print string ("*Invalid username - " . out1)
      newline
      stop
   %finish
   %if exclam # 0 %start
      %if length (subj) > 19 %start;   ! > 1 message
         length (subj) = 19
         print string ("Message truncated to '".subj."'
");   %finish
      SVC (locate process,P);          !POWNER => DSNO
      P_p6 = P_p1;  string (addr(P_p1)) = subj
      SVC (to accnt,P);                !relay message -> console
      stop
   %finish
   %if exists (out1) %start
      open input (1,out1)
   %else
      open input (1,"Null:")
   %finish
   select output (0)
   in1 = TTY dev %if in1 = ""
   %if in1 = TTY dev %start
      print string ("Enter message.  Type CTRL/D to stop")
      newline
   %finish
   open output (1,out1)
   select output (1)
   !append new text to file
   select input (1)
   %begin
      %on input ended %start
         %return
      %finish
      print symbol ('*')
      skip symbol %if next symbol = '*'
      %cycle
         print symbol (next symbol)
         skip symbol
      %repeat
   %end
   P_p1 = 0;  SVC (process info,P)
   P_p1 = 0;  P_p3 = 0;  P_p4 = 0;  SVC (unpack filename,P)
   print string ("From ")
   print string (string(addr(P_sact)))
   string (addr(Q_p1)) = "mail from " . string (addr(P_sact))
   length(string(addr(Q_p1))) = length(string(addr(Q_p1))) - 1
   space;  print string (date);  space;  print string (time);  space
   print string (" Subject:" . subj) %if subj # ""
   newline
   prompt ("")
   open input (1,in1)
   select input (1)
   %begin
      %integer ch
      %on input ended %start; %return; %finish
      %cycle
         read symbol (ch)
         %if NL # ch < ' ' %then print symbol ('?') %else print symbol (ch)
      %repeat
   %end
   print symbol (0);   !invisible frig seps messages
   close input
   close output
   string (addr(P_sact)) = out1 . ":";   !dest user
   SVC (pack filename,P)
   SVC (locate process,P)
   Q_p6 = P_p1;                          !dest service no
   SVC (to accnt,Q) %if P_p1 > 0;       !relay message if dest logged on
   !Back with P_p1 < 0 => no accountant there
   !If he was there, he sent a notify to "TO"
   stop
   %routine stop
      P_dact = become;  P_p2 = 0;  P_p6 = 0
      SVC (to director,P)
      %stop
   %end
%end %of %program
 H?   	 	^                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %begin
   printstring("Hello there")
   newline
%endofprogram
 H?    h                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!             }                        NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z        a     dQ@    D"Z 	ox           Hello there
     ?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nGHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$  w P (A  , X W   HW  ,x                                             |                                                                                                                                                                           0                                                              x                                                                                   $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                                                            4                                                         p                                             H?    j                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !Mag tape archiving program

!Format of archive tapes:
!
!   Tape ID  TM  Label fid ... TM fid ... TM fid ... TM fid ... TM EM
!            TM  Label fid ... TM fid ... TM fid ... TM fid ... TM EM
!
!                        .  .  .  .  .  .  .  .  .  .
!
!            TM  Label fid ... TM fid ... TM fid ... TM fid ... TM EM
!            TM  EOT
!
!   TM:      Tape mark.
!   Tape ID: Header, text part anything
!   Label:   Ditto
!   fid:     File identifier - header block, text part is a full file
!            name UNIT_USER:FILE.EXT.  Index part is a file sequence no.
!   EM:      A header block, text part "**end**"
!   EOT:     A header block, text part "**end of tape**"
!
!   A "header block" is 63 bytes: 60 bytes IMP string (text) +
!                                  2 bytes sequence no (binary) +
!                                  2 bytes spare.

%begin
   %include "Sysinc:command.inc"
   %externalstring(15)%spec Console Int
   %const %string(3) version = "1.6"

   !*Machine-code bootstrap tables

   %ownshortintegerarray Bootstrap(1:40) =
      !Loaded by 50-seq (50-seq called from STRAP1).
      !Loads system image on tape (512-byte blocks) -> store @ x'C00' up
      X'C810',X'00F0',
      x'D320',x'0078',x'C830',x'0C00',x'2458',x'9E15',x'9D20',x'C300',x'0010',
      x'2233',x'3403',x'9A10',x'9813',x'CA30',x'01FF',x'3403',x'9A10',x'9813',
      x'DE20',x'8023',x'DE10',x'801E',x'2631',x'9D10',x'2081',x'9E15',x'9D20',
      x'C300',x'0040',x'4330',x'FFCC',x'D1D0',x'0EF4',x'087F',x'C84E',x'0018',
      x'030E',x'F0E1'
   %ownintegerarray xC00 BOOT(0:127) =
      !Standard disc bootstrap (lives at X'C00'). 
      x'C88000C6',x'2501F810',x'FFF00CF4',x'50010000',
      x'58210000',x'23332614',x'2036111C',x'101C5010',
      x'090441F0',x'0C2624D0',x'24C2C860',x'0E00F8B0',
      x'0001FFFF',x'C8A000F0',x'C89000B6',x'DE900CF0',
      x'9DAE2081',x'9D9E94EE',x'C3E08200',x'21122333',
      x'DE900CF0',x'9D8E2347',x'C3E00010',x'2034C3E0',
      x'0040023F',x'9D8E021F',x'2387222B',x'988DDE80',
      x'0CEC4140',x'0CE0988D',x'DE800CED',x'41400CE0',
      x'DEA00CF0',x'34E69AAE',x'98A634EB',x'9AAE98AB',
      x'988D9A9C',x'DE900CF1',x'DEA00CEE',x'9DAE2081',
      x'DEA00CF0',x'9D9E2125',x'C3E00080',x'2234030F',
      x'2148021F',x'D1D00EF4',x'087FC84E',x'0018030E',
      x'C3E00010',x'033F9BA0',x'99AE3400',x'06E00BE6',
      x'26E2C4E0',x'FF000A6E',x'07CC26D1',x'43000C76',
      x'9D9E2221',x'9D8E027F',x'20820304',x'C1C23010',
      x'48C10000',x'FFFFFFFF',x'FFFFFFFF',x'FFFFFFFF',
      x'00000000'(*)

   !Boot tape format:
   !
   !      _________________________________________________________....
   !     |          |                  |                               
   !     |  Boot    |   x'C00' loader  |     System image        TM
   !     |__________|__________________|____________________________...______..
   !        block 0         block 1          blocks 3,4,5,..
   !
   !
   !All this is the "label" part of an archive format tape,
   !which is as normal after the tape mark.


   %constinteger H = x'FFFF'
   %constinteger default password = x'10685B';   !PASS:
   %recordformat parmfm(%shortinteger dsno, dact, ssno, sact, %c
                        %integer p1, p2, p3, p4, p5, p6)
   %recordformat filefm(%integer name1, name2, %c
                        %shortinteger spine, day)
   %recordformat dirfm(%shortinteger mark, %c
                       %byteinteger access, check, %c
                       %shortinteger chain, %c
                       %byteinteger spare, daccess, %c
                       %record(filefm)%array file(1:42))
   %recordformat packfm(%integer unit, owner, name1, name2)
   %recordformat blockfm(%string(59) text, %shortinteger index, spare)
   %record(blockfm) BL
   %owninteger file number = 0
   %integer exclam = Command_Modifier

   %record(packfm) F
   %record(packfm) owner
   %record(file fm) dir entry
   %ownstring(63) em = "***end***"
   %ownstring(63) eot= "***end of tape***"
   %string(63) unit, username
   %ownstring(63) head text = "***no label***"
   %string(63) word, key
   %owninteger sym = ' ', sp = ' ', used = 0, create = 0, out unit = 0
   %string(15)%name int
   %integer error, unit no, x
   %own %integer sys disc = 2;   !default
   %constinteger user list = 301
   %byteintegerarray b(0:2047)
   %const %integer max user = 20
   %integer %array user(1:max user)
   %integer users

   %predicate wanted (%integer username)
      %integer j
      %for j = 1, 1, users %cycle
         %true %if user(j) = username
      %repeat
      %false
   %end

   %routinespec release tape
   %routinespec rewind

   %routine prepare terminal
      %record(parmfm) P
      p_p1 = 1;  p_p2 = 0;  p_p3 = 0;  svc(29, p); !width=0
      p_p1 = 2;  p_p2 = 0;  p_p3 = 0;  svc(29, p); !page =0
      p_p1 = 100000;  svc(21, p);                  !time =100000
   %end
   %routine stop
      rewind
      release tape
      select output(1)
      close output
      select output(0)
      %stop
   %end
   %routine report(%string(63) text, %integer value)
      selectoutput(0)
      printstring(text)
      write(value, 0) %if value # 0
      newline
      selectoutput(1)
   %end
   %predicate create user(%integer unit, owner)
      %record(parmfm) p
      p_dact = 31
      p_p1 = unit
      p_p2 = owner
      p_p3 = default password
      p_p4 = 0;  p_p5 = 0;  p_p6 = 0
      svc(20, p)
      %if p_p6 = 0 %or p_p6 = -2 %then %true
      %false
   %end
   %routine become(%integer unit, owner)
      %record(parmfm) p
      %unless create user(unit, owner) %start
         printstring("Cannot create user")
         newline
         %return
      %finish
      p_dact = 27
      p_p1 = unit
      p_p2 = owner
      p_p3 = 0
      p_p4 = 0
      p_p5 = 0
      p_p6 = 0
      svc(20, p)
      %if p_p6 # 0 %start
         printstring("Cannot become -- ")
         printstring(string(addr(p_p1)))
         newline
      %finish
   %end
   %routine pack(%string(31) file, %record(packfm)%name f)
      %record(parmfm) P
      string(addr(p_sact)) = file
      svc(17, p)
      f_unit = p_p1
      f_owner = p_p2
      f_name1 = p_p3
      f_name2 = p_p4
   %end
   %routine unpack(%record(packfm)%name f, %string(*)%name file)
      %record(parmfm) p
      p_p1 = f_unit
      p_p2 = f_owner
      p_p3 = f_name1
      p_p4 = f_name2
      svc(18, p)
      file = string(addr(p_sact))
   %end

   %routine read block(%integer block no, %record(dirfm)%name dir)
      %record(parmfm) p
      p_sact = 1
      p_p1 = block no&H
      p_p2 = addr(dir)
      p_p3 = unit no
      p_p4 = 0
      svc(101, p)
      %if p_p1 # 0 %start
         select output(0)
         printstring("Read block ")
         write(block no, 0)
         printstring(" on unit ");  write(unit no, 0)
         printstring(" fails ");  write(p_p1, 0)
         newline
         stop
      %finish
   %end

   %routine read sym
      readsymbol(sym)
      sym = sym-32 %if 'a' <= sym <= 'z'
   %end
   %routine read(%integername n)
      %integer s
      n = 0
      %cycle
         read sym
         %return %if sym = nl
         %unless '0' <= sym <= '9' %start
            n = -1
            printstring("Invalid file number");  newline
            %return
         %finish
         n = n*10+(sym-'0')
      %repeat
   %end
   %routine read word(%string(63)%name s)
      s = ""
      read sym %while sym = ' '
      %cycle
         %exit %if sym = sp %or sym = nl
         s = s.tostring(sym) %if length(s) # 63
         read sym
      %repeat
      sp = ' '
   %end

!Tape operations

   %routine claim tape
      %record(parmfm) p
      %cycle; !till succeeds
         p_dact = 1;  svc(105, p)
         %exit %if p_p6 = 0
         report("Tape already claimed - force released", 0)
         release tape
      %repeat
   %end
   %routine release tape
      %record(parmfm) p
      p_dact = 2;  svc(105, p)
   %end
   %routine function(%integer n)
      %record(parmfm) p
      p_dact = 10;  p_p1 = n;  svc(105, p)
      error = p_p6
   %end
  %routine clear
      function(1)
      report("Clear fails ", error) %if error # 0
   %end
   %routine tape mark
      function(2)
      report("Tape mark fails ", error) %if error # 0
   %end
   %routine rewind
      function(3)
   %end
   %routine skip forward
      function(4)
      report("Skip forward fails ", error) %if error # 0
   %end
   %routine skip reverse
      function(5)
      report("Skip reverse fails ", error) %if error # 0
   %end
   %routine backspace
      function(6)
      report("Backspace fails ", error) %if error # 0
   %end
   %routine read tape(%integer buffer, size)
      %record(parmfm) p
      p_dact = 8;  p_p2 = buffer;  p_p4 = size
      svc(105, p)
      error = p_p6
   %end
   %routine writetape(%integer buffer, size)
      %record(parmfm) p
      p_dact = 9;  p_p2 = buffer;  p_p4 = size
      svc(105, p)
      error = p_p6
   %end

   %integerfn find unit no(%integer packed unit)
      %record(parmfm) p
      %result = 0 %if packed unit = 0
      p_dact = 45;  p_p1 = packed unit;  svc(20, p)
      %if p_p6 # 0 %start
         report(string(addr(p_p1)), p_p6)
         %result = 0
      %finish
      %result = p_p1
   %end
   %routine terminate
      %record(blockfm) bl
      bl_text = eot
      bl_index = file number
      write tape(addr(em), 63)
      tape mark
      write tape(addr(BL), 63)
   %end
   %routine skip to end
      %record(blockfm) BL
      function(5);      !skipr
      %cycle
         skip forward
         read tape(addr(bl), 63)
         %exit %if bl_text = eot
      %repeat
      file number = bl_index
      backspace
   %end
   %routine dump header
      %string(63) h
      skip to end
      h = head text." on ".date." at ".time
      write tape(addr(h), 63)
      printstring("Adding label - ");  printstring(h);  newline
   %end
   %routine dump system
      %record(block fm) BL
      %integer j, old;  old = unit no
      %byte %integer %array B(0:511)
      dump header
      print string ("<- $BOOT.SYS#");  newline
      file number = file number + 1
      BL_index = file number;  BL_text = "$BOOT.SYS#"
      write tape (addr(BL),63)
      unit no = sys disc
      %for j = 1,1,255 %cycle;         !dump image from fixed sys area on disc
         read block (j,record(addr(B(0))))
         write tape (addr(B(0)),512)
      %repeat
      tape mark
      terminate
      unit no = old
   %end
   %routine dump bootstrap
      %byte %integer %array B(0:511)
      %integer j,k
      write tape (addr(bootstrap(1)),40*2);  !loaded by 50-seq
      write tape (addr(xC00 Boot(0)),512);   !not in system image
      open input (3,"BOOT:MAGTAPE.SYS")
      select input (3)
      %for j = 1,1,255 %cycle;               !copy tape sys from SLOAD file
         read symbol (B(k)) %for k = 0,1,511
         write tape (addr(B(0)),512)
      %repeat
      close input
      select input (1)
   %end

   %routine dump file(%record(filefm)%name file)
      %record(blockfm) BL
      %integer p, s, index, bp
      %byteintegerarray buf(1:512)
      %record(parmfm) fp, ap
      %record(packfm) f
      %return %if file_name2 = 0
      f_unit = owner_unit;  f_owner = owner_owner
      f_name1 = file_name1;  f_name2 = file_name2
      unpack(f, bl_text)
      fp_p1 = f_unit
      fp_p2 = f_owner
      fp_p3 = f_name1
      fp_p4 = f_name2
      ap = fp;                     !save for later
      fp_dact = 4
      svc(20, fp)
      index = fp_p5
      %if fp_p6 # 0 %start
         report("Cannot open ".BL_text." -- ".string(addr(fp_p1)), 0)
         %return
      %finish
      %if used # 0 %and fp_p4&x'C000' = 0 %start
         fp_dact = 11;  fp_p5 = index;  svc(20, fp)
         %return
      %finish
      printstring("<- ".BL_text);  newline
      b(0) = 255
      file number = file number+1;  bl_index = file number
      write tape(addr(BL), 63)
      p = 0;  bp = 512
      %cycle
         %if bp = 512 %start
            bp = 0
            fp_dact = 7;  fp_p4 = addr(buf(1));  fp_p5 = index
            svc(20, fp)
            %exit %if fp_p6 < 0
         %finish
         bp = bp+1;  p = p+1;  b(p) = buf(bp)
         %if p = 2047 %start
            p = 0
            write tape(addr(b(0)), 2048)
            %exit %if int # ""
         %finish
      %repeat
      int = ""
      %while p < 2047 %cycle
         p = p+1;  b(p) = 4
      %repeat
      b(0) = 0
      write tape(addr(b(0)), 2048)
      tape mark
      fp_dact = 11; fp_p5 = index;  svc(20, fp)
      printstring("Close fails -- ".string(addr(fp_p1))) %if fp_p6 # 0
      %if used # 0 %start
         ap_dact = 46;  svc(20, ap);         !remove usage bits
      %finish
   %end
   %routine dump user(%record(filefm)%name file)
      %integer j
      %record(dirfm) spine
      %return %if file_name2 = 0
      owner_owner = file_name1
      unpack(owner, user name)
      printstring("Dumping ".username);  newline
      read block(file_spine, spine)
      %for j = 1, 1, 42 %cycle
         dump file(spine_file(j))
         %exit %if int # ""
      %repeat
      int = ""
   %end
   %routine dump user files(%record(packfm)%name f)
      %integer j
      %record(dirfm) users
      owner_unit = f_unit;  owner_name1 = 0;  owner_name2 = 0
      unit no = find unit no(f_unit)
      %return %if unit no = 0
      read block(user list, users)
      dump header
      %for j = 1, 1, 42 %cycle
         %exit %if int # ""
         %if f_owner = users_file(j)_name1 %or f_owner = 0 %start
            dump user(users_file(j))
         %finish
      %repeat
      terminate
      int = ""
   %end
   %routine read file(%string(*)%name header, %record(packfm)%name ff)
      %record(parm fm) P
      %integer k, limit
      %string(63) new file
      %record(packfm) f
      %on 9 %start
         Printstring("Cannot create ".NewFile)
         Newline
         %return
      %finish
      Pack (header, f)
      %return %if ff_unit # 0 %and ff_unit # f_unit
      %return %if ff_owner > 0 %and ff_owner # f_owner
      %return %if ff_owner < 0 %and %not wanted(f_owner)
      %if ff_name1 # 0 %or ff_name2 # 0 %start
         %return %if ff_name1 # f_name1 %or ff_name2 # f_name2
      %finish
      %return %if header = "$BOOT.SYS#"
      f_unit = out unit %if out unit # 0
      P_p1 = f_unit
      P_p2 = f_owner
      P_p3 = f_name1
      P_p4 = f_name2
      Unpack (f, new file)
      Print string ("-> ".new file)
      New line
      %if create # 0 %then become(f_unit, f_owner) %c
                     %else P_p1 = 0 %and P_p2 = 0;   !in current directory
      f_unit = 0;  f_owner = 0
      unpack(f, new file)
      open output(2, new file)
      select output(2)
      %cycle
         read tape(addr(b(0)), 2048)
         k = 1
         limit = 2048
         %if b(0) = 0 %start
            limit = limit-1 %while b(limit-1) = 4
         %finish
         %while k # limit %cycle
            printsymbol(b(k))
            k = k+1
         %repeat
         %exit %if b(0) = 0
      %repeat
      close output
      select output(1)
      P_dact = 46;               !clear 'used' bit
      SVC (20,P)
   %end
   %routine restore user files(%string(63) which, %integer x, cre)
      %record(blockfm) BL
      %record(packfm) f
      %if which = "" %or x # 0 %start
         f = 0
         f_owner = x %if x < 0
      %else
         pack(which, f)
      %finish
      create = cre
      %cycle
         skip forward
         read tape(addr(bl), 63)
         %exit %if bl_text = eot
         printstring("Label: ".bl_text);  newline
         %cycle
            read tape(addr(bl), 63)
            %exit %if bl_text = em %or int # ""
            %if x <= 0 %or bl_index&H = x %start
               read file(bl_text, f)
               %return %if x > 0
            %finish
            skip forward
         %repeat
         %exit %if int # ""
      %repeat
      create = 0
      int = ""
      rewind
   %end
   %routine analyse tape(%record(packfm)%name f)
      %record(blockfm) BL
      %string(63) label
      %record(packfm) ff
      %integer k
      rewind
      skip forward;  backspace;  backspace
      read tape(addr(bl), 63)
      printstring("Tape identifier: ".bl_text);  newlines(2)
      %cycle
         skip forward
         read tape(addr(bl), 63)
         ->err %if error # 0
         %exit %if bl_text = eot
         label = bl_text
         %cycle
            %if int # "" %start
               int = ""
               rewind
               %return
            %finish
            read tape(addr(bl), 63)
            %if error # 0 %start
err:            report("Tape read error ", error)
               %return
            %finish
            %exit %if bl_text = em
            pack(bl_text, ff)
            %if ff_owner >= 0 %start
               %if (f_unit = 0 %or f_unit = ff_unit) %and %c
                   (f_owner = 0 %or f_owner = ff_owner) %start
                  %if label # "" %start
                     newlines(2);  printstring("Label: ".label)
                     newline
                     k = 0
                     label = ""
                  %finish
                  newline %and k = 3 %if k <= 0
                  k = k-1
                  write(bl_index&H, -8);  space
                  print string (bl_text);  spaces (30 - length(bl_text)) %if k # 0
               %finish
            %finish
            skip forward
         %repeat
      %repeat
      newline;  printstring("***end of tape***");  newline
   %end

   %routine set output unit
      %record(pack fm) f
      %string(63) s
      Out unit = 0;                !default is unit files were dumped from
      Read word (s)
      %if s = "TO" %start
         Read word (s)
         Pack (s."_:", f)
         Out unit = f_unit;        !**used by READ FILE**
      %finish
   %end

int == Console Int
unit no = 0
printstring("Archive version ".version);  newlines(2)
claim tape
prepare terminal
rewind
%if exclam = 0 %start;               !old tape
   read tape(addr(bl), 63)
   printstring("Tape ".bl_text);  newline
   skip forward
%finish
%cycle
   prompt ("Archive:")
   used = 0
   int = ""
   read word(word)
   %if word = "DUMP" %start
      read word(word)
      %if word = "USER" %start
         read word(word)
         pack(word.":", f)
         dump user files(F)
      %else %if word = "UNIT"
         read word(word)
         pack(word."_x:", f)
         f_owner = 0
         dump user files(f)
      %else %if word = "FILE"
         Dump header
         Read word (word)
         Pack (word, owner)
         dir entry_name1 = owner_name1;  dir entry_name2 = owner_name2
         Dump file (dir entry)
         Terminate
      %else %if word = ".SYSTEM"
         dump system
      %else
         report("UNIT or USER wanted", 0)
      %finish
   %else %if word = "IDUMP"
      read word(word)
      pack(word."_X:", f)
      f_owner = 0
      used = 1
      dump user files(f)
   %else %if word = "RESTORE"
      rewind
      x = 0
      read sym %while sym = ' '
      %if sym = '#' %start
         read(x)
         restore user files("", x, 0) %if x > 0
      %else
         read word(key)
         %if key = "UNIT" %start
            Read word (word)
            Set output unit
            Restore user files (word."_:", 0, 1)
            create = 0;  out unit = 0
         %else %if key = "USER"
            Read word (word)
            Set output unit
            Restore user files (word.":", 0, 1)
         %else %if key = "USERS"
            users = 0
            Set output unit
            Prompt ("User:")
            %cycle
               Read sym %while sym <= ' '
               Read word (key)
               %exit %if char no(key,1) = '.'
               key = key.":"
               Pack (key, f)
               %if f_owner < 0 %start
                  Print string ("Invalid username")
                  newline
                  %continue
               %finish
               users = users + 1
               user(users) = f_owner
            %repeat
            Restore user files ("", -1, 1)
         %else %if key = "FILE"
            Read word (word)
            out unit = 0
            restore user files(word, 0, 0)
         %else
            report("UNIT, USER, or FILE wanted", 0)
         %finish
      %finish
   %else %if word = "ANALYSE"
      read word(word)
      f = 0
      pack(word.":", f) %unless word = ""
      analyse tape(f)
   %else %if word = "LABEL"
      sp = 0;  read word(head text)
      length(head text) = 31 %if length(head text) > 31
   %else %if word = "INITIALISE"
      %if exclam = 0 %start
         printstring("Initialise not permitted");  newline
         %continue
      %finish
      rewind
      sp = 0;  read word(word)
      rewind
      tape mark
      skip reverse
      dump bootstrap %if word = ".BOOT"
      word = word . " - dated " . date . " at " . time
      write tape(addr(word), 63)
      tape mark
      BL_text = EOT;  BL_index = 0;  BL_spare = 0
      write tape(addr(BL), 63)
      printstring("Tape identified as ".word);  newline
   %else %if word = "HELP" %or word = "?"
      select output(0)
      printstring("
Analyse
Analyse unit extn
Analyse user fred
Dump unit extn
Dump user sys5_fred
Idump unit
Exit
Help
Initialise tape-id
Label anything
Restore unit extn
Restore user extn_fred
Restore file extn_fred:file1.imp
Restore # filnum
")
      selectoutput(1)
   %else
      stop %if word = "EXIT" %or word = "STOP"
      report("Unknown command ".word, 0) %unless word = ""
   %finish
   read sym %while sym # nl
   sym = ' '
%repeat
%endofprogram
 H?   + +o                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     @?   @      :     '+K                 }G    K  2   WX  ;        =     W  S   c4f]  \      WzWzl    n        k       Az       %Wz           alN       w        kWz,  k  Z   0lO  ]     A  g         i       :n                                                                                                                                                                                                                                        C!          ]b\}       Pu   	        NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    %Qv   &y$ }            m"A    x"a    ~! A A    	   !  A   	   "  A A       "    b    a A A A         "  AAAA 
   "       
   " a  A  a    !!  B    ! A    " b A   B!    ! aAA A A     #! ! A A 	   "!    "a    ! a   ! a   ! a   ! a   ! a   ! a   "      !"      ("  A b 	  2"    A  	  :" b A  A  A   E" Aa a   L" ! A a   A A A    ^!"AA  A     m##!       a    Ba B!A   a  aA" A  a AA A aB 2  #!  A A! a   #a    A A A    % !  b!Aa!B!      ! b   A a Aa  AA A     +  #    !b  A ! !A   A A! A a  A   % A   A !  a A b   B!! B   a B  A A A! &  G# a  a  
   XaO"R!  a A A A   C  a   a a  a a  A a  A  A !" a a a  A a  ! A   A   A a A    a    "   AAA  aA !#A a A  ! a B A  A A A!  A     A  }  dQ@    D"Z 	}     =rR   ,>   fd:"er ,d    	yd      qX`     ,}}   	e=p y}   af" ,d    K_     y}   af" ,d    d+D     ,&@Đ %   Ld        Đ %  Ð  &@ ,d    qI\^C   o]  Đ  z   ,d    qIQ@   qI      W   ,v   qIq   Ð v   	:\   ,d    	qT{"adȄ ,d    	(_   W   ,d    	     }8!Ir8   q_:t     xdtq  xfՊZw G   qI!d   &Z  xB@ ,d    }   &Z  xB@ ,d    &V;n] d+Ey}  ,d    }R	e   ,`   	xg/!t   ,`   	UeEp ,2    	UgyQ@ ,`   l>   p_   Ud_`с D>   HD   UdK  Đ &@ ,`   ld    pv   t:t#  x    (       %   )Ug["  Đ &@ ,>   0yIXH Ug[":%Đ %   ,>   0=sx qIK  Ð 2Đ  &p   ,d    LD   PLu;` TX_&@   %   #q[j"" ,	          l`   %   qN"adĐ %   ,`   lK*!  &p   D   wag\y ,%   <v   ox    $h%Qv   #t&y$ }  ,`  &!Qp l#K5 p%   af" z!th  !H  ,!   y}  ܆=rR  l2%   * \E  z  y@  = 	eay}   À:  ""`y?   z{  ܆=sx }p_Unknown command  STOP EXIT 
Analyse
Analyse unit extn
Analyse user fred
Dump unit extn
Dump user sys5_fred
Idump unit
Exit
Help
Initialise tape-id
Label anything
Restore unit extn
Restore user extn_fred
Restore file extn_fred:file1.imp
Restore # filnum
 ?HELP Tape identified as  at  	 - dated .BOOTInitialise not permitted 
INITIALISE LABEL:ANALYSEUNIT, USER, or FILE wanted FILE Invalid username :User:USERS:USER _: UNIT RESTORE_X:IDUMPUNIT or USER wanted.SYSTEMFILE _x:UNIT :USER DUMP Archive: Tape Archive version  _: TO ***end of tape***Label: Tape read error  Tape identifier: Label: -> 
$BOOT.SYS# Cannot create  Dumping  Close fails -- <-  --  Cannot open  BOOT:MAGTAPE.SYS 
$BOOT.SYS# <- $BOOT.SYS#Adding label -  at   on  Backspace fails  Skip reverse fails Skip forward fails Tape mark fails  Clear fails  %Tape already claimed - force released  Invalid file number fails 	 on unit Read block Cannot become -- Cannot create user          *                         (   1.6                           
   :?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nH  !34  1  0 !81 !5$$A> #$$A> &C ?1  34C0  D   D   
C H  !34  1  0 !81 !5$$A> B  @ !4B ";
C@ !$$A> #$$A> B  C
B$P#E  E  &Q'1"C $A1    0#
#	QD   RD   ?&A'"3X# Y !Y !&\ Z  B!$$A> З  $1$H  H X [ &B0P  [ ,&' ?P  
*&30H  P  ї  C Kї  $$A> 
Y  #%$$A> 
qPr  PB &(pX  ?$PS?PE   &T 4A>  ?&?$$A> O$$A> ?$$A> "#:  ! ?$$A> ?$$A> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$2#XC   PC   '4"2$ #PC   '4" g A , X X8<P9 4$@$!API ,C 2&API ,PI 08AXQ  \UY !5%y UI 0AUI 4B0P 0$" <	w A , X $1P9 4$@PI 8PI <r	 ,  q	 ,$RPY 4$`Pi 8Pi <r	 ,  q	 ,0 P9 4r	 ,  q	 ,y  5	w A , X AA$aW   lW   $`W   l$ A %	g A l X $`W   l ,W   HX9 #8$PcW   TW  ,$aW   ly  0	W  A , X 0 @9 .Pi 4PY 8@ h[PI <$PPY @PY DPY Hr	 ,  q	 ,Xi Hlf#4`!5%y $" 4	W  A , X AB0W   HW  ,y 0 @9 .X P 4X  P 8$@PI <PI @PI DPI Hr	 ,  q	 ,XY H\UC0&zW   H 4W   HW  ,C  U	g A L X ) R ,A r	 L  q	 LX9 <X TP  X XI XLPJ XY \Xi \lPe X9 <X `P y  B	W  A , X X6  <P9 4XF LPI 8XV \PY <X6 <P9 @r	 ,  q	 ,X)   2A   y  3	W  A , X $1@9 2`  Pi 4PY 8XHLPI <$PPY @r	 ,  eq	 ,Xi 4lfC0|$`W   lnW   H$PXi W   TdW   H$PXhlW   T\W   H$PXi 4lW   TW  ,Ay  l	w A , X W   P a! z!%Py  	g A , X $0P6  AXŰ 
!4y ɰ 0!ɰ 9C &X %APJ  HW   HW  ,C XY Xe  l6$*AckPe  C  E	g A , X $06  XŰ  !4A"XU#4Š 
!3C ,XI T  P ?#<
  @	 ,$ ,A" ?AC `  Pmy  =	w A , X $1@9 .r	 ,  iq	 ,X H!2#' , A $`AFAC y  +	w A , X $2@9 .r	 ,  iq	 ,y  	g A , X $:@9 .Pi 4r	 ,  iq	 ,X HPy  	w A , X $aAX8<3#;' ,A XhAy  !	w A , X $bAhX8<3#;' , A XhANy  !	w A , X $cA&y  	w A , X $dAX8<3#;' ,A XhAy  !	w A , X $eAX8<3#;' ,A XhAy  !	w A , X $fAX8<3#;' ,A XhAfy  !	W  A , X $8@9 .Pi 8PY @r	 ,  iq	 ,X HPy  !	W  A , X $9@9 .Pi 8PY @r	 ,  iq	 ,X HPy  !	g A , X f!5$y 0 -@9 .Pi 4r	 ,  q	 ,X H#>' , 4A  ?kA$C X 4C  6	w A , X ) ,,A  ;X=@9 h3AP ?mAAP ?i ,Ay  *	w A , X $eAAP ?i ,A ,-,A!2#C H9 hP=A2y  )	w A , X AW   ' ,A  ',lA A"  ,A" P) lW,p, ',A  X9 l#A" ,A" ) ,A  ?P ?bAW   H ,W   HW  ,y  c	w A , $X X8<P9 pI t$P ȠP A  ) ABAW   HW  ,XM&APM@I hDA) ,A P ?bA`X]PX$`&aPi lPi $9 AQA$9 AP aA(Xi lUi A` B0P AAX9 pP8y  x	w A , X I ,$0P4 ȰP A  ) <AB$=AP PaA$=AP aA~$cW   x$cW   `$&P DP L%A&API HPI P9 <AP TW   XY T   AXI HUI PA@B0P P$9 <AP aAX DU LAŠ B0P LW   $aW   `y  	g A , :X I |$1P4 Ȱ P A  ) ABXV \U!4y X8 <P9 X P X  P PY Y;  ,i AnXI LPI XY \PY Xi lPi X9 <P9  ) $8A$@ r	   q	 X P tXI LDC0@' ,pA  ,A" jA"  A" ' ,A  ?$`AC X]C0*Xi l`   !>$;@9 P r	   q	 C ' ,fA  ,A" W   HW  ,$8AȰ ұ  X&P@ hAP ?i ,A$$@PI lP PY xXi xl` B0B$`Pi x$7@9 $9 AP X tP r	   q	 X #C XI xL&API xXY l\&QPY l8AP 9 AXi ӱ  Ҷ  X lŠB0,$P l8AP aAZXHLT  U#2#C .Xhl$06  X lɰ#&P l8A$ҡ  C $8A$@A  $8AP aAAz$[@Y Xi tlPi r	   q	 X9 <3C0"' ,VA  A" W   HX#;Ƞ .@ r	   q	 C 	g A , X X6 <3!4y XF  LPH X?  h AH' ,LA  A" W   HW  ,Y 0Xi lHf An$0&1P9 ,P90=A 8aAXӫ  #2#X9 ,U90A0 *B0P0$ҫ  C L k	g A , X X6  <P8 $@PH PH cAP!4y Y 0`-AA$P&QPY ,PY0Xhl6  3#3C R=A 8X X XA  L#3!9A 8aAXY ,UY0AP *B0P0AXX\$`e  C ^ n	W  A , *X Py C 6Xy ' ,<A  TA" W   HW  ,y ' ,A i AX9  <X  #9X #3C XC LD#)XY \E#3C D#Xi lA !3C Xi  lX6 <3!8X C0$X :!;XF LXY \E#3C LX .0A!3C :X=#3P9 X P 4X P 8XI LPI <XY \PY @Y?  Ti A|' ,,A  TA" W   HW  ,Xm#<XY \Xi lA#$0P9 4P9 8$P P Y?  Ti A T$bW   $bW   l$8AP aA$P L@ PI P$8AQ  UB0(Xi Pl8Aӱ  Ű !6'aPi PC X LXI PLC0*8Aa  W   <XY L\&QPY LC $8Aa  f!2#C JW   $aW   l0 .@9 .r	 ,  q	 ,C c 	 
Q
lW  A l /X 9 ,3#3f#;) $4A$f#Pi #' , ,A  i A<X  PAP ?i lAV l-,A!3C ' ,$A  lA" W   HW  ,P ?i lA l-A#9XJ  D#3C 6XY #(Hi `  e!>Y i;  lAFX9 #$y AC Xӫ  #2#C 8$@PMXX\E  AC  	g A , 0X AAA AP ?i ,AR' ,A  ,A" W   H$bW  8AZP ?i ,AX8<3#3C T ,-,A!3C ) lA  ?Xӫ  #9$ҫ  Ay P ?i ,AXHLD#?' , A XhlAC  ,-A!3C  ' ,A  i A>XY \UBXi lX6  <3#8X ;B0X #4B0I lDC0B$bW  8' ,A  lA" W   HW  ,$PPY Y lXi lf!)W  ,$3P9 X 'P Hi h`  %XW   TW   ,W   HX #;` I ,dW   AC zC :W  ,W   HW  ,C j&	w A , X $0P=i <Al <.AB0>aAV' L <A  A" ' ,A  i ,AX ,Py  <	w P (A , yX X=p<XC LPH lH$PPT `Pd A  (ABH$1P4 P PT A  (ABX=|P8$P' ,A A" W   H$bW  8AAAX lB0<P ?h ,A' ,A  ,A" W   HW  ,AW   $PXHҔ  hA.AB0 aA.AB0>aA' LA  A" ' ,A  h pAh pAC .AB0DaA' LA  A" ' ,A  h pA$PPX th pAC x.AB0JAphA*' ,A  h AXh lPh X8 <P8 h AAC ".A!4A#
' ,A $`AC .|AB0JaA' LA  xA" ' ,A  h pA$P t$Ph pAC f.pAB0A $PXM@  !4A"@ #B0.hAXX\U#,' ,FA $PXhA
C h\A\.jAB0FhAAd' lA  fA" ' ,A  ?$Q$`A$`PmPmC Z.`AB0<hAA' lA  ^A" ' ,A  ?$Q$`AdC .XAB0$0P8ARW   Xɰ  !$At"h\A2Ө]Š .!3C j(\PA" ?' ,\A  h pAvX t#>W   HW  ,#XHL&APH8AP  C p' ,FA $Q%aAC F\.8AB0$hA$PP]' ,A  ?eAb#
' ,A $`A`C N.AB0PaAB( p$4A$hfC0*' LA A" ' ,A  h pAzh pA$C .AB0$$0P=mlAӽlɰ #%Ȱ ҽlC . AB0*X l!?W   HW  ,C AV$PhAADAA.A!3A^W   ' ,A  ',A  A"  ,A" P(W,p, ',A  XH$A" ,A" (A  ?P ?bAAb( ,,A  ;$P@X h@X jP ?bA' ,A A" W   HW  ,C .A#7.AB0*$`W   lW   H$aW   lC H.A#6.A!3AhfC0&' lA A" ' ,A $`AX=0 
#4A4"0  P=C es(2)
claim tape
prepare terminal
rewind
%if exclam = 0 %start;               !old tape
   read tape(addr(bl), 63)
   printstring("Tape ".bl_text);  newline
   skip forward
%finish
%cycle
   prompt ("Archive:")
   used = 0
   int = ""
   read word(word)
   %if word = "DUMP" %start
      read word(word)
      %if word = "USER" %start
         read word(word)
         pack(word.":", f)
         dump user files(F)
      %else %if word = "UNIT"
         read word(word)
         pack(word."_x:", f)
         f_owner = 0
         dump user files(f)
      %else %if word = "FILE"
         Dump header
         Read word (word)
         Pack (word, owner)
         dir entry_name1 = owner_name1;  dir entry_name2 = owner_name2
         Dump file (dir entry)
         Terminate
      %else %if word = ".SYSTEM"
         dump system
      %else
         report("UNIT or USER wanted", 0)
      %finish
   %else %if word = "IDUMP"
      read word(word)
      pack(word."_X:", f)
      f_owner = 0
      used = 1
      dump user files(f)
   %else %if word = "RESTORE"
      rewind
      x = 0
      read sym %while sym = ' '
      %if sym = '#'                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                         x0 $X   "3404 #&1    @C0N   Ȁ %P  X!  #3& 6P	A&$$`  Ƞ Ȑ ސ  !#3ސ#G  4 @?#"+ހA@ހA@ޠ4暮4뚮ސޠ ޠ!% "4!HN  ?4 & 
n&C v"! 0H                                                                                                                                                                                                                                                                      	***end***ommand  unit extn
Analyse user fred
Dump unit extn
Dum***end of tape***unit extn
Analyse user fred
Dump unit extn
Dum***no label******unit extn
Analyse user fred
Dump unit extn
Dum                       d", 0)
         %finish
      %finish
   %else %if word = "ANALYSE"
      read word(word)
      f = 0
      pack(word.":", f) %unless word = ""
      analyse tape(f)
   %else %if word = "LABEL"
      sp = 0;  read word(head text)
      length(head text) = 31 %if length(head text) > 31
   %else %if word = "INITIALISE"
      %if exclam = 0 %start
         printstring("Initialise not permitted");  newline
         %continue
      %finish
      rewind
      sp = 0;  read word(word)
      rewind
      tape mark
      skip reverse
      dump bootstrap %if word = ".BOOT"
      word = word . " - dated " . date . " at " . time
      write tape(addr(word), 63)
      tape mark
      BL_text = EOT;  BL_index = 0;  BL_spare = 0
      write tape(addr(BL), 63)
      printstring("Tape identified as ".word);  newline
   %else %if word = "HELP" %or word = "?"
      select output(0)
      printstring("
Analyse
Analyse unit extn
Analyse user fred
Dump unit extn
Dump user sys5_fred
Idump unit
Exit
Help
Initialise tape-id
Label anything
Restore unit extn
Restore user extn_fred
Restore file extn_fred:file1.imp
Restore # filnum
")
      selectoutput(1)
   %else
      stop %if word = "EXIT" %or word = "STOP"
      report("Unknown command ".word, 0) %unless word = ""
   %finish
   read sym %while sym # nl
   sym = ' '
%repeat
%endofprogram
 H?   * *	L                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     H?   $ $                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             W  pXP ,C W  p d) ,A ,) LA$`@i Dr	 D  xq	 Dy W  p 4Xo<` @Pi 0Ȱ @P ,Xi ,Ui 0C0"&aPi ,d
oȶP0X[  !4y C AProcess overflowEAdr 0  q 0y W  p 4X<ʰ @P 0P @PY ,Xi ,Ui 0C0&&aPi ,d
oȶP0XY U[  !4y C AProcess lostfAr 0  q 0y W  p ,AzXo0$P  y W  p LPi 8r	 ,  q	 ,Xi 4C00@i ,X  !8 L) 4A$# ^) 4Ar	 ,  xq	 ,y W  p P` @Pi LXi L` ZC0J&aPi Lm u r) 2Ar	 ,  q	 ,Xi Ld
oȶ$PP[  Ȧ $P<XI 8PJ<C y W  p ,q  y o 0AXo @Po8X DP@X HP<$`Po4PoDX<#$ɰ #$$P<X<Y@#P@ ,/ 6A,r 0  q 0Xo <Pm  X @P $X DP (A $b@o 2X8P 8$P <r 0  q 0Xo L#=AAttach failsnA(  XoDB0hXo@Yo4C $@ 2r 0  q 0Xo LBX 8PL$@ RP Xr P  q P$`PoTH VŰ !7X hPTPo hX lB>$`PoDAXo0XLP $P 8XV P_ <X  P @X $P DXM (PO HP Lr 0  mq 0Xo LC0* 8AZXo L`!6$PDC X0%P  C X @PHX0P  $V@_ 2XLP 8r 0  q 0Xo @Po hX DP lXHʐ @@ P$R@_ RȠ @ 2XTP @XO0X? <P4 $PcAXoHPo Lr 0  q 0Xo LC0ABatch: cannot becomeYAr P  sq P$aQo4C Z$`@o 6r 0  q 0Ho 2` B0bX 8B>ɰ B 6P@Y<#%X<P@X@!?Ainitiator suspendedA#ANumber of jobs?AC ` B0L%Q4X 8PHiA$QXo0Xf A$i@o RX0X P Xr P  q PXoHAC ~` C0v` !7X <Ű C0ABad messageAvC LX , $@X= H   !5$$C  0!C   C   #'1HC   @C   '2" v@C JAC a Ua h"6`   E@C0
Ua h C nhH jF@`H &PA Jh&@h@#)B#)$BVHQ:P C0HQC0*X@C HQB0HV@@Q<AdB   B   P `&@
(v@@qC Ua h#:  @&aUa h `   Pa hC rP lC ha $Pa`@a!Xa dXq $Wq $v  Pq $Pq  C 6рp  C ^  STOP AC A (DC0AzAC 4C LAhr  p C0Np :C0A p C02p C0&!p C0p "B0r  &!p "B0C &$C &&!C &!C0'C r  &!p C0r  p C< p "<p C0>AB6p r  < >  2    f  !5     7  C             SYSEXE:SUBSYS.EXE     A   Z   Batch job startedBatch job finished BG@:h j  P9 X 4İ P j 0W   $j 4AZXJ 0DPI XZ 0P P Xj 4`  
ePi $0C ' ,A   "A  W   T$QHi W   `$QXi W   `$TXi W   `$SXi W   `$QXi W   `$QXi W   `W  8z  
w p @$&P ,XJ ,
DZH HD  PJ 0XZ 0Bn$`C>W   T$QXj ,W   ``  W   HXj 0AXW  8X: ,
3Z8 X H[ JS  i ,AXJ ,
DZMTHD H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        sysfep:loadfep(sysfep:linktest)
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                W  pP ,C W  p @$ҹ ,X	   $j  0   @	 < <'A ,A) ,AX  $jP !5y C W  p ) ,A`$`Pi lPo `$P x$QPY tPY pө ,P Pi pXi pUi C0&aPi p
iӶ ,P |Ű -!8$P[Y tPY tC bɰ 0!ɰ 9!+X l\	 xP lC BXY xC0ɰ A!ɰ F!*X lʰ
P l#Ű X!9X l!6 P x#$P `C jX ly W  p 0$`Pm $A.P  * a! z!%P  Xm  ` (#:` [#7` {#4` -!4$P $`  !4$P $` 
!4$P $` ,#:` /#7` !#4` ?!4$P $y W  p 0#	Xm  `  #4` 
!4AR"
X $P[  m #` @i ,X)  ,AA*Xm $C0Xm  `  !4A"y W  p 0$Ҷ  Xm  `  !4A"Xm $` #4` !4y ӽ #ʰ @ ,X)  ,AAC W  p L$ҿ$Pi 4r	 ,  q	 ,Xi H#$y X 8Pt$PPY 4P 8PY <PY @r	 ,  q	 , 2/$Ao$'ao$$P `$y W  p \) ,A ,) BA,Ar	 <  q	 <Xi H#$P `y r	 <  q	 <si F` ?Pop!4$P `y W  p \Pi DPY H$P LP Pr	 <  q	 < B) ,A:i ,'ai ,y W  p h) ,A ,) NA
r	 H  q	 HXi PPo PX TP TXY XP_ XX \P \y W  p lA
Oper:TAn$`Api ,A$`Pm (Xm (` "C0&&aPm ($Z
 F) ,A!4y C  ,ATA
 not found A@A2Xm  ` 
#4A"C W  p d) ,A2 ,) LA&f!8r	 D  qq	 D#	@i Dr	 D  xq	 Dy W  p LPi 4r	 ,  uq	 ,X 8y W  p LPi 4PY 8r	 ,  vq	 ,y W  p h) ,A ,) NAr	 H  q	 HXi TB 2AIllegal process name AJ ,ABA4$y    P dXY \PY `X XP \ aP Xr	 H  mq	 H ,AXi dB06A started as processA$QXi XAAX Xy #A -- rA PAA$y W  p 4$P ,Xi ,` C0>&aPi ,X  P 0XY TPY ɰ 	#&ʰ 7P 0#ʰ 0P 0kAPC y AOPERrAtsor` ?PoAd$`Po `X (
sK 
o dAxo dfC0 d-.AB0<$cPoxXox` C0&&aPoxPo 8Uo#:A#7r 0  ~q 0C C J dAXo `C0& dAA not runningpA~ApC hXpP 8r 0  ~q 0C Po dAo dfC0,o A dA d-4A#4Xo `#3C XpP 8 -:A!5$aPo <#$`Po <r 0  |q 0C o A^ AP 8Xo `B0  #5 B0SSSSP <r 0  {q 0%Q`	AC ASystem availablee$`AZ$P`	AC fo A APxXo `B08Ȱ@ 6Ȑ C@ 0$W@_ 2P 8r 0  tq 0C  o A ->A!9`	A.PxC  APxXo `B0Q`	A,A
Limit ofvA$QXoxAA usersoAAC o dA$o dfC0o Ao f!>A
	Password?AAtC l d' ,A@AATXo PPo 8X TP < ' ,A`BAA*Xo TPo @Ȱ @ 2r 0  q 0Xo L#7 8AAC o dAro dfC0 d' ,ADA6AXo PPo 8X TP <Ȑ  @ 2r 0  q 0Xo L#7 8AAC o A -FA&!7$P`	A#$Q`	AC `o Ao f!6%PxC H ' ,AdJAA.Xo TPoxB "AInvalid passwordeAAC X_x`	ABC o dAjo Ab AXo TB "AIllegal subsystemAAC Po @X XP DX \P H d' ,ALAAXo TB  AIllegal processAlA^C VX PP 8Po <   P Lr 0  mq 0Xo LC00ACannot start ' ,A< dApAAC o Ax AXo @` @@o 0$@ 2X PP 8X_ TP_ <X XP @X \P DA
test.outtAXo XPo HX \P Lr 0  sq 0C o A A0PxXm (` @o 2P 8r 0  q 0Xo L#7 8AXAJC Bo A APxXo `B0Ȱ ,@ 2P 8Ȑ [ (P <r 0  q 0C o Az APxXo `B0X (Ű !7Q`	A#Q`	AC o A: AfPxXo `B0 Ȑ'Pd!2  )P/xP/X/2  P d%P?hXx  PlȠ ҭ 9  !5  93#/0 !,#*
= 7	!%  OCAInvalid date AAC %CQOh#$<Q?h'Pl0!2Ȑ \h&
)2  $)
Px[`	Ao A:o fC0 A\PxXo `B0!2  Ȱ d+P/hAT@ KP_x  <#P BAInvalid time AbATC LȐ <I
RPxY`	AC 0o dAo dfC0 d-NA!5$`Pop#	 dARXo `B0$`o Xm  ` 
C00`  !5ӿ #<f` @o/ A(AP  C  XopAC ` Po 8r 0  zq 0C A0/
 process         store  console  cpu    state
Ad$cPoxXox` C0&aPoxPo 8r 0  q 0Xo LBX_ <Xo 8A/ A<$aPo|Xo|
oӶ Ű _#5$Q|"$RXoxA$f[o|A AXo|ӟ i$[
VXo @A$UXo LA$YXo HAXo D#A
	   *priv*AAC >AC o dAo dfC08 dAXo `C0& dAjA not running ATAFC >#$PpA(&
 seg           amt  size users flags
 A%aPoxXox` C0&aPoxPo 8XpP <r 0  q 0Xo <C0$SXoxAAXo <A($SXo @AXo @C0b$UXo HA$TXo LA$cAvso F` #5` PAso F` #5` NA~so F` #5` SAlso F` #5` RAZADC <A<C 4`	AX$SaABA free blocks AAC $j@o 2r 0  q 0AAll queues reprimedAAC o AL ' ,ATAA$l@o 2X TP 8r 0  q 0Xo LC0@ACannot create queue  A| AtA -- oAf 8A^APC Ho$A$' ,A^VAA(Xo TC Po @o A AP DXo `B0o Az AP HXo `B0AINIT:INIT.EXEA@PC  @P@ 0$c@o 2$@ 4r 0  sq 0C AINIT:AXopB0ANo initiatorEA|AnC fo A AP 8Xo `B08Xpư @@ 0$@ 2$P@_ 4r 0  sq 0C "o$A$' ,A8XAlAXo TC o At$`PoxXox` C0"&aPox$
/ AnC0(C $Px / @AaA( ATP LXo TPo 8XxP <$@ 2r 0  q 0Xo L#7 8AvAhC `` !@o 2r 0  q 0$TXo 8A`A references free out ofA0$QXo <A6A#
AWhat?AAXm  ` 
#6AP  "	C X , $@X= H   !5$$C  0!C   C   #'1HC   @C   '2"H   !5$$C   R  e
b
PP #%$$C R  '&a&1  6  "b  R  P#
#6  1  8&&a'"U$BX= $AX= $IX= V`  $GX= `  $EX= $j$EX= $FX= $EX= $HX= 8C C C y W  Aj , `C FW  AX , ,Ȱ o@ r    q  Xj Un NȰ o@ r    q  z $- ,AD
$`@a >$- ,A2
Ȱ @ >r	 8  zq	 8$f@i :i 8AzAFEP initialisedA~Ap%aPi 4X 8U N
kPi X$ $!A%aPi 0Xi 0Un NX XkC00&aPi 0X/ 4U. NAZ 0XY 4U^ NJQ  PY 4C X 8U NX/ 4U. NApZ 0XY 4U^ N$@  $P 0$`Pi ,Xi ,Un N` C0R&aPi ,- ,A,
P \X 0U NX/ 4U. NAZ 0X \HQ  @[ >X 0U N&P 0C $@ :i 8AHXo 8Un NX 0U N	kCnALoading c
.n )   9   *   <     
                       "   
STOP#4APRIV#4ARESTARTACLOSERTAOPENERTANEWERTAEXILETAREADETACOPYETALOCKETAPASSETASTARTTALOADTTAUNLOADTAPROTECTAHAZARDTAPOFFMONAPROCMONADATEMONATIMEMONATELLMONALPLLMONAUSERSONAUSERSONASEGSSONASTOREONAREPRIMEAQUEUEMEAINITEMEALIMITMEA>>>ITMEAREFSTMEASHUTTMEAMAXUSERS  "t&4		
4
4
4
d
<<6>|*d^         
PAUSEERSCONTINUERESTARTECANCELTESTOPELTE
 :.ALL OPER ON ?:::OFF::.ALL :::  N $@X= 1I2 !+K2  !
3s3B  #3
>3!$$C P P6 PV  5!%$$C !$  Ps  Q  Pc '
qX=  s #'q!$$C X^ P8PQB' 5H   !5$$C X 0!C   C   #'1HC   @C   '2"H   !5$$C   R  e
b
PP #%$$C  R  '&a&1  6  "$BX= GJH  Jx X   #Kx $$C X P  &DG"$C Y  !Y !$\ !$$C   $$C "#:  &! 8$$C h$JX= H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        !Operator command library,  ADC

!!!! %option  "NODECODE, STACK=10"


%include "sysinc:parmfm.inc"
%include "sysinc:command.inc"
%include "sysinc:direct.inc"

%record %format FD fm   (%string(15) name, %short %integer P)

!File system disc block formats

%record %format user fm (%integer name, password,
                         %short   dir block,      {disc addr of user dir}
                         %short   spare)
%record %format userlist(%short   users, spare1,  {# of users on unit}
                         %integer spare2,
                         %record(user fm) %array user (1:42))

!Block zero on every logical disc

%record %format zero fm (%integer vol id,         {m'VOLN'}
                         %string(7) disc id,      {"SVOL"}
                         %integer   free list,    {free blocks spine}
                                    user list,    {user catalog}
                                    defective list,{bad blocks list}
                         %integer   system area,  {start of system image}
                                    system size,  {N contiguous blocks}
                         %string(11)initialisation date,
                         %integer   tracks,       {physical disc info}
                                    blocks per cylinder,
                                    heads,
                         %integer   initialised,  {=0 => Disc WIPED O.K.}
                         %integer   copied,
                         %integer   checksum,     {sum(blockzero)-1 = 0}
                         %string(187) description,{of logical disc contents}
                         %integer marked,   {V2.00+: Disc INITIALISED O.K.}
                         %byte %array spare (1:252))

%const %string(31) Batch initiator =     "SPOOL:INIT.ABS"
%const %integer max unit    = 12         {Largest disc unit no. in system}

%const %integer Disc read   = 101
%const %integer Pon         = 115
%const %integer Pon off     = 116

%const %integer System lock = x'9E4'     {Magic store loc. Poke -1 to open sys.}
%const %integer System pass = x'9E8'     {Magic pass to any account}
%const %integer System time = x'9C0'     {Counts up time of day}
%const %integer System date = x'9C4'     {Knows todays date}
%const %integer Poff monitor= x'9D0'     {Switch supervisor monitoring on/off}
%const %integer Proc monitor= x'9C8'     {Log messages to/from one process}

%external %integer %fn %spec StoI (%string(31) s)
%external %routine     %spec Phex (%integer number, places)
%external %routine     %spec Read Line (%string(*)%name L)
%externalroutinespec  parse parameter(%record(Commandfm)%name  C,
                                          %integer  option, %string(127) parm)
%external %routine     %spec Unpack(%record(file fm)%name f, %string(*)%name s)
%external %routine     %spec Break Output
%system   %routine     %spec Sort(%record(FD fm)%arrayname A, %integer L, H)
%external %routine     %spec To upper (%string(*)%name s)
%external %routine     %spec Pack (%string(63) s, %record(filefm)%name f)
%external %routine     %spec Echo (%integer on off)
                             %const %integer on = 0, off = 1

%conststring(2)  x = "X "

%const %integer Symbol in Data = 3       {IMP-77 event number}
%const %integer Faulty Filename= 10

%integer %fn int (%string(31) s)
   %on symbol in data %start             {S contains a non-number}
      Print string ("""".s.""" ") %if s # ""
      Print string ("not a valid number")
      Newline
      %stop
   %finish
   %result = 0 %if s = ""
   %if s -> ("x").s %or s -> ("X").s %start
      %if s -> ("'").s %start
         length(s) = length(s) - 1 %if char no(s,length(s)) = '''' {as well}
      %finish
      s = "16_".s
   %finish
   %result = StoI(s)
%end

%routine  split up(%string(63)%name  parm)
   parse parameter(command,0,parm)
%end

%routine  pack user(%string(63) unit, %record(filefm)%name  r)
   pack (unit.":", r)
%end

%routine  check parm(%integer  mask)
   %integer  k
   %constinteger  total streams = 6
   %for k = 1,1,total streams %cycle
      %if mask&1 # 0 %and command_io(k) = "" %start
         print string("Parameter missing??")
         newline
         %stop
      %else %if mask&1 = 0 %and command_io(k) # ""
         print string(command_io(k)." ?")
         newline
         %stop
      %finish
      mask = mask>>1
   %repeat
%end

%routine nobody (%string(63) who)
   Print string (who." not logged on")
   %stop
%end

%integer %fn my process
   %record(parm fm) P
   SVC (28,P)                            {Get general info}
   %result = P_dsno&63                   {Process no. of our process}
%end

%integer %fn processes                   {Max process slot}
   %record(parm fm) P
   SVC (28,P)
   %result = P_p4
%end

%routine Director (%integer dact, %record(parm fm)%name P)
   P_dact = dact
   SVC (To Director,P)
   %if P_p6 # 0 %start
      Print string (P_text)
      Newline
   %finish
%end

%integer %fn User (%string(63) who)
   !String username => Process no.
   %record(parm fm) P
   To upper (who)
   %result = -1 %if who = ""      {ERROR}
   %result = 0 %if who = ".ALL"
   who = who.":" %unless char no(who,length(who)) = ':'
   Pack (who,P_file)
   %result = -1 %if P_file_owner < 0     {Invalid username?}
   SVC (5,P)                             {Find process}
   %result = P_p1&63
%end

%integer %function start (%string(27) proc)
   %const %integer Oper id = 1 007 883
   %record(parm fm) P
   Pack (proc,P_file)
   %result = 0 %if P_file_owner <= 0
   P_p6 = 1<<31                          {Privileged}
   P_p5 = P_p4;  P_p4 = P_p3;  P_p3 = oper id
   SVC (109,P)                           {Start process}
   %result = P_p3 %if P_p6 = 0
   %result = 0
%end

%routine Set word (%integer where, new val)
   %record(parm fm) P
   P_p1 = where;  P_p2 = new val;  SVC(118,P)
%end

%integer %fn Sys word (%integer where)
   %record(parm fm) P
   P_p1 = where;  SVC(117,P)             {Pick word up from real store}
   %result = P_p2
%end

{Kill off nominated user process(es):   }
{   KILL fred                           }
{   KILL .ALL                           }
%external %routine KILL (%string(63) parm)
   %record(parm fm) P
   %integer me = my process, j
   split up(parm)
   check parm(1);  parm = command_in1
   SVC(1,P) {Die!} %if parm = ""
   P_p1 = user(parm)
   %if P_p1 <= 0 %start                  { <0:error, 0:.ALL }
      %if P_p1 = 0 %start
         %for j = 4,1,processes %cycle
            P_p1 = j
            SVC(126,P) %if j # me
         %repeat
      %else
         Nobody (parm)
      %finish
   %finish %else SVC(126,P)              { KILL fred }
%end

{Give privilege to or remove it from the nominated process}
{   PRIV  user,ON                                         }
{   PRIV  user
%external %routine PRIV (%string(63) parm)
   %record(parm fm) P
   %string(63) what
   split up(parm)
   command_in2 = " " %if command_in2 = ""
   check parm(1+2);  parm = command_in1;  what = command_in2
   %if parm -> parm.(" ").what %start; %finish
   P_p1 = user(parm)
   Nobody(parm) %if P_p1 <= 0
   P_p2 = 0
   P_p2 = 1 %if what = "ON"
   SVC (124,P)
%end

%routine shutdown(%integer  delay)
   {Close system after DELAY minutes, sending warnings to users}
   %record(parm fm) P
   P_sact = 1                            {Nonzero to wait for reply}
   P_dsno = x'43';  P_dact = 7;  P_p1 = delay
   SVC (Pon off,P)
%end                                     {Ignores reply}

{Enable logins and make system generally available}
{   OPEN                                          }
%external %routine OPEN                  {Enable logins}
   Set word (system lock,0)
   shutdown(1 000 000)      { a very large number of minutes!! }
%end

{Disable further logins and, IFF a parameter is specified, start the}
{      shutdown sequence using that number of minutes               }
{   CLOSE                  : prevent further logins                 }
{   CLOSE  n               : stop logins and initiate shutdown      }
%external %routine CLOSE (%string(63) parm)
   %integer  k = -1
   split up(parm)
   %if command_in1 # "" %start
      k = int(command_in1);  command_in1 = ""
      check parm(0)
      k = 0 %if k < 0
   %finish
   Set word (system lock,-1)
   %if k >= 0 %start
      shutdown(k)
      print string("System closing in"); write(k,1); print string("minutes - ")
   %finish
   print string("Further log-ons inhibited")
   newline
%end

{Send a text message to all users currently logged on}
{   BROADCAST  text                                  }
%external %routine BROADCAST (%string(63) text)
   %record(parm fm) P
   P_text = text;  SVC(113,P)
%end

{Set global password so that knowledgable users can log on even though}
{the system is nominally CLOSEd                                       }
{   PASS   password                                                   }
%external %routine PASS (%string(63) parm)
   %record(parm fm) P
   %const %integer impossible pass = -2
   %integer j
   %if parm = "" %start
      Echo (off)
      Prompt ("Pass:")
      Read line(parm)
      Echo (on)
      Set word(system pass, impossible pass) %and %return %if parm = ""
   %finish
   Pack (parm.":",P_file)
   j = P_file_owner
   %if j <= 0 %start
      Print string ("Invalid password - ignored")
      Newline
      %return
   %finish
   Set word (system pass, j)
%end

%integer %fn unit (%string(63) id)
   %record(parm fm) P
   %if id = "" %start
      Print string ("Disc name?")
      Newline
      %stop
   %finish
   %if char no(id,1) = '#' %start        {Disc unit number #n}
      P_p1 = int(sub string(id,2,length(id)))
   %else
      Pack (id."_:",P_file)
      P_dact = 45                        {Find unit}
      SVC (To Director,P)
      %if P_p6 # 0 %start
         Print string (id." not loaded");  newline
         %stop
      %finish
   %finish
   %result = P_p1
%end

%integer %fn find unit (%string(63) which)
   %byte %array block(1:512)
   %record(parm fm) P
   %integer unit no
   To upper (which)
   %for unit no = 1,1,max unit %cycle
      P_p1 = 0;  P_p2 = addr(block(1));  P_p3 = unit no;  P_p4 = 0 {my process}
      SVC (Disc read,P)
      %result = unit no %if P_p1 = 0 %and string(addr(block(5))) = which
   %repeat
   %result = -1
%end

{Reboot system from nominated disc drive expressed either as the logical drive}
{number or the disc pack identifier                                            }
{   RESTART  #1         : . . . from logical DRIVE #1                           }
{   RESTART  SYS8       : . . . from the pack labelled SYS8                     }
%external %routine RESTART (%string(63) disc)
   %record(parm fm) P
   split up(disc)
   check parm(1)
   %if char no(disc,1) = '#' %then P_p1 = unit(disc) %c
                             %else P_p1 = find unit(disc)
   %unless 0 < p_p1 <= 4 %start
      print string("You can't reboot from unit #");  write(p_p1,0)
      newline
      %return
   %finish
   P_p2 = 2                              {Magic no. put in x'7E' by supervisor}
   SVC (123,P)                           {Reboot supervisor}
%end

{Make the pack on the nominated disc drive accessible to the file system}
{drive being referred to as above                                       }
{   LOAD  #1                                                            }
{   LOAD  SYS8                                                          }
{The converse operation is UNLOAD with identical conventions            }
%external %routine LOAD (%string(63) disc)
   %record(parm fm) P
   split up(disc)
   check parm(1)
   %if char no(disc,1) = '#' %then P_p1 = unit(disc) %c
                             %else P_p1 = find unit(disc)
   %if P_p1 <= 0 %start
      Print string (disc." not on-line")
      Newline
      %stop
   %finish
   Director (38,P)
%end

%external %routine UNLOAD (%string(63) disc)
   %record(parmfm)  p
   split up(disc);  check parm(1)
   p_p1 = unit(disc)
   director(39,p)
%end


%routine  set protection(%integer  on off, %string(63)%name  disc)
   %record(parmfm)  p
   split up(disc);  check parm(1)
   p_p1 = unit(disc)
   p_p2 = on off      {1=protected, 0=at risk}
   director(44,p)
%end
%external %routine PROTECT (%string(63) disc)
   set protection(1, disc)
%end
%external %routine HAZARD (%string(63) disc)
   set protection(0, disc)
%end

{List all processes either on a nominated disc unit or on all physically}
{accessible discs whether LOADed or not                                 }
%external %routine CATALOG (%string(63) parm)
   %routine %spec   Cat (%integer unit, flag)
   %const %integer  user list block = 301
   %const %integer  disc read = {SVC} 101
   %byte %name      L == length(parm)
   %integer         exclam = 0,  U,  swap unit
   %record(zero fm) Z
   %record(parm fm) P

   %predicate unloaded(%integer  unit no)
      %record(parmfm)  p
      p_p1 = unit no
      director(Direct Unitname, P)
      %true %if p_p6 # 0                 {unit not loaded}  %c
                  %or p_p1 = 0 {TEMP FRIG}
      %false
   %end
   %predicate  faulty checksum(%record(zerofm)%name  z)
      %integername  p == integer(addr(Z)), end == p++128
      %integer      total = -1
      %cycle
         total = total+p
         p == p ++ 1
      %repeat %until p == end
      %true %if total # 0
      %false
   %end

   SVC (28, P);  Swap unit = P_p2

   split up(parm);  check parm(1)
   L = L - 1 %while parm # "" %and char no(parm, L) <= ' '
   exclam = 1 %and L = L - 1   %if char no(parm, L)  = '!'

   %if char no(parm, 1) = '*' %start
      %for U = 1, 1, max unit %cycle
         %if U # swap unit %start
            P_p1 = 0;  P_p2 = Addr(Z);  P_p3 = U;  P_p4 = 0
            SVC (Disc read, P)
            Cat(U, exclam) %and newline %if P_p1 = 0
         %finish
      %repeat
   %else
      Cat (unit(parm), exclam)
   %finish

   %routine CAT (%integer unit number, exclam)
      %const %integer       user list block = 301
      %record(userlist)     Ulist
      %record(user fm)%name u
      %record(zero fm)      Z
      %record(FD fm) %array FD(1:42)
      %record(FD fm) %name  FDp
      %integer              j, k, col, dir
      %record(parm fm)      P
      %record(file fm)      f

      P_p1 = 0;  P_p2 = addr(Z);  P_p3 = unit number;  P_p4 = 0
      SVC (Disc read, P)
      %if faulty checksum(z) %start
         print string("*foreign disc* : unit #")
         write(unit number,0);  newlines(2)
         %return
      %finish
      Print string (Z_Disc id.": unit #")
      Write (unit number, 0)
      print string("  *unloaded*") %if unloaded(unit number)
      newline

      P_p1 = user list block;  P_p2 = addr(Ulist)
      P_p3 = unit number;      P_p4 = 0
      SVC (Disc read, P)

      k = 0
      %for j = 1, 1, 42 %cycle
         u == Ulist_user(j)
         %if u_name # 0 %start
            k = k + 1
            FDp == FD(k)
            FDp_p = j
            F = 0;  F_owner = u_name
            Unpack (F, FDp_name)
            length(FDp_name) = length(FDp_name) - 1
         %finish
      %repeat

      Sort (FD, 1, k) %if exclam = 0
      Col = 0
      %if exclam # 0 %then print string ("     User   Directory block
")
      %for j = 1, 1, k %cycle
         FDp == FD(j)
         Spaces(9 - length(FDp_name))
         Print string(FDp_name)
         %if exclam # 0 %start
            dir = Ulist_user(FDp_p)_dir block
            Write (dir, 5);  Spaces(2)
            Print string("x'");  Phex(dir, 5);  Print symbol('''')
            newline
         %else
            col = col+1
            newline %if col&7 = 0
         %finish
      %repeat
      Break Output
      Write(k, 1);  print string(" users")
      Newline
   %end
%end

%external %routine POFFMON (%string(63) parm)
   {Cause supervisor to log all events matching a mask}
   Set word (Poff monitor,int(parm))
%end

%external %routine PROCMON (%string(63) parm)
   Set word (Proc monitor,int(parm))
%end

%external %routine TIMEis (%string(63) parm)
   %const %byte %array limit(1:3) = 23, 59, 59
   %integer time = 0, j, k
   %string(63) x
   parm = parm.":::"
   %for j = 1,1,3 %cycle                 { hh:mm:ss }
      parm -> x.(":").parm
      k = int(x)
      %unless 0 <= k <= limit(j) %start
         Print string ("Bad time")
         Newline
         %return
      %finish
      time = 60*time + k
   %repeat
   Set word(system time,time)
%end

%external %routine DATEis (%string(63) parm)
   %record(parm fm) P
   split up(parm)
   p_text = command_in1
   %if command_in2 # "" %start
      parm = command_in2
      command_in2 = ""
   %finish
   check parm(1)
   SVC (34,P)                            {String date -> packed date in P_p1*}
   %if P_p1 = 0 %start
      Print string ("Bad date")
      Newline
      %return
   %finish
   Set word(system date,P_p1)
   Time is (parm) %unless Parm = ""
%end

%external %routine SEGS (%string(63) who)
   %const %string(15) %array flag(1:4) = {AMT flags}
      "Swopped-out", "New", "Shared", "Resident"
   %integer process = user(who)
   %record(parm fm) P
   %integer j,k,m
   Nobody(who) %if process <= 0 %and who # ""
   Print string ("
 Seg          AMT  Size  Users  Flags
")
   %for j = 0,1,15 %cycle
      P_p1 = j;  P_p2 = process;  SVC(11,P)
      %if P_p2 # 0 %start                {Segment connected?}
         Write (j,3)
         Space;  Phex(P_p2,8)
         Write (P_p3,3)
         P_p4 = P_p2 %and P_p5 = 0 %and P_p6 = 1 %if P_p3 = 0
         Write (P_p5,5)
         Write (P_p6,4)
         Spaces (3)
         m = 1
         %for k = 1,1,4 %cycle
            Space %and print string(flag(k)) %if P_p4&m # 0
            m = m<<1
         %repeat
         Newline
      %finish
   %repeat
   Newline
%end

%external %routine REPRIME
   %record(parm fm) P
   P_dact = 10;  SVC(22,P)               {Re-initialise POTTER}
%end

%external %routine QUEUE (%string(63) parm)
   %record(parm fm) P
   Pack (parm.":",P_file)
   P_p1 = P_file_owner
   P_dact = 12
   SVC (22,P)                            {Create a new queue in POTTER}
   %if P_p6 # 0 %start
      Print string ("*Cannot create """.parm.""" queue -- ".P_text)
      Newline
   %finish
%end

%external %routine INIT (%string(63) parm)
   { INIT queue current max }
   %integer init proc
   %record(parm fm) P
   %string(63) x
   split up(parm);  check parm(1+2+4)
   P_p3 = user(command_in1)                     {Queue-ID is a fake username}
   P_p4 = int(command_in2)
   P_p5 = int(command_in3)
   init proc = Start(batch initiator)
   %if init proc > 0 %start              {OK}
      P_dsno = init proc
      P_dact = 3
      P_ssno = 0
      SVC (Pon,P)
   %finish
%end

%external %routine LIMIT (%string(63) parm)
   {Set current limit on number of batch processes}
   %record(parm fm) P
   %integer init proc = user("INIT")
   %if init proc <= 0 %start
      Print string ("Batch system down")
      Newline
      %return
   %finish
   P_p1 = int(parm)
   P_dsno = init proc ! 64
   P_dact = 3                            {???????}
   P_ssno = 0
   SVC (Pon,P)
%end

%external %routine SPOOLER (%string(63) parm)
   {Send a command to one of POTTER's spoolers}
   %const %integer last command = 5
   %const %string(15) %array spooler command(1:last command) =
      "PAUSE", "CONTINUE", "RESTART", "CANCEL", "STOP"
   %string(63) queue id
   %record(parm fm) P
   %integer j
   %on %event 10 %start   {to catch faulty queue names}
      print string("Invalid queue name ".queue id.snl)
      %return
   %finish
   split up(parm);  check parm(1+2)
   queue id = command_in1; parm = command_in2
   pack user(queue id, p_file)
   p_p1 = file_owner         {get Q-id into right field}
   To upper (parm)
   %for j = 1,1,last command %cycle
      %if spooler command(j) = parm %start
         P_p2 = j
         P_dact = 13
         SVC (22,P)
         %if P_p6 # 0 %start
            Print string (P_text)
            Newline
         %finish
         %exit
      %finish
      %if j = last command %start
         Print string (parm)
         Print symbol ('?')
         Newline
         %return
      %finish
   %repeat
%end

{Creation, deletion and renaming of user processes}
{ $CREATE   user-name   password                  }
{ $DELETE   user-name                             }
{ $RENAME   user-name   new-name                  }
%routine  life and death(%integer op, %string(63)%name  parm)
   %record(parmfm)  user, parm2
   split up(parm)
   %if op = 0 {$DELETE} %start
      check parm(1)
      parm2_file_owner = 0      {to avoid 'unassigned' problem below}
   %else %if op = 1 {$CREATE}
      check parm(1+2)
      pack user(command_in2, parm2_file)
   %else
      check parm(1+8)
      pack user(command_out1,parm2_file)
   %finish
   pack user(command_in1, user_file)
   %if user_file_unit = 0 %start
FAULTY UNIT:
      print string("Faulty unit name?")
      newline
      %return
   %finish
   %if op = 2 {$RENAME} %start
      -> FAULTY UNIT %if parm2_file_unit=0 %or parm2_file_unit#user_file_unit
      user_P4 = parm2_file_owner
      op = Direct P Rename
   %else
      user_P3 = parm2_file_owner   {Password:- irrelevant for $DELETE}
      %if op = 0 %then op = Direct P Delete %else op = Direct P Create
   %finish
   director(op, user)
%end

%systemroutine  CREATE (%string(63)  parm)
   life and death(1,parm)
%end
%systemroutine  DELETE (%string(63)  parm)
   life and death(0,parm)
%end
%systemroutine  RENAME (%string(63)  parm)
   life and death(2,parm)
%end

%end %of %file
 H?   * *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!       T8}D     O .}      4F4K      fى     `EW     3w     $_	L   *d;v     0q[}:}    6\MY      <|]     Bf}}    H2B	     N	/+   T
|f^'W   Z
fW   `
~u      f<      lxwv     r2qXq@   xIm     ~:y}      Lu;`     ?yO_p   u
|@   %K@   UW@  NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    %Qv   #p}SId:w	Ry8@    eE     qIXH      Up`s    mfp  d+D    ]         	   G X \ ` q v |           .?Saipsy49EWgdQ@    :      yL;ud   d+H"  	  Y^y    U8r"K  fw  z`  =p    ys    w*   z*   F4K     fى    x}  `EW    w    _	L  d;v    y}     &V;`  q[}:}   MY     |]    wf}~wf}}   2B	    |]  %N9      /+  f^'W  fW  ~u     <     wv    qXq@  m    :y}     Lu;`    yO_p  Lnv	h	e    "e    qVM    PASCAL|.pEO Faulty unit name?Invalid queue name PAUSE system doCONTINUEstem doRESTARTEstem doCANCELTEstem doSTOPELTEstem do            REBatch system downINIT " queue -- *Cannot create " '
 Seg          AMT  Size  Users  Flags
Swopped-out DirNewpped-out DirSharedd-out DirResidentout Dir            
Bad date Bad time ::::;;              users x'      User   Directory block
   *unloaded* : unit # *foreign disc* : unit #         *    not on-line You can't reboot from unit #              not loaded_: 
Disc name? Invalid password - ignored Pass:Further log-ons inhibited
minutes -  System closing inON   .ALL  not logged on  ? Parameter missing??16_'Xxnot a valid number "  "  X  SPOOL:INIT.ABS                      *                             Ȑ
   H  !34  1  0 !81 !5$$A> 6#$$A> 6&C  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n?1  34C0  D   D   
C H  !34  1  0 !81 !5$$A> 6B  @ !4B ";
C@ !$$A> 6#$$A> 6B  C
B$P#E  E  &Q'1"C s_  eX!34RUUh!34dffз  ӳ  Ű !4Գ #9    !8 !5$$A> 6B$ C08 L  #9&"C  "
  'M  M   >' ("#4\BbD#:  
  nBJ"#<  #M  M  '"DC0  
$#M  M  &'"%ѷ  C $ "ѷ  $$A> 6?$$A> 6$A1    0#
#	QD   RD   ?&A'"3    !8 !5$$A> 6"#&!2#C$$A> 6
!  1  #C   C  '1"A> 6GHO  s/ "B
'X=  2 #$$A> 6&r0U> ?P7D   &D"$2$ #PC   '4" w ( ,A A L !A   Px LC \Xx L ,C0,' ,A  ,A A W   HW   HW  ,$ A
8 ,3!5$x 8 ,$ CA !9CA C0H~CA #>ӳ  
;ӣ  Š '!6Ә ,'Ҙ ,' ,zA  ,A ( ,A  ,W  C |   g A , $PXmpW  x  g A l ' l ,A 2  &1@ :BC   2  ' ,A W  x  &g A , $0&1P8 ,X ð C0:5XpZ=`:  ӓ  B0"fW   HW  ,$ A
ð B0^XH ,EX]pZM`E  d  fC0BX ,Z`  ' ,A bA W   HW  ,$ A
P X8 ,0 B0<x  ow ( ,A A l !A   ?' , ,A RA W   H$ A
 (w A , r ,  q ,H , ?x  w A , r ,  q ,X @x  W  A , @e X  r    q  X8  X #= W   HW  ,x  'w ( ,A A l #!A   ?h?  ,W   ,!5%x  ,.LA!3$"1  
ӱ  Ű :#;Ƞ :Ә ,&ҨI  ,Ҙ ,' , ,A h tW  XH x#%C r l  q lX t ?C  \w ( ,A A H !A   ' , ,A h PW  X T!%$x 0   P8 dX \P `X XP \ aP Xr H  mq HX d!5X XC $C  HW  A , Ph 4PX 8r ,  vq ,x  g A , Ph 4r ,  uq ,X 8x  w P (( ,A A l &!A   ?AP h ,A$aAV( ,Xp  A 8 ,3!7r l  q l ,AP tB JB0<ArP $P C  &P P tU #7r l  ~q lX U B0# ,A#r l  ~q lx  hw P (( ,A A l 3!A   ?h ,AXp< @3!7, @JA $cAv( ,Xp  A (  @A 8 ,#HH A??#1AP t!% ,A$P x .DA!4$P xr l  |q lx  ag A , $1@8 2@ C@H ,$W@X .Ph 4r ,  tq ,x  w P (A , $P`	A` B@Ax  w P (( ,A A l !A   ?%1P8 lh ,AXpӫ  C0(  AP lXp$@I  $`A6XX l#$PPX l%Q`	A8Xh lB0A2W   H$QXh lW   T&W   HW   HW  ,x  fw P (( ,A A l #!A   ?( t ,A   r l  qq lx  $w P (( ,A A l $!A   ?8 ,3B0N$aW  W   h?  ,W  $`W  Ӹ ,!9%R`	A x ' l ,A Ӣ  &Ȑ :ҒJ   Ң  ' ,A h tW  XH xPH !/W   HW  ,C T`	AC  vw ( ,A A l #!A   ?8 ,3B0"W   HW  ,$ A
H -@ #B0 ,$"Ap,Ap,P tC ' l ,A A ' ,A h tW  P -@X nr l  q lXh C06' , ,A A W   HW  ,$ A
X tx  w ( ,A A l &!A   ?NPH pp P lh?  ,W  $&P $0P8 |X l&P P P8 r t  eq tX |!?X l ( ,A!6X x X  B0%"
 Sw P (( ,A A l #!A   ?h ,AF$aA - #!8 ,AP t# ,AP t#% C .W   H$PXh tW   TW  ,x $2P8 xr l  {q l" Tw P (( ,A A l #!A   ?h ,A$aA - #!8 ,AjP t# ,A`P tB 6' , ,A A W   HW  ,$ A
X l` &A$x  Tw P (( ,A A l #!A   ?h ,A$aAf ,AP tX l` 'Ax  *W  A , eA$aA*X  AP 4X P 8X ,` ,Ax  "w P (( ,A A l !A   ?X ,$aAx  w P (( ,A A l !A   ?X ,$`AVx  g A , Pi 4Y ,$aAX H!4X9 4!5%y $" 	g A , Pi ,6 P9 0%API 4XY ,Xe  Qi 4&TPY ,UY 0#2"X 4#5%y $" (	W  A , NPI4pHP	0$0P9Tȹ0PXPi\P9`r	L  eq	Li0AdC00hW   H$PXi W   T$bW  8y ' ,4A ^A W   H$PXi W   TXi A#8PW   HW  ,Ƞ-PTI ,PIXXY PY\$`Pi`r	L  eq	L$P@<&1P9<$Zʹ 4P,X  C0T$AQI@P LYBZY0PY8@5 )l$4ALXi,X  PpX98S   bW  X8ӫ  'ҫ  X9<0 *B0XI  B0 X	0P ,X	4P 0XY@$aW  $PPYDXi  #82W   HX@P|$0P9<C &1P9<Ȱ Z0P8$iӫ  jW   X8W   HXI  C0lXY8$lLe Zmi 4H PH$UlW   T$bW   .W   H$UXiHW  ` 'W   <W  ,#$1Q9DXDð !6W  ,X9<U9|B02W  $QXi@W   T&W   HW  ,C p	w P (( ,A A l !A   ?8 ,P8 l$@PH pr|  q|XP xh ,Ad$aA8 ,3C0"ȸ ,X lӚ  
K  @  !&'Қ  C X ,Xh l  
\5  0 !!7$P p'  Ө -Š *B0\$&P tU xC0>$@PHX |PXPPHr|  eq|Xh!<XX pXh tA,W  ,X tŐ B0#
 ,AXX paAx  w P (( ,A A l !A   ? ,ABQ`	Ax   w P (( ,A A l !A   ? ,AQ`	Ax   w P (( ,A A l .!A   ?$0P8 l( ,A ?$@&APH p8 ,( x
CA??AAP t!X]ZX pe  	C  W   HW  ,x X l <
P lXH p@ B0XX l`	AC  cw P (( ,A A l #!A   ?h ,A( tXp  A   < @3#:( , @A $Ҽ @$aA\r l  "q lX tB0W   HW  ,x Z`	A8Ә ,#5 ,AC  Yw P (( ,A A l '!A   ? ,AP l!) ,#5 ,A|W   H%1&1P8 P8 xX lP |r p  q pX |C0$SXh W   TW  $XXh |W  $SXh W   TX !;XH |PH $PPX $aPh $UXh W   T$TXh W   T$cW   $P $0&1P8 X T C0 W  X ZW   HX 
P X8 0 B0W  ,X8 0 B0W  ,x  w P (A , $:@8 .r ,  q ,x  w P (( ,A A l #!A   ?' l ,A 2  &1@ :BC   2  ' ,A h tW  XX xPX t$l@h nr l  q lX C0@' ,jA  ,A ^A  tA W   HW  ,x  dw P (( ,A A l 4!A   ?h ,A$gAlXp  A0P X=p @AP Xp `AP AP l#/@ p$@ r$@ tr p  sq px  Lw P (( ,A A l $!A   ?XAP B FW   HW  ,x  ,AP tX  @@ l$3@8 n$@ pr l  sq lC  Fw P (( ,A A l 5!A   ?Px C 6Xx ' ,A  lA A W   Hx h ,A$cA
( lXp  A ( , @A ' , lA h AX8 P8 h?  ,W  $&P Z( ,AB0<X P $@ r   q XH #= W   HW  ,C >XX P B0(W   H` ?W   <W  ,C Ű B0lC 
   SnW  A , eAX !9$aA$0P8 XC H B0"$cA' ,Xp @A h TAC $iA' ,Xp A h TA`' ,Xp  A h 4AHXH 4B0W   HW  ,x XX P B0"Xh T#3d#3C X XP @P /PX C X8 XP8 <U!6P  PX #P PX X ,Xh AC  w P (( ,A A l !A   ?X ,$aAx  w P (( ,A A l !A   ?X ,$`Ax  w P (( ,A A l !A   ?X ,$bARx  A" , X @e fAX8  r    q  X  X #= W   HW  ,x  1w ( ,A A" l $X !A  ?h?  ,W  8 ,3!5%x  ,.JA!3$"P X +  Ar ?ӡ  Š :#8( ,HA" ?' , ,A h tW  X x#%C r l  q lXH tL ?C t gw ( ,A A" H X !A  ' , ,A h PW  X8 T<3!%$x    P dX \P `X XP \ aP Xr H  mq HX d!7X XC $C  VW  A" , X Ph 4PX 8r ,  vq ,x  g A" , X Ph 4r ,  uq ,X 8x  w P (( ,A A" l 'X !A  ?A4P h ,A^$aA( ,X=p<  A  ?Ӹ ,!7r l  q l ,AP tB bB0TAP $
$!AP C ,&P P P tU #7r l  ~q lX U AU B0P # ,A2#r l  ~q lx  yw P (( ,A A" l 3X !A  ?h ,AtX=p<ӳ @!7# @FA $cA( ,Xp  A  ?(  @A  ?8 ,#DH A??#1AP t!% ,Ax$P x .@A!4$P xr l  |q lx  ig A" , X $1@8 2@ C@H ,$W@X .Ph 4r ,  tq ,x   w P (A" , X $P`	Ax` B@Ax  w P (( ,A A" l X !A  ?%1P8 lh ,A(X                                                       $       $  *       *  0       0  6       6  <       <  B       B  H       H  N       N  T       T  Z       Z  `       `  f       f  l       l  r       r  x       x  ~       ~                                                                           $        (        ,        0        4        8        <        @     4&)&)ADDRESS     	                                                          POP DROP POP LHSBOTH RHS BOTH LHS SET LHSSSET C stackS STACKV stack                              @ @                Block index A ZNO5OZN    OOOONP0  P        P      P       ! GIUHDGGE'HHGGQGGGQQQQQQQQQQKyQHHHI<FD+JFIEdFCKIE+QNuK_GKnFETCKGGHlGGFIHQHqG H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ` p     W  p TP ,$`Po 8r 0  q 0Xo L!<#Xo P` &#6AP P"	X , $BX=                                                                                                                                                                                                                                                                                                                                                                                                                                    '   
PZ |#PQ PZ |H P ,XAPo 8r 0  q 0Xo L#3A
X , $DX=     
f user store
     H?    !                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!          1 (}         E  [   	        NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z        A    "        "     "!!     (!!!    -!     1a  A A!  A  A  #  aA A   A !    dQ@    D"Z 	s     ,Rv@   :[L!J ,d    	qT{"Qy儐 ,d    	g\ox   ,d    	g\       z   	xd      ox     ,a%   0^    4d    TD   Xz   \W   
SeZi LO.K. ? Test lines=<
      *** Have you 'STOP' ed  the printer spooler ???????

 (*SPECIALP complete - restart spooler!!!! can't get printer buffer 	Failed - 
   ?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nH  !34  1  0 !81 !5$$A> #$$A> &C ?1  34C0  D   D   
C H  !34  1  0 !81 !5$$A> B  @ !4B ";
C@ !$$A> #$$A> B  C
B$P#E  E  &Q'1"C A> ?$$A> ?$$A> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$  w ) ,A A l X !A  ?' ,A  ,A" W   HW  ,$ $A /	w A , X r	 ,  nq	 ,X9 4<3#Ap0 P8 ,y  "	w A , X X8 ,<0 P9 4r	 ,  	q	 ,y  	w A , X X8 ,<P9 4XH 0LCPI 8$]@Y 2r	 ,  oq	 ,$m@i 2r	 ,  q	 ,X8 ,<P8 0y  3	g A , X X8 0<c  ` AX 0&P 0X ,ź !3ATy  (	w A , X W   $ 
#7W   0"W   0y  !	w P (A , X Px `C 8Xx `AA' ,A A" W   H$ A$`W   `$`W   lA$0&1P8 TP8 d$gW   <X8 TU8 dA0 dB0P djW   H^W   ȸ \P ,Ȱ AP 0W   AVW   $aW   `$P TX ,P 0W   P XaARXH XL@ @ 
!2#C XX T\&QPX TXh \lVB0VA$`W   `W   P XAL$aW   `X8 X<0 0 Y#<0 y#9W   $P TC ^ @ AC X Š ,#7AC X P W   P XI H@ #>i <A!7AxC vC XX P  B0A,P PXh Ph W   P X PZ ,P 4X<  P9 @Ӽ Ű B0&c`$RAl$P @$OPI <Af!3C C 6\ U#7Z]Pe  Pi <AD!3C X  (!8X9 <##C ~C BC X Ű -!5A#2#i @A`!7AC A!3C X Š (B0XH PH W   P i <A!7A^C \XX P ,B0B  H8 .U8 4A U8 8P 4
 ~' ,$A $P 4P 8[Xh 0l A  	$c A  s  spoollp	' ,A  A   l' ,P 4A $P 4P 8ZXh 4 A  p  spoolpp	' ,A  A   p' ,P 4A $P 4P 8YXh 4 A  p  spoolcr	' ,A  A   c' ,P 4A $@PG 4PG 8TXh 4 A  r  ini	' ,                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |           rp               	     l CV l          h$[4laAZXm,aAPXmAHXmA@XmA8$`W   <W   $bW   l` W   <W   y A  W   H
 x K   6@ s	}    W    #p ,z   sQ@     ;L"     z   	w	} ð v   ,#   v@     ,v   	_       @ ,&@,Zx   u!:   (_TL    W.İ ,   0  İ H   ư L@   PZ!3 T~Iz
 'ox     0X   4(_Q@ #    Š   Ơ ,@   0h{   4W   8x/W <x/\ @lwW   Dz   H^  E L!%R}   C PfkyS  Ġ ly@  Ġ pq  D t:t#    x:t#	Ġ |  Ġ %   - <   8@   t   u   u0   p  à {   à {H   }:,    H?    &                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    {      6-Nov-81
{  MOUSES Standard command library       A. Culloch   Sep-81
{
!!!!%option  "NODECODE"
{
%const %string(3) version = "1.3"
{
{
{        OBEY(parm)  command/report
{        COPY  in1, in2, in3 / out
{        FILES
{        DELETE filespec
{        RENAME filespec/filespec
{        PURGE
{        LET   symbol = ...     or  LET?
{        LIB   Object filespec
{        BECOME  Username
{        ENTRIES Object filespec/out
{        OPTION(opt1, opt2, ...)  Objfilespec
{        ANALYSE  filespec/out
{        OFFER  filespec/queue:
{        SET  opt1, opt2, opt3, ...
{        STATE  or  STATE(SYSTEM)  or STATE(QUEUES)  or STATE(DISCS)
{
{  Some commands use the separate 'wildcard' processor module:
{
%include  "SysInc:Command.inc"

%record %format Filespec(%string(7) Unit, Owner, %string(15) File,
                         %string(3) Ext,
                         %short %integer Volatile, Nil)

%record %format FD fm   (%string(15) name, %short %integer pos)

%routine %spec              Sort(%record(FD fm)%arrayname T, %integer Lo, Hi)
%routine %spec              Wild Spec(%string(31) spec)
%record(Filespec) %fn %spec Next filespec
%record(Filespec) %fn %spec Split(%string(31) Filename)
%string(31)       %fn %spec Filename (%record(Filespec)%name F)
%routine %spec              For each(%record(Commandfm)%name C,
                                     %routine X(%record(Commandfm)%name CC))
%routine %spec              Mask(%record(Filespec)%name f,
                                 %record(filespec) mask)
%own %record(Command fm) C

{Subsystem entries}

%include "SysInc:Direct.inc"
%externalroutinespec  Parse Parameter(%record(Commandfm)%name  C, %integer  option,
                                          %string(127)  Parm)
%external %string(7)               %spec  SS Version %alias "$VERSION"
%external %string(17)              %spec  Console Int
%external %string(17)              %spec  Command Prompt
%external %string(15)              %spec  Error file
%external %string(7)               %spec  Search owner
%external %string(72)          %fn %spec  ItoS (%integer I, Places)
%external %integer             %fn %spec  StoI(%string(31) s)
%external %integer             %fn %spec  In type
%external %integer             %fn %spec  Out type
%external %predicate               %spec  Exists(%string(31) Filename)
%external %routine                 %spec  Rename File(%string(31) old, new)
%external %routine %spec      Pack (%string(31) file, %record(Filefm)%name F)
%external %routine %spec    Unpack (%record(Filefm)%name F, %string(*)%name ff)
%external %routine %spec   Console (%string(63) Message)
%external %routine %spec      Echo (%integer on off)
                                    %const %integer off = 0, on = 1
%external %routine %spec  To Upper (%string(*)%name S)
%external %routine %spec  To Lower (%string(*)%name S)
%external %routine %spec  Open All (%record(Command fm)%name C)
%external %routine %spec Close All (%integer how)
%external %routine %spec Read Line (%string(*)%name S)
%external %routine %spec  Del File (%record(file fm)%name F, %integer quiet)
%external %routine %spec      Phex (%integer X, Places)
%external %routine %spec   Open DA (%integer chan, RW, %string(31) Filename)
%external %routine %spec   Read DA (%integer chan, block num, %name buffer)
%external %routine %spec  Write DA (%integer chan, block num, %name buffer)
%external %routine %spec  Close DA (%integer chan)

%external %routine %spec Xobey %alias "$OBEY"(%string(31) f,t, %string(63) p)

%constant %integer   IO error = 9
%constant %string(2)        x = "X "
%constant %integer  To Potter = 22,      {SVC:Message-> Central Queuing Agency}
                      Set TTY = 29,      {Set console parameters}
                    Disc read = 101,     {Physical disc I/O}
                   Disc Write = 102,
                  Disc Status = 108,
                     max unit = 12

!File system disc block formats

%record %format extent  (%short length,  {# of contiguous blocks in extent}
                         %short base)    {disc addr of first block}
%record %format spine   (%short extents, {# of extents in file}
                         %byte  access permissions,
                                check,   {should always be '?'}
                         %integer blocks,{# of blocks in file}
                         %record(extent) %array extent (1:126))

!Block zero on every logical disc

%record %format zero fm (%integer vol id,         {m'VOLN'}
                         %string(7) disc id,      {"SVOL"}
                         %integer   free list,    {free blocks spine}
                                    user list,    {user catalog}
                                    defective list,{bad blocks list}
                         %integer   system area,  {start of system image}
                                    system size,  {N contiguous blocks}
                         %string(11)initialisation date,
                         %integer   tracks,       {physical disc info}
                                    blocks per cylinder,
                                    heads,
                         %integer   initialised,  {=0 => Disc WIPED O.K.}
                         %integer   copied,
                         %integer   checksum,     {sum(blockzero)-1 = 0}
                         %string(187) description,{of logical disc contents}
                         %integer marked,   {V2.00+: Disc INITIALISED O.K.}
                         %byte %array spare (1:252))


%routine To mixed(%string(*)%name S)
   %byte %name C
   %return %if S = ""
   To lower(S)
   C == Char no(S, 1)
   C =  C - 'a' + 'A' %if 'a' <= C <= 'z'
%end

%routine Failure(%string(63) extra)
   %string(63) S = "*"
   To mixed(Command_command)             {Which command blew up?}
   %if event_message = "" %start
      event_message = "event ".ItoS(event_event,0).",".        %c
                               ItoS(event_sub,  0)
   %finish
   S = S.Command_command." "
   extra = extra." " %if extra # "" %and char no(extra, length(extra)) # ' '
   S = S.extra."fails - ".event_message
   Console(S)
%end

%routine TT set(%integer parm, val)
   %record(parm fm) P
   P_p1 = parm
   P_p2 = 0                              {My terminal}
   P_p3 = val
   SVC(Set tty, P)
%end

%routine Number (%integer N, Places, %string(31) Text)
   %if N = 0 %then print string("No") %else Write(N, Places)
   Space
   Length(Text) = Length(Text) - 1 %if N = 1
   Print string(Text)
%end

%routine  PRINT THEN PAD(%integer  width, %string(63)  s)
   print string(s)
   spaces(width - length(s))
%end

%routine  PAD THEN PRINT(%integer  width, %string(63)  s)
   spaces(width - length(s))
   print string(s)
%end

%routine Director(%integer Dact, %record(Parmfm)%name P)
   P_Dact = Dact
   SVC(To Director, P)
   Event_message = P_text %and %signal 11 %if P_p6 # 0
%end

%routine Squeeze(%string(*)%name S)
   %string(63) T = ""
   %integer    j
   %for j = 1, 1, length(S) %cycle
      T = T.to string(char no(S,j)) %if char no(S,j) # ' '
   %repeat
   S = T
%end

%integer %function Look up(%string(63) s, %string(*)%array %name Table,
                           %integer low, high {bounds on TABLE})
   %integer j
   %for j = low, 1, high %cycle
      %result = j %if table(j) = s
   %repeat
   %result = 0                           {not found}
%end

%string(8) %function Access(%integer mask)
   %integer k = 1, j
   %string(8) s = ""
   %result = "None" %if  mask     = 0
   %result = "All"  %if ~mask&255 = 0
   %for j = 0, 1, 7 %cycle
      s = s . to string('A' + j) %if mask&1<<j # 0
   %repeat
   %result = s
%end

%integer %function Access bits(%string(31) s)
   %integer mask = 0, j, sym
   To upper(s)
   %result = -1 %if s = "ALL"
   %result =  0 %if s = "NONE"
   %for j = 1, 1, length(s) %cycle
      sym = char no(s, j)
      %if 'A' <= sym <= 'H' %start
         mask = mask ! 1<<(sym-'A')
      %else %if sym # ' '
         Event_message = "invalid access code ".s
         %signal 11
      %finish
   %repeat
   %result = mask
%end

%predicate  privileged
   %record(parmfm)  p
   p_p1 = 0;  svc(14,p)
   %true %if p_p4 < 0
   %false
%end

%external %routine OBEY (%string(63) Parm)
   %on 9 %start
      Console("*end*".event_message)
      %return
   %finish
   parse parameter(C,0,parm)
   Xobey(C_in1, C_out1, C_Parameter)
%end

%external %routine COPY (%string(63) Parm)
   %routine Copy(%record(Command fm)%name C)
      %external %integer %function %spec READ SYMBOL %alias "#READSYMFN"
      %external %routine %spec  READ BLOCK(%integer  key, block no, %name buff)
      %external %routine %spec WRITE BLOCK(%integer  key, block no, %name buff)
      %external %routine %spec SEEK OUTPUT(%integer  file addr)
      %constinteger  block size=512
      %integer       max = 6      {inspired guesswork = ad hockery!!}
      %integer Stream
      %on * %start
         Failure("") %and %return 
      %else
         %if C_in1 = "" = C_out1 %start
            Event_message = "dubious input and output"
            %signal 11
         %finish
         Open output(1, C_out1)
         Select output(1)
         Console(sNL.C_in1 ." on ".Date." at ".Time. sNL) %if C_Modifier = '?'
         open input(1,C_in1);  select input(1)
         stream = 1
      %finish

      %if C_in1 = "" = C_in2 %and intype > 0 %and outtype > 0 %start
         {Special to copy a single file quickly}
         %begin
            %recordformat  bfm(%byteintegerarray  a(1:block size))
            %record(bfm)%array  b(0:max-1)
            %integer  inkey = intype, outkey = outtype
            %integer  k,d, n = 0
            %on %event 10 %start      {end-of-file from READ BLOCK}
               -> COMPLETE
            %finish
            %cycle
               d = 0
               %cycle
                  read block(inkey, n+d, B(d))
                  d = d+1
               %repeat %until d = max+1
               write block(outkey, n+k, B(k)) %for k = 0,1,d
               n = n+d
            %repeat
         COMPLETE:
            write block(outkey, n+k, B(k)) %for k = 0,1,d-1
            seek output( (n+d)*blocksize - 1)
         %end
      %else
         {General case}
         %begin
            %on %event IO error %start
               -> OUTPUT COMPLETE %if stream = 3
               stream = stream+1
               open input( stream, c_in(stream) )
               select input(stream)
            %finish
            %cycle
               print symbol(readsymbol)
            %repeat
         OUTPUT COMPLETE:
         %end
      %finish

      Close All(0)
   %end
   Prompt("Copy:")
   parse parameter(C,0,parm)
   For each(C, Copy)
%end

%external %routine PURGE
   %record(parm fm) P
   %on * %start
      Failure("")
   %else
      Director(Direct Purge, P)
      Number(P_p1, 0, "files")
      Print string(" deleted")
   %finish
%end

%external %routine OFFER(%string(63) parm)
   %routine send(%record(Command fm)%name C)
      %systemroutinespec  offer (%string(31) file name, %integer  copies, mode,
                                 %string(7)  destination)
      %on * %start
         Failure(C_in1);  %return
      %finish
      offer(C_in1, 1, 0, C_out1)
   %end
   parse parameter(C,0,parm)
   For each(C, Send)
%end

%const %integer set min = -19,  set max = 10
%const %string(9) %array Set words(set min:set max) =
   "PASSWORD",
   "WILD",
   "ERASE",
   "TABS",
   "free"(4),
   "TRACE",   {1024}
   "QUICK",   {512}
   "s-256",   {256 unused}
   "s-128",   {128 unused}
   "XDUMP",   {64}
   "s-32",    {32 unused}
   "s-16",    {16 unused}
   "s-8",     {8  unused}
   "VERIFY",  {4}
   "DUMP",    {2}
   "MONITOR", {1}
   "eh?",
   "TIME", "TIMELIMIT",
   "WIDTH",
   "TAB",
   "SPEED",
   "PAGE",
   "SEARCH",
   "PROMPT",
   "ERRORFILE",
   "STACK"

%external %routine SET    (%string(63) parm)
   %switch                Set(set min : set max)
   %const %integer        On = -1, off = 0, Set tty = 29
   %integer               what, on off, bit, j, here
   %string(63)            S, val, t, tt
   %system %integer %spec Options, Default time, Default Stack,
                          Wild Monitor
   %record(Parm fm)       P, Q
   %on * %start
      %if Event_event = 3 %start         {Symbol in data, from StoI}
         Event_Message = """".to string(Event_extra).""" in number?"
      %finish
      Failure("")
      %return
   %finish

   parm = parm.","
   %while parm -> s.(",").parm %cycle
      val = "" %unless s -> s.("=").val
      Squeeze(s)
      To upper(s)                        {Keyword part}
      tt = ""  %unless s -> s.(":").tt
      On off = on
      %if s -> t.("NO").s %start
         %if t = "" %then on off = off %else on off = on %and s = t.s
      %finish
      what = look up(S, set words, set min, set max)
      %if what < 0 %and val # "" %start  {SET (no)opt}
         Console(" = ?");  %return
      %finish

      -> Set(what)

      Set(*):     Event_message = s." not understood"
                  %Signal 11

      {*********  -ve WHAT:  Set X  or  Set No X  ***********************}

      Set(-1):    {Set Monitor}
      Set(-2):    {Set Dump}
      Set(-3):    {Set Verify}
      Set(-7):    {Set XDump}
      Set(-10):   {Set Quick}
      Set(-11):   {Set Trace}
                  Bit = 1<<(-what-1)
                  %if on off = off %then options = options & (~Bit) %c
                                   %else options = options !   Bit
                  %continue

      Set(-16):   {Set tabs}
                  TT set(6, on off)
                  %continue

      Set(-17):   {Set Erase}
                  TT set(3, on off)
                  %continue

      Set(-18):   {Set Wild}
                  Wild Monitor = on off
                  %continue

      Set(-19):   {Set Password}
                  Echo(1)
                  Q_p1 = 0;  Director(Direct Identify, Q)
                  %unless privileged %start   {so OPER can help forgetful users}
                     Prompt("Old password:")
                     Read line(val)
                     Pack(val.":", P_file)
                     Q_p3 = P_file_owner
                     Q_Dact = Direct Become
                     SVC (To Director, Q)
                     %return %if Q_p6 # 0
                  %finish
                  Prompt("New password:")
                  Read line(val)
                  Pack(val.":", P_file)
                  P_p3 = P_file_owner
                  Director(Direct Pass, P)
                  Console("New password set")
                  %continue

      {*********************  +ve WHAT:  Set X = ...  ***********************}

      Set(1):     {Set time=N}
      Set(2):     {Set timelimit=N}
                  Default time = StoI(val)
                  %continue

      Set(3):     {Set width=N}
                  j = StoI(val);  j = 80 %if j < 0
                  TT set(1, j)
                  %continue

      Set(4):     {Set tab=N+N+... }
                  here = 0
                  val  = val."+"
                  %for j = 0, 1, 9 %cycle
                     %if val -> t.("+").val %start
                        here = here + StoI(t)
                     %else
                        here = here + 3
                     %finish
                     Byte integer(Addr(P_p3)+j) = here
                  %repeat
                  P_p1 = 5;  P_p2 = 0;  SVC(Set TTY, P)
                  %continue

      Set(5):     {Set speed:tt# = N}
                  P_p1 = 7;  P_p3 = StoI(val)
                  P_p2 = 0;  P_p2 = StoI(t) %if t # ""
                  SVC(Set tty, P)
                  %continue

      Set(6):     {Set page=N}
                  TT set(2, StoI(val))
                  %continue

      Set(7):     {Set search=owner}
                  %if val # "" %and char no(val, length(val)) = ':' %start
                     length(val)  = length(val) - 1
                  %finish
                  val = val.":" %if val # ""
                  Search owner = val
                  %continue

      Set(8):     {Set prompt=...}
                  length(val) = 17 %if length(val) > 17
                  Command prompt = val
                  %continue

      Set(9):     {Set Error file = filename}
                  length(val) = 15 %if length(val) > 15
                  Error file  = val
                  %continue

      Set(10):    {Set Stack=N}
                  Default Stack = StoI(val)
                  %continue

   %repeat
%end

%external %routine PERMIT(%string(63) Parm)
   %record(Command fm) C 
   %integer            Access mask

   %routine Permit (%record(Command fm)%name C)
      %record(Parm fm) P
      %integer         Dact
      %on * %start
         Failure(C_in1);  %return
      %finish
      Dact = Direct Daccess
      %if C_modifier = 0 %start          {Default: set file access}
         Pack(C_in1, P_file)
         Dact = Direct Faccess
      %finish
      P_p6 = Access mask
      Director(Dact, P)
   %end

   parse parameter(C,0,parm)
   Access mask = Access bits(C_parameter)
   For each(C, Permit)
%end

%external %routine DELETE(%string(63) parm)
   %routine Delete(%string(*)%name SS)
      %record(Filespec) F
      %record(Parm fm)  P
      %string(31)       S = SS                    {**COMPILER NASTY**}
      %on * %start
         Failure(S);  %return
      %finish
      String(Addr(P_Sact)) = S;  SVC(17, P)       {Pack filename}
      %if P_file_owner = 0 %start                 {Simple filename}
         Del file(P_file, -1)
         Console(S." deleted")
      %else
         Wild spec(S)
         %cycle
            F = Next filespec
            %exit %if F_Nil # 0
            S = Filename(F)
            Pack(S, P_file)
            Del file(P_file, -1)
            P_file_unit = 0;  P_file_owner = 0
            Unpack(P_file, S)
            Console (S." deleted")
         %repeat
      %finish
   %end
   %string(63) S
   Parm = Parm.","
   Delete(S) %while Parm -> S.(",").Parm
%end

%external %routine Xpack %alias "#PACK"(%string(63) File)
   %record(Parm fm) P
   String(Addr(P_Sact)) = File;  SVC(17, P)
   Phex(P_file_unit,8);  Space;  Phex(P_file_owner,8);  Space
   Phex(P_file_N1,  8);  Space;  Phex(P_file_N2,   8);  Newline
%end

%external %routine  BECOME (%string(63) parm)
   %record(parm fm) P
   %byte %name      C
   %string(63)      Pass
   %integer         Ppass = 0, who
   %Label           OK
   %on * %start
      Failure("");  %return
   %finish
   %if parm # "" %start
      %unless parm -> parm.(",").pass %start
         -> OK %if Privileged
         Echo (off)
         Prompt ("Pass:")
         Read line (pass)
         Echo (on)
      %finish
      Pack(pass.":", P_file)
      Ppass = P_file_owner
OK:   %if parm # "" %and char no(parm,length(parm)) = ':' %start
         length(parm) = length(parm) - 1
      %finish
   %finish
   parm = parm.":"
   Pack (parm, P_file)
   who = P_file_owner
   P_p3 = Ppass;  P_p6 = 0
   Director(Direct Become, P)
   To lower (parm)
   c == char no(parm,1)
   c = c - 'a' + 'A' %if 'a' <= c <= 'z'
   parm = "Command: " %if who = 0
   Command prompt = parm
%end

%external %routine RENAME(%string(63) parm)
   %routine Rename (%record(Command fm)%name C)
      %record(File fm) F
      %on * %start
         Failure(C_in1."/".C_out1);  %return
      %finish
      Pack(C_in1, F)
      F_unit = 0;  F_owner = 0
      Unpack(F, C_in1)
      Rename file(C_in1, C_out1)
      Console(C_in1." renamed ".C_out1)
   %end
   %record(Command fm) C 
   parse parameter(C,0,parm)
   For each(C, Rename)
%end

%external %routine LET(%string(63) parm)
   %systembytearrayspec Alias Text(0:255)
   %systemintegerspec   Alias Limit;     !one past last used addr
   %systemroutinespec   Let(%string(63) old, new)
   %externalroutinespec Alias (%string(*)%name it)
   %byte %integer %name B, Last == byte integer(alias limit)
   %integer             J, k
   %string(63)          New
   %if parm -> parm.("=").new %start
      %if parm = "" %start
         Console("Let what= ?");  %return
      %finish
      To upper(parm)
      Let(parm, new)
   %else %if parm = "" %or char no(parm, 1) = '?'
      j = 0
      b == alias text(0)
      %while b ## last %cycle
         %for k = 1,1,b %cycle
            b == b ++ 1
            Print symbol (b)
         %repeat
         b == b ++ 1;              !to next length byte
         %if j = 0 %start;         !toggle thru table: <sym><translation>
            Print string (" = ");  ! pairs. (Both terminated by 0's).
         %else;                    !..after <trans>..
            Newline
         %finish
         j = ~j;                   !toggle j
      %repeat
   %else;                          !LET x   i.e. show X
      New = parm
      To upper(new);  Alias(new)
      Print string(parm." = ".new)
      Newline
   %finish
%end

%external %routine LIB(%string(63) param)
   %systemintegerspec             Lib limit
   %recordformat                  Libfm(%integer when, %string(27) name)
   %systemrecord(libfm)%arrayspec Lib(1:7)
   %integer                       J, Insert, Old, New, Show
   %string(63)                    F
   %record(file fm)               Pfile
   %routine show lib
      %integer j
      %if lib limit = 0 %start
         Print string("No entries");  newline
      %else
         %for j = 1, 1, lib limit %cycle
            Spaces(3);  Print string(Lib(j)_name);  newline
         %repeat
      %finish
   %end
   %on * %start
      Failure("");  %return
   %finish
   To upper(Param)
   %if Param = "" %start
      Show lib
   %else
      Squeeze(Param)
      Param = Param.","
      %cycle
         Param -> F.(",").Param
         Show = 0
         %if F # "" %and char no(F, length(F)) = '?' %start
            Show = 1;  length(F) = length(F) - 1
         %finish
         %if F # "" %start
            %if F = ".NONE" %start
               Lib limit = 0
            %else
               Insert = 1;  Insert = 0 %if F -> ("-").F
               Pack (F, Pfile)                 {Check validity of name}
               Unpack(Pfile, F)                {Standard string form}
               New = 0;  Old = 0
               %while Old # Lib Limit %cycle
                  Old = Old+1
                  %if Lib(Old)_Name # F %start
                     New = New+1
                     Lib(New) = Lib(Old)
                  %finish
               %repeat
               %if Insert # 0 %start
                  %if New = 7 %start
                     Event_message = "Library list full"
                     %signal 11
                  %finish
                  New = New+1
                  Lib(New)_When = 0
                  Lib(New)_Name = F
               %finish
               Lib Limit = New
            %finish
         %finish
         Show lib %if show # 0
      %repeat %until Param = ""
   %finish
%end

%external %routine OPTION(%string(63) parm)
   %constant %integer decode = 1,               {Object file option masks}
                      open   = 2,
                      stack  = 8,
                      priv   = 16,
                      upper  = 32,
                      spacesx= 64
   %string(63)        s, t, val
   %integer           j, k, write flag = 0,
                      on off
   %constant %integer on = 0, off = -1,
                      last option  =  7,
                      first option = -2
   %constant %string(6) %array options(first option : last option) =
      "STACK=", "TIME=",
      "Zero",
      "DECODE", "OPEN", "unused", "STACK", "PRIV", "UPPER",
      "SPACES"

   %recordformat blockfm(%shortinteger code size, gla size, 
                                       pad1, pad2, pad3,
                                       time, flags, stack, 
                         %shortintegerarray a(1:248))
   %record(blockfm) block
   %record(Command fm) C
   %on * %start
      Failure("");  %return
   %finish

   parse parameter(C,0,parm)
   Parm = C_Parameter
   To upper(parm)
   C_in1 = C_in1.".exe" %unless C_in1 -> (".")
   Open DA(1, 1, C_in1)
   Read DA(1, 0, Block)
   Squeeze(parm)

   %if parm = "" %or parm = "?" %start
      S = "Options set: "
      S = S."upper case, "    %if Block_flags&upper # 0
      S = S. "remove spaces, " %if Block_flags&spacesx # 0
      %routine No(%integer x, %string(63) what)
         S = S. "no " %if x # 0
         S = S . what
      %end
      No(Block_flags&decode, "decode, ")
      No(Block_flags&open, "open, ") %if Block_flags&decode = 0 {otherwise irrelevant}
      No(Block_flags&priv, "priv, ")
      No(Block_flags&stack, "stack")
      S = S . snl
      print string(S)

      %routine pretty(%string(31) S, %integer value)
         pad then print(10,S)
         Space;  Print symbol('=')
         %if value = 0 %start
            print string(" current default")
         %else
            Write ( |value|, 1 )
            %if value < 0 %then print string(" absolute")
         %finish
         Newline
      %end

      Pretty("Stack",   Block_stack)
      Pretty("Code",    Block_Code Size<<9)
      Pretty("GLA",     Block_GLA  Size<<9)
   %else
      write flag = 1
      parm = parm.","
      %while parm -> s.(",").parm %cycle
         On off = on
         %if s -> t.("NO").s %start
            %if t = "" %then on off = off %else s = t."NO".s
         %finish
         %if s -> s.("=").val %then s = s."=" %else val = ""
         j = Look up(s, Options, first option, last option)
         %if j < 0 %start
            Event_message  = val." not a number"   {just in case}
            k              = StoI(val)
            %if j = -1 %start
               Block_Time  = k
            %else
               Block_Stack = k
               Block_flags <- Block_flags & (\stack)
            %finish
         %else %if j = 0
            Event_message = s." not understood"
            %signal 11
         %else
            j = 1<<(j - 1)
            Block_flags <- Block_flags & (~j)
            Block_flags <- Block_flags ! j    %unless on off = on
                                              {Bits SET for NOxxx - yech}
         %finish
      %repeat
   %finish
   Write DA(1, 0, Block) %if write flag # 0
   Close DA(1)
%end

%external %routine ENTRIES(%string(63) parm)
   %constinteger h = X'FFFF'
   %string(63) file, output
   %recordformat  pgmfm(%integer  limit,stack,gla,code base,ep,code,   %c
                                                %shortinteger  options)
   %record(parmfm) p, q
   %recordformat loadfm(%integer code, gla, specs, defs, when, file)
   %recordformat textfm(%integer n1, n2)
   %recordformat specfm(%integer gla, code, ep)
   %recordformat hdfm(%shortinteger base, n)
   %recordformat headfm(%shortinteger pure size, gla size, code disp, %C
                                      lit disp, registers, mainep, %C
                        %record(hdfm) reloc, defs, specs, ldiag, vdiag)
   %recordformat deffm(%shortinteger link, ep, %integer n1, n2)
   %ownrecord(headfm)%name head
   %record(specfm)%name spec
   %record(deffm)%name def
   %record(textfm)%name sp
   %integer base, code, gla, specs, defs
   %system %routine %spec Unpack Spec(%record(Textfm)%name T)  {into..}
   %system %string(15) %spec Spec id
   %record(textfm) txt
!!!!!!   %integer max = (free space - 1024) >> 4
   %CONSTINTEGER MAX=200
   %record(fdfm) %array slots(1:max)
   %integer used = 0, j, col
   %on * %start
      Failure("");  %return
   %finish
   parse parameter(C,0,parm)
   Open output(1, C_out1);  Select output(1)
   file = C_in1
   file = file.".exe" %unless file -> (".")
   string(addr(p_sact)) = file
   svc(10, p)
   %if p_p1 # 0 %start
      Event_message = "Cannot load ".file
      %signal 11
   %finish
   code = p_p2;  base = code-16
   gla = p_p3
   %if shortinteger(base+4) # X'4321' %start
      Event_message = file." is an old format file"
      %signal 11
   %finish
   Select output(1)
   head == record(code)
   code  = code+head_code disp&H*2
   specs = head_specs_n
   defs  = head_defs_n
   %if defs # 0 %start
      Print string("External entry points:");  newline
      %cycle
         def == record(base+2*defs+16)
         used = used + 1
         %if used > max %start
            Event_message = "too many entries"
            %signal 11
         %finish
         txt_n1 = def_n1;  txt_n2 = def_n2
         Unpack spec(txt)
         Slots(used)_name = Spec Id
         defs = def_link&h
      %repeat %until defs = 0
      Sort(slots,1,used) %if command_modifier = 0
      col = 0
      Spaces (4)
      %for j = 1,1,used %cycle
         print then pad(14,slots(j)_name)
         col = col + 1
         newline %and spaces(4) %if col&3 = 0
      %repeat
   %finish
%end

%external %routine STATE(%string(63) parm)
   %record(parm fm) P, Q, R
   %string(63)      x
   %byte %name      last
   %integer         others, hours, secs, j, k, prot, unit no, sym, priv
   %integer  exclam
   %record(zerofm)  block
   %record(spine)   free
   %integerfn  checkword      {compute zero block checksum}
      %integer  j,k=0
      k = k + integer(j) %for j = addr(BLOCK),4,addr(BLOCK)+512-4
      %result = 1-k
   %end
   %routine  read block(%integer  unit num, block num, %record(*)%name buffer)
      %record(parmfm) p
      p_p1 = block num&x'FFFF'
      p_p2 = addr(buffer)
      p_p3 = unit num      
      p_p4 = 0             {into my VM}
      svc(DISC READ,p)
   %end

   %on * %start
      Failure("");  %return
   %finish

   To upper(parm)
   Squeeze(parm)
   %if length(parm) >= 2 %start
      exclam = charno(parm,length(parm))
      %if exclam = '!' %or exclam = '?' %start
         length(parm) = length(parm)-1
      %else
         exclam = 0
      %finish
      length(parm) = length(parm)-1 %if charno(parm,length(parm)) = 'S'
   %finish
   %if parm = "" %or parm = "SYSTEM" %start
      SVC (28,R)                         {System information}
      SVC (19,P)                         {General information}
      Print string ("Mouses ".string(addr(P_p6)).                       %c
                    ":  CXE ".SS Version."/".version." on ".DATE.   %c
                    " at ".TIME.snl)
      others = P_p2 - 1
      %if parm # "" %start
         Write (R_p1>>1, 0)
         Print string ("KB of user store, swopping from unit")
         Write (R_p2, 1)
         hours = P_p1//(60*60)      {seconds => hours}
         %if hours # 0 %start
            Print symbol (',')
            Number(hours, 1, "hours")
            Print string (" since startup")
         %finish
         Print string ("

 Process         Store Console    CPU Level Prio Debt
")
         %for j = 4, 1, 32 %cycle
            P_p1 = j;  SVC (14,P)
            %if P_p6 >= 0 %start
               Q_file_unit = P_p1;  Q_file_owner = P_p2
               Q_file_N1   = 0;     Q_file_N2    = 0
               Unpack (Q_file, x)
               length(x) = length(x) - 1
               k = 1
               k = k + 1 %while char no(x,k) # '_'
               Write (j,2)
               Spaces (6-k)
               Print string (x)
               P_p3 = P_p3+1 %if P_p3&1 # 0 {round up odd figures}
               Write (P_p3>>1, k-length(x)+11)
               k = P_p6>>16;  P_p6 = P_p6&x'FFFF'  {P_p6: Debt<<16+console}
               %if P_p6 = 0 %then spaces(6) %else write(P_p6,5)
               Print (P_p5/1000, 7, 1)
               Write (P_p4&7, 3)         {Contingency level}
               Write (P_p4<<1>>9, 5)     {Queue}
               Write (k, 3)              {Debt}
               Print string ("  privileged") %if P_p4 < 0
               Newline
            %finish
         %repeat
         Newline
         %return
      %finish
      P_p1 = 0;  SVC(14,P)               {Get user specific info}
      priv = P_p4
      P_file_unit = P_p1;  P_file_owner = P_p2
      P_file_N1= 0;        P_file_N2 = 0
      Unpack (P_file, x)
      length(x) = length(x) - 1
      Print string ("User: ".x)
      Q_p1 = 0                           {Myself}
      Director(Direct Identify, Q)
      %if P_file_unit # Q_file_unit %or P_file_owner # Q_file_owner %start
         Print string (" alias ")
         Unpack (Q_file, x)
         length(x) = length(x) - 1
         Print string (x)
      %finish
      Print string (", logged on console");  write (P_p6,1)
      Secs = P_p5//1000
      %if secs # 0 %start
         Print symbol(',')
         Number(secs, 1, "CPU seconds")
         Print string (" used")
      %finish
      Newline
      Print string ("Process")
      P_p1 = 0 {me}
      Write (P_dsno&63, 1)
      Print string (" (privileged)") %if priv>>31 # 0
      Print symbol (',')
      Write (others, 1)
      Print string (" other processes")
   %else %if parm = "DISC"
      Print string ("
  Unit")
      %if exclam # 0 %then print string( %c
      "     S/W  H/W   Initialised   " )
      %if exclam = '!' %then print string(" Lost   Free   Used   Label")
      Newline
      SVC (28,Q)                         {Get sys info}
      %for unit no = 1,1,max unit %cycle
         %if unit no = Q_p2 %start
            Write (unit no, 2);  print string (" *swop*");  newline
            %continue
         %finish
         P_p1 = unit no;  P_dact = 40
         SVC (To Director, P)            {Get name of disc on unit}
         prot = P_p2
         %if exclam = 0 %start           {Just name & prot status}
            %continue %if P_p6 # 0 %or   {Unit not loaded}
                          P_P1 = 0       {Temp fix}
            Write (unit no, 2);  space
            P_file_owner = 0;  P_file_N1 = 0;  P_file_N2 = 0
            Unpack (P_file, x)
            length(x) = length(x) - 1
            Print string (x)
            %if prot # 0 %start
               Spaces (7 - length(x))
               Print string ("protected")
            %finish
         %else
            Write (unit no, 2);  space
            Read block (unit no, 0, block)
            %if P_p6 = 0 %and P_P1 # 0 %start         {Online OK}
               print then pad(7, block_disc id)
               %if prot # 0 %then print string("prot") %else spaces(4)
               P_p3 = unit no;  SVC (Disc status, P)
               %if P_p6&4 # 0 %then print string(" prot") %else spaces(5)
               %if checkword # 0 %start
                  Print string (" *foreign disc*")
               %else                     {Standard MOUSES disc}
                  pad then print(12, block_initialisation date)
                  %if exclam = '?' %start
                     Print string (block_description);  newline
                     %continue
                  %finish
                  Read block (unit no, block_free list, free)
                  Write (free_extents, 8){Lost blocks}
                  k = 0                  {count free blocks
                  %for j = 1,1,126 %cycle{by summing sizes of free extents
                     k = k + free_extent(j)_length&x'FFFF'
                  %repeat
                  Write (k, 6)
                  Write (block_tracks*block_blocks per cylinder {disc size} %c
                         - k {free}                                         %c
                         - free_extents {lost},  6)
                  Spaces (3)
                  %for k = 1,1,4 %cycle
                     sym = block_vol id>>(3*8)
                     %if sym = 0 %then space %else print symbol(sym)
                     block_vol id = block_vol id<<8
                  %repeat
                  Space;  Print string (block_description)
               %finish
            %finish
         %finish
         Newline
      %repeat
   %else %if parm = "QUEUE"
      %begin                             {Show potter's queue entries}
         %record %format entry fm (%record(file fm) label, actual,
                                   %integer queue, date, time,
                                   %short %integer priority, mode)
         %record %format block fm (%integer %array spare(1:8),
                                   %record(entry fm) %array e(0:9))
         {Potter's queue is a file of blocks of entries}
         %const %integer queue = 1       {DA channel for queue file}

         %record(entry fm) %map entry(%integer N)
            %integer block no = N//10, offset = rem(N,10)
            %own %integer last block = -1
            %own %record(block fm) block
            Read DA (queue, block no, block) %if block no # last block
            last block = block no
            %result == block_e(offset)
         %end

         %record(file fm) f
         %record(entry fm)%name e
         %integer first = 1, count
         %string(63) x
         %integer j

         Open DA (queue, 0, "POTTER:QUEUE")
         Count = 0
         %for j = 1,1,255 %cycle
            e == entry(j)
            %if e_queue # 0 %start       {Valid entry}
               count = count + 1
               %if first # 0 %start
                  Print string ("
Queue   Label                     Actual                     Date        Size
")
                  first = 0
               %finish
               f = 0;  f_owner = e_queue
               Unpack (f, x);  print then pad(8,x)
               Unpack (e_label, x);  print then pad(26,x)
               Unpack (e_actual, x);  print then pad(26,x)
               P_p1 = e_date
               SVC (13, P)               {unpack date}
               pad then print(10,p_text)
               P_file = e_actual
               P_dact = 18               {get status}
               SVC (To Director, P)
               Print (P_p2/2, 5, 1);  print string("Kb")
               Newline
            %finish
         %repeat
         Number(Count,0, "files")
         Print string(" queued")
         Newline
      %end
   %else
      Print string (parm."?")
   %finish
   Newline
%end

%external %routine FILES(%string(63) parm)
   %string(15) %array File(1:42)
   %string(15) %name  Sn
   %string(63)        S
   %integer           N = 0, rows, cols, j, k
   %string(7)         Last owner, last unit
   %record(Filespec)  F
   %record(Parm fm)   P
   %record(Commandfm) C 
   %on * %start
      Failure("");  %return
   %finish
   parse parameter(C,0,parm)
   Open output(1, C_out1);  Select output(1)
   F = Split(C_in1)
   F_file = "*" %if F_file = ""
   F_ext  = "*" %if F_ext  = ""
   Wild spec(Filename(F))
   F = Next filespec
   Last owner = F_owner
   Last unit  = F_unit
   %cycle
      %if F_Nil # 0 %or F_owner # last owner %start
         Number(N, 0, "files")
         Print string(" owned by ".last owner) %if last owner # ""
         Newline
         %if N # 0 %start
            %if C_Modifier # 0 %start    { Files! } 
               Print string("
      Filename        Size   Access   Last used
")
               %for j = 1, 1, N %cycle
                  Sn == File(j)
                  print then pad(17, Sn)
                  S = Last unit."_".last owner.":".Sn
                  Squeeze(S)
                  Pack(S, P_file)
                  Director(Direct Status, P)
                  Write(P_p2, 5)
                  S = "(".ItoS(P_p3,0).")"
                  print then pad(6, s)
                  S = Access(P_p4);  print then pad(9, s)
                  P_p1 = P_p5;  SVC(13, P)  {Unpack date}
                  Print string(P_text)
                  Newline
               %repeat
            %else
               Cols = 4
               Cols = N %if N < cols
               Rows = N//Cols
               Rows = Rows+1 %if Cols*Rows < N
               %for j = 1, 1, rows %cycle
                  k = j
                  %while k <= N %cycle
                     Sn == File(k)
                     k   = k + rows
                     print then pad(17, Sn)
                  %repeat
                  Newline
               %repeat
            %finish
         %finish
         N = 0
         %exit %if F_Nil # 0
         Last unit  = F_unit
         Last owner = F_owner
      %finish
      N = N + 1
      F_unit = "";  F_owner = ""
      To mixed(F_file);  To lower(F_ext)
      F_file = " ".F_file %while length(F_file) < 10
      File(N) = Filename(F)
      F = Next Filespec
   %repeat
%end


{*****************************************************************************
{
{        Wildcard processing module            A. Culloch   Sep-81
{
{*****************************************************************************


{Director formats}


%record %format file    (%integer name1, name2,
                         %short   Spine block, Day)
%record %format Dir fm  (%short   Files,
                         %byte    Access rights,  Check,
                         %short   Unused,
                         %byte    Spare, Access permissions,
                         %record(file) %array File(1:42))
%record %format user    (%integer Name, Password,
                         %short   Dir block, Spare)
%record %format userlist(%short   Users, Spare1,
                         %integer Spare2,
                         %record(user) %array user(1:42))


%external %record(Filespec) %function SPLIT(%string(31) s)
   %record(Filespec) F = 0
   To upper(s)
   %if s # "" %and char no(s, length(s)) = '#' %start
      F_Volatile = '#'
      length(s) = length(s) - 1
   %finish
   %if s -> ("_") %then s -> f_unit.("_").s
   %if s -> (":") %then s -> f_owner.(":").s
   %if s -> s.(".").f_ext %start; %finish
   F_file = s
   Squeeze(F_unit);  Squeeze(F_owner);  Squeeze(F_file);  Squeeze(F_ext)
   %result = F
%end

%external %string(31) %function FILENAME (%record(Filespec)%name F)
   %string(31) s = ""
   s = s.F_unit."_"     %if F_unit     # ""
   s = s.F_owner.":"    %if F_owner    # "" %or F_unit # ""
   s = s.F_file
   s = s.".".F_ext      %if F_ext      # ""
   s = s."#"            %if F_Volatile # 0
   %result = s
%end

%external %routine MASK(%record(Filespec)%name x, %record(Filespec) y)
   x_unit   =  y_unit   %if y_unit  # "*"
   x_owner  =  y_owner  %if y_owner # "*"
   x_file   =  y_file   %if y_file  # "*"
   x_ext    =  y_ext    %if y_ext   # "*"
%end

%external %record(dir fm) Dir
%system %integer wild monitor = 0
%own %integer dir pos, dir lim
%own %record(fd fm) %array sorted dir(1:42)
%own %record(user list) catalog
%own %integer cat pos, cat lim
%own %integer unit no, one off, required unit no
%own %record(Filespec) Spec
%own %string(31) Current dir

%system %routine sort(%record(fd fm) %array %name p, %integer a, b)
   %record(fdfm) dump
   %integer l, u
   %while a < b %cycle
      l = a;  u = b
      dump = p(u);  ->find

Up:   l = l+1;  ->found %if l = u
Find: ->up %unless p(l)_name > dump_name
      p(u) = p(l)
Down: u = u-1;  ->found %if l = u
      ->down %unless p(u)_name < dump_name
      p(l) = p(u)
      ->up

Found:p(u) = dump
      l = l-1;  u = u+1
      %if l-a > b-l %start
         Sort(p,u, b);  b = l
      %else
         Sort(p,a, l);  a = u
      %finish
   %repeat
%end

%routine set dir(%integer unit, owner)
   %record(Filespec)   F
   %record(file) %name Slot
   %record(Fd fm)%name S
   %record(parm fm)    P
   %integer            j

   P_file_unit  = unit
   P_file_owner = owner
   P_file_N1    = 0
   P_file_N2    = 0
   Unpack(P_file, Current dir)
   Current Dir  = ":" %if Current Dir = ""
   F            = Split(Current Dir."*.*")
   Mask(Spec, F)
   P_dact       = Direct Files
   P_p6         = Addr(Dir)
   SVC (To Director, P)                  {Read directory block}
   %if P_p6 # 0 %start
      Dir pos = 42 %and %return %if one off = 0
      Event_message = P_text
      %signal 11
   %finish
   P_file_unit  = 0
   P_file_owner = 0

   dir pos = 0
   dir lim = 0
   %for j = 1, 1, 42 %cycle
      slot == dir_file(j)
      %if slot_name2 # 0 %start
         dir lim   = dir lim + 1
         S        == Sorted dir(dir lim)
         S_pos     = j
         P_file_N1 = slot_name1
         P_file_N2 = slot_name2
         Unpack(P_file, S_name)
      %finish
   %repeat

   Sort(sorted dir, 1, dir lim)
%end

%external %routine WILD SPEC (%string(31) parm)
   %record(filespec) fff
   %record(file fm) F
   %record(parm fm) P
   Required unit no = -1
   Spec    = Split(parm)
   Cat pos = 42
   Dir pos = 0
   Dir lim = 0
   Unit no = 0
   one off = 0
   %if spec_owner # "*" %start
      one off = 1
      Pack(Spec_unit."_".spec_owner.":", F)
      Set Dir(F_unit, F_owner)
      %if F_owner = 0 %start             {Defaulted - must find out who we are}
         P_dact = Direct Identify
         P_p1   = 0
         SVC (To Director, P)
         Unpack(P_file, Current dir)
      %finish
!!!      Mask(Spec, Split(Current dir))
      fff = split(current dir."*.*")
      mask(spec, fff)
   %else
      Spec_unit = "*" %if Spec_unit = ""
      %if Spec_unit # "*" %start
         Pack(Spec_unit."_:", P_file)
         P_Dact = Direct Find unit
         SVC (To Director, P)
         P_p1 = 0 %if P_p6 # 0
         Required unit no = P_p1
      %finish
   %finish
%end

%external %predicate MATCHES(%record(Filespec)%name F1, F2)
   %predicate match(%string(*)%name S1, S2)
      %true %if S1 = S2 %or S1 = "*" %or S2 = "*"
      %false
   %end
   %true %if match(F1_unit,   F2_unit)  %and
             match(F1_owner,  F2_owner) %and
             match(F1_file,   F2_file)  %and
             match(F1_ext,    F2_ext)
   %false
%end

%external %record(Filespec) %function NEXT FILESPEC
   %own %integer    Unit
   %record(Filespec)F
   %record(parm fm) P
   %integer         User
   %label           New dir
New dir:
   %cycle
      F_unit  = Spec_unit
      F_owner = Spec_owner
      F_Nil   = 1                        {In case of early return}
      Dir pos = Dir pos + 1
      %if dir pos > dir lim %start
         %result = F %if one off # 0
         %cycle
            cat pos = cat pos+1
            %if cat pos > 42 %start
               %cycle
                  unit no = unit no + 1
                  %result = F %if unit no > max unit %or
                                  unit no = required unit no + 1
                  P_p1    = unit no
                  P_p6    = Addr(Catalog)
                  P_Dact  = Direct Catalog
                  SVC (To Director, P)
               %repeat %until P_p6 = 0   {Valid unit number}
               P_p1    = unit no
               P_Dact  = Direct Unit name
               SVC (To Director, P)
               P_p1 = 0 %if P_p6 # 0
               unit    = P_p1
               cat pos = 0
               %continue
            %finish
            user = catalog_user(cat pos)_name
            %if user # 0 %start
               Set dir(unit, user)
               -> New dir
            %finish
         %repeat
      %finish
      F = Split(Current dir . Sorted dir(dir pos)_name)
      Console(Filename(F)) %if wild monitor # 0
      F_Nil = 0
      %result = F %if matches(F, Spec)
   %repeat
%end

%external %routine FOR EACH(%record(Command fm)%name C,
                            %routine Do Something(%record(Command fm)%name CC))
   %integer            J, k = 0, wild
   %string(31)%name    Sn
   %string(31)         S
   %record(Command fm) CC
   %record(Filespec)   W, base, overlay

   %for j = 1, 1, 3 %cycle
      Sn == C_in(j)
      k   = k + 1 %and wild = j %if Sn -> ("*")
   %repeat
   Wild Spec(C_in(wild)) %if k # 0

   %cycle
      CC = C
      %if k # 0 %start
         W = Next filespec
         %exit %if W_file = ""
         CC_in(wild) = Filename(W)
         W_unit = "";  W_owner = ""
         S = Filename(W)
      %finish
      %for j = 1, 1, 3 %cycle
         S  =  CC_in(j) %if k = 0
         Sn == CC_out(j)
         %if Sn # "" %start
            overlay = Split(Sn)
            base    = Split(S)
            Mask(base, overlay)
            Sn = Filename(base)
         %finish
      %repeat
      Do Something(CC)
   %repeat %until k = 0
%end


%end %of %file
 H?   ^ ^3                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     7 C!        6d
}    n     ^@     2(@     hgZ,     ^"     $w       *#dR     0"e     6,x     <K_     BqVM     HK       NiLj       T`T:     Z!qv   `y}     fN&"8     lyL;`     r&!qR   xQ{D     ~z       !K_j s     !4   "Q|v   "X`}Kd #'k2   NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    %Qv   d:w	Rs_  &y$ } %Qv_""`:%  wq af";ov    y8@    :    a@  #	y    qVM&@d+D        &y$@  ]    mfp  da]p  `EWK   wL  qIXH  &@  eE     `EX!    qI    }@  w@  #(    NWqI\^C  }M[DwG-} &Z    ~wZx  %%N4:M%%N3}+!K_j8{}} 8{Lu;`e}     )	8    iiR  i    d+G      !_aew{    y"        A !!	!     " A a A     A A     A A    A     ! a    ! ba  	   #!A    ! a aAa     A aa aA a  A    "!A      bA 	  "A a  C b!  A! B   ! ! aA#a "    & b  A  A c U " N     * A   0b   A !  
  <# b   ;A   e "  c   aA! #  b C  C  C C !  !    !    Fa C  C a  a ! ! C  Ca C! ba  C!  C  #a " A V  # b       A    #    A A    AA B    A   *   1 b       ! ! c         U"  Aa   TA   e B a a      !  A A     " A!! 
      A A   a!     AA  a  A A  a  (  A!    !  a  AaB     q  A !  AE  Aaa A a  a a!   !    ! c Ba  5  0! a  !     A     !   AA  A  aa a a a  /  ! a   "   A a  	  :!a    14 d! a     a  bAA  a         {    a  a ! b     A a !     A  aaAa A!A   B!  A ! a  A  ! a !    aA A A      B     A   !  Aa    A   B a aAAC    !f A A"    m# e  !!AA    a     a  a  A    A a aA! A    A  a     !  A @   !  bA!    a aA aA 
  aa   c  a! B!!a A A   ' A A a AAAA    a  a B A A !    A  "  @ a!  a A A A aaA   a CA AA  !    e!   de	d   ph   a  b    A     a !  a B A  B B aa #  b f A    " !  !ab    dQ@    D"Z$h%Qv   t  #y"#:  #&y$ } #%Qv_#""`:%  #wq af"z  	4X`	zfk	zLuh/+  hfklLupy?t_^xqYX|yEqV}p ie<   À v  ŀ ,   %NZ@   ,#p lv   3"`     d:Q@     ,d    ZZ     W    e ,}}  fZ2d, ,~@ ,v   d,~EZ: ,~@ ,v   z`   +} Ā  d    y} "@  À v   ,}    l>   MgH     ,v   Mo    3o2  t>   "K     Q{D ,D   0>   4v   "Kv ,v   LQ{D P>   Tz   fي ]  ,d    	^@     ,d:Q@ 	ox     D:{#( HaE LD   P    TW   ox     (@    Đ    ,Q   0yu (@     ,d:Q@ 	gZ,     ,d    	w     Đ    	^"     ,d:Q@ 	w       ,d:Q@ l}  p_&p t   x>   |2@ v      }   @   !D`T:v  !P	)R!\	!h4X`d   j@   MdR    Đ    ,d    L+}  dR     ,d:Q@ l  "KQ{D "e    Ð y   ,%   Td    tv   "e     ,d:Q@ lv   x     ,&@ ld    K_     ,d:Q@ ld   ŀ    d;v fy ԑ   qVM    Đ    ,%   qVM     ,d:Q@ l   K       ,d:Q@!)	D:Q} ŀ l  ŀ pK;}  t>   xD   |X_   #x   ,>   	Lj       ,d:H!LjLu;`   l>   p:"$ t_   xX_   |x %   dK +Y           ,}  fՀ9     ,v    `T:     ,d:Q@ lv   }    쉴  ,>  0D  4}K/  8_&p<ox<   /!qv   ,d:Q@ l&@ ag\ d   j@  2 Ā,yEĀ0  Ā4y@  8@<@@-  DyEHvyE,L  l= p>  t$   Q`   ,>   0D   qI\^C   yEQ@    oH  Đ ,&Z 0d    !th     W   ,o]   0^wK;}\^C  ox ox     ,%  Đ <@   @&y D-Z H    >   y}     ,d:Q@ ld    j@   p   ̖   ŀK;} `"#4msxwv>   D  $f} (y?,z  0fى4#K58ox8(U@ M&"8     ,d:Q@À x   v   W   rv $v >   D   K;oXZ   K;V;`   %  d   4   =yL;`     ,v   L%   &!qR  Ā %   ,v   Q{D    Ā     ,@   y*}      @       4Ud  HK    L@   wz     y}   af" ,%  Ā Tx} Ā Xv   \d    |>   !4   ,d:Q@ L&v   t%   d    Q|     Ð {   Ð  {H   Q|v  Ā )  Ā  *   X`}Kdˁąy}  ,%   Td    t=p 'k2   Ā    0>   4D   84 À <x   @v   `8    @a5ra@   /***_: ***.*:_**.*:         *   ****#.:_.::__         *            *    )(:_1
      Filename        Size   Access   Last used

 owned by  files**? queuedfilesKb A   O
Queue   Label                     Actual                     Date        Size
POTTER:QUEUE           	   0            QUEUE *foreign disc* protprot 	protected *swop* Lost   Free   Used   Label     S/W  H/W   Initialised    
  UnitDISC  other processes  (privileged)Process usedCPU seconds, logged on console alias User:    privileged C> 8

 Process         Store Console    CPU Level Prio Debt
  since startup hours$KB of user store, swopping from unit  at   on  /:  CXE Mouses SYSTEM too many entries External entry points:  is an old format file Cannot load  .exe . not understood not a number==NO NO ,,GLACode Stack	 absolute current default stackpriv,  open,  decode,  no remove spaces, upper case,  Options set: ?.exe .            STACK=TIME==Zero==DECODEOPENDEunusedSTACKdPRIVKdUPPERdSPACES         Library list full-.NONE,,
No entries  =  = Let what= ?=	 renamed /	Command: ::Pass:,,, deleted  deleted :++New password set :New password::Old password: not understood = ? NO :=,," in number? " 

9
/
&
																



FjwPASSWORDiWILDWORDiERASEORDiTABSEORDifreeEORDifreeEORDifreeEORDifreeEORDiTRACEORDiQUICKORDis-256ORDis-128ORDiXDUMPORDis-32PORDis-16PORDis-86PORDiVERIFYRDiDUMPFYRDiMONITORDieh?ITORDiTIMETORDi	TIMELIMITWIDTHIMITTABTHIMITSPEEDIMITPAGEDIMITSEARCHMITPROMPTMIT	ERRORFILESTACKFILE      
   
  deleted filesCopy:             at   on  dubious input and output *end*invalid access code  NONE ALLAllNone No fails -    ,event  *                       ~   X                            91.3
   $?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nH  !34  1  0 !81 !5$$A> #$$A> &C ?1  34C0  D   D   
C H  !34  1  0 !81 !5$$A> B  @ !4B ";
C@ !$$A> #$$A> B  C
B$P#E  E  &Q'1"C s_  eX!34RUUh!34dffз  ӳ  Ű !4Գ #9    !8 !5$$A> B$ C08 L  #9&"C  "
  'M  M   >' ("#4\BbD#:  
  nBJ"#<  #M  M  '"DC0  
$#M  M  &'"%ѷ  C $ "ѷ  $$A> ?$$A> $A1    0#
#	QD   RD   ?&A'"3  $$A> X# Y !Y !&\ Z  B!$$A> З  $1$H  H X [ &B0P  [ ,&' ?P  
*&30H  P  ї  C Kї  $$A> 
Y  #%$$A> 
qPr  PB &(pX  ?$PS?PE   &T 41I2 !,K2  !
3s3B  #9
3
>!$$A> !$$A> A>  ?&?$$A> O$$A> ?$$A> "#:  ! ?$$A> ?$$A> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$2#XC   PC   '4"2$ #PC   '4" ?$$A> H  !34  "#(!B   C $$A> ] g A , X 6  3!4x W  dX $!A  P ,ӱ  ɰ a!ɰ z!%Ȼұ  C  -w ( ,A A l ,X !A  ?( lA X=p<c   AdXLӫ B0$PXk  lW  ' ,A  ',A  ,A" $PXLXi lP( W,p,',A  XH $A" ,A" X]L\% A  ?' , lA  XpA" A" ( lA  ?h ,fC0& ,( ,A ?1  0  #8( ,A" ?' , lA   ,A" A" XL A" ( lA  ?W  @x  ΀W  A , X Ph 4$0P8 8PX <r ,  q ,x  W  ( ,A A L X !A  f!9W   H#W   TW  X8 0 !6Ӹ ,'Ҹ , ,W   Hx  <g ( ,A A l X !A  ? ,W   HXh 8 ,cW   x  (g ( ,A A l X !A  ?8 ,cW    ,W   Hx  &W  A , X @e fAX8  r    q  X  X C0 XL)  A  ?$ $Ax  6g A , X $08 ,F  PH tS$!APX lC V&QPX lPX pX %A  a  `  C0(X %A  1    @ x( , xA" ?XX lUX pAUX tB0P pX(  ,A   x  WW  A t  X PX |'a$!APh tC .&aPh tPh x8 lA( ,A!5x Uh xAUh |B0P x$" 6g A , X $1P8 ,$@H 4f!9$Ax %QVP !7$A"%Q&QPX 0PX @%A$ab  Th #?P A  @ D( 4 DA" XX 0UX @AP B0P @ 4$AC  Vw ( ,A A L X !A  $0P8 Lh  ,W  X ,.~A!5%x .xA!3$"	ӱ  P \$
$!AP PC &P PP X ,*A ӑ  P Tɐ AB ɐ H!.)A$AB  VH LPH LC :Ő  C02' ,bA  ,A" X]L\% A $ $AU XAU \B0pP XX LC 4 w A , X $0P8 4r ,  q ,X @#%x $"  w P (( ,A A l X !A  ?Px lC 4Xx l' ,\A X=L< A" W  @x  ,$PmtW  ' ,A  ' LA  XW  C  U  w A , X J ,$0P4 X ,'P A   * <A^W  P DW  P H$@PJ TPz X#Xz XC $PPZ PXZ TXj Pl
V: <AP , P 0Xj DW  X: P<&1P: PX ,; #3C P: `%A$!APJ LC @&APJ LPJ \XZ T
T: <AP , P 0Xj HW  XJ LUJ \AUJ `B0P \XZ TXj Pl
VPZ TC 2X: P<'1P: `%$!AP LC @&P LP \XZ T
[: <AP , P 0Xj HW  X LU \AU `B0P \XJ TXZ P\
E4` &AcW  z   
 KOw A , X Pz ,C RXz ,X9 0<0 !3C T&1P9 0=PAX   Xi 0W   xXi 0lW   `W  aW   <"z  J 
 @g A , X $6P9 ,Py 4#
Xy 4ADy XI T  UB0(d fB0X=L<# BA $ $A $aW   $aW   lX X Š ?B0' ,A   A" P) 8W,p, ',A  XI 8$<A" ,A" P) <W,p, ',A  XY <%6A" ,A" A" W  @Xi l  $aW   x$aW   `$1P9 0X ӫ  B0,K @DB0"W  #+W  #$A#A$`W  |C |  	clw P (( ,A A l #X !A  ?W    ,$PmtW  Ј l8 lP7 ,mtAx  9w P (A , X Px L#	Xx LA"C ,X ,` A$PXh 4lAW   Hx  1 t|g A , X Py ,#Xy ,X9 <  Ay ' ,  A   $P$aW  0C  0 	w P (( ,A A l #X !A  ? ,$PmtW  `Ј l8 lP7 ,mtAx  2w P (( ,A A l sX !A  ?PxC lXxX=L<X  Ű B0BX 
  @' ,A A" A" XL) A  ?Ax ( ,~A" ?8 ,( |CA??C02zH A??!4$PX h?  Ah?  W  X8 #xH@A??!4$`h@%P p( tCA??C08Ө !6$P pC &P p' , A  A" ( A  ?' , A  ?X< 	   P lX@P p$Z`AP l#Ә #:nW  @C .A' , A  ^A" XMLL$ A  ?$ $A$PXh llV%A$12  P8 tX p!=XLX  %ACP  #
XLX  P  C `XX p\$fAjC NXX p\$cAXC <XMpXX p\PT  C ($aW  L$`PhX` AlAB0PW   h?  W  ' L A  NA" ' ,A  hW  (X8<P8Ȱ @r  qX#3C p@W   h?  W  ' L A  >A" ' ,A  hW  (XPX` A|,W  @C  W  XMXP  C  W  P x# PP xQ$aAC $PPX |( *A" ?%a&aPh xPh8 ( (CA??#?W  X8 |<
1P8 |#X |&P |ȨX x
XH |LJ  @ AXh xUhA` 	B0P$UPX$`Phr  qC $7P8 W  P$PӨ #: W  Pr  qC  W  Q$bAC Ә C0 ( A ?A  @ :!4'!( X U#8( &A" ?X- A  C \h ` #%` h X- A  C 88 0 #$$?8 X- A  # W  XdP  #C C  		Gg A , X Py P#Xy PX9 <  A>y @ PI LX6 <3B0$' ,  A  i 4W  (Ȱ P LXP HY ,Xi LlAC  K 	w P (( ,A A l mX !A  ? ,$Ph lW  PAPЈ8P7 ,h lA&x  8g A , &X ) tA Py #
Xy  tA<y ) Z tA  r	 T  q	 TX9 `<3B08%Qi \W  ' , tA  A" W  @C  tAA) ,$:A\H R#3C bA) tA  ' , tA  i \W  (%Qi \W  $P \P `Y  ti \W  4' , tA  A" W  @C fC   	gpw P (( ,A A l +X !A  ?( ,A" ?8 ,( lCA??#8h?  lAfC x  5w P (( ,A A l #X !A  ?( r ,A r l  q l$XXh tlW  W  $XXh xlW  W  $XXh |lW  W  $XXh lW  W  ,x  aw P (( ,A A l 7X !A  ?$0P8 Px #
Xx Ax H ,DC08 ,#H A??B0@A#3C t$`W  LW   h?  W  $aW  L' L A  A" ' ,A  h tW  (XX x\PX h ,fC0 ,( ,A ?1  0 :!4'!( ,( ,A" ?' , ,A  h tW  (X xP X P |$P X l` Ah?  ,W  dH -PH T  P a!P z!%UT  Xh lf!7( ,A X- ,A  C   g A , X Py <C >Xy <X9 <' ,  A  A" X  A" Ay ' ,  A  i ,W  ($P ,P 0XI LT   i ,W  4' ,XY \  A   W  Xi l' ,  A  A"  A" W  @C Z  	yw P (( ,A A l lX !A  ? ,$Ph lW  Ј8P7 ,h lAx  2w P (( ,A A l 1X !A  ?X=XC  LPH p8 ,#H |A??C0JX ,U!;W  @x h?  ,W  X' , ,A  |W  C @h ,f#78 -0 ?B0$P tX=|AP lX lU pC0Ӛ  P $@$!APH xC 2&APH xPH XX l\&QPX le  W   <XH xUH AUH B0P Xh ll&aPh lX8 t<3!9W   H#W  ,%X tP tC NC b( | ,A h?  |W  Xh?  |W  ' , ,A A"  |A" W   HW  ,C  w A , X X=XC  LD!?W   HW  ,C lPI 4$P$!APY ,C H&QPY ,PY 0$cW   X ,X=A&W   HW  ,XY ,UY 0AUY 4B0P 0y  Z	w P (( ,A A l 6X !A  ?Px #
Xx Ax h?  ,W  X8 ,3!5AC h?  ,A0( ,A" ?8 ,( CA??A$P |Ө C0$ ( A ?ӑ  Ő ?!7$P |'!( H DC0Z .A!8X]$`Pe  C >$1P8 p1$ H A ?#3P( p' ,A  h W  (X?  h W  4$P xP tX tXXI  LC0N&P tX=A&( AC0,XX x\&QPX xX=AP AX( $8A\C Xh plfC0bX8 x<0 B0XL+ A $ $A&1P8 xX=A$PPQ  X xX=A!  A  XmX8 x<P6  X |#3AӨ ,#3C 4C & ~g ) ,A A l X !A  ?f#8( l
A" ?( l ,A" ?y  *	g A L X  ,$jA&W  ` =W   <X9 !:W   HC *#$0;$QcW   TX #W   HW  ,y  E	w P (( ,A A lX !A  ?$0P84Px`#
Xx`Ax  ,Sh<W  ( , A  ?h?  ,W  X8\$ BBA  !7#<A" \$QeW  ȸ<P ,Ȱ P 0$P$aW  h?  ,AӨ ,#9 ,.:AB0( l,A HHÐ  #6A" ?Ð @#8( lA" ?HhH`  AH8H0 !8c` AHhH` AHhH` A( lA" ? lW   H' ,A HhJA' ,A Hh<iA' ,A Hh>iAC $1P84( ,A" ?8 ,( lCA??C0$P82( H lA??C0>Ө !6%P8C ,' , A A"  lA" ( lA  ?8 l#H A??#8#A" ?#$Ҙ ' , lA  ?X    P lXP p$W%bAzP,Cr' , A  A" XMLL$ A  ? W  P0XX,\P!7@FA#@JAHhH`@hHC pB06' , lA  A" X=L<# A  ?$ $A'!A$  P,%DH@HX8#6HH@HC FXH4C0X<PW ,P PW 0$P$aW  $aW  C v w P (( ,A A l aX !A  ?HT$1P4 Ȱ P A   (dA^$PPXlPxx#
XxxAx  ,mtW  $aW   $aW   l( lA  ?2$ BA  !8( lA" ?(  lA  r   
q Xh lfC02' ,zA  lA" X=L<# A $ $AX P<ȫP8X P@HJ @C!C06' , lA  bA" X]L\% A  ?$ $A$aW   lXh<lPmH6 0  
3
cPh<XH PDH PHC0|JW   HW  ,XH8LXH$R
A
Kd Ph0X8l&1P8l0 C XL+ 8A $ $AX PLX PPhLW  Xl8dA!XA XH0LHT  P  PXH#3C TXmplX6 <3!>XdP ,XhP 0XXl$aA0$Pt$dW   XlP$	$!APpC P&PpP|8dA$nAܘXHtL&APHt@ !<W  ,$dW   XpU|AUB0P|C   w A , X $0P9 0H4PI 8X4$$APY ,C $&TPY ,PY 4Xi 0X5  <
cPi 0UY 4AUY 8B0P 4$[ 0y  >	W  A 0 X P  PY 8X9 ,P9 <Pi @$@PI Dr	 0  eq	 0y  "	g A , X 6#  $J$P: ,VE@ $jFPJ 0U=C0]PW ,P PW 0S$aW  Xj ,PmX 0=Az  =
w A , $X $1P9 @~$PcW  $P D&P P jADP <XA  LDC08XY D&QPY DXi @#;.W   H$0P9 @) ,$4ArX <X  P 0Y?  HbW  4 H$hAbY?  HXi <lW  4 H` A>Y?  HXI <Ld W  4 H` AXY <\Xe $lPh tr l  q l t$jA<X9 << ( t$4A\Ȱ @ nr l  q lX x/m@(` ,$Q$eW   $W   HW  ,X U AŠ B0P $PXi DAW   HW  ,y  	w P (( ,A A lRX !A  ?Px8#
Xx8Aּx h?  ,W  Xh?  ,A8 ,0 BN ,( ,A ?ӱ  P4Ű !#4Ű ?!5'!( ,#$P4 ,( ,A ?ӡ  Š S!4'!( ,Ә ,#9 ,.0AB0\r   q r l  q l' ,(A  A"  A" XA" A" A" P(<W,p, ',A  XH<$A" ,A" P(@W,p, ',A  XX@%A" ,A" A" W   HXh xl'aPh8 ,3C0X ka$PW   TW   H$QXh lW   TX t ȐPC0.` ,W   <$QXhlA֒W   HW   H$C&APHPH<PH tr l  q lXX \UBXh tlPh X8 x<P8 $P P X?  h W  4Ө 'Ҩ $P  X( ,A ?A  @ _#6&!P( C $RXhlW   T$fXX \eW    W   HXh |l` #4&aPh |aX8 <Ӹ ;S W   TX  P X   P !8$fW   #$UiW   TXH L/m@` ,$Q$gW   XX \e` $SW   TXh l
fi$UW   T$SXh lW   TX8 <3#W   HW  ,XHUH<A@  B0&P<W  ,C $P tr l  q lX P0X tP tXH xLPH x$PPX |PX X?  h tW  4h 'ah ' ,A  A" W   H$0P8 X ` A
X tX !<X xXH LC0:zW   HX?  h W  4X 'QX  W   HfW   H$QXh lW   TXh lVE@ 0CPXUC0.` ,W   <Z$QXhlA0TW   HW  ,LW   H$P tHh l` ?$QW   TX0 #8>W   H` ,W   <$QXhlW   T,W   HC 8 ,.&AB0W   HX4#8W   HXH4L@ !!8W   HW  ,r   q $P&QPX(PX<Xh lVB0,$RXh(W   TW   HW  ,C 4PX t0 (@8 nr l  q lX xP$X4B0X !7XH tLD!3C $RXh(lW   TW  $PPX xPX |PX X?  h tW  4h 'ah  W   HX8$<3C0 $gӸ kW   W   HC R$RXh(lW   TW  Ȩ8P ,$PXh(lAX B0XH tLDC0<$gA6XX$\U#9W   H#$dW   Xh(lPh |r l  lq lX8 <0 #9W   H#$eW   A#:W   HC tX$lAX4Ű ?!?|W   HW  ,C JȨ8P ,XXD\Xh(lA$XHh8W   T$P I&APHPHD=A@XX \Ha  `  
VPX UHDA@ ~B0PD$VXh lW   TX8d<Xh+AX :cKh8$VW   T$cW   $&P PDXH8L@ PH,!7W  #dW   <XX8\XPX8X UDAŐ B0PDW  |W   HW  ,XX(UX<AP B0tP<C 8 ,.A!5AC "' , ,A A" W   HW  ,C 9 '0w P (( ,A A l X !A  ?H l$1P4 Ȱ *P A   ( |A^$PPX PxX#
XxXAx  ,h4W  $aW   $aW   lTA( $:A\h f!7( A 83!7(A h AAA( $:A\(  A  (  A  H!9 ( AC0
$PXh A&Ө C0"' ,A  A" W   HW  ,X C0XXHLDC0W   HXX PX`$`$!APh C X&aPh Ph\8 |AP ` A' , A  A"  A" A" X A" ( A  ?h?  A' , A  hW  (X` A,$UXh lW   T$PXh$lW  ' ,A  ',A  ,A" A" ( A  ?$fA*Xh(lA@( A  ?$iAX8,<P8r  qW   HW  ,Xh Uh\AUh`B0P\C $P 	#P 9#  X *P8 ZCA	Y#&1P8 P8`$@$!APH C \&APH PH\PH XX \YX B (8 |AP Xh l
VPX ` A.C W  ,XH UH\AUH`B0P\$0P8 H#3C (  A  (  A  X &P $Ҙ Ҙ h  Ah W  dH @ 
C$' ,A  A" ( A C X 8 |Ah P\A<X(\A  A( $:A\C C F ww P (( ,A A L X !A  ( L$:Arh  ,W  X8 ,3C0& ,( ,A ӱ  Ű #!8Ƞ #@ p'!( ,8 ,$ BA  #;( LCAA$ BA  #;( TCAA#H lA#1( \A  h  LA^h  TATh  \AJh  lA@ Lx  g P (A , X $08 ,F  DC0*' , ,A A" A" ( ,A  V U!66  3C0,' , ,A  A" A" ( ,A  ( , A" Ӷ  C0,' , ,A A"   A" ( ,A  H $#8( ,A"  ,  Ax  ~g P (A T X  ,.A#5&A   4.A#6& A   <.A#6& A   L.A#6&  A  x  ?W  P (A 4 X X8 Y8  CP8 HX  P L8 ,A( 4$5A\C X H&P HX L!3C X H8 ,A( 4A!#C X L8 ,AP PX HAX( P$5A\XH LL'APH LXX H\T!3C >8 ,A( 4A!C X H8 ,AP PX LAX( P$5A\C BX L8 ,AP P 4X( P$5A\Xh Hl'aPh HX8 L&1P8 L[h X  [ H	kC *X ,P ,X 0P 0XX  cAX HP  C (X ,P ,X 0P 0XX HXh AjX LP C px  ؀W  A , !X Ph dPX h$0P8 lP8 p] h dW  4ӽ!7-rA ' ,A  nA" AZ( ,$:A\' ,$:A\m|AJȠ @ ^ȝP xr \  q \XH xLDC0:X]t\U!8` *Pm	x X=L<#  dA  ?$ $A$P dP hP	P	&P |P =AP TX C0bXM	L&APM	=	AP X@ AXX T\Xe  lPh lX5 <P8 pX X[   h dW  4X |U AŠ *B0`P X	P ,X	P 0X]	\$aAC   w P (( ,A A L )X !A  %1P=x ,A-|$:A\Ȱ *Ph$P	P	PpPt.lAC0$Pt' ,|A  jA" A" hA" ' ,A  h tW  (XX x\Xh tlAlX xB0.@ @H $PPX r   q ] h W  4' ,A  dA" A( L$:A\' ,$:A\m|AC m|f!7-|bA |.`AC0`' LA  \A" ' ,A  h W  (0 -@8 r   q X #4$P X Pxx  W  A , X %A#>.ZA#8X  .XA!5%y $" #	W  P (A , X X8 <X  [   c   AC0rX X  Y  j  A`C0NXH LXX  \U  d  A<C0*Xh lX8  <S   f   A#5%x $" Zw P (A , X ( ,|A  ( 4A  $1@8 RX	&P	X		C  Xt#6 ,x XMhL&APMh@ *C X]p\&QP]pP !(XmxlV !5 ,C PX \=hP8 pȰ @ Vr T  q TX p#3C XpP \$A@H Vr T  q TXX p\U#4$`Ph \X8 \<P=$PhC 0=ApX  P t#:ZXmlAC C X	=	A' ,P xA  X xA" A( ,$:A\X	#9bAW  @$@@H R]|h ,A#5 ,C C J g P (A 0 X $0P8 4C&APH 0PH=PAXX \  P <1$ VBA  #:Xh 4&aPh 4X8 0P8 8XH 0UHA@ B0PX 4C0 X 8=PAX   AX ( `0 IA\X 4C0`An($:A\HD!3C X 8=PA hPAvX(A  $PXXhAZ( @A  $`&aPh 0PhX8 4!==PA ( @A  =XA P <ӱ  C0LA($:A\ @A($:A\' ,$:A\hAhAX( <,A  Xh 0UhA` B0\Ph `W  X( ,,т  A X 4#3C x                                                         $       $  *       *  0       0  6       6  <       <  B       B  H       H  N       N  T       T  Z       Z  `       `  f       f  l       l  r       r  x       x  ~       ~                
                                                                                                                                                                                                                                                                                                                                    L      L"R  R&X  X*^  ^.d  d2j  j6p      p:v      v>|      |B      F      J      N      R      V      Z      ^      b      f      j      n      r      v      z      ~                                              $        "  "(  (.  .4  4:  :@  @F      FL      LR  RXbD  Xh      hn                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          	t                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Filename        Size   A H?   @ @                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    lib oper:oper
open
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        {Mouses Standard Subsystem}

   %systemstring(7) Version       = "3.1:B"

   %conststring(16) Diag Prog     = "SUBSYS:MDIAG"
   %conststring(14) Sub Init      = "SUBSYS:SUBINIT"
   %conststring(14) Batch File    = "SUBSYS:BATCH"
   %conststring(13) Standard      = "SUBSYS:STANDARD"

   %constinteger Wsp  = 7,     {work space pointer}
                 Code = 14,    {code base}
                 Gla  = 13,    {gla base}
                 Link = 15     {subroutine link}

   %constinteger H = x'FFFF'

   %constinteger    Diag Stack       = 1200,  {stack required to run MDIAG (bytes)}
                    Basic Stack Size = 8      {god given stack size}

   %owninteger      Subsys Limit              {subsystem stack limit}
   %ownshortinteger State         = -10       {0=forground, 1=background}

   %constinteger  Opt Monitor =    1,
                  Opt Dump    =    2,
                  Opt Verify  =    4,
                  Opt Xdump   =   64,
                  Opt Quick   =  512,
                  Opt Trace   = 1024

   %systeminteger OPTIONS       = Opt Quick,
                  DEFAULT STACK =   10,     {60K for now}
                  DEFAULT TIME  =   60,     {one minute}
                  TT MODE       =    0,     {Terminal mode}
                  Obey Level    =    0

   %externalstring(17) Console int    = ""
   %externalstring(17) Prompt text    = ""
   %externalstring(17) Command prompt = "Command: "
   %externalstring(15) Error File     = ""
   %externalstring(7)  Search owner   = ""

   %recordformat Filefm(%integer Unit, Owner, Name1, Name2)

   %recordformat Parmfm(%shortinteger    Dsno, Dact, Ssno, Sact,
                        (%integer        P1,P2,P3,P4,P5,P6        %or
                         %record(Filefm) File                     %or
                         %string(23)     Text))

   %recordformat Contfm(%integer      Ps, Pc,
                        %integerarray R(0:15),
                        %integer      Eps, Epc,
                        %integerarray Er(0:15),
                                      Efpr(0:7))

   %recordformat restfm(%string(31)%array IO(1:6),
                        %integer Modifier,
                        %string(63) Parameter)

   %recordformat Command Fm(%string(31)         Command,
                           ((%string(31)         In1,  In2,  In3,
                                                Out1, Out2, Out3   %or
                            %string(31) %array  In, Out(1:3) %or
                            %string(31) %array IO(1:6)),
                            %integer            Modifier,
                            %string(63)         Parameter) %or
                           %record(Restfm) Rest)

   %external %record(Command fm) Command

   %owninteger Seg Mask     = 2_1111 1111 1111 1111,
               Current Segs = 0,
               Work Segs    = 0


   %owninteger C Level = 0          {current contingency level}

   %recordformat Eventfm(%integer    Event,
                                     Sub,
                                     Extra,
                         %string(63) Message,
                         %integer    Pc,
                                     X)

   %externalrecord(eventfm) EVENT = 0

!*******************************
!
!         {diagnostic routine}
!
         %routine REPORT(%string(23) TEXT)
            %record(parmfm) p
            p_text <- text.tostring(nl)
            svc(4, p)
         %end

!*******************************

   %include   "Sysinc:Ascii.inc"
   %include   "Sysinc:Direct.inc"
   %include   "Subsys:specs"
   %include   "Subsys:io.imp"
   %include   "Subsys:general.imp"
   %include   "Subsys:filerts.imp"
   %include   "Subsys:loader.imp"
   %include "Parse.imp"
   %include   "bci.imp"



!========= SUBSYSTEM ENTRY POINT =========

!      Control reaches here when the subsystem
!      is loaded by the system.
!      The floating-point registers contain the startup
!      message.

%externalroutine subsystem %alias "%GO"
   %record(parmfm) P, Q
   %record(Contfm) Cont       {contingency info at outer level}
   %label          Trap
   %integer        N
   %ownstring(23)  Batch  In = "T:"
   %ownstring(15)  Batch Out = "T:"

   *lhi_0,EVENT
   *st_0,4(Gla)               {prepare for events}
   *st_0,8(Gla)               {new standard}
   *stme_0,P

   *st_Wsp,N
   *stm_Gla,Old State
   Subsys Limit = N&x'F0000'+Basic Stack Size*1024-200
   Stack Limit  = Subsys Limit

   Seg Mask = Seg Mask !! 1<<(Old State_ Gla>>16)  %c
                       !! 1<<(Old State_Code>>16)  %c
                       !! 1<<(N>>16)
   SubsysFile_Code Segment = Old State_Code&x'F0000'
   SubsysFile_ Gla Segment = Old State_Gla
   SubsysFile_Code Base    = SubsysFile_Code Segment+16
   SubsysFile_ Gla Base    = SubsysFile_ Gla Segment
   SubsysFile_Head        == Record(SubsysFile_Code Base)
   SubsysFile_Defs         = SubsysFile_Head_Defs_N
   SubsysFile_Specs        = SubsysFile_Head_Specs_N
   SubsysFile_Code Head    = SubsysFile_Code Base+SubsysFile_Head_Code Disp&H*2
   SubsysFile_ Gla Head    = SubsysFile_ Gla Base
   SubsysFile_Stack Limit == Integer(SubsysFile_Gla Segment)
   SubsysFile_Stack Limit  = Subsys Limit
   SubsysFile_Options      = No Decode
   Relocate(SubsysFile)

   A Limit     = Addr(Alias Text(Max Alias))
   Alias Limit = Addr(Alias Text(0))

   %if P_Dact = 2 %start                        {a batch job}
      State = -10+1
      Q_File_Unit  = 0;     Q_File_Owner = 0
      Q_File_Name1 = P_P5;  Q_File_Name2 = P_P6
      Unpack(P_File, Batch In)
      Unpack(Q_File, Batch Out)
   %finish

            Init Streams
More:       Unstack Conts(0)
            *la_15,Trap
            *st_15,Cont+4
            *stm_0,Cont+8
            *ahi_wsp,300
            C Level = Contingency(Cont)
            %cycle
               Stack Limit            = Subsys Limit
               SubsysFile_Stack Limit = Stack Limit

               Current Segs = Seg Mask
               Work    Segs = 0
               Loaded Files = 0
               Obey Level   = 0
               Skipping     = 0
               A Limit      = Addr(Alias Text(Max Alias))
               %unless Addr(Alias Text(0)) <= Alias Limit <= A Limit %start
                  Alias Limit = Addr(Alias Text(0))
                  Console("All LETs removed")
               %finish
               %unless 0 <= Lib Limit <= 7 %start
                  Lib Limit = 0
                  Console("LIB list cleared")
               %finish
               Lib(N)_Use = 0 %for N = 1,1,7

               Obey(Batch In, Batch Out, Version)
               Stop %if State # 0
            %repeat

Trap:


      {Base level contingencies come here
      {There are two cases:
      {      1   A terminal interrupt has occurred, in which case
      {          either the global string "INT MESSAGE" is set
      {      2   A contingency is fired at the current level (Int:.)

      *stme_0,P
      N = -1
      %if P_Dact = -2 %start                             {shutdown}
         P_Dact = -1
         Shortinteger(Addr(P_P2)) = 1<<8+'.'             {pretend INT:.}
      %finish
      %if P_Dact = -1 %start                             {INT:something}
         Console Int = String(Addr(P_P2))
         N = Charno(Console Int, 1)
         %if N # '.' %start
            P_P2 = 0
            P_P2 = 256 %if N = '?'
            P_P3 = P_P1
            P_P1 = Addr(Cont)
            Svc(27, P)                                    {Resume}
         %finish
         {Int:.}
         P_P1 = 0;  P_P2 = 1;  P_P3 = 0;  Svc(6, P)       {kill output}
      %finish
      Stack Limit            = Subsys Limit
      SubsysFile_Stack Limit = Subsys Limit
      Stop %if State # 0                                  {Terminate batch job}
      Init Streams
      Console ("*Subsystem failure") %if N < 0
      Dump Contingency(Cont) %if Options&Opt Xdump # 0
      ->More

%end

%endoffile
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         E C!          Dd})r    
}	      s_    ~wZx    %%N3}+  %%N4:M $ S@   * #4"K  0 &y$ }  6 fS}}  < %Qv_ B ""`:%   H wq af" N %Qv    T"Z     Zf;s[ `)d+D     fc     lz`   r&@   xX_&@   ~UM[D (*;eox ``EX!     }}     qI     ْ}@   #!t(   w@   b!yW   9`EXg\   e!`   `EY}  `EWK    @w:` bwag\ :     a@   :H   ayu   wF6g\   	>q["iZ}  	O:`    	lafk    	NW
*xgQK 
<X`QK 
W'uxp` 
wG-} &
q["op`, fZJ_2`:p  8wZ} >X/Xg\D`a  J*wp`P?X/YVTwL  \fZXbX_Lv@  hUp`n&y$@  tHqIXH  zqX_Lv"8  yA    yA    X_d/@  yd     
|"=+&%K"=+^ULu;`  w8    aX    Ņ}+EGZ&~v,U~u@  (<@    A~u@    Z:      v(QT    `Ud 5S`:w}R-^e&Z    K#	y    "e&@qVM&@
	e&@fS    @]    V!t^Z} "s;ov    (=}    .(v    4efZK   :{sv    @fZ    F/v    LeE     Ry8@    XRqI     ^mfp  dda]p  ji    p4iiR  vd  |V   nd+GeZ^H[s      p     o     =MY   !)o    !\}eQth!#p}SI"d:w	Rr8{Lu;`t8{}} $&e}     $)	8    ::w  K4ga  $fxXH&X/;`    'X      (#(    )      NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z           gitw    Z!       8  a   A        D        Z&""   b   A a    A   B  b   a    b !A $   "      
   "       !    	   %  a         $A      "     "      !     BA   A 	   "A     !    !    $A       "A ! "    !    	D    A!A ! A  a     a  !    .A!   3F    A !!A A    A bB !  a  A   a !   )  nA!   s#       !     !     !     !     !   !    !   A   " !  A! B   ! a   !!   !        !  a"  ! !  B ba !    !    !     !    	  " ! ! !"    	! a   !      c!   A AA A  A   '!"  A!  !       9!    =! A   A(! "   b"  a  !A     !       A   a  a b  A a    B /  !    !    ! a  a   C    !    B!   ! a   !!   A  a A  A  
  " b   A 	  ! a a a !   !    ! a a  !   ! a    "        "a  !b    " A      A    "  A     ""A     (D      0"      5"A    <" a     B"     G"     L!a    P"a    a!     ^!   A    !  A  A  b    A A    u" Aaa A   A   A     " A    CAA a      A! a        B  AA  
   $B    )BAA     1#A       <B     	   E! a     J"       S!"  a a   !   a   A! $ !    A a    x!     |     ! 
        aa A    ! b  A  A AAB!    !    # b   a   a a  !  !Ba    !    ! b A a  " A    !       A ! 
   B a  A a BA   a   C A a  B!    ,! !   b   A Aa  d   ! a A!  A!  A A  a  ! a!  A AA !a"  7  M"!   T"!    > !aA     E     =-  a ! 
     T      Y  AAA    S, a    f        A B    A       aa     B  a  a !     a ! b!       B  BD     -     "           a  c    b   a  B    " a C A   A a A  a  b A  a!   A a     !  6B       =B b   !  AA  a   A      V  A    a A   `  B !          " !   Da  B   A  "  ! ! b   a     a   !a "  C   B 	  " a    A      a          b M       !     E! A   "A   A 	  	A! a     B  aA!  !B A a A      5   ! b! 
   =  a !a A A     2T    A   B   A a A  A BA  a AA A  AB  B  a A   .   	      A  A      B    A A    A B        ,! A    C ! a    ;#  a    A AB a   A a  A A   a B   A  %   q  a  A     #      "   C   AB  A    ! d ! a   ! ! a  a &   A          
         bAA A A !    U d      #  !C     c     ! a  A !  !  A ! ! aB  a a    b    a A a A a  A    E   u! B    A A    A A A a    a    A a     a A A AA    a B   a  A      a        A ! F    dQ@    D"ZPZx7W  Xz
zLu;`\y}``T:v  d	h	)Rl-^ep^%T  t&y$ } fS}} %Qv_""`:%  wq af"%Qv    wQ{D  $qV.(*G.  ,T0"Z   ZK    X  )W%  /b0  |&!x:p  a  )XtĀ/f   	 ZK	<:{#(	@aE	D:Ё	Hay^X  z
z&@$MY&"8(MY.  dMYy}p_y}  |y:Q} hLjLu;`  l~y8yE,h} )R  _d X_d )	D:Q} f.Q@  d:SxfX   `#(  $^:%!qX`     ,}}  Dd    X_&     Ā ,;`   	qT{ 4  Ā ;`   	:yqIT8Ā ,%  Ā 0(   Ā 4'`   8(   <>   @d    d+D     ,&!qR  Ā d+E ld        Ā &@À  v   ,d    z`   +qK   Ā  d    &@  Ā %    m"` ,d    L&!qR   X_&@  Ā %    xB@ ,̃t 0d    qI\^C   z`#(  oH   ,&Zp 0d    }M[D E    oH   ,&Z 0d    }    +26Z   `EX!     W  t   ,&!qR   Ld    }}     W ,d    qI     W  ox }@   W  ox #!t(   W  o ,&  0d    w@   W ,d    }qI R    yu `EX     yu ,&@ Ld    lj@  Ā &    `EXg\   yu ,&@ `EY}    yu ,&!qR  Ā L%  Ā P(    T̃tW@ dK*!  td    j@   >   ̃t 1`EY}  yu ,&@ `EWK   D %Qv   À ,&@ 0>   w:` yu 	wag\ yu 	:     a@   :Mp ayu" &%   wF6g\   |@ ,ox 0^w q["iZ}  :`     afk     !       qIQK  xgQK  ,xd  	X`QK  ,z   	'uxp` wG-}  |@ ,ox 0^w q["op` fZJ_ z   	wW   yu  v@D ,%QvqI 0d    P_   wZ}  X/Xg\ w`   yu  4o  Ā ,&0   0&    ld    j@   E   !wp` X/Y wL   4o   ,v   0:` fZX ,v  ,>   X_Lv@   Up` &y$@   ,Rv@   l_yu   qIXH  À v   ,z   X_Lv"8   W   	yA     yA     W   	X_d/@   yd      ,d    		ew   W    xB@ ,d    "ew   W   ,d    ~l=.   ,d    	ULu;`   w_v   ,d    8     @    |"8 ,d    aX     ,}  Ld    }+EGZ X   ,d    &~v,Ā    ,d    U~u@   ,d    	<@     ,d    	~u@     ,d    	:       ,p   	(QT     ,p   0Q@   4    8   yqLX   (_Q@  xB@ UdZXĀ &}  ,v   }R-^e Q@   ,d    ^"     ,&!qR   (9  S <k   L~v	i_ T(_Q@ tX   ##	y     ,&@ ld    "e&@ ,&@ l%   qVM&@ ,_W@   FX_W@   `_   X_   	e&@ ,&!qR   xB@A  	eH Hd    fS     ,v   <d    ]     _&p 	!t^Z}  ,v   	;ov     W    d    D    Hx/W }     W    d    rX          d    ,    (Q_   ,p   eÀ  v   (v     ,p   d    0v   t#   xz   fZK    ,p   e sv     ,p   @       0N` 4r   8v   fZ     ,p       @   /v     W    d    ,v   lD   eE      W    d    !         @ y8@     ,v   lW   pd    tK    x@ |z      x/W %qI      4y  4x/W8W  <K  @  D@Hv  L@P'a+Tp  X#  \%   5mfp  À v   ,d    da]p  À v   ,d            z   	d+D     D  Ɛ  W   ,d    0j@   4p   d+G   ,8  Ā }            W   	     D   	yEĀ }    	v;>9  Ā K   Ā  K  Ā ,}}  0    4{d Ā 8d    QĀ   Ā  }    ,W   0_h}    4d   Ā TK   Ā XLjd  #Q  K  yE QX     ,&}  K!  i. sf.Q@Ā f+ ,v   0Lu;` 4X_yx   8~u!)R   s       ,&@ Lf+ yW     ,&@ lf+ v   yx 	ey X_Lu;`   ,d    qT^9}  Ā K    ,d    0<w   4D   8-Zƀ <qT  Ā @}   Ā D   'MYX    Ā d    ,&@UU=w  Ā LK    Pj@   p@ MY     Ā d    ,&@Ā LK    Pf/@   |]     K! Ā ,K    ox     ,v   	!"    Ā d    ,&}  j@  À d:Q@ K! _Lu;`   MY     ,8  Ā y@    `T   <}    }eQth ,8   	#p}SIÀ   À  d:Q@ ,v   d    K    }    z   !,z     ,      Ð yu 	d:w	RĀ     `T: ,d:Q@,z  0d   4>  8z@  <K   @}    +'X     À _   ,j@   K       ,_   lX_       MX   M0   )	8    À _   	X`}      fxXHÀ v    x ,z   0'a+ 4    tX_  td   xK    %%Qv9d a}     C :l:u    x ,`T: 0'a+ 4d:Q@ X       ,}  	x ,W   0T8   4v  L!!f    ,Lv@   ,z   0v   ^@     ,(_Q@ LX   ld:[PLv@Ā &   D _%Qv D _qX`   d:Q@D _d:S   _`#( _xd    _wv   _*G. !/   >   f+f  K  d   Lu;` ez
z}   ,d    Lj@   l&} W  	W   `   !1
 & 1*Subsystem failure LIB list cleared All LETs removed , &seconds CPU  milli OUT: 
 not found @         	   .COM .EXE No room for definition of              Malformed command:  missing 
                       er loadedCannot access  .exe Cannot load  No space for stack Data:  *No space for stackFatal error during diagnostics *Diagnostics being sent to Cannot load diagnostic package Cannot load  Ref:                           075  w  y -0  H@.A  7 whose file?to whom?      PC  PS   Invalid addressA  @= *Contingency fails *Create segment fails  ) fails -- output(input( *Close  --  Cannot offer file to input ended --  *Cannot open Null:Out: NULL:IN:  invalid stream numberinvalid DA channel numberIllegal filename                                                 
                             too many open files            < 
                                                                               SUBSYS:STANDARDSUBSYS:BATCH SUBSYS:SUBINIT SUBSYS:MDIAG 
   +:?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nH  !34  1  0 !81 !5$$A> #$$A> &C ?1  34C0  D   D   
C H  !34  1  0 !81 !5$$A> $@#0#D   D   &A'1"C H  !34  1  0 !81 !5$$A> B  @ !4B ";
C@ !$$A> #$$A> B  C
B$P#E  E  &Q'1"C $A1    0#
#	QD   RD   ?&A'"3  $$A> X# Y !Y !&\ Z  B!$$A> З  $1$H  H X [ &B0P  [ ,&' ?P  
*&30H  P  ї  C Kї  $$A> 
Y  #%$$A> 
qPr  PB &(pX  ?$PS?PE   &T 41I2 !,K2  !
3s3B  #9
3
>!$$A> !$$A> A>  ?&?$$A> O$$A> ?$$A> "#:  ! ?$$A> ?$$A> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$2#XC   PC   '4"2$ #PC   '4" ?$$A> H  !34  "#(!B   C $$A>  w ( ,A AT D !A  ' , ,A VAf ( LA" r D  q Dx  ,w AT , X=|!<-<0A $ $$	AP8 ,X3 8P=|X( ,$?Ax  &g AT , X=|P6 8X %P X P|x  w P (AT , -$?A0 P=-$?A@ PM=P=ȽP$P$;AP 0P|1tP8 4X 0X  #<P X$@ Br @  q @X( 0$?AU( 4!2#P( ," <P( 0XH ,P$ 8C $=	|AP 8$[PX <Xh 8X  #?P X$P  $;@8 Br @  q @X 8&P 8X <'P <#3C $&P <P `=	LAM	 PA  X <=	dA]	 PQ  X <U `AJŐ B0P `$=	LAmPa  $`AP$=	dAP  $`A|x  Àg P (AT l #( r ,A r l  q l tX( $4AX xC*' ,A  ,Af -<A $ $$
Ax  :W  P (AT , ( 4$4Ar ,  q ,X(   2A   x  !W  P (AT , @e fAX  r    q  X8  X C0-< A  ?X  X* $$	Ax  0W  P (AT , ( 4$4A$>@8 .r ,  q ,X HT  C0&X  LXh A-< 4A X( H$$	Ax  6W  P (AT 0 X6 P8 @XF PH DPX HX 0$bAXX ,Xh <Pe  x  #W  P (AT 0 X8 ,P8 DPh HPX LX 0$iAx  W  P (AT 0 X8 ,P8 DPh HPX LX 0$jAx  g AT , f!` 
!%x -<A &$$	A W  P (( ,A AT L !A  ' , ,A h TAZXh AaA6X  P dX L$fAX =	|AX dP  x  ;g P (AT , A:=	|AX  P DX ,` A 8x   W  P (AT 4 A=	|AX ,P ,XX  Xa  Arx  W  P (AT 4 A=	|AX ,P ,XX  Xa  Alx  W  P (AT 0 A=	|AX  P HX  P LX 0$cAX ,X <P  x  'g P (AT , A4=	|AX  P D#?X ,$kAX =	|A$P  x  'W  AT , 	V!P !%x -<A %$$	A g P (( ,A AT L &!A  Px #Xx $ $$	A8 ,3B0 ` !(( ,A #( ,A ' , ,A h TA$QXh AX XŰ !=X =	LAȭP  C Ű #5 A!=X =	LAȝ	 P  C ŰB0&X =	LAP $AXH XQ  PT  C  L( l$8A$`Ph R$fA2AtP X P  X8 %P X X t'P X =	AP $=	AZ XH P XX $`Pe X $0P<  TX + $4AX =	LAP  Xm	DAx    u|g P (( ,A AT L !A  8 ,0 #%0 8 ,V$aAP L ,Xh LAx  /g P (( ,A AT L 1!A  Px #Xx $ $$	A8 ,3B0 ` !(( ,|A #( ,vA ' , ,A h |A$PXh AX Ű !=X =	dAȭP  C ŰnB0&X =	dAP $AX XA  PI  C Ű #5 A!=X =	dA]	 PQ  C z |( d$4A#7X t` A*Xh `   Ph $&P P =AP PX U |B0<X U B00X $U B0$XA  UH !>X =	dAXX PPQ  x U AJ B0P $Ph |Ah Pg ,$Zh |AV |( T$4A%P X t$fAlAP LX =	dAX LP  X LX P  XH L$PPT Xh L$P X =AP $=	AZ X LP X LX P XH LXT e Pd  TX L, $4A d, ($4AXm	HAC @  xg P (( ,A AT L !A  8 ,0 #%0 8 ,V$aAP L ,Xh LA,x  /g P (AT , Px 4C @Xx 4' ,hA X ,Af bAf <Af AF$ X4$	A$0&1P8 0P8 8=AX   P ,Xh 0AFX 0=AX  P ,Xh 0AX8 0U8 8AJ0 B0P 8$aA$aATx  i  g P (AT , V$`A=	LAX  PX  P	<X P	Dx  %g P (AT , V$`A=	dAX  PX  P	@X P	Hx  "w P (AT , X=	<#5x XMM	 !3$"	%" w P (AT , X=	@#5x XMM	 !3$"	%" w P (AT , X	Dx  w P (AT , X	Hx  w AT , XX< ӳ  Ű !?U< !3A,XX 'P C x  #g P (AT , X=	<C0^iPh ,XH @PH 0X]Ue #?Pe XX< P7 ,XX ,Xm	<AX 0'XZ P XXI TPY ABx  Aw P (AT , $`Afx  w P (AT , X=XC #$x IXS [S 
E " w P (AT , X=XC IXS [S 
x  w AT , -<VA $ $$	A w P (AT , X=XC UC #=&APC X]Xe   x X	<C0bX &P XX Y ##A|XJ PJ X]Xe P X=X P ,XS Xm	<A\XX U !3AC l=	 !3A,$@Mr  q]U!2"
XmP X=X ӫ  
P XXI &API X]Xe     !3AX=X   C  w P (AT , AP ,x  w P (AT , AP ,XX< '1P< X ,x  w P (AT , X=	@B0BXMXT ]'Q]P A"U#7r  qXmP X=ȽP x  3g P (AT , X=	@C0iPh ,XH @PH 0X]Xe Uh ,#?X U #:X5 P7 ,VXm	@AXX Z 0P XXI T PY XmX U ,C0:X8 ,	<!X P ,SXm	@A#
X P ,SXm	@ARXXH ,PI x  ew P (AT , $`Ax  g P (AT , X=Pc X	@C0jXX U #?XH I  X]Xe &aPe x X P ,XZ kAX=X P XX I PJ X]Xe &aPe C DX	 !3C X !X U !3A XH !X]Xe Ue !8AX #C vX=X X ҫ  XXI &API X]	@!8Xh ` 
!3AC @ W  P (AT , $=	LAXA  PH ,X]	DPX PAFXh #;=	LA	 P  #
$=	LAȽP  XU ,!5X  B0&XM	<PH H#?X 0$kA|X]$`Pe  XmAXh PAx  Sw P (AT , X=	D#5$QcA:x  w P (AT , Ax  W  P (AT , ,=	dAXA  PH ,XT  PX f!9AmPa  #A	 P  X8 U=	H!4cAlX C0$=	dAX ,U  C0$$AU  #=$AU  #7$AU  !4x ( 0$?AjAX 8U 4!5XH @B0:XX 8UX <#:$de  X 8&P 8"X8 4P7 ,XX @Xh A\X @&P @ H( t$4AX l` AX @[ xP #:X P X l$cAXH PH X l$kAXX  B0Xh \C0Ph tX `P |X8 dP8 X PP X TP $@ nr l  q lXH Cf$PPX Xh \Ph PX PX ]? <h A
' ,@A <Af :Af  tAf -<A  ?X( $$	AC : H( t$4AX |P X8 P8 X l` A$Ph HA,#XŽ	 #3AbC J-w P (AT , X=	H#5$PcAx  w P (AT , X=	H#5$QcA\x  g P (AT , $3P8 ,Px 4C TXx 4$`A2AX 0!6*A#"Az$PXh ,A~' ,A <Af ATAXh ,A\Xh ,AX ,!4x $P 0An$APH 0XX Xh ,AXX ,'QPX ,C  _  bw P (( ,A AT, N!A  8 ,P84$@$!A,PH,C *&APH,PH0 ,$A a  A6XH,UH0AJUH4B0P0x  Cw P (AT , $jAx  w P (AT , X=XC @ 
#3Ax  w P (( ,A AT l !A  ?X=	HP8 l$`AVA ,AAnXh lA>x  *g P (AT , $06  AP , 
!3C   @ 0X + 0Af C x  )g P (AT , X #('P $jA"	x  w P (AT , `  Ax  g P (AT , X #)'P `  A"
x  w P (AT , $lAx  w P (AT , $PeAVr ,  q ,x  W  P (AT , PX 8%1P8 <r ,  q ,X X 4 P  X XI  C.$PdA' ,A ',A  ,Af A#X( 4A$QR  V](P](x  Ig P (AT , &A$12  %ACTM(PM(Ph 4r ,  	q ,x  "w AT , X=$P8 4r ,  !q ,x  g P (AT , f#x Ph 4r ,  q ," W  P (AT , Ph 4PX 8r ,  q ,X 4!5%x $" w P (( ,A AT L !A  8 ,0 8 ,$IPH T$PPX X( \ ,A  r L  q Lx  0g P (AT , %16P8 4r ,  q ,x  g P (AT , Ph 4r ,  q ,X 4C0,$PlA' ,A ',A  ,Af A,X 8x  2w P (AT , $0P8 4r ,  q ,X Dx  w P (AT , r ,  q , 4$	Ax  w P (AT , r ,  q , @$Ax  w P (AT 0 h ,!j@.>x k@.N" w P (AT 0 h ,(#++i@BbX8 ,P8 40 0 P8 80 F#%+ x %APH 0XX 8P F#Xh 0dPh 0&QPX 8"X 0   T 4P 4h ,k 4` ,h ,#j@` ,(C  RW  P (AT , `Ph X  B0"A2X8  !#C j$UXh A6` :A*# !3A0A,$TXh A!<AAnAx $XX Xk  AX  'P  X &P C |AC  Ug P (AT , AA$XX Xl HAA$UX8 Xc LAAl%&P ,P 0ð !3AV$TXh ,AX ,=AX  P$ZXa  AFX ,U 0AJŰ B0P 0A%&P ,P 0Ð !3AXh ,
f$TA~X ,=AXH  $ZXa  AX ,U 0AJŐ B0P 0AXX Xe L`Ph ,`  ` !X ,<P8 ,#X ,   P ,P Xh ,Ax  g P (AT , Pml$;P8 4$@PH 8Ph <r ,  q ,x  W  P (( LA AT T %!A  ' , ,A h \AZ' , LA h |AFX !<-<A $ $$
AX8 \!4X `#<-<A $ $$
AX dP X hP P |$A@H vr t  q tXX #<-< |A $ $$
Ax  kw P (( ,A AT l $!A  ?Px #Xx $x ' , ,A h tAr @ nr l  q lX8 #4$C %C  :  ^dw P (( ,A AT l !A  ?' , ,A h lA
$Ph lAx  )w P (( FA AT ` (!A  ' , ,A h hA' , FA h AX P xX8 P8 |X `$oAFx  8W  P (AT H ' , ,A h PA`X P `X H$bAX8  X TP  x  'w P (( ,A AT < !A  8 ,0 #$$?8 ,- ,A ( HA XP Dr <  q <x  3g P (AT , $0P=f!4$1P=x  w P (AT , Px 0#Xx 0%x AP ,$"   `fW  P (AT , H ,$0P4 Ȱ HP A6  ( <AP IPX D$0P8 HX  #,0  P8 HȰ H[  P  #Ȼ IP  !$$P  fCD0 -P8 H$`[h Ph C.VE@ %JePh X D'P D8 <A@ 8A  XX D'QPX D8 <AX  $j 0   A"X8 #  $+P8 3#3C X HC0 X D'P D8 <Aҡ  à A"XH DYH  #/'APH D8 <AP  Q  C 'APH D8 <A` Hda  ` A"X D8 <A  HAx  ̀W  P (AT , AVAx  W  AT , h  !4x (#h@` ,#h@` ,X  'P  ##	hh ,mn@`h ,"X8 hC  jH ,`C  C  5W  AT 0 f!$x %Af X C @'P h ,` ,Al@` ,.0ȳ 0  @ 0X  * 0Af C C  :g P (AT 0  $08 0` #$$gPh h ,#Ȱ -P x++` ,#Ƞ  P x(!7ȐP tC LP8 th ,i@!XH t&APH tm@` ,C hh ,in@#XX t'QPX tln@`h ,C XX h ,Avh ,i@!Xh t&aPh tm@` ,.< 0  @ |( 0 |Af @` ,X@  0Xh A$PXh tAd' ,A ', 0A Af  ,Af ( 0A  @  @Ax  g P (AT 0 h ,` ,AAx  W  P (AT 0 $08 8` 7#%` 7Ph P #$$WPX  h ,Anh ,(#++` 4i@C ,h ,` ,Xh Zh  A' ,A   ?Ax hh ,.P 0B02(fC,X #,'P ( 8Af ?"( 8Af ?#XX kA&( 8A  ?hH 4`G ,X?  8Xh  A( 8  ?AC  W  P (AT 0 h ,` ,AAVx  W  P (AT , $08 ,U#$QPX  #P ?#%P ?PX  X  ɰ #,( ,Af ?'P  "$Z$IA%AXH B  PH XX P P PX lXh dPh P 	#&U 7PX l#U 0PX l  @ p( , pAf ?X  'P  !* ,  ?Ax C  rW  P (AT , AANx  W  AT , X6  0 0!0 9!'3P6  C *0 _0 A!0 Z!*X  İ _ȫP  #$x X XI  YH  #%"$" 7w P (( ,A AT l "!A  ?$0P8 lH ,PH tP8 p$ZPX xP8 Xh pUh t!6X lx &aPh p ,&A ?  P |  !3C X8 B0"$1P8  -#4 +!9 -!4%1P8 C dP  _!:X lP x$P lC HXX xh A!7X( |$$AXX l\H xAPX lX #&ZX PX l#X l[ P lC 6 w P (AT 4 YX8 04P8<XH ,PH@3!7@ 4 P8<XX 0P PXDP !P !$P !7X(D$AAr  !$AD"XhD` B0`$ 4APPH  !#C    @`( 4`Af AC X8<Ӹ 4	;!&$ $$AX(@ 4A x $P4PLA -#6A +!7AȑP4$@PH8PHPAPHXXLhHAb!3C @$QPXPA~XX8\HLAPX8Xh4!6[XHPX8#ZXHPX8AtPHC XH _!4X88!2##$0;P8LA&C vX8/`T .B0XDŐ #5Ő B0|+`\XHL/`XAA
PHXXLhHA!3C .$QPXPXhH/mXj\`\XL/llhX`hXAC X84!8hHTkH\`HT#h(Tj(\`(TXP!8A!$$AXD.~AX@X8P  C `XH8@ !@#&$$AXX@@E  DAC 4Xh8!` #&&$AX@l  ` A"#X8@hT`  C cg P (AT , 6  &1$%!A,P8 ,C b'1P8 ,P8 0X #A  ӱ  ɰ aB4ɰ zB ,X #A  P 4X #A  ӡ  X 4JI  X8 ,U8 0AJ0 B0P 0x  Qg P (AT , 6  &1$%!A,P8 ,C b'1P8 ,P8 0X #A  ӱ  ɰ AB4ɰ ZB ,X #A  P 4X #A  ӡ  X 4J  I  X8 ,U8 0AJ0 B0P 0x  Qg AT , ` _` A!` Z!*X9 0 _y X ɰ 0!ɰ 9!$"ɰ #!ɰ %!% C Ű  !4$C %C  8	W  AT ,  ,&A 1  P9 , ,& A A  PI 0 ,& A Q  PY 4cA<Xi 0P 8A0XY 8` (FA
QXi 4PY <AX < (
AX9  
@  y  Q	g P (AT <  , #%$ ,#8 ,0 #9( ,ZAf "XX $aAX [ $dAX Z $gAX Y $jAx  >g AT , ` !& @y ` $!$ "" 	g AT , f!4y 6#  @ ($cAXY E@ ` (FPI DC0dA  @	 ,- ,Af C  6	g P (AT , $X8 sc  ApX sk AdX sj AXX si ALx  )W  AT 0 X6 P8 0X 0C0X 
Z P 8X XH ,U  B0nX[ UT B0bsk 
fPh 4X  X< #X: 
6P< C ,X P X  X XI PJ  XX Xh  X Z 4P X8 X ,P%x s[  PX 0C `$"
 _W  AT , X=`0 C0"eA' ,TA Af AX`ð #?X  P ,XX mA#4x X$P ,XH ,C 4=AP TXX  PW ,XX aA#3C Xh ,'aPh ,C X$ C0 =AP T%BPH ,X8 ,Y=hC&1P8 ,!7ȽlP XC .3#-A ȭP X$P  #=AP XXH XXT  !5d f!3C p h 4A!3C ^X  P ,XX Xh TAC0>X8 TX XP $X X$P  XMPH 0Xh TAXX 0P]Xh XX  !2#	C Xm$AC (X=`0 !>X  P ,XX mA#3C Xh  A$' ,FA Af -<A X $P XH $PPT Xh $P  C N	w AT , 
dx   (  pXhp Xts<@$+As\

Ps^
ZpP\iAXMXT  P]XXd Pm\X P0(3w sN@
D
N $"?C j Xw AT , APx #Xx $`A&AAx h AC0,$aAR' ,
A Af A"$aAפ>P 0 4h ,AP,'P X|w  P  $`ARXh A,C vAC j b  _mg P (AT , %1P8 4XF @ #?Px ,XX ,ePh ,X  P 0C bXdP 0X6  	<#$P8 0#3#$P 0X 0Ȑ 
AP 0[h ,AXH ,#A8x PH 4XX 0
TPX 0Xh X ,P X8 X 0ȫP  X XI @ !5mA^-A AX]hPX 8Xh X 	#$P 8##$P\PX 8-00 AXh 8A&Xh AzX8 4!c` AC R w P (( ,A AT L !A   ,h LAX d P dh LAXh hAxx  +w P (( ,A AT l %!A  ?%1P8  ,h lAX ð B0hX l#$P !7ư P C JZ` FAP Zh A0X #-<A $ $AP pZ <P8 lh lAZXh AX !k` Avx  jg AT , Pm|X=Pc  X$P ,X ,C "'P , =AX (XH PI  C x  +g AT , AX s< 
3P8 ,X s@
P 0X ,C0XH Z P DXY  
UPX ,Xi C\s 
Z 0P @\iAHX8 DX B08X X $$@PI  Xh @A' ,A Af -<A ##XdP  X8 DXlP C fX X  sI 
DZJ PH <sY PX 8Xh 8C TX <H<  1X 2Z; P8 4H  à #8X  Z P  #XC  ZK PC  XX <&RPX <Xh 8'aPh 8C X X< P< (X X X|P  XH XT m0Pe X X< Ƚ0P x  ƀg ( ,A AT L !A  X=$0 !5$x ' , ,A Af ( VA r P  
q PX X!7X \V `C&' ,A  ,Af -<A $C X \IPH p )A$QR  sh `V](&A$  \P](X=$&1P=$=AP LȭP $X LXI $$QPT  Xh LX pP  X8 LX `P X LX \P XH LXX `PT Xh LX P  X8 LX  s 
Z P X LXI PI XX LXe  H P X8 LX  H P X pXH LHY PT ,Xh X$P X8 X LX ,P X pXH HY PT  Xh pX H6 
P< X X LX P XH XX LXe Pd X %1P< X LX  H 
!  XH 
Z P X]`P #?' , ,A Af AD%C  g P (( ,A AT L !A   ,AC0:X$=AP L PP $$1P8 PXh LAX LX $X  #4x $ $A <g P (AT , X$C0DY B<'P$ =AP ,X $$P  X ,si  A݄XH ,sd AxC x  4w AT , ) ,<A $aA٦-< ,A y  	g AT , B=P8 XM|PHXV #$!$$ A~P 0 4h ,A`P,'P Xh X  !:Xf  AfXh X #Xh pQ  qX X-| P-  X=XP  XhA&Xh Ax q XXP  XhA $RXh xAC0"XH xsT  P  !:Xm0!6X4!3C #	0 P=0Ӹ P4X xP|Ș ,PAX` #5h ,AAdC t W  P (AT < ' , ,A h <AHX $0P< X <Xh A^X  XP  X XI !6$ $Ax  3w P (( ,A AT H !A  8 ,0 #%0 8 ,$Pl-p ,A x  )W  P (( ,A AT  0!A  $06  X  $ҫ  $P H ,PH XX UX !4x &QPX  ,%A a  Ph =A  P  B :X ӫ  Š C0(  @ ' ,A  Af +A"  #`  !7X I  D#2#C jXX YX B \ ,%A a  Ph &QPX `  !9X  <  3!3C (X  ӫ  Š ?#>X 	  @ + Af C C  w AT , X80U8<#?&1P80 ,#A A  PH,#$JPH,=AQ  PX8y  +	g AT , $06  X8ɰ B @Ű !7X,JPH,Ű C0XX,  @	 ,Xi & ,Af ANC X, ,!3A<y  <	W  P (( ,A AT, S!A  ( ,Af $0P80H ,PH<X( 0 AAAXX8P !9Xh X,P AX8  0 #:Ȱ P8X0'P0X8Ð C0Đ P@AXH,UH@B0dXX@P 
B0PXh  C0B & A ?A  PH,=Aӱ  Ű !=X !:PF X Y 'QY A(C ~@  !8Xh  ` @#3C f@ 
B08X@  @D' ,DA Af -<A $!$$AX8 ӳ Ű ?#=  @F# FAf ?C X  à  #8X i?  AXH,@  !4A"XX8P !:Xh X !5PF AbX8 c  AX k @AX j `AX,Ő /B0(A.XH d AxXX e AlXh f A`X,=A   !<X X !7X,P AX,Ő 
C0N-<A M<@ ?#?XX,  @H-<HAf ?AXh,` 
#3C $ $$Ax \g AT , $=APXYCD<   P=ӳ  
&P ,   PX( A!5%x Ӛ  
&PC $" :w P (( lA AT  .!A  ?h?  ,Ah?  ,ATC0PX  X=ӳ  
&P X YC$XJ  I  X]&QP]Xh &aPh C XP8 l3!4x Ӹ ,P P8 
Z&YC  ' ,A  ,Af AC X- ,A Z( &!P- lA Z( &!P-C  g P (AT , AX lAf#7X( XA x  w AT , X8tU8x!5$y &1P8tX #A    " 	W  P (AT , `0 @P8 ,$APH 0$PX tPXt  PxX , @B0>AP ,  !2" 0Bt 9B lX8t0 C0`P ,B0$$PXmpAܠ' ,A ( t ,Af C $XY  !.=A ( tX  Af AP ,C  @B0$XtŠ #>( tAf AP ,C |$Ҙ 4X ,=AA  @ B (XX ,  @|( 4|Af ?AP ,C h?  4A^Xh  !X 0#5 4A
h?  4A(( t 4Af $0P8 0C .X ,Ű 
!3C $  @~( t~Af AP ,C X(  tA   X !7X`Ð C0>XH  C 6X]#;$!A  a  ` $!?' ,A X Af Ajx w AT , -$A ' ,$A Af A؄#5$x -$Af %$Ad#4%C C0b' ,A Af -$A ' ,$A Af A#4$C -$Af %$A#4%C p$C j jW  P (AT , .$0P8 ,P8 0Px C XXx X4!4x X0Š !6<AF"X 0C0 ' ,A Af -<A <AC -0 IA-$8AAX X  4m AA~P 0!=$mAXMPH ,C &#/' ,A  X ,mA#$QPX ,Xh  #C 0 4XX ,mAbX#7=0 $B0RX 0!;mAXmAC 8C$' ,$A  ' LA A#$P 0mAV$`ÀC   &h&w P (( ,A AT  +!A  $Ph  ,AJx   w AT , A ( 4A AѐP ,[LP 0X ,PLC@$UaA4' ,A ', 4A  ,Af xAf ( 4A  ?C XQE@ 0C/`X$Q$ep,Ap,',A ', 4A ,Af vAf ( 4A  ?jAf ? 4Ax  ww AT , A֦$PAôP , 
!4y  &B0NA 
B0BAĮ) 0hA 9 0ӽ	;#) 0fAf " 0AD-A #X ,
  @	 B-P BAf C v U	w P (( lA AT  H!A  ?$P X=P8 X P XP X$P XM(PH PxC XxX]p'QP]pXh Pm(X P$$PeAƂ$=	LAX P  X X  #<XJ !XZ PW ,TiAXh C0>$PeA0$=	dAX P  X8 X  #>XS &QX P ,X Xi  A$`A|$`AXH PMXX P] Xh Pmx 8 P=Xp B0 h Ax#:X$=AaAX=p&1P=pX$&P ( ldAf ? l( lA ?P$P Ș lPXMPM$PPX Xm&aPmX &P 6  0 ,#2"X'   A"X &P =A XI   PA  X]U]#3C $=	LAXa  Ph $A	 P   ,$`A
' , LA mANX=0nC0V$=	dAX  P $Aȭ	 P  $=	dAX  P XI  #;XY &QXi Pg ,dAL L$`AH\#&@\#7X=`0 P=`A%[(T$P$$P(A8$`A|$`AXh At$Pҝp$aAtAv$@MtX]l#4dAXAA*mPf!2"$Qm PAfX` #3AC   (/(w P (AT , I0P P q ,PxpX   <8P=XP=|sp+A$  stW )A$AB  sX%A$ab  P Xt   PXpPK PMPPMHT P]Hd Pms 

LPMPPP9  $PmA=AP$APH .Š B0<%@\$@PH TPH XXX DPX \Xh HPh `] h 4A]  h TAA$`AP p tp,h lAP,XXP|X=P  X P$$P(P$PpP=APAX	!Y#*APRAXMh!@ #($@PMh@A$P&QPXPX =A$`Pa  XXUX AJP B0P ' ,A ' L A PAtH\#3AC $q ,%1P8H .Ű!7@8 .Ƞ.@ 8H .B0j-t 8A  B PH@ .C00$P 8@ ?!5 P 8XX 4PX <X lPX 4r ,  q ,$`Ph 4$P 8Ph <r ,  q ,X=XP=|XP;  H\#3A:AX#,AXM`@ @#5h lAC ,U=	@!4cAlX C0$=	\AX ,U  C0$$AU  #=$AU  #7$AU  !4x ( 0$?AjAX 8U 4!5XH @B0:XX 8UX <#:$de  X 8&P 8"X8 4P7 ,XX @Xh A\X @&P @ H( t$4AX l` AX @[ xP #:X P X l$cAXH PH X l$kAXX  B0Xh \C0Ph tX `P |X8 dP8 X PP X TP $@ nr l  q lXH Cf$PPX Xh \Ph PX PX ]? 4h A
' ,PA 4Af JAf  tAf -4A  ?X( $$	AC : H( t$4AX |P X8 P8 X l` A$Ph HA,#X|Ž#3AbC J-w P (AT , X=	@#5$PcAx  w P (AT , X=	@#5$QcA\x  g P (AT , $3P8 ,Px 4C TXx 4$`ABAX 0!6:A#2Az$PXh ,A~' ,&A 4Af ATAXh ,A\Xh ,AX ,!4x $P 0An$APH 0XX Xh ,AXX ,'QPX ,C  _  bw P (( ,A AT, N!A  8 ,P84$@$!A,PH,C *&APH,PH0 ,$A a  A6XH,UH0AJUH4B0P0x  Cw P (AT , $jAx  w P (AT , X=|XC @ 
#3Ax  w P (( ,A AT l !A  ?X=	@P8 l$`AVA ,AAnXh lA>x  *g P (AT , $06  AP , 
!3C   @ 0X + 0Af C x  )g P (AT , X #('P $jA"	x  w P (AT , `  Ax  g P (AT , X #)'P `  A"
x  w P (AT , $lAx  w P (AT , $PeAVr ,  q ,x  W  P (AT , PX 8%1P8 <r ,  q ,X X 4 P  X XI  C.$PdA' ,A ',A  ,Af                 
                                 $       $ *       *" 0       0& 6       6* <       <. B       B2 H       H6 N       N: T       T> Z       ZB `       `F f       fJ l       lN r       rR x       xV ~       ~Z        ^        b        f        j        n 3.1:B         
   <         SUBSYS:STANDARD%1 SUBSYS:STANDARD%1	Command: ANDARD%1 Command: ANDARD Command              xhhX                                                                                                                                                                                                                                                                                                                                                                                                                                                                        D                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              	T                   	l                  	                                                   	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        l                                                                                                                                                                                                                                                                                                                                                                                          h\                                                                                                                                                                                                                                                                                                    0ose file?ress        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               @COMoom for definition of tics<-      econds CPU definition of tics<-A$P P Xi DAbC 4!7XH @C PmTX]TPY h&SPPY lP]TPY pXH 'API tX P W                                T:Oonds CPU definition T:Oonds CPU def-4A $C X \IPH p )A$QR  sh `V] &A$  \P] X=&1P==AP LȭP $X LXI $$QPT  Xh LX pP  X8 LX `P X LX \P XH LXX `PT Xh LX P  X8 LX  s 
Z P X LXI PI XX LXe  H P X8 LX  H P X pXH LHY PT ,Xh XP X8 X LX ,P X pXH HY PT  Xh pX H6 
P< X X LX P XH XX LXe Pd X %1P< X LX  H 
!  XH 
Z P X]`P #?' , ,A Af AD%C  g P (( ,A AT L !A  H?   X X                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %begin
   %include "Sysinc:Command.Inc"
   %externalroutinespec Extract Command(%string(*)%name C, P, %string(127) S)
   %externalroutinespec Parse Parameter(%record(Commandfm)%name C,
                                        %integer Option,
                                        %string(255) Parm)
   %string(255) A, B, C
   %integer Option
   %externalroutinespec Read Line(%string(*)%name S)

   %on 10 %start
      Printstring("Event 10,")
      Write(Event_Sub, 0)
      space
      Printstring(Event_Message)
      Newline
   %finish
   %cycle
      Prompt("Command Line:")
      Skipsymbol %while Nextsymbol = nl
      Read Line(A)
      Extract Command(B, C, A)
      Printstring("   Command:");  Printstring(B);  Newline
      Printstring("   Param:");    Printstring(C);  Newline
      Prompt("Option:");  Read(option)
      Parse Parameter(Command, Option, C)
      Printstring("   Param:");  Printstring(Command_parameter);  Newline
      Printstring("   In1:");    Printstring(Command_In1);  Newline
      Printstring("   In2:");    Printstring(Command_In2);  Newline
      Printstring("   In3:");    Printstring(Command_In3);  Newline
      Printstring("  Out1:");    Printstring(Command_Out1);  Newline
      Printstring("  Out2:");    Printstring(Command_Out2);  Newline
      Printstring("  Out3:");    Printstring(Command_Out3);  Newline
      Printstring("   Modifier:")
      %if Command_Modifier = 0 %then printstring("None") %c
                               %else printsymbol(Command_Modifier)
      Newline
   %repeat
%endofprogram
 H?    ?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!           4 }           #            NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    %Qv   #p}SId:w	RqIXH         j   a  aa     dQ@    D"Z 	ox    $h%Qv    ,@  ,  ,  ,`T:  $bANone    Modifier:   Out3:  Out2:  Out1:   In3:   In2:   In1:	   Param:Option:	   Param:   Command:Command Line:	Event 10,                          P
   4?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nGHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$  w P (A  , X Px0C XXx0W   H$PX=L<Xc lW   TW  XL W   HW  ,W   W   $ 
!7W   0"h  ,W   ,X ,h ,W  tW   H,W   HW  ,W   H,W   HW  ,W   Ȩ,P ,Ƞ AP 0W   ,XX,\XmpW  W   HXp W   HW  ,W   HXMpL  W   HW  ,W   HX]p\ @W   HW  ,|W   HXmpl `W   HW  ,tW   HX=p< W   HW  ,lW   HXp W   HW  ,dW   HXp W   HW  ,VW   HXpXI LD!9PW   H#dW   <W  ,C u@   B0&XH PG ,X]`PW 0$U$cA@ D$cA
$hAXh Pi $P C x&P X=x!<$Q ,X ,Z ,P 4#%AQH XX TZX ,PX 4Xh 4X`P  Ӧ V Ҧ 3B0%A@F 
XX V   @ X8 B0DX #7` A.C .PW ,X`&P 0$U$bA&XH PG ,X]`PW 0$ReA&C xPW ,&P 0$U$bA&Xh C00$P ,$0[8 P7 0$QeA&$P ,X P 0$X$cA&#$@PG ,[H PG 0$QeA&XX PW ,Xm`Pg 0$Q$bA&$Q`C 8$cA8X8 4X8@ 
$ң                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                          J XY Z Xi Pj  $@ $4: P ,\` %A"&$bA
Xi HA:*$P ,[$cA&n$bA
$P ,$R$cA&n$BPG ,$Q`R E ======= }
   SPOOL VOL   = COMMAND_in1 %if command_in1 # ""       { ... else default}
   BATCH LIMIT = StoI(COMMAND_in2) %if command_in2 # ""
   BATCH ROOT  = COMMAND_in3 %if command_in3 # ""

   create(potter pid, "bits")
   potter proc = started("potter", potter pid)
   create(lp pid, "bits")
   create(pp pid, "bits")
   create(cr pid, "bits")
   create(init pid, "bits")
   create(accnt pid, "bits")
   create(batch root.tostring(j), "bits") %for j = 'a', 1, 'a'-1+batch limit

   kick(potter proc, "",0,0,0)
   wait(3)
   kick( started("spoollp",lp pid), "lp", 0,0,0)
   kick( started("spoolpp",pp pid), "pp", 0,0,0)
   kick( started("spoolcr",cr pid), "cr", 0,0,0)
   kick( started("init", init pid), "batch", batch limit, 0, 0)
   kick( started("resident", accnt pid), "", 0,0,0)

   print string("
Spoolers started on ".spool vol."
Max. batch limit is ".ItoS(batch limit,0)." streams
Batch process root is ".batch root.SNL)

%endofprogram
 H?    D                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    {Symbol types}
!
!  0   a   A   .  SP  NL   o   !   (
!  :   :   :   #           t   ?   [
!  9   z   Z   $           h       {
!              :           e       <
!              _           r       -
!  
!  0   1   2   3   4   5   6   7   128+closing bracket
!                                 (128+NL for '-')
!
%constbytearray Type(0:127) =
   6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?},
   6 {?}, 6 {?}, 5 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?},
   6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?},
   6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?},
   4 { }, 7 {!}, 6 {"}, 3 {#}, 3 {$}, 3 {%}, 6 {&}, 6 {'},
 128+')', 6 {)}, 3 {*}, 6 {+}, 6 {,},128+NL, 3 {.}, 6 {/},
   0 {0}, 0 {1}, 0 {2}, 0 {3}, 0 {4}, 0 {6}, 0 {0}, 0 {7},
   0 {8}, 0 {9}, 3 {:}, 6 {;},128+'>',6 {=}, 6 {>}, 7 {?},
   6 {@}, 2 {A}, 2 {B}, 2 {C}, 2 {D}, 2 {E}, 2 {F}, 2 {G},
   2 {H}, 2 {I}, 2 {J}, 2 {K}, 2 {L}, 2 {M}, 2 {N}, 2 {O},
   2 {P}, 2 {Q}, 2 {R}, 2 {S}, 2 {T}, 2 {U}, 2 {V}, 2 {W},
   2 {X}, 2 {Y}, 2 {Z},128+']',6 {\}, 6 {]}, 6 {^}, 3 {_},
   6 {`}, 1 {a}, 1 {b}, 1 {c}, 1 {d}, 1 {e}, 1 {f}, 1 {g},
   1 {h}, 1 {i}, 1 {j}, 1 {k}, 1 {l}, 1 {m}, 1 {n}, 1 {o},
   1 {p}, 1 {q}, 1 {r}, 1 {s}, 1 {t}, 1 {u}, 1 {v}, 1 {w},
   1 {x}, 1 {y}, 1 {z},128+'}',6 {|}, 6 {?}, 6 {~}, 6 {?}
 H?    M                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !Mag tape archiving program

!Format of archive tapes:
!
!   Tape ID  TM  Label fid ... TM fid ... TM fid ... TM fid ... TM EM
!            TM  Label fid ... TM fid ... TM fid ... TM fid ... TM EM
!
!                        .  .  .  .  .  .  .  .  .  .
!
!            TM  Label fid ... TM fid ... TM fid ... TM fid ... TM EM
!            TM  EOT
!
!   TM:      Tape mark.
!   Tape ID: Header, text part anything
!   Label:   Ditto
!   fid:     File identifier - header block, text part is a full file
!            name UNIT_USER:FILE.EXT.  Index part is a file sequence no.
!   EM:      A header block, text part "**end**"
!   EOT:     A header block, text part "**end of tape**"
!
!   A "header block" is 63 bytes: 60 bytes IMP string (text) +
!                                  2 bytes sequence no (binary) +
!                                  2 bytes spare.

%begin
   %const %string(3) version = "1.6"

   !*Machine-code bootstrap tables

   %ownshortintegerarray Bootstrap(1:40) =
      !Loaded by 50-seq (50-seq called from STRAP1).
      !Loads system image on tape (512-byte blocks) -> store @ x'C00' up
      X'C810',X'00F0',
      x'D320',x'0078',x'C830',x'0C00',x'2458',x'9E15',x'9D20',x'C300',x'0010',
      x'2233',x'3403',x'9A10',x'9813',x'CA30',x'01FF',x'3403',x'9A10',x'9813',
      x'DE20',x'8023',x'DE10',x'801E',x'2631',x'9D10',x'2081',x'9E15',x'9D20',
      x'C300',x'0040',x'4330',x'FFCC',x'D1D0',x'0EF4',x'087F',x'C84E',x'0018',
      x'030E',x'F0E1'
   %ownintegerarray xC00 BOOT(0:127) =
      !Standard disc bootstrap (lives at X'C00'). 
      x'C88000C6',x'2501F810',x'FFF00CF4',x'50010000',
      x'58210000',x'23332614',x'2036111C',x'101C5010',
      x'090441F0',x'0C2624D0',x'24C2C860',x'0E00F8B0',
      x'0001FFFF',x'C8A000F0',x'C89000B6',x'DE900CF0',
      x'9DAE2081',x'9D9E94EE',x'C3E08200',x'21122333',
      x'DE900CF0',x'9D8E2347',x'C3E00010',x'2034C3E0',
      x'0040023F',x'9D8E021F',x'2387222B',x'988DDE80',
      x'0CEC4140',x'0CE0988D',x'DE800CED',x'41400CE0',
      x'DEA00CF0',x'34E69AAE',x'98A634EB',x'9AAE98AB',
      x'988D9A9C',x'DE900CF1',x'DEA00CEE',x'9DAE2081',
      x'DEA00CF0',x'9D9E2125',x'C3E00080',x'2234030F',
      x'2148021F',x'D1D00EF4',x'087FC84E',x'0018030E',
      x'C3E00010',x'033F9BA0',x'99AE3400',x'06E00BE6',
      x'26E2C4E0',x'FF000A6E',x'07CC26D1',x'43000C76',
      x'9D9E2221',x'9D8E027F',x'20820304',x'C1C23010',
      x'48C10000',x'FFFFFFFF',x'FFFFFFFF',x'FFFFFFFF',
      x'00000000'(*)

   !Boot tape format:
   !
   !      _________________________________________________________....
   !     |          |                  |                               
   !     |  Boot    |   x'C00' loader  |     System image        TM
   !     |__________|__________________|____________________________...______..
   !        block 0         block 1          blocks 3,4,5,..
   !
   !
   !All this is the "label" part of an archive format tape,
   !which is as normal after the tape mark.


   %constinteger H = x'FFFF'
   %constinteger default password = x'10685B';   !PASS:
   %recordformat parmfm(%shortinteger dsno, dact, ssno, sact, %c
                        %integer p1, p2, p3, p4, p5, p6)
   %recordformat filefm(%integer name1, name2, %c
                        %shortinteger spine, day)
   %recordformat dirfm(%shortinteger mark, %c
                       %byteinteger access, check, %c
                       %shortinteger chain, %c
                       %byteinteger spare, daccess, %c
                       %record(filefm)%array file(1:42))
   %recordformat packfm(%integer unit, owner, name1, name2)
   %recordformat blockfm(%string(59) text, %shortinteger index, spare)
   %record(blockfm) BL
   %owninteger file number = 0
   %integer exclam;  exclam = comreg(2)

   %record(packfm) F
   %record(packfm) owner
   %record(file fm) dir entry
   %ownstring(63) em = "***end***"
   %ownstring(63) eot= "***end of tape***"
   %string(63) unit, username
   %ownstring(63) head text = "***no label***"
   %string(63) word, key
   %owninteger sym = ' ', sp = ' ', used = 0, create = 0, out unit = 0
   %string(15)%name int
   %integer error, unit no, x
   %own %integer sys disc = 2;   !default
   %constinteger user list = 301
   %byteintegerarray b(0:2047)
   %const %integer max user = 20
   %integer %array user(1:max user)
   %integer users

   %predicate wanted (%integer username)
      %integer j
      %for j = 1, 1, users %cycle
         %true %if user(j) = username
      %repeat
      %false
   %end

   %routinespec release tape
   %routinespec rewind

   %routine prepare terminal
      %record(parmfm) P
      p_p1 = 1;  p_p2 = 0;  p_p3 = 0;  svc(29, p); !width=0
      p_p1 = 2;  p_p2 = 0;  p_p3 = 0;  svc(29, p); !page =0
      p_p1 = 100000;  svc(21, p);                  !time =100000
   %end
   %routine stop
      rewind
      release tape
      select output(1)
      close output
      select output(0)
      %stop
   %end
   %routine report(%string(63) text, %integer value)
      selectoutput(0)
      printstring(text)
      write(value, 0) %if value # 0
      newline
      selectoutput(1)
   %end
   %predicate create user(%integer unit, owner)
      %record(parmfm) p
      p_dact = 31
      p_p1 = unit
      p_p2 = owner
      p_p3 = default password
      p_p4 = 0;  p_p5 = 0;  p_p6 = 0
      svc(20, p)
      %if p_p6 = 0 %or p_p6 = -2 %then %true
      %false
   %end
   %routine become(%integer unit, owner)
      %record(parmfm) p
      %unless create user(unit, owner) %start
         printstring("Cannot create user")
         newline
         %return
      %finish
      p_dact = 27
      p_p1 = unit
      p_p2 = owner
      p_p3 = 0
      p_p4 = 0
      p_p5 = 0
      p_p6 = 0
      svc(20, p)
      %if p_p6 # 0 %start
         printstring("Cannot become -- ")
         printstring(string(addr(p_p1)))
         newline
      %finish
   %end
   %routine pack(%string(31) file, %record(packfm)%name f)
      %record(parmfm) P
      string(addr(p_sact)) = file
      svc(17, p)
      f_unit = p_p1
      f_owner = p_p2
      f_name1 = p_p3
      f_name2 = p_p4
   %end
   %routine unpack(%record(packfm)%name f, %string(*)%name file)
      %record(parmfm) p
      p_p1 = f_unit
      p_p2 = f_owner
      p_p3 = f_name1
      p_p4 = f_name2
      svc(18, p)
      file = string(addr(p_sact))
   %end

   %routine read block(%integer block no, %record(dirfm)%name dir)
      %record(parmfm) p
      p_sact = 1
      p_p1 = block no&H
      p_p2 = addr(dir)
      p_p3 = unit no
      p_p4 = 0
      svc(101, p)
      %if p_p1 # 0 %start
         select output(0)
         printstring("Read block ")
         write(block no, 0)
         printstring(" on unit ");  write(unit no, 0)
         printstring(" fails ");  write(p_p1, 0)
         newline
         stop
      %finish
   %end

   %routine read sym
      readsymbol(sym)
      sym = sym-32 %if 'a' <= sym <= 'z'
   %end
   %routine read(%integername n)
      %integer s
      n = 0
      %cycle
         read sym
         %return %if sym = nl
         %unless '0' <= sym <= '9' %start
            n = -1
            printstring("Invalid file number");  newline
            %return
         %finish
         n = n*10+(sym-'0')
      %repeat
   %end
   %routine read word(%string(63)%name s)
      s = ""
      read sym %while sym = ' '
      %cycle
         %exit %if sym = sp %or sym = nl
         s = s.tostring(sym) %if length(s) # 63
         read sym
      %repeat
      sp = ' '
   %end

!Tape operations

   %routine claim tape
      %record(parmfm) p
      %cycle; !till succeeds
         p_dact = 1;  svc(105, p)
         %exit %if p_p6 = 0
         report("Tape already claimed - force released", 0)
         release tape
      %repeat
   %end
   %routine release tape
      %record(parmfm) p
      p_dact = 2;  svc(105, p)
   %end
   %routine function(%integer n)
      %record(parmfm) p
      p_dact = 10;  p_p1 = n;  svc(105, p)
      error = p_p6
   %end
  %routine clear
      function(1)
      report("Clear fails ", error) %if error # 0
   %end
   %routine tape mark
      function(2)
      report("Tape mark fails ", error) %if error # 0
   %end
   %routine rewind
      function(3)
   %end
   %routine skip forward
      function(4)
      report("Skip forward fails ", error) %if error # 0
   %end
   %routine skip reverse
      function(5)
      report("Skip reverse fails ", error) %if error # 0
   %end
   %routine backspace
      function(6)
      report("Backspace fails ", error) %if error # 0
   %end
   %routine read tape(%integer buffer, size)
      %record(parmfm) p
      p_dact = 8;  p_p2 = buffer;  p_p4 = size
      svc(105, p)
      error = p_p6
   %end
   %routine writetape(%integer buffer, size)
      %record(parmfm) p
      p_dact = 9;  p_p2 = buffer;  p_p4 = size
      svc(105, p)
      error = p_p6
   %end

   %integerfn find unit no(%integer packed unit)
      %record(parmfm) p
      %result = 0 %if packed unit = 0
      p_dact = 45;  p_p1 = packed unit;  svc(20, p)
      %if p_p6 # 0 %start
         report(string(addr(p_p1)), p_p6)
         %result = 0
      %finish
      %result = p_p1
   %end
   %routine terminate
      %record(blockfm) bl
      bl_text = eot
      bl_index = file number
      write tape(addr(em), 63)
      tape mark
      write tape(addr(BL), 63)
   %end
   %routine skip to end
      %record(blockfm) BL
      function(5);      !skipr
      %cycle
         skip forward
         read tape(addr(bl), 63)
         %exit %if bl_text = eot
      %repeat
      file number = bl_index
      backspace
   %end
   %routine dump header
      %string(63) h
      skip to end
      h = head text." on ".date." at ".time
      write tape(addr(h), 63)
      printstring("Adding label - ");  printstring(h);  newline
   %end
   %routine dump system
      %record(block fm) BL
      %integer j, old;  old = unit no
      %byte %integer %array B(0:511)
      dump header
      print string ("<- $BOOT.SYS#");  newline
      file number = file number + 1
      BL_index = file number;  BL_text = "$BOOT.SYS#"
      write tape (addr(BL),63)
      unit no = sys disc
      %for j = 1,1,255 %cycle;         !dump image from fixed sys area on disc
         read block (j,record(addr(B(0))))
         write tape (addr(B(0)),512)
      %repeat
      tape mark
      terminate
      unit no = old
   %end
   %routine dump bootstrap
      %byte %integer %array B(0:511)
      %integer j,k
      write tape (addr(bootstrap(1)),40*2);  !loaded by 50-seq
      write tape (addr(xC00 Boot(0)),512);   !not in system image
      open input (3,"BOOT:MAGTAPE.SYS")
      %return %if comreg(0) # 0
      select input (3)
      %for j = 1,1,255 %cycle;               !copy tape sys from SLOAD file
         read symbol (B(k)) %for k = 0,1,511
         write tape (addr(B(0)),512)
      %repeat
      close input
      select input (1)
   %end

   %routine dump file(%record(filefm)%name file)
      %record(blockfm) BL
      %integer p, s, index, bp
      %byteintegerarray buf(1:512)
      %record(parmfm) fp, ap
      %record(packfm) f
      %return %if file_name2 = 0
      f_unit = owner_unit;  f_owner = owner_owner
      f_name1 = file_name1;  f_name2 = file_name2
      unpack(f, bl_text)
      fp_p1 = f_unit
      fp_p2 = f_owner
      fp_p3 = f_name1
      fp_p4 = f_name2
      ap = fp;                     !save for later
      fp_dact = 4
      svc(20, fp)
      index = fp_p5
      %if fp_p6 # 0 %start
         report("Cannot open ".BL_text." -- ".string(addr(fp_p1)), 0)
         %return
      %finish
      %if used # 0 %and fp_p4&x'C000' = 0 %start
         fp_dact = 11;  fp_p5 = index;  svc(20, fp)
         %return
      %finish
      printstring("<- ".BL_text);  newline
      b(0) = 255
      file number = file number+1;  bl_index = file number
      write tape(addr(BL), 63)
      p = 0;  bp = 512
      %cycle
         %if bp = 512 %start
            bp = 0
            fp_dact = 7;  fp_p4 = addr(buf(1));  fp_p5 = index
            svc(20, fp)
            %exit %if fp_p6 < 0
         %finish
         bp = bp+1;  p = p+1;  b(p) = buf(bp)
         %if p = 2047 %start
            p = 0
            write tape(addr(b(0)), 2048)
            %exit %if int # ""
         %finish
      %repeat
      int = ""
      %while p < 2047 %cycle
         p = p+1;  b(p) = 4
      %repeat
      b(0) = 0
      write tape(addr(b(0)), 2048)
      tape mark
      fp_dact = 11; fp_p5 = index;  svc(20, fp)
      printstring("Close fails -- ".string(addr(fp_p1))) %if fp_p6 # 0
      %if used # 0 %start
         ap_dact = 46;  svc(20, ap);         !remove usage bits
      %finish
   %end
   %routine dump user(%record(filefm)%name file)
      %integer j
      %record(dirfm) spine
      %return %if file_name2 = 0
      owner_owner = file_name1
      unpack(owner, user name)
      printstring("Dumping ".username);  newline
      read block(file_spine, spine)
      %for j = 1, 1, 42 %cycle
         dump file(spine_file(j))
         %exit %if int # ""
      %repeat
      int = ""
   %end
   %routine dump user files(%record(packfm)%name f)
      %integer j
      %record(dirfm) users
      owner_unit = f_unit;  owner_name1 = 0;  owner_name2 = 0
      unit no = find unit no(f_unit)
      %return %if unit no = 0
      read block(user list, users)
      dump header
      %for j = 1, 1, 42 %cycle
         %exit %if int # ""
         %if f_owner = users_file(j)_name1 %or f_owner = 0 %start
            dump user(users_file(j))
         %finish
      %repeat
      terminate
      int = ""
   %end
   %routine read file(%string(*)%name header, %record(packfm)%name ff)
      %record(parm fm) P
      %integer k, limit
      %string(63) new file
      %record(packfm) f
      Pack (header, f)
      %return %if ff_unit # 0 %and ff_unit # f_unit
      %return %if ff_owner > 0 %and ff_owner # f_owner
      %return %if ff_owner < 0 %and %not wanted(f_owner)
      %if ff_name1 # 0 %or ff_name2 # 0 %start
         %return %if ff_name1 # f_name1 %or ff_name2 # f_name2
      %finish
      %return %if header = "$BOOT.SYS#"
      f_unit = out unit %if out unit # 0
      P_p1 = f_unit
      P_p2 = f_owner
      P_p3 = f_name1
      P_p4 = f_name2
      Unpack (f, new file)
      Print string ("-> ".new file)
      New line
      %if create # 0 %then become(f_unit, f_owner) %c
                     %else P_p1 = 0 %and P_p2 = 0;   !in current directory
      f_unit = 0;  f_owner = 0
      unpack(f, new file)
      open output(2, new file)
      %if comreg(0) # 0 %start
         report("Cannot create ".new file, 0)
         %return
      %finish
      select output(2)
      %cycle
         read tape(addr(b(0)), 2048)
         k = 1
         limit = 2048
         %if b(0) = 0 %start
            limit = limit-1 %while b(limit-1) = 4
         %finish
         %while k # limit %cycle
            printsymbol(b(k))
            k = k+1
         %repeat
         %exit %if b(0) = 0
      %repeat
      close output
      select output(1)
      P_dact = 46;               !clear 'used' bit
      SVC (20,P)
   %end
   %routine restore user files(%string(63) which, %integer x, cre)
      %record(blockfm) BL
      %record(packfm) f
      %if which = "" %or x # 0 %start
         f = 0
         f_owner = x %if x < 0
      %else
         pack(which, f)
      %finish
      create = cre
      %cycle
         skip forward
         read tape(addr(bl), 63)
         %exit %if bl_text = eot
         printstring("Label: ".bl_text);  newline
         %cycle
            read tape(addr(bl), 63)
            %exit %if bl_text = em %or int # ""
            %if x <= 0 %or bl_index&H = x %start
               read file(bl_text, f)
               %return %if x > 0
            %finish
            skip forward
         %repeat
         %exit %if int # ""
      %repeat
      create = 0
      int = ""
      rewind
   %end
   %routine analyse tape(%record(packfm)%name f)
      %record(blockfm) BL
      %string(63) label
      %record(packfm) ff
      %integer k
      rewind
      skip forward;  backspace;  backspace
      read tape(addr(bl), 63)
      printstring("Tape identifier: ".bl_text);  newlines(2)
      %cycle
         skip forward
         read tape(addr(bl), 63)
         ->err %if error # 0
         %exit %if bl_text = eot
         label = bl_text
         %cycle
            %if int # "" %start
               int = ""
               rewind
               %return
            %finish
            read tape(addr(bl), 63)
            %if error # 0 %start
err:            report("Tape read error ", error)
               %return
            %finish
            %exit %if bl_text = em
            pack(bl_text, ff)
            %if ff_owner >= 0 %start
               %if (f_unit = 0 %or f_unit = ff_unit) %and %c
                   (f_owner = 0 %or f_owner = ff_owner) %start
                  %if label # "" %start
                     newlines(2);  printstring("Label: ".label)
                     newline
                     k = 0
                     label = ""
                  %finish
                  newline %and k = 3 %if k <= 0
                  k = k-1
                  write(bl_index&H, -8);  space
                  print string (bl_text);  spaces (30 - length(bl_text)) %if k # 0
               %finish
            %finish
            skip forward
         %repeat
      %repeat
      newline;  printstring("***end of tape***");  newline
   %end

   %routine set output unit
      %record(pack fm) f
      %string(63) s
      Out unit = 0;                !default is unit files were dumped from
      Read word (s)
      %if s = "TO" %start
         Read word (s)
         Pack (s."_:", f)
         Out unit = f_unit;        !**used by READ FILE**
      %finish
   %end

int == string (comreg(15))
unit no = 0
printstring("Archive version ".version);  newlines(2)
claim tape
prepare terminal
rewind
%if exclam = 0 %start;               !old tape
   read tape(addr(bl), 63)
   printstring("Tape ".bl_text);  newline
   skip forward
%finish
%cycle
   prompt ("Archive:")
   used = 0
   int = ""
   read word(word)
   %if word = "DUMP" %start
      read word(word)
      %if word = "USER" %start
         read word(word)
         pack(word.":", f)
         dump user files(F)
      %else %if word = "UNIT"
         read word(word)
         pack(word."_x:", f)
         f_owner = 0
         dump user files(f)
      %else %if word = "FILE"
         Dump header
         Read word (word)
         Pack (word, owner)
         dir entry_name1 = owner_name1;  dir entry_name2 = owner_name2
         Dump file (dir entry)
         Terminate
      %else %if word = ".SYSTEM"
         dump system
      %else
         report("UNIT or USER wanted", 0)
      %finish
   %else %if word = "IDUMP"
      read word(word)
      pack(word."_X:", f)
      f_owner = 0
      used = 1
      dump user files(f)
   %else %if word = "RESTORE"
      rewind
      x = 0
      read sym %while sym = ' '
      %if sym = '#' %start
         read(x)
         restore user files("", x, 0) %if x > 0
      %else
         read word(key)
         %if key = "UNIT" %start
            Read word (word)
            Set output unit
            Restore user files (word."_:", 0, 1)
            create = 0;  out unit = 0
         %else %if key = "USER"
            Read word (word)
            Set output unit
            Restore user files (word.":", 0, 1)
         %else %if key = "USERS"
            users = 0
            Set output unit
            Prompt ("User:")
            %cycle
               Read sym %while sym <= ' '
               Read word (key)
               %exit %if char no(key,1) = '.'
               key = key.":"
               Pack (key, f)
               %if f_owner < 0 %start
                  Print string ("Invalid username")
                  newline
                  %continue
               %finish
               users = users + 1
               user(users) = f_owner
            %repeat
            Restore user files ("", -1, 1)
         %else %if key = "FILE"
            Read word (word)
            out unit = 0
            restore user files(word, 0, 0)
         %else
            report("UNIT, USER, or FILE wanted", 0)
         %finish
      %finish
   %else %if word = "ANALYSE"
      read word(word)
      f = 0
      pack(word.":", f) %unless word = ""
      analyse tape(f)
   %else %if word = "LABEL"
      sp = 0;  read word(head text)
      length(head text) = 31 %if length(head text) > 31
   %else %if word = "INITIALISE"
      %if exclam = 0 %start
         printstring("Initialise not permitted");  newline
         %continue
      %finish
      rewind
      sp = 0;  read word(word)
      rewind
      tape mark
      skip reverse
      dump bootstrap %if word = ".BOOT"
      word = word . " - dated " . date . " at " . time
      write tape(addr(word), 63)
      tape mark
      BL_text = EOT;  BL_index = 0;  BL_spare = 0
      write tape(addr(BL), 63)
      printstring("Tape identified as ".word);  newline
   %else %if word = "HELP" %or word = "?"
      select output(0)
      printstring("
Analyse
Analyse unit extn
Analyse user fred
Dump unit extn
Dump user sys5_fred
Idump unit
Exit
Help
Initialise tape-id
Label anything
Restore unit extn
Restore user extn_fred
Restore file extn_fred:file1.imp
Restore # filnum
")
      selectoutput(1)
   %else
      stop %if word = "EXIT" %or word = "STOP"
      report("Unknown command ".word, 0) %unless word = ""
   %finish
   read sym %while sym # nl
   sym = ' '
%repeat
%endofprogram
 H?   * *Q                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     @?   @ +I     +I:     	lO:   VOG      _:     a       a:   2zlO:%  c0WM:2  k    k:   `{XW    iK      iK:>     m  C     m:L         P                                                                                                                                                                                                                                                                                                              !
!The currently available disc utility commands are:
!
!     DISC(TEST) disc/,listing
!           Check the integrity of logical disc unit 'disc'.  A listing
!           of the names and sizes {FILENAME (blocks,extents)} of all
!           files on that disc are sent to output stream 2 ('listing')
!           'Disc' is either the logical name of a loaded disc unit,
!           (e.g. "SYS7","EXTN") or the unit number of the drive the
!           logical disc is mounted on, preceded by a '#'.  E.g. '#1'
!           (the first cartridge disc, device address X'C6').
!           'Listing' may be any valid output stream destination, a
!           queue, (LP:, PP:) a file (FRED.LST, $1) or a device (T:).
!
!     DISC(COMPRESS) disc1/disc2,listing
!           The logical contents of 'disc1' are copied onto 'disc2',
!           being compressed into a minimally fragmented form in the
!           process.  A 'listing' of the output disc may be produced
!           if required.   Examples:
!              DISC(COMPRESS) SYS7/#5
!              DISC(COMPRESS) #1/JIM,LP:newJIM.lst
!
!     DISC(COPYUSERS) disc1/disc2,listing
!     DISC(COPYUSER)  disc2/disc2,listing
!        These two are synonymous, and perform the same function as
!        COMPRESS, on a selected group of users from 'disc1'.  When
!        the program starts, you will be prompted "Copy:", to which
!        you should reply with a list of usernames from 'disc1', seperated
!        by commas or newlines, and terminated by the dummy name ".END".
!        E.g.  DISC(COPYUSER) FRED/JIM
!              Copy: XXX, YYY
!              Copy: A, BB
!              Copy:.end
!        (This will copy users FRED_XXX, FRED_YYY, FRED_A and FRED_BB
!        onto disc JIM.  ***JIM WILL BE OTHERWISE EMPTY AFTER THIS
!        OPERATION***, i.e. any existing users on JIM will be overwritten).
!
!     DISC(TIDY) disc
!        The free list on 'disc' is reconstructed.  As many 'lost blocks'
!        as possible are reclaimed and put on the new free list.
!
!     DISC(COPY) disc1/disc2
!        This operation is a mindless track-by-track image dump of disc1
!        onto 'disc2'.  No compression is performed.  Note that if an
!        attempt is made to copy a disc onto a different physical type
!        of unit, block zero in the dumped disc will indicate the old
!        type of drive, this should be avoided.  COPY is mainly to
!        enable the operator make copies of discs not recorded in MOUSES
!        format.  (Any disc may be copied since no interpretation is placed
!        on the data on the disc: the number of blocks to be copied is
!        prompted for at the operator's console).
!
!     DISC(INITIALISE) /disc
!        The operator supplies various bits of information to be recorded
!        on block zero of 'disc' to identify it in the future. (Volume
!        serial number, disc name and description etc).  The directory
!        structure of the 'disc' is then wiped clean, leaving no users
!        with no files on the disc.
!        All 'blank' discs when received by an installation must be
!        initialised before the system will LOAD them.
!
!     DISC(WIPE) /disc
!        As for initialise, except that the contents of block zero remain
!        unaltered.  Used to clean out a corrupted disc.
!
!     DISC(ZERO) /disc
!        Allows the operator to alter the contents of block zero.
!        (In order to resurrect dead discs).  Pointers in block zero
!        (to free list etc) are simply set to their preferred values
!        while keeping fingers firmly crossed...
!
!     DISC(KILL) /disc
!        Block zero of the 'disc' is overwritten with an invalid pattern.
!        All data on the disc is destroyed.  The disc can no longer be LOADed
!        by the system.  (It must be re-INITIALISEd first).
!\
!
!New MOUSES disc utility program.        A. Culloch,  July 1980.
%const %string(31) version = "V2.02"
!2.02: Bug fix in COPY SYSTEM.  30-JUN-81 (ADC)
%const %string(31) program source = "SYSUTI:NEWDISC.IMP"

%external %routine %spec doing (%string(12) activity)
!User may interrogate current value of ACTIVITY by
!using the system's '^G' facility.

!System message format
%record %format parm fm (%short dsno, dact, ssno,
                         (%short sact, %integer p1,p2,p3,p4,p5,p6 %or
                          %string(25) fname))

!File system disc block formats

%record %format extent  (%short length,  {# of contiguous blocks in extent}
                         %short base)    {disc addr of first block}
%record %format spine   (%short extents, {# of extents in file}
                         %byte  access permissions,
                                check,   {should always be '?'}
                         %integer blocks,{# of blocks in file}
                         %record(extent) %array extent (1:126))

%record %format file    (%integer name1, name2,   {packed filename}
                         %short spine block,      {disc addr of file's spine}
                         %short day)              {date last written}
%const %integer dollar hash = x'C000 0000'        {&NAME1#0 => temp file}
%record %format directory(%short files,  {# of files in directory}
                         %byte  access rights,    {user access}
                         %byte  check,            {always '?'}
                         %short unused,
                         %byte  spare,
                         %byte  access permissions,{directory access}
                         %record(file) %array file (1:42))

%record %format user    (%integer name, password,
                         %short   dir block,      {disc addr of user dir}
                         %short   spare)
%record %format userlist(%short   users, spare1,  {# of users on unit}
                         %integer spare2,
                         %record(user) %array user (1:42))

!Block zero on every logical disc

%record %format zero fm (%integer vol id,         {m'VOLN'}
                         %string(7) disc id,      {"SVOL"}
                         %integer   free list,    {free blocks spine}
                                    user list,    {user catalog}
                                    defective list,{bad blocks list}
                         %integer   system area,  {start of system image}
                                    system size,  {N contiguous blocks}
                         %string(11)initialisation date,
                         %integer   tracks,       {physical disc info}
                                    blocks per cylinder,
                                    heads,
                         %integer   initialised,  {=0 => Disc WIPED O.K.}
                         %integer   copied,
                         %integer   checksum,     {sum(blockzero)-1 = 0}
                         %string(187) description,{of logical disc contents}
                         %integer marked,   {V2.00+: Disc INITIALISED O.K.}
                         %byte %array spare (1:252))

%record %format block   (%record(spine) S %or
                         %record(directory) D %or
                         %record(user list) U %or
                         %record(zero fm) Z)   {bad blocks list and free
                                               {list are just perverted
                                               {spine blocks

!System constants

%const %integer disc read = 101          {read from absolute disc address}
%const %integer disc write = 102         {write absolute disc block}
%const %integer read segment = 106       {read N contiguous blocks at abs disc ad}
%const %integer write segment = 107      {write N contiguous blocks}
%const %integer disc status = 108
%const %integer pack filename = 17
%const %integer unpack filename = 18
%const %integer to director = 20
%const %integer unit name = 40
%const %integer find disc = 45           {map packed disc-id => unit#}

%begin
   !Events trapped in program
   %const %integer input ended = 9       {end of file}
   %const %integer total failure = 11    {signalled by GET space routine}

   {I/O stream names}
   %const %integer console = 0, listing = 2, help text = 3

   %record %format disc (%integer unit no,     {unit# disc is mounted on}
                         %integer unit,        {packed unit-name}
                         %integer blocks,      {size of logical disc}
                         %integer FP,          {first free block pointer}
                         %integer prot,        {non-zero => write-prot disc}
                         %integer errors,      {# of errors found on disc}
                         %record(zero fm) zero,{copy of block zero}
                         %integer %array bitmap (0:2047))

   %record(disc) in, out                 {disc descriptors}

   %const %integer H = 16_FFFF           {halfword mask}
   %const %integer non zero = 1
   %const %integer sys size = 256        {size of system image on disc}
   %const %integer default free list=300 {preferred value}
   %const %string(31) corrupt = " corrupt pointer to ",
                      nocheck = " invalid check byte in " {error messages}
   %const %integer commands = 13
   %const %string(15) %array command (1:commands) =
      "TEST",                            {perform integrity checks on disc}
      "COMPRESS",                        {copy & compress logical disc unit}
      "INITIALISE",                      {let operator set up disc block zero}
      "WIPE",                            {clear directory structure on disc}
      "KILL",                            {write bad block zero onto disc}
      "ZERO",                            {alter selected fields in block 0}
      "COPY",                            {brainless copy of N blocks}
      "HELP",                            {copy the start of the source to TTY}
      "COPYUSER",                        {compress selected users from a disc}
      "COPYUSERS",                       {synonymous with COPYUSER}
      "TIDY",                            {recreate free list on disc}
      "RENAME",                          {alter logical name of a disc}
      "LIST"                             {just user listing}
   %const %integer single block = 1      {mnemonic}
   %integer errors = 0                   {see ERROR logging routine}
   %integer testing = 0                  {#0 => "TEST" parameter given}
   %integer splatting = 0                {#0 to inhibit block-0 validation
                                         {in the SET DISC routine}
   %integer copy user {flag} = 0         {#0 => only copy selected users}
   %integer wanted users = 0             {number of the chosen few}
   %integer exclam = comreg(2)
   %integer %array wanted user (1:42)    {Their packed names}

   %routine clear out
      errors = 0
      testing = 0
      splatting = 0
      copy user = 0
      wanted users = 0
   %end

   %predicate wanted (%integer packed name)
      %integer j
      %for j = 1,1,wanted users %cycle
         %true %if packed name = wanted user (j)
      %repeat
      %false
   %end


   !Utility routines

   %integer %fn stoi (%string(15) s)
      %byte %name b
      %integer j = 0, k, sign = 1
      %result = 0 %if s = ""
      sign = -sign %if s -> ("-") . s
      %for k = 1,1,length(s) %cycle
         b == char no (s,k)
         %result = -1 %unless '0' <= b <= '9'
         j = 10*j + (b-'0')
      %repeat
      %result = sign*j
   %end

   %string(15) %fn itos (%integer j)
      %string(15) s = ""
      %integer n = | j |
      %cycle
         s = to string (rem(n,10)+'0') . s
         n = n // 10
      %repeat %until n = 0
      s = "-" . s %if j < 0
      %result = s
   %end

   %routine normalise (%string(*)%name s)   {Kill ' 's & force upper case}
      %string(63) t
      %byte %name b
      %integer j
      s = s . t %while s -> s . (" ") . t
      %for j = 1,1,length(s) %cycle
         b == char no (s,j)
         b = b - 'a' + 'A' %if 'a' <= b <= 'z'
      %repeat
   %end

   %routine scan (%string(*)%name s)
      %on %event input ended %start
         s = s . ",.END";  %return
      %finish
      s <- ""
      skip symbol %while next symbol <= ' '
      %while next symbol >= ' ' %cycle
         s <- s . to string (next symbol)
         skip symbol
      %repeat
      normalise (s)
   %end

   %routine set bit (%integer %array %name bitmap, %integer index)
      %integer j = index>>5, k = index&31
      bitmap(j) = bitmap(j) ! 1<<k
   %end

   %routine clear bit (%integer %array %name bitmap, %integer index)
      %integer j = index>>5, k = index&31
      bitmap(j) = bitmap(j) & (\(1<<k))
   %end

   %predicate bit set (%integer %array %name bitmap, %integer index)
      %integer j = index>>5, k = index&31
      %true %if bitmap(j) & 1<<k # 0
      %false
   %end

   %routine report (%string(63) message)
      print string (message);  newline
   %end

   !Allocate buffer space for multiblock disc transfers
   %integer buf len = (FREE SPACE {on stack} - 8000 {safety})//512 {blocks}
   %record(block) %array buf (1:buf len)
   
   %routine error (%string(63) message)
      report ("*" . message);  errors = errors + 1
   %end

   %predicate valid block (%record(disc)%name D, %integer block no)
      block no = block no & H
      %false %unless 0 <= block no <= D_blocks %and
                     (%not bit set (D_bitmap,block no))
      set bit (D_bitmap, block no)
      %true
   %end

   %predicate valid extent (%record(disc)%name D, %record(extent)%name x)
      %integer base, length, j
      base = x_base&H
      length = x_length&H
      %false %unless length > 0 %and 0 <= base < D_blocks %and
                     base + length <= D_blocks
      %for j = base, 1, base + length - 1 %cycle
         %false %if bit set (D_bitmap,j) {overlaps blocks on other files?}
         set bit (D_bitmap,j)
      %repeat
      %true
   %end

   %integer %fn checkword (%record(zero fm)%name Z)
      !Calc check word for block zero
      %integer j, k = 0
      k = k + integer(j) %for j = addr(Z), 4, addr(Z) + 512 - 4
      %result = 1 - k
   %end

   %byte %fn checksum (%record(*)%name spine)
      %integer j, k
      k = 0;  k = k + byte integer(j) %for j = addr(spine),1,addr(spine) + 511
      %result = (-k) & 16_FF
   %end

   %routine read block (%record(disc)%name D, %integer block no,
                        %record(*)%name buffer)
      %record(parm fm) P
      P_p1 = block no&H;  P_p2 = addr(buffer);  P_p3 = D_unit no;  P_p4 = 0
      SVC (disc read,P)
      %if P_p1 # 0 %start
         report ("Disc read error " . itos(P_p1) . " from unit #" . %c
                 itos(D_unit no) . " at block #" . itos(block no))
      %finish
   %end

   %routine write block (%record(disc)%name D, %integer block no,
                         %record(*)%name buffer)
      %record(parm fm) P
      %return %if D_unit no = 0 {null}
      P_p1 = block no&H;  P_p2 = addr(buffer);  P_p3 = D_unit no;  P_p4 = 0
      SVC (disc write,P)
      %if P_p1 # 0 %start
         report (D_zero_disc id . " protected") %and %stop %if D_prot # 0
         report ("Disc write error " . itos(P_p1) . " to unit #" . %c
                 itos(D_unit no) . " at block #" . itos(block no))
         %stop
      %finish
   %end

   %routine list (%record(disc)%name D)
      !Uses CLEAR BIT rather than splatting D_BITMAP
      !before traversing the disc so that the operation
      !is transparent as far as the bitmap is concerned
      %record(parm fm) P
      %record(spine) spine block
      %record(user list) users
      %integer j, k, files, user count, blocks, total, free
      %string(63) s
      %record(user)%name u
      %record(directory) dir
      %record(file)%name f
      doing ("Disc listing")
      select output (listing)
      report ("Dump of " . D_zero_disc id)
      clear bit (D_bitmap,D_zero_user list)
      %return %unless valid block (D,D_zero_user list)
      read block (D,D_zero_user list,users)
      user count = 0;  total = 0
      %for j = 1,1,42 %cycle
         u == users_user(j)
         %if u_name # 0 %start
            user count = user count + 1
            newline
            P = 0;  P_p2 = u_name;  SVC (unpack filename,P)
            report (P_fname)
            clear bit (D_bitmap,u_dir block) %if 0 <= u_dir block < D_blocks
            %return %unless valid block (D,u_dir block)
            read block (D,u_dir block,dir)
            files = 0;  blocks = 0
            %for k = 1,1,42 %cycle
               f == dir_file(k)
               %if f_name2 # 0 %start
                  newline %if rem(files,3) = 0
                  files = files + 1
                  P = 0;  P_p3 = f_name1;  P_p4 = f_name2
                  SVC (unpack filename,P)
                  P_fname = " " . P_fname %while length(P_fname) < 15
                  print string (P_fname)
                  %if 0 <= f_spine block < D_blocks %start
                     clear bit (D_bitmap,f_spine block)
                  %finish
                  %if %not valid block (D,f_spine block) %start
                     error (P_fname . " corrupt")
                     s = "*CORRUPT*"
                  %else
                     read block (D,f_spine block,spine block)
                     blocks = blocks + spine block_blocks&H
                     s = " (" . itos (spine block_blocks&H) . "," . %c
                                itos (spine block_extents). ")"
                  %finish
                  s = s . " " %while length(s) < 10
                  print string (s)
               %finish
            %repeat
            blocks = blocks + files      {remember spines themselves}
            newline
            write (files,8);  print string (" file")
            print symbol ('s') %if files # 1;  print symbol (',')
            write (blocks,1); print string (" block")
            print symbol ('s') %if blocks # 1
            newline
            total = total + blocks
         %finish
      %repeat
      total = total + user count         {directory blocks}      %c
                    + single block       {block zero}            %c
                    + 3 * single block   {free,user,defective}
      total = total + D_zero_system size
      newlines (3);  spaces (3)
      print string (D_zero_disc id . ": ");  write (user count,0)
      print string (" users")
      newline
      write (total,8);  print string (" blocks in use");  newline
      free = D_blocks - total {used blocks}
      write (free,8);   print string (" free blocks (")
      free = 100*free//D_blocks {%}
      free = 0 %if free < 0
      write (free,0);   print string ("%)");  newline
      select output (console)            {again}
   %end

   %routine tidy (%record(disc)%name D)
      !Creates a new free list on D holding all blocks
      !not claimed so far (BITMAP entries not SET).
      %record(extent) e, swap
      %integer j, k, flag, lost = 0
      %record(spine) new free list = 0
      %return %if D_unit no <= 0
      %record(extent)%name this, that, victim
      doing ("free list")
      k = 0;  k = k + 1 %while \D_bitmap(k) = 0   {find a clear bit}
      j = 32*k
      %while j < D_blocks %cycle
         %if %not bit set (D_bitmap,j) %start   {start of a free extent}
            e_base <- j;  e_length = 0
            %cycle
               e_length <- e_length&H + 1
               j = j + 1
            %repeat %until j >= D_blocks %or bit set (D_bitmap,j)
            !now put this extent in NEW FREE LIST
            %if new free list_extents < 126 %start
               new free list_extents = new free list_extents + 1
               new free list_extent(new free list_extents) = e
            %else
               !Free list full -- throw away smallest
               !existing extent (the VICTIM) if it's smaller than 'E'.
               victim == new free list_extent(1)   {perhaps}
               %for k = 1,1,126 %cycle
                  this == new free list_extent(k)
                  victim == this %if this_length&H < victim_length&H
               %repeat
               %if e_length&H <= victim_length&H %start   {VICTIM is spared}
                  lost = lost + e_length&H
               %else
                  report ("reject")
                  lost = lost + victim_length&H
                  victim = e
               %finish
            %finish
         %finish
         j = j + 1
      %repeat
      !Sort new free list by ascending base address
      %if new free list_extents = 0 %start
         error(d_zero_disc id.": empty free list?")
      %else
         %cycle
            flag = 0
            this == new free list_extent(1)
            %for j = 2,1,new free list_extents %cycle
               that == new free list_extent(j)
               %if this_base&H > that_base&H %start
                  swap = this;  this = that;  that = swap
                  flag = non zero
               %finish
               this == that
            %repeat
         %repeat %until flag = 0
      %finish
      new free list_check = 0
      !DIRECTOR uses FREE_EXTENTS really as a
      !lost blocks counter, which we must initialise.
      new free list_extents = lost
      new free list_check = checksum (new free list)
      write block (D, D_zero_free list, new free list)
   %end

   %routine validate free list (%record(disc)%name D)
      %record(spine) free
      %record(extent)%name e
      %integer j, free blocks = 0, last
      !This routine checks that no blocks allegedly
      !on the free list are in fact part of the
      !directory structure of the disc. (In which
      !case their bits in the bitmap will be SET).
      doing ("freelist chk")
      read block (D, D_zero_free list, free)
      report (D_zero_disc id . ": ". itos(free_extents) . " lost blocks") %c
         %if free_extents # 0            {DIRECTOR counts lost blocks there}
      %if checksum (free) # 0 %start
         error (D_zero_disc id . ": " . no check . "free list")
         %return
      %finish
      last = 0
      %for j = 1,1,126 %cycle
         e == free_extent(j)
         %if e_base = 0 %start
            %cycle
               %if e_base # 0 %or e_length # 0 %start
                  error(d_zero_disc id.": incomplete free list")
                  %return
               %finish
               %exit %if j = 126
               j = j+1
               e == free_extent(j)
            %repeat
            %exit
         %finish
         %if e_base&H <= last %start
            error (D_zero_disc id . ": free list out of order")
         %finish
         last <- (e_base + e_length)&H
         %if valid extent (D,e) %start
            free blocks = free blocks + e_length&H
         %else
            error (D_zero_disc id . ": corrupt free list")
         %finish
      %repeat
      report ("free blocks: " . itos(free blocks))
   %end

   %routine get (%record(disc)%name D,
                 %record(extent)%name free, %integer max size)
      !A contiguous extent of up to MAX SIZE blocks
      !is claimed from the OUTPUT disc, and an extent
      !descriptor for it returned in FREE.
      free = 0 %and %return %if D_unit no <= 0 {NULL disc}
      %cycle                          {find a single free block on OUTPUT}
         %if D_FP >= D_blocks %start
            error ("Output disc too small")
            %signal total failure     {trapped in SQUEEZE: forces a return}
         %finish
         %exit %if %not bit set (D_bitmap,D_FP)
         D_FP = D_FP + 1
      %repeat
      free_base <- D_FP;  free_length = 0
      %cycle
         %exit %if D_FP >= D_blocks %or
                   bit set (D_bitmap,D_FP) {block in use} %or
                   free_length&H >= max size  {got all we wanted}
         set bit (D_bitmap, D_FP)
         free_length <- free_length&H + 1
         D_FP = D_FP + 1
      %repeat
   %end

   %routine %spec set disc (%record(disc)%name D, %string(25) id)

   %routine wipe (%record(disc)%name D)
      report ("***WIPING " . D_zero_disc id)
      %record(parm fm) P                 {D.I.Y. disc I/O - dont abort on errs}
      %integer j, k, block, left, N
      %record(spine) bad = 0             {new defective blocks list}
      %record(spine) user                {new (empty) user list}
      %record(zero fm)%name Z == D_zero
      %record(extent) free
      %record(extent)%name this

      %on %event total failure %start    {GET failed to claim system area}
         report ("No space for system area")
         -> NO SYS
      %finish

      %if Z_marked # -1 %start           {disc not properly initialised}
         report ("Unit #" . itos(D_unit no) . " not initialised")
         %stop
      %finish

      !Create defective list

      doing ("badblock chk")
      report ("blocks: ".itos(D_blocks))
      D_bitmap(j) = 0 %for j = 0, 1, 2047   {splat the bitmap}
      set bit (D_bitmap,0)               {don't scribble on block zero!}
      block = 0
      %cycle
         left = D_blocks&H - block       {# of blocks left to test}
         %exit %unless left > 0
         N = buf len;  N = left %if N > left   {test in N-block chunks}
         P_p1 = block;  P_p2 = addr(buf(1))
         P_p3 = D_unit no;  P_p4 = N
         SVC (read segment,P)
         %if P_p1 # 0 %start             {I/O err => 1 or more bad blocks}
            %for j = block, 1, block + N - 1 %cycle
               P_p1 = j                  {test individual blocks in chunk}
               P_p2 = addr(buf(1))
               P_p3 = D_unit no;  P_p4 = 0
               SVC (disc read,P)
               %if P_p1 # 0 %start       {block #J is duff}
                  set bit (D_bitmap,j)
                  bad_extents = bad_extents + 1   {use one extent for each}
                  %if bad_extents > 126 %start
                     report ("Too many bad blocks!")
                     %stop
                  %finish
                  this == bad_extent (bad_extents)
                  this_base = j;  this_length = single block
                  %if j = 0 %start
                     error ("Block zero is defective!!")
                     %stop
                  %finish
               %finish
            %repeat
         %finish
         block = block + N
      %repeat
      report ("Bad blocks: " . itos(bad_extents)) %if bad_extents # 0

      !Allocate system area

      D_FP = 0
      %if Z_system area # 0 # Z_system size %start
         %cycle
            get (D,free,sys size)
            %exit %if free_length&H = sys size
            !chunk not big enough - forget it
            clear bit (D_bitmap,j) %for j = free_base&H, 1,
                                            free_base&H + free_length&H - 1
         %repeat
         Z_system area = free_base&H
         Z_system size = free_length&H
      %finish

NO SYS:
      !Allocate free, user, defective blocks
      !(normally 300,301 and 302)

      D_FP = default free list
      %if %not valid block (D,Z_free list) %start
         get (D,free,single block)
         Z_free list = free_base&H
      %finish
      %if %not valid block (D,Z_user list) %start
         get (D,free,single block)
         Z_user list = free_base&H
      %finish
      user = 0;  write block (D,Z_user list,user)
      %if %not valid block (D,Z_defective list) %start
         get (D,free,single block)
         Z_defective list = free_base&H
      %finish
      bad_check = 0;  bad_check = checksum (bad)
      write block (D,Z_defective list,bad)
      bad = 0;                           !use BAD as free list now
      bad_check = checksum (bad)
      write block (D,Z_free list,bad)
      D_FP = 0                           {put things back}

      tidy (D)                           {create new free list}
      Z_initialisation date = DATE
      Z_initialised = 0                  {DONE}
      Z_checksum = 0;  Z_checksum = checkword (Z)
      write block (D,0,Z)
   %end

   %routine read page (%record(disc)%name D,
                       %integer disc addr, blocks, buf start)
      %record(parm fm) P
      P_p1 = disc addr&H; P_p2 = addr(buf(buf start)); P_p3 = D_unit no
      P_p4 = blocks&H;  SVC (read segment,P)
      %if P_p1 # 0 %start
         report ("Read page fails on unit #" . itos(D_unit no) . %c
                 ", status: " . itos(P_p1))
      %finish
   %end

   %routine write page (%record(disc)%name D,
                        %integer disc addr, blocks, buf start)
      %record(parm fm) P
      %return %if D_unit no = 0
      P_p1 = disc addr&H;  P_p2 = addr(buf(buf start));  P_p3 = D_unit no
      P_p4 = blocks&H;  SVC (write segment,P)
      %if P_p1 # 0 %start
         report (D_zero_disc id . " protected") %and
            %stop %if D_prot # 0
         report ("Write page fails on unit #" . itos(D_unit no) . %c
                 ", status: " . itos(P_p1))
         %stop
      %finish
   %end

   %routine merge (%record(userlist)%name new, %record(disc)%name D)
      !Create a new userlist from the old one on 'D'
      !and the NEW one passed to us.  Return merged
      !list in NEW.
      %record(userlist) old
      %integer j,k
      %record(user)%name u, slot
      %return %if D_unit no <= 0
      read block (D,D_zero_user list,old)
      j = 1
      %for k = 1,1,42 %cycle
         u == new_user(k)
         %if u_name # 0 %start
            %while j <= 42 %cycle
               slot == old_user(j)
               j = j + 1
               %if slot_name = 0 %start
                  slot = u
                  %exit
               %finish
            %repeat
         %finish
      %repeat
      new = old
   %end

   %routine squeeze (%record(disc)%name input, output)
      !The logical contents of the INPUT disc are
      !copied to the OUTPUT disc.  As the files are
      !being written sequentially, the output disc
      !will be minimally fragmented after the operation,
      !with all free space in one or two extents.

      %routine copy system
         %integer done
         %return %if input_zero_system size <= 0 %or
                    output_zero_system size <= 0
         doing ("Copy system")
         %if input_zero_system size > output_zero_system size %start
            report ("Not enough space for system area on " . %c
                    output_zero_disc id)
            %return
         %finish
         %integer j, k
         %integer pages = input_zero_system size // buf len,
                  odd blocks = rem (input_zero_system size,buf len)
         %for j = input_zero_system area, buf len,
                  input_zero_system area + (pages-1)*buf len %cycle
            read page (input, j, buf len, 1)
            writepage(output, j, buf len, 1)
         %repeat
         done = input_zero_system area + pages*buf len;   !block
         %for j = done, 1, done + odd blocks - 1 %cycle
            read block (input, j, buf(1))
            writeblock(output, j, buf(1))
         %repeat
         report ("System area: " . itos(input_zero_system size))
      %end

      %integer %fn squeezed file (%integer {packed} user {name},
                                  %record(file)%name F)
         !Result is disc addr in OUTPUT disc of new spine
         !block for the copied file.
         %integer bufp = 1, free buf = buf len, base
         %integer last, left, xfer len, j, extents
         %record(spine) old spine, new spine;  new spine = 0
         %integer {flag} empty spine = non zero
         %record(extent)%name e
         %record(extent) free
         %record(parm fm) P = 0;  P_p1 = input_unit;  P_p2 = user
                                  P_p3 = F_name1;     P_p4 = F_name2

         %routine output buf
            !The contents of BUF, from block 1 to BUFP is
            !written to the OUTPUT disc in as many extents
            !as required.  Each new extent is added to the
            !NEW SPINE block being created.
            %own %record(extent)%name last extent
            %record(extent) free
            %integer p = 1
            bufp = bufp - 1              {index of next free block->#of blocks}
            %while p <= bufp %cycle      {more to write}
               get (output, free, {extent of size up to # of blocks left}
                          bufp - p + 1)
               write page (output, free_base, free_length, {buf start} P)
               %if empty spine # 0 %or {not contiguous with last ext}
               free_base&H # last extent_base&H + last extent_length&H %start
                  empty spine = 0
                  new spine_extents = new spine_extents + 1
                  %if new spine_extents > 126 %start
                     error ("Spine block full!!")
                     %stop
                  %finish
                  last extent == new spine_extent(new spine_extents)
                  last extent = free
               %else                     {merge with LAST EXTENT}
                  last extent_length = (last extent_length + free_length)&H
               %finish
               p = p + free_length
            %repeat
            free buf = buf len           {buffer empty now}
            bufp = 1
         %end

         read block (input, F_spine block, old spine)
         %unless 0 <= old spine_extents <= 126 %start
            SVC (unpack filename,P)
            error (P_fname . itos(old spine_extents) . " extents?")
            old spine_extents = 126
         %finish
         %if old spine_check # '?' %start
            SVC (unpack filename,P)
            error (P_fname . no check . "spine block")
         %finish
         extents = 0
         %for j = 1,1,old spine_extents %cycle
            e == old spine_extent(j)
            %if e_length # 0 %start
               extents = extents + 1
               %if %not valid extent (input,e) %start
                  P = 0;  P_p1 = input_unit;  P_p2 = user
                  SVC (unpack filename,P)
                  error (P_fname . corrupt . "extent")
                  %if %not (0 <= e_base&H < input_blocks %and
                            0 <=(e_base+e_length)&H < input_blocks) %or
                     e_length&H > 200 {arbitrary} %start
                     !all is lost
                     report ("(Not copied)")
                     %continue
                  %finish
                  !copy poss. duff extent
               %finish
               new spine_blocks <- (new spine_blocks + e_length)&H
               %if testing = 0 %start    {actually copy the file?}
                  base = e_base&H;  last = (e_base + e_length)&H
                  left = e_length&H      {# of blocks yet to be transferred}
                  %cycle
                     output buf %if free buf <= 0
                     xfer len = left     {Try to read in all the other blocks}
                     xfer len = free buf %if xfer len > free buf
                     read page (input, base, xfer len, bufp)
                     bufp = bufp + xfer len;  left = left - xfer len
                     free buf = free buf - xfer len{less space left in buffer}
                     base = base + xfer len    {next disc addr}
                  %repeat %until base >= last  {read in whole extent?}
               %finish
            %finish
         %repeat
         output buf                      {flush}
         P = 0; P_p1 = input_unit; P_p2 = user; P_p3 = F_name1; P_p4 = F_name2
         %if new spine_blocks # old spine_blocks %start
            SVC (unpack filename,P)
            error (P_fname . " block count wrong in spine")
         %else %if extents # old spine_extents
            SVC (unpack filename,P)
            error (P_fname . " zero length extent in spine?")
         %finish
         %result = 0 %if new spine_extents = 0
         get (output, free, single block)
         new spine_check = '?'
         new spine_access permissions = old spine_access permissions
         write block (output, free_base, new spine)
         %result = free_base
      %end

      %integer %fn squeezed user (%integer {packed} name {of user},
                                  {disc addr of user's} dir block)
         !Result is disc addr (on OUTPUT) of copied directory.
         %record(directory) D, new dir
         %record(spine) S
         %record(parm fm) P = 0;  P_p1 = input_unit;  P_p2 = name
         %record(extent) free
         %record(file)%name F
         %integer j

         read block (input, dir block, D);  new dir = D
         %unless 0 <= D_files <= 42 %start
            SVC (unpack filename,P)
            error (P_fname . itos(D_files) . " files?")
            D_files = 42
         %finish
         new dir_files = 0
         %for j = 1,1,42 %cycle
            F == new dir_file(j)
            %if f_name2 # 0 %and f_name1&dollar hash = 0 %start
               %if %not valid block (input,F_spine block) %start
                  P = 0;  P_p1 = input_unit;  P_p2 = name
                  P_p3 = f_name1;  P_p4 = f_name2
                  SVC (unpack filename,P)
                  error (P_fname . corrupt . "spine block")
                  %if %not (0 <= f_spine block < input_blocks) %start
                     report ("(Not copied)")
                     F = 0
                     %continue
                  %finish;   !might be OK
                  read block (input,f_spine block,S)
                  %if S_check # '?' %start
                     report ("(Not copied)")
                     F = 0
                     %continue
                  %finish;   !plausible
               %finish
               !spine OK
               f_spine block <- squeezed file (name,f) &H
               %if f_spine block # 0 %start;   !exists
                  new dir_files = new dir_files + 1
               %finish %else f = 0
            %finish %else f = 0
         %repeat
         get (output, free, single block)
         write block (output, free_base, new dir)
         %result = free_base
      %end

      !SQUEEZE input => output disc

      %record(user list) catalog         {users on input disc}
      %record(user list) new cat
      %record(user)%name U
      %record(parm fm) P
      %string(63) s
      %integer j

      %on %event total failure %start    {Detected in GET space routine}
         %return                         {ERROR was called in GET,
      %finish                            {so main program will produce the
                                         {FAULTY OUTPUT DISC message}
      wipe (output) %if output_errors # 0
      read block (input, input_zero_user list, catalog)
      %unless 0 <= catalog_users <= 42 %start
         error (input_zero_disc id . ": " . itos(catalog_users) . %c
                " users?")
      %finish
      copy system
      new cat = catalog;  new cat_users = 0
      %for j = 1,1,42 %cycle
         U == new cat_user(j)
         %if U_name # 0 %start
            P = 0;  P_p1 = input_unit;  P_p2 = U_name
            SVC (unpack filename,P)
            s <- P_fname
            %if %not valid block (input,U_dir block) %start
               error (P_fname . corrupt . "directory")
               !no hope
               U = 0
               %continue
            %finish
            %if copy user = 0 {do everyone} %or wanted(U_name) %start
               doing (s)
               %if exclam # 0 %start
                  %if testing # 0 %then report ("testing " . s) %c
                                  %else report ("copying " . s)
               %finish
               new cat_users = new cat_users + 1
               U_dir block <- squeezed user (U_name,U_dir block)&H
            %finish %else U = 0
         %finish
      %repeat

      merge (new cat,output) %if copy user # 0;   !combine with old catalog
      write block (output, output_zero_user list, new cat)
      tidy (output) %if output_unit no > 0
   %end {of SQUEEZE}


   %routine validate block zero (%record(disc)%name D)
      %record(zero fm)%name Z == D_zero
      %record(spine) bad blocks
      %record(extent) temp
      %integer j,k
      %if exclam = '?' %start            {print interpreted block zero}
         report ("Unit " . Z_disc id . ", " . Z_description)
         report ("Free list at " . itos(Z_free list))
         report ("User list at " . itos(Z_user list))
         report ("Bad blocks list at " . itos(Z_defective list))
         report ("System area at " . itos(Z_system area))
         report ("System size: " . itos(Z_system size))
         report ("Tracks: " . itos(Z_tracks))
         report ("Blocks per cylinder: " . itos(Z_blocks per cylinder))
         report ("Heads: " . itos(Z_heads))
      %finish
      k = checkword(Z)
      error("Block zero checksum fault ".itos(k)) %if k # 0
      %if %not valid block (D,Z_free list) %start
         error (Z_disc id . corrupt . "free list")
         Z_free list = default free list {& hope for the best}
      %finish
      %if %not valid block (D,Z_user list) %start
         error (Z_disc id . corrupt . "user list")
         Z_user list = default free list + 1
      %finish
      %if %not valid block (D,Z_defective list) %start
         error (Z_disc id . corrupt . "bad blocks list")
         Z_defective list = default free list + 2
      %finish
      %if Z_system size # 0 %start    {unit holds a system image}
         temp_base = Z_system area
         temp_length = Z_system size
         %if %not valid extent (D,temp) %start
            error (Z_disc id . corrupt . "system area")
            Z_system area = 1;  Z_system size = sys size
         %finish
      %finish
      %if Z_tracks <= 0 %or Z_blocks per cylinder <= 0 %or Z_heads <= 0 %start
         error ("-ve no. of tracks, sectors, heads?")
         D_blocks = x'FFFF'              {max poss disc addr}
      %finish
      %if errors = 0 %then read block (D, Z_defective list, bad blocks) %c
                     %else bad blocks = 0
      %if 0 <= bad blocks_extents <= 126 %start
         %if checksum (bad blocks) # 0 %start
            error (Z_disc id . ": defective list checksum error")
         %else
            %for j = 1,1,bad blocks_extents %cycle
               %if bad blocks_extent(j)_length # 0 %and
                  (%not valid extent(D,bad blocks_extent(j))) %start
                  error (Z_disc id . ": Defective list" . %c
                         corrupt . "an extent")
               %finish
            %repeat
         %finish
      %else
         error (Z_disc id . ": " . %c
                itos (bad blocks_extents) . " bad blocks?")
      %finish
   %end

   %routine set disc (%record(disc)%name D, %string(25) id)
      %string(63) S
      %record(parm fm) P = 0
      %integer j, old errors = errors
      D = 0
      %return %if id = ""
      %if id -> ("#") . id %start        {unit# given numerically}
         j = stoi (id);  id = "#" . id
      %else
         P_fname = id . "_:"
         SVC (pack filename,P)
         j = -1
         P_dact = find disc                 {packed disc name => unit#}
         SVC (to director,P)
         j = P_p1 %if P_p6 = 0
      %finish
      error ("Invalid disc name " . id) %and %stop %if j < 0
      D_unit no = j
      P_p3 = D_unit no
      SVC (disc status,P)
      error ("Unit #" . itos(D_unit no) . " offline") %and %stop %if P_p6&3 # 0
      D_prot = P_p6 & 4
      read block (D,0,D_zero)
      D_blocks <- D_zero_tracks * D_zero_blocks per cylinder
      set bit (D_bitmap,0)
      length(D_zero_disc id) = 4 %if length(D_zero_disc id) > 4;!!!!!!!!!!!!!
      s <- D_zero_disc id
      s <- s . "_:"
      P_fname <- s
      SVC (pack filename,P)
      D_unit = P_p1
      P_dact = unit name;  P_p1 = D_unit no
      SVC (to director,P)
      D_prot = non zero %if P_p6 = 0 %and P_p2 # 0   {prot in director?}
      %return %if splatting # 0
      validate block zero (D)
      D_errors = errors - old errors
   %end


   !field number mnemonics on block zero

   %const %integer vol id = 1
   %const %integer disc id = 2
   %const %integer sys area = 3
   %const %integer make = 4
   %const %integer descr = 5
   %const %integer fields = 5

   %routine set zero (%record(disc)%name D, %integer mask, to do)
      !Alter fields indicated by mask in disc block zero from data
      !supplied by operator at the console.
      !No. of fields TO DO passed as a parameter.
      %string(63) atom
      %const %integer parms = 5          {fields in block zero}
      %const %string(15) %array parm id (1:parms) =
         "Phy. disc name:",
         "Log. disc name:",
         "System area? ",
         "Disc type:",
         "Description:"
      %const %integer {disc} types = 5, last type = types
      %const %string(9) %array type id (1:types) =
         "DIABLO",                       {5MB cartridge disc}
         "TELEFILE",                     {300MB fixed disc unit}
         "MSM80",                        {Perkin-Elmer 67MB disc}
         "CALCOMP",                      {Calcomp 67M disc}
         "UNKNOWN"                       {track size/cyls etc explicit}
      !*** UNKNOWN must be last type ***
      %const %integer %array tracks (1:types) = 400,100,815//3,815//3,0(*)
      %const %integer %array blocks per cylinder (1:types) = 2*12,19*32,5*26,5*26,
                                                             0(*)
      %const %integer %array heads (1:types) = 2,19,5,5,0(*)
      %integer j,k,m
      %switch F (1:parms)
      %record(zero fm)%name Z == D_zero
      %record(parm fm) P = 0

      Z_marked = -1;  Z_system area = -1;  Z_system size = -1
      Z_initialisation date = DATE
      %while to do > 0 %cycle            {fields left to fill}
         j = 1
         %while j <= parms %cycle
            %if mask & 1<<j # 0 %start
               prompt (parm id(j))
               scan (atom) %if j # descr
               -> F(j)

               F(vol id):
                  %if length(atom) > 4 %start
                     report ("Volume-id too long")
                     %continue
                  %finish
                  Z_vol id = 0
                  atom = atom . " " %while length(atom) < 4
                  Z_vol id = Z_vol id<<8 ! char no (atom,k) %for k = 1,1,4
                  mask = mask & (\(1<<j))
                  to do = to do - 1
                  %continue
               F(disc id):
                  P_fname = atom . "_:";  SVC (pack filename,P)
                  report ("Illegal disc name") %and
                     %continue %if P_p6 # 0
                  Z_disc id = atom
                  mask = mask & (\(1<<j))
                  to do = to do - 1
                  %continue
               F(sys area):
                  %if atom = "NO" %start
                     {Sytem area deleted next time disc is COMPRESSed}
                     Z_system area = 0
                     Z_system size = 0
                  %finish
                  mask = mask & (\(1<<j));  to do = to do - 1
                  %continue
               F(descr):
                  Z_description = ""
                  %while next symbol # NL %cycle
                     Z_description <- Z_description . to string(next symbol)
                     skip symbol
                  %repeat
                  skip symbol {NL}
                  mask = mask & (\(1<<j))
                  to do = to do - 1
                  %continue
               F(make):
                  %cycle
                     %for k = 1,1,types %cycle
                        %if type id (k) = atom %start
                           Z_tracks = tracks(k)
                           Z_blocks per cylinder = blocks per cylinder(k)
                           Z_heads = heads(k)
                           mask = mask & (\(1<<j))
                           to do = to do - 1
                           %if k = last type {"UNKNOWN"} %start
                              prompt ("Tracks:");  scan (atom)
                              Z_tracks = stoi (atom)
                              prompt ("Blocks per cylinder:");  scan (atom)
                              Z_blocks per cylinder = stoi (atom)
                              prompt ("Heads:");  scan (atom)
                              Z_heads = stoi (atom)
                           %finish
                           %exit
                        %finish
                        %if k = last type %start   {ATOM matches no type}
                           report ("Valid types are:")
                           report (type id(m)) %for m = 1,1,types
                           report ("UNKNOWN to spec disc parms by hand")
                           scan (atom)
                        %finish
                     %repeat
                  %repeat %until mask & 1<<j = 0
            %finish
            j = j + 1
         %repeat
      %repeat
      D_zero_checksum = 0
      D_zero_checksum = checkword (D_zero)
      write block (D,0,D_zero)
   %end

   %routine make sure (%record(disc)%name D)
      %string(15) reply
      %return %if D_errors # 0           {nothing worth keeping}
      report ("**Are you sure you want to overwrite " . D_zero_disc id . "?")
      prompt ("Yes/no? ")
      scan   (reply)
      %stop %unless reply = "YES"
   %end

   %routine set map (%record(disc)%name D)
      !D bitmap set with all blocks protected
      !except those on its free list
      %record(spine) free
      %record(extent)%name e
      %integer j,k
      %const %integer all bits = \0
      D_bitmap(j) = all bits %for j = 0,1,2047   {protect all}
      read block (D,D_zero_free list,free)
      %for j = 1,1,126 %cycle
         e == free_extent(j)
         %if e_length # 0 %start
            clear bit (D_bitmap,k) %for k = e_base&H, 1, %c
                                            e_base&H + e_length&H - 1
         %finish
      %repeat
   %end


                     !###############################
                     !#                             #
                     !#   M A I N   P R O G R A M   #
                     !#                             #
                     !###############################


   %const %integer all = \0              {all bits set}
   %const %string(1) null = ""
   %const %string(31) no disc = ": no such disc"
   %integer keep = 0
   %string(*)%name parm == string (comreg(1))  {command line parameter}
   normalise (Parm)
   report ("DISC " . parm . " " . version)
   report (itos(buf len) . " buffers claimed") %if exclam = '?'
   %string(*)%name listing file == string (comreg(6)),
                   in1          == string (comreg(3)),   {1st input stream-id}
                   out1         == string (comreg(4))
   %integer pages, odd blocks
   open output (listing,listing file) %if listing file # null
   select input (console);  select output (console)
   %integer j, ctype = 0
   %string(80) line
   %record(parm fm) P
   %switch C (1:commands)

   %routine check (%string(*)%name s, %string(31) mess)
      %return %if s # null
      prompt (mess);  scan (s)
   %end

   %routine check in (%string(*)%name s) {check file was specd for stream}
      check (s, "Input disc? ")
   %end

   %routine check out (%string(*)%name s)
      check (s, "Output disc? ")
   %end

   %if parm = "KEEP" %start
      keep = 1
again:prompt("Param: ");  read(parm)
      normalise(parm)
   %finish
   clear out
   keep = 0 %and ->stop %if parm = "STOP" %or PARM = "QUIT"
   %for j = 1,1,commands %cycle
      %if parm = command(j) %start
         Ctype = j
         %exit
      %finish
   %repeat
   report (parm . "?") %and %stop %if Ctype <= 0
   -> C (Ctype)

C(1): !TEST
      testing = non zero
      check in (in1);  set disc (in,in1);  set disc (out,null)
      squeeze (in,out)
      validate free list (in)
      list (in) %if listing file # null
      -> STOP

C(9): !COPYUSER
C(10):!COPYUSERS
      copy user = non zero;  wanted users = 0
      prompt ("Copy: ")
      %cycle
         scan (line);  line = line . ","
         %while line -> parm . (",") . line %and parm # ".END" %cycle
            %continue %if parm = ""
            P_fname = parm . ":";  SVC (pack filename,P)
            %if P_p2 < 0 %start
               report ("Illegal name: " . parm)
            %else
               wanted users = wanted users + 1
               wanted user(wanted users) = P_p2
            %finish
         %repeat
      %repeat %until parm = ".END"
      !drop thru..

C(2): !COMPRESS
      check in (in1);  check out (out1)
      set disc (out,out1)
      make sure (out) %if copy user = 0
      set map (out) %if ctype = 9 %or ctype = 10
      set disc (in,in1)
      error ("Input = output?") %if in_unit no = out_unit no
      squeeze (in,out)
      validate free list (in)
      %if errors # 0 %start
         error ("***FAULTY INPUT DISC***")
         %stop %if exclam # '!'          {explictly ignore errors with '!'}
         errors = 0
      %finish
      report ("Testing output disc")
      testing = non zero
      set disc (in,null)
      set disc (out,out1)   {clears bitmap in OUT}
      squeeze (out,in)
      validate free list (out)
      report ("***FAULTY OUPUT DISC PRODUCED***") %and %stop %if errors # 0
      list (out) %if listing file # null
      -> STOP

C(3): !initialise
      splatting = non zero
      check out (out1);  set disc (out,out1)
      make sure (out)
      out_zero_free list = -1            {these blocks are allocated by WIPE}
      out_zero_user list = -1
      out_zero_defective list = -1
      out_zero_initialised = -1          {only after wiping}
      set zero (out,all,fields)

C(4): !WIPE
      check out (out1);  set disc (out,out1)
      make sure (out) %if ctype = 4
      wipe (out)
      -> stop

C(5): !KILL
      check out (out1);  set disc (out,out1)
      make sure (out)
      out_zero = 0;  out_zero_initialised = non zero   {now wont LOAD ok}
      out_zero_checksum = checkword(out_zero) + 1      {checksum wrong too!}
      write block (out,0,out_zero)
      -> STOP

C(6): !ZERO
      splatting = non zero
      check out (out1);  set disc (out,out1)
      make sure (out)
      set zero (out, all, fields)
      !set preferred pointers
      out_zero_free list     = default free list
      out_zero_user list     = default free list + 1
      out_zero_defective list= default free list + 2
      %if out_zero_system area # 0 %start
         out_zero_system area = 1
         out_zero_system size = sys size
      %finish
PUT ZERO:
      out_zero_checksum = 0;  out_zero_checksum = check word (out_zero)
      write block(out,0,out_zero)
      -> STOP

C(7): !COPY
      splatting = non zero               {suppress block zero checking}
      check out (out1);  set disc (out,out1)
      check in  (in1);   set disc (in,in1)
      make sure (out)
      set zero (out, 1<<make, 1);        !!cant scribble on IN!!
      j = out_zero_tracks * out_zero_blocks per cylinder
      pages = j // buf len;  odd blocks = rem (j,buf len)
      %for j = 0, buf len, (pages - 1) * buf len %cycle
         read page  (in, j, buf len, 1)
         write page (out,j, buf len, 1)
      %repeat
      %for j = pages*buf len, 1, pages*buf len + odd blocks - 1 %cycle
         read block  (in,  j, buf(1))
         write block (out, j, buf(1))
      %repeat
      -> STOP

C(8): !HELP
      open input (help text, program source)
      select input (help text)
      skip symbol                        {first '!'}
      %cycle
         read symbol (j)
         %exit %if j = '\'               {terminating character}
         print symbol (j)
         skip symbol %if j = NL          {past '!'}
      %repeat
      newline
      close input;  -> STOP

C(11):!TIDY
      check in (in1);  set disc (in,in1)
      set disc (out,null)
      -> STOP %if errors # 0
      testing = non zero
      squeeze (in,out)                   {check input disc for errors}
      %if errors # 0 %start
         report("***Faulty input disc")
         errors = 0 %if exclam # 0
      %finish
      tidy(in) %if errors = 0
      -> STOP

C(12):!RENAME
      check in (in1);  set disc (in,in1)
      check out (out1)
      length(out1) = 4 %if length(out1) > 4;  in_zero_disc id = out1
      report (in1 . " renamed " . in_zero_disc id)
      -> PUT ZERO

C(13):!LIST
      check in (in1);  set disc (in,in1)
      list (in)
      -> STOP

STOP:
   doing ("")
   %if errors = 0 %then parm = "No" %else parm = itos (errors)
   parm = parm . " error";  parm = parm . "s" %if errors # 1
   report (parm)
   ->again %if keep # 0

%end %of %program
 H?   n n}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %begin;      !disc recovery program
   %recordformat parmfm(%short dsno, dact, ssno, sact,
                        %integer p1,p2,p3,p4,p5,p6)
   %record(parmfm) p
   %integer this unit = 0
   %integer from
   %integer max block = 32000
   %recordformat filefm(%integer name1, name2, %short spine, day)
   %recordformat dirfm(%short files, %byte access, check, %short chain,
                       %byte spare, daccess,
                       %record(filefm)%array file(1:42))

   %recordformat blockfm(%short size, addr)

   %recordformat spinefm(%short last, %byte access, check,
                         %integer size,
                         %record(blockfm)%array b(1:126))

   %routine read block(%integer block number, %record(*)%Name block)
      %record(parmfm) p
      p_sact = 1
      p_p1 = block number
      p_p2 = addr(block)
      p_p3 = this unit
      p_p4 = 0
      svc(101, p)
      %if p_p1 # 0 %start
         printstring("Cannot read block")
         write(block number, 1)
         write(p_p1, 6)
         newline
         %signal 13,0
      %finish
   %end
   %routine print file(%record(filefm)%Name f)
      %string(27)%name sn
      %record(parmfm) p
      p_p1 = 0
      p_p2 = 0
      p_p3 = f_name1
      p_p4 = f_name2
      svc(18, p)
      sn == string(addr(p_sact))
      printstring(Sn)
      spaces(15-length(sn))
   %end
   %integer n,j,k,l,z
   %record(dirfm) dir
   %record(filefm)%Name f
   %record(spinefm) spine

   %on 13 %start
      newline
      printstring("End of disc at block")
      write(n, 1)
      newline
      %stop
   %finish
   prompt("Unit: ");  read(this unit)


   prompt("From block: ");  read(n)
   n = n-1
   %cycle
      n = n+1
      read block(n, dir)
!      %continue %unless -100 <= dir_files <= 100
      l = 0;  z = 0
      %for j = 1,1,42 %cycle
         f == dir_file(j)
         %continue %If f_name2 = 0
         ->no %if f_name1 # 0 %and f_name1&X'FFFF' = 0
         read block(f_spine&X'FFFF', spine)
         z = z+1 %if spine_check # '?'
         z = z+1 %if f_name1&X'C0000000' # 0;  !dubious
         l = l+1
         ->no %if z > 8
      %repeat
      %continue %if l = 0
      printstring("Directory found at block")
      write(n, 1)
      newline
      k = 0
      %for j = 1,1,42 %cycle
         f == dir_file(j)
         %continue %If f_name2 = 0
         k = k-1
         %if k <= 0 %start
            k = 4
            newline
            spaces(10)
         %finish
         print file(f)
      %repeat
      newlines(2)
no:%repeat
%endofprogram
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        !Operator command library,  ADC

!!!! %option  "NODECODE, STACK=10"


%include "sysinc:parmfm.inc"
%include "sysinc:command.inc"
%include "sysinc:direct.inc"

%record %format FD fm   (%string(15) name, %short %integer P)

!File system disc block formats

%record %format user fm (%integer name, password,
                         %short   dir block,      {disc addr of user dir}
                         %short   spare)
%record %format userlist(%short   users, spare1,  {# of users on unit}
                         %integer spare2,
                         %record(user fm) %array user (1:42))

!Block zero on every logical disc

%record %format zero fm (%integer vol id,         {m'VOLN'}
                         %string(7) disc id,      {"SVOL"}
                         %integer   free list,    {free blocks spine}
                                    user list,    {user catalog}
                                    defective list,{bad blocks list}
                         %integer   system area,  {start of system image}
                                    system size,  {N contiguous blocks}
                         %string(11)initialisation date,
                         %integer   tracks,       {physical disc info}
                                    blocks per cylinder,
                                    heads,
                         %integer   initialised,  {=0 => Disc WIPED O.K.}
                         %integer   copied,
                         %integer   checksum,     {sum(blockzero)-1 = 0}
                         %string(187) description,{of logical disc contents}
                         %integer marked,   {V2.00+: Disc INITIALISED O.K.}
                         %byte %array spare (1:252))

%const %string(31) Batch initiator =     "SPOOL:INIT.ABS"
%const %integer max unit    = 12         {Largest disc unit no. in system}

%const %integer Disc read   = 101
%const %integer Pon         = 115
%const %integer Pon off     = 116

%const %integer System lock = x'9E4'     {Magic store loc. Poke -1 to open sys.}
%const %integer System pass = x'9E8'     {Magic pass to any account}
%const %integer System time = x'9C0'     {Counts up time of day}
%const %integer System date = x'9C4'     {Knows todays date}
%const %integer Poff monitor= x'9D0'     {Switch supervisor monitoring on/off}
%const %integer Proc monitor= x'9C8'     {Log messages to/from one process}

%external %integer %fn %spec StoI (%string(31) s)
%external %routine     %spec Phex (%integer number, places)
%external %routine     %spec Read Line (%string(*)%name L)
%external %routine     %spec Unpack(%record(file fm)%name f, %string(*)%name s)
%external %routine     %spec Break Output
%system   %routine     %spec Sort(%record(FD fm)%arrayname A, %integer L, H)
%external %routine     %spec To upper (%string(*)%name s)
%external %routine     %spec Pack (%string(63) s, %record(filefm)%name f)
%external %routine     %spec Echo (%integer on off)
                             %const %integer on = 0, off = 1

%conststring(2)  x = "X "

%const %integer Symbol in Data = 3       {IMP-77 event number}
%const %integer Faulty Filename= 10

%integer %fn int (%string(31) s)
   %on symbol in data %start             {S contains a non-number}
      Print string ("""".s.""" ") %if s # ""
      Print string ("not a valid number")
      Newline
      %stop
   %finish
   %result = 0 %if s = ""
   %if s -> ("x").s %or s -> ("X").s %start
      %if s -> ("'").s %start
         length(s) = length(s) - 1 %if char no(s,length(s)) = '''' {as well}
      %finish
      s = "16_".s
   %finish
   %result = StoI(s)
%end

%routine  split up(%string(63)%name  parm)
   parse parameter(command,0,parm)
%end

%routine  pack user(%string(63) unit, %record(filefm)%name  r)
   pack (unit.":", r)
%end

%routine  check parm(%integer  mask)
   %integer  k
   %constinteger  total streams = 6
   %for k = 1,1,total streams %cycle
      %if mask&1 # 0 %and command_io(k) = "" %start
         print string("Parameter missing??")
         newline
         %stop
      %else %if mask&1 = 0 %and command_io(k) # ""
         print string(command_io(k)." ?")
         newline
         %stop
      %finish
      mask = mask>>1
   %repeat
%end

%routine nobody (%string(63) who)
   Print string (who." not logged on")
   %stop
%end

%integer %fn my process
   %record(parm fm) P
   SVC (28,P)                            {Get general info}
   %result = P_dsno&63                   {Process no. of our process}
%end

%integer %fn processes                   {Max process slot}
   %record(parm fm) P
   SVC (28,P)
   %result = P_p4
%end

%routine Director (%integer dact, %record(parm fm)%name P)
   P_dact = dact
   SVC (To Director,P)
   %if P_p6 # 0 %start
      Print string (P_text)
      Newline
   %finish
%end

%integer %fn User (%string(63) who)
   !String username => Process no.
   %record(parm fm) P
   To upper (who)
   %result = -1 %if who = ""      {ERROR}
   %result = 0 %if who = ".ALL"
   who = who.":" %unless char no(who,length(who)) = ':'
   Pack (who,P_file)
   %result = -1 %if P_file_owner < 0     {Invalid username?}
   SVC (5,P)                             {Find process}
   %result = P_p1&63
%end

%integer %function start (%string(27) proc)
   %const %integer Oper id = 1 007 883
   %record(parm fm) P
   Pack (proc,P_file)
   %result = 0 %if P_file_owner <= 0
   P_p6 = 1<<31                          {Privileged}
   P_p5 = P_p4;  P_p4 = P_p3;  P_p3 = oper id
   SVC (109,P)                           {Start process}
   %result = P_p3 %if P_p6 = 0
   %result = 0
%end

%routine Set word (%integer where, new val)
   %record(parm fm) P
   P_p1 = where;  P_p2 = new val;  SVC(118,P)
%end

%integer %fn Sys word (%integer where)
   %record(parm fm) P
   P_p1 = where;  SVC(117,P)             {Pick word up from real store}
   %result = P_p2
%end

{Kill off nominated user process(es):   }
{   KILL fred                           }
{   KILL .ALL                           }
%external %routine KILL (%string(63) parm)
   %record(parm fm) P
   %integer me = my process, j
   split up(parm)
   check parm(1);  parm = command_in1
   SVC(1,P) {Die!} %if parm = ""
   P_p1 = user(parm)
   %if P_p1 <= 0 %start                  { <0:error, 0:.ALL }
      %if P_p1 = 0 %start
         %for j = 4,1,processes %cycle
            P_p1 = j
            SVC(126,P) %if j # me
         %repeat
      %else
         Nobody (parm)
      %finish
   %finish %else SVC(126,P)              { KILL fred }
%end

{Give privilege to or remove it from the nominated process}
{   PRIV  user,ON                                         }
{   PRIV  user
%external %routine PRIV (%string(63) parm)
   %record(parm fm) P
   %string(63) what
   split up(parm)
   command_in2 = " " %if command_in2 = ""
   check parm(1+2);  parm = command_in1;  what = command_in2
   %if parm -> parm.(" ").what %start; %finish
   P_p1 = user(parm)
   Nobody(parm) %if P_p1 <= 0
   P_p2 = 0
   P_p2 = 1 %if what = "ON"
   SVC (124,P)
%end

%routine shutdown(%integer  delay)
   {Close system after DELAY minutes, sending warnings to users}
   %record(parm fm) P
   P_sact = 1                            {Nonzero to wait for reply}
   P_dsno = x'43';  P_dact = 7;  P_p1 = delay
   SVC (Pon off,P)
%end                                     {Ignores reply}

{Enable logins and make system generally available}
{   OPEN                                          }
%external %routine OPEN                  {Enable logins}
   Set word (system lock,0)
   shutdown(1 000 000)      { a very large number of minutes!! }
%end

{Disable further logins and, IFF a parameter is specified, start the}
{      shutdown sequence using that number of minutes               }
{   CLOSE                  : prevent further logins                 }
{   CLOSE  n               : stop logins and initiate shutdown      }
%external %routine CLOSE (%string(63) parm)
   %integer  k = -1
   split up(parm)
   %if command_in1 # "" %start
      k = int(command_in1);  command_in1 = ""
      check parm(0)
      k = 0 %if k < 0
   %finish
   Set word (system lock,-1)
   %if k >= 0 %start
      shutdown(k)
      print string("System closing in"); write(k,1); print string("minutes - ")
   %finish
   print string("Further log-ons inhibited")
   newline
%end

{Send a text message to all users currently logged on}
{   BROADCAST  text                                  }
%external %routine BROADCAST (%string(63) text)
   %record(parm fm) P
   P_text = text;  SVC(113,P)
%end

{Set global password so that knowledgable users can log on even though}
{the system is nominally CLOSEd                                       }
{   PASS   password                                                   }
%external %routine PASS (%string(63) parm)
   %record(parm fm) P
   %const %integer impossible pass = -2
   %integer j
   %if parm = "" %start
      Echo (off)
      Prompt ("Pass:")
      Read line(parm)
      Echo (on)
      Set word(system pass, impossible pass) %and %return %if parm = ""
   %finish
   Pack (parm.":",P_file)
   j = P_file_owner
   %if j <= 0 %start
      Print string ("Invalid password - ignored")
      Newline
      %return
   %finish
   Set word (system pass, j)
%end

%integer %fn unit (%string(63) id)
   %record(parm fm) P
   %if id = "" %start
      Print string ("Disc name?")
      Newline
      %stop
   %finish
   %if char no(id,1) = '#' %start        {Disc unit number #n}
      P_p1 = int(sub string(id,2,length(id)))
   %else
      Pack (id."_:",P_file)
      P_dact = 45                        {Find unit}
      SVC (To Director,P)
      %if P_p6 # 0 %start
         Print string (id." not loaded");  newline
         %stop
      %finish
   %finish
   %result = P_p1
%end

%integer %fn find unit (%string(63) which)
   %byte %array block(1:512)
   %record(parm fm) P
   %integer unit no
   To upper (which)
   %for unit no = 1,1,max unit %cycle
      P_p1 = 0;  P_p2 = addr(block(1));  P_p3 = unit no;  P_p4 = 0 {my process}
      SVC (Disc read,P)
      %result = unit no %if P_p1 = 0 %and string(addr(block(5))) = which
   %repeat
   %result = -1
%end

{Reboot system from nominated disc drive expressed either as the logical drive}
{number or the disc pack identifier                                            }
{   RESTART  #1         : . . . from logical DRIVE #1                           }
{   RESTART  SYS8       : . . . from the pack labelled SYS8                     }
%external %routine RESTART (%string(63) disc)
   %record(parm fm) P
   split up(disc)
   check parm(1)
   %if char no(disc,1) = '#' %then P_p1 = unit(disc) %c
                             %else P_p1 = find unit(disc)
   %unless 0 < p_p1 <= 4 %start
      print string("You can't reboot from unit #");  write(p_p1,0)
      newline
      %return
   %finish
   P_p2 = 2                              {Magic no. put in x'7E' by supervisor}
   SVC (123,P)                           {Reboot supervisor}
%end

{Make the pack on the nominated disc drive accessible to the file system}
{drive being referred to as above                                       }
{   LOAD  #1                                                            }
{   LOAD  SYS8                                                          }
{The converse operation is UNLOAD with identical conventions            }
%external %routine LOAD (%string(63) disc)
   %record(parm fm) P
   split up(disc)
   check parm(1)
   %if char no(disc,1) = '#' %then P_p1 = unit(disc) %c
                             %else P_p1 = find unit(disc)
   %if P_p1 <= 0 %start
      Print string (disc." not on-line")
      Newline
      %stop
   %finish
   Director (38,P)
%end

%external %routine UNLOAD (%string(63) disc)
   %record(parmfm)  p
   split up(disc);  check parm(1)
   p_p1 = unit(disc)
   director(39,p)
%end


%routine  set protection(%integer  on off, %string(63)%name  disc)
   %record(parmfm)  p
   split up(disc);  check parm(1)
   p_p1 = unit(disc)
   p_p2 = on off      {1=protected, 0=at risk}
   director(44,p)
%end
%external %routine PROTECT (%string(63) disc)
   set protection(1, disc)
%end
%external %routine HAZARD (%string(63) disc)
   set protection(0, disc)
%end

{List all processes either on a nominated disc unit or on all physically}
{accessible discs whether LOADed or not                                 }
%external %routine CATALOG (%string(63) parm)
   %routine %spec   Cat (%integer unit, flag)
   %const %integer  user list block = 301
   %const %integer  disc read = {SVC} 101
   %byte %name      L == length(parm)
   %integer         exclam = 0,  U,  swap unit
   %record(zero fm) Z
   %record(parm fm) P

   %predicate unloaded(%integer  unit no)
      %record(parmfm)  p
      p_p1 = unit no
      director(Direct Unitname, P)
      %true %if p_p6 # 0                 {unit not loaded}  %c
                  %or p_p1 = 0 {TEMP FRIG}
      %false
   %end
   %predicate  faulty checksum(%record(zerofm)%name  z)
      %integername  p == integer(addr(Z)), end == p++128
      %integer      total = -1
      %cycle
         total = total+p
         p == p ++ 1
      %repeat %until p == end
      %true %if total # 0
      %false
   %end

   SVC (28, P);  Swap unit = P_p2

   split up(parm);  check parm(1)
   L = L - 1 %while parm # "" %and char no(parm, L) <= ' '
   exclam = 1 %and L = L - 1   %if char no(parm, L)  = '!'

   %if char no(parm, 1) = '*' %start
      %for U = 1, 1, max unit %cycle
         %if U # swap unit %start
            P_p1 = 0;  P_p2 = Addr(Z);  P_p3 = U;  P_p4 = 0
            SVC (Disc read, P)
            Cat(U, exclam) %and newline %if P_p1 = 0
         %finish
      %repeat
   %else
      Cat (unit(parm), exclam)
   %finish

   %routine CAT (%integer unit number, exclam)
      %const %integer       user list block = 301
      %record(userlist)     Ulist
      %record(user fm)%name u
      %record(zero fm)      Z
      %record(FD fm) %array FD(1:42)
      %record(FD fm) %name  FDp
      %integer              j, k, col, dir
      %record(parm fm)      P
      %record(file fm)      f

      P_p1 = 0;  P_p2 = addr(Z);  P_p3 = unit number;  P_p4 = 0
      SVC (Disc read, P)
      %if faulty checksum(z) %start
         print string("*foreign disc* : unit #")
         write(unit number,0);  newlines(2)
         %return
      %finish
      Print string (Z_Disc id.": unit #")
      Write (unit number, 0)
      print string("  *unloaded*") %if unloaded(unit number)
      newline

      P_p1 = user list block;  P_p2 = addr(Ulist)
      P_p3 = unit number;      P_p4 = 0
      SVC (Disc read, P)

      k = 0
      %for j = 1, 1, 42 %cycle
         u == Ulist_user(j)
         %if u_name # 0 %start
            k = k + 1
            FDp == FD(k)
            FDp_p = j
            F = 0;  F_owner = u_name
            Unpack (F, FDp_name)
            length(FDp_name) = length(FDp_name) - 1
         %finish
      %repeat

      Sort (FD, 1, k) %if exclam = 0
      Col = 0
      %if exclam # 0 %then print string ("     User   Directory block
")
      %for j = 1, 1, k %cycle
         FDp == FD(j)
         Spaces(9 - length(FDp_name))
         Print string(FDp_name)
         %if exclam # 0 %start
            dir = Ulist_user(FDp_p)_dir block
            Write (dir, 5);  Spaces(2)
            Print string("x'");  Phex(dir, 5);  Print symbol('''')
            newline
         %else
            col = col+1
            newline %if col&7 = 0
         %finish
      %repeat
      Break Output
      Write(k, 1);  print string(" users")
      Newline
   %end
%end

%external %routine POFFMON (%string(63) parm)
   {Cause supervisor to log all events matching a mask}
   Set word (Poff monitor,int(parm))
%end

%external %routine PROCMON (%string(63) parm)
   Set word (Proc monitor,int(parm))
%end

%external %routine TIMEis (%string(63) parm)
   %const %byte %array limit(1:3) = 23, 59, 59
   %integer time = 0, j, k
   %string(63) x
   parm = parm.":::"
   %for j = 1,1,3 %cycle                 { hh:mm:ss }
      parm -> x.(":").parm
      k = int(x)
      %unless 0 <= k <= limit(j) %start
         Print string ("Bad time")
         Newline
         %return
      %finish
      time = 60*time + k
   %repeat
   Set word(system time,time)
%end

%external %routine DATEis (%string(63) parm)
   %record(parm fm) P
   split up(parm)
   p_text = command_in1
   %if command_in2 # "" %start
      parm = command_in2
      command_in2 = ""
   %finish
   check parm(1)
   SVC (34,P)                            {String date -> packed date in P_p1*}
   %if P_p1 = 0 %start
      Print string ("Bad date")
      Newline
      %return
   %finish
   Set word(system date,P_p1)
   Time is (parm) %unless Parm = ""
%end

%external %routine SEGS (%string(63) who)
   %const %string(15) %array flag(1:4) = {AMT flags}
      "Swopped-out", "New", "Shared", "Resident"
   %integer process = user(who)
   %record(parm fm) P
   %integer j,k,m
   Nobody(who) %if process <= 0 %and who # ""
   Print string ("
 Seg          AMT  Size  Users  Flags
")
   %for j = 0,1,15 %cycle
      P_p1 = j;  P_p2 = process;  SVC(11,P)
      %if P_p2 # 0 %start                {Segment connected?}
         Write (j,3)
         Space;  Phex(P_p2,8)
         Write (P_p3,3)
         P_p4 = P_p2 %and P_p5 = 0 %and P_p6 = 1 %if P_p3 = 0
         Write (P_p5,5)
         Write (P_p6,4)
         Spaces (3)
         m = 1
         %for k = 1,1,4 %cycle
            Space %and print string(flag(k)) %if P_p4&m # 0
            m = m<<1
         %repeat
         Newline
      %finish
   %repeat
   Newline
%end

%external %routine REPRIME
   %record(parm fm) P
   P_dact = 10;  SVC(22,P)               {Re-initialise POTTER}
%end

%external %routine QUEUE (%string(63) parm)
   %record(parm fm) P
   Pack (parm.":",P_file)
   P_p1 = P_file_owner
   P_dact = 12
   SVC (22,P)                            {Create a new queue in POTTER}
   %if P_p6 # 0 %start
      Print string ("*Cannot create """.parm.""" queue -- ".P_text)
      Newline
   %finish
%end

%external %routine INIT (%string(63) parm)
   { INIT queue current max }
   %integer init proc
   %record(parm fm) P
   %string(63) x
   split up(parm);  check parm(1+2+4)
   P_p3 = user(command_in1)                     {Queue-ID is a fake username}
   P_p4 = int(command_in2)
   P_p5 = int(command_in3)
   init proc = Start(batch initiator)
   %if init proc > 0 %start              {OK}
      P_dsno = init proc
      P_dact = 3
      P_ssno = 0
      SVC (Pon,P)
   %finish
%end

%external %routine LIMIT (%string(63) parm)
   {Set current limit on number of batch processes}
   %record(parm fm) P
   %integer init proc = user("INIT")
   %if init proc <= 0 %start
      Print string ("Batch system down")
      Newline
      %return
   %finish
   P_p1 = int(parm)
   P_dsno = init proc ! 64
   P_dact = 3                            {???????}
   P_ssno = 0
   SVC (Pon,P)
%end

%external %routine SPOOLER (%string(63) parm)
   {Send a command to one of POTTER's spoolers}
   %const %integer last command = 5
   %const %string(15) %array spooler command(1:last command) =
      "PAUSE", "CONTINUE", "RESTART", "CANCEL", "STOP"
   %string(63) queue id
   %record(parm fm) P
   %integer j
   %on %event 10 %start   {to catch faulty queue names}
      print string("Invalid queue name ".queue id.snl)
      %return
   %finish
   split up(parm);  check parm(1+2)
   queue id = command_in1; parm = command_in2
   pack user(queue id, p_file)
   p_p1 = P_file_owner         {get Q-id into right field}
   To upper (parm)
   %for j = 1,1,last command %cycle
      %if spooler command(j) = parm %start
         P_p2 = j
         P_dact = 13
         SVC (22,P)
         %if P_p6 # 0 %start
            Print string (P_text)
            Newline
         %finish
         %exit
      %finish
      %if j = last command %start
         Print string (parm)
         Print symbol ('?')
         Newline
         %return
      %finish
   %repeat
%end

{Creation, deletion and renaming of user processes}
{ $CREATE   user-name   password                  }
{ $DELETE   user-name                             }
{ $RENAME   user-name   new-name                  }
%routine  life and death(%integer op, %string(63)%name  parm)
   %record(parmfm)  user, parm2
   split up(parm)
   %if op = 0 {$DELETE} %start
      check parm(1)
      parm2_file_owner = 0      {to avoid 'unassigned' problem below}
   %else %if op = 1 {$CREATE}
      check parm(1+2)
      pack user(command_in2, parm2_file)
   %else
      check parm(1+8)
      pack user(command_out1,parm2_file)
   %finish
   pack user(command_in1, user_file)
   %if user_file_unit = 0 %start
FAULTY UNIT:
      print string("Faulty unit name?")
      newline
      %return
   %finish
   %if op = 2 {$RENAME} %start
      -> FAULTY UNIT %if parm2_file_unit=0 %or parm2_file_unit#user_file_unit
      user_P4 = parm2_file_owner
      op = Direct P Rename
   %else
      user_P3 = parm2_file_owner   {Password:- irrelevant for $DELETE}
      %if op = 0 %then op = Direct P Delete %else op = Direct P Create
   %finish
   director(op, user)
%end

%systemroutine  CREATE (%string(63)  parm)
   life and death(1,parm)
%end
%systemroutine  DELETE (%string(63)  parm)
   life and death(0,parm)
%end
%systemroutine  RENAME (%string(63)  parm)
   life and death(2,parm)
%end

%end %of %file
 H?   * *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!        

}@     K	V     .F4K      fى     0`EW     Jw     $_	L   *d;v     0Iq[}:}    6MY      <|]     B	Gf}}    H	e2B	     N/+   T1f^'W   ZSfW   `u~u      f<      lRwv     r9qXq@   xRm     ~:y}      Lu;`     [yO_p   
|@   %K@   UW@  NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    %Qv   y8@    eE     qIXH  d:w        Up`s    mfp  d+D    ]          	    HA a   A       Y!    ]!    a#       a    rA!    w"     }"     ! A   	   C!!     CA !  
   "A    "      A  a AA A! !       a   aA     # a!     a       a ! a    A               A   B    B      A       /A#     @  aB !  b a    T  aB a!      b      j"       q    t    " A    !  ba a   
  %&a    bA    a !    " aB !!   A  !  0  z  w    a b !!   !   !    b      b     a   b a     b     A   AAAAA  a       5b!   :  a  a    F AAA  a  a a    X  a   b ! a a    h   a!  b a A a     B     BA   " a a a a  a A a    b A   A b                dQ@    D"Z$h%Qv    :       ,v   	yL;ud   À d:Q@ 	d+H"   ,y} Ā p   	   Q{D ,D   Y^y     ,   	U8r"K   ,d    	fw   ,d    	z`   +} Ā  d    =p     ,   ld    ys     ,f Hd    w*    qH  X_ ,d    z*    qH ,d    F4K      ,d:Q@ ld    R   >   fى     ,d:Q@ ld    }  x}   
( ,d    `EW     w     ,d:Q@ lD   _	L   ,}}  ld    d;v     ,d:Q@ ld    >   y}      ,8   ld    &V;`   ,	  d    y? q[}:}    ,{ ld    MY      ,{ ld    |]     ,{ ld    wf}~w _&pÀ  { ,d    f}}    ,{ 	2B	     ,{ 	|]   y? ,d    %N9Đ    ,d    0!t   4l         yEQp  #K5 ,)yĐ,@  0  ĐH&0  L>  PD  T$  Xz  \d   |%   7/+   ,d:Q@ŀ lK    p#K5 t@   xzYgV;`   |  |d    #f^'W   ,d:Q@ 	fW   ,d:Q@ 	~u      ,d:Q@ l~u@ p>   tD   x    <      ,d:Q@ ld    wv     ,   lfv   pd    >   D   Q@   qXq@   ,d    	m     ,d:Q@ ld    :y}      ,d:Q@ l:y^8   pd        Lu;`     ,d:Q@ ld    :y^8   yO_p   ,d:Q@ lm    d    >   Lnv	h `@  À  d:Q@ ,=p Ld:U 	e     ,d:Q@ 	"e     ,d:Q@ 	qVM     ,d:Q@ 	$ P,Faulty unit name?Invalid queue name PAUSE system doCONTINUEstem doRESTARTEstem doCANCELTEstem doSTOPELTEstem do            Batch system downINIT " queue -- *Cannot create " :'
 Seg          AMT  Size  Users  Flags
Swopped-out DirNewpped-out DirSharedd-out DirResidentout Dir            , Bad date Bad time ::::;;              D users x'      User   Directory block
   *unloaded* : unit # *foreign disc* : unit # not on-line You can't reboot from unit #  not loaded_: 
Disc name? Invalid password - ignored :Pass:Further log-ons inhibited
minutes -  System closing inON   :.ALL  not logged on  ? Parameter missing??:16_'Xxnot a valid number "  "  X  SPOOL:INIT.ABS                      *                             !5
   ?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nH  !34  1  0 !81 !5$$A> #$$A> &C ?1  34C0  D   D   
C H  !34  1  0 !81 !5$$A> B  @ !4B ";
C@ !$$A> #$$A> B  C
B$P#E  E  &Q'1"C s_  eX!34RUUh!34dffз  ӳ  Ű !4Գ #9    !8 !5$$A> B$ C08 L  #9&"C  "
  'M  M   >' ("#4\BbD#:  
  nBJ"#<  #M  M  '"DC0  
$#M  M  &'"%ѷ  C $ "ѷ  $$A> ?$$A> $A1    0#
#	QD   RD   ?&A'"3    !8 !5$$A> "#&!2#C$$A> 
!  1  #C   C  '1"X# Y !Y !&\ Z  B!$$A> З  $1$H  H X [ &B0P  [ ,&' ?P  
*&30H  P  ї  C Kї  $$A> 
Y  #%$$A> 
qPr  PB &(pX  ?$PS?PE   &T 4A>  ?&?$$A> O$$A> "#:  ! ?$$A> ?$$A> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$2#XC   PC   '4"2$ #PC   '4"H  !34  "#(!B   C $$A> X w ( ,A A" L X !A  Px LC \Xx L8 ,3C0,' ,A  ,A" A" W   HW   HW  ,$ AH ,D!5$x 8 ,$ CA !9CA C0J~CA #?#  A Q  P '!4'!#  ' ,zA  ,A" ( ,A  ,W  C z   og A" , X ' ,A A" W  X-p0 IA`x  'g A" l X ' l ,A xA" ' ,A W  x  #g A" , X $0&1P8 ,P8 0X ð C0B=`AXp  ӑ  B0"dW   HW  ,$ Að B0fX ,=`AXMpL  Q  UC0@X ,A  ' ,A  `A" W   HW  ,$ AP X8 ,U8 0A0 B0 P 0x  w ( ,A A" l X !A  ?' , ,A PA" W   H$ A *w A" , X r ,  q ,H , ?x  w A" , X r ,  q ,X @x  W  A" , X @e fAX8  r    q  X  X #= W   HW  ,x  1w ( ,A A" l $X !A  ?h?  ,W  8 ,3!5%x  ,.JA!3$"P X +  A ?ӡ  Š :#8( ,HA" ?' , ,A h tW  X x#%C r l  q lXH tL ?C t gw ( ,A A" H X !A  ' , ,A h PW  X8 T<3!%$x    P dX \P `X XP \ aP Xr H  mq HX d!7X XC $C  VW  A" , X Ph 4PX 8r ,  vq ,x  g A" , X Ph 4r ,  uq ,X 8x  w P (( ,A A" l 'X !A  ?A4P h ,AD$aA( ,X=p<  A  ?Ӹ ,!7r l  q l ,AP tB bB0TAP $
$!AP C ,&P P P tU #7r l  ~q lX U AU B0P # ,A2#r l  ~q lx  yw P (( ,A A" l 3X !A  ?h ,AZX=p<ӳ @!7# @FA $cA( ,Xp  A  ?(  @A  ?8 ,#DH A??#1AP t!% ,Ax$P x .@A!4$P xr l  |q lx  ig A" , X $1@8 2@ C@H ,$W@X .Ph 4r ,  tq ,x   w P (A" , X $P`	Ax` B@Ax  w P (( ,A A" l X !A  ?%1P8 lh ,AXpӫ  C0,  AP lXp$@I  $`AjXX l#$PPX l%Q`	AXh lB0A.W   H$QXh lW   T"W   HW   HW  ,x  lw P (( ,A A" l #X !A  ?( t ,A  r l  qq lx  &w P (( ,A A" l $X !A  ?8 ,3B0N$aW  W   h?  ,W  $`W  Ӹ ,!9%R`	Ax ' l ,A  A" ' ,A h tW  X xP !/W   HW  ,C Z`	A\C  vw ( ,A A" l #X !A  ?8 ,3B0"W   HW  ,$ AH -@ #B0 ,$"Ap,Ap,P tC ' l ,A A" ' ,A h tW  P -@X nr l  q lXh lfC06' , ,A A" W   HW  ,$ AX tx  w ( ,A A" l +X !A  ?H l$1P4 Ȱ P A@  ( |Ah?  ,W  $&P P $P $8 |AP P P r   eq XH LDB0"$8 |A( ,A!8X x X U AŠ B0P %C  nw P (( ,A A" l #X !A  ?h ,A$aA8 -0 #!8 ,AP t# ,AP t#% C 2W   H$PXh tlW   TW  ,x $P xr l  {q l" Xw P (( ,A A" l #X !A  ?h ,Af$aA8 -0 #!8 ,AP t# ,AP tB 6' , ,A A" W   HW  ,$ AX l` &A8x  Vw P (( ,A A" l #X !A  ?h ,A$aAB ,AxP tX l` 'Ax  ,W  A" , X eAz$aAX  A8P 4X8 P8 8X ,` ,Ax  $w P (( ,A A" l X !A  ?X ,$aAx  w P (( ,A A" l X !A  ?X ,$`AJx  g A" , X Pi 4Y ,$aAX9 H<3!7X 4!5%y $" $	g A" , X Pi ,6 P9 0%API 4XY 4Xi ,X6  <
SPY 4&dPi ,Ui 0#3C U#5%y $" /	W  A" ,%X I0$1P4 Ȱ *P A@  )@A$PPYd90P9hPilPYpr	\  eq	\i0ADC00W   H$PXi W   T$bW  8y ' ,4A  zA" W   H$PXi W   TXi A#8lW   HW  ,Ȱ-Pdȩ ,PhXI PIl$PPYpr	\  eq	\$`PiP6&1P9LP9=tA 4P,X  C0tXP&PP9@APHXIL@A DA)|$4AvXY,\Xe  lPiX9H<S   bW  XHӫ  'ҫ  X9LU9A0 *B0NPXI  B0$X	@P ,X	DP 0XYP\$aW  $PPYTXi  #8NW   HX9P<P9$$!APLC &PLP9@APH$iӡ  jW   XHW   HXI  C0vXYH\H =tA 4Ha PiX$UW   T$bW   JW   H$UXiXlW  ` 'W   <W  ,C X9T<&1P9T0 !6W  ,XLUAUB0PW  $QXiPlW   TBW   HW  ,C ,	w P (( ,A A" l X !A  ?8 ,P8 l$@PH pr|  q|X8<P8 xh ,Ar$aAӸ ,C0& ,X l*  A ?ӑ  ɐ  !&'!*  C  ,XH l$  A ?Q  P !!7$aPh p'!$  8 -0 *B0v$&P tPU xC0H$PȘ |PPPr|  eq|XHLD!>XX pXh tlAW  ,X tUAŰ B0P#
 ,AVXX paATx  w P (( ,A A" l X !A  ? ,A$Q`	A\x  "w P (( ,A A" l X !A  ? ,AQ`	Ax  "w P (( ,A A" l 0X !A  ?$0P8 l( ,(A" ?$@&APH pPH 8 ,( x&CA??AAfP tB"P X p=AXX a  	VC W   HW  ,x X lȐ <
AZ tP lXH pUH A@ B0bP XX l`	A"C  zw P (( ,A A" l #X !A  ?h ,A( tX=p<  A  Xpӫ @#;( , @A  ?$қ @$aAr l  "q lXH tLDB0W   HW  ,x T`	AlX ,U#5 ,ANC  cw P (( ,A A" l )X !A  ? ,AP l!)8 ,3#5 ,A|W   H%&P P P xX lP |r p  q pX |C0$SXh lW   TW  $XXh |lW  $SXh lW   TXH LD!=XX |\PX $`Ph $1P8 $UXh lW   T$TXh lW   T$cW   $P $&P P X XH LC0$W  X =AW   HXX \
UPX X U AŠ B0P W  ,X U AŰ B0P W  ,x  w P (A" , X $:@8 .r ,  q ,x  w P (( ,A A" l #X !A  ?' l ,A A" ' ,A h tW  X8 x<P8 t$@ nr l  q lX C0@' ,A  ,A" xA"  tA" W   HW  ,x  fw P (( ,A A" l 4X !A  ?h ,A8$gAX=p<  AP Xp @AP Xp `AP AbP lC "@ pA$@ r$@@H tr p  sq px  Xw P (( ,A A" l $X !A  ?rA.P B `W   HW  ,x  ,A6P tX8 0 @@8 l3A$@ n$@ pr l  sq lC  Kw P (( ,A A" l 5X !A  ?h ,A$cAz( lX=p<  A  ?( ,Xp @A  ? lAbP B 2' ,A  lA" W   HW  ,x h?  ,W  $&P P =A( ,AB0>P $@ r   q XH LD#= W   HW  ,C @Š B0(W   H` ?W   <W  ,C ZU AŠ B0bP C B W  A" , X eAX8 !9$aA.$P XC T0 B0($cA' ,Xp @A  ?h TAC $$iA' ,Xp A  ?h TA' ,XMpL  A  ?h 4AlXX 4\UB0W   HW  ,x Xh ` B0,X8 T<3#35#3C X XP @` /Ph C "X XP <f!6`  Ph #` Ph X ,AC  w P (( ,A A" l X !A  ?X ,$aAx  w P (( ,A A" l X !A  ?X ,$`A\x  w P (( ,A A" l X !A  ?X ,$bA x  CKLIMIT, , ,  $  STACK, , ,  ~A$  GLAHEAD, , ,  $  CODEHEAD, , ,  $  ENTRY, , ,  ~C$  SPEC, A, ,  ~B$  TIMELIMIT, , ,  $  OPTIONS, , ,  $  LOADPOINT, , ,  }O $ HDFM, D, ,  {$  BASE, , ,  $  N, , ,  }O  $ HEADFM, D,  ,  {$  PURESIZE, , ,  $  GLASIZE, , ,  $  CODEDISP, , ,  $  LITDISP, , ,  $  REGISTERS, , ,  $  MAINEP, , ,  $  RELOC, A, ,  $  DEFS, A, ,  $  SPECS, A, ,  $  LDIAG, A, ,  $  VDIAG, A, ,  }O $$ REGFM, D, ,  {$  TR1, , ,  $  TR2, , ,  $  TR3, , ,  $  TR4, , ,  $  TR5, , ,  $  TR6, , ,  $  TR7, , ,  $  TR8, , ,  $  TR9, , ,  $  TRA, , ,  $  TRB, , ,  $  TRC, , ,  $  TRD, , ,  $  TRE, , ,  $  TRF, , ,  }O )$ LOADREGS, A, , !A O *$ LOADERSTATE, A, , !A $ OLDSTATE, A, , !A O ,N$ STACKLIMIT, , , !A O .$ LIBFM, D, ,  {$  USE, , ,  $  NAME, 1, ,  }O 0N   N   b$ LIB, K, ,$A O 1N    $ LIBLIMIT, , , $A O 2N    $ TLIB, A, , !A N    $ STLIB, A, , !A O 5$ LOAD, ,  , {$ PROG, B, ,  $ FILE, 1, ,  }O 6$ LOADX, ,  , {$ X, 1, ,  $ S, B, ,  $ OPT, , ,  }O 7$ LOADUP, 
,  , {$ P, B, ,  $ FILE, 1, ,  }O 8$ UNLOAD, ,  , {$ LEVEL, , ,  }O 9$ ENTER, ,  , {$ P, B, ,  }O :$ RELOCATE, ,  , {$ L, B, ,  }O ;$ UPDATESTACKLIMIT, ,  , {$ NEWLIMIT, , ,  }O =$ PACKSPEC, ,  , ${$ ID, 1, ,  $ T, B, ,  }O >F  $ CH, , , {$ SYM, , ,  }O ?N   A@ N   _&"> N   Z?> @ N   _&N   A-N   +V: O @N   0@ "> N   9?> @ N   0-N   +V: O AN   #@ "> N   %?> @ N   #-N   %+V: O B@ N    ?# N    V: O CN   UVO D;:  O EF  $ PACK, ,  ,  {$ K, , ,  $ N, , ,  }O F$ P, , ,  $ Q, , ,  $ R, , ,  O G@ @ @ p@ pESO G@                                                        $       $  *       *  0       0  6       6  <       <  B       B  H       H  N       N  T       T  Z       Z  `       `  f       f  l       l  r       r  x       x  ~       ~                                                                           $        (        ,        0        4        8        <     +0 PN   (/pEO \@ @ @ pN   (pESO ]@ N    ?= @ @ @ @ @ pEpE.S: O ^;:  O _@ ' SO `@ @ n N   ]pEO `@ @ n N  &pEO a@ @ n N   ]pEO a@ @ n N  &pEO b;O dN    $ XOPT, , , !A O f$ SATISFIED, 
,  ,  {$ L, B, ,  $ VEC, B, ,  $ TEXT, B, ,  }O h$ D, , ,  $ DISP, , ,  O i$ DEFFM, D, ,  {$  LINK, , ,  $  EP, , ,  $  N1, , ,  $  N2, , ,  }O j$ P, B, ,  O l@ @ n SO m: @ N    ?= O n@ @ @ n @ N   *+pEZO o@ n @ n ?# @ n @ n ?# O p@ @ n N  &N   [SO q@ n N    ?) 
O r@ n @ n @ +SO sF 	: 
O t@ n @ n SO u@ n @ n SO v@ n @ n @ +SO w: 	O x@ @ n SO yTO z: O {@ @ n N  &SO |B : O }KO ~;O $ DYNAMICLOAD, ,  ,  {$ V, B, ,  $ T, B, ,  }O $ N, , ,  $ OLDXOPT, , ,  O $ P, A, ,  O $ L, B, ,  O $ LIBP, B, ,  O @ =N   &N    ?= O @ @ pEO @ e'Ref: @ .pEO : O @ =N   &N    ?= @ @ p@ p@ pEk R: O @ @ SO : @ N    ?( O @ @ @ aZO @ @ p@ p@ pEk R: O @ @ N   -SO B : O @ N   ?= O @ @ @ N   +aZO @ N   USO : @ @ ?) O @ @ N   +SO @ N    ?# 
O @ @ ZO F 	: 
@ N    ?) 
O @ n @ :SO @ @ ZO @ n N    SO F 	: 
O @ @ @ aZO : 	O @ n N    ?# @ n ' ?# 
: F : 
O @ @ p@ n pEt 
F : 
O @ @ p@ p@ pEk 
O @ n 
@ n ZO @ n N   SO @ @ SO @ @ pEO @ @ SO @ n N    ?# F : O RO : 
O @ @ pEO : B : O : O @ =N   &N    ?# @ @ p@ p@ pEk R: O @ @ pEO @ Qn 'Cannot load @ .SO @ n N    SO H?   $ $                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %begin
   %recordformat parmfm(%shortinteger dsno, dact, ssno, sact, %c
                        %integer p1, p2, p3, p4, p5, p6)
   %record(parmfm) p
   %integer  k
   %on %event 9 %start
      %stop
   %finish
   p_p1 = 0
   svc(14,p)
   %if p_p6 # 0 %start;      ! console present => initial startup
      %cycle
         skip symbol   {flush to event 9 at end of .COM file}
      %repeat
   %finish
%endofprogram
 H?    B                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!             }                        NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z        e   a    " 
  dQ@    D"Z 	ox     ,d    LD   APA-
     ?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nA> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$  w P (A  , X Px P#Xx P$ A $0P8 4r ,  q ,X H#7W   0"x  /@   QH XX TZX ,PX 4Xh 4X`P  Ӧ V Ҧ 3B0%A@F 
XX V   @ X8 B0DX #7` A.C .PW ,X`&P 0$U$bA&XH PG ,X]`PW 0$ReA&C xPW ,&P 0$U$bA&Xh C00$P ,$0[8 P7 0$QeA&$P ,X P 0$X$cA&#$@PG ,[H PG 0$QeA&XX PW ,Xm`Pg 0$Q$bA&$Q`C 8$cA8                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |           #$`A;"A=6$SXi HA@ DA=6$RXi HA@ D$QXi A;` A.X=4P=pC AjP 8W   P AjP X`&İP &P`X P ,XI PG 0$X$bA&$QPW ,$\Xi A@ B`XhPi 0A H?    D                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !!! Program to drive printer directly for doing special printing jobs
!  especially sticky labels

%begin
%include "sysinc:parmfm.inc"

%constinteger  bufflen = 1024
%constinteger  lp demon = 111
%integer  outbuff, obp
%record(parmfm) p
%integer  k,sym,n

%routine  abort(%string(63)  message)
   print string("Failed - ".message); newline
   %signal 15,15
%end

%routine  claim system buffer
%record(Parmfm)  p
   svc(110,p)
   %if p_p1 < 0 %start
      abort("can't get printer buffer")
   %finish
   outbuff = p_p1<<16
%end

%routine  release system buffer
%record(parmfm)  p
   p_p1 = outbuff>>16;  svc(9,p)
%end

%routine  put block
%record(parmfm)  p
   p_p1 = outbuff;  p_p2 = obp - outbuff
   p_sact = 13; svc(lp demon,p)
   p_sact = 13;  svc(16,p);   ! poff
   obp = outbuff
%end

%routine put(%integer  sym)
   byte integer(obp) = sym;  obp = obp+1
   put block %if obp = outbuff + bufflen
%end

%routine  skip
   skip symbol %while next symbol # nl
   skip symbol
%end

   %on %event 9 %start
      put block
      release system buffer
      print string("*SPECIALP complete - restart spooler!!!!".SNL)
      %stop
   %finish

   select input(0);  select output(0)
   claim system buffer
   print symbol(7) %for k = 1,1,100
   print string("
      *** Have you 'STOP' ed  the printer spooler ???????

")
   prompt("Test lines=");  read(n)
   skip
   prompt("O.K. ? ")
   select input(1)
   k = 0;  obp = outbuff
   %cycle
      %cycle
         read symbol(sym)
         put(sym)
         %exit %if sym&127 = nl
      %repeat
      k = k+1
      %if k = n %start
         put block
         select input(0)
         read symbol(sym); skip
         select input(1)
         %if 'Y' # sym&127 # 'y' %start
            reset input;  k = 0
         %finish
      %finish
   %repeat
%endofprogram
 H?    I                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %externalroutine SPY
   %integer sym, s, n, ad, j
   %predicate VAL(%integer ad)
      %true %if valid(ad, 2)
      printstring("Invalid address");  newline
      %false
   %end
   select input(0);  select output(0)
Reset:
   prompt("Spy>")
   %cycle
      n = nextsymbol
      %exit %unless n = ' ' %or n = nl
      skipsymbol
   %repeat
   skipsymbol %and %return %if n = '.'
   read hex(ad)
   skipsymbol                {pending newline}
   %cycle
      ad = ad&(\1)            {round it down}
      ->reset %unless val(ad)
      prompt(xtos(ad, 5).": ".xtos(shortinteger(ad), 4)." >")
      %cycle
         sym = nextsymbol
         %exit %if sym # ' '
         skipsymbol
      %repeat
      skipsymbol %and %return %if sym = '.'
      %if sym = nl %start
         skipsymbol
         ad = ad+2
      %else
         n = 0
         %if nextsymbol # nl %start
            read hex(n)
         %finish
         n = 1 %if n <= 0
         s = readsymbol %until s = nl
         %if sym = '*' %start
            %cycle
               phex(ad, 5);  printsymbol(':')
               %for j = -3, 1, 4 %cycle
                  ->reset %unless val(ad)
                  space;  phex(shortinteger(ad), 4)
                  n = n-1;  %exit %if n <= 0
                  ad = ad+2
                  space %if j = 0
               %repeat
               newline
            %repeat %until n <= 0
         %else %if sym = '+' %or sym = '-'
            n = n<<1
            %if sym = '+' %then ad = ad+n %else ad = ad-n
         %else
            ad = n
         %finish
      %finish
   %repeat
%end
%endoffile

 H?    N                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %begin   ;! pilot
%include "sysinc:command.inc"

%integer exclam = COMMAND_modifier;               !Command line modifier (0,'!','?')
%string(31)%name  in file == COMMAND_in1;   ! First input stream
%record %format file (%string(127) name, %integer chan,
                 %integer top, lim, vmtop, vmlim, flag)
%shortinteger lines, answerok, reply length, fatal error, %c
             optl, optu, opts, optg, opte, optw, accepted, expval, experr, %c
            labels, i, j, k, lastaccept, source lines, subrentries, jump
%integer ptr,first,last
%constinteger maxchars=40000
%integer chr

%string(6) goto destn
%string(6) %array label(1:200)
%shortintegerarray labpt(1:200)
%byteintegerarray reply(1:160)
%externalbytemapspec byte integer (%integer n)
%record(file) f=0;            !TEXT mapped on DA file
%byte %map text (%integer N)
   %result == byte integer (f_top + N)
%end
%integerarray line(1:1000)

%routine upper case(%integername ch)
   ch=ch - 'a' + 'A' %if 'a' <= ch <= 'z'
%end

%routine lower case(%integername ch)
   ch = ch - 'A' + 'a' %if 'A' <= ch <= 'Z'
%end

%routine get line;  ! of Pilot program
%shortinteger opcode
   %routine get label
   %shortinteger i
      labels=labels+1
      label(labels)= ""
      i=0
      read symbol(chr); upper case(chr)
      %if 'A' <= chr <= 'Z' %start
         %while ('A' <= chr <= 'Z' %or '0' <= chr <= '9') %and i<6 %cycle
            i=i+1
            label(labels)=label(labels).tostring(chr)
            read symbol(chr); upper case(chr)
         %repeat
         %if chr # ' ' %and chr # nl %start
            print string("warning - label more than 6 chrs long")
            newline; print string(label(labels))
            %cycle
               read symbol(chr); upper case(chr); print symbol(chr)
            %repeat %until chr = ' ' %or chr = nl
            spaces(2); print string("at line"); write(lines,4); newline
         %finish
         labpt(labels) = lines
         source lines=source lines + 1 %if chr = nl
      %else
         fatal error = 1
         print string("error in label definition at line")
         write(source lines,4); newline
         %cycle
            upper case(chr); print symbol(chr); read symbol(chr)
         %repeat  %until chr = ' ' %or chr = nl
         newline
      %finish
      %cycle
         read symbol(chr) 
         source lines=source lines+1 %if chr=nl
         %exit %if chr # nl %and chr # ' '
      %repeat
%end; !of get label

%routine get opcode
%constshortinteger codes = 12, mods = 8
%constbyteintegerarray modcon(1:8)='H','J','S','X','Y','N','E','C'
%constbyteintegerarray code(1:12)='R','T','A','M','J','U','E','C',
                                        'X','F','D','P'
%integer i, pt2
   upper case(chr)
   %if chr = ':' %start
      %if text(line(lines-1)) = 'T' %start
         i=0; pt2=line(lines-1)
         %cycle
            text(ptr)=text(pt2)
            ptr=ptr+1; pt2=pt2+1
         %repeat  %until text(pt2) = ':'
      %else
         print string("op-code missing at line")
         write(source lines,5); newline
         fatal error = 1
      %finish
   %else
      %for i=1,1,codes %cycle
         %if chr = code(i) %then opcode=chr %and -> codeok
      %repeat
      print string("op-code error"); spaces(2)
      print symbol(chr); newline
      print string("at line"); write(source lines,5); newline
      fatal error = 1
      read symbol(chr) %until chr=':' %or chr = nl
      %return
codeok:  text(ptr) = chr
      %if chr = 'P' %start
         %if  next symbol = 'R' %start
            ptr = ptr + 1
            read symbol(chr); upper case(chr)
            text(ptr) = chr
         %else
            print string("no R after opcode P at line ")
            write(source lines,4); newline
            fatal error = 1
         %finish
      %finish
       ptr=ptr+1
      read symbol(chr) %until chr # ' '
      %return %if chr = ':' %or chr = nl
      %cycle
         -> modok %if '0'<= chr <= '9'
         %for i=1,1,mods %cycle
         upper case(chr)
         %if chr = modcon(i) %start
            %if (i=1 %and text(ptr-1)#'T') %or (2<=i<=4 %and    %c
                        text(ptr-1) # 'M') %start
               fatal error = 1
               print string("illegal modifier  "); print symbol(chr)
               print string("  with op-code  ")
               print symbol(text(ptr-1)); newline
            %else
               -> modok
            %finish
         %finish
         %repeat
         %if chr = '(' %start
            text(ptr) = chr; ptr = ptr + 1
            %cycle
               read symbol(chr); upper case(chr); text(ptr) = chr
               ptr = ptr + 1 
            %repeat  %until chr = ')'
         %else
            print string("illegal modifier  "); print symbol(chr)
            print string("  in line "); write(source lines,5); newline
         %finish
modok:  text(ptr) = chr; ptr = ptr + 1
         read symbol(chr) %until chr # ' '
      %repeat  %until chr = ':' %or chr = nl
   %finish
%end; ! leaves chr as : or nl

   ptr = line(lines)
   %if next symbol = nl %start  ;! skip blank line
      read symbol(chr)
      source lines = source lines + 1
      %return
   %finish
   read symbol(chr) %until chr # ' '
   get label %while chr = '*'
   get opcode
   %if chr # ':' %start
      print string("colon missing from line ");
      write(source lines,5); newline
      fatal error = 1
   %finish
! move rest of line into text array
   %while chr # nl %cycle
      text(ptr) = chr
      read symbol(chr)
      ptr = ptr + 1
   %repeat
   lines=lines + 1
   source lines = source lines +1
   line(lines) = ptr
%end; ! of get line

%routine load text
   %on %event 9 %start
       %return
   %finish
   %cycle
      get line
   %repeat
%end

%routine wrapup
   %external %routine %spec close off (%record(file)%name f)
   close off (f)
   select output(1)
   print string("Finish time "); print string(time); newline
   close output
   %stop
%end

%routine match(%shortinteger matchparm)
%shortinteger oksofar,windows,errors,textsep, %c
               replyptr,frame,textlength,reply offset
%integer firstext, lastext, nextext, textptr, i, j, k, chr, chr2
%integerarray rerrpt(1:2),terrpt(1:2)
   oksofar = 0; textptr = first; reply offset = 0; replyptr=1
   %cycle
      first=first + 1 %while text(first)=' '
      firstext=first
      %if text(firstext) = '%' %then frame=2 %else frame = 0
      %for j=first,1,last %cycle
         %exit %if text(j)='!' %or text(j)='&' %or j=last
      %repeat
      %if j=last %start
         lastext = j
         textsep=' '
      %else
         lastext=j-1
         textsep=text(j)
      %finish
      first = j + 1
      textlength = lastext - firstext + 1
      windows = reply length -textlength +1 +frame - reply offset
      %if windows < 1 %then oksofar = 0 %and -> nexsep
      %for i= 1, 1, windows %cycle
         errors = 0; replyptr = i + reply offset; textptr = firstext
         %while textptr <= lastext %cycle
            %if text(firstext) = '%' %start
               textptr=textptr + 1
               %if i # 1 %and reply(i) # ' ' %then -> nexwindow
               %if i # 1 %then replyptr=replyptr + 1
            %finish
            chr=text(textptr)
            upper case(chr) %if optu = 1
            lower case(chr) %if optl = 1
            %if reply(replyptr) # chr %and chr # '*' %start
               errors=errors + 1
               %if errors > 2 %then -> nexwindow
               rerrpt(errors) = replyptr
               terrpt(errors) = textptr
            %finish
            textptr = textptr + 1; replyptr = replyptr + 1
         %repeat
         %if errors = 0 %then oksofar = 1 %and -> nexsep
         %if matchparm # 'S' %then -> nexwindow
         %if errors = 1 %then oksofar = 1 %and -> nexsep
         %if rerrpt(1)+1 # rerrpt(2) %then -> nexwindow
         chr=text(terrpt(1)); chr2=text(terrpt(2))
         upper case(chr) %and upper case(chr2) %if optu = 1
         lower case(chr) %and lower case(chr2) %if optl = 1
         %if reply(rerrpt(1)) # chr2 %or  %c
            reply(rerrpt(2)) # chr %then -> nexwindow
         oksofar = 1; -> nexsep
   nexwindow:
      %repeat
   nexsep:
      answerok = oksofar %and %return %if lastext = last
      answerok=1 %and %return %if oksofar=1 %and textsep='!'
      %if textsep = '&' %start
         %if oksofar = 0 %start
            textptr=textptr+1 %until text(textptr)='!' %or %c
                                       textptr=last
            %if textptr=last %then answerok=0 %and %return
            first=textptr+1
            replyptr = 1; reply offset = 0
         %else
            reply offset = replyptr - 1
            oksofar=0
         %finish
      %finish
   %repeat
%end


%routine scan(%shortinteger firstline)
%shortinteger count,opcode,matchparm,replyparm,lineno,subrline
%integer i,j,k,lineptr
%string (6) label destn; %byteintegerarray modcon(1:10)

%routine get symbol(%integername ch)
   read symbol(ch) ; print symbol(ch)
%end

%routine find label(%shortintegername lineno)
%shortinteger i
   %for i=1,1,labels %cycle
      lineno = labpt(i) %and %return %if label(i) = label destn
   %repeat
   print string("missing label - "); print string(label destn)
   newline
   %stop
%end

%routine get reply(%shortinteger replyparm)
%shortinteger i,j,lastch; %integer ch
%constshortintegerarray goto(1:4)='G','O','T','O'

%routine cue response
%integer pt,pt1,pt2,l
   select output(1)
   %for l=lineno-2,1,lineno-1 %cycle
      pt1 = line(l)
      pt2 = line(l+1) - 1
      print symbol(text(pt)) %for pt = pt1,1,pt2
      newline
   %repeat
   write(lineno,4); newline
%end

   cue response

start:     i=0; lastch=0; goto destn=""
   %if replyparm = 'X' %start
      %cycle
         get symbol(ch)
         i = i + 1
         reply (i) = ch
      %repeat  %until ch = nl
      reply length = i
      -> count reply
   %finish
   get symbol(ch) %until ch # ' '
   %while ch # nl %cycle
      -> next %if ch = ' ' %and lastch = ' '
      -> next %if ch = ' ' %and opts = 1
      upper case(ch) %if optu = 1
      lower case(ch) %if optl = 1
      lastch = ch
      i = i +1
      reply(i) = ch
next: get symbol(ch)
   %repeat
   reply length = i
   %if i<=1 %then -> countreply
 %if reply(i-1) = ' ' %then reply length = i-1 
countreply: 
      %if reply length = 0 %then -> start
      %if optg=1 %start
         j=1
         %for i=1,1,reply length %cycle
            %continue %if reply(i)=' '
            ch=reply(i); upper case(ch)
            %exit %if ch # goto(j)
            j=j + 1
            %exit %if j=5
         %repeat
         %if j = 5 %start
            %for i=j,1,reply length %cycle
               %continue %if reply(i)=' '
               ch=reply(i); upper case(ch)
               goto destn=goto destn.tostring(ch)
               %exit %if length(goto destn)=6
            %repeat
            %if goto destn = "FINISH" %then wrapup
         %finish
      %finish
      %if lineno = lastaccept %start
               accepted = accepted + 1
            %else
               lastaccept = lineno
               accepted = 1
            %finish
   select output(0)
%end; ! of get reply

%routine get exprn
   lineptr = lineptr + 1 %until text(lineptr) = ')'
   print string("expression evaluation not yet implemented")
   newline
   expval = 0; experr = 0
%end

%routine set options
   %shortinteger option
   optu=0; optl=0; opts=0; optg=0; optw=0; opte=0
   lineptr = lineptr + 1 %while text(lineptr) # ':'
   %while lineptr < last %cycle
      lineptr = lineptr + 1
      %continue %if text(lineptr) = ' '
      option = text(lineptr)
      optu = 1 %and %continue %if option = 'U'
      optl = 1 %and %continue %if option = 'L'
      opts = 1 %and %continue %if option = 'S'
      optg = 1 %and %continue %if option = 'G'
      optw = 1 %and %continue %if option = 'W'
      opte = 1 %and %continue %if option = 'E'
   %repeat
%end

   lineno = firstline; opcode = ' '; experr = 0; expval = 0
   %cycle; ! process one line of text
      lineptr = line(lineno); last = line(lineno+1) - 1
      opcode = text(lineptr)
      lineptr = lineptr + 1
!**********************************************
      %if opcode = 'R' %then -> nexline
!***********************************************
      %if opcode = 'P' %then set options %and -> nexline
!************************************************
      %for i= 1,1,10 %cycle
         j = text(lineptr)
         %exit %if j= ':'
         %if j = '(' %then get exprn %else modcon(i) = j
         lineptr = lineptr + 1
      %repeat
      count = i-1
      %if count > 0 %start
         %for i= 1,1,count %cycle
            j = modcon(i)
            %continue %if j = 'Y' %and answerok = 1
            %continue %if j = 'N' %and answerok = 0
            %if '0' <= j <= '9' %start
               k=j-'0'
               %continue %if accepted = k 
            %finish
            %continue %if j ='C' %and expval = 1 
            %continue %if j ='E' %and experr = 1 
            %continue %if j = 'S' %or j = 'J'
            -> nexline
         %repeat
      %finish
         i = lineptr +1; label destn = ""
         i = i + 1 %until text(i) # ' '
         j = 0
         %cycle
            chr=text(i); upper case(chr)
            label destn = label destn.tostring(chr)
            i = i + 1
            j = j + 1
            %exit %if j = 6
         %repeat %until text(i) = ' ' %or i > last
      ! label destn contains label if there is one
      %return %if opcode = 'E'
!**************************************************
      %if opcode = 'U' %start
         find label(subrline)
         subrentries = subrentries + 1
         scan(subrline)
         subrentries = subrentries - 1
         -> setjump %if jump=1 %and subrentries = 0
         -> nexline
      %finish
      first = lineptr + 1
!*************************************************
      %if opcode = 'T' %start
         select output(0)
          print symbol(text(i)) %for i=first,1,last 
          newline
      %finish
!**************************************************
      %if opcode = 'M' %start
         matchparm= ' '; j = 0
         %for i = 1,1,count %cycle
            matchparm = 'S' %and %exit %if modcon(i) = 'S'
            j = 1 %if modcon(i) = 'J'
         %repeat
         match(matchparm)
         %if answerok = 0 %and j = 1 %start
            lineno = lineno + 1 %until Text(line(lineno)) = 'M'
            %continue
         %finish
      %finish
!**********************************************
      %if opcode = 'A' %start
         replyparm = ' '
         %for i= 1,1,count %cycle
            replyparm = 'X' %and %exit %if modcon(i) = 'X'
         %repeat
         get reply(replyparm)
         %if goto destn # "" %start
            jump = 1
            %return %if subrentries > 0
setjump:    label destn=goto destn
            opcode='J'
            accepted = 0
            jump = 0
         %finish
      %finish
!**********************************************************
      %if opcode = 'J' %start
         i=first
         i = i +1 %while text(i) = ' '
         %if text(i) = '@' %start
            i = i + 1
            %if text(i) = 'A' %then j = -1 %else j = 1
            k = text(i)
            lineno = lineno + j %until text(line(lineno)) = k
         %else
            find label(lineno)
         %finish
         %continue
      %finish
nexline:  lineno = lineno + 1
   %repeat; ! processing of text line completed
%end

   print string ("Loading " . in file . " -- please wait")
   newline
   f_name = "";  f_flag = 100;  !Scratch file + 100 scratch blocks
   %external %routine %spec connect input (%record(file)%name f)
   connect input (f)
   prompt ("?")
   %if exclam = 0 %start;            !No command modifier -- student user
      open output (1,"LP:Answers")
   %else;                            !program invoked by:  PILOT fred!
      open output (1,"Null:");       !(suppress the gungy listing)
   %finish
   select output(1)
   print string("Start time "); print string(time); newline
   select output(0)
   select input(1)
   source lines=1
   subrentries = 0
   lines=1; line(lines)=1; labels=0; fatal error=0
   jump = 0
   load text
   close input
   %if fatal error = 1 %start
      print string("fatal error(s) - run aborted"); newline
      %stop
   %finish
   lines = 1
   select input(0)
   scan(lines)
   wrapup
%endofprogram
 H?   ! !S                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     	@?   @ +IWz{     Wz   saWz     a       a:A  2zlO  C  2zlO:H  c0WM  M      WzR                                                                                                                                                                                                                                                                                                                                                                                                                C!          f <(}  	     S           NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    %Qv   | }"w&p  &XK~vg\             !    !    !    $"  aa aaa A BA A a     A !   J& aA A  b A A a a! a A  c a  ! a  ! Ca ! Aa =   "!!   baA A  c   A  a    !  c A    "       $ !aA A  A  !! a!!a  !BA A  !  a a  !  c <  !   "!A  	  "" aa    0 B    !  BAA!!! a  A     a   ! #   ! A b  3  f!      m"a aAA    A   #}     A  A a!!A   A!  ABA b        ! B      aaA  D  aA   a    a D   A !  "  Y   cA ! ā!     a !    a a A A    a   %  dQ@    D"Z 	}}      W   	"	=       	Mo"	=       	,K*!    ,8@   	,`C^e   ,8@   0g=   ,Lv@   ,`C^e 	MY%    gX     Q|      Q|	   ,_^p   .6ov   0""` 2}d    4qXN   6(QR 8}~X2  :qXN&"` <&y    @K;}}    DX`}}    H}p   L8@   P>   TD   X   \@ c,z       	&T  Ơ Lv! ,8@   q[ffw ,g    0g<   4g=   8K    ,qXN   qXN	   ,8@   .>   0K;} 4    ,#r   w`T:v ,`T: 	w9W     &y:u   ,-Z .`C^e 0Q|	   2qXN	   4Lv! 6z
riXH   88@   <>   @D   DLv!p   HK*!$"LW Aox    $h%Qv    ,#K5À 0:v:% 4Lv"8 6_x   8qXN!w~@ :%%s_p <`TK  >`T@ @`Tv B`T+ D`T@ F`T H!   J# L#"" NK*!3 P8@   R>   TD   VK;}+}  Xy-pLv"8 Zz
qV"8 \Ad  `g2   d&y hK;}  l   p.,^ey   %   fatal error(s) - run aborted Start time Null:
LP:Answers ? -- please waitLoading  )expression evaluation not yet implementedFINISH  G O T O            missing label -  Finish time  colon missing from line  
  in line  illegal modifier     with op-code   illegal modifier   no R after opcode P at line  at lineop-code errorop-code missing at lineRTAMJUECXFDP            HJSXYNEC             !error in label definition at lineat line%warning - label more than 6 chrs long                            
   <?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nH  !34  1  0 !81 !5$$A> #$$A> &C ?1  34C0  D   D   
C H  !34  1  0 !81 !5$$A> B  @ !4B ";
C@ !$$A> #$$A> B  C
B$P#E  E  &Q'1"C $A1    0#
#	QD   RD   ?&A'"3X# Y !Y !&\ Z  B!$$A> З  $1$H  H X [ &B0P  [ ,&' ?P  
*&30H  P  ї  C Kї  $$A> 
Y  #%$$A> 
qPr  PB &(pX  ?$PS?PE   &T 4A> O$$A> ?$$A> "#:  ! ?$$A> ?$$A> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$2$ #PC   '4" g A , X X8D<cZi W  ty  	g A , X X6  <0 a!0 z!%3P6  y  	g A , X X6  <0 A!0 Z!%3  P6  y  	w A , X H8 N&1@8 N8 A$@A  $P@Z ,W   P lh lAHXh ll` AB` ZB xX8 l<0 A!0 Z#)0 0Bz0 9B rH ,ɰ Cf&@ ,H N8 AP 0H NAXH l  @
 4' ,A   4A" X* 0A  W   P lh lAC j0  C00 
C0W   HW  ,H N8 AW   HW   P lh lAFXh llW   <XX l\P  #6P 
#3C $bW   W   H$THh 4W   TW  ,H N8 AHh 4@a  X8 l<0 
!6H X&@ XC p$A@H :W   H$THh XW   TW  ,h lAXh llW   <W   P l  #6 
#3C W  ,W   P l 
!6HX X&Q@X X 
#5  #2#C z A
w A , X h lAX8 l<0 :B0H 4'8hAXa  lAӱ  Ű TB0|$@PJ ,H 4'8hAXQ  \PZ 0Xh `lA^Xj 0lP 4ANXj 41  6  X `&P `XJ 0L&APJ 0dA Q  P :#3C C .4W   H$UHh XW   TW  ,$a@h :C $&P ,P 4=AXH lLQ  E!8@I ,DAC U 4AŰ B0P 4&W   H$bW   Xh llW   <W  ,W   H$UHh XW   TW  ,$a@h :W   P l :#5 
#2"z Xh `lAX8 l<1  0 AX lŰ PB0W   $ RB0HXH `L&APH `W   P lh lAXh `lAXX l\Q  P AC . W   H$THh XW   TW  ,$a@h :X8 `<&1P8 `W   P l  !2"
 :#4 
!3C X lɰ 0!ɰ 9!#C $@&APJ ,PJ 4h lA*X ,=AXX l\a  VB0X ,Ű !?XH `LdAQ  P TB04Xj ,l` B` B zX8 `<cAӱ  Ű MC0^$A@H :W   HXh llW   <W   HXX `\eA6a  W   <W  ,#C XJ ,UJ 4A@ B0P 4Xh ll` (B0Xh `lAX8 l<1  0 AX `&P `W   P lh lAXh `lAXH lLA  @ AXX `\&QPX `Xh ll` )#3C C HW   HXh llW   <W   H$UHh XW   TW  ,Xh `lAX8 l<1  0 AX `&P `W   P l  !2"
 :#6 
#3C C 
w A , X H 48hAX1  <P8 `W   $ 
B0W   P lH X&@ Xy W   P l  !2"
X lŠ *!4A"	AbXH lL@ :C0.W   H$UHh XW   TW  ,$Q@X :Xh ll` 
C0@Xh `lAX8 l<1  0 AW   P lX `&P `C H 4&@ 4HH X&A@H X8hAXX `\PQ  C  	w A , X Py ,#Xy ,y A"  	 X]w A , X h W  $aW   lW   HW   W   HW  ,W   $ A ;	g A , &X I `$1P4 $P A  ) pABI x$QPT P A  ) AB$0@9 ,XX d\PY H@9 :$a@i 4Xh dlAb1  0  !:X d&P dC X dP <jA4A  @ %!5$R@Y 6#$`@i 6X8 h<P9 X d'$!AP PC R&P PP kAӡ  Š !C0*Xi PlAA  @ &#;XY P\Xh hlV!2#
U AU B0P X9 P<X h;!9P9 @Ƞ  @ 2C XI PL'API @Xi PA\Q  @Y 2Xi Pl&aPh dX9 @<X <;&1@9 83AH 8&J 6K :@ .Aɠ #$@@I ,C P $P$!APY LC t&QPY LPY $`@i 0JY :@Y 4UAX9 <<P9 HX HX @	B Xi <lAA  @ %B0@XY H&QPY HXi Ll` #=8 Aӱ  Ű  #3C ` #6H 4&@ 4Xi HAJA  PI XHX >P !5i XAdHh <` !5i XAH 48 Aӱ  X XC0BŠ *C0:HI 0&A@I 0@ ##C f9 pAHY 4PQ  H 09 AXi HPa  X9 H&1P9 HH 4&@ 4C HI 0!6$Q@Y ,C 0Hi ` S#3C 
@ !6$1@9 ,C $9 pAXQ  \$A&QXa  lV#3C $9 AXa  lA81  P9 X$9 AXa  lAӱ  P \H >Š !9i XA4i \A,HH <@ !9i XARi \AJ$9 pAX  8 AQ  Xi \lVB0*$9 pAX  8 Aӱ  X X#2#$A@I ,#XY LUY AUY B0P XY @\Xh hlV!8H9 ,@8 6y H ,Ű !;H 2Š !!6$A@H 6C H9 20 &B0rB0\X H&P HkAӡ  Š !#;XI HXX h\E#3C Xi HX8 h<c!6$@ 6C &aPh d$A@I 4$P@Y :#	H 4'@ :$@ ,C 6	g A , X W   X: P  X Xk  lW   <z  "
g A , X H8 NP: 4$@$!A@J ,DAC P&A@J ,DAPJ 08 A) HAB0H ,8 AXZ Ha  @e  z HJ ,UJ 0AUJ 4B0P 0W   H HW   HW  ,$ A b
w A , X $aW   lH9 4'1P; @HI 4'C$!APK 8C &APK 8PK <8hAXQ  \P[ 0 AXa  l'aPk 4Pk H'Q$!AP[ ,C *&QP[ ,P[ DeAa  W   <X[ ,U[ DAU[ HB0P DW  ,XK 8UK <AUK @B0^P <$THi 4W   TW  ,{  g A , X A$0@: ,@: 08 pH Ű XB0Nj 4AHJ ,&A@J ,8 AXZ 4\Q  P AXj 4l` 
#3C H: ,@8 8C j 4AhX 4Ű  !2"XJ 4L@ 
C0@  !8HZ 0P  !3C j@  !8Hh @` !3C VH8 >0 !5j 4AH <Ű !5j 4AXJ 4L@J 0DAHZ ,&Q@Z ,8 AA  @ Aj 4AC fHj ,@h 8` !"#'8 Aӱ  Ű  !4'a@h 8HH 8!3C HX BP B0p$a@j .PJ <$0&A@: ,3AC |&1@: ,3AP: 88 Aӱ  Ű  !3C HH ,AA  PJ 4j 4AH .=AXZ 4\EQ  #3C &Hj .&a@j .` !2#H: ,U: 8AU: <B0|P 8H: .0 B0H 8P <'1$!A@: ,3AC x&1@: ,3AP: 88 AA  @  !3C DH ,AQ  PZ 4j 4A6Xj 4l  @
 @( p @A" 8 p0 !2#H: ,U: 8AU: <B0P 8 p.`A!3AbH 4E V!7HH H&A@H H#@ V$Q@X H$`W   lz 
w A , X X9 D<&1P9 DcAPӱ  Ű )#2"6W   HW  ,$@@H J@H Lz  /
w A , X $0@8 >@8 <@8 @@8 B@8 F@8 DXi DlAӱ  Ű :#:XI DL&API DC XY D\Xh hl	VC&QPY DeA1  0  !3C nXi DlAӱ  @ ,Ű U!6$A@H >C JŰ L!6$Q@X <C :Ű S!6$a@h @C *Ű G!5$1@8 B#Ű W!5$A@H F#Ű E!5$Q@X D#C ^z  
g A , X I P$1P4 $P A  ) `ABH9 @9 4Ȱ  @ .$@ L@ JH 48hAXA  LPI DH 4&AXQ  \'QPX hdAa  @i .X9 D<&1P9 D` R!3C l` P!5ATC ^$&P 8P hXi DlAPӡ  P <Š :!3C JŠ (!4A#X 89 `Aҡ  à AXI DL&API DX 8U hAŰ 
B0P hXY 8\'Q@Y ,UAUC PY l$`$!APi 8C &aPi 8Pi h9 `Aӱ  P <Ű Y!8H 6Š !3C hŰ N!6HH 6!3C Xɰ 0!ɰ 9!+[PY @H H!3C 8Ű C!8HH J@ !3C $Ű E!7HX LP !2#
Ű S#4Ű J!2#C Ui hAUi lB0XP hXi Dl&aPi 8$09 HX 8&P 8kAӡ  Š  !2"$@PI <Xi 8lAQ  PX lh lAXh ll  @	 p) H pA" X9 8<&1P9 8X <&P <Ű !3C (cApӡ  Š  #=XI 8LXX h\	E!#C vHi .` E!4y ` UB0:i 6AH8 Z&1@8 ZHi 6AH Z'@ ZH \Š !5!3C C XI DL&APH d` TB0r$`W   lXX h\PY lXh dl'a$!APi 8C (&aPi 8Pi hAa  W   <Xi 8Ui hAUi lB0P hW  ,H9 .0 MB0Ȱ  @ 0$P <HI ,PI lZ$!APY 8C H&QPY 8PY h9 `Aa  ` S!7Ȱ S@ 0C &Aӡ  Š J!4$API <UY hAUY lB0P hHi 0AHX 6B0BXi <l` B02H9 4&1@9 48hAXa  lAӱ  Ű M#3C C H .Š AB0@  @I 2HY ,PY l$`$!APi 8C 0&aPi 8Pi h9 `Aӱ  Ű X!6Ƞ X@ 2#	Ui hAUi lB0P hHi 2AH pDC00$Q@X \Hh Z##C ) H pA  0 J@9 .$@ H@ \H .Š JB0XH dLPI 8Xi 8lAQ  P  !:Xi 8l&aPi 8C Xi 8lA1  0 @B0~X 8&P 8kA~ӡ  Š A!5%API <#$QPY <Xi 8lAZa  Pi @H9 4X <
;@9 48hAXa  lA*ӡ  XI @L#3C #i 4A#HY 4&Q@Y 4C 0	w P (A , \X X=p<XC LPH ,S  PX 0H x$aPd 0 P4 A  ( ABH Pd P PT A  ( ABH Pd 0 P4 A  ( AB( 0 &AHX$1P4 ȰP A  (hAB' ,,A X 0A" A" W   HW  ,$08 Ȱ dPTh W  W   X ,!:$aW   #	$aW   $aW   lW   HW   W   HW  ,$`W   l$aW   `$@ X$@@H Z@ 48hAP  $P@X N@X :@X \AW   Hh :` B0"W   HW  ,$ A$1@8 4$`W   `Hh 4AAXx ' , lA  \A" W   H$ AeA8 l#ZXH  A??!4$Ҹ l' k lA  XA" ' ,A  ?h 4W  X 4!3C nX C0pX8  ( lVCA??C0X' k lA  TA" ' ,A  ?h TW  XH @ !?XX T\U#7Xh 4lV#3C X8  ӳ  #9( lDA C X Š !8X XP @#XH XLPH <=AX ,a  Atx    w P (( ,A A" l X !A  ?X ,$aA@x  !w P (( ,A A" l X !A  ?X ,$`Ax  w P (( ,A A" l X !A  ?X ,$bAx     BOTTOM   LEFT    PAGE   <LINE   HSLINE   PNLS   SGAP   PGAP   INDENT    PAGENO    START   FINISH  'CAP    UND   _CAPSH    UNDSH   %INVERT    CAPO  
 0XMPH UNDO  X=P8 CAPSHO  XP UNDSHO  XP INVERTO  	XP ATLINE   	OLDATLINEINCLUDEFILE 1  5
 3$@H INCLUDESTREA                                      $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                        gpKX         fp          B W B X 2 Y  *    C [  F \ 6 E ]  7 H ^ >  _  ? G `  AUFFP    	INDENTIND   ERRIND    XPAGE   COLS    LHM   TEXTCOLS    LINES    PAGES    FIXED    GAPS    SGAPS    SIZE    SMAX    	INDENTCOL   NEXT    	DIRECTIVE RELIND FREELIST NUM  F            
 LNtPH p P N            	NdPH(p P$ V            	NTPH0                                                       $       $  *       *  0       0  6       6  <       <  B       B  H       H  N       N  T       T  Z       Z  `       `  f       f  l       l  r       r  x       x ~       ~                                                     $        (        ,        0        4        8        <        @     D|`d W j _ a k ` y H?    v                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %begin;               !batch stream initiator

   %owninteger sub1, sub2, sub3
   %conststring(17) subsys = "SUBSYS:subsys.exe"

   %recordformat parmfm(%shortinteger dsno, dact, ssno, sact, %C
                        %integer p1, p2, p3, p4, p5, p6)
   %record(parmfm) p, pp, Q
   %recordformat procfm(%integer process, file, name, OWNER)
   %record(procfm)%array procs('A':'Z')
   %record(procfm)%name proc

   %integer jobs, max jobs, job limit
   %owninteger  QUEUE ID = 0               {to ensure consistency}
   %integer process, pfile, reason, password
   %routine report(%string(23) text)
      %record(parmfm) p
      string(addr(p_p1)) = text
      p_dsno = 0
      svc(120, p)
   %end
   %routine spare process
      %integer j
      %for j = 'A', 1, 'A'-1+max jobs %cycle
         proc == procs(j)
         %if proc_process = 0 %start
            %return
         %finish
      %repeat
      report("Process overflow")
      svc(1, p);    !stop
   %end

   %routine find(%integer process)
      %integer j
      %for j = 'A', 1, 'A'-1+max jobs %cycle
         proc == procs(j)
         %return %if proc_process = process
      %repeat
      report("Process lost")
      svc(1, p);  !stop
   %end

   %routine release(%integer process)
      find(process)
      proc_process = 0
   %end

   %ROUTINE INFORM(%INTEGER OWNER, END)
      %RECORD(PARMFM) P
      P_P2 = OWNER;  SVC(5, P)
      %IF P_P1 # 0 %START
         P_DSNO = P_P1
         %IF END = 0 %THEN STRING(ADDR(P_P1)) = "Batch job started" %c
                     %ELSE STRING(ADDR(P_P1)) = "Batch job finished"
         SVC(120, P)
      %FINISH
   %END
   %routine initialise
      %record(parmfm) p
      %ownstring(7) proc name = "BG@:"
      %integer j
      %for j = 'A', 1, 'Z' %cycle
         charno(proc name, 3) = j
         string(addr(p_sact)) = proc name
         svc(17, p)
         procs(j)_process = 0
         procs(j)_file = 0
         procs(j)_name = p_p2
      %repeat
   %end

   {Store initial message into P so it can be interrogated}
   *STME_0,P
RECONFIGURE:
   queue id = p_p3;  max jobs = p_p4;  job limit = p_p5

REPRIME:
   jobs = 0
   max jobs = 1 %if max jobs <= 0 %or max jobs > 26
   job limit = max jobs %if job limit > max jobs
   string(addr(p_sact)) = subsys;  svc(17, p)
   sub1 = p_p2;  sub2 = p_p3;  sub3 = p_p4

   initialise

   p_dact = 2;                  !attach
   p_p1 = queue id
   p_p2 = 5;                    !sact for reply
   svc(22, p)
   %if p_p6 # 0 %start
      report("Attach fails")
      *=0
   %finish

MORE:

   %while jobs < job limit %cycle
      p_dact = 4;                  !claim
      svc(22, p)
      %exit %if p_p6 < 0;                  !not available
      pfile = p_p1
      pp_dact = 7;  pp_p1 = pfile;  svc(22, pp);   !locate
      password = 0
      %if pp_sact = 2 %start
         password = pp_p5
         pp_p5 = 0
      %finish
      %exit %if pp_p6 < 0
      %cycle
         spare process
         proc_file = pfile
         p_p1 = 0;                            !any unit
         p_p2 = proc_name;                !owner
         p_p3 = sub1
         p_p4 = sub2
         p_p5 = sub3
         p_p6 = 0;                            !not privileged
         svc(109, p);                         !start process
         %exit %if p_p6 = 0
         report(string(addr(p_p1)))
         proc_process = -1
      %repeat
      process = p_p3;                      !process number
      proc_process = process
      p_dact = 6;  p_p1 = pfile;  svc(22, p);    !identify
      pp_p5 = p_p3;  pp_p6 = p_p4
      pp_dsno = process+64;  pp_dact = 2
         p_dact = 27;         !become
         p_p3 = password
         proc_owner = p_p2;  inform(proc_owner, 0)
         p_p6 = process
         svc(20, p)
         report("Batch: cannot become") %if p_p6 # 0
      svc(115, pp);                        !send it its input file
      jobs = jobs+1
   %repeat

   !come here to wait

   p_sact = 0;  svc(16, p);                  !poff


   %if p_dact = 1 %start                      {reconfigure initiator}
      -> RECONFIGURE
   %finish

   %if p_dact = 3 %start;                     !update jobs
      %if 0 <= p_p1 <= 26 %start
         job limit = p_p1
         job limit = max jobs %if job limit > max jobs
         report("initiator suspended") %if job limit = 0
      %else
         report("Number of jobs?")
      %finish
      ->MORE
   %finish

   %if p_dact = 8 %start;                     !process stops
      jobs = jobs-1
      process = p_p1
      find(process)
      inform(proc_owner, 1)
      pp_dact = 9;  pp_p1 = proc_file;  svc(22, pp);   !delete
      release(process)
      ->MORE
   %finish
   %if p_dact = 5 %start;                     !something on queue
      ->MORE
   %finish
   ->REPRIME %if p_dact = 2 %and p_p2 = 7
   report("Bad message")
   ->MORE

%endofprogram
 H?   
 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     @?   @  ]m+  t    ]m+:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    C!             }             	        NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    B Bad messageNumber of jobs?initiator suspendedBatch: cannot become Attach fails Batch job finished Batch job startedProcess lost Process overflow       A   Z   SUBSYS:subsys.exe
   ?1  34C0  D   D   
C   w ) ,A  p d) L ,A  $0@9 Dr	 D  xq	 Dy  	w p 4X  @P 00 @P9 ,C  &1P9 ,4Z8 P8 X  !4y X9 ,U9 0B0Atr ,  q ,C  3	g p 4X  @P 00 @P9 ,C $&1P9 ,4Z8 P8 X  U !4y X9 ,U9 0B0A
r ,  q ,C  5	g p ,AX $0P<  y  	W  p LPi 8r	 ,  q	 ,X 4C00@ ,X9  !8) 4A  #) 4A  r	 ,  xq	 ,y  .	w p P @&P L_) 2\A  r	 ,  q	 ,X9 L4Z8 $P  X LZ P XI LDZH XY 8PT X L ZB0y  ;	w P (p NPH pP q ,X <P X8 @P8 X DP $P X #$ɐ #$$P XH 	I##P ( 2A  r ,  q ,XX 8P]PXh <PmTX @PXA$2@8 .X P 4$P 8r ,  q ,X H#6A>  XH YH Cn$T@X .r ,  q ,Xh H#C RX 4P $7@8 NP Tr L  q L$P H RŠ !8X dP $P dX h#C AXH XX PT $`Ph 4X P 8X=PP8 <XTP @XXP DPh Hr ,  mq ,X H!2# 4AxXH %QPT  C Xh <Ph X Pl  $6@8 .X P 4r ,  q ,X <P dX @P hXH T @@X L$b@h N @ .X P <X8 X 8P $PkA&X P Hr ,  q ,X H#5jAr L  sq L$AQH C $P@X 2r ,  q ,Hh .` B0<X 4B( B  P Y #%X P !5VAv#FAlC ,` B0L%1Q8 X 4P kA$QX Xj Aj$@ NXH XT PX Tr L  q LXh A"C ` !3C ` !8X 8 !3C 2:AC A;xX L$@@J #W   P XX P G!5$`A;#Xi A:$aA@ ^zC TXh ` JB0A<$gA
$RXi HA@ D$SXi LA@ D` #A.*X  !%$`Ad# !5$bAd#$aAd%2Q=P$P ,$P 0Z$gA<DXH !;$PPW ,$aPg 0$W$jA&W                                        $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |          BG@:h j   	     l C1& l          @ DA=T$RXi HA@ D$QXi A<` A.*X=(P=dC (AP 8W   P AP XT&İP &PTX P ,XI  H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          C!            }              	        NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z         " , 1 ; dQ@    qX`    yAqXr"K&     qT{@  :v`    :y~iL{@ox    $0Bad messageNumber of jobs?initiator suspendedBatch: cannot become Attach fails Batch job finished Batch job startedProcess lost Process overflow       A   Z   SUBSYS:subsys.exe
   SH  !34  1  0 !81 !5$$A> 6#$$A> 6&C  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n?1  34C0  D   D   
C GHO  s/ "B
'X=  2 #$$A> 6&r0U> ?P7D   &D"$  w ) ,A A D !A   ) L ,A $0@9 Dr	 D  xq	 Dy  $	w A , X8 0 @P9 0@ @PI ,C  &API ,DZH PH XT  !4y XI ,UI 0B0Abr ,  q ,C  5	g A , X8 0 @P9 0@ @PI ,C $&API ,DZH PH XT  UY !4y XI ,UI 0B0Ar ,  q ,C  7	g A , AX $0P<  y  	W  A , Pi 8r	 ,  q	 ,X 4C00@ ,X9  !8) 4A #) 4A r	 ,  xq	 ,y  0	w A , 0 @&1P9 L=c) 2`A r	 ,  q	 ,X LZ $P  XI LDZH $PPT Xi LdZh X 8P X9 L0 ZB0y  >	w P (A , -NPH pP q ,X <P\X8 @P8 X DP $P X #$ɐ #$$P XH 	I##P ( 2A r ,  q ,XX 8P]PXh <PmTX @PXA$2@8 .X\P 4$P 8r ,  q ,X H#6A  XH YH Cx$T@X .r ,  q ,Xh H#C \X 4P $7@8 NP Tr L  q L$P H RŠ !8X dP $P dX h#C AXH XX PT $`Ph 4X X< P8 8XPP <XTP @XXP DPh Hr ,  mq ,XH H!2# 4ALXX %aPe  C X <P X8 P  $@ .X P 4r ,  q ,X <P dXH @PH hXX e @@h L$@ N0 @8 .X P <X X 8P $PX Xi AXH PH Hr ,  q ,XX H#5jAr L  sq L$aQh C |$@ 2r ,  q ,H8 .0 !3C 0 B0<X 4B(ɰ B  P Y #%X P !5VA:#FA0C 0 B0L%Q X 4P iA$QXH Xd AH$Y@X NXh X P Tr L  q LXh AC 0 !3C 0 !8X 8Ű !3C :AC ' ,A  AXmP` `Ph 80 `$!A@8 .3AC P&1@8 .3AP8 4  @ <' 3\A  <A" ' ,A  AjH8 .U8 4AU8 8B0P 4' ,$A $P 4P 8[Xh 0lAf$cA' ,A A' ,P 4A $P 4P 8ZXh 4A(' ,A A' ,P 4A $P 4                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                                                       XZ ,E!Xi HIF !($cAAC b$RXi HAќ$SXi LAђXi LAT%QP$bA
B$cA
B` A.*X9                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |              BG@:h j @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nH  !34  1  0 !81 !5$$A> #$$A> &C ?1  34C0   H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        { Central queueing agency for mouses Version 2 }

!==================================================================!
!   dact              p1       p2      p3     p4     p5      p6    !
!==================================================================!
!   1   Offer         queue    -       file1  file2  alias1  alias2!
!   2   Attach        queue    sact    -      -      -       -     !
!   3   Detach        -        -       -      -      -       -     !
!   4   Claim         -        -       -      -      -       -     !
!   5   Take          id       -       new1   new2   -       -     !
!   6   Identify      id       -       -      -      -       -     !
!   7   Locate        id       -       -      -      -       -     !
!   8   Request       -        -       -      -      -       -     !
!   9   Delete        id       -       -      -      -       -     !
!  10   Reprime       -        -       -      -      -       -     !
!  11   Stop proc     proc     -       -      -      -       -     !
!  12   Create Q      queue    -       -      -      -       -     !
!  13   Relay messge  queue    code    ?      ?      ?       ?     !
!  14   Offer*        unit     owner   file1  file2  pass    alias2!
!==================================================================!


%begin

  %constinteger max logons = 6
   %constinteger max queues = 6
   %constinteger batch id = 2566987;      !BATCH:

   %recordformat parmfm(%shortinteger dsno, dact, ssno, sact, %c
                        %integer p1, p2, p3, p4, p5, p6)
   %recordformat knownfm(%integer queue, %shortinteger process, dact)
   %recordformat entryfm(%integer sender unit, sender id,       %c
                                  sender name1, sender name2,   %c
                                  owner unit, owner id,         %c
                                  owner name1, owner name2,    %c
                                  queue, date, time, %c
                                  %shortinteger priority, mode)
   %recordformat datafm(%integer t1,t2,t3,t4,t5,t6,t7,t8, %c
                        %record(entryfm)%array e(0:9))
   %ownrecord(datafm) b

   %ownrecord(knownfm)%array known(1:max logons)
   %ownrecord(parmfm) p, q
   %ownrecord(entryfm)%name e
   %owninteger potter sno,  potter unit, potter id
   %owninteger process, process unit, process id
   %owninteger queue, reply sact
   %owninteger sender unit, errorx
   %owninteger j, priv, dact
   %owninteger error, key, cell, id, this block
   %owninteger null = 0
   %owninteger who asl, cell asl
   %owninteger processes, queues
   %ownintegername  queue head, proc head

   %integerarray who, heads(1:max queues)
   %byteintegerarray whol(1:max queues)
   %byteintegerarray link(1:255)

   %switch cqa(1:14)

   %routinespec write block

   %routine report(%string(23) s)
      %record(parmfm) p
      string(addr(p_p1)) = s
      p_dsno = 0;         !tell oper
      svc(120, p)
   %end
   %routine crash(%string(23) S)
      report(s)
      svc(1, p);         !stop
   %end
   %routine pack(%record(parmfm)%name p, %string(23) file)
      string(addr(p_sact)) = file
      svc(17, p)
   %end
   %routine unpack(%record(entryfm)%name e, %string(31)%name s)
      %record(parmfm) p
      p_p1 = e_sender unit
      p_p2 = e_sender id
      p_p3 = e_sender name1
      p_p4 = e_sender name2
      svc(18, p)
      s = string(addr(p_sact))
   %end
   %routine connect queue
      %record(parmfm) p, q
      pack(p, "QUEUE")
      q = p
      q_dact = 6;  svc(20, q)
      %if q_p6 # 0 %start;                  !failed
         q = p
         p_dact = 2;                        !create file
         p_p5 = 27
         svc(20, p)
         crash(string(addr(p_p1))) %if p_p6 # 0
         q_dact = 6;  svc(20, q)
         crash(string(addr(q_p1))) %if q_p6 # 0
         key = q_p5
         b = 0
         write block %for this block = 0, 1, 26
      %finish
      key = q_p5
   %end

   %routine notify started
      %record(parmfm) p
      svc(119, p)
      potter unit = p_p1
      potter id   = p_p2
      potter sno  = p_p6
   %end
   %routine put on hat(%integer unit, owner)
      %record(parmfm) p
      p_dact = 36
      p_p1 = unit
      p_p2 = owner
      p_p3 = 0;               !password
      p_p6 = 0;               !this process
      svc(20, p)
      error = -111 %if p_p6 # 0
   %end

   %routine doff cap
      put on hat(potter unit, potter id)
      crash("Cannot locate potter") %if error # 0
   %end
   %routine delete(%record(entryfm)%name e)
      %record(parmfm) p
      put on hat(e_owner unit, e_owner id)
      %if error = 0 %start
         p_dact = 14
         p_p1 = 0
         p_p2 = 0
         p_p3 = e_owner name1
         p_p4 = e_owner name2
         svc(20, p)
         doff cap
         error = -104 %if p_p6 # 0
      %finish
   %end

   %routine get process info
      %record(parmfm) p
      p_p1 = process&31;  p_dact = 29;  svc(20, p)
      %if p_p6 < 0 %start
         error = -111
      %else
         process unit = p_p1
         process id= p_p2
      %finish
   %end
   %routine transfer file(%record(entryfm)%name from, %record(parmfm)%name to)
      %record(parmfm) pp, qq
      %integer keyin, keyout
      %byteintegerarray buf(0:511)
      %routine close(%integer key)
         %record(parmfm) p
         p_dact = 11
         p_p5 = key
         svc(20, p)
      %end

      pp_p1 = from_owner unit
      pp_p2 = from_owner id
      pp_p3 = from_owner name1
      pp_p4 = from_owner name2
      %if from_owner unit = process unit %c
         %and from_owner id = process id %start
         to_p1 = from_owner unit
         to_p2 = from_owner id
         to_p3 = from_owner name1
         to_p4 = from_owner name2
         %return
      %finish
      to_p1 = pp_p1;  to_p2 = process id
      put on hat(pp_p1, process id);     !try same unit first
      %if error # 0 %start;              !no luck, try any
         error = 0
         to_p1 = process unit
         put on hat(process unit, process id)
         %return %if error # 0;          !give up
      %finish
      qq_dact = 25;  svc(20, qq);         !create unique file
      to_p4 = qq_p4;      !QUE.???
      to_p3 = 0
      qq = pp

      pp_dact = 34;                        !transfer
      pp_p5 = to_p3;                        !new name
      pp_p6 = to_p4
      svc(20, pp)
      %if pp_p6 # 0 %start
         %if pp_p6 # -7 %and pp_p6 # -17 %start
OOPS:       doff cap
            error = -109
            %return
         %finish
         pp = qq
         pp_dact = 4;                         !open input
         svc(20, pp);  ->OOPS %if pp_p6 # 0
         key in = pp_p5
         pp_dact = 5;                         !open output
         pp_p1 = 0
         pp_p2 = 0
         pp_p3 = to_p3
         pp_p4 = to_p4
         pp_p5 = 1                  {R/W  ??}
         svc(20, pp)
         %if pp_p6 # 0 %start
            close(key in);  ->OOPS
         %finish
         key out = pp_p5

         %cycle
            pp_dact = 7;                        !read
            pp_p4 = addr(buf(0))
            pp_p5 = key in
            svc(20, pp);  %exit %if pp_p6 < 0
            pp_dact = 8;                        !write
            pp_p4 = addr(buf(0))
            pp_p5 = key out
            svc(20, pp);  %exit %if pp_p6 # 0
         %repeat
         close(key in);  close(key out)
         ->oops %if pp_p6 # -4;                  !input ended
         !transferred ok, now delete the old copy

         delete(from)
         error = 0
      %finish

      !update queue info

      from_owner unit  = to_p1
      from_owner id    = to_p2
      from_owner name1 = to_p3
      from_owner name2 = to_p4

      doff cap
      write block;         !update queue
   %end

   %routine set error
      %switch e(-112:-100)
      ->e(error) %if -112 <= error <= -100
      string(addr(p_p1)) = "Unknown error";  %return
e(-101):string(addr(p_p1)) = "Illegal request";  %return
e(-102):string(addr(p_p1)) = "Invalid queue";  %return
e(-103):string(addr(p_p1)) = "No such queue";  %return
e(-104):string(addr(p_p1)) = "No free space";  %return
e(-105):string(addr(p_p1)) = "No free queue";  %return
e(-106):string(addr(p_p1)) = "Queues full";  %return
e(-107):string(addr(p_p1)) = "Queue empty";  %return
e(-108):string(addr(p_p1)) = "No such entry";  %return
e(-109):string(addr(p_p1)) = "Transfer fails";  %return
e(-110):string(addr(p_p1)) = "Queue already exists";  %return
e(-111):string(addr(p_p1)) = "No process";  %return
e(-112):string(addr(p_p1)) = "No such file";  %return
e(-100):
   %end
   %integerfn new cell
      %integer c
      c = cell asl
      cell asl = link(cell asl) %if c # 0
      %result = c
   %end
   %routine return cell(%integer c)
      link(c) = cell asl
      cell asl = c
   %end
   %routine read block(%integer n)
      %record(parmfm) p
      %return %if this block = n
      this block = n
      p_p4 = addr(b)
      p_p5 = key
      p_p6 = n
      p_dact = 9;  svc(20, p)
      crash(string(addr(p_p1))) %if p_p6 # 0
   %end
   %routine write block
      %record(parmfm) p
      p_p4 = addr(b)
      p_p5 = key
      p_p6 = this block
      p_dact = 10;  svc(20, p)
      crash(string(addr(p_p1))) %if p_p6 # 0
   %end
   %integermap find(%integername head, %integer item)
      %integer first, n
      %result == null %if head = 0
      first = head
      %cycle
         n = who l(head)
         %result == heads(n) %if who(n) = item
         head = n
         %result == null %if head = first
      %repeat
   %end
   %routine insert(%integername head, %integer cell)
      head = cell %if head = 0
      link(cell) = link(head)
      link(head) = cell
      head = cell
   %end
   %routine extract(%integername head, cell)
      %if head = 0 %start;            !empty
         cell = 0
      %else
         cell = link(head)
         link(head) = link(cell)
         head = 0 %if head = cell;    !now empty
      %finish
   %end
   %integerfn locate(%integername head, %integer cell)
      %integer first
      %result = 0 %if head = 0
      first = head
      %cycle
         %result = cell %if link(head) = cell
         head = link(head)
         %result = 0 %if head = first
      %repeat
   %end
   %routine set date and time(%record(entryfm)%name e)
      %record(parmfm) p
      svc(19, p)
      e_date = p_p4
      e_time = p_p5
   %end
   %record(entryfm)%map entry(%integer n)
      %integer block, index
      index = rem(n, 10)
      block = n//10
      read block(block)
      %result == b_e(index)
   %end
   %routine select queue
      %integer j
      error = -103
      %for j = 1, 1, max logons %cycle
         %if known(j)_process = process %start
            queue = known(j)_queue
            error = 0
            %exit
         %finish
      %repeat
   %end
   %integermap attach(%integername q, %integer item)
      %integer cell
      cell = who asl
      error = -106 %and %result == null %if cell = 0
      who asl = who l(cell)
      q = cell %if q = 0
      who l(cell) = who l(q)
      who l(q) = cell
      who(cell) = item
      heads(cell) = 0
      q = cell
      %result == heads(cell)
   %end
   %routine detach(%integername q, %integer item)
      %integer c
      %integername h
      %return %if q = 0
      h == find(q, item)
      %return %if h == null
      c = who l(h)
      who l(h) = who l(c)
      who l(c) = who asl
      who asl = c
      q = 0 %if q = c
   %end
   %routine log off(%integer process)
      %integer j, c
      %integername q, p
      %for j = 1, 1, max logons %cycle
         %if known(j)_process = process %start
            known(j)_process = 0
            q == find(queues, known(j)_queue)
            p == find(processes, process)
            %return %if p == null
            %unless q == null %start
               !restore pending lists
               %while p # 0 %cycle
                  extract(p, c)
                  insert(q, c)
               %repeat
            %finish
            detach(processes, process)
            %return
         %finish
      %repeat
   %end
   %routine close down
      %integer j
      %record(parmfm) p
      %for j = 1, 1, max logons %cycle
         %if known(j)_process # 0 %start
            p_dsno = known(j)_process
            p_dact = 2
            p_ssno = 0
            p_sact = 0
            p_p1 = 0
            p_p2 = 7
            svc(115, p)
         %finish
      %repeat
   %end
   %routine notify owner(%integer queue)
      %record(parmfm) p
      %integer j
      %for j = 1, 1, max logons %cycle
         %if known(j)_queue = queue %start
            p_dsno = known(j)_process
            p_dact = known(j)_dact
            p_ssno = 0
            svc(115, p)
            %return
         %finish
      %repeat
   %end
   %predicate exists(%integer unit, owner, n1, n2)
      %record(parmfm) p
      p_p1 = unit
      p_p2 = owner
      p_p3 = n1
      p_p4 = n2
      p_dact = 18;  svc(20, p);            !status
      errorx = p_p6
      %true %if p_p6 = 0
      %false
   %end
   %routine initialise
      %integer j, n1
      %string(31) temp
      connect queue
      whol(j) = j-1 %for j = 1, 1, max queues
      who asl = max queues
      this block = -1
      queues = 0
      cell asl = 0
      processes = 0

      !create internal queues

      %for j = 1, 1, 255 %cycle
         e == entry(j)
         n1 = e_ownername1;  n1 = 0 %if e_mode = 2
         %unless e_queue # 0 %and %c
            exists(e_ownerunit,e_ownerid,n1,e_ownername2) %start
            link(j) = cell asl;  cell asl = j
            %if e_queue # 0 %and errorx = -1 %start
               unpack(e, temp)
               report(temp." removed")
               e = 0
               write block
            %finish
            %continue
         %finish
         queue head == find(queues, e_queue)
         queue head == attach(queues, e_queue) %if queue head == null
         crash("Q inconsistent") %if error # 0
         insert(queue head, j)
      %repeat
      report("Q full!") %if cell asl = 0
   %end

   notify started
   initialise

   %cycle
      error = 0
      p_sact = 0;  svc(16, p);               !poff
      dact = p_dact&255
      priv = p_dact>>8
      process = (p_ssno&31)!64
      reply sact = p_sact
      ->cqa(dact) %if 0 < dact <= 14
      report("Bad dact")
      error = -101
reply:set error %if error < 0
      p_p6 = error %if error <= 0
      p_dsno = p_ssno;  p_dact = reply sact
      p_ssno = 0
      svc(115, p)
   %repeat

cqa(14):!!offer (in process)
      dact = 2
      sender unit = p_p1;  p_p1 = batch id
cqa(1):!! offer
      queue = p_p1
      error = -102 %and ->reply %if queue <= 0
      get process info;  ->reply %if error # 0

      !check that the file exists

      j = p_p5;  j = 0 %if dact = 2
      %unless exists(process unit, process id, j, p_p6) %start
         error = -112
         ->reply
      %finish

      queue head == find(queues, queue)
      error = -103 %and ->reply %if queue head == null
      cell = new cell
      error = -104 %and ->reply %if cell = 0

      e == entry(cell)
      e_owner unit = process unit
      e_owner id   = process id
      e_owner name1= p_p5
      e_owner name2= p_p6

      e_sender unit = process unit
      e_sender id   = process id
      e_sender name1= p_p3
      e_sender name2= p_p4

      set date and time(e)

      e_queue = queue
      e_priority = 0
      e_mode = dact
      %if dact = 2 %start
         e_sender unit = sender unit
         e_sender id = p_p2
      %finish
      write block

      insert(queue head, cell)
      notify owner(queue)
      ->reply

cqa(2):!! attach

      queue = p_p1
      error = -102 %and ->reply %if queue <= 0
      error = -105
      %for j = 1, 1, max logons %cycle
         known(j)_process = 0 %if known(j)_process = process
         %if known(j)_process = 0 %and error # 0 %start
            error = 0
            known(j)_process = process
            known(j)_dact = p_p2
            known(j)_queue = queue
         %finish
      %repeat

      queue head == find(queues, queue)
      %if queue head == null %start
         queue head == attach(queues, queue)
         ->reply %if error # 0
      %finish

      queue head == find(processes, process)
      %if queue head == null %start
         queue head == attach(processes, process)
      %finish

      %if error = 0 %start
         queue head == find(queues, queue)
         notify owner(queue) %if queue head # 0
      %finish
      ->reply

cqa(3):!! detach

      log off(process)
      ->reply

cqa(11):!! stop

      log off(p_p1)
      ->reply

cqa(12):!! create queue

      queue = p_p1
      error = -102 %and ->reply %if queue <= 0
      queue head == find(queues, queue)
      %if error # 0 %start
         error = 0
         queue head == attach(queues, queue)
      %finish
      ->reply

cqa(4):!! claim

      select queue;  ->reply %if error # 0
      queue head == find(queues, queue)
      proc head == find(processes, process)
      error = -103 %and ->reply %if queue head == null %c
                                %or proc head == null
      extract(queue head, cell)
      error = -107 %and ->reply %if cell = 0
      p_p1 = cell
      insert(proc head, cell)
      ->reply

cqa(5):!! take

      get process info;  ->reply %if error # 0
      proc head == find(processes, process)
      error = -107 %and ->reply %if proc head = 0
      cell = locate(proc head, p_p1)
      error = -108 %and -> reply %if cell = 0
      e == entry(cell)
      transfer file(e, p)
      %if error # 0 %start;            !remove it!!!!!
         extract(proc head, cell)
         return cell(cell)
      %finish
      ->reply

cqa(8):!! request

      p_p1 = 0

cqa(6):!! identify
cqa(7):!! locate

      proc head == find(processes, process)
      cell = proc head
      cell = locate(proc head, p_p1) %if p_p1 # 0
      error = -108 %and ->reply %if cell = 0
      e == entry(cell)
      p_p1 = cell
      %if dact = 6 %start;            !identify
         p_p1 = e_sender unit
         p_p2 = e_sender id
         p_p3 = e_sender name1
         p_p4 = e_sender name2
         p_p5 = e_date
         p_p6 = e_time
         error = 1;         !special flag
      %else %if dact = 7      ;      !locate
         p_p1 = e_owner unit
         p_p2 = e_owner id
         p_p3 = e_owner name1
         p_p4 = e_owner name2
         p_p5 = 0;      !password
         %if e_mode = 2 %start
            p_p5 = p_p3
            p_p3 = 0
         %finish
      %finish
      p_sact = e_mode
      ->reply

cqa(9):!! delete

      proc head == find(processes, process)
      cell = locate(proc head, p_p1)
      error = -108 %and ->reply %if cell = 0
      e == entry(cell)
      extract(proc head, cell)
      return cell(cell)
      delete(e)
      e = 0
      write block
      ->reply

cqa(10):!! reprime

      close down
      initialise
      ->reply

cqa(13):!relay message

      queue = p_p1
      error = -102 %and ->reply %if queue <= 0
      error = -101 %and ->reply %unless 0 < p_p2 <= 6
      %for j = 1, 1, max logons %cycle;      !look for the queue
         %if known(j)_queue = queue %start;  !found
            q = p
            q_dsno = known(j)_process
            q_dact = 2
            svc(115, q)
            ->reply
         %finish
      %repeat
      error = -111
      ->reply

%endofprogram
 H?   & &                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!          `` }            	        NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z     Q Bad dact Q full!Q inconsistent  removed No such file 
No process Queue already exists Transfer fails No such entryQueue emptyQueues fullNo free queueNo free spaceNo such queueInvalid queueIllegal requestUnknown error             Cannot locate potter QUEUE  u			


M
M
J

		
i                                                          	   0 
   9`AH  !34  1  0 !81 !5$$A> rB  @ !4B ";
C@ !$$A> r#$$A> rB  C
B$P#E  E  &Q'1"C  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n2#XC   PC   '4"2$ #PC   '4"?1  34C0  D   D   
C   w ) ,ARp d) L ,AR$0@9 Dr	 D  xq	 Dy  	w ) ,ARp DAr  qy  	g ) ,ARp D&  ,ARr    q  y  	W  p LX  P 4X6 P9 8X P <X P @r	 ,  q	 ,X)   2ARy  &	w p l~i ,Aj ,) L$8A*$@ Nr	 L  q	 LX9 hC0 ,) L$8A*$@ .Ƞ P Dr	 ,  q	 ,XI H#5 4A$V@Y Nr	 L  q	 LXi h#5 TAX dP-X0 A@%1&1P=AX=0  9X dPy  h	w p Lr	 ,  wq	 ,X 4PX9 8P=X HPy  	W  p L $@ .Pi 4PY 8$0P9 <P9 Hr	 ,  q	 ,X H#5ȠPy  $	w p ,X]XmAX#5hAy  	g p LXV Xf AtXB0B$>@9 .$P 4P 8X XJ PI <XZ PY @r	 ,  q	 ,AXi H#5Py  5	w p LX P 40 @9 .r	 ,  q	 ,X H#ȠP#	XI 4PMXY 8P]y  *	g p L$@ .Pj Dr
 ,  q
 ,z  
W  p |NXPI xp P	 tX X< P9 4X P 8X P <XL PI @U=B0 U!>XY  P5 P P PE y Xi  P6 X]PV cA$XmC0&$`PmX  X=P< X]cA X#3C Ƞ @ Nr	 L  q	 LXI  XY `PT $`Pd  ,) L$8A* "@ .Pi DPY Hr	 ,  q	 ,X9 HC0$0#<0#9AȰPC B L) ,$8A*$@ .r	 ,  q	 ,XI H#3C XY DPY l$e@i .$P 4P 8X9  X P <X P @$QPY Dr	 ,  q	 ,XI H#7Xi lA@C vXY DPY p$g@i .X tP @X9 lP9 Dr	 ,  q	 ,X H#C .$@ .XI tPI @XY pPY Dr	 ,  q	 ,Xi H#2#C Xi lAXi pAX H#3C Xi A$0P=X X  XJ PK XZ P[ Xj Pk X P AAC 0	w p ,X!!(
sL  

-,ARy -AR"	-ARC - ARC -ARC -ARC -ARC -ARC -ARC |-ARC l-ARC \-ARC L-~ARC <C 8 	w p 0X$P ,#7Z D<  P=$X ,y  	g p ,Zh DX$  X P$y  	g p LX!4y Pm=XP9 @XP DPi H$@ .r	 ,  q	 ,XI H#5 4AC  ,	w p LXP @X=P9 DXP H$@ .r	 ,  q	 ,XI H#5 4Ay  &	W  p 4X  !6y P ,X9 X <Z  ӫ  P 0Z ,XJ  UI  !9XY 0RZX 4C Xi 0Pc  Ui ,!5C C  8	W  p ,X  !3PV  ZX DX8 DZ6  ӳ  ҵ  X DZ  XI  J  PF  y  #	W  p ,X  !6$0P5  C 8Z DӼ  P  X DZ  Z DK  J  XV  Xi  UV  !6X $0P<  y  .	W  p 0X  !5$y P ,X9 X DZ  ӫ  U  !5X  C XH DZC  T  PS  UY ,!4$C C  /	g p Lr	 ,  q	 ,X X9 @P< $X DP (y  	g p 4VE@ $LPI 0 P ,kA0 0L9 2Z=P=xy  %	w p 0P$0&1P9 ,3Z=XH U!>X ,ZXXJ  PM$PP]#X9 ,0 B0y  -	W  p 0X P ,!:0P=y Z <Ӽ  P X  !5X ,P  XH <ZI ,Z <:  4  X <Z  X ,ҫ  Z ,PZ  XI ,BZH 4$PPT  X ,P  Z 4C  K	W  p 4X  !4y AP 0!2"
X8 <Z1  ӳ  P ,X <Z  Z <K  J  XX <ZY ,Xm e  Xi ,Pm X X<  6!4$0P<  C  >	g p <$&P ,ZXH< U9 B0X ,ZX$@ XI ,CZMXXT  m,A\P 4XY m(ALP 8!4y XY 4]C0 Xi 8X  #<Y 0AXY 0Xi 4A"XY m(AC X , B0ZC  ]	w p P$&P ,ZXH< C08X ,ZXH @ 0$B@I 2$P@Y 4@Y 6PY 8$gPi <r	 0  sq	 0X , B0y  7	g p P$&P LZXX<  U9 B0<X LZXH @ ,XI LCZMXHT @Y .$`@i 0r	 ,  sq	 ,y X L B0"	 9	W  p TPi <PY @X ,P DX9 0P9 HȰ @ 6r	 4  q	 4X PP!5%y $" (	w p TA$&P ,Z <X9 ,'1<  X ,  >$P %P$@PM,PM$PM(T&QPY ,eA
PXa Pi 0H . !4$`Pi 0X1  #?Pg ,X P 0XQ Xa A B0jX DZ ,XM$J  XI ,PM$X]Xe  C0BXB06Y 4XmA' , 4ARtA   A(X-$<A@AvC HX=XS  m,AP0!;XX[  m,AP0X#5dAXY ,Xm0AXY ,P B0XM$!5\Ay  	w P (p LNPH 0p P ,PH 8p P 4NPH @&xP <NPH Hp P DAA6$P@r  q=P=HP HĠ Ơ @PHP3#+0 !(
3sC

RA@PMX]#AXm!#PmH@X=@=$@r  sqC ^$PXP '+KPXP!'@PMC AFX]#3C XmPmX !4$`PmPg ,X=P7 0X]XmA!7ȰPC LX]m,AP0!7ȠPC *AP!7ȐPC aA:PXMPA X]PQ XmPa XP PA  PQ X=P1 XP aAXXP  $@@J ,X]@Z .P !9XmPj  XP AX]Xm0AXmAC ~X=P=!'ȰPC hȠP$&PZXHI UM!9X]SZ]X$`@e XZXH< B0DXC0<$PXZXX]@Z XmcZmXX@ X=3Z=XXP  XŐ B0xX]m,ATP0!>X]m,AP0X#3C X]m(A$P0!9X]m(AVP0XB0X]m,AP0XA  #5XmAfC VXmA2C JXmA&C >X]P]!'`PmC (m,AP0X#<$PX]m,AP0C ApX=#3C X]m,AlP0X]m(A\P4X0Ž#4!7ȠPC ]kAX!7@PMC PYXm4AC A2X]#3C vX]m(AP4Xa  !7PC TX]aAP!70P=C 6aA^P]aARX#;]Xm4APXmAC $PX]m(A|P4X  PXM#7TaAtPX]!7`PmC eAPXPX=0 B0:X  PX PX PX PXA $PMXQ (P]$aPmC @0 B08X PX PX PX P$@PMHQ .P !5PPMHa .@mC X]m(AP4X]aAP!7PC aAP]Xm4AXmAXmAX-$<A@AC ARA~C X=P=!'ȰPC X#$ɠ #'ȐPC ~$@&APMCZMXXT  U]B06-$8A*XmcZmXH @$2@=r  sqC .XM@ B0ȰPC [ X !A  ?X ,$aA@x  !w P (( ,A A" l X !A  ?X ,$`Ax  w P (( ,A A" l X !A  ?X ,$bAx    @   @	             defaultPoptaultPtrustedPcapacityassigntyarrayntyextrantysuppresspartialsdiagsalstimeralsbriefalstracealshideeals              	  .PAS pascal:PRIMS 	imp:PASS3	imp:PASS2pascal:PASS1                
   pd?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nH  !34  1  0 !81 !5$$A> #$$A> &C ?1  34C0                                       $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                X                                                                                                                             STARTUP.COM   1   6                                                                                                                                                                                                                 8                      
              	   
   r          
         	 	 !  
 	  2                              W   H$`[i $QW   TW   HX9 0#8` sW   <#%TW   TW   HW  ,y  G	w ) ,A A l X !A  ?~W   H ,W   HW  ,$ A  ,	w P (A , SX $08 8 8 PxHC  XxH$`W   lX=L< A\X AP8( 8X  A  ( X A  ( x A  h  8W  h  XW  h  xW   X.xA!6!tA  x.nA!6!jA  x.fA!9X8Ɛ P8XH8LPMT8 8( dHAC02W  B0' , 8A  TA" ADC \A  W  B0D' , 8A  A" (A  W  !3C ( 8A  8 (RCA#1X XUB0&' ,A  LA" ( XA  C .8 X$ JBA  !>.FA#8( X@A"  X.<A!8( 8A #AR( A  `XW  W   P< 8$aW   x$bW   x x$bW    $aW   4$cW   $bW   l&W   H 8W   HW   HW   W   HW   HW   W   HW  , W   H XW   H$bW  8W  W  XmPlPh 4$bW   lXh 4lAn$`W   l$aA$bA$aA$bA$cAX8 4<3#C  .A!3C W   P@ $aW   xA( A  $aW   At( A  $bW   W  `,W  W  $aA$aA$bAW   PD $aW   x $bW   x-h XA  W  ` W  W  $`W   lXX C0W   H$QXmXlW   TW   H$QXmdlW   TW   H$QXm\lW   TW   H$QXm`lW   TW   HXXXMdL
X]\\
iX=`<
c$QW   TW   HW  ,X8ð@ C0X@X<P<XHDL[H@PH@W   XXD\PDXX<\$aAXX@\$bAXXD\$cAXh<lX8@<
cVXD
[$`A $aW   $aW   $aW  $`W   lXh 4lABW  x x@     print string ("Incorrect wildcard usage")
      newline
      %stop
   %finish
   hashfile (in1);  hashfile (out1)
   in1 = in1."." %unless in1 -> (".")
   out1=out1."." %unless out1-> (".")
   in1  -> in1 . (".") . in ext;        !Peel off extensions
   out1 -> out1. (".") . out ext
   %if in1 = "*" %start;                !RENAME *.IMP/*.OLD
      ->Bad Wild %unless out1 = "*" %and outext # "*"
      Pack (".".out ext, P_file);  ioutext = P_p4
      Pack (".".in ext, P_file);   iin ext = P_p4
      %for j = 1,1,42 %cycle
         f == D_f(j)
         %continue %if f_name2 = 0 %or iinext&H # f_name2&H
         P_p3 = f_name1;  P_p4 = f_name2
         P_p5 = P_p3;     P_p6 = (P_p4&(\H)) ! ioutext&H
         Rename (P)
      %repeat
   %else %if in ext = "*";              !RENAME FRED.*/JIM.*
      ->Bad Wild %unless out ext = "*" %and out1 # "*"
      Pack (in1,P_file)
      iin1 = P_p3;  iinext = P_p4
      Pack (out1,P_file)
      iout1 = P_p3; ioutext= P_p4
      %for j = 1,1,42 %cycle
         f == D_f(j)
         %continue %if f_name2 = 0 %or f_name1 # iin1 %or
                  "         &         *         .         2 $       $ 6 *       * : 0       0 > 6       6 B <       < F B       B J H       H N N       N R T       T V Z       Z Z `       ` ^ f       f b l       l f r       r j x       x n ~       ~ r         v         z         ~                                                                                                                                      XI p H?    G                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        %begin                                   {*Swoppable ACCOUNTANT process*}
   %external %routine %spec OPEN DA   (%integer chan, flags, %string(31) file)
   %external %routine %spec READ DA   (%integer chan, block num, %name buffer)
   %external %routine %spec WRITE DA  (%integer chan, block num, %name buffer)
   %external %routine %spec CLOSE DA  (%integer chan)
   %external %routine %spec UNPACK    (%record(file fm)%name f,
                                       %string(*)%name s)
   %external %string(72) %fn %spec ITOS (%integer N, places)
   %const %string(31) user account file  = "ACCNT:USERFILE"
   %const %integer file = 1              {DA channel for account file}

   {*System interface: supervisor call numbers*}

   %const %integer Become Accountant = 128,
                                Poff = 16,
                                 Pon = 115,
                           Tell user = 120

   %const %record(*)%name null == 0

   %routine report (%string(63) s)
      %record(parm fm) P
      P_text = s
      P_dsno = 0                         {OPER}
      SVC (Tell user, P)
   %end

   {Format of user account block}

   %const %integer resources = 6         {Room for expansion}
   %record %format account fm (          %c
           %integer unit, owner,         {Packed username}
           %string(31) name,             {Real name}
           %integer when,                {Time of last login/logout}
           (%integer CPU, logons, connect  %or
            %integer %array Usage(1:resources)),
           %integer %array Quota(1:resources),
           %string(15) Aegis,            {Dept/charge code for user}
           %string(63) Address)          {Or any other useful information}

   {Hash table entry indexing account file}
   %const %integer last = 4095           {Size of hash table}

   %record %format user fm  (            %c
           %integer index,               {Pointer to his account block}
                    Packed username)

   %record %format block fm (            %c
           %record(account fm) account   %or
           %record(user fm)%array u(0:63))


   {********** Mapping of virtual arrays onto account file ***********}

   %record(block fm) %map block (%integer N)
      %own %record(block fm) buffer
      %own %integer last block = -1, actual
      %on * %start
         Report (event_message)
         last block = -1
         %result == buffer
      %finish
      %if N # last block %start
         Write DA(file, last block, buffer) %if last block >= 0
         Read DA (file, N, buffer) %if N >= 0
         last block = N
      %finish
      %result == buffer
   %end

   %record(user fm) %map user (%integer N)
      !User list is 64 user-blocks, starting at block zero
      %integer block no = N>>6, offset = N&63
      %result == block(block no)_u(offset)
   %end

   %record(account fm) %map account (%integer N)
      %result == block(N+63)_account
   %end

   %integer %fn find (%integer who, %integer %name exists)
      %integer probe = rem(who, last)    {Primitive hash function}
      %record(user fm) %name u
      exists = 0
      %cycle
         u == user(probe)
         %if u_packed username = 0 %start            {Empty slot}
            %result = probe
         %finish
         exists = 1 %and %result = probe %if u_packed username = who
         probe = rem(last, probe+1)
      %repeat
   %end

   %record(account fm) %map find account(%integer unit, owner)
      %record(file fm) f
      %string(63)      s
      %record(account fm)%name A
      %integer         exists
      %integer         index = find(owner, exists)

      %if exists = 0 %start
         f_unit = unit;  f_owner = owner;  f_N1 = 0;  f_N2 = 0
         Unpack (f, s)
         Report ("Who is ".s."??")
         %result == null
      %finish

      A == account(user(index)_index)
      %if A_owner # owner %start
         Report ("Corrupt file!")
         %result == null
      %finish
      %result == A
   %end

   %routine Logon (%integer unit, owner, when)
      %record(account fm)%name A == find account(unit, owner)
      A_when = when %if A ## null
   %end

   %routine Logoff(%integer unit, owner, when, CPU used)
      %record(account fm)%name A == find account(unit, owner)
      %if A ## null %start
         A_CPU     = A_CPU     + CPU used
         A_Logons  = A_Logons  + 1
         A_Connect = A_Connect + (when-A_when)
         Block(-1) = 0
      %finish
   %end

   %record(parm fm) P, Q
   %switch A(1:4)
   %label REPLY

   SVC (Become Accountant, P)
   Open DA (file, 1, user account file)

   %cycle
      P_sact = 0;  SVC(Poff,P)
      %unless 0 < P_dact <= 4 %start
         Report ("DACT".itos(P_dact,1))
A(3):    P_p1 = -1
REPLY:   P_dsno = P_ssno
         P_dact = P_sact
         SVC (Pon, P)
         %continue
      %finish
      -> A(P_dact)

A(1): {LOGON P1=Unit, P2=Owner, P3=Time of day}
      Logon (P_p1,    P_p2,     P_p3)
      -> REPLY

A(2): {LOGOUT P1=Unit, P2=Owner, P3=Time of day, P4=CPU used}
      Logoff (P_p1,    P_p2,     P_p3,           P_p4)
      -> REPLY

A(4): {Relay message}
      Q = P;  Q_dsno <- P_p6
      SVC (Tell user, P)
      -> REPLY
   %repeat

%end %of %program
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          C!          5 }      ƀ 
  (           NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    `EX!    qI    }@  w@      ;ov           7 G M Q _ u z dQ@    qX`    ox    =p    a}   &     &+-ZM__    M_^    ox    XM`DACT   Corrupt file!?? Who is           ?                           PACCNT:USERFILE 
   H  !34  1  0 !81 !5$$A> 6#$$A> 6&C  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n?1  34C0  D   D   
C H  !34  1  0 !81 !5$$A> 6B  @ !4B ";
C@ !$$A> 6#$$A> 6B  C
B$P#E  E  &Q'1"C 1I2 !,K2  !
3s3B  #9
3
>!$$A> 6!$$A> 6GHO  s/ "B
'X=  2 #$$A> 6&r0U> ?P7D   &D"$2#XC   PC   '4"2$ #PC   '4" w ) ,A A l #!A   ?) t ,A   $0@9 lr	 l  xq	 ly  %	g A , Py ,C  Xy ,XL A%1P=y UmC0TXMB=P7 ,0 P7 0T$aW  hX BȭP ,Ƞ P 0[$aW  \XI PMC  O 	@Pg A , fPi ,X9 0 ?P9 0A8X 0Z
y   	g A , f ?Ay  	W  A , 6#  @$P) ,$0P5  Xi ,AxP 0X !6X ,y U !9X  $APJ  X ,"XY ,&Q0#  %P) ,C  ;	W  A , "Y Xi  ApP X B0\X9 P9 ,X  P 0$P 4P 8Y?  <i ,W  ' ,A  <A A A$y aAXa  AP |XA UI  #8A$C C  Z	W  A 0 A:P 0#5X ,P (y  	W  A 4 AP 4C0.X 0Q ,$1Q1 0X ,[ (Z 4P 4%aAl!0 A
y  *	w P (A , r ,  q ,$QeW  P$@ 2r ,  q ,H8 .#%0 C X$QcW  ' ,A ',A  ,A A%P 4H 0@ ,H 2@ .r ,  sq ,C h.AXH <PG ,XX 8Xh 4AC XX <PW ,Xh @Pg 0XX 8Xh 4AC  ,( L$8AX H@ Lr ,  xq ,C xC   8e ` e %PX=`P9 X #3C Xi DAlC dȭP 4A@ @XH 4P  $PPX PX PX Xm(#>aA;A=6X H$0@< lA-bAX ,P ,XY  $`A#C Xh `??  APX(C0JX=pU=4!>X Dӫ B0.HM$@  B0"H]$P @#; !8` 2A.$`A@AC "Xm8` #4$`AX< #5$PeAX9 Dӳ V ҳ ` A/6AX B0XH @ #7BZM$PPT  %aQm(XdZ(<  P8 C RAX pY`##P`X Š!7XM`PI TC *X]`&SPP]`A" $P$aW  x  A&W   P C @A=TX HP PA<X9 HH C0JA=TA<Xi HA;xXi HA:H$aA@ ^X]TP$P ,$@PG 0Xh A<DXY L$`@e A<$RXi HA@ J$SXi PA@ DXhZ l  A.*W   P C A<X=P2Z8 LX LP@XPZ LXI HPJ  C rH]P C0*A<Xi HAXi Hf A
$P ,P ` A&C 8$`A;X9 L$ҳ $ң C XH PH W   P XX P AB0,Xi DPh 4X ,P ,XY  %bA@ X9 xV8 P9 xC 0P B!3C hP C#6`AM45AtXTY p##P pX lPTC %PlXI ,PG ,XY  XmhA@ C |$PP]l                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       XI PI C L&API DZH ,PH <%QQX Xh dZh ,Ph 8&$4A$ 4 0 `     f_flag = -1 %and %return %if size < 0
      connected = connected + 1
      f_chan = connected
      open DA (f_chan,read only,f_name) %if f_name # ""
      %monitor %if f_chan > max con
      base(f_chan) = free VM;  f_top = free VM
      f_lim = free VM + 512*size
      free VM = free VM + 512*(size + f_flag)
      %if f_flag # 0 %start;              !mark extra pages as 'in file'
         set bit (j-1) %for j = f_top>>9 + size, 1, free VM>>9 - 1
      %finish
      f_flag = 0
      f_VM top = f_top; H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        {Program to statically apply relocation information to locations in GLA}
{Particularly for standalone programs such as spoolers, test programs etc}

%option  "noopen"
%begin
   %include "sysinc:parmfm.inc"
   %include "sysinc:command.inc"

   {Dirty assumptions}
   %recordformat  hdfm(%short  base,n)
   %recordformat  headfm(%short pure size, gla size, code disp, lit disp,
                                registers, mainep,
                         %record(hdfm) reloc, defs, specs, ldiag, vdiag)

   %owninteger    CODE SEG = 15,
                   GLA SEG = 14,
                  CODE OFFSET = x'10'

   %string(31)    root name = COMMAND_in1


   {DA i/o support}
   %owninteger  DA KEY = 0
   %owninteger  CURRENT BLOCK = -1, DIRTY = 0
   %integer     gla start   {so CODE OFFSET can be allowed for automatically}
   %byteintegerarray  block(0:511)
   %constinteger da read = 9,  da write = 10
   %routine  OPEN DA(%string(31)  fd)
      %record(parmfm)  p
      string(addr(p_sact)) = fd;  svc(17,p)      {pack fd}
      %if p_p2 < 0 %start
         print string(fd." ??".SNL)
         %stop
      %finish
      p_p5 = -1   {permit write but not auto-extend}
      p_dact = 6;  svc(20,p);   {open da}
      DA KEY = p_p5
      %if p_p6 < 0 %start
         print string("Open da: ".fd."  ".string(addr(p_p1)).SNL )
         %stop
      %finish
   %end
   %routinespec  write da(%integer  block no)
   %routine  CLOSE DA
      %record(parmfm)  p
      write da(current block) %if dirty # 0
      current block = -1
      p_p5 = DA KEY
      p_dact = 11; svc(20,p)
      DA KEY = 0
      %if p_p6 < 0 %start
         print string("Close da: ".string(addr(p_p1)).SNL )
         %stop
      %finish
   %end
   %routine  READ DA(%integer  block no)
      %record(parmfm)  p
      p_p4 = addr(block(0))
      p_p5 = DA KEY
      p_p6 = blockno
      p_dact = da read;  svc(20,p)
      %if p_p6 < 0 %start
         print string("DA read: ".string(addr(p_p1)).SNL )
         %signal 15,15
      %finish
   %end
   %routine  WRITE DA(%integer  block no)
      %record(parmfm)  p
      p_p4 = addr(block(0))
      p_p5 = DA KEY
      p_p6 = block no
      p_dact = da write;  svc(20,p)
      %if p_p6 < 0 %start
         print string("DA write: ".string(addr(p_p1)).SNL )
         %signal 15,15
      %finish
   %end

   %integerfn  HALF WORD(%integer  address)
      %integer  this block, disp
      %signal 15,15 %if address&1 # 0
      address = address + code offset %if address < gla start-code offset
      this block = address >> 9
      disp = address & 511
      %if current block # this block %start
         write da(current block) %if dirty # 0
         dirty = 0
         read da(this block)
         current block = this block
      %finish
      %result = short integer( addr(block(disp)) )
   %end
   %integerfn  WORD(%integer  address)
      %signal 15,15 %unless address&3 = 0
      %result = ( halfword(address)<<16) ! halfword(address+2)
   %end
   %routine  STORE WORD(%integer  word, address)
      %integer this block, disp
      %signal 15,15 %unless address&3 = 0
      address = address + code offset %if address < gla start-code offset
      this block = address >> 9
      disp = address & 511
      %if current block # this block %start
         write da(current block) %if dirty # 0
         read da(this block)
         current block = this block
      %finish
      dirty = 1
      integer( addr(block(disp)) ) = word
   %end

   %routine  RENAME (%string(31)  old name, new name)
      %record(parmfm)  old,new
      string(addr(old_sact)) = old name
      string(addr(new_sact)) = new name
      svc(17,old);  svc(17,new)
      %signal 15,15 %if old_p2 < 0 %or new_p2 < 0
      old_p5 = new_p3
      old_p6 = new_p4
      old_dact = 15;  svc(20,old)
      %if old_p6 < 0 %start
         print string("Rename failed"); newline
      %finish
   %end

   %constinteger  H = x'FFFF'

   %integer   code base = code seg<<16 + code offset,
              gla  base = gla  seg<<16

   %integer   code rel, gla rel
   %integer   k, p, rel, count
   %record(headfm)  head
   %string(31)  object file = root name . ".EXE"

   {initialise}
   open da(object file)
   read da(0)
   head = record( addr(block(code offset)) )
   %if head_registers # x'7DEF' %start
      print string("** ".object file." not an object file ?")
      newline
      close da
      %stop
   %finish

   code rel = code base + (head_code disp&H)*2
   gla rel  = gla  base
   gla  start = (head_pure size*2 + code offset + 511) & (\511)

   p = (head_reloc_base&H)*2
   count = head_reloc_n&H

   %while count > 0 %cycle
      rel = halfword(p)
      k = gla start + (rel>>1)<<2
      %if rel&1 # 0 %start
         store word( word(k)+code rel, k )
      %else
         store word( word(k)+gla  rel, k )
      %finish
      p = p+2
      count = count-1
   %repeat

   close da
   rename(root name.".EXE", root name. ".ABS")
%endofprogram
 H?   
 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     	 C!          P }                    NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    %Qv          B   a!       ,"  a ! a      8"   A!      C"   A!      O" a    a      ]!    a" a      a    pB  !  !     ng!C a aa   A A b  !  A   B A! "  dQ@    D"Z 	`EX!     ,&    Ld    w@   ,d    	qI     o]   ,d    }@   o]   ,d    24)'q    q[v   ,~Iw^C   0{d  *      q[v   yq_`   *   q[v   ,~Iw^C   0{d  qVM     ,_W@   LX_W@   l_   X_   ox    $h%Qv   t"=+  x-w|!(}}  ,r1R  3#(qV}\^Cz L-ys   hw   l-@   p"K    t-qT xD   |d    qT   -Z 2  ^&@ eAbXh.ABS .EXE  not an object file ?** .EXE Rename failed
DA write:  	DA read: 
Close da:     	Open da:  ??                          A
   P?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nH  !34  1  0 !81 !5$$A> #$$A> &C ?1  34C0  D   D   
C H  !34  1  0 !81 !5$$A> B  @ !4B ";
C@ !$$A> #$$A> B  C
B$P#E  E  &Q'1"C X# Y !Y !&\ Z  B!$$A> З  $1$H  H X [ &B0P  [ ,&' ?P  
*&30H  P  ї  C Kї  $$A> 
Y  #%$$A> 
qPr  PB &(pX  ?$PS?PE   &T 4A> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$2#XC   PC   '4"X w ) ,A AZ L X !A  ) R ,A r	 L  q	 LX9 X<3C6' , ,A A" A" W   H$ AV%P d$@ Nr	 L  q	 LXI dLPMXY h\UCJ' ,A  ,A" A"  TA" A" W   H$ AVy  	w AZ , X X=#5XmA %PXP D$K@I .r	 ,  q	 ,$PP]Xi HlfC6' ,A  4A" A" W   H$ AVy  J	g AZ , X $8 `AP @XMPI DPi H$Y@Y .r	 ,  q	 ,Xi HlfC6' ,A  4A" A" W   H$ $AVy  F	g AZ , X $8 `AP @XMPI DPi H$Z@Y .r	 ,  q	 ,Xi HlfC6' ,A  4A" A" W   H$ $AVy  F	g AZ , X ` #6$ $AVX8 L<[=|	c#Zm|Pi iPi ,X İP 0XC0*XM#4jA$PP]Xi ,lAtXi ,lPmX 08 `AH  y  O	g AZ , X ` #6$ $AVA<Xi &bP ,A.X9 ,0 P 0V 0y  (	W  AZ , X P #6$ $AVX8 L<[=|	S#Z]|PY  YPY ,X  İP 0XC0$XM#4jA$Xi ,lAXY ,\P]$aPmX 08 `AX P  y  Q	w ) LA AZ l +X !A  ) r ,A )  LA r	 l  q	 lr	   q	 X9 x<3!X #$ $AVX P XI LPI $_@Y nr	 l  q	 lXi lf#W   HW  ,y  g	w P (AZ , 2X ( ,X=p<  A  H P$0P4 ȰP A  ( `AX=t0 Z=|P8 hXx P l' , ,A  A" ( A  A\$`AX|8 `A( $8AH Š}C0D' ,A  A" rA" W   HW  ,A $ AVH   
Z hP pXH lPH tHX 
UZ]|e` Ph LH8 0  
3P8 |H   P X C Xh |lA8P X L
P xXH @ C0"iAaXX p\
eXX x\AC iAaX8 t<
cXX x\AX |&P |X 'P C dA' L ,A  lA" ' ,A  'L ,A  fA" A x  " ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nH  !34  1  0 !81 !5$$A> #$$A> &C ?1  34C0  D   D   
C H  !34  1  0 !81 !5$$A> B  @ !4B ";
C@ !$$A> #$$A> B  C
B$P#E  E  &Q'1"C s_  eX!34RUUh!34dffз  ӳ  Ű !4Գ #9    !8 !5$$A>                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                   @ DA=T$RXi HA@ D$QXi A<` A.*X=(P=dC (AP 8W   P AP XT&İP &PTX P ,XI                                      $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                .X=4P=pC AjP 8W   P AjP X`&İP &P`X P ,XI PG 0$X$bA&$QPW ,$\Xi A@ B`XhPi 0A H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        !!!!! 20-AUG-80

!!! Card reader spooler interfacing directly to CR demon

%begin
%constinteger  SUB = '?';   ! replaces untranslatable card codes
%conststring(1) snl = "
"

%recordformat  parmfm(%shortinteger  dsno, dact, ssno, sact,  %c
                      %integer  p1, p2, p3, p4, p5, p6)
%recordformat   buffm(%shortinteger  dsno, dact, ssno, sact,  %c
                       %byteintegerarray  b(1:24) )

%constinteger line limit = 161
%string(161)  line
%shortintegerarray  cardbuff(1:80)
%record(parmfm)  p, fdr
%record(buffm)   text
%integer  tp
%owninteger  binary = 0
%integer  job type
%string(23)  user process, file name, password
%string(23)  s
%integer  unit, user, pass
%byteintegerarray  buff(0:511);  %integer  bp

%integer  temp file, file key, error, skipping, delete flag
%integer  j, k, sym, term

%constinteger  LINK READ = 3;   ! input request to link demon
%constinteger  EOT = 4
%constinteger  INITIALISE = 1;   ! must be 1 for 'STARTUP' program (q.v.)
%constinteger  COMMAND  = 2
%constinteger  GET = 3
%switch  act(INITIALISE:GET)

! packed names:
%constinteger  BATCH = 2566987, SELF = 1253847, LP=604 , PP=608 , CR=669
%constinteger  OPER  = 1007883
! BEL control characters in strings
%conststring(1)  squeak = "";   ! one BEL
%conststring(3)  blast  = "";   ! three BEL's

%routine  report(%string(23) s)
%record(parmfm)  p
   string(addr(p_p1)) = s
   p_dsno = 0
   svc(120,p)
%end


%predicate  spooler(%integer  user name)
   %true %if user name = LP %or user name = PP
   %false
%end

%routine  pack(%string(31)  fd, %record(parmfm)%name  p)
   string(addr(p_sact)) = fd
   svc(17,p)
%end


%routine  transvest
%record(parmfm)  p
   p_p1 = unit
   p_p2 = user
   p_p3 = pass
   p_p6 = 0
   p_dact = 27;  svc(20,p);    ! become
   %if p_p6 < 0 %start
      report("tranvest:".string(addr(p_p1)))
      %signal 15,15
   %finish
%end

%routine  revert
%record(parmfm)  p
   p_dact = 27;  p_p2 = 0;  p_p6 = 0;  svc(20,p)
   %if p_p6 < 0 %start
      report("revert:".string(addr(p_p1)))
      %signal 15,15
   %finish
%end

%integerfn  opened output
%record(parmfm)  p
   p_dact = 25;  svc(20,p);   ! unique file
   temp file = p_p4
   p_p3 = 0;      ! packed CR
   p_dact = 5;  svc(20,p);      ! open output
   %if p_p6 < 0 %start
      report("open:".string(addr(p_p1)))
      p_p5 = 0
   %finish
   %result = p_p5
%end

%routine  write buffer
%record(parmfm)  p
   p_p4 = addr(buff(0))
   p_p5 = file key
   p_dact = 8;  svc(20,p);   ! sequential write
   %if p_p6 < 0 %start
      report("write:".string(addr(p_p1)))
      %signal 15,15
   %finish
%end

%routine  put(%integer  sym)
   buff(bp) = sym;  bp = (bp+1)&511
   write buffer %if bp = 0
%end

%routine  insert(%string(63)  s)
%integer  j
   put(charno(s,j)) %for j = 1,1,length(s)
   put(nl)
%end

%routine  close file
%record(parmfm) p
   put(EOT) %until bp = 0
   p_p5 = file key;  p_dact = 11;  svc(20,p);   ! close
   %if job type = 1 %and %not spooler(user) %start;   ! //FILE (to user file)
      %if delete flag # 0 %start
         p = fdr
         p_dact = 14;  svc(20,p);   ! delete
         delete flag = 0
      %finish
      p_p3 = 0;  p_p4 = temp file
      p_p5 = fdr_p3;  p_p6 = fdr_p4
      p_dact = 15;  svc(20,p);   ! rename
   %else
      p_dact = 1;                  ! normal offer
      p_p3 = fdr_p3;  p_p4 = fdr_p4
      p_p5 = 0;  p_p6 = temp file
      %if job type # 1 %start;      ! //JOB, //OS32
         p_p1 = BATCH
         %if user process # ":" %start
            p_dact = 14
            p_p1 = unit;  p_p2 = user;  p_p5 = pass
         %finish
      %else;                        ! //FILE (to output spooler)
         p_p1 = user
      %finish
      svc(22,p);                     ! offer
      %if p_p6 < 0 %start
         report("offer:".string(addr(p_p1)))
         %signal 15,15
      %finish
   %finish
   file key = 0;   ! to inhibit any further 'close' attempts
%end;   ! close file

%routine read card and convert
%record(parmfm)  p;  %integer  bytes
   %routine  convert
   ! implied (global) parameters:
   !   %shortintegerarray  cardbuff(1:80)    : input card image
   !   %integer  bytes                        : byte length of input
   !   %string(160) line                      : output string
      %integer  conv1, conv2, char
      %integer  j,k,n
   ! Hollerith 'zone' table
   %constbyteintegerarray HZTAB(0:7) =
                               x'00',x'01',x'04',x'FF',x'05',x'FF',x'FF',x'FF'
   ! Digit Table
   %constshortintegerarray  DTAB(0:8) =
         x'0000',x'0100',x'0080',x'0040',x'0020',x'0010',x'0008',x'0004',x'0001'
   ! Ascii Table
   %constbyteintegerarray  ATAB(0:71) =
         X'20',X'30',X'38',X'59',X'2D',X'26',X'51',X'48',
         X'31',X'2F', SUB , SUB ,X'4A',X'41',X'5C', SUB ,
         X'32',X'53',X'3A',X'20',X'4B',X'42',X'21',X'5B',
         X'33',X'54',X'23',X'2C',X'4C',X'43',X'24',X'2E',
         X'34',X'55',X'40',X'25',X'4D',X'44',X'2A',X'3C',
         X'35',X'56',X'27',X'5F',X'4E',X'45',X'29',X'28',
         X'36',X'57',X'3D',X'3E',X'4F',X'46',X'3B',X'2B',
         X'37',X'58',X'22',X'3F',X'50',X'47',X'5E',X'5D',
         X'39',X'5A', SUB , SUB ,X'52',X'49', SUB , SUB 
   
      %if (binary = 0 %and bytes # 160) %or bytes&1 # 0 %start
         report("card columns??")
      %finish
      n = bytes>>1
      %if binary = 0 %start
         n = n-1 %until n = 0 %or cardbuff(n) = 0
         %for j = 1,1,n %cycle
            char = cardbuff(j)
            %if char = 0 %start
               char = ' '
            %else
               conv2 = hztab(char>>9)
               char = sub %and -> DUMP CHAR %if conv2 = 255
               conv2 = conv2 ! (char&2);      ! insert row 8 into zone
               char = char & x'01FD';         ! strip zone bits and row 8
               conv1 = 9
               %cycle
                  conv1 = conv1-1;   char = sub %and -> DUMP CHAR %if conv1 < 0
                  %exit %if char = dtab(conv1)
               %repeat
               conv1 = conv1*8
               char = atab(conv1+conv2)
            %finish
   DUMP CHAR:                        ! jump to here on error
            length(line) = length(line)+1;  charno(line,length(line)) = char
         %repeat
         line = line.snl
      %else;                  ! binary mode
         k = 0
         %for j = 1,1,n %cycle
            char = cardbuff(j)
            charno(line,k+1) = (char>>8)&63 + '!'
            charno(line,k+2) = char&63 + '!'
            k = k+2
         %repeat
         length(line) = k
      %finish
   %end;         ! convert
!********* read binary card image into CARDBUFF(1:80)***********
   convert
%end;            ! read card and convert

%integerfn  code for(%string(5)  s)
%conststring(5)%array job type(0:3) =
      "END ", "FILE", "JOB ", "OS32"
%integer  j
   %for j = 0,1,3 %cycle
      %result = j %if s = job type(j)
   %repeat
   %result = -1
%end

%routine  decode params
%integer  t
   %string(63)%fn  item
   %string(63)  s
      s = ""
      %cycle
         t = t+1
         %exit %if t >= length(line);   ! can ignore last character
         sym = charno(line,t)
         %exit %if sym = ':' %or sym = ','
         s = s.tostring(sym) %if sym # ' '
      %repeat
      %result = s
   %end
   user process = "";  filename = "";  password = ""
   error = 0
   t = 7-1;               ! past job type word
   user process = item.":";   ! **** the logic here needs checking ****
   %if sym = ',' %start
      file name = ""
   %else
      file name = item
   %finish
   error = 0
   password = item
   delete flag = 0;  delete flag = 1 %if item = "DELETE"
   pack(user process.filename,fdr)
   error = 1 %and %return %if fdr_p2 < 0
   pack(password.":",p);  pass = p_p2
   pack(user process.password,p);  unit = p_p1;  user = p_p2
   %return %if spooler(user)
   %if password # "" %start
      p_dact = 21;  svc(20,p);   ! find user
      %if p_p6 < 0 %or p_p3 # pass %start
         %if p_p6 < 0 %start
            report(blast."no user ".user process)
         %else
            report(blast."password for ".user process)
         %finish
         error = 1
      %finish
   %finish
%end

!      ======= start here ==========
act(INITIALISE):   ! ***** a frig up meantime *****
   p_p1 = 19;  svc(122,p);   ! uninhibit link
act(COMMAND):
      -> startup

WAIT:
   %cycle
      p_sact = 0;  svc(16,p);   ! poff(0,p)
      -> act(p_dact) %if 0 < p_dact <= GET
      report("bad dact")
   %repeat

STARTUP:
   skipping = 1
   file key = 0
   delete flag = 0
   job type = 0
   bp = 0
   tp = 25
   term = nl
   report("CR initialised")

   %cycle
      %cycle
         read card and convert
         %if binary # 0 %start
            %exit %if charno(line,1) = '/' = charno(line,2)   %c
                                          %and charno(line,3) # nl
         %finish
         %if skipping = 0 %start
            put(charno(line,j)) %for j = 1,1,length(line)
         %finish
      %repeat
      skipping = 1
      close file %if file key # 0
      revert;      ! N.B. may not actually do anything
      bp = 0;         !  --- initialise output buffer pointer ---
      charno(line,length(line)) = ' ';      ! splat NL
      line = line." " %while length(line) < 6
      report(squeak.line);   ! * for operator's edification
      job type = code for(substring(line,3,6))
      %if job type <= 0 %start;      ! error, //END
         report(blast.substring(line,1,6)) %if job type < 0
         %continue;      ! skip this job
      %finish
      decode params
      %continue %if error # 0
      skipping = 0
      %if job type # 1 %start;      ! //JOB, //OS32
         transvest %if user process # ":"
         file key = opened output
         insert("OS32MT") %if job type = 3
      %else;                        ! //FILE
         transvest %if %not spooler(user)
         file key = opened output
      %finish
   %repeat
%endofprogram
 H?    &                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!             }T            
  T      NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z       6| 	OS32MT :CR initialised bad dact password for no user  DELETE   END rFILErJOB rOS32r               offer: :write: open:revert:	tranvest:  bl                         	
   9 H  !34  1  0 !81 !5$$A> rB  @ !4B ";
C@ !$$A> r#$$A> rB  C
B$P#E  E  &Q'1"C  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n$A1    0#
#	QD   RD   ?&A'"3  $$A> r    !8 !5$$A> r"#&!2#C$$A> r
!  1  #C   C  '1"A> r2#XC   PC   '4"?1  34C0  D   D   
C   w ) ,Ap d) L ,A$0@9 Dr	 D  xq	 Dy  	g p ,`\#4``!5%y $" 	g p L&  ,Ar    q  y  	w p LXP 4X8P9 8XP <$P H@ @I .r	 ,  q	 ,XY HC&' ,A 4A   A$ $Ay  :	w p L @ .$0P9 8P9 Hr	 ,  q	 ,X HC&' ,A 4A   A$ $Ay  0	w p L @ .r	 ,  q	 ,X9 @P8$P <$@ .r	 ,  q	 ,XI HC"' ,A 4A   A>$PPY DX Dy  ;	w p LXP @X8P9 D$@ .r	 ,  q	 ,X HC&' ,A 4A   A$ $Ay  2	g p ,XZl  X8&10P8!3Ary  	w ) ,Ap t2  P9 p$@PI l#&API lY ,
Te  AXI lUI p >$jAy  (	w p L$dAlX#2"X8P9 D$@ .r	 ,  q	 ,X4Š B0nXhA6B0bXHC0& ) ,$8A$^@Y .r	 ,  q	 ,$`Ph$P <X8P9 @X P DXP H$O@I .r	 ,  q	 ,C $Q@Y .Xh Pi <XP @$0P9 DXP HX4C0:@ '+KPI 48.A*C0$^@Y .X8P9 4XHPI 8XXPY D#XHPI 4r	 ,  q	 ,XY HC&' ,A 4A   A$ $A$`Phy  	w ) ,Ap 8%1&1P9 4$Z\ ,+A*!6X 4y X9 40 B0%"
 &	w p l$ ,$1Q9 ,X ,H ,	!C 6X ,
[e  Ph` :#4` ,!2#`  #9 ,&jL  , ,C  ,  ?ATz  9
w p 0$8PhP$6P9 ,Ah' ,A(8 ,AȰ :Ӣ  &ҲJ   Ң  XH@ ,!5$PXP#A*(PA$`PhA(hA$PA' ,A.fA*!4$1P8' ,8APA   h AX #$Py ' ,hA@ :R  &QBE   R  h AXh Ph' ,8AhA   h A^X PX8 P8cA"#3C ӸhC0Ƞ @ r   q XH !XX UXC0\DC*' ,A\A   8A   AC &' ,ANA   8A   A\$aPhC   	w P (pNPHp P P r   zq C 8$0@8 r   q H #+ɰ !(
sK

DAC $P$PPP4P@ PH0$ZPX4A$`PhX0 B0.$3@8 @8 r   q C n ($8A$P0X0ZPʨӚ  P$AQH0X]X!=Ð #:Đ ?P`  Ph#PHX #4&P8 ,
<Xҳ  %QX!2#C U!2#C N ,@ /X -E!<h .F!8 / 
#3C :XhB0. ,P$0P8#&1P8ȸ ,
k  AX8U8 >C $PX#3AFA$@PHX ,h ,
V    8 ,0 #Ȱ  &1ҸC  ,8 ,"' ,A ,A   A4$6 ,$#Abp,ADp,P4B <C4$6 ,$!Ab' ,PAXA   p,Ap,C dAX#3C V$PXH4@ C0.8.2A*#3A0A PXX4P !5*A#XhA!3AAPC rX: H Ű !7XZ 4Xj A$@PMlXZ <PX z 
g p 0XZ  AX   #5 B0rP ,X;  P  ZXL  @ C0"XZ  RZ]                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                                  	P B00%QQX Xh Yi ,!&`DFV1AdZh ,Ph 4&$4AC 6Y !`DFV2AZ ,P 4X Y ,#*P ,$1P: D                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                h    O N   S O  T P   K Q   U R  U S  U T  V U   W V  X W    X   Y Y  J Z   [ [  ! \    ]   ] ^  \ _    ` = k + 1 %while char no(x,k) # '_'
               Write (j,2)
               Spaces (6-k)
               Print string (x)
               P_p3 = P_p3+1 %if P_p3&1 # 0 {round up odd figures}
               Write (P_p3>>1, k-length(x)+11)
               k = P_p6>>16;  P_p6 = P_p6&x'FFFF'  {P_p6: Debt<<16+console}
               %if P_p6 = 0 %then spaces(6) %else write(P_p6,5)
               Print (P_p5/1000, 7, 1)
               Write (P_p4&7, 3)         {Contingency level}
               Write (P_p4<<1>>9, 5)                                      $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                                  	                                                                                                         H?    ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    { Card reader spooler interfacing to 5/16 front end. }

{Modified at PARMFM below to compile with new compiler}
%begin

%recordformat  parmfm(%shortinteger  dsno, dact, ssno, sact,  %c
                     (%bytearray  b(1:24)  %or %integer P1,P2,P3,P4,P5,P6) )

%constinteger line limit = 161
%string(161)  line
%record(parmfm)  p, fdr
%record(parmfm)   text
%integer  tp
%owninteger  binary = 0
%integer  job type
%string(23)  user process, file name, password
%string(23)  s
%integer  unit, user, pass
%byteintegerarray  buff(0:511);  %integer  bp

%integer  temp file, file key, error, skipping, delete flag
%integer  j, k, sym, term

%constinteger  LINK READ = 3;   ! input request to link demon
%constinteger  EOT = 4
%constinteger  INITIALISE = 1;   ! must be 1 for 'STARTUP' program (q.v.)
%constinteger  COMMAND  = 2
%constinteger  GET = 3
%switch  act(INITIALISE:GET)

! packed names:
%constinteger  BATCH = 2566987, SELF = 1253847, LP=604 , PP=608 , CR=669
%constinteger  OPER  = 1007883
! BEL control characters in strings
%conststring(1)  squeak = "";   ! one BEL
%conststring(3)  blast  = "";   ! three BEL's

%routine  report(%string(23) s)
%record(parmfm)  p
   string(addr(p_p1)) = s
   p_dsno = 0
   svc(120,p)
%end


%predicate  spooler(%integer  user name)
   %true %if user name = LP %or user name = PP
   %false
%end

%routine  pack(%string(31)  fd, %record(parmfm)%name  p)
   string(addr(p_sact)) = fd
   svc(17,p)
%end


%routine  transvest
%record(parmfm)  p
   p_p1 = unit
   p_p2 = user
   p_p3 = pass
   p_p6 = 0
   p_dact = 27;  svc(20,p);    ! become
   %if p_p6 < 0 %start
      report("tranvest:".string(addr(p_p1)))
      %signal 15,15
   %finish
%end

%routine  revert
%record(parmfm)  p
   p_dact = 27;  p_p2 = 0;  p_p6 = 0;  svc(20,p)
   %if p_p6 < 0 %start
      report("revert:".string(addr(p_p1)))
      %signal 15,15
   %finish
%end

%integerfn  opened output
%record(parmfm)  p
   p_dact = 25;  svc(20,p);   ! unique file
   temp file = p_p4
   p_p3 = 0;      ! packed CR
   p_dact = 5;  svc(20,p);      ! open output
   %if p_p6 < 0 %start
      report("open:".string(addr(p_p1)))
      p_p5 = 0
   %finish
   %result = p_p5
%end

%routine  write buffer
%record(parmfm)  p
   p_p4 = addr(buff(0))
   p_p5 = file key
   p_dact = 8;  svc(20,p);   ! sequential write
   %if p_p6 < 0 %start
      report("write:".string(addr(p_p1)))
      %signal 15,15
   %finish
%end

%routine  put(%integer  sym)
   buff(bp) = sym;  bp = (bp+1)&511
   write buffer %if bp = 0
%end

%routine  insert(%string(63)  s)
%integer  j
   put(charno(s,j)) %for j = 1,1,length(s)
   put(nl)
%end

%routine  close file
%record(parmfm) p
   put(EOT) %until bp = 0
   p_p5 = file key;  p_dact = 11;  svc(20,p);   ! close
   %if job type = 1 %and %not spooler(user) %start;   ! //FILE (to user file)
      %if delete flag # 0 %start
         p = fdr
         p_dact = 14;  svc(20,p);   ! delete
         delete flag = 0
      %finish
      p_p3 = 0;  p_p4 = temp file
      p_p5 = fdr_p3;  p_p6 = fdr_p4
      p_dact = 15;  svc(20,p);   ! rename
   %else
      p_dact = 1;                  ! normal offer
      p_p3 = fdr_p3;  p_p4 = fdr_p4
      p_p5 = 0;  p_p6 = temp file
      %if job type # 1 %start;      ! //JOB, //OS32
         p_p1 = BATCH
         %if user process # ":" %start
            p_dact = 14
            p_p1 = unit;  p_p2 = user;  p_p5 = pass
         %finish
      %else;                        ! //FILE (to output spooler)
         p_p1 = user
      %finish
      svc(22,p);                     ! offer
      %if p_p6 < 0 %start
         report("offer:".string(addr(p_p1)))
         %signal 15,15
      %finish
   %finish
   file key = 0;   ! to inhibit any further 'close' attempts
%end;   ! close file

%integerfn  code for(%string(5)  s)
%conststring(5)%array job type(0:3) =
      "END ", "FILE", "JOB ", "OS32"
%integer  j
   %for j = 0,1,3 %cycle
      %result = j %if s = job type(j)
   %repeat
   %result = -1
%end

%routine  decode params
%integer  t
   %string(63)%fn  item
   %string(63)  s
      s = ""
      %cycle
         t = t+1
         %exit %if t >= length(line);   ! can ignore last character
         sym = charno(line,t)
         %exit %if sym = ':' %or sym = ','
         s = s.tostring(sym) %if sym # ' '
      %repeat
      %result = s
   %end
   user process = "";  filename = "";  password = ""
   error = 0
   t = 7-1;               ! past job type word
   user process = item.":";   ! **** the logic here needs checking ****
   %if sym = ',' %start
      file name = ""
   %else
      file name = item
   %finish
   error = 0
   password = item
   delete flag = 0;  delete flag = 1 %if item = "DELETE"
   pack(user process.filename,fdr)
   error = 1 %and %return %if fdr_p2 < 0
   pack(password.":",p);  pass = p_p2
   pack(user process.password,p);  unit = p_p1;  user = p_p2
   %return %if spooler(user)
   %if password # "" %start
      p_dact = 21;  svc(20,p);   ! find user
      %if p_p6 < 0 %or p_p3 # pass %start
         %if p_p6 < 0 %start
            report(blast."no user ".user process)
         %else
            report(blast."password for ".user process)
         %finish
         error = 1
      %finish
   %finish
%end

!      ======= start here ==========
act(INITIALISE):   ! ***** a frig up meantime *****
   p_p1 = 19;  svc(122,p);   ! uninhibit link
act(COMMAND):
      -> startup

WAIT:
   %cycle
      p_sact = 0;  svc(16,p);   ! poff(0,p)
      -> act(p_dact) %if 0 < p_dact <= GET
      report("bad dact")
   %repeat

STARTUP:
   skipping = 1
   file key = 0
   delete flag = 0
   job type = 0
   bp = 0
   tp = 25
   term = nl
   report("CR initialised")

   %cycle
      %cycle
         j = 0
         %cycle
            %if tp = 25 %start
               p_sact = GET; p_dact = link read; svc(127,p)
               -> wait
act(GET):
               text = p;  tp = 1
            %finish
            sym = text_b(tp);  tp = tp+1
            %if binary = 0 %and sym&x'80' # 0 %start
               k = sym&63;  sym = ' '
            %else
               k = 1
            %finish
            %cycle
               j = j+1 %if j # line limit
               charno(line,j) = sym
               k = k-1;  %exit %if k = 0
            %repeat
            %exit %if sym = term
         %repeat
         length(line) = j
         %exit %if charno(line,1) = '/' = charno(line,2)   %c
                                          %and charno(line,3) # nl
         %if skipping = 0 %start
            put(charno(line,j)) %for j = 1,1,length(line)
         %finish
      %repeat
      skipping = 1
      close file %if file key # 0
      revert;      ! N.B. may not actually do anything
      bp = 0;         !  --- initialise output buffer pointer ---
      charno(line,length(line)) = ' ';      ! splat NL
      line = line." " %while length(line) < 6
      report(squeak.line);   ! * for operator's edification
      job type = code for(substring(line,3,6))
      %if job type <= 0 %start;      ! error, //END
         report(blast.substring(line,1,6)) %if job type < 0
         %continue;      ! skip this job
      %finish
      decode params
      %continue %if error # 0
      skipping = 0
      %if job type # 1 %start;      ! //JOB, //OS32
         transvest %if user process # ":"
         file key = opened output
         insert("OS32MT") %if job type = 3
      %else;                        ! //FILE
         transvest %if %not spooler(user)
         file key = opened output
      %finish
   %repeat
%endofprogram
 H?    H                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ! Mouses line printer spooler               1-FEB-80

%begin
   %conststring(3)  spooler name = "lp"
   %constinteger  lp demon = 111
   %constinteger max copies = 10
   %constinteger line length = 132, page size = 65
   %constinteger banner lines = 8
   %constinteger  buffmax = 1023;      ! MUST BE 2\\N-1
   %constinteger  max files = 42;      ! SYSTEM CONSTANT

   %recordformat parmfm(%shortinteger dsno,dact,ssno,sact, %c
                         %integer  p1,p2,p3,p4,p5,p6)
   %record(parmfm) p, p2
   %string(29)%name  s

   %ownstring(9) date, time, cdate
   %ownstring(29) file;  %integer  file index, current id
   %integer spooler;         ! PACKED FORM OF NAME

   %constinteger  vt=11, ff=12, cr = 13
   %owninteger  ownername,limit
   %integer  rubbish, error1, error2, copies, active, delete, paused
   %integer lines, pages, lines left
   %constinteger mask = b'0011111000000000'
   %byteintegerarray  discbuff(0:511);  %integer  inbuff
   %integer outbuff
   %integer  bufflim
   %owninteger  ibp,obp, end of line
   %shortinteger  sym, last sym, next state
   %integer  j

! States
   %constinteger  message=1
   %constinteger  command = 2
   %constinteger  accept = 3
   %constinteger  next file = 4
   %constinteger  header = 5
   %constinteger  data in = 6
   %constinteger  flush = 7
   %constinteger  trailer = 8
   %constinteger  close = 9

   %switch  state(message:close)

! Commands

   %constinteger  pause = 1
   %constinteger  continue = 2
   %constinteger  restart = 3
   %constinteger  cancel = 4
   %constinteger  stop = 5
   %constinteger  option = 6;      ! *** not supported ***

   %switch  com(pause:option)



%routine poff(%integer n, %record(parmfm)%name p)
   p_sact = n;  svc(16,p)
%end

%routine  report(%string(31) s)
   %record(parmfm) p
   string(addr(p_p1)) = s
   p_dsno = 0
   svc(120,p)
%end

%string(29)%fn  unpacked(%record(parmfm)%name  r)
   %record(parmfm)  p
   p_p1 = r_p1;  p_p2 = r_p2;  p_p3 = r_p3;  p_p4 = r_p4
   svc(18,p)
   %result = string(addr(p_sact))
%end

%integerfn  packed(%string(29)  s)
   %record(parmfm)  p
   string(addr(p_sact)) = s.":"
   svc(17,p)
   %result = p_p2
%end

%routine  attach spooler
   %record(parmfm)  p
   p_p1 = spooler;  p_p2 = accept
   p_dact = 2;  svc(22,p)
%end

%integerfn  system buffer address
   %record(parmfm)  p
   svc(110,p)
   %if p_p1 < 0 %start
      report("claim buffer failed")
      *=0
   %finish
   %result = p_p1<<16
%end

%routine  accept file
   %record(parmfm)  p
   %integer id
   p_dact = 4;  svc(22, p);         !CLAIM FILE
   id = p_p1;                        !FILE ID
   error1 = 1 %and %return %if p_p6 # 0
   p_p1 = id;  p_dact = 5;  svc(22,p);      ! TAKE
   error1 = p_P6
   report("accept:".string(addr(p_p1))) %if error1 # 0
%end

%routine  get next file
   %record(parmfm)  p
   active = 1
   p_dact = 8;  svc(22, p);      !Request a file
   error2 = p_p6
   active = 0 %and %return %if error2 = -108;    ! none left
   %if error2 >= 0 %start
      current id = p_p1
      p_dact = 6;  p_p1 = current id;  svc(22, p);   !Identify
      error2 = p_p6;  -> FAIL %if error2 < 0
      file = unpacked(p)
      p_dact = 7;  p_p1 = current id;  svc(22, p);   !Locate
      p_dact = 4;  svc(20,p);      ! OPEN SEQUENTIAL INPUT
      file index = p_p5
      error2 = p_p6
      %return %if error2 >= 0
   %finish
FAIL:
   report("Get: ".string(addr(p_p1)))
%end

%routine  close input
   %record(parmfm) p
   p_dact = 11
   p_p5 = file index
   svc(20,p)
   %if p_p6 # 0 %start
      report("close: ".string(addr(p_p1)))
   %finish
%end

%routine  reset input
   %record(parmfm)  p
   p_dact = 12
   p_p5 = file index
   svc(20,p)
   %if p_p6 # 0 %start
      report("reset: ".string(addr(p_p1)))
   %finish
%end

%routine delete file
   %record(parmfm) p
   p_dact = 9;  p_p1 = current id;  svc(22, p);   !Delete
%end

%routine   get block(%integer  next, alt)
   %record(parmfm)  p
   p_dact = 7;  p_p4 = inbuff;  p_p5 = file index;  svc(20,p)
   next state = next
   next state = alt %if p_p6 < 0 %or delete # 0;    ! eof
%end

%routine  put block(%integer then)
   %record(parmfm) p
   p_p2 = obp-outbuff
   p_p1 = outbuff
   p_sact = then
   svc(lp demon,p)
   obp = outbuff
%end

%routine  clear(%integer  n)
   %if obp + n > bufflim %start
      obp = bufflim-n+1
      byteinteger(obp-1) = nl
   %finish
%end

%routine psym(%integer sym)
   %if sym = ff %start
      sym = nl %if lines left = page size
      lines left = page size
   %finish
   %if obp = bufflim+1 %start
      report("Caption too big")
      %return
   %finish
   byteinteger(obp) = sym;  obp = obp+1
   %if sym = nl %start
      lines left = lines left-1
      psym(ff) %if lines left <= 0
   %finish
%end

%routine set dt
   %record(parmfm) p
   svc(7, p)
   date = string(addr(p_p1))
   time = string(addr(p_p4))
%end

%routine set(%integer size, %string(63) what)
   %integer j,l,s
   l = length(what)
   %for j = 1, 1, size %cycle
      %if j > l %then s = ' ' %else s = charno(what, j)
      psym(s)
   %repeat
%end

%routine set banner(%string(5) end)
   %integer j
   %const %string(32) %array mouse(0:7) = %c
      "~\                              ",
      "  \   /~~~~~~~~~\               ",
      "  /  /           ~\     /~\     ",
      " /  /  **MOUSES**  ~\   |  |    ",
      "(  /   ___           ~\_\  /_   ",
      "(  |      \                  \  ",
      " \_|       \____      |     o \ ",
      "   \____________\______\_______\"

   set dt
   j = banner lines
   j = lines left-1 %if lines left < banner lines-3
   %cycle
      set(34,mouse(8-j))
      set(7, end)
      set(28, file)
      set(9+1, date);  set(8+2, time)
      set(32,mouse(8-j))
      psym(nl)
      j = j-1;  %return %if j <= 0
   %repeat
%end

%routine  set trailer
   %conststring(7)%array  why(1:2) = "restart", "delet"
   %integer j
   j = lines left-banner lines-5
   j = 4 %if j > 4
   %cycle
      psym(nl)
      j = j-1
      %exit %if j < 0
   %repeat
   set(28, "output ".why(delete)."ed by operator") %if delete # 0
   psym(nl)
   set banner(" end ");  psym(ff)
%end

! =============start here=============

!
! initialisation
   out buff = system buffer address
reprime:
   spooler = packed(spooler name)
   attach spooler
   inbuff = addr(discbuff(0))
   bufflim = outbuff+buffmax
   active = 0;  rubbish = 0;  delete = 0;  paused = 0

   %cycle;        ! main loop
      poff(0,p)
      -> state(p_dact) %if message <= p_dact <= close
      report("bad dact")
      %continue


state(command):
      -> com(p_p2) %if pause <= p_p2 <= option
      ->reprime %if p_p2 = 7;    !potter is sick
      report("Faulty command");  %continue
   com(pause):
         paused = 1;  %continue
   com(restart):
         %if active # 0 %and paused = 0 %start
            copies = copies+1
            delete = 1
            %continue
         %finish
   com(continue):
         paused = 0;  -> more %if active # 0
         ->start next file;         !just in case
   com(cancel):
         copies = 0;  delete = 2;  %continue
   com(stop):
         paused = -1;  %continue
   com(option):            ! ignored meantime
         %continue

state(message):report("LP kicked")
state(accept):
      accept file
      %continue %if error1 # 0 %or active # 0 %or paused # 0

start next file:
state(next file):
      copies = 1
      get next file
      %continue %unless error2 = 0 %and active # 0


next copy:
state(header):
      delete = 0
      ibp = inbuff+512;  obp = outbuff
      lines = 0;  pages = 0;  last sym = 0
      lines left = page size
      set banner("start");                ! ** Maximum of 1023 characters **
      psym(nl) %for j = 1,1,3
      end of line = obp

more:
state(data in):
      %continue %if paused > 0
      %while obp # bufflim+1 %cycle
         %if ibp = inbuff+512 %start
            ibp = inbuff
            get block(data in,flush)
            -> state(next state)
         %finish
         sym = byte integer(ibp)&127;  ibp = ibp+1
         %if sym < 32 %start
            %continue %if sym = FF = last sym
            %if mask&(1<<sym) = 0 %start
               %continue %if sym = 0 %or sym = 4
               sym = '?'
               rubbish = rubbish+10
               rubbish = 0 %if rubbish < 0
               %if rubbish > 200 %start
                  clear(18)
                  psym(nl);  psym(nl)
                  set(16,"output abandoned")
                  delete = 2
                  copies = 0
               %finish
            %else
               %if sym = vt %start
                  %continue %if lines left > 8
                  sym = ff
               %finish
               end of line = ((obp-outbuff+line length)&buffmax)+outbuff
            %finish
            -> flush it %if delete # 0
         %else;         !printing char
            %if obp = end of line %start
               sym = nl;  ibp = ibp-1
            %finish
         %finish
         rubbish = rubbish-1
         last sym = sym
         psym(sym)
      %repeat
      put block(data in);  %continue

flush it:
state(flush):
      %if obp # outbuff %start
         put block(trailer);  %continue
      %finish

state(trailer):
      set trailer
      put block(close);  %continue

state(close):
      copies = copies - 1
      %if copies > 0 %start
         reset input;  -> next copy
      %finish
      close input;  delete file
      paused = |paused|
      -> start next file %if paused = 0

   %repeat

%endofprogram
 H?    X                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!            }            	        NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z        ` 2Aoutput abandoned start	LP kickedFaulty command bad dact  end ed by operator output restartdeletrt             ~\                                 \   /~~~~~~~~~\                  /  /           ~\     /~\       /  /  **MOUSES**  ~\   |  |     (  /   ___           ~\_\  /_    (  |      \                  \    \_|       \____      |     o \     \____________\______\_______\             !Caption too bigreset: close: Get: accept:claim buffer failed  `re|  	F}             /lp 
   9H  !34  1  0 !81 !5$$A> rB  @ !4B ";
C@ !$$A> r#$$A> rB  C
B$P#E  E  &Q'1"C  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n  $$A> r?1  34C0  D   D   
C   W  p ,@e r    q  y  	w ) ,A8p l) T ,A8$0@9 Lr	 L  xq	 Ly  	g p LX P 4X6 P9 8X P <X P @r	 ,  q	 , 2  A*y  &	w ) ,A8p l) R ,A80 :B  &A2D   B  r	 L  q	 LX Xy  &	w p LX xP 4$3P9 8$@ .r	 ,  q	 ,y  	w p Lr	 ,  nq	 ,X 4#A  X 4 y  	w p P$@ .r	 ,  q	 ,X9 4P9 LX H#7$P y P9 4$E@I .r	 ,  q	 ,XY HPX #?' ,A8 4A   APC  =	w p L$P $8@9 .r	 ,  q	 ,X HP Ű!7$P y B~XI 4PH t$V@Y .PI 4r	 ,  q	 ,Xi HPh #C Ri ,A-nA8$@ .X8 tP9 4r	 ,  q	 ,$@ .r	 ,  q	 ,X DP pXI HPH !C v' ,A8 4A   AlC V r	w p L$@ .X8 pP9 Dr	 ,  q	 ,X H#?' ,A8 4A   Ay  (	w p L$@ .X8 pP9 Dr	 ,  q	 ,X H#?' ,A8 4A   Ay  (	w p L$@ .X8 tP9 4r	 ,  q	 ,y  	W  p L$@ .X8 P9 @X pP Dr	 ,  q	 ,X @ XI H!XX #5X  @ y  )	g p LX[ P 8X8 P9 4@i 2r	 ,  oq	 ,X Py   	g p ,X
Y #+X &P$:<@y  	g p ,` !=X  A!4$jPi  AP X=X ; !8xAy c  &1P=` 
!:%Q XH !$$lAC  7	w p Lr	 ,  q	 ,-P 4A8-Z @A8y  	g ) ,A8p |2  P9 pPi x$@PI lC 0&API lYI p#&P  PY t#i ,
d  P tXi tAXI lUI xB0y  5	w ) ,A8p 8AH$P 4X8 0 #P 4$[ 4Ƞ !Z` "AN ,$gADn` A8P$jA.Z$jA$$H[I 4P !TZ]`  A
$jA^%aQi 4X 4!$y C  V	w p 0X 'P , #$$P ,$jA%1Q9 ,X ,##"
X C0.Z' ,8A8A   (A   ` A~$jA"A$lAy  E	w P (p NPH p P AlP AP xA$X P X8 ȳP $P P |P P X ,$`AH .ɐ !ɐ 	!(
sI

AC XH 8@ !@ !(
DsD

@ !3C nAC $QPX C Xh #;X !8$1Q8 P8 C j$P X #3C C @$P $BPH C F%QPX C <C 8AfAXh !7X !4X8 #3C $P AX !4X !3C $@PH XX e PmX PPH PH @H 0 AP8 A<$&P $jAX Ű  :XPX ##C XMXX E C0.XmX l B0P$W$fAH8 
3sC

Ӷ  İ @ &aPmɰ  C$!6E !3C $  Ð> B0`#4Ű !3C Ȱ ?@ $:Q8 |X |#$P |ɐ C ,` A $jAN$jAH` A$BPH $PPX C ,Ű !:X8 0 ##C P@ [H ȴ İZ PX #3C <#XU!7$J@H %QQ]%aQh |H @ Hh AC $fAJC TX=U8 #6$hA6C @A^$iA(C 2%Q X #%ADC "AAX I#$P !3C C tor,P)
   %if P_p6 # 0 %start
      Print string (P_text)
      Newline
   %finish
%end

%integer %fn User (%string(63) who)
   !String username => Process no.
   %record(parm fm) P
   To upper (who)
   %result = 0 %if who = ""
   %result = -1 %if who = ".ALL"
   who = who.":" %unless char no(who,length(who)) = ':'
   Pack (who,P_file)
   %result = -1 %if P_fi                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |          pj ,)pj ,)pj ,)pj ,) LA^$`@i Dr	 D  x   x  Y W   " X   b Y  c Z  Y [   J \   : ]   e ^  g _  Y `  %integer where, new val)
   %record(parm fm) P
   P_p1 = where;  P_p2 = new val;  SVC(118,P)
%end

%integer %fn Sys word (%integer where)
   %record(parm fm) P
   P_p1 = where;  SVC(117,P)             {Pick word up from real store}
   %result = P_p2
%end

{Kill off nominated user process(es):   }
{   KILL fred                           }
{   KILL .ALL                           }
%external %routine KILL (%string(63) parm)
   %record(parm fm) P
   %integer me = my process, j
   split up(parm)
   check parm(1);  parm = command_in1
   SVC(1,P) {Die!} %if parm = ""
   P_p1 = user(parm)
   %if P_p1 <= 0 %start                  { <0:error, 0:.ALL }
      %if P_p1 = 0 %start
         %for j = 4,1,processes %cycle
            P_p1 = j
            SVC(126,P) %if j # me
         %repeat
      %else
         Nobody (parm)
      %finish
   %finish %else SVC(126,P)              { KILL fred }
%end

{Give privilege to or remove it from the nominated process}
{   PRIV  user,ON                                         }
{   PRIV  user
%external %routine PRIV (%string(63) parm)
   %record(parm fm) P
   %string(63) what
   split up(parm)
   command_in2 = " " %if command_in2 = ""
   check parm(1+2);  parm = command_in1;  what = command_in2
   %if parm -> parm.(" ").what %start; %finish
   P_p1 = user(parm)
   Nobody(parm) %if P_p1 <= 0
   P_p2 = 0
   P_p2 = 1 %if what = "ON"
   SVC (124,P)
%end

%routine shutdown(%integer  delay)
   {Close system after DELAY minutes, sending warnings to users}
   %record(parm fm) P
   P_sact = 1                            {Nonzero to wait for reply}
   P_dsno = x'43';  P_dact = 7;  P_p1 = delay
   SVC (Pon off,P)
%end                                     {Ignores reply}

{Enable logins and make system generally available}
{   OPEN                                          }
%external %routine OPEN                  {Enable logins}
   Set word (system lock,0)
   shutdown(1 000 000)      { a very large number of minutes!! }
%end

{Disable further logins and, IFF a parameter is specified, start the}
{       H?    l                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ! Mouses paper tape punch spooler     2-FEB-80

%begin
   %conststring(3)  spooler name = "pp"
   %constinteger  pt demon = 112
   %constinteger max copies = 10
   %constinteger  buffmax = 1023;      ! MUST BE 2\\N-1
   %constinteger  max files = 42;      ! SYSTEM CONSTANT

   %recordformat parmfm(%shortinteger dsno,dact,ssno,sact, %c
                         %integer  p1,p2,p3,p4,p5,p6)
   %OWNrecord(parmfm) p, p2
   %OWNstring(29)%name  s

   %ownstring(9) date, time, cdate
   %ownstring(29) file;  %OWNinteger  file index, current id
   %OWNinteger spooler;         ! PACKED FORM OF NAME

   %constinteger  vt=11, ff=12, cr = 13
   %owninteger  ownername,limit
   %OWNinteger  rubbish, error1, error2, copies, active, delete, paused
   %owninteger  binary = 0
   %constinteger mask = b'0011111000000001'
   %OWNbyteintegerarray  discbuff(0:511);  %OWNinteger  inbuff
   %OWNinteger outbuff
   %OWNinteger  bufflim
   %owninteger  ibp,obp
   %OWNshortinteger  sym, last sym, next state
   %OWNinteger  j

! States
   %constinteger  message=1
   %constinteger  command = 2
   %constinteger  accept = 3
   %constinteger  next file = 4
   %constinteger  header = 5
   %constinteger  data in = 6
   %constinteger  flush = 7
   %constinteger  trailer = 8
   %constinteger  close = 9

   %switch  state(message:close)

! Commands

   %constinteger  pause = 1
   %constinteger  continue = 2
   %constinteger  restart = 3
   %constinteger  cancel = 4
   %constinteger  stop = 5
   %constinteger  option = 6

   %switch  com(pause:option)



%routine poff(%integer n, %record(parmfm)%name p)
   p_sact = n;  svc(16,p)
%end

%routine  report(%string(31) s)
   %record(parmfm) p
   string(addr(p_p1)) = s
   p_dsno = 0
   svc(120,p)
%end

%string(29)%fn  unpacked(%record(parmfm)%name  r)
   %record(parmfm)  p
   p_p1 = r_p1;  p_p2 = r_p2;  p_p3 = r_p3;  p_p4 = r_p4
   svc(18,p)
   %result = string(addr(p_sact))
%end

%integerfn  packed(%string(29)  s)
   %record(parmfm)  p
   string(addr(p_sact)) = s.":"
   svc(17,p)
   %result = p_p2
%end

%routine  attach spooler
   %record(parmfm)  p
   p_p1 = spooler;  p_p2 = accept
   p_dact = 2;  svc(22,p)
%end

%integerfn  system buffer address
   %record(parmfm)  p
   svc(110,p)
   %if p_p1 < 0 %start
      report("claim buffer failed")
      *=0
   %finish
   %result = p_p1<<16
%end

%routine  accept file
   %record(parmfm)  p
   %integer id
   p_dact = 4;  svc(22, p);         !CLAIM FILE
   id = p_p1;                        !FILE ID
   error1 = 1 %and %return %if p_p6 # 0
   p_p1 = id;  p_dact = 5;  svc(22,p);      ! TAKE
   error1 = p_P6
   report("accept:".string(addr(p_p1))) %if error1 # 0
%end

%routine  get next file
   %record(parmfm)  p
   active = 1
   p_dact = 8;  svc(22, p);      !Request a file
   error2 = p_p6
   active = 0 %and %return %if error2 = -108;    ! none left
   %if error2 >= 0 %start
      current id = p_p1
      p_dact = 6;  p_p1 = current id;  svc(22, p);   !Identify
      error2 = p_p6;  -> FAIL %if error2 < 0
      file = unpacked(p)
      p_dact = 7;  p_p1 = current id;  svc(22, p);   !Locate
      p_dact = 4;  svc(20,p);      ! OPEN SEQUENTIAL INPUT
      file index = p_p5
      error2 = p_p6
      %return %if error2 >= 0
   %finish
FAIL:
   report("Get: ".string(addr(p_p1)))
%end

%routine  close input
   %record(parmfm) p
   p_dact = 11
   p_p5 = file index
   svc(20,p)
   %if p_p6 # 0 %start
      report("close: ".string(addr(p_p1)))
   %finish
%end

%routine  reset input
   %record(parmfm)  p
   p_dact = 12
   p_p5 = file index
   svc(20,p)
   %if p_p6 # 0 %start
      report("reset: ".string(addr(p_p1)))
   %finish
%end

%routine delete file
   %record(parmfm) p
   p_dact = 9;  p_p1 = current id;  svc(22, p);   !Delete
%end

%routine   get block(%integer  next, alt)
   %record(parmfm)  p
   p_dact = 7;  p_p4 = inbuff;  p_p5 = file index;  svc(20,p)
   next state = next
   next state = alt %if p_p6 < 0 %or delete # 0;    ! eof
%end

%routine  put block(%integer next)
   %record(parmfm) p
   %integer length
   length = obp-outbuff;  obp = outbuff
   p_p2 = length
   p_p1 = outbuff
   p_sact = next
   svc(pt demon,p)
%end

%routine  clear(%integer  n)
   %if obp + n > bufflim %start
      obp = bufflim-n+1
      byteinteger(obp-1) = nl
   %finish
%end

%routine psym(%integer sym)
   %if obp = bufflim+1 %start
      report("Caption too big")
      %return
   %finish
   byteinteger(obp) = sym;  obp = obp+1
%end

%routine set dt
   %record(parmfm) p
   svc(7, p)
   date = string(addr(p_p1))
   time = string(addr(p_p4))
%end
%CONSTINTEGER  SOH = 1
%CONSTINTEGER  STX = 2
%CONSTINTEGER  EOT = 4

%ROUTINE  PPV(%STRING(255)  PARM)
! ROUTINE TO PUNCH OUT READABLE FORM OF CHARACTER WHOSE ASCII CODE
! IS SUPPLIED AS 'S'.  INTENDED FOR PAPER-TAPE!!
!     LOGICALLY THE BOUNDS OF 'HEX' ARE (32*6:95*6+5)

%CONSTBYTEINTEGERARRAY  HEX(192:575)=  %C
 X'00', X'00', X'00', X'00', X'00', X'00',
 X'00', X'B8', X'B8', X'00', X'01', X'00',
 X'00', X'01', X'38', X'38', X'00', X'00',
 X'00', X'50', X'F8', X'50', X'00', X'00',
 X'10', X'F0', X'10', X'F0', X'10', X'00',
 X'98', X'58', X'D0', X'C8', X'00', X'00',
 X'48', X'B0', X'80', X'B0', X'48', X'00',
 X'00', X'18', X'00', X'01', X'01', X'00',
 X'00', X'70', X'88', X'88', X'00', X'00',
 X'88', X'88', X'70', X'00', X'01', X'00',
 X'00', X'50', X'20', X'50', X'00', X'00',
 X'00', X'20', X'70', X'20', X'00', X'00',
 X'60', X'E0', X'00', X'00', X'01', X'00',
 X'00', X'20', X'20', X'20', X'00', X'00',
 X'60', X'60', X'00', X'00', X'01', X'00',
 X'00', X'40', X'20', X'10', X'00', X'00',
 X'70', X'88', X'88', X'70', X'00', X'00',
 X'90', X'F8', X'80', X'00', X'01', X'00',
 X'90', X'C8', X'A8', X'90', X'00', X'00',
 X'50', X'88', X'A8', X'50', X'00', X'00',
 X'40', X'60', X'50', X'F8', X'40', X'00',
 X'B8', X'A8', X'A8', X'48', X'00', X'00',
 X'70', X'A8', X'A8', X'40', X'00', X'00',
 X'08', X'C8', X'38', X'08', X'00', X'00',
 X'50', X'A8', X'A8', X'50', X'00', X'00',
 X'10', X'A8', X'A8', X'70', X'00', X'00',
 X'68', X'68', X'00', X'00', X'01', X'00',
 X'68', X'E8', X'00', X'00', X'01', X'00',
 X'00', X'20', X'50', X'88', X'00', X'00',
 X'00', X'50', X'50', X'50', X'00', X'00',
 X'00', X'88', X'50', X'20', X'00', X'00',
 X'10', X'C8', X'28', X'10', X'00', X'00',
 X'E8', X'A8', X'A8', X'F8', X'00', X'00',
 X'F0', X'28', X'28', X'F0', X'00', X'00',
 X'F8', X'A8', X'A8', X'50', X'00', X'00',
 X'70', X'88', X'88', X'88', X'00', X'00',
 X'F8', X'88', X'88', X'70', X'00', X'00',
 X'F8', X'A8', X'A8', X'A8', X'00', X'00',
 X'F8', X'28', X'28', X'08', X'00', X'00',
 X'70', X'88', X'88', X'A8', X'E8', X'00',
 X'F8', X'20', X'20', X'F8', X'00', X'00',
 X'88', X'F8', X'88', X'00', X'01', X'00',
 X'48', X'88', X'88', X'78', X'00', X'00',
 X'F8', X'20', X'50', X'88', X'00', X'00',
 X'F8', X'80', X'80', X'80', X'00', X'00',
 X'F8', X'10', X'20', X'10', X'F8', X'00',
 X'F8', X'10', X'20', X'40', X'F8', X'00',
 X'70', X'88', X'88', X'88', X'70', X'00',
 X'F8', X'28', X'28', X'10', X'00', X'00',
 X'70', X'88', X'A8', X'48', X'B0', X'00',
 X'F8', X'28', X'28', X'D0', X'00', X'00',
 X'10', X'A8', X'A8', X'A8', X'40', X'00',
 X'08', X'08', X'F8', X'08', X'08', X'00',
 X'78', X'80', X'80', X'78', X'00', X'00',
 X'18', X'60', X'80', X'60', X'18', X'00',
 X'78', X'80', X'40', X'80', X'78', X'00',
 X'88', X'50', X'20', X'50', X'88', X'00',
 X'08', X'10', X'E0', X'10', X'08', X'00',
 X'88', X'C8', X'A8', X'98', X'88', X'00',
 X'F8', X'88', X'88', X'00', X'01', X'00',
 X'10', X'20', X'40', X'00', X'01', X'00',
 X'88', X'88', X'F8', X'00', X'01', X'00',
 X'00', X'10', X'F8', X'10', X'00', X'00',
 X'C0', X'80', X'80', X'C0', X'00', X'00'
!
%CONSTINTEGER  FF=12;      !  FORM-FEED CODE
%SHORTINTEGER I,J,S, H
   %FOR J = 1,1,LENGTH(PARM) %CYCLE
      S = CHARNO(PARM,J)
      S = S-32 %IF S>95;      !  LOWER CASE ALPHABET
      %IF 32<=S<=95 %START;   ! IF A VALID PRINTING CHARACTER
         I = S*6
         %FOR I = I, 1, I+5 %CYCLE
            H = HEX(I)
            PSYM(SOH!H) %UNLESS H = 1
         %REPEAT
      %ELSE
         %IF S=NL %OR S=FF %START
            PSYM(SOH ! 0);  PSYM(SOH ! 0)
            PSYM(SOH ! 255);  PSYM(SOH ! 255)
            PSYM(SOH ! 0);  PSYM(SOH ! 0)
         %ELSE
            PSYM(SOH ! 255) %FOR I = 1,1,6
         %FINISH
      %FINISH
   %REPEAT
%END
%INTEGERFN  PARITY(%INTEGER SYM)
%CONSTBYTEINTEGERARRAY  EP(0:15) = %C
   0,128,128,0,128,0,0,128,  128,0,0,128,0,128,128,0
   %RESULT = (EP(SYM&15)!!EP(SYM>>4)) ! SYM
%END


%routine set(%integer size, %string(63) what)
   %integer j,l,s
   l = length(what)
   %for j = 1, 1, size %cycle
      %if j > l %then s = ' ' %else s = charno(what, j)
      psym(s)
   %repeat
%end

%routine  runout(%integer  n)
   psym(0) %and n = n-1 %while n > 0
%end

%routine set header
   %string(255)  s
   %integer j
   %conststring(1)  snl ="
"
   set dt
   runout(20)
   s = snl."     ".file."     ".date."  ".time."    ".snl
   ppv(s);  psym(stx)
   runout(150)
%end
%routine  set trailer
   %conststring(7)%array  why(1:2) = "RESTART", "DELET"
   %integer j
   %if delete # 0 %start
      runout(50);  ppv("output ".why(delete)."ed by operator")
   %finish
   runout(20)
   psym(eot)
   runout(200)
%end

! =============start here=============

!
! initialisation
   outbuff = system buffer address
reprime:
   spooler = packed(spooler name)
   attach spooler
   inbuff = addr(discbuff(0))
   bufflim = outbuff+buffmax
   active = 0;  rubbish = 0;  delete = 0;  paused = 0

   %cycle;        ! main loop
      poff(0,p)
      -> state(p_dact) %if message <= p_dact <= close
      report("bad dact")
      %continue


state(command):
      -> com(p_p2) %if pause <= p_p2 <= option
      ->reprime %if p_p2 = 7;     !potter is sick
      report("Faulty command");  %continue
   com(pause):
         paused = 1;  %continue
   com(restart):
         %if active # 0 %and paused = 0 %start
            copies = copies+1
            delete = 1
            %continue
         %finish
   com(continue):
         paused = 0;  -> more %if active # 0
         -> start next file;         ! just in case
   com(cancel):
         copies = 0;  delete = 2;  %continue
   com(stop):
         paused = -1;  %continue
   com(option):
         %if string(addr(p_p3)) = "BINARY" %start
            binary = 1;  %continue
         %finish
         %if string(addr(p_p3)) = "NOBINARY" %start
            binary = 0;  %continue
         %finish
         report("Bad option ".string(addr(p_p3)))
         %continue

state(message):report("PP kicked")
state(accept):
      accept file
      %continue %if error1 # 0 %or active # 0 %or paused # 0

start next file:
state(next file):
      copies = 1
      get next file
      %continue %unless error2 = 0 %and active # 0


next copy:
state(header):
      ibp = inbuff+512;  obp = outbuff
      last sym = 0
      set header;                ! ** Maximum of 1023 characters **

MORE:
state(data in):
      %continue %if paused > 0
      %while obp # bufflim+1 %cycle
         %if ibp = inbuff+512 %start
            ibp = inbuff
            get block(data in,flush)
            -> state(next state)
         %finish
         sym = byte integer(ibp);  ibp = ibp+1
         %if binary = 0 %start
            %continue %if sym = 0 %or sym = 255 
            %continue %if sym = eot
            %if sym = NL %start
               %if last sym # CR %start
                  ibp = ibp-1
                  sym = CR;  last sym = CR
               %finish
            %else
               last sym = sym
            %finish
            sym = parity(sym)
         %finish
         psym(sym)
      %repeat
      put block(next state)
      %continue

flush it:
state(flush):
      %if obp # 0 %start
         put block(trailer)
         %continue
      %finish

state(trailer):
      set trailer
      put block(close)
      %continue

state(close):
      copies = copies - 1
      %if copies > 0 %start
         reset input;  -> next copy
      %finish
      close input;  delete file
      paused =  |paused|
      -> start next file %if paused = 0

   %repeat

%endofprogram
 H?    }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     	 C!          " }            	        NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    !W  	PP kickedBad option NOBINARY BINARY Faulty command bad dact ed by operator output RESTARTDELETRT                              
                               88   PP   X  HH     p  p   P P    p   `         ``    @   pp    Ȩ  PP  @`P@ H  p@  8  PP  p  hh   h     P   PPP   P   (  訨  ((  P  p  p    ((  p       Hx   P       @ pp ((  pH ((  @  xx  `` x@x P P  Ȩ    @                 ?   Caption too bigreset: close: Get: accept:claim buffer failed    	BFS`o            Ppp 
   9H  !34  1  0 !81 !5$$A> rB  @ !4B ";
C@ !$$A> r#$$A> rB  C
B$P#E  E  &Q'1"C  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n$A1    0#
#	QD   RD   ?&A'"3  $$A> r?1  34C0  D   D   
C  Ā W  p ,@e r    q  y  	w ) ,Abp l) T ,Ab$0@9 Lr	 L  xq	 Ly  	g p LX P 4X6 P9 8X P <X P @r	 ,  q	 , 2  ATy  &	w ) ,Abp l) R ,Ab0 :B  &A2D   B  r	 L  q	 LX Xy  &	w p LXP 4$3P9 8$@ .r	 ,  q	 ,y  	w p Lr	 ,  nq	 ,X 4#A  X 4 y  	w p P$@ .r	 ,  q	 ,X9 4P9 LX H#7$Py P9 4$E@I .r	 ,  q	 ,XY HP]#?' ,Ab 4A   APC  =	w p L$P$8@9 .r	 ,  q	 ,X HPŰ!7$Py B~XI 4PM$V@Y .PI 4r	 ,  q	 ,Xi HPm#C Ri ,A-Ab$@ .X=P9 4r	 ,  q	 ,$@ .r	 ,  q	 ,X DPXI HPM!C v' ,Ab 4A   AlC V r	w p L$@ .X=P9 Dr	 ,  q	 ,X H#?' ,Ab 4A   Ay  (	w p L$@ .X=P9 Dr	 ,  q	 ,X H#?' ,Ab 4A   Ay  (	w p L$@ .X=P9 4r	 ,  q	 ,y  	W  p L$@ .X=P9 @XP Dr	 ,  q	 ,X @$XI H!X]#5X  @$y  )	g p PX[P LX=P=P 8P9 4@i 2r	 ,  pq	 ,y   	g p ,X
Y#+X&P$:<@y  	g p ,XX= !8xAy l  &P" 	w p Lr	 ,  q	 ,- 4Ab- @Aby  	w ) ,Abp<2  P94$@@I.C &A@I.Y ,
Te  @i0` _#%f@i0`  BX` _B P$@,&P8H9,'1@9,C &&1@9,Z=,ӳ  @2Ű #6k` AH9,U98B0C R` 
#5` B0*$aA$aA` A` A$aA$aA#$&@,` AH,Š  ;HI.UI4B0 y  	g p ,` Zm4X Z46  Ӽ  ;V y  	g ) ,Abp |2  P9 pPi x$@PI lC 0&API lYI p#&P  PY t#i ,
d  P tXi tAXI lUI xB0y  5	g p ,X #($`A%1Q9 "	y  	w p4A` A' ,AbA   A   A   A   A   A   A   P)0) ,X0AbA    ,A$bA,` A@y  Q	w p 4XC0<` 2AX=3Z=<' ,P9 0AbX 0A   xA   A:` A$dA` Ay  7	w P (p ,ApPAPA(XPX=ȳP$PPPP]P$`AHRɐ !ɐ 	!(
sI

nA C <XM\@ !@ !(
DsD

@ !3C n^AC $QP]C Xm#;X!8$1Q=P=C $PX#3C C $P$BPMC %QP]C `.VA*!6$aPm C .LA*!6$P C ' ,@Ab`A   A.C j6A"A\X=!7X!4X#3C H$PAXM!4X]!3C .Xm PX=P=$@"ADX##C XXMŔ C0X]XmV B0Pm$W$fAH$
sL

5  @= &QP]X B0J3#40 !3C D0 !3C :0 
!?H"Š #9'QP]$=@= @="#@="Hm A@ Hm APC VHm$AC PX#6$hAC @A$iAC 2%AQMX]#%AC AvAXm#$`lPm!3C C b      *   
  
  
	  	  	      	  	  !  &	  (  )	  *	  4  9  ;
  C  H	  O  P
	  \	  _
  c	  i  k  l  l  m			  w  x		          
  	           +   
    
  	    	         ,   
    
  	    	         -   
    
  	    	            
        g
  &                                       $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                                                          pH  pH  pH  pH    	            ؀     `    P9 ,$aW   lXi ,W   <X ,Ű 
!5XmHAzHC4$`W   lHW   H$QXmHW   TW  ,$bW   lXi ,W   <XI ,@ 
!5XmHAX]HP]LXm(PmC 6 o	W  p DX ,<  0 #$$<<  cW   <X ,ӫ  P @$@PI 8C &API 8XY ,
Te  W   <XI 8UI @B0Xi #y X P 0X8 P9 40 #X ɰ !#!4$P 03!$$1P9 4'P <$P 8XH #8XX #5Ƞ P 8dW   <Xm4Zi <  V lVi 8W   <X=PZ9 ӳ   X @ Z@ 9n SO @ X@ X' @ Zr k O : O @ Yn @ R@ XpESO @ Yn N    ?> @ N@ XpE: O @ Yn N    SO @ Z'ON?# @ Yn N   S: O @ N   |p@ YpEO ;O $ XSHUTDOWN, ,  ,  {$ YDELAY, , ,  }O $ ZP, A, 7,  O @ Zn N   SO @ Zn N   CSO @ Zn N   SO @ Zn @ YSO @ N   tp@ ZpEO ;O $ YOPEN, ,  , #{}O @ TN  	pN    pEO @ XN B@pEO ;O $ ZCLOSE, ,  , #{$ [PARM, 1, ?,  }O $ \K, , ,  @ \N   USO @ K@ [pEO @ 9n ' ?= O @ \@ J@ 9n pESO @ 9n ' SO @ MN    pEO @ \N    ?) @ \N    S: O : O @ TN  	pN   UpEO @ \N    ?< @ X@ \pE: O ;O $ [BROADCAST, ,  , #{$ \TEXT, 1, ?,  }O $ ]P, A, 7,  O @ ]n @ \SO @ N   qp@ ]pEO ;O$ \PASS, ,  , #{$ ]PARM, 1, ?,  }O$ ^P, A, 7,  OO$ _J, , ,  O@ ]' ?# O@ HN   pEO@ 'Pass:pEO@ A@ ]pEO	@ HN    pEO
@ ]' ?# @ TN  	pNpER: O: O@ G@ ]':.p@ ^n pEO@ _@ ^n n SO@ _N    ?> O@ 'Invalid password - ignoredpEO@ 0EORO: O@ TN  	p@ _pEO;O$ ]UNIT, , , {$ ^ID, 1, ?,  }O$ _P, A, 7,  O@ ^' ?# O@ ' H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        {STARTUP program for spoolers etc}

%begin;         !startup program
   %recordformat parmfm(%shortinteger dsno, dact, ssno, sact, %c
                        %integer p1, p2, p3, p4, p5, p6)
   %shortinteger count, j
   %constinteger  SPOOL process id = 40 059 494
   %integer potter proc
   %routine create(%string(6) process, pass)
      %record(parmfm) p, q
      string(addr(p_sact)) = "SPL_".process.":";  svc(17, p)
      string(addr(q_sact)) = pass.":";  svc(17, q)
      p_dact = 31;  p_p3 = q_p2
      svc(20, p)
      %if p_p6 = 0 %start
         printstring("Process ".process." created")
         newline
      %finish
   %end
   %integerfn start(%string(27) proc)
      %record(parmfm) p
      string(addr(p_sact)) = proc
      svc(17, p)
      %if p_p2 <= 0 %start
         printstring("Illegal process name ")
         printstring(proc)
         newline
         %result = 0
      %finish
      p_p6 = 1<<31;            !privileged
      p_p5 = p_p4
      p_p4 = p_p3
      p_p3 = SPOOL process id
      svc(109, p)
      printstring(proc)
      %if p_p6 = 0 %start
         printstring(" started as process")
         write(p_p3, 1)
         newline
         %result = p_p3;         !process number
      %else
         printstring(" -- ")
         printstring(string(addr(p_p1)))
         newline
      %finish
      %result = 0
   %end
   %routine kick(%integer proc)
      %record(parmfm) p
      %return %if proc = 0
      p_dsno = proc!64;  p_dact = 1
      p_sact = 0
      svc(115, p)
   %end
   %routine wait(%integer time)
      %shortinteger h
      %while time > 0 %cycle
         time = time-1
         h = h+1 %until h = 0
      %repeat
   %end

   create("potter", "bits")
   potter proc = start("potter:potter.ABS")
   create("lp", "bits")
   create("pp", "bits")
   create("cr", "bits")
   create("accnt", "bits")
   create("bg".tostring(j), "batch") %for j = 'a', 1, 'i'

   kick(potter proc)
   wait(3)
   kick(start("lp:spoollp.ABS"))
   kick(start("pp:spoolpp.ABS"))
   kick(start("cr:spoolcr.ABS"))
   kick(start("init:init.ABS"))
   kick(start("accnt:account.ABS"))
%endofprogram
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         	 C!           h}}        `     	  }      NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    %Qv   ;ov           "A aaa A 
   -B b    5BaA       @C    !    A         W%  a A A    a     h" a a  !    paaaaaaaBA a   dQ@    D"Z 	y8@     ,v   D>   HW   d+E     ,&    Ld    	e     ,fv   3d;v <d    \j@   ys    ,yO_q Lfv   Td    F+D     fv   ,lqR      4@   8   <d    }      ~u@ ,2    ox    P:Q} TyO__  \`,  $|%Qv    ,-Z .>   0fl}f +       streams
Batch process root is 
Max. batch limit is 
Spoolers started on relaybatchinit cr spoolcrpp spoolpplp spoollpbits bits bits bits bits bits potter bits :   --   started as process:.ABS SPOOL:  created Process  ::_,* * * STARTUP:  faulty process/file ident =  * * STARTUP:  faulty number                             RELAYINIT CR PP LP POTTER 
   h%?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nH  !34  1  0 !81 !5$$A> #$$A> &C ?1  34C0  D   D   
C H  !34  1  0 !81 !5$$A> B  @ !4B ";
C@ !$$A> #$$A> B  C
B$P#E  E  &Q'1"C  ?&?$$A> O$$A> "#:  ! ?$$A> ?$$A> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$2#XC   PC   '4"H  !34  "#(!B   C $$A> ) w ) ,A A D X !A  $0P9 HI ,PI PS$!APY DC &QPY DPY L ,%A* a  ` 0!` 9C >' ,A  ,A" A" A" W   H$y  ,%A* X H$:
Aӡ  
KPI HUY LAUY PB0bP LX HC  z	w ) ,A A L X !A  ) R ,A r	 L  q	 LX9 X<3C6' ,hA  ,A" A" A" W   H Ty  G	w ) 3A A < X !A  ' ,TA fA"  ,A" dA" A) D$4A' , 3A bA" A) d$4A0 @9 >X hP Lr	 <  q	 <X XB06' ,XA  ,A" NA" W   HW  ,y  y	w ) LA A T X !A  ' ,FA  ,A" @A" A6) \$4A0   P9 pX hP lX dP hX `P d' , LA >A" A' ,$4AX 0P `r	 T  mq	 T LW   HXI pLDB0:*W   H$QXi dlW   TW  ,X dy $W   H \W   HW  ,$C  	W  A < X f!4y $0P9 DP9 HP9 LI ,DC02' , ,A  A" A' ,$4AXW 0\PY LXi  Pi PX9 4P9 TX 8P XX Ơ @@ <A$A@I >$P@Y Br	 <  sq	 <C j X	g A , X X9 #,'1P9 H ,&@ ,#2""y  	w P (A , X X=<ӳ  #8-T  A  XӚ @#7 @APPXMLT `U#8-\ `A  ' ,A  A\' ,A A:P 0' ,A  A.' ,A  A' ,A   A' ,A  A' ,A  AXmP` `Ph 80 `$!A@8 .3AC P&1@8 .3AP8 4  @ <' 3\A  <A" ' ,A  AjH8 .U8 4AU8 8B0P 4' ,"A $P 4P 8[Xh 0lAf$cA' ,A A' ,P 4A $P 4P 8ZXh 4A(' ,A A' ,P 4A $P 4P 8YXh 4A' ,A A' ,P 4A $@PG 4PG 8TXh 4A' ,A A^' ,P 4A $PPW 4PW 8X]PXh 4A~' ,A A$' ,P 4"A $`Pg 4Pg 8VXh 4AF' ,A TA" $PXmPP( 4W,p,',A  X8 4#A" ,A" lA" \A" A" W   Hx   C!           (}L         G  Y   	  L      NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z        	BaA    
   B               A         0" A a     7" a a  !    >aA AAAA  a        dQ@    D"Z 		e     ,fv   3d;v <d    \j@   ys     ,f Hd                                      $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |             SPL$:P=BGL$:P=               ,  q ,XXPlXP  H\#3A6AXH#tA X]`P @#5h lA`C Vi                             H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        {STARTUP program for spoolers etc}
{New version allowing: spooler code, host process id, queue name and  upto}
{three integer 'START' parameters to be separately specified              }

{STARTUP program is parameterised so that the spooling volume can be selected}
{and the batch limit and batch process name root set appropriately:          }
{      STARTUP  SPL,2,BG       for example                                   }
{If no parameters are supplied, they default to those in the example above   }


!! %OPTION  "DECODE,NOOPEN,STACK=15"
%begin;         !startup program

%owninteger      BATCH LIMIT = 2      {Adjustable 0..26}
%ownstring(7)    SPOOL VOL   = "SPL",
                 BATCH ROOT  = "BG"

{Process ids used for LP, PP etc}
%conststring(7)  potter pid  = "POTTER",
                 LP     pid  = "LP",
                 PP     pid  = "PP",
                 CR     pid  = "CR",
                 INIT   pid  = "INIT",
                 RELAY  pid  = "RELAY"

%include "sysinc:parmfm.inc"
%include "sysinc:command.inc"
%externalstring(31)%fnspec  ItoS(%integer  N,p)


   %shortinteger count, j
   %integer potter proc

   %integerfn  S to I (%string(23)  s)
      %integer  j,N=0
      %for j = 1,1,length(s) %cycle
         %unless '0'<=charno(s,j)<='9' %start
            print string("* * STARTUP:  faulty number ".S.SNL.SNL)
            %result = 0
         %finish
         N = 10*N + charno(S,j)-'0'
      %repeat
      %result = N
   %end
   %record(filefm)%fn  PACKED (%string(31)  fd)
      %record(parmfm)  p
      string(addr(p_sact)) = fd;  svc(17,p)
      %if p_file_owner < 0 %start
         print string("* * * STARTUP:  faulty process/file ident = ".fd.snl.snl)
      %finish
      %result = P_file
   %end
   %routine CREATE (%string(6) process, pass)
      %record(parmfm)  p,q
      P_file = packed( SPOOL VOL."_".process.":" )
      Q_file = packed(pass.":")
      p_dact = 31;  p_p3 = q_p2
      svc(20, p)
      %if p_p6 = 0 %start
         printstring("Process ".process." created")
         newline
      %finish
   %end
   %integerfn  STARTED (%string(31) spooler code, %string(7) process)
      {Start SPOOL:spoolercode.ABS as 'process' and return the process no.}
      %record(parmfm) p
      P_file = packed("SPOOL:" . spooler code . ".ABS")      {stylised names}
      p_p6 = 1<<31;            !privileged
      p_p5 = p_p4
      p_p4 = p_p3
      p_p3 = p_p2
      p_p2 = packed(process.":")_owner
      svc(109, p)
      printstring(process)
      %if p_p6 = 0 %start
         printstring(" started as process")
         write(p_p3, 1)
         newline
         %result = p_p3;         !process number
      %else
         printstring(" -- ")
         printstring(p_text)
         newline
      %finish
      %result = 0
   %end
   %routine KICK (%integer process, %string(7) Qname, %integer X,Y,Z)
      {Send 'process' its startup message which normally consists of a}
      {packed  Queue identifier (P3) optionally followed by three     }
      {integer parameters (P4..P6)                                    }
      %record(parmfm) p
      %return %if process = 0
      p_p1 = 0 {for consistency}
      p_p2 = 0 { . . . . . . . }
      p_p3 = 0 { . . . . . . . }
      p_p3 = packed(Qname.":")_owner %if Qname # ""
      p_p4 = x
      p_p5 = y
      p_p6 = z
      p_dsno = process!64;  p_dact = 1
      p_sact = 0
      svc(115, p)
   %end
   %routine WAIT (%integer time)
      %shortinteger h
      %while time > 0 %cycle
         time = time-1
         h = h+1 %until h = 0
      %repeat
   %end

   { ======= S T A R T    H E R E ======= }
   SPOOL VOL   = COMMAND_in1 %if command_in1 # ""       { ... else default}
   BATCH LIMIT = StoI(COMMAND_in2) %if command_in2 # ""
   BATCH ROOT  = COMMAND_in3 %if command_in3 # ""

   create(potter pid, "bits")
   potter proc = started("potter", potter pid)
   create(lp pid, "bits")
   create(pp pid, "bits")
   create(cr pid, "bits")
   create(init pid, "bits")
   create(relay pid, "bits")
   create(batch root.tostring(j), "bits") %for j = 'a', 1, 'a'-1+batch limit

   kick(potter proc, "",0,0,0)
   wait(3)
   kick( started("spoollp",lp pid), "lp", 0,0,0)
   kick( started("spoolpp",pp pid), "pp", 0,0,0)
   kick( started("spoolcr",cr pid), "cr", 0,0,0)
   kick( started("init", init pid), "batch", batch limit, 0, 0)
   kick( started("relay", relay pid), "", 0,0,0)

   print string("
Spoolers started on ".spool vol."
Max. batch limit is ".ItoS(batch limit,0)." streams
Batch process root is ".batch root.SNL)

%endofprogram
 H?   	 	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    impd startup.new/n:,t:
impd init/n:,t:
be subsys
impd subsys/n:,t:
impd standard/n:,t:
impd opsrc:oper/n:,t:
be
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         M C!          L
H<}0~    N T    
  0~       &}}      -ɚ`     -ɖ      $eR	=     *	oR     0:y~iK    6.Q@     <^-Y8     B8Ei     H	E:t#   NWfS    X`QK xgQK fZJ_fZX!t^Z} }    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  (QT    :      :H  ayu  "Z    &y$ } fS}} %Qv_%Qv   X      "e    qVM    &"8    #      ;ov      &)^a8;		
+
-
/
1
=
?
A
C    +!   A A !  a      I!    P!    Y) baA! A     v! a    !    *a aa!  ea    %  !  a  A A A   a    "    #      $D a  bA    $  a  	  "   !    A       
     ! !    !      !   a A "    " aaA a A  a Aa      2!  a    7!     ;!     ! a A    ! a aA A a     *!A a    0! !   	   9! A     ?! A     E"         a A A! a A    _!  A     e!  a A A a A a A    "A!!! a A A      ! a  Aaab!     ,A    a     A     >" A   A     ! !  a   A     e!a    !       ! A   a A    ! A  A  	   ("   ! D      d" !!!!!!         a A    . a  a a b a   ! !     !  a     A   AA      A Aa      (         a  A b A   a A  b A   a a A   a  ! " A A    BA  aA A Ab!   a !" A     B! A!   B a ! a  B Aaa a    b    a A! A A   a    A a    A b  B  C  z  a$ a  F  a   b !  A    !   a   ! ! A  A!c         E   aa a   FA C  C  C! A a C! G a C  C  a C  a F a  ! ! A    a         B B! ! x  =" !        B  b    A  A     ! a a  "  k!     s!   {!a    !   ! a    !     !! a&  	  " a a    '# a A  DA a    A!  a ! A b A a aa B!! a B a  a B  a a  a B B   B   D   D    A !B a B a B a  B a a BA!  E    !    B   a !  b B   a !  dA  A  A B   ! B     n  B   B  B  A B   B  B   C  a a  B!a  B   A C   !   " D    D!$ a A E A  A A B B C A a A A A      )!!!     /! A   A" 
   9! A  A" 
   C!    G! A    $!K a A  !  A  A  A  A   A  A  a A !  A  A A       a A a A   A  A  B    ?     5# a A a  a  Ab A   !!!!!!! !!!!!!!!!!!!!  !!!!!!!!!!!A     a    >   |!  a  a   
   !A    AA    A     a      A    !      \# a a aB A a a  a d !   d   $!A!    
'!  o   a   f   A!  C  C ! C  a A C   A A B Aa Aa A B C A a   BA   aAA  A   Ba Aa " " A A!a C!A  C  C a a C a a ! b D! C    % D CA  CA!! C C a C!!  C f! aABa A CA  a   A   BaA  !   D A  DB  a   i a  d    A  Ba!  B Ba a! BA!  B  a B A a B A  a  A C!! B  a B  a A a  a B A    a C C C a C aa C a C     B   BA a  C!! a! C AA A   CA d+A D b!  C! ! A a a a  a C   C  D!!  A (B  J  FA B#a!  C !  C  C F C  BAA  B a A c  J"           aba  A B   A  a! c   A '   ! a A A w a    A    a A    A! A A   A A    aA A    A a    ba B a   A  " ?     )p o !! b!!|! b B a a     dQ@    t"Z#&y$ } #fS}} #%Qv_$%Qv    !}x       'a+ ,    0@   4W   8%   <   @Z   D+   %}6       ,    	,       ,    	w8       w   ,    0@   4W   80   <%   @+   Dq   %x6       ,    	+       ,    	#       ,    0+   4   8.Z   <nP   @q   DW   !M_       ,%   0Q@ 4%W 8   <   @p   DW   !M_8     ,    	yz}      ,    0@   4%   8W   p       @  $K̄ ,d    p     ,    	fo       ,   0@        ,v   	fZ    Ð v   	fZH   z   	fZ     ,Z   	fZH   ,    0v  08@  4""   fZK    'ux      [_     8@   	:y   ,^8     |"8  rX  ,f   }gq+Ð ,v   	{%SÐ v   	!Q}          	\8         	f+} Yz ,8@   q[j@   K    	X_       	&	#   ,8@   	M[	e  Ð W@ ,K    08@   fZ<  ,v  Ő,d   0K   Ugqsx   S@ ,8@   0K;} Đ <   fZ	M Y 	L{~XH  Đ K    	L{}      aYK ,g2  Đ 0K    fZ:uY؁ Lv! 	M[	eLv@ #"Ɛ ,fՉƐ 0~Iv %N      8@   	qIQ@   x     @   	WA ,Rv@   <:dKD  hKE  lM  pM  tN    #|_   }:, ,~Iyq+,2(  02v  4Z  8lwW  <h{  E@2p  ŠDfaZHW  Lx/WPW!y   AqN@   ,-Z 0-Z:Q}  ,X`}   İ ,d    	!Q `       	!Q}  İ     	{/d  ,!p     Wr     g[2Q@       	g[4h     ]   %   fh`Ep   ,@ 	%et@   ,y 0W@ <-Z @X`}  DLvD H    LW   P%   Td Xdd    |`  Š e  Š    ;8    Ð Lv@Đ D	    HYW LY  P	oU T	oU Xz
	oQ@   \y `D   dv  Ɛ h   lm}ȁ pK}  tz   xz@   |fk   fk  E   +   ,   y̞ņ Y@Ő g2   M   g9dȁ @ q&\4j}  8jK   Lv!Qp &\e   |@     Ud     Ő    ,   0    4   5K   6@ s	}    W    #p ,z   sQ@     ;L"     z   	w	} ð v   ,#   v@     ,v   	_       @ ,&@,Zx   u!:   (_TL    W.İ ,   0  İ H   ư L@   PZ!3 T~Iz
 'ox     0X   4(_Q@ #    Š   Ơ ,@   0h{   4W   8x/W <x/\ @lwW   Dz   H^  E L!%R}   C PfkyS  Ġ ly@  Ġ pq  D t:t#    x:t#	Ġ |  Ġ %   - <   8@   t   u   u0   p  à {   à {H   }:,    K   Q{D W.<	yd  <!H  @ :w"LLv@ ,z   	=       yu ,6- -sX+   0X[~v+   ox    <_} %Qv_ ,""Lv@   0v 4fՋiXH   6qV~XH 8X`~XH   :L^C   <Lv!Qp @K;~XH   DK;qp   HK;~'z
   LK;}p   P!tkgH   Tȃ@   X#H@   \f.Q@  C `~IxXH   d<.]  ŀ h<ȅt 0D   ZKd  <i+ $  ŀ @  ŀ ŀ }}ŀ   (X`q+,yA0y  T-ɚ`X-ɖ 4	_]  8	_6  <	_y   #9RATS BARATS BASIC V  millisecondsCpu time used =  END assumed after  ** Interrupted! *** Dangling input discarded !*** Line Too Long - Please Retype  Stop in  $WRKFILE.BAS $WRKFILE ECCE:ECCE $WRKFILE.BAS $WRKFILE BASBASBAS.. in  Cannot re-dimension arrayUnimplemented code Illegal upper boundDimension mismatch for array Bounds exceeded for arrayUnassigned element in arrayAUTO step not in [1..1000] Compilation errorInvalid argument to TABNull argument to ASC Cannot open input file Cannot open output fileINPUT format error, symbol = ' End of file during INPUT Arg to CHR$ not in [0..255]
SEG$ fails USE file does not existUSE depth exceeded FOR control variable corrupt FOR cannot terminate Too many "FOR"sNEXT before FORProgram has not been saved Illegal string length!Cannot re-dimension string scalar does not existData type clashOut of dataUnmatched "RETURN" Too many "GOSUB"sDestination too shortString too longUnassigned variable***    (]fox,5>GPYbkt}                 --''''!'!'&#y(d(}((`(\!----+]+r++-+++-##--------,--5-L-f-----,,--------+O+?--------------------------------------*?'5(*H++''N*'*H,&+,G,)!$%Y$m,''(
(C&&&	&	-##$4'z'&'''$"	!#,#d$$h#!|!'N!`-!K)(*(*#O-------------------------------------------------------------------------------------------------- Bytes.***Total Code =  >>  <<Code= <  ***L ***V SS= OpeEndLnpeRunLnpeCondnpeStopnpeContnpeNoptnpeByetnpeEndtnpeGoSubpeListbpeToColpePrNumpePrStrpePrTabpePrNLbpePrintpe Printpe Printpe PrintpeRanntpeSqrntpeSinntpeCosntpeTanntpeAtnntpeExpntpeLogntpeAbsntpe AbsntpeTimetpeDatetpe Datetpe Datetpe Datetpe Datetpe Datetpe Datetpe Datetpe Datetpe**tetpe**tetpe/*tetpeDivetpeModetpe+odetpe-odetpeAndetpeOrdetpe OrdetpeUnary -Notry - Notry - Notry - Notry - Notry - Notry - Notry - Notry - Notry -Fix Of-Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of- Int Of-Discard%DiagrdGetVardAssigndToRealdToIntldSetTargEncloseSAssignBinarynReturnnCompareSComparConcatrDimStrrNewStrrForStrrNexttrrSetVarrSubStrrBytetrrShortrrRealtrrStringrRDatagrSdatagrDataRgrDataSgrDataSgrUseaSgrOldaSgrToStrngRestoreOnErrreCaserreZerorreOneorreDumprreLengtheInRealeInStrngPromptgSaveptgAsceptgNoVartgEditrtgComperrAutoerrSetLineDeleteeRenameeFileseeIndexeeGet@xeePut@xeeDimArrePutStr@Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform Perform             OSS=Pop Oper Operator stack fulloooooo()*+,-./023                  ]                                                          a  %    eeee                                                        9^                                              mtx|oR  
        _Z                                                              TryGotZ encounteredInitial atom                                                        %$D A   ]  Ty=  Pt=  SA=  A2=  [ A1=                                  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~              no* At   * Unknown Fault number * Type 
* Too Many * Line * Too Complex* Form * Atom   
S\enwEEEEEEiggff                       ~                                                  w                                        	Too many lines line immediate line -dim array available  with   active with FOR loop Unassigned value  = Too Many Variables Pending "GOSUB"s cleared Pending "FOR"s cleared To Dict store
Emit store *** Discard ignoredNo space >A80  <Ůor*** Fatal Error:              F*@9>O@/@o-@j~>?̿b?
b@@ :f´7BQ<+ϲ1?"!*>  >?jA2@ D2 D" > >GA  ?'mx@   @@  @  A  A   A@  A           @Q|@A!A2Cހ@ AG@  1.0             
   <1B?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n$/ #-( $  ?,'"H  !34  1  0 !81 !5$$A> #$$A> &C?1  &034C0  D   D   
C H  !34  1  0 !81 !5$$A> $@#0#D   D   &A'1"C H  !34  1  0 !81 !5$$A> B  @ !4B ";
C@ !$$A> #$$A> B  C
B$P#E  E  &Q'1"C s_  eX!34RUUh!34dffз  ӳ  Ű !4Գ #9    !8 !5$$A> B$ C08 L  #9&"C  "
  'M  M   >' ("#4\BbD#:  
  nBJ"#<  #M  M  '"DC0  
$#M  M  &'"%ѷ  C $ "ѷ  $$A> $A1    0#
#	QD   RD   ?&A'"3    !8 !5$$A> "#&!2#C$$A> 
!  1  #C   C  '1"X# Y !Y !&\ Z  B!$$A> З  $1$H  H X [ &B0P  [ ,&' ?P  
*&30H  P  ї  C Kї  $$A> 
Y  #%$$A> 
qPr  PB &(pX  ?$PS?PE   &T 41I2 !,K2  !
3s3B  #9
3
>!$$A> !$$A> A>  ?&?$$A> O$$A> ?$$A> "#:  ! ?$$A> ?$$A> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$H  !34  "#(!B   C $$A>  g A 0 X h ,(#++` 0` !:i@t#$&$$
Adi@x#&$%$$
Adh ,l@` ,W  PP 4/l@hi ,+h/AlN@+d`i 8(&#+f+bin@|#h	 8`	 @h@` <C >h 8,` Dh@,l 8j 8` @hn@,jjn@,jjn@jn@`i < C0+Dh) @i. +B`I @X9 0 P9 X !?h	 @i h <i -y h <i (h @i -
" 	w A 0 X h ,` ,$`Ay  	w A 0 X h ,` ,$aAhy  	g A 4 X h 0m@` ,W  PP 4/` 8h 0i@p!$%$$
Ad #6$0[9 P9 h ,(h#++)#6k@` 8hI ,($#+D+Bl@l+Lh	 8l@h+@`I <(#+D+NiN@dB<h <,` @h@T,j@X,j@\,j@`,` Dh <,j <` <X Ű #:+fhI <iN +d`i <h	 <i y  	w A 0 X h ,#` ,++` 0%aAy ` ,` 0$aA"
 "	w A 0 X h ,` ,(#++j@` 0$aAty  	w A 0 X h ,i@P#&$$$$
Adi@L#+ y (#++i@H#h@"h ,l@` ,W  PP D/l@hi ,+h/AlN@+d`i 0,f`i 4h.@@,&j.@Dl) 0`) 8h@<,j@`	 <+- j.@`) @&P D  $4=Apl!  `) @ӹ @X D#& 
ҹ @h	 @C . 	w A 0 X h ,!&$#$$
Ad9 ,CPI D0 @9 ,$T
AhKPI Dh ,i@#*` ,Xi Dl'aPi DC i@0C (k@k@` 0h ,l@j@` 4C (X9 D<'1P9 Dk@` 0l@j@` 4h 0i hi 4in -` <,` 8(HlN@8j@4-HlI <jI <`I @X D/+l.@*$/l@`	 H(j	 Hy  	w A 0 X h ,` ,Al@,y  	w A 0 X h ,!5+ y (#$"$$
Ad9 ,CPI 80 @9 ,h ,` 4h@(i ,h@$i *` 0-*m@` 0hI 4-J*m@` 0h	 4-
+
m@*` 0@ #9m@` 0&API 8Y 0D#&A@ 
TY 0h	 0C J j	w A , X X=$B0.$1P=$r	 ,  q	 ,X 4[E@  *JPM XM LP }
Ah;#  ` *&BPM /m@ y  C	w A 0 X Adl	 ,` ,W  (y  	w A 4 X h ,` ,Al	 0` ,Ay  	w ) ,AA l X !A  ?$`W   x$bW  8W   H ,W   HW  ,$ %AdAd <	g A , X W   HX8 X ӫ  
:P8 y  	g A , X W   <X8 &1P8 y  	w A , X X8 0 =!W  ,$P C 6SE@ Ƞ JP TPY ,eW   Xh X9 ,<
cPh y  8	w A 0 NX $09 0h ,` ,W  PP0/h ,+(#++`4hi ,!9) 0AC (F#+f+dh.@i. )bB "h	 ,` ,$eW  X &P C Ti@C*$PaW  @' ,A  ) 0 ,A> C  h ,` ,$U$bW   X &P i  0A4y  ~	w A , X W  ,$1P8 y  	w A , X X8 0 #3Ay  	g A , X Yh #AXi [h W   X9 P8 y   	w A , X $1P8(P8,y  	W  A , X X8(<0 C 4` B0,P B0$'1P8(8 ApXA  LD  y 'QPY  X,
%P,P ,
P,ɰ'#%AnX ,8ApC  N	w A , X $Q` AH1   P9 ,$ҳ  X ,y  	g A , X X8(<0 
C ArW   HW  ,#8 ApPa  X(&P(y  3	g A , X X8 <XH L4!5Ac  XX \&QPX y  %	g A , X X8 <XH L4!5A@d  XX \'QPX y  %	g A , X ` B0HX8 L<3#=W   HW  ,X H#=W   HW  ,ȭP h$@@H d@H ,PH LXX D\PY 4d$!APi ,C &&aPi ,Pi 08 Ap$ұ Xi ,Ui 0AUi 4B0P 0$P HP 0y  o	g A , X f!5Hh \@i @h d=P8 hy  	w A , X N 8 ApP $ApP $@PH @PH D@H \dAA$Q@X :PX 0y  ,	w A , X X8 D<P9 4$@$!API ,C `&API ,PI 08 ApPPQ  X ,8 Ap$`a X ,8 Ap$ұ X ,8 Ap$P XI ,UI 0AUI 4B0P 0$@PH LPH HAy  [	g A , X 6  P9 ,XH DLPI 8$P$!APY 0C <&QPY 0PY 48 ApX X) A!6X 0y XY 0UY 4AUY 8B0P 4Xh Dl&aPh D` #%rAf8 ApP  X D8 Ap$ҡ X D8 Ap$@A X D8 Ap$PPQ Xi ,&a$%!APi 0C *'aPi 0Pi 4X &A  a  AlXi 0Ui 4A` B0P 4X D8 ApX    P Xi ,A*X DC  	w ) ,AA, MX !A  9 ,P9,C  I0D!4y &1P9,S  P a!P z!%US  i0'ai0903C00X,&P,ӫ  ɠ A!ɠ Z!%Ȫ  ҫ  I0'AI0C  ,W   HC  [	g A , X X8 D<P9 8$@$!API ,C &API ,PI 48 ApP <XQ  \P!6Xi !3C X ` ӫ  jW   XI <LX AnW   HXY <\Xe  l`!:\W   HC X5 <#  A  ӱ  P 0Ű $B0:` "W   <X <X  W   H` "W   <C ,Ű %!>$PXI <Xd  lW   `#h  ` ,AXY <\e fC04LW   H$PX9 <<c W   `DW   HX <X C0D<W   HXI <LXT \PY @$PXi @f  W   `&W   HA&XI ,UI 4AUI 8B0$P 4y 	g A , X 8 ApX Ay  	g A , X X6 <C  @ !4y $VHf  W   `XY \X W   HW  ,C  3	g A , X H8 \@9 ,AzX #6W  ,H ,C0(8 |ApP 0aAPXI 0LHT @Y ,C Xi #6W  ,y  <	g A , X f!:W   HC *W   HX 8 |Ap$PHa  W   `y  .	g A , X 8 \P9 0X 0P ,H  !3C L8 |Apȱ P 0XI ,H  ApHQ  YY ##C  H  ApHa  Ui !6H  y C X8 @<&1P8 @0,#% A8 |ApX ,HJ  @A XY ,\Xh @l@e  fAxX @8 |ApȽP X @8 |ApX @  AxX @C d 	g A , X X8 <<3#$gW   #$UcW   `W  X W   HW  ,X .DA2<W   HC 4W   HC &W   HC xW   HC fW   HC 0
W   HC BW   H$PXj W   `X #=W  ,W   HXI LD#>dW   ` |W   <W  ,$PPY PX0z  
w A , X $0P9 xXI |&API |XY p!7$jPi tz 'QPY pX9 &1P9 ӳ  P tXI l#3C =\Apӱ  P t!3C =ApHQ  PY P 'RPY xC  J
g A , X fC *` xC"W  X =LApW   H#$PW   `{  ,w * ,AA < X !A  X9 80 P: <X=<0 !4z  ,W   H` :W   <` Ӻ ,kW   $SXi lW   `W  X \=LApW   HXI @@ #8` "W   <XZ <C0,` {W   <$PXj <W   `` }W   <Xi PUmdB0,X9 TU=hB0 XlU X!<XI UMp!7XY U]tC0PW   HXi PPmdA`JW   HX9 TP=hcADX XPlC0DW   H$PXmlW   `>W   HXI PMp$PdW   `8W   HXY P]t$PXmtW   `4W   HW  ,C H 
g A , XX $0P9 PP9 TP9 XX t!4A"XI |PI XY x&RPZPXi x!<Ű 
!9$1P9 P$P TC Ű "B0X9 0 (!3C $Һ ,@ `PI PP9 X$QPY lAXi t` 
!3C ` "B0$0P9 lApX tŰ "#3C &$API lXY t  @
T* ,TA C X 9 ApPXAXjXP  X 9 ApX!  , ,A   X9 &1P9 C `#;Ű .B0X: 0 *C0X9 0 (!3C +`4$P8P<@ ^PI PXY tP .B0"Xj8lf#3C $aPj80 _P9 PC FX xŰB08h4i l@0E/*`4Xj8lf#8X:<<'1P:<##A<C P EB0A,$PLXI t@ +#4@ -!9@ -!4$PLAXY tP 0!P 9##C ` _Pi P$0P:HX tɰ 0B.ɰ 9B &XJHL4$Z%AhCKPJHAC XjLlf#9$0XJHL4P:HXZ<\X:H<
SPZ<X<#?hj4in h.@0A ,``j4hJ4iN h.@,i. )B#%@ _PI PXY PP _B0 X 9 Ap`A  Xi Pi X&aPi #
`G ,W  PP XC X9 pP:,X |P0XI PJ@XY R!;XjPlf#3C C X =pApPDAX:D<ӳ  C0Jİ U tC0&C  @ !;XZP\U#3C tC |&2P:D#&1P:Dc  
6P:DAJC X:P<3!6X x#C FXJDL&APJDT  PY PP #<P PY P&APJDd  Pi T&APJDӴ  P Xz XJ@L'API XZ,\&QPY pXj0l'aPi |$0: ,AX x!XI t@ .B0$XY t  @
\* ,\A AC ` ZPi P0 \P9 T$QPY @ $B0$0 ]P9 T* ,*A AH$bPi C (@ %B0 0 [P9 T* ,(A A$0P9 j  ,AP XC   P PC @  PI PXY |Xi lVP #%Xi |Pi C 
w A , X %1P80$@PI LP-PY H@I Xi B0dAtX9 P0 (!:$fA$aAz 0   #3C .=ApH  P !=XI T#:PI PApH  P !3C =ApHQ  PY P PY \Xi l` 'aPi A#AA$0P9 PX XP dXI @@ B0Y PY hXi hlH6  P9 `X ð0 #33!3C Ȼ P 9 <Apa Pi hC XI HL'API HXY L\E!3C $@F  DAxX H9 <ApP DX d@ AxXI DLXY P @T  UAxXi DlX9 `<@6 3AxX DXI @K 
DAxX =ApHQ  PY X =ApHa  Pi ` Pi \X İ P dAXI \LD!3C V@ Cb@ !=ApA  PI \@ x!C XY P!4dAFXi \lUi P#4Ui T!3C RX9 !C X &P C PXI \L@ BXY L\&QPY LXi HlV!3C 9 <ApP DH @  XI DLXY \@T UAxXi DlX9 @6 3AxX DXI |@K DAx$P@Y X \=\ApHa  Pi X d.A2.A2Xi dlAC X H9 <ApP DHa AX9 D<@ AxC 4X dP 0C $XI dLPJ ,C XY d\U!4$QPY dXj ,l
ePj ,X: 0<	c##3!3C $eAvC RX H9 <ApX ,@ AxC X H9 <ApHA @ !#C $fA(C XY PY C |Xi ` !3C n$fAC X9 0 #3C V$fAC $P dHI C0H9 <Ap&P hHQ  PY `XY d\@Q  UAxHi Pi dXi `l@i fAxC X9 d<P80X LC09 <ApP D'P LHA  @I HQ PY Ha Pi H1 P9 X P `X =ApHA  PI XY `\U!3C D!C ,U PY `Xi &aPi C C 0  P9 `$P #XI PPI `XY `\P   !5$bA#e` AC 
w A , X X: @B00XJ D!7$PPZ ,{ 9 <ApP ,Ha Pj @HA PJ DX @9 <ApP ,HA PJ HHQ  PZ ,Ha 
Pi P #C <D!7H1 P: @C HA #<XZ D@Q UAxXj @Pj DX: H<P: @C HA PJ @X]<P C0j 0f#:$h: 0cW   X ,=LAp* 0A$RXj HlW   `W   0W   HW  XJ <'APJ <!,$EPJ <$PZ 0W  ,C  g A , X ` AHk hA{  g A , X f  AX; <c A|XK Ld AlX[ \e A\{  *w A , X X: C  @ !5` dA*XZ 'QPZ {  w A , X X: C  @ B0(@ !6` hA#` kAXZ e  ` e  {  *w A , X X: C  @ C0@ !=` iAXZ e  `e  {  %g A , X X: &1P: c  ` A{  W  A , X X: |0 
!5A&1P: |: lApa  X |: tApK A  [ P !9P @!4A$#A{  8w A , X X: |!5An: tApA  @ B0X |ApQ  P @!4A#AnX |: tApa  ` !5` mAfX |: lAp  =xApA  K ,dA@[ ,P o!;X |: lApa  A"X |: tApa  ` !6XJ 'APJ XZ $@E  X |: tApa  `  #6X: $AC  XZ |'QPZ |{  w A , *X $0: 0P: <XH0LPJ @P: DJ \$QPT $jPd A  * lAA$0P: |J P4 P PT A  * A$: ApP X=<0 C0,W   H$PXh0lW   `W  ,X @U DC0HAX ,.HA2XJ XLD#$dAXZ e  ` #5$mA#A$lAA`$1P: T$P XXJ ,L@ !5` AC XZ X\U#$eAzXj Tlf#4$oAh$aAbC %1P: X$kARA$P TC XJ XLD#%dA2#	D!7XJ HLPJ X$PPZ TC ^Xj Hlf#3AC J` jAXj HlAC 2` AXj HlAC ` vAXj HlAC X: H<3!7` AC H0 !7` AC 60 !0 !,` xA|Xj HlAp#` yAfXj HlA$`AC X &P $AK  ` zA8X H9 ApaA|C f$bA` {A$`A
C N$bA` {AX H9 ApXQ  \PZ e  Pj %$!AP LC 4&P LP XJ Ld  AߦXZ \&QPZ X LU AU B0P X H9 ApXa  lAC ` AXXj HlALX: H<X P AXj HlAVXI @ PI C "XY P #<` AXi `Pi #` fAXj HlAXi AfC "X9 0 #9` }A$bAJ#` |A޸$aA:C (X ð #9` Aޜ$bA#` Aތ$aAXI @ !4A#A\XY P C0$Xj 6  0 #6` AP#` AFC ,X K  @ #6` lA,#` gA"Xj HlABAC V` rA#` AXj HlAXZ H\Xj ePj C "AC AC AC 
` AݺC $cA8Xj HlAݤC X: '2P: Xj HlA݊C X K  @ !7Xj HlAlXZ $`e  C Xj HlARAX: &1P: $ҳ  C ` A2Xj HlA&C jXj HlABC ZXJ $ST  ` A C D` pAXj 6  0 !9X Hư @P H'aPj F  @ !9XZ H\P PZ H$@F  Xj HlAܤC ` X: H<cPj HX HŰ !5Ȱ P HX H=TApA  PJ P@ C0,X |: tApQ  Xj PlP ` 	V!AZC X: H<0 !7X |'P |#XZ P\cAC H@ qPJ HXj HlAAC ,XZ e  ` !6` A#` ~AX: '1P: #C X<ð #;XJ <@ #6W  ,z 
g A , 0X I ,$1P4 Ȱ,P A  ) <A$PPY PPY TPY XPY l6  P9 pPY tPY xPY |PY PY Pi I PT Ȱ (P A  ) A$PPY PY PY AX80<3##A y  Y	w A , X X9 C  PI 0&1P9 S  XEPI 0&1P9 XY ,&RPY ,z  %
w A , X AX9 0<0 B&X D	;!.W  Xi 0lAJC "W   H$PXi 0lW   `z  <
w A , X A(X9 0<0 B<X @	;B .W  X 08 |Ap$PHa  W   `C "W   H$PXi 0lW   `z  G
w A , X X9 C  I 4&1P9 XY ,&QPY ,z  
w A , X AW   H$Pi 4W   `` >W   <z  &
g A , X $0P9 ,W  ,$UXi ,W   `$cW   X9 ӳ  ҹ 6&1P9 X ,&P ,=ApA  DB0 W   H$Pi 6W   `#	ApW   HY 6P f!5AC lP v!5AC ^P g!5AC PP l!5AC BP !7AAC 0P j#4P !5AC P !?Ai 4f#7'ai 4A"	C P x!5AC P yB08AW   H$PXi 0lW   `W   HC P z!;A:A6A2A.C P {B0hA9 49 5` "W   <ӹ 5C02'ҹ 5Ai 4W   <ө 4Š "!7jW   <C ` "W   <C "P o!4A#P p!4A#P !3AW  ,I 6@ #3C W  ,W   H$PXi ,W   `W   H$bW  8y @	W  A , X H8 ,#;@8 8$0@8 ,#$Ad$@I -Y ,P !>I ,W   P , 
#2"
A^W  ,ZW   HX .`A2FW   HC t6W   HC  W   HC ~W   HC lW   HC ZW   HC HW   HC 6Xk  AݔW   HC W   HC W   HC zW   HC jW   HC ZW   HC DW   HC &W   HC W   HC W   HC zW   HC hW   HC VW   HC DW   HXk  W   <` 'W   <C W   HC hW   HC RW   HC :W   HC (W   HC W   HC W   HC jW   HC XW   HC FW   HC  W   H#	vW   H#$QXk  W   `C .W  ` "W   <Xk  Ad` "W   <Hh 6#<pW   HHh 6AJ$bW  8$ $Adw A , X P{ ,#X{ ,$09 ,S` Al$AI ,W   P D 
!4$PY ,{  +  g A , X `  #$` ,!5%{ $" g + ,AA 0 X !A  6$ nBA  B00X; ' ,A  lA  ,A X+ A   {  9w + ,AA, LX !A  P{,#X{,$P` Adhk  ,AH ,$bW   $bW   x$`ATW   $`W   x{  D  elg + ,AA, MX !A  X9 &1P;,P{0#X{0$P` A0 #&$P` Adk  ,A ,Xk,W   K @ !3AҺXk,A|Xi W   l{  S  W  A , X $T` AϔP H$=4ApXK H P L$QP[ P$jPk TX: |<XC LD#7HZ ` !AX[ HXk  e  ` AX; C0&XJ lLXT  \P[ T'DPJ lU#` AXk T&aV\K PAhP[ PXK LXk T@d  fAxX; L&2P; LX[  'QP[  #3C $`@c  X[ P$4CAheSAήP ,XK HLP X[ ,\`Pe  X; ,<&4P; ,XK P'APK P#3C XZ |\Xk HPe {  w A , X P{ ,#X{ ,$P` AX: l<XC  LPK 0'4P: lXS  \P[ 4'4P: l4Xj lX  %A"X&  A   {  =     g A , CX J T$0P4 Ȱ P A  * dA$: dApP l$P@Z Pz C  Xz Xi 0!4z 'aPi 0$ $AdX: ӳ  Һ&1P: .A2HJ !:`A@ AxHZ PX4$P@Z PX<Xj llX6  <3#$0#%` AP88'dPj lC $X lXK  LPJ P'P lW  C XZ l\Xe  lPj P'TPZ l`ALX PW  C $P` A:$09 -A\C W   X l&P lAXJ lLP  AhXZ D\P 
#5P  !""P "B0vAFXj Dl` "!=W   $ "#3C 6A X: D<  @
X lXK  L$A C W   $aA:#3AC >XZ D\P 
C0.  @
Xj llX6  <#A AC C W   X l&P l+`  ApXJ DL@  !""	$PPZ 8@ -#4@ +!9@ -!4$QPZ 8A>Xj Dl` 0!` 9#)` .#6V` A$0P: @P: 0X DŰ .!6$APJ @C *ɰ 0BLɰ 9B DXZ l\h  i l@0k/*`  X: @<0 !8X 0'P 0C XJ DL@ _@ EB0$PPZ 4PZ <AXj Dl` -!9` -!4$1P: <AdX Dɰ 0!ɰ 9#&[` AXJ 4LXZ D\4$j&AhCEPJ 4AX: D<0 0!0 9!#C X <#9$@XZ 4\EPJ 4Xj 0lXJ 4L
dPj 0##AC Xj DlA!9XZ D\` A@XZ 0\UC0$Xj llhf  in h.@0A ,``f  X: 8<3#>X l+Dh+  i. +B`K  C bXJ lLXT  \e  ` #%` e  X: l<X  P P-A  C XJ lLXT  \PZ P'DPJ lW  C Xj llX6  <P: P'dPj lA$P 0C HJ !5$aA^#8 |ApaA$P@Z C Xj llX  jA9 -0 !5H \@ J@ !4$QPX 0C fVA@>W  4` A&W  i -` !5H8 \@: C  X l&P lAtXJ lLP  ZP B0$W   Xj llX&  ,A   C  W   X: l<X#  ,A   C X lXK  LPJ PD  PK  C XZ l\Xe  lPj P6  3!6$P` A$!A  a  Pe  C RX lXK  LPJ D!@ #&$P` AAǌXZ l\P  Xj l  @

X: l<X#  ,
A   C $@ C XJ T  @Z &APJ d  hV@Z &APJ 8 ApP |C X: |<ӳ P C0@X L8 ApH 8 Ap$@A XX L\'QPX LXj l	V!C X8 L<0 
!5$P$mA 8 ApP X lh  i ` XJ Lh i (!5$P$nA|XZ l'TPZ lh  i ` 'TPZ lh  i `  Xj l'dPj lX: <H @ XJ LHX 8@T h i Xj lhf  in +hF iN -` ,W  PX: <P X XK LD#$P$nAXZ |\h+  i. `%  Xh Ll&aPh LX: |<c ` AC X L!5$P$lAv8 ApP HJ !>HA @J 8 ApP |C lXZ |\e f!5$P$lA0X8 L<X |K 	4C :XZ \H 8 Ap$`a X8 L<'1P8 L8 ApP C X h  i XJ |Lh  i )#5$P$oAh i *`  XZ \Xj |lh  i `  X: <X 'P XJ LXT \U!Hd @h 8#Xh Ll'aPh LX: |<$ҳ C JMXZ l\Xe  lPmX: P8 hC X hK  @ B0N]PX hHh d!5$P$fA8 |ApXQ \PX hApHa @h dӵ  Ű #3C &QPX h$API 0Xh hlA$PPY 0Xj l&dPj l:0 }B0 ӽŰ ~#4$gAbXMLPF  C ӽŰ #4$gABhi `  C XJ lLXT  \P B^Xj 6  	SB P$KAhePj LF  @J &aPj LV  XE@J 8 |ApXQ \e  ` !5T$hAX: 3  $+AhXJ C PJ C XX H\P 
!5$P$dA&QPX H8 ApHh 8@a  C X8 H<3!5$P$eAR8 ApH  @ 8XH H'APH HC HZ @X ,$P@Z C AH 8 |ApXa lA$`@j C xAX8 0<3!8$1P8 0$P$kA$ AdX lXK  LPM<'P l@  #8W   P TC XZ e  @j &QPZ 5  8c@j &QPZ ӺŰ jB0$8 |ApXA LT  P !5V$hALC Hj A8$`@j C H: !5H \@ 8$`AAâ$@@H ,$QY -C Xj llX6  <3!3C x'dPj lC jAW   HHh 6AjW  ,$ҹ -C <XJ l&DPJ l$PPT  C (Xj l&dPj l$1P6  C X l&P lXJ T  P[  Xj &aPj C X: l&4P: lX K  PC  XZ &QPZ e  X lXK  LhFPK  XZ &QPZ C Xj l&dPj lX: ӳ  Ҷ  XJ &APJ XZ l\4  5 X &P XJ lLk  d X: &1P: X lS  [ Xj &aPj C 4X: ӳ  Һ XJ l&DPJ lS   PT  j &aZj Pj C AC A\C X: l<X  !&$P` AVkAXJ l'DPJ lC XZ l\he  in `g ,AXj l'dPj lC X: l<X  P PkAXJ l'DPJ lC pXZ e  @j &QPZ 5  8c@j &QPZ X l&P l8 ApXA  LPK  XZ l\Xe  l`!6HZ $aAC X: l&4P: lX tXK  LPC  XZ l\Xe  l`!7HZ ` AFC X: S  $aAX &P C XJ T  'QZ &APJ UB0Xj llX6  <3!0 #%S$jAX |K D#8	C#HZ $iAX[  \PC0e  X: lX  	k#&HZ $iAXJ |LXZ l\Xe  ld ` AC D$aAX: l<X  !ɰ #%[$jALXJ |LXT \ҵ ð AXj l'dPj lC X: ӳ  Һ &1P: C  @J &1P: S  XE@J &1P: 8 ApP |Xa lf!5[$`AfX: |<X K J xZ k  V#7HZ ` A$0P: HX |XK L=4Ap P ,XZ l\Xe  lX: ,<Ic  !#f#HZ ` AL&2P: ,X H
HC  &A;$AhP: H'TPZ lӺ 'Һ #3C XJ |LXT \Xe l2
cPj tC lA P P!X: l<X  A   X PXJ lP  C <XZ P\eA\C *Xj 6  @: &aPj Ӷ  ;@: &aPj 8 ApP |J@ lB0Q U!5P Q Xj llX6  <ӳ  XJ |LT 	#%$P$cA2Xd  l`!?e&a$QAX: |<   P  XJ lLXT  \PZ PXj |lX&  ,A   #X lX[  \PQ  Xj l'dPj lC 4X: t<X lXK  LPC  XZ l'TPZ lC 
Xj llX6  <P: P'dPj lӳ  J x	#%$P$cA^XZ t\Xe  l`!?d&a$QAX: t<   P  XJ tLX$  ,X PA   C XZ l\Xe  l/`  C lX: l<h  i ` ,W  PX lP  C <XJ lLh  i (#j@`  XZ l\he  in .fPe  C  X: l<hC  iN `G ,A
X l`  C XJ lLh$  i. `' ,AXZ l\`  C Xj llh  i ` ,AX: l<`  C X lh  i ` ,AjXJ lL`  C XXZ l\h  i ` ,ATXj ll`  C .X: l<h  i ` ,A	\X l`  C XJ lLh  i (h#++`  C XZ p\hE  iN `J Xj llh&  i. `* $0P6  X K  J &P @ #>h
 i h i )C0@@ #>h i h i )B @ C0&h i hj in )#(XZ l\%aPe  C ,X: l<X  P '4P: lXC  PJ $@PC  XZ e  j &QPZ ` #=X X* ,AC0<` #=X X* ,AB` C0$X X* ,A#(X: l<%P  J @ #8XZ \eA\j ` @#8X: <cA\C VX lXK  LPJ P'P lT  Xk  6  
SP #%$P$bA&A C AC 
X: lP: p'4P: lC X l+h  i +`  C XJ lL%QXd  lVPT  C X: l<h  i ` ,X ph  i ` 0AFXJ lL`  C ~XZ l\he  in Xj plhF  iN ,d`e  C PX: l<h#  i. X ph  i - `#  C "XJ lLXT  \5#  Xj plX  +SPT  C XJ lLXT  \5#  Xj plX  +RPT  C XJ lLh  i XZ p\h  i *`  C Xj llh  i X: p<h  i +`  C ^X lXK  LXZ p\Xe  lFPK  C 4X: l<X  XJ pLXT  \P  #Z`  AނC bHj #6@h 8$19 -C 8 
 ! !w A , X Pz 0C (Xz 0W   HW  ,X8 <P8 Xi W   lX P K   PH `Y ,P B04W   HW  ,$`i ,W   P , 
#2"
X9 B0X4C0XH<LD!=P<8 |ApaAC <X<8 |ApHQ PX<ApaAXh<lX84<c#3C X48 |ApH  P <$VkW  @' ,A  A W   XH <LdXX8\
eA0P4$aA`  AC hW   W   $  !'W   0"%aPh <W   $ 0B  9!.8 <P7 ,0 AP7 0W   $`AW   P , 
!3C 6aAX K  &AK  XX \e  f!6$ $AdC z + 
 -.g A , X $09 ,9 -P9 0Py 4#Xy 4X #6W   y X=$ҳ  ө -Š B0XMT  UC0HA$`W   l$`W   xW   HW  ,Xm$06  $ $	AdH 6B0.$ҩ -AW   HHh 4AW  ,C Z8 |ApHa @h 8ApX1 <ӳ  Ű !5@h 6C (H 68 |ApXa lARH 6@ 4HH 8@H 6C 
AX]<P  C0^W   P XW   HXh XlX8 T<c$PW   `W   HW  ,X<İP<$@ 4XM<@ #6d` AAXX \PX Xh `lA Xh <lfBA0@ 6Ax8 |ApX `P H 68 |ApX P $aAVXH0LD!>XX \PX ` A$aAXm<` @#7Xh lAC F$0@8 :X0C0 H 6@ 8@8 6Xh lAHH 8@H 6HX :!7Xh lPh C c 	 /,/9w P (A , PX $0@8 6W   P PH l$1P4 Ȱ,P A  ( |AH $QPT $:P4 A  ( AH $QPT $:P4 A  ( AH $QPT 0 P4 A  ( A$1P8 H $1P4 ȰN P A  ( AH $QPT 0'P4 A  (AH$QPT $:P4 A  ( A' ,AA W   HW  ,X=<ӳ C0$ɰ #%Ȱ ҳ -X A  Ah$P4iA" , 1 {g},
 &  39+    1 {h}, 1 {i}, 1 {j}, 1 {k}, 1 {l}, 1 {m}, 1 {n}, 1 {o},
 &  40+    1 {p}, 1 {q}, 1 {r}, 1 {s}, 1 {t}, 1 {u}, 1 {v}, 1 {w},
 &  41+    1 {x}, 1 {y}, 1 {z},128+'}',6 {|}, 6 {?}, 6 {~}, 6 {?}
 &  42  
 &  43  %predicate FOUND(%string(*)%name old)
 &  44     %integer q
 &  45     ap = addr(alias text(0))
 &  46     %while ap < Alias Limit %cycle
 &  47        oldp == string(ap)
 &  48        q = ap+length(oldp)+1
 &  49        newp == string(q)
 &  50        %true %if oldp = old
 &  51        ap = q+length(newp)+1
 &  52     %repeat
 &  53     %false
 &  54  %end
 &  55  %Systemroutine LET(%string(63) Old, New)
 &  56     %integer x, lo, ln
 &  57     To Upper(Old)
 &  58     %if found(old) %start            {first remove it}
 &  59        x = addr(newp)+length(newp)+1 {past the end}
 &  60        %while x < Alias Limit %cycle
 &  61           byteinteger(ap) = byteinteger(x)
 &  62           ap = ap+1;  x = x+1
 &  63        %repeat
 &  64        Alias Limit = ap
 &  65     %finish
 &  66     %return %if new = ""             {removal of alias}
 &  67     lo = length(old)
 &  68     ln = length(new)
 &  69     %if lo+ln+Alias Limit+2 > a limit %start
 &  70        console("No room for definition of ".old)
 &  71        %return
         T         X         \         `         d         h $       $ l *       * p 0       0 t 6       6 x <       < | B       B  H       H  N       N  T       T  Z       Z  `       `  f       f  l       l  r       r  x       x  ~       ~                                                                                                                                           ? 0ADSYMFNr           T         X         \         `         d         h $       $ l *       * p 0       0 t 6       6 x <       < | B       B  H       H  N       N  T       T  Z       Z  `       `  f       f  l       l  r       r  x       x  ~       ~                                                                                                                                           ? 0ADSYMFNr  Basic> MFNr                                   TZoo manyToo many Too many Too many Too many Too many Too many Too many Too many Too many Too many Too many Too many Too many Too many Too many Too many Too many Too many Too manySIMPLEnyGOMPLEnyPRINTEnyOLDNTEnyLISTTEnyRUNTTEnyIFNTTEnyTHENTEnyINPUTEnyDIMUTEnyLBMUTEnyRBMUTEnyCOMMAEnyRANMAEnyFORMAEnyEQRMAEnyTORMAEnySTEPAEnyNEXTAEnyPSEPAEnyREMPAEnyDIAGAEnyCONCAEnyLETCAEnyRBIFFEnySBIFF0nySBIFF1nySUBSTRnyUNARYRnyOPERYRnyDATAYRnyREADYRnyRESTOREyONSTOREyERRORREyDUMPRREySTOIRREyPROKILLyFILEWDLyINTEWDLyTABEWDLyAUTOWDLyFILESDLy FILESDLy FILESDLy FILESDLy FILESDLy FILESDLy FILESDLy FILESDLy FILESDLy FILESDLy FILESDLy FILESDLy FILESDLy FILESDLy FILESDLy FILESDLy FILESDLy FILESDLy FILESDLy FILESDLy FILESDLy FILESDLy FILESDLy FILESDLy FILESDLy FILESDLy FILESDLy FILESDLyIDENTDLyIIDENTLyRIDENTLySIDENTLyICONSTLyRCONSTLySCONSTLy SCONSTLy SCONSTLy SCONSTLy SCONSTLy SCONSTLy SCONSTLy SCONSTLy SCONSTLy SCONSTLy SCONSTLy SCONSTLy SCONSTLy SCONSTLy SCONSTLy SCONSTLy SCONSTLy SCONSTLy SCONSTLy SCONSTLy SCONSTLy SCONSTLy SCONSTLy SCONSTLy%PRINTLy%EXPNTLy%REALTLy%INTLTLy%ENCLOSE%DATAOSE%CONAOSE%NULLOSE%NUMCASE%NOVARSEOSCONSTERNCONSTELNOONSTEENDPRTTETARGETTEREAGETTEINPGETTEINDEXRBESCOMPARE SCOMPARENCOMPARESNOMPAREFORIDARECLNODAREULNODARE ULNODARE ULNODARENDIMRBRESDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE SDIMRBRE%FAULTRE%CONVERT%LIMITRT%SETITRT%ADDITRT%TALLYRT%STROPRT%SETTYPE%CHECKNE%CHECKSE %CHECKSE %CHECKSE %CHECKSE %CHECKSE %CHECKSE %CHECKSE %CHECKSE %CHECKSE %CHECKSE %CHECKSESSHECKSEEXPRCKSEITEMCKSEITEMSKSERSIMPKSETSIMPKSEDITEMKSEINDEXKSEDIMPARTESEQPARTECASESRTEIEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTE IEXPRSTESTREXPRE        	         x h _ q                                                                                         Z`\^ZZZ1Z]\^^                                            	    
                                                                                                                                                                               5)!"&+23479:=>  ~6 ɐ                {  {  {@#  |@   @  @#                  z@$  z%~  z@  {        ' ʀ' < @ x{@  z | } y1 y  ̀0_^\[,;8 0_^\[,; 8  @@@ z ̀*  |̀`]-. / @|@ {@      {       ) , & - . /   ! ! 0 1 # 2 3 4 7 ! / 8 &  %   9 ,  ' :    ;     <  /   * )   =   > ; A B 3 C 5 4   D G  H     ? I   M Q R E U    Y J ? I   N Z ;    S [ \ V E U   ]     ^  ` a b c e   f g c i j k l m o p p   r s t u w   s z { | } ~      -    -                                                                                                    w (  1DIAG )e *      1 1 1 ' 1 *  1	 ' 	 1 1 1
 1 1 1	 1 1 1  )"UT = =N ,C 8I 8D 1S ,YE OS ,  K$ -R$ . -UM 7 7 :V 1
  NSION  T	 2 2 -)XP ,R 6R 6D I  C  OR "tX ;< >S >OT     	B 	DBYE NT ;=  T   IL 9 9OG ,  S 
 
T +  8TH 8OD 1OT 0X &u &u sR 1 5 D RO 9PT 9  T  UI  GUN D ,-T nRN n 4ORE 4 ( RK (  3  3 N ,OMISE ! ^LC<0YS EM B$ /wO   %  % R , ,N ,G$ /wR sTCH sV : :O $ M$ -E    N , < SE  1
 1   T        K  W c o                  S Lh     D(<l	           ; G                               G  [pX                    #8        {room for .EXE etc}
 & 221           command_command = command_command . to string(sym)
 & 222        %finish
 & 223        get sym
 & 224     %repeat
 & 225     get sym %while sym = ' '
 & 226     -> error %if command_command = ""
 & 227     -> No Load %if show < 0               {Just decode command}
 & 228  
 & 229     flag = command type
 & 230     %if flag = 0 %start                   {executable program}
 & 231        Load(program, do file)
 & 232        option = program_options
 & 233     %else %if flag > 0                    { %EXTERNALROUTINE }
 & 234        LoadX (command_command, program_spec, option)
 & 235     %finish
 & 236  
 & 237     %if option&nodecode = 0 %start        {Decode command line?}
 & 238  No Load:
 & 239        %if sym type = 7 %start
 & 240           command_modifier = sym
 & 241           get sym %until sym # ' '
 & 242        %finish
 & 243        rb = -1                            { => no param }
 & 244        %if sym type&128 # 0 %start        {Opening bracket?}
 & 245           rb = sym type&127               {Corresponding right bracket )]>}
 & 246           get sym
 & 247        %finish
 & 248     %finish
 & 249  
 & 250     {Scan parm if any}
 & 251     command_parameter = ""
 & 252     %if rb >= 0 %start                 {FRED requires a parm}
 & 253        %cycle
 & 254           %exit %if sym = NL %or sym = rb
 & 255           %if Sym # ' ' %or Option&Spacesx = 0 %start
 & 256              %if length(command_parameter) # 63 %start
 & 257                 command_parameter = Command_parameter.to string(sym)
 & 258              %finish
 & 259           %finish
 & 260           get sym
 & 261        %repeat
 & 262        To upper(command_parameter) %if option&upper # 0
 & 263     %else                              { FRED t^:/t:   we've overshot
 & 264        %if sym # NL %start             {take care: FRED^  - dont back up over 'D'
 & 265           inp = inp - 1
 & 266        %finish                         {nb ^ to right of last sym scanned above}
 & 267     %finish
 & 268  
 & 269     %if rb # 0 %and Set streams (command,input line,inp) # 0 %start
 & 270        %signal 10 %if show < 0
 & 271  Error:%while sym # NL %cycle
 & 272           print symbol (sym)
 & 273           get sym
 & 274        %repeat
 & 275        print symbol ('?');  newline
 & 276        %return
 & 277     %finish
 & 278  
 & 279     %return %if show < 0                          {Don't actually do command}
 & 280     %if skipping = 0 %or char no(command_command,1) = '$' %start
 & 281        Doing (command_command)
 & 282        %if flag = 0 %start                        {Executable program}
 & 283           Run program (program)                   {Loaded before command parse}
 & 284           Unload (Program_Load Point)
 & 285        %else %if flag < 0                         {An obeyfile}
 & 286           Obey (Do file, "OUT:", command_parameter)
 & 287        %else
 & 288           flag = 0                                {Further event 8's now..
 & 289           Run Program (program)                   {assumed to be in 'program'
 & 290        %finish
 & 291     %finish
 & 292     Close all(0)
 & 293  %end
 & 294  
 & 295  %external %routine DO (%string(127) What)
 & 296     Do it (what, 0, command)
 & 297  %end
 & 298  
 & 299  %external %record(command fm) %function PARSE (%string(127) line)
 & 300     %record(command fm) command
 & 301     Do it (line, -1, command)
 & 302     %result = command
 & 303  %end
 & 304  
 & 305  %routine Show Elapsed
 & 306     %integer    N, ms
 & 307     %string(63) S
 & 308     %owninteger Elapsed = 0
 & 309     S  = Time
 & 310     N  = CPU time
 & 311     ms = N - elapsed
 & 312     Elapsed = N
 & 313     %if ms < 1000 %then S = S . ItoS(ms,5) . " milli" %c
 & 314+                  %else S = S . RtoS(ms//1000, 5, 1) . " "
 & 315     S = S . "seconds CPU"
 & 316     Console(S)
 & 317  %end
 & 318  %system %routine OBEY(%string(31) from,to, %string(63) params)
 & 319     %own %string(127) line
 & 320  
 & 321     %routine Get Line
 & 322        %integer Sym
 & 323        %string(17) S
 & 324        Prompt(Command Prompt)
 & 325        Line = ""
 & 326        %cycle
 & 327           Sym = Read symbol;  %return %if Sym = NL
 & 328           %if Sym = '&' %and Next symbol = NL %start
 & 329              Skip symbol
 & 330              S = "&"
 & 331              S = S." " %while length(s) < length(Command Prompt)
 & 332              Prompt(S);  Prompt text = Command Prompt
 & 333           %else
 & 334              Line = Line.Tostring(Sym)
 & 335           %finish
 & 336        %repeat
 & 337     %end
 & 338  
 & 339     %record(FD fm)%name FD,
 & 340+                        Old command,
 & 341+                        Old report == null
 & 342     %record(Parmpfm) Parm
 & 343     %record(Parmpfm) %name Old parmp == Parmp
 & 344     %integer Old echo obey = Echo obey,
 & 345+             Old skip      = Skipping,
 & 346+             Old Segs      = Current Segs,
 & 347+             Old work segs = Work Segs,
 & 348+             Base Load, j
 & 349     %record(Progfm) Prog
 & 350     %own %record(Parm fm) PP
 & 351  
 & 352     %on stream error %start               {End of .COM file or $EXIT}
 & 353        Obey Level   = Obey Level-1
 & 354        Work Segs    = Old work segs
 & 355        Current Segs = Old segs
 & 356        Close in(0,0)
 & 357        In  stream(0) == old command
 & 358  
 & 359        {Restore buffers, which were saved in the files}
 & 360        Read block (old command_key, old command_Bn, addr(old command_buf)) %c
 & 361+          %if old command_key # 0 %and old command_Bn >= 0
 & 362        %if old report ## null %start
 & 363           Close out(0,0)
 & 364           out stream(0) == old report
 & 365           Read block(Old command_key, Old report _Bn + 1,
 & 366+                     Addr(old report_buf)) %if old report_key # 0
 & 367        %finish
 & 368        Select input(0);  Select output(0)
 & 369  
 & 370        Skipping     = old skip
 & 371        Echo Obey    = old echo Obey
 & 372        Parmp       == old parmp
 & 373        %return
 & 374     %finish
 & 375  
 & 376     Parmp == Parm
 & 377     %if Obey Level = 1 %start
 & 378        Relocate(Loaded(Loaded Files)) %if Loadup(Prog, Batch File)
 & 379     %finish
 & 380     Obey Level = Obey Level+1
 & 381     Base Load  = Loaded Files+1
 & 382     %own %byte %name len, p, limit        {Split text param on commas}
 & 383     params = params.","
 & 384     limit == char no(params,length(params))
 & 385     Parm_N = 0
 & 386     p == length(params)
 & 387     %cycle
 & 388        len == p;  j = 0
 & 389        %cycle
 & 390           p == p ++ 1;  j = j + 1
 & 391        %repeat %until p = ','
 & 392        len = j - 1
 & 393        Parm_N = Parm_N+1
 & 394        Parm_Parm(Parm_N) == string(addr(len))
 & 395     %repeat %until p == limit
 & 396  
 & 397     old command == in stream(0)
 & 398     in stream(0)== null FD
 & 399     {Must clear INSTREAM(0), or OPENIN will return the FD pointed at by
 & 400     {OLD COMMAND to the free list when it calls CLOSE IN(0)
 & 401     Open in (0,from)
 & 402     Pack(to, PP_File)
 & 403     %if PP_File_owner # OUT Colon %start  {Change report streams}
 & 404        old report   == out stream(0)
 & 405        out stream(0)== null FD
 & 406        {for output must save half-written buffer in file..}
 & 407        FD == out stream(0)
 & 408        %if FD_key # 0 %start              {forget about NULL:, T:}
 & 409           Write block (FD_key, FD_Bn+1, addr(FD_buf))
 & 410        %finish
 & 411        Open out (0,to)
 & 412     %finish
 & 413     %if State < 0 %start
 & 414        State = State+10
 & 415        Options = Options!Opt Verify %if State # 0
 & 416        Run(Subinit)
 & 417     %finish
 & 418  
 & 419     Current Segs = Current Segs&(~Work Segs)
 & 420     Work Segs    = 0
 & 421     %cycle
 & 422        Doing ("")
 & 423        Select input (0);  Select output (0)
 & 424        Unload(Base Load)
 & 425        Echo Flag = 0
 & 426        Tlib_Name = ""
 & 427        Unstack Conts(1)
 & 428        Tidy Segs
 & 429        Console Int = ""
 & 430        Terminal Mode(0) %if TT Mode # 0
 & 431        Break output
 & 432        Get Line  %until Line # ""
 & 433        Do it (line, 1, command)
 & 434        Show Elapsed %if Options&Opt Monitor # 0
 & 435     %repeat
 & 436  %end
 & 437  
 & 438  %end %of %file
   100  
   101  
   102  
   103  !========= SUBSYSTEM ENTRY POINT =========
   104  
   105  !      Control reaches here when the subsystem
   106  !      is loaded by the system.
   107  !      The floating-point registers contain the startup
   108  !      message.
   109  
   110  %externalroutine subsystem %alias "%GO"
   111     %record(parmfm) P, Q
   112     %record(Contfm) Cont       {contingency info at outer level}
   113     %label          Trap
   114     %integer        N
   115     %ownstring(23)  Batch  In = "T:"
   116     %ownstring(15)  Batch Out = "T:"
   117  
   118     *lhi_0,EVENT
   119     *st_0,4(Gla)               {prepare for events}
   120     *st_0,8(Gla)               {new standard}
   121     *stme_0,P
   122  
   123     *st_Wsp,N
   124     *stm_Gla,Old State
   125     Subsys Limit = N&x'F0000'+Basic Stack Size*1024-200
   126     Stack Limit  = Subsys Limit
   127  
   128     Seg Mask = Seg Mask !! 1<<(Old State_ Gla>>16)  %c
   129+                        !! 1<<(Old State_Code>>16)  %c
   130+                        !! 1<<(N>>16)
   131     SubsysFile_Code Segment = Old State_Code&x'F0000'
   132     SubsysFile_ Gla Segment = Old State_Gla
   133     SubsysFile_Code Base    = SubsysFile_Code Segment+16
   134     SubsysFile_ Gla Base    = SubsysFile_ Gla Segment
   135     SubsysFile_Head        == Record(SubsysFile_Code Base)
   136     SubsysFile_Defs         = SubsysFile_Head_Defs_N
   137     SubsysFile_Specs        = SubsysFile_Head_Specs_N
   138     SubsysFile_Code Head    = SubsysFile_Code Base+SubsysFile_Head_Code Disp&H*2
   139     SubsysFile_ Gla Head    = SubsysFile_ Gla Base
   140     SubsysFile_Stack Limit == Integer(SubsysFile_Gla Segment)
   141     SubsysFile_Stack Limit  = Subsys Limit
   142     SubsysFile_Options      = No Decode
   143     Relocate(SubsysFile)
   144  
   145     A Limit     = Addr(Alias Text(Max Alias))
   146     Alias Limit = Addr(Alias Text(0))
   147  
   148     %if P_Dact = 2 %start                        {a batch job}
   149        State = -10+1
   150        Q_File_Unit  = 0;     Q_File_Owner = 0
   151        Q_File_Name1 = P_P5;  Q_File_Name2 = P_P6
   152        Unpack(P_File, Batch In)
   153        Unpack(Q_File, Batch Out)
   154     %finish
   155  
   156              Init Streams
   157  More:       Unstack Conts(0)
   158              *la_15,Trap
   159              *st_15,Cont+4
   160              *stm_0,Cont+8
   161              *ahi_wsp,300
   162              C Level = Contingency(Cont)
   163              %cycle
   164                 Stack Limit            = Subsys Limit
   165                 SubsysFile_Stack Limit = Stack Limit
   166  
   167                 Current Segs = Seg Mask
   168                 Work    Segs = 0
   169                 Loaded Files = 0
   170                 Obey Level   = 0
   171                 Skipping     = 0
   172                 A Limit      = Addr(Alias Text(Max Alias))
   173                 %unless Addr(Alias Text(0)) <= Alias Limit <= A Limit %start
   174                    Alias Limit = Addr(Alias Text(0))
   175                    Console("All LETs removed")
   176                 %finish
   177                 %unless 0 <= Lib Limit <= 7 %start
   178                    Lib Limit = 0
   179                    Console("LIB list cleared")
   180                 %finish
   181                 Lib(N)_Use = 0 %for N = 1,1,7
   182  
   183                 Obey(Batch In, Batch Out, Version)
   184                 Stop %if State # 0
   185              %repeat
   186  
   187  Trap:
   188  
   189  
   190        {Base level contingencies come here
   191        {There are two cases:
   192        {      1   A terminal interrupt has occurred, in which case
   193        {          either the global string "INT MESSAGE" is set
   194        {      2   A contingency is fired at the current level (Int:.)
   195  
   196        *stme_0,P
   197        N = -1
   198        %if P_Dact = -2 %start                             {shutdown}
   199           P_Dact = -1
   200           Shortinteger(Addr(P_P2)) = 1<<8+'.'             {pretend INT:.}
   201        %finish
   202        %if P_Dact = -1 %start                             {INT:something}
   203           Console Int = String(Addr(P_P2))
   204           N = Charno(Console Int, 1)
   205           %if N # '.' %start
   206              P_P2 = 0
   207              P_P2 = 256 %if N = '?'
   208              P_P3 = P_P1
   209              P_P1 = Addr(Cont)
   210              Svc(27, P)                                    {Resume}
   211           %finish
   212           {Int:.}
   213           P_P1 = 0;  P_P2 = 1;  P_P3 = 0;  Svc(6, P)       {kill output}
   214        %finish
   215        Stack Limit            = Subsys Limit
   216        SubsysFile_Stack Limit = Subsys Limit
   217        Stop %if State # 0                                  {Terminate batch job}
   218        Init Streams
   219        Console ("*Catastrophic failure") %if N < 0
   220        Dump Contingency(Cont) %if Options&Opt Xdump # 0
   221        ->More
   222  
   223  %end
   224  
   225  %endoffile
?HEADFM unused
2032 statements compiled
 H?   t t                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     @?   @   	lO       	lOe     	lO:    m/a      m/ae     ˅        ˅e   B     B:%   Rr`  :   Rr`eG   Rr`<W   RrWX  k   RrWXe|   RrW     RrWe   `{X     `{X:   `{X{                                                                                                                                                                                                                                                                                   %externalstring(31)%fnspec ITOS     (%integer I,places)
%externalintegerfnspec     IN POS
%external %routine %spec   SEEKINPUT(%integer byte)
%external %routine %spec   TO UPPER (%string(*)%name s)
%external %predicate %spec EXISTS   (%string(31) filename)
%external %routine %spec   ALIAS    (%string(*)%name s)
%system   %routine %spec   LET      (%string(63) old, new)
%system %integer %spec     SKIPPING      {Set nonzero to turn off BCI}
%system %integer %spec     ECHO OBEY

%own %integer level = 0                  { $IF nesting level }
%own %integer active level               { level of last cond tested }

!Batch command processor procedures,  ADC

%integer %fn StoI (%string(31) s)
   %integer j, k = 0, d
   %for j = 1,1,length(s) %cycle
      d = char no(s,j)
      k = 10*k + (d-'0') %if d # ' '
   %repeat
   %result = k
%end

%predicate true cond (%string(63)%name cond)
   %string(63) x
   cond = x.cond %while cond -> x.(" ").cond
   To upper (cond)
   %if cond -> ("EXISTS").cond %start
      %true %if exists(cond)
      %false
   %finish
   %if cond -> x.(".EQ.").cond %start
      %true %if x = cond
      %false
   %finish
   Print string (cond."
Syntax?")
   %false
%end

%system %routine EXIT (%string(63) parm)
   %signal 9                             {Simulate end of obeyfile}
%end

%System %routine IF (%string(63) parm)
   %if skipping = 0 %start
      skipping = -1 %unless true cond(parm)
      active level = level
   %finish
   level = level + 1
%end

%System %routine UNLESS (%string(63) parm)
   %if skipping = 0 %start
      skipping = -1 %if true cond(parm)
      active level = level
   %finish
   level = level + 1
%end

%System %routine ELSE (%string(63) parm)
   skipping = ~skipping %if active level = level-1
%end

%System %routine FINISH (%string(63) parm)
   level = level - 1
   skipping = 0 %if level = active level
%end

%System %routine INC (%string(63) parm)
   %string(63) var
   To upper(parm)
   var = parm
   Alias(parm)
   parm = ItoS(StoI(parm)+1,0)
   Let (var,parm)
%end

%System %routine DEC (%string(63) parm)
   %string(63) var
   To upper(parm)
   var = parm
   Alias(parm)
   parm = ItoS(StoI(parm)-1,0)
   Let (var,parm)
%end

%System %routine REPORT (%string(63) parm)
   Print string (parm)
   Newline
%end

%System %routine VERIFY (%string(63) parm)
   To upper (parm)
   ECHO OBEY = 0
   ECHO OBEY = 1 %if parm = "ON"
%end

%const %integer max label = 50
%own %integer %array lab def(1:max label) = -1(*)
%own %string(7) %array lab text(1:max label) = ""(*)
%own %integer defined = 0
%own %integer pend jump = 0

%integer %map lookup (%string(63)%name L)
   %integer j
   To upper (L)
   %for j = 1,1,defined %cycle
      %result == lab def(j) %if lab text(j) = L
   %repeat
   defined = defined + 1
   lab text(defined) = L
   %result == lab def(defined)
%end

%System %routine LABEL (%string(63) parm)
   %integer %name L == look up(parm)
   %if L < 0 %start
      L = in pos                      {Define L as here in command stream}
      SKIPPING = 0 %if addr(L) = pend jump  {Got there}
   %else
      Print string (parm." already defined")
      Newline
      %signal 9
   %finish
%end

%System %routine GOTO (%string(63) parm)
   %integer %name L == look up(parm)
   %if L < 0 %start                      {Undefined as yet}
      SKIPPING = 1                       {Till we hit it}
      pend jump = addr(L)
   %else                                 {Jump backwards}
      Seek input (L)
   %finish
%end

%end %of %file
 H?    <                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !Subsystem command interpreter

%constinteger        Max Alias = 511
%owninteger          Alimit, Ap
%ownstring(*)%name   Oldp,   Newp
%systeminteger       Alias Limit = 0
%systembytearray     Alias Text(0:Max Alias) = 0(*)

%predicate FOUND(%string(*)%name old)
   %integer q
   ap = addr(alias text(0))
   %while ap < Alias Limit %cycle
      oldp == string(ap)
      q = ap+length(oldp)+1
      newp == string(q)
      %true %if oldp = old
      ap = q+length(newp)+1
   %repeat
   %false
%end
%Systemroutine LET(%string(63) Old, New)
   %integer x, lo, ln
   To Upper(Old)
   %if found(old) %start            {first remove it}
      x = addr(newp)+length(newp)+1 {past the end}
      %while x < Alias Limit %cycle
         byteinteger(ap) = byteinteger(x)
         ap = ap+1;  x = x+1
      %repeat
      Alias Limit = ap
   %finish
   %return %if new = ""             {removal of alias}
   lo = length(old)
   ln = length(new)
   %if lo+ln+Alias Limit+2 > a limit %start
      console("No room for definition of ".old)
      %return
   %finish
   string(Alias Limit) = old
   Alias Limit = Alias Limit+lo+1
   string(Alias Limit) = new
   Alias Limit = Alias Limit+ln+1
%end
%externalroutine ALIAS(%string(*)%name old)
   To Upper(old)
   old = newp %if found(old)
%end

%const %integer external not found = {event} 0
%const %string(4) exe = ".EXE", com = ".COM"
%own %record(Progfm) Program
%recordformat Parmpfm(%integer N, %string(*)%namearray Parm(1:9))
%ownrecord(Parmpfm)%name Parmp

%system %integer Skipping  = 0,           { #0: ignore non-system commands }
                 Echo Obey = 0


%external %routine Process Line (%string(*)%name S, %integer Show)
   {Expands any parameters "@n" in the command line}
   {S prefixed by '@' to force aliasing of command verb}
   %integer sym = '@', Flag = 1
   %string(63) x
   %string(255) New = ""
   %integer P = 0, L = Length(S)

   %integerfn Next
      %result = NL %if P = L
      P = P+1
      %result = Charno(S, P)
   %end

   %cycle
      %if Sym = '@' %start
         Sym = Next %until sym # ' '
         %if '0' <= Sym <= '9' %and P # 1 %start
            Sym = Sym - '0'
            %if Sym = 0 %start         { @0 => nesting level }
               New = New . ItoS(Obey Level,0)
            %else
               New = New.Parmp_Parm(Sym) %if Sym <= ParmP_N
            %finish
            Sym = Next
         %else %if Sym = '@' %and P # 1
            New = New."@"
            Sym = Next            { @@ => @ }
         %else
            X = ""
            %while Type(Sym) <= 3 %cycle
               X = X.To String(Sym)
               Sym = Next
            %repeat
            To upper (X)
            doing(x) %if show>=0 %and flag#0       {remember unexpanded verb}
            Alias (X)
            New = New.X
         %finish
         Flag = 0
         %continue
      %finish
      %exit %if Sym = NL
      New = New.To String(Sym)
      Sym = Next
   %repeat
   S = New
   Console(Prompt Text.S) %if (Echo Obey # 0 %or Options&Opt Verify # 0) %and
                              Show > 0                                   %and
                              (Skipping = 0 %or Charno(S, 1) = '$')
%end

%ownstring(37) Do File = ""

%integerfn Command Type
   Do File = Command_Command
   %result = 0 %if Exists(Do File.EXE)
   Do File = Do File.COM
   %result = -1 %if Exists(Do File)
   %if Search Owner # "" %start
      Do File = Search Owner.Command_Command
      %result = 0 %if Exists(Do File.EXE)
      Do File = Do File.COM
      %result = -1 %if Exists(Do File)
   %finish
   %result = 1
%end

%system %routine DO IT (%string(*)%name input line, %integer show)
   {SHOW:    0 /Load program if required, don't echo expanded line
   {       +ve /  "     "     "    "   and echo expanded line (Set Verify)
   %integer Option = 0, flag = 0
   %string(127) Parm
   %on %event external not found,11 %start
      %return %if event_sub = 0          {%STOP is event 0 as well}
      %if Event_Event=11 %start
         Console(Event_Message)
         %return
      %finish
      %if flag # 0 %start                {still in subsys}
         Event_message = command_command." not found"
      %finish
      Console (event_message)
      %return
   %finish

   Command = 0
   Program = 0
   Process Line(Input line, show)
   Extract Command(Command_Command, Parm, Input Line)

   flag = command type
   %if flag = 0 %start                   {executable program}
      Load(program, do file)
      option = program_options
   %else %if flag > 0                    { %EXTERNALROUTINE }
      LoadX (command_command, program_spec, option)
   %else                                 {obey file}
      option = nodecode                  {******new*****}
   %finish


   %return %if show < 0                          {Don't actually do command}
   Parse Parameter(Command, Option, Parm)

   %if skipping = 0 %or char no(command_command,1) = '$' %start
      %if flag = 0 %start                        {Executable program}
         Run program (program)                   {Loaded before command parse}
         Unload (Program_Load Point)
      %else %if flag < 0                         {An obeyfile}
         Obey (Do file, "OUT:", command_parameter)
      %else
         flag = 0                                {Further event 8's now..
         Run Program (program)                   {assumed to be in 'program'
      %finish
   %finish
   Close all(0)
%end

%external %routine DO (%string(127) What)
   Do it (what, 0)
%end

%routine Show Elapsed
   %integer    N, ms
   %string(63) S
   %owninteger Elapsed = 0
   S  = Time
   N  = CPU time
   ms = N - elapsed
   Elapsed = N
   %if ms < 1000 %then S = S . ItoS(ms,5) . " milli" %c
                 %else S = S . RtoS(ms//1000, 5, 1) . " "
   S = S . "seconds CPU"
   Console(S)
%end
%system %routine OBEY(%string(31) from,to, %string(63) params)
   %own %string(127) line

   %routine Get Line
      %integer Sym
      %string(17) S
      Prompt(Command Prompt)
      Line = ""
      %cycle
         Sym = Read symbol;  %return %if Sym = NL
         %if Sym = '&' %and Next symbol = NL %start
            Skip symbol
            S = "&"
            S = S." " %while length(s) < length(Command Prompt)
            Prompt(S);  Prompt text = Command Prompt
         %else
            Line = Line.Tostring(Sym)
         %finish
      %repeat
   %end

   %record(FD fm)%name FD,
                       Old command,
                       Old report == null
   %record(Parmpfm) Parm
   %record(Parmpfm) %name Old parmp == Parmp
   %integer Old echo obey = Echo obey,
            Old skip      = Skipping,
            Old Segs      = Current Segs,
            Old work segs = Work Segs,
            Base Load, j
   %record(Progfm) Prog
   %own %record(Parm fm) PP

   %on stream error %start               {End of .COM file or $EXIT}
      Obey Level   = Obey Level-1
      Work Segs    = Old work segs
      Current Segs = Old segs
      Close in(0,0)
      In  stream(0) == old command

      {Restore buffers, which were saved in the files}
      Read block (old command_key, old command_Bn, addr(old command_buf)) %c
         %if old command_key # 0 %and old command_Bn >= 0
      %if old report ## null %start
         Close out(0,0)
         out stream(0) == old report
         Read block(Old command_key, Old report _Bn + 1,
                    Addr(old report_buf)) %if old report_key # 0
      %finish
      Select input(0);  Select output(0)

      Skipping     = old skip
      Echo Obey    = old echo Obey
      Parmp       == old parmp
      %return
   %finish

   Parmp == Parm
   %if Obey Level = 1 %start
      Relocate(Loaded(Loaded Files)) %if Loadup(Prog, Batch File)
   %finish
   Obey Level = Obey Level+1
   Base Load  = Loaded Files+1
   %own %byte %name len, p, limit        {Split text param on commas}
   params = params.","
   limit == char no(params,length(params))
   Parm_N = 0
   p == length(params)
   %cycle
      len == p;  j = 0
      %cycle
         p == p ++ 1;  j = j + 1
      %repeat %until p = ','
      len = j - 1
      Parm_N = Parm_N+1
      Parm_Parm(Parm_N) == string(addr(len))
   %repeat %until p == limit

   old command == in stream(0)
   in stream(0)== null FD
   {Must clear INSTREAM(0), or OPENIN will return the FD pointed at by
   {OLD COMMAND to the free list when it calls CLOSE IN(0)
   Open in (0,from)
   Pack(to, PP_File)
   %if PP_File_owner # OUT Colon %start  {Change report streams}
      old report   == out stream(0)
      out stream(0)== null FD
      {for output must save half-written buffer in file..}
      FD == out stream(0)
      %if FD_key # 0 %start              {forget about NULL:, T:}
         Write block (FD_key, FD_Bn+1, addr(FD_buf))
      %finish
      Open out (0,to)
   %finish
   %if State < 0 %start
      State = State+10
      Options = Options!Opt Verify %if State # 0
      Run(Subinit)
   %finish

   Current Segs = Current Segs&(~Work Segs)
   Work Segs    = 0
   %cycle
      Doing ("")
      Select input (0);  Select output (0)
      Unload(Base Load)
      Echo Flag = 0
      Tlib_Name = ""
      Unstack Conts(1)
      Tidy Segs
      Console Int = ""
      Terminal Mode(0) %if TT Mode # 0
      Break output
      Get Line  %until Line # ""
      Do it (line, 1)
      Show Elapsed %if Options&Opt Monitor # 0
   %repeat
%end

%end %of %file
 H?    D                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ! General compiler driver
!!  COMPILE  lang|compilation parms  in/out

!!%option "NoStack,NoDecode"
%include "Sysinc:command.inc"

{Include file for compiler communication}
%recordformat impcomfm(%integer statements, flags, code, gla, diags, perm,
                        %string(31) file,
                        %string(63) Option)
%externalrecord(impcomfm) IMPCOM

%externalintegerfnspec OUT TYPE
%externalpredicatespec EXISTS(%string(63) file)
%externalroutinespec   DELETE FILE(%string(63) file)
%externalroutinespec   DOING(%string(15) S)
%Systemroutinespec   SRUN(%string(63) what)
%externalroutinespec   TO LOWER(%string(*)%name s)
%externalroutinespec To Upper(%string(*)%name s)
%externalroutinespec   CPU LIMIT(%integer n)
%externalroutinespec   OPTION(%string(63) P)

%externalroutine COMPILE %alias "%go"
   %conststring(15) pass2       = "imp:PASS2",
                    pass3       = "imp:PASS3"
   %string(31) prim,
               language,
               pass1,
               default ext
   %string(63) Param = Command_parameter
   %integer j, return code, lines
   %string(31) source file, object  file, listing file, source
   %string(31) temp1 = "", temp2 = "", temp3 = ""
   %string(31) work
   %integer options

   ! used for accumulating timing data
   %integer  x1, x2, x3

%integerfn  option bits(%string(63)  opt)
   %integer  initial
   %integer  include, exclude, item , item no, p, no
   %string(15)  item word
   %constinteger  options = 14
   %conststring(8)%array  option word(1:options) =
      "default",      "opt",  "trusted",
   !    512+31       256+0      32
      "capacity",  "assign",    "array",  "extra",
   !      1           2         4        16
      "suppress", "partial", "diags",  "timer",
   !     128         256       512     x'4000'
      "brief",      "trace",  "hide"
   ! x'1000',         64
   %constshortintegerarray  option mask(1:options) =
      X'821F',   X'8100',   X'8020',
            1,         2,         4,       16,
          128,       256,       512,  x'4000',
      x'1000',        64,    x'0900'

   %integerfn  known item
      %integer  n,sym
      %string(15)  s, t

      item word = ""
      opt -> item word.(",").opt
      no = 0
      %if item word -> s.("no").t %start
         %if s = "" %then item word = t %and no = 2
      %finish
      %for n = 1,1,options %cycle
         %result=n %if item word = option word(n)
      %repeat
      %result = 0
   %end {of known item}

   initial = option mask(1)&x'7FFF';      ! default
   include = 0;  exclude = 0
   to lower(opt)
   opt = opt.","
   %while opt # "" %cycle
      item no = known item
      %if item no # 0 %start
         item = option mask(item no)
         %if item < 0 %start;      ! reset completely
            initial = item & x'7FFF'
         %else
            %if no # 0 %start
               exclude = exclude ! item
            %else
               include = include ! item
            %finish
         %finish
      %else %if item word # ""
         print string(item word); print symbol('?')
         newline
      %finish
   %repeat
   %result = (initial & (\exclude)) ! include
%end;      ! 'option bits'

   %routine close in(%integer st)
      select input(st);  close input
   %end
   %routine close out(%integer st)
      select output(st);  close output
   %end
   %string(31)%fn temp file
      %string(1) work
      %record(parmfm) p
      p_dact = 25;  svc(20, p)
      p_p4 = p_p4&x'FFFF'
      %if p_p4 > 26 %then work = tostring(p_p4-27+'0') %c
                    %else work = tostring(p_p4+'a'-1)
      %result = "$tmp.".work
   %end
   %routine print pass(%integer pass, time)
      %if pass = 0 %start
         print string("mean ")
      %else
         print string("pass");  write(pass,-1)
      %finish
      write( (2*time+1)//2000,5);  print string(" secs")
      write(60*1000*lines//time,5);  print string(" statements/min")
      newline
   %end
   %routine show result(%integer n)
      %if n < 0 %start
         printstring("Program contains")
         write(-n, 1)
         printstring(" fault")
         printsymbol('s') %if n # -1
      %else
         write(n, -4)
         printstring(" statements compiled")
      %finish
      newline
   %end
   %routine Fail(%string(63) Why)
      Printstring(Language." fails -- " . Why . snl)
      %stop
   %end

   %on 9,10,11 %start
      Select Output(0)
      Fail(EVENT_Message)
   %finish

   To upper(param)
   %unless param -> language.("|").param %start
      printstring("Which language?");  newline
      %return
   %finish
   %if Language = "IMP" %start
      pass1 = "IMP:Pass1"
      prim = "IMP:Prims"
      Default ext = ".imp"
   %else %if Language = "PASCAL"
      pass1 = "PASCAL:Pass1"
      prim = "PASCAL:Prims"
      Default ext = ".pas"
   %else %if Language = "FORTRAN"
      pass1 = "FORTRAN:Pass1"
      prim = ""
      Default ext = ".ftn"
   %else
      printstring(language." not available");  newline
      %return
   %finish
   parse parameter(command,0,param)          {%signal 11,10 on failure}

! ******** set compiler options *********
   options = option bits(command_parameter)

   source file = command_in1
   listing file = command_out1
   object file = command_out2
   to lower(source file)
   to lower(object file)
   to lower(listing file)

   IMPCOM_option = "";            ! %OPTION string

   %if source file -> source.(".").work %start      {extension given}
      %unless exists(source file) %start
Noex:    Fail(Source file." does not exist")
      %finish
   %else
      source = source file                          {no extension}
      %unless exists(source) %start
         work = source file.default ext
         ->noex %unless exists(work)
         source file = work
      %finish
   %finish
   %if source -> work.(":").source %start;  %finish
   %if object file = "" %start
      object file = source.".exe"
   %else %unless object file -> (".")
      object file = object file.".exe" %unless object file = "n:"
   %finish
   %if object file = "n:" %or object file = "null:" %start
      temp1 = "n:"
   %else
      temp1 = temp file
   %finish
   cpu limit(60*10)      {10 minutes}
   x1 = cpu time
   %if Source file = Listing File %start
      Printstring("Overwrite source file with listing?")
      Newline
      %return
   %finish

   open input(1, source file)
   open input(2, prim) %unless prim = ""
   open output(2, listing file)
   open output(1, temp1)
   open output(3, "t:")

   select output(2)
   options = options!x'1000' %if out type = 0     {null:}
   options = options!x'2000' %if out type < 0    {t:} 
   IMPCOM_flags = options
   printstring("Source file: ");  printstring(source file)
   printstring("     compiled on ")
   printstring(date);  printstring(" at ");  printstring(time)
   newline
   printstring("Object file: ");  printstring(object file);  newlines(2)
   doing("First pass")
   Srun(pass1)
   lines = impcom_statements
   select output(2);  show result(lines)
   select output(0)
   close in(1);  close in(2)
   close out(1);  close out(2);  close out(3)
   ->done1 %if lines < 0


   ->done %if temp1 = "n:"
   x2 = cpu time

   open input(1, temp1)
   temp2 = temp file;  open output(1, temp2)
   temp3 = temp file;  open output(2, temp3)
   doing("Second pass")
   cpu limit(60*5)      {5 minutes}
   Srun(pass2)

   close in(1)
   close out(1);  close out(2)

   x3 = cpu time

   open input(1, temp2);  open input(2, temp3)
   impcom_file = object file;      ! pass 3 opens its own DA file
   doing("Final pass")
   cpu limit(60*4)         {4 minutes}
   Srun(pass3)
   %if IMPCOM_Option # "" %start
      option("[".IMPCOM_Option."]".Object file)
   %finish

done:selectoutput(0)
      %if command_modifier # 0 %start
         printstring("Code");  write(impcom_code, 1)
         printstring(" + Perm");  write(impcom_perm, 1)
         printstring(" + Glap");  write(impcom_gla, 1)
         printstring(" + Diags");  write(impcom_diags, 1)
         printstring(" =")
         write(impcom_code+impcom_perm+impcom_gla+impcom_diags, 1)
         printstring(" bytes")
         newline
      %finish
     %if options & x'4000' # 0 %start
        x1 = x2-x1;  x2 = x3-x2;  x3 = cputime - x3
        print pass(1,x1); print pass(2,x2); print pass(3,x3)
        print pass(0,x1+x2+x3)
     %finish
stop:    delete file(temp2);  delete file(temp3)
done1:   delete file(temp1)
         select output(0)
         show result(lines)
         doing("")
%end
%endoffile
 H?    X                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!       	  
@0 }H     2      	   :X%     H      NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    %Qv   #p}SId:w	Ra@  #	y    "e&@aX    p    da]p  mfp  ULu;`  `T:       9;=? dfC0 bytes  =  + Diags  + Glap + PermCode [
Final pass Second passn: 
First pass Object file:  at       compiled on Source file: t: #Overwrite source file with listing?n: null:n: .exe n: ..exe : does not exist. not available .ftn FORTRAN:Pass1FORTRAN.pas PASCAL:Prims PASCAL:Pass1 PASCAL .imp 	IMP:Prims	IMP:Pass1IMPWhich language?|
 fails --   statements compiled  fault Program contains  statements/min secspass mean $tmp.no ,         @   @	             defaultSoptaultStrustedScapacityassigntyarrayntyextrantysuppresspartialsdiagsalstimeralsbriefalstracealshideeals`            	   	imp:PASS3	imp:PASS2                            
   90'H  !34  1  0 !81 !5$$A> rB  @ !4B ";
C@ !$$A> r#$$A> rB  C
B$P#E  E  &Q'1"C  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
ns_  eX!34RUUh!34dffз  ӳ  Ű !4Գ #9    !8 !5$$A> rB$ C08 L  #9&"C  "
  'M  M   >' ("#4\BbD#:  
  nBJ"#<  #M  M  '"DC0  
$#M  M  &'"%ѷ  C $ "ѷ  $$A> r?$$A> r$A1    0#
#	QD   RD   ?&A'"3  $$A> rA> r?1  34C0  D   D   
C M w p T$ 9 ,) CA*?A.$@PI 2* 4J DA*#=Z 4U!9) At$bPi $&P ,$9<Z=p #A8!5z  B0$" H
w ) ,Atp XxH< 0P9 l$P pP ti?  ,W  @Ƞ ,I ,&AҩD  ,I ,Y ,UC0|AP |C0:
ZxHa  Pi x#`Pi l#X #7X9 t6P9 t#X pP pC 0ө C0& W   H` ?W   <W  ,C z%A[I tTI lV py  x	g p ,W   `W   y  	g p ,W   lW   y  	w p T @ 2r	 0  q	 0s9 FP9 D0 #/ȳ   @	 P) , PAt#ȣ `
  @	 R) , RAt' ,At ,A     Aby  F	W  p ,f!:W   HC W   H%QXi W   TX  
\ E@ 0Ce$UW   TW   HX @  `;#  ])  c$UW   TW   HW  ,y  \	g p ,fCHW   H$`[i $QW   TW   HX #8` sW   <#%TW   TW   HW  ,y  C	w ) ,Atp l' , LAtA    ,A   A   W   H$ Ap +	w P (p( Xp At$08x88Px#Xx$`W   lXL A\h?  W  L8 ( LCA*?B0W   HW  ,x .A8B0(( lvAt( ,lAt( fAtC  L.^A8B0(( lPAt( ,BAt( <AtC Z.4A8B0"( l&At$08 ,(  AtC ,' ,AtA   W   HW  ,C 2 $PXmpW  Xp A$P( Xp  At(8 At( Ath  W  @h W  @h 8W  @$ҝ8 (XHA*C0.W  !?' , AtA   AC LAtW  B06( At A   W  !3C ( At8X(CA*#1HD!=(AtA   C .8$ BA*  !>.A8#8(A   .A8#6.A8!8(xAt#A(xAt`XW  XW   P (8A8!?W   HW  ,C @$aW   xX ,U#9 ,$bW   x8$bW   x$aW   $cW   $bW   lW  !7Xh` PhW  #X  PX8P=W   H W   HW   HW   W   HW   HW   W   HW  ,W   HW   H$bW  8tW  ( lW  4XP $bW   lXh Ap$`W   l$aA$bA$aA$bA$cAX #C x.pA8!3C <W   P x$aW   xA(At$aW   A(At$bW   dW  (`,W  XW  4$aA$aA6$bA0W   P$aW   x$bW   x-AtXW  (` W  XW  4ӝC0@' ,VAtA   B  &AP ]RD   B  A   W  d$`W   lXmpX C0PW   H$QXmW   THW   H$QXmW   T@W   H$QXmW   T6W   H$QXmW   T2W   HX=Z=Z=cZm$QW   T*W   HW  ,Xð@ C0\X [PX[ P W   [PXX$aA"XX $bAXX$cAXHZH TZX$`AW  W  xW  $`W   lXh AtW  (C @ _mA" (A  C .8$ BA  !>.A#8(A" .A#6.A!8(xA #AP(xA  `XW  XW   P (8A!?W   HW  ,C 
$aW   xh ,f#9 ,$bW   x8$bW   x$aW   $cW   $bW   lW  !9X8<0 P8W  #Xư  PXPW   H W   HW   HW   W   HW   HW   W   HW  ,~W   HW   H$bW  8rW  ( lW  4XP $bW   lXh lA$`W   l$aA$bA$aA8$bA2$cA,XH LD#C x.nA!3C 8W   P x$aW   xA(A  $aW   A(A  $bW   bW  (`,W  XW  4$aAT$aA~$bAxW   P$aW   x                  "         &         *         .         2 $       $ 6 *       * : 0       0 > 6       6 B <       < F B       B J H       H N N       N R T       T V Z       Z Z `       ` ^ f       f b l       l f r       r j x       x n ~       ~ r         v         z         ~                                                                                                                                                                                                                  &      & ,      , 2    # 0Xo L#7 8AAC o A -FA&!7$P`	A#$Q`	AC `o Ao f!6%PxC H ' ,AdJAA.Xo TPoxB "AInvalid passwordeAAC X_x`	ABC o dAjo Ab AXo TB "AIllegal subsystemAAC Po @X XP DX \P H d' ,ALAAXo TB  AIllegal processAlA^C VX PP 8Po <   P Lr 0  mq 0Xo LC00A H?    j                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %string(9)%fn Weekday
   %conststring(9)%array day(0:6) = "Sunday", "Monday", "Tuesday",
                                    "Wednesday", "Thursday", "Friday",
                                    "Saturday"
   %record(parmfm) p
   %integer d
   svc(19, p)
   d = rem(p_p4+3, 7)
   %result = Day(d)
%end
%begin
   printstring(Weekday);  space
   printstring(date);        space
   printstring(time);        newline
%endofprogram
 H?    {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !MOUSES file dumper utility.
%own %string(31) version = "vsn 2"
%OPTION "NOOPEN,NOSPACES,NOSTACK,UPPER"
!Alan Culloch,    August 1980.

!system calls
%const %integer disc read = 101
%const %integer to director = 20
%const %integer pack filename = 17
%const %integer find unit = 45

%begin
   %externalintegerfnspec StoI(%string(63) S)
   %externalstring(63)%fnspec ItoS(%integer N, P)
   %externalroutinespec Open Da(%integer Chan, RW, %string(63) File)
   %externalroutinespec Read Da(%integer Chan, Block, %name Buff)
   %externalroutinespec Close Da(%integer Chan)
   %const %integer non zero = 1
   %const %integer infinity = 16_7FFFFFFF
   %const %integer FF = 12;              !ASCII formfeed character
   %record %format block fm (%integer %array word(0:512//4 - 1))
   %record(block fm) block
   %record(parm fm) P
   %integer offset;                      !word index in BLOCK

   %include "Sysinc:command.Inc"

   !Events
   %const %integer DA trap = 12;         !signalled on READ DA bad block#
                                         !(used as E-O-F trap on seq. read).
   !Output display characteristics
   %integer page ht = 60,line width = 80;!defaults
   %integer j
   %for j = 1,1,length(Command_Out1) %cycle
      line width = 132 %if char no (Command_Out1,j) = ':';   !assume LP:
   %repeat
   %integer N words;                     !# of 32-bit words per dump line
   %integer firsttry;                    !!!!!!
   %integer rows;                        !# of dump lines per block
   %integer N fields;                    !# of (hex,oct,..) fields wanted
   %integer first = 0, last = infinity;  !default range of blocks to dump
   %integer physical = 0;                !0:from file; #0:direct disc reads
   %integer unit;                        !physical unit no.
   %integer squeeze = non zero;          !to suppress formfeeds
   %integer decoding = 0

   !Dump format is any comb. of hex, octal and straight ASCII
   !side-by-side on the page, with each dump line optionally
   !follwed by an ASCII decode of the words.

   %const %integer hex = 1<<1,
                 octal = 1<<2,
                 ASCII = 1<<3,
               decoded = 1<<4,
               formats = 3
   %integer wants = 0;                   !gets undecoded hex dump by default

   %routine report (%string(63) message)
      print string (message);  newline
   %end

   %integer lines = 0

   %routine break;                       !keeps track of lines for formfeeds
      newline;  lines = lines + 1
   %end

   %routine decode parm;                 !interprets program parameter
      %string(63) s, t
      %integer j
      wants = wants ! decoded %if Command_Modifier # 0
      Command_Parameter = Command_Parameter . ","
      %while Command_Parameter -> s . (",") . Command_Parameter %cycle
         %continue %if s = ""
         %if s = "HEX" %start
            wants = wants ! hex
         %else %if s = "OCTAL"
            wants = wants ! octal
         %else %if s = "ASCII"
            wants = wants ! ASCII
         %else %if s = "PAGED"
            squeeze = 0
         %else %if s -> s . ("..") . t
            t = itos(infinity, 0) %if t = ""
            first = stoi (s);  last = stoi (t)
            %if first < 0 %or last < 0 %start
               report (s . ".." . t . "?")
               %stop
            %finish
         %else %if stoi(s) >= 0
            first = stoi(s);  last = first; !single block
         %else %if s -> s . ("=") . t
            %if s = "PAGE" %start
               page ht = stoi (t)
            %else %if s = "WIDTH"
               line width = stoi (t)
            %else %if s = "DISC"
               physical = non zero
               %if t -> ("#") . t %start;   !unit #n
                  unit = stoi (t)
               %else
                  String(addr(P_Dact)) = t . "_:";  SVC (pack filename,P)
                  P_dact = find unit;  SVC (to director,P)
                  %if P_p6 # 0 %start
                     print string (P_text)
                     newline
                     %stop
                  %finish
                  unit = P_p1
               %finish
               print string ("Dumping unit #");  write(unit,0);  newline
            %else
               report (s . "=?")
               %stop
            %finish
            report (t."?") %and %stop %if line width < 0 %or
                                             page ht < 0;   !STOI faults?
         %else
            report (s . "?")
            %stop
         %finish
      %repeat
      wants = wants ! hex %if wants & (hex!octal!ASCII) = 0;   !hex default
      N fields = 0
      %for j = 1,1,formats+4 %cycle
         N fields = N fields + 1 %if wants & 1<<j # 0
      %repeat
   %end

   %routine dump ASCII (%integer word, sp); !SP = padding per character
      %routine do (%integer word)
         %integer j,k
         %for j = 1,1,3 %cycle
            k = rem (word,37);  word = word//37
            %if k = 0 %then space %else %start
               %if k <= 26 %start
                  print symbol (k + 'A' - 1)
               %else
                  print symbol (k - 27 + '0')
               %finish
            %finish
         %repeat
      %end
      %integer j, k
      %if decoding = 0 %or Command_Modifier # '?' %start;   !straight ASCII
         %for j = 1,1,4 %cycle
            spaces (sp)
            k = (word>>(3*8)) & 127;  word = word<<8
            %if k < ' ' %or k = 127 %then space %else print symbol (k)
         %repeat
      %else;                             !packed decode
         spaces (4*sp + 4 - 6)
         do (word>>16);  do(word&X'FFFF')
      %finish
   %end

   %routine phex (%integer n)
      %integer j,k
      %for j = 7*4, -4, 0 %cycle
         k = n>>j & x'F'
         %if k >= 10 %then print symbol (k - 10 + 'A') %c
                     %else print symbol (k + '0')
      %repeat
   %end

   %routine poct (%integer n)
      %integer j
      print symbol (n>>j & 7 + '0') %for j = 30, -3, 0
   %end

   %routine print decoded (%integer n, from)
      !dump the ASCII translation of the N words
      !starting at FROM under each of the format
      !part of the last dump line
      %integer j,k
      decoding = non zero
      spaces (4);  print symbol ('|')
      %for j = 1,1,formats %cycle
         %if wants & 1<<j # 0 %start
            spaces (2) %if 1<<j = octal
            %for k = from, 1, from + n - 1 %cycle
               %if 1<<j = hex %start
                  space
                  dump ASCII (block_word(k),1)
               %else %if 1<<j = octal
                  dump ASCII (block_word(k),2);   !4*(2+1) = 12 = octal field
               %else; !ASCII - dont do it again
                  spaces (4)
               %finish
            %repeat
         %finish
      %repeat
      decoding = 0
   %end

   %routine read block (%integer block no)
      %record(Parm fm) P
      read DA (1,block no,block) %and %return %if physical = 0
      P_p1 = block no;  P_p2 = addr(block);  P_p3 = unit;  P_p4 = 0
      SVC (disc read,P)
      %if P_p1 # 0 %start
         print string ("*cannot read block")
         write (block no,1);  print string (" from unit")
         write (unit,1);  print string (", status:")
         write (P_p1,1);  newline
         %stop
      %finish
   %end

   !Main program

   %on DA trap %start
      close DA (1)
      close output
      %stop
   %finish

   %integer len, block ht, block no
   %integer k, m, save

   !Calc no. of words per row of dumped block,
   !fitting in all required output formats for
   !each word

   decode parm
   len = 0;  len = len + 9 %if wants & hex # 0
             len = len +12 %if wants & octal # 0
             len = len + 4 %if wants & ASCII # 0
   N words = (line width - 5 { nnn|} - N fields) // len

   !Turn NWORDS down till a block will be printed
   !as an integral number of full rows

   first try = N words;                  !!!!
   %cycle
      %if N words = 0 %start
         report ("Won't fit!")
         %stop
      %finish
      %exit %if rem (512//4,N words) = 0
      N words = N words - 1
   %repeat

   !Now we can find the number of lines the dump
   !of a single block will occupy

   rows = (512//4) // N words
   block ht = rows
   block ht = 2*rows %if wants & decoded # 0;  !ASCII decode under each line
   block ht = 3 {header lines} + block ht
   squeeze = non zero {ignore PAGED option} %if block ht >= page ht

   open DA (1, 0, Command_In1) %if physical = 0
   open output (1,Command_Out1)
   select output (1)
   print symbol (FF)
   break

   block no = first - 1
   %cycle
      block no = block no + 1
      %exit %if block no > last
      read block (block no); !%SIGNAL when it falls off
      %if lines + block ht >= page ht %start
         print symbol (FF) %and newline %if squeeze = 0
         lines = 0
      %finish
      break;  print string ("Block #");  write (block no,0)
      break
      break
      offset = 0
      %for j = 1,1,rows %cycle
         write (4*offset,3) {byte offset};  print symbol ('|')
         %for k = 1,1,formats %cycle
            space %if 1<<k = ASCII %and wants&(\(ASCII!decoded)) # 0
            !(don't jam ASCII dump up against octal one)
            %if wants & 1<<k # 0 %start
               space
               save = offset
               %for m = 1,1,N words %cycle
                  %if 1<<k = hex %start
                     space
                     phex (block_word(offset))
                  %else %if 1<<k = octal
                     space
                     poct (block_word(offset))
                  %else %if 1<<k = ASCII
                     dump ASCII (block_word(offset),0)
                  %finish %else %monitor %and %stop
                  offset = offset + 1
               %repeat
               offset = save
            %finish
         %repeat
         break
         print decoded (N words,offset) %and break %if wants & decoded # 0
         offset = offset + N words
      %repeat
   %repeat

%end %of %program
 H?    }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
 C!       J  	^  }"              "      NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    y8@    ;ov    `EX!    qI    w@  %Qv       PA-Block #
Won't fit! 	, status:
 from unit *cannot read block =? Dumping unit # _: #DISC WIDTHPAGE =.. .. PAGEDASCIIOCTALHEX  ,                                       
   9H  !34  1  0 !81 !5$$A> rB  @ !4B ";
C@ !$$A> r#$$A> rB  C
B$P#E  E  &Q'1"C  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
ns_  eX!34RUUh!34dffз  ӳ  Ű !4Գ #9    !8 !5$$A> rB$ C08 L  #9&"C  "
  'M  M   >' ("#4\BbD#:  
  nBJ"#<  #M  M  '"DC0  
$#M  M  &'"%ѷ  C $ "ѷ  $$A> r$A1    0#
#	QD   RD   ?&A'"3A> r?1  34C0  D   D   
C A w ) ,A\p lW   HW  ,y  	w p ,W  ,$Qy  	w p XX< #7Xư PȠ ,L &AҬD  L X]5 ) ,CA*??C0i ,f!3C  ,.A.!9X PC .A.!9X80 P8C .A.!9Xư PC .A.!6$PC 1!I lA*??C0Y lU!>$P`W  |) lA\ ,W  pPp lW  pPtXhp!CD' , ,A\A    lA     &0 ?2L     AF$ AXC  ,W  p! ,W  pPpPtC 9 ,#I lA*??C0z.A.!< lW  pPPC  ,.A.!< lW  pPTC .A.B0$Px9 l$ CA* ?#;W  pP|C f(.A\A   r,  q,Ƞ -@.r,  q,XHHC0"4W   HW  ,$ AXXX4PX|xW   H$PXh|W   TW  ,C &' , ,A\tA   A$ AXXhT!XPC0' , lA\2  &1Ȱ ?ҲC   2  A$ AXC 0' , ,A\Ӣ  &@ ?BJ   Ң  AT$ AXC XXP !5P PX$`Phl&P $1<  T8#4$Ql  >y Ӏ	g p 4$&P ,XZ E@ 0 %CPJ 0X: #  Ȱ %+P: D!8W  C $@ !)d @W   <#d W   <X , B0z  C
W  p 4X#9X=X Ű ?C0d$&P ,Xi  W   XI @ @ PI 0XY XPY @  !@ !7W  #dW   <X ,Š B0C "Xi  b'bW   si Asi Ay  X	g p 4  'P ,X9 <  0 P9 00 
!c 7W   <#c 0W   <X ,B0y  .	g p 0 !'P ,X9 <  0 c 0W   <X ,B0y  !	W  p <$P$dW   ` |W   <$0&1P9 ,$  TC0$  Š !7$bW   XI  ZI 'API 4XY  'QPY 0C z&QPY 0$aX ,l  ` B0&W  X9 02Z=8 ,$QXc  AC 8$  Ű B0RZ]X ,PY 8$RX 8Xj  A#$dW   XY 0UY 4B0~X9 ,0 B0*$@PHy  	g p LXxB0$8 ,P7 ,0 P7 0V$aW  y Pi 4ȸ ,P 8X|P <$@PI @r	 ,  eq	 ,XY 4C0n`W   H$QXi W   TTW   H$QXh|W   TJW   H$QXi 4W   TW  ,$ AXC Z m	w P (p <PP0 PP8TXӫ P\$PXC "&PXXMT 
Ye  ` :!5 PTU\B0$0P8pPtP8x$PP8P8$PPxC $Xx$aW  W   $ AXA$PX80 #4&P0 #4&P0 #4&PXT'[l[E@ LPX`PXdX`!:>A6$ AX0 #  *"!2#'P`C P E@ JPXhPXXÐ #4
UPX$CQHXhYhP!$PX8x!<X  $P$aW  X $aW   $aW   l$lW   <AXp'P$AQHXXYXt##C  eAHXhZhYhPB"X!<$lW   <W  ,$0P8Ab6W   H$PXhW   TA@A<$PLXhP\PXC z&PXXhLb$SW   T` |W   <$@&APH$QT  P !;Xh`#6W  $X8  TC0W  XLPX`P$PC &P$AXXE  @ B0$W  XhLbZmh ,Xf  AhC j$   B0$W  X8L2Z=8 ,Xc  AC 8$  Ű !>XLZʨ ,$PXj  A^#
$ %AXAX$QLXUB0HXHPHLXH@ B0AXXP #9XXLXh`AXAXh`QhLXXU\B0~C x @ gy   <X9 ,U9 0A3B0P 0y  0	W  A$ , X $1P8$dW   ` |W   <$&P ,P 4X+Ab$AB  C0+Ab$QR  P !7$bW   Xi  Zi 'aPi <X9  '1$!AP9 0C &1P9 0P9 8X) ,,Ab$  Ű B00W  X 0=A ,$QXa  lAPC <Ab$  Š B0=A ,$RXa  lA#$dW   X9 0U9 8AU9 <B0\P 8X ,U 4AŰ B0P 4$@PHy  	g A$ , X X8|<3B0$H ,PG ,@ PG 0V$aW  y Pi 4H ,PI 8XX\PY <$`Pi @r	 ,  eq	 ,X9 4<3C0vXW   H$QXi W   TLW   H$QXhlW   TBW   H$QXi 4lW   TW  ,$ AC H }	w P (A$ , X 0 <P8P@ PPHTX]\e Ph`$0$!AP8XC 8&1P8XP8\X #Ap ӡ  Š :!5Ȑ PTU8\AU8`B0P\$@PHtPPXxPH|$aPhPHPH$0P8PxC $Xx$aW  W   $ AAX$0P8Xð #4&9P8ð #4&<P8ð #4&4P8XT'Xp                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |          vsn 2 #it!ad blockPP]PZ 0P]                                                       c \   Q ]   d ^  e _   `  H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        !Subsystem file handling routines

%systemroutine  OFFER (%string(31)  file name, %integer copies, mode flags,
                                       %string(7) destination)
   %record(parmfm)  from, to
   pack(file name, from_file)
   pack(destination, to_file)
   %if to_p2 = 0 %start
      event_message = "to whom?"
      %signal lib error,13
   %finish
   %if from_p1 # 0 %or from_p2 # 0 %start
      event_message = "whose file?"
      %signal lib error,13
   %finish
   to_p5 = from_p3;  to_p6 = from_p4
   to_p1 = to_p2
   to_dact = 1;  svc(22,to)
   %if to_p6 # 0 %start
      event_message = to_text   {message from POTTER}
      %signal lib error,13
   %finish
%end

%externalpredicate EXISTS(%string(63) File)
   %record(parmfm) P
   %on 10 {PACK fails} %start
      %false {cant exist - illegal name}
   %finish
   Pack(File, P_File)
   P_dact = Direct Status;  svc(20, P);    !status
   %false %if P_P6 # 0
   %true
%end

%externalroutine DELETE FILE(%string(63) file)
   %record(file fm) F
   Pack(file, F);  Del file(F, 0)
%end

%external %routine RENAME FILE(%string(25) old name, new name)
   %record(parmfm) old, new
   pack(old name, old_File)
   pack(new name, new_File)
   old_p5 = new_p3;  old_p6 = new_p4
   Director(Direct Rename, Old)
%end

%external %routine CREATE FILE (%string(25) file name, %integer size,
                                %integername Created size)
   %record(parmfm) p
   pack(filename, p_File)
   p_p5 = size
   Director(Direct Create, P)
   Created Size = p_p2
%end

%owninteger Echo Flag = 0

%externalroutine PROMPT(%string(15) S)
   %record(parmfm) p
   length(s) = 15 %if length(s) > 15
   Prompt text = s
   string(addr(p_p2)) = s
   p_p1 = echo flag
   svc(2, p)
%end

%externalroutine ECHO(%integer onoff)
   echo flag = 0
   echo flag = 1 %if onoff = 0
%end

%externalpredicate END OF INPUT
   %integer s
   %on 9 %start
      %true
   %finish
   s = nextsymbol
   %false
%end

%externalstring(72)%fn ITOS(%integer n, p)
   %byte %array s(0:72)
   %integer x, sign
   x = 73
   sign = 0
   %if p > 0 %start
      sign = ' '
      p = 72-p
   %else
      p = p+73
   %finish
   p = 1 %if p <= 0
   %if n < 0 %start
      sign = '-'
      n = -n
      %if n < 0 %start;      !max int
         n = n//(-10)
         x = x-1
         s(x) = '8'
      %finish
   %finish
   %cycle
      x=x-1
      s(x) = rem(n,10)+'0'
      n = n//10
   %repeat %until n = 0
   %if sign # 0 %start
      x = x-1;  s(x) = sign
   %finish
   %while x > p %cycle
      x = x-1;  s(x) = ' '
   %repeat
   x = x-1
   s(x) = 72-x
   %result = string(addr(s(x)))
%end

%externalroutine WRITE(%integer n, p)
   printstring(itos(n, p))
%end

%routine ROUND(%realname v, %integer p)
   %real x
   %return %if v = 0
   %if v < 0 %then x = -0.5 %else x = 0.5
   %cycle
      p = p-1;  %exit %if p < 0
      x = x/10
   %repeat
   v = v+x
%end

%routine FRACTION(%real R, %integer Places, %string(*)%name S)
   %return %if Places <= 0
   S = S."."
   %while Places > 0 %cycle
      Places = Places-1
      R = Fracpt(R)*10
      S = S.Tostring(Intpt(R)+'0')
   %repeat
%end

%externalstring(64)%fn FtoS(%real r, %integer p)
   %string(64) S = ""
   %integer    Exp, Sym
   P = 7 %if P > 7
   %if R < 0 %then Sym = '-' %and R = -R  %c
             %else Sym = ' '
   %if R = 0 %start
      Exp = -99
   %else
      Exp = 0
      Exp = Exp+1 %and R = R/10 %while R >= 10
      Exp = Exp-1 %and R = R*10 %while R < 1
   %finish
   Round(R, P);  Exp = Exp+1 %and R = R/10 %if R >= 10
   S = S.Tostring(Intpt(R)+'0')
   Fraction(R, P, S)
   S = S."@".ItoS(Exp, 0)
   %result = S
%end
%externalroutine PrintFl(%real R, %integer Places)
   Printstring(Ftos(R, Places))
%end

%externalstring(63)%fn RtoS(%real R, %integer A, B)
   %integer Before
   %real    Rm
   %string(63) S = ""
   %constinteger Max Int = (-1) >> 1
   A = 63-8 %if A > 63-8
   B =  7   %if B > 7
   Round(R, B)
   Rm = |R|
   %result = FtoS(R, A+B) %if Rm > Max Int
   Before = Intpt(R)
   %if Before = 0 %and r < 0 %start
      %while A > 0 %cycle
         A = A-1
         S = S." "
      %repeat
      S = S."-0"
   %else
      S = ItoS(Before, A)
   %finish
   Fraction(Rm, B, S)
   %result = S
%end
%externalroutine Print(%real R, %integer B, A)
   Printstring(RtoS(R, B, A))
%end

%externalstring(63)%fn XTOS(%integer n, p)
   %string(63) s = ""
   %integer k
   %if p < 0 %start
      p = 1
   %else %if p > 63
      p = 63
   %finish
   s = s." " %and p = p-1 %while p > 8
   N = N<< ( 4*(8-P) )
   %cycle
      k = n>>28&15;  n = n<<4
      %if k > 9 %then k = k-10+'A' %else k = k+'0'
      s = s.tostring(k)
      p = p-1
      %result = s %if p <= 0
   %repeat
%end

%externalroutine PHEX(%integer n, p)
   printstring(XTOS(n, p))
%end

%predicate Base Ok(%integername V, %integer Base)
   %if '0' <= V <= '9' %start
      V = V-'0'
   %else %if 'A' <= V&95 <= 'Z'
      V = V&95-'A'+10
   %finish %else %false
   %true %if V < Base
   %false
%end
%externalintegerfn StoI(%string(63) S)
   %integer N, P, L, Base, Sym, V, Sign
   N = 0
   L = Length(S)
   P = 0
   Base = 10
   Sign = 0
   %cycle
      %result = N %if P = L
      P = P+1;  Sym = Charno(S, P)
      %continue %if Sym = ' '
      %if Sign = 0 %start
         Sign = 1
         %if Sym = '-' %or Sym = '+' %start
            Sign = -1 %if Sym = '-'
            %continue
         %finish
      %finish
      V = Sym
      %if V = '_' %start
         Base = N;  N = 0
         %continue
      %finish
      %signal 3,1,Sym %unless Base Ok(V, Base)
      N = N*Base
      %if Sign > 0 %then N = N+V %else N = N-V
   %repeat
%end
%externalroutine READ(%name NN)
   %string(255)  st
   %integer sign, n, len, adr, type, s, base, Flag
   %real  r, exp, f
   %constinteger  integers=1,
                  reals=2,
                  strings=3,
                  records=4,
                  bytes=5,
                  shorts=6,
                  long reals=7
   %switch  TP(integers:longreals)
   len = size of(NN);  adr = addr(NN)
   len = adr>>24+1 %if len = 0
   type = type of(NN)
   %unless  integers <= type <= longreals %and type # records %start
TP(records):      %signal 5,5,type
   %finish
   skip symbol %while next symbol <= ' '
   %if type = strings %start
      st = ""
      %cycle
         s = next symbol
         %exit %if s <= ' '
         st = st.tostring(s)
         skip symbol
      %repeat
      %signal 1,3 %if len <= length(st)
      string(adr) = st
      %return
   %finish

   ! read a number
   sign = 10;  Base = 10
   sign = readsymbol-'-' %if next symbol = '-' %or next symbol = '+'
   {sign is zero after -}
   %cycle
      n = 0;  Flag = 0
      %cycle
         s = next symbol
         %exit %unless Base Ok(S, Base)
         Flag = 1
         skip symbol
         n = n*Base
         %if Sign = 0 %then N = N-S %else N = N+s
         {Beware of overflow}
         s = next symbol
      %repeat
      %exit %if S # '_' %or N = 0
      Base = |N|
      skipsymbol
   %repeat
   r = n
   %if s = '.' %and (type = reals %or type = longreals) %start
      F = 0
      Exp = Base;  skip symbol
      %cycle
         s = next symbol
         %exit %unless Base Ok(S, Base)
         Flag = 1
         f = f + S/Exp
         Exp = Exp*Base
         skip symbol
      %repeat
      %if Sign = 0 %then R = R-F %else R = R+F
   %finish
   %signal 3,1,Nextsymbol %if Flag = 0
   -> TP(type)
TP(integers):  integer(adr) = n;  -> RETURN
TP(shorts):    %signal 1,1,n %unless x'FFFF8000' <= n <= x'00007FFF'
               shortinteger(adr) = n;  -> RETURN
TP(bytes):     %signal 1,1,n %unless 0 <= n <= 255
               byte integer(adr) = n;  -> RETURN
TP(longreals):
TP(reals):     real(adr) = r
RETURN:
%end

%externalroutine To Upper(%string(*)%name S)
   %integer P
   %for P = Length(S), -1, 1 %cycle
      Charno(S, P) = Charno(S, p)-32 %if 'a' <= Charno(S, P) <= 'z'
   %repeat
%end

%externalroutine To Lower(%string(*)%name S)
   %integer P
   %for P = Length(S), -1, 1 %cycle
      Charno(S, P) = Charno(S, P)+32 %if 'A' <= Charno(S, P) <= 'Z'
   %repeat
%end
%endoffile
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        !Subsystem general routines

   %externalroutine STOP
      %record(parmfm) p
      Close Out(0, 0)
      svc(1, p)
   %end
   %systemroutine CREATE SEG(%integername n, %integer size)
      %record(parmfm) p
      p_p2 = size;  p_p3 = -1;    svc(8, p)
      n = p_p1<<16
      %if n < 0 %start
         console("*Create segment fails ".itos(n, 0))
      %else
         work segs = work segs!(1<<p_p1)
      %finish
   %end
   %systemroutine DELETE SEG(%integer n)
      %record(parmfm) p
      work segs = work segs&(\(1<<n))
      p_p1 = n
      svc(9, p)
   %end
   %routine TIDY SEGS
      %record(parmfm) p
      p_p1 = current segs;  svc(33, p)
   %end
   %externalroutine CPU LIMIT(%integer seconds)
      %record(parmfm) p
      %return %if seconds < 0
      p_p1 = seconds
      svc(21, p)
   %end
   %externalpredicate VALID(%integer a, bytes)
      %record(parmfm) p
      p_p1 = a;  p_p2 = bytes;  svc(30, p)
      %true %if p_p1 = 0
      %false
   %end
   %externalroutine DOING(%string(31) what)
      %recordformat parmfm(%shortinteger dsno, dact, ssno, sact, %c
                           %integer n, term, %string(15) what)
      %record(parmfm) p
      length(what) = length(what)&15
      p_n=9;  p_term=0;  p_what=what
      svc(29, p)
   %end
   %externalroutine UNSTACK CONTS(%integer to)
      %record(parmfm) p
      p_p1 = \to
      svc(25, p)
   %end
   %externalintegerfn CONTINGENCY(%record(contfm)%name c)
      %record(parmfm) p
      p_p1 = addr(c);  svc(24, p)
      console("*Contingency fails ".itos(p_p1, 0)) %if p_p1 # 0
      %result = p_p2
   %end

%externalintegerfn CPUTIME
   %record(parmfm) p
   p_p1 = 0;            !this process
   svc(14, p)
   %result = p_p5
%end
%externalstring(9)%fn DATE
   %record(parmfm) p
   svc(7, p)
   %result = string(addr(p_p1))
%end
%externalstring(8)%fn TIME
   %record(parmfm) p
   svc(7, p)
   %result = string(addr(p_p4))
%end
%externalintegerfn INT(%real r)
   %result = intpt(r+0.5) %if r >= 0
   %result = intpt(r-0.5)
%end
%externalrealfn FRACPT(%real r)
   %integer m,x,z
   %if |R| >= 1.0 %start
      x = integer(addr(r))
      z = x>>24&b'01111111'
      %result = 0 %if z > x'46'
      m = -1
      m = m<<4 %and z = z+1 %while z < x'46'
      x = x&(m!x'FF000000')
      r = r-real(addr(x))
   %finish
   r = r+1 %if r < 0
   %result = r
%end
%systemroutine STORE DUMP(%integer from, size)
   from = from&(\31)
   %cycle
      %if from&31 = 0 %start
         newline
         %exit %if size <= 0
         phex(from, 5)
         printsymbol(':')
      %else
         space %if from&15 = 0
      %finish
      space
      %unless valid(from, 4) %start
         newline
         printstring("Invalid address");  newline
         %return
      %finish
      phex(integer(from), 8)
      size = size-4
      from = from+4
   %repeat
   newline
%end
%systemroutine DUMP CONTINGENCY(%record(contfm)%name  cont)
   %integer s
   newline
   printstring("PS  ");  phex(cont_eps, 8)
   printstring("     PC ");  phex(cont_Epc, 5)
   newline
   %for s = 0, 1, 15 %cycle
      newline %if s&3 = 0
      write(s, 4);  phex(cont_er(s), 10)
   %repeat
   newline
   %for s = 0, 1, 7 %cycle
      newline %if s&3 = 0
      write(s<<1, 4);  phex(cont_efpr(s), 10)
   %repeat
   newline
   s = cont_epc&(\3)
   %if s&X'FFFF' >= 128 %then s = s-128 %else s = s&X'F0000'
   store dump(s, 256)
%end;      ! hex dump
%externalroutine Terminal mode(%integer m)
   %record(parmfm) P
   tt mode = m
   p_p1 = 11;  p_p2 = 0;  p_p3 = m;  svc(29, p)
%end
%endoffile
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
!IMP-77 I/O package                      A. Culloch     Aug-81

   !Limits
   %const %integer max FD = 20,          {active file limit}
               max stream = 3,           {in:0..3; out:0..3}
                   max DA = 10           {DA channels}

   !System call nos.
   %const %integer  tt in = 3,           {read message from console}
                   tt out = 4,           {Write message to console}
                To Potter = 22           {Message to Central Queuing Agency}

   %const %integer Hash bit = x'80000000' {Set in F_NAME1 for "FILE#"}
   %const %integer File alloc = 10        {Initial file allocation (blocks)


   !Packed filenames (F_owner values):
   %const %integer T colon = 20,
                  IN colon = 527,
                 OUT colon = 28172,
                   N colon = 14,
                NULL colon = x'E41FD'

   !Events
   %const %integer stream error = 9,
                      Lib error = 10     {Library procedure detected fault}

   %const %record(*)%name null == 0      {list terminator}
   %const %byte %name nil == 0

   %own %record(parm fm) tt in buf, tt out buf   {Console I/O message buffers}

   %record %format FD fm (               %c
           %integer             Key,     {file system access key}
           %bytename            Buf,     {base of 1-block buffer}
                                Ptr,     {pos within buffer}
                                Lim,     {end of buffer area}
           %integer             Bn,      {Block no. within file}
                                Last,    {Block no. of last block in file}
           %record(Filefm)      File,    {file identifier}
                                Label,   {Tag for spooled files}
           %record(FD fm) %name Link)    {Chain free FD's}

           {For output, LAST is the last symbol written, used by BREAK OUTPUT}

   %own %record(FD fm) %array FD(1:max FD) = 0(*)
   %own %record(FD fm) %name FD asl,     {Free list}
                             In,         {Currently selected input stream}
                             Out         {selected output stream}

   %own %record(FD fm) tt  in FD = 0,         {Known device desciptors}
                       tt out FD = 0,
                       null   FD = 0

   %record(FD fm) %map New FD
      %record(FD fm)%name It
      %if FD asl == null %start
         EVENT_message = "too many open files"
         %signal stream error,3
      %finish
      It      == FD asl
      FD asl  == FD asl_link
      It       = 0
      %result == It
   %end

   %routine Release FD (%record(FD fm)%name It)
      It_link == FD asl
      It_file_owner = -1                 {Make sure it won't get picked up!!}
      FD asl  == It                      { IT ==> hd of ASL }
   %end

   %own %integer in key = 0, out key = 0 {copies of IN_KEY, OUT_KEY}
   %own %integer in str, out str         {Selected stream nos.}

   %own %record(FD fm)%name %array In Stream  (0:Max Stream) = 0(*)
   %own %record(FD fm)%name %array Out Stream (0:Max Stream) = 0(*)
   %own %integer %array DA chan (0:max DA) = 0(*)
                                         {FD's not unique: e.g. OUTSTREAM(2)
                                         { == OUTSTREAM(3) is OK - output
                                         {will be merged.
   %record %format block fm (%byte %array B(0:511))
   %own %record(block fm) %array in buf(0:max stream)
   %own %record(block fm) %array outbuf(0:max stream)

   %routine %spec Close DA (%integer Channel)
   %routine %spec EOF

   %system %routine INIT STREAMS
      %record(FD fm) %name F, Fp, Fl
      %integer %name DA
      %integer J
      %record(parm fm) P

      TT  in FD = 0;        TT  in FD_File_Owner = T Colon

      TT out FD = 0;        TT out FD_File_Owner = T Colon

      TT out FD_Ptr == char no(TT out buf_Text,1)
      TT out FD_Lim == char no(TT out buf_Text,23) ++ 1
      TT out FD_Last = NL

      Fp == Fd(1);         FD Asl == Fp
      Fl == Fp++(Max FD-1)
      %cycle
         %if Fp_Key # 0 %start
            P_P5   = Fp_Key
            P_Dact = Direct Close
            Svc(To Director, P)
         %finish
         Fp      = 0
         %exit %if Fp == Fl
         F      == Fp
         Fp     == Fp++1
         F_Link == Fp
      %repeat

      DA == DA chan(0)                   {*Close any DA files*}
      j   = max DA + 1
      %cycle
         %if DA # 0 %start
            P_p5 = DA;  DA = 0
            P_Dact = Direct Close
            SVC (To Director, P)
         %finish
         DA == DA ++ 1            
         j   = j - 1
      %repeat %until j = 0

      %for j = 1,1,max stream %cycle
         In stream(j)  == null FD
         Out stream(j) == null FD
      %repeat

       In Stream(0) == tt  in FD;  Select Input(0)
      Out Stream(0) == tt out FD;  Select Output(0)

   %end

   %external %routine PACK (%string(63) filename, %record(file fm)%name packed)
      %record(parm fm) P
      string(addr(P_sact)) = filename
      SVC (17,P)                         {pack}
      packed = P_file
      %if P_file_owner < 0 %start
         EVENT_message = "Illegal filename ".filename
         %signal 10,1
      %finish
   %end

   %external %routine UNPACK (%record(file fm)%name file, %string(*)%name s)
      %record(parm fm) P
      P_file = file
      SVC (18,P)                         {unpack}
      s = string(addr(P_sact))
   %end

   %external %routine DIRECTOR (%integer DACT val, %record(parmfm)%name P)
      P_dact = dact val
      SVC (To Director,P)
      %if P_p6 # 0 %start
         EVENT_message = string(addr(P_p1))
         %signal stream error, 10, P_p6
      %finish
   %end

   %const %integer loud = -1, quiet = 0

   %external %routine DEL FILE (%record(file fm)%name f, %integer quiet)
      {QUIET: 0 suppress %SIGNAL on failure
      {      -1 let it through
      %record(parm fm) P
      %string(31)      filename
      P_file = f
      P_dact = Direct Delete
      SVC (To Director,P)
      %if P_p6&quiet # 0 %start
         Unpack (f,filename)
         Event_message = P_text
         %signal stream error, 10, P_p6
      %finish
   %end

   %external %routine NEW FILE (%record(file fm)%name f,
                                %integer size,   {requested}
                                %integer %name actual) {size returned >=SIZE}
      %record(parm fm) P
      P_p3 = f_name1;  P_p4 = f_name2;  P_p5 = size
      Director (Direct Create,P)
      Actual = P_p2
   %end

   %system %routine READ BLOCK (%integer Director key, block num, buffer addr)
      %record(parm fm) P
      P_p4 = buffer addr;  P_p5 = Director key;  P_p6 = block num
      Director (Direct Read DA, P)
   %end

   %system %routine WRITE BLOCK (%integer key, block num, buffer)
      %record(parm fm) P
      P_p4 = buffer;  P_p5 = key;  P_p6 = block num
      Director (Direct Write DA, P)
   %end

   %integer %fn Checked (%integer DA chan num)
      %result = DA chan num %if 0 <= DA chan num <= max DA
      EVENT_message = "invalid DA channel number"
      %signal stream error, 3, DA chan num
   %end

   %external %routine OPEN DA (%integer Chan, RW, %string(31) Filename)
      %record(parm fm) P
      Pack (Filename,P_File)
      Close DA (Checked(Chan))
      P_p5 = RW                          {Read/write flag}
      Director (Direct Open DA, P)
      DA chan(chan) = P_p5               {Director key}
   %end

   %record %format Finf (%integer size,  {of file (blocks)
                                  Last,  {No of extents}
                                  Access,{File access permissions}
                                  Day)   {When last accessed - packed date}
   %external %record(Finf) %function TEST DA (%integer chan)
      %record(parm fm) P
      P_p5 = DA chan(checked(chan))
      Director (Direct Status, P)
      %result = record(addr(P_p2))
   %end

   %external %routine READ DA (%integer chan, block, %name buffer)
      Read block (DA chan(checked(chan)), block, addr(buffer))
   %end

   %external %routine WRITE DA (%integer Chan, Block, %name Buffer)
      Write block (DA chan(checked(chan)), block, addr(buffer))
   %end

   %external %routine EXTEND DA (%integer chan, blocks, %integer %name final)
      {Final is set to the number of blocks in the file after the operation,
      {Since Director may give us more than we asked for.
      %record(parm fm) P
      P_p5 = DA chan(checked(chan))
      P_p6 = blocks
      Director (Direct Extend, P)
      final = P_p2
   %end

   %external %routine CLOSE DA (%integer chan)
      %record(parm fm) P
      P_p5 = DA chan(checked(chan))
      %if P_p5 # 0 %start                  {Forget it if chan closed anyway}
         Director (Direct Close, P)
         DA chan(chan) = 0
      %finish
   %end

   %integer %fn checked stream(%integer min, stream)
      %result = stream %if min <= stream <= max stream
      EVENT_message = "invalid stream number"
      %signal stream error, 2, stream
   %end

   %system %routine Open in (%integer Stream, %string(31) File)
      %record(parm fm) P, Q
      %record(FD fm) %name FD

      %on %event Lib error %start        {PACK failure}
         %signal Stream Error, 4         {Invalid filename}
      %finish

      %if File = "" %start               {Default it}
         %if Stream <= 1 %then File = "IN:"    %c
                         %else File = "NULL:"
      %finish
      Pack(File,P_File);  Close In(Stream, 1)

      %if P_File_Owner = T Colon %start
         In Stream(Stream) == tt in FD
      %else %if P_File_Owner = N Colon %or P_File_Owner = Null Colon
         In Stream(Stream) == null FD
      %else %if P_File_Owner = IN Colon       {IN:}
         In Stream(Stream) == In Stream(0)
      %else                                   {File}
         Q    = P
         Q_P5 = 0                             {read only access}
         Director (Direct Open DA, Q)
         FD     == New FD
         FD_Key  = Q_P5
         FD_Bn   = -1
         FD_Last = Q_P1 {file size} - 1
         FD_Buf == In Buf(Stream)_B(0)
         FD_Ptr == Nil
         FD_Lim == Nil
         FD_File = P_File
         In Stream(Stream) == FD
      %finish
      Select input(In Str)
   %end

   %external %routine OPEN INPUT (%integer stream, %string(31) file)
      length(file) = 31 %if length(file) > 31
      Open in (checked stream(1,stream),file)
   %end

   %system %routine Open Out (%integer Stream, %string(31) filename)
      %record(FD fm) %name F, Fp
      %record(file fm) Actual name, label
      %record(parm fm) P, Q
      %integer J, Actual

      %on %event Lib error %start
         %Signal stream error, 4         {PACK: invalid filename}
      %finish

      %if filename = "" %start           {default it}
         %if Stream <= 1 %then filename = "Out:"  %c
                         %else filename = "Null:"
      %finish
      Pack (filename,P_file);  Close Out (Stream,0)

      %if P_file_owner = T Colon %start
         Out stream(stream) == tt out FD
      %else %if P_file_owner = OUT Colon
         Out stream(stream) == out stream(0)
      %else %if P_file_owner = N Colon %or P_file_owner = Null Colon
         Out stream(stream) == null FD
      %else
         label = P_file
         Director(Direct Unique, P) %if P_file_owner # 0
         P_file_name1 = P_file_name1 ! hash bit   {FRED => FRED#}

         {Same as any existing output stream?}

         %for j = 1, 1, Max FD %cycle
            Fp == FD(j)
            %if Fp_file_unit  = P_file_unit  %and
                Fp_file_owner = P_file_owner %and
                Fp_file_name2 = P_file_name2 %and
                Fp_file_name1 = P_file_name1 %start
               out stream(stream) == Fp
               %return
            %finish
         %repeat

         Del File (P_file, quiet)
         New File (P_file, file alloc, actual)
         Actual name = P_file            {Name of file to be opened}
         P_p5 = -1                       {Read/Write access, auto-extend}
         Director (Direct Open DA, P)
         F == New FD
         Out stream(stream) == F
         F_Key  = P_P5                   {File system key}
         F_Bn   = 0
         F_Last = NL                     {For BREAK OUTPUT}
         F_Buf == Out Buf(stream)_B(0)
         F_Ptr == F_Buf
         F_Lim == F_Buf ++ 512
         F_File = Actual name
         F_Label= Label
      %finish
      Select output(Out Str)
   %end

   %external %routine OPEN OUTPUT (%integer stream, %string(31) file)
      length(file) = 31 %if length(file) > 31
      Open out (checked stream(1,stream),file)
   %end

   %external %routine OPEN ALL (%record(command fm)%name command)
      %string(31)%name file
      %integer j
      %on stream error %start
         Console ("*Cannot open ".file." -- ".EVENT_message)
         %signal stream error, Event_Sub
      %finish
      %for j = 1,1,3 %cycle
         file == command_in(j);  Open input (j,file)
         file == command_out(j); Open output(j,file)
      %repeat
      Select input (1);  Select output (1)
   %end

   %external %routine SELECT INPUT (%integer Stream)
      In == In Stream(Checked Stream(0,Stream))
      In Key = In_Key
      In Str = Stream
   %end

   %external %routine SELECT OUTPUT (%integer Stream)
      Out == Out Stream(Checked Stream(0,Stream))
      Out Key = Out_Key
      Out Str = Stream
   %end

   %externalintegerfn IN TYPE
      %result = In Key %if In Key # 0         {File}
      %result = 0      %if In == Null Fd      {Null:}
      %result = -1                            {T:}
   %end

   %externalintegerfn OUT TYPE
      %result = Out Key %if Out Key # 0       {File}
      %result = 0       %if Out == Null Fd    {Null:}
      %result = -1                            {T:}
   %end

   %external %integer %fn IN STREAMER %alias "INSTREAM"
      %result = In str
   %end

   %external %integer %fn OUT STREAMER %alias "OUTSTREAM"
      %result = Out str
   %end

   %routine find eof                     {Put IN_LIM at last valid byte in buf}
      %while in_lim = EOT %cycle
         EOF %if in_lim == in_ptr
         in_lim == in_lim -- 1
      %repeat
   %end

   %external %routine SEEK INPUT (%integer byte)
      %integer block, offset
      %if in key # 0 %start              {Only sensible on files}
         block = byte>>9;  offset = byte&511
         %if block # in_Bn %start        {Slight optimisation}
            in_Bn = block
            Read block (in key, block, addr(in_buf))
         %finish
         in_ptr == in_buf ++ (offset-1)  {Read symbol advances ptr}
         in_lim == in_buf ++ 511
         Find eof
      %finish
   %end

   %external %routine RESET INPUT
      Seek input (0)
   %end

   %external %integer %fn In Pos
      %result = 0 %if In_Bn < 0
      %result = In_Bn<<9 + (Addr(In_Ptr)-Addr(In_Buf)) + 1
   %end

   %external %integer %fn Out Pos
      %result = Out_Bn<<9 + (Addr(Out_Ptr)-Addr(Out_Buf))
   %end

   %routine EOF
      EVENT_message = "input ended"
      %signal 9,1
   %end

   %external %integer %function READ SYMBOL %alias "#READSYMFN"
      %if in_ptr ## in_lim %start
         in_ptr == in_ptr ++ 1
         %result = in_ptr
      %finish
      %if In key # 0 %start              {input from file}
         in_Bn = in_Bn + 1               {Ingest next block}
         EOF %if in_Bn > in_last
         in_ptr == in_buf
         in_lim == in_buf ++ 511
         Read block (in key, in_Bn, addr(in_buf))
         Find eof %if in_Bn = in_last
      %else %if in == null FD            {NULL:}
         EOF
      %else                              {T:}
         tt in Buf_Text = ""             {in case SVC omitted during cont!!}

         SVC(TT in, TT in Buf) %until TT in Buf_Text # ""
         In_Ptr == Length(TT in Buf_Text)

         in_lim == in_ptr ++ (in_ptr)    {LENGTH bytes past count}
         in_ptr == in_ptr ++ 1           {Past length byte}
         EOF %if in_ptr&127 = EOT
      %finish
      %result = in_ptr
   %end

   %external %routine SKIP SYMBOL
      %integer skip = READ SYMBOL
   %end

   %external %integer %fn NEXT SYMBOL
      %integer sym = READ SYMBOL
      in_ptr == in_ptr -- 1
      %result = sym
   %end

   %external %routine Flush output
      %if out key = 0 %start
         length(tt out buf_text) = addr(out_ptr) - addr(tt out buf_text) - 1
         SVC (tt out, tt out buf) %if tt out buf_text # ""
         out_ptr == char no(tt out buf_text,1)
         out_lim == char no(tt out buf_text,23) ++ 1
      %finish
   %end

   %external %routine SEEK OUTPUT (%integer byte)
      %integer block, offset
      %if out key # 0 %start             {Only on files}
         block = byte>>9;  offset = byte&511
         Write block (out key, out_Bn, addr(out_buf)) %if out_Bn # block %and
                                                          out_ptr ## out_buf
         out_ptr == out_buf ++ offset
         out_lim == out_buf ++ 512
         %if out_Bn # block %start       {Not got BYTE in buffer}
            %if block >= out_Bn %start   {Off end, WRITE does auto-extend}
               Write block (out key, block, addr(out_buf))   {write garbage..
            %else                        {Backwards in file, get right block}
               Read block  (out key, block, addr(out_buf))
            %finish
            out_Bn = block
         %finish
      %finish
   %end

   %external %routine RESET OUTPUT
      Seek output (0)
   %end

   %external %routine PRINT SYMBOL (%integer sym)
      Out_last = sym                     {For benefit of BREAK OUTPUT}
      %if Out key # 0 %start             {File}
         %if out_ptr ## out_lim %start
            out_ptr <- sym
            out_ptr == out_ptr ++ 1
            %return
         %finish
         {Expel filled buffer}
         Write block (out key, out_Bn, addr(out_buf))
         out_ptr == out_buf
         out_lim == out_buf ++ 512
         out_Bn = out_Bn + 1
      %else
         %return %if out == null FD      {Null:}
         Flush output %if sym < 0 %or out_ptr == out_lim    {tty}
         %if sym < 0 %or out_ptr == out_lim %start
            Flush output
            %return %if sym < 0
         %finish
      %finish
      out_ptr <- sym
      out_ptr == out_ptr ++ 1
      Flush output %if out key = 0 %and sym = NL
   %end

   %system %routine CLOSE IN (%integer Stream, Safe)
      %record(FD fm) %name Command stream == In stream(0)
      %record(Parm fm)     P
      %integer             Old = in str
      Select input(Stream)
      %if Stream # 0 %then In stream(Stream) == Null  FD                %c
                     %else In stream(0)      == tt in FD
      %if In ## Command Stream %or Safe = 0 %start
         P_p5 = In key
         %if P_p5 # 0 %start
            Director(Direct Close, P)
            In_key = 0
            Release FD(in)
         %finish
      %finish
      Select input(old)
   %end

   %external %routine CLOSE INPUT
      Close in(in str,1) %if in str # 0
   %end

   %external %routine ABANDON INPUT        {For symmetry}
      Close input
   %end

   %system %routine CLOSE OUT (%integer stream, how)
      {HOW:  0 for close stream normally (Overwrite old version)
      {     #0 to close channel & abandon (leaving FRED#)
      %record(FD fm)%name FDp
      %record(FD fm)      FD
      %record(parm fm)    P, Q
      %integer            key

      FDp == Out Stream(Stream)
      Key =  FDp_key
      %if Stream = 0 %then out stream(stream) == tt out FD %c
                     %else out stream(stream) == null FD
      Select output(stream) %if stream = out str

      %if Key # 0 %start                 {File}
         {File also open on another stream? don't close}
         %return %if FDp == Out Stream(0) %or
                     FDp == Out Stream(1) %or
                     FDp == Out Stream(2) %or
                     FDp == Out Stream(3)
         FD = FDp
         Release FD (FDp)

         %if FD_Ptr ## FD_Buf %or        {Buffer not empty: pad with EOTs}
             FD_Bn  =  0      %start     {** Frig to cope with empty files **}
            %while FD_Ptr ## FD_Lim %cycle
               FD_Ptr = EOT
               FD_Ptr == FD_Ptr ++ 1
            %repeat
            Write block (Key, FD_Bn, addr(FD_Buf))
            FD_Bn = FD_Bn + 1
         %finish

         P_file = FD_file
         Director (Direct Status, P)     {Get current size of file -> P_p2}
         P_p6 = FD_Bn - P_p2             {-Truncate}
         %if P_p6 # 0 %start
            P_p5 = Key
            Director (Direct Extend, P)  {To make file correct size}
         %finish
         P_p5 = Key
         Director (Direct Close, P)

         %if how = 0 %start               {Volatile FRED# becomes new FRED}
            %if FD_label_owner # 0 %start {Prog/LP: }
               P_p1 = FD_label_owner      {Queue - LP: }
               P_p3 = FD_label_name1
               P_p4 = FD_label_name2
               P_p5 = FD_file_name1;  P_p6 = FD_file_name2
               P_dact = 1                {Code for Offer}
               SVC (To Potter, P)
               %if P_p6 < 0 %start       {Potter rejected}
                  Q_p1 = 0;  Q_p2 = FD_label_owner;  Q_p3 = 0;  Q_p4 = 0
                  Unpack (Q_file, event_message)
                  Event_message = "Cannot offer file to ".event_message. %c
                                  " -- ".P_text
                  %signal stream error, 6, P_p6
               %finish
            %else
               P_file = FD_file
               P_p5 = P_p3 & (~Hash bit);  P_p6 = P_p4
               Director (Direct Exchange, P)
               Del File (FD_file, Quiet) 
               {Kill FRED# - its now the old one}
            %finish
         %finish

      %else %if out ## null FD           {TTY}
         Flush Output
      %finish
   %end

   %external %routine CLOSE OUTPUT
      Close out (out str,0) %unless out str = 0
   %end

   %external %routine ABANDON OUTPUT
      Close out (out str,1) %unless out str = 0
   %end

   %externalroutine Close All(%integer How)
      %integer S = max stream, In Out
      %on stream error %start
         Select output(0)
         Print string("*Close ")
         %if in out = 0 %then print string("input(") %c
                        %else print string("output(")
         Write (S, 0)
         Print string(") fails -- ".Event_message)
         Newline
      %finish
      %cycle
         Select Input(S)
         Select Output(S)
         %return %if S = 0
         In out = 0;   Close input
         In out = 1;   Close out(S, How)
         S = S-1
      %repeat
      {leaves stream 0 selected}
   %end

   %external %routine PRINT STRING (%string(255) s)
      %integer j
      Print symbol (char no(s,j)) %for j = 1,1,length(s)
   %end

   %external %routine NEWLINE
      Print symbol (NL)
   %end

   %external %routine BREAK OUTPUT
      Newline %if out_last # NL
   %end

   %external %routine CONSOLE (%string(63) message)
      %integer old stream = out str
      Select output (0)
      Break output
      Print string (message)
      Newline
      Select output (old stream)
   %end

   %external %routine READ LINE (%string(*)%name S)
      %integer sym
      S = ""
      %cycle
         sym = Read symbol
         %exit %if sym = NL
         S = S . to string(sym)
      %repeat
   %end

   %external %routine NEWLINES (%integer n)
      %while n > 0 %cycle
         n = n-1
         Print symbol (NL)
      %repeat
   %end

   %external %routine SPACE
      Print symbol (' ')
   %end

   %external %routine SPACES (%integer n)
      %while n > 0 %cycle
         n = n-1
         Print symbol (' ')
      %repeat
   %end

   %external %routine NEW PAGE
      Print symbol (FF)
   %end

%end %of %file
 H?   / /                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Set verify
Utilty:ToEmas!
SYSX_SUBSYS:BASIC.EXE
SYSX_SUBSYS:BATCH.IMP
SYSX_SUBSYS:BCI.IMP
SYSX_SUBSYS:COMPILE
SYSX_SUBSYS:COMPILE.EXE
SYSX_SUBSYS:DT
SYSX_SUBSYS:DT.EXE
SYSX_SUBSYS:DUMP
SYSX_SUBSYS:DUMP.EXE
SYSX_SUBSYS:FILERTS.IMP
SYSX_SUBSYS:GENERAL.IMP
SYSX_SUBSYS:IO.IMP
SYSX_SUBSYS:LOADER.IMP
SYSX_SUBSYS:MDIAG.EXE
SYSX_SUBSYS:MDIAG.IMP
SYSX_SUBSYS:PARSE.IMP
SYSX_SUBSYS:SPECS
SYSX_SUBSYS:SPY.IMP
SYSX_SUBSYS:STANDARD
SYSX_SUBSYS:STANDARD.EXE
SYSX_SUBSYS:STANDOLD.EXE
SYSX_SUBSYS:STARTUP.COM
SYSX_SUBSYS:SUBINIT
SYSX_SUBSYS:SUBINIT.EXE
SYSX_SUBSYS:SUBOLD.EXE
SYSX_SUBSYS:SUBSYS
SYSX_SUBSYS:SUBSYS.EXE
.END
Set no verify
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        !Subsystem loading procedures

%constinteger  No Decode  =  1,
               No Open    =  2,
               No Stack   =  8,
                  Upper   = 32,
                  Spacesx = 64

%recordformat Textfm(%integer N1, N2 %or %short H11,H12,H21,H22)
%recordformat Specfm(%integer Gla, Code, Entry)

%recordformatspec Headfm
%recordformat Loadfm(%integer Code Segment, Gla Segment,  {start of segments}
                              Code Base,    Gla Base,     {logical start}
                              Code Head,    Gla Head,     {R14 value}
                              Specs,                      {spec list}
                              Defs,                       {definition list}
                     %record(Headfm)%name   Head,         {object file header}
                     %integername Use,
                                  Stack Limit,
                     %integer Options)

   %ownrecord(Loadfm) SubsysFile         {defines subsystem entries}
   %ownrecord(Loadfm)%array Loaded(1:6)  {currently loaded files}
   %owninteger Loaded Files = 0

%recordformat Progfm(%integer Stack Limit, Stack, 
                    (%integer Gla Head, Code Head, Entry %or
                     %record(Spec fm) Spec),
                     %integer Time Limit, Options, Load Point)
%recordformat Hdfm  (%short Base, N)
%recordformat Headfm(%short Pure Size, Gla Size, Code Disp,
                            Lit Disp,  Registers, MainEp,
                     %record(hdfm) Reloc, Defs, Specs, Ldiag, Vdiag)

%recordformat Regfm(%integer Tr1, Tr2, Tr3,
                             Tr4, Tr5, Tr6, Tr7,
                             Tr8, Tr9, TrA, TrB,
                             TrC, TrD, TrE, TrF)

   %ownrecord(Regfm)  Load Regs
   %ownrecord(Specfm) Loader State,            {loader gla, code and Entry}
                      Old State                {previous gla, code & Entry}
   %owninteger        Stack Limit = (-1)>>1    {enormous}

%recordformat Libfm(%integer Use, %string(27) Name)

   %systemrecord(Libfm)%array Lib(1:7)
   %systeminteger    Lib Limit = 0
   %ownrecord(Libfm) Tlib      = 0,
                     St Lib    = 0

%routinespec   Load  (%record(Progfm)%name Prog, %string(31) File)
%routinespec   LoadX (%string(15) X, %record(Specfm)%name S, %integername Opt)
%predicatespec Loadup(%record(Progfm)%name P, %string(31) File)
%routinespec   Unload(%integer Level)
%routinespec   Enter (%record(progfm)%name P)
%routinespec   Relocate(%record(Loadfm)%name L)
%routinespec   Update Stack Limit(%integer New Limit)

%Systemroutine Pack Spec(%string(15) Id, %record(Textfm)%name T)
   %integerfn  Ch(%integer  sym)
      %result = sym&95-'A'+1 %if 'A' <= sym&95 <= 'Z'
      %result = sym-'0'+27   %if '0' <= sym    <= '9'
      %result = sym-'#'+37   %if '#' <= sym    <= '%' {37=#, 38=$, 39=%}
      %result = 0            %if sym = ' '
      %result = -1
   %end
   %routine  Pack(%integer  k, %shortname  n)
      %integer  p,q,r
      p = charno(Id,k);  q = charno(Id,k+1);  r = charno(Id,k+2)
      n <- ( (ch(p)*40 + ch(q))*40 + ch(r) )
   %end
   %if Length(Id) > 12 %start
      Length(Id) = 12
   %else
      Id = Id." " %while Length(Id) # 12
   %finish
   Pack(1,  T_H11);  Pack(4,  T_H12)
   Pack(7,  T_H21);  Pack(10, T_H22)
%end
%system %string(15) Spec id
%system %routine Unpack spec (%record(textfm)%name T)
   %integerfn  Ch(%integer  n)
      %result = n-1+'A' %if n <= 26
      %result = n-27+'0' %if n <= 36
      %result = n-37+'#'
   %end
   %routine UNPACK(%integer k)
      %return %if k = 0
      unpack(k//40)
      k = rem(k, 40)
      spec id = spec id . to string(ch(k)) %unless k = 0
   %end
   spec id = ""
   unpack(t_n1>>16);  unpack(t_n1&H)
   unpack(t_n2>>16);  unpack(t_n2&H)
%end

%own %integer Xopt = 0                   {Options on file which satisfied
                                         {last external reference
%predicate Satisfied(%record(Loadfm)%name L, %record(Specfm)%name Vec,
                     %record(Textfm)%name Text)
   %integer d, disp
   %recordformat deffm(%shortinteger link, ep, %integer N1, N2)
   %record(deffm)%name p

   D = L_Defs
   %while D # 0 %cycle
      P == Record(L_Code Base+D*2)
      %if P_N1 = Text_N1 %and P_N2 = Text_N2 %start     {entry found}
         Disp = (P_Ep&H)<<1
         %if Vec_Entry < 0 %start      {data entry}
            Vec_Entry = L_Gla Head+Disp
         %else                         {code entry}
            Vec_Code  = L_Code Head
            Vec_Gla   = L_ Gla Head
            Vec_Entry = L_Code Head+Disp
         %finish
         Xopt = L_Options
         %true
      %finish
      D = P_Link&H
   %repeat
   %false
%end

%routine Dynamic Load(%record(Specfm)%name V, %record(Textfm)%name T)

   %integer             N, Old Xopt
   %record(Progfm)      P
   %record(Loadfm)%name L
   %record(Libfm)%name  Libp

   %if Options&Opt Trace # 0 %start
      Unpack Spec(T)
      Console("Ref: ".Spec Id)
   %finish
   %return %if Options&Opt Quick # 0 %and Satisfied(SubsysFile, V, T)
   N = Loaded files                             {files already loaded}
   %while N > 0 %cycle
      L == Loaded(N)
      %return %if Satisfied(L, V, T)
      N = N-1
   %repeat

   %if Loaded Files # 6 %start
      L == Loaded(Loaded Files+1)
      N = -2                                    {finally user-defined files}
      %while N < Lib Limit %cycle
         N = N+1
         %if N = 0 %start                       {try temp lib}
            Libp == Tlib
         %else %if N < 0
            St Lib_name = Standard
            Libp       == St Lib
            Libp_use    = 0
         %else                                  {user library}
            Libp == Lib(N)
         %finish
         %continue %if Libp_Use # 0 %or
                       Libp_Name = ""           {in use or undefined}
         %continue %unless Loadup(P, Libp_Name)
         %if Satisfied(L, V, T) %start
            L_Use  == Libp_Use
            Libp_Use = 1
            Old Xopt = Xopt                     {In case of recursive call}
            Relocate(L)
            Xopt = Old Xopt
            %exit %if Libp_Use = 0              {unresolved references}
            %return
         %finish
         Unload((Loaded Files))                 {remove the last one}
      %repeat
   %finish
   %return %if Options&Opt Quick = 0 %and Satisfied(SubsysFile, V, T)

   !unsatisfied reference

   Unpack spec(T)
   Event_Message = "Cannot load ".Spec Id

   V_Entry = 0
   V_Code  = 0
   V_Gla   = 0
   !   fall through to enter program at ASYNCH
%end
%routine DYNAMIC
      %ownrecord(specfm)%name VEC       {must be OWN as DYNAMIC runs
      %ownrecord(Textfm)%name Spec      {without its local base register!}
      %label load

      *la_15,load
      *stm_gla,Loader State
      %return

      {   *** Enter here for dynamic loading             }

      {      r13 = gla for this file                     }
      {      r14 = <disp of text> <disp of this vector>  }
      {      r15 = return address                        }

      {      entry sequence - *STM_5,0(WSP)              }
      {                       *LM_13,XV                  }
      {                       *BALR_15,15                }

Load: *lr_0,0;            !noop (skipped by proc param entry)
      *lr_0,0
      *stm_1,Load Regs
      *lm_14,x'20'(Wsp)
      *stm_14,Old State
      *l_Code,Loader State+4
      *ahi_Wsp,512

      Spec == Record(Old State_Code %c
                     -2*(Shortinteger(Old State_Code-4)&H)+(Load Regs_TrE>>16)*2)
      Vec == Record(Old State_Gla+(Load Regs_TrE&H)<<1)
      Dynamic Load(Vec, Spec)

      Load Regs_TrD = Vec_Gla
      Load Regs_TrE = Vec_Code
      Load Regs_Tr3 = Vec_Entry
      *lm_1,Load Regs
      *lr_code,code
      *bner_3
      *lm_wsp,8(wsp);      !restore context of call
      *lhl_4,-6(code)
      *ar_4,4
      *ar_4,code
      *sr_0,0
      *lis_1,14
      *sr_2,2
      *lr_3,link
      *br_4
%end

%routine MDIAG
   %record(contfm) cont
   %integer level
   %record(Progfm) diags
   %label error
   %on %event 10 %start
      select output(0)
      printstring("Cannot load diagnostic package");  newline
      %return
   %finish

   Load(Diags, Diag Prog)
   %if Error File # "" %start
      Open Output(1, Error File)
      Console("*Diagnostics being sent to ".Error File)
      Select Output(1)
   %finish
   *la_15,Error
   *st_15,Cont+4
   *stm_0,Cont+8
   C Level = Contingency(Cont)
   Level = Clevel-1
   *l_1,Stack Limit
   *stm_7,8(Wsp)
   *lm_13,Diags+8
   *st_1,0(13)
   *balr_15,15
   Close All(0)
   Unstack Conts(Level)
   %return

Error:Console ("Fatal error during diagnostics")
%end

%systemroutine Run Program(%record(Progfm)%name  Prog)
   %integer s, limit, new stack, time limit
   new stack = -1
   %if Prog_Options&NoStack # 0 %start      {run on basic stack}
      *st_wsp,s
      s = s+44+diag stack                   {Protect ENTER below ****}
      *l_1,0(gla)
      *st_1,limit
   %else                                    {Get new stack}
      Limit = Default Stack
      %if Prog_Stack Limit > Limit %start
         Limit = Prog_Stack Limit
      %else %if Prog_Stack Limit < 0
         Limit = -Prog_Stack Limit
      %finish
      Limit = Limit*1024
      Create Seg(S, Limit)
      %if S < 0 %start
         Console("*No space for stack")
         %return
      %finish
      New Stack = S
      Limit = Limit+S
   %finish
   Prog_Stack       = S
   Prog_Stack Limit = Limit-800;      ! stack limit
   Open All(Command) %if Prog_Options&NoOpen = 0
   Prompt Text = "Data: ";  Prompt(Prompt Text)
   Time Limit = Default Time
   %if Prog_Time Limit > Time Limit %start
      Time Limit = Prog_Time Limit
   %else %if Prog_Time Limit < 0
      Time Limit = -Prog_Time Limit
   %finish
   EVENT = 0
   Cpulimit(Time Limit)
   Enter(Prog)
   Delete seg(new stack>>16) %if New Stack >= 0
%end
%externalroutine RUN(%string(31) file)
   %record(Progfm) prog
   Load(Prog, File)
   Prog_Options = Prog_Options!NoStack     {use the current stack}
   Enter(Prog)
   Unload(Prog_Load Point)
%end
%systemroutine S Run(%string(63) File)
   %record(Progfm) Prog
   %integer S=-1,
            Stack
   Load(Prog, File)
   %if Prog_Options&NoStack = 0 %start
      Stack = |Prog_Stack Limit|
      %if Stack = 0 %start
         Prog_Options = Prog_Options!NoStack
      %else
         Stack = Stack*1024
         Create Seg(S, Stack)
         %if S < 0 %start
            Event_Message = "No space for stack"
            %Signal 0,15
         %finish
         Prog_Stack = S
         Prog_Stack Limit = S+Stack-800
      %finish
   %finish
   Enter(Prog)
   Unload(Prog_Load Point)
   Delete Seg(S>>16) %if S >= 0
%end

%routine Update Stack Limit(%integer New Limit)
   %integer P
   Stack Limit            = New Limit
   SubsysFile_Stack Limit = New Limit
   P = Loaded Files
   %while P > 0 %cycle
      P = P-1
      Loaded(P+1)_Stack Limit = New Limit
   %repeat
%end
%routine Relocate(%record(Loadfm)%name L)
   %integer P, Data Base, K, Count
   %shortname Rel
   %record(Textfm)%name T
   %record(specfm)%name V

   Dynamic                           {set up loader entry info}

   P = L_Specs&H*2
   Data Base = L_Code Head-Shortinteger(L_Code Head-4)&H*2
   %while P # 0 %cycle
      V == record(P+L_Gla Base)
      P = V_Gla*2
      %if V_Entry < 0 %start                    {data spec}
         T == Record(Data Base+(V_Code>>16)*2)
         Dynamic Load(V, T)                     {must resolve it now}
         %if V_entry = 0 %start                 {Unresolved references}
            L_use = 0
            Unpack spec(T)
            Event_Message = "Cannot load ".Spec Id
            %exit
         %finish
      %else                                     {procedure spec}
         V_Gla   = Loader State_Gla
         V_Entry = Loader State_Entry
      %finish
   %repeat

   {Now relocate the gla}

   Rel   == Shortinteger(L_Code Base+(L_Head_Reloc_Base&H)*2)
   Count = L_Head_Reloc_N&H
   %while Count > 0 %cycle
      K = L_Gla Head+Rel>>1<<2
      %if Rel&1 # 0 %then Integer(K) = Integer(K)+L_Code Head %c
                    %else Integer(K) = Integer(K)+L_ Gla Head
      Rel == Rel++1
      Count = Count-1
   %repeat
   L _Stack Limit       == Integer(L_Gla Head)
   Integer(L_Gla Head)   = Stack Limit               {make sure it's safe}
   Integer(L_Gla Head+4) = Addr(EVENT)               {old standard}
   Integer(L_Gla Head+8) = Addr(EVENT)               {new standard}

%end
%predicate Loadup(%record(Progfm)%name P, %string(31) File)
   %owninteger Dummy Use = 0
   %record(Loadfm)%name L
   %record(Parmfm) Q
   %integer Base
   %false %if Loaded Files = 6
   String(Addr(Q_Sact)) = File.".exe"
   Svc(10, Q)
   %if Q_P1 # 0 %or Q_P2!Q_P3 < 0 %start
      Event_Message = "Cannot access ".File
      %false
   %finish
   Base = Q_P2-16
   Work Segs = Work Segs ! (1<<(Q_P2>>16)) ! (1<<(Q_P3>>16))
   Loaded Files   = Loaded Files+1
   L             == Loaded(Loaded Files)
   L_Use         == Dummy Use;  L_Use = 1
   L_Code Segment = Base
   L_ Gla Segment = Q_P3
   L_Code Base    = Q_P2
   L_ Gla Base    = Q_P3
   L_Head        == Record(L_Code Base)
   L_Code Head    = L_Code Base + L_Head_Code Disp&H*2
   L_ Gla Head    = L_ Gla Base
   L_Specs        = L_Head_Specs_N
   L_Defs         = L_Head_ Defs_N
   L_Options      = Shortinteger(Base+12)
   P_Load Point   = Loaded Files
   P_Options      = L_Options
   P_Stack Limit  = Shortinteger(Base+14)
   P_Time Limit   = Shortinteger(Base+10)
   P_Code Head    = L_Code Head
   P_ Gla Head    = L_ Gla Head
   P_Entry        = -1
   P_Entry        = P_Code Head+L_Head_MainEp&H*2 %if L_Head_MainEp >= 0
   Console(File." loaded") %if Options&Opt Trace # 0
   %true
%end
%systemroutine Load(%record(Progfm)%name P, %string(31) File)
   %record(Loadfm)%name L
   %integer Prog use
   %if Loadup(P, File) %start
      L     == Loaded(Loaded Files)
      L_use == Prog use;  Prog use = 1
      Relocate(L)
      %return %if L_Use # 0
   %finish
   %signal 0,14
%end
%systemroutine UNLOAD(%integer Level)
   %record(Loadfm)%name L
   %while Loaded Files # 0 %and Loaded Files >= Level %cycle
      Loaded Files = Loaded Files-1
      L == Loaded(Loaded Files+1)
      L_Use = 0
      Delete Seg(L_Code Segment>>16)
      Delete Seg(L_ Gla Segment>>16)
   %repeat
%end
%routine ENTER(%record(Progfm)%name  P)
   %label trap
   %record(contfm) cont
   %record(parmfm) q
   %string(63)%name parm == Command_parameter
   %integer Level,
            Old Limit = Stack Limit
   %signal 0,14,1 %if P_Entry < 0

   *La_15,trap
   *St_15,cont+4
   *Stm_0,cont+8
   clevel = contingency(cont)
   level  = clevel-1

   %if P_Options&NoStack = 0 %start   {use new stack}
      Update Stack Limit(P_Stack Limit)
      *L_6,P
      *L_1,4(6)                       {new wsp}
   %else
      *L_6,P
      *Ahi_Wsp,Diag Stack
      *Lr_1,Wsp
   %finish
   *Stm_5,0(1)        {save the context}
   *Lr_Wsp,1          {new wsp}
   *L_1,Parm
   *L_2,Stack Limit
   *Lm_13,8(6)        {new gla, code, ep}
   *St_2,0(13)        {stack limit}
   *Balr_15,15

   SubsysFile_Stack Limit = Old Limit         {otherwise we can't call anything now}
   Update Stack Limit(Old Limit)
   Unstack Conts(Level)
   %return

TRAP: *Stme_0,Q
      SubsysFile_Stack Limit = Old Limit
      Update Stack Limit(Old Limit)
      %if Valid(Cont_Epc, 2) %and Shortinteger(Cont_Epc)&H = x'8101' %start
         {an event}
         %return %if EVENT_Event = 0 = EVENT_Sub    {%stop}
      %else
         EVENT_Event = 16                           {contingency}
         EVENT_Sub   = Q_Dact&255                   {type of error}
      %finish
      EVENT_Pc = Cont_Epc
      EVENT_X  = Addr(Cont)                         {context of error}
      %begin                                        {Preserve Message in case
         %string(63) S = Event_Message              {of error in Close All}
         Close All(1)                               {abandon output}
         Event_message = S
      %end
      Dump Contingency(Cont) %if Options&Opt Dump # 0
      Mdiag
%end
%systemroutine LoadX(%string(15) Id, %record(Spec fm)%name sp, %integername opt)
   %record(Textfm) T
   Pack Spec(Id, T)
   Sp_Entry = 0
   Dynamic Load(Sp, T)
   Opt = Xopt
   %signal 0,14 %if Sp_Entry = 0
%end
%externalroutine Temp Library(%string(27) Id)
   Length(Id) = 27 %if Length(Id) > 27
   Tlib_Use   = 0
   Tlib_Name  = Id
%end
%endoffile
 H?   ! !                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!          {d }J  
          	  J      NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    }R-^eeE     yqLX  8          OQSU&P PStopped at linecalled from  
Executing  Environmental variables starting at line in  line Termination Requested '  to to  	 bounds () not in    *Event    'YYc| cb C  !1 gSR Q Bg p    # $d  Ue               Unassigned variabler diagnoNo switch label (ler diagnoArray index (el (ler diagnoCorrupt arrayel (ler diagno Corrupt arrayel (ler diagnoNot enough store(ler diagnoSymbol in datare(ler diagnoError on stream (ler diagnoCapacity exceededler diagnoInvalid substring (r diagnoArray inside-out: (r diagnoIllegal exponent: (r diagnoIllegal %FOR parametersagnoControl variable corruptgnoIllegal shiftble corruptgnoString resolution failedgnoIllegal InstructionailedgnoValue too largetionailedgnoSegment ErrorgetionailedgnoTime Exceededgetionailedgno%event failureetionailedgno %event failureetionailedgnoREAD: parameter type ??dgnoNo charno (eter type ??dgnoPerm routine missing ??dgno             =  unassigned  ? unassigned pointer *unknown type    Fn   illegal reference *Unknown PC   *Cannot give further diagnostics *Mdiag - internal error                 Termination RequestedessageIllegal interruptstedessageIllegal SVCerruptstedessageIllegal instructionedessageArithmetic faultionedessageAddress errorultionedessageTime exccededultionedessageInsufficient privilegessageInvalid PON serviceegessageVague SVC errorviceegessageInvalid SVC addressegessageConsole failureressegessageConsole buffer failuressageInvalid contingency buffere
Demon deadntingency buffereGod knows whatgency buffereTransfer failurency buffereUnknown contingency buffere              x'                                        
     $$A>  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nA> ?1  &034C0  D   D   
C  y g p ,W   H$XXi W  \` 'W   <y   	W  p ,W  ,X ! !(
sL

W   HC 2fW   HC  XW   H$QXi  W  \#$bW  8$ A  F	W  p ,W  t#5%y DW   HXi A $" 	w p 0XZX=U< 8!4y XZX< 8P=X=Z=X 4P$TXmAx#7$TXmAl!6X]$aAXsJ@
DPP$PP]0Hj Pi ,#$QP]0`
fPi ,!7X]Z$`AH 

l
jPmX9 ,'2
:P= s 
P ,HJ 
D

PX ,'
PXMsT@
U
TP]'BPMC  	g p ,$PX=P=XUC0:$RkAC0.XsJ  
DPDXY 	Z#%Y]!"#P$aQmC XY $aAXDX=!=X 0 #7%Py XMHT P P](Xi X=0 c#9H İ@ V,P,&PH     #4&P&PX=0B0XPHXPLXMPMDX]DC0*XmHs  
lPmHX=Ls  
;P=L'QP]DC XHsJ  
DP8$RQ]8Xm8H  !2"  PP@X=P=P&bPm8XPY CLX@PXM8HT  P]<!P 
P@Xm<e
f
PP#ĠP@UMH!2#&BPM8C XLs<  
3&P XLP$C 2X&
Xs  PPX&XMJPM &GPM$C p	g p ,$PlXZ E@ 0 (CPMpD!7@  PMpC &@ !&D @PMp#@ $!&D PMp#'BPMpӽTZlʽTK  %QQ]lXml!2#X: #   (,P: C T&Tz  R
W  p 0X Z  Ph%2Q=hXhH  !2"$@MTP ,XY 
SP]d#
&RP]dse  AX]dUY , ;mTT
l6  0  !5'T"T$A  y  C	g p 4$QW   TX   BB ~B :$eW   ` 'W   <Xj W   <` 'W   <C &X: #$0;0 #+$dW   Xj Az  L
w p 4XtP ,X=|#:2Z=Z=Z  P ,Xxð C02&P ,$TlW  t!3C &XJ ,XT  PZ ,Xmx` PmxXx
sL"

W   H$QXmxW   TC $TXj ,A:C0:X: ,X  P ,!9W   H#XMx@ 
DsD"

C $TXj ,AC0BXZ ,Xe  `C0,Xx  !4AN#h  ` ,$V$aW   #C 0C :$QXj ,AC0^Xj ,6  
c$QAC0JX ,K  @ !7[ P C0,` "W   <X ,W   H` "W   <#C C Xj , P 0$TXj ,AC02W  $XX: ,Xc  W  \$Q ,XJ ,UJ 0#3C C z$QXj ,AC0XZ ,e  ARXj ,   !3C 2C J$RXj ,AC0X: ,Hc  A"X ,sK  @  !2##W   HW   Hz @
w p ,X &PX=U=$C0H  Pİ  PtXĠ P|XMH@ PMxX]P@ #4&HPMxP  #5D PMx$dPmU#$`Pms PtV&Tc A-A X=&8Z=P=$oӲ  kW   W   HW   HAW  ,C *y  z	w p 0XVP , #4 !5 P , !5 cP , !5 P ,0 P=XC0"
ZHK  PMTUZ ,!2#%aQmC z  B
w p ,XLX<  P=X PX PXM!P TZ]W   HC  ɰ !#A,W   H$PXmW   T` ,W   <$PXmW   T` ,W   <$PXmW   TXmL #?W  X=L W   HW   HXC0dȠ ZW   HXM&HZMXT P]Xm&hZmX PX=8
3sC

$PXmW   T` )W   <C $PXmW   TW   HW   H$\XmAZC06X$PXk W   TW   HX$PXj W   T` )W   <C p$PXmW   TC \$PXmW   TW   H$QXmW   TC W   HXmW   <` 'W   <#XM!;X]!8zW   HW  ,y =	w ) ,A p DW  , ,W   HX0B0>X=C06X4!3P=4tW   H$QXmW   TnW   H$XXm AW   HXC0(\W   H$QXmW   TW  ,XM0B0xANX](PY @Xm` AXi @Pm(X &U$C0JX=Z=X 4P <X UC0.XP W  ,DW   HW  ,Ay  	w P (p 0XLX< PP=ȳ HPX  Š !=X P!ɐ #%Ȑ PPx ,#Xx ,x W  ,$`W  P$P,$1Q=AX&Zȫ P%PAXMXd AX]#XmZmXf <A8AX,#3C 6X=(2Z=Z=X  PAXZXj <A~*AC X4C04W  ,W   H$QXm4W   T$bW  8C  @ mr H$QXm4W   T$bW  8C  @ (\W   H$QXmW   TW  ,XM0B0xAX](PY @Xm` AXi @Pm(X &U$C0JX=Z=X 4P <X UC0.XP W  ,DW   HW  ,Ay  	w P (p 0XLX< PP=ȳ HPX  Š !=X P!ɐ #%Ȑ PPx ,#Xx ,x W  ,$`W  P$P,$1Q=AX&Zȫ P%PAXMXd AX]#XmZmXf <A8AX,#3C 6X=(2Z=Z=X  PAXXZXj <AN*AC X4C04W                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                                                                      Ā        illegal ref   illegal ref     ' ,A   hW   XP@ @Hr  qXX#3C lW   h?  W  ' K A b  &a :F   b  ' ,A   hW   X8P8X` AZW  8C  W  XP  C  W  P x# PP xQ$aAC $P |Ȑ +H &AҘD  H %Q&QPX x8 ( XCA    illegal ref   illegal ref   %)  7    ;+ 	5,  :    >. ;w P (p0NPH 0p2P ,NPH Dp@P @NPH Pp @P LNPH Xp P TNPH lpP hNPH xp xP tN|PH p@P |$P P P N\PHp PNLPHp	`PP P$N<PH,p PP(A @  #5@$aW   ` H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        {   **************************************************************
{   *                                                            *
{   *          PERKIN-ELMER 32-BIT SERIES IMP COMPILER           *
{   *                   Master Diagnostic Routine                *
{   *                                                            *
{   *                 (GENERAL SERVICE VERSION)                  *
{   *                                                            *
{   *                       C.H. WHITFIELD                       *
{   *                     19, REDFORD TERRACE                    *
{   *                          COLINTON,                         *
{   *                     EDINBURGH  EH13-0BT                    *
{   *                                                            *
{   *                 COPYRIGHT (c) MAY 1ST. 1980                *
{   *                     ALL RIGHTS RESERVED                    *
{   *                                                            *
{   **************************************************************

%begin
   {Note: as MDIAG runs on the user's stack in front of the program
   {      it is diagnosing, care must be taken to minimise the amount
   {      of stack it uses. Gla space is unlimited}

   %externalroutinespec Terminal mode(%integer n)
   %externalroutinespec phex(%integer n, p)
   %externalroutinespec store dump(%integer from, size)
   %externalpredicatespec valid(%integer a, n)

%recordformat  pgmfm(%integer  limit, stack, gla, code base, ep, code,     %c
                                                   %shortinteger  options)
%ownrecord(pgmfm)  reg

%recordformat  rfm(%integer  ps,pc,%integerarray gpr(0:15), fpr(0:7) )
%recordformat  contfm(%integer  ps,pc,%integerarray gpr(0:15),  %c
                                      %record(rfm)  old)

! Constants known to third pass.
%constinteger  line diag limit = 31
%constinteger  indirect = x'4000'

%routine hex(%integer n)
   printstring(" x'");  phex(n, 8);  printsymbol('''')
%end

%ownrecord(rfm)%name error context
%ownrecord(contfm)%name c
%owninteger contingency =-1,
            diag char
%owninteger k
%conststring(27)%array Cont Mess(0:17) =
            "Termination Requested",            {0}
            "Illegal interrupt",                {1}
            "Illegal SVC",                      {2}
            "Illegal instruction",              {3}
            "Arithmetic fault",                 {4}
            "Address error",                    {5}
            "Time excceded",                    {6}
            "Insufficient privilege",           {7}
            "Invalid PON service",              {8}
            "Vague SVC error",                  {9}
            "Invalid SVC address",              {10}
            "Console failure",                  {11}
            "Console buffer failure",           {12}
            "Invalid contingency buffer",       {13}
            "Demon dead",                       {14}
            "God knows what",                   {15}
            "Transfer failure",                 {16}
            "Unknown contingency"               {17}

   c == record(EVENT_x)
   error context == c_old
   %if EVENT_event = 16 %start         {contingency}
      contingency = EVENT_sub
      contingency = 17 %unless 0 <= Contingency <= 16
   %finish

   ! Register definitions
   %constinteger  p2=5, p1=6, wsp=7, gla=13, code=14, link=15

   ! layout of first 44 bytes of stack frame
   %recordformat  framefm(%integerarray  reg(p2:link))

   ! Description of object file header block
   %recordformat  hdfm(%shortinteger  p1,p2)
   %recordformat  headerfm(%shortinteger  pure size, gla size, code disp,
                                          lit disp, registers, mainep,
               %record(hdfm)  reloc, defn, spec, ldiag, vdiag )
   %constinteger  basic header=18;         ! *** halfwords ***

   %ownrecord(headerfm)%name  hdr
   %ownrecord(framefm)%name  f
   %owninteger gla mark = 0

   %owninteger  code base, gla base, file base, ca;      ! absolute byte addresses
   %owninteger  event head, event end, line head, line end, id head, id end; ! ditto

   ! Pointers set by 'set pointers' routine
   %owninteger  epntr, block no, block addr, block line no, line no
   %owninteger  id from, id to;      ! limits of interest in ident. tables
   %owninteger  display reg,  main prog, diags
   %owninteger stop line = 0

   %constinteger  full=0, partial=1, H = x'FFFF'

%routine  fail(%integer  fail no, p)
   %constinteger  fmax=1
   %switch  f(0:fmax)
   newline
   -> f(fail no) %if 0 <= fail no <= fmax
        print string("*Mdiag - internal error");          -> exit
f(0):   print string("*Cannot give further diagnostics"); -> exit
f(1):   print string("*Unknown PC ");  Phex(p,1);         -> exit

EXIT:   newlines(2)
        %stop
%end


%predicate  ok(%integer from, bytes)
   %true %if valid(from, bytes)
   print string(" illegal reference");  hex(from)
   %false
%end;      ! 'ok'

%routine  initialise
! Initialise for this code segment.  Where external linking occurs, must
! be called every time a segment switch occurs. i.e. when new code base is
! different than old code base.
   %integer  k

   %return %if code base = f_reg(code)
   code base = f_reg(code)
   gla base = f_reg(gla)
   fail(1, ca) %unless ok(codebase, 4) %and ok(glabase, 4)
   file base = code base - ((shortinteger(code base-4))&H)*2
   
   hdr == record(file base)

   diags = full
   k = hdr_ldiag_p1
   diags = partial %if k < 0;      ! ldiag_p1 sign bit
   k = (k & x'7FFF')*2
   %if k = 0 %start
      fail(0,ca-file base);      ! No diag tables - return address of smash
   %finish
   line head = k + hdr_ldiag_p2*2 + file base
   line  end = (k-2) + file base;            ! convention
   k = (hdr_vdiag_p1 & H)*2
   id head = k +hdr_vdiag_p2*2 + file base
   id  end = (k-2) + file base;              ! convention
   event head = (shortinteger(code base-2)&H)*2 + code base;   ! N.B. absolute
   event  end = code base - 2;               ! convention

%end;         ! initialise

%routine  set pointers(%integer  ca);   ! N.B. parameter is absolute address
   %owninteger  k, n, here, next, lpntr, vpntr, ad

   block no = 0
   epntr = event head
   %while epntr # event end %and ok(epntr, 2) %cycle
      next = epntr - (shortinteger(epntr)&H)*2
      -> FOUND %if next < ca <= epntr
      epntr = next;  block no = block no+1
   %repeat
   fail(1,ca);      ! *** error address not found ***

FOUND:
   %if next = code base - 2 %and ca # codebase!1 %start;  ! trapped from perm
      block no = -1
      %return
   %finish
   display reg = short integer(epntr+2)&15
   %if ca # codebase!1 %start
      main prog = short integer(epntr+2)&x'4000'! main prog
   %finish
   block addr = next+2
   block addr = block addr+6 %if shortinteger(block addr)&x'8000' # 0
   block addr = block addr+2;         !+previous: skip event info
   %if diags = full %start
      lpntr = line head;  vpntr = id head
      next = block no
      %while next # 0 %cycle
         lpntr = lpntr - (shortinteger(lpntr)&H)*2
         vpntr = vpntr - (shortinteger(vpntr)&H)*2
         next = next-1
      %repeat
      k = lpntr - (shortinteger(lpntr)&H)*2
      k = k+2 %until shortinteger(k) # 0;   ! skip any empty space
      block line no = shortinteger(k)&H
      here = block line no;  ad = block addr
      k = k+2
      %while ad < ca %cycle
         line no = here
         n = shortinteger(k)
         %if n >= 0 %start
            here = here + (n & line diag limit)
            ad   = ad + (n>>5)*2;            ! ** N.B   //(line diag limit + 1)
         %else
            here = n&x'7FFF'
         %finish
         %exit %if k = lpntr
         k = k+2
      %repeat
      id from = vpntr - (shortinteger(vpntr)&H)*2 + 2
      id to   = vpntr
   %else;            ! partial diags
      block line no = shortinteger(line head - 2*(block no+1))&H
      line no = block line no
      id from = id head - 8*(block no+1)
      id to   = id from + 7
   %finish
%end;            ! set pointers

%string(12)%fn  varname(%integer  where, bytes)
   %ownstring(12)  s
   %owninteger  k, end

   %routine  unpack(%integer  x)
      %owninteger  k,sym

      k = 3
      %cycle
         sym = rem(x,40)
         %if sym = 0 %start
            sym = ' '
         %else %if sym <= 26
            sym = sym - 1 + 'A';       ! 1:26 => A:Z
         %else %if sym <= 36
            sym = sym - 27 + '0';      ! 27:36 => 0:9
         %else
            sym = sym - 37 + '#';      ! 37 => #, 38 => $, 39 => %
         %finish
         charno(s, length(s)+k) = sym
         k = k-1;  %exit %if k = 0
         x = x//40
      %repeat
      length(s) = length(s) + 3
   %end

   end = where + bytes
   end = end-2 %until shortinteger(end) # 0
   s = ""
   unpack(shortinteger(k)&H) %for k = where,2,end
   length(s) = length(s) - 1 %while charno(s,length(s)) = ' '
   %result = s
%end;            ! varname

%routine  dump locals
   %owninteger  disp, type, base reg, extra ident
   %ownstring(12)  ident
   %owninteger  k, pntr

   !**** Note that the reduced types used by the diagnostics are, for reasons of
   !     economy, generated in Pass TWO %not 3 (%routine describe)
   !****

   %routine output(%integer  n)
      %integer  j,k

      write(n,1)
      %if 32 <= n&(\128) <= 126 %start;      ! ignore parity bit
         spaces(5)
         print symbol('''');  print symbol(n);  print symbol('''')
      %else %if |n| > 256
         spaces(4);  hex(n)
      %finish
   %end;      ! 'output'

   %routine  print value
      %switch  s(0:15)
      %integer  p, q
      %constinteger  unass = x'80808080'

      p = disp
      p = p + f_reg(base reg) %if base reg # 0
      %if type&16 # 0 %start      {external spec}
         p = p+8                  {skip linkage info}
         ->out %unless VALID(p, 4)
         p = integer(p)
         type = type&15
      %finish
      -> s(type)
   s(0):
   s(8):   ! unused
           print string(" *unknown type"); write(type,1)
           -> OUT
   s(9):   !integername
   s(10):  !realname
   s(15):  !longrealname
   s(11):  !stringname
   s(12):  !recordname
   s(13):  !byteintegername
   s(14):  !shortintegername
           %if ok(p,4) %start
              p = integer(p);   ! fetch pointer
              %if p = unass %start
                 print string(" unassigned pointer")
              %else
                 -> s(type&7)
              %finish
           %finish
           -> OUT
s(1):      !integer
s(2):      !real
s(7):      !longreal
           %if ok(p,4) %start
              %if integer(p) # unass %start
                 %if type&7 = 1 %start
                    output(integer(p))
                 %else
                    print(real(p),1,6)
                 %finish
              %else
                 -> UNA;      ! print "unassigned" message
              %finish
           %finish
           -> OUT
s(3):      ! string
           %if ok(p,1) %and ok(p+byteinteger(p),1) %start
              %if byte integer(p) # x'80' %or byte integer(p+1) # x'80' %start
                 print symbol('"');  print string(string(p));  print symbol('"')
              %else
                 -> UNA
              %finish
           %finish
           -> OUT
s(4):      ! record
           q = p + 6*4
           %while ok(p, 4) %cycle
              Space
              phex(integer(p),8)
              p = p+4
           %repeat %until p = q
           -> OUT
s(5):      ! byte
           %if ok(p,1) %start
              output(byteinteger(p))
              -> MAYBE %if byteinteger(p) = x'80';   ! possibly unassigned
           %finish
           -> OUT
s(6):     ! shortinteger
           %if ok(p,2) %start
              output(shortinteger(p))
              -> MAYBE %if shortinteger(p)&x'FFFF' = x'8080'
           %finish
           -> OUT
MAYBE:     print string("  ?")
UNA:       print string(" unassigned")
OUT:
   %end;      !of 'print value'

   pntr = id from + 4*2;      ! skip over procedure ident
   %while pntr # id to %cycle
      k = shortinteger(pntr)
      disp = (k&15) << 16;         ! top 4 bits of disp
      base reg = (k>>4)&15
      type = (k>>8)&7
      type = type+8 %if k&indirect # 0;      ! ... basic type 0:7, indirect 8:15
      type = type+16 %if k&x'2000' # 0       {external spec}
      extra ident = 4
      extra ident = 0 %if k < 0
      disp = disp ! (shortinteger(pntr+2)&H)
      ident = varname(pntr+4,4+extra ident)
      pntr = pntr + 8 + extra ident
      spaces(3+12-length(ident));  print string(ident)
      print string(" = ");  print value
      newline
   %repeat
%end;         ! dump locals

%routine  print happening
   %constinteger  messages = 25
   %constinteger  UAV  = X'081', SLNS = X'163', ABE  = X'262',
                  CDV  = X'043', INE  = X'091', EXB  = X'021',
                  SID  = X'831', SND  = X'492', CEX  = X'013',
                  SSE  = X'667', AIO  = X'353', EXPI = X'452',
                  FPI  = X'051', FVC  = X'042', ISP  = X'567',
                  SRF  = X'070', BADI = X'000', FLOV = X'011',
                  SEGR = X'023', TEX  = X'024', SIGF = X'464',
                  LODF = X'00E', RDP  = X'055', CLEX = X'765',
                  MISSING = X'0BB'

   !Flag fields 0 = no action
   !            1 = output switch index (r2)
   !            2 = output array  index (R2) and array  bounds (R4)
   !            3 = output array bounds (R4)
   !            4 = output exponent (R2)
   !            5 = output shift count (R2)
   !            6 = output substring limits (R2, R4)
   !            7 = output charno index (R2)
   !            8 = output symbol in R2
   %conststring(27)%array  message text(1:messages) =
         "Unassigned variable",    "No switch label (",
         "Array index (",          "Corrupt array",
         "",                       "Not enough store",
         "Symbol in data",         "Error on stream ",
         "Capacity exceeded",      "Invalid substring (",
         "Array inside-out:",      "Illegal exponent",
         "Illegal %FOR parameters","Control variable corrupt",
         "Illegal shift",          "String resolution failed",
         "Illegal Instruction",    "Value too large",
         "Segment Error",          "Time Exceeded",
         "%event failure",         "",
         "READ: parameter type ??","No charno (",
         "Perm routine missing"
   %constshortintegerarray  code(1:messages) =
               UAV,                     SLNS,
               ABE,                     CDV,
               INE,                     EXB,
               SID,                     SND,
               CEX,                     SSE,
               AIO,                     EXPI,
               FPI,                     FVC,
               ISP,                     SRF,
               BADI,                    FLOV,
               SEGR,                    TEX,
               SIGF,                    LODF,
               RDP,                     CLEX,
               MISSING
   %owninteger  event no,subevent,extra,message, flag, r2, r4
   %switch action(0:8)

   %routine  find message
      %integer  k
      k = event no<<4 ! subevent
      k = 1<<4!3 %if k = 1<<4!5 %or k = 1<<4!7
      k = 6<<4!3 %if k = 8<<4!2
      k = 1<<4!1 %if k = 1<<1!2
      message = messages
      %while message # 0 %cycle
         flag = code(message)
         %exit %if flag&255 = k
         message = message-1
      %repeat
   %end

   event no = EVENT_EVENT
   subevent = EVENT_sub
   extra = EVENT_extra
   %if Contingency >= 0 %start
      Printstring(Cont Mess(Contingency))
   %else
      find message %if sub event <= 15
      printstring("*Event ")
      write(eventno, 0);  printsymbol(',')
      write(subevent,0);  printsymbol(',')
      write(extra, 0)
      space %and printstring(EVENT_Message) %if EVENT_Message # ""
      print string("   ")
      %if message # 0 %start
         print string(message text(message))
         r2 = error context_gpr(2);  r4 = error context_gpr(4)
         ->action(flag>>8)
action(1):     !switch
action(7):     !charno
      write(r2, 0);  printsymbol(')');  ->done
action(2):     !array
      write(r2, 0)
      printstring(") not in")
action(3):     !inside-out
      printstring(" bounds (")
      %if ok(r4, 12) %start
         write(integer(r4+4), 0);  printstring(" to ");  write(integer(r4+8), 0)
      %finish
BRACKET:
      printsymbol(')')
      ->done
action(4):     !exponent
action(5):     !shift
      write(r2, 0)
      -> DONE
action(6):      ! substring
      write(R2,0);  print string(" to");  write(R4,1)
      -> BRACKET
action(8):      !symbol in data
      printstring(" '");  printsymbol(Extra);  printsymbol('''')
action(0):
done:
      %else %if event no=0=sub event
         printstring("Termination Requested")
      %finish
   %finish
   newline
%end;            ! print happening

%routine  print out(%string(13)  prefix)
   %integer g, old display

   newline
   print string(prefix)
   %if diags = full %and line no # 0 %start
      stop line = line no %if stop line = 0
      print string("line");  write(line no,1)
      print string(" in ")
   %finish
   print string(varname(id from,8))
   %if block line no # 0 %start
      print string(" starting at line"); write(block line no,1)
      newline
   %finish
   %if diags = full %start
      dump locals
      old display = display reg
      set pointers(codebase!1);      !look for globals
      display reg = old display
      %if id from+4*2 # id to %start
         g = f_reg(gla)
         %if integer(g+4) # gla mark %start
            integer(g+4) = gla mark
            newline
            printstring("Environmental variables");  newline
            dump locals
         %finish
      %finish
   %finish
%end;      ! print out

!      ------- M A I N    L O O P -------

   %on 9 %start;  %return;  %finish
   Newline
   terminal mode(0)            {in case of binary I/O to terminal}
   main prog = 0
   gla mark = gla mark+1       {to enable repeated printing of globals}
   print happening
   f == record(addr(error context_gpr(p2)))
   code base = -1              {force first initialisation to occur}
   initialise
   set pointers(error context_pc)
   set pointers(f_reg(link)) %if block no < 0;      ! pc in perm
   print out("Executing ")
   %cycle
      %exit %if main prog # 0
      f == record(f_reg(display reg))
      initialise
      set pointers(f_reg(link))
      print out("called from ")
   %repeat

   %if stop line # 0 %start
      newline
      print string("Stopped at line");  write(stop line,1);  newlines(2)
   %finish
%endofprogram
 H?   % %"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    {Symbol types}
!
!  0   a   A   .  SP  NL   o   !   (
!  :   :   :   #           t   ?   [
!  9   z   Z   $           h       {
!              :           e       <
!              _           r
!              -
!  
!  0   1   2   3   4   5   6   7   128+closing bracket
!
%constbytearray Type(0:127) =
   6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?},
   6 {?}, 6 {?}, 5 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?},
   6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?},
   6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?},
   4 { }, 7 {!}, 6 {"}, 3 {#}, 3 {$}, 3 {%}, 6 {&}, 6 {'},
 128+')', 6 {)}, 3 {*}, 6 {+}, 6 {,}, 3 {-}, 3 {.}, 6 {/},
   0 {0}, 0 {1}, 0 {2}, 0 {3}, 0 {4}, 0 {6}, 0 {0}, 0 {7},
   0 {8}, 0 {9}, 3 {:}, 6 {;},128+'>',6 {=}, 6 {>}, 7 {?},
   6 {@}, 2 {A}, 2 {B}, 2 {C}, 2 {D}, 2 {E}, 2 {F}, 2 {G},
   2 {H}, 2 {I}, 2 {J}, 2 {K}, 2 {L}, 2 {M}, 2 {N}, 2 {O},
   2 {P}, 2 {Q}, 2 {R}, 2 {S}, 2 {T}, 2 {U}, 2 {V}, 2 {W},
   2 {X}, 2 {Y}, 2 {Z},128+']',6 {\}, 6 {]}, 6 {^}, 3 {_},
   6 {`}, 1 {a}, 1 {b}, 1 {c}, 1 {d}, 1 {e}, 1 {f}, 1 {g},
   1 {h}, 1 {i}, 1 {j}, 1 {k}, 1 {l}, 1 {m}, 1 {n}, 1 {o},
   1 {p}, 1 {q}, 1 {r}, 1 {s}, 1 {t}, 1 {u}, 1 {v}, 1 {w},
   1 {x}, 1 {y}, 1 {z},128+'}',6 {|}, 6 {?}, 6 {~}, 6 {?}
%externalroutine Extract Command(%string(*)%name C, Parm, %string(127) S)
   %integer P, L, T, Sym
   C = "";  Parm = ""
   P = 0;  L = Length(S)
   %cycle
      %return %if P = L
      P = P+1
      Sym = Charno(S, P)
      T = Type(Sym)
      %if T <= 3 %start
         C <- C.Tostring(Sym) %if Length(C) # 31
      %else
         %exit %if Sym # ' ' %or C # ""
      %finish
   %repeat
   %while P <= L %cycle
      Sym = Charno(S, P);  P = P+1
      %continue %if Sym = ' ' %and Parm = ""
      Parm = Parm.Tostring(Sym) %unless Length(Parm) = 63
   %repeat
%end
%externalroutine Parse Parameter(%record(Commandfm)%name C, %integer Option,
                                 %string(127) Parm)
   %integer Sym, P, J, Sym Type, L, T
   %routine Get Sym
      %if P # L %start
         P = P+1;  Sym = Charno(Parm, P)
      %else
         Sym = NL
      %finish
      Sym Type = Type(Sym)
   %end
   %routine Get(%string(31)%name Stream)
      Stream = ""
      %while Sym Type <= 4 %cycle
         Sym = Sym-32 %if Sym Type = 1
         Stream = Stream.Tostring(Sym) %if Sym Type # 4
         Get Sym
      %repeat
      Get Sym %if Sym = ','
   %end
   Parm = Parm.Tostring(NL)
   P = 0
   L = Length(Parm);  %signal 6,8,L %if L > 127
   C_Rest = 0
   Get Sym
   %if Sym Type = 7 %start
      C_Modifier = Sym
      Get Sym
   %finish
   Sym Type = 128+NL %and P = P-1 %if Option&NoDecode # 0
   %if Sym Type&128 # 0 %start
      T = Sym Type&127
      %cycle
         Get Sym
         %if Sym = T %start
            %if Option&nodecode = 0 %and T = NL %and C_Parameter # "" %start
               Sym = Charno(C_parameter, Length(C_Parameter))
               %if Type(Sym) = 7 %and C_Modifier = 0 %start
                  C_Modifier = Sym
                  Length(C_Parameter) = Length(C_Parameter)-1
               %finish
            %finish
            Get Sym
            %exit
         %finish
         %continue %if Sym = ' ' %and Option&SpacesX # 0
         %if Sym = NL %start
            Event_Message = Tostring(T)." missing"
            %signal 11,10,1
         %finish
         C_Parameter=C_Parameter.Tostring(Sym) %unless Length(C_Parameter)=63
      %repeat
      ToUpper(C_Parameter) %if Option&Upper # 0
   %finish
   Get Sym %while Sym = ' '
   %if Sym Type = 7 %and C_Modifier = 0 %start
      C_Modifier = Sym;  Get Sym
   %finish
   Get(C_In1);  Get(C_In2);  Get(C_In3)
   %if Sym = '/' %start
      Get Sym
      Get(C_Out1);  Get(C_Out2);  Get(C_Out3)
   %finish
   %if Type(Sym) = 7 %and C_Modifier = 0 %start
      C_Modifier = Sym
      Get Sym
   %finish
   %if Sym # NL %start
      Event_Message = "Malformed command: "
      %cycle
         Event_Message=Event_Message.Tostring(Sym) %if Length(Event_Message)#63
         Get Sym
      %repeat %until Sym = NL
      %Signal 11,10,0
   %finish
%end
%endoffile
 H?    H                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %routinespec prompt(%string(15) s)
%routinespec selectinput(%integer st)
%routinespec selectoutput(%integer st)
%routinespec close in(%integer stream, safe)
%routinespec close out(%integer stream, how)
%routinespec close input
%routinespec close output
%routinespec abandon input
%routinespec abandon output
%routinespec open input(%integer st,  %string(31) file)
%routinespec open output(%integer st, %string(31) file)
%routinespec printsymbol(%integer sym)
%routinespec printstring(%string(255) s)
%routinespec newline
%routinespec space
%routinespec newpage
%routinespec newlines(%integer n)
%routinespec spaces(%integer n)
%routinespec console(%string(63) s)
%integerfnspec readsymbol
%integerfnspec nextsymbol
%routinespec skipsymbol
%routinespec write(%integer value, places)
%routinespec print fl(%real r, %integer p)
%routinespec print(%real r, %integer a, b)
%routinespec phex(%integer n, p)
%routinespec read(%name n)
%routinespec stop
%routinespec create seg(%integername n, %integer size)
%routinespec tidy segs
%routinespec cpu limit(%integer seconds)
%routinespec unstack conts(%integer to)
%integerfnspec cputime
%string(9)%fnspec date
%string(8)%fnspec time
%realfnspec fracpt(%real r)
%routinespec store dump(%integer from, size)
%routinespec dump contingency(%record(contfm)%name  cont)
%routinespec to upper(%string(*)%name s)
%routinespec to lower(%string(*)%name s)
%routinespec obey(%string(31) in, out, %string(63) p)
%routinespec pack(%string(63) s, %record(filefm)%name F)
%routinespec unpack(%record(filefm)%name F, %string(*)%name S)
%routinespec Del file(%record(filefm)%name F, %integer quiet)
%routinespec delete file(%string(63) file)
%string(72)%fnspec itos(%integer n,p)
%string(63)%fnspec xtos(%integer n,p)
%endoffile
 H?    Q                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %externalroutine SPY
!   %integer sym, s, n, ad, j
!   %predicate VAL(%integer ad)
!      %true %if valid(ad, 2)
!      printstring("Invalid address");  newline
!      %false
!   %end
!   Init streams
!Reset:
!   prompt("Spy>")
!   %cycle
!      n = nextsymbol
!      %exit %unless n = ' ' %or n = nl
!      skipsymbol
!   %repeat
!   skipsymbol %and %return %if n = '.'
!   read hex(ad)
!   skipsymbol                {pending newline}
!   %cycle
!      ad = ad&(\1)            {round it down}
!      ->reset %unless val(ad)
!      prompt(xtos(ad, 5).": ".xtos(shortinteger(ad), 4)." >")
!      %cycle
!         sym = nextsymbol
!         %exit %if sym # ' '
!         skipsymbol
!      %repeat
!      skipsymbol %and %return %if sym = '.'
!      %if sym = nl %start
!         skipsymbol
!         ad = ad+2
!      %else
!         n = 0
!         %if nextsymbol # nl %start
!            read hex(n)
!         %finish
!         n = 1 %if n <= 0
!         s = readsymbol %until s = nl
!         %if sym = '*' %start
!            %cycle
!               phex(ad, 5);  printsymbol(':')
!               %for j = -3, 1, 4 %cycle
!                  ->reset %unless val(ad)
!                  space;  phex(shortinteger(ad), 4)
!                  n = n-1;  %exit %if n <= 0
!                  ad = ad+2
!                  space %if j = 0
!               %repeat
!               newline
!            %repeat %until n <= 0
!         %else %if sym = '+' %or sym = '-'
!            n = n<<1
!            %if sym = '+' %then ad = ad+n %else ad = ad-n
!         %else
!            ad = n
!         %finish
!      %finish
!   %repeat
%end
%endoffile
 H?    V                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    {      6-Nov-81
{  MOUSES Standard command library       A. Culloch   Sep-81
{
!!!!%option  "NODECODE"
{
%const %string(3) version = "1.3"
{
{
{        OBEY(parm)  command/report
{        COPY  in1, in2, in3 / out
{        FILES
{        DELETE filespec
{        RENAME filespec/filespec
{        PURGE
{        LET   symbol = ...     or  LET?
{        LIB   Object filespec
{        BECOME  Username
{        ENTRIES Object filespec/out
{        OPTION(opt1, opt2, ...)  Objfilespec
{        ANALYSE  filespec/out
{        OFFER  filespec/queue:
{        SET  opt1, opt2, opt3, ...
{        STATE  or  STATE(SYSTEM)  or STATE(QUEUES)  or STATE(DISCS)
{
{  Some commands use the separate 'wildcard' processor module:
{
%include  "SysInc:Command.inc"

%record %format Filespec(%string(7) Unit, Owner, %string(15) File,
                         %string(3) Ext,
                         %short %integer Volatile, Nil)

%record %format FD fm   (%string(15) name, %short %integer pos)

%routine %spec              Sort(%record(FD fm)%arrayname T, %integer Lo, Hi)
%routine %spec              Wild Spec(%string(31) spec)
%record(Filespec) %fn %spec Next filespec
%record(Filespec) %fn %spec Split(%string(31) Filename)
%string(31)       %fn %spec Filename (%record(Filespec)%name F)
%routine %spec              For each(%record(Commandfm)%name C,
                                     %routine X(%record(Commandfm)%name CC))
%routine %spec              Mask(%record(Filespec)%name f,
                                 %record(filespec) mask)
%own %record(Command fm) C

{Subsystem entries}

%include "SysInc:Direct.inc"
%externalroutinespec  Parse Parameter(%record(Commandfm)%name  C, %integer  option,
                                          %string(127)  Parm)
%external %string(7)               %spec  SS Version %alias "$VERSION"
%external %string(17)              %spec  Console Int
%external %string(17)              %spec  Command Prompt
%external %string(15)              %spec  Error file
%external %string(7)               %spec  Search owner
%external %string(72)          %fn %spec  ItoS (%integer I, Places)
%external %integer             %fn %spec  StoI(%string(31) s)
%external %integer             %fn %spec  In type
%external %integer             %fn %spec  Out type
%external %predicate               %spec  Exists(%string(31) Filename)
%external %routine                 %spec  Rename File(%string(31) old, new)
%external %routine %spec      Pack (%string(31) file, %record(Filefm)%name F)
%external %routine %spec    Unpack (%record(Filefm)%name F, %string(*)%name ff)
%external %routine %spec   Console (%string(63) Message)
%external %routine %spec      Echo (%integer on off)
                                    %const %integer off = 0, on = 1
%external %routine %spec  To Upper (%string(*)%name S)
%external %routine %spec  To Lower (%string(*)%name S)
%external %routine %spec  Open All (%record(Command fm)%name C)
%external %routine %spec Close All (%integer how)
%external %routine %spec Read Line (%string(*)%name S)
%external %routine %spec  Del File (%record(file fm)%name F, %integer quiet)
%external %routine %spec      Phex (%integer X, Places)
%external %routine %spec   Open DA (%integer chan, RW, %string(31) Filename)
%external %routine %spec   Read DA (%integer chan, block num, %name buffer)
%external %routine %spec  Write DA (%integer chan, block num, %name buffer)
%external %routine %spec  Close DA (%integer chan)

%external %routine %spec Xobey %alias "$OBEY"(%string(31) f,t, %string(63) p)

%constant %integer   IO error = 9
%constant %string(2)        x = "X "
%constant %integer  To Potter = 22,      {SVC:Message-> Central Queuing Agency}
                      Set TTY = 29,      {Set console parameters}
                    Disc read = 101,     {Physical disc I/O}
                   Disc Write = 102,
                  Disc Status = 108,
                     max unit = 12

!File system disc block formats

%record %format extent  (%short length,  {# of contiguous blocks in extent}
                         %short base)    {disc addr of first block}
%record %format spine   (%short extents, {# of extents in file}
                         %byte  access permissions,
                                check,   {should always be '?'}
                         %integer blocks,{# of blocks in file}
                         %record(extent) %array extent (1:126))

!Block zero on every logical disc

%record %format zero fm (%integer vol id,         {m'VOLN'}
                         %string(7) disc id,      {"SVOL"}
                         %integer   free list,    {free blocks spine}
                                    user list,    {user catalog}
                                    defective list,{bad blocks list}
                         %integer   system area,  {start of system image}
                                    system size,  {N contiguous blocks}
                         %string(11)initialisation date,
                         %integer   tracks,       {physical disc info}
                                    blocks per cylinder,
                                    heads,
                         %integer   initialised,  {=0 => Disc WIPED O.K.}
                         %integer   copied,
                         %integer   checksum,     {sum(blockzero)-1 = 0}
                         %string(187) description,{of logical disc contents}
                         %integer marked,   {V2.00+: Disc INITIALISED O.K.}
                         %byte %array spare (1:252))


%routine To mixed(%string(*)%name S)
   %byte %name C
   %return %if S = ""
   To lower(S)
   C == Char no(S, 1)
   C =  C - 'a' + 'A' %if 'a' <= C <= 'z'
%end

%routine Failure(%string(63) extra)
   %string(63) S = "*"
   To mixed(Command_command)             {Which command blew up?}
   %if event_message = "" %start
      event_message = "event ".ItoS(event_event,0).",".        %c
                               ItoS(event_sub,  0)
   %finish
   S = S.Command_command." "
   extra = extra." " %if extra # "" %and char no(extra, length(extra)) # ' '
   S = S.extra."fails - ".event_message
   Console(S)
%end

%routine TT set(%integer parm, val)
   %record(parm fm) P
   P_p1 = parm
   P_p2 = 0                              {My terminal}
   P_p3 = val
   SVC(Set tty, P)
%end

%routine Number (%integer N, Places, %string(31) Text)
   %if N = 0 %then print string("No") %else Write(N, Places)
   Space
   Length(Text) = Length(Text) - 1 %if N = 1
   Print string(Text)
%end

%routine  PRINT THEN PAD(%integer  width, %string(63)  s)
   print string(s)
   spaces(width - length(s))
%end

%routine  PAD THEN PRINT(%integer  width, %string(63)  s)
   spaces(width - length(s))
   print string(s)
%end

%routine Director(%integer Dact, %record(Parmfm)%name P)
   P_Dact = Dact
   SVC(To Director, P)
   Event_message = P_text %and %signal 11 %if P_p6 # 0
%end

%routine Squeeze(%string(*)%name S)
   %string(63) T = ""
   %integer    j
   %for j = 1, 1, length(S) %cycle
      T = T.to string(char no(S,j)) %if char no(S,j) # ' '
   %repeat
   S = T
%end

%integer %function Look up(%string(63) s, %string(*)%array %name Table,
                           %integer low, high {bounds on TABLE})
   %integer j
   %for j = low, 1, high %cycle
      %result = j %if table(j) = s
   %repeat
   %result = 0                           {not found}
%end

%string(8) %function Access(%integer mask)
   %integer k = 1, j
   %string(8) s = ""
   %result = "None" %if  mask     = 0
   %result = "All"  %if ~mask&255 = 0
   %for j = 0, 1, 7 %cycle
      s = s . to string('A' + j) %if mask&1<<j # 0
   %repeat
   %result = s
%end

%integer %function Access bits(%string(31) s)
   %integer mask = 0, j, sym
   To upper(s)
   %result = -1 %if s = "ALL"
   %result =  0 %if s = "NONE"
   %for j = 1, 1, length(s) %cycle
      sym = char no(s, j)
      %if 'A' <= sym <= 'H' %start
         mask = mask ! 1<<(sym-'A')
      %else %if sym # ' '
         Event_message = "invalid access code ".s
         %signal 11
      %finish
   %repeat
   %result = mask
%end

%predicate  privileged
   %record(parmfm)  p
   p_p1 = 0;  svc(14,p)
   %true %if p_p4 < 0
   %false
%end

%external %routine OBEY (%string(63) Parm)
   %on 9 %start
      Console("*end*".event_message)
      %return
   %finish
   parse parameter(C,0,parm)
   Xobey(C_in1, C_out1, C_Parameter)
%end

%external %routine COPY (%string(63) Parm)
   %routine Copy(%record(Command fm)%name C)
      %external %integer %function %spec READ SYMBOL %alias "#READSYMFN"
      %external %routine %spec  READ BLOCK(%integer  key, block no, %name buff)
      %external %routine %spec WRITE BLOCK(%integer  key, block no, %name buff)
      %external %routine %spec SEEK OUTPUT(%integer  file addr)
      %constinteger  block size=512
      %integer       max = 6      {inspired guesswork = ad hockery!!}
      %integer Stream
      %on * %start
         Failure("") %and %return 
      %else
         %if C_in1 = "" = C_out1 %start
            Event_message = "dubious input and output"
            %signal 11
         %finish
         Open output(1, C_out1)
         Select output(1)
         Console(sNL.C_in1 ." on ".Date." at ".Time. sNL) %if C_Modifier = '?'
         open input(1,C_in1);  select input(1)
         stream = 1
      %finish

      %if C_in1 = "" = C_in2 %and intype > 0 %and outtype > 0 %start
         {Special to copy a single file quickly}
         %begin
            %recordformat  bfm(%byteintegerarray  a(1:block size))
            %record(bfm)%array  b(0:max-1)
            %integer  inkey = intype, outkey = outtype
            %integer  k,d, n = 0
            %on %event 10 %start      {end-of-file from READ BLOCK}
               -> COMPLETE
            %finish
            %cycle
               d = 0
               %cycle
                  read block(inkey, n+d, B(d))
                  d = d+1
               %repeat %until d = max+1
               write block(outkey, n+k, B(k)) %for k = 0,1,d
               n = n+d
            %repeat
         COMPLETE:
            write block(outkey, n+k, B(k)) %for k = 0,1,d-1
            seek output( (n+d)*blocksize - 1)
         %end
      %else
         {General case}
         %begin
            %on %event IO error %start
               -> OUTPUT COMPLETE %if stream = 3
               stream = stream+1
               open input( stream, c_in(stream) )
               select input(stream)
            %finish
            %cycle
               print symbol(readsymbol)
            %repeat
         OUTPUT COMPLETE:
         %end
      %finish

      Close All(0)
   %end
   Prompt("Copy:")
   parse parameter(C,0,parm)
   For each(C, Copy)
%end

%external %routine PURGE
   %record(parm fm) P
   %on * %start
      Failure("")
   %else
      Director(Direct Purge, P)
      Number(P_p1, 0, "files")
      Print string(" deleted")
   %finish
%end

%external %routine OFFER(%string(63) parm)
   %routine send(%record(Command fm)%name C)
      %systemroutinespec  offer (%string(31) file name, %integer  copies, mode,
                                 %string(7)  destination)
      %on * %start
         Failure(C_in1);  %return
      %finish
      offer(C_in1, 1, 0, C_out1)
   %end
   parse parameter(C,0,parm)
   For each(C, Send)
%end

%const %integer set min = -19,  set max = 10
%const %string(9) %array Set words(set min:set max) =
   "PASSWORD",
   "WILD",
   "ERASE",
   "TABS",
   "free"(4),
   "TRACE",   {1024}
   "QUICK",   {512}
   "s-256",   {256 unused}
   "s-128",   {128 unused}
   "XDUMP",   {64}
   "s-32",    {32 unused}
   "s-16",    {16 unused}
   "s-8",     {8  unused}
   "VERIFY",  {4}
   "DUMP",    {2}
   "MONITOR", {1}
   "eh?",
   "TIME", "TIMELIMIT",
   "WIDTH",
   "TAB",
   "SPEED",
   "PAGE",
   "SEARCH",
   "PROMPT",
   "ERRORFILE",
   "STACK"

%external %routine SET    (%string(63) parm)
   %switch                Set(set min : set max)
   %const %integer        On = -1, off = 0, Set tty = 29
   %integer               what, on off, bit, j, here
   %string(63)            S, val, t, tt
   %system %integer %spec Options, Default time, Default Stack,
                          Wild Monitor
   %record(Parm fm)       P, Q
   %on * %start
      %if Event_event = 3 %start         {Symbol in data, from StoI}
         Event_Message = """".to string(Event_extra).""" in number?"
      %finish
      Failure("")
      %return
   %finish

   parm = parm.","
   %while parm -> s.(",").parm %cycle
      val = "" %unless s -> s.("=").val
      Squeeze(s)
      To upper(s)                        {Keyword part}
      tt = ""  %unless s -> s.(":").tt
      On off = on
      %if s -> t.("NO").s %start
         %if t = "" %then on off = off %else on off = on %and s = t.s
      %finish
      what = look up(S, set words, set min, set max)
      %if what < 0 %and val # "" %start  {SET (no)opt}
         Console(" = ?");  %return
      %finish

      -> Set(what)

      Set(*):     Event_message = s." not understood"
                  %Signal 11

      {*********  -ve WHAT:  Set X  or  Set No X  ***********************}

      Set(-1):    {Set Monitor}
      Set(-2):    {Set Dump}
      Set(-3):    {Set Verify}
      Set(-7):    {Set XDump}
      Set(-10):   {Set Quick}
      Set(-11):   {Set Trace}
                  Bit = 1<<(-what-1)
                  %if on off = off %then options = options & (~Bit) %c
                                   %else options = options !   Bit
                  %continue

      Set(-16):   {Set tabs}
                  TT set(6, on off)
                  %continue

      Set(-17):   {Set Erase}
                  TT set(3, on off)
                  %continue

      Set(-18):   {Set Wild}
                  Wild Monitor = on off
                  %continue

      Set(-19):   {Set Password}
                  Echo(1)
                  Q_p1 = 0;  Director(Direct Identify, Q)
                  %unless privileged %start   {so OPER can help forgetful users}
                     Prompt("Old password:")
                     Read line(val)
                     Pack(val.":", P_file)
                     Q_p3 = P_file_owner
                     Q_Dact = Direct Become
                     SVC (To Director, Q)
                     %return %if Q_p6 # 0
                  %finish
                  Prompt("New password:")
                  Read line(val)
                  Pack(val.":", P_file)
                  P_p3 = P_file_owner
                  Director(Direct Pass, P)
                  Console("New password set")
                  %continue

      {*********************  +ve WHAT:  Set X = ...  ***********************}

      Set(1):     {Set time=N}
      Set(2):     {Set timelimit=N}
                  Default time = StoI(val)
                  %continue

      Set(3):     {Set width=N}
                  j = StoI(val);  j = 80 %if j < 0
                  TT set(1, j)
                  %continue

      Set(4):     {Set tab=N+N+... }
                  here = 0
                  val  = val."+"
                  %for j = 0, 1, 9 %cycle
                     %if val -> t.("+").val %start
                        here = here + StoI(t)
                     %else
                        here = here + 3
                     %finish
                     Byte integer(Addr(P_p3)+j) = here
                  %repeat
                  P_p1 = 5;  P_p2 = 0;  SVC(Set TTY, P)
                  %continue

      Set(5):     {Set speed:tt# = N}
                  P_p1 = 7;  P_p3 = StoI(val)
                  P_p2 = 0;  P_p2 = StoI(t) %if t # ""
                  SVC(Set tty, P)
                  %continue

      Set(6):     {Set page=N}
                  TT set(2, StoI(val))
                  %continue

      Set(7):     {Set search=owner}
                  %if val # "" %and char no(val, length(val)) = ':' %start
                     length(val)  = length(val) - 1
                  %finish
                  val = val.":" %if val # ""
                  Search owner = val
                  %continue

      Set(8):     {Set prompt=...}
                  length(val) = 17 %if length(val) > 17
                  Command prompt = val
                  %continue

      Set(9):     {Set Error file = filename}
                  length(val) = 15 %if length(val) > 15
                  Error file  = val
                  %continue

      Set(10):    {Set Stack=N}
                  Default Stack = StoI(val)
                  %continue

   %repeat
%end

%external %routine PERMIT(%string(63) Parm)
   %record(Command fm) C 
   %integer            Access mask

   %routine Permit (%record(Command fm)%name C)
      %record(Parm fm) P
      %integer         Dact
      %on * %start
         Failure(C_in1);  %return
      %finish
      Dact = Direct Daccess
      %if C_modifier = 0 %start          {Default: set file access}
         Pack(C_in1, P_file)
         Dact = Direct Faccess
      %finish
      P_p6 = Access mask
      Director(Dact, P)
   %end

   parse parameter(C,0,parm)
   Access mask = Access bits(C_parameter)
   For each(C, Permit)
%end

%external %routine DELETE(%string(63) parm)
   %routine Delete(%string(*)%name SS)
      %record(Filespec) F
      %record(Parm fm)  P
      %string(31)       S = SS                    {**COMPILER NASTY**}
      %on * %start
         Failure(S);  %return
      %finish
      String(Addr(P_Sact)) = S;  SVC(17, P)       {Pack filename}
      %if P_file_owner = 0 %start                 {Simple filename}
         Del file(P_file, -1)
         Console(S." deleted")
      %else
         Wild spec(S)
         %cycle
            F = Next filespec
            %exit %if F_Nil # 0
            S = Filename(F)
            Pack(S, P_file)
            Del file(P_file, -1)
            P_file_unit = 0;  P_file_owner = 0
            Unpack(P_file, S)
            Console (S." deleted")
         %repeat
      %finish
   %end
   %string(63) S
   Parm = Parm.","
   Delete(S) %while Parm -> S.(",").Parm
%end

%external %routine Xpack %alias "#PACK"(%string(63) File)
   %record(Parm fm) P
   String(Addr(P_Sact)) = File;  SVC(17, P)
   Phex(P_file_unit,8);  Space;  Phex(P_file_owner,8);  Space
   Phex(P_file_N1,  8);  Space;  Phex(P_file_N2,   8);  Newline
%end

%external %routine  BECOME (%string(63) parm)
   %record(parm fm) P
   %byte %name      C
   %string(63)      Pass
   %integer         Ppass = 0, who
   %Label           OK
   %on * %start
      Failure("");  %return
   %finish
   %if parm # "" %start
      %unless parm -> parm.(",").pass %start
         -> OK %if Privileged
         Echo (off)
         Prompt ("Pass:")
         Read line (pass)
         Echo (on)
      %finish
      Pack(pass.":", P_file)
      Ppass = P_file_owner
OK:   %if parm # "" %and char no(parm,length(parm)) = ':' %start
         length(parm) = length(parm) - 1
      %finish
   %finish
   parm = parm.":"
   Pack (parm, P_file)
   who = P_file_owner
   P_p3 = Ppass;  P_p6 = 0
   Director(Direct Become, P)
   To lower (parm)
   c == char no(parm,1)
   c = c - 'a' + 'A' %if 'a' <= c <= 'z'
   parm = "Command: " %if who = 0
   Command prompt = parm
%end

%external %routine RENAME(%string(63) parm)
   %routine Rename (%record(Command fm)%name C)
      %record(File fm) F
      %on * %start
         Failure(C_in1."/".C_out1);  %return
      %finish
      Pack(C_in1, F)
      F_unit = 0;  F_owner = 0
      Unpack(F, C_in1)
      Rename file(C_in1, C_out1)
      Console(C_in1." renamed ".C_out1)
   %end
   %record(Command fm) C 
   parse parameter(C,0,parm)
   For each(C, Rename)
%end

%external %routine LET(%string(63) parm)
   %systembytearrayspec Alias Text(0:255)
   %systemintegerspec   Alias Limit;     !one past last used addr
   %systemroutinespec   Let(%string(63) old, new)
   %externalroutinespec Alias (%string(*)%name it)
   %byte %integer %name B, Last == byte integer(alias limit)
   %integer             J, k
   %string(63)          New
   %if parm -> parm.("=").new %start
      %if parm = "" %start
         Console("Let what= ?");  %return
      %finish
      To upper(parm)
      Let(parm, new)
   %else %if parm = "" %or char no(parm, 1) = '?'
      j = 0
      b == alias text(0)
      %while b ## last %cycle
         %for k = 1,1,b %cycle
            b == b ++ 1
            Print symbol (b)
         %repeat
         b == b ++ 1;              !to next length byte
         %if j = 0 %start;         !toggle thru table: <sym><translation>
            Print string (" = ");  ! pairs. (Both terminated by 0's).
         %else;                    !..after <trans>..
            Newline
         %finish
         j = ~j;                   !toggle j
      %repeat
   %else;                          !LET x   i.e. show X
      New = parm
      To upper(new);  Alias(new)
      Print string(parm." = ".new)
      Newline
   %finish
%end

%external %routine LIB(%string(63) param)
   %systemintegerspec             Lib limit
   %recordformat                  Libfm(%integer when, %string(27) name)
   %systemrecord(libfm)%arrayspec Lib(1:7)
   %integer                       J, Insert, Old, New, Show
   %string(63)                    F
   %record(file fm)               Pfile
   %routine show lib
      %integer j
      %if lib limit = 0 %start
         Print string("No entries");  newline
      %else
         %for j = 1, 1, lib limit %cycle
            Spaces(3);  Print string(Lib(j)_name);  newline
         %repeat
      %finish
   %end
   %on * %start
      Failure("");  %return
   %finish
   To upper(Param)
   %if Param = "" %start
      Show lib
   %else
      Squeeze(Param)
      Param = Param.","
      %cycle
         Param -> F.(",").Param
         Show = 0
         %if F # "" %and char no(F, length(F)) = '?' %start
            Show = 1;  length(F) = length(F) - 1
         %finish
         %if F # "" %start
            %if F = ".NONE" %start
               Lib limit = 0
            %else
               Insert = 1;  Insert = 0 %if F -> ("-").F
               Pack (F, Pfile)                 {Check validity of name}
               Unpack(Pfile, F)                {Standard string form}
               New = 0;  Old = 0
               %while Old # Lib Limit %cycle
                  Old = Old+1
                  %if Lib(Old)_Name # F %start
                     New = New+1
                     Lib(New) = Lib(Old)
                  %finish
               %repeat
               %if Insert # 0 %start
                  %if New = 7 %start
                     Event_message = "Library list full"
                     %signal 11
                  %finish
                  New = New+1
                  Lib(New)_When = 0
                  Lib(New)_Name = F
               %finish
               Lib Limit = New
            %finish
         %finish
         Show lib %if show # 0
      %repeat %until Param = ""
   %finish
%end

%external %routine OPTION(%string(63) parm)
   %constant %integer decode = 1,               {Object file option masks}
                      open   = 2,
                      stack  = 8,
                      priv   = 16,
                      upper  = 32,
                      spacesx= 64
   %string(63)        s, t, val
   %integer           j, k, write flag = 0,
                      on off
   %constant %integer on = 0, off = -1,
                      last option  =  7,
                      first option = -2
   %constant %string(6) %array options(first option : last option) =
      "STACK=", "TIME=",
      "Zero",
      "DECODE", "OPEN", "unused", "STACK", "PRIV", "UPPER",
      "SPACES"

   %recordformat blockfm(%shortinteger code size, gla size, 
                                       pad1, pad2, pad3,
                                       time, flags, stack, 
                         %shortintegerarray a(1:248))
   %record(blockfm) block
   %record(Command fm) C
   %on * %start
      Failure("");  %return
   %finish

   parse parameter(C,0,parm)
   Parm = C_Parameter
   To upper(parm)
   C_in1 = C_in1.".exe" %unless C_in1 -> (".")
   Open DA(1, 1, C_in1)
   Read DA(1, 0, Block)
   Squeeze(parm)

   %if parm = "" %or parm = "?" %start
      S = "Options set: "
      S = S."upper case, "    %if Block_flags&upper # 0
      S = S. "remove spaces, " %if Block_flags&spacesx # 0
      %routine No(%integer x, %string(63) what)
         S = S. "no " %if x # 0
         S = S . what
      %end
      No(Block_flags&decode, "decode, ")
      No(Block_flags&open, "open, ") %if Block_flags&decode = 0 {otherwise irrelevant}
      No(Block_flags&priv, "priv, ")
      No(Block_flags&stack, "stack")
      S = S . snl
      print string(S)

      %routine pretty(%string(31) S, %integer value)
         pad then print(10,S)
         Space;  Print symbol('=')
         %if value = 0 %start
            print string(" current default")
         %else
            Write ( |value|, 1 )
            %if value < 0 %then print string(" absolute")
         %finish
         Newline
      %end

      Pretty("Stack",   Block_stack)
      Pretty("Code",    Block_Code Size<<9)
      Pretty("GLA",     Block_GLA  Size<<9)
   %else
      write flag = 1
      parm = parm.","
      %while parm -> s.(",").parm %cycle
         On off = on
         %if s -> t.("NO").s %start
            %if t = "" %then on off = off %else s = t."NO".s
         %finish
         %if s -> s.("=").val %then s = s."=" %else val = ""
         j = Look up(s, Options, first option, last option)
         %if j < 0 %start
            Event_message  = val." not a number"   {just in case}
            k              = StoI(val)
            %if j = -1 %start
               Block_Time  = k
            %else
               Block_Stack = k
               Block_flags <- Block_flags & (\stack)
            %finish
         %else %if j = 0
            Event_message = s." not understood"
            %signal 11
         %else
            j = 1<<(j - 1)
            Block_flags <- Block_flags & (~j)
            Block_flags <- Block_flags ! j    %unless on off = on
                                              {Bits SET for NOxxx - yech}
         %finish
      %repeat
   %finish
   Write DA(1, 0, Block) %if write flag # 0
   Close DA(1)
%end

%external %routine ENTRIES(%string(63) parm)
   %constinteger h = X'FFFF'
   %string(63) file, output
   %recordformat  pgmfm(%integer  limit,stack,gla,code base,ep,code,   %c
                                                %shortinteger  options)
   %record(parmfm) p, q
   %recordformat loadfm(%integer code, gla, specs, defs, when, file)
   %recordformat textfm(%integer n1, n2)
   %recordformat specfm(%integer gla, code, ep)
   %recordformat hdfm(%shortinteger base, n)
   %recordformat headfm(%shortinteger pure size, gla size, code disp, %C
                                      lit disp, registers, mainep, %C
                        %record(hdfm) reloc, defs, specs, ldiag, vdiag)
   %recordformat deffm(%shortinteger link, ep, %integer n1, n2)
   %ownrecord(headfm)%name head
   %record(specfm)%name spec
   %record(deffm)%name def
   %record(textfm)%name sp
   %integer base, code, gla, specs, defs
   %system %routine %spec Unpack Spec(%record(Textfm)%name T)  {into..}
   %system %string(15) %spec Spec id
   %record(textfm) txt
!!!!!!   %integer max = (free space - 1024) >> 4
   %CONSTINTEGER MAX=200
   %record(fdfm) %array slots(1:max)
   %integer used = 0, j, col
   %on * %start
      Failure("");  %return
   %finish
   parse parameter(C,0,parm)
   Open output(1, C_out1);  Select output(1)
   file = C_in1
   file = file.".exe" %unless file -> (".")
   string(addr(p_sact)) = file
   svc(10, p)
   %if p_p1 # 0 %start
      Event_message = "Cannot load ".file
      %signal 11
   %finish
   code = p_p2;  base = code-16
   gla = p_p3
   %if shortinteger(base+4) # X'4321' %start
      Event_message = file." is an old format file"
      %signal 11
   %finish
   Select output(1)
   head == record(code)
   code  = code+head_code disp&H*2
   specs = head_specs_n
   defs  = head_defs_n
   %if defs # 0 %start
      Print string("External entry points:");  newline
      %cycle
         def == record(base+2*defs+16)
         used = used + 1
         %if used > max %start
            Event_message = "too many entries"
            %signal 11
         %finish
         txt_n1 = def_n1;  txt_n2 = def_n2
         Unpack spec(txt)
         Slots(used)_name = Spec Id
         defs = def_link&h
      %repeat %until defs = 0
      Sort(slots,1,used) %if command_modifier = 0
      col = 0
      Spaces (4)
      %for j = 1,1,used %cycle
         print then pad(14,slots(j)_name)
         col = col + 1
         newline %and spaces(4) %if col&3 = 0
      %repeat
   %finish
%end

%external %routine STATE(%string(63) parm)
   %record(parm fm) P, Q, R
   %string(63)      x
   %byte %name      last
   %integer         others, hours, secs, j, k, prot, unit no, sym, priv
   %integer  exclam
   %record(zerofm)  block
   %record(spine)   free
   %integerfn  checkword      {compute zero block checksum}
      %integer  j,k=0
      k = k + integer(j) %for j = addr(BLOCK),4,addr(BLOCK)+512-4
      %result = 1-k
   %end
   %routine  read block(%integer  unit num, block num, %record(*)%name buffer)
      %record(parmfm) p
      p_p1 = block num&x'FFFF'
      p_p2 = addr(buffer)
      p_p3 = unit num      
      p_p4 = 0             {into my VM}
      svc(DISC READ,p)
   %end

   %on * %start
      Failure("");  %return
   %finish

   To upper(parm)
   Squeeze(parm)
   %if length(parm) >= 2 %start
      exclam = charno(parm,length(parm))
      %if exclam = '!' %or exclam = '?' %start
         length(parm) = length(parm)-1
      %else
         exclam = 0
      %finish
      length(parm) = length(parm)-1 %if charno(parm,length(parm)) = 'S'
   %finish
   %if parm = "" %or parm = "SYSTEM" %start
      SVC (28,R)                         {System information}
      SVC (19,P)                         {General information}
      Print string ("Mouses ".string(addr(P_p6)).                       %c
                    ":  CXE ".SS Version."/".version." on ".DATE.   %c
                    " at ".TIME.snl)
      others = P_p2 - 1
      %if parm # "" %start
         Write (R_p1>>1, 0)
         Print string ("KB of user store, swopping from unit")
         Write (R_p2, 1)
         hours = P_p1//(60*60)      {seconds => hours}
         %if hours # 0 %start
            Print symbol (',')
            Number(hours, 1, "hours")
            Print string (" since startup")
         %finish
         Print string ("

 Process         Store Console    CPU Level Prio Debt
")
         %for j = 4, 1, 32 %cycle
            P_p1 = j;  SVC (14,P)
            %if P_p6 >= 0 %start
               Q_file_unit = P_p1;  Q_file_owner = P_p2
               Q_file_N1   = 0;     Q_file_N2    = 0
               Unpack (Q_file, x)
               length(x) = length(x) - 1
               k = 1
               k = k + 1 %while char no(x,k) # '_'
               Write (j,2)
               Spaces (6-k)
               Print string (x)
               P_p3 = P_p3+1 %if P_p3&1 # 0 {round up odd figures}
               Write (P_p3>>1, k-length(x)+11)
               k = P_p6>>16;  P_p6 = P_p6&x'FFFF'  {P_p6: Debt<<16+console}
               %if P_p6 = 0 %then spaces(6) %else write(P_p6,5)
               Print (P_p5/1000, 7, 1)
               Write (P_p4&7, 3)         {Contingency level}
               Write (P_p4<<1>>9, 5)     {Queue}
               Write (k, 3)              {Debt}
               Print string ("  privileged") %if P_p4 < 0
               Newline
            %finish
         %repeat
         Newline
         %return
      %finish
      P_p1 = 0;  SVC(14,P)               {Get user specific info}
      priv = P_p4
      P_file_unit = P_p1;  P_file_owner = P_p2
      P_file_N1= 0;        P_file_N2 = 0
      Unpack (P_file, x)
      length(x) = length(x) - 1
      Print string ("User: ".x)
      Q_p1 = 0                           {Myself}
      Director(Direct Identify, Q)
      %if P_file_unit # Q_file_unit %or P_file_owner # Q_file_owner %start
         Print string (" alias ")
         Unpack (Q_file, x)
         length(x) = length(x) - 1
         Print string (x)
      %finish
      Print string (", logged on console");  write (P_p6,1)
      Secs = P_p5//1000
      %if secs # 0 %start
         Print symbol(',')
         Number(secs, 1, "CPU seconds")
         Print string (" used")
      %finish
      Newline
      Print string ("Process")
      P_p1 = 0 {me}
      Write (P_dsno&63, 1)
      Print string (" (privileged)") %if priv>>31 # 0
      Print symbol (',')
      Write (others, 1)
      Print string (" other processes")
   %else %if parm = "DISC"
      Print string ("
  Unit")
      %if exclam # 0 %then print string( %c
      "     S/W  H/W   Initialised   " )
      %if exclam = '!' %then print string(" Lost   Free   Used   Label")
      Newline
      SVC (28,Q)                         {Get sys info}
      %for unit no = 1,1,max unit %cycle
         %if unit no = Q_p2 %start
            Write (unit no, 2);  print string (" *swop*");  newline
            %continue
         %finish
         P_p1 = unit no;  P_dact = 40
         SVC (To Director, P)            {Get name of disc on unit}
         prot = P_p2
         %if exclam = 0 %start           {Just name & prot status}
            %continue %if P_p6 # 0 %or   {Unit not loaded}
                          P_P1 = 0       {Temp fix}
            Write (unit no, 2);  space
            P_file_owner = 0;  P_file_N1 = 0;  P_file_N2 = 0
            Unpack (P_file, x)
            length(x) = length(x) - 1
            Print string (x)
            %if prot # 0 %start
               Spaces (7 - length(x))
               Print string ("protected")
            %finish
         %else
            Write (unit no, 2);  space
            Read block (unit no, 0, block)
            %if P_p6 = 0 %and P_P1 # 0 %start         {Online OK}
               print then pad(7, block_disc id)
               %if prot # 0 %then print string("prot") %else spaces(4)
               P_p3 = unit no;  SVC (Disc status, P)
               %if P_p6&4 # 0 %then print string(" prot") %else spaces(5)
               %if checkword # 0 %start
                  Print string (" *foreign disc*")
               %else                     {Standard MOUSES disc}
                  pad then print(12, block_initialisation date)
                  %if exclam = '?' %start
                     Print string (block_description);  newline
                     %continue
                  %finish
                  Read block (unit no, block_free list, free)
                  Write (free_extents, 8){Lost blocks}
                  k = 0                  {count free blocks
                  %for j = 1,1,126 %cycle{by summing sizes of free extents
                     k = k + free_extent(j)_length&x'FFFF'
                  %repeat
                  Write (k, 6)
                  Write (block_tracks*block_blocks per cylinder {disc size} %c
                         - k {free}                                         %c
                         - free_extents {lost},  6)
                  Spaces (3)
                  %for k = 1,1,4 %cycle
                     sym = block_vol id>>(3*8)
                     %if sym = 0 %then space %else print symbol(sym)
                     block_vol id = block_vol id<<8
                  %repeat
                  Space;  Print string (block_description)
               %finish
            %finish
         %finish
         Newline
      %repeat
   %else %if parm = "QUEUE"
      %begin                             {Show potter's queue entries}
         %record %format entry fm (%record(file fm) label, actual,
                                   %integer queue, date, time,
                                   %short %integer priority, mode)
         %record %format block fm (%integer %array spare(1:8),
                                   %record(entry fm) %array e(0:9))
         {Potter's queue is a file of blocks of entries}
         %const %integer queue = 1       {DA channel for queue file}

         %record(entry fm) %map entry(%integer N)
            %integer block no = N//10, offset = rem(N,10)
            %own %integer last block = -1
            %own %record(block fm) block
            Read DA (queue, block no, block) %if block no # last block
            last block = block no
            %result == block_e(offset)
         %end

         %record(file fm) f
         %record(entry fm)%name e
         %integer first = 1, count
         %string(63) x
         %integer j

         Open DA (queue, 0, "POTTER:QUEUE")
         Count = 0
         %for j = 1,1,255 %cycle
            e == entry(j)
            %if e_queue # 0 %start       {Valid entry}
               count = count + 1
               %if first # 0 %start
                  Print string ("
Queue   Label                     Actual                     Date        Size
")
                  first = 0
               %finish
               f = 0;  f_owner = e_queue
               Unpack (f, x);  print then pad(8,x)
               Unpack (e_label, x);  print then pad(26,x)
               Unpack (e_actual, x);  print then pad(26,x)
               P_p1 = e_date
               SVC (13, P)               {unpack date}
               pad then print(10,p_text)
               P_file = e_actual
               P_dact = 18               {get status}
               SVC (To Director, P)
               Print (P_p2/2, 5, 1);  print string("Kb")
               Newline
            %finish
         %repeat
         Number(Count,0, "files")
         Print string(" queued")
         Newline
      %end
   %else
      Print string (parm."?")
   %finish
   Newline
%end

%external %routine FILES(%string(63) parm)
   %string(15) %array File(1:42)
   %string(15) %name  Sn
   %string(63)        S
   %integer           N = 0, rows, cols, j, k
   %string(7)         Last owner, last unit
   %record(Filespec)  F
   %record(Parm fm)   P
   %record(Commandfm) C 
   %on * %start
      Failure("");  %return
   %finish
   parse parameter(C,0,parm)
   Open output(1, C_out1);  Select output(1)
   F = Split(C_in1)
   F_file = "*" %if F_file = ""
   F_ext  = "*" %if F_ext  = ""
   Wild spec(Filename(F))
   F = Next filespec
   Last owner = F_owner
   Last unit  = F_unit
   %cycle
      %if F_Nil # 0 %or F_owner # last owner %start
         Number(N, 0, "files")
         Print string(" owned by ".last owner) %if last owner # ""
         Newline
         %if N # 0 %start
            %if C_Modifier # 0 %start    { Files! } 
               Print string("
      Filename        Size   Access   Last used
")
               %for j = 1, 1, N %cycle
                  Sn == File(j)
                  print then pad(17, Sn)
                  S = Last unit."_".last owner.":".Sn
                  Squeeze(S)
                  Pack(S, P_file)
                  Director(Direct Status, P)
                  Write(P_p2, 5)
                  S = "(".ItoS(P_p3,0).")"
                  print then pad(6, s)
                  S = Access(P_p4);  print then pad(9, s)
                  P_p1 = P_p5;  SVC(13, P)  {Unpack date}
                  Print string(P_text)
                  Newline
               %repeat
            %else
               Cols = 4
               Cols = N %if N < cols
               Rows = N//Cols
               Rows = Rows+1 %if Cols*Rows < N
               %for j = 1, 1, rows %cycle
                  k = j
                  %while k <= N %cycle
                     Sn == File(k)
                     k   = k + rows
                     print then pad(17, Sn)
                  %repeat
                  Newline
               %repeat
            %finish
         %finish
         N = 0
         %exit %if F_Nil # 0
         Last unit  = F_unit
         Last owner = F_owner
      %finish
      N = N + 1
      F_unit = "";  F_owner = ""
      To mixed(F_file);  To lower(F_ext)
      F_file = " ".F_file %while length(F_file) < 10
      File(N) = Filename(F)
      F = Next Filespec
   %repeat
%end


{*****************************************************************************
{
{        Wildcard processing module            A. Culloch   Sep-81
{
{*****************************************************************************


{Director formats}


%record %format file    (%integer name1, name2,
                         %short   Spine block, Day)
%record %format Dir fm  (%short   Files,
                         %byte    Access rights,  Check,
                         %short   Unused,
                         %byte    Spare, Access permissions,
                         %record(file) %array File(1:42))
%record %format user    (%integer Name, Password,
                         %short   Dir block, Spare)
%record %format userlist(%short   Users, Spare1,
                         %integer Spare2,
                         %record(user) %array user(1:42))


%external %record(Filespec) %function SPLIT(%string(31) s)
   %record(Filespec) F = 0
   To upper(s)
   %if s # "" %and char no(s, length(s)) = '#' %start
      F_Volatile = '#'
      length(s) = length(s) - 1
   %finish
   %if s -> ("_") %then s -> f_unit.("_").s
   %if s -> (":") %then s -> f_owner.(":").s
   %if s -> s.(".").f_ext %start; %finish
   F_file = s
   Squeeze(F_unit);  Squeeze(F_owner);  Squeeze(F_file);  Squeeze(F_ext)
   %result = F
%end

%external %string(31) %function FILENAME (%record(Filespec)%name F)
   %string(31) s = ""
   s = s.F_unit."_"     %if F_unit     # ""
   s = s.F_owner.":"    %if F_owner    # "" %or F_unit # ""
   s = s.F_file
   s = s.".".F_ext      %if F_ext      # ""
   s = s."#"            %if F_Volatile # 0
   %result = s
%end

%external %routine MASK(%record(Filespec)%name x, %record(Filespec) y)
   x_unit   =  y_unit   %if y_unit  # "*"
   x_owner  =  y_owner  %if y_owner # "*"
   x_file   =  y_file   %if y_file  # "*"
   x_ext    =  y_ext    %if y_ext   # "*"
%end

%external %record(dir fm) Dir
%system %integer wild monitor = 0
%own %integer dir pos, dir lim
%own %record(fd fm) %array sorted dir(1:42)
%own %record(user list) catalog
%own %integer cat pos, cat lim
%own %integer unit no, one off, required unit no
%own %record(Filespec) Spec
%own %string(31) Current dir

%system %routine sort(%record(fd fm) %array %name p, %integer a, b)
   %record(fdfm) dump
   %integer l, u
   %while a < b %cycle
      l = a;  u = b
      dump = p(u);  ->find

Up:   l = l+1;  ->found %if l = u
Find: ->up %unless p(l)_name > dump_name
      p(u) = p(l)
Down: u = u-1;  ->found %if l = u
      ->down %unless p(u)_name < dump_name
      p(l) = p(u)
      ->up

Found:p(u) = dump
      l = l-1;  u = u+1
      %if l-a > b-l %start
         Sort(p,u, b);  b = l
      %else
         Sort(p,a, l);  a = u
      %finish
   %repeat
%end

%routine set dir(%integer unit, owner)
   %record(Filespec)   F
   %record(file) %name Slot
   %record(Fd fm)%name S
   %record(parm fm)    P
   %integer            j

   P_file_unit  = unit
   P_file_owner = owner
   P_file_N1    = 0
   P_file_N2    = 0
   Unpack(P_file, Current dir)
   Current Dir  = ":" %if Current Dir = ""
   F            = Split(Current Dir."*.*")
   Mask(Spec, F)
   P_dact       = Direct Files
   P_p6         = Addr(Dir)
   SVC (To Director, P)                  {Read directory block}
   %if P_p6 # 0 %start
      Dir pos = 42 %and %return %if one off = 0
      Event_message = P_text
      %signal 11
   %finish
   P_file_unit  = 0
   P_file_owner = 0

   dir pos = 0
   dir lim = 0
   %for j = 1, 1, 42 %cycle
      slot == dir_file(j)
      %if slot_name2 # 0 %start
         dir lim   = dir lim + 1
         S        == Sorted dir(dir lim)
         S_pos     = j
         P_file_N1 = slot_name1
         P_file_N2 = slot_name2
         Unpack(P_file, S_name)
      %finish
   %repeat

   Sort(sorted dir, 1, dir lim)
%end

%external %routine WILD SPEC (%string(31) parm)
   %record(filespec) fff
   %record(file fm) F
   %record(parm fm) P
   Required unit no = -1
   Spec    = Split(parm)
   Cat pos = 42
   Dir pos = 0
   Dir lim = 0
   Unit no = 0
   one off = 0
   %if spec_owner # "*" %start
      one off = 1
      Pack(Spec_unit."_".spec_owner.":", F)
      Set Dir(F_unit, F_owner)
      %if F_owner = 0 %start             {Defaulted - must find out who we are}
         P_dact = Direct Identify
         P_p1   = 0
         SVC (To Director, P)
         Unpack(P_file, Current dir)
      %finish
!!!      Mask(Spec, Split(Current dir))
      fff = split(current dir."*.*")
      mask(spec, fff)
   %else
      Spec_unit = "*" %if Spec_unit = ""
      %if Spec_unit # "*" %start
         Pack(Spec_unit."_:", P_file)
         P_Dact = Direct Find unit
         SVC (To Director, P)
         P_p1 = 0 %if P_p6 # 0
         Required unit no = P_p1
      %finish
   %finish
%end

%external %predicate MATCHES(%record(Filespec)%name F1, F2)
   %predicate match(%string(*)%name S1, S2)
      %true %if S1 = S2 %or S1 = "*" %or S2 = "*"
      %false
   %end
   %true %if match(F1_unit,   F2_unit)  %and
             match(F1_owner,  F2_owner) %and
             match(F1_file,   F2_file)  %and
             match(F1_ext,    F2_ext)
   %false
%end

%external %record(Filespec) %function NEXT FILESPEC
   %own %integer    Unit
   %record(Filespec)F
   %record(parm fm) P
   %integer         User
   %label           New dir
New dir:
   %cycle
      F_unit  = Spec_unit
      F_owner = Spec_owner
      F_Nil   = 1                        {In case of early return}
      Dir pos = Dir pos + 1
      %if dir pos > dir lim %start
         %result = F %if one off # 0
         %cycle
            cat pos = cat pos+1
            %if cat pos > 42 %start
               %cycle
                  unit no = unit no + 1
                  %result = F %if unit no > max unit %or
                                  unit no = required unit no + 1
                  P_p1    = unit no
                  P_p6    = Addr(Catalog)
                  P_Dact  = Direct Catalog
                  SVC (To Director, P)
               %repeat %until P_p6 = 0   {Valid unit number}
               P_p1    = unit no
               P_Dact  = Direct Unit name
               SVC (To Director, P)
               P_p1 = 0 %if P_p6 # 0
               unit    = P_p1
               cat pos = 0
               %continue
            %finish
            user = catalog_user(cat pos)_name
            %if user # 0 %start
               Set dir(unit, user)
               -> New dir
            %finish
         %repeat
      %finish
      F = Split(Current dir . Sorted dir(dir pos)_name)
      Console(Filename(F)) %if wild monitor # 0
      F_Nil = 0
      %result = F %if matches(F, Spec)
   %repeat
%end

%external %routine FOR EACH(%record(Command fm)%name C,
                            %routine Do Something(%record(Command fm)%name CC))
   %integer            J, k = 0, wild
   %string(31)%name    Sn
   %string(31)         S
   %record(Command fm) CC
   %record(Filespec)   W, base, overlay

   %for j = 1, 1, 3 %cycle
      Sn == C_in(j)
      k   = k + 1 %and wild = j %if Sn -> ("*")
   %repeat
   Wild Spec(C_in(wild)) %if k # 0

   %cycle
      CC = C
      %if k # 0 %start
         W = Next filespec
         %exit %if W_file = ""
         CC_in(wild) = Filename(W)
         W_unit = "";  W_owner = ""
         S = Filename(W)
      %finish
      %for j = 1, 1, 3 %cycle
         S  =  CC_in(j) %if k = 0
         Sn == CC_out(j)
         %if Sn # "" %start
            overlay = Split(Sn)
            base    = Split(S)
            Mask(base, overlay)
            Sn = Filename(base)
         %finish
      %repeat
      Do Something(CC)
   %repeat %until k = 0
%end


%end %of %file
 H?   ^ ^[                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     7 C!        6d
}    n     ^@     2(@     hgZ,     ^"     $w       *#dR     0"e     6,x     <K_     BqVM     HK       NiLj       T`T:     Z!qv   `y}     fN&"8     lyL;`     r&!qR   xQ{D     ~z       !K_j s     !4   "Q|v   "X`}Kd #'k2   NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    %Qv   d:w	Rs_  &y$ } %Qv_""`:%  wq af";ov    y8@    :    a@  #	y    qVM&@d+D        &y$@  ]    mfp  da]p  `EWK   wL  qIXH  &@  eE     `EX!    qI    }@  w@  #(    NWqI\^C  }M[DwG-} &Z    ~wZx  %%N4:M%%N3}+!K_j8{}} 8{Lu;`e}     )	8    iiR  i    d+G      !_aew{    y"        A !!	!     " A a A     A A     A A    A     ! a    ! ba  	   #!A    ! a aAa     A aa aA a  A    "!A      bA 	  "A a  C b!  A! B   ! ! aA#a "    & b  A  A c U " N     * A   0b   A !  
  <# b   ;A   e "  c   aA! #  b C  C  C C !  !    !    Fa C  C a  a ! ! C  Ca C! ba  C!  C  #a " A V  # b       A    #    A A    AA B    A   *   1 b       ! ! c         U"  Aa   TA   e B a a      !  A A     " A!! 
      A A   a!     AA  a  A A  a  (  A!    !  a  AaB     q  A !  AE  Aaa A a  a a!   !    ! c Ba  5  0! a  !     A     !   AA  A  aa a a a  /  ! a   "   A a  	  :!a    14 d! a     a  bAA  a         {    a  a ! b     A a !     A  aaAa A!A   B!  A ! a  A  ! a !    aA A A      B     A   !  Aa    A   B a aAAC    !f A A"    m# e  !!AA    a     a  a  A    A a aA! A    A  a     !  A @   !  bA!    a aA aA 
  aa   c  a! B!!a A A   ' A A a AAAA    a  a B A A !    A  "  @ a!  a A A A aaA   a CA AA  !    e!   de	d   ph   a  b    A     a !  a B A  B B aa #  b f A    " !  !ab    dQ@    D"Z$h%Qv   t  #y"#:  #&y$ } #%Qv_#""`:%  #wq af"z  	4X`	zfk	zLuh/+  hfklLupy?t_^xqYX|yEqV}p ie<   À v  ŀ ,   %NZ@   ,#p lv   3"`     d:Q@     ,d    ZZ     W    e ,}}  fZ2d, ,~@ ,v   d,~EZ: ,~@ ,v   z`   +} Ā  d    y} "@  À v   ,}    l>   MgH     ,v   Mo    3o2  t>   "K     Q{D ,D   0>   4v   "Kv ,v   LQ{D P>   Tz   fي ]  ,d    	^@     ,d:Q@ 	ox     D:{#( HaE LD   P    TW   ox     (@    Đ    ,Q   0yu (@     ,d:Q@ 	gZ,     ,d    	w     Đ    	^"     ,d:Q@ 	w       ,d:Q@ l}  p_&p t   x>   |2@ v      }   @   !D`T:v  !P	)R!\	!h4X`d   j@   MdR    Đ    ,d    L+}  dR     ,d:Q@ l  "KQ{D "e    Ð y   ,%   Td    tv   "e     ,d:Q@ lv   x     ,&@ ld    K_     ,d:Q@ ld   ŀ    d;v fy ԑ   qVM    Đ    ,%   qVM     ,d:Q@ l   K       ,d:Q@!)	D:Q} ŀ l  ŀ pK;}  t>   xD   |X_   #x   ,>   	Lj       ,d:H!LjLu;`   l>   p:"$ t_   xX_   |x %   dK +Y           ,}  fՀ9     ,v    `T:     ,d:Q@ lv   }    쉴  ,>  0D  4}K/  8_&p<ox<   /!qv   ,d:Q@ l&@ ag\ d   j@  2 Ā,yEĀ0  Ā4y@  8@<@@-  DyEHvyE,L  l= p>  t$   Q`   ,>   0D   qI\^C   yEQ@    oH  Đ ,&Z 0d    !th     W   ,o]   0^wK;}\^C  ox ox     ,%  Đ <@   @&y D-Z H    >   y}     ,d:Q@ ld    j@   p   ̖   ŀK;} `"#4msxwv>   D  $f} (y?,z  0fى4#K58ox8(U@ M&"8     ,d:Q@À x   v   W   rv $v >   D   K;oXZ   K;V;`   %  d   4   =yL;`     ,v   L%   &!qR  Ā %   ,v   Q{D    Ā     ,@   y*}      @       4Ud  HK    L@   wz     y}   af" ,%  Ā Tx} Ā Xv   \d    |>   !4   ,d:Q@ L&v   t%   d    Q|     Ð {   Ð  {H   Q|v  Ā )  Ā  *   X`}Kdˁąy}  ,%   Td    t=p 'k2   Ā    0>   4D   84 À <x   @v   `8    @a5ra@   /***_: ***.*:_**.*:         *   ****#.:_.::__         *            *    )(:_1
      Filename        Size   Access   Last used

 owned by  files**? queuedfilesKb A   O
Queue   Label                     Actual                     Date        Size
POTTER:QUEUE           	   0            QUEUE *foreign disc* protprot 	protected *swop* Lost   Free   Used   Label     S/W  H/W   Initialised    
  UnitDISC  other processes  (privileged)Process usedCPU seconds, logged on console alias User:    privileged C> 8

 Process         Store Console    CPU Level Prio Debt
  since startup hours$KB of user store, swopping from unit  at   on  /:  CXE Mouses SYSTEM too many entries External entry points:  is an old format file Cannot load  .exe . not understood not a number==NO NO ,,GLACode Stack	 absolute current default stackpriv,  open,  decode,  no remove spaces, upper case,  Options set: ?.exe .            STACK=TIME==Zero==DECODEOPENDEunusedSTACKdPRIVKdUPPERdSPACES         Library list full-.NONE,,
No entries  =  = Let what= ?=	 renamed /	Command: ::Pass:,,, deleted  deleted :++New password set :New password::Old password: not understood = ? NO :=,," in number? " 

9
/
&
																



FjwPASSWORDiWILDWORDiERASEORDiTABSEORDifreeEORDifreeEORDifreeEORDifreeEORDiTRACEORDiQUICKORDis-256ORDis-128ORDiXDUMPORDis-32PORDis-16PORDis-86PORDiVERIFYRDiDUMPFYRDiMONITORDieh?ITORDiTIMETORDi	TIMELIMITWIDTHIMITTABTHIMITSPEEDIMITPAGEDIMITSEARCHMITPROMPTMIT	ERRORFILESTACKFILE      
   
  deleted filesCopy:             at   on  dubious input and output *end*invalid access code  NONE ALLAllNone No fails -    ,event  *                       ~   X                            91.3
   $?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nH  !34  1  0 !81 !5$$A> #$$A> &C ?1  34C0  D   D   
C H  !34  1  0 !81 !5$$A> B  @ !4B ";
C@ !$$A> #$$A> B  C
B$P#E  E  &Q'1"C s_  eX!34RUUh!34dffз  ӳ  Ű !4Գ #9    !8 !5$$A> B$ C08 L  #9&"C  "
  'M  M   >' ("#4\BbD#:  
  nBJ"#<  #M  M  '"DC0  
$#M  M  &'"%ѷ  C $ "ѷ  $$A> ?$$A> $A1    0#
#	QD   RD   ?&A'"3  $$A> X# Y !Y !&\ Z  B!$$A> З  $1$H  H X [ &B0P  [ ,&' ?P  
*&30H  P  ї  C Kї  $$A> 
Y  #%$$A> 
qPr  PB &(pX  ?$PS?PE   &T 41I2 !,K2  !
3s3B  #9
3
>!$$A> !$$A> A>  ?&?$$A> O$$A> ?$$A> "#:  ! ?$$A> ?$$A> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$2#XC   PC   '4"2$ #PC   '4" ?$$A> H  !34  "#(!B   C $$A> ] g A , X 6  3!4x W  dX $!A  P ,ӱ  ɰ a!ɰ z!%Ȼұ  C  -w ( ,A A l ,X !A  ?( lA X=p<c   AdXLӫ B0$PXk  lW  ' ,A  ',A  ,A" $PXLXi lP( W,p,',A  XH $A" ,A" X]L\% A  ?' , lA  XpA" A" ( lA  ?h ,fC0& ,( ,A ?1  0  #8( ,A" ?' , lA   ,A" A" XL A" ( lA  ?W  @x  ΀W  A , X Ph 4$0P8 8PX <r ,  q ,x  W  ( ,A A L X !A  f!9W   H#W   TW  X8 0 !6Ӹ ,'Ҹ , ,W   Hx  <g ( ,A A l X !A  ? ,W   HXh 8 ,cW   x  (g ( ,A A l X !A  ?8 ,cW    ,W   Hx  &W  A , X @e fAX8  r    q  X  X C0 XL)  A  ?$ $Ax  6g A , X $08 ,F  PH tS$!APX lC V&QPX lPX pX %A  a  `  C0(X %A  1    @ x( , xA" ?XX lUX pAUX tB0P pX(  ,A   x  WW  A t  X PX |'a$!APh tC .&aPh tPh x8 lA( ,A!5x Uh xAUh |B0P x$" 6g A , X $1P8 ,$@H 4f!9$Ax %QVP !7$A"%Q&QPX 0PX @%A$ab  Th #?P A  @ D( 4 DA" XX 0UX @AP B0P @ 4$AC  Vw ( ,A A L X !A  $0P8 Lh  ,W  X ,.~A!5%x .xA!3$"	ӱ  P \$
$!AP PC &P PP X ,*A ӑ  P Tɐ AB ɐ H!.)A$AB  VH LPH LC :Ő  C02' ,bA  ,A" X]L\% A $ $AU XAU \B0pP XX LC 4 w A , X $0P8 4r ,  q ,X @#%x $"  w P (( ,A A l X !A  ?Px lC 4Xx l' ,\A X=L< A" W  @x  ,$PmtW  ' ,A  ' LA  XW  C  U  w A , X J ,$0P4 X ,'P A   * <A^W  P DW  P H$@PJ TPz X#Xz XC $PPZ PXZ TXj Pl
V: <AP , P 0Xj DW  X: P<&1P: PX ,; #3C P: `%A$!APJ LC @&APJ LPJ \XZ T
T: <AP , P 0Xj HW  XJ LUJ \AUJ `B0P \XZ TXj Pl
VPZ TC 2X: P<'1P: `%$!AP LC @&P LP \XZ T
[: <AP , P 0Xj HW  X LU \AU `B0P \XJ TXZ P\
E4` &AcW  z   
 KOw A , X Pz ,C RXz ,X9 0<0 !3C T&1P9 0=PAX   Xi 0W   xXi 0lW   `W  aW   <"z  J 
 @g A , X $6P9 ,Py 4#
Xy 4ADy XI T  UB0(d fB0X=L<# BA $ $A $aW   $aW   lX X Š ?B0' ,A   A" P) 8W,p, ',A  XI 8$<A" ,A" P) <W,p, ',A  XY <%6A" ,A" A" W  @Xi l  $aW   x$aW   `$1P9 0X ӫ  B0,K @DB0"W  #+W  #$A#A$`W  |C |  	clw P (( ,A A l #X !A  ?W    ,$PmtW  Ј l8 lP7 ,mtAx  9w P (A , X Px L#	Xx LA"C ,X ,` A$PXh 4lAW   Hx  1 t|g A , X Py ,#Xy ,X9 <  Ay ' ,  A   $P$aW  0C  0 	w P (( ,A A l #X !A  ? ,$PmtW  `Ј l8 lP7 ,mtAx  2w P (( ,A A l sX !A  ?PxC lXxX=L<X  Ű B0BX 
  @' ,A A" A" XL) A  ?Ax ( ,~A" ?8 ,( |CA??C02zH A??!4$PX h?  Ah?  W  X8 #xH@A??!4$`h@%P p( tCA??C08Ө !6$P pC &P p' , A  A" ( A  ?' , A  ?X< 	   P lX@P p$Z`AP l#Ә #:nW  @C .A' , A  ^A" XMLL$ A  ?$ $A$PXh llV%A$12  P8 tX p!=XLX  %ACP  #
XLX  P  C `XX p\$fAjC NXX p\$cAXC <XMpXX p\PT  C ($aW  L$`PhX` AlAB0PW   h?  W  ' L A  NA" ' ,A  hW  (X8<P8Ȱ @r  qX#3C p@W   h?  W  ' L A  >A" ' ,A  hW  (XPX` A|,W  @C  W  XMXP  C  W  P x# PP xQ$aAC $PPX |( *A" ?%a&aPh xPh8 ( (CA??#?W  X8 |<
1P8 |#X |&P |ȨX x
XH |LJ  @ AXh xUhA` 	B0P$UPX$`Phr  qC $7P8 W  P$PӨ #: W  Pr  qC  W  Q$bAC Ә C0 ( A ?A  @ :!4'!( X U#8( &A" ?X- A  C \h ` #%` h X- A  C 88 0 #$$?8 X- A  # W  XdP  #C C  		Gg A , X Py P#Xy PX9 <  A>y @ PI LX6 <3B0$' ,  A  i 4W  (Ȱ P LXP HY ,Xi LlAC  K 	w P (( ,A A l mX !A  ? ,$Ph lW  PAPЈ8P7 ,h lA&x  8g A , &X ) tA Py #
Xy  tA<y ) Z tA  r	 T  q	 TX9 `<3B08%Qi \W  ' , tA  A" W  @C  tAA) ,$:A\H R#3C bA) tA  ' , tA  i \W  (%Qi \W  $P \P `Y  ti \W  4' , tA  A" W  @C fC   	gpw P (( ,A A l +X !A  ?( ,A" ?8 ,( lCA??#8h?  lAfC x  5w P (( ,A A l #X !A  ?( r ,A r l  q l$XXh tlW  W  $XXh xlW  W  $XXh |lW  W  $XXh lW  W  ,x  aw P (( ,A A l 7X !A  ?$0P8 Px #
Xx Ax H ,DC08 ,#H A??B0@A#3C t$`W  LW   h?  W  $aW  L' L A  A" ' ,A  h tW  (XX x\PX h ,fC0 ,( ,A ?1  0 :!4'!( ,( ,A" ?' , ,A  h tW  (X xP X P |$P X l` Ah?  ,W  dH -PH T  P a!P z!%UT  Xh lf!7( ,A X- ,A  C   g A , X Py <C >Xy <X9 <' ,  A  A" X  A" Ay ' ,  A  i ,W  ($P ,P 0XI LT   i ,W  4' ,XY \  A   W  Xi l' ,  A  A"  A" W  @C Z  	yw P (( ,A A l lX !A  ? ,$Ph lW  Ј8P7 ,h lAx  2w P (( ,A A l 1X !A  ?X=XC  LPH p8 ,#H |A??C0JX ,U!;W  @x h?  ,W  X' , ,A  |W  C @h ,f#78 -0 ?B0$P tX=|AP lX lU pC0Ӛ  P $@$!APH xC 2&APH xPH XX l\&QPX le  W   <XH xUH AUH B0P Xh ll&aPh lX8 t<3!9W   H#W  ,%X tP tC NC b( | ,A h?  |W  Xh?  |W  ' , ,A A"  |A" W   HW  ,C  w A , X X=XC  LD!?W   HW  ,C lPI 4$P$!APY ,C H&QPY ,PY 0$cW   X ,X=A&W   HW  ,XY ,UY 0AUY 4B0P 0y  Z	w P (( ,A A l 6X !A  ?Px #
Xx Ax h?  ,W  X8 ,3!5AC h?  ,A0( ,A" ?8 ,( CA??A$P |Ө C0$ ( A ?ӑ  Ő ?!7$P |'!( H DC0Z .A!8X]$`Pe  C >$1P8 p1$ H A ?#3P( p' ,A  h W  (X?  h W  4$P xP tX tXXI  LC0N&P tX=A&( AC0,XX x\&QPX xX=AP AX( $8A\C Xh plfC0bX8 x<0 B0XL+ A $ $A&1P8 xX=A$PPQ  X xX=A!  A  XmX8 x<P6  X |#3AӨ ,#3C 4C & ~g ) ,A A l X !A  ?f#8( l
A" ?( l ,A" ?y  *	g A L X  ,$jA&W  ` =W   <X9 !:W   HC *#$0;$QcW   TX #W   HW  ,y  E	w P (( ,A A lX !A  ?$0P84Px`#
Xx`Ax  ,Sh<W  ( , A  ?h?  ,W  X8\$ BBA  !7#<A" \$QeW  ȸ<P ,Ȱ P 0$P$aW  h?  ,AӨ ,#9 ,.:AB0( l,A HHÐ  #6A" ?Ð @#8( lA" ?HhH`  AH8H0 !8c` AHhH` AHhH` A( lA" ? lW   H' ,A HhJA' ,A Hh<iA' ,A Hh>iAC $1P84( ,A" ?8 ,( lCA??C0$P82( H lA??C0>Ө !6%P8C ,' , A A"  lA" ( lA  ?8 l#H A??#8#A" ?#$Ҙ ' , lA  ?X    P lXP p$W%bAzP,Cr' , A  A" XMLL$ A  ? W  P0XX,\P!7@FA#@JAHhH`@hHC pB06' , lA  A" X=L<# A  ?$ $A'!A$  P,%DH@HX8#6HH@HC FXH4C0X<PW ,P PW 0$P$aW  $aW  C v w P (( ,A A l aX !A  ?HT$1P4 Ȱ P A   (dA^$PPXlPxx#
XxxAx  ,mtW  $aW   $aW   l( lA  ?2$ BA  !8( lA" ?(  lA  r   
q Xh lfC02' ,zA  lA" X=L<# A $ $AX P<ȫP8X P@HJ @C!C06' , lA  bA" X]L\% A  ?$ $A$aW   lXh<lPmH6 0  
3
cPh<XH PDH PHC0|JW   HW  ,XH8LXH$R
A
Kd Ph0X8l&1P8l0 C XL+ 8A $ $AX PLX PPhLW  Xl8dA!XA XH0LHT  P  PXH#3C TXmplX6 <3!>XdP ,XhP 0XXl$aA0$Pt$dW   XlP$	$!APpC P&PpP|8dA$nAܘXHtL&APHt@ !<W  ,$dW   XpU|AUB0P|C   w A , X $0P9 0H4PI 8X4$$APY ,C $&TPY ,PY 4Xi 0X5  <
cPi 0UY 4AUY 8B0P 4$[ 0y  >	W  A 0 X P  PY 8X9 ,P9 <Pi @$@PI Dr	 0  eq	 0y  "	g A , X 6#  $J$P: ,VE@ $jFPJ 0U=C0]PW ,P PW 0S$aW  Xj ,PmX 0=Az  =
w A , $X $1P9 @~$PcW  $P D&P P jADP <XA  LDC08XY D&QPY DXi @#;.W   H$0P9 @) ,$4ArX <X  P 0Y?  HbW  4 H$hAbY?  HXi <lW  4 H` A>Y?  HXI <Ld W  4 H` AXY <\Xe $lPh tr l  q l t$jA<X9 << ( t$4A\Ȱ @ nr l  q lX x/m@(` ,$Q$eW   $W   HW  ,X U AŠ B0P $PXi DAW   HW  ,y  	w P (( ,A A lRX !A  ?Px8#
Xx8Aּx h?  ,W  Xh?  ,A8 ,0 BN ,( ,A ?ӱ  P4Ű !#4Ű ?!5'!( ,#$P4 ,( ,A ?ӡ  Š S!4'!( ,Ә ,#9 ,.0AB0\r   q r l  q l' ,(A  A"  A" XA" A" A" P(<W,p, ',A  XH<$A" ,A" P(@W,p, ',A  XX@%A" ,A" A" W   HXh xl'aPh8 ,3C0X ka$PW   TW   H$QXh lW   TX t ȐPC0.` ,W   <$QXhlA֒W   HW   H$C&APHPH<PH tr l  q lXX \UBXh tlPh X8 x<P8 $P P X?  h W  4Ө 'Ҩ $P  X( ,A ?A  @ _#6&!P( C $RXhlW   T$fXX \eW    W   HXh |l` #4&aPh |aX8 <Ӹ ;S W   TX  P X   P !8$fW   #$UiW   TXH L/m@` ,$Q$gW   XX \e` $SW   TXh l
fi$UW   T$SXh lW   TX8 <3#W   HW  ,XHUH<A@  B0&P<W  ,C $P tr l  q lX P0X tP tXH xLPH x$PPX |PX X?  h tW  4h 'ah ' ,A  A" W   H$0P8 X ` A
X tX !<X xXH LC0:zW   HX?  h W  4X 'QX  W   HfW   H$QXh lW   TXh lVE@ 0CPXUC0.` ,W   <Z$QXhlA0TW   HW  ,LW   H$P tHh l` ?$QW   TX0 #8>W   H` ,W   <$QXhlW   T,W   HC 8 ,.&AB0W   HX4#8W   HXH4L@ !!8W   HW  ,r   q $P&QPX(PX<Xh lVB0,$RXh(W   TW   HW  ,C 4PX t0 (@8 nr l  q lX xP$X4B0X !7XH tLD!3C $RXh(lW   TW  $PPX xPX |PX X?  h tW  4h 'ah  W   HX8$<3C0 $gӸ kW   W   HC R$RXh(lW   TW  Ȩ8P ,$PXh(lAX B0XH tLDC0<$gA6XX$\U#9W   H#$dW   Xh(lPh |r l  lq lX8 <0 #9W   H#$eW   A#:W   HC tX$lAX4Ű ?!?|W   HW  ,C JȨ8P ,XXD\Xh(lA$XHh8W   T$P I&APHPHD=A@XX \Ha  `  
VPX UHDA@ ~B0PD$VXh lW   TX8d<Xh+AX :cKh8$VW   T$cW   $&P PDXH8L@ PH,!7W  #dW   <XX8\XPX8X UDAŐ B0PDW  |W   HW  ,XX(UX<AP B0tP<C 8 ,.A!5AC "' , ,A A" W   HW  ,C 9 '0w P (( ,A A l X !A  ?H l$1P4 Ȱ *P A   ( |A^$PPX PxX#
XxXAx  ,h4W  $aW   $aW   lTA( $:A\h f!7( A 83!7(A h AAA( $:A\(  A  (  A  H!9 ( AC0
$PXh A&Ө C0"' ,A  A" W   HW  ,X C0XXHLDC0W   HXX PX`$`$!APh C X&aPh Ph\8 |AP ` A' , A  A"  A" A" X A" ( A  ?h?  A' , A  hW  (X` A,$UXh lW   T$PXh$lW  ' ,A  ',A  ,A" A" ( A  ?$fA*Xh(lA@( A  ?$iAX8,<P8r  qW   HW  ,Xh Uh\AUh`B0P\C $P 	#P 9#  X *P8 ZCA	Y#&1P8 P8`$@$!APH C \&APH PH\PH XX \YX B (8 |AP Xh l
VPX ` A.C W  ,XH UH\AUH`B0P\$0P8 H#3C (  A  (  A  X &P $Ҙ Ҙ h  Ah W  dH @ 
C$' ,A  A" ( A C X 8 |Ah P\A<X(\A  A( $:A\C C F ww P (( ,A A L X !A  ( L$:Arh  ,W  X8 ,3C0& ,( ,A ӱ  Ű #!8Ƞ #@ p'!( ,8 ,$ BA  #;( LCAA$ BA  #;( TCAA#H lA#1( \A  h  LA^h  TATh  \AJh  lA@ Lx  g P (A , X $08 ,F  DC0*' , ,A A" A" ( ,A  V U!66  3C0,' , ,A  A" A" ( ,A  ( , A" Ӷ  C0,' , ,A A"   A" ( ,A  H $#8( ,A"  ,  Ax  ~g P (A T X  ,.A#5&A   4.A#6& A   <.A#6& A   L.A#6&  A  x  ?W  P (A 4 X X8 Y8  CP8 HX  P L8 ,A( 4$5A\C X H&P HX L!3C X H8 ,A( 4A!#C X L8 ,AP PX HAX( P$5A\XH LL'APH LXX H\T!3C >8 ,A( 4A!C X H8 ,AP PX LAX( P$5A\C BX L8 ,AP P 4X( P$5A\Xh Hl'aPh HX8 L&1P8 L[h X  [ H	kC *X ,P ,X 0P 0XX  cAX HP  C (X ,P ,X 0P 0XX HXh AjX LP C px  ؀W  A , !X Ph dPX h$0P8 lP8 p] h dW  4ӽ!7-rA ' ,A  nA" AZ( ,$:A\' ,$:A\m|AJȠ @ ^ȝP xr \  q \XH xLDC0:X]t\U!8` *Pm	x X=L<#  dA  ?$ $A$P dP hP	P	&P |P =AP TX C0bXM	L&APM	=	AP X@ AXX T\Xe  lPh lX5 <P8 pX X[   h dW  4X |U AŠ *B0`P X	P ,X	P 0X]	\$aAC   w P (( ,A A L )X !A  %1P=x ,A-|$:A\Ȱ *Ph$P	P	PpPt.lAC0$Pt' ,|A  jA" A" hA" ' ,A  h tW  (XX x\Xh tlAlX xB0.@ @H $PPX r   q ] h W  4' ,A  dA" A( L$:A\' ,$:A\m|AC m|f!7-|bA |.`AC0`' LA  \A" ' ,A  h W  (0 -@8 r   q X #4$P X Pxx  W  A , X %A#>.ZA#8X  .XA!5%y $" #	W  P (A , X X8 <X  [   c   AC0rX X  Y  j  A`C0NXH LXX  \U  d  A<C0*Xh lX8  <S   f   A#5%x $" Zw P (A , X ( ,|A  ( 4A  $1@8 RX	&P	X		C  Xt#6 ,x XMhL&APMh@ *C X]p\&QP]pP !(XmxlV !5 ,C PX \=hP8 pȰ @ Vr T  q TX p#3C XpP \$A@H Vr T  q TXX p\U#4$`Ph \X8 \<P=$PhC 0=ApX  P t#:ZXmlAC C X	=	A' ,P xA  X xA" A( ,$:A\X	#9bAW  @$@@H R]|h ,A#5 ,C C J g P (A 0 X $0P8 4C&APH 0PH=PAXX \  P <1$ VBA  #:Xh 4&aPh 4X8 0P8 8XH 0UHA@ B0PX 4C0 X 8=PAX   AX ( `0 IA\X 4C0`An($:A\HD!3C X 8=PA hPAvX(A  $PXXhAZ( @A  $`&aPh 0PhX8 4!==PA ( @A  =XA P <ӱ  C0LA($:A\ @A($:A\' ,$:A\hAhAX( <,A  Xh 0UhA` B0\Ph `W  X( ,,т  A X 4#3C x                                                         $       $  *       *  0       0  6       6  <       <  B       B  H       H  N       N  T       T  Z       Z  `       `  f       f  l       l  r       r  x       x  ~       ~                
                                                                                                                                                                                                                                                                                                                                    L      L"R  R&X  X*^  ^.d  d2j  j6p      p:v      v>|      |B      F      J      N      R      V      Z      ^      b      f      j      n      r      v      z      ~                                              $        "  "(  (.  .4  4:  :@  @F      FL      LR  RXbD  Xh      hn                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          	t                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Filename        Size   A H?   @ @                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    basic:search basic:
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        %begin
   %conststring(5)  SYSTEM UNIT = "SYSX_"

   %system   %routine %spec OBEY(%string(31) from, to, %string(63) parm)
   %system   %routine %spec LET (%string(63) old,  new)
   %external %routine %spec CONSOLE(%string(63) Mess)
   %external %routine %spec DO  (%string(127) line)
   %external %routine %spec LIB (%string(63) parm)
   %external %predicate %spec EXISTS(%string(31) file)
   %system   %integer %spec OPTIONS
   {Options = -1  to run subsys in diag mode}
   Console ("Process started ".DATE." ".TIME)
   Let ("C",   "Copy")
   Let ("E",   system unit. "EDITOR:HARDECCE")
   Let ("F",   "Files")
   Let ("V",   system unit. "EDITOR:VECCE")
   Let ("BE",  "Become")
   Let ("IMP",     system unit. "subsys:Compile IMP|")
   Let ("FORTRAN", system unit. "subsys:Compile FORTRAN|")
   Let ("PASCAL",  system unit. "subsys:Compile PASCAL|")
   Let ("BASIC",                "basic:basic")
   Let ("HELP",    system unit. "help:help")
   Let ("LAYOUT",  system unit. "text:layout")
   Let ("LIST",    system unit. "text:list")
   Let ("COMPARE", system unit. "text:compare")
   Let ("TELL", system unit. "relay:tell")
   Let ("MAIL", system unit. "relay:mail")
   Let ("OS32MT", "emul:os32mt")
   Obey("Startup.tmp", "Out:", "") %if exists("Startup.tmp")
%end %of %program
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          C!          I X }                       NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    #(    e}     &y$@  X      Lj      #	y    ~wZx  &P  Out: Startup.tmpStartup.tmpemul:os32mtOS32MT 
relay:mail MAIL 
relay:tell TELL text:compare COMPARE	text:listLIST text:layoutLAYOUT 	help:helpHELP basic:basicBASICsubsys:Compile PASCAL| PASCAL subsys:Compile FORTRAN|FORTRANsubsys:Compile IMP|IMPBecome BE EDITOR:VECCE VFilesFEDITOR:HARDECCEECopy CProcess started  SYSX_
   9XFH  !34  1  0 !81 !5$$A> rB  @ !4B ";
C@ !$$A> r#$$A> rB  C
B$P#E  E  &Q'1"C  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n?1  34C0  D   D   
C   w P (p 0W   ' ,A*',A* ,A   P( ,W,p, ',A*X ,<  &1Ȱ  ҼC   <  ,,A   W  h' ,A*W  \' ,A*' lA*A   W  \' ,A*W  \' ,A*' lA*A   W  \' ,A*W  \' ,A*' lA*A   W  \' ,A*' lA*hA   W  \' ,`A*' lA*HA   W  \' ,BA*6W  \' ,0A*' lA*&A   W  \' ,A*' lA*A   W  \' ,A*' lA*A   W  \' ,A*' lA*A   W  \' ,A*' lA*A   W  \' ,A*' lA*A   W  \' ,A*W  \W  C0&' ,A*' LA*W  Px A.X  !%$`A@# !5$bA@#$aA@%2Q=\$P ,$P 0Z$gA<&$gA
XH !;$PPW ,$aPg 0$W$jA&W   P C :A=6X HP PA<X9 HH C0JA=6ABXi HA;ZXi HA:*$aA@                                      $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                                                        P AjP X`&İP &P`X P ,XI PG 0$X$bA&$QPW ,$\Xi A@ B`XhPi 0A                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                                                        P AjP X`&İP &P`X P ,XI PG 0$X$bA&$QPW ,$\Xi A@ B`XhPi 0A H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        {Mouses Standard Subsystem}

   %systemstring(7) Version       = "3.1:B"

   %conststring(16) Diag Prog     = "SUBSYS:MDIAG"
   %conststring(14) Sub Init      = "SUBSYS:SUBINIT"
   %conststring(14) Batch File    = "SUBSYS:BATCH"
   %conststring(13) Standard      = "SUBSYS:STANDARD"

   %constinteger Wsp  = 7,     {work space pointer}
                 Code = 14,    {code base}
                 Gla  = 13,    {gla base}
                 Link = 15     {subroutine link}

   %constinteger H = x'FFFF'

   %constinteger    Diag Stack       = 1200,  {stack required to run MDIAG (bytes)}
                    Basic Stack Size = 8      {god given stack size}

   %owninteger      Subsys Limit              {subsystem stack limit}
   %ownshortinteger State         = -10       {0=forground, 1=background}

   %constinteger  Opt Monitor =    1,
                  Opt Dump    =    2,
                  Opt Verify  =    4,
                  Opt Xdump   =   64,
                  Opt Quick   =  512,
                  Opt Trace   = 1024

   %systeminteger OPTIONS       = Opt Quick,
                  DEFAULT STACK =   10,     {60K for now}
                  DEFAULT TIME  =   60,     {one minute}
                  TT MODE       =    0,     {Terminal mode}
                  Obey Level    =    0

   %externalstring(17) Console int    = ""
   %externalstring(17) Prompt text    = ""
   %externalstring(17) Command prompt = "Command: "
   %externalstring(15) Error File     = ""
   %externalstring(7)  Search owner   = ""

   %recordformat Filefm(%integer Unit, Owner, Name1, Name2)

   %recordformat Parmfm(%shortinteger    Dsno, Dact, Ssno, Sact,
                        (%integer        P1,P2,P3,P4,P5,P6        %or
                         %record(Filefm) File                     %or
                         %string(23)     Text))

   %recordformat Contfm(%integer      Ps, Pc,
                        %integerarray R(0:15),
                        %integer      Eps, Epc,
                        %integerarray Er(0:15),
                                      Efpr(0:7))

   %recordformat restfm(%string(31)%array IO(1:6),
                        %integer Modifier,
                        %string(63) Parameter)

   %recordformat Command Fm(%string(31)         Command,
                           ((%string(31)         In1,  In2,  In3,
                                                Out1, Out2, Out3   %or
                            %string(31) %array  In, Out(1:3) %or
                            %string(31) %array IO(1:6)),
                            %integer            Modifier,
                            %string(63)         Parameter) %or
                            %record(Restfm) Rest)

   %external %record(Command fm) Command

   %owninteger Seg Mask     = 2_1111 1111 1111 1111,
               Current Segs = 0,
               Work Segs    = 0


   %owninteger C Level = 0          {current contingency level}

   %recordformat Eventfm(%integer    Event,
                                     Sub,
                                     Extra,
                         %string(63) Message,
                         %integer    Pc,
                                     X)

   %externalrecord(eventfm) EVENT = 0

!*******************************
!
!         {diagnostic routine}
!
         %routine REPORT(%string(23) TEXT)
            %record(parmfm) p
            p_text <- text.tostring(nl)
            svc(4, p)
         %end

!*******************************

   %include   "Sysinc:Ascii.inc"
   %include   "Sysinc:Direct.inc"
   %include   "Subsys:specs"
   %include   "Subsys:io.imp"
   %include   "Subsys:general.imp"
   %include   "Subsys:filerts.imp"
   %include   "Subsys:loader.imp"
   %include   "Subsys:Parse.imp"
   %include   "Subsys:bci.imp"



!========= SUBSYSTEM ENTRY POINT =========

!      Control reaches here when the subsystem
!      is loaded by the system.
!      The floating-point registers contain the startup
!      message.

%externalroutine subsystem %alias "%GO"
   %record(parmfm) P, Q
   %record(Contfm) Cont       {contingency info at outer level}
   %label          Trap
   %integer        N
   %ownstring(23)  Batch  In = "T:"
   %ownstring(15)  Batch Out = "T:"

   *lhi_0,EVENT
   *st_0,4(Gla)               {prepare for events}
   *st_0,8(Gla)               {new standard}
   *stme_0,P

   *st_Wsp,N
   *stm_Gla,Old State
   Subsys Limit = N&x'F0000'+Basic Stack Size*1024-200
   Stack Limit  = Subsys Limit

   Seg Mask = Seg Mask !! 1<<(Old State_ Gla>>16)  %c
                       !! 1<<(Old State_Code>>16)  %c
                       !! 1<<(N>>16)
   SubsysFile_Code Segment = Old State_Code&x'F0000'
   SubsysFile_ Gla Segment = Old State_Gla
   SubsysFile_Code Base    = SubsysFile_Code Segment+16
   SubsysFile_ Gla Base    = SubsysFile_ Gla Segment
   SubsysFile_Head        == Record(SubsysFile_Code Base)
   SubsysFile_Defs         = SubsysFile_Head_Defs_N
   SubsysFile_Specs        = SubsysFile_Head_Specs_N
   SubsysFile_Code Head    = SubsysFile_Code Base+SubsysFile_Head_Code Disp&H*2
   SubsysFile_ Gla Head    = SubsysFile_ Gla Base
   SubsysFile_Stack Limit == Integer(SubsysFile_Gla Segment)
   SubsysFile_Stack Limit  = Subsys Limit
   SubsysFile_Options      = No Decode
   Relocate(SubsysFile)

   A Limit     = Addr(Alias Text(Max Alias))
   Alias Limit = Addr(Alias Text(0))

   %if P_Dact = 2 %start                        {a batch job}
      State = -10+1
      Q_File_Unit  = 0;     Q_File_Owner = 0
      Q_File_Name1 = P_P5;  Q_File_Name2 = P_P6
      Unpack(P_File, Batch In)
      Unpack(Q_File, Batch Out)
   %finish

            Init Streams
More:       Unstack Conts(0)
            *la_15,Trap
            *st_15,Cont+4
            *stm_0,Cont+8
            *ahi_wsp,300
            C Level = Contingency(Cont)
            %cycle
               Stack Limit            = Subsys Limit
               SubsysFile_Stack Limit = Stack Limit

               Current Segs = Seg Mask
               Work    Segs = 0
               Loaded Files = 0
               Obey Level   = 0
               Skipping     = 0
               A Limit      = Addr(Alias Text(Max Alias))
               %unless Addr(Alias Text(0)) <= Alias Limit <= A Limit %start
                  Alias Limit = Addr(Alias Text(0))
                  Console("All LETs removed")
               %finish
               %unless 0 <= Lib Limit <= 7 %start
                  Lib Limit = 0
                  Console("LIB list cleared")
               %finish
               Lib(N)_Use = 0 %for N = 1,1,7

               Obey(Batch In, Batch Out, Version)
               Stop %if State # 0
            %repeat

Trap:


      {Base level contingencies come here
      {There are two cases:
      {      1   A terminal interrupt has occurred, in which case
      {          either the global string "INT MESSAGE" is set
      {      2   A contingency is fired at the current level (Int:.)

      *stme_0,P
      N = -1
      %if P_Dact = -2 %start                             {shutdown}
         P_Dact = -1
         Shortinteger(Addr(P_P2)) = 1<<8+'.'             {pretend INT:.}
      %finish
      %if P_Dact = -1 %start                             {INT:something}
         Console Int = String(Addr(P_P2))
         N = Charno(Console Int, 1)
         %if N # '.' %start
            P_P2 = 0
            P_P2 = 256 %if N = '?'
            P_P3 = P_P1
            P_P1 = Addr(Cont)
            Svc(27, P)                                    {Resume}
         %finish
         {Int:.}
         P_P1 = 0;  P_P2 = 1;  P_P3 = 0;  Svc(6, P)       {kill output}
      %finish
      Stack Limit            = Subsys Limit
      SubsysFile_Stack Limit = Subsys Limit
      Stop %if State # 0                                  {Terminate batch job}
      Init Streams
      Console ("*Subsystem failure") %if N < 0
      Dump Contingency(Cont) %if Options&Opt Xdump # 0
      ->More

%end

%endoffile
 H?    
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     0 C!          /fD}$Yr     (      s_    ~wZx    %%N3}+  %%N4:M $ S@   * #4"K  0 &y$ }  6 fS}}  < %Qv_ B ""`:%   H wq af" N %Qv    T"Z     Z_;s[ `
d+D     f=     l[z`   r&@   xX_&@   ~UM[D *;eox "`EX!     U}}     rqI     }@   #!t(   w@   
!yW   `EXg\   !`   `EY}  `EWK    ww:` wag\ :     a@   :H   ayu   $wF6g\   ]q["iZ}  l:`    afk    NW#xgQK 3X`QK J'uxp` twG-} &q["op`,fZJ_2	F`:p  8	wZ} >	X/Xg\D	`a  J
wp`P
X/YV
wL  \NfZXbuX_Lv@  hUp`n&y$@  tqIXH  zX_Lv"8  yA    yA    X_d/@  +yd     A
|"=+%K"=+ULu;`  ʉ8    aX    }+EGZ$&~v,TU~u@  k<@    ~u@    :      (QT    `Ud R5S`:w}R-^e&Z    e#	y    "e&@qVM&@
	e&@fS    <]    P!t^Z} "k;ov    (
}    .(v    4%fZK   :9sv    @fZ    FΙ/v    L7eE     Ryy8@    XqI     ^Hmfp  dzda]p  ji    p4iiR  v"d  |V   d+GeZ^HVs      yp    go    MY   }o    }eQth#p}SId:w	Rr8{Lu;`t8{}} 3e}     )	8    ::w  K4ga  fxXH!;/;`    !X      "#(    $Y      NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z           gitw   Z 8 D Z              	.3ns	'9=A      " ( 0 5 < B G L P ^ u    $ ) 1 < E J S x |          MT > E = T Y S f   6=V`	  5 = 2 	  , C ; q      udQ@    qX`    X_&     qT{ 4  :yqIT8d+D        z`  &@  X_&@  qI\^C  }M[D}   `EX!    }}    qI    }@  #!t(  w@  }qI`EX    `EXg\  `EY}   `EY} `EWK   w:`wag\:    a@  :Mpayu"&%  wF6g\  q["iZ} :`    afk    !      qIQK xgQK X`QK 'uxp`wG-} q["op`fZJ_wW  wZ} X/Xg\w`  wp`X/YwL  fZXX_Lv@  Up`&y$@  qIXH  X_Lv"8  yA    yA    X_d/@  yd     	ew  "ew  ~l=.  ULu;`  8    aX    }+EGZ&~v,U~u@  <@    ~u@    :      (QT    yqLX  UdZX}R-^e^"    #	y    "e&@qVM&@	e&@fS    ]    !t^Z} ;ov    }    rX     (Q_  (v    fZK   sv    fZ    /v    eE     !    y8@    qI     mfp  da]p         d+D    d+G             yEv;>9  QQ  QX    sf.Q@s      yW    	eyqT^9}  MYX    MY     |]    ox    !"    MY    }eQth#p}SI,z    ,      d:w	R'X     K      )	8    X`}     fxXH%Qv9da}     X      x,Lv@  ^@    z
z}  $ OUTTYPE*Subsystem failure LIB list cleared All LETs removed &seconds CPU milli OUT: 
 not found          	   .COM .EXE No room for definition of              Malformed command:  missing                         loadedCannot access  .exe Cannot load  No space for stack Data:  *No space for stackFatal error during diagnostics *Diagnostics being sent to Cannot load diagnostic package Cannot load  Ref:                          0OS  <  ,<-0 HA            H    	whose file?to whom?      PC  PS   Invalid addressA  @@ *Contingency fails *Create segment fails  ) fails -- output(input( *Close  --  Cannot offer file to input ended --  *Cannot open Null:Out: NULL:IN:  invalid stream numberinvalid DA channel numberIllegal filename                                                 
                             too many open files            <                                                                              &SUBSYS:STANDARDSUBSYS:BATCH SUBSYS:SUBINIT SUBSYS:MDIAG 
   "%H  !34  1  0 !81 !5$$A> D$@#0#D   D   &A'1"C  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nH  !34  1  0 !81 !5$$A> DB  @ !4B ";
C@ !$$A> D#$$A> DB  C
B$P#E  E  &Q'1"C $A1    0#
#	QD   RD   ?&A'"3  $$A> DA> D2#XC   PC   '4"2$ #PC   '4"?1  34C0  D   D   
C   w ( ,Ap d' , ,A2  &1$JBC   2  ( LA   r D  q Dx  )w p 0X|!<-<4A$ $$	AP ,X 8P|X( ,$?Ax  $g p ,X|P 8%1P6 Pm|x  w P (p `-$?A0 P=-$?A0 P=ȽPȭP$PXMȤ <P 0P|ȚtP 4XH 0XT  #<PX X$k@h Br @  q @X( 0$?AU( 4!2#P( ," <P( 0X ,P, 8C X=	|P8 8$P <X 8X  #?P X$P  $K@H Br @  q @XX 8&TPX 8%aQh <X <#3C $0&1P8 <2Z=	LȽ	 P  X <Z	dP  X8 <0 B0X	LMPI  $`AX]	dmPe  $`A"x  g P (p ( r ,Ar l  q l tX( $4AX xC -<A ,A  ?$ $$
Ax  3W  P (p L( 4$4Ar ,  q ,X(   2Ax  W  P (p ,@e r    q  X  X< #=-< AX, $$	Ax  %W  P (p l( 4$4A$>@8 .r ,  q ,X HT  C0&X  LXh A4-< 4AX( H$$	Ax  4W  P (p PX P @X6 P8 DPX HX 0$bA"X ,X <P  x  !W  P (p PX ,P DPh HPX LX 0$iAx  W  P (p PX ,P DPh HPX LX 0$jAx  g p ,f!` 
!%x -<A&$$	A W  P (( ,Ap l' , ,Ah TAXh AaAX  P dX L$fA(X8 2Z=	|X dP  x  3g P (p LARZ	|X  P DX ,` A 8x  W  P (p 4AZ	|X ,P ,XX  Xa  Ax  W  P (p 4AZ	|X ,P ,XX  Xa  Ax  W  P (p PAZ	|X  P HX8  P8 LX 0$cA4X ,X <P  x  $g P (p LAdZ	|X  P D#>X ,$kAX8 2Z=	|$P  x  #W  p ,	V!P !%x -<A%$$	A g P (( ,Ap Px #Xx $ $$	A8 ,3B0 ` !(( ,A#( ,A' , ,Ah TA$QXh AX XŰ !<X Z	LȝP  C Ű #5 A!<XH BZM	L]	 PT  C Ű!>Xh bZm	LX	LX<  P6  C | L( l$8A$P R$fAAFP X P  %APA XX t'QPQ Xh iZm	Zm	Pa $P P  TX8 # $4AX Z	LX P  Xm	DAx    g P (( ,Ap P2  0 #%0 2  V$aA0P L ,Xh LAVx  (g P (( ,Ap Px #Xx $ $$	A8 ,3B0 ` !(( ,A#( ,zA' , ,Ah |A$PXh A$X Ű !<X Z	dȝP  C rŰn!>XH BZM	dX]	dXe  Pd  C RŰ #5 A!<X Z	d=	 P<  C . |( d$4A#7X t` AX    P $&P Ȑ <ZP PXI UH |B06XY UX B0*Xi $Uh B0X  U !;X8 2Z=	dP  x Š B0$Ph |Aȸ P ,$Zh |A" |( T$4A%P X t$fARAP LX Z	dP  XH PA  $PPQ $jPa X ZZ	P P < P1  TX L+ $4A d+ ($4AXm	HAXC D
  g P (( ,Ap P2  0 #%0 2  V$aAP L ,Xh LAx  (g P (p 8Px 4C @Xx 4' ,lAX ,A  fA  <A  A$ X4$	A$&P 0X8 Z  P ,Xh 0AX 0X Zʺ P ,Xh 0AX 0 B0$aA$aANx  ^  ?g P (p ,V$`AZ	LX  PX<  P=	<X P	Dx  "g P (p ,V$`AZ	dX  PX<  P=	@X P	Hx  w P (p ,X	<#5x X==	 !3$"	%" w P (p ,X	@#5x X==	 !3$"	%" w P (p ,X	Dx  w P (p ,X	Hx  w p ,XX< ӳ  Ű !?U< !3AXX 'P C x  !g P (p 4X	<C0RiPh ,X8 0P8 0XUk #;Pk X P ,VlAX 0'XMZ P XT ePd AVx  9w P (p ,$`Azx  w P (p ,XX< #$x 9X [ 
; " w P (p ,XX< 9X [ 
x  w p ,-<ZA$ $$	A w P (p ,XX< U< #9&1P<   x X	<C0F$Q X Y ##AX< P< CPL P7 ,YkAX]Xe Ue !3A0C X	 !3AX$r  q=3!2"
XȭP Ӛ  
P XK &APK T  P P !3A
XmX   C D sw P (p 0AP ,x  w P (p 0AP ,XX< '1P< x  w P (p ,X	@B04X=X ˽'ҽ#7r  qXȝP MPJ x  *g P (p 4X	@C0iPh ,X8 0P8 0XX #>X U #9XK PG ,ZlAX]Xe Zh 0Pe X < P5 X U ,C02X ,	!P ,ZXm	@Ah#P ,ZXm	@A&XXH ,PI x  Yw P (p ,$`A:x  g P (p ,XPl X=	@C0JX U #9k  &P x X P ,X\ cAXXI PI T PY $aQi C >	 !3C f!X< U< !3AXX !XX U !8A@XH #C X]Xe X   &aPe X=	@!6 
!3AC b jW  P (p TX	LX<  P8 ,X	DP PA<X #9Z	Lȝ	 P  #XM	L]PT  XmUh ,!5X  B0$X=	<P8 H#>X 0$kAX$P  kAXh PAx  Hw P (p ,X	D#5$QlATx  w P (p ,Ax  W  P (p bZm	dX  P ,X<  P8 X !9Z	dȭP  #Z	dȝ	 P  XH UM	H!4dAvXX C0Xm	dX ,U  #:U #7U #4U !4x ( 0$?AlAX8 8U8 4!5X @B02X 8U <#8$Қ  &P 8"XH 4PG ,XX @Xh A$QQX @ H( t$4AX l` AbXh @[h xPh #:X P X l$cABX8 P8 X l$kA0X  B0X \C0P tX `P |XH dPH XX PPX Xh TPh $@ nr l  q lX8 Cj$P X \P P P ]? <h A' ,DA<A  >A  P( -<X A tA  ?X( $$	AC : H( t$4AX |P XH PH X l` AD$Ph HA#X]]	 #3AC Nw P (p ,X	H#5$PlAx  w P (p ,X	H#5$QlAx  g P (p 8$P ,Px 4C TXx 4$`A&6AX8 0!6.A#&Av$PXh ,A' ,A<A  APAXh ,AXh ,AX ,!4x $P 0A$P 0XX Xh ,A%AQH ,C  [  
&w P (( ,Ap42  P80$@PH,#&APH,X ,
Te  AXH,UH0 >x  *w P (p ,$jAx  w P (p ,XX< 0 
#3Ax  w P (( ,Ap pX=	HP8 l$`AA ,A:AXh lAx  #g P (p 0$  AP , 
!2#X8 ӳ  &K   ҳ  C x  #g P (p ,X #('P $jA"	x  w P (p ,`  Ax  g P (p ,X #)'P `  A"
x  w P (p ,$lAlx  w P (p L$PeAr ,  q ,x  W  P (p LPX 8%P <r ,  q ,X8 X 4 P  C.$PkA' ,A',A ,A  AL#
$X 4  V(P(x  Ag P (p L$  %1<T=(P=(Ph 4r ,  	q ,x  w p LX$P 4r ,  !q ,x  g P (p Lf#x Ph 4r ,  q ," W  P (p LPh 4PX 8r ,  q ,X 4!5%x $" w P (( ,Ap l2  0 2  $IPH T$PPX X( \ ,Ar L  q Lx  (g P (p L%P 4r ,  q ,x  g P (p LPh 4r ,  q ,X 4C0,$PlA`' ,A',A ,A  AX 8x  0w P (p L$P 4r ,  q ,X Dx  w P (p Lr ,  q , 4$	Ax  w P (p Lr ,  q , @$Ax  w P (p 0h ,!j@.x k@.>" w P (p <h ,(#++i@BbX ,P 4  P 8 F#%+ x %1P8 0X 8ɰ F#X 0P 0&P 8"X 0   T 4P 4h ,k 4` ,h ,#j@` ,(C  PW  P (p ,`Ph X  B0"AX8  !#C b$UXh A.` :Ap# !3AA$TXh A2!<AA,Avx $XX Xk  A%Q  $Q C ANC  Og P (p 4A4A$XX Xl HAA$UX8 Xc LAA%&P ,ð !3A$TXh ,AX ,X Zʩ P$ZXj  APX ,Ű B0A%A&APH ,@ !3AXh ,
f$TAXX ,RXh Z]V PX 0$ZX 0Xl  AXH ,@ B0AjX8 X LİP ,  ɰ !ȠQ ,#X ,   P ,P Xh ,AFx  g P (p LPml$P 4$0P8 8Ph <r ,  q ,x  W  P (( LAp ' , ,Ah \A' , LAh |AX !<-<A$ $$
AX8 \!4X `#<-<A$ $$
AX dP X hP P |$A@H vr t  q tXX #<-< |A$ $$
Ax  dw P (( ,Ap Px #Xx $x ' , ,Ah tA @ nr l  q lX8 #4$C %C  3  qww P (( ,Ap |' , ,Ah lA$Ph lAx  "w P (( FAp ' , ,Ah hAv' , FAh AbX P xX8 P8 |X `$oAx  1W  P (p h' , ,Ah PAX P `X H$bAX8  X TP  x  %w P (( ,Ap \2  0 #$$?2  - ,A( HAXP Dr <  q <x  ,g P (p ,$Pf!4$Px  w P (p 4Px 0#Xx 0%x AP ,$"   X^W  P (p <NPH 0p LP , IP 4$0P8 8U#,0  P8 8P H[X  PX  #U IPX  U!$$QPX  fC:0 -P8 8$`[h Ph C$ %kPh 'P 4Z ,Ȱ 8Ҽ  %Q 4X ,Z 4X8 #  $J$R 0Y  XX E@ $jFPX U#3C X 8#9Q 4X8 ,Z8 4  X 4Y  #+'P 4Z ,Ƞ  ҫ  "'P 4Z ,Ȑ H[ 4қ  XH ,ZH 4  HAx  W  P (p ,AArx  W  p 0h  !4x (#h@` ,#h@` ,%Q  X8  ##	hh ,mn@`h ,"X hK  jH ,`K  C  3W  p 0f!$x  .5  &1C   5  X C :'P h ,` ,Al@` ,.X  I  &AZ 0YD   I  C C  9g P (p $ 0` #$$gPh h ,#0 -P8 x++` ,#Ȱ  P x(!7ȠP tC @P th ,i@!$Q tm@` ,"hh ,in@#%AQH tln@`h ,"XX h ,Ah ,i@!$QQX tm@` ,.` 0&6 08L  0 0` ,X@  0Xh A$PXh tA' ,A', 0AӲ  &Ƞ @ҢK   Ҳ  P( |!X |A ,A  @ 0
Ax  g P (p 0h ,` ,AA4x  W  P (p x$ 8` 7#%` 7Ph P #$$WPX  h ,Ah ,(#++` 4i@C ,h ,` ,Xh Zh  A6' ,A  ?Ax hh ,.6P8 0B0<(fC6X C 'P Ƞ  Ә 8&ҨI  8Ҙ 8C ( 8A  ?#
XX cA( 8AhH 4`G ,X?  8Xh  A: 8  ?AC x W  P (p 0h ,` ,AA
x  W  P (p p$ ,U#$QPX  #P ?#%P ?PX  X8  0 C Ȱ  Ө ,&ҸJ  ,Ҩ ,'1P8  C $XH I  PH XX P P PX lXh dPh P 	#&U 7PX l#U 0PX l ,&XL  , ,%1Q8  X  !* ,  ?Ax C  iW  P (p ,AAx  W  p ,X   0! 9!'P  C * _ A! Z!*X6  0 _ȳP  #$x X  	#%"$"
 2w P (( ,Ap $0P8 lB  PH tP8 p$ZPX xP8 Xh pUh t!6X lx &aPh p ,
<  P8 |0  !3C X B0"$P 0 -#40 +!90 -!4%P C ^P8 0 _!:X lP x$P lC BXX xh A!7X( |$$AXX l\H xPX lX #&ZX PX l#XH l[H PH lC B zw P (p`X 0P<X8 ,P8@!70  P<X 0İ PDɰ !ɰ !$Ű !7X(D$AA"  !$A"XDŠ B0V$Ҙ 4A PH  !"#H 4&AD  4H 4AC XX<h 4	V!&$ $$AX(@ 4Ax $P4PLA -#6A +!7A1P84$P8PPA|PHXXLhHA!3C :$PPA<XX8\HLPX8X4!6[XHPX8#ZXHPX8A4PHC XHH@ _!4XX8!2#e#$PVPXLAC |X8/`T@ .B0X8D0 #50 B0|+`\XL/`XAAPHXXLhHA!3C .$PPXH/mXj\`\XHL/dlhX`hXAjC XX4!8hHTkH\`HT#h(Tj(\`(TXhP!8A\!$$AXD
sL|

X8@X8P  C RX8ɠ !ɠ#&*$AX@@  C ,XH8!@ #&$$AXX@E  #Xh@hT`  C  Ug P (p 0  &P ,C 6'P ,X8 
<ӳ  ɰ aBɰ z!-X 
X 
I  TZ   B0x  2g P (p 0  &P ,C 6'P ,X8 
<ӳ  ɰ ABɰ Z!-X 
X 
I  T  Z   B0x  2g p ,` _` A!` Z!*Xi ` _y X  0! 9!$" #! %!% C   !4$C %C  6	W  p @ ,
<  P9 ,ȸ ,ʶ ӫ  P 0H ,F T  PY 4cAVXi 0P 8AJXY 8` (F
QXi 4PY <A2X < (X9  
@  y  @	g P (p < , #%$ ,#8 ,0 #:Ȱ  &1ҸC  ,8 ,"XX $aA:X Z $dA,X Y $gAXH T $jAx  =g p ,` !& @y ` $!$ "" 	g p ,f!4y VE@  (LeAX  0 (P #<jAӽ&K ҽC  /	g P (p ,$X8 sc  AX sk AvX sj AjX si A^x  'W  p <X P 0X8 0C0~X 
3Z; P8 8X X ,U  B0TXC UI B0HsS 
UPX 4Xh  X #X 
P #X; P6 X P  
P XK ,PM%x sS  PX 0C z$"
 PW  p \X` C0"eA' ,RAA  AX=`0 #?X  P ,XX mA
#4x X$P ,X ,C 0@ 0IZMPH TXX  PW ,XX dA#3C %aQh ,C X$ C00 0<Z=ȳ 0P T%P ,X ,YhC&P ,!7ȝlP XC *#-AMPH X$PPT  #ZP XXh XX  !56 3!3C j h 4A!3C XX  P ,XX Xh TAC08X TX XP $$API  X]PX 0jAPXh 0PmX XX<  !2#	C Xm$AnC 2X`ð !>X  P ,XX mA#3C Xh  AV-<DAA  ?X $@PI PI PI  C p w p ,
dx   (  pXhp Xts<@
3s\

Ps^
ZpP\jAXXI  PMXXY P]\Xi Pm0(3w sN@
D
N $"?C r Rw pPx #Xx $`AH$AAx h AC0,$aA' ,AA  A $aA>P 0 4h ,AP,'P X|w  P  $`ArXh AC vAC j `  kyg P (p <%P 4X6 0 #=Px ,ȰQ ,X  P 0C RXdP 0X  	#$P 0##$P 0XH 0JPH 0Th ,AXX ,#A(x PX 4QX 0Xh X ,P X8 0ȳP  X à !5mA-AAXhP 8XH XT 	Y#$PX 8#U#$P 8-00 AXh 8AXh A2Xh 4!` A`C b w P (( ,Ap lh LAX d P dh LAXh hALx  #w P (( ,Ap %1P8 h lAX ð B0ZX l#$P !7ư P C <P Zh A0XH #-<A$ $APH pZH TPX lh lABXh AXh !` Ahx  Zg p 0Pm|XPl  X=$P8 ,X ,C  'P ,Ƞ 0ZX XXH PI  C x  (g p HA"X s< 
3P8 ,X s@
P 0X ,C0XH Z P DXY  
UPX ,Xi CRs 
Z 0P @\iAX8 DX B0.X X $$@PI  Xh @A-<AA  ?##	XdP  XmlPi C tX8 X  s 
Z P <s P 8XH 8C DXX <He  aX bZl Ph 4H5  0 #6X Q  #X Q  &RPX <'APH 8C X XY PY (Xm|Pe  0P P x  g ( ,Ap tX=$0 !5$x ( V ,AA  r P  
q PX X!6X \V `#-<A ,A  ?$C X \IPH p $QY  sh `V]($  \P]($1Q=$Ƞ 0L&ZP LȝP $P9  PJ  Xh `Pj X \P Pj P  s< 
3
P Pj X:  H P H P HT PZ ,Xh X$P PV H4 P6  H 
P X P XJ PF %QPV Xj  H 
!  X8 
Z P X` #?' , ,AA  An%C  ŀg P (( ,Ap TAZC08 0L&ZP L8 PP< $$1P8 PlAX LX $X  #4x $ $A 3g P (p 0X$C0BY B:'P$0 0<Z=ȳ 0P ,X $$P  sk  AXH ,sd A|C x  1w p l) ,<A$aA.-< ,Ay  	g pP X=|P8X #$!$$ A|P 0 4h ,ABP,'P X X Ð !:Xj  AXh X #Xh pQ  qX X-| P-  XMXXPT  eABXh Ax q XmXP  lA$RXh xAC0"X8 xs    !:X0!6X4!3C #	@ PM0X P]4Xh xPm| ,PAX` #5h ,AAC v W  P (p D' , ,Ah <A(X $0P< X <lA
X  XP  X XI !6$ $Ax  0w P (( ,Ap H2  0 #%0 2  $Pl-p ,Ax  "W  P (( ,Ap $06  5  P8 B  PH XX UX !4x &QPX h ,
e  P Z<  P8 0 B :X ӫ  Š C0(' ,AӒ  &XH BI   Ғ  +A    #X Ű  !7X Ӛ  #2#C rXH YH B LX ,
Te  Ph &APH `  !9X  <  3!3C X  ӫ  Š ?#9&X қJ   ҫ  C C   w p ,X U #<&P 8 ,
<ӳ  P #$P XMZH T  PX y  %	g p ,$  X8 0 B 40 !5ȰQ 0 #=X J  &AXX ZD   J  AjC Xh ` ,!3AXy  4	W  P (( ,Ap $8 ,&1C  ,8 ,$P P8 0 #&#$$AX( 0 AAAX Š !9X XH PI AXX  P #8` Ph %Q X8 0 C00 P8 AX U B0bX  à B0NX Ő 
B0BXH T UC04d  
lӶ  P Z;  0 !;XT !8XX PT ' AHC hŰ  !8Xh  ` @#3C PŰ 
B0.X   @ -< AA  ?$!$$AX8 ӣ Š ?#7&ҳJ  ң C &X  Ð  #8XH d?  AXX P  !4A"Xh ` !:X X< !5P\ AX k  AX j @AX i `AXH @ /B0(AdXX e AXh f AX l AX=Z8 ӳ  Ű !<X X !7X P AXH @ 
C0B-<A]<P ?#9&QXh mE <]<AX  
#3C $ $$Ax Gg p 0XPX=Y=CH   Pӫ  
:&1P8 ,   PX( An!5%x XH ,Y  
E&APMC $" 7w P (( lAp h?  ,A
h?  ,AhC0FX  X=ӳ  
&P X Y#XJ  I  &P&P C X]P]h lf!4x  ,P Ph 
Z&YC  ' ,A ,A  AC X- ,AZ( &!P- lAZ( &!P-C  wg P (p ,A*X lA#7X( XAx  w p ,XtUx!5$y &PtX8 
<  " 	W  P (p| @P ,$1P8 0$Ҹ tPtӦ  PxX , @B08AP ,  !2" 0Br 9B jX8t0 C0^P ,B0$$PXmpA' ,A( t ,A  C "XY  !-Z ( tX  A  AP ,C  @B0,XtŠ C0 Ȑ @H t&AҘD  tH tAP ,C p$PX 4XmZh ,   B  8 4&1X ,ҸC  48 4AP ,C h?  4AX  !X 0#5 4Ah?  4A@( t 4A  $@PH 0C $XX ,P 
!2#h t&aXF  th tA<P ,C X(  tAX !7X=`0 C04X  C ,X#6Ӓ Ő $!?' ,AX A  AՌx  w p ,-$A' ,$AA  A#5$x -$A  %$A#4%C C0X-$AA  %' ,$AA  A܄#4$C -$A  %$Af#4%C z$C t cW  P (p $P ,P 0Px C LXx X=4!4x X0Ű !6<Az"X 0#<-<AA  ?<ATC -0 IA-$8AAX X  4m AAP 0!=$mAXP ,C $#.' ,AX ,mA#$APH ,XX  #C > 4XX ,mAXm#7 $B0PX8 0!;mAXmAC 63C"' ,$A' LAA#$0P8 0mA$`AC   !I!ow P (( ,Ap $Ph  ,Alx  w p |A( 4AAzP ,[LP 0X ,PLCD$UaA܄' ,A', 4A ,A  P( t( 4X tAzA  ?C fQE@ 0C/`X$Q$ep,Ap,',A', 4A,A  P( x( 4X xAȰ  Ӣ  &ҲJ   Ң  ( 4nA  ? 4A(x  w p DA$PA0P , 
!4y  &B0PA 
B0DA) 0lA9 0ӽ	;#Ƞ  &1ҩC  09 0" 0Aږ-A#MP&AXY ,]D PMPC | P	w P (( lAp $P X=P8 X P XP X$P XM(PH PxC Xx%QQ]pXh Pm(X P$$PeAjX=	LX P  X  #<X !XK PG ,YjAXX C04$PeAXm	dX P  X<  #>X\ &QX P ,X Xj  A$`Ab$`AƚX PXH PM XX P]x 8 P=Xmp` B0 h At#: 0L&ZlA$1Q=pX$&P Ƞ ,Ә l&ҨI  lҘ lH lX l
EPM$`Ph  lPX=P=$P X&P$Q J  @ ,#2"X]Xh 'ae  Q X Z 5   P<  U#3C X	LX  P ȭ	 P   ,$`At' , LAmAXŐnC0BXM	dXT  PX ]	 PT  PX Xe  #>XU &QX X< P7 ,Xl  A L$`AH\#&@\#7X`Ơ P`A%[(T$P$$@PM(Aь$`AĨ$`AXh A$PP]]p$aAѸA$`mtXl#3ARAΌA=P3!2"$Qm PAX`ð #3ApC |  "#Vw P (p 0P P q ,PxpX   <8P=XP=|sp$  stW $AI  sX$ae  P Xt   PXpPK PMPPMHT P]Hd Pms 

LPMPPP9  $PmAX=ȳPP=H .Š B0<%@\$@PH TPH XXX DPX \Xh HPh `] h 4Av]  h TAvA$`AFP p tp,h lAZP,XXP|X=P  X P$$P(P$PpPXIPMX]	Y!	T#'PZAXmh!` #($`PmhHA$&PZ$0P<  X  =' ,A' L APAH\#3AʹC Lq ,%PH .Ő!7@ .@.@H 8HX .ZB0h-t 8AӢ PŠ .C00$P 8Š ?!5 P 8Xh 4Ph <h lPh 4r ,  q ,$P 4$1P8 8P <r ,  q ,XXP|XP  H\#3AAXH#4AX]`P @#5h lA.C Viord(parm fm)    P, Q
 & 583        %integer            key
 & 584  
 & 585        FDp == Out Stream(Stream)
 & 586        Key =  FDp_key
 & 587        %if Stream = 0 %then out stream(stream) == tt out FD %c
 & 588+                      %else out stream(stream) == null FD
 & 589        Select output(stream) %if stream = out str
 & 590  
 & 591        %if Key # 0 %start                 {File}
 & 592           {File also open on another stream? don't close}
 & 593           %return %if FDp == Out Stream(0) %or
 & 594+                      FDp == Out Stream(1) %or
 & 595+                      FDp == Out Stream(2) %or
 & 596+                      FDp == Out Stream(3)
 & 597           FD = FDp
 & 598           Release FD (FDp)
 & 599  
 & 600           %if FD_Ptr ## FD_Buf %or        {Buffer n                
                                 $       $ *       *" 0       0& 6       6* <       <. B       B2 H       H6 N       N: T       T> Z       ZB `       `F f       fJ l       lN r       rR x       xV ~       ~Z        ^        b        f        j        n 3.1:B          
   <         SUBSYS:STANDARD   SUBSYS:STANDARD  	Command: ANDARD   Command: ANDARD Command              xhhX                                                                                                                                                                                                                                                                                                                                                                                                                                                                        H                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              	T$                  	l                  	                                                  	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        h                                                                                                                                                                                                                                                                                                                                                                                          hX                                                                                                                                                                                                                                                                                                    0ose file?ress        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               @COMoom for definition of tics           econds CPU definition of tics         k        	9    
               	                                                                      T:Oonds CPU definition T:Oonds CPU defymbol(':')
 & 102        %else
 & 103           space %if from&15 = 0
 & 104        %finish
 & 105        space
 & 106        %unless valid(from, 4) %start
 & 107           newline
 & 108           printstring("Invalid address");  newline
 & 109           %return
 & 110        %finish
 & 111        phex(integer(from), 8)
 & 112        size = size-4
 & 113        from = from+4
 & 114     %repeat
 & 115     newline
 & 116  %end
 & 117  %systemroutine DUMP CONTINGENCY(%reco H?   D D                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %ownstring(7) proc = "direct";  %owninteger sno = 2, stack  = 4
!===================================================================== !
!                       P1      P2      P3      P4      P5      P6     !
!===================================================================== !
!  1: unit name         unit no -       -       -       -       -      !
!  2: create            -       -       name1   name2   size           !
!  3: extend            -       -       -       -       key     mod    !
!  4: open input        unit    owner   name1   name2   -       -      !
!  5: open output       -       -       name1   name2   -       -      !
!  6: open da           unit    owner   name1   name2   read    -      !
!  7: read              -       -       -       buffer  key     -      !
!  8: write             -       -       -       buffer  key     -      !
!  9: read da           -       -       -       buffer  key     block  !
! 10: write da          -       -       -       buffer  key     block  !
! 11: close             -       -       -       -       key     -      !
! 12: reset             -       -       -       -       key     -      !
! 13: abandon           -       -       -       -       key     -      !
! 14: delete            -       -       name1   name2   -       -      !
! 15: rename            -       -       old1    old2    new1    new2   !
! 16: purge             -       -       -       -       -       -      !
! 17: files             unit    owner   -       -       -       buffer !
! 18: status            unit    owner   name1   name2   -       -      !
! 19: info              -       -       -       -       key     -      !
! 20: catalog           unit no -       -       -       -       -      !
! 21: find user         unit    user    -       -       -       -      !
! 22: set file access   -       -       name1   name2   -       access !
! 23: set password      -       -       password-       -       -      !
! 24: set dir access    -       -       -       -       -       access !
! 25: unique file       -       -       -       -       -       -      !
! 26: user info         unit    user    -       -       -       -      !
! 27: become            unit    owner   pass    -       -       -      !
! 28: exchange          -       -       old1    old2    new1    new2   !
! 29: identify          process -       -       -       -       -      !
! 30: archive           -       -       name1   name2   -       -      !
!=====================privileged=======================================!
! 31: new user          unit    user    password-       -       -      !
! 32: exile user        unit    user    -       -       -       -      !
! 33: statistics        -       -       -       -       -       -      !
! 34: receive           -       user    from1   from2   to1     to2    !
! 35: open input        unit    owner   name1   name2   -       process!
! 36: logon             unit    user    password-       -       process!
! 37: logoff            -       -       -       -       -       process!
! 38: load              unit no -       -       -       -       -      !
! 39: unload            unit no -       -       -       -       -      !
! 40: unit name         unit no -       -       -       -       -      !
! 41: set user access   unit    user    -       -       -       access !
! 42: force load        unit    volid   -       -       -       -      !
! 43: set page unit     unit    -       -       -       -       -      !
! 44: protect           unit    on/off  -       -       -       -      !
! 45: find unit         unit    -       -       -       -       -      !
! 46: clear used bit    unit    user    name1   name2   -       -      !
! 47: rename user       unit    user    -       newuser -       -      !
!======================================================================!
%control 0

! configuration parameters

%constinteger H   = x'0000FFFF'
%constinteger default permission = b'01001000';   !DG
%constinteger special access = b'00001000';        !D
%constinteger used bit = x'8000', arch bit = x'4000'
%constinteger temp = x'80000000'
%constinteger free list block = 300
%constinteger users           = 301
%constinteger processes = 31

%constinteger max dirs = 5;       ! user directorys in store
%constinteger max refs = 70;      ! active file references
%constinteger max bufs =  10;      ! spine buffers in store
%constinteger increment = 50;     ! sequential output file block increment
%constinteger max unit  = 12;      ! no. of disc units available

%constinteger  oper = 3;           ! service no. of 'oper:'

! replies: -   1  : last block
!          -   0  : success
!          -  -1  : file does not exist
!             -2  : file already exists
!             -3  : no access
!             -4  : input ended
!             -5  : output exceeded
!             -6  : block does not exist
!             -7  : unknown user
!             -8  : illegal file/user name
!             -9  : wrong mode
!             -10 : directory full
!             -11 : corrupt file
!             -12 : file system full
!             -13 : invalid reference
!             -14 : disc full
!             -15 : illegal request
!             -16 : unknown device
!             -17 : disc protected

%begin
   %constinteger  last d = 47
   %switch d(1:last d)
   %integer spine, size, j, k

%owninteger xsno, xact
%owninteger free list = 0
%owninteger use = 0
%owninteger error = 0
%owninteger found = 0
%owninteger dact = 0
%owninteger keys = 0
%owninteger priv = 0
%owninteger user id;                  !id of requesting process
%owninteger user directory;           !directory of requesting process
%owninteger user unit
%owninteger user access
%owninteger owner id;                 !id of file's owner
%owninteger owner directory;          !directory of file's owner
%owninteger owner unit, this unit
%owninteger current dir, last dir
%owninteger request owner, request process
%owninteger process = 0
%owninteger page unit = 0
%recordformat parmfm(%shortinteger dsno, dact, ssno, sact, %c 
                    %integer p1, p2, p3, p4, p5, p6)
%recordformat filefm(%integer name1, name2, %c
                     %shortinteger spine, day)
%recordformat dirfm(%shortinteger files, %c
                    %byteinteger access, check, %c
                    %shortinteger chain, %c
                    %byteinteger spare, daccess, %c
                    %record(filefm)%array file(1:42))
%recordformat reffm(%integer key,funit,fowner, name1, name2, from, to, %c
                    %shortinteger index, spine, size, block, unit, %C
                                  directory, process)
%recordformat blockfm(%shortinteger size, addr)
%recordformat freefm(%shortinteger last, %c
                     %byteinteger access, check, %c
                     %integer size, %c
                     %record(blockfm)%array b(1:126))

%recordformat ufm(%byteinteger unit, access, %c
                  %shortinteger directory, %integer id)
%ownrecord(ufm)%array user(0:processes)
%ownrecord(dirfm)%array dirs(1:max dirs)
%ownshortintegerarray dirblock(1:max dirs)
%ownshortintegerarray dirunit(1:max dirs)
%ownintegerarray dirpos(1:max dirs)
%ownrecord(reffm)%array refs(1:max refs)
%ownrecord(freefm)%array bufs(1:max bufs)
%ownshortintegerarray bufads(1:max bufs)
%ownshortintegerarray bufunit(1:max bufs)
%ownintegerarray bufpos(1:max bufs)
%ownrecord(dirfm)%name dir, new dir
%ownrecord(reffm)%name ref
%ownrecord(filefm)%name file, old, new file
%ownrecord(parmfm) p, rp
%ownrecord(freefm) free
%ownrecord(freefm)%name block
%ownintegerarray devs(1:max unit) 
%ownshortintegerarray unitx(1:max unit)
%ownshortinteger uhead = 1
%ownbyteintegerarray prot(0:max unit)
%ownshortintegername rblock, rdir;      !memory of last block
%ownstring(23) mess

%string(3)%fn itos(%integer n)
   %string(3) s
   s = ""
   s = "1" %and n = n-10 %if n > 9
   s = s.tostring(n+'0')
   %result = s
%end
%routine report(%string(23) s)
   %record(parmfm) p
   string(addr(p_p1)) = s
   p_dsno = 0;    !tell oper
   svc(120, p)
%end
%routine set error
   %switch e(-17:0)
   ->e(error) %if -17 <= error <= 0
       string(addr(rp_p1)) = "unknown fault";               ->OUT
e(-1): string(addr(rp_p1)) = "file does not exist";         ->OUT
e(-2): string(addr(rp_p1)) = "file already exists";         ->OUT
e(-3): string(addr(rp_p1)) = "access restricted";           ->OUT
e(-4): string(addr(rp_p1)) = "input ended";                 ->OUT
e(-5): string(addr(rp_p1)) = "output exceeded";             ->OUT
e(-6): string(addr(rp_p1)) = "invalid block";               ->OUT
e(-7): string(addr(rp_p1)) = "unknown user";                ->OUT
e(-8): string(addr(rp_p1)) = "illegal name";                ->OUT
e(-9): string(addr(rp_p1)) = "wrong mode";                  ->OUT
e(-10):string(addr(rp_p1)) = "directory full";              ->OUT
e(-11):string(addr(rp_p1)) = "corrupt file";                ->OUT
e(-12):string(addr(rp_p1)) = "file system full";            ->OUT
e(-13):string(addr(rp_p1)) = "invalid reference";           ->OUT
e(-14):string(addr(rp_p1)) = "disc full";                   ->OUT
e(-15):string(addr(rp_p1)) = "illegal request";             ->OUT
e(-16):string(addr(rp_p1)) = "unknown device";              ->OUT
e(-17):string(addr(rp_p1)) = "disc protected"
out:rblock = -1;  rdir = -1;         !forget the store copy
    free list = -1
e(0):!careful not to overwrite p1-p5
    rp_p6 = error
%end
%routine read free list
   %record(parmfm) p
   %integer j, check, tries
   tries = 5
Again:
   %if free list # this unit %start
      p_sact = 1
      p_p1 = free list block
      p_p2 = addr(free)
      p_p3 = this unit
      p_p4 = 0
      svc(101, p)
      %if p_p1 # 0 %start
         report("cannot read free list")
         *0
      %finish
   %finish
! test checksum
   check = 0
   check = check+byteinteger(j) %for j = addr(free), 1, addr(free)+511
   %if check&255 # 0 %start
      report("Free list checksum")
      tries = tries-1;  ->again %if tries > 0
      free = 0;  !clear it???
   %finish
   free list = this unit
%end
%routine write free list
   %record(parmfm) p
   %integer j, check
   %if free list # this unit %start
      report("wrong free list")
      *0
   %finish
   ! compute checksum
   free_check = 0
   check = 0
   check = check+byteinteger(j) %for j = addr(free), 1, addr(free)+511
   free_check = -check
   p_sact = 2
   p_p1 = free list block
   p_p2 = addr(free)
   p_p3 = free list
   p_p4 = 0
   svc(102, p)
   %if p_p1 # 0 %start
      report("cannot write free list")
      *0
   %finish
%end
%routine read directory(%integer block)
   %record(parmfm) p
   %owninteger when = 0
   %integer d, min, minp
   current dir = block
   when = when+1
   min = when;  minp = 1
   %for d = 1, 1, max dirs %cycle
      %if dirblock(d)&h = block %and dirunit(d) = this unit %start
         dirpos(d) = when
         dir == dirs(d);  %return
      %finish
      %if min > dirpos(d) %start
         min = dirpos(d);  minp = d
      %finish
   %repeat
   dir == dirs(minp)
   dirpos(minp) = when
   p_sact = 1
   p_p1 = block
   p_p2 = addr(dir)
   p_p3 = this unit
   p_p4 = 0
   svc(101, p)
   %if p_p1 # 0 %start
      report("directory read fails")
      *0
   %finish
   dirblock(minp) = block;  dirunit(minp) = this unit
   rdir == dirunit(minp)
%end
%routine write directory
   %record(parmfm) p
   %if Dir_Files > 42 %start
      Dir_Files = 42
      Report("Directory files?")
   %finish
   p_sact = 2
   p_p1 = current dir
   p_p2 = addr(dir)
   p_p3 = this unit
   p_p4 = 0
   svc(102, p)
   %if p_p1 # 0 %start
      report("directory write fails")
      *0
   %finish
%end
%routine read block(%integer add)
   %record(parmfm) p
   %owninteger when = 0
   %integer n, min, minp
   when = when+1
   min = when;  minp = 1
   %for n = 1, 1, max bufs %cycle
      %if bufads(n)&h = add %and bufunit(n) = this unit %start
         bufpos(n) = when
         block == bufs(n);  %return
      %finish
      %if min > bufpos(n) %start
         min = bufpos(n);  minp = n
      %finish
   %repeat
   block == bufs(minp)
   bufpos(minp) = when
   p_sact = 1
   p_p1 = add
   p_p2 = addr(block)
   p_p3 = this unit
   p_p4 = 0
   svc(101, p)
   %if p_p1 # 0 %start
      %if add = 0 %and p_p1 = -1 %start;     !special for director
         error = -1;  %return
      %finish
      report("block read fails")
      *0
   %finish
   bufads(minp) = add;  bufunit(minp) = this unit
   rblock == bufunit(minp)
%end
%routine write block(%integer add)
   %record(parmfm) p
   p_sact = 2
   p_p1 = add
   p_p2 = addr(block)
   p_p3 = this unit
   p_p4 = 0
   svc(102, p)
   %if p_p1 # 0 %start
      report("block write fails")
      *0
   %finish
%end
%routine read user block(%integer block, buffer)
   %record(parmfm) p
   p_sact = 1
   p_p1 = block
   p_p2 = buffer
   p_p3 = this unit
   p_p4 = request process
   svc(101, p)
   error = p_p1
%end
%routine write user block(%integer block, buffer)
   %record(parmfm) p
   p_sact = 2
   p_p1 = block
   p_p2 = buffer
   p_p3 = this unit
   p_p4 = request process
   svc(102, p)
   error = p_p1
%END
%routine inform load(%integer spine)
      !tell load to forget the file at 'spine'
      %record(parmfm) p
      p_dsno = x'43';  p_dact = 4
      p_p1 = spine+owner unit<<16
      p_sact = 0;                  !no reply wanted
      svc(115, p)
%end
%integerfn disc status(%integer unit)
   %record(parmfm) p
   %result = 7 %unless 0 < unit <= max unit
   p_p3 = unit;  svc(108, p)
   %result = p_p6
%end
%routine load(%integer unit)
   %string(7)%name disc id
   %string(7) text
   %integer status
   %record(parmfm) p
   error = -16 %and %return %unless 0 < unit <= max unit  %c
                            %and unit # page unit
   this unit = unit
   %if devs(unit) # 0 %start
      report("Unit ".itos(unit)." not unloaded");  error = -15;  %return
   %finish
   status = disc status(unit)
   error = -3 %and %return %if status&3 # 0;   !not ready?
   read block(0)
   disc id == string(addr(block)+4)
   %if length(disc id) > 4 %start
bad:  error = -16
      %return
   %finish
   string(addr(p_sact)) = disc id.":"
   svc(17, p);              !pack the name
   ->bad %if p_p2 <= 0
   %for j = 1, 1, max unit %cycle
      %if devs(j) = p_p2 %and j # unit %start
         mess = "Duplicate ".disc id;  report(mess)
         error = -16
         %return
      %finish
   %repeat
   devs(unit) = p_p2
   mess = disc id."    "
   length(mess) = 4
   text = mess;  length(text) = 3;  !first 3 chars
   mess = mess." on unit ".itos(unit)
   %if status&4 # 0 %or text = "SYS" %start
      mess = mess."-prot"
      p_p1 = unit;  p_p2 = 1;  svc(125, p);   !protect it
      prot(unit) = 1
   %finish
   report(mess)
   read free list
   report(disc id." has lost blocks") %if free_last # 0
%end
%routine unload(%integer unit)
   %integer j
   %record(parmfm) p
   error = -16 %and %return %unless 0 < unit <= max unit
   %for j = 1, 1, processes %cycle
      user(j)_unit = 0 %if user(j)_unit = unit
   %repeat
   %for j = 1, 1, max refs %cycle
      refs(j)_unit = 0 %if refs(j)_unit = unit
   %repeat
   %for j = 1,1,max dirs %cycle
      dirunit(j) = 0 %if dirunit(j) = unit
   %repeat
   %for j = 1,1,max bufs %cycle
      bufunit(j) = 0 %if bufunit(j) = unit
   %repeat
   p_p2 = devs(unit);  %return %if p_p2 = 0
   p_p1 = 0;  p_p3 = 0;  p_p4 = 0
   svc(18, p)
   mess = string(addr(p_sact))
   length(mess) = length(mess)-1 %unless mess = ""
   devs(unit) = 0
   report(mess." unloaded")
%end
%integerfn today
   %record(parmfm) p
   svc(19, p)
   %result = p_p4
%end
%routine claim(%integername size, new)
   %integer p, got, margin, help, helpgot
   %integer last
   margin = (size*3)>>1
   last = -1
   help = 0;  help got = 0
   %for p = 1, 1, 126 %cycle
      got = free_b(p)_size&h
      new = free_b(p)_addr&H
      %if new <= last %start
         free = 0
         report("Free list corrupt 2!")
         error = -14
         %return
      %finish
      last = new+got
      %if got >= size %start
         %if got <= margin %start
the lot:    size = free_b(p)_size&h
            new = free_b(p)_addr&h
            %while p # 126 %cycle
               free_b(p)_size = free_b(p+1)_size
               free_b(p)_addr = free_b(p+1)_addr
               p = p+1
            %repeat
            free_b(126)_size = 0
            free_b(126)_addr = 0
            %return
         %finish
         free_b(p)_size = free_b(p)_size-size
         free_b(p)_addr = free_b(p)_addr+size
         %return
      %finish
      help = p %and help got = got %if got > help got
   %repeat
   p = help %and ->the lot %if help # 0
   error = -14
%end
%routine release(%integer size, addr)
   %integer next, p, n, last
   %integer b, e, s, px, min, x

   size = size&H;  addr = addr&H;         !just in case
   %if size <= 0 %start
      report("Release zero size?")
      %return
   %finish
   last = 0
   next = addr+size

   %for p = 1,1,126 %cycle
      b = free_b(p)_addr&H
      s = free_b(p)_size&H
      %if s = 0 %start;         !end of list
         %if b # 0 %start
            report("Corrupt free list!")
            free = 0
         %else
            free_b(p)_addr = addr
            free_b(p)_size = size
         %finish
         %return
      %finish
      %if b <= last %start
         report("Free list order?")
         free = 0
         %return
      %finish
      e = b+s
      last = e


      %if b > addr %start;         !past the returned block
         ->over %if next > b
         %if next = b %start;      !append to the front
            free_b(p)_addr = addr
            free_b(p)_size = free_b(p)_size+size
            %return
         %finish
         !shuffle extents down
         min = 0;  n = 126
         %if free_b(126)_size # 0 %start;      !free list full
            !choose minimum to loose
            min = s;  px = 0
            %cycle
               x = free_b(n)_size&H
               %if x < min %start
                  min = x
                  px = n
               %finish
               %exit %if n = p
               n = n-1
            %repeat
            ->Lost %if px = 0
            n = px
         %finish
         %while n # p %cycle
            n = n-1
            free_b(n+1)_addr = free_b(n)_addr
            free_b(n+1)_size = free_b(n)_size
         %repeat
         free_b(p)_addr = addr
         free_b(p)_size = size
lost:    report("Disc blocks lost") %if min # 0 %and free_last = 0
         free_last = free_last+min
         %return
      %finish
      ->over %if addr < e
      %if addr = e %start;         !append on end
         s = s+size
         free_b(p)_size = s
         e = b+s
         %return %if p = 126;      !nothing following
         addr = free_b(p+1)_addr&H
         ->over %if addr < e
         %return %if addr # e
         free_b(p)_size = free_b(p)_size+free_b(p+1)_size
         %while p # 126-1 %cycle
            p = p+1
            free_b(p)_size = free_b(p+1)_size
            free_b(p)_addr = free_b(p+1)_addr
         %repeat
         free_b(126)_size = 0
         free_b(126)_addr = 0
         %return
      %finish
   %repeat
over:
   report("Free list overlap!")
   report("**Tidy the disc**")
%end
%routine create spine(%record(filefm)%name f)
   %integer size, addr
   read free list
   size = 1
   claim(size, addr);  %return %if error # 0
   f_spine = addr
   read block(addr)
   block = 0;  block_check = '?';  block_access = user access
   write block(addr);  write free list
%end
%routine destroy spine(%integer spine, mode)
   %integer n, P
   inform load(spine)
   read block(spine);  read free list
   n = block_last;  P = 0
   %unless 0 <= n <= 126 %and block_check = '?' %start
      error = -11;  %return
   %finish
   %while p # n %cycle
      p = p+1
      release(block_b(p)_size&h, block_b(p)_addr&h)
   %repeat
   %if mode = 0 %start
      block = 0
      block_check = '?'
      write block(spine)
   %else
      release(1, spine)
   %finish
   write free list
%end
%routine find user(%record(parmfm)%name p)
   %shortintegername pt
   %integer j, u, all
   all = 1
   u = p_p1
   %if u # 0 %start
      all = 0
      this unit = 0
      %for j = 1, 1, max unit %cycle
         %if devs(j) = u %start
            u = j
            this unit = j;  %exit
         %finish
      %repeat
      error = -16 %and %return %if this unit = 0
   %else
      pt == uhead;  this unit = uhead
   %finish
   error = -8 %if p_p2 = 0
   %cycle
      %if devs(this unit) # 0 %start;      !device loaded
         read directory(users)
         %for j = 1, 1, 42 %cycle
            %if dir_file(j)_name1 = p_p2 %start
               file == dir_file(j)
               owner id = p_p2
               owner directory = file_spine&h
               owner unit = this unit
               %return %if all = 0
                  u = unitx(pt);  pt = u;      !unchain it
                  unitx(this unit) = uhead;  uhead = this unit
               %return
            %finish
         %repeat
      %finish
      %exit %if all = 0
      pt == unitx(this unit);  this unit = pt
      %exit %if this unit = 0
   %repeat
   error = -7
%end
%routine get directory(%record(parmfm)%name p)
   %if p_p2 # 0 %start
      find user(p)
      %return %if error # 0
   %finish
   read directory(owner directory)
%end
%routine find free
   %for found = 1, 1, max refs %cycle
      %if refs(found)_key = 0 %start
         ref == refs(found);  ref = 0;  %return
      %finish
   %repeat
   error = -12
%end
%routine validate(%record(parmfm)%name p, %integer mask)
   %integer index, key
   key = p_p5
   index = key>>24
   error = -13
   %if 0 < index <= max refs %start
      ref == refs(index)
      %if ref_key = key %start
         this unit = ref_unit
         error = 0
         error = -9 %if key&mask = 0
         error = -3 %if ref_process # request process
      %finish
   %finish
%end
%routine establish(%integer n1, n2, mode)
   %record(filefm)%name zf
   %integer n, z
   error = -8 %and %return %if n2 = 0
   z = 0
   %for n = 1, 1, 42 %cycle
      file == dir_file(n)
      %if file_name2 = 0 %start;    ! free slot
         z = n;  zf == file
      %else %if file_name1 = n1 %and file_name2 = n2 %start
         error = -2 %if mode = 0       
         %return  
    %finish
   %repeat
   %if mode = 0 %start;             ! new file
      %if z = 0 %then error = -10 %else file == zf
   %else
      error = -1;                   ! doesn't exist
   %finish
%end
%routine extend(%integer size)
   %integer new
   %if block_last = 126 %start;      ! spine full
      error = -5;  %return
   %finish
   claim(size, new);  %return %if error # 0
   ref_size = size;  ref_block = new
   ref_from = 0;  ref_to = -1;  ref_index = 0
   %if block_last # 0 %and %c
             (block_b(block_last)_addr+block_b(block_last)_size)&h = new %start
      block_b(block_last)_size = block_b(block_last)_size+size
   %else
      %if block_last = 126 %start;  ! spine full
         error = -5
         release(size, new)
         %return
      %finish
      block_last = block_last+1
      block_b(block_last)_size = size
      block_b(block_last)_addr = new
   %finish
   block_size = block_size+size
%end
%routine remove(%integer n1, n2, n3)
   %integer j
   %for j = 1, 1, max refs %cycle
      %if refs(j)_name1 = n1 %and refs(j)_name2 = n2 %start
         %if refs(j)_directory&H = n3 %and refs(j)_unit = this unit %start
            refs(j) = 0
         %finish
      %finish
   %repeat
%end
%routine delete(%integer n1, n2)
   error = -17 %and %return %if prot(owner unit) # 0
   establish(n1, n2, 1);  %return %if error # 0
   read block(file_spine&h)
   error = -3 %and %return %if block_access&8 = 0 %and priv = 0
   file_name1 = 0;  file_name2 = 0
   dir_files = dir_files-1
   destroy spine(file_spine&h, 1)
%end
%routine close(%integer id)
   %integer size, n1, n2, extra, new
   %record(filefm)%name this
   n1 = ref_name1;  n2 = ref_name2;  extra = ref_size
   ref_key = 0;  ref_name2 = 0
   %if id&2 # 0 %start;     ! output file
      error = -17 %and %return %if prot(this unit) # 0
      read directory(user directory);  %return %if error # 0
      establish(n1, n2, 1)
      %if error = 0 %start
         read block(file_spine&h)
         %if extra # 0 %start
            size = block_b(block_last)_size&h
            %if size >= extra %start
               read free list
               release(extra, (block_b(block_last)_addr+size-extra)&h)
               block_size = block_size-extra
               block_b(block_last)_size = size-extra
               %if block_b(block_last)_size = 0 %start
                  block_last = block_last-1
               %finish
               write block(file_spine&h);  write free list
            %finish
         %finish

         this == file
         new = n1<<1>>1;                      !drop temp bit
         %if block_last = 0 %start;           !empty
            extra = file_spine&h
            file_name1 = 0;  file_name2 = 0
            Dir_Files = Dir_Files-1
         %else;                               !not empty
            establish(new, n2, 1);            !look for old version
            %if error = 0 %start;             !found it
               extra = file_spine&h
               read block(extra)
               error = -3 %and %return %if priv = 0 %c
                          %and (block_access!user access)&8 = 0
               file_name1 = 0;  file_name2 = 0; !delete it
               dir_files = dir_files-1
            %finish
            this_name1 = new
         %finish
         write directory
         destroy spine(extra, 1) %if error = 0
         error = 0

      %finish
   %finish
%end
%routine find block(%integer b)
   %integer index, to, from, limit
   %unless 0 <= b < block_size&h %start
no:   error = -6;  %return
   %finish
   index = ref_index;  limit = block_last
   from = ref_from;  to = ref_to
   %cycle
      %if b > to %start
         index = index+1;  ->no %if index > limit
         from = to+1;  to = to+block_b(index)_size&h
         %exit %if to >= b
      %else
         index = index-1;  ->no %if index <= 0
         to = from-1;  from = from-block_b(index)_size&h
         %exit %if from <= b
      %finish
   %repeat
   ref_index = index
   ref_to = to;  ref_from = from
   ref_block = block_b(index)_addr&h
%end
%integerfn unique ext
   %byteintegerarray used(1:43)
   %integer j, x
   used(j) = 0 %for j = 1, 1, 43
   %for j = 1, 1, 42 %cycle
      x = dir_file(j)_name2&x'0000FFFF';    !pick off ext
      used(x) = 1 %if 0 < x <= 43
   %repeat
   %for j = 1, 1, 42 %cycle
      %result = j %if used(j) = 0
   %repeat
   %result = 43
%end

   %for j = 1,1,max unit %cycle
      devs(j) = 0
      unitx(j) = j+1
   %repeat
   unitx(max unit) = 0
   free list = 0
   refs(j)_key = 0 %for j = 1, 1, max refs
   dirblock(j) = 0 %and dirunit(j) = 0 %for j = 1,1,max dirs
   bufads(j) = 0 %and bufunit(j) = 0 %for j = 1, 1, maxbufs
   rdir == dirunit(1);  rblock == bufunit(1)
   %cycle
      p_sact = 0
      svc(16, p);                ! poff
      xsno = p_ssno;  xact = p_sact
      error = 0;  process = 0;               ! system service
      process = p_ssno&31 %if p_ssno > 64;   ! user process
      priv = p_dact&x'8000'
      dact = p_dact&255
      %unless 0 < dact <= last d %start
         error = -15
      %finish
      request process = process
      request owner   = user(process)_id

more: user id         = user(process)_id
      user directory  = user(process)_directory&H
      user unit       = user(process)_unit
      user access     = user(process)_access
      owner id        = user id
      owner directory = user directory
      owner unit      = user unit
      this unit       = user unit;            !by default
      %if process > 3 %start;                 !user request
         error = -7 %if owner unit = 0
         error = -15 %if dact > 30 %and priv = 0
      %finish
      ->d(dact) %if error = 0

Out:  set error
      rp_sact = 0
      rp_dsno = xsno;  rp_dact = xact
      svc(115, rp)
      %continue

D(2):!create
      error = -17 %and ->out %if prot(owner unit) # 0
      error = -5 %and ->out %if p_p5 <= 0
      find free;  ->out %if error # 0
      read directory(user directory)
      error = -8 %if p_p4 = 0
      establish(p_p3, p_p4, 0);  ->out %if error # 0
      read free list
      user access = default permission
      create spine(file);  ->out %if error # 0
      %cycle
         extend(p_p5)
         %if error # 0 %start
            destroy spine(file_spine&h, 1)
            ->out
         %finish
         p_p5 = p_p5-ref_size&h
         %exit %if p_p5 <= 0
      %repeat
      file_name1 = p_p3;  file_name2 = p_p4;  file_day = today!used bit
      dir_files = dir_files+1
      write free list
      write block(file_spine&h) 
      write directory
      ->set status

D(3):!extend
      error = -17 %and ->out %if prot(owner unit) # 0
      error = -9 %and ->out %if p_p5&8 = 0
      validate(p, 12)
      error = -13 %if ref_process #  request process
      ->out %if error # 0
      read block(ref_spine&h);  read free list
      ref_index = 0;  ref_from = 0;  ref_to = -1
      error = -11 %and ->out %unless block_check = '?'
      %if p_p6 > 0 %start;              !increase
         %cycle
            extend(p_p6);  %exit %if error # 0
            p_p6 = p_p6-ref_size&h
            %exit %if p_p6 <= 0
         %repeat
         write free list;  write block(ref_spine&h)
      %else
         j = block_last;  k = -p_p6
         block_size = block_size-k
         error = -6 %and ->out %if block_size < 0
         %cycle
            %exit %if j = 0 %or block_b(j)_size&h >= k
            k = k-block_b(j)_size&h
            release(block_b(j)_size&h, block_b(j)_addr&h)
            j = j-1
            block_last = j
         %repeat
         %if j # 0 %start
            block_b(j)_size = block_b(j)_size&h-k
            release(k, (block_b(j)_addr+block_b(j)_size)&h)
            j = j-1 %and block_last = j %if block_b(j)_size = 0
         %finish
         write block(ref_spine&h);  write free list
      %finish
      ->Set Status

D(35):!open input (other process)
      dact = 4
      %if p_p2 = 0 %start
         process = p_p6
         error = -15 %and ->out %unless 0 < process <= processes
         ->more
      %finish
      ->d4

D(5):!open output
      error = -15 %and ->out %if p_p1!p_p2 # 0
      p_p1 = 0;  p_p2 = 0;        !must be to own directory

D4:

D(4):!open input
D(6):!open da
      p_p2 = 0 %if p_p2 = user id %and p_p1 = user unit
      get directory(p);  ->out %if error # 0
      %if dir_access&special access # 0 %and p_p2 # 0 %start
         error = -3;  ->out
      %finish
      %if p_p4 = 0 %start;                            !bum filename
         error = -8;  ->out
      %finish
      p_p3 = p_p3!temp %if dact = 5
      k = 1<<(dact-4)
      %if K = 4 %and P_P5 # 0 %start;                 !da output
         %if User Id = Owner Id %or Priv # 0 %start;  !permit write
            K = 12
            K = 12 ! 16 %if P_P5 < 0;                 !permit auto-extend
         %finish
      %finish
      find free;  ->out %if error # 0;                !no free slot
      establish(p_p3, p_p4, dact-5);                  !look for the file
      ->out %if error # 0
      %if dact = 5 %start;                            !create output file
         error = -17 %and ->out %if prot(owner unit) # 0
         read free list
         user access = default permission
         create spine(file);  ->out %if error # 0
         file_name1 = p_p3;  file_name2 = p_p4;  file_day = today
         dir_files = dir_files+1
      %else
         read block(file_spine&h)
         Rp_P1 = Block_Size&H
         Rp_p2 = block_access
         %if user id # owner id %start
            %if user access&block_access = 0 %and priv = 0 %start
               error = -3;  ->out
            %finish
         %finish
         inform load(file_spine&h) %if k&8 # 0;    !Writable da file
      %finish
      keys = keys+32
      ref_key = keys&x'00FFFFE0'!found<<24!k
      ref_fowner = p_p2
      ref_name1 = p_p3;  ref_name2 = p_p4
      ref_directory = owner directory;  ref_unit = owner unit
      ref_spine = file_spine&h
      ref_process = request process
      Rp_p3 = ref_spine&h+owner unit<<16
      file_day = file_day!used bit %if dact # 4
      ref_index = 0;  ref_from = 0;  ref_to = -1
      write directory %if prot(this unit) = 0
      Rp_p5 = ref_key;  Rp_p4 = file_day&h
      ->out

D(7):!read
      validate(p, 1) ;  ->out %if error # 0
      %if ref_size = 0 %start
         read block(ref_spine&h)
         error = -11 %and ->out %unless block_check = '?'
         ref_to = block_last
         %if ref_from = block_last %start;        !none left
            error = -4;  ->out
         %finish
         ref_from = ref_from+1
         ref_block= block_b(ref_from)_addr&h
         ref_size = block_b(ref_from)_size&h
         error = -11 %and ->out %if ref_size = 0
      %finish
      read user block(ref_block&h, p_p4)
      ref_block = ref_block+1
      ref_size = ref_size-1
      error = 1 %if ref_size = 0 %and ref_from = ref_to; !last
      ->out

         %routine Stretch
            Read free list
            Read Block(Ref_Spine&H)
            Error = -11 %and %return %if Block_Check # '?'
            Extend(Increment);  %return %if Error # 0
            Write Free List
            Write Block(Ref_Spine&H)
         %end

d(8):!write
      validate(p, 2);  ->out %if error # 0
      error = -17 %and ->out %if prot(owner unit) # 0
      %if ref_size = 0 %start;           !this extent full
         Stretch
         ->out %if error # 0
      %finish
      write user block(ref_block&H, p_p4)
      ref_block = ref_block+1
      ref_size = ref_size-1
      ->out

D(9): ! read da
D(10):!write da
      validate(p, (dact-8)<<2);  ->out %if error # 0
      %unless ref_from <= p_p6 <= ref_to %start
         read block(ref_spine&h)
         error = -11 %and ->out %unless block_check = '?'
         %if P_P6 = Block_Size&H %and Dact = 10 %and %c
                                      Ref_Key&16 # 0 %start;      !auto extend
            Stretch;  ->Out %if Error # 0
         %finish
         find block(p_p6);  ->out %if error # 0
      %finish
      k = (ref_block+p_p6-ref_from)&H
      %if dact = 9 %start
         read  user block(k, p_p4)
      %else
         error = -17 %and ->out %if prot(owner unit) # 0
         write user block(k, p_p4)
      %finish
      ->out

D(11):!close
      validate(p, 15)
      close(p_p5) %if error = 0
      ->out

D(12):!reset
      validate(p, 15);  ->out %if error # 0
      %if p_p5&2 # 0 %start
         %if prot(owner unit) # 0 %then error = -17 %c
                                  %else destroy spine(ref_spine&h, 0)
      %finish
      ref_size = 0;  ref_from = 0;  ref_to = -1
      ref_index = 0
      ->out

D(13):!abandon stream
      validate(p, 15);          !works on any type of file
      ref = 0 %if error = 0
      ->out

D(14):!delete
      read directory(user directory)
      delete(p_p3, p_p4)
      %if error = 0 %start
         write directory
         remove(p_p3, p_p4, owner id)
      %finish
      ->out

D(30):!archive
D(28): !exchange
D(15):!rename
      error = -17 %and ->out %if prot(owner unit) # 0
      read directory(user directory)
      establish(p_p3, p_p4, 1);  ->out %if error # 0
      %if dact = 30 %start
         file_day = file_day!arch bit
      %else
         old == file
         error = -8 %if p_p5 < 0 %or p_p6 = 0
         establish(p_p5, p_p6, 1)
         %if error = 0 %start;                     !new found
            error = -2 %and ->out %if dact = 15;   !rename
            file_name1 = p_p3
            file_name2 = p_p4
         %finish
         error = 0
         old_name1 = p_p5;  old_name2 = p_p6
      %finish
      write directory
      ->out

D(17):!files
      get directory(p);  ->out %if error # 0
      %if dir_daccess&user access = 0 %and user id # owner id %c
                                      %and priv = 0 %start
         error = -3;  ->out
      %finish
      rp_p1 = this unit;  rp_p2 = owner directory
      read user block(owner directory, p_p6)
      ->out

D(46):!clear used & arch bits
D(18):!status
      get directory(p);          ->out %if error # 0
      establish(p_p3, p_p4, 1);  ->out %if error # 0
      read block(file_spine&h)

Set Status:
      rp_p2 = block_size&h
      rp_p3 = block_last
      rp_p4 = block_access
      rp_p5 = file_day
      %if dact = 46 %start
         file_day = file_day & (\(used bit!arch bit) )
         %if prot(owner unit) # 0 %start
            error = -17
         %else
            write directory
         %finish
      %finish
      ->out

D(26):!user info
      get directory(p);  ->out %if error # 0
      rp_p1 = dir_access
      rp_p2 = dir_daccess
      rp_p3 = user access
      rp_p4 = dir_files
      rp_p5 = 42-dir_files;                     !file slots left
      ->OUT

D(19):!info
      validate(p, 15);  ->out %if error # 0
      Read Block(Ref_Spine&H)
      rp_p1 = devs(ref_unit)
      rp_p2 = ref_fowner
      rp_p2 = user(process)_id %if rp_p2 = 0
      rp_p3 = ref_name1
      rp_p4 = ref_name2
      rp_p5 = Block_Size&H
      ->out

D(20):!Read catalog (unit#)
      this unit = p_p1 %if 1 <= p_p1 <= max unit
      error = -16 %and ->out %if devs(this unit) = 0
      read user block(users, p_p6)
      ->OUT

D(21):!find user
      error = -8 %and ->out %if p_p2 <= 0
      find user(p);  ->out %if error # 0
      rp_p1 = p_p1
      rp_p2 = p_p2
      rp_p3 = file_name2;        !password
      rp_p4 = file_spine&h
      rp_p5 = file_day
      rp_p3 = 0 %if priv = 0;          !not for all eyes
      ->out

D(24):!set directory access
D(22):!set file access
      p_p1 = 0;  p_p2 = 0
      get directory(p);  ->out %if error # 0
      error = -17 %and ->out %if prot(owner unit) # 0
      %if dact = 24 %start;   !dir
         dir_daccess = p_p6
         write directory
      %else;                  !file
         establish(p_p3, p_p4, 1);  ->out %if error # 0
         read block(file_spine&h)
         block_access = p_p6
         write block(file_spine&h)
      %finish
      ->out

D(23):!set password
      p_p1 = devs(this unit)
      p_p2 = user(process)_id
      find user(p);  ->out %if error # 0
      error = -17 %and ->out %if prot(owner unit) # 0
      error = -8 %and ->out %if p_p3 <= 0
      file_name2 = p_p3
      write directory
      ->out

D(25):!get unique file
      read directory(owner directory)
      rp_p1 = 0
      rp_p2 = 0
      rp_p3 = 0
      rp_p4 = unique ext+22405<<16;      !que.?
      ->out

D(31):!new
      error = -8 %and  ->out %if p_p1 <= 0 %or p_p2 <= 0 %or p_p3 <= 0
      find user(p)
      error = -2 %and  ->out %if error = 0
      error = 0
      rp_p1 = p_p1;  rp_p2 = 0
      find user(rp);   ->out %if error # -8
      error = -17 %and -> out %if prot(owner unit) # 0;   ! disc protected ?
      error = 0
      user access = 1<<6;          !access=g
      create spine(file);  ->out %if error # 0
      file_name1 = p_p2
      file_name2 = p_p3
      file_day = p_p4
      write directory
      ->out

D(32):!exile
      error =  -8 %and ->out %if p_p2 <= 0 %or p_p1 <= 0
      find user(p);    ->out %if error # 0
      error = -17 %and ->out %if prot(owner unit) # 0
      file_name1 = 0;  file_name2 = 0
      write directory
      spine = file_spine&h
      read directory(spine)
      %for j = 1, 1, 42 %cycle
         file == dir_file(j)
         delete(file_name1, file_name2) %unless file_name2 = 0
         error = 0
      %repeat
      dir = 0
      destroy spine(spine, 1)
      ->out

D(47):!rename user
      error = -8 %and -> out %if p_p1 = 0 %or p_p2 <= 0 %or p_p4 <= 0
      rp_p1 = p_p1;  rp_p2 = p_p4;  find user(rp);      !look for new name
      error = -2 %and -> out %if error = 0
      error = 0
      find user(p);                                     !look for old name
      ->out %if error # 0
      file_name1 = p_p4
      write directory
      ->out

D(33):!spare
      ->out

D(34):!receive <***order to be changed in case of errors***>
      p_p1 = devs(this unit)
      find user(p);  ->out %if error # 0
      error = -15 %and ->out %if owner directory = user directory
      error = -17 %and ->out %if prot(owner unit) # 0
      read directory(owner directory);  ->out %if error # 0
      establish(p_p3, p_p4, 1);  ->out %if error # 0
      new dir == dir
      new file == file
      last dir = current dir
      read directory(user directory)
      establish(p_p5, p_p6, 0);  ->out %if error # 0
      file = new file;  new file_name2 = 0
      newdir_files = newdir_files-1
      file_name1 = p_p5;  file_name2 = p_p6
      dir_files = dir_files+1
      rp_p5 = file_day
      write directory
      dir == new dir;  current dir = last dir
      write directory
      ->out

D(27):!become
      error = -15 %and ->out %if p_p6 # 0 %and priv = 0
      p_p3 = -1 %if p_p3 = 0 %and priv = 0
      %if p_p2 = 0 %start;             !revert to owner
         rp_p1 = p_ssno&31;  svc(14, rp)
         p_p1 = rp_p1;  p_p2 = rp_p2
         p_p3 = 0;                     !password ok
      %finish

D(36):!log on
      process = p_p6;  process = p_ssno&31 %if process = 0
      error = -15 %and ->out %unless 0 < process <= processes
      error = -8 %and ->out %if p_p2 <= 0
      get directory(p);  ->out %if error # 0
      %if dir_access&special access # 0 %start
         error = -3 %and ->out %if dact = 27 %or p_p3 = 0
      %finish
      p_p3 = file_name2 %if p_p3 = 0
      error = -3 %and ->out %unless p_p3 = file_name2
      user(process)_directory = owner directory
      user(process)_unit      = this unit
      user(process)_access    = dir_access
      user(process)_id        = p_p2
      rp_p2 = this unit
      rp_p1 = devs(this unit)
      ->out

D(29):!identify user (by file system rather than process ID)
      process = p_p1 %if p_p1 # 0 %and priv # 0;    ! default to caller
      error = -15 %and ->out %unless 0 < process <= processes
      rp_p1 = devs(user(process)_unit)
      rp_p2 = user(process)_id
      rp_p3 = 0;  rp_p4 = 0
      error = -7 %if rp_p2 = 0;       ! any such user ?
      -> out

D(37):!log off
      process = p_p6
      user directory = user(process)_directory&H
      this unit      = user(process)_unit
      user id        = user(process)_id
      user(process)  = 0
      %for j = 1, 1, max refs %cycle
         refs(j) = 0 %if refs(j)_process = process
      %repeat

D(16):!purge
      error = -16 %and ->out %if this unit = 0;      !unloaded underneath
      error = -17 %and ->out %if prot(this unit) # 0
      %for j = 1, 1, processes %cycle
         %if user(j)_directory&h = user directory %start
            !more that one user - no purge ?
            error = -3 %and ->out %if j # process
         %finish
      %repeat
      rp_p1 = 0
      use = 0
      read directory(user directory)
      %for j = 1, 1, 42 %cycle
         %if dir_file(j)_name1&x'C0000000' # 0 %start
            delete(dir_file(j)_name1, dir_file(j)_name2)
            error = 0
            use = 1
            rp_p1 = rp_p1+1
         %finish
      %repeat
      write directory %if use # 0
      ->out

D(38):!load
D(40):!unit name
D(1): !Unprivileged alias for UNIT NAME
      error = -16 %and ->out %unless 0 < p_p1 <= max unit
      load(p_p1) %if dact = 38
      rp_p1 = devs(p_p1) %if error = 0
      rp_p2 = prot(p_p1)
      ->out

D(39):unload(p_p1);  ->out

D(41):!set user access
      get directory(p);  ->out %if error # 0
      p_p6 = p_p6!special access %if dir_access&special access # 0 %c
                                %and p_p2 # 0
      error = -17 %and ->out %if prot(owner unit) # 0
      dir_access = p_p6
      write directory
      ->out

D(42):!force load
      devs(p_p1) = p_p2
      report("Unit force-loaded")
      ->out

D(43):!set page unit
      error = -16 %and ->out %unless 0 <= p_p1 <= max unit
      page unit = p_p1
      p_dsno = x'43';  p_dact = 5;  svc(115, p);     !tell load
      %if page unit # 0 %start
         %if devs(page unit) # 0 %start
            report("Page unit busy")
            devs(page unit) = 0
         %finish
      %finish
      p_p1 = page unit;  svc(103, p)
      ->out
d(44):!protect device prot
      %if disc status(p_p1)&4 # 0 %or p_p2 # 0 %start
         p_p2 = 1
         report("Unit ".itos(p_p1)." write-protected")
      %finish
      prot(p_p1) = p_p2
      svc(125, p)
      ->out

D(45):!find unit
      %for j = 1, 1, max unit %cycle
         %if devs(j) = p_p1 %start
            rp_p1 = j;  ->out
         %finish
      %repeat
      error = -16
      ->out

   %repeat
%endofprogram
 H?   X X`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     @?   @   'k::     '+KWzC      0WzW   W  i   W:z        |     W       W:   hWz   @cWz      4Wz     mA    `Wz     %:!     %WzG     5WzP    cf  U      WzZ  k    k:   `{XG   0lO      0lO:	    iK      iK:_                                                                                                                                                                                                               Oq ȿ  _W  p@P ,	uq direct        /-\X@"@ !",",##2###-$%%&Z&&'&'%+#,B#(()* +l,-.4-.@../N/%)                                                                                                    *         ~                                                                                                                                                                                                                                                         E                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          F   ,                                                                                                                                                                                                                                                                                                                                                                                                    o                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                             
                             
                                                                                                                                                                                                                                                                                                         C jW  p 4~ B $ҹ ,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                direct  ` 	#*0 ) ,A'jPi &  ` 0f` @i 0) , 0A"H R y "k  W  p d) ,A̡Q r  ,) LA| B $`@i D r r	 D  xq	 D9 B y *          
       
 (     
 0+3      +"     0%3     4 s     8   *     <   +            8x     ,\ L  \     2,     $[      8d      ϙk      ڜ     )\   $ $\4\ 5\ Jn !\3X 2  	) 2#*d 2 қ 5Κ4 Jn %-c2M. $8l   %r.3 %r/3 %   5xp Jn/$Z5    /#Ȳ   +/ ʙ2    / 9m      )        .     ,   3    @  \ \2	r   4 ,   3    @   2Is + b W  p ,[d  Xm `!f!'
fsmF 0(
n  0*--DAxC \  08--DAhC \  0L--DAXC \  0`--DAHC \*  0r--DA8C \7  0~--DA(C \J  0--DAC \Y  0--DAC \j  0--DAC \{  0--DAC x\  0--DAC h\  0--DAC X\  0--DAC H\  0--DAC 8\  1--DAC (\  1--DA#  1 --DAz# r 10--DAl    Xm/%@  X]/@  F 2 P  R Xm Pm-X( B y *l b W  p \[ B $ePi T r Xm Um C0T B $@ 2R R P,PY 4 R ȭ-\P 8 2 Pi <V B $P @! r r	 ,  eq	 ,9 R Xi 4C0  Acannot read free listA "    B $`Pi P Ƚ-\ʰP X]-\'QPY LXi LUi X#9&aPi LӶ  Q P"y b ӹ SC02^  AFree list checksumiAg4 b %aQi TB :FF r --\  ATQP R Xm Pm T B y *Q b W  p X[ b Xm Um #>,.  Awrong free listAN6B "    B $`m-_ڥ 2 Pi P' Ƚ-\ʰP T]-\'QPY LXi LUi T#9&aPi LӶ  Q P"o b $[ Pҽ-_} B $R@Y 2 R Ƞ,P 4 R -\P 8 R XM PI <UL B $0P9 @  r r	 ,  fq	 ,9 R Xi 4C0" Acannot write free listA "    B y *: b W  p XZ 2 Pm ح B $Q1@W rX]1@PY PP T9 $P LXi L` C0l&aPi L/
f
mX sV*B02X EBB0& X L
XM1@PLX X9 L9
=  P-y p` X L
XXY P# rP PXI LPI T: 2
C ; X T
[  P]-C X T
X1@PX B$A@I 2 RX9 P9 4U 2PY 8- RX P <UW B$ P) @# rr	 ,  eq	 ,9 RXi 4C0 Adirectory read failssAW "   Xi T
f
mX @*X] @VBE  RȦBP/ By * bW  p LZ Xm-H  ɰ *C " RP *@V   ADirectory files?aA4 B $b@i 2 R!X P 4T
 R"X]-PY 8( R#X P <T$ B$$P @ r%r	 ,  fq	 ,9 R&Xi 4C0 'Adirectory write failsA? "(   B*y *
 b+W  p XZ B/$Q1DV r0X]1DPY PP T 1$P LXi L` 
C0l&aPi L/2
f
mX sV,B02X E,B0& 3X L
XM1DPL,؁ 4X9 L9
=P/\y Wi 6X L
X,Y P# r7P PXI LPI T 29C  :X T
[P]/\* ;X T
X1DP,؁3 B<$A@I 2 R=X9 P9 4U 2>PY 8 R?X P <U( B@$ P) @ rAr	 ,  eq	 ,9} RBXi 4C02l rCX !9`!6 bDPm y ؿ FAblock read failsfA "G   IXi T
f
mX @,X] @V, RJȦ,P/v BKy ) bLW  p LZ BN$@ 2 2OPi 4 RPX]/\PY 8& RQX P <S BR$P @ rSr	 ,  fq	 ,9j BTXi 4#? UAblock write failsA:+) "V   BXy ) bYW  p LZ B[$@ 2 2\Pi 4 2]PY 8 R^X P <S R_X P @S r`r	 ,  eq	 ,9^ RaXi 4Pm T Bby ) bcW  p LZ Be$@ 2 2fPi 4 2gPY 8 RhX P <S RiX P @S rjr	 ,  fq	 ,9S RkXi 4Pm T Bly ) bmW  p LZ pȰ C@ ,$T@Y .Z qX  
jPi 4[ Br$@ 2 rsr	 ,  sq	 ,9= Bty ) buW  p LZ~ wf#$` #%$y + xPi <r	 ,  lq	 ,z byX Hy : b{W  p\Xhf#'` !$Um !8ȰP y E 2Pm ԭ
 rb
mX/hC0>Xi A) \A1H' ,A \A1NAA%oPm y  rXi ALP 8}  #7%cPm y ̏ B$`Aʛ rXm/\ȶ P ,\ b[  P #(>< R`Pm  By ) ) BAP1\Aa rr	 <  q	 <9c RXi HC b $P 8Xo 8` C0N&aPo 8/\ b
mX HU/hB04XY U_ 8C0( 1^-/AX ,A(A R`Pm  By ) 2C  X 
XY HP[/hE X ,-/A1jA/ B$dm/j ) 0A$SY 0Nk2Xi Aj)\A-/1pA\A/ si :` !9 0-1zAB028 r-/1~A$3 Xi Pi D$P Hr	 <  }q	 < rXi 
m$Ҷ/s R/ADB 2AHm-\#>X ,' ,A1A@A ; By )@ &r)Yr L   *     P+Z#     T3    @ ☀%Ҝ,\ L   *     P+Z#    @ $r4\ +"    1@ Z7     L   $     P m     T m    @ 였%Ҝ#*d@ "r ;  I!    1D Z7     L   .     P m     T m    @ ̘%Ҝ+"  I!    @ **5r,)s +"      %mb   2@ ll%Ҝ"\ +"      %mb   2@ 2k$- %3    @ 였3:d3Ht  қ    @ ""       қ     ,):d   $ 0 Ӊt     853   3@ 
B
B!˵   $  қ bW  p PZI f#$` #(ȰP y  $P ,Xi ,` C0 &aPi ,/ c
mX V!4$ҦX 2C ԻM $P ,Xi ,` FC0$&aPi ,/f Ȱ ,
XY EQt!4$@tJ 2C лN $P ,Xi ,` C0&aPi ,/ 
f
mX EB!4$P@VB 2C ֻE $P ,Xi ,` 
C0&aPi ,/ 
f
mX E,!4$P@V,k 2C ֻB X 
X[/hPY <!4y 6 $P 8P @P Do rr	 0  q	 09Q r 6-/AW  m/f#4'am/ X 
$PP[/h ' ,A1AA( By )w bW  p LZ5 rr	 ,  q	 ,9P bX @y  bW  p DZ8 r$3\&  1P9 4 B%P @L b$P 8P <7o P ,Xi ,` ~C0 &aPi ,S rb
ms-`P 0 rXY  s-bP   RY @B 6 r--\  AYAFree list corrupt 2!sAl B%nPm o By )d B
P @W rX Y  B| RY 4B Zr Xi ,b
mX sV-`P[  ?F rX  s-bP   rXi ,` ~C0 rb
mH-d@-` RHV-f@V-b` B$Q ,m 2C ֻ B$@/Xi 2@/Z By )V rHF-`[L  @F-` RX<  a6-b By )R Y <#'XI ,PI 8P <r 2C  X 8#5P ,C h$ B%^P] w By )L bW  p TZ `  Pi P  PY  s BfB "3' ARelease zero size?2A By )D B$P 8* B
VPY , P 0Xi 0` ~C08&aPi 0Q rb
ms-bP < RsV-`PY Dc 2B0F;_ BC0*1 ACorrupt free list!2A1 r--\  Af[# "#	 RX  @-b6 RX @-`6 B y )4 RY 8B ,n AFree list order?tA` r--\  A [` By )/ B
P @ 2P 8 rX  Y <C rX <Y ,B~ BU ,!: 2@-b RXI aF-` By )$ $@PI L0 ~P9 4oz RH/XC0Jª RPY LPI H\a Xi 4b
ms-`P P BY L# 2P L RXY 4PY HTd bXY 0UY 4#6,4 B%Q 4! 2C ʺ R X HC0F& 2!P 4 r#Xi 0Ui 4C0" B$%Q 4 %XY 4R
]H-b@-f R&H-`@-d9 2'C Һ r(b
mX  @-b R)XY @V-`7qR*Xi LC0 H-\!>ADisc blocks losttAJ6 R+Xi Lam-\ B,y ) B.	B1L B/B0~55 R0ZY PY DR 21@V-` R2ZY <PY @RM 3X 0 ~!4y F R4sF-fPI   B5	EBP1 b6E#4y  e R7H-da-`f r8Xi 0` }C0 B9&aPi 0 r:b
mH-d@-`T R;HV-f@V-b 2<C ֺ B=$@/Xh 2>@/Zx B?y ( 2AC  CAFree list overlap!2A
 DA**Tidy the disc**Ax? BEy ( bFW  p 4Y 2HA BI$aPi ,~ JY 0i ,AXm #4y ݽ rKX XY 0@[  BLeA^. MX-/\  A` ?b X Ҳ  rNXi 0AA8 BOy ( bPW  p 4Y 2RAJı rSXi AA;1 TXm/\H  P ,$PPY 0f U!ɰ ~!&Ӧ Š ?#7+ rV%P y  rXXi ,Ui 0C0" BY$Q 0 ZX]/\X 0
sZ sj AHd 2[C Һ R\X  B0J r]X-/\  AD R^P ?R bk R_Xi Am "`#w baXY $aAB 2cA Bdy ( beW  p <Y Bh$P 8 RiXV PY 4TY 2jC0V9 Bk$P 8 2lP ԫ mP 0Xi 0` C0&&aPi 0S nb
mX 4U/h!8 RoXY 0PY 4T( BpP] # 2rC κ sXm !8ȰP y  "t#	` uȭ/P ,H/P  wXi X !4%XP] : yXm b
mX/hC0; Rz`-A  & {$`Pi 0Xi 0` *C0&aPi 0.|X-$\
ȡX XL UJ  B0X 2}P- 2~PM Ȭ: Rs: P= 8 RX- P- S/ rX 8!4y  Xi ,H  
 
H/P	 4@  6 
"
-H/@/X] @]/6X By ( 2C r BXi 8#?U X 

[/PY ,H  P Ԫ 2B02 B%P  By ( bW  p ,Y BX #93 2A= rXm #4y . RXm AqK By ( bW  p ,Y~ $`Pm Xm ` FC02&aPm - Ȱ ,
XQP!= ȡPP-*  A@y &b 2C ºq B%P  By (     ,   *    @ 9K    @ Ę-#      s       yn     ,   0     0 K     4)(m   . 8 h     <'h  / @ 8l    @ !r  	s  s       I!     , Ӊn     0   0     4   .     8 8l     <   "     @   %     D   3     H  0     L m     P   8    @ ꘀ4\. , s     0 I!    @ VV29d)>o %3       K     ,   .     0   0    @ 

5f )s ,  0     0   *     4   5     8 !    @ vv)Ig/9r@ &f Yr@ ~ bW  p 4Yn RX P 0SW R P ,` B%P  C Lɰ FB DZ  ,
ȫPP- rXI 0UJ  B0( RH: $P= c B$P F bE!4%)P- a XM EJ (#4%#P-  By ( bW  p <YW U!7%P y  B$P 8l P 4Xi 4` *C0R&aPi 4R X-$\
ȡP- BX !7 RPi 8P 0[ C "XI UJ  !=U  !: rX9 ,!4%"P- K By (} 2C r BX ,!= XY 8!5%P #X 0P-& "# B%QP]  By (u bW  p 0YO X/\H[  P ~!7EB r%P y K Y ,i ArXm #4y  X-XY @[  X ,@ "DD $P %APK @ |"X=/\H  C0
H! J!    *!5, 2aQ  2C 29 bH   ~!< B%%P-  bZXi ANb: By (e B&@   R
@Q a 2@ S 2QS  By (^ bW  p 4Y4 $P 0Xi 0` FC0N&aPi 0."6Ȱ ,+
=XY US\B0.X  U`B0"! X ,sCv!<X Et!71 r#P  Aڃ 2C H By (T bW  p 0Y. X 
ӫ/#8P y y $P ,AXm #4y j rX-sk AXm/\Ӷ ð !:X] !7%P y  X]-$P  P < bX-%AaL  X PY ,$QX9 ,sc Al By (K bW  p DY X-X[ PY 0X P 4H  P 8 b$@PK  PK 7 R` C0t X= 
=/#8 P- y }: Xm AhXm #4y #} $P ,XY 4Xi 0A% RXm B0b rX-sk A RXi 8C0g X/\H[  R
[s P ,K B	Bf0 2ANBXm/\H  
H[ ZY ,[Y 8P  Xi 8AJ Xm/\X [ 8P oE HV  R
VX ,[ 8@  "!4ۭ B%a  u9 X]-se AAܤ RXm-Pi @& rX 0
P <7? rX]/\H  B0 i Rs P 87 bP  $@PF 7f bX=-%a  0 2	C t9P 
$P ,XY 4kA  RXm B0P rX-s[ PY 8 BeAĵBXm B0X/\[ V] P !7%SP] y = X-$PP[  P[  bX-%a  P rXi @X <P  & 2A.
 Xm !6$QXi 8A B$`Pm 5 By ( bW  p <X f!X/\s[ 	e! r%fPm y n !X-H P ,HK  PI 8C "X: P9 4X P 0 r$Xi 0Yi C< %$Q ,XY 8YY ,B &
kPi 4X/\X ,
sL QI 0ޜ r'X9 Y9 0C :f 2(C 29s b)%Q ,C ~B@"*Z 4P 0Xm/\XY ,R
VX 4s P 4* B+Y ## 2-C  r.Xm-X ,@ / /XY 0PV X 4P  0X/\
sK @F " B1y ( b2W  p `X5$`Pi XXi X` +#9&aPi X
i$Ҷ +" 6$P XXi X` *C02&aPi X-g 7X-$\
ȡs P \ 8#( +!%
$AL +| 29C ¹ :$P XXi X` *C0&aPi X-w ;
iӶ +!6X Xy  2<C ֹ b= +y _ @$`Po 8Xo 8` C0&&aPo 8.u bAb
m$P/h; BX 8

X_ 8&Q@Y/' 2CC ι BD$@/gN 2EP /RFP 8Xo 8` F#>&aPo 86Ȱ ,+
=$PPC 6BG$P 8Xo 8` #<&aPo 8
f
m$@*@B"BH$P 8Xo 8` 
#<&aPo 8
f
m$@,@,"' IȽDP/ȝ,P/0 BK$`@m-"j rLr-  q- MHm- Pm H-"P n^ bN$P P 4 O` @#%` Pm  rPsm-` Pm 1 RQ]-P]  bRU#$P /#$/ BS%P j RUX P Q2 rV
XP 4X XXm c
mXP ۭ RYsP 6O RZVP]  R[ӦP & 2\P Ȫ 2]P ̫ 2^P] ЫB R_X P Q  r`XM @ C  u baU!4%7P= \ bX= 0 #'X !4%/P- x dX= !9X 
sA  2
]w 2fA\Ջ Bg$`@m-BjG hX @-<X @->m rir-<  sq-< 2jC } mXm 
mӶ/#7ȐP C  nX-4!&%UP] C  roAXm B0( RpXm Ayz rqXm-0!4%P 2 r$P ,VXm-,AXm B0t$D 2sA0Ԫ Rt` HPm ` uXm-AXm B0XJ RwXm-4A@< BxXm #: _     0  P  \  v               . > N ^ n ~       B      '`+FLUY*clmu{"^	B	~				


*
Bf(,8*CDFHJL$M0NHPVR`ShZ]_ac e
zvv"NJXHfz
Rl2f2oprsuwy yX-$Qsk A` 2zC 8 |X-X-4s[  P-4f 2~B ʺeBX-X-,P  XM-0PJ A|Xm-   @ 
\J bX-$a  0 2A. rXm-sf A|$ 2A2 2C 0S Xm 
mӶ/#7ȐP C  s-6Ð !6%YP] C  b$\m-AnA Xm-X E (#4%P < RX B0b+ rsf AA:7q Xm-$@ P %P I X]/\ӥ Š ?#6%P C N RX-8C 8 Xm-8A.Xm !<L X-X-8s[  P-8H 2B ܺ= AXm-sf A鬰a 2C 8m HE  PO 8P <c bX5 ;P5 HX r#%P C "Xo 8#;X/\b
kX <sV 	!#C (! BP < rsV sf A B%aQo 8 rX/\X 8@  c 2C s RXo 8C0H X/\b
ks [ <@ G J P  YXo <AV*Xm/\X 8
H !8%QQ_ 8X 8@   Xm-sf AA 2C \1 B$dPm  RX-(B0 RX-8P $ #$ɐ #&%_P] C 5> 2C  2C 8 Xm-$Vm-(#6%oPm C  b$`Pm-$Pm-(b Xm Um-(!9X U-$!4$P-(^ m-AXm B08 X-ӛ Ð #9X]-(#6 b%P C EA BX]-0!6U: b%P C EI X Š !8X-,   P-,@ r'$  P <p  B0*X-4C0"*W XM UM #4X= #:. B$<P? <? r# P < rAXm B08/ X 'P ,X]-0Xm-,Afd RXm B0d rX Ű B0d X 
Y/U#7ȠP C  2A R` HPm  Xm-AXm B0جX-X-,P  X]-0P[ A2Xm-@ 
ծ bX-$a   2C V8 rX-si A' rXm/\s P-D0 RӖ P-HX bX] U] #<)N rT !9X !6
 b%P C jF$ s >Ð #7X-sj A~4 R`  Qm 0X  X  X-V <P  1 RX]-(PY % X-,P X-0P N& XM @I &X= @9 $ȗ rX-s! @)  RX @ (a    0 
#P--L X= 0 #8H 
    @ 
 $ @	 P	 %aPi ` X 
ӹ/!3A`D Xm-X  P-TX-sY 
P]-P(E 2C W $Qm-ALXm B0x rX-H  B0fj Rsk Aa Xm/\Ӷ Ű ?#6%P C Ll rX-HV  PY * BUY !6& b%P C 0G B$Q h X 
sL @I "S Rs< @9  H r!6%P C '{ Xm-X]-0sf "AUu bXm-$a " B%a  tx HV  !8X U !3P p 2 C ξ C ^W  p , 2A| rXm-sf A Xm/\Ӷ Ű ?#7%[P] y k ` 2A~Xm #4y  2A. rXm-sf A B	y '+ $Rm-A.Xm B0Z- X 
ӛ/#7PP] C @ bX]-H  !7* 2Ah RXm B0*g2 X-X]-0sk "ATU bXm-$a " B%a  tb 2C  Xm 'hVRm-AXm B0 X-X-8Y !Y C `W Rsk A"cg Xm/\Ӷ Ű ?#6%P C 2s U-8B0$X] P 
!>X-s  #7! rAXm B0'c !Xm-8A&Xm B0vJ #X-H "Z-8[   P < b$X] P 	!8 b%X]-0iA@G 2&C $8 'X 
/#7@PM C * b(X]-0iAZG 2*C  b-$_m-Aް* .Xm !5Xm-4A& 2/C   2$_m-AXm B0 r3s-6ð C0&_B4X 
Y/U#6ȠP #X-$Psj A 7Xm-$@  P %P I 28@  29C  b<$_m-Ab =Xm !7X--  Aze 2>C  RAXm A rBX]-0Xm-,A BCXm !=, 2DA EXm Pg ,X]-0Xm-,A 2GC J< LXm 
mӶ/#7ȐP C 0 RMXm Aߪ N$aPg ,X]-0Xm-,AZXm B0 bOX Ű !; PX-HY 
P@ @Y 
Z 2QC v8 RRX-P- SX]-4!X-8!4%P 6S T$aPg ,X]-8Xm-4AJW RUXm B0( VX Ű !6%P C 
 rWX-X]-,PY   RXX-0P $ BZ$P R [Xm-X-4P  X]-8PV  2]A0 2^C r am-AXm B0bDbX-ӛ T !>X] U] #9X !6ݏ bd%P C :J fX P-DX] P]-HL rgX]-8Xm A 2hC K lm-AVXm B0
EW m$P ,X]-0Xm-,A<Xm B0	 rnX-sk A8' rqXm/\s P-H RrH  P-L4 RsV P]-P5 rtX-H 
P-Tg ruXM @ .B0&[ bv?@ 
 wX= 
=/#6i Rx P- U "y#a 2zADڏ 2}C  m-AXm B0vFk rX-ӛ P-D# R[ P]-H$ RX P-L# RH  P-P4A b@ *LPM-T 2C D $_m-AXm B02! rX-sk Az Xm-H $
X/hP-D
 RXV P]-H% !9X 
XP-H RX P-L$t RX P-P$+ rXM/\s4 P=-T 2C d Xm-$` !` !#Pm N X 
X/h!7PP] C c rX]-8`-A 2C Ü Xm-(!&%P C u m-AZXm B0zI RX-$P-D/ RX-(P-Hf rX]-X P-L Rs P-P	$ RHE 
PM-T5 bX= !3P=-LO 2C @ b$`Pm-$Pm-(q m-ArXm B0&H X 
ӛ/#7PP] C  bX] P !;H rX-X-8 \ 2Aݬ 2C >7 $P ,X]-0Xm-,A Xm B0Խ! rX-sk A rXm/\X-8Ҷ h rX-si AJ 2C o Xm b
mX/hP-$ X 
XYP]-( m-A\Xm B0|K X 
ӛ/#7PP] C b> X]-,!&%P C R RX-PZ $ 2A ܒ 2C B RXm Aۼy B$`Pm-DX 2Pm-H}W 2Pm-L}R AW  P-Pn 2C  Xm-$#'X-(#$X-,!&%P C T Rm-A Xm !6%P C d B$P  rXm-$Pm-DP-Hy{ m-<AXm `B0[ X 
ӛ/#7PP] C  B$PP]  R` @Pm  Xm-AHXm B0򈾏 rX-X-(P   RX]-,P[ $ RX-0@ 
4H 2A"W 2C dŔ Xm-(#$X-$!&%P C N> m-AXm B0>M X 
ӛ/#7PP] C $Z X]-$P  P G 2Aݥ rXm-s P 0 BkAڂr $`Po 8Xo 8` *C08&aPo 8, X-6$)
;SP]-ۺ X #8ZX-Xl  Aj B$`Pm j 2C . rX--  AX b$QXo 0AU 2C K Xm-$#7X-(#$X-0!&%P C U Pm-DP-Hm-<AH| Xm !6%P C ` B$P  Rm-A*܍ RXm B0Jn4 rX-X-0P  i 2Ai 2C 6Ʀ 2C 2Ƨ Xm b
mX/hP-$g m-AXm B0P' X U !6%P C ~> X 
Y/U#7ȠP C  Xm A^Xm B0F $P ,X]-0Xm-,AXm B0 RX-P-* RX-P-M RX] P] P@ R Xm A $`Pg ,X]-8Xm-4AXm B0 X--X-$AR$P  bX-%QaY  K X-4P  X-8P M bXM-$1a4   RH 
P-T4: 2AP Xm-Pm-X P LQ 2	Ab 2
C $ǟ Xm-8#9X !6%P C , X-,!7X !4%QP]-,5 RX-(B0.[ s- Đ P-Dr-<  q-<0 Xm-DPm-$X-HP-(0 B$P-,XR Xm-8Pm !7s- İ P J X #$ɰ #&%P C  X-(!&%XP] C  m-AXm B0zQ X-ӛ Ð #>/ X] P #4X-,!6%P C Rh X]-,!7X-X P-, X]-X U-,#6%P C (̎ X 
XM @L R X= <, 2!Ҝ& R"X-(P$ 2#P=-H}% r$2
=X#/hP--D 2%C ȸ (Xm-$#6X #3Pm 胅 )X #$ɰ #&%P C  *
ӛ
XY/hP]-Ds R+XP-H" b,$P-LP-P{ b-!4%GPM ZZ 2.C 	 R1Xm-8Pm # r2c
msP F R3ӖP _ R4XVP] O b5&$A^HL 6$P 8Xo 8` FC0*&aPo 8+7Ȱ ,
X Ex!7!P  A&Ԫ 28C ʷ ;Xm !7ȰP C 4 <
mӶ/#7ȐP C uX =$P 8Xo 8` C0.&aPo 8+ >c
mX s!;F @X] U_ 8#6%P C Ȁ? 2BC Ʒ BC$P-DW 2DP , REXm A4 F$`Po 8Xo 8` *C0F&aPo 8,1 GX-$	
Qs  à C0 M HXQ   Xl?AW BI$`Pm  BJ$P e 2KQ-D{ 2MC  bNX #3A
e5 2OC L2 TXm-$#$` #'ȰP C 4\ UX Ű &!3A  VXm !9X-$
X/hP-Di WX-$
ӛ/P-H8 2XC w rZXm-$AC '* ]m-A.Xm B0V^X-ӛ Ð #9X]-(#6$V-8P-8C `X] 
]ӥ/#7P C  RaX-8 z 2bAX 2cC  fXm-$b
mX-(P/hR gAUnit force-loadedAњf 2hC l kXm-$!` #'ȰP C T5 2lPm  mȰ C@-$@-r-  sq- RnXm C02݄ rob
mX/hC0& pAPage unit busydA4b qXm b
m$P/h tXm Pm-$r-  gq-6 2uC t wXm-$Aؖ !5Xm-(C08, Bx$aPm-(XOyXm-$AР/ @A1' ,A @A1AA {Xm-$
mX-(Ҷ/ r|r-  }q-B 2}C x $`Po 8Xo 8` C0$&aPo 8,7 b
mX-$U/h!7 rX 8P-DC F 2C зy RȰP ' 2C 6 2C B"X , $@X= 0
3'4XC   PC   "0
3$ '4PC   "H   !5$$C  0!C   C   #'1HC   @C   '2"H   !5$$C   R  e
b
PP #%$$C fR  '&a&1  6  "b  R  P#
#6  1  8&&a'"U#1  vfVF6&    unknown faultfile does not existfile already existsaccess restrictedinput endedoutput exceededinvalid blockunknown user illegal name 
wrong mode directory full corrupt file file system full invalid reference	disc fullillegal requestunknown device disc protected         Unit  not unloaded:
Duplicate       	 on unit SYS-prot has lost blocks 	 unloaded      +   Unit  write-protected $@LPt^>Nn   !8!h!r!~!!!!!"":"`"!"%"(#-#.#*2#84#r<#=#A#B#D#E#M$N$T$j]$a$g%l%m%6n%Jz%%%&&&' '<'R'f'~'''((8(b((()).)n)))))**R*l ****	++5,7,E-|H-N-U.Z.8].Db.g.p/w/Ry/n    v$v ]!   8m     ,8K     0 k    @ vv"L :l   n             , K     4   .     8   :    @ "".N%   $  s     , yn    @ 蘀6r   %   n             ,       0   *    @ XX4d   %   n            @ %#       	)     , s     0  n     4       8!N%     < yn    @ ژ"f ;    "     ,8K     0       4      84l    @ Ԙ5ƛ Ӊe X   *     \   8    @ |!h4-3  
#@ !@ 0 @ 0
 0            q   H?   H H                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %ownstring(7) proc = "load"
%owninteger sno  = 3
%owninteger stack = 4
%control 0
%begin;                        !load process
   %switch op(1:8)

%constinteger loaded files = 32
%constinteger max unit = 4
%owninteger  swopping unit = 9;      !default
%constinteger h = x'FFFF'

   %recordformat parmfm(%shortinteger dsno, dact, ssno, sact, %c
                        %integer p1, p2, p3, p4, p5, p6)
%owninteger user unit = 0
%string(7) when
%integer u, process, spine, j, x, y
%owninteger closing = -1, next message, control = 0
%string(18)  m
%ownrecord(parmfm)  p, pp
!loading info

   %recordformat loadfm(%shortinteger camt, gamt, %integer disc, %c
                        %shortinteger codebase, mainep)
   %ownrecord(loadfm)%array lds(1:loaded files)
   %ownbyteintegerarray ldhead(1:loaded files)
   %ownrecord(Loadfm)%name load list
   %owninteger last = Loaded files


%routine  report(%string(18) s)
   %record(parmfm) p
   p_dsno = 0
   string(addr(p_p1)) = s
   svc(120,p)
%end
%string(13)%map itos(%integer n)
   %ownstring(13) s
   s = ""
   %cycle
      s = tostring(rem(n, 10)+'0').s
      n = N//10
      %result == s %if n = 0
   %repeat
%end
%routine  load(%integer  unit no)
   %record(parmfm)  p
   p_p1 = unit no;  p_dact = 38;  svc(20,p)
%end
%integerfn connect(%integer amt, process, seg)
   %record(parmfm) p
   p_p1 = amt;  p_p2 = process;  p_p3 = seg
   p_dsno = 18;  p_dact = 5
   p_sact = 14;  svc(116, p)
   %result = p_p1
%end
%routine delete(%shortintegername amt)
   %record(parmfm) p
   %return %if amt <= 0
   p_sact = 116
   p_dsno = 18;  p_dact = 6;  p_p1 = amt;  svc(116, p)
   report("Delete rejected!") %if p_p1 # 0
   amt = -1
%end
%routine find use
   %integer pt, n, prev
   pt = 1;  prev = 0
   %cycle
      load list == lds(pt)
      %if load list_disc = spine %start
         %if prev # 0 %start
            ld head(prev) = ld head(pt)
            ld head(pt) = ld head(1)
            ld head(1) = pt
            last = prev %if last = pt
         %finish
         %return
      %finish
      n = ld head(pt)
      %exit %if n = 0
      prev = pt
      pt = n
   %repeat
   !not found, choose the last one
   %if sno # 0 %start;      !first load (subsystem?)
      sno = 0
      pt = 1;               !this is protected
   %else
      last = prev
      ldhead(last) = 0
      ld head(pt) = ld head(1)
      ld head(1) = pt
   %finish
   load list == lds(pt)
   load list_disc = 0
%end
%routine load file(%record(parmfm)%name p)
   %integer key, gla, code, term
   %shortinteger camt, gamt, cblock, gblock
   %integer block, limit, size, pdisc
   %recordformat bfm(%shortinteger ca, ga, mark, dd, lindld, %C
                     x5,x6,x7, ps, gs, code disp, ld, reg, mainep, %c
                     %shortintegerarray a(14:255))
   %record(bfm) buf
   %routine read
      %record(parmfm) p
      p_p4 = addr(buf);  p_p5 = key;  p_dact = 7;  svc(20, p)
      term = p_p6
   %end
   camt = -1;  gamt = -1
   pp = p
   pp_dact = 35;  pp_p6 = process;  svc(20, pp)
   p_p1 = -1 %and ->error %if pp_p6 # 0
   key = pp_p5;  spine = pp_p3
   find use
   %if load list_disc # spine %start;      !unknown
      report(itos(spine)." unknown") %if control&1 # 0
      delete(load list_camt);  delete(load list_gamt)
      read
      code = buf_ca
      gla  = buf_ga
      %if (code!gla)>>(16-9) # 0 %start;  !> 1 segment
         p_p1 = -2;  ->error
      %finish
      %if buf_mark = X'4321' %start;         !new compiler
         load list_code base = buf_code disp
         load list_main ep   = buf_mainep
      %else
         load list_code base = 0
         load list_main ep = 0
      %finish
      pp_dsno = 18;  pp_dact = 4;            !create virtual
      pp_sact =  134
      pp_p1 = code;  pp_p2 = 4+x'60';        !shared & write prot
      svc(116, pp);                          !pon & wait
      cblock = pp_p2
      camt = pp_p1;  p_p1 = -2 %and ->error %if camt <= 0
      pp_dsno = 18;  pp_dact = 4;            !create virtual
      pp_sact = 134
      pp_p1 = gla;  pp_p2 = 4;               !shared & writeable
      svc(116, pp)
      gblock = pp_p2
      gamt = pp_p1;  p_p1 = -2 %and ->error %if gamt <= 0
      pdisc = pp_p3
      size = code;  block = cblock*12;  limit = block+size
      %cycle
         size = size-1;  p_p1 = -4 %and ->error %if size < 0
         pp_p1 = block;  pp_p2 = addr(buf);  pp_p3 = pdisc;  pp_p4 = 0
         svc(102, pp);               !disc write
         p_p1 = -3 %and ->error %if pp_p1 # 0
         block = block+1
         %if block = limit %start
            %exit %if code = 0
            code = 0
            block = gblock*12;  size = gla;  limit = block+size
         %finish
         read
      %repeat
      load list_camt = camt
      load list_gamt = gamt
      load list_disc = spine
   %finish
   p_p1 = 0
   p_p2 = load list_camt
   p_p3 = load list_gamt
   p_p4 = load list_codebase&H*2
   p_p5 = load list_main ep&H*2
   pp_dact = 11;  pp_p5 = key;  svc(20, pp)
   %return
error:
   pp_dact = 11;  pp_p5 = key;  svc(20, pp)
   delete(camt);  delete(gamt)
%end
%routine forget everything
   %integer u
   lds(u) = 0 %for u = loaded files, -1, 1
%end

   ld head(j) = j+1 %for j = 1, 1, loaded files-1
   ld head(loaded files) = 0
   forget everything
   %for u = 1, 1, max unit %cycle
      load(u) %unless u = swopping unit
   %repeat
   svc(28, p);                       !is swop 0?
   %if p_p2 = 0 %start;              !yes - use default
      p_dact = 43;  p_p1 = swopping unit;  svc(20, p)
   %finish
   %cycle
      p_sact = 0;  svc(16, p);   !poff
      ->op(p_dact) %if 0 < p_dact <= 8
op(1):report("LOAD- ".itos(p_dact).":".itos(p_ssno))
      p_p1 = -1;  ->ret
op(6):
      control = p_p1
      %continue
op(3):!load file proc<p6>
      process = p_p6
      load file(p)
      %if p_p1 = 0 %start
         p_p2 = connect(p_p2, process, -1)<<16+16
         p_p3 = connect(p_p3, process, -1)<<16
         %if p_p4 # 0 %start;         !new format
            p_p4 = p_p4+p_p2
            p_p5 = p_p5+p_p4
         %finish
      %finish
Ret: %if p_ssno = 64+3 %start
         %if control&2 # 0 %start
            *0
         %finish
         report("Load loops")
         %continue
      %finish
      p_dsno = p_ssno;  p_dact = p_sact
      p_ssno = 0
      svc(115, p)
      %continue
op(2):!start proc
      pp_dsno = 18;  pp_dact = 4
      pp_sact = 15
      pp_p1 = 16;  pp_p2 = 2;            !new area for stack
      svc(116, pp)
      u = connect(pp_p1, p_p1, 13) %if pp_p1 > 0
      p_dsno = p_p1+64
      p_dact = 1
      p_ssno = 0
      svc(115, p) %if p_p2 = 0
      %continue
OP(4):!forget discaddr<p1>
      spine = p_p1
      find use
      %if load list_disc = spine %start;      !in use
         delete(load list_camt)
         delete(load list_gamt)
         load list_camt = 0;  load list_gamt = 0;  load list_disc = 0
         x = ld head(1)
         ld head(1) = ld head(x)
         ld head(x) = 0
         ld head(last) = x
         last = x
      %finish
      %continue
op(5):forget everything %if p_p1 # swopping unit
      swopping unit = p_p1
      %continue
op(7):!set closedown
      closing = p_p1
      p_dsno = p_ssno;  p_dact = p_sact;  p_sact = 0;  svc(115, p)
      ->go %if 0 <= closing <= 99
      closing = -1
      %continue
op(8):!clock tick
      %continue %if closing < 0
      closing = closing-1
      %if closing < 0 %start;      !time up
         %for j = 4, 1, 24 %cycle
            p_p1 = j;  svc(126, p)
         %repeat
         %continue
      %finish
      %continue %if closing # next message
go:   %if closing = 0 %start
         string(addr(p_p1)) = "Closing down NOW!!"
      %else
         when = itos(closing)." minute"
         when = when."s" %if closing # 1
         string(addr(p_p1)) = "Close in ".when
      %finish
      svc(113, p)
      next message = closing>>1
      %if closing < 2 %start
         p_p1 = X'9E4';  p_p2 = -2;  svc(118, p)
      %finish
   %repeat
%endofprogram
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         O6XV @  W  p lP ,
6XV @load           	                                                                                                                                                                                                                                                                                                                                                                                                                                                  J  C W  p `) ,A B !$`@i @ r " ,) HA r #r	 @  xq	 @:` B $y + b %W  p 0[ B '$ҽX )XI T@ $jF@ 0D@ @I , ,'AnXA-XA\5  *X  $jP @ r +!5y  2 ,C  b .W  p L[  0Pi 4Ȱ &@ .r	 ,  q	 ,% B 1y + b 2W  p P[  4Pi 8PY <X ,P @%  5Ƞ @ 0$@ 2  6$N@I 6r	 0  tq	 0t b 7X 8y Ҍ b 9W  p L[ r ;H  !$y  R <P t@Y 2" =Ƞ @ ,$@ .P 4r	 ,  tq	 ,y >Xi 4#>ADelete rejected!Az4 b ?Xi %@  @ B @y * b AW  p 8[ r C$aPi ,$P 4  E$\	 ,
a PmPY r FX @U B0<" R GXY 4C0.{  H
]X ,
//Y R IM0J/Un R JX9 ,=0ґ  KU=T!5X) 4P-Tێ B My *  OXY ,
]ӥ/P 0u 2 P#9Ӛ R QX ,P 4Uj 2 RP , 2 SC  B UX (#9: B V$@PM ( B W$P , 2 XC  <U R YXI 4PMTT6 R Z
M$04/s R [-0%/U R \X ,ҍ0  ^$\	 ,
Q P]PY B _$P  B `y * b aW  pTY          
       
 (     
 ,+3      +"     D0.{ H5\ Jn 0 Z7     8   5     <%   @%3     D   *     H   8     L   9     L)#  	 T-Ӊn'< X2  / P   -    T 8l     2	r   4 ,   3    @  H H )        .    X   3    @         .қ   /@  ژ %  #  Ka      %   , ys    @ 4d   %  Ka    @ 5f  	s ,  0     0   .     4 \    @ ll& [) , k     0 '     4 K     8 )tx_  iC :W  p L " ki TPj @X ,P D$W@Z .r
 ,  q
 , R lXj HPi 8U B mz * b n%a@i <@i >X  o- xX   AM  pȰ #@ zX_ <P] r x  q x  qXm #8X %QP[ C |  rX P ,X] P_ @E 2 sAxb  tXmPX @U C00MB us] VP #?kA' ,AtAA,  vXmPfAXmPf A 2 wA R xHi TPi 4e R yH VP 0e< B zkg#89  {Xi %RPV C k b }Hi X`C!!< r ~X]PH h@  R H n@ 
u( " #U b X]P$@ ?" 2 @ 
  Ƞ @ x$@ z R @ @M ~  X9 4P=  dP < r r x  tq x9 R Xm @i @e  X @ <!(XY %P C t*  P @] x$@ z R  @ ~ r XI 0PM P  r r x  tq x9 R Xm @i Be  X @ >!(XY %P C &p R X] PY PU  X 4P L$<H @,P9 D
:P9 H   %aQi L#X %TP[ C  X DP Y TP] X PP $P Z r r x  fq x9  Xm #8X %SP[ C o B $Q Dx r XY HUY DB0(_ R X 4C0( B $P 4f  $H B
P DXI 0PI L
P H! 2 Ar> 2 C j r XPHI <@L    R H9 >@< vX R X @P V b Xi $P 1 r X]PH  P 
 R H P ek b sE 
DPF 1 b s5 

3P6 16  $@ zX) ,P- r x  q x+ B y *  $k@m zX ,P r x  q x)  i <Ai >Azy B y * b W  p 0[a ` !Pi ,Xi ,` #?'aPi ,V$K
]% $AC  B y *2 $`Po DXo D` #;&aPo D
mX D&Ҷ/"Or B $ҽOM 2 A  $`Po 8Xo 8` #:&aPo 83 b Um D#3A|J " " r r X  q X9 B Xm d!?  Ȱ +@ ZX DP `r X  q X  $`@m ^r X  q XԚ  Hm Z#*` !'
fsmF  2
nuB Hm ZAHm \P dAP h~' ,A8Xo dAjAbXo hAXA<~ b %aPm `C n@ R Xm `Pm TU\ 2 C z R Xm tPo <U[ R m XAp1 R Xm `B0J %P ,X_ <Xm dA  P d/  %aPg ,X_ <Xm hA P h^$ B Xm l#7 R Zm dPm lS7 2 Qm p# r Hm \` CB0$- b s Vð #2 "     A
Load loopseA4 2 C  r @m XH ^@ Z3 B $@ \\ r r X  sq X9w 2 C ƽ-  ` @m x$@ z_ B $@ ~&  P P] $P o r r x  tq x90  Xm #*$P ,X] `AP 8)
 r Xm `` @@m Xz B $@ Z B $@ \Q  X] d!7r X  sq XD 2 C R R Xm `Po @UJ 2 Aj  XmPX @U B0L2 B fA r XmPf Aܡ!  XmP$@  @ P  R ӝ0P H b 
Y/]0I 2 ҹ/)  XT
X H/j 2 PT 2 C   Xm DUm `#3A< R Xm `Pm DU: 2 C ̾ R Xm `Pm LU/" H \@ XH ^@ Z$P@] ^r X  sq X|  Xm L!` cC R B %P L 2 C G R Xm LBfd B 'aPm L 2 C.; $P DXo D` #>&aPo D	 Pm `r X  ~q XV 2C ܻ 2C J RUm PB0Bix BXm L!9 r- `A 2	C :; 
A
/ 0AAڮ! Xm L` #5A/ - `A 0An rr X  qq X9D bXm LaPm PD bX Lɰ # Ȑ	P `%RP] dr X  vq XH 2C X , $@X= 0
3'4XC   PC   "0
3$ '4PC   "H   !5$$C  0!C   C   #'1HC   @C   '2"H   !5$$C   R  e
b
PP #%$$C fR  '&a&1  6  "v                                                                                       load            unknown LOAD-  :Closing down NOW!!  minutes	Close in      " 2 % H ) z .  2  9 >` A al iz o s u. vN w^      2    0 f   2 > 	2
	:	\	h    6e     < c     > g     @#ȣ   + B#ȧ   + D+"     H4l     L s     P#Ι0     z r    @ @ %+2it ,   5    @ @ 	@ 	 
n               H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !#################################################
            !#                   MOUSES                      #
            !#        INTERDATA 7/32 operating system        #
            !#                                               #
            !#               Copyright 1980                  #
            !#   Interactive Datasystems (Edinburgh) Ltd.    #
            !#             All rights reserved               #
            !#################################################
%control 0

      ! D0/!CR=/ for a card-reader version

%conststring(4) version = "6-I"
%constshortintegername restart = x'7E';    !zero to inhibit auto restart
%owninteger swop disc     = 0;      !invalid
%constinteger processes   = 19
%constinteger consoles    = 16
%constinteger max service = 19
%constinteger vdu page    = 20;   ! default lines/page set by 'p control'
%constinteger max amt     = 158
%constinteger max space   = 160
%constinteger max segs    = 128
%constinteger sleep limit = 10;    ! minutes before chop
%constinteger svc charge  = 100
%constinteger disc charge = 20;    !millisec per disc transfer
%constinteger MT charge = 800
%constinteger parm cells  = 96
%owninteger nparms        = parm cells
%constinteger services    = 160
%constinteger first user  = 4
%constinteger sys stack   = 5
%constinteger time outs   = 6
%constinteger buffers     = 3
!
%begin
%recordformat parmxfm(%shortinteger dsno, dact, ssno, sact,            %c
                     %string(23) text)
%recordformat parmcfm(%shortinteger dsno, dact, ssno, sact,           %c
                      %byteintegerarray char(0:23))
%recordformat parmfm(%shortinteger dsno, dact, ssno, sact,           %c
                      %integer p1, p2, p3, p4, p5, p6)
%recordformat gprfm(%integerarray r(0:15))
%recordformat fprfm(%integerarray r(0:7))
%recordformat regfm(%integer ps, pc, %record(gprfm) gpr,              %c
                                     %record(fprfm) fpr)
%recordformat contfm(%integer ps, pc, %record(gprfm) gpr)
%recordformat ucontfm(%record(contfm) new, %record(regfm)  old)
%recordformat procfm(%string(7) owner,                               %c
                     %integer slept, time limit, cpu time, residence,%c
                     %record(regfm) user, %record(gprfm) segs,       %c
                     %byteinteger priv, queue, prio, time chain,     %c
                     %byteinteger console, clevel, look, id,         %c
                     %shortinteger params, store, reply, status,     %c
                     %byteintegerarray page(0:15),                   %c
                     %integer powner, alarm, unit,                   %c
                     %integerarray caddr(1:5))

!status flags
%constinteger stopping     = 1
%constinteger cont load    = 2
%constinteger activated    = 4
%constinteger on runq      = 8
%constinteger on cpu       = 16
%constinteger waiting      = 32
%constinteger incomplete   = 64
%constinteger all on disc  = 128
%constinteger on timer q   = 256
%constinteger blocked      = 512
%constinteger cont wait    = 1024

%constinteger busy = b'1100011100';  !blocked+timer+cpu+runq+activated

!   amt flags
%constinteger paged out = 1
%constinteger new area  = 2
%constinteger shared    = 4
%constinteger resident  = 8
!                       16-128 protection

%recordformat amtfm(%integer addr, disc, %c
                    %shortinteger size,  %c
                    %byteinteger flags, users, chain, flink, blink, state)
%record(amtfm)%array amt(0:max amt)
%shortinteger amt asl
%recordformat segdescfm(%integername seg, %byteinteger link)
%record(segdescfm)%array seg desc(1:max segs)
%recordformat spacefm(%integer addr, %shortinteger size, link)
%record(spacefm)%array space cell(1:max space)
%shortinteger segasl, disc list, store list, space asl

%recordformat qfm(%shortinteger on, off)
%recordformat ttfm(%integer eget, eput, in, get, out, put,      %c
                   %integer inlimit, out limit, elimit,          %c
                   %integer t1, t2, length,          %c
                   %shortinteger flags,              %c
                   %byteinteger page, lines,        %c
                   %byteinteger mode, drain, control, shift,  %c
                   %byteinteger inact, outact, inreq, outreq,%c
                   %byteinteger pendint, outpos, prev, tell, %c
                   %byteinteger device, service, quiet, del, %c
                   %string(19) prompt, %string(15) doing,  %c
                   %byteintegerarray inv(0:127),     %c
                   %byteintegerarray echo(0:127),    %c
                    %byteintegerarray outv(0:255), %c
                    %byteintegerarray tab(1:10))
%recordformat ccbfm(%shortinteger ccw, bytes0,                        %c
                    %integer address0, %shortinteger check0,          %c
                    %shortinteger bytes1,                             %c
                    %integer address1, translate,                     %c
                    %shortinteger routine)
%recordformat tofm(%shortinteger dsno, dact, %integer when)

! service numbers

%constinteger console sno    = 1, console altno = 4
%constinteger disc sno       = 3, disc altno = 2
%constinteger start proc sno = 7, start proc altno = 8
%constinteger p control sno  = 9
%constinteger tape sno       = 10
%constinteger system sno      = x'41'
%constinteger director sno    = x'42'
%constinteger loader sno      = x'43'
%owninteger   potter sno = 0
%owninteger   oper process = 0
%owninteger   account = 0
%constinteger mt sno = 12, mt altno = 13
%constinteger activate sno = 14, activate altno = 15
%constinteger lp demon sno   = 16, lp demon altno = 17
%constinteger user seg sno   = 18
%constinteger link sno       = 19
!96.... for terminals

%owninteger selch owner = 0;    !disc by default
%recordformat filefm(%integer unit, owner, name1, name2)
%ownrecord(filefm) file

!     poffmon  &1  - poffs
!              &2  - pons
!              &4  - svcs
!              &8  - contingencies
!              &16 - paging
!              &32 - process messages
!              &64 - disc ints
!              &128- queues
!              &256- abort on fail
!#############################################
!# reserved store locations                  #
!#                                           #
!#  a00 : sysr12                             #
!#  a04 : sysr13                             #
!#  a08 : sysr14                             #
!#  a0c : sysr15                             #
!#  a10 : svc arg                            #
!#  a14 : work                               #
!#  a18 : idle psw                           #
!#  a1c :                                    #
!#  a20 : system regs dump area - sysdump0   #
!#  a60 : user   regs dump area              #
!#  aa0 : intp   interrupt message           #
!#  b00 : current register set base          #
!#  b68 : current segmentation registers     #
!# c00 - cff : bootstrap                     #
!# d00 - eff : system process stack          #
!# f00 - fff : priv process info             #
!#############################################

%constrecord(parmfm)%name intp = x'AA0'
%constinteger reg addr = x'B00'
%constintegername regs = reg addr
%constinteger atemp    = x'B04'
%constinteger time rt = x'B0C', time left = x'B10', null time rt = x'B14'
%constinteger clock arg = x'B08'
%constinteger oper id = 1 007 883
%constinteger enginr id = 662 331 985
%constinteger  SUBSYS process id = 231 631 179;   ! subsys: . . . .

! ######## mac variables ########

   %owninteger mac status = 0
   %constintegername mac status reg  = x'340';   ! status register
   %constinteger sys segs = x'300';              ! segmentation registers
   %constinteger wprot     = b'01100000'
   %constinteger present   = b'00010000'
   %constinteger exec prot = b'10000000'

%CONSTINTEGER IISTATUS = X'30', IILOCN = X'34', POWER FAIL = X'84'

!  MACHINE CODE CONSTANTS

%CONSTINTEGER TIMER = X'0129';       ! BALR_2,9
%CONSTINTEGER ST0 = X'5006',  ST1 = X'5016',  ST2 = X'5020'
%CONSTINTEGER ST3 = X'5030'
%CONSTINTEGER ST13 = X'50D0'
%CONSTINTEGER STM0 = X'D000', STM14 = X'D0E6'
%CONSTINTEGER LM12 = X'D1C0'
%CONSTINTEGER PS = 0, PC = 4, P3 = X'AB0', P4 = X'AB4'
%constinteger                              HP4 = x'AB6'

%CONSTINTEGER DEVS = 10
%CONSTBYTEINTEGERARRAY DEVMAP(1:DEVS) =
   255, 0, 2, X'6C', X'F0', X'B6', X'C6', X'C7', X'D6', X'D7'
%CONSTINTEGER INFINITY = X'7FFFFFFF'
!
!##################################################
!#                                                #
!#             INTERRUPT VECTORS                  #
   %CONSTSHORTINTEGERARRAY VEC(-3:-2)
   %SWITCH                  IV(1 :64)
!#                                                #
!##################################################
!
!CR=   %constinteger cr dev = x'04'

! AUTO DRIVER EXIT POINTS
%INTEGER TAPE EXIT, LP EXIT

!##### CLOCK INFO #####

%integer wake when
%integer time outs pending;  time outs pending = 0
%record(tofm)%array time out(1:time outs)
%byteinteger wake who
%owninteger idle time, user time, exec time, period
%owninteger real time = 0, old time = 0, up time = 0
%ownstring(9) swork = "??:???:??";  !word aligned!!!

%CONSTINTEGER SYSR12   = X'A00'
%CONSTINTEGER SYSDUMP0 = X'A20'
%CONSTINTEGER USRDUMP0 = X'A60'
%CONSTINTEGER USER STATUS = X'77F3';    ! CC 'NOT EQUAL'+system queue


%owninteger mask = 0
%owninteger quick = 0;                     !flag for interactive pending
%integer shuffling;  shuffling = 0

! symbols

%constinteger cr = 13, lf = 10, ff = 12
%constinteger del   = 127, can = 24
%constinteger eot   = 4
%constinteger dle   = 16
%constinteger si    = 15, so    = 14
%constinteger esc   = 27
%constinteger dc2   = 18, dc3 = 19
%constbyteintegerarray xsym(0:15) =
   '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'

%constintegerarray MONTH(1:12) = m'JAN-', m'FEB-', m'MAR-', m'APR-',
                                 m'MAY-', m'JUN-', m'JUL-', m'AUG-',
                                 m'SEP-', m'OCT-', m'NOV-', m'DEC-'

%constinteger disarm = x'C0', enable = x'40'

!message tables

%record(parmxfm)%array parm(1:parm cells)
%byteintegerarray parmq(1:parm cells)

%byteintegerarray serviceq(1:services)
%byteintegerarray service messq(1:services)
%byteintegerarray inhibited(1:services)
%integer service, sysq
%byteintegername pq end

%switch serve(1:20)

%integer j,k,l
%string(73) output
%ownstring(19) user int = ""

!process tables

%record(parmxfm) p
%record(procfm)%array      proc(0:processes)

%byteintegerarray fq, bq(1:processes)
%owninteger dump lines = 64

%record(procfm)%name curproc;            !current process on cpu
%record(procfm)%name svcproc;            !process firing svc
%constrecord(procfm)%name null proc = 0

%constintegername svcarg = x'A10';       !svc parameter
%constinteger     svcnum = x'A1C';       !svc index

!console tables

%constinteger devices = 12
%ownbyteintegerarray prot(0:devices)
%ownbyteintegerarray device(0:devices) = 0, x'C6', x'D6', x'C7', x'D7',
                                            x'F4', x'F5', x'F6', x'F7',
                                            x'F8', x'F9', x'FA', x'FB'
%constinteger ttbase = x'20'
%ownbyteintegerarray ttclock(1:consoles) = b'11101000'(consoles); ! 7 bits, no parity
%owninteger console number = 1
%record(ttfm)%array        tty(1:consoles)
%record(ttfm)%name tt
%ownrecord(ccbfm)%array       ccb(1:3);   !***must be own < 64k***
%ownrecord(qfm)%array queue(1:3)
%byteintegerarray          qarea(0:95);  !<32 processes
%owninteger queue0 = 0
%constbyteintegerarray   up queue(0:4) = 1,1,2,2,3
%constbyteintegerarray down queue(0:4) = 1,2,3,4,4

%ownshortintegerarray residences(0:4) = 500,  500, 1000, 2000, 4000
%ownshortintegerarray slices(1:3) = 50, 100, 200

%ownbyteintegerarray buf proc(1:buffers)
%integerarray buffer(1:buffers)

!CR=   %owninteger cardp = 0, cardvec = 0, card sno = 0, card act = 0

   %constintegername big job in  = x'BA0'
   %constintegername store limit = x'BA4'
   %constintegername half left   = x'BA8'
   %constintegername big q       = x'BAC'
   %constintegername going       = x'BB0'
   %constintegername fair        = x'BB4'
%constintegername store left = x'990'
%constintegername store base = x'994'
%constintegername route      = x'998'
%constinteger     deadlock   = x'99C'
%constintegername abort num  = x'9A0'
%constintegername parm asl   = x'9A4'
%constintegername pending    = x'9A8'
%conststring(8)%name date    = x'9AC'
%conststring(8)%name time    = x'9B6'
%constintegername seconds    = x'9C0'
%constintegername yearday    = x'9C4'
%constintegername proc mon   = x'9C8'
%constintegername max store  = x'9CC'
%constintegername poff mon   = x'9D0'
%constintegername users      = x'9D4'
%constintegername user limit = x'9D8'
%constintegername protected  = X'9DC'
%constintegername sys lock   = x'9E0'
%constintegername open       = x'9E4'
%constintegername system pass= x'9E8'
%constintegername io limit   = x'9EC'
%constintegername fast waitq = x'9F0'
%constintegername      waitq = x'9F4'
%constintegername slow waitq = x'9F8'
%constintegername sleepq     = x'9FC'

!*end*

         big job in = 0
         big q = 0
         going = 0
         fair = 0
         route = 0
         shortinteger(deadlock) = 0
         pending = 0
         proc mon = 0
         poff mon = 0
         users = 0
         user limit = 15
         sys lock = 1
         open = -1
         system pass = -2
         io limit = 50
         fast waitq = 0
         waitq = 0
         slow waitq = 0
         sleepq = 0

   %if restart = x'CC' %start
      swop disc   = integer(0)
      proc mon    = integer(4)
      poffmon     = integer(8)
      open        = integer(12)
      system pass = integer(16)
      route       = integer(20)
   %finish


%routinespec  pon(%record(parmxfm)%name p)
%routinespec poff(%record(parmxfm)%name p)
%routinespec inhibit(%integer service)
%routinespec uninhibit(%integer service)
%routinespec adsorb(%integer service)
%routinespec sense status(%integer dev, %integername st)
%routinespec command(%integer dev, com)
%routinespec read half(%integer dev, %integername x)
%routinespec enqueue(%integer process)
%routinespec report(%string(63) mess)
%routinespec console(%record(parmxfm)%name p)
%routinespec tape(%record(parmfm)%name p)
%routinespec ttin(%integer flag)
%routinespec ttout
%routinespec send input
%routinespec to q(%integer process, %integername q)
%routinespec clock(%integer length)
%routinespec disc(%record(parmfm)%name p)
%routinespec mag tape(%record(parmfm)%name p)
%routinespec cpu give(%integer why)
%routinespec clock tick
%routinespec time bomb(%integer dsno, dact, when)
%routinespec defuse(%integer dsno)
%routinespec wake up(%record(procfm)%name pr)
%routinespec call process(%record(parmfm)%name p)
%routinespec user svc
%routinespec start proc(%record(parmfm)%name p)
%routinespec p control(%record(parmfm)%name p)
%routinespec lpdemon(%record(parmfm)%name p)
%routinespec lkdemon(%record(parmfm)%name p)
%routinespec contingency(%integer proc, n)
%routinespec set dt
%routinespec pack(%record(filefm)%name f, %string(63) file)
%routinespec unpack(%record(filefm)%name f, %stringname file)
%predicatespec valid(%record(procfm)%name p, %c
                        %integername addr, %integer size)
%routinespec clear terminal(%integer L)

%routinespec start privs
%routinespec system process

   ->supervise;       ! ***** skip interrupt table *****

!
%routine clear store
   %integer j
   j = addr(j)+64
   %while j # 0 %cycle
      integer(j) = x'22222222'
no1:  %exit %if integer(j) # x'22222222'
      integer(j) = x'DDDDDDDD'
no2:  %exit %if integer(j) # x'DDDDDDDD'
      j = (j+4)&x'FFFFF'
   %repeat
   store limit = j
%end
%routine display(%integer process, extra)
   *x'2401';       !*lis_0,1
   *x'C810';  *x'40'
   *x'9E01'
   *x'9466';       !*exbr_6,6
   *x'9806';       !*whr_0,6
   *x'3466';       !*exhr_6,6
   *x'9466';       !*exbr_6,6
   *x'9806';       !*whr_0,6
   *x'9A05';       !*wdr_0,5
%end
%routine printsymbol(%integer sym)
   *x'C810';  *x'62';    !*lhi_r1, x'62'
   *x'9D10';             !*ssr_r1,r0
   *x'2081';             !*bnr_.-1
   *x'9A16';             !*wdr_r1,r6
%end
%routine newpage
   printsymbol(ff)
   dump lines = 64
%end
%routine newline
   printsymbol(nl)
   dump lines = dump lines-1
   newpage %if dump lines <= 0
%end
%routine spaces(%integer n)
   %while n > 0 %cycle
      n = n-1
      printsymbol(' ')
   %repeat
%end
%routine printstring(%string(63) s)
   %integer j
   printsymbol(charno(s,j)) %for j = 1, 1, length(s)
%end
%routine phex(%integer n)
   %integer j
   %cycle j = 1, 1, 8
      printsymbol(xsym(n>>28));  n = n<<4
   %repeat
%end
%routine dump line(%integer p)
   %integer j, sym
   %cycle j = 1, 1, 8
      printsymbol(' ');  phex(integer(p))
      p = p+4
      printsymbol(' ') %if j = 4
   %repeat
   p = p-32
   printstring(" *")
   %cycle j = 1, 1, 32
      sym = byteinteger(p);  p = p+1
      sym = ' ' %unless ' ' <= sym < 127
      printsymbol(sym)
   %repeat
   printsymbol('*')
%end
%routine monitor(%record(parmxfm)%name p, %string(63) message)
   printstring(message)
   spaces(19-length(message))
   dump line(addr(p));  newline
%end
%string(11)%fn itos(%integer v)
   %string(11) s
   %integer n
   n = !v!
   s = ""
   %cycle
      s = tostring(rem(n,10)+'0').s
      n = n//10
      %exit %if n = 0
   %repeat
   s = "-".s %if v < 0
   %result = s
%end
%string(8)%fn xtos(%integer n)
   %string(8) s
   s = ""
   %cycle
      s = tostring(xsym(n&15)).s
      n = n>>4
      %result = s %if n = 0
   %repeat
%end
%routine dump system
   !dumps the first 128k of store to D7
   !and then reloads.
   %constshortintegerarray dumper(1:136) =
   x'C880',x'00D7',x'41F0',x'8000',x'C8D0',x'012C',x'24C0',x'2460',x'E6B0',
   x'4001',x'FFFF',x'5060',x'80FA',x'C8A0',x'00F0',x'C890',x'00B6',x'DE90',
   x'80C2',x'9DAE',x'2081',x'9D9E',x'94EE',x'C3E0',x'8200',x'2112',x'2333',
   x'DE90',x'80AE',x'9D8E',x'2347',x'C3E0',x'0010',x'2034',x'C3E0',x'0040',
   x'023F',x'9D8E',x'021F',x'2387',x'222B',x'988D',x'DE80',x'808C',x'4140',
   x'807C',x'988D',x'DE80',x'8083',x'4140',x'8072',x'DEA0',x'807E',x'34E6',
   x'9AAE',x'98A6',x'34EB',x'9AAE',x'98AB',x'988D',x'9A9C',x'DE90',x'8067',
   x'DEA0',x'8065',x'9DAE',x'2081',x'DEA0',x'805E',x'9D9E',x'2125',x'C3E0',
   x'0080',x'2234',x'030F',x'2148',x'021F',x'25D1',x'2561',x'4140',x'8048',
   x'4300',x'0C00',x'C3E0',x'0010',x'033F',x'9BA0',x'99AE',x'3400',x'06E0',
   x'0BE6',x'26E2',x'C4E0',x'FF00',x'0A6E',x'4140',x'8028',x'C8E0',x'3000',
   x'51E0',x'804A',x'5560',x'8046',x'2030',x'07CC',x'26D1',x'4300',x'FF84',
   x'9D9E',x'2221',x'9D8E',x'027F',x'2082',x'0304',x'C1C2',x'3010',x'48C1',
   x'C800',x'1388',x'5000',x'8026',x'2401',x'C8E0',x'0040',x'9E0E',x'94ED',
   x'980E',x'08E6',x'10E8',x'94EE',x'980E',x'25E1',x'51E0',x'800C',x'203D',
   x'0304'
   integer(x'30') = 0
   integer(x'34') = addr(dumper(1))
   *0
%end
%routine abort(%integer err)
   %shortinteger n,m, tries
   *x'C800';  *x'F0';        ! *lhi_0,x'F0'
   *x'9510';                 ! *epsr_1,0
   *x'D000';  *usrdump0;     ! *stm_0,usrdump0
   *x'2400';                 ! *lis_0,0
   *x'9510';                 ! *epsr_1,0
   abort num = err
   tries = 20
   m = x'FFFF';  n = 0
   %cycle
      display(m, 0)
      m = \m
      n = n+1 %until n = 0
      tries = tries-1;  %exit %if tries <= 0
   %repeat
   restart = -1;        !to report later
   dump system
%end
%record(procfm)%map user process(%integer process)
   %record(procfm)%name pr
   %if 0 < process <= processes %start
      pr == proc(process)
      %result == pr %if pr_id = process
   %finish
   %result == null proc
%end
!
!Packing and Unpacking procedures

%routine UNPACK TIME(%integer s, %stringname result)
   %recordformat tfm(%byteinteger l,h1,h2,c1,m1,m2,c2,s1,s2)
   %record(tfm) r
   %integer h,m
   result = "??" %and %return %unless 0 <= s < 60*60*24
   m = s//60
w: h = m//60
   r_h1 = h//10+'0'
   r_h2 = rem(h,10)+'0'
   r_c1 = ':'
   r_c2 = ':'
   m = rem(m, 60)
x: r_m1 = m//10+'0'
   r_m2 = rem(m,10)+'0'
   s = rem(s, 60)
y: r_s1 = s//10+'0'
   r_s2 = rem(s,10)+'0'
   r_l = 8
   result = string(addr(r_l))
%end
%routine UNPACK DATE(%integer year, %stringname result)
   %integer d, m, y
!   %recordformat sfm(%string(9) date %or
!                     %byte l, d1,d2, h, %integer m, %byte y1,y2)
   %recordformat sfm(%byteinteger l,d1,d2,h,m1,m2,m3,m4,y1,y2)
   %record(sfm) r
   d = (year&x'3FFF'+21000)<<2-1
   y = d//1461+1
   d = ((rem(d,1461)+4)>>2)*5-3
   m = d//153-9
   %if m <= 0 %start
      m = m+9+3;  y = y-1
   %finish
   d = (rem(d, 153)+5)//5
   r_l = 9
   r_h = '-'
   integer(addr(r_m1)) = month(m)
   r_y2 = rem(y, 10)+'0'
   r_y1 = y//10+'0'
   r_d2 = rem(d, 10)+'0'
   r_d1 = d//10+'0'
   r_d1 = ' ' %if r_d1 = '0'
   result = string(addr(r_l))
%end
%integerfn PACK DATE(%string(15) date)
   %integer y, m, n
   %string(15) temp
   %integername nn;  nn == integer(addr(date)+4)
   m = 13
   date = " ".date %if length(date) = 8
   n = charno(date,1)
   nn = nn&x'5F5F5FFF'
   %cycle
      m = m-1;  %result = 0 %if m = 0
      %exit %if month(m) = nn
   %repeat
   y = charno(date,8)*10+charno(date,9)-'0'*11
   m = m-3
   m = m+3+9 %and y = y-1 %if m < 0
   n = (n!16)*10+charno(date,2)+(y*1461)>>2+(m*153+2)//5-21000-'0'*11
   unpack date(n, temp)
   %result = 0 %unless temp = date
   %result = n
%end
%routine PACK(%record(filefm)%name file, %string(63) filename)
   %integer sym, temp, l, n, m
   %integerfn P3
      %cycle
         %result = 0 %if l = 0
         sym = charno(filename, l);  l = l-1
         %result = sym&95-'A'+1 %if 'A' <= sym&95 <= 'Z'
         %result = sym-'0'+27 %if '0' <= sym <= '9'
         %exit %if sym # ' '
      %repeat
      l = l+1
      %result = 0
   %end
   %integerfn THREE
      %integer n, m
      n = p3;  %result = 0 %if n = 0
      m = p3;  %result = n %if m = 0
      n = n*37+m
      m = p3
      n = n*37+m %unless m = 0
      %result = n
   %end
   file = 0
   temp = 0;  l = length(filename)
   l = -1 %if l > 25
   temp = x'80000000' %and l = l-1 %if charno(filename, l) = '#'
   %if l > 0 %start
      n = three
      %if charno(filename, l) = '.' %start
         l = l-1;  file_name2 = three<<16+n
      %else
         file_name2 = n<<16
      %finish
      file_name1 = three
      n = p3
      m = p3
      n = n*37+m %unless m = 0
      file_name1 = file_name1+n<<16
      %if m = 0 %and charno(filename, l) = '$' %start
         file_name1 = file_name1!x'40000000'
         l = l-1
      %finish
      %if charno(filename, l) = ':' %start
         l = l-1;  file_owner = three+three<<16
         %if charno(filename, l) = '_' %start
            l = l-1;  file_unit = three+p3<<16
         %finish
      %finish
   %finish
   file_owner = -1 %if p3 # 0 %or l # 0
   file_name1 = file_name1!temp
%end
%routine UNPACK(%record(filefm)%name file, %stringname filename)
   %integer t
   %routine STRIP(%integer v)
      %integer m
      %while v # 0 %cycle
         m = rem(v, 37)
         %if m # 0 %start
            m = m-27-'A'+'0'+1 %if m > 26
            filename = filename.tostring(m+'A'-1)
         %finish
         v = v//37
      %repeat
   %end
   filename = ""
   %return %if file_owner < 0
   %if file_unit # 0 %start
      strip(file_unit>>16)
      strip(file_unit&x'FFFF');  filename = filename."_"
   %finish
   %if file_owner # 0 %start
      strip(file_owner>>16);  strip(file_owner&x'FFFF')
      filename = filename.":"
   %finish
   filename = filename."$" %if file_name1<<1 < 0
   strip(file_name1>>16&x'3FFF')
   strip(file_name1&x'FFFF');  strip(file_name2>>16)
   t = file_name2&x'FFFF'
   %if t # 0 %start
      filename = filename.".";  strip(t)
   %finish
   filename = filename."#" %if file_name1 < 0
%end
%routine SET DT
   unpack time(seconds, time)
   unpack date(yearday, date)
%end
!
! #####     interrupt handling    #####

!    ### note iv mapped onto vec ###

!CR=%routine do cr(%integer status, col)
!CR=   %owninteger n = 0
!CR=   %record(parmfm) p
!cr=   %if status&4 = 0 %start
!CR=      n = n+1
!CR=      cardp = cardp-2
!cr=      shortinteger(cardvec-cardp+158) = col
!cr=   %else
!cr=      command(cr dev, disarm+X'08');      !clear
!cr=      cardp = 0
!cr=   %finish
!CR=   %if cardp <= 0 %start
!CR=      p_dsno = card sno
!CR=      p_dact = card act
!CR=      p_ssno = 0
!CR=      p_p1 = status
!CR=      p_p2 = n
!CR=      n = 0
!CR=      pon(p)
!CR=   %finish
!CR=%end
!CR=%routine test card
!CR=   %integer s, n
!CR=   sense status(cr dev, s)
!cr=   %return %if s&8 # 0 %and s&4 = 0
!CR=   read half(cr dev, n)
!CR=   do cr(s, n)
!CR=%end

iv(x'01'):! illegal interrupt
      *stm0;  *sysdump0
      *timer
      contingency(0, 1);  ->resume
iv(x'02'):!  sint 0 (from cpu give)
      *x'0301';        !straight back (system regs)
iv(x'03'):! console
      *st0;  *ps;  *st1;  *pc;  *st3;  *p4
      *timer
      p_dact = 1;  console(p);  ->resume
iv(62):! time left routine
      *x'C810';  *x'6C';    ! *lhi_1,clock dev
      *x'9910';             ! *rhr_1,0 - interval left
      *x'5000';  *time left;! *st_0,time left
      *x'9811';             ! *whr_1,1
      *x'C800';  *x'E0';    ! *lhi_0, disarm+start
      *x'9E10';             ! *ocr_1,0 - stop it
iv(61):*x'0302';             ! *bfcr_0,2 - return
iv(63):! line frequency clock
      *x'2421';              ! *lis_2,1
      *x'5120'; *clock arg;  ! *am_2,clock arg
      *x'2332';              !beq .+2
      *x'1800';              ! lpswr_0
      *st0; *ps
      *st1; *pc
      *timer
      clock tick
      ->resume
iv(x'04'):! clock
      *st0;  *ps;  *st1;  *pc
      *timer
timed out:
      integer(time left) = 0;      !because the clock has reset the interval
      %if curproc_cputime > curproc_time limit %start
         contingency(0, 6);  ->resume
      %finish
      l = 1
      %if (curproc_cputime >= curproc_residence %or curproc_queue = quick) %c
         %and curproc_id > 3 %start
         !residence time exceeded
         curproc_queue = down queue(curproc_queue)
         l = 0;         !don't enqueue
         intp_dsno = activate sno;  intp_dact = 1
         intp_ssno = 0
         intp_p1 = curproc_id
         pon(intp);            !throw it out
         curproc_status = curproc_status!blocked
         curproc_prio = 3
      %finish
      cpugive(l)
      ->resume
iv(x'05'):! selch
         *st0; *ps;    *st1; *pc
         *st2; *p3;    *st3; *p4
         *timer
         %if selch owner >= 0 %start;    !held by disc
            intp_dact = 8;  disc(intp);  ->resume
         %finish
         intp_dact = 3;  mag tape(intp);  ->resume
iv(x'06'):! cont
         *st0; *ps;    *st1; *pc
         *st2; *p3;    *st3; *p4
         *timer
         intp_dact = 9;  disc(intp);  ->resume
iv(x'07'):! disc1
iv(x'08'):! disc2
iv(x'09'):! disc3
iv(x'0A'):! disc4
         *st0;  *ps;  *st1;  *pc
         *st2;  *p3;  *st3;  *p4
         *timer
         intp_dact = 10;  disc(intp);  ->resume
iv(x'0E'):!big disc cont int
         *st0; *ps;    *st1; *pc
         *st2; *p3;    *st3; *p4
         *timer
         intp_dact = 11;  disc(intp);  ->resume
iv(59):!MT
         *st0; *ps;      *st1;   *pc
         *st2; *p3;      *st3;   *p4
         *timer
         intp_dact = 4;  mag tape(intp);  ->resume
iv(x'0B'):! paper tape (auto driver)
      *st0;  *ps;  *st1;  *pc
      *st3;  *p4
      *timer
      intp_dact = 1;  tape(intp);  ->resume

!!!!!iv(X'0c'): is at resume

iv(X'15'):!   cr
!cr=      *st0;  *ps;  *st1;  *pc
!cr=      *st3;  *p3
!cr=      *x'D920';  *hp4
!cr=      *timer
!cr=      do cr(intp_p3, intp_p4)
!cr=      ->resume
iv(x'0D'):! lp (auto driver)
      *st0;  *ps;  *st1;  *pc
      *st3;  *p4
      *timer
      intp_dact = 1;  lp demon(intp);  ->resume
iv(x'10'):! free console kb
      *st0;  *ps;  *st1;  *pc
      *st2;  *p3
      *timer
      console number = (integer(p3)-ttbase)>>1+1
      intp_dact = 1;  intp_dsno = p control sno
      pon(intp);  ->resume
iv(x'11'):! user console kb
      *st0;  *ps;  *st1;  *pc
      *st2;  *p3;  *st3;  *p4
      *timer
      console number = (integer(p3)-ttbase)>>1+1
      tt == tty(console number)
      ttin(0);  ->resume
iv(x'12'):! user console tp
      *st0;  *ps;  *st1;  *pc
      *st2;  *p3;  *st3;  *p4
      *timer
      console number = (integer(p3)-ttbase)>>1+1
      tt == tty(console number)
      ttout;  ->resume
iv(x'13'):!link in
      *st0;  *ps;  *st1;  *pc
      *st2;  *p3;  *st3;  *p4
      *timer
      intp_dact = 1;  lk demon(intp);  ->resume
iv(x'14'):!link out
      *st0;  *ps;  *st1;  *pc
      *st2;  *p3;  *st3;  *p4
      *timer
      intp_dact = 2;  lk demon(intp);  ->resume
!
iv(x'20'):! svc 0
      *stm14;  *ps
      *st13;  *x'A10';     ! *st_13,svcarg
      *lm12;  *sysr12
      *timer
      svcproc == curproc
      integer(svcnum) = 0
      user svc
      ->resume %if svcproc_status&(\waiting) # 0;      !not asleep
      k = svcproc_id+64;  l = k+64
      uninhibit(l)
      %cycle
         intp_dsno = l;  poff(intp)
         ->resume %if intp_dsno = 0
         intp_dsno = k;      pon(intp)
      %repeat
iv(x'21'):*x'2401';  ->svcx
iv(x'22'):*x'2402';  ->svcx
iv(x'23'):*x'2403';  ->svcx
iv(x'24'):*x'2404';  ->svcx
iv(x'25'):*x'2405';  ->svcx
iv(x'26'):*x'2406';  ->svcx
iv(x'27'):*x'2407';  ->svcx
iv(x'28'):*x'2408';  ->svcx
iv(x'29'):*x'2409';  ->svcx
iv(x'2A'):*x'240A';  ->svcx
iv(x'2B'):*x'240B';  ->svcx
iv(x'2C'):*x'240C';  ->svcx
iv(x'2D'):*x'240D';  ->svcx
iv(x'2E'):*x'240E';  ->svcx
iv(x'2F'):*x'240F'
svcx: *stm14;  *ps
      *st13;  *x'A10';      !stuff off svcarg
      *stm0;  *sysdump0
      *lm12;  *sysr12
      *x'5000';  *svcnum
      *timer
      contingency(0, 2);  ->resume
iv(x'30'):! illegal instruction
      *stm14;  *ps
      *stm0;  *sysdump0
      *lm12;  *sysr12
      !check for supervisor loops!!!
         *x'2401';                     !*lis_0,1
         *x'6100';  *deadlock;         !*ahm_0,deadlock
         *x'2135';                     !*bne_past
         abort(m'Lock')
      *x'5890';  *time rt
      *timer
      %if integer(sysdump0+14*4)&X'F0' = 0 %or %c
                      integer(sysdump0+6*4)&X'000FFFFF' < protected %start
         *X'C870';  *X'D00';      !use a new stack
         abort(m'BadI')
      %finish
      contingency(0, 3);  ->resume
iv(x'0F'):! front panel
      *stm0;  *sysdump0
      *timer
      abort(m'Oper');!<<<<<<<<<<<<<<<<<<<<
iv(x'32'):! arithmetic fault
      *stm14; *ps
      *lm12; *sysr12
      *x'2384';          !*bffs_8,4
      *x'2133';          !*btfs_3,3
      *X'C206';  *0;    !*lpsw_*ps
      *timer
      contingency(0, 4);  ->resume
iv(x'33'):! segment trap
      *stm14;  *ps
      *stm0;  *sysdump0
      *lm12;  *sysr12
      *timer
      mac status = mac status reg
      mac status reg = 0
      contingency(0, 5);  ->resume
iv(60):!machine malfunction interrupt
      *x'43F0';  *x'0C00';        !Jump to boot on power back
      *x'C800';  *x'5000'
      *x'1101';                   ! *slls_0,1
      *x'5000';  *x'0030';        !Protect illegal inst
      *x'9510';                   ! *epsr_1,0 wait for the end
iv(64):! start interruptable system process
      system process;    ! should never return
      *0

resume:  ->timed out %if integer(time left) = 0
         clock(integer(time left))
         *x'5890';  *timert
         *x'5860';  *x'B00';         !*l_6,regs
         *x'C206';  *0;              !*lpsw_(r6)

! ###########################################

%routine pon(%record(parmxfm)%name p)
   %integer service, new, old
   service = p_dsno
   %return %if service = 0;         ! null service
   abort(m' Pon') %and %stop %unless 0 < service <= services;!<<<<<<<<<<<<<<
   new = parm asl;  parm asl = parmq(new)
   abort(m' Asl') %and %stop %if parm asl = 0;!<<<<<<<<<<<<<<<<<<<<
   old = service messq(service);  service messq(service) = new
   %if old = 0 %start;    ! currently empty
      parmq(new) = new
   %else
      parmq(new) = parmq(old);  parmq(old) = new
   %finish
   %if inhibited(service) = 0 %and serviceq(service) = 0 %start
      %if sysq = 0 %start
         serviceq(service) = service
      %else
         serviceq(service) = serviceq(sysq)
         serviceq(sysq) = service
      %finish
      sysq = service
   %finish
   parm(new) = p
   nparms = nparms-1
   %if nparms < 6 %start
      old = inhibited(console sno)
      adsorb(console sno)
      inhibited(console sno) = old
      report("******output lost******") %if nparms > 6
   %finish
   monitor(p, "pon:") %if poffmon&2 # 0
%end
%ROUTINE poff(%record(parmxfm)%name p)
   %integer service, last, first
   service = p_dsno
   abort(m'Poff') %and %stop %unless 0 < service <= services;!<<<<<<<<<<<<<<<<<<<<
   last = service messq(service)
   %if last = 0 %or inhibited(service) # 0 %start
      p_dsno = 0;  %return
   %finish
   first = parmq(last)
   %if first = last %start;        ! last cell coming off
      service messq(service) = 0
   %else
      parmq(last) = parmq(first)
   %finish
   pq end = first
   pq end == parmq(first)
   pq end = 0
   p = parm(first)
   nparms = nparms+1
   monitor(p, "poff:") %if poffmon&1 # 0
%end
%routine inhibit(%integer service)
   abort(m'Inhi') %unless 0 <= service <= services;!<<<<<<<<<<<<<<<<<<<<
   inhibited(service) = 1
%end
%routine uninhibit(%integer service)
   abort(m'Unin') %unless 0 <= service <= services;!<<<<<<<<<<<<<<<<<<<<
   inhibited(service) = 0
   %if serviceq(service) = 0 %and service messq(service) # 0 %start
      %if sysq = 0 %start
         serviceq(service) = service
      %else
         serviceq(service) = serviceq(sysq)
         serviceq(sysq) = service
      %finish
      sysq = service
   %finish
%end
%routine adsorb(%integer service)
   %record(parmfm) p
   uninhibit(service)
   %cycle
      p_dsno = service
      poff(p)
      %return %if p_dsno = 0
      %if service = console sno %or service = route+96 %start
         p_dsno = p_ssno;  p_dact = p_sact
         p_ssno = 0;  pon(p);                !send the reply
      %finish
   %repeat
%end
%routine set exit(%integername exit, %integer entry)
   *x'0A5E'
   *x'5056';  *0
%end
%routine set entry(%integer dev, disp)
   *x'0A5E';              ! *ar_5,14
   *x'0A66';              ! *ar_6,6
   *x'4056';  *x'D0';     ! *sth_5,d0(6)
%end
%routine set svc(%integer n, disp)
   *x'0A5E';              ! *ar_5,14
   *x'0A66';              ! *ar_6,6
   *x'4056';  *x'9C';     ! *sth_5,9c(6)
%end
%routine set loc(%integer loc, disp)
   *x'0A5E';              ! *ar_5,14
   *x'5056';  *0;         ! *st_5,0(6)
%end
%routine sense status(%integer device, %integername status)
   *x'9D60';               ! *ssr_device, r0
   *x'5005';  *0;          ! *st_r0, status
%end
%routine write half(%integer device, half)
   *x'9865';               ! *whr_device, half
%end
%routine write data(%integer device, data)
   *x'9A65';               ! *wdr_device, data
%end
%routine read data(%integer device, %integername data)
   *x'9B60';              ! *rdr_6,0
   *x'5005';  *0;         ! *st_0,0(5)
%end
%routine read half(%integer device, %integername half)
   *x'9960';  *x'5005';  *0
%end
%routine command(%integer dev, com)
   *x'9E65';         !*ocr_r6,r5
%end
%routine notify(%integer console, %record(parmfm)%name p)
   console = console number %if console = 0
   tt == tty(console)
   tt_tell = 1 %if tt_flags&32 = 0
   p_dsno = console+96
   adsorb(p_dsno)
   inhibit(p_dsno)
   pon(p)
   tt_mode = 5 %and ttout %if tt_mode>>1 = 0
%end
%routine broadcast(%record(parmfm)%name p)
   %integer j
   %for j = 1, 1, consoles %cycle
      notify(j, p)
   %repeat
%end
%routine tell oper(%string(63) text)
   %record(parmxfm) p
   %integer c
   %if oper process # 0 %start
      c = proc(oper process)_console
      %if c # 0 %start
         p_text = text
         notify(c, p)
      %finish
   %finish
%end
%routine report(%string(63) message)
   %record(parmxfm) p
   %integer c
   p_text = message
   p_dsno = console sno;  p_dact = 3
   p_ssno = 0
   pon(p)
!!!!   %if oper process # 0 %start
!!!!      c = proc(oper process)_console
!!!!      notify(c, p) %if c # 0
!!!!   %finish
%end
%routine console(%record(parmxfm)%name p)

   ! commands

   %constinteger listen    = x'D4'
   %constinteger write data= x'C8'

   ! states

   %constinteger listening = 0
   %constinteger reading   = 1
   %constinteger writing   = 2
   %constinteger returning = 6

   %constinteger interrupt = 1
!  %constinteger read      = 2
   %constinteger write     = 3
   %constinteger writeit   = 4

   %integer activity
   %owninteger sym = cr
   %owninteger state = listening;       ! console state
   %owninteger pp;                      ! buffer pointer

   %switch act(1:4), int(0:7)

   activity = p_dact
   %return %unless 0 < activity <= 4
   ->act(activity)

   %routine psym(%integer s)
      *x'2412';           !*lis_r1, 2
      *x'9A16';           !*wdr_r1,r6
   %end
   %routine rsym(%integername sym)
                          ! addr(sym) in r6
      *x'2412';           !*lis_r1,2
      *x'9B10';           !*rdr_r1,r0
      *x'C400';  *x'7F';  !*nhi_r0,127
      *x'5006';  *0;      !*st_r0,0(r6)
   %end
   %routine select(%integer state)
                          ! state in r6
      *x'2412';           !*lis_r1,2
      *x'C800';  *enable; !*lhi_r0,enable
      *x'9E16';           !*ocr_r1,r6
      *x'9E10';           !*ocr_r1,r0
   %end

act(interrupt):
      ->int(state)

int(listening):
int(reading):
   rsym(sym)
   %return

int(writing):
   %if pp = length(output) %start
done: state = listening
      select(listen)
      uninhibit(console sno)
      %return
   %finish
   pp = pp+1;  sym = charno(output, pp)
   %if sym = nl %start
      sym = cr
      state = returning
   %finish
   psym(sym)
   %return

act(write):
   route = 0 %unless 0 <= route <= consoles
   %if route # 0 %start
      notify(route, p)
   %else
      inhibit(console sno)
      p_dsno = system sno;  p_dact = 5;  pon(p)
   %finish
   %return
act(writeit):
   pp = 0
   select(write data)
int(7):
int(returning):
   state = writing
   ->done %if pp = length(output)
   psym(lf)
%end
%routine tape(%record(parmfm)%name p)
   %constinteger tape dev = x'13'
   %record(parmfm) pp
   %owninteger ssno, sact, comm, rep
   %owninteger ccw, bytes
   %switch t(1:3)
   %unless 0 < p_dact <= 3 %start
      pp_dsno = p_ssno;  pp_dact = p_sact
      pp_p1 = -2;  pon(pp);  %return
   %finish
   rep = p_dact
   ->t(p_dact)

t(1):! interrupt
      %if p_p4 = 0 %start;       ! normal term
         pp_p1 = 0
done:    pp_p2 = ccb(1)_bytes0+bytes-1;         !bytes input
         pp_dsno = ssno;  pp_dact = sact
         ssno = 0
         pp_ssno = tape sno
         pon(pp)
         uninhibit(tape sno);  %return
      %finish
      ! abnormal term
      ->try %if p_p4&1 = 0;                    ! not du
      command(tape dev, disarm+x'20');        ! stop the tape
      pp_p1 = -1;  ->done

t(2):! reader
      ccw = x'181';  comm = x'09';  bytes = p_p2;  ->auto

t(3):! punch
      ccw = x'185';  comm = x'0A';  bytes = p_p2

auto: inhibit(tape sno)
      bytes = 1024 %if bytes > 1024
      sact = p_sact;  ssno = p_ssno
      ccb(1)_bytes0 = 1-bytes
      ccb(1)_address0 = p_p1-ccb(1)_bytes0
      ccb(1)_ccw = ccw
      ccb(1)_routine = tape exit
      shortinteger(x'D0'+2*tape dev) = addr(ccb(1))+1
try:  command(tape dev, disarm+x'20'+comm!!3)
      command(tape dev, enable+x'10'+comm)
%end
%routine lp demon(%record(parmfm)%name p)
   %constinteger lp dev = x'62'
   %record(parmfm) pp
   %owninteger ssno, sact, end addr
   %switch d(1:3)
   %unless 0 < p_dact <= 3 %start
      pp_dsno = p_ssno;  pp_dact = p_sact
      pp_p1 = -1;  pon(pp);  %return
   %finish
   ->d(p_dact)
d(1):! interrupt
      pp_p2 = 1-ccb(2)_bytes0
      %if p_p4 = 0 %or pp_p2 = 0 %start;! normal term
         pp_p1 = 0
         uninhibit(lp demon sno)
         pp_dsno = ssno;  pp_dact = sact
         pp_ssno = 0;  ssno = 0
         pon(pp);  %return
      %finish
      command(lp dev, disarm)
      %return %if ssno = 0
      tell oper("lp not ready")
      pp_dsno = lp demon sno;  pp_dact = 3
      pp_ssno = ssno;  pp_sact = sact;  sact = 0
      pp_p1 = end addr-pp_p2+1
      pon(pp)
      time bomb(lp demon altno, 2, 30);   !kick after 30 secs
      %return
d(3):!kick
      defuse(lp demon altno)
d(2):! output request
      ssno = p_ssno;  sact = p_sact
      inhibit(lp demon sno)
      p_p2 = 1024 %if p_p2 > 1024
      ccb(2)_bytes0    = 1-p_p2
      end addr = p_p1-ccb(2)_bytes0
      ccb(2)_address0  = end addr
      ccb(2)_ccw       = x'185'
      ccb(2)_routine   = lp exit
      shortinteger(x'D0'+2*lp dev) = addr(ccb(2))+1
      command(lp dev, enable)
   %end
%routine lk demon(%record(parmfm)%name p)

   %ownrecord(parmfm) monp
   %owninteger monn = 0
   %constinteger in dev = x'10'
   %constinteger outdev = x'11'

   %integer sym
   %owninteger pt, n, check
   %switch act(1:6)
   %ownrecord(parmfm) pp

!control characters

   %constinteger STX = x'82'
   %constinteger ENQ = x'85'
   %constinteger ACK = x'86'
   %constinteger NAK = x'95'
   %constinteger SYN = x'96'
   %constinteger ETB = x'97'
   %constinteger BEL = x'87'

!common states

   %constinteger idle = 0
   %constinteger null = 1
   %constinteger data = 2

!receiver states

   %constinteger checking = 3
   %constinteger count    = 5
   %constinteger init1    = 6
   %constinteger init2    = 7
   %constinteger ignore   = 8
   %constinteger maybe    = 9
   %constinteger sin      = 10

!transmitter states

   %constinteger ending   = 3
   %constinteger request  = 4
   %constinteger trans    = 5

   %ownshortinteger in state = init1;   ! to suppress initial overrun messages
   %ownshortinteger outstate = idle
   %ownshortinteger in  waiting = 0
   %ownshortinteger out waiting = 0

   ! Define link baud rate setting
   %constinteger  clock = x'40';   ! 0 => clock A, x'40' => clock B

   %switch in(idle:sin)
   %switch out(idle:trans)

   ->act(p_dact) %if 1 <= p_dact <= 6
   report("link bad dact")
   %return

act(1):!input interrupt
   read data(in dev, sym)
   monn = monn+1
   byteinteger(addr(monp_p1)-1+monn) = sym
   %if monn > 16 %start
      monn = 0
      monitor(monp, "Link:") %if poffmon&2048 # 0
      monp = 0
   %finish
   %if p_p4&b'11100000' # 0 %start
      %if instate = init1 %or instate = init2 %start
         instate = init1
         %return
      %finish
NO:   write data(out dev, nak)
      instate = sin
      outstate = ending
      %return
   %finish
   ->in(instate)

in(sin):    %if sym # syn %start
               write data(out dev, NAK)
            %else
               write data(out dev, SYN)
               in state = idle
            %finish
            %return
act(2):!output interrupt
         ->out(outstate)

in(idle):%if in waiting = 0 %or sym # enq %start
            ->no %unless sym = syn
out(ending):
            ->try out %if out waiting # 0
            write data(out dev, SYN)
            out state = null
            %return
         %finish
         write data(out dev, stx);            !go ahead
         outstate = null
         instate = maybe
         %return

in(maybe):
         %if sym = ENQ %start
            instate = count
            %return
         %finish
in(count):
         pt = addr(pp_p1)
         n = sym
         %if n <= 0 %or n > 24 %start
            out state = ending
            ->NO
         %finish
         check = n
         in state = data
         out state = null;  write data(out dev, ACK)
         %return

in(data):byteinteger(pt) = sym;  pt = pt+1
         check = check+sym
         out state = null;  write data(out dev, ACK)
         n = n-1
         instate = checking %if n = 0
         %return

in(checking):
         check = (check&255)!!(check>>8)!!sym
         %if check # 0 %start
            ->NO
         %finish
         write data(out dev, ETB)
         out state = ending

DONE:    instate = idle
         pp_dsno = pp_ssno
         pp_dact = pp_sact
         pp_ssno = 0
         pon(pp)
         uninhibit(link sno)
         in waiting = 0
         out waiting = 0

         %return

out(idle):
         %return

out(data):
         n = n-1
         %if n # 0 %start
            pt = pt+1;  sym = byteinteger(pt)
            write data(out dev, sym)
            check = check+sym
            %return
         %finish
         check = (check&255)!!(check>>8)
         write data(out dev, check)
         out state = null
         in state = null
out(null):
         out state = idle
         %return

in(null):
         instate = idle
         %if sym # ETB %start
            report("Link NAK")
            out state = null
            write data(out dev, SYN)
            %return
         %finish

         ->done

act(4):!output request
         pp = p
         inhibit(link sno)
         out waiting = 1
try out: out state = request
         n = 25
         pt = addr(pp_p1)-1
         write data(out dev, enq)
         %return
out(request):out state = data
            write data(out dev, N)
            %return
act(3):!input request
         pp = p
         inhibit(link sno)
         in waiting = 1
         instate = idle
         %return

act(5):!send transparent
         pp = p
         inhibit(link sno)
         instate = ignore
         pt = addr(pp_p1)-1
         n = 25
out(trans):
         out state = trans
         n = n-1
         ->done %if n = 0
         pt = pt+1;  write data(out dev, byteinteger(pt))
in(ignore):
         %return

act(6):!initialise

         pp = p
         inhibit(link sno)
         instate = init1

!set up the device

         command(in dev, clock+b'00110100');     !clock+8bits+odd
         command(in dev, b'01000001');    !enable input
         command(outdev, b'01000011');    !enable output
         read data(in dev, sym);         !clear out status byte
         %return
in(init1):
         %return %if sym # bel
         write data(out dev, syn)
         out state = null;  instate = init2
         %return
in(init2):
         instate = idle %and ->done %if sym = syn
         instate = init1
         %return

%end
%routine time bomb(%integer dsno, dact, when)
   %record(tofm)%name to
   %integer j
   %record(parmfm) p
   when = 5 %if when <= 0 %or when > 1000000
   %for j = 1, 1, time outs %cycle
      to == time out(j)
      %if to_dsno = 0 %start
         to_dsno = dsno;  to_dact = dact;  to_when = up time+when
         time outs pending = time outs pending+1
         %return
      %finish
   %repeat
   !no free slots, fire it now
   report("Time bomb fails")
   p_dsno = dsno;  p_dact = dact
   p_ssno = 0
   p_p1 = 0
   pon(p)
%end
%routine defuse(%integer dsno)
   %integer j
   %for j = 1, 1, time outs %cycle
      %if time out(j)_dsno = dsno %start
         time out(j)_dsno = 0
         time out(j)_when = infinity
         time outs pending = time outs pending-1
         %return
      %finish
   %repeat
%end
%routine clock tick
   %owninteger min = 60;  !to count 60 seconds
   %integer j
   %record(parmfm) p
   mask = mask!!b'10000000'

!  1 second has gone by
   integer(clock arg) = -100;  !count 100 ticks
   seconds = seconds+1
   %if seconds >= 24*60*60 %start;  !1 day later
      seconds = 0
      year day = year day+1
   %finish
   up time = up time+1

   min = min-1
   %if min <= 0 %start
      min = 60
      p_dsno = loader sno;  p_dact = 8
      p_ssno = 0
      pon(p) %if restart = 2;    !kick loader
   %finish

   !check for process timouts

   %if time outs pending > 0 %start
      %for j = 1, 1, time outs %cycle
         %if time out(j)_when <= up time %start
            p_dsno = time out(j)_dsno
            p_dact = time out(j)_dact
            p_ssno = 0
            p_p5 = m'TIME';  p_p6 = M' OUT'
            p_p1 = 0
            time out(j)_dsno = 0
            time out(j)_when = infinity
            pon(p)
            time outs pending = time outs pending-1
         %finish
      %repeat
   %finish
   %if up time >= wake when %start
      p_dsno = wake who+64;  p_dact = 1
      wake up(proc(wake who))
      pon(p)
   %finish

   %return %if up time&255 # 0;    !every 4 min

   %for j = first user, 1, processes %cycle
      %if proc(j)_id = j %and proc(j)_priv = 0 %start
         %if proc(j)_slept < up time-sleep limit*60 %start
            proc(j)_slept = up time
            p_dsno = p control sno;  p_dact = 7
            p_ssno = 0
            p_p1 = j
            pon(p)
            !!!report("Time out")
         %finish
      %finish
   %repeat
%end
%routine clock(%integer length)
   %constinteger clock dev = x'6C'
   *x'C810';  *clock dev
   *x'C660';  *x'8000';       ! ohi
   *x'9816'
   *x'C860';  *x'E0'
   *x'9E16'
   *x'C860';  *x'40'
   *x'9E16'
%end
%routine  stop selch
   %constinteger  selch = x'F0'
   %integer  status
   command(selch,64+8);   !32bit flag
   %cycle
      sense status(selch,status)
      %exit %if status&8 = 0
   %repeat
%end
%routine disc(%record(parmfm)%name p)

! dact = 1 : read block
!        2 : write block
!        3 : read pages
!        4 : write pages
!        5 : read (no retry)
!        6 : status 1-UNAVAILABLE, 2-NOT READY, 4-WRITE PROTECTED
!        7 : retry last command
!        8 : selch interrupt
!        9 : cart-cont interrupt
!       10 : cart-file interrupt
!       11 : big-cont interrupt
!       12 : move process (in store)

   !states

   %constinteger idle = 0
   %constinteger active = 1
   %constinteger waiting = 2
   %constinteger seeking = 3
   %constinteger retrying = 4

                                                  !devices

   %constinteger selch = x'F0'
   %constinteger cart cont = x'B6'
   %constinteger big cont = x'F4'

   !commands

   %constinteger reset   = 8
   %constinteger seek    = x'42'
   %constinteger restore = x'C1'

   %switch a(1:13)
   %integer error, j, max addr, addr limit
   %owninteger cop
   %owninteger act, req;                          !pending activity
   %owninteger permit;                            !non-zero to permit retry
   %owninteger retry;                             !retry count
   %ownshortinteger ssno, sact;                   !requesting address
   %ownshortinteger devno;                        !current device (file)
   %ownshortinteger surface;                      !head select
   %ownshortinteger count, blocks;                !no of blocks to transfer
   %ownshortinteger sector;                       !current sector number
   %ownshortinteger last track = -1;              !last track sought
   %ownshortinteger last file = -1
   %ownshortinteger track;                        !track wanted
   %ownshortinteger file;                         !disc address
   %ownshortinteger state = idle;                 !driver status
   %owninteger addr;                              !disc address

! * * * * * * * *  order significant  * * * * * * * * *
   %owninteger cont;                              !active controller
   %owninteger store;                             !store address
   %owninteger limit;                             !transfer end address
   %owninteger con op
   %owninteger sel op
! * * * * * * * * * * * * * * * * * * * * * * * * * * *

   %integer status, major, minor
   %string(23) mess
   %routine get status
      write half(big cont, x'1028')
      read half(big cont, major)
      read half(big cont, minor)
   %end
   %routine report status
      %string(23) text
      text = xtos(major)
      text = text." : "
      text = text.xtos(minor)
      report(text)
      retry = 0 %if major = x'4000' %and minor = x'2000'
   %end
   %routine  start transfer(%integername pointer)
      *x'C830'; *selch;     ! lhi 3,selch
      *x'D1B6';  *0;        ! lm r11,cont+store+limit+conop+selop
      *x'120E';             ! chvr r0,conop
      *x'2112';             ! bmfs 2 -> if neg
      *x'9EBE';             ! ocr cont,conop
      *x'342C';             ! exhr 2,12
      *x'9A32';             ! wdr 3,2
      *x'983C';             ! whr 3,12
      *x'342D';             ! exhr 2,13
      *x'9A32';             ! wdr 3,2
      *x'983D';             ! whr 3,13
      *x'120E';             ! chvr r0,conop
      *x'212A';             ! bpfs 2 -> if greater
   *x'080E';                           !lr_0,14
   *x'100C';                           !srls_0,12
   *x'C500';  *12;                     !clhi_0,12
   *x'2334';                           !BEFS_.+5
   *x'C500';  *8
   *x'2136';                           !BNEFS_.+5
      *x'98BE';             ! whr cont,conop  start telefile
      *x'9E3F';             ! ocr selch,selop
   %return
   %cycle;  %repeat
   %end

   selch owner = 0
   %if poffmon&64 # 0 %start
      p_p6 = state;  monitor(p, "disc<<<")
   %finish
   error = 0;                                     !assume no errors
   act = p_dact
   %unless 1 <= act <= 13 %start;                 !out of range
      p_dsno = p_ssno;  p_dact = p_sact
      p_ssno = 0;  p_p1 = -1;  pon(p)
      %return
   %finish

   %if act <= 6 %start;                           !initial request
      req = act
      permit = 1;  count = 1;  blocks = 1
      ssno = p_ssno;  sact = p_sact
      devno = p_p3
      error = -2 %and ->out %unless 1 <= devno <= devices
      addr = p_p1;                                !disc address
      store = p_p2;                               !store address
      %if req # 6 %and addr>>16 # 0 %start;       !too big
         error = -3;  ->out
      %finish
      max addr = addr
      %if devno >= 5 %start;                      !map address on big disc
         addr = addr+(devno-5)*x'10000'
         cont = big cont
         addr limit = x'10000'-1
      %else
         file = device(devno)
         cont = cart cont
         addr limit = 407*24
      %finish
   %finish
   ->a(act)

a(6):                                             !get status
   p_p6 = 0
   %if devno >= 5 %start
      get status
      error = major;  p_p3 = minor
      p_p6 = p_p6!4 %if minor&8 # 0;      !write protect
      p_p6 = p_p6!2 %if minor&x'70' # 0;  !unsafe+seek incomp+offline
   %else
      sense status(file, error)
      p_p6 = 1 %if error&1 # 0;            !not ready
      p_p6 = p_p6!2 %if error&x'7E' # 0
      p_p6 = p_p6!4 %if error&x'80' # 0;   !write prot
   %finish
   p_p2 = error
   ->out

a(5):                                             !read (if possible)
   permit = 0;                                    !no retry
   req = 3;                                       !map onto read block
   p_p4 = 1;                                      !only read 1 block

a(3):                                             !read pages
a(4):                                             !write pages
   count = p_p4
   error = -5 %and ->out %if count = 0 %or count>>16 # 0
   error = -5 %and ->out %if max addr+count > addr limit
   blocks = 24;                                   !biggest transfer
   req = req-2;                                   !map onto single r/w

a(1):                                             !read block
a(2):                                             !write block

                                                  !calculate address

   %if req = 2 %and prot(devno) # 0 %start
      error = -9;  ->out
   %finish
   %if devno >= 5 %start;                          !big disc
      sector = addr&31
      j = addr>>5
      surface = rem(j, 19)
      track = j//19
      error = -6 %and ->out %unless 0 <= track <= 815
      limit = store+count*512-1
      %if req = 2 %then cop = x'C000' %else cop = x'8000'
   %else;                                         !cartridge disc
next: j = addr<<1;                             !into 512 units
      sector = rem(j, 48)
      blocks = (48-sector)>>1
      %if sector >= 24 %start;            !switch surfaces
         sector = sector+8
      %finish
      track = j//48
      error = -6 %and ->out %unless 0 <= track <= 407
      blocks = count %if blocks > count
      limit = store+blocks*512-1
      conop = req
   %finish

                                                  !check all is well

   %if req = 2 %then selop = x'10' %else selop = x'30'
   inhibit(disc sno);                             !prevent interruptions

again:
   retry = 15
try:                                              !come here on retry
   retry = retry-1
   %if retry <= 0 %start;                         !give up
      report("retry fails")
      error = -7;  ->out
   %finish
   %if retry = 13 %start;                         !report retrying
      error = -7 %and ->out %if permit = 0
      mess = "retrying ".xtos(devno)
      report(mess)
      last track = -1;                            !force a seek
   %finish

   stop selch

   j = 10;                                        !in case of devious state

                                                  !check the controller status

   %if cont = cart cont %start;                   !cartridge disc
      last track = -1 %if (file!!last file)&(\1) # 0
      last file = file
      %cycle
         sense status(cont, status)
         %exit %if status&2 # 0;                  !idle
         j = j-1
         %if j <= 0 %start;                       !looping !!!
            report("status loop!")
            status = x'80';                       !to force a reset
         %finish
         %if status&x'80' # 0 %start;             !overrun
            report("overrun")
            command(cont, reset)
            last track = -1;                      !force a seek
            %exit
         %finish
      %repeat

                                                  !now check the file

      %cycle
         sense status(file, status)
         %if status&1 # 0 %start
            report(xtos(file)." not ready")
            ->wait
         %finish
         %exit %if status&x'10' = 0;              !no interlock
      %repeat
      %if status&2 # 0 %start;                    !seek incomplete
         state = retrying
         write half(file, 0)
         command(file, restore)
         last track = -1
         report("seek incomplete")
         %return;                                 !wait for an interrupt
      %finish

                                                  !do the seek

      %if track # last track %start
         write half(file, track)
         command(file, seek)
         state = seeking
         %return
      %finish
seek done:
      last track = track
      write half(file, track)
      write data(cont, sector)

   %else;                                         !big disc

      command(cont,1);                            !reset dc-16c
      write half(cont, x'0800');                  !select unit 0 & clear
      %cycle
         %cycle
            get status
            %exit %if minor&x'20' = 0
            write half(big cont, x'2800')
            j = j-1
            %if j <= 0 %start
               command(cont, 0);                !kick it in the pants
               report("seek incomplete")
               report status
               ->wait
            %finish
         %repeat
         %if minor&x'40' # 0 %start
            report("telefile not ready")
            report status
            ->wait
         %finish
         %exit %if major&x'A000' = 0
         j = j-1
         %if j <= 0 %start;                       !looping
            command(cont, 0);                     !shut it up
            report("status locked ")
            report status
            %exit;                                !hope for the best
         %finish
      %repeat
      write half(cont, x'1028');                  !enable ints
      write half(cont, x'6000'+track);            !linked seek
      conop = cop+surface<<6+sector;       !start it up
   %finish

                                                  !now start the selch

   %if store < protected %start
      report("overwrite system!")
      error = -9;  ->out
   %finish
   start transfer(cont);      ! also starts dc16
   state = active
   %return

a(7):                                             !kick (after error)
   error = p_p1 %and ->out %if p_p1 # 0;          !abandon
   %if state # waiting %start
      report("kick rejected");  %return
   %finish
   ->try

a(8):                                             !selch interrupt
   stop selch
   %if state # active %start
      report("spurious selch int");  %return
   %finish

                                               !check controller (cartridge only)

   %if cont = cart cont %start
      sense status(cont, status)
      %if status&x'80' # 0 %start
         report("overrun");  ->try;               !try again
      %finish
   %finish

                                                  !wait for the controller

   %return

a(9):                                             !cartridge controller interrupt
   %if state = idle %start
      report("spurious cont int");  %return
   %finish
   sense status(cont, status)
   %if status&x'20' # 0 %start;                   !def trk
      report("bad track") %if retry = 14
      ->try;                                      !try again
   %finish
   %if status&1 # 0 %start;                       !transfer error
      report("cont not ready ".xtos(status)) %if retry = 14
      sense status(file, status)
      %if status&128 # 0 %start
         report(xtos(file). " write protected")
wait:    time bomb(disc altno, 7, 10);    !wait 10 sec
         tell oper("Disc not ready")
         state = waiting;  %return
      %finish
      command(file, restore)
      command(cont, reset)
      ->try;                                      !try again
   %finish
   count = count-blocks
   %if count > 0 %start;                           !multiple read
      addr = addr+blocks;                          !onto next block
      store = store+512*blocks;                    !and next store page
      blocks = 24
      ->next
   %finish
   ->out

a(10):                                            !cart-file interrupt

   ->again %if state = retrying
   %if state # seeking %or p_p3 # file&(\1) %start
      !spurious or wrong disc
      report(xtos(p_p3)." spurious int")
      %return
   %finish
   sense status(file, status)
   ->seek done %if status&127 = 0;              !ignore write prot here
   %if status&x'20' = 0 %start
      report(xtos(file)." not ready")
      ->wait
   %finish
   report("illegal disc address")
   error = -8;  ->out

a(11):                                            !big controller interrupt

   get status
   ->out %if major&x'5000' = 0;                  !all ok
   %if retry = 14 %start
      report status
      report("Telefile def Trk") %and retry = 0 %if minor&x'200' # 0
   %finish
   ->try

a(12):!move process
   inhibit(disc sno)
   p_dsno = system sno;  p_dact = 7
   pon(p);  %return

a(13):!claim selch
      selch owner = -1
      inhibit(disc sno)
      p_dsno = p_ssno;  p_dact = p_sact
      p_ssno = 0
      pon(p)
      %return

out:
   p_dsno = ssno;  p_dact = sact
   p_ssno = 0;  ssno = 0
   p_p1 = error;  pon(p)
   monitor(p, "disc>>>") %if poffmon&64 # 0
   uninhibit(disc sno)
   state = idle
%end
%routine mag tape(%record(parmfm)%name p)
   ! 1 = claim
   ! 2 = release
   ! 3 = selch int
   ! 4 = MT int
   ! 5 = w/r selch claimed
   ! 6 = general selch claimed
   ! 7 - kick from clock
   ! 8 = read p2 = store addr, p4 = size
   ! 9 = write p2 = store addr, p4 = size
   ! 10 = general function p1

   !errors -1 invalid command (or not claimed)
   !       -2 tape in use
   !       -3 illegal buffer address
   !       -4 tape unavailable
   !       -5 no motion
   !       -6 transfer failure
   !       -7 termination error
   !       -8 time-out

   %constinteger selch = x'F0'
   %constinteger mt drive = x'C5'
   %owninteger ssno, sact, start, finish, status, error
   %owninteger state = 0, claimed = 0, owner = 0, dact, count
   %ownrecord(procfm)%name pr
   %constbyteintegerarray mtops(1:9)= x'20', x'70', x'78',
                                    ! clear  wfm    rewind
                                      x'63', x'53', x'51',
                                    ! skipf  skipr  backspace
                                      x'00', x'61', x'62'
                                    ! ??     read   write
   %owninteger selch op, mt op, x, tm
   %integer y
   %switch mt(1:10), int(0:2)
   dact = p_dact
   monitor(p, "TAPE>>>") %if poffmon&X'20000' # 0
   error = 0;  tm = 0
   %if dact <= 7 %or owner = p_ssno&31 %start
      ->mt(dact) %if 1 <= dact <= 10
      report("Bad MT activity")
   %finish
   error = -1
no:p_dsno = p_ssno;  p_dact = p_sact
   p_ssno = 0
   p_p5 = status;  p_p6 = error
   pon(p)
   %return

   %routine stop the tape
      %integer status
      command(mt drive, x'20');   !clear
      %cycle
         sense status(mt drive, status)
         %return %if status&17 # 0
      %repeat
   %end
   %predicate tape started(%integer op, action)
      command(mt drive, mtops(op))
      state = action
      sense status(mt drive, status)
      error = -5 %and %false %if status = 4;      !time-out
      error = -4 %and %false %if status&7 # 0
      %true
   %end
   %routine claim selch(%integer act)
      claimed = 1
      ssno = p_ssno;  sact = p_sact
      p_dsno = disc sno;  p_dact =13
      p_ssno = mt altno;  p_sact = act
      pon(p)
      inhibit(mt sno)
   %end
   %routine release selch
      uninhibit(disc sno) %and stop selch %if claimed # 0
      claimed = 0
   %end

mt(1):!claim MT
      error = -2 %and ->no %if owner # 0
      owner = p_ssno&31
      ->no
mt(2):!release MT
      owner = 0
      ->no
mt(8):!read p2=store addr, p4 = size
mt(9):!write p2=store addr, p4 = size
   %if dact = 8 %then selch op = x'30' %C
                %else selch op = x'10'
   mtop = dact
   pr == user process(p_ssno&31)
   start = p_p2;  finish = p_p4
   claim selch(5)
   %return
mt(5):           !reply from above
   %unless valid(pr, start, finish) %start
      error = -3;  ->done
   %finish
   finish = start+finish-1
   count = 5
int(2):          !retry
   stop selch

   write data(selch, start>>16);  write half(selch, start)
   write data(selch, finish>>16);  write half(selch, finish)
   state = 0
   command(mt drive, mt ops(mt op))
   command(selch, selch op)
   time bomb(mt altno, 7, 5);      !5 second wait
   %return
mt(10):!general function p1
   mt op = p_p1
   %unless 1 <= mt op <= 6 %start
      error = -1;  ->no
   %finish
   claim selch(6)
   %return
mt(6):!reply from above
   stop selch
   ->done %unless tape started(mt op, 0)
   release selch
   %return %if status&16 = 0;            !in motion
   ->done
mt(4):!mt interrupt
      sense status(mt drive, status)
      error = -3 %and ->done %if status&1 # 0;      !du
      tm = 1 %if status&64 # 0;      !tape mark
      %return %if status&16 = 0;      !still going
      ->int(state)

mt(7):report("MT times out")
      error = -8
      count = 0

mt(3):!selch interrupt
   stop selch
   %if claimed = 0 %start
      report("Spurious Selch int in MT")
      %return
   %finish
   read data(selch, x);  read half(selch, y)
   y = x<<16!y
   x = y-start+1;               !bytes transferred
   sense status(mt drive, status)
   %if status&128 # 0 %start
      count = count-1
      %if count <= 0 %start
         error = -6 %if error = 0
         ->done
      %finish
      report("Tape retrying") %if count = 4
      state = 1 %and %return %if status&16 = 0;      !still moving
int(1):
      ->done %unless tape started(6, 2);      !backspace
      %return
   %finish
   %if status&1 # 0 %start
      error = -4
      ->done
   %finish
   release selch
   %return;         !wait for MT controler
done:
int(0):
   state = 0
   uninhibit(mt sno);  defuse(mt altno)
   release selch
   p_dsno = ssno;  p_dact = sact
   p_ssno = 0;  ssno = 0;   !in case of extra interrupts
   p_p3 = x;            !bytes transferred
   p_p4 = tm;  p_p5 = status;  p_p6 = error
   pon(p)
   report("MT not ready") %if status&1 # 0
   stop the tape %if error # 0
%end
%predicate valid(%record(procfm)%name p, %c
                 %integername addr, %integer size)
   %integer end, seg, sr, limit
   end = addr+size-1
   seg = addr>>16&15
   %false %if seg # end>>16&15
   %false %if p == null proc
   sr = p_segs_r(seg)
   %false %if sr&present = 0
   limit = (sr>>20&255)*256+255;        !limit is inclusive
   addr = sr&x'FFF00' + addr&x'FFFF'
   end = end&x'FFFF'
   %false %if end > limit
   %true
%end
%routine p control(%record(parmfm)%name p)
   %record(procfm)%name pr
   %record(parmfm) pp
   %integer console, process, act, dev, sym, j
   %stringname sn
   %string(63) mess
   %switch sp(1:9)
   %routinespec put(%string(63) s)

   act = p_dact&15
   %unless 0 < act <= 9 %start
rej:  report("p control ".itos(act));  %return
   %finish
   console = p_dact>>4
   %if console = 0 %start
      ->rej %if act # 1 %and act # 7 %and act # 8
   %finish
   tt == tty(console)
   ->sp(act)

sp(1):! start from user console
   dev = p_p3
   console = console number
   ->rej %unless 0 < console <= consoles
   read data(dev, sym)
   %if sym&127 # ' ' %start
      ttclock(console) = ttclock(console)+x'40'
      command(dev, ttclock(console))
      %return
   %finish
   %return %if proc(1)_id # 1;      ! privs not going yet
   tt == tty(console);  tt = 0
   %if ttclock(console)&x'80' # 0 %start;   ! assume VDU if clock <= 2
      tt_flags = 8;               ! set VDU erase
      tt_page  = vdu page;        ! set page size
      tt_lines = vdu page
   %finish
   tt_tab(j) = j+j+j %for j = 1, 1, 10
   tt_device = dev;  tt_prev = nl
   tt_service = p control sno;         ! replies to here
   set entry(tt_device, vec(x'11'))
   tt_in act = console<<4+3;  tt_inreq = 1
   tt_prompt = "
User:";  ttin(1);  %return

sp(3):! reply from user prompt
   sn == string(addr(p_p1))
   length(sn) = length(sn)-1;   !strip <nl>
   ->sp6 %if sn = ""
   pack(file, sn.":")
   tt_t1 = file_owner;         !name
   tt_length = file_unit;         !unit
   tt_in act = console<<4+4;  tt_inreq = 1
   tt_prompt = "Password:";  ttin(1)
   tt_quiet = 1;  %return

sp(4):! reply from password prompt
   sn == string(addr(p_p1))
   length(sn) = length(sn)-1;   !strip <nl>
   length(sn) = 11 %if length(sn) > 11
   tt_quiet = 0
   pack(file, sn.":")
   tt_t2 = file_owner;       !password
   %if file_unit # 0 %start; !load specific subsystem
sp9:  tt_inact = console<<4+9;  tt_inreq = 1
      tt_prompt = "Subsystem:"
      ttin(1)
      %return
sp(9):sn == string(addr(p_p1))
      length(sn) = length(sn)-1;   !strip <nl>
      ->sp9 %if sn = ""
      pack(file, sn)
      pp_p3 = file_owner
      pp_p4 = file_name1
      pp_p5 = file_name2
   %else
!!!!      pp_p3 = 1 766 530 618;      !sysexe:
      pp_p3 = SUBSYS process id;   ! subsys:
      pp_p4 = 3 534;              !sub
      pp_p5 = 1 766 530 618;      !...sys.exe
   %finish
   pp_dsno = start proc sno;  pp_dact = console<<4+1
   pp_ssno = p control sno;  pp_sact = 5
   pp_p1 = tt_length;  !unit
   pp_p2 = tt_t1;      !name
   pp_p6 = tt_t2; !password
   pp_p6 = pp_p6!1<<31 %if pp_p2 = oper id %or pp_p2 = enginr id
   pon(pp)
   tt_length = 80;     !max line length
   tt_drain = ".";      !by default
   %return

sp(5):! reply from start proc
   %if p_p6 < 0 %start
      put(string(addr(p_p1)));  %return
   %finish
   oper process = p_p3 %if tt_t1 = oper id
   tt_service = p_p3+64
   tt_inact = 2;  tt_outact = 3
   %return

sp(7):! stop process
      big job in = 0;            !just in case
sp(8):! detach console
      process = p_p1
      process = p_ssno-64 %if p_ssno >= 64
      pr == user process(process);  %return %if pr == null proc
      mess = pr_owner." logged off "
      %if act = 7 %start
         %for j = first user, 1, processes %cycle
            proc(j)_reply = 0 %if proc(j)_reply = process+64
         %repeat
         oper process = 0 %if oper process = process
         potter sno = 0 %if potter sno = process+64
         account = 0 %if account = process
         %if account # 0 %start
            pp_dsno = account+64;  pp_dact = 2;      !log off
            pp_ssno = 0
            pp_p1 = pr_unit;  pp_p2 = pr_powner
            pp_p3 = up time;  pp_p4 = pr_cpu time
            pon(pp)
         %finish
         wake up(pr) %if pr_status&on timer q # 0
         cpugive(0) %if pr_status&on cpu # 0
         adsorb(process+64)
         adsorb(process+128)
         pr_params = 0
         pr_status = pr_status!stopping
         %if pr_status&on runq = 0 %start
            pp_dsno = process;  pp_dact = 0;  call process(pp)
         %finish
         pp_dsno = director sno;  pp_dact = 37;  pp_p6 = process
         pon(pp);            ! log off in director
         pp_dsno = potter sno;  pp_dact = 11;  pp_p1 = process;  pon(pp)
         !log off in potter
         %if pr_reply # 0 %start
            pp_dsno = pr_reply;  pp_dact = 8
            pp_ssno = 0
            pp_p1 = process
            pp_p2 = p_p2;               !reason (0=user stop)
            pon(pp)
         %finish
!!!         report(mess)
      %else
         mess = "Console disconnected"
      %finish
      %return %if pr_console = 0
      tt == tty(pr_console);  pr_console = 0
      tt_eput = 0;  tt_eget = 0;  tt_elimit = 0;  tt_flags = 0
      tt_in = 0;  tt_get = 0;  tt_inlimit = 0;  tt_service = 0
      tt_mode = 0 %if tt_mode = 1
      set dt
      mess = mess.date." ".time
      put(mess)
sp(6):!reply from put (error)
sp6:  tt_service = 0;  tt_outreq = 0
      set entry(tt_device, vec(x'10'))
      %return

   %routine put(%string(63) text)
      %integer j
      %for j = 1, 1, length(text) %cycle
         tt_put = tt_put+1
         tt_outv(tt_put&255) = charno(text, j)
      %repeat
      tt_put = tt_put+1
      tt_outv(tt_put&255) = nl
      tt_out limit = tt_put;  tt_outact = console<<4+6
      tt_outreq = 1
      ttout %if tt_mode = 0
   %end
%end
%routine start proc(%record(parmfm)%name p)
   !unit<p1> owner<p2> subsystem<p3:p4,p5> priv!password<p6>
   !replies p6=0 for success
   %owninteger state = 0, process = 0
   %owninteger unit, powner
   %integer j, password
   %record(parmxfm) ps
   %ownrecord(parmfm) pp
   %ownrecord(procfm)%name pr
   %record(parmfm) req
   %switch sp(1:5), fail(-7:-1)

   j = p_dact&15
   ->sp(j) %if 0 < j <= 5
   req_p6 = -2;               !ILLEGAL REQUEST
   req_dsno = p_ssno;  req_dact = p_sact
   req_sact = 0;  pon(req);  %return
sp(5):!special for oper startup
      %return %if users # 0
      report("OPER starts")
      p_p1 = 0
      p_p2 = oper id
      p_p3 = SUBSYS process id
      p_p4 = 3 534
      p_p5 = 1 766 530 618
      p_p6 = 1<<31
      p_dact = 2
      j = 8
sp(4):!user-start proc
sp(1):!start process
   inhibit(start proc sno)
   pp = p;              !SAVE FOR LATER
   %if users >= user limit %and pp_p6 >= 0 %start;   !let oper etc in
      report("System full!!!")
      req_p6 = -1;                ! system full
done: %if req_p6 < 0 %start
         ->fail(req_p6)

fail(-1):string(addr(req_p1)) = "System full";       ->done1
fail(-2):string(addr(req_p1)) = "Faulty subsystem"; ->done1
fail(-3):string(addr(req_p1)) = "Unknown user";      ->done1
fail(-4):string(addr(req_p1)) = "No user service";   ->done1
fail(-5):string(addr(req_p1)) = "Shutdown imminent"; ->done1
fail(-6):string(addr(req_p1)) = "Process running";   ->done1
fail(-7):string(addr(req_p1)) = "Invalid password"

      %finish
done1:req_dsno = pp_ssno;  req_dact = pp_sact!pp_dact&x'FF0'
      req_ssno = start proc sno;  pon(req)
      state = 0
      uninhibit(start proc sno)
      %return
   %finish
  !pick off relevant information
   unit = pp_p1
   powner = pp_p2
   password = pp_p6<<1>>1;      !loose priv bit
   password = -7 %if password = 0;        !JUST IN CASE
   %if password = system pass %or j # 1 %start
      password = 0
   %else
      password = password!open %unless pp_p6 < 0;  !privileged
   %finish
   !now get a process slot
   process = 0
   %for j = first user, 1, processes %cycle
      %if proc(j)_id = 255 %start;       !UNUSED
         process = j %if process = 0
      %else %if proc(j)_powner = powner %and proc(j)_id = j %start
         req_p6 = -6;  ->done
      %finish
   %repeat
   %if process = 0 %start;                   !NONE FOUND
      req_p6 = -1;                            !GIVE sYSTEM FULL
      report("process slot lost")
      ->done
   %finish
   !ask director to log the user on
   req_dsno = director sno;  req_dact = 36;   ! get user
   req_ssno = start proc altno;  req_sact = 2
   req_p1 = unit
   req_p2 = powner
   req_p3 = password
   req_p6 = process
   pon(req);  %return
sp(2):
   req_p6 = open-3
   %if p_p6 # 0 %start;      !director objects
      req_p6 = -7 %if open = 0 %and p_p6 = -3
      ->done
   %finish
   pr == proc(process);  pr = 0
   pr_powner = powner
   pr_reply = pp_ssno %if pp_dact&15 = 4
   pr_slept = real time;  pr_time limit = infinity
   pr_alarm = infinity
   pr_queue = 1;  pr_priv = pp_p6>>31;  pr_prio = 1
   file_unit = 0;  file_owner = powner
   file_name1 = 0;  file_name2 = 0
   unpack(file, pr_owner)
   length(pr_owner) = length(pr_owner)-1;      !strip colon
   pr_console = pp_dact>>4
   pr_unit = p_p1;       !unit NAME
   unit = p_p2;         !director's unit number

   req_p1 = 0
   req_p2 = pp_p3
   req_p3 = pp_p4
   req_p4 = pp_p5
   req_dsno = loader sno;  req_dact = 3
   req_ssno = start proc altno;  req_sact = 3
   req_p6 = process
   pon(req);                          !let loader start it up
   %return
sp(3):!reply from loader startup process
   req_p6 = -2 %and ->done %if p_p1 # 0;   !failed
   pr_user_ps = user status
   pr_user_pc = P_P2
   pr_user_gpr_r(14) = P_P2
   pr_user_gpr_r(13) = P_P3
   pr_user_gpr_r(7)  = x'D0000'
   pr_user_gpr_r(4)  = p_p2+x'18'
      %if p_p4 # 0 %start;      !new standard
         pr_user_gpr_r(14) = p_p4
         pr_user_pc = p_p5
      %finish
   pr_id = process
   req_dsno = loader sno;  req_dact = 2
   req_ssno = 0;  req_sact = 0
   req_p1 = process
   req_p2 = pp_dact&4
   pon(req)
   req_p6 = 0;                 ! successful
   req_p3 = process
   users = users+1
   %if account # 0 %start
      p_dsno = account+64;  p_dact = 1;      !log on
      p_ssno = 0
      p_p1 = pr_unit;  p_p2 = pr_powner
      p_p3 = up time;  p_p4 = year day;  p_p5 = pr_console
      pon(p)
   %finish
   ->done
%end
%routine enqueue(%integer process)
   %record(procfm)%name pr
   %integer qn
   %record(qfm)%name q
   pr == proc(process)
   pr_status = pr_status!on runq
   %if process = SYSTEM SNO&31 %start
      !the paging demands that THE SYSTEM PROCESS, when called,
      !will pr-empt anything otherwise disc messages etc.
      !can get out of sequence and be given old process
      !addresses with fatal results!
      queue0 = PROCESS
      cpugive(-1)
   %else
      qn = pr_prio
      qn = 1 %and pr_prio = 1 %unless 0 < qn <= 3 %and process > 3
      q == queue(qn)
      q_on = q_on+1
      qarea(q_on&31+qn*32-32) = process
      cpugive(-1) %if curproc_prio > qn;      !pre-empt
   %finish
%end
!
%routine cpu give(%integer why)
!      why : -1 = pseudo time-up (pre-empt)
!             0 = general release (no enqueue)
!             1 = time slice
   %owninteger last slice = 250
   %record(parmfm) pp
   %integer process, used, ad, t
   %record(ucontfm)%name new
   %record(contfm)%name old
   curproc_status = curproc_status&(\on cpu)
   curproc_slept = up time
   used = last slice-integer(time left)+1;         !force a tick
   curproc_cputime = curproc_cputime+used
   process = curproc_id;              !current process number
   %if process # 0 %start;            !don't unload idle
      %if process <= 3 %start
         exec time = exec time+used
      %else
         user time = user time+used
      %finish
      %if why # 0 %start;                 !from clock
         %if process = system sno&31 %start;          !never slice system
            last slice = 400
            integer(time left) = last slice
            curproc_status = curproc_status!on cpu;  %return
         %finish
         enqueue(process)
      %finish
      *X'C800';  *X'20F0';         ! *LHI_0,X'20F0'
      *X'9510';                    ! *EPSR_1,0
                                   ! NOW IN USER REGS
      *X'50F0';  *ATEMP;           ! *ST_15,ATEMP
      *X'58F0';  *REG ADDR;        ! *L_15,REGADDR
      *X'D00F';  *8;               ! *STM_0,8(15)
      *X'710F';  *72;              ! *STME_0,72(15)
      *X'5800';  *ATEMP;           ! *L_0,ATEMP
      *X'500F';  *68;              ! *ST_0, 68(15)
      *X'C800';  *X'2000';         ! *LHI_0,X'2000'
      *X'9510';                    ! BACK IN SYSTEM REGS
   %finish


choose:! the next process for the cpu

   %if queue0 # 0 %start
      last slice = 400
      process = system sno&31;  queue0 = 0;  ->load
   %finish

   %if queue(1)_off # queue(1)_on %start
      queue(1)_off = queue(1)_off+1
      process = qarea(queue(1)_off&31)
      last slice = slices(1)
      ->load
   %finish
   %if queue(2)_off # queue(2)_on %start
      queue(2)_off = queue(2)_off+1
      process = qarea(queue(2)_off&31+32)
      last slice = slices(2)
      ->load
   %finish
   %if queue(3)_off # queue(3)_on %start
      queue(3)_off = queue(3)_off+1
      process = qarea(queue(3)_off&31+32+32)
      last slice = slices(3)
      ->load
   %finish

   ! nothing there so choose idle

   curproc == proc(0)
   regs = addr(curproc_user)
   display(1, 0)
   last slice = 400
   integer(time left) = last slice
   %return

load:

   curproc == proc(process)
   curproc_status = curproc_status&(\on runq)
   %if curproc_status # 0 %start
      %if curproc_status&stopping # 0 %start
         old time = old time+curproc_cputime
         curproc_cputime = 0
         pp_dsno = user seg sno;  pp_dact = 3;          !delete all
         pp_ssno = 0;  pp_p6 = process;  pon(pp);  ->choose
      %finish
      ->choose %if curproc_status&cont load = 0
      curproc_params = 0
      curproc_status = curproc_status&(\cont load)
      %cycle
         %unless 0 <= curproc_clevel <= 5 %start
            pp_dsno = p control sno;  pp_dact = 7
            pp_ssno = 0;  pp_sact = 0
            pp_p1 = process;  pp_p2 = 1;  pon(pp)
            report(curproc_owner." fails")
            abort(m'Fail') %if poffmon&256 # 0
            ->choose
         %finish
         ad = curproc_caddr(curproc_clevel)
         curproc_clevel = curproc_clevel-1
         %exit %if valid(curproc, ad, 176)
      %repeat
      new == record(ad)
      new_old = curproc_user
      old == record(addr(curproc_user_ps))
      old = new_new
      curproc_user_ps = curproc_user_ps&15!user status&(\15)
      %if curproc_status&cont wait # 0 %start
         curproc_status = curproc_status&(\cont wait)
         uninhibit(process+128)
         ->choose
      %finish
   %finish
   display(1<<process, 1<<(curproc_queue-1)!mask)
   %if process # system sno&31 %start
      abort(m'Shuf') %if shuffling # 0;!<<<<<<<<<<<<<<<<<<<<
      %if process > 3 %start;      !check for nearly timed out
         t = curproc_residence-curproc_cputime
         t = 0 %if t < 0
         last slice = t %if t < last slice
      %finish
   %finish
   integer(time left) = last slice
   curproc_status = curproc_status!on cpu
   regs = addr(curproc_user)
   *X'C800';  *X'20F0';            ! *LHI_0,X'20F0'
   *X'9510';                       ! *EPSR_1,0
                                   ! NOW IN USER REGS
   *X'58F0';  *REGADDR;            ! *L_15,REGADDR
   *X'D10F';  *104;                ! *LM_0,104(15)
   *X'D000';  *SYS SEGS;           ! *STM_0,SEG REGS
   *X'58F0';  *REGADDR;            ! *L_15,REGADDR
   *X'720F';  *72;                 ! *LME_0,72(15)
   *X'D10F';  *8;                  ! *LM_0,8(15)
   *X'E200';  *0;                  ! *SINT_0
                                   ! back in system regs
%end
%routine call process(%record(parmfm)%name p)
   %integer process, f, b
   %record(procfm)%name pr
   process = p_dsno&31
   pr == user process(process);  ->error %if pr == null proc
   %if (p_dact # pr_params %and pr_params # 0) %or pr_status&busy # 0 %start
      p_dsno = process+128
      inhibit(p_dsno);  pon(p);  %return
   %finish
   pr_params = 0
   pr_user_fpr = p
   %if poffmon&32 # 0 %or procmon = process %start
      monitor(p, pr_owner."  <-")
   %finish
   %if pr_status&(on cpu!on runq!on timerq!blocked) = 0 %start
      %if pr_status&waiting # 0 %start;            !on sleepq
         pr_status = pr_status&(\waiting)
         f = fq(process);  b = bq(process)
         fq(b) = f
         bq(f) = b
         sleepq = b %if sleepq = process
         sleepq = 0 %if f = process
         fq(process) = 0;  bq(process) = 0
      %finish
      %if pr_status&incomplete # 0 %start;      !incomplete
         p_dsno = activate sno;  p_dact = 2;    !to load queue
         p_p1 = process
         pon(p)
         pr_status = pr_status!blocked
      %finish
      %if pr_params = 0 %start
         enqueue(process) %if pr_status&(incomplete!activated!blocked)=0
      %finish
   %finish
   %return
error:
   report("no process ".xtos(process))
   p_dsno = p_ssno;  p_dact = p_sact
   p_sact = 0
   p_p1 = -1;  p_p6 = -1
   pon(p)
%end
%routine wake up(%record(procfm)%name pr)
   %byteintegername wn
   wn == wake who
   %while wn # 0 %cycle
      %if wn = pr_id %start
         wn = pr_time chain
         pr_time chain = 0
         pr_status = pr_status&(\on timer q)
         wake when = proc(wake who)_alarm
         %return
      %finish
      wn == proc(wn)_time chain
   %repeat
%end
%routine echo(%integer sym)
   %if tt_quiet = 0 %or sym = nl %start
      tt_eput = tt_eput+1
      tt_echo(tt_eput&127) = sym
      tt_elimit = tt_eput %if sym = nl
   %finish
   ttout %if tt_mode>>1 = 0
%end
%routine print text(%string(63) text)
   %integer sym, j, len
   len = length(text);  len = 23 %if len > 23
   %for j = 1, 1, len %cycle
      sym = charno(text, j)
      tt_outpos = tt_outpos+1
      tt_outpos = 0 %if sym = nl %or sym = cr
      %if tt_length # 0 %and tt_outpos > tt_length %start
         tt_put = tt_put+1
         tt_outv(tt_put&255) = nl
         tt_outpos = 0;  tt_outlimit = tt_put
      %finish
      tt_put = tt_put+1
      tt_outv(tt_put&255) = sym
      tt_outlimit = tt_put %if sym < 32
!CR=      test card %if cardp # 0
   %repeat
%end

!
%routine user svc
   ! svcarg >100 for privileged svc's
   !   1  - stop
   !   2  - prompt flags<p1> text<sp2>
   !   3  - console input
   !   4  - console output text<sp1>
   !   5  - locate process id<p1>
   !   6  - kill i/o
   !   7  - date & time  -> date<sp1> time<sp4>
   !   8  - create segment size<p2> seg<p3>
   !   9  - destroy segment n<p1>
   !  10  - load file
   !  11  - segment info seg<p1>
   !  12  - performance info
   !  13  - unpack date
   !  14  - get proc info proc<p1> -> powner<p1>,cputime<p2>, store<p3>,
   !                                  uptime<p6>
   !  15  - load file
   !  16  - poff   sact = reply wanted (0 = any)
   !  17  - pack   file<sp1> -> p1,p2,p3<owner>
   !  18  - unpack p1,p2,p3<owner> -> file<sp1>
   !  19  - info seconds<p1> users<p2> cpu<p3>
   !             date<p4> owner<p5> version<p6>
   !  20  - to director & wait
   !  21  - set time limit <p1> seconds from now
   !  22  - message to potter
   !  23  - wake after p1 .01 secs.
   !  24  - stack contingency vector<p1>
   !  25  - unstack contingency to<p1>
   !  26  - fire contingency weight<p1> at<p2>
   !  27  - resume from contingency vector<p1> repeat<p2>
   !  28  - info 2 users<p1> clevel<p2> console<p3> priv<p4>
   !  29  - set param<p1> value<p2>
   !  30  - validate addr<p1> size<p2>
   !  31  - detach process
   !  32  - protect segment<p1>
   !  33  - delete segs<p1>
   !  34   - pack date <sp1> -> <p1>
   !  35   - unpack time <p1> -> <sp1>
   !  36   - user message to account
   !=======================================================
   !================= privileged svcs =====================
   !=======================================================
   ! 101  - disc read discaddr<p1> storeaddr<p2> disc<p3> process<p4>
   ! 102  - disc write     ""            ""       ""         ""
   ! 103  - set swop disc
   ! 104  - operator message
   ! 105  - MT operation
   ! 106  - read segment
   ! 107  - write segment
   ! 108  - disc status unit<p3>
   ! 109  - start process console<p1> owner<p2> disc<p3>
   !                      pass<p4>file<p5> reason<p6>
   ! 110  - get resident buffer
   ! 111  - lp demon
   ! 112  - pt demon
   ! 113  - broadcast
   ! 114  - get unit no
   ! 115  - pon (no wait)
   ! 116  - pon
   ! 117  - read real <p1>
   ! 118  - write real addr<p1> value<p2>
   ! 119  - define potter
   ! 120  - tell process<p1> text<p2>
   ! 121  - inhibit service<p1>
   ! 122  - uninhibit service<p1>
   ! 123  - boot  dev<p1> restart<p2>
   ! 124  - privilege process<p1> priv<p2>
   ! 125  - hazard/protect dev<p1> prot<p2>
   ! 126  - stop process<p1>
   ! 127  - lk demon
   ! 128  - define accountant
   ! 129  - resume & time out
   ! 130  - CR demon
   ! 131  - SHUTDOWN process P1
   ! 132  - get/set residences(1:4) & slice (5)

   %switch svc(1:36), psvc(101:132)
   %ownshortinteger user sact = 6
   %byteintegername wn
   %integer process, limit, j, term
   %record(ucontfm)%name reg
   %record(procfm)%name pr, tp
   %record(parmfm) p, pp

   pr == svcproc
   process = pr_id
   pr_prio = 2
   pr_residence = pr_residence-svc charge
   cpu give(0)
   p = pr_user_fpr;         !svc parameters in fp regs
   p_ssno = process+64
   %if poffmon&4 # 0 %or procmon = process %start
      monitor(p, pr_owner."  svc ".itos(svcarg))
   %finish
   ->psvc(svcarg) %if pr_priv # 0 %and 100 < svcarg <= 132
   contingency(process, 7) %and %return %unless 0 < svcarg <= 36
   ->svc(svcarg)

psvc(132):   !get/set scheduling info

      %if p_p6 = 0 %start
         residences(1) = p_p1
         residences(2) = p_p2
         residences(3) = p_p3
         residences(4) = p_p4
      %else
         p_p1 = residences(1)
         p_p2 = residences(2)
         p_p3 = residences(3)
         p_p4 = residences(4)
      %finish
      ->tell

psvc(128):  account = process;  ->enret
svc(36):   p_p1 = -1 %and ->tell %if account = 0
           p_dsno = account+64;  p_dact = 4
           ->pwait
psvc(119):  potter sno = process+64
            p_p1 = pr_unit
            p_p2 = pr_powner
            p_p6 = potter sno
            ->tell

psvc(115):!***** pon (no wait) *****

         svcarg = 0

psvc(116):!***** pon *****

         %unless 0 <= p_dsno <= max service %or p_dsno > 64 %start
            contingency(process, 8);  %return
         %finish
         pon(p)
         ->enret %if svcarg = 0
         p_sact = 0 %if process = system sno&31;         !we never wait!!

svc(16):! poff

         pr_params = p_sact
         ->sleep %if svcarg = 16 %and process > 3;      !let it page out
         %return

svc(17):p_dact = 3;  ->swait;          !PACK FILENAME
svc(18):p_dact = 4;  ->swait;          !UNPACK FILENAME
svc(7): p_dact = 2;  ->swait;          !DATE & TIME
svc(13):p_dact = 6;  ->swait;          !UNPACK DATE
svc(34):p_dact = 8;  ->swait;          !pack date
svc(35):p_dact = 9;  ->swait;          !unpack time

swait:  p_dsno = system sno;  pon(p);  pr_params = 7;  %return

svc(12):!performance info

      p_p1 = proc(0)_cputime-idle time;  idle time = proc(0)_cputime
      p_p2 = user time;  user time = 0
      p_p3 = exec time;  exec time = 0
      p_p4 = up time-period;  period = up time
      p_p5 = up time
      ->tell

svc(19):

      p_p1 = up time
      p_p2 = users
      p_p3 = proc(0)_cpu time
      p_p4 = year day
      p_p5 = seconds
      string(addr(p_p6)) = version

tell: p_dsno = process;  p_dact = 1;  call process(p);  %return

svc(11):!seg info seg<p1> process<p2>

      p_p1 = -1 %and ->tell %unless 0 <= p_p1 <= 15
      %if p_p2 # 0 %start
         pr == user process(p_p2)
         p_p1 = -1 %and ->tell %if pr == null proc
      %finish
      p_p2 = pr_segs_r(p_p1)
      p_p3 = pr_page(p_p1)
      %if p_p3 # 0 %start
         p_p4 = amt(p_p3)_flags
         p_p5 = amt(p_p3)_size
         p_p6 = amt(p_p3)_users
      %finish
      ->tell

svc(14):!get proc info

      p_p1 = process %if p_p1 = 0
      pr == user process(p_p1)
      p_p6 = -1 %and ->tell %if pr == null proc
      p_p1 = pr_unit
      p_p2 = pr_powner
      p_p3 = pr_store
      p_p4 = pr_priv<<31+pr_clevel+pr_queue<<8
      p_p5 = pr_cputime
      p_p6 = pr_console
      ->tell

svc(28):! info 2 max store<p1> swop unit<p2> no. of message cells<p3> no. of processes<p4>

      p_p1 = max store
      p_p2 = swop disc
      p_p3 = nparms
      p_p4 = processes
      ->tell

svc(29):! set param<p1> terminal<p2> value<p3>

      term = p_p2;  ->enret %if term # 0 %and pr_priv = 0
      term = pr_console %if term = 0
      ->enret %unless 0 < term <= consoles
      tt == tty(term)
      %begin
         %switch set(1:10)
         %integer j, n, here
         ->set(p_p1) %if 0 < p_p1 <= 10
         ->out

set(1):  tt_length = p_p3;                             !width
         tt_length = 0 %if tt_length < 0
         ->out

set(2):  tt_page = p_p3;                     !page in lines
         tt_lines = tt_page
         ->out

set(3):  tt_flags = (tt_flags&(\8))!(p_p3&8);     !erase bit
         ->out

set(4):  tt_shift = p_p3;                         !so=1, si=0
         ->out

set(5):  here = 0
         %for j = 0, 1, 9 %cycle
            n = byteinteger(j+addr(p_p3))
            %if n > here %then here = n %else here = here+3
            here = 70 %if here > 70
            tt_tab(j+1) = here
         %repeat
         ->out

set(6):  tt_flags = tt_flags&(\16)!p_p3&16
         ->out

set(7):  ttclock(term) = (ttclock(term)&b'00111111')! p_p3<<6
         command(term*2+ttbase-2, ttclock(term));  ->out

set(8):  tt_flags = tt_flags&(\32) ! p_p3&32
         tt_tell = 1 %if tt_flags&32 = 0
         ->out

set(9):  byteinteger(addr(p_p3)) = 15 %if byteinteger(addr(p_p3)) > 15
         tt_doing = string(addr(p_p3));  ->out

set(10):!set drain char
         tt_drain = p_p3
         ->out

out:  %end
      ->enret

svc(5): !locate process<p2>

         %for j = 1, 1, processes %cycle
            %if proc(j)_id = j %and  proc(j)_powner = p_p2 %start
               p_p1 = j+64;  ->tell
            %finish
         %repeat
         p_p1 = 0
         ->tell

svc(30):!validate

         %if valid(pr, p_p1, p_p2) %then p_p1 = 0 %else p_p1 = -1
         ->tell

psvc(117):p_p2 = integer(p_p1&(\3));  ->tell
psvc(118):integer(p_p1&(\3)) = p_p2;  ->enret

sverr:   contingency(process, 9);  %return

svc(3):! console input

      ->stop %if pr_console = 0
      pr_prio = 1
      %if pr_store >= half left %then pr_queue = 2 %else pr_queue = 1
      tt == tty(pr_console)
      tt_inreq = 1
      send input %and %return %if tt_inlimit # tt_get
      ttin(1)
      pr_params = 2

      !      S L E E P

sleep:pr_status = pr_status!waiting
      pr_queue = up queue(pr_queue)
      big job in = 0 %if big job in = process
      toq(process, sleepq)
      p_dsno = activate sno;  p_dact = 3;  pon(p);       !kick activate
      %return

svc(4):! console output

      ->enret %if pr_console = 0
      tt == tty(pr_console)
      ->enret %if tt_flags&4 # 0
      print text(string(addr(p_p1)))
      %if tt_put-tt_out < 256-25 %start
         enqueue(process)
      %else
         tt_outlimit = tt_put %if tt_outlimit = tt_out;  !dire straits
         pr_params = 3
         tt_outreq = 1
      %finish
      ttout %if tt_mode = 0
      %if tt_outreq # 0 %start
         pr_prio = 1
         %if pr_store >= half left %then pr_queue = 2 %else pr_queue = 1
         ->sleep
      %finish
      %return

svc(6):!kill i/0 <p1>/<p2>

      ->enret %if pr_console = 0
      tt == tty(pr_console)
      %if p_p1&1 # 0 %start;        !kill input
         tt_get = tt_inlimit;  ttin(-2)
      %finish
      %if p_p1&2 # 0 %start;        !kill output
         tt_put = 0;  tt_out = 0;  tt_outlimit = 0
         tt_mode = 4 %if tt_mode = 3;            !printing -> ending
         echo(nl)
         tt_outpos = 0
      %finish
      %if p_p1&4 # 0 %start;   !force output
         tt_outlimit = tt_put
         ttout %if tt_mode = 0
      %finish
      ->enret

svc(2):! prompt flags<p1> text<sp2>

      ->tell %if pr_console = 0
      tt == tty(pr_console)
      byteinteger(addr(p_p2)) = 19 %if byteinteger(addr(p_p2)) > 19
      tt_prompt = string(addr(p_p2))
      tt_quiet = p_p1&1
      p_p1 = tt_in-tt_get
      ->tell

svc(21):! time limit <p1>

      pr_time limit = pr_cputime+p_p1*1000
      ->enret

svc(23):! wake after <p1> 0.01 secs

      wn == wake who
      j = p_p1+up time
      %while wn # 0 %cycle
         tp == proc(wn)
         %exit %if tp_alarm > j
         wn == tp_time chain
      %repeat
      pr_time chain = wn;  wn = pr_id
      pr_alarm = j
      pr_status = pr_status!on timer q
      wake when = proc(wake who)_alarm
      ->sleep

svc(15):p_dsno = loader sno;  p_dact = 4;  ->pwait

svc(22):%if potter sno = 0 %start;         !not loaded
           string(addr(p_p1)) = "Q not available"
           p_p6 = -18
           ->tell
        %finish
        p_dsno = potter sno;  p_dact = p_dact&x'FF'!pr_priv<<15;  ->pwait

svc(20): p_dsno = director sno
         p_dact = p_dact&x'FF'!pr_priv<<15
         ->pwait

psvc(109):p_dsno = start proc sno;  p_dact = 4
          ->pwait

psvc(110): p_dact = 7;  ->segw
svc(8):    p_dact = 1;  ->segw
svc(9):    p_dact = 2;  ->segw
svc(32):   p_dact = 8;  ->segw
svc(33):   p_dact = 9

segw:      p_dsno = user seg sno;  p_p6 = process;  ->pwait

svc(10):pack(file, string(addr(p_sact)))
        p_p1 = file_unit
        p_p2 = file_owner
        p_p3 = file_name1
        p_p4 = file_name2
        p_p6 = process
        p_dsno = loader sno;  p_dact = 3;  ->pwait

psvc(131):!shutdown process<p1>
      enqueue(process)
      process = p_p1
      pr == user process(p_p2)
      %return %if pr == null proc
      contingency(process, -2)
      %return
psvc(126): !stop process<p1>

      enqueue(process)
      process = p_p1

stop:
svc(1):    ! stop
svc(31):   ! detach

         pp_dsno = p control sno;  pp_dact = 7
         pp_dact = 8 %if svcarg = 31
         pp_ssno = 0
         pp_p1 = process;  pp_p2 = 0;  pon(pp)
         ->enret %if svcarg = 31;    !detach
         %return

svc(24):! stack contingency

      p_p1 = -1 %and ->tell %if pr_clevel >= 5
      pr_clevel = pr_clevel+1
      p_p2 = pr_clevel
      pr_caddr(pr_clevel) = p_p1
      p_p1 = 0
      ->tell

svc(25):! unstack contingency to<p1>

      limit = p_p1;  p_p1 = 0
      %if limit <= 0 %start;       !SET CONTINGENCY LEVEL
         limit = \limit %unless limit = 0
         %if limit <= pr_clevel %start;     !VALID
            pr_clevel = limit
         %else
            p_p1 = -1;                    !INVALID
         %finish
      %else %if pr_clevel < limit %start
         p_p1 = -1
      %else;                        !REMOVE SO MANY LEVELS
         pr_clevel = pr_clevel-limit
      %finish
      p_p2 = pr_clevel;                    !REPLY WITH CURRENT DEPTH
      ->tell

svc(26):! fire contingency weight<p1> level<p2>

      pr_clevel = p_p2 %if 0 < p_p2 <= pr_clevel
      contingency(process, p_p1)
      %return

psvc(129):! resume & time-out

svc(27):! resume from contingency vector<p1> again<p2> level<p3>

      j = p_p1;  limit = 7
      %if valid(pr, j, 176) %start
         reg == record(j)
         pr_user = reg_old
         pr_user_ps = pr_user_ps&15 ! user status&(\15)
         p_p3 = pr_clevel+1 %if p_p3 = 0
         pr_clevel = p_p3 %if 0 <= p_p3 <= 5
         ->enret %if p_p2 = 0
         limit = p_p2
      %finish
      contingency(process, limit)
      %return

psvc(113):!broadcast string(p1)

      broadcast(p);  ->enret

psvc(120):!tell process<dsno> text<p1>

      p_dsno = p_dsno&31
      %if p_dsno = 0 %start
         p_dsno = oper process
         ->main log %if p_dsno = 0
      %finish
      pr == user process(p_dsno)
      p_p1 = -1 %and ->tell %if pr == null proc
      notify(pr_console, p) %if pr_console # 0
      p_p1 = 0;  ->tell

psvc(121):!inhibit service<p1>

      inhibit(p_p1) %if 0 < p_p1 <= services
      ->enret

psvc(122):!uninhibit service<p1>

      uninhibit(p_p1) %if 0 < p_p1 <= services
      ->enret

psvc(123):!boot unit no.<p1> restart<p2>

      restart = p_p2
      integer(0) = device(p_p1)
      *x'5880';  *0;         !pick up device
      *x'4300';  *x'C04';    !jump to loader

psvc(124):!priv process<p1>

      proc(p_p1)_priv = p_p2 %if 3 < p_p1 <= processes
      ->enret

psvc(125):!hazard/protect device<p1> prot<p2>

      p_p1 = -1 %and ->tell %unless 0 < p_p1 <= devices
      prot(p_p1) = p_p2
      p_p1 = 0
      ->tell

main log:
psvc(104):!***** operator message ***** operator message

      p_dsno = console sno;  p_dact = 3
      ->enret

psvc(103):!set swop disc

      swop disc = p_p1
      p_dsno = loader sno;  p_dact = 5;  p_ssno = 0
      pon(p);               !inform loader
      report("swopping from unit ".itos(swop disc))
      ->enret

psvc(114):!get unit no

      %for j = 1, 1, 5 %cycle;   ! ####### depends on no. of drives ######
         p_p1 = j %and ->tell %if device(j) = p_p1
      %repeat
      p_p1 = -1
      ->tell

psvc(108):!disc status

      p_dsno = disc sno;  p_dact = 6;  ->pwait

psvc(101):!***** disc read *****
psvc(102):!***** disc write ***** disc  discaddr<p1> buffer<p2> disc<p3> owner<p4>

      %if p_p4 # 0 %start
         tp == user process(p_p4)
         tp_residence = tp_residence-9*disc charge %if tp_queue >= 3
      %else
         tp == pr
      %finish
      %unless valid(tp, p_p2, 512) %start
         p_p1 = -15;  ->tell;       !give a bad reply
      %finish
      tp_residence = tp_residence-disc charge
      p_dsno = disc sno;  p_dact = svcarg-101+1

pwait:user sact = user sact+8
      p_sact = user sact
      pr_params = p_sact;  pon(p)
      ->sleep %if p_dsno >= loader sno
      %return

psvc(105):!  ***** MT operation *****

         pr_residence = pr_residence-MT charge
         p_dsno = mt sno;  ->pwait

psvc(106):!***** read segment *****
psvc(107):!***** write segment*****

      %unless valid(pr, p_p2, p_p4*512) %start
         p_p1 = -15;  ->tell
      %finish
      p_dsno = disc sno;  p_dact = svcarg-106+3;  ->pwait

psvc(112):!***** pt demon ***** pt demon buffer<p1> size<p2> mode<p3>

      p_dsno = tape sno
      %if p_p3 = 0 %then p_dact = 2 %else p_dact = 3
      ->test
psvc(130):      !cr demon
!CR=      j = p_p1
!CR=      ->sverr %unless 0 < j <= buffers %and buf proc(j) = process
!CR=      cardp = 160
!CR=      card vec = buffer(j)
!CR=      card act = p_sact
!CR=      card sno = p_ssno
!CR=      ! start it up
!cr=      command(cr dev, enable+x'20');   !feed
      ->sleep

psvc(127):!***** lk demon *****

      p_dsno = link sno;  ->test2

psvc(111):!***** lp demon ***** lp demon buffer<p1> size<p2>

      p_dsno = lp demon sno;  p_dact = 2

test: ->sverr %unless valid(pr, p_p1, p_p2)
test2:pr_queue = 1;        !interactive?
      pr_prio = 1
      pon(p)

enret:   enqueue(process)
%end
%routine send input
   %integer j
   %record(parmcfm) pc
   %for j = 1, 1, 23 %cycle
      tt_get = tt_get+1
      pc_char(j) = tt_inv(tt_get&127)
      %exit %if pc_char(j) = nl %or tt_get = tt_inlimit
!CR=      test card %if cardp # 0
   %repeat
   tt_inreq = 0
   pc_char(0) = j
   pc_dsno = tt_service;  pc_dact = tt_inact;  pon(pc)
%end
%routine kick output
   %record(parmfm) p
   tt_outreq = 0
   p_dsno = tt_service;  p_dact = tt_outact;  pon(p)
%end
%routine ttout
   %record(parmfm) p
   %integer sym, from
   %string(11) temps
   %owninteger bells = X'0307070A'
   %switch m(0:5)
   %constinteger idle     = 0
   %constinteger echo idle= 1
   %constinteger echoing  = 2
   %constinteger printing = 3
   %constinteger ending   = 4
   %constinteger telling = 5

   %if tt_flags&1 # 0 %start
      tt_flags = tt_flags!3
      %return
   %finish
   ->m(tt_mode)

m(echo idle):tt_mode = echoing
m(echoing):  %if tt_eget = tt_eput %start
                tt_mode = echo idle
                ->tellit %if tt_tell # 0
                %return
             %finish
             tt_eget = tt_eget+1
             sym = tt_echo(tt_eget&127)
             ->print
m(ending):
tell idle:
m(idle):     %if tt_eget # tt_elimit %and tt_tell = 0 %start
                tt_mode = echoing
             %else %if tt_out # tt_outlimit %start
                tt_mode = printing
             %else %if tt_eget # tt_eput %start
                tt_mode = echoing
             %else
tell it:
m(telling):     tt_mode = idle
                %if tt_tell # 0 %start
                   sym = (tt_device-ttbase)>>1+97
                   uninhibit(sym);  p_dsno = sym;  poff(p);  inhibit(sym)
                   %if p_dsno # 0 %start
                      print text(string(addr(bells))) %if tt_prev # nl
                      print text("***")
                      from = p_ssno&31
                      %if from <= 3 %then printtext("System") %c
                                    %else printtext(proc(from)_owner)
                      print text(": ")
                      set dt;  temps = time;  length(temps) = 5
                      temps = temps." "
                      print text(temps)
                      print text(string(addr(p_p1)))
                      print text(string(addr(bells)))
                      tt_mode = printing
                   %else
                      tt_tell = 0
                      tt_mode = telling;  ttin(-1);  tt_mode = idle
                      ->tell idle
                   %finish
                %finish
                kick output %if tt_outreq # 0 %and tt_mode = idle
             %finish
             %if tt_mode # idle %start
                ->m(tt_mode) %if tt_prev # nl
                write data(tt_device+1, lf)
             %finish
             %return
m(printing): tt_out = tt_out+1
             sym = tt_outv(tt_out&255)
             tt_mode = ending %if tt_out = tt_outlimit
             %if sym < 32 %and tt_outreq # 0 %start
                kick output %if tt_put-tt_out < 256-25
             %finish
             %if sym = nl %start
                tt_lines = tt_lines-1
                %if tt_lines = 0 %start
                   tt_lines = tt_page
                   tt_flags = tt_flags!1 %if tt_lines # 0
                %finish
             %finish
print:       tt_prev = sym
             %if sym < 32 %start
                sym = cr %if sym = nl
                tt_mode = ending
             %finish
             write data(tt_device+1, sym)
%end
%routine clear flags
   tt_flags = tt_flags&(\(4))
   %if tt_flags&2 # 0 %start
      tt_flags = tt_flags-2
      ttout
   %finish
%end
%routine ttin(%integer flag)
   %record(parmfm) p
   %integer sym, n, m, service
   %switch cc(0:31)
   %routinespec dump(%integer sym)
   %routinespec send prompt

   %if flag # 0 %start;          ! kick prompt
      ->canc %if flag = -2
      ->retry %if flag < 0;      !after operator message
      clear flags
      %return %if tt_in # tt_in limit %or tt_mode = 1
kp:   send prompt
      %return
   %finish
   read data(tt_device, sym)
   sym = sym&127
   n = tt_in-tt_get
   %if n > 124 %start
      tt_control = 0
      %if sym # cr %and sym # del %and sym # 8 %c
                   %and sym # esc %and sym # can %start
         echo(7)
         %return
      %finish
   %finish
   %return %if tt_eput-tt_eget > 120;     !no room to echo
   %if tt_control = 0 %start;     ! interpret controls
      ->cc(sym) %if sym <= 31
      %if sym = del %start
cc(8):   %return %if tt_in = tt_inlimit
         sym = tt_inv(tt_in&127)
         tt_in = tt_in-1
         %if tt_flags&8 # 0 %start;      !erase
            echo(8);  echo(' ');  echo(8)
         %else;                       !noerase
            echo('\') %if tt_del = 0
            tt_del = 1
            echo(sym)
         %finish
         %return
      %finish
      sym = sym-32 %if tt_shift # 0 %and  'a' <= sym <= 'z'
   %finish
   echo('\') %if tt_del # 0
   tt_control = 0;  tt_del = 0
   echo(sym);  dump(sym);  %return
cc(si): tt_shift = 0;  %return
cc(so): tt_shift = 1;   %return
cc(dle):tt_control = 1; %return
cc(9):   n = tt_in-tt_inlimit
         j = 3
         %if tt_flags&16 # 0 %start
            %for m = 1, 1, 10 %cycle
               %if tt_tab(m) > n %start
                  j = tt_tab(m)-n
                  %exit
               %finish
            %repeat
         %finish
         %return %if tt_in-tt_get+j > 123
         %cycle
            dump(' ');  echo(' ')
            j = j-1
            %return %if j <= 0
         %repeat
cc(21):!NAK
CC(CAN):
canc:   tt_del = 0
        %return %if tt_in = tt_inlimit
        %if tt_flags&8 # 0 %start
           %while tt_in # tt_inlimit %cycle
              tt_in = tt_in-1
              echo(8);  echo(' ');  echo(8);  echo(0)
           %repeat
           tt_elimit = tt_eput
        %else
          tt_in = tt_inlimit
          echo('#');  echo(nl)
          ->kp %IF TT_INREQ # 0
        %finish
        %return
set:    tt_del = 0
        %if tt_pendint # 0 %start;! interrupt message
int mess:  user int = "";  tt_pendint = 0
            j = tt_inlimit
            %while j # tt_in %cycle
               j = j+1
               %exit %if length(user int) = 19
               length(user int) = length(user int)+1
               charno(user int, length(user int)) = tt_inv(j&127)
            %repeat
            tt_in = tt_inlimit
            %if user int # "" %start
               service = tt_service&31
               tt_del = 0
               %if length(user int) = 1 %and charno(user int, 1) = tt_drain %start
                  tt_mode = 0 %if tt_mode = 3
                  tt_put = 0;  tt_out = 0;  tt_outlimit = 0
                  tt_outpos = 0
                  tt_get = 0;  tt_in = 0;  tt_inlimit = 0
               %finish
               contingency(service, -1)
            %finish
            ->kp %if tt_inreq # 0
            %return
        %finish
        dump(sym)
        tt_inlimit = tt_in
        send input %if tt_inreq # 0
        %return
cc(17): !dc1 (CTRL+Q)
cc(cr):
cc(lf): tt_lines = tt_page
        tt_flags = tt_flags&(\1) %and clear flags %if tt_flags&7 # 0
        %return %if sym # cr
        sym = nl;  echo(nl);  ->set
cc(eot):echo('[');  echo(']');  echo(nl)
        ->set
cc(7): !bell (CTRL+G)
         string(addr(p_p1)) = tt_doing
         notify(0, p)
         %return
cc(dc2):%return %if tt_inlimit = tt_in %or tt_eget # tt_eput
        echo('#');  echo(nl)
        tt_del = 0
retry:  send prompt %if tt_inreq # 0
        j = tt_inlimit
        %while j # tt_in %cycle
           j = j+1
           echo(tt_inv(j&127))
!cr=         test card %if cardp # 0
        %repeat
        %return
cc(esc):%return %if tt_service <= x'40'
         tt_flags = tt_flags&(\1)
        clear flags
        tt_del = 0
        tt_in = tt_inlimit
        %if tt_pendint # 0 %start;    ! <esc><esc>
           echo('!');  echo(nl)
           dump('!')
           ->int mess
        %finish
        echo(cr)
        tt_pendint = 1;  send prompt;  tt_elimit = tt_eput
        %return
CC(20): tt_flags = tt_flags!4
        echo(nl)
        tt_out = tt_outlimit
        tt_mode = 0 %if tt_mode = 3
        tt_put = tt_outlimit
         send prompt %if tt_inreq # 0
        %return
cc(dc3):tt_flags = tt_flags!1
       %return
cc(0):cc(1):cc(2):cc(3):
cc(5):cc(6):
cc(11):cc(12):
cc(22):
cc(23):cc(25):cc(26):cc(28):cc(29):
cc(30):cc(31):         %return
   %routine dump(%integer sym)
      tt_in = tt_in+1
      tt_inv(tt_in&127) = sym
   %end
   %routine send prompt
      %stringname intx
      %ownstring(5) intm = "
Int:"
      %integer quiet, sym, m
      quiet = tt_quiet;  tt_quiet = 0
      intx == tt_prompt
      intx == intm %if tt_pendint # 0
      echo(cr) %if intx = ""
      %for m = 1, 1, length(intx) %cycle
         sym = charno(intx, m)
         %if sym = nl %start
            sym = nl+128;  echo(cr)
         %finish
         echo(sym)
!cr=         test card %if cardp # 0
      %repeat
      tt_quiet = quiet
   %end
%end

%integerfn free seg(%record(procfm)%name p)
   %integer j
   %for j = 15, -1, 0 %cycle
      %result = j %if p_segs_r(j) = 0;            !free
   %repeat
   %result = -1;                               !none available
%end

%integerfn disc space(%integer size)
   %integer p, q, total, old
   %shortintegername pt
   %record(spacefm)%name s
   total = (size+11)//12
   old = 0
   pt == disc list
   %while pt # 0 %cycle
      s == space cell(pt)
      p = s_addr
      abort(m'Stsp') %if p <= old
      old = p
      %if s_size >= total %start
         s_addr = s_addr+total
         s_size = s_size-total
         %if s_size = 0 %start
            q = pt
            pt = s_link;         !remove from free list
            s_link = space asl;  !onto asl
            space asl = q
         %finish
         %result = p
      %finish
      pt == s_link
   %repeat
   abort(m'DKsp')
   %cycle;  %repeat
%end
%integerfn store space(%integer size)
   %integer p, q, old
   %shortintegername pt
   %record(spacefm)%name s
   old = 0
   pt == store list
   %while pt # 0 %cycle
      s == space cell(pt)
      p = s_addr
      abort(m'STsp') %if p <= old
      old = p
      %if s_size >= size %start
         s_addr = s_addr+size<<9
         store left = store left-size
         s_size = s_size-size
         %if s_size = 0 %start
            q = pt
            pt = s_link;         !remove from free list
            s_link = space asl;  !onto asl
            space asl = q
         %finish
         %result = p
      %finish
      pt == s_link
   %repeat
   %result = -1
%end
%integerfn new amt(%integer flags, size)
   %integer an
   %record(amtfm)%name a
   an = amt asl;   %result = 0 %if an = 0
   a == amt(an)
   amt asl = a_flink
   a = 0
   a_flags = flags!paged out
   a_size = size
   a_disc = disc space(size) %if flags&paged out # 0 %c
                            %and flags&new area = 0
   %result = an
%end

%routine release(%integer addr, size, shift, %shortintegername list)
   %integer n0, n1
   %integer next, p
   %shortintegername fn
   abort(m'Rele') %if size <= 0;!<<<<<<<<<<<<<<<<<<<<
   %if shift # 0 %start
      store left = store left+size
   %else
      size = size+11
dum:  size = size//12
   %finish
   next = addr+size<<shift;        !address of next bit
   fn == list;                   !free store list
   %while fn # 0 %cycle
      n0 = space cell(fn)_addr
      %if n0 = next %start;  !follows on
         space cell(fn)_addr = addr
         space cell(fn)_size = space cell(fn)_size+size
         %return
      %finish
      n1 = n0+space cell(fn)_size<<shift
      %if n1 = addr %start
         space cell(fn)_size = space cell(fn)_size+size
         p = space cell(fn)_link;       !onto the following cell
         %if p # 0 %start
            %if space cell(p)_addr = next %start;  !follows on
               space cell(fn)_link = space cell(p)_link;     !remove next cell
               space cell(p)_link = space asl
               space asl = p
               space cell(fn)_size = space cell(fn)_size+space cell(p)_size
            %else %if space cell(p)_addr < next %start
               abort(m'OV 1');                  !overlap<<<<<<<<<<<<<<<<<
            %finish
         %finish
         %return
      %finish
      %if n0 > addr %start
         abort(m'OV 2') %if n0 < next;            !overlap<<<<<<<<<<
         %exit
      %finish
      abort(m'OV 3') %if n1 > addr;               !overlap<<<<<<<<<<<<<<<
      abort(m'OV 4') %if n0 = addr;                !<<<<<<<<<<<<<<<<<<<<
      fn == space cell(fn)_link
   %repeat
   next = space asl;  abort(m'NOsp') %if next = 0;!<<<<<<<<<<<<<<<<<<<<
   space asl = space cell(next)_link
   space cell(next)_link = fn
   fn = next
   space cell(next)_addr = addr
   space cell(next)_size = size
%end
%routine remove(%record(amtfm)%name a)
   abort(m'RemA') %if amt(0)_flink = 0
   amt(a_flink)_blink = a_blink
   amt(a_blink)_flink = a_flink
   a_flink = 0;  a_blink = 0
%end
%routine insert(%integer an)
   %record(amtfm)%name a
   %integer bn
   %byteintegername b
   bn = 0;  b == amt(0)_flink
   a == amt(an)
   %while b # 0 %cycle
      %exit %if amt(b)_addr > a_addr
      bn = b
      b == amt(bn)_flink
   %repeat
   a_flink = b;  a_blink = bn
   amt(b)_blink = an
   b = an
%end
%integerfn connect virtual(%integer process, seg, amtn)
   %record(procfm)%name pr
   %record(amtfm)%name a
   %record(segdescfm)%name sd
   %integer s
   pr == proc(process)
   seg = free seg(pr) %if seg < 0
   %result = -3 %unless 0 <= seg <= 15 %and pr_segs_r(seg) = 0
   pr_segs_r(seg) = \present
   pr_page(seg) = amtn
   a == amt(amtn)
   pr_status = pr_status!incomplete
   s = segasl;      abort(m'Sasl') %if s = 0;!<<<<<<<<<<<<<<<<<<<<
   sd == seg desc(s)
   seg asl = sd_link
   sd_link = a_chain;  a_chain = s
   sd_seg == pr_segs_r(seg)
   pr_store = pr_store+a_size
   %result = seg
%end

%routine unchain(%record(amtfm)%name a, %integername this)
   %byteintegername n
   %integer p
   %record(seg descfm)%name sd
   n == a_chain
   %cycle
      abort(m'Cajn') %if n = 0;!<<<<<<<<<<<<<<<<<<<<
      sd == seg desc(n)
      %exit %if sd_seg == this
      n == sd_link
   %repeat
   p = sd_link;   sd_link = seg asl;  seg asl = n;  n = p
%end

%integerfn new buffer(%integer process)
   %integer j
   %for j = 1, 1, buffers %cycle
      %if bufproc(j) = 0 %start;         !it's free
         bufproc(j) = process;           !record who owns it
         %result = j;                    !buffer number
      %finish
   %repeat
   %result = -1;                         !none left?
%end
%routine release buffer(%integer process)
   %integer j
   %for j = 1, 1, buffers %cycle
      bufproc(j) = 0 %if bufproc(j) = process
   %repeat
%end
%routine user segment(%record(parmfm)%name p)
   %switch us(1:9)
   %integer dact
   %integer size, process, an, s, j
   %record(procfm)%name pr
   %record(amtfm)%name a

   %routine delete(%integer seg)
      %record(amtfm)%name a
      %integer an
      %integername this
      an = pr_page(seg)
      pr_page(seg) = 0
      this == pr_segs_r(seg)
      release buffer(process) %if this&resident # 0
      this = 0
      big job in = 0 %if big job in = process
      %return %if an = 0;               !wasn't in use
      a == amt(an)
      pr_store = pr_store-a_size
      a_users = a_users-1 %if a_flags&(paged out!new area) = 0
      unchain(a, this)
      %return %if a_users # 0;         !other users (was _chain??)
!cr=      test card %if cardp # 0
      %if a_flags&(paged out!new area) = 0 %start
         a_flags = a_flags!paged out %if a_flags&shared # 0
         release(a_addr, a_size, 9, store list)
         a_addr = 0
         remove(a)
      %finish
      %return %if (a_flags&shared # 0 %and a_state = 0) %or a_chain # 0
      release(a_disc, a_size, 0, disc list) %if a_disc # 0
      a_flink = amt asl;  amt asl = an
   %end

   dact = p_dact
   ->us(dact) %if 0 < dact <= 9
NO:p_p1 = -1
REPLY:
   p_dsno = p_ssno;  p_dact = p_sact
   pon(p)
   %return

us(8):!protect seg<p1>
      process = p_p6;  ->no %unless 0 < process <= processes %c
                            %and 0 <= p_p1 <= 15
      pr == proc(process)
      an = pr_page(p_p1)
      ->no %if an = 0
      a == amt(an)
      a_flags = a_flags!wprot
      pr_segs_r(p_p1) = pr_segs_r(p_p1)!wprot
      p_p1 = 0;  ->reply

us(9):!delete segs<p1>
      process = p_p6;  ->no %unless 0 < process <= processes
      pr == proc(process)
      s = p_p1
      %for j = 0, 1, 15 %cycle
         delete(j) %if s&1 # 0
         s = s>>1
      %repeat
      p_p1 = 0;  ->reply
us(1):!create seg size<p2> seg<p3>
   process = p_p6
   ->NO %unless 1 <= p_p6 <= processes
   pr == proc(process)
   size = (p_p2+511)>>9;                  !bytes->pages
   ->NO %if size = 0 %or pr_store+size > max store
   an = new amt(new area, size)
   p_p1 = -2 %and ->reply %if an = 0
   p_p1 = connect virtual(process, p_p3, an)
   ->REPLY
us(2):!destroy seg<p1>
us(3):!destroy all
   process = p_p6
   ->NO %unless 1 <= process <= processes
   pr == proc(process)
   %if dact = 2 %start;       !just one
      ->NO %unless 0 <= p_p1 <= 15
      delete(p_p1)
   %else
      delete(j) %for j = 0, 1, 15
      pr_id = 255
      users = users-1
   %finish
   p_p1 = 0;  ->reply
us(4):!create virtual size<p1> mode<p2>
   ->no %if p_p1 = 0
   p_p1 = new amt(p_p2!paged out, p_p1)
   p_p1 = -2 %and ->reply %if p_p1 = 0
   p_p2 = amt(p_p1)_disc
   p_p3 = SWOP DISC
   ->REPLY
us(5):!connect amtn<p1> process<p2> seg<p3>
   process = p_p2
   ->NO %unless 0 < process <= processes
   pr == proc(process)
   a == amt(p_p1)
   ->no %if pr_store+a_size > max store
   p_p1 = connect virtual(process, p_p3, p_p1)
   ->REPLY
us(6):!unshare amtn<p1>
   an = p_p1
   ->no %unless 0 < an <= max amt
   a == amt(an)
   abort(m'Shar') %if a_flags&shared = 0
   a_state = 255
   p_p1 = 0
   ->REPLY %if a_chain # 0;         !still in use
   release(a_disc, a_size, 0, disc list) %if a_disc # 0
   a_flink = amt asl;  amt asl = an
   ->REPLY
us(7):!get buffer
   process = p_p6
   pr == proc(process)
   s = free seg(pr)
   ->no %if s < 0
   j = new buffer(process)
   ->no %if j < 0
   pr_segs_r(s) = buffer(j)+3<<20+resident+present
   p_p1 = s;  p_p2 = j
   ->reply
%end
%predicate can loose(%integer pnum)
   %record(procfm)%name pr
   %record(parmfm) p
   %integername s
   %integer seg, an, j
   %record(amtfm)%name a

   abort(m'Pend') %if pnum = pending
   pr == proc(pnum)
   %false %if pr_status&all on disc # 0;               !all on disc
   %for j = 0, 1, 15 %cycle
      seg = (pr_look+1)&15;  pr_look = seg
      an = pr_page(seg)
      %if an # 0 %start
         a == amt(an)
         %continue %if a_flags&paged out # 0
         s == pr_segs_r(seg)
         %if s >= 0 %start
            s = \present
            pr_status = pr_status!incomplete;               !incomplete
            a_users = a_users-1;                !one less active user
         %finish
         ->found %if a_users = 0;            !no longer in use
      %finish
   %repeat
   pr_status = pr_status!all on disc;                    !nothing left in store
   %false

found:!throw out the segment

   abort(m'Pout') %if a_flags&paged out # 0;!already paged out?<<<<<<<<<<<<
   a_flags = a_flags!paged out
   %if a_disc # 0 %start;                       !copy on disc
      abort(m'Sh ?') %if a_flags&shared = 0;         !how does it know<<<<<<<<<
      p_dsno = activate altno;  p_dact = 5
      p_p1 = 0
   %else

      !first claim some disc space
   
      a_disc = disc space(a_size)
   
      !page the segment out
   
      p_dsno = disc sno;  p_dact = 4;           !write pages
      p_ssno = activate altno;  p_sact = 5
      p_p1 = a_disc*12
   %finish
   p_p2 = a_addr
   p_p3 = SWOP disc
   p_p4 = a_size
   p_p6 = pnum;  going = pnum
   pon(p)
   inhibit(activate sno)
   mask = mask!x'E000'

   release(a_addr, a_size, 9, store list)
   a_addr = 0

   !remove segment from as list

   remove(a)
   %true;                                    !and wait for the disc
%end

%predicate space from(%integer q)
   %integer head
   %false %if q = 0
   head = q
   %cycle
!cr=      test card %if cardp # 0
      %true %if can loose(q)
      q = bq(q)
      %false %if q = head
   %repeat
%end
%routine to q(%integer process, %integername queue)
   %integer n
   abort(m'On Q') %if fq(process) # 0 %or bq(process) # 0
   %if queue = 0 %start
      queue = process
      n = process
   %else
      n = fq(queue)
   %finish
   fq(queue) = process
   bq(n) = process
   fq(process) = n
   bq(process) = queue
   queue = process
%end
%routine dq(%integername q)
   %integer f, b
   %if q = 0 %start
      pending = 0;  %return
   %finish
   pending = fq(q)
   f = fq(pending);  b = bq(pending)
   fq(b) = f
   bq(f) = b
   q = 0 %if pending = q
   fq(pending) = 0;  bq(pending) = 0
%end
%routine activate(%record(parmfm)%name p)
   %switch ac(1:8)
   %ownintegername s
   %integername q
   %ownbyteintegername ps
   %ownrecord(procfm)%name pr
   %record(parmfm) pp
   %record(seg descfm)%name sd
   %record(amtfm)%name sa
   %ownrecord(amtfm)%name a
   %integer j, new, u, big, process
   %owninteger seg, an, n, base, disp, high, low

   monitor(p, "activate") %if poffmon&16 # 0
   ->ac(p_dact)

ac(2):!proc<p1> wakes up
ac(1):!proc<p1> sliced
      process = p_p1
      pr == proc(process)
      pr_status = pr_status&(\blocked)
      %return %if pr_status&activated # 0
      pr_status = pr_status!activated;                    !show coming in
      abort(m'Wait') %if pr_status&waiting # 0;!<<<<<<<<<<<<<<<<<<
      big = 0
      big = 1 %if pr_store >= half left
      %if pending = 0 %and (big = 0 %or big job in = 0) %start;!nothing waiting
         pending = process
      %else
         %if pr_console = 0 %start;         !background process
            %if pr_priv = 0 %then pr_queue = 3 %else pr_queue = 2
         %finish
         %if pr_queue = 1 %start
            %if proc(pending)_queue # 1 %start
               q == waitq
               j = pending;  pending = process;  process = j
               quick = 4
            %else
               q == fast waitq
            %finish
         %else %if pr_queue = 2
            q == waitq
         %else %if pr_queue = 3 %or big = 0
            pr_queue = 3
            q == slow waitq
         %else
            pr_queue = 4
            q == big q
         %finish
         to q(process, q)
      %finish
      pr_residence = pr_cputime+residences(pr_queue)
      big job in = 0 %if process = big job in
      ->test

ac(4):!segment here

   mask = 0
   uninhibit(activate sno)
   %if p_p1 # 0 %start
failed:report("Transfer failed ".itos(p_p1))
       p_p1 = pending
       p_dsno = p control sno;  p_dact = 7;  p_ssno = 0
       pon(p)
      s = 0;  ->test
   %finish
   %if a_flags&shared = 0 %start;            !forget the disc copy
      release(a_disc, a_size, 0, disc list)
      a_disc = 0
   %else %if a_flags&wprot = 0 %start;         !copy gla amt
      a_users = a_users-1
      unchain(a, s);  remove(a)
      an = new amt(a_flags&(\(shared!paged out)), a_size)
      ps = an
      %if an = 0 %start
         report("AMT full")
         ->failed
      %finish
      sa == amt(an)
      sa_addr = a_addr
      sa_users = 1
      n = seg asl
      abort(m'SAsl') %if n = 0
      sd == seg desc(n)
      seg asl = sd_link
      sd_link = 0;  sa_chain = n
      sd_seg == s
      insert(an)
      a == sa
   %finish
   a_flags = a_flags&(\paged out)
   s = s!present;                            !mark the segment entry
   ->test

ac(5):!segment gone
   mask = 0
   uninhibit(activate sno)
   %if p_p1 # 0 %start;                      !transfer failure
      p_p1 = going
      report("Transfer failure".itos(p_p1))
      p_dsno = p control sno;  p_dact = 7
      p_ssno = 0
      pon(p);                                !kill it
      ->dequeue
   %finish
ac(3):!kick
test: !check pending process
   ->dequeue %if pending = 0
   pr == proc(pending)
   %if pr_status&incomplete = 0 %start;                !complete
ready:
      pr_status = pr_status&(\activated);              !no longer coming in
      enqueue(pending);                      !onto cpu queue
      big job in = pending %if pr_store >= half left
dequeue:                                     !take next process
      quick = 4
      dq(fast waitq);  ->test %if pending # 0
      quick = 0
      dq(waitq);       ->test %if pending # 0
      dq(slow waitq);  ->test %if pending # 0
      %return %if big job in # 0
      dq(big q);       ->test %if pending # 0
      %return
   %finish

   pr_prio = 2
find:!bring in the next segment

!cr=   test card %if cardp # 0
   %for j = 0, 1, 15 %cycle
      seg = (pr_look+1)&15;  pr_look = seg
      s == pr_segs_r(seg)
      ->found %if s < 0;                     !out on disc
      abort(m'Prot') %if s&present # 0 %and s&x'FFF00' < protected %c
                                   %and s&resident # 0
   %repeat
   pr_status = pr_status&(\incomplete);                  !all in store
   ->ready

found:

   pr_status = pr_status&(\all on disc);     !not all on disc
   ps == pr_page(seg);  an = ps
   abort(m'No A') %if an = 0;!<<<<<<<<<<<<<<<<<<<<
   a == amt(an)
   %if a_flags&paged out = 0 %start
      a_users = a_users+1
      s = a_addr!a_flags!((a_size<<1-1)<<20)!present
      ->find
   %finish

   %if a_size <= store left %start;        !enough for this segment
try:  a_addr = store space(a_size)
      ->got %if a_addr > 0;               !hole found
      inhibit(activate sno)
      inhibit(user seg sno)
      j = space cell(store list)_link
      abort(m'NoSt') %if j = 0 %or store list = 0;!<<<<<<<<<<<<<<<<<<<<
      base = space cell(store list)_addr
      disp = space cell(store list)_size
      space cell(j)_size = space cell(j)_size+disp
      space cell(store list)_link = space asl
      space asl = store list
      store list = j
      disp = disp*512
      low = base+disp
      high = space cell(j)_addr
      space cell(j)_addr = space cell(j)_addr-disp
      pp_p1 = high-low;                         !how much to move
      pp_p2 = low;                              !from
      pp_p3 = base;                             !to
      pp_dsno = disc sno;  pp_dact = 12
      pp_ssno = activate altno
      pon(pp);                                  !compress the store
      %return
ac(7):!reply from shuffle
      uninhibit(disc sno)
      uninhibit(user seg sno)
      uninhibit(activate sno)

      !adjust the store tables

      n = amt(0)_flink;  abort(m'Flnk') %if n = 0;!<<<<<<<<<<<<<<<<<<<<
      %cycle
         sa == amt(n)
         %exit %if sa_addr > high;               !none moved from here
         %if sa_addr >= low %start;              !has been moved
!cr=            test card %if cardp # 0
            u = sa_users
            sa_addr = sa_addr-disp;               !relocate it
            new = sa_addr!sa_flags!((sa_size<<1-1)<<20)!present
            j = sa_chain
            %while j # 0 %cycle
               seg desc(j)_seg = new %and u = u-1 %if seg desc(j)_seg > 0
               j = seg desc(j)_link
            %repeat
            abort(m'Use?') %if u # 0
         %finish
         n = sa_flink
         %exit %if n = 0
      %repeat
      cpu give(-1);             !remove current process in case
                                !loaded with bum segs
      ->try

got:  s = a_addr!a_flags!((a_size<<1-1)<<20)
      a_users = a_users+1
      insert(an)
      %if a_flags&new area # 0 %start;                      !new segment
         a_flags = a_flags&(\(new area!paged out))
         s = s!present
         ->find
      %finish
      !page in from disc at a_disc
      p_dsno = disc sno;  p_dact = 3;        !read pages
      p_ssno = activate altno;  p_sact = 4
      p_p1 = a_disc*12
      p_p2 = a_addr
      p_p3 = SWOP disc
      p_p4 = a_size
      p_p6 = pending
      abort(m'NoDk') %if a_disc = 0
      pon(p);                                !kick the disc
      mask = -1
      inhibit(activate sno)
      %return;                               !and wait for it
   %finish
   !not enough store yet
   %return %if space from(big q);      !get rid of the biggies first
   %return %if space from(sleep q)
   %return %if space from(slow waitq)
   %return %if space from(waitq)
   %return %if space from(fast waitq)
   !can get no store - wait until next kicked.
%end
%routine contingency(%integer pn, n)
!                 -2 - SHUTDOWN request
!                 -1 - INT:something
!                  0 - user message (int:)  <= 0 for asynchronous
! contingencies :  1 - illegal interrupt
!                  2 - illegal svc
!                  3 - illegal instruction
!                  4 - arithmetic fault
!                  5 - segment error
!                  6 - time exceeded
!                  7 - invalid svc arg
!                  8 - invalid pon service
!                  9 - svc error
!                 10 - invalid svc address
!                 11 - console failure
!                 12 - console buffer failure
!                 13 - invalid contingency buffer
!                 14 - demon not present
!                 16 - transfer failure
   %integer params, status
   %record(parmfm) p
   %record(ttfm)%name tt
   %record(procfm)%name pr
   %if pn = 0 %or pn = curproc_id %start
      pn = curproc_id
      cpugive(0)
   %finish
   pr == user process(pn)
   abort(m'NoPR') %if pr == null proc %or poffmon&512 # 0;!<<<<<<<<<<<<<<<<<<<<
   abort(m'ResP') %if pn <= 3
   pr_id = 255 %and %return %if pr_status&stopping # 0
   %return %if pr_status&cont load # 0
   adsorb(pn+128);      !remove any junk
   p_dsno = pn;  p_dact = n
   p_ssno = 0;  p_sact = integer(svcnum)
   pr_status = pr_status!cont load
   %if n > 0 %start;         !synchronous therefore quick
      big job in = 0
      abort(m'Cont') %if pr_status # cont load %or pr_params # 0
      pr_time limit = pr_cpu time+60*100 %if n = 6
      p_p1 = svc arg
      call process(p)
      %return
   %finish
   pr_queue = 1;  pr_prio = 1;       !speed it up
   p_p1 = pr_clevel;  pr_clevel = 1 %if pr_clevel # 0
   wake up(pr) %if pr_status&on timer q # 0
   %if pr_status&waiting # 0 %and pr_console # 0 %start;          !waiting
      tt == tty(pr_console)
      %if tt_mode = 1 %and tt_get = tt_in %start
         tt_mode = 0;  tt_quiet = 0
         tt_elimit = tt_eget %if tt_elimit < tt_eget
      %finish
      pr_params = 0
      tt_inreq = 0;  tt_outreq = 0
   %finish
   string(addr(p_p2)) = user int
   call process(p)
   pr_status = pr_status!cont wait %if p_dsno&128 # 0
%end





supervise:     display(-1, -1)

! initialise it all

!initialise dump info

   integer(x'910') = addr(proc(0))
   integer(x'914') = addr(amt(1))
   integer(x'920') = addr(parmq(1))
   integer(x'924') = addr(parm(1))
   integer(x'928') = addr(seg desc(1))
   integer(x'92C') = addr(space cell(1))
   integer(x'938') = addr(fq(1))
   integer(x'93C') = addr(queue(1))
   integer(x'940') = addr(tty(1))
   command(j, disarm) %for j = 2, 1, 255
   clear store
   *x'D0C0';  *sysr12
   integer(x'80') = addr(sysq);         !system queue (header only)
   integer(x'88') = x'2000';     ! machine malfunction
   set exit(integer(x'8C'), vec(x'0C')&X'FFFF');   !sysq new psw
   shortinteger(power fail  ) = x'E00'
   shortinteger(power fail+2) = x'E08'
   integer(x'38'  ) = 0
   set exit(integer(x'38'+4), vec(60));     !machine malfunction

   parmq(j) = j+1 %for j = 1, 1, parm cells-1
   pq end == parmq(parm cells)
   parmq(parm cells) = 0
   parm asl = 1

   %for j = 1, 1, services %cycle
      inhibited(j) = 0
      serviceq(j) = 0
      service messq(j) = 0
   %repeat
   sysq = 0
   protected = 0
   wake who = 0;  wake when = infinity

!initialise paging info

   amt asl = 1
   amt(j)_flink = j+1 %for j = 1, 1, max amt-1
   amt(max amt)_flink = 0

   space asl = 3
   space cell(j)_link = j+1 %for j = 3, 1, max space-1
   space cell(max space)_link = 0

   disc list = 2
   space cell(2)_addr = 22
   space cell(2)_size = 400*2-22-1
   space cell(2)_link = 0

   !space cell(1) initialised in "start privs"
   store list = 1
   space cell(1)_link = 0

   amt(0) = 0

   seg asl = 1
   seg desc(j)_link = j+1 %for j = 1, 1, max segs-1
   seg desc(max segs)_link = 0


!  fs(1) initialised in start privs

   *X'5070';  *0;                 !*ST_WSP, 0
   store base = (integer(0)+sys stack*512+1023)&(\1023);  !onto 1k boundary
   store left = (store limit-store base)>>9

   queue(1)_on = 0;  queue(1)_off = 0
   queue(2)_on = 0;  queue(2)_off = 0
   queue(3)_on = 0;  queue(3)_off = 0
   %for j = 0, 1, processes %cycle
      fq(j) = 0;  bq(j) = 0
      proc(j) = 0
      proc(j)_id = 255
      proc(j)_time limit = infinity
      proc(j)_alarm = infinity
   %repeat
   curproc == proc(0);  curproc_id = 0;  curproc_owner = "*idle*"
   curproc_user_ps = x'E200';  curproc_user_pc = x'DEAD'
   curproc_priv = 1;  curproc_queue = 4;  curproc_prio = 4
   regs = addr(curproc_user)

! initialise interrupt vectors

   set entry(j, vec(1)) %for j = 0, 1, 1023; ! in case of bum ints
   set entry(1, vec(x'0F'));                ! console ints
   set entry(devmap(j), vec(j)) %for j = 1, 1, devs
!cr=   set entry(cr dev, vec(x'15'))
   set entry(x'6D', vec(63));      ! line frequency clock
   set entry(x'F4', vec(14));     !big disc
   set entry(x'C5', vec(59));     !MT controller
   set exit(integer(time rt), vec(62))
   set exit(integer(null time rt), vec(61))
   set svc(j, vec(j+x'20')) %for j = 0, 1, 15
   integer(x'98') = x'2000';     !svc new ps
   set loc(iilocn, vec(x'30'));  integer(iistatus) = x'2000'
   set loc(x'94', vec(x'33'));  integer(x'90') = x'2000'
   set loc(x'4C', vec(x'32'));  integer(x'48') = x'2000'
   set exit(tape exit, vec(x'0B'))
   set exit(lp exit, vec(x'0D'))

!initialise the link

   set entry(x'10', vec(x'13'))
   set entry(x'11', vec(x'14'))

!initialise consoles

   %routine clear terminal(%integer L)
      %integer j, k
      j = ttbase+L*2-2
      set entry(j, vec(x'10'));     ! kb free
      set entry(j+1, vec(x'12'));   ! tp active

      command(j, ttclock(L))
      read data(j, k)
      command(j,   b'11000001');      !disarm input
      command(j+1, b'11000011');      !disarm output
      command(j,   b'01000001')
      command(j+1, b'01000011')
      inhibit(L+96)
      tty(L) = 0
      tty(L)_device = j
   %end

   clear terminal(L) %for L = 1, 1, consoles

   COMMAND(X'B6', 8);              ! RESET CONTROLER
   INTP_P3 = 0

!start system process

   set exit(l, vec(64))
   proc(1)_user_pc = l;  proc(1)_user_ps = x'62F0';   ! ints+priv+user regs
   proc(1)_id = 1;  proc(1)_owner = "system"
   proc(1)_powner = -1;  proc(1)_priv = 1
   proc(1)_user_gpr_r(15) = integer(sysr12+12)
   proc(1)_user_gpr_r(14) = integer(sysr12+8)
   proc(1)_user_gpr_r(13) = integer(sysr12+4)
   proc(1)_user_gpr_r(7)  = x'D00';   ! enough????????
   p_dsno = system sno;  p_dact = 1;  pon(p);   ! start system process
   %for j = 1, 1, time outs %cycle
      time out(j)_dsno = 0
      time out(j)_when = infinity
   %repeat
   integer(clock arg) = -100
   COMMAND(X'6D', ENABLE);              ! START THE CLOCK

! kick the system

   report("Mouses V".version)
   real time = 0
   dump lines = 64
   start privs
   %if restart = -1 %start
      integer(0) = x'00000520';  integer(4) = abort num
      report("******** Abort: ".string(2))
   %finish
   p_dsno = loader sno;  p_dact = 2
   p_ssno = 0;  pon(p)
   time bomb(start proc sno, 5, 10);   !start oper in 10 seconds
   restart = 2
   abort num = 0
   ->resume
!
!
!####################################################
!################ MAIN SERVICE LOOP #################
!####################################################

iv(X'0C'):!system queue interrupt
      *lm12;  *sysr12
      *timer
      %if sysq # 0 %start
         service = serviceq(sysq)
         %if inhibited(service) = 0 %and service messq(service)#0 %start
            p_dsno = service;  poff(p)
            ->serve(service) %if service <= 31
            call process(p);  ->resume
         %finish
         %if service = sysq %start
            sysq = 0
         %else
            serviceq(sysq) = serviceq(service)
         %finish
         serviceq(service) = 0
      %finish
      ->resume

!####################################################
!####################################################

!
SERVE(CONSOLE ALTNO):
SERVE(CONSOLE   SNO):    CONSOLE(P);     ->resume

serve(disc  altno):
SERVE(DISC    SNO):      DISC(P);        ->resume

SERVE(MT ALTNO):
SERVE(MT   SNO):         MAG TAPE(P);    ->resume

SERVE(START PROC ALTNO):
SERVE(START PROC   SNO): START PROC(P);  ->resume

SERVE(P CONTROL SNO):    P CONTROL(P);   ->resume

SERVE(TAPE SNO):         TAPE(P);        ->resume

serve(user seg sno):     user segment(p);    ->resume

SERVE(ACTIVATE ALTNO):
SERVE(ACTIVATE   SNO):   ACTIVATE(P);    ->resume

serve(lp demon altno):   uninhibit(lp demon sno);  ->resume
SERVE(LP DEMON SNO):     LP DEMON(P)
                         *X'C860';  *X'A18'
                         *X'5890';  *NULL TIME RT
                         *X'E200';  *X'62';         ! *SINT_LP
                         ->resume

serve(link sno):         lk demon(p);     ->resume

!
%routine start privs
   %integer stl, pd, j
   %record(procfm)%name pr
   %record(parmfm) pp
   %recordformat pfm(%string(7) name, %c
                     %integer csize, cstart, gsize, gstart, %c
                     %integer sno, stack)
   %record(pfm)%name info
   %constrecord(pfm)%arrayname inf = x'F00'
   %ROUTINE CLAIM(%INTEGER SEG, SIZE, AT, PROT)
      PD = AT&255
      SIZE = (SIZE+PD+511)>>9
      PR_SEGS_R(SEG) = AT&X'FFF00'!(SIZE<<1-1)<<20!PROT!PRESENT
   %END
   protected = inf(1)_gstart
   stl = store left;  max store = store left
   %for j = 1, 1, 7 %cycle
      info == inf(j)
      %continue %if info_name = ""
      pr == proc(info_sno);  pr = 0
      claim(1, info_csize, info_cstart, wprot)
      pr_user_gpr_r(14) = x'10000'+pd
      pr_user_gpr_r(4) = pr_user_gpr_r(14)
      pr_user_pc = pr_user_gpr_r(14)
      pr_user_ps = user status
      claim(2, info_gsize, info_gstart, exec prot)
      pr_user_gpr_r(13) = x'20000'+pd
      claim(3, info_stack*512, store base, exec prot)
      store base = store base+info_stack*512
      stl = stl-info_stack
      pr_user_gpr_r(7) = x'30000'
      pr_owner = info_name
      pr_id = info_sno
      pack(file, info_name.":")
      pr_powner = file_owner
      pr_priv = 1;  pr_queue = 1;  pr_time limit = infinity
   %repeat
   pp_dsno = director sno;  pp_dact = 1
   pp_ssno = 0;  pon(pp);   !START DIRECTOR
   store left = stl
   space cell(1)_addr = store base
   SPACE CELL(1)_SIZE = store left
   buffer(j) = store space(2) %for j = 1, 1, buffers
   %if store limit&x'7FFF' # 0 %start;            !store error?
      report("STORE??? ".xtos(store limit))
   %finish
   report(itos(store left>>1)."K of user store")
   max store = store left-1
   half left = max store>>1+20;      !room for bouncing
%end
!
%routine system process
   ! *** this process runs without the mac enabled (in real store)
   ! *** and has access to all system tables etc.
   ! *** it should be used for any expensive (in time) operations
   ! *** as it runs interruptably
   ! *** replies with dact = 7
   %record(parmfm) p
   %record(filefm) file
   %stringname SN
   %integer z
   %switch s(1:9)
   report("system stack???") %if addr(z) > x'E00'
   p_sact = 0;  svc(16, p);            !pick off first message
   %cycle
      z = 0
      ->s(p_dact)
s(1):! console message
      ->reply
s(2):! date & time
      set dt
      string(addr(p_p1)) = date;  string(addr(p_p4)) = time
      ->reply
s(3):! pack filename
      sn == string(addr(p_sact))
      length(sn) = 25 %if length(sn) > 25
      pack(file, sn)
      p_p1 = file_unit;  p_p2 = file_owner
      p_p3 = file_name1;  p_p4 = file_name2
      ->reply
s(4):! unpack filename
      file_unit = p_p1;  file_owner = p_p2
      file_name1 = p_p3;  file_name2 = p_p4
      unpack(file, string(addr(p_sact)))
      z = p_sact
      ->reply
s(5):! system console output
      set dt
      sn == string(addr(p_p1))
      length(sn) = 23 %if length(sn) > 23
      output = date." ".time." ".sn."
"
      p_dsno = console altno;  p_dact = 4;  ->rep2
s(6): unpack date(p_p1, string(addr(p_p1)));  ->reply
s(8):!pack date
      sn == string(addr(p_p1))
      length(sn) = 23 %if length(sn) > 23
      p_p1 = pack date(sn)
      ->reply
s(9):!unpack time
      unpack time(p_p1, string(addr(p_p1)))
      ->reply
s(7):! move length<p1> from<p2> to<p3>
      shuffling = 1
      integer(X'EE0') = addr(p)
      *x'5840';  *X'EE0';        !*l_4,X'EE0'
      *x'5804';  *8;             !*l_0,8(4)  - length
      *x'5814';  *12;            !*l_1,12(4) - from
      *x'5824';  *16;            !*l_2,16(4) - to
      *x'0A10';                  !*ar_1,0
      *x'0A20';                  !*ar_2,0
      *x'0B33';                  !*sr_3,3
      *x'0B30';                  !*sr_3,0    - -length
      *x'C800';  *48;            !*lhi_0,48
      *x'D040';  *0;             !*stm_4,0
      *x'D141';  *x'4300';  *0;  !*lm_4,0(1,3)
      *x'D042';  *x'4300';  *0;  !*stm_4,0(2,3)
      *x'0A30';                  !*ar_3,0
      *x'2017';                  !*bms_-7
      *x'D140';  *0;             !*lm_4,0
      shuffling = 0
      ->reply
reply:p_dsno = p_ssno;  p_dact = 7
rep2: p_ssno = 0;       p_sact = z;  svc(116, p);  !ponoff
   %repeat
%end
%endofprogram

 H?  !                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     OD^  #W  p"P ,	 B $`Po8v 2 PopD^6-I       `                                                                                                                 
                                             
    l           @46666Z "`                    Z`flrx~  0P              ~x                                     	??:???:??                    0123456789ABCDEF         JAN-FEB-MAR-APR-jrV0 m A@ ?"8A@ ()$Q0 mtA@ ?"pA@ (}SMAY-JUN-JUL-AUG-SEP-OCT-NOV-DEC-      `          `                                      ܂܂Ѓ   ??:???:??                      @                                                            t                                                                                                             _                                                       2 d                   c          
  ))v  
 $$ <
 (-.   3  +"    
 3Ka   ,$3ys   ,&,:d L(%3 :l*%3  %K  0\/3; 58  . (s2 48m ]!,%t Jx0)\,   447w h8/t%=5l7w  4) [i4\ [i4^% [i/)p   $4r [i)K/  	m-L5   %+     8m    +q    p&Z3 l!))s  	c! >s    !$\p    !   *    !   +    !   ,    !5Mo   4)\  .,d [/-l%]q    Hd& B\$`P`~ 2]P`d 2^P`_ 2_P`Z 2`P`	u 2a@`	p 2bP`	c 2cP`	ȤB 2dP`	Ф9 2eP`	Ԥ4 Bf$P	 Bg$P	U Bh%QPP	~ Bi%P	~* Rj 2P	ڥ 2kP`	 2lP`	 2mP`	 2nP`	 rpH@ ~@ B00, RqX0  P= $U RrX P	LO RsX  P 	L" RtX P	KI RuX  P 	L@ RvX P	K+ BC@ {n C W  p 0o ri ,` @Pi , RXi ,C0F b""""P  pI X ,Xk  `""""B0*Pd bPP[   X ,Xk  `!9z r& P , 2C l RXi ,P`Id By ) bW  p ,Za "$) 2 @5 "`' "fi "f  "4fɿ "fi "f "d By )x bW  p ,ZV 2 b5 "a " ݜ "d By )r bW  p ,ZP B$lA֘7 R` @Pm' By )n bW  p ,ZL B$jAS B%aQmr B!#Aƛ By )i bW  p ,ZG BXi #)Z B'aPi ! R`  AV ""
 By )c W  p t) ,A@ dbbi ,Pi p$P lXi lUi p#:&aPi l
if ,AD"؜ By )_ bW  p 0Z9 $P ,Xi ,` C0&&aPi ,/w X  
kAXi dPi  2C λ% By )Y bW  p 4Z/ $P ,Xi ,` C02&aPi ,/e `  AX Xk  Az B$dQi  Ui ,!5`  A~( 2C ») RȰQ } rA *:Aϩ $`Pi ,Xi ,`  C08&aPi ,/ XY ӵ  P 0&QPY 	 ɰ  !ɰ !Ƞ  P 0 RXi 0ALe` 2C ( R` *A@y By )I W  p l) ,A@ dP R ,A] ` ӹ ,kAj rXi AA<$ By )D bW  p @Z f#`&aPi 8 B$ҹ ,3X	 8  $j  0   @	 < <'A@ d ,A@ ) ,A@ d|w X 8 $jP 8
 ") 2B0bXY C"'A@ d ,A@ ) ,A@ dV Ry ! bW  p 8Z	 B $ҹ ,($oDi 
mӶԓʰ @ 6 6'A@ d ,A@ ) ,A@ d bXi dPi D\ b!5y  2C  bW  p ,Z B$`P` 0 RȽ P 4 "   By ) bW  p 4Y 2!  4 ""h 2# 
`#J "$$ ٹ "%h R&Xi P`	K R'Ȱ @ 0 (P  @Y .$@ ,^ b*$PHi .ArR b+%aKi .@i .K ,#Hi ,#5$aai ,"w B-%a 0u 2.B һ 2/@ ~p 20Ar B1y )     t     2[#%3 ,   *    @ ff,:d  a %    !N%    @ 4/s  s    @ !yn  	g@ )yn  	n@ 䘀%3   3    .    @ 

4.-3 ,   3     l   *    @ NN Z0        .     ,   *    @ ,d [    0     ,   *     0 s    @ PP4   ,!9m  	g@  )        6     ,   3     8   .    @ 22 8        .     ,   3    @ 3d-L@ 4      ,     ,   .     .   -     03    @ &&0\` b2W  p 0Y 4fC &` B  b5hZo"8Pi , 6X V !5y ̴ R8$y  b=W  p @YAf!` Q!0%A@ dy Y B  <P <_ CX) <2  ` <&P9 8x D  $ 0 -  ECT@ K@ 0I .C RFP :Y /bU 2GY 2* HX	 <  P	 <Af IX	 <  $j 0 0Ї JX) <2  &  0) 1] KX  P <P u LX	   $j 0 3й MX  ʠ 0ҩ 4 BN$ҹ , O ,X)  A@ d BPy ( bQW  p HY W`?`Rb'aPi ,R X &P 4 Y  &0$*'3P9 , Z  ` 'P 0` "[!'[ r\&P 0'P 4.^  

P	 DX	 D  
P ,5 B_$II 8 R`0 -9 ;b| aX) 0"
-XP <1 b  $Z  0	 A  c   0 @E" dX	 ,    0	 : eX	 ,   0 9 f 0!5   	 9|@ g 8X)  A@ dҪ Bhy ( iW  p \) ,A@ d Rli 0Pi X Bm$P @nY ,P B0"4'A@ d ,A@ ) ,A@ d Roi -Pi D pXY XX  ___P  F r%aQi @!5$y l# sX @
X XXZ  U[~ 2tB0ػQ u 4$I 5P < Bv%3Q9 @ w#$Q @
P <xX Dư Ȱ\ <ө .
 \	 @&
AT@ $KʥP D?  byY HjA z H) ,A@ #5$y E b{X Dy < }W  p ) ,A@ d C W  p , Xi t!5z J 
iӶ ,P l%QQY tV]"İ _ɰ A!ɰ Z!*si n` _z  Xi l` 0!` 9!&z 1 2`  7 2C0y B$Q tX R$z  bW  p 4Yq AxP ,!4z m AfP 0!6X ,z i 0 %\* ,
1P: ,} RABP 0l #8P %\J ,
QPZ ,Q bX ,z < rX) $A@ wM $`Pi pӹ ,P tb rɰ #$%QPY tXY t
Yӥ ,Š #!9   P p%AQI tm RXY tC  RAJP xk Xi t
iӶ ,Ű .!?ޏ %QQY tA, Xi Z xP Ty "#; rXY  P gS rA
Xi P  RAP xly RA|P |l| #8Ȱ %\ x
P xO Xi x` X Qk J B0$Xi t
iV ,P $!; X @   P  B%Q t Xi t
iV ,P :B0V="%Q tAP A Xi Z P Ò X t
[ ,P _B0"=F"%Q tAVP A Xi Z P  n A!4Xi t#6Xi %P I Xi X V pP  By ( bW  p 0Y^ C nW  p 4 RXj C0V   Ȱ %P
 ,\ B C0*1   #% P
 ,{   @   @
 0X)   0A@ i9 X
   P AL 2C o Bz (v bXi  $Ҷ   XY X #y T RX  C0$ bl` Af Xi sf AZX)  6A@  rXi X C0$N k` A6Xi sf A*d X)  8A@  Xi X 
#X)  :A@  Xi sf `?A Xi sf 
AXi sf A rXi s P ,߬ "#; X)  <A@ kA- Xi X #X)  >A@ i By (d bW  p ,YB rX]X`	A
 rX]X`	A By (` 2 
 " ") $Q$`A@ yC  " rP  P P0
 ")  $a@o"o"AC  2 l4O "c 2P  "d 2  3 "^ " "
$!ز 2Q  "#2ٟ "  2P   2P  ") 2A'R 2C \5_ RP  P \y ") B$`P`| X"hX Y # r$VA@ yC 2 B$QP_!f*2X Y #(XK B0N  C By K 
M4; t 2 Po!Ȋv b!$N@@
@P
B\ 2"@`
 2#P
B R$`
Ad %Xo"hH ư @ - B&$Җ  R(Xo!A̍ 2)C 5 R+P  P \b R,P 
P0
F "-) B.Xm !@ /$@
`
A<C  1$@
`
AC ~G R3P  P \Z R4P 
P0
F "5) 6$i@`
`
AC Z R;P  P \R R<P 
P0
F "=)w >$j@`
`
AC 6 R@P  P \M RAP 
P0
F "B)r C$k@`
`
AC ] REP  P \H RFP 
P0
F "G)m H$d@`
`
ARC  RJP  P \C 2KP0
 "L)h M$a@`
`
A~C ( BR  P Q "S
 "T
 RYP  P \4 2ZP0
 "[)Y \$a@`
`
AC ' R^P  P \/ 2_P 
 "`)T aX`
`a&aPmD rb$@
$@
_ rc`
AC n ReP  P \( RfP 
P0
F "g)M hX`
`a&aPmDz iȰtZ"pP"x rj$`A@ [C 05% RlP  P \! RmP 
P0
F "n)F oX`
`a&aPmDs p6Ȱt+Z?"pP?"x bqA@ XC \ RsP  P \ RtP 
P0
F "u)? v$a@`
`
AC ' RxP  P \ RyP 
P0
F "z): {$b@`
`
AdC ' 2~  +i 2P
n 2
   ")3 RXo"hPo"ly B$P
| 2A Xo"lH ðB0|N Ӗ ʐ @P!ʐ @P!ȭ  BiA.} Xo!@`
`
Aği RH`
C0J X!@
`
AX7 2C Թm B$C B B$C < B$C 6 B$C 0 B$C * B$C $ B$C  2$## 2$	## 2$
#
# 2$## 2$## 2$## 2$## "$3 2  +K 2P
P 2 
 " 2
  n 2P 
 ") $R$`A@ yC  2  +C 2 
 " 2
  g "$4 2a 	 "!5 b`LockAj 2X ") s`
Z` #9X
8 Y	# 2p & b`BadIA' $S$`A@ yC pM 2 
 ! ") b`OperA 2  +. 2
  S "#؞ "!3 2  :
 ") $T$`A@ yC @p 2  +& 2 
 ! 2
  J ") RX`@Pm N B$P@W r$UkA@ y# 2C  2 P  " 2P  0 "͕g  BA@  "   RX`C0Y 2AD)6 2X] 2X`  2  9 C@ {W  p 8YQ3; %  @ dd#%+    3      ,9r   4 8   (     <   -    @ vv#%+  y      ,9r   4 ,   $     0   -     4   9    @ $8p ]! , Hd     <   9     @   -     D   .     H t     X      @  8p     ,.f [a l s     p t     t   ,     x   .     |   -           @ 	B 	B%*4    ! ,   .    ! 0   -    @ 	@ 22#   +  .f [a ,   4     @0-3    !    6    ! ,   -    @ @ 4Is    @ Θ      ,))s  	c' RH  P ,b6 R!4y #$ɰ #+` PonA$ A@  XP	PY 0
_ӥsP	F !;` AslA$ A@  
 sP 4XI 0K s`K 2!4 2Es
2 "# 
<s5sLs !B04;3B0*} BX!!6` RX) ,+ӱq "#
 b
!+ RX ,ҁӰ RX ,P!1 E
O$T  A@ * B%1Q= (6 rX (ɀ CB R!P	 4Z B$aA( RXi 4o!rX (ɰ C  A******output lost******A@ s`	` #:Apon:*Xi AT By '; bW  p 8X RH  P ,b #$ɰ #+`PoffA$ A@  b
[ sPY 0 rU#5ӫ!#7e r $@  y  b
_sP 4 BU 0!5 B$@K s "# b
LsEsQ rX!XI 4L  V1 b	
O4sP?! B
$  0 X 4
&T  A@ Ҥ B$1Q= ( s	À #9Apoff:bAt By '& bW  p ,X f!` #&`InhiA  rXi 
o$Ҷ!& By '" bW  p ,X  f!` #&`UninAG rXi 
o$Ҷ!# VUB04Ӧ sC0*}8 BX!!6_ RXI Fӱ/ "#
غ b
LF| RX9 <ӱF RX P!0< By ' b W  p LW 2"A R$Xi @i ,b R%i ,Ax r&Hi ,!4y  'X Ű #8XP	P `B0 (HY 0@Y ,Hi 2@i . )$@ 0i ,A 2+C  #  &) D f
BN~:FPhv~2^*02&=dAOjQvginyz}	B	L	^			

4
@
H

2@8JV| ,T$(/1
6.>RCvHM\cjVqv{ *:R,Fp" l"v%)-){ b-W  p ,W ".
^Q 2/PV  H B0y ' b1W  p ,W "2
^M "3
fD 24@V кs B5y & b6W  p ,W "7
^H "8
f? 29@V  B:y & b;W  p ,W "<
^C 2=PV  : B>y & b?W  p ,W "@`^= 2AP   BBy & bCW  p ,W "Dec4 BEy & bFW  p ,W "Gea1 BHy & bIW  p ,W "J``3 2KP  } BLy & 0 yn     4 K/    @  k     ,))s  	c 0 8l     44*f    @ Θ"  ) ))s  	c@ ( Ҙ ))s  	c@ ll29!   " ))s  	c@ И8Is  )  Ҟ%      9K    @ 昀.Is   id       :d    @ 6Is   #    .       :d    @ /Is   #  ;       :d    @ ,,%s53 #id   %  53   3@ BB%Ҝ h #id   %   h    @ TT%Ҝ Hd #id   %   Hd    @ ff$r ! #id   %   Hd    @ ||(r k! #id   %  
 bMW  p ,W BN`P  
 BOy & bPW  p ,W "Qe]' BRy & bSW  p ,W rTf!5XP % Ut\	 Z"pP"xa Vsa 0`  !4$ұ ?1 rWX ʰ `@   BXkA rYXi  Hf  A RZXi  Ae [Xo"xӶ 4!7$UV 4A@ Xܨ B\y & b]W  p 0W _$P ,Xi ,` #9&aPi , R`XY A^b "a"p Bby & cW  p ) ,A@ d RfXm C0* ghZo"8Ӷ P GH 2h#=m i ,) tA@ d`@ bjY lkAs Bmy & nW  p ) ,A@ d q ,) tA@ d`8 rr$a@i l$@ n0 Bs$P@Y p1 Rti lA Byy & bzW  p 0W RH P ,a| #$ɰ #$y c r
sK N
h C JW  p , "$2 "a- Bz & bW  p ,Wg "$- "`. 2  6 2P  & Bz & bW  p ,W` "$& 2  @2 "]  "]% Bz & XmD
fsmF \
nm Rm@A By & rXmHӿ!k!> B$`PmD R` A B$aAj By &| &aPmH
oV!P]@)o BP 
!7q B$P@g B$PD) RXm@AH\y By &t X`	!` #$$P	 BX`	#6u RXY AcQ "# B$aAܙ9 Xi Ȱ A@  $U@V A By &j B$`PmH R` A  B$bPmD XH_!C0P_G B$jA֖+ By &a bW  p LW H #%ɰ C $ HV @Y ,H @ .0 %P 4i ,A<y  2Px r
sK 
 rXi X B0B 2P 4 Hm*Zm'aPi 8 Xl@ ,X]p@Y .& B$Pl B$@ 0 Ri ,A r$jA.y  Rð C0s: rP ` A* b%aPi 4C B `Pm|$PtXY X P#5 `Pm|$PtXY X PX5 B$jA? Xm` #%Ȱ P Xi H PpHV P]ld b$[@*0 bX P,B RXM|@M(Yt RX?,@=<K b(&@ D Xmt` $SV` A P PZ]t` A  B y &4 bW  p LV H #%ɰ C $ HV @Y ,H @ . %P 4i ,Ay  r

sK 
 b$aKmBPi 86 X X[ #4fB06[4 B$`Pi 4 R` A Xm@i ,X@ . b$P@Y 0P]? i ,Any $_ rP ` bA@+ rXm!4y  Alp not ready AO ` @i ,$@ . X]@Y 0X@ 2$PAr XM[I 8&API 4@ Ri ,A ~ ` Pg ,$R` AN- By & R` Aj  Xi H PHV P]dl R!` A "Xi X ɰ #%P PV ;e b#$[ @B6 b$XV [P]@ 2%P]D R&Ƞ@@u R'X0@TJf b(M@&A@@ r)P @` bAT-> B*y &
 b+W  p 0V h    @ !  	.  id           @ &K   9 /  	l@ $ 8c ,   *    @ NN/t )p , Ӊt        #    @ 2	r   4 ,!9m  	g    #    @ ܘ/  	l ,6H )@ s    D%3    H  0          !    3    @         %  s    @ < <#s   4! %3    @ V@ << t    l     p 8s    t     x 	r    | x    3Nb    @ -L,        8s    $K  @ DD-J        , s    \        	  	-           Ȁ A ,$$`@P`Ƞ Ȑ ސ  !#3ސ#G  4 @?#"+ހA@|ހA@rޠ~4暮4뚮ސgޠe ޠ^!% "4!H%%aA@HC   ?4 & 
nA@(0 QJU`F 0&C "! 0H P &$ @%Q =??  _:$.#             V     fft                                                                                                    p~j                        K bH ɰ !ɰ !'
sK 
0 cAlink bad dactA Bdy % rgY ,` A- Bh$aQm~ iȽ'ZXY ,[  xq rjXɰ C 0 Bk$P= ls	ð #:ALink:mAx m-  A@ Z oXi s ð C0: pH]P #4P !7܀ Bq$@ Bry % rtP ` A6. Bu$j@mi Bv$@
 Bwy % yH]
Us]E 
^f b{Xi ,` #8_ r|P ` A.= "}#
V r~P ` A.H B$`@mi By % Hm

fsmF .
n Hm#7X ,Ű C0, rX ,Ű B0t8 RHmB0 rP ` A. B$a@m
[ By % rP ` A. B$a@m
W B$@ By % bXi ,` !7Y B$@ By % RmPm RX ,PJ R#$ɰ #& B$S@]
h 2C 3 2Pԣ B$R@]g $@
P ` A$z By % XmX ,Ҷ  &aPmL 2QԢ $Q@]
P ` AC B%aQm}y R!4$@mZ By % XmhӽkWi ,Pm$ 2B0h rP ` A/H B$c@m
3 B$`@m6 RH@d RH]@]eg 2@m쳿 RmA2 R` A8 B$`@m, 2@m By %y By %v B%aQm}^ 2C0(6 $QXZ  PY , R` AT RXi ,QmJ By %n X]PR b[` A,\ B$a@m
 2@m B$`@m
 By %f B$`@m rX ,Ű C0*5 A
Link NAK A8} B$a@m
 rP ` A0 By %^ 2C  -X   A@  R` A6 B$a@m B$d@m
 RȰ Pw b]'QP]̭ rP ` A0S By %Q B$b@m
  rX]` Az By %N -X   A@  R` A B$a@m B$@] By %H -X   A@  R` A" B$h@m bȽ'P̬ RP P]$ B$e@m
 B%Q| 2C0NX $QQ]XZ  ` AL By %: -X   A@  R` AJq B $f@m rP t` A0 rP A` A1 rP C` A1 rY ,` A1e By %, 
Xi ,` #4y * rP ` Ax13 r$a@m
$@#- By %' Xi ,` !6$@C n B$@2 By %# bW  p XU X ,#% B@#$$P , $P 4Xi 4` C0F&aPi 4+  rc
oȶ4P 0 RH[  B0( X @  X  @ XMZI ,PK B B$1Q?8p By % 2 C  "ATime bomb failsAdy #Xi @i 8X  @ :Ɛ B$$P@Y < 2%PY @ R&i 8Av B'y % b(W  p 0U *$P ,Xi ,` C04&aPi ,+ +c
oX E4!?
 B,$P@V4 b-P8 B.%Q8n B/y % 21C  B2y % b3W  p PU r7Xm` Pm R:ȰPo B;$QQP	z! r<X	 Q!* B=$P	z@ 2>QP	Ğ{ 2@Q] BB%Q<{ 2CB .7< RD <P<d E@ C@I 0$8@9 2 BF$@ 4 GH  ~  !5i 0A RLXo8C v$ M$P ,Xi ,` C0d&aPi ,* Nc
oXY8BJS ROHV4@Y 0]K RPH6@ 2\ BQ$@ 4 R@TIMEPI H0 OUTP9 LPD 2SP 8y 2T@4 bUP8 RVi 0A BW%aQo8o^ 2YC  r[Xo4YmB *p( \ӿlʰ @@ 0$Q@Y 2! ]ӯlZ"8jAꔒ R^i 0Aj amf#4y # c$P ,Xi ,` C0v&aPi ,*2dhZo"8X ,V B0XZ"8ӫ B0HF eX ,Z"8XL X=CC.Ԋ fX ,Z"8P1 * rg$)@) 0$@ 2/b 2h@ 4 RiX	 ,P	 8P Rji 0A R 2nC ~ Boy $ bpW  p ,U 2r l0 2s`  "taS 2u` 0 "v[Q 2w` @0 "x[O Byy $ bzW  p 0U r}P H` Av32 rY ,` A3 Rsi .` . " :" By $ bW  pdOX  0       .    +Z#    !;  	t
4Mo ]!){ t!Mo')@   "t +o         8d     , Z7     4   *    @  Ę 3id   %       ,   *    @ !!+# :t< m     ,   *    @ ""+#     4l   (@ ##33 ;% ,53   3@ #8#8 :d     ,2,     0   *     4$m   8,I! қi`     d H    h r    l))p   4p9Ir    t     v 8s    x/id    z!-s  	c|4[    ~+"   3/9s   248l 8r&8l" C W  p ,= rP(` A# rY @` A3H rY D` A3O Bz $m bW  pDT$ Xi @A* ,A@ d} bA@ Xi DA* DA@ d* , DA@ ) BAԼ Xi @`@ !9X DŰ  !4$PP]p Bz $e bW  p ,U4 20 / 2Ѷ  'F " "! "ԞZK "4, "֚2^ "ט<` "4- "ٚ2^ "ژ=` " "!* " " 2  3 "#4 2  3 "!6 "㘾`< "?Z Bz $N "#  B$`Pm ȃ? rs	ð @C0XY HP Adisc<<<eA{ B$`Pi , rX H[ P]d  P !P C & H @  H @  @k %APK kAz By $B RP B l 2P]h $Pl@|@~x H @tHK @MvQ RX; @=xY 	!$0 #&%P ,C # RX PI RX+ P-I rP #9 #6  b%P ,C  R XP 4I R0 B$mC '5   (
P[ R0 P=ع b   P) 8 "# b
=Ӄ@ R  PS R`&(Pi 8| Xmd
fsmF B
n bXi $P * rH]xP B< 2A¹{ Xi @Pi ,X XY DP[ M9 P #6$V P E P p#6$V P E4 2C H5q rY ,HmAd si .` #6X $QP[ Є ` ~#8X $RV[ P[ # ` #8X $TV[ P[  rXi X ,P _ 2C -0 B$`Pml}f B$Ph| b XY $P * r$Xi X @| %#4 #6%P ,C N& &X 4J|Y 8#&%P ,C 6 R'Ȱ @~ B(%RQ]h{~ /Xmh` !=Hx
[U#6V b0%P ,C  r2Hxɰ B r3s]P @]s# b4XP 07 5P `X `  @z( 6X	 0  @F  7!/#&%P ,C I 8H|Z'P 9` !7@   PM`#@   PM`[ 2:C |5 b;Xm
fPi 0>j <  Ȱ 0@t R=@~ B>  !S B?&@ A  P 0@Ϳ B!#&%P ,C "| CI|#%H|@~ DH~Z'P REXhPB
 JXmh` !6P P]#P 0P]Pw BK$cA} BN$oPmp}# BP%aQmp{/ 2QB 6> RAretry failsA5 bS%gPi ,C  rUXpŰ B0F VX]l!6%P ,C 8bWHmxA$) dA@ d) HA@ d dA@ Dk BXAdo BY%a@m 2\AƼ+ B^$jPi 0\ rbXŰ B0z cH]G]P#4%Q@]r RdH]@]b rfY <XmA첢c rgsi >` B0Z Bh%Q 0 2iB 6& jAstatus loop!iA Rk` Pi <޽ rmsi >` C0"G nAoverrunAС bo$XXmAF Bp%a@m "q#i 2sC 16;?,CBFTIfM|PSXYZ[]`BcNijnqtz <j2<n,<N^!):+Dcjglmt|R~`,Z$Pp"`v " & ( 3!G!V" ]"8^"@j"p"z#}##$#8#F#X#d#p#z#####$H$%%K'R'W(
X(2\(<f(vj(n(o(x(p rxY <HmA@ rysi >` C02zHmA2)dA@ d' ,A@ dA@ At̓ 2{C |1 2}` 4 2~B0q R` C0@q\ B$@B b$PHmAW_ rP HmA<I B%a@m Aseek incompleteA& By # rHEC0$- rH]HmA, rP BHmA B$c@m By # RHm@mb: bVHmAs rH]XmA 2C 44 R$QkA뾞 rP XmAb 2AbP rsi F`  C0DN rP( ` AF B%aQi 0% 2B *5 b$PXmAG Aseek incompleteArk 2AN] 2C v2 2C | R` @C0$q Atelefile not ready*AB-, 2A 2C F2 rs Bð C06\ B%QQY 07 2B (5 b$PXmAH Astatus locked eAH 2A޽ "#) 2C > rP(XmAꔔP P` J]XmA HmzfZm`JmPm rX`	YmC $rQ Aoverwrite system!A뤬 b%iPi ,C L RmA B$a@m By #s Xi X #5P ,C p bH]P #?` Akick rejectedATy < 2C r 2A rHm` C0" "Aspurious selch int*Ay 7_ rXŰ B0( bY <kA bsi >` #; AoverrunAC e8 By #Y RHmB0 Aspurious cont intAy  rY <XmA<^ rsi >`  C0 4 XpŰ !:A
	bad trackAb 2C C R` C0phXpŰ B00Xi <A)dA@ d' ,A@ ddA@ A: rY <HmA rsi >` C0`HmAײ)dA@ d' ,A@ dA@ A $jPg ,$W$bAZ ADisc not readyeA  r$b@my  rP HmA讵j b$XXmAJ4 2C к rH|K~@| "#.Ի RH]~Q]P BYQ]} RP @]~s 2C  2C x3[ rHm` C0r ` !:X %RD]U[ C08.X Xk A)dA@ d' ,A@ dA@ A&p By #2 rY <HmA禶 rsi >` C0 R`  B02qHmA֐)dA@ d' ,A@ dA@ A 2C ڵ
Aillegal disc address*A8 b%hPi ,C  2AN rsi B`P C0 rXpŰ B001 2Afrsi F` C0 ATelefile def TrkrA`$`Pmp_ 2C ~: B$cA儬> Xi Ȱ A@  $W@V 0 bANy , B%aPm ȁ
 B$cA\` Xi H @  HV @V  B $@ S 2!A B"y # %Xi Ht@  H]v@V  b&$@ @tK r'X ,P A)5(s`	` @#;Adisc>>>Xi ArP B)$cA B*$`@m< B+y #	 b,W  p 0S ROH P V PsP	P #9ATAPE>>>A46 bQ$`PmPmP#RX ɰ #+XY s Ġ UB00 Sɰ !ɰ 
!'
sK V
B TABad MT activityA&gR BV%aPmz WXi H @  HV @V e BX$@  YXP XMPF  2ZA B[y " ]C W  p 0~ r_P  ` A>O raZ ,` AX> bsj .` #4z D "c"l beW  p ,S f
mV7` A! RgXj  PmG[ rh]` A7 iXm` !8%P$z : j` #8%P$z ) Rk$z  [)+     f    %3     I!         %3    4l    0    0s     <53   3 @2m     D2m     H 9m     #F4Ig ]!@ #z #z2	r4L!@ , Ӊt    @ # #433% 4  @ $*@ ..!xm  	p       8s    43    3f   (53   32,    %3    -#  	%$2    , 8d    04[    D(s  /H -    L   8    P  t     ,   9     /430Ih! ,53   3@ / /3t%(t!   /    !  /H   .@ 0F 0Fų bmW  p ,S Bn$Pz oXY H PHE PM ^W rp$3@5  $@ . Rq@ @e v BreA*< Bs$lAD Btz " buW  p ,S vXm#6$cAXA\% Bw$`Pm{a Bxz " {Xm#6%PC   |X s[ P P] 2}C  B$`Pm{U 2C  Xm ` !6Ȱ 0PD#Ȱ PDK 2PmH XY ` De AP($ Xi X PXV P]> B$eA< By " XmPg ,]Xm(A!622 b%cPmC 8 XmZm'aPm3 B$P$z 2A& s]` AX]` A? s]` AX]` A? B$`Pm{G XH
[7` A rX]D` AΨ $ePg ,$W$mA<	m By " rXi X PH rɰ !ɰ #&P b%QP]C 9 B$fAF By " 2Aį $PXmHAC0xn 2At5 sm` !4y   2C `2 r]` A9 sm` #6%PC @S r` @#4$PPQ r` !4y = X
sK p
? AMT times outiAv B%hPmz) B$P$z| 2Ah2 RXmB0("ASpurious Selch int in MTAN5 By "~ ]L` AY ,` A▃ XmL` Vi ,Pi ,a b[m&aPmLX r]` A : rsm` C0` B%Q$xn "!) rX]!4%P 2C `3X]$P !<ATape retryingAJ' sm` !7$Py FM r$R$fAxC0 By "n B` #5_ B%Pys "# 2A{ By "g B$`Pm{ r$lAb$mA"]_ 2A긑 Xi X@  X] @V ] b$@ P9 RXLP E XMPPF X=P6 XP j 2Aװsm` #<AMT not readygA bXm#3A6 By "Z bW  p @S$ X  Z ,'P 0k b$D  P 4<  İ #5$y #u rf!5$y x r
X P 808 ð !5$y   ʰ P <G X 8  sE 
P   RsI 2PI 02 r	K#%$y ѝ R$y + bW  pQ b$D P X<" b#%ɰ 	C 6FuXi XAβ) A@ d' ,A@ d A@ Ay D bHV TPY PMQ "!;ժ Ű #8Ű #5Ű B0 ȠtJZ_"pP_"x~ r
sK x
 rXi X P \F R	 X]PY PJ r	#$P ##C pu b	Y `kA 	si b` `  C0"4 	Xi P
mӶʰ @Ҷ b	[Xi \As B	y ". 	Xo"8ӶŰ #4y  		t\	 PZ"pP"x! :A@ . 	
XY P
]ӥà #:c B	$@ 0 R	@ A 2[ 2	A 3$L	$P dXi d` 
C0 &aPi dX"x
kXY dZY dZY dVgC {B 	X"xXY \[ @$ҫ >X3 B	$ A r	H],k @Aޠ' 	Xi PdX"x&ck 8$Q[ :  	+ DA@ dTS r	eApy 2 r	Xi ȶ P h) b	[  'Q[  )} 2	C0.	' ,A@ dA@ m A \ r	Xo"xX P $# R	X] PV ,L 	X P&Ҧ 8$ :_ 	& DA@ dlAe1 	 Xo"x$Ҷ By 4 r	#Xi ȶ P h b	$[  'Q[  )r r	%P #$$ҫ   b	&X_"x$ҥ B	'' ,A@ dA@ m Aj]: r	(Xo"xX P ( R	)X] C0nٽ 	*Xi PdX"x&ik 8$Q[ :  	++ DA@ dT& B	,eA\P B	-y " r	.Xi ȶ P h b	/[  'Q[  )g 2	0C0 b	1m A R	2Xm Pi @L R	3X P DK R	4X] PY HL "	5#ә b	7iKP @5 R	8P D b	9@iK:PI H& 	;$g@i 0X P&@ 2 r	<$Y@Y 4$@ 6+ r	=X"xXL ,PI 8 R	>X< $P9 <M R	?X (P LM 	@0 a#50'zbQ!6   P L R	Ai 0An r	BXo"xȰ PP ,a R	CP .V 5[a B	Dy ! b	GXi X #! 	H Ay 0 	JX_"xX $ a!5X P  r	KX  @ Af r	L$BE 8$35 9 B	My ! B	P$`P`v r	RXi X P T 	SHV P @!PPY TN 	TXi TARP ,!4y AG 	U) lA@ dA@ AK r	VXi X` B0G 	W$P dXi d` C0.&aPi d':2	XhZo"8H XY Tŵ @!9X dZ"8$@ ̐ 2	YC Ƴ 	ZX TU !4$PP]  	[X] [ @!4$P @! r	\U !4$PP] 	 R	]X] C0@ٿ 	^P @@Y 0$@ 2 B	_$@ 4 	`XI ,X4 P9 8X P <J 	aX-P) @X P De R	bi 0A< 	dXi ,s ð #3A\r! 	eXi ,s ð #4$`AT; r	f` @Zi TAڂ r	g` Zi TAv b	hXi ,$@ 7r b	i$QFV @V I B	jP !; 	kX T@ 0@ 2i 0A& 	m` B@i 0Ȱ %@ 2XY TPY L9s R	ni 0Aj	oXm @i 0$@ 2XY TPY 8i 0ALk r	qXi ,H C0, b	r@ 0$X@Y 2P_ B	s$@ 4 R	tX TP 8L r	uXI X4 P9 < R	vi 0A
 "	y#^ b	zA@ dL 	|Xi ,Ӷ !4y Z 	}PtZ"pP"x$Ҧ % 	~P P  P  @ 0 	P P P ҫ A0 	 4 !3ҫ 4h+ 2	AѨ$"	) lXA@ A@ XA@  B	A$, 	Xo"x$Ҷ AҶ ;yz()F)R)\))))))))***(*<*X*|*****++0+P+`++++,,4,h,|,,,,-J--
--.. .F.\.n!.'.(.).,.P/T/\Z/]/_/a/e/f/h0m0Fr0s0u0v011.1H1l1x11111222282x22233:3j333334444	5h	5		5	6B	6d	6l	6	6	'7,	+7x	,7	17	A8<	H8h	T8	U8	b9	d9	e9	f9	g9	k: 	n:@	o:^	v:	z:	:	;	;"	;<J r	H]*f @A٦ B	y ! 	C W  p t* ,A@ d	j ,Pj p$P lXj lUj pC0$&aPj lq b	X"x$QQ[  	 

jF ,Khe 2	C гo b	X"x$QQ[  r	 
$JKhb 	X?"xX P X) P$&&# 9pp 2	S ;# r	Ӄ 4!3A B	z ! B	y ! b	W  p tR5                  
>6r  d@   2>     <  &n&n&*&*&%j++P+--.D.f                                                                   : 	retrying 
 not ready cont not ready  write protected  spurious int
 not ready                                                         	    pxcSQ ab                     
002201822x001   33f1l  	5B  6v68Z;&887
p control  
User: :	Password::
Subsystem:  logged off  Console disconnected                                  Z b	$D P ,; 	#*ɰ !'
sK 
M B	%RPY p 	H @ TH @ V6 	$@@I Zi TA|y ܂ r	X`	#4y  	AOPER startsAB! b	Xi $P ( b	P aPV L& b	iKP 5 R	P Θ b	@iK:PF % b	0   P6 -l B	$@  B	$(P) , B	$gA* 	-X   A@  	X`	Y`	B XBIf 	ASystem full!!!nAٸc B	%aPi p R	Xi pCه r	
fsmF 4
nX 	4) \A@ dC fs 	@) \A@ dC Tx 	R) \A@ dC Bw 	`) \A@ dC 0z 	p) \A@ dC { 	) \A@ d#/ 	) \A@ dR 	Hm@i TsİF@ V9 	$W@Y Xi TA^ B	$`PmyI B	$gAX B	y !k R	XP< R	X]P]=> r	X
P 0( R	!4%P 0] 	X	U 0#6X , #5 B	$P 03 "	#
 	XM!X9 0V0	P9 0k4 B	$Pxv 	$CPI ,Xi ,` C0b&aPi ,( 	hZo"8Ӷ Ű !:  	X]!5X ,P	C 6XY ,XZ_"8XU B0 X ,Z"8XI ,< C!6 b	%P pC t> 2	C ^ R	XB0$ B	%QPY p 	Aprocess slot lostA 2	C D 	P B@Y TȠ $@ V r	$@ X$B@I Z* R	X=P9 \E R	XP `ED R	X) 0P) dL 2	P p 	i TAy D b	X`	'cPi p1 b	X X[ #<!@ 	X	!7P!4%P p3 2	C Ե
 	XZ"8P*  A@ - R	XP CX 	$ODM@ !5H=@:  	XMPJ 0P:  2	P: 䤺 	$ X Ҋ  
 b	$ P P /0 R	P P S b	Zm Aˠ 	XmӶ  'Ҷ   b	H]TV  r	X X P d R	XJ PME% B	$0P9 \ R
 X P `E R
X-P) dD R
XP hD% 
  C@	 T$c@i V b
$@ X@i ZO R
X]PY pD R
i TAѪ B
y !- 
	Xi X #6%RPY pC j r

X]ȠwP  R
X P K 2
P X R
XF PE TL b
0   P5 < R
 P 0 B
X #7zL 2
P XO R
X& P% M R
X-%  
Ȁ C@ T$@	 Vg b
$`@i X@i ZO 2
P) \1 b
$DP `3	 R
i TAA B
$`Pi pj R
XP dC B
$QQP	v, R
X C0Fة 
X ʠ @@  @\ P 2
@l > 
 XMX4 P< X P BT 
!X-P, X	P  P t# B
"lAд 2
$C 궿 b
&W  p 8Q b
*hZo"8Pi , b
+$F @ G b
,XY P !8 2
1P] B
2%aAn< 2
3C d26 R
4Ӧ P 08 
5#'ɠ !$P !&$P 0 ª 
6X 0
xP 4b B
7$AaL  o 
8s<  0 X 0
1
?S"\J 
9X"hX) 0Ӂ 	(#%aA: B
;y   b
=W  p dQ 
FX"hH[ P@[ +o R
GXP JV 
HX[&P P 2
IQ  R
JK PI Lм B
KDC0`) B
L@ !$
 2
MQ "
N#Ҍ 2
OQ B
QfC0&) B
R@ !> R
S0P=ҹ 2
TP09 
UP @[ y  B
WdA⬠ 2
Y   "
Z`s 2
\P} 2
]X  2
^ %X 2
_q H 2
`X i 2
aP D 2
b   k "
c`j B
iXm#=v R
jȰPѢ 
k$QPY L$PC Cq r
nH|E~C0$W B
o$Qa]~l" 
ps~Ġ 
"|P Lf R
qHMPMP 2
rC 1 r
tH]E]C0$	 B
u$akx 
vs 
L"PI Lgm R
wH=P=P2 2
xC Z1 r
zHEC0$[ B
{$ak. 
|sM@ 
O4"P9 Lh R
}HPPj 2
~C *2% R
X"8P"h R
L P@ х R
$P$aAfi R
`Pm& 2
P` B
y   
Xi LhZo"8Po"hV b
%D @ HO 2
C0X0 R
ð C04n	 R
XV Q]I B
$P  
P @Y ,$@ .J 
@ 0XI LPI Hi ,ABC t R
ð C0n B
$P@V ȏ R
İ@  
Xo"hӶ !$U	[Cdn r
$Y@Y ,$@ .* b
$@ 0@ 2NN 
XI LPI 4$1P9 8i ,A
Xo"h' ,A@ dA@ AҴ 
s`	` #6`FailA 2
C B r

X P T- b
 ' %$ 
Ȱ P ,Y TAf 2
C0^ R
Xi TPi \K 
& HX"h   4A@ 9 2
P ` 
!  $A@  
$_D[ PwP[ M b
s à #? r
H @ Ψ r
` Zi LAvV 2
C l2
$aX Lk  X_"hӥ '$  \V]Af\ r
Xi L` C0FP 
Xp#6`ShufA] r
Xi L` C *x 
X"hX[ [[ PY Xu R
#$P X\C 
X]YY X#%X XPd~ R
XP7 
X_"hH Ơ @ (V R
 P U 2
  ! "
` 2
X  2
 h# 2
  " 2
X  2
r H 2
 # 2
    B
y  m-#(s!  H    @ 0 0!r,9s@ 0@ 44$v       I!     , s     0 K     4 ys     8       <4l    @ 444  P/  	l T%   X H     \ id     ` s     d   *     h       l 9m     ;J Mp    !@ , Ӊt    ! l   *    @ ;@ ;昀;43 %3    %   қ    %{   2 ,   *     078p L@ @@%  	u %   0      @ AA)\#  	v  7    38l :l L%   P \     T  	!     X   4    @ EJEJ0c3;$ b
W  p<P; r
s  İ P ,kX 
kA&P 8C0X
Xi H E #3!7sQ PC0  r
XY ,P @V   
eA.Xi Ay  B
$@ Ȏ 
! `  A@ R 
s	ð  !7X ,U	B0$2
X 8' ,A@ dA@ Xi AP@? 
Xi 8s ðB0 R
ð  C0Zm| r
HV P@V Φ> 
X ,
ӫ"?P 0"SP 4 B

Ҭ"?) 
XI 0
OX9 44"SD 
X ,U	!3P0	 r
U 0!4$ P 	 b
$ +"?+"S r
s ð @C0. 
XY $@  $@ S R
XI ,PE L	 B
eA 
Xi 8H ư @ H0 B
H !: 
sV PD!5Xi ,A<8 B
y  J
Xi ,A2) <A@ d' ,A@ d <A@ AϢ 
Xi H @  HV @V  B
$@  b
%P P -= 2
Aʎ B
y  C b
W  p 0Q R
ȿlP ,ǩ 
X ,k  fC0RP 
XY ӥ jB02 R
   Mc B
$`e = r
HE @@E Χ/ 
?l8Z?"8X P4ÿ B
y  9 
hZo"8 P ,K 2
C / B
y  5 b W  p ,Q X"x[ BU#5` 
B0"2 B$Q ~k s  
l K ` 
!5XK PK  e  rӫ 4!3Ab By  - W  p |) ,A@ d~$ 
i ,Pi t` #%Ȱ P t1X tP x$PPY pXi pUi xC0&aPi p b
iӶ ,P l! X_"xӥ =&ҥ =4 Ű 
#4Ű !4$ =, X ,C0. =	C$7= B$AQE  r5 
S$hF X/"x$҂ =X P 1 bX_"x$Q  bE 
TҵhB X9 l0  #X"xX! P!  2C `U By   bW  pN RqXo"lPi D( RrӶ P 0 Bs$RV  RtȠQ C Bu$`A v) LXi D `  AA rwX 0ʰ @@ P4 xsP	P !7X 0U	B08oyX`
A) A"Xi D' ,A	TAH A@i LAPR{Xi DӶ #?XP
P d#*P !'
Us]E H
^ |XP
#$P $#)$WXi 0A$y >S r}
Us]E 
^7 RXi hB0$ RX T@V RXY X@]WL RX \@V RX `@V^ 2C  1' RHP TV RH]PY XWG RHP \V RHP `VY 2C / rXi 0Pm C  y5 Xm !6%P TC >5 ` @@i L$@ N 2C $F rXi 0` @Pm  rX DX[ PY T RX P XI 2Pi hg 2C J/ B$`P`
uS Hi L!` #,` @!) $XXi 0AJy  Ri LA" RX`
C0~ X 0Ű !4$P@Y RO rXi DH R@  XP
P !7X 0ɠ B  By  b$c@i NC *ˮ b$d@i NC  ˶ R$b@i N#k R$f@i N#	k R$h@i N#k R$i@i N#k` A@i Li LAƚXi D$@ y  Xo"8X [P TXV P]M XP X$PS rXMPI \P X=[=P9 `XP@ 2P d 2C 80 RXmPi TI RX	P X@X rX_"8X P \{ RX	P `@> RX@	PI dA= r  ) hAd Xi 0@i L$@ Ni LAy  Xi T!` #&%P TC Ӂ BX X#=w bkA&P DTU !6%aPi TC  Xi DX T
X[ PY X{ rZi TӦ P \s 2#? r
 :P `; RHJ 8PI dZ R: ;P9 h 2C l Xi T!5X 0P Tϻ rXi TA&P D !6%aPi hC D RXa Pi TI RX P XI- RHQ PY \Y ӡ   
A H
P ` RXA PI dJ R1 P9 h5 2C  RX`	Pi T@ RX $P XI RX] (PY \J RȠ P ` 2C ڲ Xi XPi <#8X D[ UC0." f!7X D[ PY <L/ X <#$ɰ ##C r PtZ"pP"x 2Py X T#*ɠ 
!'
sJ 	^

 2C b/t rXo"xX \P ,ζ R#$PPV ,[ 2C J/ rXo"xX \Ҷ 2L 2Ҷ 3  2C 6/ Xo"x%D 0$XDY ^@ 0] 2C / rXo"xX \Ҷ 7L 2C / B$`Pi}U %PXi` 	C0J&aPi r	i \Ӷ  P 
Y#$P#$cQi% Xi` F#%P FPY Xo"xZiXYVh 2C  2C 0 Xo"xH 0İsY ^P @ 0 2C 04 Xi <
mӶİ ?XY \VҶ XY <
Ue [AXC Z? Xo"xH 0İsY ^P  @ 0 rð  !4$QV ? 2C 00 i \` #$$ҹ \;'  \Xo"x& XA# rXo"xX \Ҷ 5L "#н 2!Xy 2"C v'5 &$`Pi 8Xi 8` C0>&aPi 8%2'hZo"8X 8V B0 Z"8X XU !9 (X 8 @P TC >i 2*C  B+$P T} 2,C 20Xi XPg ,Y TXi DA
#5$`Pi T#%aPi T 21C  3%dTi TX  P XC v 4%dTi TX XP  C q 6$YXi 0A|y  :Xi DӶ C0& B;$QV  <XI !%$ #V 4 =tZ"pP"x 2>[ :  ?X U #6Ay  B@eA4d bAXi D$@ 4 EXi DH ư  @ H FV 
]ӥҦ j GXY 0UP!4$PY rHP	Xi 0A0 I$n@i L$@ Ni LA\H BJy  NXi DӶ C0 OPtZ"pP"x_ rPs 0à B0 RQ TA RXo"xX [ ɰ # RSXi 0Ah 2TC "0W UX U !5XV PV z_ bVXY D$@ 4 BW$ ; YXo"xӶ 4!3AR ZXo"xӶ ;C0$< b[XY D$ҥ ¢ \XI !%$BE #ҥ 5 2]C v B_y  cXi DӶ C0F dPtZ"pP"xJ bes Và #8` fX P %bAW rhsi V` C02 iX"x$PP[ P[ P[ b jӫ 4Š !4$ 4@ Bk$jAt blXo"x$Ҷ = bnsi V` #= roX"xX[ P[  rpӫ 4!3A,[ 2rC ) vXi DӶ C0B wPtZ"pP"x7 xө Xɠ #%  X ry X+ DAi bz$D Vҫ B r{X [ P TK 2|C U P\I TXi DZV PV ƃ 2C P) RolPi ,Ƹ rX TZP 8 X ,k  fC0  bhZo"8Pi HU bXY 8YV !2 RȦ P , 2C Ұp Xi D[  V Ӧ ҫ  L RX 8P Hu rHF @ @F Ρ ?l8Z?"8X P4* 2C p ` C@i L$@ NC ֻ BXm !=x r	t) TAap RȰP hX 2C 4 @i LX D[ _ө OZ@Y NC  R` B@i L X D[ _ө OZ@Y NA 2C |+ r$g@i L$@ N( 2C l+ b$g@i NC ʿ R$a@i N#j R$b@i N#j R$h@i N#j B$i@i N ` @i LX 0P hC 0xD r Rm A RXm Pi TI RX P XHc RX] PY \I RX P `Hq RX 0P hH @ C@I L$3@9 NC  RXi 0Ak/ RXi TPi 0I rXi XA&P D b!4y  b%RXi 0AX# By | RXi 0A|k] RXi TPi 0I r$i@i l$@ n' XP
P !4$@ nC B$@ p@ X 0P tP xi lA  rX`
` C0J^ By m Xi DӶ ɰ !%QPY TC ) B&Ҷ  2P X r
XY TP[ ,g B$P T}Q 2C ] Xi TPi 4$P TӒ BfB *(8 rf#5%QVPY 4E Xi DXY 4Ӧ 	Z!$Bs 2V  "#  B%P T| #XY Dӥ 	j#%u B%P T| "# Bҥ  rXi DV PY Xu3 2C 8 Xi X#)X D[ 	e!#k K rXY TXi 0A8Z By L Xi TPi 8$P 4Ӎ P PW ,Y 8Xi DA\C0V RXi 8Pi @Is X D+  H  4AL $_D[ PwP[  X \!6 &P \+ X \!ɠ !#ҫ ź& RX XC0c 2P 4 rXY 4Xi 0A[E By ; ri LAC a rsi L` @i Ly "!7Ѥ RX @ LX( 2C0. rHi LA&P D !6%aPi TC B a f#5Y LA,(T b	$`Pi TC (DO Xi T#&` !#A5 2C -? Xi T#&` !#A5 2C l-N RXi X@` ~X X T
[PP  h 2X  4 2C Xi T` #+` !(hZo"8X XҶ c 2C ,- #Xi T#$` #&%P TC ? b$
mX XҶĹ B%$PPY T} 2&C  r+$a@i L$@ N' 2,C - R0Xi TPm $I/ 1Ȱ C@ L$U@Y N$@ P R2i LA֊b3Xm $A)A	' ,A A4A(A 24C - 8$`Pi 8Xi 8` C0$&aPi 8$ 9
mX TV!7X 8P TC h 2:C Я B;%P T{ 2<C  @$c@i L$@ NC hc BEXi `#?vp RFA&P H[R Ga ` !ȰLQ  "H#ϐ RIX DP HHf K` Pg ,Y XXi HA!6u bL%oPi TC D rNXi HȰQ ( O$S@Y LX
ʠ@ N3 BQ$ham	RcE RRH	R@ R_A SXY D@ i LA< rTHi L` CC^s BUy  rYXi DȰQ - bZ$\@Y LC J _Xi `iPg ,Y XXi DA܎!6g b`%oPi TC D b$c@i LX
ʰ@ NC 1 Bf$j@i L8 gX \!5$R@Y N#$S@Y N 2hC /G 2rC s rv` @i LC &% z` @i L$@ N% |Xi XPg ,Y TXi DAC0F b}Xi D$Ҷ K 2~Ҷ  Ri LA= RXi 0Ao3 By  bW  p PNl $`Pi ,Xi ,` C0:&aPi ,$F bX"x$QQ[ ' 
is Ġ 
 h 8  
#6XK UK !2# 2C  bXo"x$Ҷ : RXY ,Y 8
 Ӧ A@ 0 8@ 2i 0A By  bW  p LNc bXo"x$Ҷ ; V A@Y ,Ӧ 9@ .i ,A By  bW  p `NJ Xo"xs 0ð #9$ b$SFV 0@V 0F By  V 4
Us]E 	
^D bXo"x$Ҷ 4r Xo"xX U  !<A B$QV 48 bӦ ?B0jR By  B$QQV  |h s Ġ 
 P Lz 2C - Xo"xX  U  #:V ?U!6 B$Ҧ 4 C HXV UV #6\r B$Ҧ 4 C 4X U  #6\ B$ 4I 2C  - bXo"x$Ҷ 4a bV ?UC0Q Ӧ @ʠʠ aP L&jAXi L@i ,i ,AXi LA. RHi ,C0 X"x[ >P 
#5	A rA***A rsi 0` Pi Ph2` !*ASystemnA#hZo"8A: rA: sA AX) TA$ei T R	A20k BA| R 4At R	AlB bXo"x$Ҷ 4N 2C $. bX"x$P[ ? $ҫ 4%aA8Xo"x$Ҷ 4Q 2C V V ;U#5!3A. Xo"xӶ 4C0" V >P 
#7
sK 	
Tb rf @&a$ZAT|t By \ bXo"x$Q  f V 
eӦhP L X"xXL UL !4$4< 4 ɠ  #< ;3#: X [  #Ab8 rXi L` 
B0&9 X"x[ 3'Q[ 3 "!< Rӫ 2ҫ 3K #6$F 0@ 0 rXo"xX LҶ >J Bɰ  # rŰ 
!4$]PY L B$TV 4 f @&aXY LATH By H bW  p ,N& Xo"x%D 0@ 0' Bð #6
 B'@ 05	;J	;	;	<.	<D	<	<	<	=	=	=(	=:	=L	=^	=n	=	=	>	>	?(	?
@ 
@
"@
&@
2A,
9A
=A
WB
C
Ch
C
C
C
D 
D@
DR
D
D
D
EJ
Eb
E
E
E
F
F
F
G
G& GGGHuHvIyI6|IJ~JKKKKLPMN6N0O
6OL?O@OHOIP QP6SPPYPfPkQ&pQRyQRfSSHSXSpS~STTTUU,URUtUU2VD3VLFVKW SWH_W|WXXX$XXXXYZZZ&ZDZPZjZpZxZZZZ[D[[[- 2AZ By A bW  p \M BfC0:% R`C0\f BfB" 2AXo"xX U !6V 4P !4y  2 A*y By 3 Y LX"xk @Af rsi N` Pi Lh> X"xX[ [[ PY Pq RP |C 4d B$ҫ 65"` C0&` C0` #=` #:` #7$ B
$gA By ) X [  ɠ x#$y {  bӫ 6B0R' ` !'
fsmF 	
n+ R` B0vi Xo"xX U !4y  sV 
P 
Vӥ hP L B%Q z bsF 0@ #= $hA`  A$hA[ 2C ". 6 C3!5` \Av bXo"x$Ҷ C~ RXi LAdl By   7#;` a!` z!%`Pi L    C#5` \A2 !Xo"x$Ҷ 6Ҷ C "Xi LAXi LAFy y #Xo"x$Ҷ 7y = $Xo"x$Ҷ 7y ; %Xo"x$Ҷ 6y ; &Xo"xX [ P Pp B'$SP_![$ r(s 0à C06y )$P TXi T` 
C0$&aPi T" *X"x
kXY PӦg	Z#l B+P!s~ ",#ή 2.C Ю 0Xo"xX [ Z!ɰ {#$y  2`  A`  AZpM B3%aQo!X R4!$y  "5"ϙ b8Xo"x$Ҷ C~ 9XV UV !4y M r:s 0à C0@e ;Xo"xX U C0$k B<%QQV z =$hA`  A $hA$`A: 2>C ̮ R?XV PV  H 2@C  .m 2APV . B` #A$jAү CXo"xӶ :B0FZ2 BEy  bFXo"x$Ҷ C~ bGV <UC0Qi H$`mX"xk < RIX[ P_!& JXo"xX U!C00 BK$QQ_!Z rLӭŠ C0 BM
ҭ N
s! 
L hJ6 2OC  RPXV PV H bQӽC0ZN rRӦ AĠ P X BS$ C TŰ B08M6 5CB0* U 4 !3 4d rVP P P  2W =s rXP P P  RZ%QjA \Xo"xӶ :B0\[ B]y  R_Xi LA r`Xo"xX P ̺ raV :U#3A:Z Bby  reXo"xӶ 2Ҷ 3p fsV 0P #8%D 0@ 0AF gXi L` #4y ' h$P LkAnC A i` [Ab` ]AZ$jATb 2jC  lXo"x X) 4A bmY ,$`A Bny oXo"xX U #6XV UV  #4y x p` #A
$jA bqXo"x$Ҷ C~ rXo"xӶ :#3ADr rsXo"xX P! tXo"xX U!#? Bu$QQ_!Y vs!Ġ 
j hA渏 2xC ֮ Byy  zXo"xӶ Aɰ @!$y X b{%RDV 0@V 0F 2|A1 b}Xo"x$Ҷ C~ R~XV PV Hc RӦ <#>d ` !Aj$jAdD R` !Af 2C  B$mAR Xo"x$Ҷ <AXo"xX P  y By  Xo"x$F 0@ 0ɏ B$jA- rXo"xX P ̅ V 4P !4$Ҧ 4?X 2P x rV :U#3AL0 By  Xo"x$F 0@ 0ɋ By  By  ,%   0   &     4   "    @ G&G&5w   0 ,      @ GG       s    @ GG4 Ӊt , Ӊt     l s     p   *     t l    @ HΘH3\  	R3\ H ,       0%   44l     8   *     < )t     M+"        *        .      )h    @ N@ X$X$)s \. ,   *    @ XX/:k45@ XܘX44     L s     P      T3t    	3b    @ [[2[#3&@ [[ 4      &     L s     P   .     T   -     X))s  	c a d    ! B C W  p ,} bX"x$QQ[   s 
 
l h2 Bz  bW  p @MU Xo"xӶ BP 0$PV BZ R DP , F <D#5=	P: ,< X ,1  3!4$mA`P2Xj ,Ӷ  P <$PPZ 8Xj 8Uj <C02&aPj 8Y rZj ,Ӷ  P 4q BŰ 
!8
& P PZ 4$mAf RXj 4Aq 2C ®a rX"xXZ 0[ BJ Bz  By  bW  p 0M` Ȱ P ,Xi ,C0"'aPi ,C
 X b
kXV !6X ,y  2C ֮D R%y _ bW  p DMD &k&2  $l&P9 49 B$P 8{` R_&PY < rX <Hk  C0 rc
oVPY @ RX  P ,Gs Y 8!&`StspAp! RXi ,Pi 8G X @XY 4I[ B :3k 2Q[   bH @ [ 2B0 . rXI <H  P 0 RH; @4  hp RH*@ Uz 2@*
 Ry B Rȫ P <I 2C r b`DKspAr "#  bW  p @M, B$P 4{I R_(PY 8Ľ rX 8Hk  C0 rc
oVPY < RX  P ,GX Y 4!&`STspAp* RXi ,Pi 4G X <XY I[ B J3t BYQ[  * rXP	[Y PP	ِ rH [ @  2B0 . rXI 8H  P 0l RH; @4  hT RH*@ U^ 2@* Ry & Rȫ P 81 2C b R%y ' bW  p 4M H
 P ,!5$y 2 r
ȫ 0P 0t R @
  R*$AF R` j 
W 2@Z usI @ #;@ !8eA$Xi 0P  bX ,y  bW  p HL  U!&`ReleAɘ BXi ,#6t RX  Q	< "# B$Q  zE X	    $lP   Xi  X ,k  Zi Pi <{ RXY 0PY DG r	X DHk  C0 r
c
oXVPY 4 BUY <!<y RX P92 RX  a ' By & H X ,  
ZPY 8 RUY B0\س RX  a (, RHF"PI @I 2C0B-G C
OX9 <U4B0"V RH"@"L) RH/*@$"F RX @@*D RH a +J R#	Y4#&C b`OV 1AB[ By  b X Y 4# !XI <YI 4#&`OV 2Al 2"C :-q $	Z#&`OV 3A %Xi Ui 4!6`OV 4Ar &Xi DH  
["PY D8 2'C  (Ho*Pi <!6`NOspA"R )Xi <c
oH"@* r*X DHZ  @V"  R+X <@  V R,XI PF9 R-X9  @6 I B.y  b/W  p ,L 0ӿ =!6`RemAA 1Xi Ӷ 
V [ >| r2T
_Ӧ ҥ =. b3$  & B4y   b5W  p 8L s    @ a a0s4%@ , K    "	 K    ! 04q    ! 4 s    ! 8   -    @ b@ bb3\  	 ,   *    @ bꘀb3:d 8p  s     ,   0     0   1     4,K     8 K/     <  0    @ cc%3%3  s     ,   0     0   1     4 K/     8  0    @ dldl-yn   4 3&       s     ,      @ dؘd!r  	s  I!       s     ,43     0 :l     4  .     8  n     < Ӊn     @   0     D      @ ff6r   %@ fԘf2;   4        0       9$P 0_ =PY 4a r:d
oȦ 0P , ;X 4k  fC0** <d
oXY ,X  Y 0!1 R=  P 0ˬ r>
L =PI 4 2?C ȭ @Xi ,[  V X 0Ҧ - rAT
_X  > 2B   BCy  bDW  p @L bIhZo"8Pi 0 rJU#A0P  8"KXi  !` !(X 0b
kXV #5%y  RLȠP ֬ rMZ  XY ,[ i rNT
_ 0P 4 OXI 0H4 0 @@4 G1 PH$P <!6`SaslA QXi <c
oȶ
P 8W RR[ @_$y SX 4  XI <J ŝ TX9 0X  
! P+   RUH a Ey bVX  y å bYW  p 8L R]ȶ P ,֩ _X ,k  f!6`CajnA `Xi ,Ӷ  
[
PY 4, baX  U  #7 Rb P ,֍ 2cC  d P 0HO$E 6  @?$   Bey  bgW  p 0L i$P ,Xi ,` C0&&aPi ,! bj
mӶ!:$ RkXY V blX ,y c 2nC έ Ro%y  bqW  p 0L s$P ,Xi ,` C0&aPi ,! t
mX V!4$Ҧ< 2uC ֭ Bvy  bwW  p PLx                      <>@
<<8=f=V=D=2= =<System fullFaulty subsystem Unknown user No user serviceShutdown imminentProcess runningInvalid password     fails   <- no process   $SQZOVP
NPJRRRKK$JL>RFJJJKrRQRXQST
TrTLLNSRRJJJ e VVV$VW^WtWtVRRWWU(VvJ`JfO"O4J8U4UUUUUSzWJ
TWSDI   svc    
M6MNMbM|MMNN>NhNQ not availableswopping from unit 
   Y^YYZY^Y    aaaa`4aa`N\]_aa_]]]_`naal^Taa^Taa`aaaa
Int:  	kl6 ~C LW  p 8 X D
kV PZ 0g B$  XJ B
K4 P: 4b s  #5Xi 4Ar bXj 4$P  " XY 4UP!3P rX 0!4z M r
L 0PJ , X9 DH K @  $ 
  !6ӄ '҄ j RVdAX Xj ,Ӷ #4z   rV 
P B06 P #5P V 
p $P ,O(PG 0HV Xf  Ap bXj ,$P  " 2AZ`2Xj ,Ӷ 
ð #5V U#5V U#4z 	X #=$@PG ,?&P7 0HV lAhF/ Xj ,H
 Ҷ XZ 0@_
 u Bz  rXi H P , #*ɰ 	!'
sK 	
 m bXi %P !% Xi H @  HV @V  2A By 2Xi X P 4#*ɰ !'XV !P ##C 6B bZ"8P DL b
[ӥ P 8F BC0 r
 0P H rL 
@ `L 
 X6 2
;X  `P b b$ P& C n96 Xi X P 4#$ɰ ##C L bZ"8P DB RXV PY <G
 %P @Xi @` C0"&aPi @ ~ s >ð #3AU bXi <aPi <6? 2C ҭG X $PP[ C V rXi X P 4 ɰ !ɰ ##C . bZ"8P D8 XV PYPY 0j0 #6J[ YP	##C d XY 0$bAlP 8 !8Xi %P C  P ,Xi XV Xi 4A0Xi P a 2C ~ rXi X P 4 ɰ !ɰ ##C X֧ bZ"8P D- bXY ,P !> X !ɠ ##C 4G BjA©J 2C ., %P @Xi @` #7&aPi @A"
`3 rX DP [ U B%Q	n Xi $P C  rXi X C0"Pi L$aXY LVe X XZ AXi P 8= !6%P C 9 r
X 4P * RX] $PV F 2C U rXi X P 4 r#$ɰ ##C * bZ"8P D XV T
_ȥ 0P Ha H J Y	B X( X P ,XV Xi 4AXi P o 2C B rXi X P 8 r#$ɰ ##C   r
[ 0PY H ӥ 
à !6`SharACi rXi HȰ Ҷ  bXY $P " b B0 XF #<P ,?&P7 0HV dAm Xi HH
 Ҷ XY 8@_
  2C 0 rXi X P 4x bZ"8P D bkAP <` BB* rXi 4AzP @
 BBt:Xi DX <

XQ"P 0 P[ ?7 X X <P XI @PJ C 2C H bW  p dK U`	!6`PendAq Xi hZo"8Pi ,q s ð #5$y  %QPY \Xi \` C0&aPi \  X ,[ &QP PY T[ Ƴ b
[ӥ P X B C0V# r
 0P ` rL 
@ B0 X9 T2
; P Pbt RX!  BZ RȀP  ָ rH+   @@+ Ο5 b ' #g R	, "#? 2C nT X ,H[ P @[ EZ R$y  Xi `Ӷ 
ð #6`PoutA) Xi `$V 
Ҷ 
 RXV C0& ð !6`Sh ?AX( r$o@i 0$@ 2$ B$PPY 8z 2C 0, Hf A6Xi `P K r$@ 0$T@Y 2$ r $@ 4$@ 6$ R!$LP 8^ r#Xi `X  P < R$X] $PY @Fo R%H P DU r&X P LP R'i 0Aӱ B($nAu )Xm`   Pml+$P ,_(PW 0X `HZ Xj  A9 b,Xi `$P  !B 20A< R1$y  b4W  p 0K r6f!5$y # 27Pi , :Xi A#5$y ;q ;Xi 
oӶ"SP E <U ,!5$y  2=C ά b?W  p 0K 4   "    @ gZgZ%2m# %     ys     , Ka     <   3    @ h2h2!;     Κ4     ,   .     0   0    @ hh5yn Y %   ,   *    @ hh!r&)s %   ,   *    @ i0i03\. , 8d     0 s     4%   8       <   3     @   *     i>4d   %!  ys    ! 0      % 4 Κ4    @ j@ nlnl/c \  [     P   3     T ys     X       \   *    @ pTpT%3     1     , h    @ pp      %    %]q     ,   . A
oӶ"?!5Ӧ"S#6`On QA@ bBX  Xk  !8 RCXY P[  F 2DPY , "E#̒ bF
oV"?PY , HXk  
oX Ҧ"?> BI
_ҥ"S bJ
X ,"? RKXK  J"Sz RLX9 P;  F BMy  bNW  p 4K BPX  !6u bQP	y k bS
["?PP	 T
_ӥ"?P ,"SP 0V BU
Ҭ"? VXI ,
OX9 04"S?s WX  U	!4$ P&   bX$ҵ"?ҵ"S BYy  bZW  ppIu gs	ð #:A
activate APS hXi H 
sK 

lo rlXi X P h bmZ"8P
, rnH[ P@[ ΢~ roP #4y 4 RpP @[  qP  #6`WaitA Br$`Pi dz sX
,XPI[ !$$P dG tX	!=X d#4X@!7i RuXI hP@	< 2vC + Rw !< xK D!5$3; #$2;  rzK @ B0@V {Z"8: CC0$ R|	P , }X 	P) XX hP	P) h8 B~$Pyj "#Y R	P , bC <@ !7Ef R0	P9 ,̡ C *@ #4X9 d!9r B$3; 	 R@	PI ,z "#N B$ E R@PI , rXY ,Xi hA| Xm
,Ӷ 

XV J[PV ! XU h!4$P: 2C *" B$`Pmx B$nAu/ rXi X C0^z?Xi Xf A) lA
P' ,A lADA rXi X	P s $Y@V  $@ $@ = 2A Xm
$$P  C RF X]
0ӥ 
à B0,2$P ,O&PG 0HU X=
0Xc A bXm
0$P  rC à `B0ؤ b '   X]
$Xm
0AFXm
0A]2Xm
0Pil%fXl[ 
eX
0HZ AXP
8 RXm
(  _ 2!< A
AMT full A} 2C - r
ȱ 0P T rX]
0X  P   B$ | RHO$PM
<9 r!6`SAslA^ Xm
<c
oȶ
P PLj R[ @_$ $ҫ X TXM
<L ia RX=
$P;  <a RXm
8A.X RXi TPm
0; Xm
0%V 
Ҷ 
 X]
$X  Ơ P  = 2C f+ B$`Pmxw B$nAu	 rXi X C0Nz) RXPPV :ReA)pAd
b' ,AXpAA{ Xi $@  $W@V $ B$@  2A 2C J+ RX`	C0Bn bhZo"8Pm
,/ rs ð @B0 Xm
,%D @ ^ RX`	A˒ Xm
,XI !%XP	PP B$dPmx[ `	AX`	B0;k B$Pw `	AvX`	B0; `	AfX`	B0z; rX#4y  `AJX`	B0^:. By ` B$RV | %aPi XXi X` C0\&aPi XR X
,[ &QP P]
4[ ƞ rR
[ȥ P
$ RX  B@ӵR C0   Y	#s  #6`ProtA 2C T X
,H[ P@[ =A 2C  Xm
,H İ@ < Zm
4V P]
(ӥ  P
87 !6`No AAd Xm
8d
oȶ 0P
0L8 r[ 
P B0, bӫ &ҫ !H 
'V[   \X
$P P\  x 2C  rX	I B~! Xm
0Hf AXm
0P  bi BB " B$nAt R` A Ho(c
oH"P X% #4H_(!6`NoStAm Ho(c
oXP
@= RHV P]
D= rX X
aZ 	 RH*@"C RHO(@O*? RXi X@o(BX BYP]
D B
P
L  R X:P=
H- B5P:1 bX
HP 80 2P < RX-
@P) @; r$@ 0$@	 2% B$@ 4+ Ri 0A By , B
$cAt R` AФ B$nAt o =Pm
<f!6`FlnkA Xm
<d
oȶ 0P TU rX]
HY[  Bo rX
LY  B xo= R P `ɘ rXK  [M
DPK  O H; 
3'1 
0  P \) R; P9 Xʼ RXi XC0(z c
oXV
X  #(X \P  %Q `] RӶ
 P X 2C Ы[[ \ \6
\]]$]6 ]h"]~2^8=^B^Z___a_f`h`,i`8l`Zm`dp`r`v`|aa0a>aHaVa|aaab:b~bbbc@cccdlddd de!e$f
%f(fJ/f0f5fDgZJgrPgYh2_hVghqhwi0~i>izijj*jljkkl&lxllmbmmnn(nlnojoo'p(p+p:0pH4pT:pr?pApNqZqgqqrrs$s<ssstt$thtttu0uhuuuuvLvvw
ww4w
wwwwx) X `#6`Use?Ax r Xi TӶ P
<f "! 2"B0N- B#%aA 2%C Dd"'Xm
0H 
'V 
VV   X
$[PZ  > b(Ӷ &Ҷ !B R)Xm
8A\i *Xm
0Ӷ 
ð #? R+İҶ 
W ,X]
$X  Ơ P   2-C ޮ 0XY $@  @  r1$@ $D@E $5 b2$\ P ( R3X6  P5 F R4X- $P% E R5H P UQ R6X 	P < 7X !6`NoDkA R8Xi AB B9%aPmv B:$nAt B;y  >X`A#4y Z ?X`	A#4y [ @X`	A#4y [ AX`	A#4y [ BX`	A#4y \ BDy  bEW  p \J \f#7X"hӫ j!:L7 r]X"hӫ P M B^$`AǦ r`Xi A&P X a#6s`	` #6`NoPRA\ bXi ` !&`ResPA cXi Xs ð #8P V y ȇ rdð #4y 2 re` Zi Alt fXi @i 4X  @ 6U g$P@Y 8X
@ : hX X$BFL @L ~ BiC J"/ 2jPPs k@ !4H< #6`ContA lXi  ` !9X XX[ PpP[  RmX
P <: Rni 4Ap Boy  bq$1< < $  r P <#3< ˀ rs@ #4lA  tXi Xs ð  C0TV UC0J' uȠtJZ_"pPY T9. v 4 B0"XE UE != bw$05 45 B% xX  Y  ##P  c Bz$@ ȇ R{ : ;H3 r}) @A R~i 4AF si 4` #9X XH[ P @[ 5 By  R%QeAf}} RXo"8P`	
 Rȿ @P	] RȟtP	 \ R_tPP	$ Rȯ
$P	( R$P	,= RO"@P@	8 R=|P0	< rX"p!tP 	@Ou$P!Xo!` #9&aPo!P A" 2A  2
 v Ro!P`  RȰ  P , rs]"` AZ* R` @`  RȰ@ # B$P 8x rH]` <AЅ2$`Po!Xo!` _#;&aPo!
oX!&Ҷs" RȿP! B$ҟ B$QPP	o P!Xo!` #>&aPo!L R
o$Ҷ! 2Ҷ 2Ҷ s 2C ܫH B$P!V 2P	ܓ ҿlP4+E B$Q@_
 =2P!Xo!` #<&aPo!d
oX!&Ҷ ="̠ B$ҿ
 B$@*uB$RP_!Xo!` #<&aPo!c
oX!&@"", B$@"uv B$@&u RP P_, RȠ	@0k 2@2! B$@(uG 2@*% b/ 0$A5k 2@$2P!Xo!` #<&aPo!c
oX!&Ҷ
 " B$ҿ i 2Pp   X`  `` P`	 rXP	 b$@|@~A R@@e R@@e %QP_!Xo!` C0^&aPo!, r
o$Ҷ"?Ҷ"SԞ X!Z"8)  AH X_!XZ_"8Ƞ ҥ Hp X!Z"8@PL  X?!8Z?"8PC  2C ` X"8P"h$қ 
t+A` P   P[   ޭP  $ $DK K * R; P0 O%P!Xo!`#9&aPo!H]A" bH]($aA)c$`Po!Xo!` 
C0 &aPo!
mX!

H[
f AC i rH]` mA愄 rH]&` A^ rH]` A2 rH]`Ay rH]`Ayb%aPo!Xo!` #>&aPo!
f
mHVJXo!AC  RȰ  P  H]j` 4A`  P` 0Kt H]p` A`  P` J H]n` LA`  P` HK> rH] o,Ar* rH]$o0Ar! rH]0` A* rH]2` A& C W  p 4< b
f` Pi ,+ RH]*AM $aZi ,H].A΍ Xi 
mVXi ,A rY 0Xi ,Afu} rP Xi ,At  $aZi ,P ANT rP AXi ,AuF $aZi ,P CAN r` `Zi Au t\	 Z"p! :A Ȱt\ Z"pXi ,k @ By . $`Po!Xo!` #7&aPo!A."
@ b
$X` A B$`P`
nB rH]o!Ac Xo"8X!PȐbP) $QV
|& A b%PVN RX
P\8 RX@
PFX9 RX0
P6T9 RȀ P<U   A@"@_"o"A" $`Po!Xo!` C0&aPo! bc
o$@4Y bP8' 2C ֪ RȰPɍ rP @` mA2!A
Mouses V ' ,A   A4A- B"$`Pmw& R#Ȱ @P) 2$A* r%H` ~`B0: &Ȱ P  X	P b'A******** Abort: i' ,A$AAO )` C@o"$@": *$@"o"A(E +$jPg ,$U$gA  B,$b@` ~Q B-$P	n 2.C 26
  "7)} R8Xo!C0r b9
oӶP!| :
ӛ!B0<[ sUC02c ;X!@"o"A <Xo!` !'
fsmF ^
n r=o"AC b?X_!U_!!5 B@$P!Vv "A#ʗ RBӫҦt BD$`k 2FC rMo"ACU rPo"A#8CIR rSo"A.C= rVo"A;C0 rXo"A4C7 rZo"A<CTD r\o"AXC4 r_o"AC} ra` ACz Rbo"A 2c`
 2dX 2e  b 2fC rho"ADCQ. kC W  pd tC JW  p 4 RuӺ /P 0f bv[YPZ  RwX 8b
l
U'QXJ ,@  P EVJ 0@ PF  Bxz  RyX`4P`	+d rzX	P ,P	r {$PPY 4Xi 4` C06&aPi 4m b|eȶ P \ b}[  UC0f ~X Z"8P 8*  A4 X P ,@ `PG 0X[ $aADl5 Xi 8X 0   P X 2P 0f 2P y RPwPV \yX \X P ,@ PG 0XZ $bA Xi 8X 0   P TXY \XU YX	P , P 0$cA Xi \X Q	b rX ,[ P ,i XY 8   P <J R%A RX   ' ,A
Am A& rXi 8X P < $QV V P X 2C  Ȱ B@ <$Q@Y >~ $@ @i <Ak RXi ,P`	: RX	P$+ 2@o($PPY 4Xi 4` C0 &aPi 4b
oPi `$bAވXi `P"C _ rsðC0*fbX`A2) dA
' ,A
 dA>Ah*bX`	aA)dA' ,A
AAb bX`	'aP`		 ba` P`% By  bW  p dI=    @ qq  d        1     ,   &     0   "    @ qq6H ]!
$   3     ,   1    
(       X   *     \ yn     `   5     d zb     h%  
4 ys    
8      
<   .    
@ 8b    
D :d    
H zh    
L {    @ y̘y)#Y            .     ,-(p   3 053   3@ {2[#))t    ,     ,   *     0   +    @ n433ڜ , 3     0  	0     4   *     *-#    !  ys    !   s    ! ,  !    ! 0     @ t@ %>s#,- \      "i `` #-Asystem stack???A% $`@i 2r	 ,  q	 ,> B$`Pi `w H .
sK 

 2C ( 2A X) 4APX) @AD 2C r( Ri 2Pi \Ә Ӷ  ɰ #%P V  D bi LA Xi LPi 4X PP 8i XY TPY <X XP @ 2C *( Xi 4Pi LX 8P Pe XY <PY TX @P X rY 2i LA2 RHi 2Pi `S 2C ) 2A Ri 4Pi \ӈ Ӷ  ɰ #%P V  :X/!A
AXA
AX \A
A $d@i ,@i .C  Y 4Xi 4AvC  Ri 4Pi \Ӂ Ӷ  ɰ #%P V  3 bAP 4KR 2C Z) rY 4Xi 4Ad 2C J) B$aPopd Rȹ ,Pe 2X@ 2X  2X  2X$  "
 "
  "3 "0 2  0$ 2@   BAC   ؞ BBC   ٜ "
0 "  2@   B$`Popd "# Hi 0@i ,$@ . $`@i 0X `@ 2r	 ,  tq	 ,(\ 2C (
bX , $@X= 0
3'4XC   PC   "0
3$ '4PC   "P P6 PV  5!%$$C !$  Ps  Q  Pc '
qX=  s #'q!$$C ~X^ P8PQB' 5H   !5$$C V 0!C   C   #'1HC   @C   '2"H   !5$$C   R  e
b
PP #%$$C R  '&a&1  6  "b  R  P#
#6  1  8&&a'"U&l6lmmrmjkF  qqu8st  w                                                Transfer failed  Transfer failure *idle* system :	STORE??? K of user store  	 $lL<  
e#x)x7yX8y`:yl>yz?y@yAyByEy^y`yazbz,ez`kznzs{}{r~{z{|||2|T}\}~L~~~~~~6Nbv  .:P
J!N$'*+;>=\MPSVXZ\_abhkt*~"T"BnDņȇ̇0χD    -E `   :    @ @ @ ̈             }2   H?    =                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!            }          
              NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8      eA AA  	  dQ@     ox     ,&@ ld    A@  = :
    A?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nH  !34  1  0 !81 !5$$A> #$$A> &C ?1  34C0  D   D   
C H  !34  1  0 !81 !5$$A> B  @ !4B ";
C@ !$$A> #$$A> B  C
B$P#E  E  &Q'1"C GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$  w P (A , #X $aW   ( ,X  A  ?' , ,A  A" ( rA  r l  q l' , ,A  A" W   H$QXh xlW   TW  ,x  X HA@ D.A=$RXi HA@ D.$Qr reg addr = x'B00'
%constintegername regs = reg addr
%constinteger atemp    = x'B04'
%constinteger time rt = x'B0C', time left = x'B10', null time rt = x'B14'
%constinteger clock arg = x'B08'
%constinteger oper id = 1 007 883
%constinteger enginr id = 662 331 985

! ######## mac variables ########

   %owninteger mac status = 0
   %constintegername mac status reg  = x'340';   ! status register
   %constinteger sys segs = x'300';              ! segmentation registers
   %constinteger wprot     = b'01100000'                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |      0 rh  r               	     l Co l          A=$RXi HA@ D.$oPg ,X @X<  P7 0$S$aA&` A.C $aA;r$kAȌA=X @X  &HK 
DP Xi HA#;XY HXe  Qi H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        %begin
   %string(63) file
   %recordformat parmfm(%shortinteger dsno, dact, ssno, sact,
                        %integer p1, p2, p3, p4, p5, p6)
   %record(parmfm) p
   file = string(comreg(1))
   string(addr(p_sact)) = file.":"
   svc(17, p)
   printstring(file." =")
   write(p_p2, 1)
   newline
%endofprogram
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
 C!         <	(}O        C    	  O      NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z           a !!       #    (  a a    1  a   	   = !     9  A   a    A  a a  a  a  ba  AB    A !  !  a    a 8   ~ !     a    a         !          0A a a    a  a A A !      AAAAA  b! a  A  !   4  dQ@    D"Z 	{,     ,v   0}    4@   gq+   ,v   	qIKM ,>   0v   2       W   ,>   0D   24%    Ơ W   ,    MYK  Đ ,S   	gQ@     v   ,d    g\       W   	g\2      W   	ox     ,&@PUgV;`  Ty@   L>   PD   TK    X   \+   `K(   d-   h(U@ ll  pwj t"AH   v-xB@   xW   |x ~@ K, *     S%v   Lu;`Ā S   m B04HZSUPERVISOR DUMPEDj
MODULE     CODE           GLA            SNO   STACK
==================================================== SUPERVISOR LOADED.END 	MOUSE.OBJSYSGENSNO SUCH DISC!! OUTPUT DISC: MOUSES SYSTEM GENERATOR V1.0 DISC WRITE FAILS TOO BIG!             MOUSEY NOT ENOUGH STORE CHECKSUM ERROR BAD FIRST BLOCKCORRUPT OBJECT FILELOADING  TOO MANY MODULES   :  C6D6C7D7                     d                  C 
   H  !34  1  0 !81 !5$$A> 6#$$A> 6&C  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n?1  34C0  D   D   
C H  !34  1  0 !81 !5$$A> 6B  @ !4B ";
C@ !$$A> 6#$$A> 6B  C
B$P#E  E  &Q'1"C $A1    0#
#	QD   RD   ?&A'"3A> 6GHO  s/ "B
'X=  2 #$$A> 6&r0U> ?P7D   &D"$  w A , W   P , 
#4  !2"W   P 0 
!5$y W   P 4  !2"
 
#4$C X 0 a!P 0X9 ,0 a!3P9 ,8
P 0$&P 4
Z`H  U 0!5X 4C X 4Ű B0$C z e	w ) ,A A l !A   ? ,W   HW   H ,W   HW  ,$ $A 1	w A , $08 ,$aW   `W   P 0 
!4y   #9Ӹ ,&K  ,Ҹ ,C  ,	g A , $0&1P9 ,s İ P 0X P ɰ 	#&Ȼ 7P 0#Ȼ 0P 0kW   <X9 ,0 B0y  3	g A , W   P ,W   X @  X: X ,J  @  XJ HT  aX |z  +
w A , $1Q8 XH @ !5AdEZMXPI ,' ,A  ,A W   HW  , ,$bW   x$bW   `W   @ !2"	W   P L !6H  #5A$1@8 |h AH İ Ű #5vAh tAh vAh AH Š !5h Ah AHH |#5fArXX h
UZX PX XXh hJh t&a`
fZh Ph \Ph dX hJ tJ v&P hc#%TA$X9 ,H t
P X l
XI ,Z PT Xi ,H v
P X8 l
3Z8 \[8 X ,ȣ P $A@H |h AHX P @X ~Hh d`@h P BrP B jP !6 \P x#8 XP8 xP !8h A%a H P 0$@PH LC  &APH LXX xXe  AtXh x$Q  XH LUI 0B0C $Pi 0$0@8 #
&1@8 h A@H8 U9 0 ;h A.H |#3C H ~!2#C XH C0,XX dX) ,  A   Xa Pb X dX9 ,X ,P #X) ,LA $@PB XY ,$`Pe W   X hQ l'P 0%1P8 L#&1P8 L
3Z8 Hc  A*X8 LU9 0 >$P hy 	g A , $1Q=TXMhZMTd  X]TPB0X p#% B.$`W   l2W   HW  ,$ A%QP]TP 4&P pX=hP9 8XPP <$P @@ o@I 2r	 ,  fq	 ,XY 4C0" W   HW  ,$ Ay  k	g A , ` Asi AXi hAXi Ay  	g A , hAXi Ay  	w P (A , 'NPH p  P $P l%1P8 W   HW  ,$`W   `W   APPB .$`W   lW   HW  ,$ A$aW   `W   $aW   x$P h$P p( ,A AA ,.A!2#A"$aW   lW   HW  ,NW   H%&P LZXP I  D!3C W  ,X W   H$iXX   lW   $VX8 Xc W   T` (W   <X Xk A6` )W   <$UX Xj W   T` (W   <X Xi A` )W   <$WXH Xd W   T$WXh Xf W   TX LŐ B0
W  ,$aW   `W   X p #$`At"$P p%1&1P8 L$`A^X8 L0  :XXXk A` AX l
ʠ?j`AXXP L@&APH PXX Le  A$aQh LXH P@B0$`W   l<W   HW  ,x ~                                                                                                                                                                                                                                                                                                                                                                                                                                       $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |               `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  p<                                                                                                 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        %CONTROL X'1000'
%BEGIN
   %ROUTINESPEC PUTH(%INTEGER N)
   %STRING(31) FILE
   %OWNINTEGER DUMP UNIT = 2;    !WORK DISC BY DEFAULT
   %OWNINTEGER SP = -1
   %INTEGER J,K,L
   %INTEGER CA, GA, LA, GLA, FREE, TOTAL, SECTOR
   %SHORTINTEGER CODE SIZE, GLA SIZE
   %INTEGERNAME N
   %SHORTINTEGER CHECK, TYPE, LENGF, WORD, V
   %RECORDFORMAT INFM(%STRING(7) NAME, %C
                      %INTEGER CSIZE, CADDR, GSIZE, GADDR, %C
                      %INTEGER SNO, STACK)
   %OWNRECORD(INFM)%ARRAY MODULE(0:15)
   %INTEGER MODULES, LIMIT
   %RECORD(INFM)%NAME MOD
   %SHORTINTEGERARRAY A(0:(1024*50)//2)

   %INTEGERFN DISC ID
      %CONSTSHORTINTEGERARRAY DISC(1:4) = M'C6', M'D6', M'C7', M'D7'
      %INTEGER S,T,U
      READSYMBOL(S) %UNTIL S # NL %AND S # ' '
      READSYMBOL(T);  %RESULT = 0 %IF T = NL
      READSYMBOL(U) %UNTIL U # ' '
      %RESULT = 0 %UNLESS U = NL
      T = T-32 %IF T >= 'a'
      S = S-32 %IF S >= 'a'
      T = T+S<<8
      %FOR U = 1, 1, 4 %CYCLE
         %RESULT = U %IF DISC(U) = T
      %REPEAT
      %RESULT = 0
   %END
   %ROUTINE PSTRING(%STRING(63) S)
      PRINTSTRING(S);  PRINTSTRING(": ")
      PRINTSTRING(FILE);  NEWLINE
      %SIGNAL 11,11
   %END
   %ROUTINE READ FILE NAME
      %INTEGER J,S
      FILE = ""
      SELECTINPUT(1)
      %CYCLE
         READSYMBOL(S);  %RETURN %IF S = NL
         FILE = FILE.TOSTRING(S) %UNLESS S = ' '
      %REPEAT
   %END
   %ROUTINE HEX(%INTEGER N)
      %INTEGER J,K
      %FOR J = 1, 1, 5 %CYCLE
         K = N>>16&15;  N = N<<4
         %IF K > 9 %THEN K = K-10+'A' %ELSE K = K+'0'
         PRINTSYMBOL(K)
      %REPEAT
   %END
%ROUTINE LOAD FILE
   %RECORD(INFM)%NAME MOD
   MODULES = MODULES+1;  PSTRING("TOO MANY MODULES") %IF MODULES = 16
   MOD == MODULE(MODULES)
   %ROUTINE HALF(%SHORTINTEGERNAME N)
      %INTEGER X
      READSYMBOL(X);  READSYMBOL(N)
      N = N+X<<8
      CHECK = CHECK+N
   %END
   PRINTSTRING("LOADING ".FILE);  NEWLINE
   OPEN INPUT(2, FILE);  SELECTINPUT(2)
   READSYMBOL(V) %UNTIL V # 0
   READSYMBOL(J)
   %UNLESS J = X'82' %AND V = X'82' %START
      PSTRING("CORRUPT OBJECT FILE")
   %FINISH
   CHECK = 1
   HALF(WORD)
   %UNLESS WORD&15= 15 %START
      PSTRING("BAD FIRST BLOCK")
   %FINISH
   HALF(CODE SIZE);  HALF(GLA SIZE)
   HALF(V)
   HALF(V) %IF WORD>>4 = 4
   HALF(V)
   %IF CHECK # 0 %START
CE:   PSTRING("CHECKSUM ERROR")
   %FINISH
   CA = ADDR(A(FREE));  GA = ADDR( A((FREE+CODESIZE+1)&(\1)) );  GLA = GA
   FREE = (FREE+CODE SIZE+GLASIZE+1)&(\1)
   PSTRING("NOT ENOUGH STORE") %IF FREE > 1024*50//2-20
   MOD_CSIZE = CODESIZE<<1;  MOD_CADDR = TOTAL<<1+X'1000'
   MOD_GSIZE = GLASIZE<<1;   MOD_GADDR = TOTAL<<1+GA-ADDR(A(0))+X'1000'
   %CYCLE
      CHECK = 1
      HALF(V)
      TYPE = V&15;  LENGF = V>>4&X'FFF'
      %IF 1 <= TYPE <= 3 %START
         %IF TYPE = 3 %THEN N == GA %ELSE N == CA
         %IF TYPE = 2 %START
            HALF(V)
            LENGF = LENGF-1
        %FINISH
         %FOR J = 1, 1, LENGF %CYCLE
            HALF(SHORTINTEGER(N));  N = N+2
         %REPEAT
      %ELSE
         HALF(WORD) %FOR V = 1, 1, LENGF
      %FINISH
      HALF(V)
      ->CE %IF CHECK # 0
      %EXIT %IF TYPE = 0
   %REPEAT
   %IF MODULES # 0 %START
      MOD_NAME = STRING(GLA+32)
      MOD_SNO  = INTEGER(GLA+32+8)
      MOD_STACK= INTEGER(GLA+32+8+4)
   %ELSE
      MOD_NAME = "MOUSEY"
      MOD_SNO  = 0
      MOD_STACK= 0
   %FINISH
   CLOSE INPUT
   TOTAL = TOTAL+FREE
   PUTH(A(J)) %FOR J = 0, 1, FREE-1
   FREE = 0
%END
!*******
   %ROUTINE PSYM(%INTEGER S)
      %RECORDFORMAT PFM(%SHORTINTEGER DSNO, DACT, SSNO, SACT, %C
                        %INTEGER P1,P2,P3,P4,P5,P6)
      %RECORD(PFM) P
      %OWNBYTEINTEGERARRAY A(0:511)
      SP = SP+1;  A(SP) = S
      %IF SP = 511 %START
         %IF SECTOR <= 0 %OR SECTOR >= X'120' %START
            SELECTOUTPUT(0)
            PRINTSTRING("TOO BIG!");  NEWLINE
            %STOP
         %FINISH
         SP = -1
         P_P1 = SECTOR;  SECTOR = SECTOR+1
         P_P2 = ADDR(A(0))
         P_P3 = DUMP UNIT
         P_P4 = 0
         P_SACT = 111
         SVC(102, P);  ! DISC WRITE
         %IF P_P1 # 0 %START
            PRINTSTRING("DISC WRITE FAILS");  NEWLINE
            %STOP
         %FINISH
      %FINISH
   %END
   %ROUTINE PUT(%INTEGER N)
      PSYM(N>>24);  PSYM(N>>16)
      PSYM(N>>8);   PSYM(N)
   %END
   %ROUTINE PUTH(%INTEGER N)
      PSYM(N>>8);  PSYM(N)
   %END
   TOTAL = 0
   MODULES = -1
   PRINTSTRING("MOUSES SYSTEM GENERATOR V1.0");  NEWLINE
   SELECTINPUT(0)
   PROMPT("OUTPUT DISC:")
   DUMP UNIT = DISC ID
   %IF DUMP UNIT <= 0 %START
      SELECTOUTPUT(0)
      PRINTSTRING("NO SUCH DISC!!");  NEWLINE
      %STOP
   %FINISH
   SELECTINPUT(1);  CLOSE INPUT
   OPEN INPUT(1, "SYSGENS")
   FREE = 0;  SECTOR = 2
   FILE = "MOUSE.OBJ";  LOAD FILE
   %CYCLE
      READ FILE NAME;  %EXIT %IF FILE = ".END"
      LOAD FILE
   %REPEAT
   SELECTOUTPUT(1)
   PRINTSTRING("SUPERVISOR LOADED");  NEWLINE
   PRINTSTRING("
MODULE     CODE           GLA            SNO   STACK
====================================================")
   %CYCLE J = 0, 1, 7
      MOD == MODULE(J)
      %CONTINUE %IF MOD_NAME = ""
      NEWLINE
      PRINTSTRING(MOD_NAME);  SPACES(9-LENGTH(MOD_NAME))
      WRITE(MOD_CSIZE, 6)
      PRINTSYMBOL('(');  HEX(MOD_CADDR);  PRINTSYMBOL(')')
      WRITE(MOD_GSIZE, 5)
      PRINTSYMBOL('(');  HEX(MOD_GADDR);  PRINTSYMBOL(')')
      WRITE(MOD_SNO, 7)
      WRITE(MOD_STACK, 7)
   %REPEAT
   NEWLINE
   SELECTINPUT(1);  CLOSE INPUT
!   PSYM(0) %WHILE SP >= 0
   PSYM(0) %WHILE SECTOR < 256
   SECTOR = 1
   PSYM(0) %FOR J = 0 ,1, 255-12
   PUT(MODULE(0)_GADDR);              !GLA BASE (R13)
   PUT(X'1000');                      !CODE BASE (R14)
   PUT((X'1000'+TOTAL*2+63)&(\63));   !STACK BASE (R15)
   J = ADDR(MODULE(0))
   %FOR K = X'F00', 1, X'FFF' %CYCLE
      PSYM(BYTEINTEGER(J));  J = J+1
   %REPEAT
   SELECTOUTPUT(0)
   PRINTSTRING("SUPERVISOR DUMPED");  NEWLINE
%ENDOFPROGRAM
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        DIRECT.OBJ
LOAD.OBJ
.END
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        **  18/7/79
TEST EQU 0
 PROG 5/16 TEST AND BOOTLOADER
 CROSS
 SQUEZ 99
* REGISTERS
P1 EQU 13
P2 EQU 14
P3 EQU 15
THIS EQU 1
LAST EQU 2
CA EQU 3
J EQU 4
K EQU 5
L EQU 6
LINK EQU 7
LINK2 EQU 8
PARM EQU 0
COUNT EQU 9
WK1 EQU 10
WK2 EQU 11
WK3 EQU 12
 SPACE
* LINK SPEED SETTING
CLKA EQU 0
CLKB EQU X'40'
LINKRATE EQU CLKB
 SPACE
* ASSORTED CONSTANTS
CR EQU 13
NL EQU 10
ACK EQU X'86'
NAK EQU X'95'
ENQ EQU X'85'
SYN EQU X'96'
STX EQU X'82'
ETX EQU X'83'
ETB EQU X'97'
BEL EQU X'87'
SENDNEXT EQU ACK
SENDLAST EQU NAK * RETRANSMIT
NOT1 EQU X'FFFE'
NOT3 EQU X'FFFC'
NOT1023 EQU -1024
TIMES EQU 2 * BASIC REPETITION FACTOR FOR TEST LOOPS
CONSOLE EQU X'C0' * SERIAL I/O PORT ADDR.
CONREAD EQU X'92' * SET IT INTO READ MODE
CONRESET EQU X'03' * CLEAR PENDING INTERRUPTS
 EJECT
* -------- EVERYTHING BELOW HERE IS RELOCATED DURING TEST ----------
PROGBEG EQU X'1000'
SAVE EQU X'1000' * REGISTER SAVE AREA
 SPACE
PSW EQU 16*2+SAVE
 SPACE
STORETOP EQU 2*2+PSW
REPEATS EQU STORETOP+2
 SPACE
 ORG PSW
 SPACE
* ALO HEADER:
 DC Z(0) * INITIAL STATUS
 DC Z(START) * INITIAL PC
 DC Z(START) * INITIAL LOAD POINT
 DC Z(PROGEND) * LAST HALFWORD TO LOAD
 SPACE
* FIND TOP OF STORE
START LHI J,PROGEND-2
 LHI K,X'F0F0'
 LIS L,0
 STH L,0 ** YES - IT'S TRUE !!!!
 SPACE
FIND.1 AIS J,2
 STH K,0(J)
 LH P1,0(J)
 BZ FIND.2 * STORE TIMEOUT -> 0
 AIS P1,1
 BZ FIND.2 * ALL ONES = -1?   ->
 LH L,0 * WRAPAROUND ?
 BZ FIND.1 * NO ->
FIND.2 SIS J,2 * LAST HALFWORD ADDRESS
 STH J,STORETOP
 BAL LINK,MESSAGE
 DB C'STORE TOP=',0
 DB *
 LH PARM,STORETOP
 BAL LINK,PHEX
 BAL LINK,MESSAGE
 DB CR,NL,NL,0
 DB *
 SPACE
 LH J,STORETOP
 AIS J,2
 SLHLS J,3
 IFZ TEST
 BNZ MUSTSTOP
 ELSE
 BZ TESTS
 BAL LINK,MESSAGE
 DB C'**STORE TOP VALUE WRONG**',CR,NL,0
 DB *
 ENDC
 B TESTS
 EJECT
* RUN VARIOUS PROCESSOR AND STORE TESTS THEN LOAD REAL PROGRAM
* OVER THE PASLA LINK
 SPACE
TESTS LHI J,1(0) * SO IT CAN BE PATCHED
 STH J,REPEATS
TEST.1 LIS P2,0 * PLUG ILLEGAL INSTRUCTION NEW PSW
 LHI P3,IITRAP
 STM P2,X'34'
 BAL LINK,CPUTEST
 LHI J,PROGBEG
 NHI J,X'E000'
 BNZ RETEST * DON'T RELOCATE TWICE
 SPACE
* STORE TEST P1:P2 FORWARDS THEN BACKWARDS
 LHI P1,PROGEND
 LH P2,STORETOP
 LIS P3,2
 BAL LINK,STORE
 LH P1,STORETOP
 LHI P2,PROGEND
 LCS P3,2
 BAL LINK,STORE
* MOVE TO TOP OF STORE AND REPEAT
 LHI P1,SAVE
 LHI P2,PROGEND
 LH P3,STORETOP
 SR P3,P2
 AR P3,P1 * P3 = STORETOP - (END - START)
 BAL LINK,MOVE
* NOW RUN STORE TEST AGAIN
RETEST LHI P1,X'D0' * START OF INTERRUPT TABLE
 LHI P2,PROGBEG
 SIS P2,2 * **DYNAMIC SO PROGBEG IS RELOCATED**
 LIS P3,2
 BAL LINK,STORE
 LHI P1,PROGBEG
 SIS P1,2
 LHI P2,X'D0'
 LCS P3,2
 BAL LINK,STORE
 SPACE
* LOOP ON LOW STORE TEST ?
 LCS J,1
 AHM J,REPEATS
 BNZ TEST.1
 SPACE
 IFNZ TEST
 BAL LINK,INTTEST
 ENDC
 EJECT
* WAIT FOR PASLA ACTIVITY THEN LOAD.  AFTER LOADING, CONFIRM
* OR DENY SUCCESSFUL LOAD.
* PROTOCOL IS:    (FROM 5/16 END)
* SEND 'BEL' AT ABOUT ONE-SECOND INTERVALS UNTIL LINK RESPONDS
* WITH 'SYN'.   WHEN 'SYN' IS RECEIVED, SEND 'SYN' AND ENTER LOADER.
* ON CONCLUSION OF LOAD, TEST FOR SUCCESS.  IF OK, SEND 'ACK' AND
* ENTER NEWLY LOADED PROGRAM - OTHERWISE, SEND 'NAK' AND RETRY
RELOAD BAL LINK,LINKINIT
 BAL LINK,MESSAGE
 DB C'LOAD ',0
 DB *
RESNIFF BAL LINK,SNIFF
 B LOAD
 SPACE
LOADED LR COUNT,COUNT  *  *** CHECKSUM ***
 BZ LOADOK
 BAL LINK,MESSAGE
 DB C'*FAILED*',CR,NL,0
 DB *
* LHI PARM,NAK
* BAL LINK2,SEND
 B RELOAD
LOADOK BAL LINK,MESSAGE
 DB C'O.K.',CR,NL,0
 DB *
* LHI PARM,ACK
* BAL LINK2,SEND
 LPSW X'80' *** FILLED IN BY LOADER ***
 SPACE 2
SNIFF STM 0,SAVE
SNIFF.1 LHI PARM,BEL
 BAL LINK2,PSYM
 LHI PARM,BEL
 BAL LINK2,SEND
 BAL LINK2,GET
 CLHI PARM,SYN
 IFZ TEST
 BNE SNIFF.1
 ELSE
 BE SNIFF.2
 BAL LINK,PHEX
 LIS PARM,CR
 BAL LINK2,PSYM
 LIS PARM,NL
 BAL LINK2,PSYM
 B SNIFF.1
SNIFF.2 EQU *
 ENDC
 BAL LINK2,SEND * ECHO 'SYN'
 LM 0,SAVE
 BR LINK
 SPACE 2
* BASIC LOADER:
*   READS ALO FORMAT INPUT WITH AN ADDITIONAL HALFWORD FOR
*   CHECKSUM AT THE END.  CHECKSUM IS CALCULATED AS THE HALFWORD
*   SUM OF CONSECUTIVE PAIRS OF BYTES PLUS AN ADDITIONAL -1
*   NOTE THAT THE INPUT DATA MUST BE LOADED ON AN EVEN BYTE
*   AND CONTAIN AN EVEN NO. OF BYTES
 SPACE
LOAD LCS COUNT,1 * INITIALISE CHECKSUM
 LHI P2,HALF
 BALR LINK,P2 * INITIAL PSW
 STH P1,X'80'
 AIS P1,1
 BZ RESNIFF * READ FAILED ?
 BALR LINK,P2 * INITIAL LOC.
 STH P1,X'80'+2
 BALR LINK,P2
 LR CA,P1
 LR L,CA * *** TO LOOK AT LATER ***
 BALR LINK,P2
 LR LAST,P1
LOAD.1 BALR LINK,P2
 STH P1,0(CA)
 AIS CA,2
 CLR CA,LAST
 BNP LOAD.1
 BALR LINK,P2 * CHECKSUM IN LAST+1 HALFWORD
 B LOADED
 SPACE
HALF BAL LINK2,GET
 EXBR P1,PARM
 BAL LINK2,GET
 OR P1,PARM
 AR COUNT,P1 * *** CHECKSUM ***
 BR LINK
 EJECT
IITRAP BAL LINK,MESSAGE
 DB C'**ILLEGAL INST',0
 DB *
 LH PARM,X'32' * OLD PSW PC
 BAL LINK,SPPHEX
 DC X'8888' * BREAK
 EJECT
* TEST STORE FROM P1 TO P2 IN INCREMENTS OF P3
 SPACE
STORE STM 0,SAVE
 BAL LINK,MESSAGE
 DB C'STORE TEST',CR,NL,0
 DB *
 LIS LINK2,0 * CLEAR FLAG - SET BY ERROR MESSAGE
* NHI P1,NOT1
* NHI P2,NOT1
 LHI COUNT,TIMES
ST.1 LR CA,P1
 LIS THIS,0
ST.2 STH THIS,0(CA)
 AR CA,P3
 CLR CA,P2
 BNE ST.2
 LHI L,PATTERNS*2-2
ST.3 LR LAST,THIS
 LH THIS,PATTERN(L)
 LR CA,P1
ST.4 LH K,0(CA)
 CLR LAST,K
 BE ST.5
 LR PARM,CA
 BAL LINK,PHEX
 BAL LINK,MESSAGE
 DB C': REFRESH/ADDR COUPLING ?: ',0
 DB *
 LR PARM,LAST
 B ST.ERR
ST.5 STH THIS,0(CA)
 BAL LINK,NULL
 LH K,0(CA)
 CLR THIS,K
 BE ST.6
 LR PARM,CA
 BAL LINK,PHEX
 BAL LINK,MESSAGE
 DB C': WRITE-REREAD MISMATCH: ',0
 DB *
 LR PARM,THIS
 SPACE
ST.ERR BAL LINK,SPPHEX
 LHI PARM,C' '
 BAL LINK2,PSYM
 LR PARM,K
 BAL LINK,SPPHEX
 BAL LINK,MESSAGE
 DB CR,NL,0
 DB *
 SPACE
ST.6 AR CA,P3
 CLR CA,P2
 BNE ST.4
 SIS L,2
 BNM ST.3 * GO DO NEXT PATTERN
 SIS COUNT,1
 BNZ ST.1
 LR LINK2,LINK2
 BNZ MUSTSTOP *    *** ERROR ***
 BAL LINK,MESSAGE
 DB C'O.K.',CR,NL,0
 DB *
 LM 0,SAVE
 BR LINK
 SPACE
PATTERNS EQU 4
PATTERN DC Z(0)
 DC X'AAAA'
 DC X'5555'
 DC X'FFFF'
 SPACE
* NULL ROUTINE TO ENSURE FLUSHING OF ANY STORE BUFFERS
NULL BR LINK
 EJECT
* BASIC CPUTEST - EXPAND AS REQUIRED
 SPACE
CPUTEST STM 0,SAVE
 BAL LINK,MESSAGE
 DB C'CPU TEST ',0
 DB *
 LIS LINK2,0 *  SAME FRIG AS ABOVE
 LHI COUNT,TIMES*2
 LIS K,0
 LIS L,0
 LHI P1,18541
 LHI P2,13849
CPU.1 MHR J,P1
 AR K,P2
 LHI L,1(L)
 BZ CPU.2
 LR K,K
 BNZ CPU.1
CPU.2 LR K,K
 BNZ CPU.3
 LR L,L
 BZ CPU.4
 SPACE
CPU.3 BAL LINK,MESSAGE
 DB C'**FAILED**',CR,NL,0
 DB *
 B MUSTSTOP
 SPACE
CPU.4 BAL LINK,MESSAGE
 DB C'O.K.',CR,NL,0
 DB *
CPU.5 LM 0,SAVE
 BR LINK
 EJECT
* TEST INTERRUPT FUNCTIONS
 SPACE
 SPACE
 IFNZ TEST
INTTEST STM 0,SAVE
 LHI J,X'D0' * INITIAL VALUE
 LHI K,2 * INCREMENT
 LHI L,X'D0'+512-2 * 256 DEVICES
 LHI WK1,ILLEGAL
VECT.1 STH WK1,0(J)
 BXLE J,VECT.1
 LHI WK1,CLOCKINT
 STH WK1,7*2+X'D0' * CLOCK
 BAL LINK,MESSAGE
 DB C'INTERRUPT VECTORING ',0
 DB *
 LIS WK1,0
 STH WK1,CLOCKCNT
 SINT 0,7
 LH J,CLOCKCNT
 CLHI J,1
 BNE VECT.2
 BAL LINK,MESSAGE
 DB C'O.K.',CR,NL,NL,0
 DB *
 B CLOCK
VECT.2 BAL LINK,MESSAGE
 DB C'*FAULTY*',CR,NL,0
 DB *
 B MUSTSTOP
 SPACE
* VERIFY THAT LINE-FREQUENCY CLOCK IS RUNNING
CLOCK LIS COUNT,5
CLOCK.1 LIS J,0
 STH J,CLOCKCNT
 LHI J,CONSOLE
 OC J,RESET
 LHI J,ENABLE
 EPSR K,J
 LHI P1,35 * ABOUT 10 SECONDS WORTH
 LIS P2,0
CLOCK.2 SIS P2,1
 BNZ CLOCK.2
 SIS P1,1
 BNZ CLOCK.2
 LHI J,DISABLE
 EPSR K,J
 BAL LINK,MESSAGE
 DB C'CLOCK COUNT =',0
 DB *
 LH PARM,CLOCKCNT
 BAL LINK,SPPHEX
 BAL LINK,MESSAGE
 DB CR,NL,NL,0
 DB *
 LH J,CLOCKCNT
 BNZ CLOCK.3
 SIS COUNT,1
 BNZ CLOCK.1
CLOCK.3 EQU *
 SPACE
* USE CONSOLE TO TEST INTERRUPT DRIVEN OUTPUT
CONTEST LHI J,CONSINT
 STH J,2*CONSOLE+X'D0'
 LHI J,CONSOLE
 OC J,WRITENAB
 LHI K,TEXTLINE
 LHI J,ENABLE
 EPSR L,J
 SINT 0,CONSOLE
CONTST.1 CLHI K,ENDLINE
 BNE CONTST.1
 LHI J,DISABLE
 EPSR L,J
 LM 0,SAVE
 BR LINK
 SPACE
TEXTLINE DB C'  INTERRUPT TEST O.K.',CR,NL,NL,0
ENDLINE EQU *
 DB *
 SPACE
 ALIGN 4
CONSINT DC Z(0)
 DC Z(0)
 DC Z(DISABLE)
 LHI WK1,CONSOLE
 WD WK1,0(K)
 AIS K,1
 LPSW CONSINT
 SPACE
 ALIGN 4
CLOCKINT DC Z(0)
 DC Z(0)
 DC Z(DISABLE)
 STH WK1,CLOCKTMP
 LIS WK1,1
 AHM WK1,CLOCKCNT
 LH WK1,CLOCKTMP
 LPSW CLOCKINT
CLOCKCNT DC Z(0)
CLOCKTMP DC Z(0)
ENABLE EQU X'4800'
DISABLE EQU 0
RESET DB CONRESET
READ DB CONREAD
WRITENAB DB X'32'
 DB *
 SPACE 5
 ALIGN 4
ILLEGAL DC Z(0)
 DC Z(0)
 DC Z(DISABLE)
 BAL LINK,MESSAGE
 DB C'****ILLEGAL INTERRUPT AT',0
 DB *
 LH PARM,ILLEGAL+2
 BAL LINK,SPPHEX
 BAL LINK,MESSAGE
 DB CR,NL,NL,0
 DB *
 ENDC
 SPACE 5
MUSTSTOP BAL LINK,MESSAGE
 DB C'**STOP**',CR,NL,NL,0
 DB *
 DC X'8888'
 EJECT
* MOVE P1:P2 INCLUSIVE TO 0(P3) RELOCATING AS REQUIRED
 SPACE
MOVE STM 0,SAVE
 NHI P3,NOT3
 LR L,P3
 SR L,P1 *RELOCATION CONSTANT
 SIS P1,2
 SIS P3,2
MOVE.1 AIS P1,2
 AIS P3,2
 LH THIS,0(P1)
 BM MOVE.2 * AVOID SIGN-BIT PROBLEMS
 CLHI THIS,X'1000' * LOWER ADDRESS LIMIT
 BL MOVE.2
 CLHI THIS,X'1FFF'
 BP MOVE.2
 AR THIS,L * RELOCATE
MOVE.2 STH THIS,0(P3)
 CLR P1,P2
 BL MOVE.1
 B MOVE.3(L) * JUMP TO RELOCATED COPY
MOVE.3 EQU *
 IFNZ TEST
 BAL LINK,MESSAGE
 DB C'RELOCATED TO',0
 DB *
 LHI PARM,PROGBEG
 BAL LINK,SPPHEX
 BAL LINK,MESSAGE
 DB C'  -  RESTART AT',0
 DB *
 LHI PARM,TESTS
 BAL LINK,SPPHEX
 BAL LINK,MESSAGE
 DB CR,NL,0
 DB *
 ENDC
 LM 0,SAVE *  **N.B. 'SAVE' HAS BEEN RELOCATED **
 BR LINK
 EJECT
* ROUTINES TO DRIVE LINK
 SPACE
* INITIALISE PASLA
* CLOCK B , 8 DATA BITS + ODD PARITY + 1 STOP BIT
* INTERRUPT DISARMED
 SPACE
LINKIN EQU X'1E' * INPUT SIDE
LINKOUT EQU X'1F' * OUTPUT SIDE
 SPACE
LINKINIT LHI J,LINKIN * FDX INPUT SIDE
 OC J,LNKCMD2
 OC J,LNKCMD1A * INPUT SIDE
 AIS J,LINKOUT-LINKIN
 OC J,LNKCMD1B * OUTPUT SIDE
 BR LINK
 SPACE
LNKCMD2 DB LINKRATE+X'34' * CLOCK + 8 BITS + ODD PARITY + 1 STOP BIT
LNKCMD1A DB X'81' * DISARM + READ + CMD1
LNKCMD1B DB X'83' * . . . . .WRITE . . .
 DB *
 SPACE
GET LHI WK1,LINKIN
 LIS WK3,0
GET.1 SSR WK1,WK2
 BFC 8,GET.2
 SLHLS WK2,15 * TO INCREASE LOOP TIME
 SLHLS WK2,15
 AIS WK3,1
 BNZ GET.1
 LCS PARM,1 * TIMEOUT => -1
 BR LINK2
GET.2 RDR WK1,PARM
 BR LINK2
 SPACE
SEND LHI WK1,LINKOUT
SEND.1 SSR WK1,WK2
 BTC 8,SEND.1
 WDR WK1,PARM
SEND.2 SSR WK1,WK2
 BTC 8,SEND.2
 BR LINK2
 EJECT
* UTILITY ROUTINES
 SPACE
SPPHEX LR WK3,PARM
 LHI PARM,C' '
 BAL LINK2,PSYM
 B PHEX+2
 SPACE
PHEX LR WK3,PARM
 LIS WK2,12
PHEX1 LR PARM,WK3
 SRL PARM,0(WK2)
 NHI PARM,15
 CLHI PARM,9
 BP PHEX2
 AHI PARM,C'0'
 B PHEX3
PHEX2 AHI PARM,C'A'-10
PHEX3 BAL LINK2,PSYM
 SIS WK2,4
 BNM PHEX1
 BR LINK
 SPACE
PSYM LHI WK1,CONSOLE
 OC WK1,WRITEDIS
 WDR WK1,PARM
PSYM1 SSR WK1,PARM
 BTC 9,PSYM1
 BR LINK2
WRITEDIS DB X'02'
 DB *
 SPACE
MESSAGE LB PARM,0(LINK)
 AIS LINK,1
 LR PARM,PARM
 BZ MESS2
 BAL LINK2,PSYM
 B MESSAGE
MESS2 AIS LINK,1
 NHI LINK,NOT1
 BR LINK
 SPACE
PROGEND EQU *
 SPACE
LOADSIZE EQU PROGEND-START+8
 END


 NHI LINK,NOT1
 BR LINK
 SPACE
PROGEND EQU *
 END



 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         @?   @  akhWz    akh5     Wz     5     8Wz<    85     ;C:     ;CWz    :    Wz   (Gg                                                                                                                                                                                                                                                                                                                                                                                        punch516 init516.rel,boot516.rel/n:
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        !!!!!! 14/11/79  - Mouses Version
! Modified version of 50-sequence puncher to produce tape
! for Wolfson's prom burner
! Reads in a P-E relocatable 32-bit object tape and punches hexadecimal
%BEGIN
%CONSTINTEGER  MAIN=1,LISTING=1
%SHORTINTEGERARRAY  ST(0:2000)
%INTEGER  CA,J,K
%recordformat  parmfm(%shortinteger  dsno,dact,ssno,sact, %c
                      %integer  p1,p2,p3,p4,p5,p6)

%ROUTINE  ERROR(%STRING(63)  S)
   PRINT STRING(S);  NEWLINE
   %SIGNAL 15,15
%END

%ROUTINE  INGEST(%INTEGER  STREAM NO)
%CONSTINTEGER  RECORD LENGTH = 126
%INTEGER  J,K,COUNT,ADDR,C
%SWITCH  LC(0:X'60')
%ROUTINESPEC  NEWRECORD

%INTEGERFN  BYTE
%INTEGER S
   NEW RECORD %IF COUNT = 0
   COUNT = COUNT-1;  READ SYMBOL(S)
   %RESULT = S
%END

%ROUTINE  SKIP(%INTEGER  N)
%INTEGER  K
   K = BYTE %AND N = N-1 %WHILE N > 0
%END

%INTEGERFN  HALFWORD
   %RESULT = BYTE<<8 + BYTE
%END

%ROUTINE  NEWRECORD
%INTEGER  S
   S = BYTE %WHILE COUNT > 0
   COUNT = RECORD LENGTH
   S = HALFWORD;           ! SEQ
   S = HALFWORD;           ! CHECK SUM
%END

%ROUTINE  PUT(%INTEGER  ITEM)
   ERROR("Initial ORG missing") %IF ADDR < 0
   ST(CA) = ITEM&X'FFFF';  CA = CA+1
   ADDR = ADDR + 1
%END

   SELECT INPUT(STREAM NO)
   COUNT = 0;  NEW RECORD
   ADDR = -1
   %CYCLE
      C = BYTE
      %IF C >= X'20' %START
         K = C-X'20'+1
         C = 16
      %FINISH
      -> LC(C)
LC(0):  NEW RECORD;  %CONTINUE
LC(4):  ! ABSOLUTE ORG. RESET
      SKIP(1);          ! FIRST BYTE OF ADDR
      J = HALFWORD;  ERROR("ORG to odd address") %UNLESS J&1 = 0
      J = J>>1
      %IF ADDR < 0 %START
         ADDR = J
      %ELSE
         CA = CA + (J-ADDR)
         ADDR = J
      %FINISH
      %CONTINUE
LC(15):  SKIP(6);  %CONTINUE
LC(24):  SKIP(6);  %CONTINUE
LC(10):  PUT(HALFWORD)
LC(25):
LC(7):  PUT(HALFWORD);  %CONTINUE
LC(16):
      PUT(HALFWORD) %FOR J = 1,1,K
      %CONTINUE
   %REPEAT
LC(1):
DUMMY:
%END;       ! INGEST

%ROUTINE  HEXDUMP(%INTEGER  FROM,TO,RELOC)
%INTEGER  J,K,L
%ROUTINE  PHEX(%INTEGER N)
%INTEGER  P,Q
   %FOR P = 4,-4,0 %CYCLE
      Q = (N>>P)&15
      %IF Q < 10 %THEN Q = Q+'0' %ELSE Q = Q-10+'A'
      PRINT SYMBOL(Q)
   %REPEAT
%END

   SELECT OUTPUT(LISTING)
   PRINT STRING("S 0 1024")
   NEWLINE
   K = 0
   %FOR J = FROM//2,1,TO//2 %CYCLE;   ! 'J' must index halfword array
      PHEX(ST(J)>>8);  SPACE;  PHEX(ST(J)&255)
      K = (K+1)&7;   ! halfwords again!!
      %IF K = 0 %THEN NEWLINE %ELSE SPACE
   %REPEAT
   PRINT SYMBOL('Z')
   NEWLINE
%END

   ST(J) = 0 %FOR J = 0,1,2000
   CA = 0
   INGEST(MAIN)
   HEXDUMP(0,1023,X'1000'-8)
%ENDOFPROGRAM
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         PROG 5/16 FIRST STAGE LOADER     9/3/79
 CROSS
 SQUEZ 99
* REGISTER EQUATES
DEV EQU 1
READ EQU 2
LINK1 EQU 3
LINK EQU 4
START EQU 5
FINISH EQU 6
DATA EQU 7
TEMP EQU 8
HALFADDR EQU 9
RSYMADDR EQU 10
R14 EQU 14
R15 EQU 15
 SPACE
NOT1 EQU X'FFFE'
 SPACE
 ORG X'80'
 LB DEV,X'78' * CONSOLE DEVICE
 LIS DATA,0
 EPSR TEMP,DATA
 LHI HALFADDR,HALF
 LHI RSYMADDR,RSYM
SKIP BALR LINK1,RSYMADDR
 LR TEMP,TEMP
 BZ SKIP
BEGIN BALR LINK,HALFADDR
 LR R14,DATA * NEW PSW MASK
 BALR LINK,HALFADDR
 LR R15,DATA * NEW LOC.
 STM R14,PSW
 BALR LINK,HALFADDR
 LR START,DATA * INITIAL LOAD ADDR
 BALR LINK,HALFADDR
 LR FINISH,DATA * FINAL LOAD ADDR
LOOP BALR LINK,HALFADDR
 STH DATA,0(START)
 AIS START,2
 CLR START,FINISH
 BNP LOOP
 LPSW PSW
 SPACE
RSYM OC DEV,X'79'
RLOOP SSR DEV,TEMP
 BTC 9,RLOOP
 RDR DEV,TEMP
 BR LINK1
 SPACE
HALF BALR LINK1,RSYMADDR
 EXBR DATA,TEMP
 BALR LINK1,RSYMADDR
 STBR TEMP,DATA
 BR LINK
 SPACE
PSW EQU *+3&X'FFF8' * ** N.B. 2 HALFWORDS OVERWRITTEN **
 END
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        * 28-9-79 
* MODIFIED 13/3/80 TO ALLOW BINARY CARD READING FOR MARK SENSE
   PROG 5/16 - 7/32 LINK TEST PROGRAM
TEST EQU 0
CHECKS EQU 0
 SPACE
INTERVAL EQU -5 * BASIC INTERVAL - SECONDS
RESET EQU INTERVAL*3 * RE-INITIALISE AFTER SO MANY INTERVALS
 SPACE
* BASIC SYSTEM PARAMETERS
BUFFLEN EQU 8192
BUFF EQU PROGEND
MESSLEN EQU 24
 SPACE
* DEVICE ADDRESSES
LINKIN EQU X'1E'
LINKOUT EQU X'1F'
CONSOLE EQU X'92'
CARD EQU X'04'
CLOCK EQU X'07'
 SPACE
* LINK SPEEDS
CLKA EQU 0
CLKB EQU X'40'
LINKRATE EQU CLKB
 SPACE
IOF EQU 0
ION EQU X'4800' * VECTORED EXTERNAL INTERRUPTS ONLY
 SPACE
R0 EQU 0
R1 EQU 1
R2 EQU 2
R3 EQU 3
R4 EQU 4
R5 EQU 5
R6 EQU 6
R7 EQU 7
R8 EQU 8
R9 EQU 9
R10 EQU 10
R11 EQU 11
R12 EQU 12
R13 EQU 13
R14 EQU 14
R15 EQU 15
 SPACE
* DON'T CHANGE ANY OF THESE LIGHTLY
INBP EQU R3
OUTBP EQU R4
GAP EQU R5
LINK1 EQU R15
 SPACE
* GENERAL WORK REGISTERS IN INTERRUPTABLE SEGMENTS
J EQU R13
K EQU R14
L EQU R15 *     **** NOTE OVERLAP WITH 'LINK1' ****
 SPACE
* ASSORTED CONSTANTS
NL EQU 10 * ASCII NEWLINE
SUB EQU C'?' * SUBSTITUTE CHARACTER USED BY CARD/ASCII CONVERSION
O82PUNCH EQU X'0282' * USED TO FORCE FEP BUFFER FLUSHING
BINKEY EQU X'FFF' * CARD WITH ALL 1'S WILL SIGNIFY BINARY
 EJECT
* LOADER HEADER
   ORG X'1000'-8
   DC Z(IOF)
   DC Z(INIT)
   DC Z(INIT)
   DC Z(PROGEND-2)
 SPACE 2
* INITIALISATION
INIT LHI K,IOF
   EPSR J,K
   LIS J,0
   LHI L,ILLEGAL
   STM K,X'34' * ILLEGAL INSTRUCTION TRAP
   LHI L,DIVERR
   STM K,X'4C' * FIXED POINT DIVIDE ERROR
   STH J,X'80' * SYSTEM Q POINTER
   LHI L,SYSQINT
   STH K,X'86'
   STH L,X'88'
   STH K,X'9A' * SVC STATUS
   LHI J,256*2-2
INIT.1 STH L,X'D0'(J)
   SIS J,2
   BNM INIT.1
   LHI J,.LINKIN
   STH J,2*LINKIN+X'D0'
   LHI J,.LINKOUT
   STH J,2*LINKOUT+X'D0'
   LHI J,.CARD
   STH J,2*CARD+X'D0'
   LHI J,.CLOCK
   STH J,2*CLOCK+X'D0'
   LHI J,.CONSOLE
   STH J,2*CONSOLE+X'D0'
   LHI J,CONSOLE
   OC J,CONRESET
   LHI J,LINKIN
   OC J,LNKCMD2 * CLOCK + 8 DATA BITS + ODD PARITY
   OC J,LNKCMD1A * ENABLE + READ + CMD1
   RDR J,K * CLEAR BUSY
   AIS J,1 * OUTPUT SIDE
   OC J,LNKCMD1B
REINIT LHI K,IOF
   EPSR J,K
   LHI J,CARD
   OC J,CARDDIS
   LIS INBP,0
   LIS OUTBP,0
  STH OUTBP,BINFLAG
   STH OUTBP,CARDTOGO * SET INTO KNOWN STATE
   STH OUTBP,CARDWAIT * DITTO
   STH OUTBP,FLUSH082
   LHI GAP,BUFFLEN
   LHI LKSTATE,LKIDLE
   STM LKSTATE,LINKREGS
   LCS CDBP,1
   STM DEV,CARDREGS
   STH CDBP,CARDLEN
   LHI J,RESET
   STH J,IDLENESS
   LHI J,INTERVAL
   STH J,CARDTOGO
   STH J,FLUSHED * ANY NON-ZERO VALUE
   IFNZ TEST
   LHI R1,X'3000'
   ENDC
   LPSW ENTER
   ALIGN 4
ENTER DC Z(ION)
   DC Z(WAIT)
 SPACE 4
* DEVICE COMMANDS
CONRESET DB X'03'
CONREAD DB X'92'
CONWRITE DB X'31'
 SPACE
CARDDIS DB X'80'
CARDFEED DB X'60'
 SPACE
LNKCMD2 DB LINKRATE+X'34' * CLOCK + 8 DATA BITS + ODD PARITY
LNKCMD1A DB X'41' * ENABLE + READ + CMD1
LNKCMD1B DB X'43' * ENABLE + WRITE + CMD1
   DB *
 SPACE 3
ILLEGAL DC X'8801'
 SPACE
SYSQINT EQU *
DIVERR EQU *
   DC X'8802'
 SPACE
PGMERR DC X'8803'
   EJECT
* DISPATCHER
WAIT LH J,IDLENESS
   BP  FLUSH * BOW-WOW THE FAITHFUL WATCHDOG!
 SPACE
   CLHI GAP,BUFFLEN-MESSLEN * ENOUGH FOR ONE MESSAGE ?
   BP WAIT.0 * NO   ->
   BAL LINK1,LINKSEND * YES
   LH J,FLUSH082 * DRAINING BUFFER ?
   BNZ WAIT * YES - SO DON'T READ ANY MORE
   B WAIT.1
WAIT.0 LH J,FLUSH082 * FORCED FLUSH?
   BNZ FLUSH * YES     ->
WAIT.1 EQU *
 SPACE
   IFNM TEST
 SPACE
WAIT.2 LH J,CARDTOGO
   CLHI GAP,BUFFLEN*3/4 * GAP > BUFFLEN*3/4  ?
   BNP WAIT.3
   LIS J,1 * YES
WAIT.3 CLHI GAP,160+1 * GAP < MAX CARD LENGTH ?
   BNL WAIT.4
   LIS J,0
WAIT.4 STH J,CARDTOGO
   LR J,J
   BZ WAIT.5
 SPACE
   BAL LINK1,KICKCARD
WAIT.41 LH J,IDLENESS
   CHI J,RESET+2 * AT LEAST 1 SECOND
   BP WAIT.43
   LH J,CARDREGS+4
   BNM WAIT.41
   LH J,CARDLEN * MANAGE TO READ ANYTHING ?
   BM WAIT.5 * NO  ->
  LIS K,2
   LH J,CARDBUFF(K) * BINARY FLAG TO BE SET ?
   CLHI J,BINKEY
   BNE WAIT.42 * NO  ->
  LIS J,1 * SET BINARY FLAG
  STH J,BINFLAG
  B WAIT.42
WAIT.43 LIS J,1
   STH J,FLUSH082
   B WAIT.5
 SPACE
WAIT.42 BAL LINK1,CONVERT
   LIS J,0
   STH J,FLUSHED
 SPACE
WAIT.5 EQU *
   ELSE
   BAL LINK1,FILLUP * SET TEST = -1 TO BASH LINK ONLY
   ENDC
   B WAIT
   EJECT
* ROUTINE TO FLUSH BUFFER PRIOR TO RESET
FLUSH LH J,FLUSHED * ALREADY FLUSHED ?
   BNZ REINIT * YES    ->
   LHI J,ENDLINE
FLUSH.1 LB K,0(J)
   AIS INBP,1
   NHI INBP,BUFFLEN-1
   STB K,BUFF(INBP)
   SIS GAP,1
   AIS J,1
   CLHI J,ENDLINE1
   BNE FLUSH.1
FLUSH.2 CLHI GAP,BUFFLEN-MESSLEN * CLEARED YET ?
   BP REINIT * YES     ->
   LHI J,LKIDLE
   CLH J,LINKREGS+0 * LINK BUSY ?
   BNE FLUSH.3 * YES     ->
   BAL LINK1,LINKSEND
FLUSH.3 LH J,IDLENESS
   CHI J,RESET+5 * 5 SECONDS GRACE
   BP REINIT
   B FLUSH.2
 SPACE
ENDLINE DB NL,C'//END'
   DO 7
   DB NL,NL,NL,NL
ENDLINE1 EQU *
   DB *
FLUSHED DSH 1
FLUSH082 DSH 1
CARDTOGO DSH 1
BINFLAG DSH 1
   EJECT
   IFM TEST
* ROUTINE TO BASH CIRCULAR BUFFER + LINK DRIVER
FILLUP LHI J,TESTLINE
FILLUP.1 LB K,0(J)
   AIS J,1
   AIS INBP,1
   NHI INBP,BUFFLEN-1
   STB K,BUFF(INBP)
  AIS GAP,1
   SIS K,NL
   BNZ FILLUP.1
   BR LINK1
TESTLINE DB C'ABCDEFGHIJKLMOPQRSTUVWXYZ',NL
   DB *
   ENDC
   EJECT
* CARD CODE TO ASCII CONVERSION ROUTINE
* INPUT FROM 'CARDBUFF', OUTPUT TO CIRCULAR BUFFER 'BUFF' VIA 'OUTBP'
 SPACE
CONV1 EQU R10
CONV2 EQU R11
CONVEND EQU R12
J EQU R13
K EQU R14
CHAR EQU R15
 SPACE
CONVERT STM CONV1,CONVTEMP
   LH CONVEND,CARDLEN
 SPACE
   IFNZ CHECKS
   CLHI CONVEND,160
   BE CONV.OK
   DC X'8809'
CONV.OK EQU *
   ENDC
 SPACE
BINCHECK LH J,BINFLAG * ARE WE READING BINARY?
  BNZ BINCONV * FLAG SET - SWITCH TO OTHER ROUTINE
 SPACE
CONV.1 SIS CONVEND,2
   LH CHAR,CARDBUFF(CONVEND)
   BZ CONV.1
 SPACE
   LHI J,-2
CONV.2 AIS J,2
   CLR J,CONVEND
   BP CONV.9 * ALL DONE
   LH CHAR,CARDBUFF(J)
 SPACE
   BZ CONV.SP * A BLANK?:  YES    ->
 SPACE
   LR K,CHAR
   SRHLS K,9 * EXTRACT ZONE BITS
   LB CONV2,HZTAB(K)
   CLHI CONV2,255
   BE CONV.SUB
   LIS K,2
   NR K,CHAR
   OR CONV2,K * INSERT ROW 8 INTO ZONE
   NHI CHAR,X'01FD' * STRIP ZONE BITS AND ROW 8
 SPACE
   LHI CONV1,9*2
CONV.3 SIS CONV1,1*2
   BM CONV.SUB
   CLH CHAR,DTAB(CONV1)
   BNE CONV.3
 SPACE
   SLHLS CONV1,3-1 * --- N.B. *2 ABOVE ---
   AR CONV1,CONV2
   LB CHAR,ATAB(CONV1)
   B CONV.4
 SPACE
CONV.SP LH K,CARDBUFF-2(J) * PREVIOUS CHAR
   BNZ CONV.SP1
   LB CHAR,BUFF(INBP)
   AIS CHAR,1
   STB CHAR,BUFF(INBP)
   CLHI CHAR,X'FF'
   BNE CONV.SP2
CONV.SP1 LHI CHAR,128+64+1 * ONE SPACE
   B CONV.4
 SPACE
CONV.SUB LHI CHAR,SUB
 SPACE
CONV.4 AIS INBP,1
   NHI INBP,BUFFLEN-1
   STB CHAR,BUFF(INBP)
   SIS GAP,1
CONV.SP2 B CONV.2
 SPACE
CONV.9 LIS CHAR,NL
   AIS INBP,1
   NHI INBP,BUFFLEN-1
   STB CHAR,BUFF(INBP)
   SIS GAP,1
 SPACE
CONV.10   LHI J,-1
   STH J,CARDLEN * SET CHECK THAT BUFFER REALLY HAS BEEN MOVED
  LM CONV1,CONVTEMP
   BR LINK1
 SPACE
BINCONV LIS J,0 * SET BUFFER COUNT
  LIS K,1
  LH CHAR,CARDBUFF(K) * CHECK FOR FLAG CARD
  CLHI CHAR,BINKEY
  BE CONV.10
NEXBIN CLR J,CONVEND
  BP CONV.9 * END OF CARD - INSERT NL
  LH CHAR,CARDBUFF(J) * GET 12 BIT CARD CHAR
  LR CONV1,CHAR * TAKE A COPY
  SRHLS CONV1,6
  AHI CONV1,33 * MAKE ASCII CHAR
  NHI CHAR,X'3F' * EXTRACT LEAST SIG. 6 BITS
  AHI CHAR,33
  AIS INBP,1 * INCREMENT BUFFER POINTER
  NHI INBP,BUFFLEN-1
  STB CONV1,BUFF(INBP) * STORE MOST SIGNIFICANT CHAR
  AIS INBP,1
  NHI INBP,BUFFLEN-1
  STB CHAR,BUFF(INBP) * STORE LEAST SIGNIFICANT CHAR
  SIS GAP,2
  AIS J,2
  B NEXBIN
 SPACE
* ZONE TABLE
HZTAB DB X'00',X'01',X'04',X'FF',X'05',X'FF',X'FF',X'FF'
 SPACE
* DIGIT TABLE
DTAB DC X'0000',X'0100',X'0080',X'0040'
   DC X'0020',X'0010',X'0008',X'0004',X'0001'
 SPACE
* ASCII TABLE
ATAB DB X'20',X'30',X'38',X'59',X'2D',X'26',X'51',X'48'
   DB X'31',X'2F',SUB,SUB,X'4A',X'41',X'5C',SUB
   DB X'32',X'53',X'3A',X'20',X'4B',X'42',X'21',X'5B'
   DB X'33',X'54',X'23',X'2C',X'4C',X'43',X'24',X'2E'
   DB X'34',X'55',X'40',X'25',X'4D',X'44',X'2A',X'3C'
   DB X'35',X'56',X'27',X'5F',X'4E',X'45',X'29',X'28'
   DB X'36',X'57',X'3D',X'3E',X'4F',X'46',X'3B',X'2B'
   DB X'37',X'58',X'22',X'3F',X'50',X'47',X'5E',X'5D'
   DB X'39',X'5A',SUB,SUB,X'52',X'49',SUB,SUB
 SPACE
   ALIGN 4
CONVTEMP DSH 6
   EJECT
* CLOCK DRIVER
   ALIGN 4
.CLOCK DC Z(0)
   DC Z(0)
   DC Z(IOF)
   STH J,CLOCKTMP
   LIS J,1
   AHM J,CLOCKCNT
   BP CLOCK.2
CLOCK.1 LH J,CLOCKTMP
   LPSW .CLOCK
CLOCK.2 AHM J,IDLENESS
   AHM J,CARDWAIT
   LHI J,-50 * LINE FREQUENCY
   STH J,CLOCKCNT
   B CLOCK.1
CLOCKTMP DC Z(0)
CLOCKCNT DC Z(0)
IDLENESS DC Z(0)
CARDWAIT DC Z(0)
   EJECT
 EJECT
* REGISTERS USED (AND RESTORED) BY LINK DRIVER
LKSTATE EQU R10
LKSUM EQU R11
LKCOUNT EQU R12
DEV EQU R13
SYM EQU R14
LKBP EQU R15
 SPACE
 SPACE
* CONTROL CODES USED BY PROTOCOL
ENQ EQU X'85' * CAN I SEND ?
STX EQU X'82' * O.K. - START TRANSMISSION
ACK EQU X'86' * ACKNOWLEDGE - EACH CHARACTER OF MESSAGE
ETB EQU X'97' * TRANSMISSION OF BLOCK COMPLETE
NAK EQU X'95' * UNIVERSAL 'NO'
SYN EQU X'96' * RE-SYNCHRONISE
 SPACE
   ALIGN 4
.LINKIN DC Z(0)
   DC Z(0)
   DC Z(IOF)
   STM LKSTATE,LINKTEMP
   LM LKSTATE,LINKREGS
   LHI DEV,LINKIN
   RDR DEV,SYM
   SSR DEV,SYM
   THI SYM,X'E0'
   BNZ LKSYNCH
   RDR DEV,SYM
   IFNZ TEST
   STB SYM,0(R1)
   AIS R1,1
   ENDC
   BR LKSTATE
 SPACE
LKQUERY CLHI SYM,STX
   BNE LKSYNCH
   LHI LKSTATE,LKINIT
   LHI DEV,LINKOUT
   LHI LKSUM,24
   WDR DEV,LKSUM
   IFNZ TEST
   STB LKSUM,0(R1)
   AIS R1,1
   ENDC
   B LINKEXIT
 SPACE
LKINIT LHI LKSTATE,LKDATA
   LHI LKCOUNT,24
   LR LKBP,OUTBP
LKDATA CLHI SYM,ACK
   BNE LKSYNCH
   AIS LKBP,1
   NHI LKBP,BUFFLEN-1
   LB SYM,BUFF(LKBP)
   AR LKSUM,SYM
   LHI DEV,LINKOUT
   WDR DEV,SYM
   IFNZ TEST
   STB SYM,0(R1)
   AIS R1,1
   ENDC
   SIS LKCOUNT,1
   BNZ LINKEXIT
   LHI LKSTATE,LKCHECK
   B LINKEXIT
 SPACE
LKCHECK CLHI SYM,ACK
   BNE LKSYNCH
   EXBR SYM,LKSUM
   XR SYM,LKSUM
   LHI DEV,LINKOUT
   WDR DEV,SYM
   IFNZ TEST
   STB SYM,0(R1)
   AIS R1,1
   ENDC
   LHI LKSTATE,LKSTOP
   B LINKEXIT
 SPACE
LKSTOP CLHI SYM,ETB
   BNE LKSYNCH
   LHI LKSTATE,LKIDLE
   LR OUTBP,LKBP
   AHI GAP,24
   B LINKEXIT
 SPACE
LKIDLE EQU LINKEXIT
 SPACE
LINKEXIT STM LKSTATE,LINKREGS
   LM LKSTATE,LINKTEMP
   LPSW .LINKIN
 SPACE
LKSYNCH CLHI LKSTATE,LKIDLE * IS LINK INHIBITED
   BE LINKEXIT * YES - IGNORE ERROR
   CLHI SYM,SYN * RE-SYNCHRONISE AFTER PROTOCOL HICCUP
   BE LKRETRY
   LHI LKSTATE,LKSYNCH
   LHI DEV,LINKOUT
   LHI SYM,SYN
   WDR DEV,SYM
   IFNZ TEST
   STB SYM,0(R1)
   AIS R1,1
   ENDC
   B LINKEXIT
 SPACE
LKRETRY LHI LKSTATE,LKQUERY * TRY AGAIN
   LHI DEV,LINKOUT
   LHI SYM,ENQ
   WDR DEV,SYM * CAN I SEND ?
   IFNZ TEST
   STB SYM,0(R1)
   AIS R1,1
   ENDC
   B LINKEXIT
 SPACE
   ALIGN 4
.LINKOUT DC Z(0) * IGNORE OUTPUT INTERRUPTS
   DC Z(0)
   DC Z(IOF)
   LPSW .LINKOUT
 SPACE
* GIVE LINK INITIAL KICK TO START TRANSMIT CYCLE
LINKSEND LHI J,IOF
   EPSR K,J
   LHI J,LKIDLE
   CLH J,LINKREGS+0 * STORED 'LKSTATE' = 'LKIDLE' ?
   BNE LKRETURN
   LHI J,RESET
   STH J,IDLENESS
   STH K,.LINKIN * CALLER'S STATUS
   STH LINK1,.LINKIN+2 * RETURN ADDRESS
   STM LKSTATE,LINKTEMP
   LM LKSTATE,LINKREGS
   B LKRETRY
 SPACE
LKRETURN EPSR J,K
   BR LINK1
   ALIGN 4
LINKTEMP DSH 6
LINKREGS DSH 6
   EJECT
* CARD READ DRIVER
DEV EQU R13
SYM EQU R14
CDBP EQU R15
 SPACE
   ALIGN 4
.CARD DC Z(0)
   DC Z(0)
   DC Z(IOF)
   STM DEV,CARDTEMP
   LM DEV,CARDREGS
   LHI DEV,CARD * --- N.B. THIS REALLY IS NECESSARY ---
 SPACE
CARDLOOP SSR DEV,SYM
   BFC 8,CARDREAD * O.K.   GO READ
   BFC 4,CARDLOOP * STATUS ERROR
   SSR DEV,SYM * MAKE SURE STATUS IS SET
   THI SYM,X'E1' * ALL ERRORS EXCEPT 'NO MOTION'
   BNZ CARDERR * AN ERROR IS SET
   LR CDBP,CDBP
   BZ CARDOFF * IGNORE LEADING 'NMTN'
   B CARDOK * NO ERROR   ->
CARDERR LHI CDBP,INTERVAL
   STH CDBP,CARDWAIT
   THI SYM,X'20' * HOPPER EMPTY
   BNZ CARDOK
   THI SYM,X'40' * 'TROUBLE' ?
   IFZ CHECKS
   B CARDOFF
   ELSE
   BZ CARDEOV
   DC X'8804'
   ENDC
CARDEOV THI SYM,X'80' * OVERRUN
   BZ CARDOFF
   DC X'8805' * YES - IT REALLY HAPPENED!!
 SPACE
CARDOK STH CDBP,CARDLEN
 SPACE
CARDOFF LCS CDBP,1 * SET 'NOT BUSY'
   OC DEV,CARDDIS
 SPACE
CARDEXIT STM DEV,CARDREGS
   LM DEV,CARDTEMP
   LPSW .CARD
 SPACE
CARDREAD RHR DEV,SYM
   LR DEV,SYM
   NHI DEV,X'3F00'
   NHI SYM,X'003F'
   SRHLS DEV,2
   OR SYM,DEV
  STH SYM,CARDBUFF(CDBP)
   AIS CDBP,2
   B CARDEXIT
 SPACE
KICKCARD LH J,CARDWAIT
   BMR LINK1
   LHI J,IOF
   EPSR K,J
   LH J,CARDREGS+4 * STORED VERSION OF 'CDBP'
   BNM CARDBUSY
 SPACE
   LH J,CARDLEN
   BM KICKCD.1
   DC X'8807'
KICKCD.1 EQU *
 SPACE
   STH K,.CARD
   STH LINK1,.CARD+2
   LHI J,RESET
   STH J,IDLENESS
   LIS CDBP,0
   STH CDBP,CARDREGS+4 * --- SETTING POINTER ALSO MARKS 'CARD BUSY'
   LHI DEV,CARD * DEVICE NO
   OC DEV,CARDFEED
   LPSW .CARD
 SPACE
CARDBUSY EPSR J,K
   BR LINK1
 SPACE
   ALIGN 4
CARDTEMP DSH 4
CARDREGS DSH 4
CARDLEN DSH 1
 SPACE
   DC Z(-1) * STOPPER FOR CONVERT ROUTINE
CARDBUFF DSH 81
 EJECT
   ALIGN 4
.CONSOLE DC Z(0)
   DC Z(0)
   DC Z(IOF)
   LPSW .CONSOLE
 SPACE 3
   DSH 6
PROGEND EQU *
* --- MAIN CIRCULAR BUFFER IN HERE ---
   END
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        `= H?    +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    {23-Nov-81}

{Original version hacked a bit for new subsystem environment}

!  LOAD516 - Program to load 5/16 front-end over PASLA link.
%BEGIN
%CONSTINTEGER  MAIN=1,LISTING=1
%CONSTINTEGER  STMAX = 8191
%SHORTINTEGERARRAY  ST(0:STMAX+12)
%INTEGER  CA,J,K
%recordformat  parmfm(%shortinteger  dsno,dact,ssno,sact,  %c
                      %shortintegerarray  buf(1:12) )
%include "sysinc:command.inc"
%string(63) param

   param = COMMAND_parameter
   %if param = "" %start
      print string("No FEP executive supplied"); newline
      %stop
   %finish
   open input(main,param.".REL")
   select input(main)


%ROUTINE  ERROR(%STRING(63)  S)
   PRINT STRING(S);  NEWLINE
   %SIGNAL 15,15
%END

%ROUTINE  INGEST(%INTEGER  STREAM NO)
%CONSTINTEGER  RECORD LENGTH = 126
%INTEGER  J,K,COUNT,ADDR,C
%SWITCH  LC(0:X'60')
%ROUTINESPEC  NEWRECORD

%INTEGERFN  BYTE
%INTEGER S
   NEW RECORD %IF COUNT = 0
   COUNT = COUNT-1;  READ SYMBOL(S)
   %RESULT = S
%END

%ROUTINE  SKIP(%INTEGER  N)
%INTEGER  K
   K = BYTE %AND N = N-1 %WHILE N > 0
%END

%INTEGERFN  HALFWORD
   %RESULT = BYTE<<8 + BYTE
%END

%ROUTINE  NEWRECORD
%INTEGER  S
   S = BYTE %WHILE COUNT > 0
   COUNT = RECORD LENGTH
   S = HALFWORD;           ! SEQ
   S = HALFWORD;           ! CHECK SUM
%END

%ROUTINE  PUT(%INTEGER  ITEM)
   ERROR("Initial ORG missing") %IF ADDR < 0
   ST(CA) <- ITEM&X'FFFF';  CA = CA+1
   ADDR = ADDR + 1
%END

   SELECT INPUT(STREAM NO)
   COUNT = 0;  NEW RECORD
   ADDR = -1
   %CYCLE
      C = BYTE
      %IF C >= X'20' %START
         K = C-X'20'+1
         C = 16
      %FINISH
      -> LC(C)
LC(0):  NEW RECORD;  %CONTINUE
LC(4):  ! ABSOLUTE ORG. RESET
      SKIP(1);          ! FIRST BYTE OF ADDR
      J = HALFWORD;  ERROR("ORG to odd address") %UNLESS J&1 = 0
      J = J>>1
      %IF ADDR < 0 %START
         ADDR = J
      %ELSE
         CA = CA + (J-ADDR)
         ADDR = J
      %FINISH
      %CONTINUE
LC(15):  SKIP(8);  %CONTINUE
LC(24):  SKIP(6);  %CONTINUE
LC(10):  PUT(HALFWORD)
LC(25):
LC(7):  PUT(HALFWORD);  %CONTINUE
LC(16):
      PUT(HALFWORD) %FOR J = 1,1,K
      %CONTINUE
   %REPEAT
LC(1):
DUMMY:
%END;       ! INGEST

%ROUTINE  TRANSMIT
%INTEGER  J,K
%integer  check
%record(parmfm)  p
   %routine  to fep(%record(parmfm)%name  p)
      p_sact = 111;  svc(127,p)
      p_sact = 111;  svc(16,p);   ! poff
   %end

   p_buf(1) = 0; p_buf(2) = 19;  svc(122,p);   ! uninhibit link
   p_dact = 6;  to fep(p);   ! initialise
   print string("FEP initialised"); newline
   check = -1;  check = check + st(k) %for k = 0,1,ca-1
   st(ca) = (-check)&x'FFFF'
   k = 0
   %cycle
      %for j = 1,1,12 %cycle
         p_buf(j) = st(k)
         k = k+1
      %repeat
      p_dact = 5;  to fep(p)
      %exit %if k > ca
   %repeat
   print string("Loading complete"); newline
%END

%ROUTINE  HEXDUMP(%INTEGER  FROM,TO,RELOC, %STRING(63)  TITLE)
%INTEGER  J,K,L
%ROUTINE  PHEX(%INTEGER N)
%INTEGER  P,Q
   %FOR P = 12,-4,0 %CYCLE
      Q = (N>>P)&15
      %IF Q < 10 %THEN Q = Q+'0' %ELSE Q = Q-10+'A'
      PRINT SYMBOL(Q)
   %REPEAT
%END

   SELECT OUTPUT(LISTING)
   PRINT SYMBOL(12);  PRINT STRING(TITLE)
   K = 0
   %FOR J = FROM,1,TO %CYCLE
      %IF K&7 = 0 %START
         NEWLINE
         PHEX((J-FROM)*2+RELOC);  PRINT STRING(":  ")
      %ELSE %IF K&7 = 4
         SPACES(2)
      %FINISH
      PHEX(ST(J));  SPACE
      K = (K+1)&31
      NEWLINE %IF K = 0
   %REPEAT
   NEWLINES(2)
%END

   ST(J) = 0 %FOR J = 0,1,STMAX
   CA = 0
   K = CA
   INGEST(MAIN)
   %if COMMAND_out1 # "" %start
      HEXDUMP(K,CA-1,X'1020',"Main Program")
   %else
      transmit
   %finish
%ENDOFPROGRAM
 H?    -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
 C!         	 }            
        NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    %Qv           A    $"    +"    0!    4"a       <!A     A!   b  a     aa a a A !  A     ! C    i!    e)a a b   ! A    " a a 	   K  a  !         c'a  A A a A a!! ! B   dQ@    D"Z 	""`     ,v   	|@     ,v   	xd      W   ,D   24)'q    X_qK`   ,v   	g\       ;eQ@ 	:w"L     yuY   ,>   0D   4-Z 8p <   ^!    Ġ d    	Z;`   ,>   0D   4x 8d    eE      W   ,d    0j@   2Ud    (_Q@  X   ,qT^8 0~|Kȁ p>   tD   xK    !ox     D   H>   LD  $p%Qv    Pd:H   Main Program :  Loading complete FEP initialisedORG to odd address Initial ORG missing   `                                                                                                                                                                                .REL No FEP executive supplied                                          
   W?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nH  !34  1  0 !81 !5$$A> #$$A> &C ?1  34C0  D   D   
C H  !34  1  0 !81 !5$$A> B  @ !4B ";
C@ !$$A> #$$A> B  C
B$P#E  E  &Q'1"C X# Y !Y !&\ Z  B!$$A> З  $1$H  H X [ &B0P  [ ,&' ?P  
*&30H  P  ї  C Kї  $$A> 
Y  #%$$A> 
qPr  PB &(pX  ?$PS?PE   &T 41I2 !,K2  !
3s3B  #9
3
>!$$A> !$$A> A> O$$A> "#:  ! ?$$A> ?$$A> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$ ?$$A>  w ) ,A A l X !A  ? ,W   HW  ,$ $A %	w A , X X9 4<3!3AX 4'P 4W   P ,z  $
g A , X X: #+AP ,X 'P "z  
w A , X AlP ,AdX: ,8P 0Z 0z  
w A , X X9 4<3#&A(P ,"
0 ~P9 4AP ,AP ,z  %
g A , X X9 8<3#AX D8 <A`  @a  X D&P DXI 8L&API 8z  3
g A , X Xi W   `$0P9 4A&%P 8AfP <  !ȡP 0 P <.AVAC $aA~AP , #5AP ,XI 8#P 8#XX D\
QPX DXI ,PI 8C z$hA4C p$fA*C fAXaAANaAC NXi 0lPi D$0$!AP9 ,C  &1P9 ,P9 @AaAX9 ,U9 @AU9 DB0P @#C 
y  	g A , X 0 o@6 X r    q  XJ LP o@T Xj r    q  z  *
w A , X $=PA @$0@1  $=PA @Ȱ @  r	 8  zq	 8$@ :i 8AVW   HW  ,%API 4XX D\'QPY \d$!APi 0C (&aPi 0Pi X8 <AX 4J  P 4Ui XAUi \B0P XX D8 <A$[ 4  @  A$@PI 0$P&QPY ,PY X=PA @P `X 08 <AXi `H  @  X 0&P 0XY ,UY XAP B0P X$E@I :i 8APXY 0Xh Dl	V#"#C W   HW  ,y  ʀ	g A , X 0 '4P: ,P: 4#AX   İ P 0ɰ 
#Ȼ 0P 0#Ȼ 7P 0kW   <X: ,U: 4A3B0P 4z  =
W  ) 0A A p !X !A  ?$aW   l$lW   < 0W   H$0P9 tX  P X '
$!AP pC &P pP |XI t@ B0.W  ,XY p[Y 
UeZi ,AW   H#@ @ !7$bW   X p8 <AHa  AW  Xi t&a` Pi t!6W  ,X pU |AU B0ZP |$bW  8y  	w P (A , %X H ,$0P4 Ȱ P A  ( <A( PX]x\ A  ?8 P3B0"W   HW  ,$ A' , PA A" $aW   x$aW   `%1&1P8 HP8 8 <A$@  X8 HU8 A0B0P $P DP L$aAPXxI DC0$XX D\` Pg ,'QXh LlA#Ax   8 <A$@  X8 HU8 A0B0P $P DP L$aAXxI DC0$XX D\` Pg ,f'QXh LlAZ#AFx  @	 old report_key # 0
      %finish
      Select input(0);  Select output(0)

      Skipping     = old skip
      Echo Obey    = old echo Obey
      Parmp       == old parmp
      %return
   %finish

   Parmp == Parm
   %if Obey Level = 1 %start
      Relocate(Loaded(Loaded Files)) %if Loadup(Prog, Batch File)
   %finish
   Obey Level = Obey Level+1
   Base Load  = Loaded Files+1
   %own %byte %name len, p, limit        {Split text param on commas}
   params = params.","
   limit == char no(params,length(params))
   Parm_N = 0
   p == length(params)
   %cycle
      len == p;  j = 0
      %cycle
         p == p ++ 1;  j = j + 1
      %repeat %until p = ','
      len = j - 1
      Parm_N = Parm_N+1
      Parm_Parm(Parm_N) == string(addr(len))
   %repeat %until p == limit

   old command == in stream(0)
   in stream(0)== null FD
   {Must clear INSTREAM(0), or OPENIN will return                                      $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |               nue

C(36):       {for} pending = pending-3
                   t1 = op type(pending+1)
                   fault(Type err             H?    6                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !!!!!! 6/7/78  - Mouses Version
! PUNCH516 - Program to punch 50 sequence tape for 5/16
%BEGIN
%CONSTINTEGER  INITIAL=1,MAIN=2,LISTING=1
%SHORTINTEGERARRAY  ST(0:2000)
%INTEGER  CA,J,K
%recordformat  parmfm(%shortinteger  dsno,dact,ssno,sact, %c
                      %integer  p1,p2,p3,p4,p5,p6)

%ROUTINE  ERROR(%STRING(63)  S)
   PRINT STRING(S);  NEWLINE
   %SIGNAL 15,15
%END

%ROUTINE  INGEST(%INTEGER  STREAM NO)
%CONSTINTEGER  RECORD LENGTH = 126
%INTEGER  J,K,COUNT,ADDR,C
%SWITCH  LC(0:X'60')
%ROUTINESPEC  NEWRECORD

%INTEGERFN  BYTE
%INTEGER S
   NEW RECORD %IF COUNT = 0
   COUNT = COUNT-1;  READ SYMBOL(S)
   %RESULT = S
%END

%ROUTINE  SKIP(%INTEGER  N)
%INTEGER  K
   K = BYTE %AND N = N-1 %WHILE N > 0
%END

%INTEGERFN  HALFWORD
   %RESULT = BYTE<<8 + BYTE
%END

%ROUTINE  NEWRECORD
%INTEGER  S
   S = BYTE %WHILE COUNT > 0
   COUNT = RECORD LENGTH
   S = HALFWORD;           ! SEQ
   S = HALFWORD;           ! CHECK SUM
%END

%ROUTINE  PUT(%INTEGER  ITEM)
   ERROR("Initial ORG missing") %IF ADDR < 0
   ST(CA) = ITEM&X'FFFF';  CA = CA+1
   ADDR = ADDR + 1
%END

   SELECT INPUT(STREAM NO)
   COUNT = 0;  NEW RECORD
   ADDR = -1
   %CYCLE
      C = BYTE
      %IF C >= X'20' %START
         K = C-X'20'+1
         C = 16
      %FINISH
      -> LC(C)
LC(0):  NEW RECORD;  %CONTINUE
LC(4):  ! ABSOLUTE ORG. RESET
      SKIP(1);          ! FIRST BYTE OF ADDR
      J = HALFWORD;  ERROR("ORG to odd address") %UNLESS J&1 = 0
      J = J>>1
      %IF ADDR < 0 %START
         ADDR = J
      %ELSE
         CA = CA + (J-ADDR)
         ADDR = J
      %FINISH
      %CONTINUE
LC(15):  SKIP(6);  %CONTINUE
LC(24):  SKIP(6);  %CONTINUE
LC(10):  PUT(HALFWORD)
LC(25):
LC(7):  PUT(HALFWORD);  %CONTINUE
LC(16):
      PUT(HALFWORD) %FOR J = 1,1,K
      %CONTINUE
   %REPEAT
LC(1):
DUMMY:
%END;       ! INGEST

%ROUTINE  PUNCH
%INTEGER  J,K
%INTEGER  BUFFADDR, BUFFPNTR
%RECORD(PARMFM)  P
   SVC(110,P)
   %IF P_P1 < 0 %START
      PRINT STRING("can't get PP buffer"); NEWLINE
      %STOP
   %FINISH
   BUFFADDR = P_P1<<16;  BUFFPNTR = BUFFADDR
   %ROUTINE  PUT(%INTEGER N,FORCE)
      SHORTINTEGER(BUFFPNTR) = N&((-1)>>16)
      BUFFPNTR = BUFFPNTR+2
      %RETURN %IF BUFFPNTR # BUFFADDR+1024 %AND FORCE = 0
      P_P2 = BUFFPNTR-BUFFADDR;   ! LENGTH
      P_P1 = BUFFADDR
      P_P3 = 1;      ! OUTPUT
      P_SACT = 17;  SVC(112,P);   ! PT DEMON
      P_SACT = 17;  SVC(16,P);   ! POFF
      BUFFPNTR = BUFFADDR
   %END
   K = 50
   PUT(0,0) %AND K = K-1 %WHILE K # 0
   PUT(ST(J),0) %FOR J = 0,1,CA-1
   K = 50
   PUT(0,0) %AND K = K-1 %WHILE K # 0
   PUT(0,1);   ! FLUSH BUFFER
%END

%ROUTINE  HEXDUMP(%INTEGER  FROM,TO,RELOC, %STRING(63)  TITLE)
%INTEGER  J,K,L
%ROUTINE  PHEX(%INTEGER N)
%INTEGER  P,Q
   %FOR P = 12,-4,0 %CYCLE
      Q = (N>>P)&15
      %IF Q < 10 %THEN Q = Q+'0' %ELSE Q = Q-10+'A'
      PRINT SYMBOL(Q)
   %REPEAT
%END

   SELECT OUTPUT(LISTING)
   PRINT SYMBOL(12);  PRINT STRING(TITLE)
   K = 0
   %FOR J = FROM,1,TO %CYCLE
      %IF K&7 = 0 %START
         NEWLINE
         PHEX((J-FROM)*2+RELOC);  PRINT STRING(":  ")
      %ELSE %IF K&7 = 4
         SPACES(2)
      %FINISH
      PHEX(ST(J));  SPACE
      K = (K+1)&31
      NEWLINE %IF K = 0
   %REPEAT
   NEWLINES(2)
%END

   ST(J) = 0 %FOR J = 0,1,2000
   CA = 0
   INGEST(INITIAL)
   K = CA+5;   CA = (X'D0'-X'80'+2)//2 + 5
   CA = K %IF K < CA
   ST(CA) = X'00FF'; CA = CA+1
   K = CA
   INGEST(MAIN)
   HEXDUMP(0,K-1,X'80',"Initial Loader")
   HEXDUMP(K,CA-1,X'1000'-8,"Main Program")
   punch
%ENDOFPROGRAM
 H?    C                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %constinteger NUL = 0,  BS  =  8,  DLE = 16,  CAN = 24,
              SOH = 1,  HT  =  9,  DC1 = 17,  EM  = 25,
              STX = 2,  LF  = 10,  DC2 = 18,  SUB = 26,
              ETX = 3,  VT  = 11,  DC3 = 19,  ESC = 27,
              EOT = 4,  FF  = 12,  DC4 = 20,  FS  = 28,
              ENQ = 5,  CR  = 13,  NAK = 21,  GS  = 29,
              ACK = 6,  SO  = 14,  SYN = 22,  RS  = 30,
              BEL = 7,  SI  = 15,  ETB = 23,  US  = 31,  DEL = 127

%endoffile
 H?    K                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     	@?   @ m.@T   m.KG  UG´Wz   	lO@T   <F@T*   <F@,   VO  5   VO:B  +EWzJ                                                                                                                                                                                                                                                                                                                                                                                                              {Include file for compiler communication}
%recordformat impcomfm(%integer statements, flags, code, gla, diags, perm,
                        %string(31) file,
                        %string(63) Option)
%externalrecord(impcomfm)%spec IMPCOM
%endoffile
 H?    N                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %recordformat command fm(%string(31) command,
                        (%string(31) in1,  in2,  in3,
                         %string(31) out1, out2, out3     %or
                         %string(31) %array in, out(1:3)  %or
                         %string(31) %array io(1:6) ),
                         %integer modifier,
                         %string(63) parameter)
%externalrecord(command fm)%spec COMMAND
%externalroutinespec EXTRACT COMMAND (%string(*)%name C, parm, %string(127)  S)
%externalroutinespec PARSE PARAMETER (%record(commandfm)%name  C,
                                      %integer option, %string(127)  parm)
%endoffile
 H?    P                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %recordformat comreg fm(%integer stack, time, options, status,
                        %byte exclam,
                        %string(31) in1, in2, in3,
                        %string(31) out1, out2, out3,
                        %string(63) param,
                        %string(15) user int, prompt, cprompt)
%externalrecord(comreg fm)%spec comreg
%endoffile
 H?    S                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !Direct-access disc block I/O specs

%external %predicate %spec EXISTS        (%string(25) file name)
%external %routine %spec   DELETE FILE   (%string(25) file name)
%external %routine %spec   RENAME FILE   (%string(25) old name, new name)
%external %routine %spec   NEW FILE   (%string(25) file name,
                                          %integer initial size,
                                          %integername ACtual)
%external %string(15) %fn %spec ITOS     (%integer x, y)
%external %integer %fn %spec    STOI     (%string(15) S)
%external %record(parm fm) %fn %spec PACKED (%string(25) filename)
%external %routine %spec   OPEN DA       (%integer chan, rw, %string(25) file)
%external %routine %spec   READ DA       (%integer chan, block number,
                                          %name buffer)
%external %routine %spec   WRITE DA      (%integer chan, block number,
                                          %name BUffer)
%external %routine %spec   EXTEND DA     (%integer chan, extent, %integername F)
%external %routine %spec   CLOSE DA      (%integer chan)
%end %of %file
 H?    U                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %constinteger To Director = 20

%constinteger Direct Unit Name   =  1,
              Direct Create      =  2,
              Direct Extend      =  3,
              Direct Open  Input =  4,
              Direct Open Output =  5,
              Direct Open Da     =  6,
              Direct Read        =  7,
              Direct Write       =  8,
              Direct Read  Da    =  9,
              Direct Write Da    = 10,
              Direct Close       = 11,
              Direct Reset       = 12,
              Direct Abandon     = 13,
              Direct Delete      = 14,
              Direct Rename      = 15,
              Direct Purge       = 16,
              Direct Files       = 17,
              Direct Status      = 18,
              Direct Catalog     = 20,
              Direct Faccess     = 22,
              Direct Pass        = 23,
              Direct Daccess     = 24,
              Direct Unique      = 25,
              Direct Become      = 27,
              Direct Exchange    = 28,
              Direct Identify    = 29,
              Direct Archive     = 30,
              Direct Pcreate     = 31,      {Create a new process directory}  %c
              Direct Pdelete     = 32,      {Delete existing process }    %c
              Direct Statistics  = 33,
              Direct Receive     = 34,
              Direct P OpenI     = 35,      {Open other process' input}  %c
              Direct Logon       = 36,
              Direct Logoff      = 37,
              Direct Load        = 38,      {Load disc unit} %c
              Direct Unload      = 39,
              Direct P Unitname  = 40,      {privileged version of Call 1}  %c
              Direct SetAccess   = 41,
              Direct ForceLoad   = 42,
              Direct SetSwop     = 43,
              Direct Protect     = 44,
              Direct FindUnit    = 45,
              Direct ClearUsed   = 46,
              Direct Prename     = 47

%endoffile
 H?    Y                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !specs for low-level magtape I/O procedures
%end %of %list

!event
%const %integer tape event = 14
!subevents
%const %integer tape mark hit = -9

%external %routine %spec                 CLAIM TAPES (%integer mask)
%external %routine %spec                 SELECT TAPE (%integer drive no)
%external %routine %spec                 TAPE FN (%integer fn code)
%external %routine %spec                 MARK TAPE
%external %routine %spec                 REWIND
%external %routine %spec                 SKIP FORWARD
%external %routine %spec                 SKIP BACK
%external %routine %spec                 BACKSPACE
%external %routine %spec                 READ TAPE (%integer bytes, %name buf)
%external %routine %spec                 WRITE TAPE(%integer bytes, %name buf)
%external %integer %function %spec       TAPE SUB EVENT
%external %string(23) %function %spec    TAPE ERROR (%integer sub event)
%external %routine %spec                 RELEASE TAPES (%integer mask)

%list
%end %of %file
 H?    ^                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %recordformat  filefm(%integer  unit,owner,N1,N2)
%recordformat  parmfm(%short dsno,dact,
               (%short  ssno, sact, (%integer  P1, P2, P3, P4   %or
                                     %record(filefm)  file      %or
                                     %string(23)  text ),
                                                         %integer  P5, P6) %or
               (%short  pad,  %string(25)  filename)   )
%endoffile
 H?    a                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %recordformat  filefm(%integer  unit,owner,N1,N2)
%recordformat  parmfm(%short dsno,dact,ssno,sact, 
                        (%string(23) text %or
                        (%record(filefm) file %or %integer  P1,P2,P3,P4),
                         %integer P5,P6) )
%endoffile
 H?    c                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !Fixed-length record I/O specs.
%end %of %list

%const %integer RMS error = 12;          !Event name
%const %integer end of file = 8;         !sub event of RMS ERROR

%external %routine %spec move rec (%integer record length,
                                   %record(*)%name from, to)
%external %routine %spec open     (%integer chan, record length,
                                   %string(25) file name)
%external %routine %spec write rec(%integer chan,record no,%record(*)%name buf)
%external %routine %spec read rec (%integer chan,record no,%record(*)%name buf)
%external %record(*)%map %spec rec(%integer chan, record no)
%external %routine %spec read seq (%integer chan, %record(*)%name buf)
%external %routine %spec write seq(%integer chan, %record(*)%name buf)
%external %routine %spec backspace (%integer chan)
%external %routine %spec skip (%integer chan)
%external %routine %spec reset chan (%integer chan)
%external %routine %spec close (%integer chan)

%list
%end %of %file
 H?    e                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %constinteger  R0  =  0,  R1  =  1,  R2  =  2,  R3  =  3,
               R4  =  4,  R5  =  5,  R6  =  6,  R7  =  7,
               R8  =  8,  R9  =  9,  R10 = 10,  R11 = 11,
               R12 = 12,  R13 = 13,  R14 = 14,  R15 = 15

%constinteger  P1   =  R6,
               P2   =  R5,
               Wsp  =  R7,
               Gla  = R13,
               Code = R14,
               Link = R15
%endoffile
 H?    h                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    {Subsystem communication}

%externalstring(17)%spec Console int
%externalstring(17)%spec Prompt text
%externalstring(17)%spec Command prompt

%endoffile
 H?    j                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    {Subsystem communication variables}

%recordformat Userfm(%string(17) Console Interrupt,   {reply to Int:}
                                 Command Prompt,      {request for commands}
                                 Data Prompt,         {request for data}
                                 Monitor File,        {file for diagnostics}
                     %string(13) Search,              {search directory owner}
                     %integer    Default Stack Size,
                                 Default Time Limit,
                                 Subsystem Options,   {monitor, dump etc}
                                 Obey Level,          {depth inside OBEYs}
                                 Batch Job,           {0 if interactive user}
                                 Terminal Mode)       {Terminal control bits}

%systemrecord(Userfm)%spec       User

%endoffile
 H?    l                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!           }.      . !O       aX      :H    ayu   fS     $qIQK  *3NW 0IX`QK  6cxgQK  <yfZJ_ BfZX H}     Nw:` Twag\ Z`EXg\   ``EY}  fwZ}  lwp` rq["iZ}  x&q["op` ~6~u@     M<@     dU~u@   x%qO     qI      fZ     fZK    yA      yA     5X_Lv@   DX_Lv"8  NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8     * 1 4 7 : C L S Z ] g j m p s v y |              dQ@    aX    :H  ayu  fS    qIQK qIQ@  X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     d       fZ    d       fZK   yA    yA    X_Lv@  X_Lv"8  A6A@f    
   9UH  !34  1  0 !81 !5$$A> rB  @ !4B ";
C@ !$$A> r#$$A> rB  C
B$P#E  E  &Q'1"C  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n  $$A> rA> r?1  &134C  0  D   D   
C X=   w P (( ,A<p \$P D$0P8 H( L ,A<r <  q <x  "w P (p ,$jW   X  x  w P (p ,$kW   X  x  w P (( ,A<p <$AAfx  g P (p ,$BAf#$ $	A8P  x  w P (p ,$BAf#$ $	A8x  w P (p 0$CAfP ,X ,!x $ $	A8 w P (p ,$BAf#$ $	A8x  g P (p ,$EAfx  w P (( ,A<p,H   #7$FAfx $ $$A8 W  P (p ,$HAfx  g P (p ,$IAfx  g P (p ,$JAfx  g P (( ,A<p L$KAfx  g P (( ,A<p L$LAfx  w P (p ,$MAfx  w P (p ,$NAfx  w P (p ,$OAfx  w P (p ,@ Afx  w P (p 0@ AfP ,X ,$A*x  w P (p 0@ AfP ,X ,$	A*x  w P (p 0@ AfP ,X ,x  g P (p 0@ AfP ,X ,x  W  P (pHX 0P  !7X , P  XH 0@ PH 0@ !@ !$@ !7X( 0$A8A&  #6A 
!4AF"XX 0P B0j$`h 4AP   #4 
!3C $X   @D( 4DA   AC X8  Ӹ 4	;#$ $$A8X( , 4A<x $P8P4A -#6A +!5h4AApP  0! 9C &X Ő .!9XH 0@ #:@ #7X( $$A8XX P 0!P 9##C $ATXX8$jFZX P8AP C X88/`<X Ű .B0dX 0Š #5Š B0Rh@`@AAP  0! 9##C ,X ʐ/l@j<`<h@l@`@AC XH4@ -!;$P[X8PX8+fkh<`h<Xh 0
fnsf  
f
nX8X8 ,P  C (X8X ,@  #X8XH ,Ҕ  #hH<XX ,`E  x 4W  p 8y  
	W  P (p 0h( ,`' ,Xh Pg 0X  P 4$PeA@ Afx   W  p 4y  
	g P (p 0h ,` ,X8 P7 0$PeA@ Afx  w P (p ,`  Ax  g P (p ,X #'A%Q "x  w P (p ,$jAtx  g P (p ,X #'A%AQH "x  w p @XI l[I hPJ ,#6XY xP !4z Xi x!6X: ,P: 0#X ,Ű !4z $BPJ 0XY tPZ <Xh 'aPj 4C  &aPj 4dZh ,Pj 8X6  [: 0P6  Xj 4Uj <B0X p[ 0P pz  Q
W  p ) 0  A$0P9 xP9 P9 P9 $P P9 XP P9 %API P9 X]HPY \PMHX]lPY |P=lXY  PY Xm8Pi TX=<P9 X$P<X=P9 `XP dXP$@PH PH %QPX PI 8Xh `#6`-1 ?AZX8 4P9 DX ,P X"#&$%ORR HELEN           5H  24$%PATON MOIRA         5E  "%$%PHILLIPS ANNE       5G  
#$%PRIOR JUDITH J      5G  $%REYNOLDS DEREK      5H  $%RINTOUL VALERIE     5H  $%)$%RITCHIE EVELYN      5F  $%ROSS ELIZABETH      5H  -/4$%ROSS PAUL           5H  ()$%RUTHERFORD GILLIAN  5E  #$$%SHAW LAURA          5F  #$$%SHAW MARGARET       5G  04$%SMITH KENNETH       5H  = ca
%integer  sw list = 0
%int                                                       $       $  *       *  0       0  6       6  <       <  B       B  H       H  N       N  T       T  Z       Z `       ` f       f
 l       l r       r x       x ~       ~                "        &        *      C l          	zP Xk A،XM8&A@PM8X[ e Pg ,$Q` A"$0P7 ,@ PG 0$Q$cA# XX PW ,Xm8Pg 0$Q`  A#\X8 XK 4 X]8PT  $bQm8$5XK @4 $T@T {  ug p 84%WELSH GRAEME        5H  %WILSON HELEN        5H  %WILSON IAN          5E  /04%WILSON KENNETH      5H  34%YOUNG BRIAN         5H  27?@34%AITKEN CRAIG        6   ()34%ARBUTHNOTT JANIS    6   )=34%BLACK ANGELA        6   (34%BLAIKIE ROBERT      6   234%BROWN MICHAEL       6   ()*4%CHRISTIE KATHRYN    6   "%,*4%GEORGESON ANNA      6   "23<*4%GRAY FIONA          6                                  7?@*4%GREIG JOHN          6   "*4%HARVEY COLIN        6   *B4%HOGG JACQUELINE     6   36B4%HOOK GRAHAM         6   34?B4%HUTTON PAULINE      6   "4B4%MACSPORRAN ANDREW A 6   +B4%MCCRAN MAUREEN      6   ,64%MARRIOTT NEIL V     6   7?@64%PLAIN DAVID         6   "#:4%PRIOR AMANDA        6   #+:4%ROBERTSON MARGARET  6   %)%ROLLO DALE          6   34%)%SCOTT GEORGE        6                                   H?    o                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     @?   @  1qL      GO   GukR    G&:T       )X    akh]   k`    `wFpb    `wFp/d   bpQg   fai    iKk     an                                                                                                                                                                                                                                                                                                                                                              set verify
Ptape(Read,ISO)
Null:
Bci.imp
Clean
Filerts.imp
Io.imp
Loader.imp
Loop.com
Oper
Search
Sort
Specs
Standard
State
Subsys
Subsys.lay
Dumper
Ebcdic
Ebcdic.inc
Fromhex
Ibmprocs
Ibmprocs.inc
Ibmtape
Labels.inc
Mtdefs
Mtdefs.inc
Ptape
Tapes.lay
Testgen
Tohex
Utan.com
*
 H?    }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     @?   @   	V:{                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
%external %routine DUMP BLOCK (%name from, %integer bytes, line width, wants)
   %integer from addr = addr(from)

   !'WANTS' mask values:

   %const %integer hex = 1<<1,
                 octal = 1<<2,
                 ASCII = 1<<3,
               decoded = 1<<4,
                exclam = 1<<5,
                EBCDIC = 1<<6,
               formats = 3

   %external %integer %fn %spec EtoI (%integer sym)
   %external %string(63) %fn %spec ITOS (%integer I,places)
   %external %routine %spec PHEX (%integer n,width)

   %integer %fn STOI (%string(15) s)
      %byte %name b
      %integer j, n = 0
      %for j = 1,1,length(s) %cycle
         b == char no (s,j)
         %continue %if b <= ' '
         %if '0' <= b <= '9' %start
            n = 10*n + (b-'0')
         %finish %else %result = -1
      %repeat
      %result = n
   %end

   %const %integer non zero = 1
   %const %integer infinity = 16_7FFFFFFF
   %const %integer FF = 12;              !ASCII formfeed character
   %record(parm fm) P
   %integer offset;                      !word index in BLOCK

   %integer N words;                     !# of 32-bit words per dump line
   %integer firsttry;                    !!!!!!
   %integer rows;                        !# of dump lines per block
   %integer N fields;                    !# of (hex,oct,..) fields wanted
   %integer unit;                        !physical unit no.
   %integer decoding = 0
   %integer j,k

   %routine report (%string(63) message)
      print string (message);  newline
   %end

   %integer lines = 0

   %routine break;                       !keeps track of lines for formfeeds
      newline;  lines = lines + 1
   %end

   %routine dump ASCII (%integer word, sp); !SP = padding per character
      %routine do (%integer word)
         %integer j,k
         %for j = 1,1,3 %cycle
            k = rem (word,37);  word = word//37
            %if k = 0 %then space %else %start
               %if k <= 26 %start
                  print symbol (k + 'A' - 1)
               %else
                  print symbol (k - 27 + '0')
               %finish
            %finish
         %repeat
      %end
      %integer j, k
      %if decoding = 0 %or wants&1<<exclam # 0 %start;   !straight ASCII
         %for j = 1,1,4 %cycle
            spaces (sp)
            k = (word>>(3*8)) & 255;  word = word<<8
            %if wants&EBCDIC {xlate} # 0 %then k = EtoI(k) %else k = k&127
            %if k < ' ' %or k = 127 %then space %else print symbol (k)
         %repeat
      %else;                             !packed decode
         spaces (4*sp + 4 - 6)
         do (word>>16);  do(word&X'FFFF')
      %finish
   %end

   %routine poct (%integer n)
      %integer j
      print symbol (n>>j & 7 + '0') %for j = 30, -3, 0
   %end

   %routine print decoded (%integer n, offset)
      !dump the ASCII translation of the N words
      !starting at FROM under each of the formats
      %integer j,k,from
      from = from addr + offset
      decoding = non zero
      spaces (4);  print symbol ('|')
      %for j = 1,1,formats %cycle
         %if wants & 1<<j # 0 %start
            spaces (2) %if 1<<j = octal
            %for k = from, 4, from + 4*(n-1) %cycle
               %if 1<<j = hex %start
                  space
                  dump ASCII (integer(k),1)
               %else %if 1<<j = octal
                  dump ASCII (integer(k),2);   !4*(2+1) = 12 = octal field
               %else; !ASCII - dont do it again
                  spaces (4)
               %finish
            %repeat
         %finish
      %repeat
      decoding = 0
   %end

   %integer len, block ht, m, save

   bytes = bytes + 1 %while bytes&3 # 0

   !Calc no. of words per row of dumped block,
   !fitting in all required output formats for
   !each word

   N fields = 0
   %for j = 1,1,formats+4 %cycle
      N fields = N fields+1 %if wants & 1<<j # 0
   %repeat
   len = 0;  len = len + 9 %if wants & hex # 0
             len = len +12 %if wants & octal # 0
             len = len + 4 %if wants & ASCII # 0
   N words = (line width - 5 { nnn|} - N fields) // len

!  %cycle
!     %if N words = 0 %start
!        report ("Won't fit!")
!        %stop
!     %finish
!     %exit %if rem (bytes//4,N words) = 0
!     N words = N words - 1
!  %repeat

   !Now we can find the number of lines the dump
   !of a single block will occupy

   rows = (bytes>>2) // N words
   rows = rows+1 %if rows*N words < bytes>>2
   block ht = rows
   block ht = 2*rows %if wants & decoded # 0;  !ASCII decode under each line
   block ht = 3 {header lines} + block ht
   break

   offset = 0
   %for j = 1,1,rows %cycle
      write (4*offset,3) {byte offset};  print symbol ('|')
      %for k = 1,1,formats %cycle
         space %if 1<<k = ASCII %and wants&(\(ASCII!decoded)) # 0
         !(don't jam ASCII dump up against octal one)
         %if wants & 1<<k # 0 %start
            space
            save = offset
            %for m = 1,1,N words %cycle
               %if 1<<k = hex %start
                  space
                  Phex (integer(from addr+4*offset),8)
               %else %if 1<<k = octal
                  space
                  Poct (integer(from addr+4*offset))
               %else %if 1<<k = ASCII
                  Dump ASCII (integer(from addr+4*offset),0)
               %finish %else %monitor %and %stop
               offset = offset + 1
            %repeat
            offset = save
         %finish
      %repeat
      break
      print decoded (N words,offset) %and break %if wants & decoded # 0
      offset = offset + N words
   %repeat
%end

%end %of %file
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          C!          H   }        	  $     Ud\^C  NWfS    X`QK xgQK fZJ_fZX!t^Z} }    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  (QT    :      "Z    "o8@    ;ov    eE         . 4 9 8 T Y dQ@    y8@    qX`    U    X      Ud;1  f[}     fZUd\^C  
    H  !34  1  0 !81 !5$$A> 6#$$A> 6&C  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n?1  &134C0  D   D   
C A> 6GHO  s/ "B
'X=  2 #$$A> 6&r0U> ?P7D   &D"$  w ) ,A P) <A @ X <A   $0P9 HI ,PI <SPY DC F&QPY Di ,
ePi @    !#C ( 0! 9!+X H$:
P H#%y UY <B0X Hy  L	w ) ,A P) lA p X lA   ? ,W   HW  ,y  #	w A , W  ,$Q y  	g A , $0&1P: ,XZ E@ Ȱ %KPJ 0X: #  +P: D!8W  C $@ !)d @W   <#d W   <X: ,0 B0z  C
W  A , X t#7X8 40 C0$&P ,Xi  W   X  JPI 0XY XPY Xh 4` @#:dW  hP 0#@ PI 0X 0  ! !7W  #lW   <X ,Ű B0|C $X9  2cW   si Asi Ay  l	g A , 0 !'3P9 ,X   İ k 0W   <X9 ,3B0y  #	W  A , X8 8
5P9 4$APH t$dW   ` |W   <$P&QPY ,$ae  Th 4C0$   !7$bW   X9 '12Z9 4P9 8X 4'P 0C Z&P 0$XI ,  Š !?W  $QXi 0Xf  A0C $$   !7$RXk  A#$dW   X 0U 8B0XY ,P B0H$0P8 ty  	W  P (A 8 (X8 ,P8 8$P t$P X  #5&P "$0P8 l&P x$  T 4#4$Q lŰ  >$@PH XX 4P #4&IPH P #4&LPH P #4&DPH Xh  'e[h l P `X <#  +P8 h+X 	:#$Q hXh hPh P #4
fPh $Q AJ$0P8 \X hP P xC ~&P xXh \b$SW   `` |W   <$&P |$AI  @ !;XX 4P#6W  $aX |l  Th 4C0W  X8 \P8 X `P $P C &P $XH |  Ő B00W  XX \RZX 8PX $XXh Xf  W  C b$   B0 W  X8 \2Z8 8Xc  AC 4$  Ű !<X \Z 8$PXi  A#
$ %AA$AQH \X U B0DXX PX \X |Ő B0AXh 4` #9XX \Xh `AAX `Q \X xU B0zx H  Ű !;$RX 0Xj  lA#$dW   XY 0UY <AVUY @B0tP <XY ,UY 8AVP B0P 8$@PH ty  	W  P (A` 8 *X X8 ,P8 8$0P8 t$0P8 X8 0 #5&1P8 "$P l&P xP *A$  T 4#8XH lL&APH lU AVŠ B0P $PPX Xh 4` #4&YPX ` #4&\PX ` #4&TPX X8  '5X l;SE@ ]H PX `X  P h
A(X 	#XH h&APH hX8 h<P8 ` #8$+A(P8 &3P8 AP$P \X hP J$!A8PH xC 4&APH xPH X \$T
A(k$SW   `` |W   <$`&aPh |Ph &                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                                       ̀4READSYMFN    !        g P      g Q#       !  )       !READSYMFN    !             	not found Tape force-reVolume serial no. wrongFile sequence no. wrongNonzero block countrong  Record length mismatchgBlock size mismatchtchgWrong density code?tchgMultireel dataset!?tchgSpanned records!t!?tchg  ' ,X8 < $A  $=AX   P, P0W  $=AX                                      $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                                        H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        %external %routine to EBCDIC (%integer bytes,%name buffer)
   %const %byte %array I to E (0:255) =
      0,1,2,3,55,45,46,47,22,5,37,11,12,13,14,15,16,17,18,19,60,61,50,38,
      24,55,63,39,28,29,30,31,64,79,127,123,91,108,80,125,77,93,92,78,
      107,96,75,97,240,241,242,243,244,245,246,247,248,249,122,94,
      76,126,110,111,124,193,194,195,196,197,198,199,200,201,209,210,
      211,212,213,214,215,216,217,226,227,228,229,230,231,232,233,74,
      224,90,95,109,121,129,130,131,132,133,134,135,136,137,145,146,
      147,148,149,150,151,152,153,162,163,164,165,166,167,168,169,192,
      106,208,161,7,32,33,34,35,36,21,6,23,40,41,42,43,44,9,10,27,
      48,49,26,51,52,53,54,8,56,57,58,59,4,20,62,225,65,66,67,68,
      69,70,71,72,73,81,82,83,84,85,86,87,88,89,98,99,100,101,102,103,
      104,105,112,113,114,115,116,117,118,119,120,128,138,139,140,141,
      142,143,144,154,155,156,157,158,159,160,170,171,172,173,174,175,
      176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
      202,203,204,205,206,207,218,219,220,221,222,223,234,235,236,237,
      238,239,250,251,252,253,254,255
   %byte %name b == byte integer (addr(buffer))
   %while bytes > 0 %cycle
      bytes = bytes - 1
      b = I to E (b&255)
      b == b ++ 1
   %repeat
%end

%external %routine to ISO (%integer bytes, %name buffer)
   %const %byte %array E to I (0:255) =
      0,1,2,3,156,9,134,127,151,141,142,11, 12,13,14,15, 16,17,18,19,
      157,133,8,135, 24,63,146,143, 28,29,30,31, 128,129,130,131,
      132,10,23,27, 136,137,138,139, 140,5,6,7, 144,145,22,147,
      148,149,150,25, 152,153,154,155, 20,21,158,26, 32,160,161,162,
      163,164,165,166, 167,168,91,46, 60,40,43,33, 38,169,170,171,
      172,173,174,175, 176,177,93,36, 42,41,59,94, 45,47,178,179,
      180,181,182,183, 184,185,124,44, 37,95,62,63, 186,187,188,189,
      190,191,192,193, 194,96,58,35, 64,39,61,34, 195,97,98,99,
      100,101,102,103, 104,105,196,197, 198,199,200,201, 202,106,107,108,
      109,110,111,112, 113,114,203,204, 205,206,207,208, 209,126,115,116,
      117,118,119,120, 121,122,210,211, 212,213,214,215, 216,217,218,219,
      220,221,222,223, 224,225,226,227, 228,229,230,231, 123,65,66,67,
      68,69,70,71, 72,73,232,233, 234,235,236,237, 125,74,75,76, 77,78,79,80,
      81,82,238,239, 240,241,242,243, 92,159,83,84, 85,86,87,88,
      89,90,244,245, 246,247,248,249, 48,49,50,51, 52,53,54,55, 56,57,250,251,
      252,253,254,255
   %byte %name b == byte integer (addr(buffer))
   %while bytes > 0 %cycle
      bytes = bytes - 1
      b = E to I (b&255)
      b == b ++ 1
   %repeat
%end

%external %integer %fn E to I (%integer sym)
   to ISO (1,byte integer(addr(sym)+3))
   %result = sym
%end

%external %integer %fn I to E (%integer sym)
   to EBCDIC (1,byte integer(addr(sym)+3))
   %result = sym
%end

%endoffile
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          C!            }    $ *     4      ]8    ay      "o8@     ;o@    NWfS    X`QK xgQK fZJ_fZX!t^Z} }    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  (QT    :      "Z            q   a  A 	   r   a  A 
   4aA    9aA   dQ@    \"Z 	]8   |"8ŀ 4   ay     |"8ŀ 4   "o8@     z   	;o@     z   	 	?
 [.<(+!&]$*);^-/|,%_>?`:#@'="abcdefghijklmnopqr~stuvwxyz{ABCDEFGHI}JKLMNOPQR\STUVWXYZ0123456789              7-./%<=2&7?'@O{[lP}M]\Nk`Kaz^L~no|JZ_myjС !"#$()*+,	
01345689:;>ABCDEFGHIQRSTUVWXYbcdefghipqrstuvwx             
   0?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nX# Y !Y !&\ Z  B!$$A> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$  g P (A  4 X X8 ,P8 4X C 2'P X 4Ӛ   =hA ӑ  Қ  XH 4&APH 4C x  1g P (A  4 X X8 ,P8 4X C 2'P X 4Ӛ   =pA ӑ  Қ  XH 4&APH 4C x  1g P (A  , X 8 P7 ,$5P7 0$aAtX x  g P (A  , X 8 P7 ,$5P7 0$aAX x           *         .         2         6         :         > $       $ B *       * F 0       0 J 6       6 N <       < R B       B V H       H Z N       N ^ T       T b Z       Z f `       ` j f       f n l       l r r       r v x       x z ~       ~ ~                                                                Ԁ         *         .         2         6         :         > $       $ B *       * F 0       0 J 6       6 N <       < R B       B V H       H Z N       N ^ T       T b Z       Z f `       ` j f       f n l       l r r       r v x       x z ~       ~ ~                                                                Ԁ H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        %external %routine %spec     to EBCDIC (%integer bytes, %name buffer)
%external %routine %spec     to ISO    (%integer bytes, %name buffer)
%external %integer %fn %spec E to I    (%integer sym)
%external %integer %fn %spec I to E    (%integer sym)
%end %of %file
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        !IBM magtape library

%include "Labels.inc"
%include "MTdefs.inc"
%include "EBCDIC.inc"
%include "IBMprocs.inc"

%const %integer true = 0,  false = 1     {Pseodo-Booleans}

!Signals
%const %integer MT err = 13,  { & subevents... }
                No such drive = 1,
                Already claimed = 2,
                Bad Vol = 3,
                Wrong Vol = 4,
                Chan open = 5,
                 Not open = 6,
                      EOF = 7,
                      EOT = 8,
            invalid label = 9,
    Unimplemented feature = 10

   %routine error (%integer code, extra)
      %const %string(31) %array text(1:10) =
         "no such channel",
         "tape in use",
         "tape is not IBM labelled",
         "label does not match tape",
         "channel in use",
         "channel not open",
         "end of file",
         "end of tape",
         "incorrect file labels",
         "unimplemented feature"
      event_message = "unknown error"
      event_message = text(code) %if 0 < code <= 10
      %signal %event MT err, code, extra
   %end

%record %format Buf fm  (%byte %array B(0:2047))
%own %record(buf fm) buffer

%record %format chan fm (                %c
        %integer     Vflags,             {Flags from LOAD MT call}
                     Flags,              {Copied from OPEN MT call}
                     Count,              {Relative file position in tape}
                     Block size,         {bytes}
                     Rec len,
                     Output,             {Bool: chan open for output}
                     Block count,        {Relative block position in file}
                     Open,               {Bool: File open on this channel?}
                     Free,               {Bool: Chan not connected to a vol?}
        %string(17)  File,               {Name of open dataset}
        %byte %array Vol ID(1:6),        {Name of vol. mounted on chan}
        %byte %name  BP,                 {Next free byte in buffer}
        %integer     Used,               {No. of bytes used in buffer on output}
                     Left,               {No. of bytes read from buf on input}
        %record(buffm)%name buffer)      {Ptr. to buffer area}
%own %record(chan fm) %array chan table(1:1)

   %routine put (%record(chanfm)%name chan, %integer w)
      %integer j
      %for j = 24, -8, 0 %cycle
         chan_bp = w>>j & x'FF'
         chan_bp == chan_bp ++ 1
      %repeat
      chan_used = chan_used + 4
   %end

   %routine get (%record(chanfm)%name chan, %integer %name w)
      %integer j
      w = 0
      %for j = 1,1,4 %cycle
         w = w<<8 ! chan_bp
         chan_bp == chan_bp ++ 1
      %repeat
      chan_left = chan_left - 4
   %end

   %external %routine MOVE (%integer N, %name from,to)
      %byte %name f == byte integer(addr(from)),
                  t == byte integer(addr(to))
      %integer j
      %for j = 1,1,N %cycle
         t = f
         t == t ++ 1;  f == f ++ 1
      %repeat
   %end

   %external %string(*) %map STRING OF (%integer bytes, %name where)
      %own %byte %array copy(0:63)
      Move (bytes, where, copy(1))
      copy(0) = bytes
      %result == string(addr(copy(0)))
   %end

   %external %routine MOVE STRING (%string(255) s, %name to)
      MOVE (length(s), char no(s,1), to)
   %end

   %external %routine FILL (%name buffer, %integer fill char, bytes)
      %byte %name b == byte integer(addr(buffer))
      %integer j
      %for j = 1,1,bytes %cycle
         b = fill char
         b == b ++ 1
      %repeat
   %end

   %external %string(*) %map FIELD (%integer width, %string(*)%name sn)
      %own %string(80) s
      s = sn
      s = s . " " %while length(s) < width
      length(s) = width %if length(s) > width
      %result == s
   %end

   %external %predicate EQUAL (%integer bytes, %name buf1, buf2)
      %byte %name x == byte integer(addr(buf1)),
                  y == byte integer(addr(buf2))
      %integer j
      %for j = 1,1,bytes %cycle
         %false %if x # y
         x == x ++ 1;  y == y ++ 1
      %repeat
      %true
   %end

   %string(31) %map ItoS (%integer N,places)
      %own %string(31) s
      s = ""
      %cycle
         s = to string('0'+rem(N,10)) . s
         N = N//10
      %repeat %until N = 0
      s = "0".s %while length(s) < places
      %result == s
   %end

   %external %integer %function StoI (%string(31) s)
      %integer sign = 1, val = 0, j
      %byte %name b
      %for j = 1,1,length(s) %cycle
         b == char no(s,j)
         %if b = '-' %start
            sign = -sign
         %else %unless '0' <= b <= '9'
            %signal 10,0,b
         %else
            val = 10*val + (b-'0')
         %finish
      %repeat
      %result = sign*val
   %end

   %external %routine CLAIM MT (%integer N, wait)
      error(no such drive,N) %if N # 1
      %cycle
         Claim tape
         %exit %if tape error = 0
         Select output (0)
         Print string ("*Warning: Tape force-released")
         Newline
         Release tape
      %repeat
   %end

   %external %routine RELEASE MT (%integer which)
      error(no such drive,which) %if which # 1
      error(chan open,which) %if chan table(which)_open = true
      Release tape
   %end

   %routine find (%record(chanfm)%name chan, %integer file no)
      {File no is absolute (1..N).   We navigate there
      {by dead reckoning on the CHAN_COUNT field.
      %record(label) L
      file no = 1 %if file no <= 0
      %while chan_count < file no %cycle
         Read tape (addr(L),80)
         Backspace %and %exit %if TM # 0
         skip forward;  skip forward;  skip forward
         chan_count = chan_count + 1
      %repeat
      %while chan_count > file no %cycle
         skip reverse;  skip reverse;  skip reverse
         Backspace;  backspace
         chan_count = chan_count - 1
      %repeat
   %end

   %external %routine LOAD MT (%integer channel, flags, %string(6) volume)
      %record(chan fm)%name chan
      %record(label) V
      error(no such drive,channel) %if channel # 1
      chan == chan table(channel)
      error(chan open,channel) %unless chan_free = true
      chan_free = false
      chan_Vflags = flags
      chan_count = 1                     {Relative file# within volume}
      chan_buffer == buffer
      chan_open = false                  {No file currently open}
      Rewind
      Read tape (addr(V),80);  to ISO (80,V)
      
      {Check VOL1 label}

      Move string (field(6,volume), chan_Vol ID(1))
      error(bad vol,0) %if V_vol1 # m'VOL1'
      error(wrong vol,0) %unless equal (6,V_serial no(1),chan_volid(1))
      
      Find (chan,999999) %if flags&append # 0

   %end {of LOAD MT}


   %routine set label 1 (%record(chanfm)%name chan, %record(label)%name H)
      Fill (H,' ',80)
      Move string (chan_file, H_file(1))
      Move (6, chan_vol ID(1), H_file serial(1))
      Move string ("0001", H_vol seq(1))
      Move string (ItoS(chan_count,4), H_file seq(1))
      Move string (" 00000", H_created(1))
      Move string (" 00000", H_expires(1))
      H_lock = '0'
      Move string ("000000", H_Blocks(1))
      Fill (H_system(1), 0, 13)
   %end

   %routine set label 2 (%record(chanfm)%name chan, %record(label)%name H)
      Fill (H,' ',80)
      H_format = 'F'                     {Fixed records only as yet}
      Move string (ItoS(chan_block size,5), H_block len(1))
      Move string (ItoS(chan_rec len,5), H_record len(1))
      H_density = '2'                    {800bpi NRZI}
      H_DSP = '0'
      H_Job ID(9) = '/'
      %if chan_flags&variable # 0 %then H_format = 'V' %c
                                  %else H_format = 'F'
      %if chan_flags&unblocked# 0 %then H_attrib = ' ' %c
                                  %else H_attrib = 'B'
   %end

   %external %routine OPEN MT IN  (      %c
             %integer channel,
             %string(17) filename,
             %integer File no,
                      Record length, Block size,
                      Flags)
      %own %string(23) %array HDR1 errors(1:4) =
         "not found",
         "Volume serial no. wrong",
         "File sequence no. wrong",
         "Nonzero block count"
      %own %string(23) %array HDR2 errors(1:6) =
         "Record length mismatch",
         "Block size mismatch",
         "Wrong density code?",
         "Multireel dataset!",
         "Spanned records!",
         "Record format mismatch"

      %routine show errors (%string(31) where, %integer mask,
                            %string(23) %array %name text)
         %integer j, k = 0
         %for j = 1,1,32 %cycle
            %if mask&k # 0 %start
               Print string ("*".where." -- ".text(j))
               Newline
            %finish
            k = k<<1
         %repeat
      %end

      %record(label) L
      %record(chan fm)%name chan
      %integer err {mask},  j
      %byte %array dataset(1:17)
      Move string (field(17,filename), dataset(1))
      block size = record length %if block size < record length
      block size = block size//record length * record length

      error(no such drive,channel) %if channel # 1
      chan == chan table(channel)
      error(chan open,channel) %if chan_open = true

      {Set up channel control block}

      chan_file = filename
      chan_block size = block size
      chan_rec len = record length
      chan_output = false
      chan_block count = 0
      chan_flags = flags
      chan_bp == byte integer(addr(chan_buffer))
      chan_left = 0

      Find (chan,file no)

      {Check file header labels}

      Read tape (addr(L),80)
      Backspace %and error(EOT,channel) %if TM # 0
      To ISO (80,L)
      err = 0
      err = 1      %if  L_label1 # m'HDR1'
      err = err+2  %if  filename#"" %and %not equal(17,dataset(1),L_file(1))
      err = err+4  %if  %not equal(6,L_file serial(1), chan_Vol ID(1))
      err = err+8  %if  %not equal(4,ItoS(chan_count,4), L_file seq(1))
      err = err+16 %if  %not equal(6, ItoS(0,6), L_Blocks(1))
      Show errors ("File HDR1 label", err, HDR1 errors)

      Read tape (addr(L),80)
      To ISO (80,L)
      error(unimplemented feature,0) %if 'V' # L_format # 'F'
      err = 0
      err = 1      %if  Record length # 0 %and
                        Record length # StoI(string of(5,L_record len(1)))
      err = err+2  %if  Blocksize # 0     %and
                        Blocksize # StoI(string of(5,L_Block len(1)))
      err = err+4  %if  L_density#2 %or L_how(1)#' ' %or L_how(2)#' '
      err = err+8  %if  L_DSP # '0'
      err = err+16 %if  L_attrib # 'B'
      j = chan_flags
      j = j&(~variable) %if L_format = 'F'
      j = j!variable %if L_format = 'V'
      err = err+32 %if  j # chan_flags
      chan_flags = j                     {Override}
      Show errors ("File HDR2 label", err, HDR2 errors)

      Skip forward                       {Past any UHL's}
      chan_open = true
   %end

   %external %routine READ MT (%integer channel,
                               %integer %name bytes, %name buffer)
      %record(chan fm) %name chan
      %integer j, BDW
      error(no such drive,channel) %if channel # 1
      chan == chan table(channel)
      error(not open,channel) %unless chan_open = true

      %if chan_left = 0 %or chan_flags&unblocked # 0 %start
         Read tape (addr(chan_buffer), chan_block size+15)
         Backspace %and error(EOF,channel) %if TM # 0
         chan_left = bytes transferred   {Less than whole block read?}
         chan_bp == Byte integer(addr(chan_buffer))
         chan_block count = chan_block count + 1
         %if chan_flags&variable # 0 %start
            Get (chan,BDW)
!           %if BDW>>16 # chan_left+4 %start
!              Print string ("*Length count wrong in block")
!              Write (chan_block count,1)
!              Print string (" of file")
!              Write (chan_count,1)
!              Print symbol (':')
!              Write (BDW>>16,1)
!              Print symbol ('#')
!              Write (chan_left+4,0)
!              Newline
!           %finish
            chan_left = BDW>>16 - 4      {Believe BDW not transfer length}
         %finish
      %finish

      %if chan_flags&variable # 0 %start
         Get (chan,bytes)
         bytes = bytes>>16 - 4
         Move (bytes, chan_bp, buffer)
         chan_bp == chan_bp ++ bytes
         chan_left = chan_left - bytes
      %else
         bytes = chan_rec len %if bytes > chan_rec len
         Move (bytes, chan_bp, buffer)
         chan_bp == chan_bp ++ chan_rec len
         chan_left = chan_left - chan_rec len
      %finish

      To ISO(bytes,buffer) %if chan_Vflags&ISO = 0
   %end

   %external %routine OPEN MT OUT (      %c
             %integer channel,
             %string(17) filename,
             %integer File no,
                      Record length, Block size,
                      Flags)
      %record(label) H
      %record(chan fm) %name chan
      error(no such drive,channel) %if channel # 1
      chan == chan table(channel)
      block size = record length %if block size < record length
      block size = block size//record length * record length   {exact multiple}
      error(chan open,channel) %if chan_open = true

      chan_open = true                   {Set channel control block}
      chan_file = filename
      chan_block size = block size
      chan_rec len = record length
      chan_output = true
      chan_block count = 0
      chan_flags = flags
      chan_bp == byte integer(addr(chan_buffer))
      chan_used = 0

      Find (chan,file no)

      Set label 1 (chan,H)               {Build header labels}
      H_label1 = m'HDR1'
      To EBCDIC (80,H)
      Write tape (addr(H),80)

      Set label 2 (chan,H)
      H_label2 = m'HDR2'
      %if flags&variable # 0 %start
         Put (chan,0)                    {Hole for BDW at start of buffer}
      %finish
      To EBCDIC (80,H)
      Write tape (addr(H),80)

      Tape mark
   %end

   %routine flush out (%record(chan fm)%name chan)
      %integer j = chan_used
      %if j # 0 %start
         %while j < 18 %or j&1 # 0 %cycle
            {**** system doesn't like odd-length transfers ****}
            {**** IBM don't like blocks less than 18 bytes ****}
            chan_bp = 0
            chan_bp == chan_bp ++ 1
            j = j + 1
         %repeat
         %if chan_flags&variable # 0 %start   {Fill BDW hole}
            chan_bp == byte integer(addr(chan_buffer))
            Put (chan,chan_used<<16)
         %finish
         Write tape (addr(chan_buffer), j)
         chan_block count = chan_block count + 1
      %finish
      chan_bp == byte integer(addr(chan_buffer))
      chan_used = 0
      Put (chan,0) %if chan_flags&variable # 0   {Hole for BDW}
   %end

   %external %routine WRITE MT (%integer channel,
                                %integer %name bytes, %name buffer)
      %record(chan fm)%name chan
      %integer blank, j
      error(no such drive,channel) %if channel # 1
      chan == chan table(channel)
      error(not open,channel) %unless chan_open = true
      bytes = chan_rec len %if bytes > chan_rec len
      %if chan_flags&variable = 0 %start
         Flush out(chan) %if chan_used+chan_reclen > chan_block size %or
                             chan_flags&unblocked # 0
         Move (bytes, buffer, chan_bp)
         To EBCDIC (bytes,chan_bp) %if chan_Vflags&ISO = 0
         chan_bp == chan_bp ++ bytes
         chan_used = chan_used + bytes
         blank = ItoE(' ')
         %for j = 1,1, chan_reclen-bytes %cycle   {Pad out fixed record}
            chan_bp = blank
            chan_bp == chan_bp ++ 1
            chan_used = chan_used + 1
         %repeat
      %else                              {variable records}
         bytes = bytes+4                 {RDW included}
         Flush out(chan) %if chan_used+bytes > chan_block size %or
                             (chan_flags&unblocked # 0 %and chan_used > 4)
         Put (chan,bytes<<16)
         bytes = bytes - 4               {lose RDW}
         Move (bytes, buffer, chan_bp)
         To EBCDIC (bytes,chan_bp) %if chan_Vflags&ISO = 0
         chan_bp == chan_bp ++ bytes
         chan_used = chan_used + bytes
      %finish
   %end

   %external %routine CLOSE MT (%integer channel)
      %record(chan fm)%name chan
      %record(label) L
      error(no such drive,channel) %if channel # 1
      chan == chan table(channel)
      %return %unless chan_open = true
      chan_open = false
      %if chan_output = true %start
         Flush out (chan)                {Last (or only) data block ->
         Tape mark

         Set label 1 (chan,L)            {write trailer labels
         L_label1 = m'EOF1'
         Move string (ItoS(chan_block count,6), L_Blocks(1))
         To EBCDIC (80,L)
         Write tape (addr(L),80)

         Set label 2 (chan,L)
         L_label2 = m'EOF2'
         To EBCDIC (80,L)
         Write tape (addr(L),80)

         Tape mark;  tape mark           {**EOT**}
         Backspace                       {Next file will scrub last TM}
      %else
         Skip forward                    {past end of user file}
         Skip forward                    {Past trailer labels}
      %finish

      chan_count = chan_count + 1        {One file processed}
   %end

   %external %routine UNLOAD MT (%integer channel)
      %record(chan fm)%name chan
      error(no such drive,channel) %if channel # 1
      chan == chan table(channel)
      error(chan open,channel) %if chan_open = true
      Rewind
      chan_free = true
   %end

%end %of %file
 H?   # #                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!          ^}f $  l rt      QS@     y:w^   S"Lq+ &K      $;&K     *k!      0y8@     6z:U}    <qT{!\   BkMY     H`EY:p   N8qI     T`EYa   Z}}    `w}    f|]T`  NWfS    X`QK xgQK fZJ_fZX!t^Z} }    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  (QT    :      "Z    :\  q_:t    }8!Ir8  xdtq xfՊZwG  |"LpwqI!d        }  qT{"ad}8 r  ]8  ay    "o8@    ;o@    S@    S"Lq+y:w^  &K     &K    !     y8@    :U}   MY    `EY:p  `EYa  qI    }}   w}   |]T`  qT{!\                     
hk    ,a    =" aaa 	   F" a aa 
   Pa!A 	   Zb    aa    ea !A  	   nb a    va! A 	   " b A 	    a   A    a  A     A    a !     $ !a AAa A     a    "    !!    !   " a  !      a!!!dA   A !A aa!! abaA!  A   0  Od bAAAa  a!! A   ~h !b A   A  "   "    !  a#aa  A bA    d aA!!!!Aaa A!!!!"   c ! aa a  A" "A  !  a    b a   	  dQ@    \"Zp|"Lpw  }8 r  &Z ""`     @  #p g\      Ā W     ,>   ,      Ā W     ,>   S@     W  ŀ <%  ŀ @}    D>   y:w^   |"8 	S"Lq+ ,v   	&K      &K	    |"8ŀ 4   8>   &K     ,~@À  x  \v   !      |"8ŀ <   ŀ @@   D>   ;ov     W    ev   y8@     ,v   Px/W T   X>  ŀ \   :U}    W    }  qT{!\   	  	&     Ā W  &! ,K    MY     YK     'a. ,MĀ 8W <   wK*!<  Ā WĀ  2    wK*!=  Ā WĀ  2    xrv ,qH Q{D T>   XD   `EY:p   YK    ,&!qR    &! @qK`K. Do<U   H'a. LK   Ā W ""   >   5qI     YK     |"8Ā 4W 8>   <7   `EYa   YK    ,&!qR    &! @qK`K. Do<U   H'a. L2   Ā W -'ux`  Ā W ,>   }}    YK     |"8Ā 4W 8aY8 <>   w}    YK   Ā ,W 0K    |]T`   YK   Ā ,W markFile HDR2 labelFile HDR1 label --  *                        e 000000  00000  00000 0001 *Warning: Tape force-released0             ?               L                        ocunknown errorno such channel!         tape in usennel!         tape is not IBM labelled      label does not match tape     channel in use match tape     channel not openatch tape     end of file openatch tape     end of tape openatch tape     incorrect file labelstape     unimplemented featuretape              
             L                                                                                                                                                                                                                                     
                        
                           
   ?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nH  !34  1  0 !81 !5$$A> #$$A> &C ?1  &134C0  D   D   
C H  !34  1  0 !81 !5$$A> B  @ !4B ";
C@ !$$A> #$$A> B  C
B$P#E  E  &Q'1"C X# Y !Y !&\ Z  B!$$A> З  $1$H  H X [ &B0P  [ ,&' ?P  
*&30H  P  ї  C Kї  $$A> 
Y  #%$$A> 
qPr  PB &(pX  ?$PS?PE   &T 4A>  ?&?$$A> ?$$A> "#:  ! ?$$A> ?$$A> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$ ?$$A> H  !34  "#(!B   C $$A>  W  A , X X=d<# A  ?f#/` 
!,=AXMd$ A %$AX +W  A , X 0  '8P8 ,P8 0#AX    X X <İ ҹ  ð AlXH LXT <\&QPT <X8 ,U8 0A3B0P 0Xh lX6 @<&4P6 @x  MW  A , X $0P5  $&P ,P 0X  X  XH LXT <\e  P  X8 <X <&P <X ,U 0AŰ B0P 0X X D'P Dx  Mg P (A < X X8 ,P8 <XH 4PH @Ph L$P$!AvPX DC :&QPX DPX HXh @X8 <ӳ  Ҷ  X @&P @X <&P <XX DUX HAUX LB0P Hx  Gg P (A 4 X X ,P ,X 0P 0$=AP 4 P 8W  $=AX ұ  ð Al$=A   x  =w P (A4 MX 8 -P7 ,$5P7 0X,P 4X0P 8h ,W  x  &W  P (A 4 X X8 ,P8 4PX @$@$!AvPH 8C 4&APH 8PH <XX 4Xh e  ` AlX8 4&1P8 4XH 8UH <AUH @B0P <x  @W  P (A , X -\A =\Y8 #-\A$ P"Y8 #)X8 =\0 AlP \x  0g P (A < X X8 ,P8 <XH 4PH @Ph L$P$!AvPX DC :&QPX DPX HXh <6  X @ӫ  :#5$x &aPh <&P @UX HAUX LB0P H%x  HW  A , X $0=XX E@ $K@ 0  @ ,' , ,A A$ -A XX E@ KPX U#3C ӭY  C(' ,A  A$ -A  C  x  Xw P (( ,A P( LA P X X LA  $1P8 P$@PH TX ,PX `d#AvPh XC h&aPh XPh L ,&A P \1  0 -!8$[ PP PC .0 0!0 9#&#$$
AXXX T$JA\0
SPX TUh LAUh `B0P LX P\ TA\x  oW  P (A , X ` #5V$aA W  (X=X  !3C 2$`W   xW   HW  ,W  C x  ?g P (A , X ` #5V$aAX =AX !6XX $eA`W  x  -W  A , X U!$$QPX  X8 <X Y  ChP Ph ,W  |XX  #8W  dC 8W  LW  LW  LXH LXT \&QPT C Xh lX6 <Y8  C LW  XW  XW  XW  dW  dX X 'P C x  W  P (( ,A P( 4A 8 #X X 4A  ` #5V$aAX =AP 8X  #6XX $eAX 8$P  XH 8LXX  PT  Xh 8l$1P6 X 8ȭP HX 8$API W  4P Ph <W  |X <PW ,PPW 0` PW  X  ,$fW  ' ,A  $=AXh 8l 6P, P0W  X8 <<0VOL1#5$P$cA$=hA @P , P 0$=AX 8 6P 4 P 8$fW  $!5$P$dAX  à #:P B?Xh 8lADx  ހW  A , X PW ,PPW 0P P`  W  ' ,X8 < $A  $=AX   P, P0W  $=AX  6P , P 0$=AX   P 4 P 8$fW  ' ,A  $=AXH  L P, P0W  $TXh lXf lA' ,A  $=AX   P, P0W  ' ,A  $=AX   )P, P0W  ' ,A  $=AX   /P, P0W  XH  LP 0T 5' ,A  $=AXh  l 6P, P0W  $=AX   <P , P 0$]$`W  x  W  A , X PW ,PPW 0P P`  W  X8  <Ȱ Fҳ $UX Xj lA>' ,A  $=AX   P, P0W  $UXH LXd lA' ,A  $=AXX  \ 
P, P0W  Xh  l0 26 X  Ƞ 0ҫ $= AX   @ /A  XX \Xe l` #:X8  <Ȱ Vҳ #	X  Ȑ FҚ XH LXT \P #:Xh  l0  6 &#	X  Ƞ Bҫ &x  Ȁg A T X $0P9 XC&API TPI \XY TY XC0\' ,nA   ,A$ X T9 LP) `AXi `&P dhA$ X dA$ W   HW  ,X9 X
3P9 XXI TUI \A@  B0pP \y  \	W  P (A L 0X H $1P4 Ȱ P A  ( AX  ,kW  ' ,A  $8 AP, P0W  X DY @#X @P D ] @\ @
A\P DX Ő #5Y$aALX =AP XA LD!6XX $eA&XX \% $ ,A Xh DPe X8 <X @P X $P XH L$PPT Xh lX8 HP6 X X HP <X $@PI DXX  Xh lAPP Ph LW  |X]Xe  lf#;W  dXX $hAf8 LP7 ,0P7 0` PW  $P X LHDR1#4$P Ә ,C0N$8 AP , P 0$=A PP 4 P 8` W  $!8XH L&BPH $=A aP , P 0$=AXX \ 6P 4 P 8$fW  $!8Xh l&dPh $TX8 <Xc lA   P ,ȰP 0$=A kP 4 P 8$dW  $!8X &P $V$`Ad   P ,ȐP 0$=A P 4 P 8$fW  $!9XH LD PH ' ,XA  XP LXP PXh lAP Ph LW  |X LPW ,PPW 0` PW  h P` V#8` F#5$P$jAZ$0P8 X @C0>$=A VP , P 0$eW   W  0X @#4$P XH DC0F$=A QP , P 0$eW   W  0XX DQ#8Xh l&bPh 8 [0 B0,$=A nӱ  Ű  !;$A nӡ  Š  #8X &P H \@ 0#8XX \&XPX h r` B#9X8 <3 P8 X X P Ә PŐ F!5ĠP Ő V!5Ơ P X[ \#9X8 <3  P8 P ' ,HA  X8P LX<P PXh lAW  LX $P x W  P (A 4 X ` #5V$aAX =AP 4X #6XX $fA^X 4X D#9XJ L@ C0XZ \&_Xj HlW  |XmX6  <3#;W  dXX $gAX 4XxX  P DXH 4LXT H\PT <Xh 4lX6 <&1P6 X 4X à C0$X <kAX < XH 4L'P DXX 4\Xe l` C0XX  Xh 4AHX8  X   'P  X 4X <P ,Ȑ P 0X ,P 4X 0P 8XH  Xd  lW  XX  Xe  lX8 4<X <
P <X 4X DXH  XT  \P DC X8  X  X 	##P  X 4XI <LPG ,@ PG 0X ,P 4X 0P 8XX  Xe  lW  Xh 4lX6 <X <
P <X 4X DXJ LP DXX 4\Xe  l` B0&X ,P ,X 0P 0X8  Xc  lW  x eW  P (A L (X ` #5V$aAX =AP X DY @#X @P D[E@ ]H @\ @
A\P DX !6XX $eAfX $@PI XX \% $ ,A Xh DPe X8 <X @P X $P XH L$PPT Xh lX8 HP6 X X HP <X $@PI @XX  Xh lAX LXh lA8PHDR1PX Lh LPg ,`Pg 0` PW  P Ph LW  X LXh lA.0HDR2P8 LX Hð #8$PXh lAȨ LP ,ȠP 0` PW  P Ph LW  W  @x  g A , X X6 @<P8 ,3C0X ,ɰ !ð C0:X X <$@I  XX \Xe <l&aPe <X8 ,&1P8 ,C X X Ð C0*XJ HLPJ <XX \Xe @lVP Xh AXX ,X8 <Xc HlW  X X &P X XI HLPI <XX \$`Pe @X8 <X ð #5$PcA>x  W  P (A 4 X ` #5V$aAX =AP 4X #6XX $fAX  X  XH 4LXT \	##PZ  Xh 4lX6 <0 B0X @X 
X 	!$0 #3A"X ,P ,X 0P 0XH 4XT <\PW 4P PW 8Xh  Xf  lW  X8 4<X  ð B0*X <P ,Ƞ P 0X  Xi  lW  XH  XT  \Xh 4lX6 <<
5P6 <X 4X @X  XI  L
P @`  W  P 8XX 4\Xe lX8  X  kPh D$
$!AvP <C f&P <P @X 4XI <LXX 8\T  P AlXh 4lX6 <<&1P6 <X 4X @&P @X <U @AU DB0P @C NX  XI  L&DPI  XX 4\Xe @lX8  X  
kX 	j!-Xe l` #9X5 @0 #$eAFX  X  ZP Xh 4lAX  XI  L'DPI  X ,P ,X 0P 0XX 4Xe <lPg 4` Pg 8X8  Xc  lW  X 4X  à B0*X <P ,Ȑ P 0XH  Xd  lW  XX  Xe  lX8 4<X <
P <X 4X @XH  XT  \
P @x Āg P (A ,  X ` #5V$aA2X =AP ,X #4x $P X ,X B0jAW  @X 0Xh ,lAN@EOF1PH 0$VXh ,lXf lA' ,A  $=A fP, P0W  8 0P7 ,0P7 0` PW  P Ph 0W  X 0Xh ,lA EOF2P 0Ȩ 0P ,ȠP 0` PW  P Ph 0W  W  @W  @W  d#W  LW  LX ,XI L&API x  πg P (A , X ` #5V$aAX =AP ,X !6XX $eAnW  4X ,$P  x  6en on the tape. If this bit is clear, ISO to EBCDIC
conversions will be performed automatically. 
$b$i .flags&append
$b0 If the .append bit is set, the tape will be positioned after the last
existing file. Further files written to the tape will be appended to the
existing data. If the bit is clear, the tape is left positioned immediately
after the volume label, and any files written will cause the exisiting data
to be destroyed. 
$b$i .flags&hazard
$b0 If this bit is set, the named tape volume must be mounted with a write
enable ring. If the bit is clear, the tape will be mounted without a write
ring (i.e. write protected). 
$b$i .flags&vol$ labels$ only
$b0 If this bit is set, the tape will be treated as 'volume labelled' rather
than standard labelled. File header/trailer labels will not be written or
processed. If the bit is clear, the tape is treated as .ibm standard labelled.
$a indent=0
$b The default case is FLAGS equal to zero.
$n$b$l
OPEN MT IN                                 Find input file.
$l0

   %external %routine %spec OPEN MT IN ( %c
             %integer chan,
            r         v         z         ~                   $       $  *       *  0       0  6       6  <       <  B       B  H       H  N       N  T       T  Z       Z  `       `  f       f  l       l  r       r  x       x  ~       ~                                                                 tdTD4$t                           &      & ,      , 2      2 8  8>      >D  D
J      JP      PV  V\      \b      bh      h"n      n&t      t*z      z.      2      6      :      >      B      F      J      N      R      V      Z      ^      b    d                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |                                                                              Ԁnknown error featuretape     !        g Q      g R*       nknown error featuretape          	not found Tape force-reVolume serial no. wrongFile sequence no. wrongNonzero block countrong  (pRecord length mismatchgBlock size mismatchtchgWrong density code?tchgMultireel dataset!?tchgSpanned records!t!?tchgRecord format mismatchgcal record is written to the tape on channel .chan.
.bytes bytes are written from the user's buffer to the tape. 
$n$b$l
CLOSE MT                       Terminate processing of a file
$l0

   %external %routine %spec CLOSE MT (_i_n_t_e_g_e_r chan)

$b0 The file currently open on channel .chan (if any) is closed. Any open
file must be closed using .close$ mt before another file may be opened on
the same channel. 
$n$b$l
UNLOAD MT                                Terminate processing of a volume
$b2$l0
   %external %routine %spec UNLOAD MT (_i_n_t_e_g_e_r chan)
$b2
The specified channel is disconnected from any volume which may currently
be mounted on it. It is then free to be connected to other volumes via
.load$ mt. The call on .unload$ mt is ignored if the channel is not currently
connected to any volume. .unload$ mt must be called before futher volumes
may be LOADed
on the same channel, otherwise file trailer labels will not be written.
$n$b$l
RELEASE MT                  Return claimed drives to the system
$l0

   %external %routine %spec RELEASE MT (integer chan)

$b0 Channel .chan is returned to the system. It may not be referenced again
unless reclaimed. (Note that a drive cannot be claimed if any drives are
still claimed when the request is made).
$e
 H?   ( (                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    {Specs for IBM tape access procedures}

%external %routine %spec        MOVE (%integer bytes, %name from,to)
%external %routine %spec        MOVE STRING (%string(255) s, %name to)
%external %string(*) %map %spec STRING OF (%integer bytes, %name where)
%external %routine %spec        FILL (%name buffer, %integer fill char, size)
%external %string(*) %map %spec FIELD (%integer width, %string(*)%name source)
%external %predicate %spec      EQUAL (%integer bytes, %name buffer1, buffer2)
%external %integer %fn %spec    STOI (%string(31) s)

%external %routine %spec        CLAIM MT (%integer how many, wait)
%external %routine %spec        LOAD MT (%integer chan, flags, %string(6) vol)
         %const %integer        {FLAGS}   %c
                                ISO = 1,
                                Append = 2,
                                Hazard = 4,
                                Vol labels only = 8
%external %routine %spec        OPEN MT IN (%integer chan,
                                            %string(17) filename,
                                            %integer File no,
                                                     Record length, block size,
                                                     Flags)
%external %routine %spec        OPEN MT OUT(%integer chan,
                                            %string(17) filename,
                                            %integer File no,
                                                     Record length, block size,
                                                     Flags)
         %const %integer        {Flags for OPENMT procedures} %c
                                Variable = 1,
                                Unblocked = 2

%external %routine %spec        READ MT (%integer chan,
                                         %integer %name bytes,
                                         %name buffer)
%external %routine %spec        WRITE MT(%integer chan,
                                         %integer %name bytes,
                                         %name buffer)

%external %routine %spec        CLOSE MT(%integer chan)
%external %routine %spec        UNLOAD MT (%integer chan)
%external %routine %spec        RELEASE MT (%integer which)

%end %of %file
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        %include "SysInc:Command.inc"
%include "TAPE:EBCDIC.inc"
%include "TAPE:IBMprocs.inc"
%include "TAPE:Labels.inc"
%include "TAPE:MTdefs.inc"

%begin
   %external %routine %spec to upper (%string(*)%name s)
   %external %predicate %spec end of input
   %external %integer %fn %spec StoI (%string(31) s)

   %const %integer true = 0,  false = 1

   %const %integer keys = 20
   %const %string(15) %array key(1:keys) =
      "INITIALISE",  "READ",        "WRITE",
      "APPEND",      "HELP",        "ANALYSE",
      "FIXED",       "VARIABLE",    "TRUNCATE",
      "NOTRUNCATE",  "SYNCH",       "NOSYNCH",
      "RECORD",      "BLOCK",       "BLOCKED",
      "UNBLOCKED",   "SPANNED",     "UNSPANNED",
      "LABEL",       "FILE"
   %switch S(1:6)                        {Initialise..analyse: subcommands}

   %own %integer {control flags} %c
      Fixed = true,                      {Fixed-length records}
      Synch char = -1,                   {Default NOSYNCH}
      Record length = 80,
      Block size = 6*80,
      Blocked = true,
      Spanned = false,                   {No spanned records}
      File no = 1

   %own %integer option = 0              {READ, WRITE, APPEND etc}
   %const %integer Stream err = 9        {IMP stream I/O error event no.}
   %const %integer Pack err = 10         {Invalid filename}
   %const %integer MT err = 13           {Error from IBM tapes package}
   %const %integer TTY = 0               {IMP command/report stream no.}
   %own %string(6) tape label = ""
   %string(63) junk, hd, tl

   %routine decode parm
      %string(63)%name p == command_parameter
      %string(63) x, val
      %integer j, k
      %switch C(0:keys)
      To upper (p)
      p = x . val %while p -> x . (" ") . val
      p = p . ","
      %while p -> x . (",") . p %cycle   {Peel off options}
         val = ""
         %if x -> x . ("=") . val %start; %finish
         k = 0
         %for j = 1,1,keys %cycle
            k = j %and %exit %if x = key(j)
         %repeat
         -> C(k)
         C(0): { unrecognised keyword }
               Print string (x)
               Print string ("=".val) %if val # ""
               Print symbol ('?');  newline
               %return

         C(1): {Initialise}
         C(2): {Read}
         C(3): {Write}
         C(4): {Append}
         C(5): {Help}
         C(6): {Analyse}
               %if option # 0 %start
                  Print string (key(option)." and ".x."?")
                  Newline
                  %return
               %finish
               option = k
               %continue

         C(7): {Fixed}
               Fixed = true
               Record length = 80
               %continue
         C(8): {Variable}
               Fixed = false
               Record length = 1024
               %continue

         C(9): {Truncate}
         C(10):{NoTruncate}
               Print string (x." not implemented");  newline
               %continue

         C(11):{Synch}
               Synch char = char no(val,1)
               %continue
         C(12):{No Synch}
               Synch char = -1 {none}
               %continue

         C(13):{Record=n}
               Record length = StoI(val)
               %continue

         C(14):{Block=n}
               Block size = StoI(val)
               %continue
   
         C(15):{Blocked}
               Blocked = true
               %continue
         C(16):{Unblocked}
               Blocked = false
               %continue

         C(17):{Spanned}
               Print string ("*Spanned records not allowed")
               Newline
               %stop
         C(18):{Unspanned}
               Spanned = false
               %continue

         C(19):{LABEL=volname}
               %if length(val) > 6 %start
                  Print string ("*Label more than six characters?")
                  Newline
                  %continue
               %finish
               tape label = val
               %continue

         C(20):{FILE=n}
               file no = StoI(val)
               %continue

      %repeat
   %end

   %routine stop
      Rewind
      Release tape
      %stop
   %end

   {********* Main Program *********}

   %on stream err %start                 {end of input on console stream}
      Stop
   %finish

   -> S(5) %if command_modifier = '?'
   Decode Parm %if command_parameter # ""
   Prompt ("Parm: ")
   %while option = 0 %cycle
      Read (command_parameter)
      Decode parm
   %repeat
   %while tape label = "" %and
      option # 6 {analyse} %cycle
      Prompt ("Label:")
      Read (junk)
      command_parameter = "LABEL=".junk
      Decode parm
   %repeat
   -> S(option)

S(1): {Initialise tape}
      %begin
         %record(label) V                {Volume label}
         Release tape
         Claim tape
         Rewind
         Tape mark;  backspace           {***** FRIG tape hardware *****}
         Fill (V,' ',80)
         V_vol1 = m'VOL1'
         Move string (tape label, V_serial no(1))
         V_R1(1) = '0'
         To EBCDIC (80,V)
         Write tape (addr(V),80)
         Tape mark
         Tape mark
         Rewind
         Stop
      %end

S(2): {Read tape}
      %begin
         %string(255) line
         %string(17) dataset
         %string(31) file
         %integer failed, sym, j, joins = 0

         %on stream err, MT err %start
            %if EVENT_event = MT err %start
               Select output (tty)
               Print string ("*".event_message)
               Newline
            %finish
            {TTY input ended}
            Unload MT (1)
            Release MT (1)
            %stop
         %else
            Claim MT (1,0)
            Load MT (1,0,tape label)
            Prompt ("File: ")
         %finish

         %cycle
            Select input (TTY)
            Read (file)
            To upper (file)
            %if char no(file,1) = '*' %start
               command_parameter = sub string(file,2,length(file))
               %signal stream err %if command_parameter = ""
               Decode parm
               %continue
            %finish
            %begin
               %on stream err, pack err %start     {Open output failed}
                  Print string ("*".Event_message)
                  Newline
                  Failed = true
                  %return
               %finish
               Open output (3,file)
               Failed = false
            %end
            %continue %if failed = true
            j = 0
            j = variable %unless fixed = true
            j = j + unblocked %unless blocked = true
            Open MT in (1,"",File no,record length,block size,j)
            Select output (3)
            %begin
               %integer j
               %on MT err %start         {Assume eof on tape file}
                  %return                {from BEGIN..END}
               %finish
               %cycle
                  j = record length
                  Read MT (1, j, charno(line,1))
                  length(line) = j
                  %if fixed = true %start
                     {guess where end of line is..}
                     %while line#"" %and charno(line,length(line))=' ' %cycle
                        length(line) = length(line) - 1
                     %repeat
                  %finish
                  %if line # "" %and char no(line,length(line)) = synch char %start
                     length(line) = length(line) - 1
                     Print string (line)
                     joins = joins + 1
                  %else
                     Print string (line)
                     Newline
                  %finish
               %repeat
            %end
            Close MT (1)
            Close output
            Select output (TTY)
            %if joins # 0 %start
               Write (joins,0)
               Print string (" join")
               Print symbol ('s') %if joins # 1
               Newline
            %finish
            file no = file no + 1
         %repeat
      %end

S(3): {Write tape}
S(4): {Append to tape}
      %begin
         %string(17) Dataset             {Filename recorded on tape}
         %string(31) file
         %byte %array line(1:256)
         %integer failed, sym, len, line no, j, pend = -1, splits = 0

         %on stream err %start           {Assume EOF on command stram}
            Unload MT (1)
            Release MT (1)
            %stop
         %finish

         Claim MT (1,0)
         Load MT (1,hazard,tape label)
         Prompt ("File: ")
         %cycle
            Select input (tty)
            Read (file)
            To upper (file)
            %if char no(file,1) = '*' %start     {special command}
               file = sub string(file,2,length(file))
               %signal stream err %if file = ""
               Command_parameter = file
               Decode parm
               %continue
            %finish
            %begin
               %on stream err, pack err %start   {Open input failed}
                  Print string ("*".Event_message)
                  Newline
                  Failed = true
                  %return
               %finish
               Open input (3,file)
               Failed = false
            %end
            %continue %if failed = true
            Dataset <- file              {truncate in required}
            j = 0
            j = variable %unless fixed = true
            j = j + unblocked %unless blocked = true
            file no = 999999 %if option = 4 {append?}
            Open MT out (1,dataset,file no,record length,block size,j)
            Select input (3)
            len = 0                      {Current input record length}
            line no = 0
            %while %not end of input %cycle
               Read symbol (sym)
               %if sym = NL %start
                  line no = line no + 1
                  %if len > record length %start
                     Print string ("*Warning: record")
                     Write (line no,1)
                     Print string (" truncated")
                     Newline
                  %finish
                  write MT (1,len,line(1))
                  len = 0
               %else
                  len = len + 1
                  line(len) = sym
                  %if len = record length - 1 %and synch char >= 0 %start
                     splits = splits + 1
                     len = len + 1
                     line(len) = synch char
                     Write MT (1,len,line(1))
                     len = 0
                  %finish
               %finish
            %repeat
            %if splits # 0 %start
               Write (splits,0)
               %if splits = 1 %start
                  Print string (" line was split")
               %else
                  Print string (" lines were split")
               %finish
               Newline
            %finish
            Close MT (1)
            Close input
            file no = file no + 1
         %repeat
      %end

S(5): {Help information}
      Print string ("*Use LAYOUT TAPE:TAPE.LAY")
      Newline
      %stop

S(6): {Analyse tape}
      %begin
         %byte %array B(0:8191)          {Max 8K blocks}
         %record(label) L
         %integer j, number, last

         %routine show (%integer number, size)
            %return %if number = 0
            Write (number, 3+5+17+1)
            Print string (" block")
            Print symbol ('s') %if number # 1
            Print string (" of")
            Write (size,1)
            Print string (" bytes")
            Newline
         %end

         Release tape
         Claim tape
         Rewind
         Read tape (addr(L),80);  to ISO(80,L)   {Volume label}
         %if L_Vol1 # m'VOL1' %start
            Print string ("*Not an IBM tape")
            Newline
            Stop
         %finish
         Print string ("Volume ")
         Print symbol (L_serial no(j)) %for j = 1,1,6
         Newlines (2)
         %cycle
            Read tape (addr(L),80)    {File header label}
            To ISO (80,L)
            %exit %if tape error # 0
            %if L_label1 # m'HDR1' %start
ERR:           Print string ("*Tape protocol error")
               Newline
               Stop
            %finish
            L_label1 = 17             {Fake string length for _FILE}
            Print string ("   File ".string(addr(L_label1)+3))
            Read tape (addr(L),80)
            To ISO (80,L)
            ->ERR %if tape error#0 %or L_label2#m'HDR2'
            write (StoI(string of(5,L_record len(1))),0)
            Print string (" byte ")
            %if L_format = 'F' %start
               Print string ("fixed")
            %else %if L_format = 'V'
               Print string ("variable")
            %else
               Print string ("undefined")
            %finish
            Print string (" length records, ")
            %if L_attrib = ' ' %start
               Print string (" unblocked")
            %else
               %if L_attrib # 'B' %start
                  Print string ("spanned, ")
               %finish
               %if L_attrib # 'S' %start
                  Write (StoI(string of(5,L_block len(1))),0)
                  Print string (" byte blocks")
               %finish
            %finish
            Newline
            Skip forward              {Past header labels}
            number = 0;  last = 0     {Find end of user data}
            %cycle
               Read tape (addr(B(0)),8192)
               %exit %if tape error # 0
               %if bytes transferred # last %start   {change of blocksize}
                  Show (number,last)
                  last = bytes transferred
                  number = 0
               %finish
               number = number + 1
            %repeat
            Show (number,last)
            Skip forward              {Past trailer labels}
         %repeat
         Print string ("**EOT**")
         Newline
         Stop
      %end

%end %of %program
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          C!          x}	k    9 E 0   
  	k      NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    %Qv   #p}SId:w	R]8  ay    "o8@    ;o@    S@    S"Lq+y:w^  &K     &K    !     y8@    :U}   MY    `EY:p  `EYa  qI    }}   w}   |]T`  qT{!\  :\  q_:t    }8!Ir8  xdtq xfՊZwG  |"LpwqI!d        }  qT{"ad}8 r  mfp  !t^Z} y8@       AEIMQUY]aeimquy}   *     ,rm dQ@    ^ed:Q@yd     ox    ox    ox    ox    ox    ox    x    ox    ox    P ,P 0S **EOT** byte blocks 	spanned, 
 unblocked  length records, 	undefinedvariable fixed byte     File  *Tape protocol error Volume *Not an IBM tape  bytes  of block             *Use LAYOUT TAPE:TAPE.LAY lines were split line was split
 truncated *Warning: record *File:                join*File:  *LABEL= Label: Parm:   *Label more than six characters? *Spanned records not allowed  not implemented  and ==  ,    U	:  						
INITIALISEa@e  READIALISEa@e  WRITEALISEa@e  APPENDLISEa@e  HELPNDLISEa@e  ANALYSEISEa@e  FIXEDSEISEa@e  VARIABLESEa@e  TRUNCATESEa@e  
NOTRUNCATEa@e  SYNCHNCATEa@e  NOSYNCHATEa@e  RECORDHATEa@e  BLOCKDHATEa@e  BLOCKEDATEa@e  	UNBLOCKEDEa@e  SPANNEDEDEa@e  	UNSPANNEDEa@e  LABELNNEDEa@e  FILELNNEDEa@e                       L                                                                                                                                                                                                                                     
                        
                                                     X
   
H  !34  1  0 !81 !5$$A> 6#$$A> 6&C  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n?1  34C0  D   D   
C H  !34  1  0 !81 !5$$A> 6$@#0#D   D   &A'1"C H  !34  1  0 !81 !5$$A> 6B  @ !4B ";
C@ !$$A> 6#$$A> 6B  C
B$P#E  E  &Q'1"C s_  eX!34RUUh!34dffз  ӳ  Ű !4Գ #9    !8 !5$$A> 6B$ C08 L  #9&"C  "
  'M  M   >' ("#4\BbD#:  
  nBJ"#<  #M  M  '"DC0  
$#M  M  &'"%ѷ  C $ "ѷ  $$A> 6$A1    0#
#	QD   RD   ?&A'"3    !8 !5$$A> 6"#&!2#C$$A> 6
!  1  #C   C  '1"1I2 !,K2  !
3s3B  #9
3
>!$$A> 6!$$A> 6A> 6GHO  s/ "B
'X=  2 #$$A> 6&r0U> ?P7D   &D"$݀ w Az , .X=pC PI ,d?   W  X9 ,) 0I pA??C0$' , 0A  pAV X) ,A C P ,c  &aSF   c  X9 ,) 0CA??C0<$ p2I pA??#1$0P9 &P Z 0+A!6X P #X Ű B0X .AD 0W   HI pDC0"' ,A  pAV W   H` ?W   <W  ,y X]C0RTZ]' ,A AV  0AV b  &a ?F   b  W   HW  ,C XY P]C  $0P=Ȱ PP C $P@ PM C ' , 0A AV W   HW  ,C Y qP]C %aPmC  pW  P C  pW  PC $PC $1P=C vW   HW  ,$ Av$PC Jө pɠ #/dW   HW  ,C $- pA   # pW  P#C C ll	w Az , W  HW  $ Av 	w Az , #W  W  <W  HW  TW  x ,P ,P 0P P`  W  0VOL1P9 ,' ,A ȹ 0Z|&P,Ȱ P0W  ȩ 8Z@ 0J Y ,PW ,PPW 0` PW  P Pi ,W  W  TW  TW  HA 	w Az , Pz ,C @Xz ,' ,@A XL AV W   HW  ,$0P9`z >$cW   $P`" 9 
 w Az , Pz 0#Xz 0z X P ,9 -P7 ,0 P7 0Z ,$aW  @X ,ҹ ,XMB0(Y ,UC0i , ,
l6  0  !6' ,C ӹ ,C00I ,Y ,
Ed  Um!?'QY , ,W   H$Ql# ,W   HW  ,C J o 
  ',w Az , ]$0P9lPypC rXypXLX  Š B0<$`W   l' ,JA XML AV W   HW  ,$aW  d$aW  p$ AvS$aW  $P$aW  BW   $`W   `Y >PW ,PPW 0W   i >W  i?` *B049>>$"AXp, A < 3!6$ $	AvAtC ArX`!3C $0P9hX#4$1P9hX#4&2P9h' ,A XM PG @X]PW DXihPg HX]$aW  ($cW   lA~$aW  XW   $`W   lXlC0>$PlW   T:W   HX9l0 #8` sW   <W  ,$QC  	" w Az , Pz ,C @Xz ,' ,A XL AV W   HW  ,$0P9 hz  >$cW   x$P h" < 
 w Az , "N(PI dp P	 `%1P9 |$P Py C &Xy $aW  d$aW  p$ Av[$aW  $T$aW   W   $`W   `  >P ,ȠP 0W   i  >W  I ?@ *B0@9 > >$"A) >A Y >U!6$ $	AvXmp&  >A AC AvX h!3C ) , >A $0P9 xX]#4$1P9 xXm#4&2P9 xXŰ !6 B?P' , ,A XM PG @X=P7 DX xP HX]$aW  4$cW   `$@PI pPI tW  B0W   P l 
B0t$QQY tXi pYm C 6W   H$QXi tW   T W   HW  ,X `&P , P 0Y p$aW  L$0P9 pC f$Q pX `Z p  XI pX] EB0DXmB<$Q &API pZI `d  X9 `&1P7 ,0 P7 0Y p$aW  L$P pC X C0@$PjW   TXI @ !9W   H#W   HW  ,$aW  XW   $QQ]C z 	 W  Az , f!4z P W   TW   HX  #8` sW   <W   H$QXj  W   TW   HW  ,C  H
w Az , (NPI 0p  P	 ,W  W  <W  HP Pi 4W   4P ,P 0` PW  X9 40VOL1#?W   HW  ,AW   H$&P Z|ʹ 8k  W   <X Ű B0$bW  8P Pi 4W  ȩ 4P ,ȠP 0` PW  XMXT  #3C FXi 4`HDR1#?pW   HW  ,A ` Pi 4' ,fA  7AV W   HP Pi 4W   4P ,P 0` PW  X=X  !7X 4HDR2#3C pI DZM&APG ,@ PG 0$eW  W  $PaW   T^W   HY 8P F!:XW   HC $P V!9NW   H#DW   H2W   Hi d`  !:&W   HC h` B#8W   H d SC0H9 <Z=&1P7 ,0 P7 0$eW  W  $PaW   TW   HW  ,W  `$P P P  Xi ,W  XXJ  #3C 8X]Xe  Ui C0XY Xi ANXX<  P9 $P $Q C XY Xi A&W  `C |W   HW  ,A	w P (Az , <Px #Xx AXpX< 0 ?!6$.ADӼ #3A\W   XB0(XpI?  PG ,@PG 0W   AlC ]UB0bXm` C0VTW   ?  ,P ,P 0W   ' ,LA  ,AV X=p# A A C X.ADAADAW   HW  ,$ AvAVx  @ 	u	yQ  P AN$9 pAVP , P 0Y $aW  4$0P9 C X C0@$PkW   `X Š !9W   H#W   HW  ,$aW  @W   XM&APMC & 	 W  Ab , X f!4z P W   `W   HX: 0 #8` sW   <W   H$QXj  W   `W   HW  ,z  K
w Ab , )X I ,$0P4 ȰP A|  ) <AW  W  $W  0P Pi DW  x9 DP7 ,0P7 0` PW  X DVOL1#?W   HW  ,AW   H$&P P =dAV Ha  W   <X U AXŠ B0P $bW  8P Pi DW  xI DPG ,@PG 0` PW  X]Xe  lf#3C X9 D<0HDR1#?W   HW  ,AȰ P D' ,A   GAh W   HP Pi DW  xȩ DP ,ȠP 0` PW  XMXT  \U!9Xi Dl`HDR2#3C d$=AV NP , P 0$eW  W  $PaW   `W   H9 H0 F!:W   HC $0 V!9W   H#W   HpW   Hӹ jŰ  !:dW   HC lŰ                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                                                                                                                                                           &      & ,      , 2      2 8    tdTD4$tdT  8                                                                                     D       P                 FILELN  errors)

      Skip forward                       {Past any UHL's}
      chan_open = true
   %end

   %external %routine READ MT (%integer channel, bytes, %name buffer)
      %record(chan fm) %name chan
      %integer j
      %signal MT err, no such drive %if channel # 1
      chan == chan table(channel)
      %signal MT err, not open %unless chan_open = true

      %if chan_left = 0 %start           {refill buffer from tape}
         Read tape (addr(chan_buffer), chan_block                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                                                                                                                                                              $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                                                                                                                                                                             &      & ,    tdTD4$t  ,                                                                                     d       P                 FILELN ELN ELN      Set label 2 (chan,H)
      H_label2 = m'HDR2'
      To EBCDIC (80,H)
      Write tape (addr(H),80)

      Tape mark
   %end

   %routine flush out (%record(chan fm)%name chan)
      %if chan_used # 0 %start
         %if chan_Vflags&ISO = 0 %start
            To EBCDIC (chan_used, chan_buffer)
         %finish
         Write tape (addr(chan_buffer), chan_used)
         chan_block count = chan_block count + 1
      %finish
      chan_bp == byte integer(addr(chan_buffer))
      chan_used = 0
   %end

   %external %routine WRITE MT (%integer channel, bytes, %name buffer)
      %record(chan fm)%name chan
      %integer j
      %signal MT err, no such drive %if channel # 1
      chan == chan table(channel)
      %signal MT err, not open %unless chan_open = true
      chan_count = chan_count + 1
      bytes = chan_reclen %if bytes > chan_reclen
      Flush out(chan) %if chan_used+chan_reclen > chan_block size
      Move (bytes, buffer, chan_bp)
      chan_bp == chan_bp ++ bytes
      chan_used = chan_used + bytes
      %for j = 1,1, chan_reclen-bytes %cycle   {Pad out record?}
         chan_bp = ' '
         chan_bp == chan_bp ++ 1
         chan_used = chan_used + 1
      %repeat
   %end

   %external %routine CLOSE MT (%integer channel)
      %record(chan fm)%name chan
      %record(label) L
      %signal MT err, no such drive %if channel # 1
      chan == chan table(channel)
      %return %unless chan_open = true
      chan_open = false
      %if chan_output = true %start
         Flush out (chan)                {Last (or only) data block ->
         Tape mark

         Set label 1 (chan,L)            {write trailer labels
         L_label1 = m'EOF1'
         Move string (ItoS(chan_block count,6), L_Blocks(1))
         To EBCDIC (80,L)
         Write tape (addr(L),80)

         Set label 2 (chan,L)
         L_label2 = m'EOF2'
         To EBCDIC (80,L)
         Write tape (addr(L),80)

         Tape mark;  tape mark           {**EOT**}
         Backspace                       {Next file will scrub last TM}
      %else
         Skip forward                    {past end of user file}
         Skip forward                    {Past trailer labels}
      %finish
   %end

   %external %routine UNLOAD MT (%integer channel)
      %record(chan fm)%name chan
      %signal MT err, no such drive %if channel # 1
      chan == chan table(channel)
      %signal MT err, chan open %if chan_open = true
      Rewind
      chan_free = true
   %end

%end %of %file
 H?    >                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
{IBM magtape label formats
{All labels are 80 bytes, EBCDIC

   %record %format label (               {VOLUME label}   %c
           %integer      vol1,           {m'VOL1', EBCDIC}
           %bytearray    serial no(1:6),
                         R1(1:1),        {Rn: reserved fields}
                         VTOC(1:10),     {ignored for tape volumes}
                         R2(1:20),
                         Owner(1:10),    {volume owner ID}
                         R3(1:29)        %c
      %or  %integer      Label1,         {HDR1/EOV1/EOF1}
           %byte %array  File(1:17),     {"data set identifier"}
                         File serial(1:6),   {Vol ID of vol. holding this file}
                         Vol seq(1:4),   {Volume no. within multi vol. set}
                         File seq(1:4),  {File seq no. within current volume}
                         Gen(1:4),       {Generation number}
                         Version(1:2),
                         Created(1:6),   { byyddd, b=blank, ddd=001-366 }
                         Expires(1:6),
           %byte         Lock,           {'0':no prot, '1','3':passwords}
           %byte %array  Blocks(1:6),    {File block count}
                         System(1:13),   {Name of system which wrote tape}
                         R4(1:7)         %c
      %or  %integer      Label2,         {HDR2/EOV2/EOF2 labels}
           %byte         Format,         {F(ixed),V(ariable),U(ndef) records}
           %byte %array  Block len(1:5),
                         Record len(1:5),
           %byte         Density,        { 0: 7-track/200 9-track/ -    } %c
                                         { 1:        /556        / -    } %c
                                         { 2:        /800        /800(NRZI)} %c
                                         { 3:        / -         /1600(PE) } %c
                                         { 4:        / -         /6250(GCR)} %c
                         DSP,            {Data set position (multi-reel only) }
           %byte %array  Job ID(1:17),   {who wrote this tape?}
                         How(1:2),       {Tape recording conventions}
           %byte         Control,        {Control characters in dataset?}
                         R5,
                         Attrib,         {"B": Blocked records}   %c
                                         {"S": Spanned records}   %c
                                         {"R": Blocked & Spanned} %c
                                         {" ": No Blocked or spanned recs!} %c
           %byte %array  R6(1:8),
           %byte         Checkpoint,
           %byte %array  R7(1:32)        %c
      %or  %integer      User label,     {ha ha}
           %byte %array  R8(1:76))

%end %of %file
 H?    <                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %recordformat parmfm(%shortinteger dsno, dact, ssno, sact, %C
                     %integer p1, p2, p3, p4, p5, p6)
%externalinteger tape error = 0
%externalinteger bytes transferred
%externalinteger TM = 0

   %externalroutine claim tape
      %record(parmfm) p
      p_dact = 1;  svc(105, p)
      tape error = p_p6
   %end
   %externalroutine release tape
      %record(parmfm) p
      p_dact = 10;  p_p1 = 3;  svc(105, p)
      p_dact = 2;  svc(105, p)
   %end
   %integerfn function(%integer n)
      %record(parmfm) p
      p_dact = 10;  p_p1 = n;  svc(105, p)
      %result = p_p6
   %end
   %externalroutine rewind
      tape error = function(3)
   %end
   %externalroutine tape mark
      tape error = function(2)
   %end
   %externalroutine skip forward
      tape error = function(4)
   %end
   %externalroutine skip reverse
      tape error = function(5)
   %end
   %externalroutine read tape(%integer buffer, size)
      %record(parmfm) p
      p_dact = 8;  p_p2 = buffer;  p_p4 = size
      svc(105, p)
      P_p3 = P_p3 - 1 %if P_p3 # size;     !system horror
      bytes transferred = P_p3
      tape error = p_p6
      tape error = tape error!128 %if p_p4 # 0;      !tape mark
      TM = P_p4
   %end
   %externalroutine write tape(%integer buffer, size)
      %record(parmfm) p
      p_dact = 9;  p_p2 = buffer;  p_p4 = size
      svc(105, p)
      tape error = p_p6
   %end
   %externalroutine clear
      tape error = function(1)
   %end
   %externalroutine backspace
      tape error = function(6)
   %end

%endoffile
 H?    C                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!           }     Z `   A w      }8 r    |"Lpw          :\   $ qT{"ad * q_:t     0 }8!Ir8   6xdtq  <'xfՊZw B<qI!d   Hw}   N	     TG  NWfS    X`QK xgQK fZJ_fZX!t^Z} }    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  (QT    :      "Z        b!     b!    "a    a     a     a     a     "b  A A A A    ,b       2a     5a    dQ@    \"Zh}8 r  l|"Lpwp   :\   ,d    	qT{"adȄ ,d    	(_   W   ,d    q_:t     }8!Ir8   xdtq  xfՊZw qI!d   &Z  xB@ ,d    }   &Z  xB@ ,d    	     G   
   ?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nGHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$  w P (A  , X $1@8 .r ,  iq ,X HPhx  w P (A  , X $:@8 .$CPH 4r ,  iq ,$R@X .r ,  iq ,x  %g A  , X $:@8 .Ph 4r ,  iq ,X Hx  w P (A  , X $cAPhx  w P (A  , X $bAPhx  w P (A  , X $dAVPhx  w P (A  , X $eA,Phx  W  P (A  , X $8@8 .Ph 8PX @r ,  iq ,X <U  #4'P <PlX HPhX @#5Ơ PhPpx  ;W  P (A  , X $9@8 .Ph 8PX @r ,  iq ,X HPhx  #w P (A  , X $aAFPhx  w P (A  , X $fAPhx           `         d         h         l         p         t $       $ x *       * | 0       0  6       6  <       <  B       B  H       H  N       N  T       T  Z       Z  `       `  f       f  l       l  r       r  x       x  ~       ~                                                                          H?   ) )'                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     H?    H                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %external %routine %spec claim tape
%external %routine %spec rewind
%external %routine %spec tape mark
%external %routine %spec skip forward
%external %routine %spec skip reverse
%external %routine %spec backspace
%external %integer %spec bytes transferred  {Set by READ, WRITE}
%external %routine %spec read tape (%integer buffer,bytes)
%external %integer %spec TM                 {Tape mark hit on read?}
%external %routine %spec writetape (%integer buffer,bytes)
%external %routine %spec release tape
%external %integer %spec tape error
%end %of %file
 H?    Q                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %begin
   %include "sysinc:command.inc"
   %record(parmfm) P
   P_p1 = Command_modifier - '!' + 1
   SVC (37,P)
%endofprogram
 H?    T                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!       
      }                       NWfS    X`QK xgQK fZJ_fZX!t^Z} }    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  (QT    :      "Z    %Qv   
      w P (p LXpX< ȳP 4r ,  %q ,x                                       $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                  H?    V                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %include "SysInc:Command.inc"
%include "IBM:EBCDIC.inc"
%include "IBM:MTdefs.inc"

%begin
   %external %routine %spec to upper (%string(*)%name s)
   %external %predicate %spec end of input
   %external %integer %fn %spec StoI (%string(31) s)

   %const %integer true = 0,  false = 1

   %const %integer keys = 10
   %const %string(15) %array key(1:keys) =
      "ANALYSE",
      "READ",
      "WRITE",
      "WIDTH",
      "ISO",
      "LIMIT",
      "FILE",
      "BLOCK",
      "EBCDIC",
      "ISO"
   %switch S(1:3)

   %own %integer option = 0              {READ, WRITE, APPEND etc}
   %own %integer ISO tape = false        {Tape assumed EBCDIC by default}
   %own %integer width = 132             {Page width for dump output}
   %own %integer limit = 80              {Default bytes dumped/block by ANALYSE}
   %own %integer file no = 1             {Position within tape}
   %own %integer block size = 2048       {Default}
   %own %integer convert = false         {ISO:EBCDIC conversions?}
   %const %integer Stream err = 9        {IMP stream I/O error event no.}
   %const %integer Pack err = 10         {Invalid filename}
   %const %integer MT err = 13           {Error from IBM tapes package}
   %const %integer new option = 14       {DECODEPARM wants to change options}
   %const %integer TTY = 0               {IMP command/report stream no.}
   %routine %spec stop                   {Wind down tape & quit}

   %routine decode parm
      %string(63)%name p == command_parameter
      %string(63) x, val
      %integer j, k
      %switch C(0:keys)
      %if command_modifier = '?' {PTAPE?} %or p -> ("HELP") %start
         Print string ("*LAYOUT IBM:TAPES.LAY for information")
         Newline
         Stop
      %finish
      p = p . ","
      %while p -> x . (",") . p %cycle   {Peel off options}
         val = ""
         %if x -> x . ("=") . val %start; %finish
         k = 0
         %for j = 1,1,keys %cycle
            k = j %and %exit %if x = key(j)
         %repeat
         -> C(k)
         C(0): { unrecognised keyword }
               Print string (x)
               Print string ("=".val) %if val # ""
               Print symbol ('?');  newline
               %return

         C(1): {ANALYSE}
         C(2): {READ}
         C(3): {WRITE}
               %if option # 0 %start
                  Print string (key(option)." and ".x."?")
                  Newline
                  %signal new option
               %finish
               option = k
               %continue

         C(4): {WIDTH=characters}
               width = StoI(val)
               %continue

         C(5): {ISO}
               ISO tape = true
               %continue

         C(6): {LIMIT=n}
               limit = StoI(val)         {max no. of chars in block ANALYSE}
               %continue

         C(7): {FILE=n}
               file no = StoI(val)
               %continue

         C(8): {BLOCK=n}
               block size = StoI(val)
               %if block size < 18 %start
                  block size = 18
                  Print string ("*Block size set to 18 bytes (minimum)")
                  Newline
               %finish
               %continue

         C(9): {EBCDIC}
               convert = true
               %continue

         C(10):{ISO}
               convert = false
               %continue

      %repeat
   %end

   %routine get tape
      %cycle
         Claim tape
         %exit %if tape error = 0
         Release tape
         Print string ("*Warning: tape force-released")
         Newline
      %repeat
      Rewind
   %end

   %routine stop
      Rewind
      Release tape
      %stop
   %end

   %routine find (%integer f)
      {F is a file number.  FILE NO (global) is the file no. we
      {are currently at within the tape (one at beginning of tape).
      {Physical files are separated by tape marks. 
      %byte %array junk(1:20)
      %if f <= 1 %start
         Rewind
         file no = 1
         %return
      %finish
      %while file no < f %cycle
         skip forward
         file no = file no + 1
      %repeat
      %while file no > f %cycle
         skip reverse                    {back past last TM}
         skip reverse                    {back over prev file}
         read tape (addr(junk(1)),20)    {move over TM at start of file}
         file no = file no - 1
      %repeat
   %end

   {********* Main Program *********}

   %on %event MT err, stream err, new option %start
      %if event_event = stream err %start
         Stop
      %finish
      %if event_event = MT err %start
         Print string ("**Magtape error ")
         Write (tape error,1)
         stop
      %finish
      -> S(option)
   %finish

   Prompt ("Parm: ")
   Decode parm %if command_parameter # ""
   %while option = 0 %cycle
      Read (command_parameter)
      To upper (command_parameter)
      Decode parm
   %repeat
   -> S(option)

S(1): {*********** ANALYSE ***********}

      %begin
         %external %routine %spec TEMP LIBRARY (%string(31) filename)
         %external %routine %spec DUMP BLOCK   %c
            (%name from, %integer bytes, page width, flags)
         %const %integer {FLAGS masks} %c
            Hex = 1<<1, ASCII = 1<<3, EBCDIC = 1<<6
         %const %integer max block = 8000
         %byte %array B(1:max block)
         %integer after TM = true        {Frig to force dump of block #1}
         %integer number, size           {Count up groups of blocks}
         %integer j, flags

         %routine show (%integer number, size)
            %if number # 0 %start
               Write (number,4)
               Print string (" block")
               Print symbol ('s') %unless number = 1
               Print string (" of")
               Write (size,1)
               Print string (" bytes")
               Newline
            %finish
         %end

         Temp library ("IBM:DUMPER")
         Get tape
         number = 0;  size = 0
         %cycle
            Read tape (addr(B(1)),max block)
            %if bytes transferred # size %start   {New group}
               Show (number, size)
               size = bytes transferred
               number = 0
            %finish
            number = number + 1
            %signal MT err %if tape error&(~128) # 0   {mask out TM flag}
            %if TM # 0 %start
               number = 0                {suppress SHOW for tapemarks}
               Print string ("Tape mark")
               Newline
               %exit %if after TM = true {two consecutive tapemarks?}
               after TM = true
            %else
               %if after TM = true %or command_modifier = '!' %start
                  j = bytes transferred
                  j = limit %if j > limit
                  flags = hex+ASCII
                  flags = flags+EBCDIC %if convert = true
                  Dump block (B(1), j, width, flags)
               %finish
               after TM = false
            %finish
         %repeat
         Show (number,size)
         Stop
      %end

S(2): {************* READ *************}

      %begin
         %const %integer max block = 8000
         %byte %array B(1:max block)
         %integer failed, j
         %string(31) file
         Get tape
         Prompt ("File: ")
         %cycle
            Read (file)
            To upper (file)
            %if char no(file,1) = '*' %start
               file = sub string(file,2,length(file))
               Stop %if file = ""
               command_parameter = file
               Decode parm
               %continue
            %finish
            %begin
               %on * %start
                  Print string ("*".event_message)
                  Newline
                  failed = true
                  %return
               %finish
               Open output (3,file)
               failed = false
            %end
            Find (file no)
            Select output (3)
            %cycle
               Read tape (addr(B(1)), max block)
               To ISO (bytes transferred,B(1)) %if convert = true
               %exit %if TM # 0
               Print symbol (B(j)) %for j = 1,1,bytes transferred
            %repeat
            Close output
            file no = file no + 1
         %repeat
      %end

S(3): {************** WRITE ***************}

      %begin
         %const %integer max block = 8000
         %byte %array B(1:max block)
         %integer len, j
         %string(31) file
         %integer {Bool} failed = false
         %integer eof
         Get tape
         %cycle
            Prompt ("File: ")
            Select input (tty)
            Read (file)
            To upper (file)
            %if char no(file,1) = '*' %start
               file = sub string(file,2,length(file))
               %exit %if file = ""
               Decode parm
               %continue
            %finish
            Find (file no)
            Tape mark;  backspace        {For grotty tape hardware}
            %begin
               %on * %start
                  Print string ("*".event_message)
                  Newline
                  failed = true
                  %return
               %finish
               Open input (3,file)
               failed = false
            %end
            %continue %if failed = true
            Prompt ("Text: ")
            Select input (3)
            %cycle
               B(j) = 0 %for j = 1,1,18  {Min tape block is 18: padded with 0's}
               eof = false
               %begin                    {Read up to one tape block from file}
                  %integer j
                  %on stream err %start {end of file?}
                     eof = true
                     %return
                  %finish
                  %for j = 1,1,block size %cycle
                     Read symbol (B(j))
                     len = j
                  %repeat
               %end
               len = 18 %if len < 18
               To EBCDIC (len,B(1)) %if convert = true
               Write tape (addr(B(1)),len)
            %repeat %until eof = true
            Tape mark;  tape mark        {**eot**}
            Backspace                    {next file overwrites last mark}
            file no = file no + 1
         %repeat
      %end

%end %of %program
 H?    [                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!       `  OJ}     D      
        NWfS    X`QK xgQK fZJ_fZX!t^Z} }    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  (QT    :      "Z    %Qv   ]8  ay    "o8@    ;o@    :\  q_:t    }8!Ir8  xdtq xfՊZwG  |"LpwqI!d        }  qT{"ad}8 r  mfp  !t^Z} y8@    }eQthUd\^C  -/    (!   B a! a a  e     C! C a C! C! C!     # a # a " A .     p" A    A     {!      $! a  a b    !     A    ! a         '! p  A A  b ! a    a A  a  b A  A !   !   a b a    "# A   a A B J  AA A     *!   a b a   :"  a ba a   "# b B     A B A J   A a KaA   A !   a a B  B  A  A A  A AN A   dQ@    \"Zh%Qv   |"Lpw  (}8 r   ^ed:Q@Ð ,d    0    p   >   D   ,}8@   yd      &      %   	x     ZZ  xB@ ox     DD"$Q@   HZZ LxB@ P>   T'a. ox     ox     D%Ḱ H>   L&@ ox     ox     ,>   	ox     DK   H>   L&@ l%Ḱ p!   ox    ``T:d;G}8@  h,~@lLu;`p&!to<U  x&Z}    'Text:  *File:  *File:  	Tape mark
IBM:DUMPER  bytes  of block Parm:  **Magtape error  *Warning: tape force-released%*Block size set to 18 bytes (minimum)? and ==  ,,%*LAYOUT IBM:TAPES.LAY for informationHELP    
*/:Ecg  fhjANALYSEMFN    READYSEMFN    WRITESEMFN    WIDTHSEMFN    ISOTHSEMFN    LIMITSEMFN    FILETSEMFN    BLOCKSEMFN    EBCDICEMFN    ISODICEMFN             
   
   o?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nH  !34  1  0 !81 !5$$A> #$$A> &C ?1  &134C0  D   D   
C H  !34  1  0 !81 !5$$A> B  @ !4B ";
C@ !$$A> #$$A> B  C
B$P#E  E  &Q'1"C s_  eX!34RUUh!34dffз  ӳ  Ű !4Գ #9    !8 !5$$A> B$ C08 L  #9&"C  "
  'M  M   >' ("#4\BbD#:  
  nBJ"#<  #M  M  '"DC0  
$#M  M  &'"%ѷ  C $ "ѷ  $$A> $A1    0#
#	QD   RD   ?&A'"3    !8 !5$$A> "#&!2#C$$A> 
!  1  #C   C  '1"X# Y !Y !&\ Z  B!$$A> З  $1$H  H X [ &B0P  [ ,&' ?P  
*&30H  P  ї  C Kї  $$A> 
Y  #%$$A> 
qPr  PB &(pX  ?$PS?PE   &T 41I2 !,K2  !
3s3B  #9
3
>!$$A> !$$A> A> ?$$A> "#:  ! ?$$A> ?$$A> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$> w A< , 0X X=p<C PI ,XS \P ?#:4$ BA  #?W   HW  ,ArXi ,&A$ ?X9 ,) 0CA??C0$ҹ p2I pA??#1$P Z&QPY PY =XAP  0X) A!6Xi Pi #XY UY A2P 
B0P X . A 0W   H9 p3C0$' ,A   pA$ W   H` ?W   <W  ,y X`C0P=XA' ,A A$  0A$ A$ W   HW  ,$ $AX P`C  pW  LPhC $PdC x pW  LPlC b pW  LPpC L pW  LPt C  PtW   HW  ,#	$@PMx#$QP]x#C y 3	w A< , X W  X=0X  !3C &W  W   HW  ,C W  y  5	w A< , X W  W  $ A 	g A< , X I ,$1P4 Ȱ P A8  ) <A` !,W  $Ppy XMpYI #W  X]p&QP]p"XmpYi C <W  W  $9 <AP aW  X=p'1P=pC y  a	W  A< , X fC0h$TW   `|W   HX: 0 #8` sW   <xW   H$QXj  W   `pW   HW  ,z  E
w A< , X I ,$1P4 Ȱ@P A8  ) <A$PPY DdW  |A$0P9 HP9 L$9 <AP@aW  XX  U LC0"XY LXi HAXMXT  \PY L$`Pi HX9 H&1P9 HX0X  à#6$ $AXMXT  \UC02$0P9 HZW   HW  ,Xi D!3C $`Pi DC Xi D#=X=p<X Ű !B0^XX:  <P9 PY=l#%X=lP9 P$P TXx!5Ȼ @P T$9 <AP , P 0P 4X]hXi PW  $API DC XY LXi HAAy  ؀	w A< , X Pz ,C FXz ,' ,PA  X=d< A$ W   HW  ,$P Dz  L$cW   $API Dz  @ 
Low A< , X I ,$1P4 Ȱ@P A8  ) <AARW     LP ,ȠP 0W   i  LW  4I M@ *B0B9 L L$"A) LA  Y LU!3AXmpl&  LA  ?AC AXmpA$cW   x$9 <AP@aW  X=xB0,$9 <AP , P 0XXk  lW  XXJ  LD#3C bX]Xe  lPi p$0$!AP9 HC .&1P9 HP9 l9 <Aa  W   <X9 HU9 lA2U9 pB0P lC <W   Xp&PpC  ߀	w A< , X Pz ,C FXz ,' ,FA  X=d< A$ W   HW  ,$P lz  L$cW   $API lz  @ 
kw A< , X Pz 0#	Xz 0$0P9 pz XMtPJ 8$0$!AP: ,C H&1P: ,P: 49 <AP <W   X <   A
XJ ,LPI D4U: 4A2U: 8B0P 4z  T 
 w A< , X I ,$1P4 Ȱ@P A8  ) <A$QPY lAHW   $`W   li  LPg ,`Pg 0W   i  LW  49 M0 *B0,9 L L$"A) LA  ӹ L!3C &AC XmpAW  W  AX9 l!3C >W   $cW   l$&P HP t9 <A$ҡ  X HU tA2Ű B0P t$API pAX9 D<0 #0 P9 DXxB0$$9 <AP , P 0Xi DW  t$9 <AXY D\aW  X p#3C RW  W  W  XMp&APMpC dy  	w P (A< , X Px ,C lXx ,X=d<X  Ű 	!3ADXdX  Ő B0*W   H$QXM0Xd  lW   `AX`.:AW   X]p\e f#3AX=`B0@Xp?  P ,ȠP 0W   Xpi?  W  4AC .:AAA0Ax  @b ,$PPY X=0 !4$QPY ' , ,A  XP @XP DPW H$QeW  $cW   l$@PI PI W  B0W   P | 
B0$9 pAVP , P 0Y $aW  4XY \Y]C :W   H$QXi lW   `W   HW  ,Xi l&aPi $0P9 C (X &P 9 pAVX |ҡ  à ANC ($aW  @W   C $aW  L$aW  X$ AJU 	 !%W  Ab , X f!4z P W   `^W   HX: 0 #8` sW   <ZW   H$QXj  W   `RW   HW  ,z  K
w Ab , )X I ,$0P4 ȰP A|  ) <AW  W  $W  0P Pi DW  l9 DP7 ,0P7 0` PW  X DVOL1#?@W   HW  ,A88W   H$&P P =dAV Ha  W   <X U AXŠ B0P $bW  8P Pi DW  lI DPG ,@PG 0` PW  X]Xe  lf#3C X9 D<0HDR1#?"W   HW  ,AnȰ P D' ,A   GAh W   HP Pi DW  lȩ DP ,ȠP 0                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                                                                                                                                                          $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                                                                                                                                                                 &    4             P           & >      > D      L@ B0"XV H\PW ,P  PW 0cW  Xh lXV @\Xf HlW  X8 <X &P X X HP <XH L$PPT @x  [W  P (A 4 X ` #6$ $$AX=AP 4XA LD#6$ $$AXXQ \&QPQ Xh  X8 4<X 	k##P  X @
X 	#$cAX ,P ,X 0P 0XH 4XT <\PW 4P PW 8Xh  W  Xh 4lX6 <<Z8  P6 <X 4X @Z  P @X 4XI L[H  PH @$P$!AvPX 8C Z&QPX 8PX <Xh 4lX6 <<Ȱ  ҳ  X 4X <&P <XH 4LXT @\&Q                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                                                                                                                                                                             &      & ,    tdTD4$t  ,                                                                               $d              ~   P             NOLABL  H?    q                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    set tab=3+3+3+3+3+3+3+3+17,tabs,page=22,width=0,time=10000000
lib mtdefs
lib IBMprocs
lib EBCDIC
lib dumper
let pu=purge
let f=files
let t=c
let e=ecce:ecce
let v=ecce:edit
let z=syscom:clear200
exit
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        %begin;      !tapeanal
   %include "sysinc:command.inc"
   %externalintegerfnspec ETOI(%integer s)
   %string(15) Param
   %record(parmfm) p
   %owninteger error, dumping, tm, size, number, flag
   %byteintegerarray b(0:8000)
   %integer j,s
   %routine print out
      %return %if number = 0
      write(number, 4)
      printstring(" block")
      printsymbol('s') %unless number = 1
      printstring(" of")
      write(size, 1)
      printstring(" bytes")
      newline
      number = 0;  size = 0
   %end
   %routine claim tape
      %record(parmfm) p
      p_dact = 1;  svc(105, p)
      error = p_p6
   %end
   %routine release tape
      %record(parmfm) p
      p_dact = 10;  p_p1 = 3;  svc(105, p)
      p_dact = 2;  svc(105, p)
   %end
   %integerfn function(%integer n)
      %record(parmfm) p
      p_dact = 10;  p_p1 = n;  svc(105, p)
      %result = p_p6
   %end
   %routine rewind
      error = function(3)
   %end
   %routine skip forward
      error = function(4)
   %end
   %routine clear
      error = function(1)
   %end
   %routine backspace
      error = function(6)
   %end
   %routine read(%integer n)
      p_p2 = addr(b(0))
      p_p4 = n
      p_dact = 8
      svc(105, p)
   %end
   %routine dump block(%integer size)
      %integer j, s
      %routine hex(%integer p)
         %integer j, s
         %routine xs(%integer s)
            %if s > 9 %then s = s-10+'A' %else s = s+'0'
            printsymbol(s)
         %end
         %for j = p, 1, p+15 %cycle
            space %if p&3 = 0
            s = b(j)
            s = 0 %if j > size
            xs(s>>4&15);  xs(s&15)
         %repeat
      %end
      %routine syms(%integer p)
         %integer j,s
         %for j = p, 1, p+15 %cycle
            s = b(j)
            s = ETOI(s) %if flag < 0
            s = ' ' %unless ' ' <= S <= 126
            printsymbol(s)
         %repeat
      %end
      %for j = 0, 16, 256-16 %cycle
         newline
         spaces(10)
         hex(j)
         printstring(" |")
         syms(j)
      %repeat %until j >= size-15
      newline
      flag = 0 %if command_modifier = 0
   %end
   printstring("Tapeanal V3");  newline
   param = command_parameter
   %for j = 1,1,length(param) %cycle
      s = charno(param, j)
      charno(param, j) = s+32 %if 'A' <= s <= 'Z'
   %repeat
   %if param = "" %start
      dumping = 0
   %else %if param = "ascii"
      dumping = 1
   %else %if param = "ebcdic"
      dumping = -1
   %else
      printstring("Unknown keyword ".param." ASCII assumed")
      newline
      dumping = 1
   %finish
   claim tape
   rewind
   tm = 0
   size = 0;  number = 0;  flag = dumping
   %cycle
      read(8000)
      %if p_p4 # 0 %start;      !tm
         print out
         printstring("Tape mark");  newline
         %exit %if tm # 0
         tm = 1
         flag = dumping
         %continue
      %finish
      tm = 0
      %if p_p6 # 0 %start
         printstring("Error");  write(p_p6, 0);  newline
         %exit
      %finish
      j = p_p3-1
      dump block(j) %if flag # 0
      print out %if j # size
      size = j;  number = number+1
   %repeat
   newline
   release tape
%endofprogram
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        $a escape='/'; just=1; top=8; bottom=8; line=60; page=50
/a left=10; tab=4,10,16,22,28,34
/n
/b20/lmc
MOUSES Magnetic Tape Utilities
/b
/lm
A.D. Culloch
/b20/l2
                                        PSS Document 19.02
                                        27-JUL-81
/n
/a escape='$'
$a cap='@'; capsh='.'; und='_'
$b$lmu
Tape Utilities
$b2
In the first instance .mouses will provide two standard magnetic tape
utilities.  .ptape
(for reading and writing unlabelled tapes) and .ibmtape (for processing .ibm
standard labelled tapes).  In general, use of .ibmtape is recommended for
import/export of data to other sites.
 $p In the description which follows,
punctuation and upper case words are compulsory and lower case indicates a
user supplied parameter.
Compulsory words may be entered in either upper or lower case.
All the tape commands assume that the operator has already mounted the
appropriate tape in the drive.
 $p Both the .ptape program and the .ibmtape program require a parameter
string to be supplied in the command line used to invoke them.
Using the .read or .write options, the user is subsequently prompted for
the names of files to be transferred to or from tape. Parameter information
may still be changed by entering a pseudo-filename whose first character is
an asterisk "*". The remainder is assumed to be an option-setting parameter
(e.g. *EBCDIC to ask for character set translation, see below).
 $p The .ptape program is invoked by a command of the form:
 $v6$l0

               Command: PTAPE(parm)

$b0 "Parm"
consists in general of several options separated by commans. The most
important options are:
$b$v6$l0

   ANALYSE- List the contents of an unlabelled tape,
            indicating tape marks and data.
   READ  -  Copy physical files from tape (to disc or 
            other device)
   WRITE -  Copy files from disc to tape
   APPEND-  As for write, but copied files are added to the
            end of an existing tape, rather than replacing
            existing data.
   HELP  -  Online command summary.  (Also produced by
            the command PTAPE?)
$b
If "parm" is omitted, .ptape will prompt the user to enter it.
The .ptape program will prompt the user to supply the names of files to
be read or written.
These should be entered one to a line. (The prompt will be reissued after
the previous file has been processed).
Enter standard .mouses file or device names.
When all files have been transferred, the end of the list of files is marked
either by signalling end of file (enter CTRL+D on the console), or by
entering the pseudo-filename "*". For example:
$v6$l0

               Command: Ptape(read)
               File: fred
               File: second
               File: *file=5,EBCDIC
               File: fifth
               File: *
               Command: Ptape(write)
               File: BigFile.imp
               File: []
               Command:

$b0 (Note CTRL+D echoes as "[]" on the console).
.ptape
reads and writes tapes formatted as
a series of physical
files separated by tape marks. The final file on the tape is terminated by
two tape marks to indicate logical end of tape. 
 $p The physical files  read or written by .ptape are not interpreted
(as 'records', 'lines' etc), they are simply streams of 8-bit bytes.
Since the maximum size of a data block on the tape is limited, these
streams (which may be very large) must be broken up into separate
physical  %data %blocks. The size of these blocks is 2K$ bytes by
default, but other sizes may be specified in the parameter to .ptape as
shown:
 $v6$l0

               Command: PTAPE(parm,BLOCK=n)

$b0 As before, "parm" is one of "HELP", "READ", "WRITE", "APPEND" etc. "N" is
the size in bytes of the data blocks on the tape.
This must be between four bytes and 2048 bytes.
On output, blocks of exactly this size are written, though the last (or only)
block may be less than the stated size, since the file being written may not
be an integral multiple of the block size in length.
For input, the blocks in the file may be of any size. The bytes they contain
are concatenated into a .mouses file.
$p There are further parameter options available to the user. These allow
for ISO/EBCDIC character set conversion, reading or writing only selected
files on a tape and controlling the format of .analyse output. 
The "parm" string consists of a list of options separated by commas.
The form of the individual options is as follows:
$a indent=1
$b2$v6$i0 ISO
$b0$i0 EBCDIC
$b In the default (ISO) case, no character set conversion is performed as
tapes are read or written. Bytes are transferred to or from store with no
interference from the system. If the .ebcdic option is requested, then on
output bytes are converted from the .iso character set (used internally
by .mouses for storing text) to the .ebcdic character set used by .ibm
systems. On input, bytes are converted from an .ebcdic code to the
corresponding .iso code for the same character. 
$b$v6$i0 FILE=n
$b This parameter selects the file which is to be read or written on the
tape. If there are K files on a tape, separated by tape marks, they are
referred by by numbers in the range 1..K. The value of "n" should be in the
range 1..K. Note that on output, if file "n" is written then .file .n+1
.and .all .succeeding .files .are .erased due to the nature of the tape
medium.
The value of "n" is one by default, although if the .append option is being
used then the setting fo .file is ignored.
$b$v6$i0 WIDTH=n
This limits the width of the listing produced by the .analyse option to "n"
columns.
The value of "n" is 132 by default, suitable for most line printers.
By default, .analyse output is produced on the operator's console.
To direct the output to any other file or device, the program is invoked as:
$b$i2 PTAPE(parm) /file
$b$v6$i0 LIMIT=n
$b By defualt, only the first eighty bytes of any tape block are dumped during
a tape analysis. The limit may be altered using this option.
$n
$b$lmu
IBM Standard Labelled Tapes
$b2
The .ibmtape utility may be used to process standard .ibm labelled tapes.
These may have volume labels and file header/trailer labels (standard) or
volume labels only (volume labelled). 
The general form of the .ibmtape command is:
$v6$l0

               Command: IBMTAPE(parm)

$b0 "Parm" is a parameter string describing the operation to be performed.
The tape is assumed to be a standard labelled IBM tape
and file header/trailer labels will be written or checked as appropriate.
 $p "Parm" may be any of the following 
$a indent=1
$v6$l0

$v6$i0INITIALISE- $b0
 The scratch tape in the drive is initialised as
                        an .ibm standard labelled tape.  ANY DATA PRESENTLY
                        ON THE TAPE IS DESTROYED BY THIS OPERATION.
                        The "parm" should also contain the tape label to be
                        written.   (The user will be prompted with 
                        "Label:" if none is supplied in the parameter string).
$b$i3
                               IBMTAPE(INITIALISE,LABEL=label)
$b
                        "Label" is a character string.
                        It will be padded
                        on the right with blanks if it is less
                        than six characters long, but will be rejected if
                        it is longer.

$b$v6$i0 ANALYSE $b0
A summary of the contents of the tape is written
                        on output stream one, the console by default. To
                        send output to a file or device use:
$b$i3
                                 IBMTAPE(ANALYSE) /file
$b
$v6$i0 READ $b0 
Copy files from the tape to a disc file or device. 
The tape .label parameter must be specified as for .initialise,
and must match the label recorded on the tape.
$b$v6$i0 WRITE $b0 
Copy files from a disc file or device to tape.
The tape .label parameter must be specified as for .read,
and must match the label recorded on the tape.
$b$v6$i0 APPEND $b0 
.append is equivalent to .write except that the files are written %after
any existing files on the tape. The first file output to a tape by .write
will destroy any existing files recorded after that file position.
The tape label parameter must be supplied as for .write.
$b$v6$i0 HELP $b0 
Online command summary.
$a indent=0
$b4$v10$b2$lum
Block and record structures
$b2
The READ, WRITE and APPEND commands are concerned with copying .mouses 
text files to or from tape.
.mouses text files are represented as byte streams, line boundaries
being indicated by embedded NL (newline) characters in the file. 
However, .ibm systems
treat such files as arrays of records (either padded out to a fixed
length or separated by system-managed pointers). By default therefore, 
files are %converted between the two formats automatically. (The character
set encoding is also converted, .mouses using the .iso 7-bit character set
internally, .ibm systems using the .ebcdic 8-bit character set). To perform
this conversion, the .ibmtape program must be informed of the file and
record structures required on the tape. (Fixed or varying length records,
blocked or unblocked etc). This information is passed in the "parm" string.
"Parm" in fact has the general format: $b$l
               Opt1, opt2, opt3, ..., Opt N
$b The options are independent and may be specified in any order. 
The allowable options are listed below, the defaults being:
$b$v5$l
     IBMTAPE(FIXED,BLOCKED,RECORD=80,BLOCK=480,UNSPANNED)
$v6$b
$a indent=2
$b$i0 FIXED $b0
Records are fixed length. On output to tape, lines from the .mouses file
will be padded out on the right with blanks to fill a record, on input 
trailing blanks will be deleted. On output,
if a line exceeds the stated record length
a warning message will be generated and the line will be truncated
(but see SYNCH below).
$b$v10$i0 VARIABLE $b0
Records are of variable length, up to the maximum specified by the RECORD=
option.
$b$v10$i0 FILE=n $b0
"N" is an integer between one and the number of files on the tape, which
specifies which file is to be read or written. On output, all existing files
past the nth will be lost. Other files are unaffected  by input.
$b$v10$i0 RECORD=n $b0
This option specifies the record length to be used. (For VARIABLE
records this is a maximum length). "N" is the record size in bytes.
The default record length is 80 bytes (card image format)
for fixed records and 1024 bytes for variable length records.
$b$v10$i0 BLOCK=n $b0
The size of data block used to record files on the tape is determined by this
parameter. The default block size is 480 bytes.
The maximum size allowed is 2048 bytes.
The last (or only) block of
a file may be shorter than this. For VARIABLE records, the block size is
a maximum size. (Blocks are of variable length).
$b$v10$i0 BLOCKED $b0
$i0 UNBLOCKED $b0
This option controls the blocking of logical records into physical blocks
during transfer to or from tape. With .unblocked tapes, each logical record
is read or written as a single data block and the BLOCK= parameter is
ignored. BLOCKED tapes may have multiple logical records packed into
physical data blocks on the tape. (The maximum blocking factor being
determined by the BLOCK= parameter setting). 
.blocked records are the default.
$b$v10$i0 SPANNED $b0
$i0 UNSPANNED $b0
Not implemented.
(I.e. UNSPANNED is forced).
$n$b$lum
IBM tape accessing procedures
$a indent=0
$p2
The .ibmtape utility is written using a package of .imp-77 %external
procedures, which may be called directly from privileged user programs.
The interface to this package is described below. Seven procedures are
provided,
all of which refer to 'tape channels'. A tape volume is connected to a 
channel (a number in the range 0-31) by the LOAD$ MT routine. All further
reference to the volume is by channel number. Currently only channel one
is supported.
$a indent=1
$b$v6$i0 CLAIM MT
$b0 To avoid deadlocks where multiple
                                         drives are involved, all drives to
                                         be used are claimed simultaneously.
$b$v6$i0             LOAD MT
$b0                       LOAD specifies a tape volume to be
                                         mounted on a particular drive.
$b$v6$i0             OPEN MT IN,  OPEN MT OUT     
$b0 These procedures locate the file on
                                         a tape which is to be accessed,
                                         either by name or relative position.
$b$v6$i0             READ MT,  WRITE MT           
$b0 Transfer logical records to or from
                                         the open tape file. 
$b$v6$i0             CLOSE MT                     
$b0 Terminate operations on a tape file.
$b$v6$i0             UNLOAD MT
$b0                     Free a tape channel for use with
                                         another volume.

$b$v6$i0             RELEASE MT
$b0                    Selected channels are returned to the
                                         system. (And may not be reclaimed
                                         later).
$a indent=0
$n$b$l
Error signals generated by the procedures.
$b2
$l0

      Signal   Source              Meaning

   13,1,chan   Any      CHAN is not a valid tape channel number.

   13,3        LOADMT   The tape has an incorrect VOL1 label.

   13,4        LOADMT   Tape volume label does not match user-supplied label
                        in the parameter list of LOADMT.

   13,5,chan   OPENMTIN
               OPENMTOUT
               LOADMT   Channel CHAN has not been UNLOADed (LOADMT), or has
                        not been CLOSEd (Open MT).

   13,6        READMT
               WRITEMT  Channel CHAN had not been OPENed.

   13,7        READMT   End of file detected on input file.

   13,8        OPENMTIN End of tape detected.

   13,9        OPENMTIN
               CLOSEMT  Invalid tape label detected on input.

   13,10       Any      Unimplemented feature.
$b3$v10$b$l
CLAIM MT                       Allocate channels to a process.
$b2$i %external %routine %spec CLAIM MT (_i_n_t_e_g_e_r N, WAIT)
$b2
This procedure allocates "N" tape drives to the process. If fewer than "N"
drives are available, then the request is either queued (WAIT not equal to
zero), or causes an error signal (WAIT equal to zero). 
After a successful call on CLAIM$ MT, channels one to N will be available
to the program (for connexion to volumes etc).
CLAIM$ MT may not be called when a process currently has tapes allocated to
it.
$a indent=0
$b3$v10$b$l
LOAD MT                                  Connect volumes to channels.
$b2$il0
 %external %routine %spec LOAD$ MT (   %c
                          _i_n_t_e_g_e_r chan, flags, _s_t_r_i_n_g(6) volume)
$b2
.chan is the channel to be connected to the named .volume. The .volume
name is a string. Strings shorter than six characters are padded on the
right with blanks before being compared with the volume label on the tape.
.flags is a bit mask specifying various options. The bits are given symbolic
names in the .imp-77 %include file containing the %specs for the .ibm tape
procedures as follows.
$a indent=2
$b$i .flags&iso
$b0 If this bit is set, no character set translation is performed on blocks
being read and written on the tape. If this bit is clear, ISO to EBCDIC
conversions will be performed automatically. 
$b$i .flags&append
$b0 If the .append bit is set, the tape will be positioned after the last
existing file. Further files written to the tape will be appended to the
existing data. If the bit is clear, the tape is left positioned immediately
after the volume label, and any files written will cause the exisiting data
to be destroyed. 
$b$i .flags&hazard
$b0 If this bit is set, the named tape volume must be mounted with a write
enable ring. If the bit is clear, the tape will be mounted without a write
ring (i.e. write protected). 
$a indent=0
$b The default case is FLAGS equal to zero.
$b3$v10$b$l
OPEN MT IN                                 Find input file.
$l0

   %external %routine %spec OPEN MT IN ( %c
             %integer chan,
             _s_t_r_i_n_g(17) filename,
             %integer file no,
                      Record length, Block size,
                      Flags)

$b
 $p If FILE$ NO is
positive the file is located by relative position on the tape. 
(File$ 1 is the file at the current position, file$ 2 the next and so on).
The .filename string must match the label on the file found in this way.
(The null string will match any filename). 
A negative or zero FILE$ NO is treated as a one.
 $p The .record$ length and .block$ size parameters
respectively determine the size of
user logical records and physical data
blocks expected
on the tape. (These are maximum sizes in the case of 
.variable record length files). 
 $p The .flags parameter is a bit mask indicating the file organisation expected.
The bits are named symbolically in the .imp-77 %include file containing the
%specs for the .ibm tape procedures as follows.
$a indent=2
$b$i .flags&variable
$b0 With this bit set, variable length logical records are read
from the tape. If the bit is clear, fixed length records (of size
.record$ length) are read.
$b$i .flags&unblocked
$b0 If .unblocked input is requested (bit is set), each logical record
read by .read$ mt will comprise a single data block on the tape. 
Blocked input (bit clear) causes input logical records to be unbuffered
from physical blocks of .block$ size bytes. 
$a indent=0
$b3$v10$b$l
OPEN MT OUT                     Prepare to write output file.
$l0

   %external %routine %spec OPEN MT OUT ( %c
             %integer chan,
             _s_t_r_i_n_g(17) filename,
             %integer File no, 
                      Record length, Block size,
                      Flags)

$b
.fileno determines the position within the tape of the file to be written.
All files after the indicated file on the tape will be destroyed.
 $p The .record$ length and .block$ size parameters
respectively determine the size of
user logical records and the size of physical data
blocks to be written
on the tape. (These are maximum sizes in the case of 
.variable record length files). 
 $p The .flags parameter is a bit mask indicating the file 
organisation required.
The bits are named symbolically in the .imp-77 %include file containing the
%specs for the .ibm tape procedures as follows.
$a indent=2
$b$i .flags&variable
$b0 With this bit set, variable length logical records are written
to the tape. If the bit is clear, fixed length records (of size
.record$ length) are written.
$b$i .flags&unblocked
$b0 If .unblocked output is requested (bit is set), each logical record
written by .write$ mt will comprise a single data block on the tape. 
Blocked output (bit clear) causes output logical records to be buffered
up into physical blocks of .block$ size bytes. 
$a indent=0
$b3$v10$b$l
READ MT                        Read a logical record from tape
$l0

   %external %routine %spec READ MT (_i_n_t_e_g_e_r chan,
                                   %integer %name bytes,
                                   %name buffer)

$b
The next logical record is copied from the tape
on channel .chan to the .buffer. The
specified number of .bytes are tranferred. .bytes may be less than the
record length quoted in the .open$ in$ mt call, in which case the first
.bytes of the record
are copied, but may not exceed the stated record length.
Upon return from .read$ mt, the value of .bytes will always be the length
of the record on the tape. (Useful for processing variable length records).
$b3$v10$b$l
WRITE MT                       Write a logical record to tape
$l0

   %external %routine %spec WRITE MT (_i_n_t_e_g_e_r chan,
                                    %integer %name bytes,
                                    %name buffer)

$b
The next logical record is written to the tape on channel .chan.
.bytes bytes are written from the user's buffer to the tape. 
If .fixed length records were specified and .bytes is less than the
record length given in the .open$ mt$ out call, the record will be padded
on the right with blanks to fill the required length.
On return, BYTES will be the length of the record transferred.
$b3$v10$b$l
CLOSE MT                       Terminate processing of a file
$l0

   %external %routine %spec CLOSE MT (_i_n_t_e_g_e_r chan)

$b0 The file currently open on channel .chan (if any) is closed. Any open
file must be closed using .close$ mt before another file may be opened on
the same channel. 
The call on CLOSE$ MT is ignored if there is no open file on the specified
channel.
$b3$v10$b$l
UNLOAD MT                      Terminate processing of a volume
$b2$l0
   %external %routine %spec UNLOAD MT (_i_n_t_e_g_e_r chan)
$b2
The specified channel is disconnected from any volume which may currently
be mounted on it. It is then free to be connected to other volumes via
.load$ mt. The call on .unload$ mt is ignored if the channel is not currently
connected to any volume. .unload$ mt must be called before futher volumes
may be LOADed
on the same channel, otherwise file trailer labels will not be written.
$b3$v10$b$l
RELEASE MT                  Return claimed drives to the system
$l0

   %external %routine %spec RELEASE MT (integer chan)

$b0 Channel .chan is returned to the system. It may not be referenced again
unless reclaimed. (Note that a drive cannot be claimed if any drives are
still claimed when the request is made).
$e
 H?   * *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!             }                        NWfS    X`QK xgQK fZJ_fZX!t^Z} }    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  (QT    :      "Z    Ud\^C      b"   dQ@    \"Z 	ox     D>   HD   
    C?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nX# Y !Y !&\ Z  B!$$A> З  $1$H  H X [ &B0P  [ ,&' ?P  
*&30H  P  ї  C Kї  $$A> 
Y  #%$$A> 
qPr  PB &(pX  ?$PS?PE   &T 4?$$A> ?$$A> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$  w P (A , X H ,$0P4 Ȱ P A   ( <AL%Q&QPX DPX L8 <A Q  P AXX DUX LAP B0P L$8 <A P , P 0$jPg 4P P` W  hx  U                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                      H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCD
EFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghi
jklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./
0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRST
UVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxy
z{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?
@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcd
efghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*
+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNO
PQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrst
uvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:
;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%
&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJ
KLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmno
pqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./012345
6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ
[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ 
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDE
FGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij
klmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0
123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTU
VWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz
{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@
ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcde
fghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+
,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOP
QRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstu
vwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;
<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`
abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&
'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJK
LMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnop
qrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456
789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[
\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !
"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEF
GHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijk
lmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./01
23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUV
WXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{
|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@A
BCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdef
ghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,
-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQ
RSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuv
wxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<
=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a
bcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'
()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKL
MNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopq
rstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./01234567
89:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\
]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"
#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFG
HIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijkl
mnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./012
3456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW
XYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|
}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@AB
CDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefg
hijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-
./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQR
STUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvw
xyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=
>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ab
cdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'(
)*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLM
NOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqr
stuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./012345678
9:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]
^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#
$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH
IJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklm
nopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123
456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX
YZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}
~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABC
DEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefgh
ijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-.
/0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRS
TUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwx
yz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>
?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abc
defghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()
*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN
OPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrs
tuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789
:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^
_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$
%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHI
JKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmn
opqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./01234
56789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXY
Z[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCD
EFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghi
jklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./
0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRST
UVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxy
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        %begin
   !Generate a test file easy to check by eye after passing
   !through corrupting influences (e.g. E.R.C.C. network).
   %integer lines, width, col, lines printed, sym
   Prompt ("Test lines: ")
   %if next symbol = NL %then lines = 100 %c
   %else read (lines)
   Prompt ("Line width: ")
   skip symbol
   %if next symbol = NL %then width = 62  %c
   %else read (width)
   lines printed = 0
   col = 0
   %cycle
      %for sym = ' ', 1, 126 %cycle
         col = col + 1
         Print symbol (sym)
         %if col = width %start
            Newline
            lines printed = lines printed + 1
            %stop %if lines printed = lines
            col = 0
         %finish
      %repeat
   %repeat
%endofprogram
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          C!             }            #            NWfS    X`QK xgQK fZJ_fZX!t^Z} }    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  (QT    :      "Z        d B  B a B   a  a b   dQ@    \"Z 	ox     ,Lv"8 0,~@ 4$   8Lv"Hq}́ <z   Line width:  Test lines:  
    *?$$A>    ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
nA> ?$$A> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$  w P (A  , X W   W   $ 
!60 dP8 ,#ȸ ,P ,Ȱ AP 0W   W   W   0W   $ 
!6Ƞ >P 0#Ș 0P ,Ȑ AP 0W   $@PH 8PH 4P &QPX <PX @Xh 4l&aPh 4eW   <X8 4<X 0;B04W  ,X 8&P 8X ,!6$ A $@PH 4XX <UX @A P ~B0~P @C r                                      $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                             H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Ptape(analyse,EBCDIC,Width=80,limit=480) /t:!
exit
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ! file compare program (with profuse apologies to H.M. Dewar esq.)

%begin
%include "Sysinc:command.inc"
%externalroutinespec CPU LIMIT(%integer n)
%owninteger  max=8;          !  minimum acceptable lookahead
%constinteger  linemax=127;  !  maximum line length
%constinteger  astream=1, bstream=2;      !  input streams
%constinteger  out=1;        !  output stream
%constinteger  skip=0;       !  set non-zero to skip blank lines
                             !  (but then line numbers are incorrect)

%owninteger  abase=0, bbase=0, acount=0, bcount=0
%integer  anum, bnum, aline, bline
%integer  aeof, beof
%integer  mismatch

%begin;            ! set 'max' to use all available store
%constinteger  spare=512
%integer  lim
   lim = (free space - spare)//(2*(line max + 1))
   %if lim < max %start
      print string("* More store required")
      newline
      %stop
   %finish
   max = max << 1 %while max <= lim
   max = max >> 1
%end

%string(127)%array  aa,bb(0:max-1)

%string(*)%map a(%integer  i)
   %result == aa((abase+i)&(max-1))
%end

%string(*)%map b(%integer  i)
   %result == bb((bbase+i)&(max-1))
%end

%routine  replenish(%string(*)%map  x(%INTEGER N), %integername  xline,  %c
                          %integer n, %integername count, eof)
   %integer  i,j,k,last
   %string(*)%name  p
   %on 9 %start
      eof = 1;  %return
   %finish
   %for i = max-n+1, 1, max  %cycle
      p == x(i)
      %cycle
         last = 0;  j = 0
         %return %if eof # 0
         %cycle
            read symbol(k)
            j = j+1;  charno(p,j) = k
            %exit %if k = nl %or j = linemax
            last = j %if k # ' '
         %repeat
         read symbol(k) %while k # nl;  ! ...skip any remaining chars
         xline = xline + 1;    ! ...within-file line no.
         %exit %if last # 0 %or skip = 0;  ! ...blank line?
      %repeat
      length(p) = last+1;  charno(p,last+1) = nl
      count = count+1;   ! ...within-buffer line count
   %repeat
%end


%routine  PRINT(%string(*)%map  X(%integer N),
                %integer  XBASE, N,
                %string(*)%name  ID)
   %integer  i
   PRINT STRING("** ");  printstring(id)
   PRINT STRING(" at line");  WRITE(XBASE+1,1)
   newline
   %return %if n <= 0
   %for I = 1,1,n %cycle
      %if i=n %then printstring("  ") %else printstring(" |")
      print string(x(i))
   %repeat
%end

%predicate  same(%integer  al, bl)
   %if al > acount %or bl > bcount %start
      %true %if al > acount %and bl > bcount
      %false
   %finish
   %true %if a(al) = b(bl)
   %false
%end


%routine  find match(%integername  an, bn)
   %integer i,j
   %for i = 1,1,max %cycle
      an=i %and bn=i %and %return %if same(i,i)
      %if i # 1 %start
         %for j = 1,1,i-1 %cycle
            an=i %and bn=j %and %return %if same(i,j)
            an=j %and bn=i %and %return %if same(j,i)
         %repeat
      %finish
   %repeat
   an = max+1;  bn = max+1
%end


!    ------- it all starts here --------
   cpu limit(10000)
   select output(out)
   anum = max;  bnum = max
   aline = 0;  bline = 0
   aeof = 0;  beof = 0
   mismatch = 0
   %cycle
      select input(a stream);  replenish(a,aline,anum,acount,aeof)
      select input(b stream);  replenish(b,bline,bnum,bcount,beof)
      %exit %if acount<=0 %and bcount<=0
      find match(anum,bnum)
      %if anum # 1 %or bnum # 1 %start
         mismatch = mismatch + 1
         print(a,abase,anum,command_in1)
         print(b,bbase,bnum,command_in2)
         newline
      %finish
      abase = abase+anum;  acount = acount-anum
      bbase = bbase+bnum;  bcount = bcount-bnum
   %repeat

   newline
   print string("  Complete -")
   %if mismatch = 0 %start
      print string(" Files identical (")
      write(aline,0);  print string(" lines)")
   %else
      write(mismatch,1);  print string(" mismatch")
      print string("es") %if mismatch # 1
   %finish
   newline

%endofprogram
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         @?   @.hf~    Ha      Ha:    Z\      Z\:    Z\   Sbf     Sbf:   Sbf   	l     	l:;    
g\B    Uf~  G    Uf~:P    Uf~S     w  U     w:Z      p    :   `{XG   9"@_       9fd     m:   #     mK     mK:     KG                                                                                                                                                                                        C!          	   }       	  $   	        NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    %Qv   ULu;`        ! % ) E S ] dQ@    ox    @            qXK;@  fZ    v@    &	}  ox    Aes 	 mismatch lines) Files identical (   Complete -  |     at line ** * More store required             @
   D  $A1    0#
#	QD   RD   ?&A'"3З  $1$H  H X [ &B0P  [ ,&' ?P  
*&30H  P  ї  C Kї  $$A>  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n
Y  #%$$A> 
qPr  PB &(pX  ?$PS?PE   &T 4A> GHO  s/ "B
'X=  2 #$$A> &r0U> ?P7D   &D"$X   $$A>   w A , A1 #0 0 P9 ,Y=xC"W   HW  ,$ A~XxY ,!%
Px"Pxy  8	g A , X=|
6XMx'A47Z8 X   y  	g A , X=
6XMx'A47Z8 `   y  	W  A 8 Py L#Xy LX 4$1P<  y XMxEX=xP9 PPI 8C &API 8dW  X) ,т  A P H$P DP <X 4XJ  #3C W   P @$QQY <Xi HZi <  X @ 
#6X9 <0 !2#  #3P9 DC X @Ű 
#9W   P @"X $AQJ  XY D!3$`!2#C pX H&Q\  X9 D&1Z9 H$ҳ  X 0$AQJ  XI 8UI PB0 C    	 _iW  A 4 W   HX 0W   HW   HXi &a$QW   TW  ,X  !$y P 8$0P9 4C P&1P9 4U9  !9W   H#W   HXi 4W  X) ,т  A W   HX9 4U9 8B0C  j	W  A , Ym!$Y]#-Ym#(Y]#%%y $"AlXi  P ,AP 0X ,X) 0A  !4%C $C  2	W  A , X=xP9 4$@PI ,C &API ,TdAnC0XY Xi ,Pe  X  X9 ,P<  y X ,Ű C0t'P 8$P 0C \&P 0ZXi ,A #?XI XY ,PT  Xi  X 0P  C XY ,Xi 0A#?X9 X 0P  X  XI ,PJ  C X 0U 8B0XI ,UI 4B0DXY Xmx&aPe  X  X=x&1P<  C N 	w P (A , :AH H$P X=x'1P4 A *  ( XA@A@`'W  l$aW   lXxP ,P 0$0P8 4P8 8P8 <P8 @P8 D$aW   `Ј hȸ hP ,ȭP 0Ș <P 4XX ,h 4A$bW   `Ј H PG ,]PW 0h @Pg 4XX 0h 8AX!&X=!#C X 0h ,AX ,Ű !7X 0Š C0b$Q DЈ H PG ,X]he   Pg 0[Xm|A"Ј  P ,X=h  @P 0XX 0XmAZW  ,X ,Q|XPXH 0QMX]TP]C W  ,W   HXh DB00W   H$PXh 4W   TW   HC 2$QW   TW   HX D #8W   HW  ,x                                           	           
                                                                                                                                                              ,     $          0             <           H     ,     T           `           l           x     ,       AX l` &AC  Uw P (( ,A A" l #X !A  ? ,AP tX l` 'Atx  %w P (( ,A A" l #X !A  ? ,AzP t$1P8 xX l` ,A$x  (w P (( ,A A" l #X !A  ? ,A*P t$0P8 xX l` ,Ax  (w P (( ,A A" l X !A  ? ,AQ`	Alx  "w P (( ,A A" l X !A  ? ,AzQ`	A(x  "w P (( ,A A" l 0X !A  ?$0P8 l( ,A" ?$@&APH pPH 8 ,( xCA??AA P tB"P                                      $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                              #$ $	A8x  g P (p ,$EAfx  w P (( ,A<p,H   #7$FAfx $ $$A8  H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        A
AARDVARK
ABANDON
ABANDONED
ABBREVIATED
ABILITY
ABLE
ABNORMAL
ABNORMALLY
ABORT
ABORTED
ABORTING
ABOUND
ABOUT
ABOVE
ABSENCE
ABSOLUTE
ABSORB
ABSTRACT
ABSTRACTION
ABUSE
ACCEPT
ACCEPTABLE
ACCEPTED
ACCEPTS
ACCESS
ACCESSED
ACCESSES
ACCESSIBILITY
ACCESSIBLE
ACCESSING
ACCIDENTAL
ACCIDENTALLY
ACCOMMODATE
ACCOMPLISHED
ACCORDING
ACCORDINGLY
ACCOUNT
ACCOUNTED
ACCUMULATED
ACCUMULATOR
ACCUMULATORS
ACCURATE
ACHIEVE
ACHIEVED
ACKNOWLEDGES
ACROSS
ACT
ACTION
ACTIONS
ACTIVATE
ACTIVATED
ACTIVE
ACTIVITIES
ACTIVITY
ACTS
ACTUAL
ACTUALLY
ADAPT
ADAPTIVE
ADD
ADDED
ADDING
ADDITION
ADDITIONAL
ADDITIONALLY
ADDRESS
ADDRESSABILITY
ADDRESSABLE
ADDRESSED
ADDRESSES
ADDRESSABILITY
ADDRESSABLE
ADDRESSING
ADDS
ADEQUATE
ADJUST
ADOPTED
ADOPTS
ADVANCE
ADVANCES
ADVANCING
ADVANTAGE
ADVANTAGEOUS
ADVANTAGES
ADVERSE
ADVISABLE
AFFAIRS
AFFECT
AFFECTED
AFFECTING
AFTER
AGAIN
AGAINST
AHEAD
AID
AIM
AIMS
ALARMING
ALERT
ALGOL
ALGORITHM
ALGORITHMS
ALIGNMENT
ALL
ALLEVIATED
ALLOCATE
ALLOCATED
ALLOCATES
ALLOCATING
ALLOCATION
ALLOW
ALLOWANCE
ALLOWED
ALLOWS
ALMOST
ALONE
ALONG
ALPHABETIC
ALPHABETICAL
ALPHABETICS
ALREADY
ALSO
ALTER
ALTERATIONS
ALTERED
ALTERING
ALTERNATE
ALTERNATIVE
ALTERNATIVELY
ALTERS
ALTHOUGH
ALTOGETHER
ALTRUISTIC
ALWAYS
AMBIGUITY
AMELIORATED
AMENDED
AMENDING
AMONG
AMONGST
AMOUNT
AMOUNTS
AN
ANALOGOUS
ANALYSE
ANALYSED
ANALYSER
ANALYSIS
AND
ANGLE
ANNOUNCE
ANNOUNCES
ANNOYING
ANONYMOUS
ANOTHER
ANSWER
ANSWERED
ANY
ANYONE
ANYTHING
ANYWAY
ANYWHERE
APPARENT
APPARENTLY
APPEAR
APPEARANCE
APPEARED
APPEARING
APPEARS
APPEND
APPENDED
APPENDING
APPENDIX
APPENDS
APPLICATIONS
APPLIED
APPLIES
APPLY
APPLYING
APPRECIABLY
APPRECIATE
APPRECIATION
APPROACH
APPROPRIATE
APPROPRIATELY
APPROXIMATELY
APRIL
ARBITRARILY
ARBITRARY
ARCHITECTURE
ARCHITECTURES
ARCHIVE
ARCHIVED
ARCHIVING
ARE
AREA
AREAS
ARGUMENT
ARGUMENTS
ARISE
ARISES
ARITHMETIC
ARMS
AROSE
AROUND
ARRANGEMENT
ARRAY
ARRAYS
ARRIVAL
ARROW
ART
AS
ASCII
ASIDE
ASK
ASKED
ASKING
ASKS
ASPECTS
ASSEMBLE
ASSEMBLED
ASSEMBLER
ASSEMBLY
ASSEMBLY-LANGUAGE
ASSIGN
ASSIGNED
ASSIGNING
ASSIGNMENT
ASSIGNMENTS
ASSISTANCE
ASSOCIATE
ASSOCIATED
ASSOCIATING
ASSOCIATIONS
ASSUME
ASSUMED
ASSUMES
ASSUMING
ASSUMPTION
ASSUMPTIONS
ASTERISK
ASYNCHRONOUS
AT
ATLAS
ATTACH
ATTACHED
ATTEMPT
ATTEMPTED
ATTEMPTING
ATTEMPTS
ATTENTION
ATTRACT
ATTRIBUTES
AUDIBLE
AUGUST
AUTHORISED
AUTHORS
AUTO-RESTART
AUTOCODE
AUTOMATIC
AUTOMATICALLY
AUTUMN
AVAILABILITY
AVAILABLE
AVERAGE
AVOID
AVOIDED
AWARE
AWAY
AWKWARD
BACK
BACKGROUND
BACKING
BACKLOG
BACKSPACE
BACKSPACING
BACKUP
BACKWARD
BACKWARDS
BADLY
BANNER
BAR
BARE
BARRED
BASE
BASED
BASES
BASIC
BASIS
BATCH
BATCHING
BAUD
BE
BEAR
BEARING
BEAT
BECAUSE
BECOME
BECOMES
BECOMING
BEEN
BEFORE
BEGIN
BEGINNING
BEHAVE
BEHAVED
BEHAVING
BEHAVIOUR
BEHIND
BEING
BEINGS
BELL
BELONG
BELONGING
BELONGS
BELOW
BENEATH
BENEFIT
BENEFITS
BEST
BETTER
BETTER-BEHAVED
BETWEEN
BEYOND
BILLION
BINARY
BINDING
BIT
BITS
BLANK
BLANKED
BLANKS
BLOCK
BLOCK-STRUCTURE
BLOCK-STRUCTURED
BLOCKED
BLOCKS
BLOWN
BODY
BOOK
BOOKLETS
BOOLEAN
BOOTED
BOOTSTRAP
BOOTSTRAPPED
BOOTSTRAPPING
BORDER
BORNE
BOTH
BOTTOM
BOUND
BOUNDARIES
BOUNDARY
BOUNDS
BRACES
BRACKET
BRACKETED
BRACKETS
BRANCH
BRANCHES
BREAK
BREAKING-UP
BREAKS
BRIEF
BRIEFCASE
BRIEFLY
BROADCAST
BROUGHT
BROWN
BUFFER
BUFFERED
BUFFERING
BUFFERS
BUILD
BUILDING-IN
BUILDS
BUILT
BUILT-IN
BULKY
BUSY
BUT
BUTTON
BY
BYE
BYTE
BYTEINTEGER
BYTES
CABLE
CALCULATE
CALCULATIONS
CALL
CALLED
CALLER
CALLING
CALLS
CAN
CANCEL
CANCELS
CANNOT
CANONICAL
CAPABILITIES
CAPABLE
CAPACITY
CAPITALS
CARD
CARDS
CARE
CAREFUL
CAREFULLY
CARRIAGE
CARRIED
CARRY
CARRYING
CARTRIDGE
CASE
CASES
CASUAL
CATALOGUE
CATCH
CATEGORIES
CATEGORY
CAUGHT
CAUSE
CAUSED
CAUSES
CAUSING
CAUTION
CAVEAT
CEASES
CELL
CENTRAL
CENTRALISED
CERTAIN
CERTAINLY
CHAIN
CHAINED
CHAINING
CHAIR
CHANCE
CHANCES
CHANGE
CHANGED
CHANGES
CHANGING
CHANNEL
CHANNELS
CHAPTER
CHARACTER
CHARACTERISTIC
CHARACTERISTICS
CHARACTERS
CHARGE
CHEAP
CHECK
CHECKED
CHECKING
CHECKS
CHIEF
CHOICE
CHOICES
CHOOSE
CHOOSES
CHOOSING
CHOSEN
CHRISTMAS
CHUNK
CHUNKS
CLAIM
CLAIMED
CLAIMING
CLASS
CLASSES
CLASSIFICATION
CLAUSE
CLAUSES
CLEAN
CLEAR
CLEARED
CLEARLY
CLOCK
CLOSE
CLOSED
CLOSELY
CLOSER
CLOSES
CLOSING
COALESCE
COBOL
CODE
CODE-GENERATION
CODE-GENERATOR
CODE-GENERATORS
CODE-SHARING
CODES
CODING
COFFEE
COLD
COLLATED
COLLECTING
COLLECTION
COLON
COLUMN
COLUMNS
COMBINED
COMBINING
COME
COMES
COMFORTABLE
COMING
COMMA
COMMAND
COMMANDS
COMMAS
COMMENCES
COMMENTS
COMMON
COMMONLY
COMMUNICATE
COMMUNICATED
COMMUNICATING
COMMUNICATION
COMMUNICATIONS
COMPACT
COMPACTED
COMPACTION
COMPACTS
COMPARE
COMPARED
COMPARES
COMPARING
COMPARISON
COMPATIBLE
COMPETE
COMPETING
COMPILATION
COMPILATIONS
COMPILE
COMPILE-TIME
COMPILED
COMPILER
COMPILER-COMPILERS
COMPILER-GENERATED
COMPILERS
COMPILING
COMPLEMENT
COMPLEMENTARY
COMPLETE
COMPLETED
COMPLETELY
COMPLETION
COMPLEX
COMPLEXITY
COMPLICATE
COMPLICATED
COMPLICATES
COMPLICATION
COMPLY
COMPONENT
COMPONENTS
COMPRESS
COMPRESSED
COMPRESSES
COMPRESSING
COMPRESSION
COMPRESSIONS
COMPRESSOR
COMPRISES
COMPRISING
COMPROMISE
COMPROMISING
COMPULSORY
COMPUTATION
COMPUTATIONS
COMPUTE
COMPUTED
COMPUTER
COMPUTERS
CONCATENATE
CONCATENATED
CONCATENATES
CONCENTRATE
CONCEPT
CONCEPTS
CONCERN
CONCERNED
CONCERNING
CONCERNS
CONCLUDED
CONCLUSION
CONCLUSIONS
CONCRETE
CONCURRENT
CONCURRENTLY
CONDITION
CONDITION-CODE
CONDITIONAL
CONDITIONALS
CONDITIONS
CONFIDENCE
CONFIGURATION
CONFIGURE
CONFIRM
CONFIRMATORY
CONFLATING
CONFLICT
CONFLICTS
CONFORM
CONFORMING
CONFUSION
CONJUNCTION
CONNECT
CONNECTED
CONNECTING
CONNECTION
CONNECTS
CONNOTATIONS
CONSECUTIVE
CONSEQUENCE
CONSEQUENCES
CONSEQUENT
CONSEQUENTLY
CONSIDER
CONSIDERABLE
CONSIDERABLY
CONSIDERATION
CONSIDERATIONS
CONSIDERED
CONSIDERING
CONSIST
CONSISTENCY
CONSISTENT
CONSISTING
CONSISTS
CONSOLE
CONSOLIDATED
CONSTANT
CONSTANTS
CONSTITUTED
CONSTRAINED
CONSTRAINT
CONSTRAINTS
CONSTRUCT
CONSTRUCTED
CONSTRUCTING
CONSTRUCTION
CONSTRUCTIONS
CONSTRUCTS
CONSULT
CONSULTING
CONSUME
CONTAIN
CONTAINED
CONTAINING
CONTAINS
CONTEMPLATED
CONTENT
CONTENTS
CONTEXT
CONTEXTS
CONTIGUOUS
CONTINGENCIES
CONTINGENCY
CONTINGENT
CONTINUE
CONTINUES
CONTINUOUS
CONTINUOUSLY
CONTRADICTION
CONTROL
CONTROLLED
CONTROLLER
CONTROLLING
CONVENIENCE
CONVENIENT
CONVENIENTLY
CONVENTION
CONVENTIONAL
CONVENTIONS
CONVERGENCE
CONVERSATION
CONVERSION
CONVERSIONS
CONVERT
CONVERTED
CONVERTS
CONVEY
COPE
COPIED
COPIES
COPY
COPYING
CORRECT
CORRECTED
CORRECTIVE
CORRECTLY
CORRESPOND
CORRESPONDENCE
CORRESPONDING
CORRESPONDINGLY
CORRESPONDS
CORRUPT
CORRUPTED
CORRUPTING
CORRUPTION
COST
COSTS
COUCHED
COULD
COUNT
COUNTED
COUNTER
COUNTERACT
COURSE
COVER
CRASH
CRASHES
CREATE
CREATED
CREATES
CREATING
CREATION
CREATOR
CRITERION
CRITICISMS
CROSS
CUMBERSOME
CURRENT
CURRENTLY
CURRENTLY-ACTIVE
CURRENTLY-DEFINED
CURRENTLY-EXECUTING
CURRENTLY-LOADED
CURSOR
CUT-DOWN
CYCLE
CYLINDER
CYLINDERS
DAILY
DAMAGE
DANGER
DANGEROUS
DANGLING
DATA
DATE
DAY
DAYS
DEAD
DEADLY
DEAL
DEALING
DEALS
DEALT
DEBATE
DEBUG
DEBUGGED
DEBUGGING
DECEMBER
DECIDE
DECIDED
DECIDES
DECIDING
DECIMAL
DECISION
DECISIONS
DECK
DECKS
DECLARATION
DECLARATIONS
DECLARE
DECLARED
DECODE
DECODED
DECODING
DECOMPOSED
DECOMPOSITION
DECREASE
DECREASES
DECREASING
DEDICATED
DEDUCE
DEEMED
DEFAULT
DEFAULTING
DEFAULTS
DEFECTIVE
DEFECTS
DEFER
DEFERRING
DEFINE
DEFINED
DEFINES
DEFINING
DEFINITE
DEFINITION
DEFINITIONS
DEFINITIVE
DEGRADE
DEGREE
DELAY
DELAYED
DELAYING
DELETE
DELETED
DELETES
DELETING
DELETION
DELETIONS
DELIBERATE
DELIBERATELY
DELIMIT
DELIMITED
DEMAND
DEMANDS
DEMONS
DEMONSTRATE
DEMONSTRATES
DEMONSTRATION
DEMOTES
DENIED
DENOTED
DENSE
DENSITIES
DEPEND
DEPENDANT
DEPENDENCIES
DEPENDENT
DEPENDING
DEPENDS
DEPRESSED
DEPRESSIONS
DERIVED
DESCRIBE
DESCRIBED
DESCRIBES
DESCRIBING
DESCRIPTION
DESCRIPTIONS
DESCRIPTIVE
DESCRIPTOR
DESCRIPTORS
DESERVING
DESIGN
DESIGNATED
DESIGNED
DESIGNERS
DESIGNING
DESIRABLE
DESIRED
DESIRES
DESPAIR
DESRIPTION
DESRIPTORS
DESTINATION
DESTINATIONS
DESTROY
DESTROYED
DESTRUCTION
DETACH
DETACHED
DETAIL
DETAILED
DETAILS
DETECTED
DETECTION
DETECTS
DETERMINE
DETERMINED
DEVELOPED
DEVELOPING
DEVELOPMENT
DEVICE
DEVICE-INDEPENDENT
DEVICES
DIAGNOSING
DIAGNOSTIC
DIAGNOSTICS
DIAGRAM
DIAGRAMATICALLY
DIAGRAMS
DIALOGUE
DID
DIFFER
DIFFERENCE
DIFFERENCES
DIFFERENT
DIFFERENTLY
DIFFERING
DIFFERS
DIFFICULT
DIFFICULTIES
DIFFICULTY
DIGIT
DIGITS
DILUTION
DIMENSION
DIMINISHING
DIRECT
DIRECT-ACCESS
DIRECTED
DIRECTION
DIRECTIVE
DIRECTIVES
DIRECTLY
DIRECTOR
DIRECTORIES
DIRECTORY
DIRECTORYS
DISABLE
DISABLED
DISABLES
DISADVANTAGE
DISADVANTAGES
DISAPPEAR
DISAPPEARS
DISASTER
DISC
DISC-ADDRESS
DISCARDED
DISCARDS
DISCONNECTED
DISCOURAGED
DISCOVER
DISCOVERED
DISCOVERS
DISCREPANCIES
DISCREPANCY
DISCRETION
DISCS
DISCUSS
DISCUSSED
DISCUSSES
DISCUSSION
DISK
DISPATCHER
DISPLACEMENT
DISPLACEMENTS
DISPLAY
DISPLAYED
DISPLAYING
DISPLAYS
DISPOSAL
DISTANCE
DISTINCT
DISTINCTION
DISTINGUISHED
DISTRIBUTED
DIVIDE
DIVIDING
DIVISION
DO
DOCUMENT
DOCUMENTATION
DOCUMENTS
DOES
DOING
DOLLAR
DOMINATE
DONE
DORMANT
DOUBLE
DOUBLE-LENGTH
DOUBLE-SIDED
DOUBT
DOWN
DOWNWARDS
DRAIN
DRASTIC
DRAWBACK
DRAWBACKS
DRAWN
DRINK
DRINKING
DRIVE
DRIVEN
DRIVER
DRIVERS
DRIVES
DUE
DUMMY
DUMP
DUMPED
DUMPING
DUMPS
DUPLEX
DUPLICATE
DUPLICATED
DURATION
DURING
DUSTBIN
DYNAMIC
DYNAMICALLY
EACH
EARLIER
EARLIEST
EARLY
EASE
EASED
EASIER
EASILY
EASING
EASTER
EASY
EAT
ECCE
ECHO
ECHOED
ECHOES
ECHOING
ECONOMICAL
ECONOMY
EDINBURGH
EDIT
EDITED
EDITING
EDITION
EDITOR
EFFECT
EFFECTED
EFFECTIVE
EFFECTIVELY
EFFECTS
EFFICIENCIES
EFFICIENCY
EFFICIENT
EFFICIENTLY
EFFORT
EIGHT
EIGHT-BIT
EIGHTEEN
EIGHTY
EITHER
ELAPSE
ELAPSED
ELEGANTLY
ELEMENT
ELEMENTARY
ELEMENTS
ELEVEN
ELIMINATED
ELSE
ELSEWHERE
EMBEDDED
EMBODIES
EMBRACE
EMPHASIS
EMPHASISED
EMPLOY
EMPTIED
EMPTY
EMULATE
EMULATOR
ENABLE
ENABLED
ENABLES
ENABLING
ENCLOSED
ENCLOSING
ENCODED
ENCODING
ENCOUNTERED
ENCOURAGE
END
END-OF-BLOCK
END-OF-FILE
END-OF-TASK
ENDED
ENDING
ENDS
ENFORCED
ENGINEER
ENGINEERS
ENHANCEMENTS
ENJOY
ENOUGH
ENSUES
ENSURE
ENSURES
ENSURING
ENTAILS
ENTER
ENTERED
ENTERING
ENTERS
ENTIRE
ENTIRELY
ENTITIES
ENTITLED
ENTITLES
ENTITY
ENTRIES
ENTRY
ENVIRONMENT
ENVISAGED
EQUAL
EQUALLY
EQUALLY-SIZED
EQUALS
EQUIPPED
EQUIVALENT
EQUIVALENTLY
EQUIVALENTS
ERASE
ERASED
ERASES
ERASING
ERASURE
ERRATA
ERROR
ERROR-FREE
ERROR-PRONE
ERRORS
ESCAPE
ESOTERIC
ESPECIALLY
ESSENTIAL
ESSENTIALLY
ESTABLISHED
ESTABLISHER
ESTABLISHES
ESTABLISHMENT
ETC
EVALUATE
EVALUATED
EVALUATING
EVALUATION
EVEN
EVENT
EVENTS
EVENTUALLY
EVER
EVERY
EVERYTHING
EVIDENT
EVIDENTLY
EXACT
EXACTLY
EXALTED
EXAMINE
EXAMINED
EXAMINING
EXAMPLE
EXAMPLES
EXBEDDING
EXCEED
EXCEEDED
EXCEEDING
EXCEEDS
EXCEPT
EXCEPTION
EXCEPTIONAL
EXCESS
EXCHANGE
EXCHANGED
EXCLAMATION
EXCLUDING
EXCLUSIVE
EXEC
EXECUTABLE
EXECUTE
EXECUTED
EXECUTES
EXECUTING
EXECUTION
EXERCISE
EXERCISED
EXHAUSTIVE
EXILE
EXILED
EXILES
EXIST
EXISTENCE
EXISTENT
EXISTING
EXISTS
EXIT
EXITING
EXITS
EXPAND
EXPANDED
EXPANDING
EXPANSION
EXPECTED
EXPECTING
EXPECTS
EXPENSE
EXPENSIVE
EXPERIENCE
EXPIRED
EXPIRES
EXPLICIT
EXPLICITLY
EXPLOITING
EXPONENTIATION
EXPRESSED
EXPRESSION
EXPRESSIONS
EXTEND
EXTENDABLE
EXTENDED
EXTENDS
EXTENSION
EXTENSIONS
EXTENSIVE
EXTENT
EXTENTS
EXTERNAL
EXTERNALS
EXTRA
EXTREME
FACE
FACES
FACILITATE
FACILITIES
FACILITY
FACT
FACTOR
FACTORS
FAIL
FAILED
FAILING
FAILS
FAILURE
FAILURES
FAIRLY
FALL
FALLING
FALLS
FALSE
FALSITY
FAMILIAR
FAMILIARITY
FAR
FASHION
FASHIONS
FAST
FASTER
FAULT
FAULTED
FAULTS
FAULTY
FAVOUR
FEAR
FEATURE
FEATURES
FEBRUARY
FED
FEED
FEELS
FELT
FEW
FEWER
FIELD
FIELDS
FIFTEEN
FIFTY
FIGURES
FILE
FILE-IDENTIFIER
FILE-SYSTEM
FILENAME
FILENAMES
FILES
FILESTORE
FILL
FILLED
FILLING
FINAL
FINALLY
FIND
FINDING
FINDS
FINISH
FINISHED
FINISHES
FINISHING
FIRE
FIRED
FIRST
FIRSTLY
FIT
FITTED
FIVE
FIXED
FIXED-SIZE
FIXED-SIZED
FIXES
FLAG
FLAGGED
FLAGS
FLASH
FLEX
FLEXIBILITY
FLEXIBLE
FLEXIBLY
FLOAT
FLOATING
FLOATING-POINT
FLOW
FOLDING
FOLLOW
FOLLOWED
FOLLOWING
FOLLOWS
FOOTING
FOR
FORBIDDEN
FORCE
FORCE-LOAD
FORCED
FORCES
FORCIBLY
FORCING
FOREIGN
FORGET
FORGOTTEN
FORM
FORM-FEED
FORMAL
FORMAT
FORMATS
FORMATTED
FORMATTING
FORMED
FORMER
FORMING
FORMS
FORTRAN
FORTY
FORWARD
FORWARDS
FOSTERED
FOUND
FOUR
FOURTEEN
FRAGMENT
FRAGMENTATION
FRAGMENTED
FRAGMENTS
FRAME
FRAUGHT
FREE
FREED
FREEDOM
FREQUENCY
FREQUENT
FREQUENTLY
FRESH
FRIDAY
FROM
FRONT
FROZEN
FULL
FULL-LENGTH
FULLER
FULLWORD
FULLY
FUNCTION
FUNCTIONING
FUNCTIONS
FUNDAMENTAL
FURTHER
FURTHERMORE
FURTHUR
FUSE
FUTURE
GAIN
GAINED
GAINS
GATHER
GATHERED
GAVE
GENERAL
GENERAL-PURPOSE
GENERALISED
GENERALLY
GENERATE
GENERATED
GENERATES
GENERATING
GENERATION
GENERATOR
GENERATORS
GET
GETS
GETTING
GHOST
GIVE
GIVEN
GIVES
GIVING
GLANCE
GLOBAL
GLOBALLY
GO
GOES
GOING
GONE
GOOD
GOTO
GRACE
GRANT
GRANTED
GRANTING
GRAPHIC
GREAT
GREATER
GREATLY
GREW
GRIEF
GROUP
GROUPED
GROUPINGS
GROUPS
GROW
GROWING
GROWS
GUESSWORK
GUIDANCE
GUIDE
HAD
HALF
HALFWORD
HALFWORDS
HALT
HAND
HAND-CONSTRUCTED
HANDLE
HANDLED
HANDLER
HANDLES
HANDLING
HANDS
HAPPEN
HAPPENED
HAPPENING
HAPPENS
HARD
HARD-COPY
HARDWARE
HARDWARE-DEFINED
HARDWARE-PROTECTED
HAS
HASH
HAVE
HAVEN
HAVING
HAZARD
HE
HEAD
HEADER
HEADING
HEADINGS
HEADS
HEAVILY
HEAVY
HEIGHT
HEIRARCHY
HELD
HELP
HELPFUL
HELPING
HELPS
HENCE
HER
HERE
HEREIN
HERRING
HEXADECIMAL
HIDDEN
HIERARCHY
HIGH
HIGH-LEVEL
HIGHER
HIGHER-LEVEL
HIGHEST
HIGHLY
HINDER
HINTS
HIS
HIT
HITTING
HOLD
HOLDING
HOLDS
HOLE
HOLES
HOLIDAY
HOME
HONOUR
HONOURED
HOPE
HOPED
HOPEFULLY
HOPPER
HORIZONTALLY
HOT
HOTEL
HOUR
HOURS
HOUSE
HOUSEKEEPING
HOW
HOWEVER
HUMAN
HUNDRED
HUNTING
HYPHEN
HYPOTHETICAL
IDEA
IDEAL
IDEALLY
IDEAS
IDENTICAL
IDENTICALLY
IDENTIFICATION
IDENTIFIED
IDENTIFIER
IDENTIFIERS
IDENTIFY
IDLE
IDLING
IF
IGNORANCE
IGNORE
IGNORED
ILLEGAL
ILLUSION
ILLUSTRATES
IMAGE
IMMEDIATE
IMMEDIATELY
IMMINENT
IMP
IMPACT
IMPLEMENT
IMPLEMENTATION
IMPLEMENTATION-DEPENDENT
IMPLEMENTED
IMPLEMENTORS
IMPLEMENTS
IMPLICATIONS
IMPLICIT
IMPLICITLY
IMPLIED
IMPLIES
IMPLY
IMPORTANCE
IMPORTANT
IMPOSED
IMPOSES
IMPOSING
IMPOSSIBLE
IMPROPER
IMPROVE
IMPROVED
IMPROVEMENT
IMPROVEMENTS
IMPROVING
IN
IN-LINE
IN-STORE
INACCESSABLE
INADVERTENT
INADVERTENTLY
INCIDENTALLY
INCLUDE
INCLUDED
INCLUDES
INCLUDING
INCLUSION
INCLUSIVE
INCOMING
INCONSISTENCIES
INCONSISTENT
INCORRECT
INCORRECTLY
INCREASE
INCREASED
INCREASES
INCREASING
INCREASINGLY
INCREMENTAL
INCREMENTALLY
INCREMENTATION
INCREMENTED
INCREMENTS
INCURRED
INCURS
INDEED
INDEFINITELY
INDENT
INDEPENDENCE
INDEPENDENT
INDEPENDENTLY
INDEX
INDEXED
INDEXES
INDICATE
INDICATED
INDICATES
INDICATING
INDICATION
INDICATIVE
INDICES
INDIRECTLY
INDIVIDUAL
INDIVIDUALLY
INEVITABLE
INEVITABLY
INFILTRATED
INFINITE
INFLEXIBLE
INFLUENCE
INFORM
INFORMATION
INFORMED
INFORMING
INFORMS
INFREQUENTLY
INHIBIT
INHIBITED
INHIBITS
INITIAL
INITIALISATION
INITIALISE
INITIALISED
INITIALISING
INITIALLY
INITIATED
INITIATES
INITIATOR
INN
INPUT
INPUTS
INPUTTING
INSERT
INSERTED
INSERTION
INSIDE
INSIGNIFICANT
INSISTENCE
INSPECT
INSPECTED
INSPECTING
INSPECTION
INSTALLATION
INSTALLED
INSTEAD
INSTRUCIONS
INSTRUCT
INSTRUCTED
INSTRUCTION
INSTRUCTIONS
INSTRUCTS
INSUFFICIENT
INSULATED
INTACT
INTEGER
INTEGERS
INTEGRITY
INTELLIGENCE
INTENDED
INTENTION
INTERACT
INTERACTION
INTERACTIVE
INTERACTIVELY
INTERACTS
INTERCHANGEABLE
INTERDATA
INTEREST
INTERESTING
INTERFACE
INTERFACES
INTERIM
INTERLEAVED
INTERMEDIATE
INTERMEDIATE-CODE
INTERMIXED
INTERNAL
INTERNALLY
INTERPRET
INTERPRETATION
INTERPRETATIONS
INTERPRETED
INTERPRETER
INTERPRETING
INTERPRETS
INTERROGATE
INTERRUPT
INTERRUPTABLE
INTERRUPTED
INTERRUPTING
INTERRUPTS
INTERSPERSED
INTERVENTION
INTIMATE
INTIMATELY
INTO
INTRODUCE
INTRODUCED
INTRODUCES
INTRODUCING
INTRODUCTION
INTRODUCTORY
INTUITION
INVALID
INVALIDATE
INVALIDATED
INVARIABLY
INVARIANT
INVERSE
INVERT
INVERTED
INVESTIGATE
INVESTIGATED
INVESTIGATING
INVESTIGATION
INVITED
INVOKE
INVOKED
INVOKES
INVOKING
INVOLVE
INVOLVED
INVOLVES
INVOLVING
IRRESPECTIVE
IRRETRIEVABLY
IRREVOCABLE
IRRITATING
IS
ISOLATED
ISSUE
ISSUED
ISSUES
ISSUING
IT
ITEM
ITEMS
ITERATIONS
ITS
ITSELF
JAM
JAMMED
JAMS
JANUARY
JOB
JOBS
JOIN
JULY
JUMP
JUMPED
JUMPING
JUMPS
JUNE
JUST
JUSTIFIES
JUSTIFY
KEEP
KEEPING
KEEPS
KEPT
KERNEL
KEY
KEYBOARD
KEYBOARDS
KEYED
KEYS
KEYWORD
KILL
KILLED
KILOBYTES
KIND
KIT
KNOW
KNOWING
KNOWLEDGE
KNOWN
KNOWS
LABEL
LABELLED
LABELS
LACK
LAID
LANGUAGE
LANGUAGE-DEFINED
LANGUAGE-DEPENDENT
LANGUAGE-SPECIFIED
LANGUAGES
LARGE
LARGE-SCALE
LARGELY
LARGER
LARGEST
LAST
LATER
LATEST
LATTER
LAYER
LAYERS
LAYOUT
LEAD
LEADER
LEADING
LEADS
LEAST
LEAVE
LEAVES
LEAVING
LED
LEFT
LEISURE
LENGTH
LENGTHEN
LENGTHS
LESS
LET
LETTER
LETTERS
LEVEL
LEVELS
LIBRARIES
LIBRARY
LIES
LIFE
LIFETIME
LIGHT
LIGHTS
LIKE
LIKELY
LIMBO
LIMIT
LIMITATION
LIMITATIONS
LIMITED
LIMITING
LIMITS
LINE
LINE-NUMBERED
LINE-PRINTER
LINEAR
LINES
LINK
LINKAGE
LINKED
LINKER
LINKING
LINKS
LIST
LISTED
LISTING
LISTINGS
LISTS
LITTLE
LOAD
LOADED
LOADER
LOADING
LOADS
LOCAL
LOCALISATION
LOCALISE
LOCALISED
LOCALITY
LOCALS
LOCATE
LOCATED
LOCATION
LOCATIONS
LOCK
LOCKED
LOCKING
LOCKING-OUT
LOCKS
LOG
LOG-OFF
LOG-ON
LOGGED
LOGGED-ON
LOGGING
LOGGING-ON
LOGICAL
LOGICALLY
LOGS
LONG
LONG-GONE
LONG-WINDED
LONGER
LOOK
LOOKING
LOOP
LOOPS
LOOSE
LOOSELY
LOSE
LOSS
LOST
LOT
LOVE
LOW
LOW-LEVEL
LOWER
LOWER-CASE
LOWER-LEVEL
LOWERING
LOWEST
LUMPED
LUNCHTIME
LYING
MACHINE
MACHINE-CODE
MACHINE-DEPENDENT
MACHINE-INDEPENDENCE
MACHINE-INDEPENDENT
MACHINE-SPECIFIC
MACHINES
MACRO
MACROS
MADE
MAGIC
MAGNETIC
MAIN
MAINLY
MAINTAIN
MAINTAINED
MAINTAINING
MAINTAINS
MAINTENANCE
MAJOR
MAJORITY
MAKE
MAKES
MAKING
MALICIOUS
MAN
MANAGE
MANAGEABLE
MANAGEMENT
MANAGER
MANAGES
MANAGING
MANIPULATE
MANIPULATED
MANIPULATING
MANIPULATION
MANNER
MANPOWER
MANUAL
MANUALLY
MANUALS
MANUFACTURER
MANY
MAP
MAPPED
MAPPING
MAPS
MARCH
MARK
MARKED
MARKER
MARKET
MARKS
MASK
MASTER
MAT
MATCH
MATCHED
MATCHES
MATCHING
MATHEMATICAL
MATTER
MAXIM
MAXIMUM
MAY
MEAN
MEANING
MEANINGFUL
MEANINGLESS
MEANINGS
MEANS
MEANT
MEASURED
MEASUREMENT
MEASUREMENTS
MECHANICAL
MECHANICS
MECHANISM
MECHANISMS
MEMBER
MEMBERS
MEMORIES
MEMORY
MENTION
MENTIONED
MERE
MERELY
MERGED
MERGING
MERRY
MESSAGE
MESSAGES
MET
METHOD
METHODS
MICROSECONDS
MIDNIGHT
MIGHT
MILLI-SECOND
MILLI-SECONDS
MILLION
MILLISECONDS
MIND
MINE
MINIMAL
MINIMISE
MINIMISED
MINIMUM
MINOR
MINUS
MINUTE
MINUTES
MISHAP
MISLEADING
MISS
MISTAKE
MISTAKES
MISUSE
MISUSED
MNEMONIC
MNEMONICS
MODE
MODEL
MODELS
MODERN
MODES
MODIFICATION
MODIFICATIONS
MODIFIED
MODIFIER
MODIFIERS
MODIFIES
MODIFY
MODIFYING
MODULE
MODULES
MODULUS
MOMENT
MOMENTARILY
MONDAY
MONITOR
MONITORED
MONITORING
MONTHS
MORE
MORE-OR-LESS
MOREOVER
MORNING
MOST
MOTIVATED
MOUNT
MOUNTED
MOVE
MOVED
MOVEM
MOVEMENT
MOVES
MOVING
MRS
MUCH
MULTI-ACCESS
MULTI-DIMENSIONAL
MULTI-PHASE
MULTI-PROGRAMMED
MULTI-TASKING
MULTI-USER
MULTIPLE
MULTIPLEXING
MULTIPLICATION
MULTIPLIES
MULTIPLY
MULTIPROGRAMMING
MUNDANE
MUST
NAME
NAMED
NAMELY
NAMES
NAMING
NARROW
NATURAL
NATURALLY
NATURE
NEAR
NECESSARILY
NECESSARY
NECESSITATES
NECESSITATING
NECESSITY
NEED
NEEDED
NEEDING
NEEDS
NEGATE
NEGATIVE
NEITHER
NEST
NESTED
NESTING
NEVER
NEW
NEWLINE
NEWS
NEXT
NICE
NICETIES
NIGHT
NINE
NINETEEN
NINTY
NO
NODE
NOISE
NOMINALLY
NOMINATE
NOMINATED
NON
NON-ALPHANUMERIC
NON-CHARACTER
NON-EMPTY
NON-EXISTENT
NON-INTERACTIVE
NON-INTERRUPTABLE
NON-NEGATIVE
NON-OPTIMISED
NON-PRIVILEGED
NON-RESIDENT
NON-SHAREABLE
NON-STANDARD
NON-TEACHING
NON-TERMINAL
NON-VOLATILE
NON-ZERO
NONE
NOR
NORMAL
NORMALLY
NOT
NOTATION
NOTE
NOTED
NOTES
NOTHING
NOTICE
NOTICEABLE
NOTICING
NOTING
NOTION
NOTIONAL
NOTORIOUSLY
NOTWITHSTANDING
NOVA
NOVEL
NOVEMBER
NOW
NULL
NUMBER
NUMBERED
NUMBERS
NUMERIC
NUMERICAL
NUMERICALLY
OBEY
OBEYED
OBEYING
OBEYS
OBJECT
OBJECT-FILE
OBJECT-FILES
OBJECTIVE
OBJECTIVES
OBJECTS
OBLIGATION
OBLIGATORY
OBSCURE
OBSERVATIONS
OBSERVE
OBSERVED
OBTAIN
OBTAINABLE
OBTAINED
OBTAINING
OBVIOUS
OBVIOUSLY
OCCASIONALLY
OCCASIONS
OCCUPIED
OCCUPIES
OCCUPY
OCCUR
OCCURRANCE
OCCURRED
OCCURRENCE
OCCURRENCES
OCCURRING
OCCURS
OCTAL
OCTOBER
ODD
OF
OFF
OFF-CYLINDER
OFF-LINE
OFFENDING
OFFER
OFFERED
OFFERING
OFFLINE
OFFSET
OFTEN
OLD
OLDER
OMITTED
ON
ON-LINE
ONCE
ONE
ONES
ONLINE
ONLY
ONTO
OPEN
OPENED
OPENING
OPENS
OPERAND
OPERANDS
OPERATE
OPERATED
OPERATES
OPERATING
OPERATING-SYSTEM
OPERATION
OPERATIONAL
OPERATIONS
OPERATOR
OPERATORS
OPPORTUNISTIC
OPPORTUNITIES
OPPORTUNITY
OPPOSED
OPPOSITE
OPTIMISATION
OPTIMISATIONS
OPTIMISE
OPTIMISED
OPTIMISER
OPTIMISERS
OPTIMISING
OPTIMUM
OPTION
OPTIONAL
OPTIONALLY
OPTIONS
OR
ORDER
ORDERED
ORGANISATION
ORGANISATIONAL
ORGANISES
ORGANISING
ORIGINAL
ORIGINALLY
OTHER
OTHERS
OTHERWISE
OUT
OUT-OF-BOUNDS
OUTER
OUTERMOST
OUTLINED
OUTPUT
OUTPUT-FILE
OUTPUTS
OUTPUTTING
OUTSIDE
OUTSTANDING
OUTWEIGH
OUTWITH
OVER
OVERALL
OVERFLOW
OVERFLOWING
OVERHEAD
OVERHEADS
OVERLAP
OVERLAPPING
OVERLAPS
OVERLAY
OVERLEAF
OVERLOADED
OVERLOOKED
OVERNIGHT
OVERRIDDEN
OVERRIDE
OVERSIGHT
OVERWRITE
OVERWRITING
OVERWRITTEN
OWN
OWNED
OWNER
OWNERS
OWNERSHIP
OWNING
PACK
PACKAGE
PACKAGED
PACKAGES
PACKED
PACKING
PADDED
PADDING
PAGE
PAGED
PAGES
PAGING
PAID
PAIR
PAIRS
PANEL
PAPER
PAPER-TAPE
PARALLEL
PARALLELISM
PARAMETER
PARAMETER-BLOCK
PARAMETERISATION
PARAMETERISING
PARAMETERS
PARENTHESES
PARENTHESIS
PARENTHESISED
PARITY
PARSE
PARSED
PARSING
PART
PARTIALLY
PARTICULAR
PARTICULARLY
PARTITION
PARTS
PARTY
PASS
PASSAGE
PASSED
PASSING
PASSWORD
PASSWORDS
PAST
PATH
PATHS
PATTERN
PAUSE
PEN
PENALISE
PENALISED
PENALTY
PENDING
PEOPLE
PERCENT
PERCENTAGE
PERFECTLY
PERFORM
PERFORMANCE
PERFORMED
PERFORMING
PERFORMS
PERHAPS
PERIOD
PERIODS
PERKIN-ELMER
PERMANENT
PERMANENTLY
PERMISSION
PERMISSIONS
PERMIT
PERMITS
PERMITTED
PERMITTING
PERSON
PERSONS
PERTINENT
PHASE
PHASES
PHILOSOPHY
PHYSICAL
PHYSICALLY
PICK
PIECE
PIECES
PILE
PIN
PLACE
PLACED
PLACES
PLANNED
PLANTED
PLANTING
PLAUSIBLE
PLOT
PLUG
PLUS
POINT
POINTED
POINTER
POINTERS
POINTING
POINTS
POLICY
POOR
POPPED
POPULAR
POPULATION
PORTABILITY
PORTABLE
PORTION
POSE
POSES
POSITION
POSITION-INDEPENDENT
POSITIONED
POSITIONS
POSITIVE
POSSESS
POSSESSES
POSSIBILITIES
POSSIBILITY
POSSIBLE
POSSIBLY
POST-MORTEM
POSTCARD
POSTLUDES
POTENTIAL
POTENTIALLY
POWER
POWERFUL
PRACTICAL
PRACTICE
PRE-COMPILED
PRE-DECLARED
PRE-DEFINED
PRE-EMPTED
PRE-EMPTING
PRE-LOADED
PRECAUTIONS
PRECEDED
PRECEDING
PRECISION
PREDEFINED
PREDICATE
PREDICT
PREFER
PREFERABLE
PREFERENCE
PREFERRED
PREFIX
PREFIXED
PREFIXING
PRELIMINARY
PRELUDES
PREPARE
PREPARED
PRESENCE
PRESENT
PRESENTED
PRESENTLY
PRESERVATION
PRESERVE
PRESERVED
PRESERVING
PRESS
PRESSED
PRESSING
PREVENT
PREVENTED
PREVENTING
PREVENTS
PREVIOUS
PREVIOUSLY
PRIM
PRIMARY
PRIME
PRIMITIVE
PRINCIPAL
PRINCIPLE
PRINT
PRINTED
PRINTER
PRINTING
PRINTS
PRIOR
PRIORITY
PRIVATE
PRIVILEGE
PRIVILEGED
PRIVILEGES
PROBABILITY
PROBABLY
PROBLEM
PROBLEMS
PROCEDURE
PROCEDURES
PROCEED
PROCEEDING
PROCEEDS
PROCESS
PROCESSED
PROCESSES
PROCESSING
PROCESSOR
PROCESSORS
PRODUCE
PRODUCED
PRODUCES
PRODUCING
PRODUCTION
PROFILE
PROGRAM
PROGRAM-COUNTER
PROGRAM-COUNTER-RELATIVE
PROGRAMME
PROGRAMMED
PROGRAMMER
PROGRAMMERS
PROGRAMMING
PROGRAMS
PROGRESS
PROGRESSES
PROMINENT
PROMPT
PROMPTED
PROMPTING
PROMPTS
PRONE
PROPAGATE
PROPER
PROPERLY
PROPERTIES
PROPERTY
PROTECT
PROTECTED
PROTECTION
PROVED
PROVEN
PROVIDE
PROVIDED
PROVIDES
PROVIDING
PROVISION
PROVISIONALLY
PSEUDO
PUB
PUN
PUNCH
PUNCHED
PUNCHES
PUNCHING
PUNCTUATION
PURCHASED
PURE
PURELY
PURGE
PURITY
PURPOSE
PURPOSES
PUSH
PUSHED
PUT
PUTS
PUTTING
QUALIFIED
QUALITY
QUANTITIES
QUANTITY
QUANTUM
QUERY
QUESTION
QUESTIONS
QUEUE
QUEUED
QUEUEING
QUEUER
QUEUES
QUEUING
QUICK
QUICKER
QUICKLY
QUIESCENT
QUIET
QUIT
QUITE
QUOTIENT
QUOTING
RANDOM
RANGE
RANGES
RAPID
RAPIDLY
RARE
RARELY
RATE
RATHER
RAW
RE-DONE
RE-ENTERED
RE-ENTRANT
RE-OPENS
RE-ORDERING
RE-PROMPTS
REACHED
REACHING
READ
READ-ONLY
READER
READERS
READILY
READING
READS
READSYMBOL
READY
READY-MADE
REAL
REAL-TIME
REALISED
REALISES
REALITY
REALLY
REAPPEARS
REARRANGED
REARRANGING
REASON
REASONABLE
REASONABLY
REASONS
RECAST
RECEIPT
RECEIVE
RECEIVED
RECEIVER
RECEIVES
RECEIVING
RECLAIM
RECLAIMED
RECLAIMING
RECOGNISED
RECOGNISES
RECOMMENCED
RECOMMENDED
RECOMPILATION
RECOMPILE
RECONSTRUCTED
RECORD
RECORD-LENGTH
RECORDED
RECORDING
RECORDS
RECOURSE
RECOVER
RECOVERED
RECOVERING
RECOVERY
RECUR
RECURSION
RECURSIVE
REDEFINED
REDEFINITION
REDESIGN
REDUCE
REDUCED
REDUCEING
REDUCES
REDUCING
REDUCTION
REDUNDANCY
REDUNDANT
REFER
REFERENCE
REFERENCED
REFERENCES
REFERRED
REFERRING
REFERS
REFINEMENT
REFLECT
REFLECTING
REFLECTION
REFLECTS
REFUSE
REGAIN
REGAINS
REGARD
REGARDED
REGARDLESS
REGENERATE
REGENERATION
REGION
REGIONS
REGISER
REGISTER
REGISTERS
REGULAR
REGULARLY
REINITIALISE
REINITIALISED
REINITIATED
REJECTED
REJECTS
RELATED
RELATING
RELATIONSHIP
RELATIVE
RELATIVELY
RELEASE
RELEASED
RELEASING
RELEVANT
RELIABILITY
RELIABLE
RELIES
RELOAD
RELOADED
RELOADING
RELOCATABLE
RELOCATE
RELOCATED
RELOCATION
REMAIN
REMAINDER
REMAINING
REMAINS
REMEDIAL
REMEMBER
REMEMBERED
REMEMBERING
REMIND
REMOTE
REMOTELY
REMOVABLE
REMOVAL
REMOVE
REMOVED
REMOVES
REMOVING
RENAME
RENAMED
REOPENED
REORDER
REORDERED
REORDERING
REORDERS
REPEAT
REPEATED
REPEATEDLY
REPETITIVE
REPLACE
REPLACED
REPLACEMENTS
REPLACES
REPLACING
REPLICATED
REPLIES
REPLY
REPORT
REPORTING
REPORTS
REPRESENT
REPRESENTATION
REPRESENTATIONS
REPRESENTED
REPRESENTS
REPRIME
REQUEST
REQUESTED
REQUESTING
REQUESTS
REQUIRE
REQUIRED
REQUIREMENT
REQUIREMENTS
REQUIRES
REQUIRING
REROUTES
RESEMBLE
RESEMBLES
RESERVE
RESERVED
RESET
RESETS
RESIDE
RESIDENT
RESIDES
RESOLUTION
RESOLVE
RESOLVED
RESOLVES
RESOLVING
RESORT
RESOURCES
RESPECT
RESPECTIVELY
RESPECTS
RESPOND
RESPONDS
RESPONSE
RESPONSES
RESPONSIBILITY
RESPONSIBLE
REST
RESTART
RESTARTED
RESTARTS
RESTORE
RESTORED
RESTORING
RESTRICT
RESTRICTED
RESTRICTION
RESTRICTIONS
RESTRUCTURING
RESULT
RESULTING
RESULTS
RESUME
RESUMED
RESUMES
RETAINING
RETRIEVE
RETROSPECT
RETURN
RETURNED
RETURNING
RETURNS
RETYPE
RETYPED
RETYPES
REUSED
REVERSE
REVERSED
REVERSES
REVERT
REVIEW
REVISION
REVOKED
REVOKES
REWIND
REWOUND
REWRITE
REWRITES
REWRITTEN
RID
RIGHT
RIGHT-JUSTIFIED
RIGHTS
RISE
ROLE
ROOM
ROOMS
ROOT
ROOTS
ROUGHLY
ROUND
ROUTE
ROUTED
ROUTINE
ROUTINES
ROUTING
ROW
RUBBISH
RUBOUT
RULE
RULES
RUN
RUN-TIME
RUNAWAY
RUNNING
RUNS
RUNTIME
SACRIFICED
SADLY
SAFE
SAFELY
SALVAGE
SAME
SAMPLE
SATISFIED
SATISFIES
SATISFY
SATISFYING
SATURDAY
SAVE
SAVED
SAVES
SAVING
SAY
SCALAR
SCALARS
SCALE
SCALED
SCAN
SCANNED
SCATTER
SCATTERED
SCHEDULER
SCHEDULING
SCHEME
SCHOOL
SCIENCE
SCOPE
SCRATCH
SCREEN
SEARCH
SEARCHED
SEARCHES
SEARCHING
SEAT
SECOND
SECONDARY
SECONDLY
SECONDS
SECRECY
SECRET
SECTION
SECTIONS
SECTOR
SECTORS
SECURE
SECURITY
SEE
SEEK
SEEM
SEEMS
SEEN
SEES
SEGMENT
SEGMENTATION
SEGMENTS
SELECT
SELECTED
SELECTION
SELECTS
SELF
SELF-COMPILING
SELF-CONSISTENCY
SEMANTIC
SEMANTICALLY
SEND
SENDER
SENDING
SENDS
SENSE
SENSED
SENSIBLE
SENSITIVE
SENT
SEPARATE
SEPARATED
SEPARATELY
SEPARATES
SEPARATING
SEPTEMBER
SEQMENTS
SEQUENCE
SEQUENCES
SEQUENTIAL
SEQUENTIALLY
SERIALLY
SERIES
SERIOUS
SERVE
SERVED
SERVER
SERVERS
SERVICE
SERVICED
SERVICES
SERVICING
SERVING
SESSION
SET
SETS
SETTING
SETTINGS
SEVEN
SEVENTEEN
SEVENTY
SEVERAL
SHARE
SHAREABLE
SHARED
SHARING
SHE
SHEET
SHEETS
SHIFT
SHORT
SHORT-CIRCUIT
SHORT-CIRCUITING
SHORTEN
SHORTENING
SHORTER
SHORTLY
SHORTS
SHOULD
SHOW
SHOWED
SHOWING
SHOWN
SHOWS
SHRINKING
SHUFFLE
SHUFFLES
SHUFFLING
SHUT
SHUTDOWN
SHUTTING
SIDE
SIDE-EFFECT
SIGN
SIGN-BIT
SIGN-EXTENDED
SIGNAL
SIGNALLED
SIGNALLING
SIGNALS
SIGNED
SIGNIFICANCE
SIGNIFICANT
SIGNIFIES
SIMILAR
SIMILARITIES
SIMILARITY
SIMILARLY
SIMPLE
SIMPLER
SIMPLEST
SIMPLICITY
SIMPLIFICATION
SIMPLIFIED
SIMPLIFIES
SIMPLIFY
SIMPLIFYING
SIMPLY
SIMULA
SIMULATE
SIMULATED
SIMULTANEOUSLY
SIMULTANEOUSLY-ACTIVE
SINCE
SINGLE
SINGLE-PRECISION
SINGLE-USER
SIT
SITE
SITES
SITTING
SITUATION
SITUATIONS
SIX
SIXTEEN
SIXTEEN-BIT
SIXTY
SIZE
SIZEABLE
SIZES
SKIP
SKIPPING
SKIPS
SLACK
SLASH
SLEEP
SLICE
SLIGHT
SLIGHTLY
SLOTS
SLOWER
SLOWLY
SLOWLY-DEVELOPING
SMALL
SMALLER
SMALLEST
SMITH
SMOOTH
SO
SOFTWARE
SOLE
SOLELY
SOLUTION
SOLVE
SOLVED
SOME
SOMEONE
SOMETHING
SOMETIMES
SOMEWHERE
SOON
SOPHISTICATED
SORT
SORTS
SOURCE
SOURCE-LANGUAGE
SPACE
SPACES
SPAN
SPARE
SPECIAL
SPECIAL-CASE
SPECIAL-PURPOSE
SPECIALLY
SPECIFED
SPECIFIC
SPECIFICALLY
SPECIFICATION
SPECIFICATIONS
SPECIFIED
SPECIFIES
SPECIFY
SPECIFYING
SPEED
SPEEDS
SPELL
SPELLING
SPEND
SPENDING
SPENDS
SPENT
SPINE
SPLAT
SPLATTED
SPLATTING
SPLIT
SPLITS
SPOOLED
SPOOLER
SPOOLERS
SPOOLING
SPREAD
SPRING
SPURIOUS
SQUARE
SQUASHED
SQUEEZE
SQUEEZED
STABLE
STACK
STACK-ORIENTED
STACKED
STACKS
STAFF
STAGE
STAGES
STAND
STAND-ALONE
STANDARD
STANDARDS
STANDING
START
STARTED
STARTING
STARTS
STARTUP
STATE
STATED
STATEMENT
STATEMENTS
STATES
STATIC
STATISTICS
STATUS
STEMS
STEP
STEPS
STEREOTYPED
STICKING
STILL
STOP
STOPPED
STOPS
STORAGE
STORE
STORE-IMAGE
STORE-RESIDENT
STORED
STORES
STORING
STRAIGHT
STRAIGHTFORWARD
STRATEGIC
STRATEGY
STREAM
STREAMS
STRESSED
STRETCH
STRETCHED
STRETCHES
STRETCHING
STRICTLY
STRIKING
STRING
STRINGS
STRONGLY
STRUCK
STRUCTURAL
STRUCTURE
STRUCTURED
STRUCTURES
STRUCTURING
STUDENT
STUDENTS
STYLE
STYLISED
SUB-DIRECTORIES
SUB-DIRECTORY
SUB-DIVIDED
SUB-ELEMENT
SUB-EXPRESSIONS
SUB-OPTION
SUB-SEQUENCES
SUBJECT
SUBJECTS
SUBMITTED
SUBPROGRAMS
SUBROUTINE
SUBROUTINES
SUBSCRIPT
SUBSCRIPTS
SUBSEQUENT
SUBSEQUENTLY
SUBSTANTIAL
SUBSTITUTE
SUBSTITUTED
SUBSTITUTION
SUBSTITUTIONS
SUBSTRUCTURE
SUBSYSTEM
SUBSYSTEMS
SUBTRACT
SUBTRACTION
SUCCEED
SUCCEEDED
SUCCEEDING
SUCCESS
SUCCESSFUL
SUCCESSFULLY
SUCCESSION
SUCCESSIVELY
SUCH
SUFFER
SUFFERS
SUFFICIENT
SUFFICIENTLY
SUFFIXED
SUGGEST
SUGGESTED
SUGGESTING
SUGGESTS
SUIT
SUITABILITY
SUITABLE
SUITABLY
SUITE
SUITED
SUM
SUMMARIES
SUMMARY
SUMMER
SUNDAY
SUPER
SUPERFICIAL
SUPERVISING
SUPERVISOR
SUPPLIED
SUPPLIES
SUPPLY
SUPPORT
SUPPORTED
SUPPORTING
SUPPORTS
SUPPRESS
SUPPRESSED
SURE
SURMOUNT
SURPRISE
SURROUNDING
SUSPEND
SUSPENDED
SUSPENDS
SUSPENSION
SWITCH
SWITCH-SELECTABLE
SWITCHED
SWITCHES
SWITCHING
SWOP
SWOPPABLE
SWOPPED
SWOPPER
SWOPPING
SYMBOL
SYMBOLIC
SYMMETRY
SYNCHRONISATION
SYNCHRONOUS
SYMONYMOUS
SYNONYMS
SYNTACTIC
SYNTACTICALLY
SYNTAX
SYSTEM
SYSTEM-LEVEL
SYSTEM-MAINTAINED
SYSTEM-PROVIDED
SYSTEM-WIDE
SYSTEMS
TABLE
TABLES
TABULATE
TABULATED
TACTICAL
TAIL
TAKE
TAKEN
TAKES
TAKING
TALLY
TAMPER
TAPE
TAPES
TAPPED
TARGET
TARGET-MACHINE
TASK
TASKS
TEACHER
TEACHERS
TEACHING
TECHNIQUE
TECHNIQUES
TECHNOLOGY
TEDIOUS
TELEPHONE
TELETYPE
TELEVISION-LIKE
TELL
TEMPORARIES
TEMPORARILY
TEMPORARY
TEN
TEND
TENTATIVE
TERM
TERMED
TERMINAL
TERMINALS
TERMINATE
TERMINATED
TERMINATES
TERMINATING
TERMINATION
TERMINOLOGY
TERMS
TEST
TESTED
TESTING
TEXT
TEXTS
TEXTUAL
THAN
THAT
THE
THEIR
THEM
THEMSELVES
THEN
THERE
THEREAFTER
THEREBY
THEREFORE
THESE
THESIS
THEY
THING
THINGS
THINK
THINKING
THIRD
THIRTEEN
THIRTY
THIS
THOROUGHLY
THOSE
THOUGH
THOUGHT
THOUGHTS
THOUSAND
THRASHING
THREE
THROUGH
THROUGHOUT
THROUGHPUT
THROW
THROWN
THUNK
THUNKS
THURSDAY
THUS
TIDIED
TIDIES
TIDY
TIDYING
TIED
TIGHTEST
TIME
TIME-CRITICAL
TIME-SHARING
TIMER
TIMES
TIMETABLE
TIMETABLER
TIMETABLES
TO
TOGETHER
TOLD
TOLERABLE
TOO
TOOL
TOOLS
TOP
TOPIC
TOTAL
TOTALLY
TRACE
TRACK
TRACKS
TRADITIONAL
TRADITIONALLY
TRAILING
TRANSFER
TRANSFERRED
TRANSFERS
TRANSFORMATIONS
TRANSIT
TRANSLATE
TRANSLATED
TRANSLATES
TRANSLATING
TRANSLATION
TRANSMISSION
TRANSMITTED
TRANSPARENT
TRAP
TRAPPING
TRAVERSE
TREAT
TREATED
TREATMENT
TREATS
TREBLE
TREND
TRICKY
TRIED
TRIES
TRIVIAL
TROUBLE
TRUE
TRULY
TRUNCATED
TRUNCATION
TRUSTED
TRUTH
TRY
TRYING
TUESDAY
TURN
TURNED
TURNS
TWELVE
TWENTY
TWICE
TWO
TYPE
TYPED
TYPEHEAD
TYPES
TYPICAL
TYPIFY
TYPING
TYPISTS
UNABLE
UNACCEPTABLE
UNAFFECTED
UNALTERED
UNAMBIGUOUS
UNARY
UNASSIGNED
UNATTENDED
UNAVAILABLE
UNAVOIDABLE
UNAWARE
UNCHAIN
UNCHECKED
UNCONDITIONAL
UNCONDITIONALLY
UNCOVER
UNDEFINED
UNDER
UNDERLINED
UNDERSTAND
UNDERSTANDING
UNDERSTOOD
UNDERTAKE
UNDESIRABLE
UNDO
UNEXPECTED
UNFORTUNATELY
UNIFY
UNINHIBIT
UNINHIBITED
UNIQUE
UNIQUELY
UNIT
UNITARY
UNITS
UNIVERSAL
UNIVERSITY
UNKNOWN
UNLESS
UNLIKELY
UNLIMITED
UNLOAD
UNLOADED
UNMATCHED
UNNECESSARY
UNPACK
UNPACKED
UNPACKING
UNPREDICTABLE
UNPROTECTED
UNREAD
UNREPEATABLE
UNSHARE
UNSHARED
UNSIGNED
UNSPECIFIED
UNSTACK
UNSTRUCTURED
UNTIL
UNTOUCHED
UNUSABLE
UNUSED
UNUSUAL
UNWANTED
UNWIND
UNWINDING
UNWOUND
UP
UPDATE
UPDATED
UPDATES
UPDATING
UPON
UPPER
UPPER-CASE
UPPERMOST
UPWARDS
USABLE
USAGE
USE
USEABLE
USED
USEFUL
USER
USER-DEFINED
USER-LEVEL
USER-SPECIFIC
USERNAME
USERNAMES
USERS
USES
USING
USUAL
USUALLY
UTILISATION
UTILISE
UTILITIES
UTILITY
VALID
VALIDATE
VALUABLE
VALUE
VALUES
VARIABLE
VARIABLES
VARIANT
VARIATIONS
VARIETY
VARIOUS
VARY
VARYING
VECTOR
VECTORS
VERIFICATION
VERIFY
VERSA
VERSION
VERSIONS
VERTICALLY
VERY
VIA
VICE
VIDEO
VIEW
VIEWED
VIOLATIONS
VIRTUAL
VIRTUALLY
VISIBLE
VISUAL
VITAL
VOLATILE
VOLUME
VOLUMES
WAIT
WAITING
WAITS
WANT
WANTED
WANTS
WARNING
WARRANT
WAS
WAY
WAYS
WEDNESDAY
WEEK
WELCOME
WELL
WELL-ADVISED
WELL-BEHAVED
WELL-DEFINED
WELL-KNOWN
WELL-SUITED
WENT
WERE
WHAT
WHATEVER
WHATSOEVER
WHEN
WHENEVER
WHERE
WHEREAS
WHEREBY
WHETHER
WHICH
WHILE
WHILST
WHO
WHOLE
WHOLLY
WHOM
WHOSE
WHY
WIDELY
WIDTH
WILL
WIN
WINDOW
WINTER
WIPED
WIRE
WISH
WISHES
WISHING
WITH
WITHDRAWN
WITHIN
WITHOUT
WOMAN
WON
WORD
WORDS
WORK
WORKING
WORKING-SET
WORKS
WORKSPACE
WORKSPACE-POINTER-RELATIVE
WORLD
WORSE
WORST
WORTH
WOULD
WOUND
WRITE
WRITE-ONLY
WRITE-PROTECTED
WRITEABLE
WRITER
WRITERS
WRITES
WRITING
WRITTEN
WRONG
YEAR
YEARS
YES
YET
YOU
YOUR
ZAP
ZEBRA
ZERO
 H?   @ @                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    %begin
   %constinteger max text = 4000
   %constinteger max words = 300
   %constinteger max line = 400
   %recordformat linefm(%short line, link)
   %recordformat wordfm(%short wp, xp, link)
   %record(linefm)%array line(1:max line)
   %record(wordfm)%array word(1:max words)
   %byteintegerarray text, xtext(1:max text)
   %integer tp = 1, lp = 0, wp = 0, xp = 1
   %integer n
   %string(*)%name param
   %owninteger escape = '$', max = 0
   %routine strip(%string(*)%name from, to)
      %integer j,let,s
      to = ""
      let = 0
      %for j = 1,1,length(from) %cycle
         s = charno(from, j)
         %if s = escape %start
            let = 1
         %else
            s = s-32 %if 'a' <= s <= 'z'
            to = to.tostring(s) %if let # 0 %or (s#'_' %and s#'%')
            let = 0
         %finish
      %repeat
   %end
   %integerfn next word
      %string(*)%name sn, xn
      %integer j,p, s
      sn == string(addr(text(tp)))
      sn = ""
      readsymbol(s) %until s # ' '
      %cycle
         sn = sn.tostring(s)
         readsymbol(s)
      %repeat %until s = nl
      %for j = 1,1,wp %cycle
         %result = j %if string(addr(text(word(j)_wp))) = sn
      %repeat
      wp = wp+1
      word(wp)_xp = xp
      word(wp)_wp = tp;  tp = tp+length(sn)+1
      word(wp)_link = 0
      xn == string(addr(xtext(xp)))
      strip(sn, xn)
      max = length(xn) %if length(xn) > max
      xp = xp+length(xn)+1
      %result = wp
   %end
   %routine add line(%integer wp, line no)
      %record(linefm)%name l
      %record(wordfm)%name w
      %shortname p
      w == word(wp)
      p == w_link
      %while p # 0 %cycle
         l == line(p)
         %exit %if l_line > line no
         p == l_link
      %repeat
      lp = lp+1;  l == line(lp)
      l_line = line no
      l_link = p;  p = lp
   %end
   %routine process words
      %integer line, sect
      %cycle
         read(sect)
         read(line)
         %return %if line < 0
         add line(next word, line)
      %repeat
   %end
   %routine output index
      %record(wordfm)%name w
      %record(linefm)%name l
      %integer j, p
      printsymbol(escape);  printstring("A TAB=1,")
      write(max+5, 0);  newline
      printsymbol(escape);  printstring("A INDENT=2; JUST=1");  newline
      %for j = 1,1,wp %cycle
         w == word(j)
         printsymbol(escape);  printstring("B0")
         printsymbol(escape);  printstring("T1 ")
         printstring(string(addr(text(w_wp))))
         p = w_link
         printsymbol(escape);  printstring("T2 ")
         %while p # 0 %cycle
            l == line(p);  p = l_link
            write(l_line, 3)
            printsymbol(',') %if p # 0
         %repeat
         newline
      %repeat
      printsymbol(escape);  printsymbol('E');  newline
   %end
   %routine sort words
      %record(wordfm)%name w1, w2
      %record(wordfm) w
      %integer j,n,flag
      %for n = wp-1, -1, 1 %cycle
         flag = 0
         w2 == word(1)
         %for j = 1,1,n %cycle
            w1 == w2
            w2 == w2++1
            %if string(addr(xtext(w1_xp))) > string(addr(xtext(w2_xp))) %start
               flag = 1
               w = w1;  w1 = w2;  w2 = w
            %finish
         %repeat
      %repeat %until flag = 0
   %end

   param == string(comreg(1))
   escape = charno(param,1) %unless param = ""
   process words
   sort words
   output index
%endofprogram
 H?    I                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !!!! 14-NOV-80

! EMAS VERSION OF LAYOUT, ALTERED FOR INTERDATA
! CHANGED AGAIN TO DO SINGLE PAGES ON DEMAND.
! 19-9-80:  changed so Pragma printer will underline properly
!           CAP,CAPO,CAPSH,CAPSHO,INVERT,INVERTO defaulted out
! 4-11-80:   'include' option implemented
!            ASSIGN parameter lookup changed to strings from packed chars
!           PSR modification to look for input.LAY if input not found.

%BEGIN
!*  DOCUMENT LAYOUT PROGRAM
!* SYMBOLIC CONSTANTS
%CONSTINTEGER  command stream = 0
%OWNINTEGER  SIN = 1;           ! SOURCE INPUT STREAM
%CONSTINTEGER  LSIN = 3;         !   DITTO
%CONST %INTEGER ERR=0,out=1

! Define various types of output possible - only one per run
%constinteger output types = 4;      ! no. of types
%constinteger  printer = 1, update = 2, merge = 3, index = 4, daisy = 5
%conststring(11)%array  operating mode(1:5) =
      "PRINTER",  "UPDATE",  "MERGE",  "INDEX",  "DAISY"
%owninteger  output type = printer;   ! default
%owninteger  inclusion mode = 1;   ! 0 => merge, 1 => copy INCLUDE references by name

%include "Sysinc:command.inc"
%externalpredicatespec Exists(%string(31) File)

%string(63) parm = command_parameter;   ! start parameter:- MOUSES dependent
%string(31)  IN1= command_in1
%string(31) OUT1= command_out1

%CONST %INTEGER LBOUND=200;             !LINE BUFF BOUND
%CONST %INTEGER ABOUND=200;             !ATOM BUFF BOUND
%CONST %INTEGER SBOUND=200;             !SOURCE LINE BUFF BOUND
%CONST %INTEGER TBOUND=25;              !TAB BOUND
%CONST %INTEGER ESCBIT=256,UNDBIT=128,CASEBIT=32
%CONST %INTEGER CHARMASK=255,BASICMASK=127,LETMASK=95
%CONST %INTEGER SENTSP=544;             !512+' '
%CONSTINTEGER JUSTBIT = X'8000'
                                        !LAYOUT PARAMETERS
%OWN %INTEGER TOP=2,BOTTOM=4,LEFT=0,PAGE=60,LINE=72
%OWN %INTEGER SLINE=80,NLS=1,SGAP=2,PGAP=3
%OWN %INTEGER INDENT=0,PAGENO=0,START=1,FINISH=9999
!!!!%OWN %INTEGER CAP='@',UND='_',CAPSH='.',UNDSH='%',INVERT=32
%owninteger  cap=0, und='_',capsh=0,undsh='%',invert=0
%integer     capo = cap, undo = und, capsho = capsh, undsho = undsh
%integer     inverto = invert
%owninteger at line = 1, old at line
%string(35)  include file = "";  %integer  include stream
%string(35)  output ident
%OWN %INTEGER ASCII=1,JUST=0,MARK=0,ESCAPE='$'
%OWN %INTEGER IGNORE=0, SECTNO=0
%OWNINTEGER DLPI=6, DCPI=10, DPAGE=1700
%OWNINTEGER DLEFT=250, DTOP=250
%OWN %INTEGER %ARRAY TAB(0:25)=  %C
1,9,17,25,33,41,49,57,65,73,81,
89,97,105,113,121,129,137,145,153,161,169,177,185,193,
201
%OWN %INTEGER XLINES=0,LINECAPIND=0,LINEUNDIND=0,LINEMIDIND=0
%OWNINTEGER DBUFFP=0
%OWN %INTEGER INDENTIND=1,ERRIND=0,XPAGE=1
%OWN %INTEGER COLS=0;                   !COLUMNS USED ON CURRENT LINE
%OWNINTEGER LHM=1
%OWN %INTEGER TEXTCOLS=0;               !LAST COL OCCUPIED
%OWN %INTEGER LINES=0;                  !LINES PRINTED ON CURRENT PAGE
%OWN %INTEGER PAGES=0;                  !TOTAL PAGES PRINTED
%OWN %INTEGER FIXED=0;                  !FIXED COLUMNS
%OWN %INTEGER GAPS=0,SGAPS=0;           !TOTAL GAPS, SENTENCE GAPS
%OWN %INTEGER SIZE=0;                   !SIZE OF CURRENT ATOM
%OWN %INTEGER SMAX=0;                   !UPDATED SOURCE POINTER
%OWN %INTEGER INDENTCOL=1
%OWN %INTEGER NEXT=0
%INTEGER DIRECTIVE,RELIND,FREELIST,NUM
%INTEGERARRAY DBUFF(1:LBOUND);          !DIABLO BUFFER
%INTEGER %ARRAY BUFF(1:LBOUND);         !LINE BUFFER
%INTEGER %ARRAY ABUFF(1:ABOUND);        !ATOM BUFFER
%INTEGER %ARRAY SBUFF(1:SBOUND);        ! SOURCE LINE (UPDATED)

! VARIABLES ASSOCIATED WITH SINGLE PAGE PRINTING
%CONSTINTEGER  PPS = 1024;  ! PAGES PER SECTION
%CONSTINTEGER  PRINT MAX = 30
%RECORDFORMAT  PRINTFM(%SHORTINTEGER  SECTION, PAGE)
%RECORD(PRINTFM)%ARRAY  PRINT LIST(1:PRINT MAX)
%OWNINTEGER  LAST PRINT = 0, NEXT PRINT = 1

%INTEGER %ARRAY TYPE(0:127);            ! FOR SYMBOL INPUT.
%INTEGER %ARRAY LINK(1:65),HEAD,TAIL(1:500)




   %PREDICATE  TO BE PRINTED(%INTEGER  LINE)
      %RECORD(PRINTFM)%NAME  P;  %OWNINTEGER  PRINT=0
      %TRUE %IF LAST PRINT = 0;       ! PRINT LIST EMPTY
      %IF LINE # 0 %START;  ! FOR SPEED:-  NOT AT START OF PAGE SO
         %FALSE %IF PRINT = 0;   ! SIMPLY REPEAT PREVIOUS DECISION
         %TRUE
      %FINISH
      P == PRINT LIST(NEXT PRINT)
      %IF SECTNO*PPS+PAGENO > P_SECTION*PPS+P_PAGE %START
         NEXT PRINT = NEXT PRINT+1
         %STOP %IF NEXT PRINT > LAST PRINT
         P == PRINT LIST(NEXT PRINT)
      %FINISH
      %IF P_SECTION = SECTNO %AND (P_PAGE = PAGENO %OR P_PAGE = PPS-1) %START
         PRINT = 1;  %TRUE
      %FINISH
      PRINT = 0;  %FALSE
   %END

   %ROUTINE READCH(%INTEGERNAME CH)
      %OWNINTEGER E = 0
      %on 9 %start
         ->ended
      %finish
      %CYCLE
         %if e = 0 %start
            read symbol(ch)
            at line = at line+1 %if ch = nl
            %return
         %finish
Ended:   at line = 1
         %if include file # "" %start
            close input;  select input(sin)
            include file = ""
            at line = old at line
            inclusion mode = |inclusion mode|
            %continue
         %finish
         %IF SIN#LSIN %START
            SIN = SIN+1; SELECTINPUT(SIN)
         %ELSE
            E =     NL %IF E='E'
            E =    'E' %IF E=escape
            E = escape %IF E=0
            CH = E; %RETURN
         %FINISH
      %REPEAT
   %END
  %ROUTINE FAULT(%INTEGER N)
  %SWITCH S(1:17)
    SELECTOUTPUT(ERR)
   print symbol('*')
   %if include file # "" %start
      print string("file ");  print string(include file)
      space
   %finish
   print string("line");  write(at line,3);  print string(": ")
    ->S(N)
S(1):
    PRINTSTRING("FAULTY FORMAT AT ")
    PRINTSYMBOL(NEXT)
    ->A9
S(2):
    PRINTSTRING("INVALID ASSIGNMENT TO SYMBOL PARAMETER");  ->A9
S(3):
    PRINTSTRING("UNKNOWN NAME");  ->A9
S(4):
    PRINTSTRING("SCALAR/VECTOR MISMATCH");  ->A9
S(5):
    PRINTSTRING("UNKNOWN DIRECTIVE ");  ->A8
S(6):
    PRINTSTRING("SPURIOUS DIRECTIVE ");  ->A8
S(7):
    PRINTSTRING("OUT OF BOUNDS ");  ->A8
S(8):
    PRINTSTRING("OFF PAGE ");  ->A8
S(9):
    PRINTSTRING("OVER TEXT ");  ->A8
S(10):
    PRINTSTRING( %C
       "TOO MANY PARAMETER VALUES NESTED - RUN ABANDONED")
    ->A9
S(11):
    PRINTSTRING("NO VALUE STORED ");  ->A9
S(12):
    PRINT STRING("MISPLACED DIRECTIVE ");  -> A8
S(13):
   PRINT STRING("TOO MANY PRINT VALUES");  -> A9
S(14):
   PRINT STRING("DUPLICATE PRINT REQUEST");  -> A9
s(15):
   print string("Unknown output type = ");  print string(output ident)
   -> A9
s(16):
   print string("Nested - INCLUDE=");  print string(include file)
   -> A9
s(17):
   print string("$X:  index atom missing?")
   -> A9
A8: PRINTSYMBOL(DIRECTIVE)
    PRINTSYMBOL(RELIND) %IF RELIND#0
A9: ERRIND=1
    NEWLINE
  %END
   %integerfn  output name(%string(35)  name)
      %integer  j,k,sym
      j = 0
      %for k = 1,1,length(name) %cycle
         sym = charno(name,k)
         %if sym # ' ' %start
            sym = sym-'a'+'A' %if 'a' <= sym <= 'z'
            j = j+1;  charno(name,j) = sym
         %finish
      %repeat
      length(name) = j
      %result = printer %if j = 0
      %for k = 1,1,output types %cycle
         %result = k %if operating mode(k) = name
      %repeat
      fault(15);               ! unknown output type
      %result = printer;       ! default it
   %end
  %ROUTINE READ ATOM OR DIRECTIVE
  %INTEGER K,C,U,ATOMCAPIND,ATOMUNDIND
  %INTEGER STATOM
  %SWITCH SW(0:8)
    %IF NEXT=0 %THEN READCH(K) %ELSE K=NEXT %AND NEXT=0
    DIRECTIVE=0;  SIZE=0
    %IF IGNORE#0 %THEN %START
      %CYCLE
        READCH(K) %WHILE K#ESCAPE
        READCH(K)
        DIRECTIVE=K&LETMASK
        %IF DIRECTIVE='A' %OR DIRECTIVE='E' %C
           %THEN READCH(NEXT) %AND %RETURN
        READCH(K)
      %REPEAT
    %FINISH
    %IF K&ESCBIT#0 %THEN %START;        ! DIRECTIVE READ IN LAST CALL.
      DIRECTIVE=K&LETMASK
      READCH(NEXT)
      %RETURN
    %FINISH
    ATOMCAPIND=LINECAPIND;  ATOMUNDIND=LINEUNDIND;  STATOM=0
    U=ATOMUNDIND;  C=ATOMCAPIND
    %CYCLE
      ->SW(TYPE(K&BASICMASK)&15)
SW(1):                                  ! CAPSH.  RECOGNISED AT START OF ATOM O
      ->TOBUFF %UNLESS STATOM=0;  STATOM=1
      ATOMCAPIND=CASEBIT;  C=CASEBIT
      ->LOOP
SW(2):                                  ! ESCAPE
      READCH(K);  K=K+ESCBIT
      ->TOBUFF %UNLESS 'A'<=K&LETMASK<='Z' %OR K&LETMASK = NL
      %EXIT %IF SIZE#0
      DIRECTIVE=K&LETMASK
      READCH(NEXT)
      %RETURN
SW(3):                                  ! CAP
      C=CASEBIT;  STATOM=1
      ->LOOP
SW(4):                                  ! UND
      U=UNDBIT;  STATOM=1
      READCH(K);  ->TOBUFF %IF K&BASICMASK=' '
      ->SW(TYPE(K&BASICMASK)&15)
SW(6):                                  ! UNDSH
      STATOM=1
      ATOMUNDIND=UNDBIT
      U=UNDBIT
      ->LOOP
SW(7):                                  ! SPACE OR NEWLINE
      %EXIT %IF K=NL %OR K!LINEUNDIND=' ';  ->TOBUFF
SW(8):                                  ! LETTERS
      K=K!!INVERT
      K=K-C %IF 'a'<=K&BASICMASK<='z'
!* NOTE THAT HERE 'a' AND 'z' ARE LOWER CASE.
SW(0):                                  ! EVERYTHING ELSE
TOBUFF:
      STATOM=1;  SIZE=SIZE+1;  ABUFF(SIZE)=K!U
      U=ATOMUNDIND;  C=ATOMCAPIND
LOOP: READCH(K)
    %REPEAT
    NEXT=K
    %RETURN %IF ATOMUNDIND=0 %OR SIZE=0
!* REMOVES UNDERLINE FROM TERMINATING PUNCTUATION - BUT NOT IF SET BY UND
    K=ABUFF(SIZE)!!UNDBIT
    ABUFF(SIZE)=K %IF K='.' %OR K=',' %OR K=':' %OR K=';' %C
       %OR K=')' %OR K='!' %OR K='?'
  %END
  %ROUTINE PRINTSOURCELINE
  %INTEGER I
    %IF ERRIND#0 %START
      SELECTOUTPUT(ERR)
      I=0
      I=I+1 %AND PRINTSYMBOL(SBUFF(I)) %WHILE I#SMAX
      NEWLINE
      ERRIND=0
    %FINISH
    SMAX=0 %AND %RETURN %IF output type # update %or inclusion mode < 0
    SELECTOUTPUT(out)
    I=0
    I=I+1 %AND PRINTSYMBOL(SBUFF(I)) %WHILE I#SMAX
    NEWLINE;  SMAX=0
  %END
  %ROUTINE STORE(%INTEGER K)
    SMAX=SMAX+1;  SBUFF(SMAX)=K
  %END
%routine nstore(%integer  n)
   %routine strip
      %integer  k
      k = rem(n,10)
      n = (n-k)//10
      strip %if n # 0
      store(k+'0')
   %end
   strip;  store(' ')
%end;      !  ... of NSTORE
  %ROUTINE STORESOURCEATOM
!* IN GENERAL, THE UNDERLINE AND CAPITALISE OUTPUT PARAMETERS ARE USED
!* IF NOT DISABLED.  ALL LETTERS ARE SET TO LOWER CASE, WITH
!* APPROPRIATE SYMBOL PARAMETERS, AND THEN INVO IS APPLIED.  THIS
!* SWITCHES THEM BACK, IF INVO IS NON-ZERO, TO U.C.
!* IF AN OUTPUT DEVICE ACCEPTED THE 8TH BIT SET AS SIGNIFYING UNDERLINING,
!* SETTING UNDO AND UNDSHO TO 0 WOULD CAUSE THE 8TH BIT TO BE SET TO
!* SIGNIFY UNDERLINING.
  %INTEGER I,K,ATOMCAPIND,ATOMUNDIND
    %ROUTINE TRANSLATEUNDERLINE
    %INTEGER P,Q
      K=K-UNDBIT %AND %RETURN %IF LINEUNDIND#0
      ->ONE %IF K-UNDBIT=' '
      K=K-UNDBIT %AND %RETURN %IF ATOMUNDIND#0
      ->ONE %IF UNDSHO=0
      P=I
      %WHILE P#SIZE %CYCLE
        P=P+1;  Q=ABUFF(P)
        ->ONE %IF Q&UNDBIT=0 %AND (P#SIZE %OR (Q#'.' %C
           %AND Q#',' %AND Q#':' %AND Q#';' %AND Q#')' %C
           %AND Q#'!' %AND Q#'?'))
      %REPEAT
      STORE(UNDSHO);  K=K-UNDBIT;  ATOMUNDIND=1
      %RETURN
ONE:  %RETURN %IF UNDO=0
      STORE(UNDO);  K=K-UNDBIT
    %END
   %return %if output type # update %or inclusion mode < 0
    %IF SMAX#0 %AND XLINES=0 %START
      %IF SMAX+SIZE+1<=SLINE %THEN STORE(' ') %C
         %ELSE PRINTSOURCELINE
    %FINISH
    ATOMCAPIND=0;  ATOMUNDIND=0
    %IF LINECAPIND=0 %AND CAPSHO#0 %AND SIZE>=2 %START
      %CYCLE I=1,1,SIZE
        K=ABUFF(I)&BASICMASK
        ATOMCAPIND=0 %AND %EXIT %IF 'A'<=K-CASEBIT<='Z'
                                        !LC
        ATOMCAPIND=1 %IF 'A'<=K<='Z';   !UC
      %REPEAT
    %FINISH
    STORE(CAPSHO) %IF ATOMCAPIND#0
    %CYCLE I=1,1,SIZE
      K=ABUFF(I)
      TRANSLATEUNDERLINE %IF K&UNDBIT#0
      K=K+CASEBIT %IF 'A'<=K<='Z' %AND (LINECAPIND#0 %C
         %OR ATOMCAPIND#0)
      STORE(CAPO) %AND K=K+CASEBIT %IF 'A'<=K<='Z' %AND CAPO#0
      K=K!!INVERTO %IF 'A'<=K&LETMASK<='Z'
      STORE(ESCAPE) %IF K&ESCBIT#0
      STORE(K&CHARMASK)
    %REPEAT
  %END
  %ROUTINE SETCOLUMN(%INTEGER M)
!* THIS MOVES TO COL M-1 SO THAT THE NEXT ATOM STARTS AT COL M.
!* FIXED IS SET TO SUPPRESS A SPACE BEING INSERTED BEFORE THAT ATOM, AND
!* TO INHIBIT JUSTIFICATION TO THE LEFT OF THIS POINT.
!* ON ENTRY, COLS GIVES THE LAST COLUMN USED.
    %IF 1<=M<=LINE %START
      M=M-1
      %IF M>COLS %START
        COLS=COLS+1 %AND BUFF(COLS)=' ' %UNTIL COLS=M
      %FINISH %ELSE %START
        %WHILE COLS#M %CYCLE
          FAULT(9) %AND %EXIT %IF BUFF(COLS)#' '
          COLS=COLS-1
        %REPEAT
        LHM = COLS+1
      %FINISH
    %FINISH %ELSE %START
      FAULT(8);  INDENTCOL=1 %IF INDENTCOL=M
    %FINISH
    FIXED=COLS;  GAPS=0;  SGAPS=0
  %END
  %ROUTINE MARKDOC
 %INTEGER  J;  %CONSTINTEGER  BELL = 7
    %IF MARK=1 %START
      PRINTSYMBOL('=');  SPACES(LINE-2);  PRINTSYMBOL('=')
      NEWLINE
   %ELSE %IF MARK = 2
      PRINTSYMBOL(12)
   %ELSE %IF MARK = 3
      SELECT OUTPUT(ERR)
      J = 8
      PRINT SYMBOL(BELL) %AND J = J-1 %UNTIL J = 0;  NEWLINE
      SELECT OUTPUT(out)
      SELECT INPUT(command stream)
      SKIP SYMBOL %WHILE NEXT SYMBOL # NL
      SKIP SYMBOL
      SELECT INPUT(SIN)
   %FINISH
  %END
  %ROUTINE RESETDOCLINE
    %IF XLINES#0 %START
      XLINES=XLINES-1
      %IF XLINES=0 %START
        LINECAPIND=0;  LINEUNDIND=0
        LINEMIDIND=0;  INDENTIND=1
      %FINISH
    %FINISH
   LHM = 1
    TEXTCOLS=0;  COLS=0;  FIXED=0;  XPAGE=0
    SETCOLUMN(INDENTCOL) %IF INDENTIND#0
  %END
  %ROUTINE PRINTLPLINE
  %CONST %INTEGER CR=13
  %INTEGER I,J,K,L,M,U,V
   ! method of underlining changed to suit Pragma printer
   %integer  ul = 0
    %IF PAGES+1>=START %AND TO BE PRINTED(LINES-NLS) %START
      SELECTOUTPUT(out)
      %IF LINES=NLS %START
        MARKDOC %IF MARK#0
        NEWLINES(TOP)
      %FINISH
      %IF TEXTCOLS#0 %START
        L=LEFT
        L=L+(LINE-COLS)//2 %IF LINEMIDIND#0
        SPACES(L)
        U=UNDBIT;  V=BASICMASK
        U=0 %AND V=CHARMASK %IF ASCII=0
        %CYCLE I=1,1,COLS
          K=BUFF(I)
          ul = i %if k & undbit # 0
          PRINTSYMBOL(K&V)
        %REPEAT
        %if ul # 0 %start
           printsymbol(CR)
           spaces(l)
           %for i = 1,1,ul %cycle
              k = ' '
              k = '_' %if buff(i) & undbit # 0
              print symbol(k)
           %repeat
        %finish
      %FINISH
      NEWLINES(NLS)
      %IF LINES>=PAGE %AND BOTTOM#0 %START
        %IF PAGENO=0 %START
          NEWLINES(BOTTOM)
        %FINISH %ELSE %START
          I=BOTTOM//2
          NEWLINES(I)
          SPACES(LEFT+LINE//2-4)
         %IF SECTNO#0 %START
            WRITE(SECTNO,1); WRITE(-PAGENO,1)
         %FINISHELSE WRITE(PAGENO,1)
          NEWLINES(BOTTOM-I)
        %FINISH
      %FINISH
    %FINISH
  %END
  %ROUTINE PRINTDIABLOLINE
%endoflist
!!    %INTEGER LI,L,K,I,J,DIR,P,PLAST
!!    %OWNINTEGER VDIFF=0, HDIFF=0, VPOS=0, HPOS=0, OLDCOL=0
!!   %CONSTINTEGER HOLD = 240;   ! 128+64+48
!!   %CONSTINTEGER MLEFT=212;   !128+64+16+4
!!   %CONSTINTEGER MRIGHT= 208;   !128+64+16
!!   %CONSTINTEGER DOWN= 224;   !128+64+32
!!%CONSTINTEGER  ESC=27, HT=9, VT=11, FF=12, GRAPHICS ON='6'
!!   %ROUTINE SET GRAPHICS MODE
!!      PRINT SYMBOL(ESC);  PRINT SYMBOL(GRAPHICS ON)
!!   %END
!!   %ROUTINE MOVE
!!      %IF HDIFF#0 %START
!!         HPOS = HPOS+HDIFF;  HDIFF = 0
!!         PRINT SYMBOL(ESC);  PRINT SYMBOL(HT);  PRINT SYMBOL(HPOS)
!!      %FINISH
!!      %IF VDIFF#0 %START
!!         VPOS = VPOS+VDIFF;  VDIFF = 0
!!         PRINT SYMBOL(ESC);  PRINT SYMBOL(VT);  PRINT SYMBOL(VPOS)
!!      %FINISH
!!   %END
!!   %ROUTINE DRESET
!!      PRINTSYMBOL(MRIGHT); PRINTSYMBOL(0)
!!      PRINTSYMBOL(DOWN); PRINTSYMBOL(0)
!!   %END
!!   %ROUTINE DSPACES(%INTEGER N)
!!      HDIFF = HDIFF+(60//DCPI)*N
!!   %END
!!   %ROUTINE DNEWLINES(%INTEGER N)
!!      VDIFF = VDIFF+N*(48//DLPI)
!!   %END
!!   %ROUTINE DCR
!!      HDIFF = -HPOS
!!   %END
!!   %ROUTINE DNEWPAGE
!!      HDIFF = -HPOS
!!      VDIFF = (DPAGE*12)//25-VPOS
!!      VDIFF = 0 %IF VDIFF<0
!!      MOVE
!!      VPOS = 0
!!      PRINTSYMBOL(HOLD) %IF PAGES#FINISH
!!   %END
!!   %ROUTINE DINCSP(%INTEGER N)
!!      HDIFF = HDIFF+N
!!      HDIFF = HDIFF-N-N %IF DIR<0
!!   %END
!!   %ROUTINE DPRINTCH(%INTEGER C)
!!      %IF DIR<0 %THEN HDIFF = HDIFF-60//DCPI
!!      %IF C#' ' %START
!!         MOVE; PRINTSYMBOL('_') %IF C&UNDBIT#0
!!         C = C&127
!!         PRINTSYMBOL(C) %IF C#' '
!!      %FINISH
!!      %IF DIR>0 %THEN HDIFF = HDIFF+60//DCPI
!!   %END
!!   %ROUTINE DWRITE(%INTEGER N)
!!      %INTEGER M
!!      M = N//10; N = N-M*10
!!      DWRITE(M) %IF M#0; DPRINTCH('0'+N)
!!   %END
!!
!!   LI = LINES+NLS; DIR = 1
!!   %IF PAGES+1>=START %AND TO BE PRINTED(LINES) %START
!!      SELECTOUTPUT(out)
!!      %IF LI=NLS %START
!!         %IF PAGES = 0 %START
!!            PRINT SYMBOL(FF);  SET GRAPHICS MODE
!!         %ELSE
!!            DNEWPAGE
!!         %FINISH
!!         DRESET; OLDCOL = 0
!!         VDIFF = (DTOP*48)//100
!!         DNEWLINES(TOP)
!!      %FINISH
!!      %IF TEXTCOLS#0 %START
!!         DCR; HDIFF = HDIFF+(DLEFT*60)//100
!!         L = LEFT
!!         %IF LINEMIDIND#0 %START
!!            L = LINE-COLS
!!            DINCSP(30//DCPI) %IF L&1#0
!!            L = LEFT+L//2
!!         %FINISH
!!         DSPACES(L)
!!         %IF LHM-OLDCOL>OLDCOL-COLS %START
!!            DIR = 1; P = LHM; PLAST = DBUFFP+1
!!            DSPACES(LHM-1)
!!            %IF PLAST=1 %THEN PLAST = COLS+1
!!         %ELSE
!!            DIR = -1; P = DBUFFP; PLAST = LHM-1
!!            %IF P=0 %THEN P = COLS %AND DSPACES(P) %C
!!            %ELSE DSPACES(LINE)
!!         %FINISH
!!         %WHILE P#PLAST %CYCLE
!!            %IF DBUFFP=0 %THEN K = BUFF(P) %ELSE K = DBUFF(P)
!!            OLDCOL = P
!!            P = P+DIR
!!            %IF K&JUSTBIT#0 %THEN DINCSP(K-JUSTBIT) %C
!!            %ELSE DPRINTCH(K&511)
!!         %REPEAT
!!      %FINISH
!!      DNEWLINES(NLS)
!!      DIR = 1
!!      %IF LI>=PAGE %AND BOTTOM#0 %START
!!         %IF PAGENO#0 %START
!!            DNEWLINES(BOTTOM//2); DCR; HDIFF = HDIFF+(DLEFT*60)//100
!!            I = 1; I = 2 %IF PAGENO>=10
!!            I = 3 %IF PAGENO>=100; I = 4 %IF PAGENO>=1000
!!            I = I+2 %IF SECTNO#0; I = I+1 %IF SECTNO>=10
!!            DSPACES(LEFT); DSPACES((LINE-I)//2)
!!            DINCSP(30//DCPI) %IF I&1#0
!!            %IF SECTNO#0 %START
!!               DWRITE(SECTNO); DPRINTCH('-')
!!            %FINISH
!!            DWRITE(PAGENO)
!!         %FINISH
!!      %FINISH
!!   %FINISH
!!   DBUFFP = 0
%list
%END
  %ROUTINE PRINTDOCLINE
      lines = lines + nls
      %if output type = printer %start
         print LP line
      %else %if output type = daisy
         print diablo line
      %finish
      %if lines >= page %start
         lines = 0;  pages = pages+1
         page no = page no + 1 %if page no # 0
      %finish
      reset doc line
   %END
  %ROUTINE JUSTIFY
  %OWN %INTEGER FLIP=0
  %INTEGER I,J,K,L,MIN,COUNT,SCOUNT,AWAIT,SWAIT,AGAPS
  %INTEGER DX1,DX2,DX3
    COUNT=LINE-COLS
    %RETURN %IF COUNT<=0 %OR GAPS=0
%endoflist
!!!! JUSTIFY FOR DIABLO
!!!    SCOUNT = COUNT*(60//DCPI);        !EXTRA SIXTIETHS
!!!    DX1 = SCOUNT//GAPS;               !EXTRA PER GAP
!!!    DX2 = SCOUNT-DX1*GAPS;            !REMAINDER
!!!    DX3 = 0
!!!    %IF DX2>SGAPS %START;             !CANT FIT REST IN SGAPS
!!!       DX3 = DX2-SGAPS; DX2 = SGAPS
!!!    %FINISH
!!!    AGAPS = GAPS
!!!    %CYCLE I = COLS,-1,1
!!!       K = BUFF(I)
!!!       %IF AGAPS>0 %START
!!!          %IF K=SENTSP %OR K=' ' %START
!!!             AGAPS = AGAPS-1
!!!             J = JUSTBIT+DX1+60//DCPI
!!!             %IF K=SENTSP %AND DX2>0 %START
!!!                DX2 = DX2-1; J = J+1
!!!             %FINISH
!!!             %IF DX3>0 %START
!!!                DX3 = DX3-1; J = J+1
!!!             %FINISH
!!!             K = J
!!!          %FINISH
!!!       %FINISH
!!!       DBUFF(I) = K
!!!    %REPEAT
    DBUFFP = COLS
%list
    AGAPS=GAPS-SGAPS;                   ! ATOM GAPS
    MIN=COUNT//GAPS;                    ! MIN NO OF SPACES TO BE ADDED TO EVERY
    COUNT=COUNT-MIN*GAPS;               ! SPACES TO BE ADDED AS WELL AS MIN AT 
!* SENTENCE GAPS ARE FILLED IN PREFERENCE TO ATOM GAPS.
    SCOUNT=SGAPS;  SCOUNT=COUNT %IF COUNT<SGAPS
    COUNT=COUNT-SCOUNT;                 ! COUNT IS NOW NO OF SPACES FOR ATOM GA
    FLIP=1-FLIP
    %IF FLIP#0 %START;                  ! EXTRA SPACES FROM RH END.
      AWAIT=0;  SWAIT=0
!* NOS OF ATOM AND SENTENCE GAPS TO BE PASSED BEFORE INSERTION BEGINS.
    %FINISH %ELSE %START
      AWAIT=AGAPS-COUNT;  SWAIT=SGAPS-SCOUNT
    %FINISH
    J=LINE;                             ! BUFF(J) TO BE OUTPUT TO.
    %CYCLE I=COLS,-1,1
      K=BUFF(I)
      %IF (K=SENTSP %OR K=' ') %AND BUFF(I-1)#K %START
!* SECOND TEST PREVENTS GAPS FROM BEING PADDED MORE THAN ONCE.
        L=J-MIN
        %IF K=SENTSP %START;            ! SENTENCE GAPS
          %IF SWAIT=0 %START
            L=L-1 %AND SCOUNT=SCOUNT-1 %IF SCOUNT#0
          %FINISH %ELSE SWAIT=SWAIT-1
        %FINISH %ELSE %START;           ! ATOM GAP
          %IF AWAIT=0 %START
            L=L-1 %AND COUNT=COUNT-1 %IF COUNT#0
          %FINISH %ELSE AWAIT=AWAIT-1
        %FINISH
        BUFF(J)=' ' %AND J=J-1 %WHILE J#L
                                        ! SPACES INSERTED
        COLS=LINE %AND %RETURN %IF J=I
      %FINISH
      BUFF(J)=K;  J=J-1
    %REPEAT
  %END
  %ROUTINE PLACEATOM
  %INTEGER I,L,S
    %IF COLS#FIXED %AND XLINES=0 %START
      L=COLS+1;  S=' '
      %IF (BUFF(COLS)='.' %OR BUFF(COLS)='?' %C
         %OR BUFF(COLS)='!') %AND 'A'<=ABUFF(1)<='Z' %START
        L=COLS+SGAP;  S=SENTSP
      %FINISH
      %IF L+SIZE<=LINE %START
        COLS=COLS+1 %AND BUFF(COLS)=S %WHILE COLS#L
        GAPS=GAPS+1;  SGAPS=SGAPS+1 %IF S=SENTSP
      %FINISH %ELSE %START
        JUSTIFY %IF JUST#0
        PRINTDOCLINE
        PRINTSOURCELINE %IF SMAX#0
      %FINISH
    %FINISH
    I=0
    %WHILE I#SIZE %CYCLE
      COLS=COLS+1;  I=I+1
      BUFF(COLS)=ABUFF(I)
    %REPEAT
    TEXTCOLS=COLS
  %END
  %ROUTINE PROCESSDIRECTIVE
  %INTEGER C,T
  %SWITCH S('A':'Z')
  %ROUTINE %SPEC ASSIGN
    %ROUTINE SKIP
      SMAX=SMAX+1;  SBUFF(SMAX)=NEXT
      READCH(NEXT)
    %END
    %ROUTINE READNUM
      RELIND=0;  NUM=1
      RELIND=NEXT %AND SKIP %IF NEXT='+' %OR NEXT='-'
      %IF '0'<=NEXT<='9' %START
        NUM=NEXT-'0';  SKIP
        NUM=10*NUM-'0'+NEXT %AND SKIP %WHILE '0'<=NEXT<='9'
      %FINISH
      NUM=-NUM %IF RELIND='-'
    %END
    %IF XLINES#0 %START
      FAULT(6) %IF XLINES>0 %OR TEXTCOLS#0
!* I.E. FAULT IF $L NOT FINISHED OR, WITH $L0, OFF LHM, WHEN
!*      DIRECTIVE ENCOUNTERED.
      XLINES=1;  RESETDOCLINE
    %FINISH
      %IF DIRECTIVE = NL %START
         STORE(' ') %IF SMAX # 0;  STORE(ESCAPE)
      %FINISH
    %IF TEXTCOLS#0 %AND 'C'#DIRECTIVE#'T' %and directive # 'X' %START
      JUSTIFY %IF JUST#0 %AND DIRECTIVE='J'
      PRINTDOCLINE
      PRINTSOURCELINE %IF SMAX#0
    %FINISH
    PRINTSOURCELINE %IF SMAX+5>SLINE
   %RETURN %IF DIRECTIVE = NL
    STORE(' ') %IF SMAX#0
    STORE(ESCAPE);  STORE(DIRECTIVE)
    READNUM %if directive # 'X';      !cross-ref?
    ->S(DIRECTIVE)
S('A'):                                 !ASSIGN
    %CYCLE
      ASSIGN
      SKIP %WHILE NEXT#';' %AND NEXT#NL
      %EXIT %IF NEXT=NL
      SKIP
    %REPEAT
    INVERT=32 %IF INVERT#0;  INVERTO=32 %IF INVERTO#0
    PAGE=9999 %IF PAGE<=0
    FAULT(7) %AND INDENT=0 %UNLESS 0<=INDENT<=TBOUND
    INDENTCOL=TAB(INDENT)
    SETCOLUMN(INDENTCOL)
    ->S('N') %IF IGNORE#0
    %RETURN
S('B'):                                 !BLANKS
    %IF LINES#0 %OR XPAGE#0 %START;     ! NOTE XPAGE SET BY $N TO 1.
      NUM=(NUM-xpage)*NLS;      ! n-1 IFF after forcible page turn
      NUM=PAGE-LINES %IF PAGE-LINES<NUM
      PRINTDOCLINE %AND NUM=NUM-NLS %WHILE NUM>0
    %FINISH
    %RETURN
S('C'):                                 !COL
    NUM=COLS+1+NUM %IF RELIND#0
    SETCOLUMN(NUM)
    %RETURN
S('E'):                                 !END
    PRINTDOCLINE %WHILE LINES#0 %AND PAGE<999
    FINISH=PAGES;  NEXT=NL
    %RETURN
S('I'):                                 !INDENT
    NUM=INDENT+NUM %IF RELIND#0
    FAULT(7) %AND NUM=0 %UNLESS 0<=NUM<=TBOUND
    NUM=TAB(NUM)
    SETCOLUMN(NUM)
    %RETURN
S('J'):                                 !JUSTIFY (DONE)
    %RETURN
S('L'):                                 !LINES
    XLINES=NUM;  XLINES=-1 %IF XLINES=0
    INDENTIND=0
    %WHILE NEXT#NL %CYCLE
      LINECAPIND=CASEBIT %IF NEXT&LETMASK='C'
      LINEUNDIND=UNDBIT %IF NEXT&LETMASK='U'
      LINEMIDIND=1 %IF NEXT&LETMASK='M'
      INDENTIND=1 %IF NEXT&LETMASK='I'
      SKIP
    %REPEAT
    COLS=0 %AND FIXED=0 %IF INDENTIND=0
    %RETURN
S('N'):                                 !NEWPAGE
S('S'):
    %RETURN %IF PAGE>=999
    PRINTDOCLINE %WHILE LINES#0
    XPAGE=1
    %IF DIRECTIVE='S' %AND SECTNO # 0 %START
      SECTNO = SECTNO+1 %IF SECTNO # 0; PAGENO=1
    %FINISH
    %RETURN
S('P'):                                 !PARAGRAPH
    %IF LINES#0 %START
      NUM=NUM*NLS
      NUM=PAGE-LINES %IF PAGE-LINES<NUM+2
      PRINTDOCLINE %AND NUM=NUM-NLS %WHILE NUM>0
    %FINISH
    SETCOLUMN(COLS+1+PGAP)
    %RETURN
S('T'):                                 !TAB
    %IF RELIND#0 %START
      T=0;  C=COLS+1
      %IF RELIND='+' %START
        %WHILE NUM>0 %CYCLE
          T=T+1 %UNTIL T>TBOUND %OR TAB(T)>C
          FAULT(7) %AND %RETURN %IF T>TBOUND
          C=TAB(T)
          NUM=NUM-1
        %REPEAT
      %FINISH %ELSE %START
        T=T+1 %UNTIL T>TBOUND %OR TAB(T)>=C
        %WHILE NUM<0 %CYCLE
          T=T-1 %UNTIL T<0 %OR TAB(T)<C
          FAULT(7) %AND %RETURN %IF T<0
          C=TAB(T)
          NUM=NUM+1
        %REPEAT
      %FINISH
    %FINISH %ELSE %START
      FAULT(7) %AND %RETURN %UNLESS 0<=NUM<=TBOUND
      C=TAB(NUM)
    %FINISH
    SETCOLUMN(C)
    %RETURN
S('V'):                                 !VERIFY
    %IF PAGE-LINES<NUM*NLS %START
      PRINTDOCLINE %WHILE LINES#0
      XPAGE=1
    %FINISH
    %RETURN
s('X'):                  !INDEX
      smax = smax-2 %if output type # update;   ! delete '$X'
      next = 0 %if next = ' ' %or next = NL
      read atom or directive;         ! get index atom
      fault(17) %and %return %if directive # 0;      ! it's missing
      %if output type = index %start
         smax = 0;            ! ensure this 'source' output is blank
         nstore(sect no);  nstore(page no)
         output type = update
         store source atom;  print source line
         output type = index
      %else %if output type = update
         store source atom
      %finish
      size = 0 %if output type # update;      ! delete index atom
      %return
S('D'):               ! ***** change to DUMP DEFAULTS ******
S('F'):
S('G'):
S('H'):
S('K'):
S('M'):
S('O'):
S('Q'):
S('R'):
S('U'):
S('W'):
S('Y'):
S('Z'):
    FAULT(5)
    %ROUTINE NEWCELL(%INTEGER H, %INTEGER %NAME T)
    %INTEGER P
      %IF FREELIST=0 %START
        FAULT(10)
        PRINTSOURCELINE
        %STOP
      %FINISH
      P=FREELIST;  FREELIST=HEAD(FREELIST)
      HEAD(P)=H;  TAIL(P)=T
      T=P
    %END
    %ROUTINE POP(%INTEGER %NAME L)
      HEAD(L)=FREELIST;  FREELIST=L
      L=TAIL(L)
    %END
    %ROUTINE ASSIGN
    %CONST %INTEGER NAMEMAX=40
    %INTEGER I,J,K,L,M,SWOP
   %RECORD(PRINTFM)%NAME  P,Q
    %ROUTINE %SPEC READNAME(%INTEGER %NAME ORDINAL)
    %INTEGER %MAP %SPEC MAP(%INTEGER I)
   %ROUTINESPEC  READ N(%SHORTINTEGERNAME  N)
   %routinespec  read string(%string(35)%name  s)
      READNAME(I);  %RETURN %IF I=0
      SKIP %WHILE NEXT=' '
   %IF LINES # 0 %START;        ! LINES ON CURRENT PAGE
      %IF 11 <= I <= 16 %START
         FAULT(12);           ! MISPLACED DIRECTIVE
      %FINISH
   %FINISH
   %IF I = 36 %START;           ! PRINT
      FAULT(1) %AND %RETURN %IF NEXT # '='
      %CYCLE
         SKIP;            ! either = or ,
         %IF LAST PRINT = PRINT MAX %THEN FAULT(13) %ELSE  %C
                                 LAST PRINT = LAST PRINT + 1
         P == PRINT LIST(LAST PRINT)
         READN(P_SECTION)
         SKIP %WHILE NEXT = ' '
         %IF NEXT = '-' %START
            SKIP %UNTIL NEXT # ' '
            %IF NEXT = '*' %START
               SKIP;  P_PAGE = PPS-1
            %ELSE
               READN(P_PAGE)
            %FINISH
         %ELSE
            P_PAGE = P_SECTION
            P_SECTION = 0
         %FINISH
         SKIP %WHILE NEXT = ' '
         %EXIT %IF NEXT # ','
      %REPEAT
      %CYCLE
         SWOP = 0;  Q == PRINT LIST(1)
         %FOR K = 2,1,LAST PRINT %CYCLE
            P == Q;  Q == PRINT LIST(K)
            %IF P_SECTION*PPS+P_PAGE >= Q_SECTION*PPS+Q_PAGE %START
               L = P_SECTION;  M = P_PAGE
               P_SECTION = Q_SECTION;  P_PAGE = Q_PAGE
               Q_SECTION = L;  Q_PAGE = M
               SWOP = 1
            %FINISH
         %REPEAT
         %EXIT %IF SWOP = 0
      %REPEAT
      %FOR J = 1,1,LAST PRINT-1 %CYCLE
         P == PRINT LIST(J);  Q == PRINT LIST(J+1)
         %IF P_SECTION = Q_SECTION %AND P_PAGE = Q_PAGE %START
            FAULT(14);  %RETURN
         %FINISH
      %REPEAT
      %RETURN
   %else %if i = 37;               ! INCLUDE file
      fault(1) %and %return %if next # '=';  skip
      fault(16) %if include file # "";      ! already including
      read string(include file)
      include stream = lsin;  include stream = 1 %if sin # 1;  !**** LSIN > 1???
      open input(include stream, include file)
      select input(include stream)
      old at line = at line;  at line = 1
      %if inclusion mode = 0 %start;         ! literal merge into update
         smax = 0;   ! delete INCLUDE line
      %else
         print source line;     ! copy INCLUDE line
         inclusion mode = -1;   ! don't copy body to update
      %finish
      %return
   %else %if i = 38;               ! define OUTPUT type
      fault(1) %and %return %if next # '=';  skip
      read string(output ident)
      %if pages = 0 = lines %start
         output type = output name(output ident)
      %else
         fault(12);               ! misplaced directive
      %finish
      %return
   %FINISH
      %IF NEXT='<' %OR NEXT='>' %START
        J=I
        %CYCLE
          %IF NEXT='<' %START
            NEWCELL(MAP(J),LINK(J))
          %FINISH %ELSE %START
            FAULT(11) %AND %RETURN %IF LINK(J)=0
            %IF 1<=J<=6 %AND TYPE(MAP(J))&15=J %START
              K=MAP(J)
              %CYCLE
                TYPE(K)=TYPE(K)>>4
                %EXIT %IF TYPE(K)=0 %OR MAP(TYPE(K)&15)=K
              %REPEAT
            %FINISH
            MAP(J)=HEAD(LINK(J))
            TYPE(MAP(J))=TYPE(MAP(J))<<4!J %IF 1<=J<=6
            POP(LINK(J))
          %FINISH
          J=J+1
          %EXIT %IF J<NAMEMAX %OR J>=65
        %REPEAT
        SKIP %UNTIL NEXT#' '
        %RETURN %IF NEXT=';' %OR NEXT=NL
      %FINISH
      FAULT(1) %AND %RETURN %IF NEXT#'='
      %CYCLE
        SKIP %UNTIL NEXT#' '
        %IF 'A'<=NEXT&LETMASK<='Z' %START
                                        ! RHS ALSO PARAMETER.
          READNAME(J);  %RETURN %IF J=0
        %FINISH %ELSE %START
          J=0
          %IF NEXT='''' %START
            SKIP;                       !QUOTEMARK
            NUM=NEXT;  SKIP;            !QUOTED SYMBOL
            SKIP;                       !QUOTEMARK (PRESUMABLY)
          %FINISH %ELSE %START
            READNUM
            NUM=MAP(I)+NUM %IF RELIND#0
          %FINISH
        %FINISH
        %IF 1<=I<=6 %AND TYPE(MAP(I))&15=I %START
          K=MAP(I)
!* MAP(I) IS CURRENTLY ACTIVE, I.E. ITS ENTRY IN TYPE REFERS TO IT.
          %CYCLE
            TYPE(K)=TYPE(K)>>4
            %EXIT %IF TYPE(K)=0 %OR MAP(TYPE(K)&15)=K
          %REPEAT
        %FINISH
        %CYCLE
          MAP(I)=MAP(J);                ! N.B. MAP(0)==NUM.
          TYPE(MAP(I))=TYPE(MAP(I))<<4!I %IF 1<=I<=6
          I=I+1;  J=J+1
          %EXIT %IF J<NAMEMAX
          %EXIT %IF I<NAMEMAX %OR I=65
        %REPEAT
        %EXIT %UNLESS NEXT=',' %AND I>NAMEMAX
      %REPEAT
      FAULT(1) %UNLESS NEXT=';' %OR NEXT=NL
      %routine read string(%string(35)%name  s)
         %integer  k,sym
         s = ""
         %cycle
            sym = next & 127;  %exit %if sym = ';' %or sym = NL
            skip
            %if sym # ' ' %start
               sym = sym-'a'+'A' %if 'a' <= sym <= 'z'
               s = s.tostring(sym) %if length(s) # 35
            %finish
         %repeat
      %end;      ! read string
      %routine  get(%integername  k)
         k = 0 %and %return %unless 'A' <= next & let mask <= 'Z'
         k = next & let mask;  skip
      %end
      %ROUTINE READNAME(%INTEGER %NAME ORDINAL)
      %string(7) ident
      %integer  sym
      %conststring(7)%array  name(1:name max) =
         "CAPSH",  "ESCAPE",  "CAP",    "UND",  "spare",   "UNDSH",
         "NLS", "SGAP",   "PGAP",    "INDENT", "TOP", "BOTTOM",
         "LEFT", "PAGE", "LINE", "SLINE", "INVERT", "CAPO",
         "UNDO", "CAPSHO", "UNDSHO", "INVERTO", "ASCII", "JUST",
         "MARK",  "START",  "FINISH",  "PAGENO", "IGNORE", "SECTNO",
         "DLPI", "DCPI", "DLEFT",  "DPAGE", "DTOP" ,"PRINT",
         "INCLUDE",      "OUTPUT",    "SPLAT",   "TAB"

         skip %while next=' '
         ident = ""
         %cycle
            get(sym);  %exit %if sym = 0
            ident = ident.tostring(sym) %if length(ident) # 7
         %repeat
         fault(1) %and ordinal = 0 %and %return %if ident = ""
         %for ordinal = 1,1,name max %cycle
            %return %if name(ordinal) = ident
         %repeat
         fault(3);  ordinal=0
      %END;                             !READ NAME
      %INTEGER %MAP MAP(%INTEGER I)
      %SWITCH S(0:NAME MAX)
        %RESULT ==TAB(I-(NAMEMAX-1)) %IF I>=NAMEMAX
        ->S(I)
S(0):   %RESULT ==NUM
S(1):   %RESULT ==CAPSH
S(2):   %RESULT ==ESCAPE
S(3):   %RESULT ==CAP
S(4):   %RESULT ==UND
S(6):   %RESULT ==UNDSH
S(7):   %RESULT ==NLS
S(8):   %RESULT ==SGAP
S(9):   %RESULT ==PGAP
S(10):  %RESULT ==INDENT
S(11):  %RESULT ==TOP
S(12):  %RESULT ==BOTTOM
S(13):  %RESULT ==LEFT
S(14):  %RESULT ==PAGE
S(15):  %RESULT ==LINE
S(16):  %RESULT ==SLINE
S(17):  %RESULT ==INVERT
S(18):  %RESULT ==CAPO
S(19):  %RESULT ==UNDO
S(20):  %RESULT ==CAPSHO
S(21):  %RESULT ==UNDSHO
S(22):  %RESULT ==INVERTO
S(23):  %RESULT ==ASCII
S(24):  %RESULT ==JUST
S(25):  %RESULT ==MARK
S(26):  %RESULT ==START
S(27):  %RESULT ==FINISH
S(28):  %RESULT ==PAGENO
S(29):  %RESULT ==IGNORE
S(30):  %RESULT ==SECTNO
S(31):  %RESULT == DLPI
S(32):  %RESULT == DCPI
S(33):  %RESULT == DLEFT
S(34):  %RESULT == DPAGE
S(35):  %RESULT == DTOP
   ! 36 = PRINT
   ! 37 = INCLUDE
   ! 38 = OUTPUT
s(39):   %signal 15,15
   ! 40 = TAB
s(*):   %result == num;           !  all the odds and sods
      %END;                             !MAP
      %ROUTINE  READ N(%SHORTINTEGERNAME  N)
         SKIP %WHILE NEXT = ' '
         N = 0
         %IF NEXT = '?' %START
            SKIP
         %ELSE
            %WHILE '0' <= NEXT <= '9' %CYCLE
               N = 10*N + NEXT - '0'
               SKIP
            %REPEAT
         %FINISH
      %END;            ! READ N
    %END;                               !ASSIGN
  %END;                                 !PROCESS DIRECTIVE

! =================== IT ALL STARTS HERE =====================
   %unless exists(in1) %start
      %if exists(in1.".lay") %start
         in1 = in1.".lay"
      %else
         printstring("* LAYOUT fails -- ".in1." does not exist")
         newline
         %stop
      %finish
   %finish
   open input(1, in1);  open output(1, out1)
   select input(1);  select output(1)
   output type = output name(parm)
   %if output type = printer %start
      print symbol(12);      ! initial page throw
   %else %if output type = merge
      inclusion mode = 0
      output type = update
   %else %if output type = index
      inclusion mode = 0
   %finish
   PROMPT(">")
  %CYCLE NUM=0,1,127;  TYPE(NUM)=0
  %REPEAT
  %CYCLE NUM='A',1,'Z';  TYPE(NUM)=8
  %REPEAT
  %CYCLE NUM='A'!32,1,'Z'!32;  TYPE(NUM)=8
  %REPEAT
  TYPE(CAPSH)=1;  TYPE(ESCAPE)=2;  TYPE(CAP)=3
  TYPE(UND)=4;  TYPE(UNDSH)=6
  TYPE(' ')=7;  TYPE(NL)=7
  SELECTINPUT(SIN)
  SELECTOUTPUT(out)
  %CYCLE FREELIST=1,1,65
    LINK(FREELIST)=0
  %REPEAT
  %CYCLE FREELIST=1,1,500
    HEAD(FREELIST)=FREELIST-1
  %REPEAT
  %WHILE PAGES<FINISH %CYCLE
    READATOMORDIRECTIVE
    %IF DIRECTIVE#0 %START
      PROCESSDIRECTIVE
    %FINISH %ELSE %START
      %IF SIZE#0 %START
        PLACEATOM
        STORESOURCEATOM
        NEXT=0 %IF NEXT=NL %AND XLINES=0
      %FINISH
      %IF XLINES#0 %START
        %IF NEXT=' ' %START
          STORE(NEXT)
          COLS=COLS+1;  BUFF(COLS)=' '
        %FINISH
        PRINTDOCLINE %IF NEXT=NL
      %FINISH
    %FINISH
    PRINTSOURCELINE %IF NEXT=NL
    NEXT=0 %IF NEXT=' ' %OR NEXT=NL
  %REPEAT
  PRINTDOCLINE
   %if output type = index %start
      print string("-1 -1  *end*");  newline;   ! a comprehensive terminator!
   %finish
%END %OF %PROGRAM
= 2,1,LAST PRINT %CYCLE
            P == Q;  Q == PRINT LIST(K)
            %IF P_SECTION*PPS+P_PAGE >= Q_SECTION*PPS+Q_PAGE %START
               L = P_SECTION;  M = P_PAGE
               P_SECTION = Q_SECTION;  P_PAGE = Q_PAGE
               Q_SECTION = L;  Q_PAGE = M
               SWOP = 1
            %FINISH
         %REPEAT
         %EXIT %IF SWOP = 0
      %REPEAT
      %FOR J = 1,1,LAST PRINT-1 %CYCLE
         P == PRINT LIST(J);  Q == PRINT LIST(J+1)
         %IF P_SECTION = Q_SECTION %AND P_PAGE = Q_PAGE %START
            FAULT(14);  %RETURN
         %FINISH
      %REPEAT
      %RETURN
   %else %if i = 37;               ! INCLUDE file
      fault(1) %and %return %if next # '=';  skip
      fault(16) %if include file # "";      ! already including
      read string(include file)
      include stream = lsin;  include stream = 1 %if sin # 1;  !**** LSIN > 1???
      open input(include stream, include file)
      select input(include stream)
      old at line = at line;  at line = 1
      %if inclusion mode = 0 %start;         ! literal merge into update
         smax = 0;   ! delete INCLUDE line
      %else
         print source line;     ! copy INCLUDE line
         inclusion mode = -1;   ! don't copy body to update
      %finish
      %return
   %else %if i = 38;               ! define OUTPUT type
      fault(1) %and %return %if next # '=';  skip
      read string(output ident)
      %if pages = 0 = lines %start
         output type = output name(output ident)
      %else
         fault(12);               ! misplaced directive
      %finish
      %return
   %FINISH
      %IF NEXT='<' %OR NEXT='>' %START
        J=I
        %CYCLE
          %IF NEXT='<' %START
            NEWCELL(MAP(J),LINK(J))
          %FINISH %ELSE %START
            FAULT(11) %AND %RETURN %IF LINK(J)=0
            %IF 1<=J<=6 %AND TYPE(MAP(J))&15=J %START
              K=MAP(J)
              %CYCLE
                TYPE(K)=TYPE(K)>>4
                %EXIT %IF TYPE(K)=0 %OR MAP(TYPE(K)&15)=K
              %REPEAT
            %FINISH
            MAP(J)=HEAD(LINK(J))
            TYPE(MAP(J))=TYPE(MAP(J))<<4!J %IF 1<=J<=6
            POP(LINK(J))
          %FINISH
          J=J+1
          %EXIT %IF J<NAMEMAX %OR J>=65
        %REPEAT
        SKIP %UNTIL NEXT#' '
        %RETURN %IF NEXT=';' %OR NEXT=NL
      %FINISH
      FAULT(1) %AND %RETURN %IF NEXT#'='
      %CYCLE
        SKIP %UNTIL NEXT#' '
        %IF 'A'<=NEXT&LETMASK<='Z' %START
                                        ! RHS ALSO PARAMETER.
          READNAME(J);  %RETURN %IF J=0
        %FINISH %ELSE %START
          J=0
          %IF NEXT='''' %START
            SKIP;                       !QUOTEMARK
            NUM=NEXT;  SKIP;            !QUOTED SYMBOL
            SKIP;                       !QUOTEMARK (PRESUMABLY)
          %FINISH %ELSE %START
            READNUM
            NUM=MAP(I)+NUM %IF RELIND#0
          %FINISH
        %FINISH
        %IF 1<=I<=6 %AND TYPE(MAP(I))&15=I %START
          K=MAP(I)
!* MAP(I) IS CURRENTLY ACTIVE, I.E. ITS ENTRY IN TYPE REFERS TO IT.
          %CYCLE
            TYPE(K)=TYPE(K)>>4
            %EXIT %IF TYPE(K)=0 %OR MAP(TYPE(K)&15)=K
          %REPEAT
        %FINISH
        %CYCLE
          MAP(I)=MAP(J);                ! N.B. MAP(0)==NUM.
          TYPE(MAP(I))=TYPE(MAP(I))<<4!I %IF 1<=I<=6
          I=I+1;  J=J+1
          %EXIT %IF J<NAMEMAX
          %EXIT %IF I<NAMEMAX %OR I=65
        %REPEAT
        %EXIT %UNLESS NEXT=',' %AND I>NAMEMAX
      %REPEAT
      FAULT(1) %UNLESS NEXT=';' %OR NEXT=NL
      %routine read string(%string(35)%name  s)
         %integer  k,sym
         s = ""
         %cycle
            sym = next & 127;  %exit %if sym = ';' %or sym = NL
            skip
            %if sym # ' ' %start
               sym = sym-'a'+'A' %if 'a' <= sym <= 'z'
               s = s.tostring(sym) %if length(s) # 35
            %finish
         %repeat
      %end;      ! read string
      %routine  get(%integername  k)
         k = 0 %and %return %unless 'A' <= next & let mask <= 'Z'
         k = next & let mask;  skip
      %end
      %ROUTINE READNAME(%INTEGER %NAME ORDINAL)
      %string(7) ident
      %integer  sym
      %conststring(7)%array  name(1:name max) =
         "CAPSH",  "ESCAPE",  "CAP",    "UND",  "spare",   "UNDSH",
         "NLS", "SGAP",   "PGAP",    "INDENT", "TOP", "BOTTOM",
         "LEFT", "PAGE", "LINE", "SLINE", "INVERT", "CAPO",
         "UNDO", "CAPSHO", "UNDSHO", "INVERTO", "ASCII", "JUST",
         "MARK",  "START",  "FINISH",  "PAGENO", "IGNORE", "SECTNO",
         "DLPI", "DCPI", "DLEFT",  "DPAGE", "DTOP" ,"PRINT",
         "INCLUDE",      "OUTPUT",    "SPLAT",   "TAB"

         skip %while next=' '
         ident = ""
         %cycle
            get(sym);  %exit %if sym = 0
            ident = ident.tostring(sym) %if length(ident) # 7
         %repeat
         fault(1) %and ordinal = 0 %and %return %if ident = ""
         %for ordinal = 1,1,name max %cycle
            %return %if name(ordinal) = ident
         %repeat
         fault(3);  ordinal=0
      %END;                             !READ NAME
      %INTEGER %MAP MAP(%INTEGER I)
      %SWITCH S(0:NAME MAX)
        %RESULT ==TAB(I-(NAMEMAX-1)) %IF I>=NAMEMAX
        ->S(I)
S(0):   %RESULT ==NUM
S(1):   %RESULT ==CAPSH
S(2):   %RESULT ==ESCAPE
S(3):   %RESULT ==CAP
S(4):   %RESULT ==UND
S(6):   %RESULT ==UNDSH
S(7):   %RESULT ==NLS
S(8):   %RESULT ==SGAP
S(9):   %RESULT ==PGAP
S(10):  %RESULT ==INDENT
S(11):  %RESULT ==TOP
S(12):  %RESULT ==BOTTOM
S(13):  %RESULT ==LEFT
S(14):  %RESULT ==PAGE
S(15):  %RESULT ==LINE
S(16):  %RESULT ==SLINE
S(17):  %RESULT ==INVERT
S(18):  %RESULT ==CAPO
S(19):  %RESULT ==UNDO
S(20):  %RESULT ==CAPSHO
S(21):  %RESULT ==UNDSHO
S(22):  %RESULT ==INVERTO
S(23):  %RESULT ==ASCII
S(24):  %RESULT ==JUST
S(25):  %RESULT ==MARK
S(26):  %RESULT ==START
S(27):  %RESULT ==FINISH
S(28):  %RESULT ==PAGENO
S(29):  %RESULT ==IGNORE
S(30):  %RESULT ==SECTNO
S(31):  %RESULT == DLPI
S(32):  %RESULT == DCPI
S(33):  %RESULT == DLEFT
S(34):  %RESULT == DPAGE
S(35):  %RESULT == DTOP
   ! 36 = PRINT
   ! 37 = INCLUDE
   ! 38 = OUTPUT
s(39):   %signal 15,15
   ! 40 = TAB
s(*):   %result == num;           !  all the odds and sods
      %END;                             !MAP
      %ROUTINE  READ N(%SHORTINTEGERNAME  N)
         SKIP %WHILE NEXT = ' '
         N = 0
         %IF NEXT = '?' %START
            SKIP
         %ELSE
            %WHILE '0' <= NEXT <= '9' %CYCLE
               N = 10*N + NEXT - '0'
               SKIP
            %REPEAT
         %FINISH
      %END;            ! READ N
    %END;                               !ASSIGN
  %END;                                 !PROCESS DIRECTIVE

! =================== IT ALL STARTS HERE =====================
   %unless exists(in1) %start
      %if exists(in1.".lay") %start
         in1 = in1.".lay"
      %else
         printstring("* LAYOUT fails -- ".in1." does not exist")
         newline
         %stop
      %finish
   %finish
   open input(1, in1);  open output(1, out1)
   select input(1);  select output(1)
   output type = output name(parm)
   %if output type = printer %start
      print symbol(12);      ! initial page throw
   %else %if output type = merge
      inclusion mode = 0
      output type = update
   %else %if output type = index
      inclusion mode = 0
   %finish
   PROMPT(">")
  %CYCLE NUM=0,1,127;  TYPE(NUM)=0
  %REPEAT
  %CYCLE NUM='A',1,'Z';  TYPE(NUM)=8
  %REPEAT
  %CYCLE NUM='A'!32,1,'Z'!32;  TYPE(NUM)=8
  %REPEAT
  TYPE(CAPSH)=1;  TYPE(ESCAPE)=2;  TYPE(CAP)=3
  TYPE(UND)=4;  TYPE(UNDSH)=6
  TYPE(' ')=7;  TYPE(NL)=7
  SELECTINPUT(SIN)
  SELECTOUTPUT(out)
  %CYCLE FREELIST=1,1,65
    LINK(FREELIST)=0
  %REPEAT
  %CYCLE FREELIST=1,1,500
    HEAD(FREELIST)=FREELIST-1
  %REPEAT
  %WHILE PAGES<FINISH %CYCLE
    READATOMORDIRECTIVE
    %IF DIRECTIVE#0 %START
      PROCESSDIRECTIVE
    %FINISH %ELSE %START
      %IF SIZE#0 %START
        PLACEATOM
        STORESOURCEATOM
        NEXT=0 %IF NEXT=NL %AND XLINES=0
      %FINISH
      %IF XLINES#0 %START
        %IF NEXT=' ' %START
          STORE(NEXT)
          COLS=COLS+1;  BUFF(COLS)=' '
        %FINISH
        PRINTDOCLINE %IF NEXT=NL
      %FINISH
    %FINISH
    PRINTSOURCELINE %IF NEXT=NL
    NEXT=0 %IF NEXT=' ' %OR NEXT=NL
  %REPEAT
  PRINTDOCLINE
   %if output type = index %start
      print string("-1 -1  *end*");  newline;   ! a comprehensive terminator!
   %finish
%END %OF %PROGRAM
ion
            %if X = 0 %start
               ! Null phrase
               Next = P_Link ; -> GN
            %finish
            %if P_Link # 0 %start
               ! Follow a phrase
               P_Sub = Link
               Link  = Next
            %finish
            Next = X
         %repeat
         Next = P_Link
         %if Diag&Diag Compiler # 0 %start
            Spaces(8-Length(Name)) %unless Name = ""
            Name = Text(Class)
            Write(X, 2)
            Space
            Print String(Name)
            Sm
    read item;  -> er1 %if type # 1
    -> restore
  %finish
  %if sym = '%' %start
    read sym;  -> erq %if sym < 'A'
    code = sym&95;                      !upper-case
    read sym
    -> pc(symtype(code)>>4&7)
  %finish
  dir = 0
  %if video > 0 %start
    clear line;  print symbol('=')
    print symbol(sym)
    echo = 1
  %finish
! C o m m a n d   i n p u t:  m a i n   l o o p
more:                                   !(command code has been read)
  hold = type;  -> er2 %if hold < 4
  -> er0 %if hold < 8 %and newtop = 0;  !no changes when Showing
  ci = ci+1;  -> er6 %if ci >= cbound-3
  code = sym;                           !command letter
  ref = 0;  num = 1;  scope = 1;        !default values
  read item
  -> c(hold)
c(8):                                   !Find
  minus
  scope = 0
c(4):                                   !+ Delete, Uncover
c(9):                                   !+ Traverse, Verify
  %if type = 0 %start;                  !followed by number
    scope = num
    read item
  %finish
  num = 0;                              !as indicator (not I,S)
c(5):                                   !+ Insert, Substitute
  hold = sym;  -> er4 %if type # 3;     !not valid quote mark ->
  ti = ti+1;  ref = ti;                 !REF indexes first quoted symbol
  %cycle
    read sym
    %if sym = nl %start;                !closing quote omitted
      -> er4 %if num = 0;               !allowed only for I,S
      pend = sym;  sym = hold
    %finish
    %exit %if sym = hold
    -> er6 %if ti > tbound-2
    sym = sym&casemask %if 'a' <= sym <= 'z' %and num = 0
    text(ti) = sym;  ti = ti+1
  %repeat
  -> er4 %if ti = ref %and num = 0;     !null allowed only for I,S
  text(ti) = 0;                         !end-marker
  num = 1;                              !restore default
  read item
  -> nput
c(6):                                   !Erase
c(10):                                  !+ Move, Print
  minus
c(7):                                   !+ Get, Kill, etc
c(11):                                  !+ Left, Right, etc
  -> er1 %if type = 3;                  !(redundant, but better report)
  -> nput
c(12):                                  !open bracket
  code = '['
  -> comma
c(13):                                  !comma
  code = '^'
! read item %if type = 1;               !permit line break (better not?)
comma:
  ref = chain;  chain = ci
  -> put
c(14):                                  !close bracket
  unchain;  -> er3 %if ref = 0
  code = ']';  r(ref)_count = num
nput:
  read item %if type = 0;               !get %own %string(*)%name line             {Current command line}
%own %integer inp                     {Position in line}
%own %integer sym, sym type           {Last char extracted from line}
!
! Symbol types:
!
!  0   a   A   .  SP  NL   o  (
!  :   :   :   #           t  [
!  9   z   Z   $           h  {
!              :           e  <
!              _           r  -
!  
!  0   1   2   3   4   5   6  128+closing bracket
!                            (128+NL for '-')
!
%constbytearray Type(0:127) =
   6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?},
   6 {?}, 6 {?}, 5 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?},
   6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?},
   6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?}, 6 {?},
   4 { }, 6 {!}, 6 {"}, 3 {#}, 3 {$}, 6 {%}, 6 {&}, 6 {'},
 128+')', 6 {)}, 9 {*}, 9 {+}, 6 {,},128+NL, 3 {.}, 6 {/},
   0 {0}, 0 {1}, 0 {2}, 0 {3}, 0 {4}, 0 {6}, 0 {0}, 0 {7},
   0 {8}, 0 {9}, 3 {:}, 6 {;},128+'>',6 {=}, 6 {>}, 6 {?},
   6 {@}, 2 {A}, 2 {B}, 2 {C}, 2 {D}, 2 {E}, 2 {F},  %cycle
         print symbol (sym)
         get sym
      %repeat
      print symbol ('?');  newline
      %return
   %finish
   {Do the command}
   %if skipping = 0 %or char no(command_command,1) = '$' %start
      %if flag = 0 %start                {Executable program}
         Run Program (Program)           {Loaded before command parse}
      %else %if flag < 0                 {An obeyfile}
         Obey (Obey File,"Out:",Command_Parameter)
      %else
         LoadX (Command_Command,Program_Spec)   {load external}
         Run Program (Program)
      %finish
   %finish
   Close All(0)
%end
%externalroutine DO(%string(127) What)
   DoIt(What)
%end

%system %integer ECHO OBEY = -1
   !Normally 0 (no echo) or 1 (echo on).  Only negative at very beginning,
   !to let SUBSYSTEM (at label STARTUP) decide whether it has just started
   !or just come back from an Int:.

%routine Show Elapsed
   %owninteger Elapsed = 0
   Printstring(Time)
   N = Cputime
   Print((N-Elapsed)//1000, 5,1)
   Elapsed = N
   Printstring(" CPU seconds")
   Newline
%end
%external %routine OBEY (%string(31) from,to, %string(63) params)
   %own %string(127) line
   %record(FD fm)%name FD, old command, old report
   %record(Parmpfm) Parm
   %integer j, nparms, old echo Obey = ECHO Obey, old skip = SKIPPING
   %integer Old Segs      = Current Segs,
            Old work segs = Work Segs,
            Base Load
   %record(Progfm) Prog

   %on stream error %start               {End of .COM file or $EXIT}
      Obey Level   = Obey Level-1
      Work Segs    = Old work segs
      Current Segs = Old segs
      Close in (0);  Close out (0,0)
      In  stream(0) == old command
      Out stream(0) == old report
      select input(0);  select output(0)
      {Restore buffers, which were saved in the files}
      Read block (old command_key, old command_Bn, addr(old command_buf)) %c
         %if old command_key # 0
      Read block (old report_key, old report_Bn+1, addr(old report_buf))  %c
         %if old report_key # 0
      SKIPPING = old skip
      ECHO Obey = old echo Obey
      %return
   %finish

   Parmp == Parm
   %if Obey Level = 1 %start
      Relocate(Loaded(Loaded Files)) %if Loadup(Prog, Batch File)
   %finish
   Obey Level = Obey Level+1
   Base Load  = Loaded Files+1
   %if Echo Obey < 0 %start            {first entry}
      Echo Obey = 0
      Run(Subinit)
   %finish

   %routine Get Line
      %integer Sym
      Prompt(Command Prompt)
      Line = ""
      %cycle
         Sym = Readsymbol;  %exit %if Sym = Nl
         %if Sym = '&' %and Nextsymbol = Nl %start
            Skipsymbol
         %else
            Line = Line.Tostring(Sym)
         %finish
      %repeat
      Console(Prompt Text.Line) %if Echo Obey # 0
   %end

   %own %byte %name len, p, limit
   params = params.","
   limit == char no(params,length(params))
   Nparms = 0
   p == length(params)
   %cycle
      len == p;  j = 0
      %cycle
         p == p ++ 1;  j = j + 1
      %repeat %until p = ','
      len = j - 1
      Nparms = Nparms + 1
      Parm_Parm(Nparms) == string(addr(len))
   %repeat %until p == limit

   old command == in stream(0)
   in stream(0)== null FD
   {Must clear INSTREAM(0), or OPENIN will return the FD pointed at by
   {OLD COMMAND to the free list when it calls CLOSE IN(0)
   Open in (0,from)
   old report   == out stream(0)
   out stream(0)== null FD
   {for output must save half-written buffer in file..}
   FD == out stream(0)
   %if FD_key # 0 %start              {forget about NULL:, T:}
      Write block (FD_key, FD_Bn+1, addr(FD_buf))
   %finish
   Open out (0,to)

   Current Segs = Current Segs&(~Work Segs)
   Work Segs    = 0
   %cycle
      Select input (0);  Select output (0)
      Unload(Base Load)
      Tlib_Name = ""
      Unstack Conts(1)
      Tidy Segs
      Console Int = ""
      Terminal Mode(0) %if TT Mode # 0
      Break output
      Get Line  %until Line # ""
      DoIt (Line)
      Show Elapsed %if Options&Opt Monitor # 0
   %repeat
%end

%end %of %file
ng(Intpt(R)+'0')
   %repeat
%end

%externalstring(64)%fn FtoS(%real r, %integer p)
   %string(64) S = ""
   %integer    Exp, Sym
   P = 7 %if P > 7
   %if R < 0 %then Sym = '-' %and R = -R  %c
             %else Sym = ' '
   %if R = 0 %start
      Exp = -99
   %else
      Exp = 0
      Exp = Exp+1 %and R = R/10 %while R >= 10
      Exp = Exp-1 %and R = R*10 %while R < 1
   %finish
   Round(R, P)
   Exp = Exp+1 %and R = R-1 %if R >= 10
   S = S.Tostring(Intpt(R)+'0')
   Fraction(R, P, S)
   S = S."@".ItoS(Exp, 0)
   %result = S
%end
%externalroutine PrintFl(%real R, %integer Places)
   Printstring(Ftos(R, Places))
%end

%externalstring(63)%fn RtoS(%real R, %integer A, B)
   %integer Before
   %real    Rm
   %string(63) S = ""
   %constinteger Max Int = (-1) >> 1
   A = 63-8 %if A > 63-8
   B =  7   %if B > 7
   Round(R, B)
   Rm = |R|
   %result = FtoS(R, A+B) %if Rm > Max Int
   Before = Intpt(R)
   %if Before = 0 %and r < 0 %start
      %while A > 0 %cycle
         A = A-1
         S = S." "
      %repeat
      S = S."-0"
   %else
      S = ItoS(Before, A)
   %finish
   Fraction(Rm, B, S)
   %result = S
%end
%externalroutine Print(%real R, %integer B, A)
   Printstring(RtoS(R, B, A))
%end

%externalstring(8)%fn XTOS(%integer n, p)
   %string(8) s = ""
   %integer k
   p = 8 %if p > 8
   N = N<< ( 4*(8-P) )
   %cycle
      k = n>>28&15;  n = n<<4
      %if k > 9 %then k = k-10+'A' %else k = k+'0'
      s = s.tostring(k)
      p = p-1
      %result = s %if p <= 0
   %repeat
%end

%externalroutine PHEX(%integer n, p)
   printstring(XTOS(n, p))
%end

%externalroutine READ(%name NN)
   %string(255)  st
   %integer sign, n, len, adr, type, s, base, Flag
   %real  r, exp, f
   %constinteger  integers=1,
                  reals=2,
                  strings=3,
                  records=4,
                  bytes=5,
                  shorts=6,
                  long reals=7
   %switch  TP(integers:longreals)
   len = size of(NN);  adr = addr(NN)
   len = adr>>24+1 %if len = 0
   type = type of(NN)
   %unless  integers <= type <= longreals %and type # records %start
TP(records):      %signal 5,5,type
   %finish
   skip symbol %while next symbol = ' ' %or next symbol = NL
   %if type = strings %start
      st = ""
      %cycle
         s = next symbol
         %exit %if s = ' ' %or s = NL
         st = st.tostring(s)
         skip symbol
      %repeat
      %signal 1,3 %if len <= length(st)
      string(adr) = st
      %return
   %finish

   ! read a number
   sign = 0;  Base = 10
   sign = readsymbol %if next symbol = '-' %or next symbol = '+'
   %cycle
      n = 0;  Flag = 0
      %cycle
         s = next symbol
         %if '0' <= s <= '9' %start
            s = s-'0'
         %else %if 'A' <= S&95 <= 'Z'
            s = s&95-'A'+10
         %finish %else %exit
         %exit %if s >= Base
         Flag = 1
         skip symbol
         n = n*Base + s
         s = next symbol
      %repeat
      %exit %if S # '_' %or N = 0
      Base = N
      skipsymbol
   %repeat
   r = n
   %if s = '.' %and (type = reals %or type = longreals) %start
      F = 0
      Exp = 10;  skip symbol
      %cycle
         s = next symbol
         %exit %unless '0' <= s <= '9'
         Flag = 1
         f = f + (s-'0')/Exp
         Exp = Exp*10
         skip symbol
      %repeat
      R = R+F
   %finish
   %if sign = '-' %start
      n = -n;  r = -r
   %finish
   %signal 3,1,s %if Flag = 0
   -> TP(type)
TP(integers):  integer(adr) = n;  -> RETURN
TP(shorts):    %signal 1,1,n %unless x'FFFF8000' <= n <= x'00007FFF'
               shortinteger(adr) = n;  -> RETURN
TP(bytes):     %s
 H?   p pQ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      C!          r4}-               -      NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    %Qv   #	y        oq   ^ q   *.-@7lHUWb Jf dQ@    Z!:qI    %N     ag\W@qI<_q)fZayqH    y:    Z`    Z	etyq[aw$V  QzEo  q["d^D:ufZeXHfZ8jMdfZ^D:uA~n@  ee  xd     qIEQ@  X_K   fh      qIq+,      qI1R  Qx      qI0    	K9f    fwiqKox    4-1 -1  *end* > does not exist* LAYOUT fails --  .lay .lay    (EHKOSW[_cgkosw{CAPSHinESCAPEnCAPAPEnUNDAPEnspareEnUNDSHEnNLSSHEnSGAPHEnPGAPHEnINDENTnTOPENTnBOTTOMnLEFTOMnPAGEOMnLINEOMnSLINEMnINVERTnCAPORTnUNDORTnCAPSHOnUNDSHOnINVERTOASCIITOJUSTITOMARKITOSTARTTOFINISHOPAGENOOIGNOREOSECTNOODLPINOODCPINOODLEFTOODPAGEOODTOPEOOPRINTOOINCLUDEOUTPUTESPLATTETABATTE         (   NM A Z3[$k$$$$$$$$5$$$$   p   CN\$X:  index atom missing? Nested - INCLUDE=Unknown output type =  DUPLICATE PRINT REQUESTTOO MANY PRINT VALUESMISPLACED DIRECTIVE  NO VALUE STORED  0TOO MANY PARAMETER VALUES NESTED - RUN ABANDONED 
OVER TEXT  	OFF PAGE OUT OF BOUNDS  SPURIOUS DIRECTIVE UNKNOWN DIRECTIVE  SCALAR/VECTOR MISMATCH UNKNOWN NAME &INVALID ASSIGNMENT TO SYMBOL PARAMETER FAULTY FORMAT AT :  line file   3CLU^gpy                    A                                                                                                        PRINTER #<UPDATER #<MERGEER #<INDEXER #<DAISYER #<            
   <H  !34  1  0 !81 !5$$A> 6#$$A> 6&C  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n?1  34C0  D   D   
C H  !34  1  0 !81 !5$$A> 6B  @ !4B ";
C@ !$$A> 6#$$A> 6B  C
B$P#E  E  &Q'1"C $A1    0#
#	QD   RD   ?&A'"31I2 !,K2  !
3s3B  #9
3
>!$$A> 6!$$A> 6A> 6GHO  s/ "B
'X=  2 #$$A> 6&r0U> ?P7D   &D"$ g A , X=!5%y f#8XM!3$"	%"XMBZH<PI ,X]ZHd  jZ]Jd 	VC "$QQ]Xm	c#&$ AbZh<Pi ,X ,H  U!?H U#4Š!7$QP]%C t$`PmC h Y	g A , Py ,#Xy ,C 4XB0,W   X9 P  X X  Š 
!4$AQMy $QP]h fC0:W   XmPW   `$ X=P=X`#P`C VXMP@ #<&APMPdW   `C 6X E!4$PU!5 EP!5XPX9 P  C ZC ( | 	 vzg A , $`W   l` *W   < C0&W   H W   HW  W   H$SXmW   TW   HX .AW   HXmW   <C \W   HC JW   HC 8nW   HC &ZW   HC FW   HC 6W   HC ,W   HC  W   HC W   HC W   HC W   HC vW   HC W   HC rW   H W   HC RnW   H W   HC 2TW   HC  XhW   <X8#7cW   <$PW  ,y 	w ) ,A A P !A   #$0P9 PI ,PI \SPY TC F&QPY Ti ,
e  P X  C0& a! z!%P X$1Q9 Pȹ ,Z P  XY TUY \B0X Pҩ ,!5$y $@&API T$\TZ]T) ,A!5X TC XI T@ B0$oA$C  l	w A , X=!6i ,A#P9 ,$0P=$PPXC0NXI ,UM#6i ,A"	i ,AXY ,P _PXP A#4P E!8mAy i ,AC Xi ,` #<İ _PmA`C X|P 8X=P9 <P @P9 4P 0X ,İ ZDX   .>AX @#3C  $P @@  PI 8PI 0C :i ,AP QY ,Xi ,` _` A!` Z#*X , _ 
#3C X=#3C X ,İ _PmAC Ƞ  P 0$API @C P PY 4$aPi @i ,AX ,   !3C xX9 ,0 2Z8DX   .>A$P @Ƞ P <P 4C tXI ,@ 
#6VM@  !3C hC (XY ,W]PY ,P P a!P z!'Xi ,[i 0Pi ,$P @QX=2Z8,X ,V 4P  X <P 4XI 8PI 0i ,AC |XY ,P]Xi <#4X!3C Z,X\  P PY ,P .C0&P ,C0P :#=P ;#:P )#7P !#4P ?!8X=2Z8,PS  C [	w A , X=C0L$`W   l$P ,X ,UC0&P ,Z4Xj  W   <C W  ,$@PMX]\P !4Xm`#$Py $aW   l$0P9 ,X ,UC0&P ,Z4Xk  W   <C W  ,$PC  i	g A , $1Q=XMBZH4Pd  y  	w A , X9 #  $J$P* ,X9 2SE@ $:CPY U#3AXj ,` 0Az  *
g A , A`  Afy  	w A , X=#8@QI 0z XI 0TP  !3C Xi 8#5PY 0C X !3C X9 ,P: ,X ,UC0^&P ,Z,XK  PJ 0@ B0>XZ ,U]B0.@ .C0*@ ,C0"@ :#?@ ;#<@ )#9@ !#6@ ?#3C C Xh A`Qi 0$P 8C DX8 !3C :cAtȰQ 0C ( |
w A , X\ !4X=`#y XC0 Xx!>Z&Y!&`  A#AF$@PI 4PI 8X]|B0rXh C0jX B^P <4P9 ,C H&1P9 ,2Z8,X  İ P 0ȫɠ A!ɠ Z!&$@PI 4C ɰ A!ɰ Z!$$QPY 4X9 ,U9 <B0Xi 4#5Xh AXP <$0P9 ,C &1P9 ,2Z8,X  P 0ð #3AX 0ɠ A!ɠ Z!+XM|!4XY 4#5Ȫ  P 0ɠ A!ɠ Z!*Xh #7A  Q 0X9 00 _0 A!0 Z!'X 0W P 0X 0à #5XmAi 3AX9 ,U9 <B0ZC  π	g A , ` BzYmB r'aPi YmC *$QX=2Z8$Ȱ  P  XU #3C C 8XMUI C0"BZH$XT  P  #5$iA#%aQmC X&P#$hAX=U9 !4$1P=XP$PPy  a	w A , X=0 B0:` =W   <Xm'bW   ` =W   <W  ,C 0 !9$lW   <C 0 B0$`W   l$P ,$gW   <%Q ,XI ,#2"W  ,$aW   l$`W   `W   $ 
#7W   0"W   0XmPW   `y  	w A , X=x#?'1P=x!;$@PM|PMPM$QP]$aPm$PPPPX#5XmAy  0	w A , $0P9 HXM&AYMBXm[mABC0$aW   lX]U]!=Xm#3APXmW  8XC0X=P9 8X#<X[#& 
:P9 8cW   @ PI @P PY DXm!8$@PI @P PY DXP L$0P9 ,C 6&1P9 ,2Z8$X  P 4ð #5X ,P HkTi DW   <X9 ,U9 LB0XI HC0j$mW   <Xi 8W   XY HPY L$`Pi ,C 6&aPi ,  P 4bZh$X6  0 #5 _P 4lW   <Xi ,Ui LB0XmW  8XYBXC0XM!9jW  8C #& P ,jW  8X]#&QP Z]eW   XmC0 $QW   T$`[m$QW   T#	$QXmW   TXm[i ,W  8y !	w A , y  	w A , X=Q=XM\@ !4A#@ !3AX]Y]!$PP]$aQmX#4&PAy  0	w A , X=[=P9 @#$XM!4y X]P][MPI PSE@ ]MPY <\M5P9 @XMPI D	4#P9 D[9 DP9 @$Q[]P]#7$`Pi HPi L#
X PP H[I DPI LXP 0X&P ,C 'P ,Z$XJ  PI 4@ #5@  B0XY ,RZX$Xe@dC0X 0[ <P 8@ B0$X9 L!;X D#7'P 8'P D#'1P9 LC  X9 H!;X @#7'P 8'P @#'1P9 HX 0U 8#<Z$@  PJ  %QQY 0"U ,!7XmPmC X 0Z$X9 4P<  %Q 0X ,Š B0C  ̀	w A , X=U=C0XMxB0&1P9 0P  PY 4XmbZh$X   .C0*X=2Z8$X  Ű ?#<XZ$XJ  @ !B0(X8,X ɰ A!ɰ Z!+XZP 0P PY 4XI 0ZMYMB 6X]UY 0#<&QP]RZX$Xi 4Pe  "$QX9 40 !3Q#X#3AAX#3A$@PI ,XY ,U]C0($aQm&QPY ,XZ$RZX,X5  P<  C XPy  	w A , $1Q=XMBZH4X]PT  mA`z  
w A , $0P8$APHX]P +#4P -!5PXAXm` 0B@` 9B 8PAvX=0 0B 0 9!.XX$KE
CPHANC XXP -!6$`[hPhz  N
W  A , X8!;$jAAN$ AP: ,2Z8TXC  PHXZ ,RZXTPe  X ,Z\X:  X  P  XJ  XZ ,PT  z  :
g A , X6  2Z8TXHPC  XZ Xe  PhbZh\X  P  z  "
g A , $06  XM@ PK 0@ ;#4@ 
!3C BA@X[ 0P  C0.P a!P z!%UP[ 0Xk    ##7&VL     C {  >g A , X=0 _0 A!0 Z#'$@PF  { X=0 _P6  A" "g A , X  !4A"$0; ,k 4AXK 4!2#[ ,P #7&QKE  ,[ ,C k ,f!<$aAX $0P<  { X[ P[ 8$&X; 8P  XK XT  SZ]+ ,A!3C Xk 8X   (B0$cAX $0P<  C  cg A , ` (!bZmd{ .^A"
"C C C C C C C C C C C C C |C tC l C d C \ C T C L C DC <C 4C ,C $C C C C C C  C C C $ $AC  g A , X  !4Az"X; $@@C  X]P ?!5A`C 2Xm` 0B&` 9B X H\  $:C
VE@L  A.C {  ;w A , j ,AVX ,!4z X=0  !4A"X#<XJ ,@ !@ !$$lA^XZ ,P $B0Xm` =#6$aABC AX !5$mA*#&PX=2Z8<P: DcAXŰ  !4At"Ű -B06AfXM@  !2"@ *!:APXZ D`@e #X Dl A#X: DHC  @C XZ D$`@e  X  !4A" ,#2#C P$0P: @X<&P HXMPJ L$QPZ 4C |&QPZ 4Xj HPj DRZX<PZ HH  H5  :J J5 	BFH  P 8HF PJ <H  @  XZ DX HH< @5 X HXJ 8@K  XZ HXj <@e $P @XZ 4UZ LB0|X: @!2#C NX'P L$@PJ 0C B&APJ 0BZH<PJ DXZ 0RZX<&TPZ HHd  Ee  !;H E !6$nAC XJ 0UJ LB0C X: ,0 %B0XŰ =#6$aA^C AH D#5` AFh A>$SPX XmP` #4$QPX  eW   xXh W   `XP$PX=`!5$P#A%APM`C P0 &B0DX]P =#6$aAC 4A4h AXm!;X!8 AP\#$lAC XŰ <#5Ű >B0P: 0XM@ <B0Xj 0AXZ 0RZXLXa  AC 4Xj 0bZhLX  !6$kA>C X: 00 B0 B cAX  ZDXK  @ UJ 0B0fXj 0AXQ  PZ 4Xj 4bZhDX 4ZDX<  4P6  X 4ZDXK  C0 XZ 4RZXDXe  ` A6Xa  Uj 4!2#C Xj 0AX 0ZLX<  2Z8TX  P  XJ 0@ B@@ B 8dAXQ  RZXDXj 0PZ LAXa  bZhDX  X: LV 0P  X 0ZLkA$AQJ 0XZ 0P (!P A!#C AtXm`  !2"` ;#4` 
!3C TX =#6$aAC @A@X=0  !2"0 _0 A!0 Z!,j 0AhX 0!3C C F$@PJ 0X]P '!=AXmPhAAC AX#;Xj ,AX1  Z8P8X ,ɰ Bɰ B kAXA  BZHDXT  P UZ ,B0fXj ,AXa  Pj 4X 4ZDX: 42Z8DX  P  XJ 4BZHDXT  C0 Xj 4bZhDXf  ` APX  U 4!2#C Xj ,A8Xj 0P LA,X: LX  P  XJ ,@ B@@ B 8dAXQ  RZXDXj ,PZ LAXa  bZhDX  X: LV ,P  $Q ,Q 0XJ 0@ (##XZ ,P (!P A!2#C hXm` ,!6X , (!"#C 8` ;#7` 
#4kAC b_
w A , Xx#=!$X=#4$fA$PxABXŠ 
!<XM#5`  A0XmA(X]C0:Xh` CC0.` TC0&` XC0X#6` J!3AAX=#3AX&Y##AXŠ 
!4y XM#5`  AXmAXhAXXP X#3AX.AAXXm` ;#7` 
#4Ad"
` 
!2#AVC X#5  PX8 #50  P8 X!%Ȱ'PX!ɠ #'$gA$@PMX]RZ]Xe  PmAFX#7 N.AC *X=!5XC0>X[Z\MPXXMC	E#X]SPXXX#*AlXh[mPh"C X#8X=&1Z8P8XhAC X#9Xɠ#A&"
XMPM$ZP]C Xh#7XZPX8!0 #'$gA$PXZXJ  PHdAVC LC HXXP]x!4%QP]x$`PmX 
C0X _ C!50  P=|Xİ _Ű U!5Ƞ PXM@ _@ M!4$QP]Xm` _` I!4$PAC X=!6$PPC Xɠ!C XM#4A""$QP]Xh` S!:X#7#4&PP]C zX=C0:X\PXɫ #XPXH#*AXX[]PX"Xm&aZmA0C &XC0$0P9 0X&P , +B0\XC P$AQI 0XY 0P !+RZ]Xe  Yi ,!#C X 0 #&$gAC ZX<  P9 ,%QC C r$Q 0XI 0@ !+BZMXT  YY ,#C XhCF%Q 0X9 0!2Z=X  Y ,!"X 0#$gAޚC PZXJ  PI ,$QQXC C $Xh!` #&$gAhC bZmX  P ,Xi ,AC X=[=XX\M	5#X#4Af"$PC XM\@ #4%RQ]Xm`  #4` 
!4$`PmAX#7` AC X=\0 B0,$PXmAXmA$P\AAh$DPM\#0 !3AX]\P #4$`PmC H$eA݈C >	w P (A , Y( ,X=| A ( lXM|  A ( X=| A XMPH X=P8 XP XP XP $@H NtPH p PNdPH(p P$NTPH0p P,NDPH8p P4N4PH@p xP<N$PHHp PDNPHPpPLNPHXpPTPH`pP\ lW  B0v' , lA XA W  #:( lRA C @' ,>A  lA .A W   HW  ,$ A l$aW   x $aW   $aW   `$aW   l ,AP\ !9$lW   <C   !8$P`$P\# !4$0P=`,W   %&PZD$P  XŰ  =Ȑ @&PZD$HPI  XŐ Z =P `&QPXRZXD$hPe  XXP z =XZD$1P<  XZD$P  XZD$CPI  X]RZXD$dPe  XZD$6P<  XD$P XD$GPI (XmPW   `$aW   l$P&QPXRZXL$`Pe  XXP A =$&PZTX8'1P<  X ?XYCA$X#5A.C fXC0A>A*XM@ 
!7X]x!4$@PMXmxC08X  B0lA^$1Q=XZ$Ƞ  P  XŐ 
!3AXM@ 
!3AXX]P  #4P 
!4$PP]C TAXm\` !=W   HW  ,x pEO@ @ n pN   pEO@ @ n pN   pEO@ @ n pN   pEO@ 0EO: O;:  OF  $ INSERTPRIMS, ,  ,  {}O$ J, , ,  $ K, , ,  $ L, , ,  $ M, , ,  $ TO, , ,  O@ N   N   &N   f O@ @ Z@ aSO@ N    ?< ON    N    ?) 
O@ 'primpEO@ @ pN   pEO@ N    pEO@ j@ pEO@ 0EO: 
O@ @ qp@ Xn @ Z@ a+pEO@ @ <@ aSO@ @ @ <@ aN  &+SO: 	@ @ ?= 
O@ @ N   +SO@ @ <@ aN  &SO@ N  &N  ?= O@ @ qp@ pEOF : @ N  ?# O@ @ qn SO@ @ qp@ pEOF : O@ N   &N   ?# O@ @ qpN  CpEOF : O@ @ qpN  A@ N   &N   [+pEO: O@ @ N   +SO@ @ <@ aSO@ @ Z@ aSO@ N    ?) @ kN   p@ pE: O@ @ qp@ Xn @ +N   *pEO: OB 	: 
O: OB : O@ @ ZN   &aSO;:  OF  $ PLANTCODEREF, ,  ,  {}O$ J, , ,  $ K, , ,  $ L, , ,  $ T, , ,  $ THERE, , ,  O$ D, B, Q,  ON   N   b$ FORMAT, ,  ,  O@ @ N   +SO@ @ U@ aSO@ @ T@ aZO@ @ S@ n an @ n +@ +SO@ N   &N    ?= @ @ N   +S: O@ N   @&N    ?# @                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                              <   H   P                      '       _       %                     $              
                	         !   )   1   9   A   I   Q   Y   a   i   q   y                                                                                                                                 t 	
p j    t p p p   p  p #p .m  D!M"P# Q$ R% T&Z' [n pEO,@ @ qn SO,@ N    SO-@ N   ?= O/@ l@ pEO/@ N   pEO0@ 8N    ?= O1@ @ SO2@ 9N    ?= 
@ N    S: 
O3@ @ sp@ pEO3@ @ tpEO4: O5F : O6@ 8N    ?= O7@ n 	'PERMSO7@ n N   SO8@ @ spN    pEO8@ @ tpEO9: O:@ EO;@ @ qp@ Xn @ Xn +N   -pEO<@ @ qp@ qn @ -pEO=@ @ qn N   -SO>@ @ qpN   pEO?: OA: OB@ @ pEOCN    @ ") N   ?> @ W : OE@ kN   p@ pEOGN   _ OH@ @ pEOH@ @ ?= @ kN   p@ pE: OI@ @ qn SOI@ @ sn SOI@ @ tn SOJ@ EOK@ @ qp@ pEOK@ @ sp@ pEOK@ @ tp@ pEOLF OMN   _ ON@ @ N   -SOO@ N    ?= OQ@ @ qp@ qn @ -pEOR@ @ qn N   -SOS@ n N    ?# 
OT@ @ qp@ n N !pEOUF 	: 
OV@ @ qp@ n pEOW@ @ qp@ n pEOX@ @ qp@ T@ n 	an @ n +pEOY@ @ qp@ T@ n 
an @ n +pEOZ: 	O[: O^N    N    ?) O_@ @ sn pN   pEO`@ @ n pN   pEO`@ @ n pN   pEO`@ 0EOa: Ob@ 8N   ?# Oc@ N    ?# 
Od@ @ sp@ Xn pEOe@ @ tp@ Xn pEOfF 	: 
Og@ @ sp@ sn @ -pEOh@ @ sn N   -SOi@ @ tp@ tn @ -pEOj@ @ tn N   -SOk: 	Ol@ @ n @ n +SOl: 	@ sn @ ?= 
@ @ spN    pEB 	: 
Om: OnROoN   _ Op@ @ qn SOq@ qn @ SOrF OsN   _ Ot@ @ qn SOu@ qn @ SOvF OwN   _ Ox@ l@ pEOy@ @ USOzF O{N   _ O|@ l@ pEO}@ @ qp@ pEO~F ON   _ O@ l@ pEO@ N    ?= @ @ N   -SF : O@ @ rp@ pEOF ON   _ O@ @ up@ rn N   -pEOF ON   _ O@ @ up@ rn N   -N   +pEOF ON   _ O@ @ qp@ qn N   -pEO@ @ qp@ n pEOF ON   _ ON   _ O@ EO@ l@ pEO@ @ N   &SO@ @ N   ]SO@ N    SO@ EOF ON   _ O@ l@ pEO@ EO@ l@ pEO@ EO@ l@ pEO@ N    SO@ EOF ON   _ O@ EO@ l@ pEO@ EO@ l@ pEON    @ ") N   &?( : @ kN   p@ pE: O@ @ qp@ pEO@ @ qp@ Z@ aN   *pEOF ON   _ O@ EO@ l@ pEO@ @ T@ an SO@ N    ?= @ @ @ n +S: O@ @ qp@ pEOF ON   
_ O@ l@ pEO@ d@ N   -SON   	_ O@ d@ dN   +SON    N    ?) O@ 'linepEO@ @ dpN   pEO@ @ qn pN   pEO@ 0EO: O@ f@ qn @ -SO@ fN    ?# F : O@ e@ d@ -SON    @ e"> N   ?( : O@ 8N   ?# 
@ @ sp@ dN   -N !pE: 
O@ eN   SO: O@ 8N   ?# @ @ sp@ fN   N   +*@ e+pE: O@ @ dSO@ @ qn SOF ON   _ O@ N    pEO@ 8N   ?# O@ @ n N   &N   [@ n N   &+N   [@ n N   ]+SO@ n N   ?= 
@ @ N !S: 
O@ n N   ?# 
@ @ N  @ !S: 
O@ n N   &N    ?= 
@ @ N    !S: 
O@ @ tp@ pEO@ @ tp@ n N  &pEO@ @ tpEO: OF ON   _ O@ @ pEO@ l@ n pEO@ NpEO@ N    SO@ N   ?= @ N   ?# : O@ @ n SO@ N   ?# 
O@ @ qn SO@ n 	@ :?# O@ n @ n N  @ !SO@ }n @ SO: O: 
O@ @ vp@ pEO@ @ }n n @ vn +N   -SO@ @ vp@ pEO@ @ vpEOF : @ N   ?= @ N   ?# : O@ N    ?= 
@ n 	@ ;?# 
O@ @ qn SO@ @ qp@ pEO@ @ qp@ rn N   *pEO@ @ qp@ pEO: 
O@ @ }n 	n @ wn +SO@ @ wpEO@ @ rp@ N   ]pEO@ @ rp@ pEO@ @ rn N   -SO@ @ rp@ pEO@ @ rp@ rn N   -pEO@ N   ?# 
O@ @ rpN   UpEO@ @ rpN   UpEOF 	: 
O@ @ rpN    pEO@ @ rpN    pEO : 	O@ N   SOF : O@ kN   p@ pEO: OF O: B O;:  O
@ N   pEO@ @ 7n p@ pEO@ @ pEO@ N   @ N   -N   f @ @ rpN  pEB : O@ @ rpN    pEO@ @ rpN    pEO@ @ pEO@ N   ?) @ kN   p@ pE: O@ dN    SO@ N   USO@ @ Xn N   -SO@ @ Xn N   -SO@ N    SO@ N    SO@ EO@ @ pEO@ N   ?= @ kN   Up@ pE: O@ @ qpN   UpEO H?   ( (                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    {LIST program for new subsystem}

%begin
!!!%OPTION "NOOPEN,STACK=15"

%include "sysinc:command.inc"

%string(31)  label,
             outfile
%integer     offer flag = 0
%externalroutinespec  NEWPAGE
%systemroutinespec    OFFER (%string(31) file name, %integer copies, mode,
                                                     %string(7)  destination)

%routine  LIST FILE (%string(31)  source fd)
   %constinteger  line max = 132,
                  lines on page = 60
   %constinteger  FF = 12   {Form-feed character}

   %integer  lines = 0,
             page  = 0,
             source line = 0,
             last sym = NL,
             last line = -1

   %string(132)  line = "",
                 title = source fd."                     ".date."  ".time."   page"

   %routine  PRINT LINE
      %if lines = 0 %start
         newpage;  page = page+1
         newline
         print string(title);  write(page,4)
         newlines(2)
         lines = lines on page
      %finish
      %if source line = last line %start
         print string(" ...")
      %else
         write(source line,-4)
         last line = source line
      %finish
      space
      print string(line);  newline
      lines = lines-1;  line = ""
   %end

   %on %event 9 %start
      close input      {the stream that just protested}
      %if event_sub = 1 %start   {EOF}
         print line %if line # ""
!!!!         newpage
      %else
         newlines(10)
         spaces(15)
         print string("* * * ".source fd." does not exist * * *".SNL)
      %finish
      %return
   %finish

   open input(1,source fd);  select input(1)
   %cycle
      source line = source line + 1 %if last sym = NL
      %cycle
         read symbol(last sym)
         last sym = NL %and lines = 0 %if last sym = FF
         %exit %if last sym = NL %or length(line) = line max
         line = line . to string(last sym)
      %repeat
      print line
   %repeat
%end;      ! LIST FILE

   outfile = command_out1;  outfile = "LP:" %if outfile = "" {default}
   label = command_in1
   %if length(outfile) >= 3 %and substring(outfile,1,3) = "LP:" %start
      label = substring(outfile,4,length(outfile))
      outfile = "$LIST"
      offer flag = 1
   %finish

   open output(1,outfile); select output(1)
   list file(command_in1)
   list file(command_in2) %if command_in2 # ""
   list file(command_in3) %if command_in3 # ""
   close output

   offer("$LIST", 1, 0, "LP:".label) %if offer flag # 0

%endofprogram
 H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          C!             }h            	  h      NWfS    X`QK xgQK fZJ_fZX}    w:`wag\`EXg\  `EY} wZ} wp`q["iZ} q["op`~u@    <@    U~u@  %qO    qI     fZ    fZK   yA    yA    X_Lv@  X_Lv"8  "Z    %Qv   X_d/@  &Z            dQ@    fZ:u  L{}K  ox    'P 4LP:$LIST$LISTLP:LP: does not exist * * ** * *   ...    page                                                    `
    H  !34  1  0 !81 !5$$A> 6#$$A> 6&C  ,XM #7P  P P$ ȧ @$AA  A \U#?A PH& RRXZE"B"s 

	1#,H #8z s 

 @ !8X5 (X $C  ,sn@
fsN   
 VP	!#	!(e" ,$ $U
n?1  34C0  D   D   
C H  !34  1  0 !81 !5$$A> 6B  @ !4B ";
C@ !$$A> 6#$$A> 6B  C
B$P#E  E  &Q'1"C $A1    0#
#	QD   RD   ?&A'"3    !8 !5$$A> 6"#&!2#C$$A> 6
!  1  #C   C  '1"GHO  s/ "B
'X=  2 #$$A> 6&r0U> ?P7D   &D"$ w A , X9 LB0LW  t$Q PW  , W   H$TXi PW   T$bW  8@ <PI LXY TUY \!9W   H#%TXi TW   TXi TPi \W   `W   HW  ,%Q L$09 `z  f
w ) ,A A L ]!A   $0P9 LP9 PP9 T$JPI X%QPY \9 `W   ' ,A ', ,A A  ,A P)lW,p, ',A Xil&A ,A A ) A   PypC XypW   XLX< 0 !9ӹ `#3AJC N$jW  8$oW   ' ,A  ,A A A W   Hy  ,$aW   x$aW   `X XŠ 
!4$AQI TW   P X !7$P X$PPY L 
#6i `` !2#	&aF  `i `C AC   	 &w P (A , $0P8 l( LXp A 8 L3!7( LA ( ,  A Ӹ Lɰ B@$3 L$!A.AB0(8 L L$$A( ,A ( L~A $P l L$aW   $aW   lXp  AXMpT @U#5 @AnXmp `#5 `AZW   X8 lC02' ,xA ' LtA  ,A $P$aW  x                  Aw P (A , X $0P8 l( LX=p< A  H LD!7( LA ( ,X]p  A  h L` BB$3 L$!A.AB0*8 L L$$A( ,A  ( L~A $1P8 l L$aW   $aW   lXp  ABXpӚ @#5 @A*XMpLT `U#5 `AW   Xh lC02' ,xA ' LtA  ,A" $P$aW  x            } 
Dd 
Dd 	 
EP 	        
N 	                                                                                     2309',x'D351',x'4400',x'0000',x'D452',x'4400',
x'0000',x'023F',x'2641',x'2701',x'2219',x'0833',x'030F',x'0082',x'735F',
x'0000',x'9465',x'1058',x'2133',x'3452',x'9455',x'9355',x'1068',x'2133',
x'3464',x'9466',x'9366',x'D0B7',x'0000',x'D3B3',x'0000',x'C5B0',x'0080',
x'2134',x'D4B3',x'0001',x'2339',x'D301',x'0000',x'C500',x'0080',x'2138',
x'D401',x'0001',x'2135',x'2408',x'2411',x'8883',x'0034',x'0BB0',x'4210',
x'80A8',x'24C0',x'0800',x'4330',x'8038',x'D301',x'0001',x'D403',x'4C00',
x'0001',x'2339',x'26C1',x'0                                     $         (         , $       $ 0 *       * 4 0       0 8 6       6 < <       < @ B       B D H       H H N       N L T       T P Z       Z T `       ` X f       f \ l       l ` r       r d x       x h ~       ~ l         p         t         x         |                                 AX P `X H$bAX8  X TP  x  %w P (( ,Ap \2  0 #$$?2  - ,A( HAXP Dr <  H?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        %begin
   %constinteger magic = 6700421
   %constinteger name bits = 11
   %constinteger max names = b'11111111111';  !!!1<<name bits-1
   %constinteger max d = 40000
   %byteintegerarray d(1:max d)
   %integerarray p,n(0:max names)
   %integer key,k1,k2,dp,sym,j,total,add, num, dflag
   %ownstring(63) word, dword = ""
   %routine read sym
      readsymbol(sym)
      sym = sym-32 %if 'a' <= sym <= 'z'
   %end
   %routine read word(%string(*)%Name word)
      %on %event 9 %start
         word = ""
         %return
      %finish
      word = ""
      key = 0;  dflag = 0
      read sym %until 'A' <= sym <= 'Z' %or sym < 0
      %return %if sym < 0
      %cycle
         key = key<<3!!sym
         word = word.tostring(sym)
         read sym
         word = "" %and %return %if sym < 0
         %exit %unless 'A' <= sym <= 'Z' %or sym = '-'
      %repeat
      dflag = 1 %if sym = '*'
   %end
   %routine include(%integer new, %string(63)%name s)
      printstring(s)
      printsymbol('*') %if new # 0
      newline
   %end
   %routine next word
      include(dflag, dword) %if add # 0
      read word(dword)
   %end
   %predicate correct(%string(*)%name s)
      %cycle
         %false %if dword = ""
         %true %if s = dword
         %if s < dword %start
            include(1, s) %if add # 0 %and length(s) > 2
            %false
         %finish
         next word
      %repeat
   %end
   %routine set(%integer x)
      %string(63)%name sn
      %return %if x > total
      sn == string(addr(d(p(x))))
      x = n(x)
      write(x, -5)
      %if x = 1 %then printstring("<- ") %else printstring("   ")
      printstring(sn)
      spaces(21-length(sn))
   %end
   %routine qsort(%integer a, b)
      %string(63)%name s
      %integer hold, l, u, dump, dumpn
again:%return %if a >= b
      l = a;  u = b
      dump = p(u)
      dumpn = n(u)
      s == string(addr(d(dump)))
      ->find
up:   l = l+1
      ->found %if l = u
find: ->up %unless string(addr(d(p(l)))) > s
      p(u) = p(l)
      n(u) = n(l)
down: u = u-1
      -> found %if l = u
      -> down %unless string(addr(d(p(u)))) < s
      p(l) = p(u)
      n(l) = n(u)
      ->up
found:p(u) = dump
      n(u) = dumpn
      l = l-1;  u = u+1
      %if l-a > b-l %start
         qsort(u, b)
         b = l
      %else
         qsort(a, l)
         a = u
      %finish
      ->again
   %end
   %routine count and sort words
      %integer j, flag, t, limit
      num = -1
      %for j = 0, 1, max names %cycle
         %if p(j) # 0 %start
            num = num+1;  p(num) = p(j);  n(num) = n(j)
         %finish
      %repeat
      qsort(0, num)
   %end
   %routine analyse
      %integer j,k,l,t
      %string(63)%name sn
      count and sort words
      open input(2, "THESIS:GLOSSARY")
      select input(2)
      select output(2)
      add = 0
      next word
      add = 1 %if string(comreg(1)) = "+"
      k = -1
      %for j = 0, 1, num %cycle
         sn == string(addr(d(p(j))))
         %unless correct(sn) %start
            k = k+1
            p(k) = p(j)
            n(k) = n(j)
         %finish
      %repeat
      num = k
      %if add # 0 %start;      !copy dict
         next word %while dword # ""
      %finish
      select output(1)
      total = num
      l = (num+3)>>2
      %for j = 0, 1, l-1 %cycle
         set(j);  set(j+l);  set(j+l+l);  set(j+l+l+l)
         printsymbol(11)
         newline
      %repeat
   %end
   %routine insert
      %integer k1, k2, x
      k1 = key*magic
      k2 = k1>>(32-2*name bits)!1;                     !giving 2*name bits
      k1 = k2>>name bits;                       !giving name bits
      %cycle
         x = p(k1)
         %exit %if x = 0;                !not in
         %if string(addr(d(x))) = word %start
            n(k1) = n(k1)+1
            %return
         %finish
         k1 = (k1+k2)&max names
      %repeat
      p(k1) = dp
      n(k1) = 1
      string(addr(d(dp))) = word
      dp = dp+length(word)+1
   %end
   dp = 1
   %for j = 0, 1, max names %cycle
      p(j) = 0
      n(j) = 0
   %repeat
   printstring("Analysis of file ")
   printstring(string(comreg(3)))
   newlines(2)
   %cycle
      read word(word)
      %exit %if word = ""
      insert
   %repeat
   analyse
%endofprogram
 H?   	 	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     	@?   @ WX     WX:  hiL  H      P    n      n:     m       m:  B@_                                                                                                                                                                                                                                                                                                                                                                                                                