IMD 1.18: 21/01/2023 0:08:46 PERQ-SFT-MBD-5 3RCC PERQ DOCUMENTATION DISTRIBUTION FLOPPY Copyright (C) Three Rivers Computer Corporation, 1981 single density, double sided D.5 Group name Command file DOCUMENTATION DOC.CMD  d Report [JW74]. 16.1 REWRITE The REWRITE procedure has the following form: REWRITE(Fof CHAR, then the next n-m+1 characters from the input line will be used to fill the array. If there are fewer than n-m+1,Name) F is the file variable to be associated with the file to be written and Name is a string containing the name of th characters on the line, the array will be filled with the available characters, starting at the m'th position, and thee file to be created. EOF(F) becomes true and a new file may be written. The only  remainder of the array will be filled with - 26 - PERQ Pascal Extensions  ______ ____ ______ ___ ______ difference between the PERQ and PASCAL User Manual and Report[JW74] REWRITE is the inclus 19 Jul 81 blanks. If the parameter to be read is of type STRING, then the string ion of the filename string. 16.2 RESET The RESET procedure has the following form: R variable will be filled with as many characters as possible until either the end of the input line is reached or the maxiESET(F,Name) F is the file variable to be associated with the existing file to be read and Name is a string containing themum length of the string is met. If there are not enough characters on the line to fill the entire string, the dynamic len name of the file to be read. The current file position is set to the beginning of file, i.e. RESET assigns the value of thegth of the string will be set to the number of characters read. 16.4 WRITE/WRITELN PERQ Pascal provides many extascal Extensions 19 Jul 81 15.6 Rotate Function ROTATE(Value, Distance: i first element of the file to F^. EOF(F) becomes false if F is not empty; otherwise, EOF(F) becomes true and F^ is unnteger): integer; ROTATE returns Value rotated Distance bits. If Distance is positive a right rotate occurs, othdefined. 16.3 READ/READLN PERQ Pascal supports extended versions of the READ and READLN erwise a left rotate occurs. Note that the direction of the ROTATE is the opposite of SHIFT. ______ ____ ______ ___ ______ procedures defined by PASCAL User Manual and Report [JW74]. Along with the ability to re - 25 - PERQ Pascal Extensionsad integers (and subranges of integers), reals and characters, PERQ Pascal also supports reading booleans, packed arrays o 19 Jul 81 16. Input/Output Intrinsics f characters, and strings. The strings TRUE and FALSE (or any unique abbreviations) are valid input for parameters ______ ____ PERQ's Input/Output intrinsics vary slightly from PASCAL User ______ ___ ______ Manual an of type boolean. Mixed upper and lower case are permissible. If the parameter to be read is a PACKED ARRAY[m..n]  &@'i: idvn[)hI&Z[ ) &8"[B) % N[)XwR[)`sQQ"[#)[iHOii|L[) j[.) ;d[i j[i@Rr[did9k (f,p1); ... write(f,pn) END 3. writeln(p1,...,pn) stands for writeln(output,p1,...pn) 4. writeln( 2..36 and -36..-2. If e2 is positive, then the value of e is printed as a signed quantity (16-bit twos f,p1,...,pn) stands for BEGIN write(f,p1); ... write(f,pn); writeln(f) END 5. Every parameter pi must complement); otherwise, the value of e is printed as a full 16-bit unsigned quantity. If e2 is omitted, th be of one of the forms: e e : e1 e : e1 : e2 where e, e1 ande signed value of e is printed in base 10. If e is of type real, then e2 specifies the number of dig e2 are expressions. 6. e is the VALUE to be written and may be of type CHAR, integer (or subrange its to follow the decimal point. The number is then printed in fixed-point notation. If e2 is omittedof integer), real, boolean, packed array of char, or string. For parameters of type boolean, one of, then real numbers are printed in floating-point notation.  the strings TRUE, FALSE or UNDEF will be written; UNDEF is written if the internal form of the expression is  - 28 - PERQ Pascal Extensions  neither 0 nor 1. 7. e1, the minimum field width, is optional. In general, the value e is wr 19 Jul 81 17. Miscellaneous Intrinsics 17.1 StartIO STARTIO is a special QCode (See the PERQ QCode itten with e1 characters (with preceding blanks). With one exception, if e1 is smaller than the Reference Manual) which is used to initiate input/output operations to raw devices. PERQ Pascal supports a procedure, STAnumber of characters required to print the given value, more space is allocated; if e is a packed array of char, RTIO, to facilitate generation of the correct QCode sequence for I/O programming. The procedure call has the following forthen only the first e1 characters of the array will be printed. - 27 - Pm: STARTIO(Unit) where Unit is the hardware unit number of the device to be activated. 17ensions to the WRITE and WRITELN ______ ____ ______ ___ ______ procedures defined by PASCAL UseERQ Pascal Extensions 19 Jul 81 8. e2, which is optional, is applicable only r Manual and Report [JW74]. Due to the scope of these extensions, the WRITE and WRITELN procedures are completely redefinewhen e is of type integer (or subrange of integer) or real. If e is of type integer (or subrange of ind below: 1. write(p1,...,pn) stands for write(output,p1,...,pn) 2. write(f,p1,...,pn) stands for BEGIN writeteger) then e2 indicates the base in which the value of e is to be printed. The valid range for e2 is *KmiPcIc}cIc}-c}}-s`a,k,' }*Lk,' }*<cPLX-V-Illegal switch: ` cc}-` c\cIc}}*]) Pc} ɺa\cIcrc ) Pc} ɺa\cIcrc ) Pc}ɺa\wvu x&c Verifying transfer` c'8cP GET SourceFile [DestinationFile]` c\' P)Pc}c}c}ɺq'Ec\PLX-G-` cc` c not found` c\ qI'\3dc}c}as(`} already exists. Delete?  JP)}Pa \3das'>cPLX-G-Can .2 RasterOp RasterOp is a special QCode which is used to manipulate blocks of memory of arbitrary sizes. It is especia, Source-X-Position, Source-Y-Position, Source-Area-Line-Length, lly useful for creating and modifying displays on the screen. RasterOp modifies a rectangular area (called the "destina Source-Memory-Pointer) Note: the values for the destination precede those for the source. The arguments to Rtion") of arbitrary size (to the bit). The picture drawn into this rectangle is computed as a function of the previous asterOp are defined below: "Function" defines how the source and the destination are to be combined to crcontents of the destination and the contents of another rectangle of the same size called the "source". The funceate the final picture stored at the destination. The RasterOp functions are as follows: (Src tions performed to combine the two pictures are described below. To allow RasterOp to work on memory other than that usrepresents the source and Dst the destination): Function Name Action -------- ---- ed for the screen bitmap, RasterOp has parameters that specify the areas of memory to be used for the source and destin ------ 0 RRpl Dst gets Src 1 RNot Dst gets NOT Src ation: a pointer to the start of the memory block and the width of the block in words. Within these regions, the position 2 RAnd Dst gets Dst AND Src 3 RAndNot Dst gets Dst AND NOT Src s of the source and destination rectangles are given as offsets from the pointer. Thus position (0,0) would be at the upp 4 ROr Dst gets Dst OR Src 5 ROrNot Dst gets Dst OR NOT Src er left corner of the region, and, for the screen, (767, 1023) would be the lower right. 6 RXor Dst gets Dst XOR Src 7 RXNor Dst gets Dst XNOR Src The symb - 29 - PERQ Pascal Extensions 19 Jul 81 olic names are exported by the file "Raster.Pas". "Width" specifies the size in the horizontal ("x") direction of  The compiler supports a RASTEROP intrinsic which may be used to invoke the RasterOp QCode. The form of this call is:  the source and destination rectangles (given in bits). "Height" specifies the size in the vertical ("y") direc RASTEROP(Function, Width, Height, Destination-X-Position, tion of the source and destination rectangles (given in scan lines). "Destination-X-Position" is the bit o Destination-Y-Position, Destination-Area-Line-Length, Destination-Memory-Pointerffset of the left side of the destination rectangle. The value is offset from Destination-Memory- is seperated by a { page break. This is done by placing a formfeed character between { the sections. { { The firstpe>): ; Private Const Version = '1.1'; { } section contains a) the author, b) the copyright notice { and c) the abstract for the file. The abstract gives a general function Funct(Parm1, Parm2: ): ; {------------------------------------------------------ { { Abstract:  { indication of what can be found in the file. { { The second section of the file contains the change log. Each {  { This is how a procedure/function should look. { The Abstract section gives a description of what the { procedure/f entry in the log starts with the date, version number and { name of the person who made the change. This is followed by aunction does. { { Parameters: { This section describes the parameters if there are any. { If there are no parameters tn { entry of one or more lines. Each entry is terminated by a { open/close comment pair. { { The third section of his section may be omited. { { Environment: { This section describes any state that must be set up before { the procedthe file contains the global declarations for { the file. This includes both the Exports, if there are any, and { the Pure is called. It may say that the procedure { expects a file to be opened on the file variable Foo. { If there is no srivate parts of the file. { { The forth section of a file starts the list of procedures. Each { procedure consists of a procedure header followed by a block of { documentation for the procedure followed by the declarations and code { for the procedure. Procedures should appear one per page. { See the procedures in this file for more details on how they { should be structured. { { {--------------------------------------------------------------- { } { This is a formfeed charaprogram HowAFileShouldLook; {--------------------------------------------------------------- { { This is a single line of tcter } { 21-Nov-80 1.1 Don Scelza { Updated this file. Moved the copyright notice. { Added the second change log entry. itle and author. { Copyright (C) 1980 - Three Rivers Computer Corperation. { { Abstract: { This file provides a template {} { 10-Nov-80 1.0 Don Scelza { This is the change log section of the file. { It contains information about the last tifor all files that are to { be part of the new PERQ software. { { Files are divided into four sections. Each section me that the file was changed. { New entries go at the top of the list. { } { } Exports function Funct(Parm1, Parm2: MyPes provided by the PERQ Pascal compiler, although similar in syntax, bear little resemblance to the switches described rog The syntax for the compiler command line is: [=]{/SW} is ______ ____ ______ ___ ______ in PASCAL User Manual and Report [JW74]. - 34 - PERQ the source file to be compiled. If the file does not exist, ".PAS" will automatically be concatenated onto <Pascal Extensions 19 Jul 81 The following sections describe the various switcInFile> and a second attempt will be made to find . is the name to be given to the output of the comphes currently supported by the PERQ Pascal Compiler. 18.2.1 File Inclusion The PERQ Pascal compiler may be directiler. ".SEG" will be concatenated onto the end of if it is not already present. If no is given, will be used, replacing ".PAS", if present, with ".SEG". Any number of compiler switches may follow the is identical to having the text of the secondary file(s) present in the primary source file (the primary source file  input file specification. The format and functionality of available switches are defined in the following sections. 18.is that file which the compiler was told to compile). To include a secondary file, the following syntax is used: 2 Compiler Switches PERQ Pascal compiler switches may be set either in a mode similar  {$INCLUDE FILENAME} The characters between the "$INCLUDE" and the "}" are taken as the name of the ; the destination must be a local, intermediate or global variable; it must not be a VAR parameter; if it is a record, a field ______ ____ ______ ___ to the convention described on pages 100-102 of PASCAL User Manual and ______ Report [JW7 specification may be given. - 33 - PERQ Pascal Extensions 4] or on the command line described above (see above Section, "Command Line"). The first form of compiler switches may 19 Jul 81 18. Command Line and Compiler Switches 18.1 Command Line The compi be written as comments and are designated as such by a dollar sign character ($) as the first character of the commler is invoked by either the PERQ Operating System command compile, or it may be run directly (PASCAL.RUN). Furthermore, ent followed by the switch (unique abbreviations are acceptable) and possibly switch parameters. The second form  80 says that it is willing to accept messages for that device. ata1>... The , and bytes of a floppy command must be in the same format that is e 17 Jul 81 This document is not to be reproduced in any form or tranxpected by the NEC floppy chip. The valid values for the byte of a floppy command are: 1 - read a sector of smitted in whole or in part, without the prior written authorization of Three Rivers Computer Corporation. The information in this document is subject to change without notice and should not be construed as a commitment  17 Jul 81 PERQ to by Three Rivers Computer Corporation. The Company assumes no responsibility for any errors that may appear in this Z-80 Messages Bill Glass Donald A. Scelza  document. Three Rivers Computer Corporation will make every effort to keep customers apprised of all  Copyright (C) Three Rivers Computer, 1980, 1981 This document gives a brief descriptiondocumentation changes as quickly as possible. The Reader's Comments card is distrib- uted with this document to  of the messages that are interchanged between PERQ and the Z-80 on the I/O board. The descriptions give the synrequest users' critical evalu- ation to assist us in preparing future documentation. PERQ is a trademark otax of the command, a brief description of its function, and any restrictions. Note that all commands begin with a 153 byte wf Three Rivers Computer Corporation. - 1 - hich is not shown. In all the descriptions, is a byte count. An N of zero is interpreted as 256. The byte has t 17 Jul 81 Perq -> Z80 Messages RS232Out he low order bit set if that device is to be enabled, and clear if it is to be disabled. The remaining 7 bits are device speChar <001>... This message places characters into the RS-232 output ring buffercific and should normally be zero. All numbers are octal unless they are terminated with a period. Whenever PERQ send. The byte count (N) must be less than or equal to sixteen. The Z-80 will give a transmitter ready status whenes a message that requires a data transfer, no further transfer messages, for that device, should be sent until the Z-ver there are sixteen free bytes in the ring buffer. Floppy Command <002><1> Turns the keyboard on or off. No other ster, and the second a data value. The register numbers are: 0 - Interrupt Mask 0 (The Z-80 will always enable BI and BOatus settings are possible. Disk Seek <010> Performs a seek of cylinders. The seek compl with your data); 1 - Address Register; 3 - Parallel Poll; 4 - Interrupt Mask 1; 5 - Serial Poll; 6 - Auxilete message is issued after the appropriate delay time based on the value of . Voltage settings <01iary Command. Again, N must be in the range or 1 to 32. Speech Command <004>... Th1> Enables or disables voltage/temperature checking and sets the minimum and maximum allowais command is similar to the RS-232 output command except that the output goes to the speech channel. The byte count (ble values (the range is inclusive). The values are specified as four bytes for each voltage/tempera- ture. Thedata, 2 - write a sector of data, 3 - format a sector and 4 - seek to a cylinder. The write command is the onN) must be less than or equal to thirty-two. The Z-80 will give a speech ready status whenever there are thirty-twoly command that must contain valid data. This data will be written to the floppy in the specified sector. All  free bytes in the ring buffer RS232 Status <005><3> This command sets the curre writes transfer 256 bytes of data to the floppy. If 256 bytes are not provided by PERQ then the remainder of thent state of the RS-232 channel. represents the baud rate (1 is 9600, 2 is 4800, 4 is 2400, etc.).  sector will be written with what ever is left in the buffer. For all of the commands except Write a byte count  is the bit pattern rrttsspp where: - 2 - of 1 must be specified. This data byte will not be used. GPIB Command <003>...  17 Jul 81 rr is number of bits per receive character (00 for 5, 01 for 7, 1 The allowable value of cmd are: 1 - write data; 2 - write data with EOI on last byte; and 3 - write registers. Th0 for 6 and 11 for 8). tt is the number of bits per transmit character (same as rr). ss is the number of stop bite first two commands cause a data transfer on the GPIB bus. N must be in the range of 1 to 32. The GPIB will nots (00 for synchronus, 01 for 1, 10 for 1 1/2, and 11 for 2). pp is the parity setting (00 for no parity, 01 for be marked as ready until all the bytes have been transfered. The third command allows PERQ to directly write into  odd, 11 for even). Tablet Status <006><1> Turns the tablet on or off. No other st  Default value: Automatic initialization enabled $AUTO+ or /AUTO enables automatic initialization $AUTO-  If the comment exceeds a single line, the remainder of the comment is ignored. If the /VERSION form is used, the ve or /NOAUTO disables automatic initialization If "$AUTO" is not followed by a "+" or "-", then "+" is assumed. rsion string is terminated by either the end of the command line or the occurrence of a '/' character (hence a '/' may not ae: Display of procedure and function names enabled $QUIET+ or /VERBOSE enables display of procedure and function  - 37 - PERQ Pascal Extensions 19 Jul 81  names $QUIET- or /QUIET disables display of procedure and  If the comment form of this switch is used, it must precede the BEGIN of the main body of the program. 18.2.7 P function names $QUIET= resumes the state of the quiet switch rocedure/Function Names The PERQ Pascal compiler generates a table of the procedure and function names at the end  which was in force before the previous $QUIET- or $QUIET+ switch. if "$QUIET" is not fof the ".SEG" file, if so directed. This table may be useful for debugging programs. The format for this switch is: ollowed by a "+" or "-", then "+" is assumed. 18.2.5 Symbols Switch This switch is used to set the number Default value: Name Table is not generated $NAMES+ or /NAMES enables generation of the Name Table $N of symbol table swap blocks used by the Compiler. As the number of symbol table swap blocks increases, compiler executAMES- or /NONAMES disables generation of the Name Table If "$NAMES" is not followed by a "+" or "-", then "-ion time becomes shorter; however physical memory requirements increase (and the Compiler may abort due to insufficie" is assumed. 18.2.8 Version Switch The Version Switch permits the inclusion of a version string in the firsnt memory). Any number of symbol tables blocks from 1 to 32 may be used. The default is 24. The format for this switch is: t block of the ".SEG" file. This string has a maximum length of 80 characters. Currently this string is not used by any other /SYMBOLS:<# of Symbol Table Blocks (1-32)> Note: There is no comment form of this switch, it may only be used on a c PERQ software, however, it may be accessed by user programs to identify ".SEG" files. The format for this switch is: ommand line. 18.2.6 Automatic RESET/REWRITE The PERQ Pascal compiler automatically generates a RESET(INPUT)  $VERSION or /VERSION: to set the Version string. When util and REWRITE(OUTPUT). This may be disabled if desired with the use of the AUTO switch. The format for this switch is: izing the $VERSION form of the switch, the version string is terminated by the end of the comment or the end of the line. he status settings of any device. The byte is treated as a set of one bit flag to indicate which device s001> is the eight bit value received from the keyboard. RS232In Char <002><2*N>... This message transfers up to sixteen characters received on the RS-232 channel. represents Keyboard 010 - Voltage 020 - Clock 040 - Floppy 100 - GPIB 200 - send status change the eight bit quantity receiv- ed. The bytes have the following error bits: 1 (bit 0) - parity; 2 (bit 1) - 3 - 17 Jul 81 Flopp - overrun; 4 (bit 2) - framing. Tablet <003> This message reports the X and Y vy Status <014><003><# Heads> The Floppy Status command is used to set the status ofalues from the tablet. The tablet switch appears as the high order bit of Xhigh. represents the num the floppy. is used to set the floppy to single or double density. A 0 indicates single density ber of clock ticks (1/60 second) elapsed since the sending of the last tablet message. Clock <004>  while a 100(octal) indicates double density. <# Heads> indicates the number of heads that the floppy has. This message reports the number of clock ticks since the last clock message. Note, this message is used only when theValid values are 1 and 2. is used to set the interrupt status of the floppy. If interrupts a clock is enabled and the tablet is disabled. Floppy Data <005>... This me first byte is the low order minimum, the second is the high order minimum, the third is the low order maximum, and the re disable then the floppy will not be able to interrupt the Z80. A 1 indicates that interrupts are to be  fourth is the high order maximum. The ordering of the volt- ages/temperatures is: ground; +5; +12; +12/-12; allowed. A 0 will disable interruptes. Floppy Boot <15> The Floppy Boot message is used to request the Z80 t Vref; Network; CRT; base unit; +55; and +24. The value of specifies the number of data bytes in the commano read a boot file from the floppy. The format of boot floppies is described elsewhere. d. It may fall in the range of 1 to 51 (octal). Clock status <012><1> Turns the clock on or of - 4 - f. No other status settings are possible. Request status <013> Requests the Z-80 to return t 17 Jul 81 Z80 -> Perq Messages Keyboard Char < ses the text of the switch to be printed on the user's screen when the switch is parsed by the compiler. It has no effect o functions much in the same way as the else clause in an IF statement. If the boolean expression of the $IFC switch is trn the compilation process. The format for this switch is: $MESSAGE to print on the console duue, then the $ELSEC text is ignored, otherwise it is included. If a $ELSEC switch is used, no $ENDC preceeds tring compilation The message is terminated by the end of the comment or the end of the lhe $ELSEC; the $ELSEC signals the end of the $IFC region. A $ENDC is then used to terminate the $ELSEC clause. Conine. If the comment exceeds a single line, the remainder of the comment is ignored. Note: There is no command line formditional compilations may be nested. The following are two examples of the conditional compilation mechanism:  for this switch, it may only be used in its comment form. 18.2.11 Conditional Compilation The PERQ Pascal cond Const CondSw = TRUE; PROCEDURE Test; begin {$IFC CondSw THEN} Writeln('CondSw is tppear in the version string). 18.2.9 Comment Switch The Comment Switch permits the inclusion of arbitrary text in itional compilation facility is implemented through the standard switch facility. There are three switches which are used fthe first block of the ".SEG" file. This string has a maximum length of 80 characters. It is particularly useful for ior conditional compilations. The first is the $IFC switch, which has the following form: {$IFC THEN} This switch indicates the beginning of a region of conditional compilation. If the boolean expres- PERQ Pascal Extensions 19 Jul 81 $COMMENT or /COMMENT: to set the comment text. When utilizing the $COMMENT form of the switch, the comment text is terminated by the evaluates to false, then the text which follows is not included. The region of conditional compilation is terminated end of the comment or the end of the line. If the comment exceeds a single line, the remainder of the comment is ignored.by the $ENDC switch: {$ENDC} Upon encountering the $ENDC switch, the state of compilatio If the /COMMENT form is used, the comment text is terminated by either the end of the command line or the occurrence of n returns to whatever state was present prior to the most recent $IFC. - 39 - PEa '/' character (hence, a '/' may not appear in the comment text). 18.2.10 Message Switch The Message Switch cauRQ Pascal Extensions 19 Jul 81 The remaining switch is the $ELSEC switch, and it  tus>... RS232 Status <007><3> Reports the current RS-232 status.settings> give the lower and upper bounds in the same format as the PERQ to Z-80 message. Clock status <016><1> and is the same as for the PERQ to Z-80 message. Tablet Status <010><1nable> Reports the status of the clock. Floppy status <20>.. This message is used to return the st> Reports the current status of the tablet. Keyboard Status <011><1> Reports the current status of the floppy. Up to seven registers may be returned by this message. These are the status registers thatatus of the keyboard. Seek Complete <012> Acknowledges completion of a disk seek.  are provided by the NEC chip. Floppy done <21> The floppy done message is used to indicate that the r - 5 - 17 Jul 81 Status Change <013> equested floppy operation has finished. The low order bit of this message is used to provide error status informatiThis message reports the ability of the Z-80 to accept data transfer messages to different devices. is interon. If the low order bit is set then there was an error during the operation. The Floppy Status command canpreted as a set of one bit flags that indicate which devices are currently permitted. 001 - Can Accept be used to get more detailed informa- tion about any errors that may have occurred. GPIB status <017><6> RS232 Output 002 - Can Accept Speech Output 004 - Can Accept Floppy Input/Output 010 - Can Acc This message reports the status of the GPIB read registers at the last interrupt. Thept GPIB command 020 - Can Accept Disk Seek 200 - Always set Voltage error <014><024> Reports that at least one of the voltage/temperatures was out of the allowable bounds. The values are repos Through; 5 - Interrupt Status 1; 6 - Bus Status. Floppy Boot Error <22> The floppy boot error message will be srted in the same order as in the PERQ to Z-80 message with the low byte preceeding the high byte in each case. ent anytime that there is - 6 - ssage is used to transmit data from a read operation to PERQ. The low order bit of the status byte indicates if the ReaVoltage status <015><75> This message reports the status of voltage/temd operation completed without error. A 1 indicates that there was error. GPIB (not implemented) <006> reports the current values (as in the voltage error message), and ... This message is used to send a block of boot file information from t system, as well as makes up for shortcomings in the PERQ documentation, until appropriahe Z80 to Perq. is the number of bytes in the message. NOTE: in a Floppy Boot Data message a byte count of zero meanste corrections are made. Copyright (C) 1981 Three Rivers Computer Corporation 720 Gross Str NO data bytes. A message with a zero byte count will be sent after all of the boot blocks from the floppy have beeet Pittsburgh, PA 15224 (412) 621-6250 This document is not to be reproden read. uced in any form or transmitted, in whole or in part, without the prior written authorization of Three Rivers Com - 7 - puter Corporation. The information in this document is subject to change without notice and should not be construed as a commitment by Three Rivers Computer Corporation. The Company assumes no responsibility for any errors that may appear in this document. Three Rivers Computer Corporation will make every effort to keep customers apprised of all documentation changes as quickly as possible. The Reader's Comments card is distrib PERQ Operating System User's Guide to Features, Quirks and other Oddities uted with this document to request users' critical evaluation to assist us in preparing future documentation.  Compiled by Michael R. Kristofic July 17, 1 PERQ is a trademark of Three Rivers Computer Corporation.   ________ [BSI79] "BSI/ISO Pascal Standard," Computer, April 1979.  Constant Expressions 3 Constants 3 ______ ____ ______ ___ ______ [JW74] K. Jensen and N. Wirth, PASCAL User Manual and Report, Springer Ver Control Structures 7 Declaration Relaxation 2lag, New York, 1974. [P*] J. Hennessy and F. Baskett, "Pascal*: A Pascal Based Systems Programming Language," St Declarations 2 DISPOSE 23anford University Computer Science Department, TRN 174, August 1979. ___________ __ __ Dynamic Space Allocation and Deallocation 22 ELSEC 39__ ________ __ ______ [UCSD79] K. Bowles, Proceedings of UCSD Workshop on System ___________ __________ __  ENDC 39 EXCEPTION 19 ___ ______ ________ Programming Extensions to the Pascal Language, Institute for Information Systems, Uni Exceptions 19 Exclusive Or 24versity of California, San Diego, California, 1979.  EXIT Statement 7 EXPORTS Declaration 18 - 43 - PERQ Pascal Extensions 19 Jul 81  FILE 14 File Inclusion 35 INDEX (Entries entirely in upper case are reserved words or predeclared identifiers)  Files 2 Function Result Type 16 ALL 21 AND 24 Functions 16 Generic Files 14 Automatic RESET/REWRITE 37 CASE Statement 6 Generic Pointers 13 GOTO Statement 7orrect code will be generated.  Command Line 34 Comment Switch 38 - 42 - PERQ Pascal Extensions 19 Jul 81 20. References  Compiler Switches 34 Conditional Compilation 39   ________ TYPEFILE If the TypeFile program thinks there is something wrong wi 3 - User's Guide to Features, Quirks and other Oddities III. Bugs. ______ ______th the file it is displaying, it advises that the Scavenger program should be run. This is not necessary in the case __ PASCAL COMPILER Documentation on bugs in the PERQ Pascal compiler is contained in the dof improperly closed files. If you want to correct the file length, run the Scavenger to rebuild directories and checkocument "PERQ Pascal Extensions." ______ EDITOR The file lengths. ______ ________ PASCAL COMPILER Documentation  editor sets the default filename to the name typed on its command line. If the editor prompts for a filename, the defau ______ _________ ____________ MEMORY ALIGNMENT REQUIREMENTS The hard disk requires that th on features and oddities in the PERQ Pascal compiler is contained in the document "PERQ Pascal Extensions." e buffers which it uses be aligned on 256 word boundaries. This is only relevent if the user is performing his own cal _____________ Miscellaneous When booting the system from a floppy, the hls to UnitIO in the IO module or I/O routines in the DISKIO module. The standard filesystem calls (such as FSBlkRead)ard disk must still be able to perform a "locate disk heads" operation. Opening or closing the floppy drive door du use their own buffers for the actual transfer and then copy the data to the user buffer; hence any alignment is permitted fring I/O to the hard disk usually causes recoverable disk errors. A Readln on the last line of a file that does or the user buffers. not contain an end-of-line marker causes a run-time error. - 2 - User's Guide  - 1 - User's Guide to Features, Quirks and other Oddities II. Features and Oddities. to Features, Quirks and other Oddities Delete, Rename and Copy ignore extra arguments. Directories can b _________ PARTITION The Partition program does not turn off swapping. Ife easily overwritten by specifying a filename of the form "directoryName>" to many utilities. If you dismount the  the partition that is used for swapping is initialized, the PERQ must be rebooted. The Partition program is casesystem device the system may not be able to find the SHELL program and you will have to reboot PERQ. Real numbers a sensitive. A Partition name must be capitalized exactly as it is in the list printed by Partition. re not implemented. -   Modules 17 NEW 22  Sets 9 SHIFT 24  HANDLER 19 Identifiers 2 NOT 24 Octal Constants 3  IFC 39 INCLUDE 35 OR 24 OTHERWISE 6  Inclusive Or 24 INLINEAWORD 33 Parameter Lists 16 Parameters 16  INLINEBYTE 32 INLINEWORD 32 POINTER 13 PRIVATE 18  Input/Output Intrinsics 26 Integer Logical Operations 24 Procedure/Function Names 38 Procedures 16  LAND 24 LENGTH 12 QUIET 36 Quirks 41  LIST 35 LNOT 24 RAISE 19 RANGE 36  LOADADR 33 - 44 - PERQ Pascal Range Checking 36 RASTEROP 29  Extensions 19 Jul 81 LOADEXPR 33  READ 26 READLN 26  LOR 24 LXOR 24  RECAST 5 Record Comparisons 10  MAKEPTR 32 MAKEVRD 32  References 43 RESET 26  MESSAGE 39 Miscellaneous Intrinsics 29  REWRITE 26 ROTATE 25   PERQ File System Utilities Manual Brad - ii - PERQ File System Utilities Manual - Notation Conventions 17 Jul 81 1. Prefa A. Myers This manual describes the PERQ file system utilities: Partition, Scavenger, Mce: Notation Conventions. The notations used below have been clearly and consistently used throughout this document.akeBoot, and FixPart. Other utili- ties are described in the manual "PERQ Utility Programs Manual." In addition ______ _______ SYMBOL MEANING [] , relevant parts of the file system are described so the programs can be understood. Copyright (C) optional feature {} 0 to n repetitions CAPITALS  1981 Three Rivers Computer Corporation 720 Gross Street Pittsburgh, PA 15224 (412) 621-6250 PERQ Fil literal lowercase or LowerCase metaname ^ e System Utilities Manual 17 Jul 81 This document is not to be re control key CR carriage return SHIFT produced in any form or transmitted in whole or in part, without the prior written authorization of Three Riveshift key | or lt filename is not changed. _____________ Miscellaneous Sprs Computer Corporation. The information in this document is subject to change without notice and should ecifying a wildcard character in the destination filename of many utilities (e.g. the Editor, Plx) may result in files whnot be construed as a commitment by Three Rivers Computer Corporation. The Company assumes no responsibility foose names contain those characters. To delete, rename or copy such files, the Shell quote facility must be used. For any errors that may appear in this document. Three Rivers Computer Corporation will make every effort to r example, to delete a file named *, the command: delete *'* must be used. Rep keep customers apprised of all documentation changes as quickly as possible. The Reader's Comments card is distribeated use of ^S and ^Q to control the display causes the PERQ to "beep". These "beeps" may be ignored. - uted with this document to request users' critical evalu- ation to assist us in preparing future documentation. - 4 -  PERQ is a trademark of Three Rivers Computer Corporation.   John P. Strait June 25, 1981 2.c Code Segment Organization 1.C Error Handling and Fault Conditions 2. Instruction Format 3. Pointers  Copyright (C) 1981 Three Rivers Computer Corporation 720 Gross Street Pittsburgh, PA 15224 (4 4. QCode Descriptions 4.A Variable Fetching, Indexing, Storing and Transferring 4.A.1 Loads and Stores of One W12) 621-6250 This document is not to be reproduced in any form or transmittord 4.A.1.a Constant One Word Loads 4.A.1.b Local One Word Loads and Stores 4.A.1.c Own One Word Loads and Stores 4.A.1.d Gled, in whole or in part, without the prior written authorization of Three Rivers Computer Corporation. The informaobal One Word Loads and Stores 4.A.1.e Intermediate One Word Loads and Stores 4.A.1.f Indirect One Word Loads and Stores 4.A. STARTIO 29 STOREXPR 33 tion in this document is subject to change without notice and should not be construed as a commitment by Thre STRING 11 Strings 11 e Rivers Computer Corporation. The Company assumes no responsibility for any errors that may appear in this docu Switches 34 Symbols Switch 37 ment. Three Rivers Computer Corporation will make every effort to keep customers apprised of all documentation  Type Coercion 5 Type Compatibility 5 changes as quickly as possible. The Reader's Comments card is distributed with this document to request u Unsigned Octal Integers 3 VERSION 38 sers' critical evaluation to assist us in preparing future documentation. PERQ is a trademark of Three Ri WORDSIZE 31 WRITE 27 vers Computer Corporation. - ii -  WRITELN 27 - 45 -  Table of Contents 1. Q-Machine Architecture 1.A Definitions 1.B Memory Organization 1.B.1 Memory Organization at the Process Level 1.B.1.a Global Data 1.B.1.b Local Data 1.B.1.c Run-Time Stack Organization 1.B.2 PERQ QCode Reference Manual Miles A. Barel  Memory Organization at the System Level 1.B.2.a System Segment Address Table 1.B.2.b System Segment Information Table 1.B.  of directories. The main directory in a partition (the one you get if you simply specify the partition name) is the Root dDisk.Cmd" which is found on the boot floppy in every release package. A heavily-commented printed copy of this commanirectory for that parti- tion. All directories can contain other directories and files. Directories are stored as stad file is provided as instructions for how to initialize a blank device. To create a file system on a floppy, usendard files and can be accessed by any program. However, the system knows special things about their format. All file the Partition program described below. The manual "How To Make a New System" describes the process necessary to create a s in this file system can be noncontiguous; blocks for files may be scattered throughout the partition in which they residsystem using the MakeBoot program. This manual provides the background necessary to understand these processes. e. The naming conventions for filenames are described in detail in "The PERQ Introductory User Manual" but all are o - 2 - PERQ File System Utilities Manual - Partitions 17 Jul 81 3. Pf the form: [[[device]:partition]>]{directory>}[filename] Files may be stored on floppy disks in two ways. The PLXartitions and the Partition Program. The partitions on a device are restricted to be fewer than 32768 blocks, where ea program can be used to transfer files to and from the floppy, or the floppy can be initialized as part of the file systech block is 256 words (512 bytes, 4096 bits). The block size is fixed for all devices. On a 12-megabyte disk or a flopm. These types of floppy disks are called "PLX floppies" and "filesystem floppies" respectively. NOTE: Floppies opy, the entire device can be in one partition. On a 24-megabyte disk, at least 2 partitions are needed. We recommend, howeverf one type CANNOT be used for the other; the formats are totally incompatible. Floppy disks that contain files transfer- red , that each partition have 10080 or fewer blocks in them, otherwise Scavenger (described below) cannot handle the partby the program PLX must be accessed by the PLX program (and not by the file system directly), and PLX cannot read a file ition in one pass. All partitions must start and end on cylinder boundaries, the Partition program enforces this constr - 1 - PERQ File System Utilities Manual - Introduction 17 Jul 81 2. Introduction. The PEsystem floppy. To create a file system floppy, use the Partition program described below. The user programs that haRQ has a hierarchical, multi-directory file system which supports search lists and noncontiguous files. Devices (e.g., hndle the file system are described in the "PERQ Utility Programs Manual" and only Partition, Scavenger, MakeBoot, and Fard and floppy disks) are divided into a number of sections called "partitions." Each partition can contain any number ixPart are described in detail here. To create a file system on a blank disk, it is necessary to run the command file "Init   - iv - PERQ QCode Reference Manual 19 Jul 81 1. Q-Machine Architecture 1.A Base (register). Physical address of the base of the current stack segment. PC - Program Counter (regis Definitions Segment - A segment is the underlying structure of PERQ's virtual memory system. It ter). Physical address of the current instruction. GDB - Global Data Block. A GDB contains the globalis the largest area of contiguous memory, and also the unit of swappability. Segments come in tw variables for a particular module. GDBs always begin on a double-word boundary. o types: code segments, which are byte-addressed, read-only, and fixed in size with a maximum - 1 - PERQ QCode Reference Manual 19 Jul 81 ISN size of 64K bytes (32K words); and data segments, which are word-addressed, read-write, and variable in size  - Internal Segment Number (compiler-generated). SSN - System Segment Number (system-generated). Note, System  with a maximum size of 64K words. MSTACK - Memory Stack. A data segment which contains the user run-ti Segment 0 is reserved and may never be used. LL - Lexical Level. Note: the Lexical Level of the main body me stack. ESTACK - Expression Stack. A 16 level expression evaluation stack (internal to the PERQ process of a process is always 0. RN - Routine Number (register). RN contains the ordinal number of the current 2 Loads and Stores of Multiple Words 4.A.2.a Double Word Loads and Stores 4.A.2.b Multiple Word Loads and Stores 4.A.3 Byor). MTOS - Top of MSTACK. MTOS refers to the virtual address of the top of the memory stack. (MTOS) denotte Arrays 4.A.4 Strings 4.A.5 Record and Array Indexing and Assignment 4.B Top of Stack Arithmetic and Comparisons es the item on the top of the MSTACK. ETOS - Top of ESTACK. (ETOS) denotes the item on the top of the  4.B.1 Logical 4.B.2 Integer 4.B.3 Reals 4.B.4 Sets 4.B.5 Strings 4.B.6 Byte Arrays 4.B.7 Array and Record C ESTACK. Activation Record - Stack segment fragment for a single routine containing local variables, paramomparisons 4.B.8 Long Operations 4.C Jumps 4.D Routine Calls and Returns -eters, function result, temporaries (anonymous variables), other housekeeping values (Activation Co iii - Table of Contents 4.E Systems Programs Support Procedures Index ntrol Block - defined below), and a copy of the EStack at the time the activation record is created.   CB - Code Base (register). Physical adddress of the base of the current code segment. SB - Stack  aint. No file or directory can be in more than one partition (a file cannot cross a partition boundary) so having froppy or when installing the file system on an old machine). If you want to modify an existing device, answer "NO". If you aee blocks in one partition does not prevent you from running out of free block space in another. The Partition program nswered "YES" to initialize the entire disk, then the program asks for information about each partition in turn. Tis used to create and modify the partitions on a device. Creating a partition usually destroys all old data in the area wherehe device must first be given a name (eight or fewer characters). Next, each of the partitions must be given a name  the partition is made. The device should first be formatted (by using DTST on hard disks or FLOPPY for floppy disks).(also eight or fewer characters). Examples of partition names used for the hard disk include "boot", "user", and "exp". After formatting, Partition is the first program to run. Partition asks whether to do a "dry run". This is a debuggi There is no problem with having a partition with the same name as a device, but all the partitions must have uniqueng feature. If you answer "YES", then nothing will be modified on the device. Answer "NO" if you want to make modifications names. The size of each partition is - 3 - PERQ File System Utilities Manual - Part. Next, Partition requires that you tell it what device you want to modify. The choices are 12 or 24-megabyte disitions 17 Jul 81 also requested. As mentioned earlier, we have found that 10080 or fewer blocks are desik, or single or double-sided floppy disks (double-density floppy disks are not yet implemented). A floppy that is formrable; otherwise Scavenger (described below) cannot handle the partition in one pass. This means there are 3 partitions atted on both sides can be partitioned as either single or double sided. It is very important that you type the correct devon a 12-megabyte disk and 5 on a 24-megabyte disk. The minimum size for partitions is 120 blocks on a 12 megabyte disk, 240 ice type to the Partition program. WARNING: Do not type ^C or ^SHIFT-C while running the Partition program where the blocks on a 24-megabyte disk, and 6 blocks on a floppy disk. The sizes of all partitions must be multiples of the mimimum device specified is the one you are running from. Partition needs to dismount the device so it can be worked on, and if you size for that device. For each partition on the device, the program asks whether to initialize the partition pages type ^C, it is not able to remount the device and you may need to reboot the machine. Next, the program asks if y. This process puts all the pages in the partition on the free list and therefore should be done for a new device. The nou want to partition the entire disk. Answer "YES" if you are starting from scratch (for example, on a newly formatted flext question is whether to test after initializing the pages. Although this slows down the initialization somewhat, it is goo r (SSN) for the current stack segment. This segment must be resident in physical memory for a process to be ent activation record. When the LP is stored in an Activation Control Block (ACB), it is represented as a runnable. PS - Parameter Size. PS is the number of words in an activation record which are n offset from SB. Unlike other values in the ACB, the LP value is the current value of the Local Poused for parameters. RPS - Result + Parameter Size. This is the number of words in an activation record inter, not some previous value. XGP - eXternal Global Pointer. Pointer to another code which are used for function result and parameters. LTS - Local + Temporary Size. LTS is the number of words i segment's GDB, represented as an offset from SB. XST - eXternal Segment Table. For a given program module, the n an activation record which are used for locals and temporaries (anonymous variables). (Note XST translates ISNs to SSNs and XGPs. RS - Return Segment. RS is the CS of the caller. RA - Return Addres: the LTS of a main program body is always forced to 0.) AP - Activation Pointer (register). AP contains. PC of the caller, represented as an offset from CB. RR - Return Routine. RN of the caller. Rs the physical address of the current activation record. DL - Dynamic Link. This is the AP of the caller, D - Routine Dictionary. Each code segment contains a routine dictionary which is indexed by RN. For each routinerepresented as an offset from SB. SL - Static Link. This is the AP of the surrounding routine, , the routine dictionary gives the lexical level (LL), entry address, exit address, parameter sizerepresented as an offset from SB. TP - Top Pointer (register). TP contains the physical address of the top  (PS), result + parameter size (RPS), and local + temporary size (LTS). ACB - Activation Control Block. Theof the run-time MStack. TL - Top Link. TP of the caller, represented as an offset from SB.  ACB contains housekeeping values in the activation record. It contains the SL, LP, DL, GL, RS, RA, RRroutine. Note: RN must lie in the range 0 to 255. CS - Code Segment (register). CS contains the system s - 2 - PERQ QCode Reference Manual 19 Jul 81 GP - Globegment number (SSN) for the current code segment. This segment must be resident in physical memory fal Pointer (register). Physical address of the GDB for the current code segment. GL - Global Link. GP or a process to be runnable. SS - Stack Segment (register). SS contains the system segment numbeof the caller, represented as an offset from SB. LP - Local Pointer (register). Physical address of the curr n name where it was linked. If you rename the device, then no program on that device can be run (including the Shell, Lnt to initialize the pages. If not, then all the files on both partitions can be saved. Just after Partition exits, you ogin, Partition, for example). If you rename a partition, no program in that partition can be run. If you did not r must run Scavenger program (see below) on the new partition. When running the Scavenger in this case, be sure to telename the device, you are asked which partition you want to modify. Type the name of one of the partitions. The progl it to rebuild the directories so that the directories of the two partitions can be joined together. Partition also can chd practice to do this testing. If any pages are found to be bad, they are removed from the free list so they will neveram then asks what you want to do to the partition. You can split a partition into two parts, merge a partition with anr be accessed again. The final question asked before initialization is whether to write every page twice. This providesother, initialize a partition, or change the name of a partition. It is never a good idea to split a partition with files in some additional protection from bad pages since random data is written into the header and body of each block. It has it since files cannot cross partition boundaries. Any file which has blocks in both partitions will be destroyed. It is s been found in practice that some bad blocks on the disk will pass the first test and fail this one. After all the bloafe to split an empty partition or one that you plan to erase. The program asks how much of the partition to leave with thecks on the device have been included in a partition, the program displays some data about the device and asks whether  old name; the rest of the blocks in the partition will be put in the partition just created. The  to remount the device. Only mounted devices can be accessed, so if you plan to use the device, say "YES". If you s - 4 - PERQ File System Utilities Manual - Partitions 17 Jul 81 program will ask if you wantaid that you did not want to initialize the entire device, the program reads the device information block (which is in to initialize the partition pages to create a new free list. This is recommended. Next, a name for the new partition is a reserved, fixed location on cylinder 0) to find what partitions are currently on the device. These are displayed in  solicited and the pages are initialized if desired. It is much safer to merge two partitions together than to split one apthe order they appear on the disk. The first question asked is whether to rename the device. NOTE: Before renaming a art. You specify the first partition and it is joined with the partition which is next on the disk. This is the only device or partition it is important to note that every Run file on the device has incorporated in it the device and partitiotime the order of the partitions on the disk matters. If you want to erase the new, bigger partition, say that you wa  and EP. In the ACB, the DL, GL, RS, RA, and RR are the AP, GP, CS, PC, and RN of the caller, respecn - Asserting a certain exception. - 4tively. The SL is the AP of the routine that surrounds the current one. The LP in the ACB is the  - PERQ QCode Reference Manual 19 Jul 81 1.B Memory Organization The P current local pointer. EEB - Exception Enable Block - Each EEB enables a single exception by aERQ's virtual memory system features a segmented 32-bit virtual address space mapped into a 20-bit physical address space.ssociating an exception with a handler. A (possibly empty) list of EEBs is associated with each acti The segment is the unit of swappability, and comes in two types: 1) Code segments which are byte-addressed, read-only, vation record in the stack. Enabling an Exception - Associating a certain exception handler with a certain exand fixed in size with a maximum size of 64K bytes (32K words). 2) Data segments which are word-addressed, rception. - 3 - PERQ QCode Reference Manual 19 ead-write, and variable in size with a maximum size of 64K words. A PERQ process is a collection of up to 64KJul 81 EP - Exception Pointer. The address (as an offset from SB) of a list of nodes that describe whic code and data segments. One of the data segments is the stack segment. Every process must have a stack segment and ah exceptions are enabled in a certain routine. ER - Exception Routine Number. The routine number of at least one code segment. All segments are allocated in 256 word chunks and when in physical memory are aligned n exception. ES - Exception Segment Number. The segment number of an exception. Excon 256 word boundaries. Note: A single segment must exist in contiguous memory. It may not be fragmented. 1.B.1 Memoryeption - An error or unusual occurrence in the execution of a routine or program. Exception Handler - A pro Organization at the Process Level The memory organization is designed with the following attributes in mindcedure to be executed when a certain exception is raised. HR - Handler Routine Number. The routine numb: 1) to allow separately compiled code segments to be grouped into a single process, 2) to allow code segments to be shaer of an exception handler. NE - Next Exception. The address (as an offset from SB) of thred among processes, 3) to allow each code segment to have its own global variables, and 4) to allow one code segmene next in a list of nodes that describe which exceptions are enabled in a certain routine. Raising an Exceptiot to reference routines and global variables in other code segments. To achieve this, the following high-level char  PERQ File System Utilities Manual - Scavenger 17 Jul 81 4. The Scavenger Program. The Scavengeurrently no way to rebuild the directory! In this case, you must initialize the partition, r program fixes a partition on a device that contains useful files. It checks all files for consistency, rebuilds the fthus losing all files there. Scavenger program fixes one partition at a time. It is possible (and sometimes necessarree list, and creates a new directory structure for the partition. The Scavenger should only be run on devices that have alrey) to scavenge partitions other that the one you are currently running in. It is usually safe, however, to scavenge theady been initialized by the Partition program. The Scavenger checks and fixes some system information and then chec current partition. Scavenger program has three separate phases. In phase one, it checks and updates some of the systks all files in a partition for consistency and recreates the free list. It can also recreate the directories. The Scavem information. In this phase, bad boots are deleted. If a boot has been defined by MakeBoot (see below) but either the menger also removes bad boots. The Scavenger should be run whenever an inconsistency is found in the file system or whenicrocode or system code files have been deleted, the boot is known to be bad. The Scavenger cannot tell, however, ifange the name of a partition. Do not change the name of the partition that is used in the current path since the default p some program aborts and asks you to run the Scavenger. WARNINGS: 1) As with the Partition program, do not type Controath name then becomes invalid. In addition, all entries in the search list that refer to the partition renamed will no longel-C (^C) to Scavenger after it has begun writing on the device. During the read pass, it is r work. After a rename, therefore, the system may not be able to find the Shell or any other programs. Finally, you can safe to ^C. If you type ^C after it begins rebuilding the directory, you may not be able to acce initialize the partition. This is a fast way to delete all the files in the partition. After asking whether to initialss anything in the directo- ry. If this happens, rerun Scavenger from another partition. ize the partition, the program asks whether to initialize the partition pages. If you answer "NO", you must use Scavenger prog 2) Scavenger will not be able to recreate the directory if there are no free blocks in the partition. Thram to recreate the directory immediately after running Partition. There are few reasons to initialize the partition witerefore, if your partition is full, you must delete some files before running Scavenger. If you hout initializ- ing the pages. - 5 - cannot delete any files due to a bad directory and there are no free blocks, then there is c double-word boundary. +-----------------------+ SB ---->| | -----------+ | eXternal Global Pointer (XGP)| +-------------------------------+  | undetermined space | | | +-----------------------+  | System Segment Number (SSN) | +-------------------------------+ 1.B.1.b Local Data At the lo | XST 1 | +-----------------------+ | GDB 1 | cal level, there is an activation record, which consists of local variables, function result, parameters, teacteristics are implemented: 1) All code is re-entrant. 2) Each code segment only refers to other code segme +-----------------------+ | | .... | nts by internal (compiler-generated) segment numbers, which are not necessarily the same as the system-assigned | +-----------------------+ | | | XST segment numbers. 3) Each code segment in a process has its own Global Data Block on the run-time stack. 4) i | | | +-----------------------+ GP ---->|  Each code segment has an external segment table to permit referencing global variables and routines from other  | | GDB i | | | +--- code segments. - 5 - PERQ QCode Reference Manual --------------------+ | | .... toward the  19 Jul 81 1.B.1.a Global Data At the global level, there is a Global Data Block (GDB) and an eXternal top of stack The XST for each segment is indexed by the internal segment numbers (ISNs). The entry is at G Segment Table (XST) associated with each code segment in a process. For a particular program module, the GDB contains thP - 2*ISN (Note: There is no entry for ISN 0; ISN 0 always refers to the current segment). Each entry contains the offset e global variables, and the XST translates internal (compiler- generated) segment numbers (ISNs) to actual system segfrom stack base (SB) of an external data block (XGP) and the actual system segment number (SSN) of the external segmentment numbers (SSNs) and eXternal Global Pointers (XGPs). To simplify the system, we devote a single pointer to reference bot. The XGP values are set by the linker, and the SSN values are set by the loader. -h the current GDB and XST. This Global Pointer (GP) points to the lowest address in the GDB and is ALWAYS aligned on a  6 - PERQ QCode Reference Manual 19 Jul 81 +-------------------- rrigible" and removed from the file system. All blocks that were in files containing bad or incorrigible blocks are put in The Scavenger in this pass also makes sure the length of all files are correct and allow you to specify a new length. Note  the - 6 - PERQ File System Utilities Manual - Scavenger 17 Jul 81  that this refers to the stored length rather than the number of blocks in a file. Certain files, like directories and sw bad file. In addition, any malformed chains are added to the bad file. The user is asked for a name for this bad file in ap files, do not bother to set the length field. File lengths usually become wrong when the file is opened and written but phase three of Scavenger. In phase three of the scavenge, the directories for the partition are completely rebuilt. Scanot closed properly. This, for example, happens when a transfer is aborted. The Scavenger asks the user a number of qvenger will delete the old directories, if desired. Otherwise, the old directories are marked as such and their names haveuestions before it begins processing the partition. First, it asks whether to look at the floppy or hard disk. It then a "$" added to the end. If there is not enough room for copies of all the directories in the partition to be crea checks that device to see how big it is and then asks if its choice is correct. When it has this information, Scavenger askted, Scavenger will crash leaving the directories only partially created. In this case, you have to delete some of the files s if it can make changes to the device in the first two phases of the program (the directory fixing is handled later). Thisin the directory (run Direct to see them) and then rerun Scavenger. Before entering any name in a directory or creating a ne is like the "dry run" for the Partition program. If you answer "NO", then Scavenger checks the partition for errorw directory, Scavenger first checks to make sure the name seems reasonable as a filename. Certain characters are not allowes and reports them but does not fix anything. If you are running Scavenger only to fix the directory, it is about twice a a boot file is deleted and another created in the same place before Scavenger is run. In this case, the boot will seem d in filenames. These include any control characters, "<", "/", ":", and " ". In addition, the name may not end w valid but will not work. During the second phase of the scavenge, the partition specified by the user is checked for consith a ">" or contain ">..>" or ">.>". If a bad name is found, or two files have the same name, Scavenger requests aistency. All blocks are read and a new free list is generated in ascending disk order (the old free list is discarded). In a new filename from the user. After Scavenger is finished, you can examine the files with bad names to see whether they conddition, blocks that are not readable are marked as "bad", and if they cannot be rewritten, they are marked as "incotains any useful information. If so, rename or edit the files to recover the data. Otherwise, simply delete the files.  tack m-2 | +-----------------------+ | Exceptions m-1 | +-- | Exceptions m | | | +-----------------------+ ---------------------+ | Extra m-1 | +-----------------------+ |  | | | Extra m | TP ---->| |  | .... - 7 -  +-----------------------+ toward the top of stack The function result, parameters, lo PERQ QCode Reference Manual 19 Jul 81 .... cals and temporaries are located by an offset from LP. - 8 -  | | +-----------------------+ LP ---->| | PERQ QCode Reference Manual 19 Jul 81 Each ACB has the following form:  | Result m | | | +-----------------------+  +---------------------------------------+ | Static Link (SL) | +----mporaries (anonymous variables), the Activation Control Block (ACB), the previous EStack, exception enable blocks, a | | | Parameters m | | | nd extra values that the routine may push and pop from the run-time stack. Three pointers are used to access and k +-----------------------+ | | | Locals m | eep track of this information: the top-of-stack pointer (TP), the current-activation pointer (AP), and the local-variable | | +-----------------------+ | | s pointer (LP). +-----------------------+ | Result m-1 | +------ | Temporaries m | | | +-----------------------+ A-----------------+ | Parameters m-1 | +-----------------------+ | LocaP ---->| | | ACB m | | | ls m-1 | +-----------------------+ | Temporaries m-1 | +---- +-----------------------+ | | | EStack m-1 | -------------------+ | ACB m-1 | +-----------------------+ | ES | | +-----------------------+ | |  number consisten- cy testing and serial number consistency testing. The header of every block contains information about it can rewrite bad blocks. If a block cannot be successfully read, it is possible that writing new data onto the block wilthe state of that block. The information includes the count of the block in the file (is it the first, second, etc.) andl fix the problem. However, for our hard disks, this seems to have a small chance of fixing the problem. Therefore, the d a two-word identifier for the file the block belongs to. These numbers are checked for correctness if you answer "YES"; efault answer is "NO". Howev- er, if you answer "YES", the bad blocks will be rewritten. If the write or a subsequent reathere is no reason to answer "NO" to these questions. Just type CR to get the default which is "YES". Then Scavenger asks ifd fails, then the block is "incorrigible", otherwise it is "bad". If rewritting is not permitted, then the block is mark there is enough memory to do the scavenge in - 7 - PERQ File System Utilities Manuaed "incorrigible" as soon as the read fails. If there are only transient read errors, the block is left alone. After you l - Scavenger 17 Jul 81 one pass. If your partition has 10080 or fewer blocks in it and if the screen has b answer all of the questions, Scavenger can get to work. The title line of the window is updated to show what Scavenger is een shrunk (the Shell shrinks the screen when it knows you are running the Scavenger), then the answer is "YES". If your working on. In addition, various cursors are used to show the progress of the different passes. First, Scavenger does  partition is bigger than 10080 blocks, then answer "NO". Three passes will then be used and the program will be correspon phase one checking as described above, fixing any discrepancies if you allowed changes. If Scavenger finds a problem with tdingly slower. If you answered "YES" when asked if Scavenger could change your disk, you will be asked three more qhe partition or device information blocks it cannot fix, it asks for help. If you cannot figure it out either, the problemuestions about ways Scavenger might change the disk. First, Scavenger asks whether it should delete temporary files.  may be that: 1) you specified the wrong device type to the first question; 2) the device is not a file system device (e.g.  Temporary files exist for swapping; all user files are permanent. Second, the Scavenger asks if it should delete old bada PLX floppy); 3) the device has not been initialized; or 4) the device has been messed up beyond repair. Unfortuna segments. As described above, files with bad blocks in them are marked as bad. If you answer "YES" to this question, thetely, the only fix in this case is to re-partition the device from scratch. After the device and partition informats fast to answer "NO" to this question; otherwise, "YES" is a good idea. Next, Scavenger asks if it should do logical block n the bad file created by the previous scavenge of this partition is added to the free list. Finally, Scavenger asks if   | Return Segment Number (RS) | +---------------------------------------+ this: +-----------------------+ | Number of Words Saved | +---------------- | Return Address within Segment (RA) | +---------------------------------------+ | Retu-------+ | (ETOS) | +-----------------------+ | (ETOS-1) rn Routine Number (RR) | +---------------------------------------+ | Exception Poin | +-----------------------+ | | .... ter (EP) | +---------------------------------------+ toward the top o | | +-----------------------+ | (ETOS-n) |f stack The values in the ACB are the AP of the surrounding routine (SL), the current (not previous) LP, the AP o +-----------------------+ toward the top of stack f the caller (DL), the GP of the caller (GL), the TP of the caller (TL), the SSN of the caller (RS), the program counter  - 10 - PERQ QCode Reference Manual (PC) of the caller (RA), the RN of the caller (RR) and a pointer to the current exception enable records (EP). Note:  19 Jul 81 1.B.1.c Run-Time Stack Organization The following is an outline of the stack for a process ofWhen previous pointer values are saved in the ACB they are called links: SL, DL, GL, TL. Because the current (not previous) n segments, executing the mth routine call, which is in the ith segment: +-----------------------+ LP and EP are stored in the ACB, they are called pointers, not links. The static link is not used for main programs an SB ---->| | | undetermined space | | -----------------------------------+ | Local Pointer (LP) (current) | +--------------d top-level routines. It is zero for these routines and is therefore a means of detecting top-level routines. The dynamic-------------------------+ | Dynamic Link (DL) | +------------------------ link is zero for the first routine on the stack (the one at the base of the stack). This is used to detect the end ---------------+ | Global Link (GL) | +----------------------------------of the stack during stack searches. - 9 - PERQ QCode Referen-----+ | Top Link (TL) | +---------------------------------------+ ce Manual 19 Jul 81 The EStack image immediately follows the ACB and looks like   partition information block. Next, the directory building pass is started. Scavenger asks whether it should rebuile start. This table is called the "Random Index Table." Scavenger, as part of the directory building phase, can rebuild theild the directory. Sometimes it recommends that you do this, otherwise there is no default. If you suspect there is a pr random indices for all files. There is a separate question for this with a default answer of "NO". There is usually ion checks out, Scavenger displays a list of the partition names and asks which one it should work on. Type the name of oblem with the directories and if there are enough free blocks, answer "YES". The old directories will be deleted, if you sthe partition to be scavenged. Next, Scavenger will display some information about the specified parti- tion. The valueso specify. Otherwise they are saved for later inspection. A "$" is appended to the end of their names and their file type i are those stored in the partition information block before the scavenge. Now Scavenger makes a read pass through the pars changed to ExDirFile (directories all have the type DirFile). New director- ies are then created whenever needed. Thitition building tables of each block's next and previous link (this is the data usually visible in the lower portion of s means that empty directories are not recreated. The old directories are just files that you can delete after the scavethe screen). The pass is done in eight parts for efficiency. There- fore, the Scavenger cursor goes down the screen eightnge. Note: This scheme makes it easy to recover from overwriting or deleting a directory since the directory reappea times before the next step. The tables built by Scavenger are now checked for consistency, and the cursor changes to srs after a scavenge. As described above, the Scavenger checks and allows fixing file lengths if desired. For each fihow that checking is in progress. If any loops are found, Scavenger breaks the loops and blinks the screen to show thale, it checks the stored length with the actual number of blocks in the file. If they do not match, it allows you to spect a loop has been fixed. Afterwards, if changing the device is allowed, the Scavenger rebuilds the free list. This requiify a new stored length. This can be any value, but making it bigger than the number of blocks in the file is not recommenres a write pass for all blocks on the free list - 8 - PERQ File System Utilities ded. The default for the stored length is the number of blocks in the file. The Scavenger does not check the lengths fManual - Scavenger 17 Jul 81 and a write cursor is displayed. If any bad blocks were found, some more reads or directory files or files with their type field set to "SWAPFILE." Each file has a table which points to each logicaland writes are necessary to make the bad blocks into a well-formed chain. After this pass, Scavenger writes the new  block of the file. This allows the file system to find a random logical block without searching down the chain from the f -+ | GDB 1 | +-----------------------+ |  19 Jul 81 .... | | + | .... | | +-----------------------+ -----------------------+ | ACB 1 | +-----------------------+  | | | XST i | | | | EStack 0 | +-----------------------+ | Exceptions 1 |  +-----------------------+ GP ---->| | | GDB i |  +-----------------------+ | Extra 1 | +-----------------------+ LP --- | | +-----------------------+ | | ->| | | Result m | | |  .... | | +-----------------------+  +-----------------------+ | | | Parameters m |  | XST n | +-----------------------+ | GDB n |  | | +-----------------------+ | |  +-----------------------+ | ACB 0 (main program) | +-----------------------+  | Locals m | | | +-----------------------+  | Exceptions 0 | +-----------------------+ | Extra 0 |  | | | Temporaries m | | |  +-----------------------+ | Result 1 | +-----------------------+  +-----------------------+ AP ---->| | | ACB m |  | Parameters 1 | +-----------------------+ | Locals 1 |  | | +-----------------------+ | |  +-----------------------+ | Temporaries 1 | +-----------------------+  | EStack m-1 | | | +-----------------------+ | +-----------------------+ | XST 1 | +---------------------- | | - 11 - PERQ QCode Reference Manual  e assigned to the floppy disk. The default that is used when no keys are held down is lower case "a". Boot letters can be fessages SW Loader SW Reader SW Perq_String SW reed of the associated boot by deleting the system and/or interpreter boot files and then running the Scavenger. Any prog Screen SW FileSystem SW GetTimeStamp SW FileDefs SW ram can be made to work "stand-alone" (so it can be booted) by initializing various modules as the System program does. It  Memory SW IO_Init SW RunRead SW - 10 - is generally not necessary or desirable to have programs other than the System be stand-alone. The run file name given to PERQ File System Utilities Manual - MakeBoot 17 Jul 81 FileDir SW  MakeBoot determines on which device and partition the boot will be. MakeBoot takes the directory part of the file name  Scrounge SW The system data segments that the hardware uses are required to be unmovable, the data used by software (*no reason to rebuild the indices unless Scavenger asks you to. Building the random indices for large files takes a long ti and uses that to determine on which device and partition to put the boot. Therefore, to make a boot somewhere, firsme. If a bad file was created, Scavenger will ask for a name for the that file at the end of the directory building phast copy the run file to that partition. After specifying the run file, Makeboot asks for the configuration file. This file e. If you allow Scavenger to enter and fix the indices for the bad file, you can then type and edit it as a normal file. tells MakeBoot which System modules are swappable. The format of the file is: Module-name swappability In this way some useful information may be reclaimed. - 9 -  where swappability is "sw" for swappable, "um" for unmovable (stronger than unswappable), or "us" or blank for uns PERQ File System Utilities Manual - MakeBoot 17 Jul 81 5. MakeBoot. The MakeBoot program creates nwappable. The default is unswappable so only the modules in your system that you want to be swappable or unmovable need ew systems. An overview of its use appears in the manual "How To Make a New System". The "PERQ Introductory User Mto be listed. The default system config file (named System.nn.Config) is: *SAT* UM anual" describes the booting process. MakeBoot creates a boot file taking a stand alone run file (such as a system) and then *SIT* US *Cursor* UM *Screen* UM *Font* US  associates this boot file with a letter. The lower case letters are assigned to the hard disk and the upper case letters ar*IO* UM System SW Stream SW Writer SW IOErrM  2) Segment Size (number of 256 word blocks - 1) 3) Flags Not Resident Recents being moved from one location in physical memory to another. If moving is true, Resident wly Used Moving Shareable Segment Kind Segment Full ill be false. Moving is used only by the swapper to determine how to handle segment faults.  | | | Exceptions m | | |  Segment Table Entry In Use The Segment Base Address is the upper 12 bits of the physical address of the bas +-----------------------+ | | | Extra m | e of the segment. If the segment is not resident in physical memory, this field is undefined. The lower 8 bits of the Se TP ---->| | +-----------------------+ toward the top of stack gment Base Address are always guaranteed to be zero (since all segments are aligned on 256-word boundaries). The Segme - 12 - PERQ QCode Reference Manual 19 Jul 81 nt Size is one less than the size of the segment in 256-word blocks (i.e., Segment Size 0 = 256 words). The Flags hav 1.B.2 Memory Organization at the System Level The system makes use of two tables to control memory usage, the Sye the following meanings and uses: Not Resident - When true, this flag indicates that the segmstem Segment Address Table and the System Segment Information Table. The former contains all information which is needeent is either swapped out or that the segment table entry is not in use. When false, this flag d by the Q-Code micro-code (location, size, residency, etc). The latter contains other information which is only referen indicates that the entry is in use and the segment it describes is resident in physical memory. (Sced by the operating system (reference, I/O and lock counts; maximum size; etc). 1.B.2.a System Segment Address Table ee the "Segment Table Entry In Use" flag.) - 13 - PERQ QCodeThe System Segment Address Table is a dynamic table, which is always resident in physical memory starting at physical addres Reference Manual 19 Jul 81 Recently Used - This flag is set when a segment is accs 0. This table contains two words per segment, and contains all information that the Q-Code micro-code needs to essed. It is used by the swapper to determine which segments are likely candidates know about each segment. The information contained in this table is: 1) Segment Base Address (upper 12 bits)  to be swapped out when space is needed. Moving - This flag, when true, indicates that the segment i  boot file is created by MakeBoot by reading the supplied run file. The standard microcode is usually used with all boot fil FixPart is an experimental program for fixing the Device and ___ ___________ Pes. It is used by MakeBoot to create the interpreter boot file if you so specify. If you have already created a boot for the artition information blocks. It is not recommended that customers try to use it without assistance. Unlike the other current letter and you have not changed microcode, it is not necessary to make a new interpreter boot file, but it never h programs described above, FixPart is not automatic and can cause a lot of damage. Unfortunately, it is currently the onurts to do so. If you want to load the standard microcode and it is found by MakeBoot, type CR when it asks for an interpretly way to fix bad partition and device information blocks. ____ ____ Note: It is very rare that ter microcode file. Included in the system code is the default character set font. MakeBoot looks for the default fonthe device and partition information blocks get broken, so Scavenger should always be run first to see if the problem is actual (currently, "Fix13.kst") in all the search paths. If it is not found, you will have to supply a font file name. Notly elsewhere. FixPart first asks if you are sure you want to run the program. Next, it asks for the device type. It e: For the Editor and certain other programs to work, the default font must be fixed width and thirteen bits high and nine bitsthen goes through and checks each partition for consistency with the other partition and with the device information block.  wide. MakeBoot puts the output boot files wherever you specify but it is important that the interpreter and system booIf a name is dubious it asks if it is valid or not. After all partitions are checked, the program gives a summary of thSIT* and *FONT*) are required to be unswappable, and everything else that is not used by the swapping system itself can t files be in the same partition. The device and partition in which the boot file is created will be the default patbe swappable. The next question MakeBoot asks is whether to write the boot microcode onto the device. No matter hoh after the boot. This means that there must be at least a "Login.nn.run" and a "Shell.nn.run" (where "nn" is the versionw many boot letters are defined for a device, there is only one set of boot microcode so this only needs to be written number of the system run file), in the root directory of the partition. It doesn't matter if the boot files are in a sub when putting the first boot onto a device. The standard boot microcode files are "SysB" and "Vfy". There are two fidirectory in the partition; the run files mentioned above must be in the Root directory. les associated with each boot letter. The system boot file is Pascal and the interpreter boot file is microcode. The system  - 11 - PERQ File System Utilities Manual - FixPart 17 Jul 81 6. FixPart.   15 8 7 0 +------------------------+-----------------------+ Word 0 | Bas to the first word of the routine dictionary. The second word contains the number of routines which are defined in the segmee Addr (bits 8-15) | Flags | +------------------------+-----------------------+ Bit 15 nt. These two words are followed by the actual code which comprise the routines. Finally, the code is followed by the routine 4 3 0 +--------------------------------+---------------+ Word 1 | Segment Size dictionary. The code is padded with 0 to 3 words of zero (by the compiler) so that the routine dictionary is aligned on  | BA (16-19) | +--------------------------------+---------------+ a quad-word boundary. This is possible since the compiler knows that the base of the segment is also aligned on a quad-wor - 14 - PERQ QCode Reference Manual 19 Jul 81 The positions ofd boundary. It should also be noted that each entry in the dictionary is exactly 2 quad-words long (8 words). The (Not used by the Q-Code micro-code). Shareable - When true, this flag indicates that a segment  the flags within the low byte of Word 0 are: Bit Flag --- ----  may be shared by several processes. (Not used by the Q-Code micro-code) Segment 0 Resident 1 Moving 2 Recently Used  Kind - This flag indicates whether the segment is a data or code segment. (Not used by the Q-Code  3 Shareable 4 Segment Kind 5 Segment micro-code) Segment Full - This flag, when true, indicates that the entire data se Full 6 Table Entry In Use 7 not used 1.B.2.b System Segment Ingment has been allocated (via the Pascal New procedure). This flag is needed to diformation Table There is no information in the System Segment Information Table which is needed by the Q-Code micro-codstinguish full and empty data segments (and has no relevant meaning for code segments). (Not used by e; hence it is not described here. See "Module Memory" in the Operating System Manual. 1.B.2.c Code Segment Organization  the Q-Code micro-code) Segment Table Entry In Use - This flag is set true when the segmen A code segment contains the code for all routines in a segment and a routine dictionary which contains vital informatiot table entry describes a valid segment. The arrangement of these fields within the two words are shown below: Bit n about each of these routines. The first word of every code segment is the offset from the base of the segment nd, unfortunately, lose all the data on it. If one of the partition information blocks is not writeable, then you may be a in this document is subject to change without notice and should not be construed as a commitment by Three Rivble to save some information by using the partition program to join the partition with the bad information block to the partiers Computer Corporation. The Company assumes no responsibility for any errors that may appear in this documenttion before and then scavenging. If it is the first partition, however, your device will have to be reformatted. . Three Rivers Computer Corporation will make every effort to keep customers apprised of all documentation cha - 12 - Table of Contents nges as quickly as possible. The Reader's Comments card is distrib- uted with this document to request users' crit 17 Jul 81 1 Preface: Notation Conventions 2 Introduction 3 Partitions and theical evalu- ation to assist us in preparing future documentation. PERQ is a trademark of Three Rivers Comput Partition Program 6 The Scavenger Program 10 MakeBoot 12 FixPart er Corporation. - ii - PERQ Fault D - iii - ictionary 17 Jul 81 _______ ___________ Display Description 000 Boot never got going, StackReset doesn't work or other major problem in the processor board (or clock). 001 Simple PERQ Fault Dictionary The Key to the PERQ Diagnostic Branches fail. 002 Main Data Path Failure. 003 Dual Address failure on Registers. 004 Y Ram Failure. 0 Display Copyright (C) 1981 Three Rivers Computer Corporat05 Const/Carry Propogate failure. 006 ALU failure. 007 Conditional Branch failure. 008 Looping faion 720 Gross Street Pittsburgh, PA 15224 (412) 621-6250 PERQ Fault Dictionary ilure. 009 Control Store (or Write Control Store) failure. 010 Hung in Disk Boot. 011 Memory Data Erroe errors. If none were found, then it exits; otherwise, you can specify new start and end addresses for the par 17 Jul 81 This document is not to be reproduced in any form or transmitted tition and fix the names. If the device information block is not writeable, then you have to reformat the entire device ain whole or in part, without the prior written authorization of Three Rivers Computer Corporation. The information  try Address Within Segment | +-------------------------------+ | Exit Address Within Segment -----------------------+ | | | | | Code for Routine 3  | +-------------------------------+ | Lexical Level (LL) | +---- | v | | | +-------------------------------+ | ---------------------------+ | not used 1 | +------------------------------ | RD Entry for Routine 1 | <--+ +-------------------------------+ | RD E-+ | not used 2 | +-------------------------------+ ntry for Routine 2 | +-------------------------------+ | RD Entry for Routine 3  toward high memory The Entry and Exit Addresses are the offsets from code base (CB) to the beginning of the | +-------------------------------+ toward high memory  routine and the beginning of the "terminate code" of the routine.  - 17 - PERQ QCode Reference Manual 19 - 16 - PERQ QCode Reference Manual 19 Jul 81 Th Jul 81 1.C Error Handling and Fault Conditions Error processing is done through an exception handling e following is a sample of a code segment containing 3 routines: +-------------------------------+  mechanism. The syntax of exception and handler is described in the PERQ Pascal Extensions manual. The QCodes used to enablroutine dictionary is indexed by (Base Address of Dictionary)+8*RN.  | Pointer to Routine Dictionary | >--+ +-------------------------------+ | | - 15 - PERQ QCode Reference Manual 19 Jul 81 Each entry has the following fo Number of Routines (3) | | +-------------------------------+ | | rm: +-------------------------------+ | Parameter Size (PS) | +-- | | | Code for Routine 1 | v | |-----------------------------+ | Result + Parameter Size (RPS) | +---------------------------- | +-------------------------------+ | | | | ---+ | Local + Temporary Size (LTS) | +-------------------------------+ | En | Code for Routine 2 | v | | | +--------  - 1 - PERQ Fault Dictionary 17 Jul 81 _______ ____k upper bits test failed. 119 Dual Addr/Fetch4 test failed. 120 Unexpected refill. 121 BPC test failed. r. 012 Memory Address Error. 013 Disk never became ready. 014 Couldn't boot from either disks. 015 - 02_______ Display Description 083 BCP[3] didn't jump when it should have. 084 C19 jumped when it shouldn't ha0 Bad Interrupts Reading Floppy Disk Data. 030 VFY Hung. 050 Bad Error Message from VFY. 051 Empty stve. 085 BCP[3] jumped when it shouldn't have. 086 GTR didn't jump. 087 GTR jumped when it shouldn't haveack bit not working. 052 Could not load TOS. 053 Push did not work. 054 Stack Empty did not go off. 055. 088 GEQ didn't jump. 089 GEQ jumped when it shouldn't have. 090 LSS didn't jump when it should have.  Data error in push. 056 Empty or Full set when that is not the case. 057 Data error in bit 15 of the sta091 LSS jumped when it shouldn't have. 092 LEQ didn't jump. 093 LEQ jumped when it shouldn't have. 094 ck. 058 Stack empty set when the stack is full. 059 Data error on stack. 060 Data error after POP. Bit  GEQ didn't jump on equal. 095 LEQ didn't jump on equal. 096 Carry didn't jump when it should have. 097 14. 061 Data error after POP. Bit 13. 062 Data error after POP. Bit 12. 063 Data error after POP. Bit Carry jumped when it shouldn't have. 098 Overflow didn't jump when it should have. 099 Overflow jumped when 11. 064 Data error after POP. Bit 10. 065 Data error after POP. Bit 9. 066 Data error after POP. Bit it shouldn't have. 100 And-Not ALU function failed. 101 Or ALU function failed. 102 Or-Not ALU function 8. 067 Data error after POP. Bit 7. 068 Data error after POP. Bit 6. 069 Data error after POP. Bit 5 failed. 103 And ALU function failed. 104 Or-Not ALU function failed. 105 Not-A ALU function failed. 10. 070 Data error after POP. Bit 4. 071 Data error after POP. Bit 3. 072 Data error after POP. Bit 2. 6 Not-B ALU function failed. 107 Xor ALU function failed. 108 Xnor ALU function failed. 109 OldCa 073 Empty wrong. 074 Data error after POP. Bit 1. 075 Data error after POP. Bit 0. 076 Empty nrry-Add ALU function failed. 110 OldCarry-Sub ALU function failed. 111 OldCarry-Add /w No OldCarry failed. 112 ot set after all pops. 077 Call test falied. 078 Odd didn't jump on a 1. 079 Odd jumped on a 0. 080  Fetch error on Force Bad Parity. 113 Unexpected Parity error. 114 No parity errors on force bad parity.  Byte sign didn't jump on 200. 081 Byte sign jumped on 0. 082 C19 didn't jump when it should have. 115 Wrong address on force bad parity. 116 Upper 4 bit test failed. 117 MDX test failed. 118 Stac nition of an exception. There is a corresponding entry in the routine dictionary to describe this exception. This entry ------+ When a routine is called, the exception pointer (EP) within the new ACB is set to zero to indicate thatdescribes a procedure with the correct number of parameters along with no locals or temporaries. The system segment num there are no exception handlers. If exception handlers are declared within the routine, the compiler generates appropriber of the module, which contains the exception, and its routine number uniquely identify the exception. An exceptionate QCodes to add those handlers to the routine's exception list. When a routine is exited, the exception records ar handler is simply a procedure--handlers may not return a value. An exception handler is enabled by declaring it insidee popped from the run-time stack along with the rest of the activation record. - 18 -  some routine. This outer routine is called the enabler of the handler. The code segment numbers and global pointers of  PERQ QCode Reference Manual 19 Jul 81 When an exception is raised, the QCode  the enabler and handler are the same. The static link of the handler is the same as the activation pointer of the enainterpreter microcode calls the procedure RaiseP in the module Except. This routine searches back through the run-timebler. Thus an exception handler is uniquely identified by the ACB of the enabler and the routine number of the handler.  stack to find the most recent routine which contains a handler for that exception. Once such a candidate is found, th An exception enable record consists of the definition of the exception to be handled (ER and ES), the routine ne stack is searched again to determine if that handler is already active. If it is, the search for a candidate continues.umber of the handler (HR), and a link to the next exception enable record (NE). ER and ES are negative for a handler of all  This implementation ensures that while a particular instance of a handler is active, it will not be activated again. Aexceptions. +-----------------------------------------+ | Exception Segment Number (ES) |  recursive routine may contain a handler, and there may be several instances of the same handler. In this case, eac +-----------------------------------------+ | Exception Routine Number (ER) | +---h handler is activated separately. Determining if a handler is active by searching the stack is not the best mete and raise exceptions are described in Section "Routine Calls and Returns." An exception is declared in a way whic--------------------------------------+ | Handler Routine Number (HR) | +-------------------h is similar to a procedure declaration. Therefore it is convenient to assign a routine number at the point of defi----------------------+ | Next Exception Pointer (NE) | +-----------------------------------  162 - 168 Bad interrupts. 198 QCode interpreter microcode not entered correctly. 199 System not entered - c17 Jul 81 _______ ___________ Display Description 370 Microcode informed that the device table has been alls or assignments don't work. 200 System entered, InitMemory to be called. 201 InitMemory entered. 203  initialized, IO microcode initialization complete, LocateDskHeads to be called. 371 LocateDskHeads  SAT and SIT pointers set. 204 StackSegment number set. 205 Reading the BootBlock. 206 System version entered, buffers allocated. 373 Disk heads at cylinder 0 or disk broken. 374 Disk heads at cylinder 0 (not brokenumber set. 207 Head of free-segment-number list set. 208 First system segment number set. 209 System bon). 375 Microcode instructed to consider current position as cylinder 0. 376 Dummy read of cylinder  122 Fetch4 test failed. 123 Fetch4R test failed. 124 Store4 test failed. 125 Fetch2 test failed.ot disk set. 210 System boot character set. 211 Boot block read. 212 Default heap segment number set. 2 126 Store2 test failed. 127 NextOp test failed. 128 Fetch/Store overlap failed. 129 Bad interru13 First used segment number set. 214 Before setting freelists of data segments. 215 Freelists of data sept Loc 4. 130 Bad interrupt Loc 14. 131 Bad interrupt Loc 20. 132 Bad interrupt Loc 30. 133 Memogments set. 216 ScreenLast set. 217 Header buffer allocated for swapping. 218 Status buffer allocated fory error on No Dual Addr test. 134 Memory error on No Dual Addr Invert. 135 Field didn't work. r swapping. 219 SwappingAllowed set false. 220 All boot-loaded segments set UnSwappable (if booted from  - 2 - PERQ Fault Dictionary 17 Jul 81 _______ ___________ floppy), InitMemory complete, ready to return to System. 300 InitIO to be called. 301 InitIO entered. 302 Display Description 136 Dispatch did not jump. 137 Wrong Dispatch target. 150 Sysb not loaded co KeyEnable set false. 303 Buffers allocated. 310 InitInterruptVectors to be called. 320 InitInterrrectly or hung. 151 Sysb did not complete. 152 Illegal Boot Key. 153 Hard Disk Restore Failure. 154 ruptVectors complete, InitDeviceTable to be called. 330 InitDeviceTable complete, InitScreen to be called.  No such boot. 155 No interpreter for that key. 156 No system for that key. 157 Disk Error. 158 340 InitScreen complete, InitTablet to be called. 350 InitTablet complete, InitCursor to be called. 360 I Floppy error. 159 Malformed Boot File. 160 CheckSum error in microcode. 161 CheckSum error in QCode.nitTablet complete. - 3 - PERQ Fault Dictionary  a pointer to the first word of the original parameters, and a pointer to the first word after the original parameters. Thea type (i.e., var I: ^Integer;). (TOS-1) is the system segment number that contains the datum. (TOS) hod. If we assume that the depths of handler activation records are related to the number of active handlers, then th two pointers are represented as integer offsets from the base of the stack. e total stack search time for raising an exception is related to the square of the number of active handlers of that excepti - 19 - PERQ QCode Reference Manual 19 Jul 81 2. Instruction Format Instron. This should rarely be burdensome because it is not expected that there will be more than one or two active handlersuctions on the Q-machine are one byte long followed by zero to four parameters. Parameters are either a signed byte (B : for a given exception. Recursive routines that pass exceptions up the call stack are pathological cases. Whe range -128 to 127), an unsigned byte (UB : range 0 to 255) or a word (W). Words need not be word aligned (unless specified)n an unused enable for the exception is found, the associated handler is called. The handler has the option of exiti. The low byte is first in the instruction byte stream. Any exceptions to these formats are noted with the instructing to the routine which enabled the exception (via a Goto) or of returning to the point where the exception was raisons where they occur. 3. Pointers There are five different types of pointers, defined as follows: (Note: 20-bit ed (by falling off the end of the procedure). If no handler is found, the default handler is called. The search offsets may only exist on the EStack). Word Pointer: A 20-bit offset from StackBase (StackBase is the 20 bitorder for a certain routine's exception list is the reverse of the order in which they were enabled. If a handler of a physical address of the base of the stack). Byte Pointer: A 20-bit offset from StackBase to the base of the ll exceptions is declared within a certain routine, the compiler enables it first. A handler of all exceptions byte array (TOS-1) and a byte offset into the array (TOS). String Pointer: Same as a byte pointer. Packed Field Pois called in a special way. When it is called, the parameters that were passed when the exception was raised have already binter: A 20-bit offset from StackBase to the base of the word the field is in (TOS-1) and a one word field een pushed onto the stack. A new activation record for the handler is built above those parameters. Such a handler f descriptor (TOS). Field Descriptor: Bits 0-3: The field width (in bits) minus 1 Bits 4-7or all exceptions must have four words of parameters: the segment and routine numbers of the exception that was raised, : The rightmost bit of the field. Pascal Pointer: Obtained by declaring a variable as a pointer to another dat nitStream to be called. 600 InitStream complete, FSInit to be called. 700 FSInit complete. 800 Com This document is not to be reproduced in any form or transmitted, in whole or in pamand file and Console opened, InitExceptions to be called. 810 InitExceptions complete. 820 Systrt, without the prior written authorization of Three Rivers Computer Corporation. The information in this documenem version number set. 822 Current 60 Hz. clock value read. 824 60 Hz time reference set, TimeStamp time referet is subject to change without notice and should not be construed as a commitment by Three Rivers Computer Corponce to be set. 900 FSSetUpSystem to be called. 950 FSSetUpSystem complete. 951 About tration. The Company assumes no responsibility for any errors that may appear in this document. Three Rivo enable swapping (if booted from hard disk). 952 FSLocalLookup and EnableSwapping complete. 999 System fully ers Computer Corporation will make every effort to keep customers apprised of all documentation changes as quickinitialized, system title line to be printed. - 4 - ly as possible. PERQ is a trademark of Three Rivers Computer Corporation.  PERQ Segment Files Ed Frankenberry  - ii - PERQ Segment File Format - Introduction 17 Jul 81 0, sector 0 complete, about to dispose buffers and exit LocateDskHeads. 380 LocateDskHeads complete, FindSiz July 1981 A segment file is an object file produced when a program e to be called. 381 FindSize entered and buffers allocated. 382 Size of disk determined, about to dispose buffer is compiled. The segment file is used primarily to hold the actual QCodes which the PERQ executes. In addition to the s and exit FindSize. 390 FindSize complete. 400 Keyboard enabled. 410 InitGPIB to be called. QCodes, the segment file includes information used for linking, loading and debugging. This document describes  411 InitGPIB entered, buffers allocated. 412 First GPIB command built. 413 First GPIB command sent to Zthe current format of segment files as defined in the POS. The reader is assumed to be familiar with the QCode Re80. 414 Second GPIB command built. 415 Second GPIB command sent to Z80, about to dispose buffers andference Manual. Copyright (C) 1981 Three Rivers Computer Corporation 720 Gross Street  exit InitGPIB. 420 InitGPIB complete. 499 Clock enabled, about to exit InitIO. 500 InitIO complete, I Pittsburgh, PA 15224 (412) 621-6250 PERQ Segment File Format 17 Jul 81   - 21 - PERQ QCode Reference Manual 19 Jul 81 4.A.1) into word with offset W in the current activation record. Impl.b Local One Word Loads and Stores LDL0..15 109-124 Short Load Local Word. LDLx fetches the ementation Note: The address of the first local (offset 0) is contained in the Local Pointer register (LP). The address of th word with offset x in the current activation record and pushes it onto the EStack. LDLB UB e Nth local is computed as (LP) + N. - 22 - PERQ QCode Ref 107 Load Local Word/Byte Offset. Fetches the word with offset UB in the current erence Manual 19 Jul 81 4.A.1.c Own One Word Loads and Stores LDO0..15 139-154  is the offset from the segment base to the datum. Implementation Note: Stacks grow from low addresses to high addr activation record and pushes it on the EStack. LDLW W 108 esses (i.e., if the address of TOS is 10 then the address of TOS-1 is 9 -- not 11).  Load Local Word/Word Offset. Fetches the word with offset W in the current activation  - 20 - PERQ QCode Reference Manual 19 Jul 81 4. QCode Descriptions  record and pushes it on the EStack. LLAB UB 125 Load Local Address/Byte Offset. Pushes a  4.A Variable Fetching, Indexing, Storing and Transferring 4.A.1 Loads and Stores of One Word 4.A.1.a Constant One Wo word pointer to the word with offset UB in the current activation record on EStack.rd Loads LDC0..15 0-15 Load Word Constant. Pushes the value (0..15), with high LLAW W 126 Load Local Address/Word Offset. Pushes a word pointer to the word with  byte zero, onto the EStack. LDCN 22 Load Constant Nil. Pushes the value of NI offset W in the current activation record on EStack. STL0..7 129-136 Short Store Local L onto the EStack. LDCMO 16 Load Constant -1. LDCB B 17 Load ConstanWord. Store (ETOS) into word with offset x in the current activation record. t Byte. Pushes the next byte on the EStack, with sign extend. LDCW W 18 Load Constant STLB UB 127 Store Local Word/Byte Offset. Store (ETOS) into word with offset UB in  Word. Pushes the next word on the EStack.  the current activation record. STLW W 128 Store Local Word/Word Offset. Store (ETOS 56 word blocks organized in four groups: 1) a header block; 2) one or more code blocks; 3) an import list; 4) a routine nam |---------------------------------------| | file name | |---e list. The header block contains information about the size and contents of the module. The code blocks contain the QCod------------------------------------| | Number of Segments | |---------------------es and routine dictionary generated by the compiler. The code blocks are followed by a list of imported modules and a lis------------------| | Import Block Number | |---------------------------------------t of the routine names declared in the current module. Header Block The first portion of the segment file conta| | Size of Global Data Block (GDB) | |---------------------------------------| | ins 9 fields, shown in the figure below (precise sizes of fields may be found in the appendix). The first byte con version string | |---------------------------------------| | copyrighttains flags which are set by the compiler. Bit 0, the least significant bit, indicates whether the segment is a program o string | |---------------------------------------| | reserved r module. (A program is a special instance of a module, which includes a main body.) The remaining 7 bits are reserved  | +---------------------------------------+ toward high memory for future use. The high-order byte of this word contains the version number of the QCodes generated by the compiler. The - 3 - PERQ Segment File Format - Header Block 17 Jul 81 The third field gives next field contains the name of the module (as it appears in the source file). Module names are currently unique to 8  the number of imported segments. This is followed by the number of the block containing the import list (described bel characters. The name of the source file from which the segment file was generated follows the module name. The fileow) and the size of the global data block (referred to as the GDB in the QCode Reference Manual). The "version" and "c Introduction Segment files are produced by compilers for use by the linker, loader and debugger. Segment filesname string contains the full pathname of the source file from which the segment file was generated. MSB 1 have the extension ".SEG". Along with a run file, a collection of segment files contains all information necessary for5 LSB 0 +---------------------------------------+ | QCode version # |  execution of a program. Segment files must conform to certain formatting conventions. A segment file consists of 2 flags | |---------------------------------------| | module name | ent Global Data Block (GDB) on EStack. LOAW W 156 Load Own Address/Word Offset. Pushes a word pointer to the word with offset UB2 in the Global Data Block (GDB) for program  pointer to the word with offset W in BASE activation record on EStack. STO0..7 15 segment UB1 onto EStack. LGAW UB,W 195 Load Global Address/Word Offset. Same as 9-166 Short Store Own Word. STOx stores (ETOS) into the word with offset x in the current  LGAB except a full word offset is used. LGAWW W1,W2 181 Load Global Address/Word Segment, Word  Global Data Block (GDB). STOB UB 157 Store Own Word/Byte Offset. Stores (ETOS)  Offset. Same as LGAB except a full word is used both for the segment number and the  into the word with offset UB in the current Global Data Block (GDB). STOW W 15 offset. STGB UB1,UB2 196 Store Global Word/Byte Offset. Stores (8 Store Own Word/Word Offset. Stores (ETOS) into the word with offset W in the current ETOS) in word with offset UB2 in the Global Data Block (GDB) for program segment UB1. STGW UB,W  Global Data Block (GDB). Implementation Note: The address of the first own (offset 0) is containe 197 Store Global Word/Word Offset. Same as STGB except a full word offset is used. Short Load Own Word. LDOx fetches the word with offset x in the current Global Data d in the Global Pointer register (GP). The address of the Nth own is computed as (GP)+N.  Block (GDB) and pushes it on the EStack. LDOB UB 137 Load Own Word/Byte Offset. Fetches the word  - 23 - PERQ QCode Reference Manual 19 Jul 81 4.A.1.d  with offset UB in the current Global Data Block (GDB) and pushes it on the EStGlobal One Word Loads and Stores LDGB UB1,UB2 192 Load Global Word/Byte Offset. Loads the ack. LDOW W 138 Load Own Word/Word Offset. Fetches the word with offset W in the c word with offset UB2 in the Global Data Block (GDB) for program segment UB1 onto urrent Global Data Block (GDB) and pushes it on the EStack. LOAB UB 155 Load Own Address EStack. LDGW UB,W 193 Load Global Word/Word Offset. Same as LDGB except a /Byte Offset. Pushes a word pointer to the word with offset UB in the currfull word offset is used. LGAB UB1,UB2 194 Load Global Address/Byte Offset. Pushes a word  opyright" fields complete the information stored in the first block. These strings may be specified using compiler switch in the block following the routine dictionary. Imports refer to segments which are external to the current module. es. The remainder of the header block is reserved for future use. Code Blocks The second block (block number  The import list is ordered by segment number (the compilergenerated ISN). Each entry in the import list consists of the  1) is the start of the code portion of the segment file. Word 0 points to the routine dictionary which follows(8 character) module name followed by the full pathname of the source file. Each entry is word aligned.  the code. The value in word 0 is the offset (in words) from the beginning of block 1 to the first word of the routine  - 4 - PERQ Segment File Format - Routine Dictionary Entries 17 Jul 81 Routine Namdictionary. Word 1 contains the number of routines within the segment. The QCodes generated by the compiler start with woe List After the list of imported segments, the compiler provides the names of the routines. The first routine name rd 2 of this block. The QCodes for each routine follow those of the previous routine on the next word boundary. The code se begins immediately after the last import entry. The entries in the routine name list are 8 characters long, are word-aligction of the segment file may occupy several consecutive blocks. The routine dictionary is aligned on the next quad-word bounned, and are ordered by routine number. dary following the end of the QCodes. +---------------------------------------+ | Offset to - 5 - Appendix - Relevant Pascal Declarations 17 Jul 8 Routine Dictionary | |---------------------------------------| | Number of Routines in this Se1 Appendix Users who need to manipulate segment files are encouraged to import the declarations found in the fgment | |---------------------------------------| | QCode | ile "Code.Pas". The necessary definitions to access portions of segment and run files may be found in this file. Pertinent s | . . . | +---------------------------------------+ The dictionary conections are included here which give the actual definitions and lengths for fields described above. Exports consttains an entry for each routine in the module, and is padded to the end of the current block. A more complete descriptio QCodeVersion = 2; { Current QCode Version Number } FileLength = 100; { max chars in a file name } n of the routine dictionary may be found in the QCode Reference Manual. Import List The import list begins  SegLength = 8; { max chars in a segment name } CommentLen = 80; { max chars in a comment string }  The address of the first global (offset 0) in the designated GDB is computed as GP - 2 * ISN, where ISN (Internal Segment NumbS) in memory (address determined as in LDIW). Implementation Note: The Activation Pointeer) is the program segment number specified in the load or store instruction. The Nth global is addressed by tr register (AP) contains the address of the current Activation Control Block (ACB). Within the ACB is the Static Link (he base address (computes as above) plus N. - 24 - PERQ QCode RefeSL) to the previous ACB. To compute the address of the first intermediate word of the desired level, traverse the Static Lrence Manual 19 Jul 81 4.A.1.e Intermediate One Word Loads and Stores LDIB UB1,UB2 inks to the correct ACB. Within the ACB is the Local Pointer (LP) for that activation record. 215 Load Intermediate Word/Byte Offset. UB1 indicates the number of static links to  - 25 - PERQ QCode Reference Manual 19 Jul 81  traverse to find the activation record to use. UB2 is the offset within4.A.1.f Indirect One Word Loads and Stores STIND 21 Store Indirect. (ETOS) is stored into the  the activation record of the desired word. The datum is pushed on EStack. word pointed to by word pointer (ETOS-1). LDIND 173 Load Indirect. Word pointed to by word  LDIW UB,W 216 Load Intermediate Word/Word Offset. Same as LDIB except a word offset is u pointer (ETOS) is pushed on EStack. sed. LIAB UB1,UB2 217 Load Intermediate Address/Byte Offset. A word pointer is pushed on  - 26 - PERQ QCode Reference Manual EStack (determined as in LDIB). LIAW UB,W 218 Load Intermediate Address/Word Offset. A 19 Jul 81 4.A.2 Loads and Stores of Multiple Words 4.A.2.a Double Word Loads and Stores (Reals and Pointers) LDD Note: To achieve LDGW and STGW with full word segment numbers, use LGAWW with LDIND word pointer is pushed on EStack (determined as in LDIW). STIB UB1,UB2  or STIND. Implementation Note: Self-relative pointers to the Global Data Blocks (GDB) for ea219 Store Intermediate Word/Byte Offset. Stores (ETOS) in memory (address determined as in ch externally referenced segment are contained in the External Segment Table (XST), pointed to by the Global Pointer (GP).  LDIB). STIW UB,W 220 Store Intermediate Word/Word Offset. Stores (ETO } FileName: FNString { file name } ); false:( Artransmitted in whole or in part, without the prior written authorization of Three Rivers Computer Corporation. They: array [0..0] of integer) end; { used with range checking disabled } SegFileType = file of Se information in this document is subject to change without notice and should not be construed as a commitment gBlock; - 6 - Table of Contents 17 Jul by Three Rivers Computer Corporation. The Company assumes no responsibility for any errors that may appear in this  type SNArray = packed array[1..SegLength] of Char; { segment name } FNString = String[FileLength]; { file  81 3 Introduction 3 Header Block 4 Code Blocks 4 Routine Dictionary name } QVerRange = 0..255; { range of QCode version numbers } { Segment file: } pSeg Block = ^SegBlock; SegBlock = packed record case boolean of { .SEG file definition } { first bl - iii - ock: } true: (ProgramSegment: boolean; SegBlkFiller : 0..127; { low order byte } QVersion : QVerRange; { high order byte } ModuleName : SNArray; FileName : FNString; NumSeg : integer;  How to Make a New System John P.  ImportBlock : integer; GDBSize : integer; Version : stStrait This manual describes how to change modules contained in the Three Rivers PERQ Operatinring[CommentLen]; Copyright : string[CommentLen]); false:(Block: array[0..255g System and how to create a new version of that system. Copyright (C) 1981 Three Rivers Comp] of integer) end; CImpInfo = record case boolean of { Import List Info - as } uter Corporation 720 Gross Street Pittsburgh, PA 15224 (412) 621-6250 How to Make a New System  { generated by the compiler } true: ( ModuleName: SNArray; { module identifier  17 Jul 81 This document is not to be reproduced in any form or  C 237 Load Double Word Constant. is a double word constant. Load the c 19 Jul 81 4.A.3 Byte Arrays Note: A byte pointer is loaded onto the stack with a LLA, LOAonstant onto EStack. LDDW 239 Load Double Word. (ETOS) is a word pointer  or LGA of the base address of the array followed by the computation of the offset. LDB 23 Load Byte. Pu to a double word. The double word is pushed onto EStack. STDW 183 Stosh the byte (after zeroing the high Byte) pointed to by byte pointer (Ere Double Word. (ETOS),(ETOS-1) is a double word and (ETOS-2) is a word pointer TOS),(ETOS-1) on EStack. STB 24 Store Byte. Store the low byte of (ETOS) into  to a double word block of memory. The double word is popped from ESTACK into the the location specified by byte pointer (ETOS-1),(ETOS-2). MVBB UB 167 Move Bytes/Byte Co double word pointed to by (ETOS-2). 4.A.2.b Multiple Word Loads and Stores (Sets) LDMC UB,unter. (ETOS),(ETOS-1) is a source byte pointer to a block of UB bytes, 236 Load Multiple Word Constant. UB is the number of words to load, and is a  and (ETOS-2),(ETOS-3) is the destination byte pointer to a similar block.  block of UB words, in reverse word order. Load the block onto the MStack. LDMW  Transfer the source block to the destination block. MVBW 168 Move Bytes/Word  238 Load Multiple words. (ETOS-1) is a word pointer to the beginning of a bloc Counter. Same as MVBB except (ETOS-1), (ETOS-2) is the source byte pointek of (ETOS) words. Push the block onto the MStack. STMW r, (ETOS-3), (ETOS-4) is the destination byte pointer, and (ETOS) is the 182 Store Multiple Words. The MStack contains a block of (ETOS) words, (ETOS-1) is a word  number of bytes to transfer. - 28 -  pointer to a similar block. Transfer the block from MStack to the destination b PERQ QCode Reference Manual 19 Jul 81 4.A.4 Strings LSA UB, 19 Loalock. - 27 - PERQ QCode Reference Manual d String Address. UB is the length of the string constant . A string  re not guaranteed to show you the most efficient way of making your changes. It only shows you a reliable way of making t the corresponding boot files and partitions. The .Boot file contains the Operating System, and the .MBoot fihe changes. This manual doesn't attempt to explain why the system is organized the way it is nor why each step le contains the QCode interpreter microcode. 3. Do not change System..a.Boot and System..a.MBoot until your  is required. If your changes are not too major, this manual will help you to create a new system. It does not explain  new system is completely debugged. These are the default boot files. If you do not change these files, you can boothow to change low-level interface (e.g., interface to the Stream module) or low-level data structures (e.g., the segment  the old system in the case that your new system contains errors. 4. Create a new directory or select an unused partitiontables or the structures on disk). _______________ Recommendations We make several recommendations to help you  for your new experimental files when you begin making your changes to the system. Copy the sources of the files yavoid errors that will make your system non-bootable. Remember, if you can no longer boot your PERQ, you can always boot ou want to change into this area before you begin editing. Compile all new .Seg files into this area. Do not use  document. Three Rivers Computer Corporation will make every effort to keep customers apprised of all docu from the "PERQ System Boot Floppy". Therefore, you always have a way of bringing up your PERQ. 1. Back up important fimentation changes as quickly as possible. The Reader's Comments card is distrib- uted with this document to requesles on floppy disks before you begin changing the PERQ Operating System. While it is improbable that you will destroy t users' critical evalu- ation to assist us in preparing future documentation. PERQ is a trademark of Three any files by changing the system, the importance of backup files cannot be stressed too much. 2. Maintain at leasRivers Computer Corporation. - ii - Ht one partition of the disk that runs the old system. This enables you to boot your PERQ in the event that your ow to Make a New System 17 Jul 81 ___ _____ __ ____ ______ The Scope of This Manual new system contains bugs. When you receive your PERQ, the hard disk is divided into several partitions. At least on This is a "how to" manual. If you follow the instructions of this manual, barring errors in the manual and bugs e partition contains a pair of boot files: System...Boot and System...MBoot. The in the file name is in your modifications to the system, you should be successful in making a new system. The instructions in this manual a the current system version number, and the in the file name represents the character that you hold down to use  Store Character. (ETOS) is a character and (ETOS-1),(ETOS-2) is a string pointer.  LDIND). INDB UB 171 Static Index and Load Word/Byte Index. Indexes (ETOS-1) is checked to insure that it lies within the dynamic length of the string. If  the word pointer (ETOS) by UB words, and pushes the word pointed to by the result  so, the character (ETOS) is stored in the string, at the position point on ESTACK. INDW W 172 Static Index and Load Word/Word Index. Same as INDB except  pointer is pushed on EStack (the virtual address of UB is pushed followed by a zero). ed to by (ETOS-1),(ETOS-2); otherwise, a run-time error occurs.  UB is word aligned. SAS 184 String Assign. (ETOS-1),(ETOS-2) is the  - 29 - PERQ QCode Reference Manual  source string pointer, and (ETOS-3),(ETOS-4) is the destination string pointer. (ETOS)  19 Jul 81 4.A.5 Record and Array Indexing and Assignment MOVB UB 169 Move Words/Byte Counter. (ET is the declared length of the destination. The length of the source and destinaOS) is a word pointer to a block of UB words, and (ETOS-1) is a word pointertion are compared, and if the source string is longer than the destination,  to a similar block. The block pointed to by (ETOS) is transferred to the b a run-time error occurs. Otherwise all bytes of source containing vlock pointed to by (ETOS-1). MOVW 170 Move Words/Word Counter. Same as MOVB exalid information are transferred to the destination string. LDCH 25 Load Character. cept (ETOS-1) is the source pointer, (ETOS-2) is the destination pointer, and  (ETOS),(ETOS-1) is a string pointer. (ETOS) is checked to insure that it  (ETOS) is the number of words to be transferred. SIND0-7 173-180 Short Inlies within the dynamic length of the string. If so, the character pointed to by dex and Load Word. SINDx indexes the word pointer (ETOS) by x words, and  (ETOS),(ETOS-1) is pushed; otherwise, a run-time error occurs. STCH 28  pushes the word pointed to by the result on ESTACK. (Note: SIND0 is synonymous to  source and binary files that you can fall back on. ________ Overview Creating a new system usually consists of the microcode (e.g., memory manager tables) or data structures that live across boots (e.g., struc- tures on dithe following steps. 1. Evaluate the change you intend to make 2. Create a directory to work in 3. Edit and compile ssk)? If so, you may need to do a complicated bootstrapping operation to bring up your new system. This is beyondystem modules 4. Edit and compile system programs 5. Link the system and system programs 6. Prepare the system configur the scope of this manual. - 2 - How to Make a New System ation file 7. Write a boot file 8. Test the new system 9. Iterate at step 3 ________ ___ ______ ___ ______ __  17 Jul 81 4. Are you changing the existing exports of modules that the compiler knows about (Code, Dyn____ Evaluate the Change You Intend to Make Before you begin, you should determine how extensive the changes aramic, and Stream). If so, you again need to do a complicated bootstrapping opera- tion. This too, is beyond thee. The following criteria tell you how much you need to change. 1. Are you changing the existing exports of any s scope of this manual. 5. Are you changing the format of .Seg files? If so, you need to do a complicated bootstrystem modules? If not, you need only re-compile those modules that you change. If so, you may need to re-compileapping operation which is beyond the scope of this manual. ______ _ __________ _____ ___ _______ Create a Direct those modules and programs that import the ones you are chang- ing. 2. Are you adding exports but not changory, Edit, and Compile Create a new directory for your experimental files. You do this with the MakeDir utility pring any that already exist? If you don't change existing exports, you need to re-compile only those modules thatogram. This new directory should be in the partition which contains the old system (probably the Boot partition). Copy sothe root directory in the default partition: the one that is entered by the default boot letter ("a" is default- you change. You must, however, add your new exports at the end of the export list. By adding at the end of t-the same as not holding down a key). The default boot files are System..a.Boot and System..a.MBoot. he export list, you do not change the storage allocation of existing variables or the routine numbers of existing pr - 1 - How to Make a New System 17 Jul 81 If you do noocedures and functions. If you change either of these, you must re-compile all modules and programs that imt change the default boot files or the files in the root directory of the default partition, you will still have port the ones you are chang- ing. 3. Are you changing the definition of data structures which are known by   222 Index Array/Word Array Size. Same as IXAB except (ETOS-1) is the integer index,  distance to rotate or shift. If UB is 0 then a right rotate occurs, and if UB is 1  (ETOS-2) is the word pointer to the base of the array, and (ETOS) is the size (in then a shift occurs. The direction of the shift is determined from (ETOS); If  words) of an array element. (Gen1A) full word is - 30 - (ETOS) >= 0 then a left shift occurs; otherwise, a right shift. (ETOS) must  PERQ QCode Reference Manual 19 Jul 81 used for the array elementbe in the range from -15 to +15.  size. IXA1..4 223-226 Index Array/Short Array Size. Same as IXAB except array element siz - 31 - PERQ QCode Reference Manual 19 Jul 81 4.B Top of Stack Arithmeties are fixed at 1-4. IXP UB 214 Index Packed Array. (ETOS) is an integer index, andc and Comparisons 4.B.1 Logical LAND 30 Logical Add. AND (ETOS) into (ETOS-1). LOR 31 a full word index is used. INCB UB 232 Increment Field Pointer/Byte Index. The word (ETOS-1) is a word pointer the base of the array. Bits 4-7 of UB contain  pointer (ETOS) is indexed by UB words and the resultant pointer is pushed on  the number of elements per word minus 1, and bits 0-3 contain the field width (in bits)  ESTACK. INCW W 233 Increment Field Pointer/Word Index. Same as INCB except a f minus 1. Compute and push a packed field pointer. LDP 26 Load aull word index is used. Note: INCB and INCW are equivalent to add UB or W to (ETOS). IXAB UB 221 Index Array/ Packed Field. Push the field described by the packed field pointer Byte Array Size. (ETOS) is an integer index, (ETOS-1) is a word pointer to t (ETOS),(ETOS-1) on ESTACK. STP 27 Store into Packed Field. Store (ETOS) in he base of the array, and UB is the size (in words) of an array element. A word the field described by the packed field pointer (ETOS-1),(ETOS-2). ROTSHI UB 20 Rota pointer to the first word of the indexed element is pushed on ESTACK. IXAW te/Shift. (ETOS-1) is the argument to be rotated or shifted, and (ETOS) is the  p until now, has not been used. Using a new partition is somewhat safer than merely creating a new directory in some o just copy the configuration file for the current version of the operating system. The default configura- tion file is namld partition. Edit the modules and programs that you need to change. Re-compile those modules and programs ted System..Config. If you need to change the swappability of segments in the system, you can copy the old file and edhat you have changed and any others indicated by your evaluation of your changes. ____ ___ ___ ______ Link the New Sysit it. Each line in the file describes the swappability of a single segment in the form: tem Once all necessary changes and compilations have been done, you should link the new system and system programs. Ch The is chosen from the following: SW - segment is swappable. LS - segment is swappable but theoose a new system version number. Three Rivers Computer Corporation intends to use the version numbers between 1 and 99 memory manager should be reluctant to swap it out (this is not implemented yet). US - segment is not swapp for releases of the official PERQ Operating System. You should avoid these numbers to prevent conflicts with future Thrable but may be moved in memory. UM - segment is neither swappable nor movable. Names with asterisks are recognized asee Rivers Computer's releases. For exam- ple, you should choose version number 100 for your new system. The new run fi special segment names. They are chosen from the following list: *SAT* - Segment address table (default UM) *les for System, Login, Shell, and Link should be in the root directory of the partition which contains your new system.SIT* - Segment information table (default US) *Cursor* - Display cursor (default UM) *Screen* - Display screen (d You should use the following link commands to link your new system (assuming that the partition name is Part): Link :efault UM) *Font* - Character set (default US) *Stack* - Run-time stack (default US) *Names* - System segmPart>System.100=System/System Link :Part>Login.100=Login Link :Part>Shell.100=Shell Link :Part>Link.100=Link ent names (default SW) *IO* - Input/output tables (default UM) The default for code segments (modules) is US. We s - 3 - How to Make a New System 17 Jul 81trongly suggest that you do not change the swappability of the special segments and, unless you are sure you know what you ar _______ ___ ______ _____________ ____ Prepare the System Configuration File Before you write the boot file, e doing, do not change the swappability of existing system modules. System data segments that the hardware or microcode usurces of the system modules and programs into this directory. You may choose instead to work in a partition which, uyou must create a system configuration file which describes the swappability of segments in the system. You probably can or false on ESTACK.  LEQI 41 <=, LESI 42 <, GEQI 43  - 32 - PERQ QCode Reference Manual 19 Jul 81 4.B.2 Integer ABI  >=, GTRI 44 and > comparisons. Compare (E 71 Absolute Value of Integer. Take absolute value of (ETOS). Result is undefined if TOS-1) to (ETOS) and push true or false on ESTACK. - 33 (ETOS) is initially -32768. ADI 72 Add Integers. Add (ETOS) and (ETOS-1). NGI  - PERQ QCode Reference Manual 19 Jul 81 4.B.3 Reals All over/underflow 73 Negate Integer. Take the twos complement of (ETOS). SBI 74 Subtras cause a run-time error. FLT 79 Float. The integer (ETOS) is converted to a floatct Integers. Subtract (ETOS) from (ETOS-1). MPI 75 Multiply Integers. Multing-point number and pushed onto EStack. TNC 80 Truncate Real. The real (ETiply (ETOS) and (ETOS-1). This instruction may cause overflow if tOS),(ETOS-1) is truncated (as defined by Jensen and Wirth), converted to an he result is larger than 16 bits. DVI 76 Divide Integers. Divide (ETOS-1) by (E integer, and pushed onto EStack. RND 81 Round Real. The real (ETOS),(ETOS-TOS) and push quotient (as defined by Jensen and Wirth). MODI 71) is rounded (as defined by Jensen and Wirth), truncated and converted t Logical Or. OR (ETOS) into (ETOS-1). LNOT 32 Logical Not. Take one's complement of 7 Modulo Integers. Divide (ETOS-1) by (ETOS) and push the remainder (as defined by Jensen  (ETOS). EQUBOOL 33 Boolean =, NEQBOOL 34 <>, LEQBOOL 35  and Wirth). CHK 78 Check Against Subrange Bounds. Insure that  <=, LESBOOL 36 <, GEQBOOL 37 >=, GTRBOOL (ETOS-1) <= (ETOS-2) <= (ETOS), leaving (ETOS-2) on top of the stack. If conditions  38 and > comparisons. Compare (ETOS-1) to (ETOS) and push true  are not met a run-time error occurs. EQUI 39 Integer =, NEQI 40 <>,   you have chosen the boot letter "z" _ :MakeBoot _______________ Root file name: System.100 _______________________ _micro boot file [System.100.z.MBoot]: ____________________________________________________________ Existing boot file to c___________________ Configuration file name [System.100.Config]: _____________________________ Which character to boot fopy (type return to build a new one): ________________________________________________ Use standard interpreter microcode es cannot be moved, most data used by the operating system cannot be swapped, and the code that makes up the swapping sysrom? z ________________________________________ Do you want to write the boot area [No]: { The boot area of thetem itself cannot be swapped. Since the default for code segments is US, you should add entries to the configuration file disk contains a microprogram which runs diagnostics and reads the .Boot and .MBoot files. You need to rewrite th if you add modules to the system. The default system configuration file is: *SAT* UM *SIT* US *Cursis only if you are making modifications to Vfy.Micro or SysB.Micro. } _______________________________ Write a system boor* UM *Screen* UM *Font* US *IO* UM System SW Stream SW Writer SW IOErrMessages SW ot file [Yes]: _______________________________________________________ Enter name of new system boot file [System.100.z.Bo Loader SW - 4 - How to Make a New System 17 Jul 8ot]: ____________________________________________________________ Existing boot file to copy (type return to build a new o1 Reader SW Perq_String SW Screen SW FileSystem SW GetTimeStamp SW FileDefs SW Memne): ________________________________________ Enter name of character set [Fix13.Kst]: { This writes the boot fory SW IO_Init SW RunRead SW FileDir SW Scrounge SW _____ _ ___ ____ ____ Write a New Boot Fileile containing the Pascal part of the system and special system segments such as the segment tables, the cursor You are now ready to write a boot file using the MakeBoot program. Before you run MakeBoot, choose a boot-lette, and the character set. Note that you may specify a character set which is different than the standard (Fix13.Kst). r for this new system; use one not already in use. You can run the Details program to find out which letters are in use. Aft If you use a non-standard character set, some programs (like the Editor) may not work well. } er choosing a boot letter, run MakeBoot and answer the questions in the following way: -- Underlined text is what the PERQ t - 5 - How to Make a New System 17 Jul 81 ____________________________ypes -- Commentary is given inside { } -- means type the RETURN key without entering any text -- In this example, assume_________ Write an interpreter boot file [Yes]: _______________________________________________________ Enter name of new  solute value of the real (ETOS),(ETOS-1). ADR 83 Add Reals. Add (ETOS),(ETO is not altered). SRS 68 Build SubRange Set. The integers (ETOS) and (ETOS-1) are S-1) and (ETOS-2),(ETOS-3). NGR 84 Negate Real. Negate the real (ETOS), checked as in SGS, the set [(ETOS-1)..(ETOS)] is pushed onto MSTACK, a (ETOS-1). SBR 85 Subtract Reals. Subtract (ETOS),(ETOS-1) nd the size of the set is pushed on ESTACK. (The null set is pushed if (ETOS-1) > (ETOS)  from (ETOS-2),(ETOS-3). MPR 86 Multiply Reals. Multiply (ETOS),(ETOS-1) and  or either is out of range). INN 88 Set Membership. See if integer (ETOS) is in (ETOS-2),(ETOS-3). DVR 87 Divide Reals. Divide (ETOS-2),(ETOS-3) by (ETOS),(ETOS set contained on the top of MSTACK, and with length (ETOS-1), pushing TRUE or FALSE on -1). EQUREAL 45 Real =, NEQREAL 46 <> comparisons. Push true or false  ESTACK. UNI 89 Set Union. The union of the two sets con on ESTACK. - 34 - PERQ QCode Reference Manual tained on the top of MSTACK (with sizes (ETOS) and (ETOS-1)) is pushed on MSTACK,  19 Jul 81 4.B.4 Sets ADJ UB 185 Adjust Set. The set on the top of the  and the length of the result on ESTACK. INT 90 Set Intersection. The intersection of the  MSTACK is forced to occupy UB words, either by expansion or compression, and its l two sets contained on the top of MSTACK (with sizes (ETOS) and (ETOS-1)) is puength word is popped from ESTACK. SGS 66 Build Singleton Set. The integer (ETOS) shed on MSTACK, and the length of the result on ESTACK. DIF 9is checked to insure that 0 <= (ETOS) <= 4,095, the set [(ETOS)] is pushed 1 Set Difference. The difference of the two sets contained on the top of MSTACK, and on MSTACK, and the size of the set is pushed on ESTACK. If (ETOS) is out o sizes (ETOS) and (ETOS-1) is pushed on MSTACK, and the length of the resuo an integer, and pushed onto EStack. ABR 82 Absolute Value of Reals. Take the abf range, the null set is pushed (a zero is pushed on ESTACK, the MSTACK! ory by themselves, these run files will not get in your way when you are running the old system. If you want, you can mak - 7 - How to Make a New System 17 Jul 81 _____e a Login profile to add this directory to your search list when you log in under your new system. Once you are  __ ________ Table of Contents 1 The Scope of This Manual 1 Recommendations 2 Overview 2 running the new system, you need to link the system utility programs. Set your path to the new directory that you creat Evaluate the Change You Intend to Make 3 Create a Directory, Edit, and Compile 3 Link the New System ed to contain the run files. Push the directory containing the old .Seg files onto your search list, and then push th 4 Prepare the System Configuration File 5 Write a New Boot File 6 Test the New System 7 Rewre directory containing the new .Seg files. Now, type: Link ProgramName for each utility program you wish to link. ite Other Boot Files files? [Yes]: ___________________________ Interpreter microcode file: { This writes the boot file containing th Re-compile any programs that import modules whose exports have changed. If your system doesn't come up at all, e microcode which is the Q-machine interpreter. Unless you are changing the interpreter microcode, you need only wr you can look at the diagnostic display to determine where in system initialization the system hangs. ite this part once for a given boot letter. Note that you may add other microcode files to the boot file (as  - 6 - How to Make a New System 17 Jul 81 _____ long as they do not overlap the standard microcode). } ____ ___ ___ ______ Test the New System Yo__ _____ ____ _____ Rewrite Other Boot Files Once your new system is debugged and working, you can use MakeBoot u are now ready to boot your new system and test it. Hold down the boot key you selected ("z" in the example) and press to rewrite the boot files associated with other boot letters. Before you rewrite the old boot files, you must be surethe Boot button. If all goes well, your new system will announce itself. Note that when you try to run most program that some partition contains all files that make up the new system. This includes files that you have not changed. If you fs, the loader informs you that they were linked under the old system. This means you must re-link them for your new systemail to make a partition containing all source, binary, and run files, you run the risk of deleting portions of your new sy. It is a good idea to create another new directory to hold these run files. By putting the new run files in a directstem when you delete the old system. !  PERQ QCode Reference Manual 19 Jul 81 4.B.6 Byte Arrays EQUBYT UB 57 Byte  is the low-order word and (ETOS-1) is the high-order word of the value.Array =, NEQBYT UB 58 <>, LEQBYT UB 59 <=, LESBYT UB 60  When two long values are involved, (ETOS-2) is the low-order word lt on ESTACK. EQUPOWR 63 Set =, NEQPOWR 64 <>,  <, GEQBYT UB 61 >=, GTRBYT UB 62  - 35 - PERQ QCode Reference Manual 19 Jul 81 LEQPOWR  and > comparisons. <=, <, >=, and > are only emitted for pa 65 <= (subset of), GEQPOWR 67 and >= (superset of) cked arrays of characters. The argument, UB, if non-zero, is the size of  comparisons of the two sets on top of ESTACK, with sizes (ETOS) and (ETOS-1). the array. If UB is equal to 0, then (ETOS) is the size of the array.  - 36 -  - 38 - PERQ QCode Reference Manual  PERQ QCode Reference Manual 19 Jul 81 4.B.5 Strings EQUSTR 51 Strin 19 Jul 81 4.B.7 Array and Record Comparisons EQUWORD UB 69 Word or multiword structure = g =, NEQSTR 52 <>, LEQSTR 53 <=, LESSTR 54  NEQWORD UB 70 and <> comparisons. The argument, UB, if non- <, GEQSTR 55 >=, GTRSTR 56 and > comparzero, is the size of the array. If UB equals 0, then (ETOS) is the size of isons. The string pointed to by string pointer (ETOS-2),(ETOS-3) is the array.  lexicographically compared to the string pointed to by string pointer (ETOS) - 39 - PERQ QCode Reference Manual 19 Jul 81 4.B.8 Long Operations LOPS ,(ETOS-1). - 37 - UB 252 Long Operations. Arithmetic operations on long (32 bit) values. In general, (ETOS)"  FILE.FORMAT Get FAULT.DOC FAULT.DOC Get EDITOR.DOC EDITOR.DOC Get SEGMEN.DOC SEGMENT.DOC floppy is a boot floppy. If so, the second part of the boot will be done from the floppy. 3. The third altern Get PERQZ8.DOC PERQ_Z80.DOC ative is booting from hard disk. The microcode tries to boot from the hard disk. If all of these fail, then the DDS will contain an indication of what the error is. See the Fault Dictionary Manual for an explanation of the display number. After the boot device has been chosen, the second part of the boot sequence can begin. In this part, the PERQ reads 3k words of microcode from the selected boot device. This microcode is in two sections, a more extensi covers the lower 2k of standard control store during this part of the boot sequence. This microcode runs a simple diagnosticve diagnostic (VFY) and a system boot loader (SYSB). VFY attempts to verify that all of the CPU and Memory systems are on the processor and memory systems. If there are any errors, the microcode halts. The value in DDS gives the reason that working. Any failures that VFY discloses are displayed on the DDS. If all went well, the microcode determines what set of the machine halted. Once these diagnostics have been passed, the microcode makes a decision about which device is to interpreter microcode and system Pascal code is to be loaded. It does this by - 12 -  - iii -  be used for booting. Currently, there are three possible boot devices. 1. The first possible boot device is another  PERQ. The microcode determines if there is a PERQ Link Board plugged into the I/O Option slot of the machine. IfSides 2 Density SINGLE Fast ! DOCUMENTATION - DOCUMENTATION ! Created 19 Jul 81 15:13:36 Get UTILIT.DOC UTI the board is plugged in, and there is another PERQ on the other end of the link, the booting PERQ will wait for cLITIES.DOC Get PASCAL.DOC PASCAL.DOC Get FILES.DOC FILES.DOC Get FEATUR.DOC FEATURES.DOC Get ommands from the link. 2. The second choice of boot devices is a floppy disk. The microcode checks to seQCODE.DOC QCODE.DOC Get MICRO.DOC MICRO.DOC Get MAKESY.DOC MAKESYSTEM.DOC Get FILE.FOR e if there is a floppy in the floppy drive. If there is a floppy in the drive, PERQ will check to see if the" ong values. 14 - > of two long values. - 40 - PERQ QCode Ref, 100 Case Jump. W1 is word-aligned, and is the minimum inderence Manual 19 Jul 81 4.C Jumps JMPB B 204 Unconditional Jump/Byte Offsex of the table. W2 is the maximum index. W3 is the offset to the code et. B is added to the IPC. Negative values of B cause backward jumps. to be executed if the case specified has no entry in the case table. The case table is  JMPW W 205 Unconditional Jump/Word Offset. W is added to the IPC. Negative value W2 - W1 + 1 words long and contains offsets to the code to be executed for each case. s of W cause backward jumps. JFB B 206 False Jump/Byte Offset. Jump (as in JMPB)  If (ETOS), the actual index, is not in the range W1..W2 then W3 is added of the second long and (ETOS-3) is the high-order word. UB deter if (ETOS) is false. JFW W 207 False Jump/Word Offset. Jump (as in JMPW) mines the operation according to the following table: 0 - Converts the long value (ET if (ETOS) is false. JTB B 208 True Jump/Byte Offset. Jump (as in JMPB) if OS), (ETOS-1) to a single word. The high- order word must be 0 or all 1's, as it is truncat (ETOS) is true. JTW W 209 True Jump/Word Offset. Jump (as in JMPW) if (ETOS) is trued. If not, a runtime error is generated. 1 - Converts a single word (ETOS) into a long vale. JEQB B 210 Equal Jump/Byte Offset. Jump (as in JMPB) if integer (ETOS) equals (ETue. 2 - Adds two long values. 3 - Negates long value. 4 - Subtracts two long values. OS-1). JEQW W 211 Equal Jump/Word Offset. Jump (as in JMPW) if integer (ETOS) equals 5 - Multiplies two long values. 6 - Divides two long values. 7 - Mods two long values.  (ETOS-1). JNEB B 212 Not Equal Jump/Byte Offset. Jump (as in JMPB) if integer  8 - Absolute value of a long value. 9 - = of two long values. (ETOS) = true or false. 10 - <> (ETOS) is not equal to (ETOS-1). JNEW W 213 Not Equal Jump/Word Offset. Jump (as of two long values. 11 - <= of two long values. 12 - < of two long values. 13 - >= of two l in JMPW) if integer (ETOS) is not equal to (ETOS-1). XJP W1,W2,W3# boot will be done. The default is the same as holding down "a". Hold the key down until a pattern flashes on the screen.  Rivers Computer Corporation 720 Gross Street Pittsburgh, PA 15224 (412) 621-6250 PERQ Utility Programs MaAny of the 26 alphabetic keys can be used to specify a boot. All lower-case characters cause a boot from the hard disk. nual 17 Jul 81 This document is not to be reproduced in Upper case characters cause a boot from floppy. If you type "Details Boots" the Details program will provide you with a any form or transmitted in whole or in part, without the prior written authorization of Three Rivers Computer Corplist of all of the valid boot characters. Once a boot has been chosen, the microcode interpreter and PERQ operating oration. The information in this document is subject to change without notice and should not be construed asystem are loaded into the PERQ. Control is then transferred to the third portion of the boot sequence. In the third s a commitment by Three Rivers Computer Corporation. The Company assumes no responsibility for any errors that portion of the boot sequence, the interpreter microcode does any initialization that is needed and then starts to execute t may appear in this document. Three Rivers Computer Corporation will make every effort to keep customershe PERQ operating system. The PERQ operating system system also increments the DDS. If there were no errors during  apprised of all documentation changes as quickly as possible. The Reader's Comments card is distrib- uted witthe boot sequence, the machine will be running and the DDS will read 999. h this document to request users' critical evalu- ation to assist us in preparing future documentation.  - 13 -  PERQ is a trademark of Three Rivers Computer Corporation.  - ii - PERQ Utility Programs Manual - Notation Conventions. 17 Jul 81 1. Preface: Notation Con PERQ Utility Programs Manual Diana Connan Forventions. The notations used below have been clearly and consistently used throughout this document.  PERQ Introductory User Manual - Booting the Machine 17 Jul 81 checking to see if any key is being held down ongy Donald A. Scelza Brad A. Myers This manua the keyboard. If a key is being held down, that key specifies which boot is to be done. If no key is held down, the default l provides an introduction to the use of the PERQ Utility Programs. Copyright (C) 1981 Three# a segment. CALL UB 186 Call Routine. Call routine UB, which is in  Pointer, represented as an offset from SB; (ETOS-2) = Routine Number; and (ETOS- the current segment. CALLXB UB1,UB2 234 Call External Routine/Byte Segment. UB1 is the 3) = Static Link (determined as if a call were actually performed to the rinternal segment number (ISN) which contains the routine numbered UB2 to be outine here). CALLV 187 Call Variable Routine. The ESTACK elements (ETOS) --- (ETO called. First the ISN is translated to the correct SSN, and residency of that segment S-3) are a variable routine descriptor (as described above in LVRD). Resid is checked. If the segment is resident, the call proceeds; if not, the PC is backency of the segment are checked. If the segment is resident, the call is made as ed up so that the call will be re-executed, and a segment fault occurs. The  will CALL, except the GP and SL are taken from the variable routine descriptor; if second attempt is guaranteed to succeed, since the process is unable to resum not, a segment fault occurs as with CALLX. RETURN 200 Return from Routine. Return frome execution until the segment SSN is resident. CALLXW W,UB 235 Call External Routine/Word Se the current routine. If the routine was a function, the function val to PC. Otherwise, (ETOS) - W1 is used as an index into the case table agment. Same as CALLXB except the internal segment number (ISN) is given innd the index entry is - 41 - PERQ QCode Reference Manual  a full word. LVRD W,UB1,UB2 98 Load Variable Routine Descriptor. This Q-Code pushes a  19 Jul 81 added to PC. Variable Routine Descriptor on the EStack for the routine UB1 in segment ISN  - 42 - PERQ QCode Reference Manual W, at lexical level UB2. The following values (which comprise a variable routine  19 Jul 81 4.D Routine Calls and Returns Note: There can be at most 256 routines in  descriptor) are pushed: (ETOS) = System Segment Number (SSN); (ETOS-1) = Global $  list of the commands that can be abbreviated. quest that you power down the machine by hand. In this case, ^C will cause Login to be run. BYE WAIT logs you  ______ _______ SYMBOL MEANING []  - 2 - PERQ Utility Programs Manual - Question Mark: ? 17 Jul 81 3. Qu optional feature {} 0 to n repetitions CAPITALS estion Mark: ? The question mark command lists all the commands that the Shell knows. In addition, it gives som literal lowercase or LowerCase metaname ^ e information about what the command does and how it is called. This manual describes a superset of the commands that arecontrol key CR carriage return SHIFT shift key  listed by a question mark.  | or - 1  - 3 - PERQ Utility Programs Manual - Append 17 Jul 81 4. Appen- PERQ Utility Programs Manual - Introduction 17 Jul 81 2. Introduction This manual describes d Append is used to attach two files together. Typing the command line APPEND File1 File2 will the PERQ Utility Programs and explains how to use them. In some cases you will be referred to additional documentatcopy File2 onto the end of File1. File2 remains unchanged. ion that exists either online or in other Three Rivers Computer Corporation publications. Although most of the commands - 4 - PERQ Utility Programs Manual - Bye 17 J described here are implemented as one or more Pascal files, some are implemented directly by the Shell itself. No distincul 81 5. Bye Bye logs you off the PERQ. Type: BYE and it types your name and the date and timetion is made here since it is invisible to the user. An additional distinction is that some commands are known to be used f of logoff. Login then loads and you or some other user can log back on. BYE OFF logs you off and turns off yourequently. The names of these commands are allowed to be abbreviated to the number of letters that are unique with rer machine. OFF may be disabled on your PERQ; if it is, call Three Rivers Computer Corporation for information on reespect to the other commands that can be abbreviated. The question mark command (see section 'Question Mark' below) gives anabling it. OFF requires some special microcode which should be available on your machine. If not, Bye will log off and re$  19 Jul 81 the routine dictionary, if the RA which is beinhandler. A new exception enable record is pushed (quad word aligned) onto the MStack g returned to is 0, the return is performed to the exit code of that routine.  and linked into the routine's current exception list. RAISE W1,UB,W2 243 Rai (This proves useful for the EXIT and EXGO Q-Codes described below). EXIT W,UB 92 se Exception. W1 and UB1 are the internal segment and routine numbers,  Exit from Routine. Exit from all routines up to and including the most recent  respectively, of the exception to be raised. W2 is the number of words of parameters that  invocation of the routine UB in ISN W. This is accomplished by setting the RAs in al have already been pushed onto the memory stack. The exception is raised. l the ACBs to 0, from the most recent through and including the first AC - 44 - PERQ QCode Reference Manual B which was created from an invocation the routine to be exited, and jumpin 19 Jul 81 4.E Systems Programs Support Procedures NOOP 93 No-Operation. REPL 94 g to the exit code of the current routine. EXGO W1,UB,W2 29 Exit and Goto. Exit from all r Replicate. Replicate (ETOS). REPL2 95 Replicate Two. Replicate two top-of-estack outines up to, but not including, routine UB in ISN W1, and then jump to the words (i.e., first push original (ETOS-1), then push original (ETOS)). MMS 96 Movinstruction with offset W2 from CB. The implementation is similar to EXIT, e to Memory Stack. Push (ETOS) onto MTOS (16-bit transfer). MES 97 Move to Expresexcept the last RA modified is loaded with W2. ENABLE W,UB1,UB2 242 Enable Exception Handlersion Stack. Push (MTOS) onto ETOS (16-bit transfer - top 4 bits are zerue is left on the top of the MStack. Since the first word of a code segment . W and UB1 are the internal segment and routine numbers, respectivelyis not code, but an offset to - 43 - PERQ QCode Reference Manual , of the exception being enabled. UB2 is the routine number of the %  S to save everything that that comes from the remote computer in a file. T to tr (compiles the default file) COM /sy:14 (compiles the default file witansmit a file across RS232, as if it were being typed at the keyboard. C to close a file afterh 14 symbol table blocks) If you want to compile a program immediately after editing it, you need not doing a Save. B to change the RS232 baud rate. The default when Chatter comes up is 2400 bau specify its name since the Shell remembers the last file edited, compiled, linked, or run. Certain switches may be d. Q to quit Chatter and return to Shell. This doesn't log off or disconnect the remote host.included in the source program text. See the PERQ Pascal Extensions Manual for more detailed information on switches and otoff the machine and sends the hard disk heads to the center of the disk (the highest disk address). It then prints a messag This menu will appear at the very top of your screen to prompt you after you've typed ^R. While in Chatter, if you fine and waits for power down or ^C. When shipping a PERQ, it is recommended that the disk heads be in the position thd that the characters you type are not being echoed properly, one of two things may be wrong: the baud rate may be inapproprat Bye WAIT puts them. BYE HELP describes the options available for Bye. All of the arguments to Bye can iate or your RS232 cable might not be connected properly. Chatter cannot be used as a half duplex terminal since it dbe specified as switches (e.g. Bye/help) rather than as arguments, if you so desire. It is very important to log off oes not echo characters locally. - 6 - PERQ using BYE before powering down the machine. If you do not, certain temporary disk files will not be deleted and they will Utility Programs Manual - PERQ Pascal Compiler 17 Jul 81 7. PERQ Pascal Compiler The PERQ Pascal compiler trstay around using disk space until you run the Scavenger (see below). anslates your Pascal source program into a .Seg file that can be linked and run. There are several ways to invoke the comp - 5 - PERQ Utility Programs Manual - Chatter 17 Jul 81 6. Chatter Chatter alliler and several options that you can use with it. The command line takes the form: COMPILE [Destination=]SourceProgows a PERQ to act as a terminal, using an RS232 line for communication. It is invoked by typing: CHATTER ram{/switch} Examples of legitimate compiler calls include: COMPILE Program.pas COM ProgrWhile in Chatter, some special functions can be invoked by typing ^R, the function's code letter, and CR. These include am (note that the .pas extension is implicit) COMP Program2=Program1 COM%  than that used for the screen bitmap. There are two parameters that specify the areas of r (ETOS-3) Source-X-Position (ETOS-2) Source-Y-Position oed). MMS2 201 Move Double to Memory Stack. Transfer the top two words from the ES memory to be used for the source and destination: a pointer to the start of the tack to the MStack. The order is reversed; old (ETOS) is (MTOS-1), (ET memory block and the length (in words) of scanlines in the block. A scanOS-1) is (MTOS). MES2 202 Move Double to Expression Stack. Transfer the top two line is one of the elements that cross the block. On the screen, for exa words from the MStack to the EStack. THe order is reversed; old (MTOS) ismple, a scanline is one - 45 - PERQ QCode Reference Manual  (ETOS-1), (MTOS-1) is (ETOS). RASTER-OP 102 RasterOp. RasterOp is a special QCode which  19 Jul 81 of the horizontal lines with a length of 48 words. Wis used to manipulate blocks of memory of arbitrary sizes. It is especially useful ithin these regions, the positions of the source and destination rectangles are  for creating and modifying displays on the screen. RasterOp modifies a rectangular  given as offsets from the pointer. Thus position (0,0) would be at the upper left  area (called the "destination") of arbitrary size (to the bit). The picture  corner of the region, and, for the screen, (767, 1023) would be the lower right. drawn into this rectangle is computed as a function of the previous contents  The EStack must be arranged in the following order for RASTER-OP: of the destination and the contents of another rectangle of the same siz (ETOS-10) Function (ETOS-9) Width (ETOS-8) Heie called the "source". The functions performed to combine the two ght (ETOS-7) Destination-X-Position (ETOS-6) Destination-Y-Position  pictures are described below. RasterOp can be used on memory other  (ETOS-5) Destination-Area-Line-Length (ETOS-4) Destination-Memory-Pointe& ame wild cards in the same order. In this case, Copy matches all files in the directory with the source pattern. For each maks the user whether to continue processing the rest of the files that match the input. This confirmation is required no mattch, the part of the source file name that matches each wild card replaces the corresponding wild card in the destiter what switches were specified. A final switch is "/HELP" which describes the function of Copy and the various switchesnation. As an example, for the command: COPY foo*.abc# anotherdir>*baz.rmn#z the input file "FOOZAP.. - 8 - PERQ Utility Programs Manual - The Preliminary Debugger 17 Jul 81 9ABCD" would be copied into a new file named "anotherdir>ZAPbaz.rmnDz". If wild cards are used, Copy asks for verification . The Preliminary Debugger The current operating system includes a simple debugger. When the user types ^SHIFT-D or  of each file copied. This can be disabled with the switch "/NOVERIFY" or enabled with "/VERIFY". The latter is the defaulan uncaught exception is discovered, a dump of the user stack is shown. This has the form: Control-shift-D dump Debug att. Wild cards are not allowed in the directory part of the source file. If wild cards are not used, then Copy uses the searc 108 in routine 7 in IO_PRIVA. Called from 214 in routine RANDOMWI (8) in WIPEWIN. Called from 395 in routine WIPEWIN (0h list to try to find the source. Note that this is different from Rename and Delete which always look in only one directory.) in WIPEWIN. Called from 149 in routine 0 in LOADER. Called from 222 in routine 1 in SYSTEM. Called from 520 in routine 0her compiler features. - 7 - PERQ Utility P Copy is a useful command if you'd like to edit your own copy of a file without changing the original one. (The Editor rograms Manual - Copy 17 Jul 81 8. Copy Copy creates a new file identical to the specif provides you with the ability to do this too, but copying can give you an additional safeguard against unintentionalied source. Its command syntax is: COPY SourceFile DestinationFile Copying works across devices and parti changes to the source.) The names of SourceFile and DestinationFile may be identical; however if they are identictions (see the PERQ Introduc- tory User Manual for details on devices and partitions). You can also specify the non-file-al a new file will not be created. If you want two files you should use nonidentical names. If the file you are copying structured devices CONSOLE: and RS:. The source file for Copy can have wild cards in it (for a description of t to already exists, Copy requests confirmation before overwriting it. This can be disabled by using the switch "/FAST" he wild cards, see the PERQ Introductory User Manual). If the source has wild cards, the destination must have the sor enabled using the switch "/SAFE". FAST also sets NOVERIFY. If an error is discovered and wild cards were used, Copy as& XOR Src 7 RXNor Dst gets Dst XNOR Src - 46 - al address of the top left corner of the destination region. This pointer MUST  PERQ QCode Reference Manual 19 Jul 81 "Width" specif be quad-word aligned, however. "Source-X-Position" is the bit offset ies the size in the horizontal ("x") direction of the source and destinat of the left side of the source rectangle. The value is offset from Source-Memory- ion rectangles (given in bits). "Height" specifies the size in the  Pointer (see below). "Source-Y-Position" is the scan-line  (ETOS-1) Source-Area-Line-Length (ETOS) Source-Memory-Pointer  vertical ("y") direction of the source and destination rectangles (given in scan  The values on the stack are defined below: "Function" lines). "Destination-X-Position" is the bit offset of  defines how the source and the destination are to be combined to create thethe left side of the destination rectangle. The value is offset from  final picture stored at the destination. The RasterOp functions are as follows (Src  Destination-Memory-Pointer (see below). "Destination-Y-Position" is the scan-  represents the source and Dst the destination): Function line offset of the top of the destination rectangle. The value is offset from  Name Action -------- ---- ------ 0 RRpl Dst gets Src  Destination-Memory-Pointer (see below). "Destination-Area-Line-Length" i 1 RNot Dst gets NOT Src 2 RAnd Dst gets Dst AND Src s the number of words which comprise a line in the destination region (he 3 RAndNot Dst gets Dst AND NOT Src 4 ROr Dst gets Dst OR Snce defining the region's width). The appropriate value to use when operarc 5 ROrNot Dst gets Dst OR NOT Src 6 RXor Dst gets Dst ting on the screen is 48. "Destination-Memory-Pointer" is the virtu' sponding place in the source. When the debugger can find the name, it is printed followed by the number. At other times,  There are 5 local words, 0 argument words, and 0 result words Debug> - 9 - PERQonly the routine number will be printed. You can count the procedure (and exception and function) headers in the module sou Utility Programs Manual - The Preliminary Debugger 17 Jul 81 Now you can use the debugger's commands to investigate yrce file to determine which procedure it is. When counting procedures, start with one for programs and zero for modules. our program. Notice that the debugger goes to more effort to find the procedure names than the original dump, so that if  The main body of a program is its procedure zero. Exported and forward procedures are counted only once, where tha procedure name was not printed at first, going into the debugger may get it displayed. The debugger does not know the typee name first appears. _ ____ _____ _________ _____ A note about procedure names: These names are always truncated to es or sizes of variables, but it does know the number of words allocated for locals, arguments and results. Note that theight characters and converted to all uppercase. To get the names, the debugger examines the Seg file for the module. If the compiler generates temporary variables which are included in the local count. When a debugger command is invoked which t Seg file found is not the one that was loaded, the procedure names will be wrong. The procedure numbers will always be cakes an offset, you can type a number which is the offset of the word to print. Zero is the first word. If you type -1, aorrect, however. For the procedure names of system modules, the system run file is checked to find the Seg file name. ll the words in the current context will be printed. For example, to an "a" command, all the arguments will be printed for This Seg file is used to get the procedure names. If the system run file or the system Seg files are not accessible, the deb -1. If you type -2, the debugger will request the first and the last offsets to print. In this manner, a range of values cugger will not be able to print the procedure names for system routines. After the dump is printed, you will be asked if youan be printed. No checking is done to make sure that the offsets typed are in range; if a number is out of range, some rando in SYSTEM. First, the reason for taking the dump is shown. Next is a trace of all the procedures on the stack. Each line want to debug. (If a dump is printed due to a ^SHIFT-C, no debugging will be allowed). If you answer no, the progra shows the location in the code, the routine that location is in, and the module which contains that routine. The locm will be continued if it was called from ^SHIFT-D, otherwise it will be aborted and control will go back to the Shell. If yation is the QCode offset from the beginning of the procedure. You can use QDis to try to associate this with the correou decide to debug, the debugger will print something like: Scrounge, V0.10 Now at routine KEYINTR (7) in IO_PRIVA '  - 47 - PERQ QCode Reference Manual 19 Jul 81 LINE ith out interrupts, to competion. If the segment SSN (ETOS-1) is non-resident,  241 Line Drawing. (ETOS) is a pointer to the origin (relative 0,0) of the area on which  restore the EStack to its previous state, backup the PC to re-execute the TLATE1 and  the line is drawn. (ETOS-4) and (ETOS-3) are the x and y coordinates (respec perform a segment fault. TLATE2 228 Translate Top of Stack - 1. Same as TLATE1 tively) of the first endpoint of the line. (ETOS-2) and (ETOS-1) are the x  except the virtual address is at (ETOS-1),(ETOS-2). TLATE3 229 Tranand y coordinates (respectively) of the second endpoints on the line. (Eslate Top of Stack - 2. Same as TLATE1 except the virtual address is at TOS-5) is the style of the line where a value of 1 means erase the line, 2 m (ETOS-2),(ETOS-3). STLATE UB 240 Special Translate. This translate is simieans to xor the line and anything else means to draw the line. STARTIO 103 (ETOS) ilar to the previous translate Q-Codes, except that it can specify a greater depth  offset of the top of the source rectangle. The value is offset from Source-Memory- s the channel on which to start IO. INTOFF 105 Disable interrupts. INTON 106 Enable interrupts. Pointer (see below). "Source-Area-Line-Length" is the number  EXCH 230 Exchange. (ETOS) and (ETOS-1) are swapped. EXCH2 231 Exchange Double. The pa of words which comprise a line in the source region (hence defining the region's width). ir (ETOS) and (ETOS-1) are swapped with the pair (ETOS-2) and (ETOS-3).  The appropriate value to use when operating on the screen is 48. TLATE1 227 Translate Top of Stack. (ETOS),(ETOS-1) is a virtual address. If the se "Source-Memory-Pointer" is the virtual address of the top left corner of the source gment SSN (ETOS-1) is resident, convert the virtual address to an offset f region. This pointer MUST be quad-word aligned, however. rom stack base (SB) and execute the next Q-Code (what ever it may be), w( m data will be printed. Data is printed in the form: [ 7] ( 5053^) = 6 where 7 is the offset in the current proceof the stack. To investigate the variables of a procedure, move up or down the stack until that procedure is redure, 5053 is the offset from the bottom of the entire stack and 6 is the value in that location. _ ____ __ ______ached and then it can be investigated. < Down level. Move down one level towards the bottom of the sta__ _________ A note on counting variables: Imagine that your procedure was defined with the following variables: vck. When entering the debugger, the current procedure is set at the top so this command has to be used first. t ar a,b,c: Integer; d: Char; When a list of variables are defined in the same statement, they are allocated in reverTop of Stack. Move to the top of the stack. b Bottom of Stack. Move to the bottom of the stack. c Current. Shows se order so the first word is the variable "c". The second word is "b", the third "a" and the fourth is "d". This is truenumber of words for arguments, returns and locals for the current procedure. d Display Stack. This command r for local and global variables and for records. Note that if you had declared the variables as: var a: Integer; eprints the original dump. Some additional procedure names may be printed. In addition, the procedure where yo b: Integer; c: Integer; d: Char; then "a" would be the first word, "b" is the second one, etc. This u are debugging is marked with "<**>". l Local. Examine the local data. The debugger reprints the number of  ___ does not hold for procedure parameters, however, where the variables are always stored in exactly the order declared. Tlocal words. You can type the offset of the word you want to see. a Argument. Examine the arguments to a prhe debugger's commands are: ? Print a list of all the commands. x Set the radix. All integers are normally printocedure or function. Unfortunately, there is no way to investigate the parameters to an exception. r Retured in signed decimal. With this command, you can specify any radix from 2 to 36. If the radix is negative tns. Examine the return values from a procedure. g Globals. Examine the globals for the module or program that hen all output will be unsigned. If it is positive then output will be signed. Note that this radix is only the procedure is in. When the g command is given, the module or program name is printed. If it is a program, the debufor output; all input is still in signed decimal. - 10 - PERQ Utilitygger asks if you want to skip input and output. These are the two file variables that are defined for every pro Programs Manual - The Preliminary Debugger 17 Jul 81 > Up level. Move up one level in the stack towards the top gram and take up space at the top. If you answer yes to this question, you do not have to worry about the (  virtual address to be translated (prior to any stack alteration).  (ETOS-1) is the value to be written into the high-order byte, (ETOS-2) is the value to bA depth of 0 indicates no translation. All segments specified in the written into the middle byte and (ETOS-3) is to be written into the low-ordee STLATE must be resident before any translations occur; otherwise a segr byte. JCS 191 Jump to a Location in the Control Store. Control is transferred ment fault occurs. Note, if both nibbles of UB are non-zero then the low-order nibble to the address (bytes exchanged) given in (ETOS). A routine called wi (bits 0-3) must be less than the high-order nibble (bits 4-7). LSSN 99 Loath JCS should exit with a NextInst(0) jump. REFILLOP 255 Refill the OpFile. Thisd Stack Segment Number. Pushes the system segment number of the MStack onto  instruction causes execution to proceed from the beginning of the next qua EStack. LDTP 203 Load Top Pointer (plus 1). Pushes the value of Top Pointerd-word. - 49 - PERQ QCode Reference Manual 1 (TP) plus 1 onto EStack. LDAP 244 Load Activation Pointer. The current activ9 Jul 81 INCDDS 251 Increment Diagnostic Display. The value of the diagnostic dation pointer (as an offset from the base of the stack) is pushed onto the isplay is incremented and the contents of the EStack is checked. If the E EStack. ATPB SB 188 Add to Top Pointer/Byte Value. Adds SB to TP. ATPW Stack is not empty, a runtime error is generated.  than TLATE3, and that it may specify the translation of 2 virtual addresses. Each  189 Add to Top Pointer/Word Value. Adds (ETOS) to TP. WCS 190 Write Co half of UB is interpretted as the depth of the System Segment Number word ofntrol Store. A control store word is written from information on the EStack.  the - 48 - PERQ QCode Reference Manual 19 Jul 81  (ETOS) contains the address (bytes exchanged) of the word to be written. )  Utility Programs Manual - The Preliminary Debugger 17 Jul 81 s Stack. This command permits display of words anywhing a file name" in the PERQ Introductory User Manual for details on PERQ wildcard conventions. The valid switches for Dere on the program stack. Detailed knowledge of the compiler's memory allocation is necessary to utilize telete are: VERIFY asks for verification before deleting a file. It's the default when you use his command so it is generally not useful. q Quit. Exits the debugger and aborts the program that was  a wildcard. NOVERIFY is the default when you specify only a filename without a wildcard.space for them when counting variables. Unfortunately, there is no way to examine data in modules that do not ha running. This returns control back to the Shell. It requires confirmation. p Proceed. Exits the debugger anve procedures on the stack. m Mode. The debugger cannot know the type of data, but if you know, you can tell thd resumes the program executing. Note that this command allows you to resume from uncaught exceptions but te debugger. The mode command lets you specify the output mode for data. When you type the Mode command, his is not recommended. In this case, confirmation is required. If the debugger was entered through ^SHIFTit prints the current mode and asks for a new one. If you type "?" at this point, a list of the options is -D, then no confirmation is required. If an exception is raised inside the debugger, the debugger aborts immediately and e printed. They are: i=integer, s=string, c=char, B=Boolean, b=byte. Notice the case sensitivity of the argumentsxits to the Shell. In the debugger, ^C and ^SHIFT-C both cause immediate exit to the Shell also. ^SHIFT-D is disab. When the mode is string, the debugger cannot print a range or all data since it cannot know how much memoled while inside the debugger. ry was allocated to hold the first string. In this case, if the -1 argument is given, the offset is assume - 12 - PERQ Utility Programs Manual - Delete 17 Jul 81 10. Delete The command: d to be zero. When printing strings, the length is printed first. When printing bytes, the radix specifie DELETE FileSpecification[/switch] irrevocably destroys the specified file. It deletes the file's name fromd still holds (although they will always be unsigned). For bytes and characters, offsets are still in terms  the directory and places the blocks it occupied on the free list, thus making those blocks available for use by other fileof words; the debugger prints both bytes in the word specified. - 11 - PERQs. Wildcards may be used in the file specification, but not in a directory part. See the section entitled "Specify)  - 50 - PERQ QCode Reference Manual  EQUPOWR 35 EQUREAL 34 EQUSTR  19 Jul 81 INDEX ABI 3 37 EQUWORD 39 ER 3 ABR 34 ACB 3 Act4 ES 4 ESTACK 1 ETOivation Record 1 ADI 33 ADJ S 1 Exception 4 Exception Handler  35 ADR 34 AP 2  4 EXCH 48 EXCH 48  ATPB 49 ATPW 49 CALL  EXGO 44 EXIT 44 FLT  43 CALLV 43 CALLX 43  34 GDB 1 GEQBOOL 32  CALLX 43 CB 1 CHK  GEQBYT 38 GEQI 33 - 33 CS 2 DIF 35  51 - PERQ QCode Reference Manual 19 Jul 81 GEQPOWR  DL 2 DVI 33 DVR  36 GEQSTR 37 GL 3  34 EEB 3 ENABLE 44  GP 2 GTRBOOL 32 GTRBYT  Enabling an Exception 3 EP 3 EQUBOOL  38 GTRI 33 GTRSTR 37  32 EQUBYT 38 EQUI 33  HR 4 INC 30 INC *  blocks in each partition) LOADEDPROFILE Profile information that is cachedal - Directory 17 Jul 81 12. Directory The Directory command provides an alphabetical list of fi in memory SEARCH Prints the current search list. SHELLNAME Name of current Shellles in a directory. The form for the command line is: DIRECTORY [dirSpec>][fileSpec]{/switch} If it is i runfile SHELLINFO Shell specific information DISKSIZE Size of hard disk nvoked without a parameter, all files in the current directory will be listed. If there are wild cards, the dirSpec part  TIME Gives current date and time PATH Gives current path, default partition  is matched against all directories and the fileSpec part is matched against all files in the directories that matched d name and default device name LASTFILE Default file for Edit and Compile irSpec. Wild cards are described in the section "Specifying a file name" in the PERQ Introductory User Manual. Wild card BOOTCHAR Character used for booting BOOTS Valid boot characters SWAP s are not allowed in partition or device names. Examples of usage include: DIR lists every file in  HELP provides some online documentation.  Whether swapping is enabled or not and to where IOERRORS A coun - 13 - PERQ Utility Programs Manual - Details 17 Jul 81 11. Details t of how many times each of the IO errors occurred since the last  The Details command provides some information about the current state of your PERQ. Typing DETAILS HELP will ge boot HELP For online documentation These may be abbreviated to as many characters as are unt you online documentation. The Details command line is of the form: DETAILS{ parameter} Valid parameters ique. If you don't specify a parameter, a selection of the available infomation is typed. If you specify *, all infare: USERNAME Name of current user USERID ID of current user PROFormation is typed. "Details Partition" is very useful since it tells how much free space there is in all the partitionsILENAME Name of profile file for the current user PARTITION Names . See the PERQ Introductory User Manual and the PERQ File System Utilities Manual for details on Partitions, Searcof all devices and partitions known (includes the number of free h lists, Shell, Path, and Boots. - 14 - PERQ Utility Programs Manu*  LDB 28 LDC 21 LDC  32 LESBYT 38 LESI 33  21 LDC 21 LDCH 29  LESSTR 37 LGA 24 LGA  LDCMO 21 LDCN 21 LDDC  24 LGA 24 LIA 25  30 INCDDS 49 IND 30  27 LDDW 27 LDG 24  IND 30 INN 35 INT  LDG 24 LDI 25 LDI  35 INTOFF 48 ISN 1 25 LDIND 26 LDL 22 IXA 30 IXA 30 IXA  - 52 - PERQ QCode Reference Manual 19 Jul 81  30 IXP 31 JCS  LDL 22 LDL 22 LDMC  49 JEQ 41 JEQ 41  27 LDMW 27 LDO JF 41 JF 41 JMP  23 LDO 23 LDO 23 L 41 JMP 41 JNE 41 DP 31 LDTP 49 LEQBOOL  JNE 41 JT 41 JT  32 LEQBYT 38 LEQI 33  41 LAND 32 LDAP 49  LEQPOWR 35 LEQSTR 37 LESBOOL + directory, e.g., Program.pas, Program.seg, Program.run. DIRECT *zing* lists all files with MULTICOLUMN tells Direct to print files in four columns. This is the default when doing  "zing" in their names. DIR Program*/SIZE lists files beginning with "Program" and tells h a FAST directory to the screen. This switch does nothing if SIZE or ALL is ow much disk space each occupies. The following are the switches available for use with this program: HELP  specified. FILE:name directs the output to a file called name. If the for types some online documentation. FAST prints a short directory. This is the defaulm /FILE is used, Direct prompts for the file to use. DELIMITER when used in conjunction wit. SIZE tells you how many blocks and bits are in each file. th the FILE switch, writes filenames as name | name  - 15 - PERQ Utility Programs Manual - Directory 17 Jul 81 ALL prov into a file. This is useful for creating command files. PARTITIONS gives information abides this information about each file: Number of Blocks out all partitions after the files are listed.  Number of Bits Kind of file Creation date Last Upd - 16 - PERQ Utility Programs Manual - DirTree 17 Jul 81 13. DirTree DirTree gives ate date Last Access date LISTDIRECTORIES When doing a multi-directory a graphic representation of the filesystem's tree structure. It erases the screen and then displays a tree of all the dithe current directory DIR *>* shows all files in all directories starting with the current listing, only the directories that have valid matches for the fileSpec ar directory and including all subdirectories. DIR/HELP gives online documentation DIRECTOe printed. This switch tells Direct to print all directories that match the dirRY :BOOT>x*>*.run looks in the Boot partition for all the run files in directories whose names start witSpec even if they do not contain any matches for fileSpec. ONECOLUMN tells Direct to prinh "x" DIRECTORY Program* tells you what files beginning with "Program" are in the current t all files in one column. This is the default when the output goes to a file. + ES2 45 MMS 45 MMS2 45 RD 3 REFILLOP 49 RE 45 MODI 33 MOV 30 PL 45 REPL 45 RETURN  MOV 30 MPI 33 MPR  43 RN 2 RND 34  34 MSTACK 1 MTOS 1  ROTSHI 31 RPS 2 RR  MVB 28 - 53 - PERQ QCode Reference Manual  3 RS 3 SAS 29  19 Jul 81 MVB 28 NE  SB 1 SBI 33 SBR  LIA 25 LINE 47 LL  4 NEQBOOL 32 NEQBYT 38  2 LLA 22 LLAW 22  NEQI 33 NEQPOWR 35 NEQREAL  LNOT 32 LOA 23 LOA  34 NEQSTR 37 NEQWORD 39  23 LOPS 40 LOR 32  NGI 33 NGR 34 NOOP  LP 3 LSA 29 LSSN  45 PC 1 PS 2  49 LTS 2 LVRD  Q-Machine Architecture 1 RA 3 RAISE  43 Memory Organization 5 MES 45 M 44 Raising an Exception 4 RASTER-OP ,  default starting place is the default device. In this case, DirTree displays all the partitions, and then all thet and press the HELP key) and manual (The Editor Quick Guide), so this description will be brief. Three common use directories in each partition, and then all the subdirectories, etc. Lines are drawn from each directory to its pares of the editor are discussed here. The command line for Edit is: EDITOR FileSpecification or nt. If a directory is supplied, DirTree simply starts the search from that directory. After displaying all the di EDITOR/replay If the parameter is left out Edit will assume that you want to edit the default file name remembered by therectories, DirTree highlights the current directory if it is displayed.  Shell. The Editor does extension completion on the file name specified. If the file to print is FOO.PAS, it is only necess - 17 - PERQ Utility Programs Manual - Dismount ary to type FOO. The extensions that type knows about, in order tried, are: Pas, Micro, Cmd, and Dfs. Three common uses  17 Jul 81 14. Dismount The Dismount command detaches devices from the filesystem. The argument tof the Editor are: 1. To create a new file: Invoke the editor with the name of your new file. The screen io Dismount is HARDDISK or FLOPPY. Note that these names are used no matter what the name the device was given when it was s cleared to give you a blank page to write on. Type I to insert the text that you want to type in. Wh partitioned. Once a device has been dismounted, it can no longer be accessed _en you're finished, i. Press the INS key (upper lefthand corner of keyboard). This is impor___ until it has been mounted again. It is very important to Dismount filesystem floppies before removing them from the drivtant; it's the only way that what you typed in will be saved. ii. Type Q. The screen is cleared ae. See the section on "Mount" for more information. gain and you are prompted with a list of alternatives. See the Editor documentation for detai - 18 - PERQ Utility Programs Manual - Editor 17 Jul 8ls on these. 2. To make changes to an existing file: Invoke the editor with the name of an existing 1 15. Editor The Editor is used to create or alter any text file on the PERQ. You will probably use it very freqfile. Work with the Editor Quick Guide at your side until you're comfortable with the functions avairectories starting from the root directory on the left. Any directory can be specified as the root of the tree. Theuently, so it's a good idea to become familiar with it as soon as you can. It has its own online documentation (run Edi,  29 STDW 27 STG 24  STG 24 STI 25 STI  25 STIND 26 - 54 -  PERQ QCode Reference Manual 19 Jul 81 STL 2 PERQ Micro-Programmer's Guide Brian2 STL 22 STL 22 STL Rosen John P. Strait This manual provides an introduction to the ATE 48 STMW 27 STO PERQ micro- programmable CPU. Copyright (C) 1981 Three Rivers Computer Corporation 720 G 23 STO 23 STO 23 ross Street Pittsburgh, PA 15224 (412) 621-6250 PERQ Micro-Programmer's Guide 19 J STP 31 TL 2 TLATE1 ul 81 This document is not to be reproduced in any form or transmitted in whole or 48 TLATE2 48 TLATE3 48  in part, without the prior written authorization of Three Rivers Computer Corporation. The information in this d 34 Segment 1 SGS 35  TNC 34 TP 2 UNI  SIND 30 SL 2 SRS  35 WCS 49 XGP 3  35 SS 2 SSN 2  XJP 41 XST 3  STARTIO 48 STB 28 STCH  - 55 - - ts command line takes the form: EXPANDTABS SourceFile DestinationFile  time. READ to read sequential sectors of the floppy  - 21 - PERQ Utility Programs Manual - WRITE to write sequential sectors of the floppy RANDOM to do ralable. If you find that you've made changes to a file that isn't yours or that you've done irreparable Floppy 17 Jul 81 17. Floppy Floppy formats and tests a floppy disk. Its command line is:  damage to one that is, don't panic - if, after typing Q you type E, all of the changes you've ma FLOPPY and it's self-prompting. To run Floppy, follow these steps: 1. Put the floppy into tde will be ignored. If you'd like to save your changes but don't want to alter the source he drive. 2. Run Floppy. The following dialogue will ensue: ______ ____ file, you can type W after Q to make a new file. - 19 - PERQ Utility P FLOPPY USER Double density? No (double density is rograms Manual - Editor 17 Jul 81 3. To read a file at your leisure: you can EDIT it,  not yet supported) Both heads? Yes if your floppy  reading and scrolling at your own pace. (The TYPE command, documented later in this manual, displays a  is double-sided; No if it's single-sided Interlacing factor? 5  file very quickly.) To safeguard against your having made any accidental changes to the file, type E after  Random number? Any number less than 32767 You are then prompted with an asterisk; valid commands are:  Q.  HELP for some online documentation FORMAT to format the floppy. This  - 20 - PERQ Utility Programs Manual - ExpandTabs 17 Jul 81 16. ExpandTabs  destroys the current contents of the floppy. You  ExpandTabs simulates tabs in every 8th column by replacing tabs in the imput file with the correct number of spa are asked if you want to test after formatting; ces. ExpandTabs is used when a file that was written for another system is put onto a PERQ, which does not support tabs. I this is not usually neces- sary and takes a great deal of-  Corporation. The Company assumes no responsibility for any errors that may appear in this document. Thr 19 Jul 81 The XY registers (256 registers x 20 bits) form a double ported file of general-purpose registers. ee Rivers Computer Corporation will make every effort to keep customers apprised of all documentation changes as  The X port outputs are multi- plexed with several other sources (the AMUX) to form the A input to the ALU. The Y port ou quickly as possible. The Reader's Comments card is distrib- uted with this document to request users' critical evalu- tputs, multiplexed with an 8- or 16-bit constant via the BMUX, form the B input to the ALU. The ALU outputs (R) are fed ation to assist us in preparing future documentation. PERQ is a trademark of Three Rivers Computer Corporati back to the XY registers as well as the memory data output and memory address registers. Memory data coming from the on. - ii - PERQ Micro-Programmer's Gu memory is sent to the ALU via the AMUX. The IO bus (IOB) connects the CPU to IO devices. It consists of an 8-bit address ide 19 Jul 81 ____________ __ ___ ________ Introduction to the Hardware PERQ(IOA) which is driven from a microword field and a 16-bit birectionalal data bus (IOD) which is read via AMUX and written from is implemented with a high-speed microprogrammed processor which has a 170 nanoseconds microcycle time. The microinstructio R. Opcodes and operands that are part of the instruction byte stream are buffered in a special 8 x 8 RAM (the OP n is 48 bits wide. Most of the data paths in the micro engine are 20 bits wide. The data coming in and out of the proc file). The OP file is loaded 16 bits at a time from the memory data inputs. The output of the OP file is 8 bits wide anessor (IO and Memory data for instance) are 16 bits wide. The extra 4 bits allow the microprogrammed processor to calculd can be read via AMUX or can be sent to the micro-addressing section for opcode dispatch. The read port of the OP file isate real addresses in a 1 megaword addressing space. The assumption is that virtual addresses are kept in a doubleword in mem addressed by the 3-bit BPC (Byte Program Counter). A shift matrix (SHIFT), which is part of the special hardware prory but calculations on addresses can be single precision within the processor. The programmer of the virtual machine nevovided for the RasterOp operator, can be accessed by loading an item to be shifted via the R bus, and reading the shifted rer sees the 20 bit paths. The major data paths are diagrammed below: esult on AMUX. A 16-level push down stack (ESTK) is written from R and read on AMUX. The stack is used by the Qocument is subject to change without notice and should not be construed as a commitment by Three Rivers Computer - 1 - PERQ Micro-Programmer's Guide .  - 23 - PERQ Utility Programs Manual - FTP ne can begin the transfer. The possible commands for FTP are GET SourceFile[ DestinationFile]  17 Jul 81 19. FTP The FTP utility copies files across the RS232 link to another PERQ or any other c PUT SourceFile[ DestinationFile] MODE Mode (can be PERQ or PDP-11; default is PERQ) BAUD Baud rate (iomputer that supports the FTP protocol. The command line is: FTP[ command] The two machines have to be linkenitially set to 9600) POLL (One machine has to be in Poll mode while the other does the Get or Putd together with an RS232 cable, which goes into their RS232 ports (located between the cables for the display and keybo) - 24 - PERQ Utility Programs Manual - FTP 17 Juard in the lower lefthand corner of the back of the PERQ). Once this is done, each machine should be running the FTP progrl 81 You can call FTP with one command line. For example, you can specify FTP POLL ndom reads and writes QUIT to leave the program 3. If you're formatting a floppy, am. Its prompt is an asterisk (*). The transfer may be done with either machine taking the active role; the alternat Floppy prints out news of its progress for a few minutes. When it stops, type Q to exit e scenarios are described below: 1. PERQ #1 takes the active role and PERQ #2 is passive. They'll follow thisFloppy. 4. After you have formatted a new floppy disk, create a new directory for i script: PERQ #2: POLL PERQ #1: PUT SourceFile[ DestinationFile] Both PERQs: #!#!#!#!#!t. If you want to make a PLX floppy, use the ZERO command in PLX. If you want to make a filesyst...#!#! (this appears on the screen as the file is being transferred em floppy, use the Partition program. - 22 - PERQ Utility Programs Man and a "hand" moves from top to bottom to show percentage dual - FloppyDup 17 Jul 81 18. FloppyDup FloppyDup reproduces the contents of one floppy disk on oneone. When the hand reaches the bottom, the transfer is complete.) 2 or more others, using the PERQ hard disk as intermediary. It's self-promp- ting and very time-consuming. Its command line. PERQ #2 has the active role: PERQ #1: POLL PERQ #2: GET DestinationFile[ SourceFile]  is: FLOPPYDUP and it tells you what to do.  Both PERQs: #!#!#!#!...#! (same as above) The passive PERQ must be polling before the active o. X select: 0 = XY[Y], 1 = Constant. W 1 Write: XY[X] := R if W = 1. H 1 Hold: If set, do not all 4 Push (ESTK) 5 Pop (ESTK) 6 CntlRasterOp := (Z) ow IO devices to access memory. Also used with JMP field to modify address inputs. AL 7 SrcRasterOp := (R) 10 DstRasterOp := (R) 11 WidthRasterOp := (R) -code interpreter to evaluate expressions. BPC and the microstate condition codes can be read as the Micro State Register (UU 4 ALU function: 0 A 1 B 2 not A STATE) via AMUX. - 2 - PERQ Mic 3 not B 4 A and B 5 A and not B 6 A and B ro-Programmer's Guide 19 Jul 81 _____ ___________ ______ Micro Instruction Format  7 A or B 10 A or not B 11 A nor B 12 A xor B  8 8 3 1 1 1 4 2 4 8 4 4 +-------+-------+---+-+-+-+-----+--+----+-------+----+----+ | X  13 A xnor B 14 A + B 15 A + B + OldCarry 16  | Y | A |B|W|H| ALU | F| SF | Z |CND | JMP| +-------+-------+---+-+-+-+-----+--+----+-------+----+----+ _____ ___ A - B 17 A - B - OldCarry - 3 - PERQ Micro-Programmer's Guide__ ___ Field Width Use X 8 Address for X port of XY. Also address used to write XY.  19 Jul 81 F 2 Function: Controls usage of SF and Z fields. _ Y 8 Address for Y port of XY. Also low 8 bits of constant. A 3 AMUX Select:  __ ___ _ ___ F SF use Z use 0 Special Func. Constant/Sho 0 SHIFT 1 NextOp 2 IOD 3 MDI Memory Dart Jump 1 Memory Control Short Jump 2 Special Func. Shift Control ta Inputs, AMUX[19..16] := 0 AMUX[15..00] := MD[15..00]  3 Long Jump Long Jump SF 4 Special Function: Upper 4 bits of address for long  4 MDX Memory Data Input extended AMUX[19..16] := MD[03..00] AMUX[15.jump and memory control functions (see F). When used as Special Function: 0 Long Con.00] := 0 5 USTATE 6 XY (RAM) 7 ESTK B 1 BMUstant 1 ShiftOnR 2 StackReset 3 TOS := (R) (Top Of ESTK) / s. - 25 - PERm1, Program2/VERBOSE where Program1.Seg and Program2.Seg are com- piled .Seg files and ProgramO.rQ Utility Programs Manual - Help 17 Jul 81 20. Help The Help command is used to print help aboun is to be the runfile. The VERBOSE switch specifies that the name of each import module is to but other commands and the PERQ operating system. If issued without an argument, it prints the following message: Thie listed. Any number of source files can be listed separated by commas. The switches currently available are: /MAs is the Three Rivers Computer Corporation PERQ. Commands are either a system command name or a run file name. Type "P:name -creates a map file. If you don't specify a name after the colon, the MAP file will ?" for a list of valid system commands. Type "" to run a program. Type "Help " for help on have the same name as the runfile with a .Map extension. /USER -this is th . If you supply an argument, it looks for help for that subsystem. If no help is available, try typing the /HELP e default. It specifies that the program being linked is a user program. The opposwitch to the subsystem. site is /SYSTEM. /VERBOSE -lists the imports of each module as the module is being process - 26 - PERQ Utility Programs Manual - Linker 17 Jul 81 21. Linker The Lied. /SYSTEM -specifies that this is a system program. /VERSION:nn -links the program with the version oon one machine and FTP GET DestinationFile on the other. Control is returned to the command intnker takes compiler-generated .Seg files as its input and produces a runfile with a .Run extension. The runfile is createerpreter Shell after that one command is executed. Sometimes the BitPad and pen can cause problems with file transfers. If d by linking together all of the separately compiled modules that make up a program. The command line takes the form:  you encounter any problems, unplug the pen or move it away from the BitPad. Sometimes FTP transfers will fail. Normally,  LINK[ RunFile=]Source{,Source}{/switch} Examples of valid command lines include LINK Program this will cause the current transfer to abort and FTP will wait for another command (or exit if invoked with a command lin where Program.Seg is the output of a compilation LINK Program1, Program2 where Program1.seg e). If FTP was invoked from a command file, however, it restarts the transfer and repeatedly tries again until it succeedand Program2.seg are compiler output files. The output will be Program1.Run. LINK ProgramO=Progra/  14 Carry - carry out of bit 15 of the ALU 15 Eql - equal to 16  Push Push S:=Addr 5 CallS  Gtr - greater than 17 Geq - greater than or equal to - 4  NIA:=Addr NIA:=S Push Push 6 Vector/Dis- PERQ Micro-Programmer's Guide 19 Jul 81 JMP 4 Jump Control: See AMD 2910 dopatch H = 0 NIA:=Vector NIA:=CIA+1 +ZAddr cumentation for further details. CIA = Current Instruction Address.  H = 1 NIA:=Dispatch NIA:=CIA+1 +ZAddr  NIA = Next Instruction Address. Addr = SF,,Z (Long) or CIA,,Z (Short).  7 GotoS NIA:=Addr NIA:=S 10 RepeatLoop if S 12 LoadOp (OP := MDI) 13 BPC := (R) 14 WCS[15..00] := (R)  ZAddr = Z(UpperBits),,0,,Z(LowerBits). S = internal address register.  15 WCS[31..16] := (R) 16 WCS[47..32] := (R) 17 IOB Function Z  CSTK = top of five level call stack. Push = push CIA+1 onto call stack.  8 Low 8 bits of Jump Address, high 8 bits of Constant, Shift Control (see F), or IOB address. CND  Pop = pop call stack. ____ ____ ____ ____  4 Condition (what to test during conditional jump): 0 True - always jump 1 Code Name Pass Fail 0 JumpZero NIA:=0 NIA:=0  False - never jump 2 IntrPend - interrupts pending 3 unused  1 Call NIA:=Addr NIA:=CIA+1 Push 2 N4 BPC[3] - OP file is empty 5 C19 - no carry out of bit 19 of the ALU 6 Odd - extInst/ReviveVictim H = 0 NIA:=OP NIA:=OP ALU bit 0 7 ByteSign - ALU bit 7 10 Neq - not equal to 11 Leq +ZAddr +ZAddr H = 1 NIA:=Victim NIA:=Victim 3 GoTo  - less than or equal to 12 Lss - less than 13 OverFlow - 16 bit overflow in the ALU NIA:=Addr NIA:=CIA+1 4 PushLoad NIA:=CIA+1 NIA:=CIA+1 0 ridden by using /VERSION:nn switch. A word about versions. Every system has a version number. When yotiates a user's session at a PERQ. It is called automatic- ally when the PERQ is booted or when a user logs off using the BYu create a new system, you also should use a new system version number. You then have to relink all the runfiles. E command. It can also be called explicitly by a user. At boot time, Login asks for the date and time. When it is invoked, This insures that the programs execute correctly with the new system. In order to prevent confusion, we have put the syste it asks for your name and password. It prompts you with the format it wants these in. It can be called explicitly with tm version number into the name of certain critical system runfiles: Link, Shell, Login, and System (e.g. Login.5.run). he command line: LOGIN[ UserName] and will prompt you with the information it wants. Login searches the SystWhen you link a file, it looks up the - 27 - PERQ Utility Programs Manual - Linker em.Users file for the given user-name and the password is checked. The System.Users file is maintained using the UserControl 17 Jul 81 system run file based on the version in use. If no version is specified, it uses the c program (see below). If the user has a profile, it is read to find parameters to set up the PERQ for the user. The validurrent system version (which is displayed at the top of the screen when in the Shell). If a version is specified,  profile entries for Login are: PATH dir Sets the default path to dir. If this aa system run file with that number is used to resolve references to system routines. If the /SYSTEM switch is used, ppears more than once, only the last one has effect. SEARCHLIST dir Pushes dir onto thehowever, no run file is looked for since a new system run file is created. The syntax for creating a system run file is:  search list. This command can be repeated to add additional items to the  LINK SYSTEM.NewNumber=SYSTEM/SYSTEM/VERSION:NewNumber where the /VERSION switch is optional. To create runfiles for search list. The last item listed will be the first looked at. a new system, you link using the VERSION switch after making the system runfile. It's done like this: LINK FileSpecifiCURSORFUNCTION n Sets the default cursor function. Since the cursor function determines f the system specified by "nn". If the run file name ends in a number (e.g., "LOGcation/VERSION:NewNumber IN.42"), then the Linker uses the number as the version number. This can be over - 28 - PERQ Utility Programs Manual - Login 17 Jul 81 22. Login Login ini0 o-Programmer's Guide 19 Jul 81 13 JumpPop NIA:=Addr NIA:=CI constant and a jump address at the same time, or it could be used as an IO address and a jump address at the same time. The A+1 Pop 14 LoadS NIA:=CIA+1 NIA:=CIA+1 assembler, however, will flag an error if the programmer tries to load two different values into the same microinstruction fi S:=Addr S:=Addr 15 Loop NIA:=CSTK NIA:=CIA+1 eld. _________ Constants Constants can be 8 or 16 bits wide. If B = 1, the B input to the ALU is  Pop 16 Next NIA:=CIA+1 NIA:=CIA+1 a constant. If F = 0 or 3 and SF = 0, the Y and Z fields form a 16 bit constant. If SF <> 0 and F <> 0 or 3 then Y is an 8  17 ThreeWayBranch if S <> 0 NIA:=CIA+1 NIA:=CSTK  bit constant. - 6 - PERQ Micro-Programmer's Guide  Pop S:=S-1 S:=S-1 if S = 0 NIA:=CIA+1  19 Jul 81 ________ OldCarry OldCarry (in ALU functions 15 and 17) is the carry from NIA:=Addr Pop Pop The Z field is used for many things: as part  the immediately preceeding microinstruction, it is used for multiple precision arithmetic. _________ _____of a jump address, the upper 8 bits of a constant, Shift Control, and as an IOB address. The F field decodes do not  Condition Codes All ALU related condition codes test the result of the ALU operation from the previous mic <> 0 NIA:=CSTK NIA:=CSTK S:=S-1 S:=S-1 inecessarily enforce restric- tions on the use of the Z field, they merely enable some of them. In particular, B = 1, SF =f S = 0 NIA:=CIA+1 NIA:=CIA+1 Pop Pop 11  0, and F = 0 or 3 selects a long constant using the Z field. When F <> 2, the Z field is used for a jump address. When Repeat if S <> 0 NIA:=Addr NIA:=Addr S:=S-1  SF = 17 and F = 0 or 3, the Z field is used for an IOB address. When F = 2, the Z field is loaded into the Shift Co S:=S-1 if S = 0 NIA:=CIA+1 NIA:=CIA+1 12 Return NIA:=Cntrol register. These are the only specific actions taken by the hardware that affect the usage of the Z field. The hardwSTK NIA:=CIA+1 Pop - 5 - PERQ Micrare does nothing to prevent the Z field from being used for several things at once. For example, it could be used for a long1 Name> Search Sys:Boot>Library> Search Sys:Part3>Alt7> CmdFile ReadMail.cmd h a name. See the PERQ Introductory User Manual for more information on files and directories.  the screen color also, this can be used to set the default screen color.  Cursor 4 Note that the command names in the profile can be abbreviated. Additional documentation for Logi If you like white letters on a black background, use CURSORFUNCTION 5. n can be found in the section "Turning on the PERQ" in the PERQ Introductory User Manual.  The default value is 4. SCREENOFFCOMP off comp Sets the default parameters for  - 30 - PERQ Utility Programs Manual - MakeBoo the screen when the Shell needs to shrink the screen. The values for t 17 Jul 81 23. MakeBoot MakeBoot writes boot files onto hard disk and floppy disk. It is s each parameter are TRUE or FALSE. If off is false, then the part of the elf-prompting. Its command line is: MAKEBOOT[ RunFile] See the section "Booting the Machine" in the PERQ I screen used for data will still be visible. If comp is true then the ntroductory User Manual for more details on booting. The manual How to Make a New System gives complete description of the part of the screen used for data will be inverted with respect to the rest  MakeBoot program.  of the screen. The default value is FALSE FALSE.  - 31 - PERQ Utility Programs Manual - MakeDir 17 Jul 81 24. MakeDir MakeD - 29 - PERQ Utility Programs Manual - Login 17 Jul 81 CMDFILE cmd Execute ir creates a new empty directory. Its command line is: MAKEDIR[ FileSpecification] where FileSpecification isthe command file cmd after login and before accepting commands from the ke the name for the new directory. If you do not specify the name you will be prompted for it. All directories haveyboard. SHELL name Specify an alternate Shell (command interpreter). This is an ai a .Dr extension; MakeDir will provide this automat- ically if you do not specify it. MakeDir will not accept as its parametd to debugging a new Shell. A sample profile for login might be: #Login Path Sys:User>Myer the name ROOT or the name of any extant file that has a .Dr extension; it will print an error message if you pass it suc1  > B All ALU tests with the exception of C19 test the lower 16 bits of the ALU. These are intended for data c________ SF Type Description 16 Fetch Fetch 1 word from Memory. 17 Store Storeomparisons. After a subtraction, these condition codes compare the two operands. After other operations, these condition 1 word into Memory 12 Fetch4 Fetch 4 words (0 mod 4 address) 13 Store4 Store 4 words (0 mod 4 add codes compare the 16-bit ALU result against zero. C19 is designed for unsigned address comparisons. Assuming ress) 10 Fetch4R Fetch 4 words, transport in reverse order 11 Store4R Store 4 words, transport in rethat A and B are registers containing 20-bit addresses and T is a temporary register, the following code fragments show how verse order 14 Fetch2 Fetch 2 words (0 mod 2 address) 15 Store2 Store 2 words (0 mod 2 address) to compare A and B. A - 1; if C19 Goto(Label); ! Jumps if A = 0, doesn't jump if A <> 0 T := A; T In the following discussion of the memory controller, the terms "Fetch" and "Store" are used for the memory functions whi := T - B; T - 1; if C19 Goto(Label); ! Jumps if A = B, doesn't jump if A <> B A - B; if C19 Goto(Lach fetch or store exactly one word. The generic terms "fetch type" and "store type" are used for any type of fetching or stbel); ! Jumps if A < B, doesn't jump if A >= B B - A; if C19 Goto(Label); ! Jumps if A > B, doesn't jump if A oring memory reference. The address for all memory references comes from R. For all fetch type references, the <= B - 7 - PERQ Micro-Programmer's Guide address (and the request itself) are latched at t3 and data is available from MDI or MDX (A = 3 or 4) at t2. If MDI or MDX 19 Jul 81 ______ _______ Memory Control The memory system cycles in 680 ns (exactly 4 microcyc is used during a t0 or t1 following a fetch type memory reference, the processor is suspended until t2. Any address males). Microcycles are numbered starting at 0 (t0, t1, t2 and t3). Requests must be made in a particular cycle (whichy be used with a Fetch, and the memory word may be read during any cycle from t2 until the following t1. The address cycle depends on the type of request). If a memory request is made in the wrong cycle, the processor will be suspended for a Fetch2 must be even (double-word aligned). If it is odd, the low-order bit of the address is ignored. After a Fetchro cycle. Thus the normal sequence is to perform an ALU operation and test its result in the next microinstruction. F until the correct cycle. In some contexts, however, a request made in an improper cycle will be ignored--these contexts aor example, comparison of two registers A and B could be done this way: A - B; if Gtr Goto(Label); ! Jumps if Are explained below. There are 8 types of memory references, coded into the SF field when F = 1. __ ____ ___2  4. It's a bad idea to dismount the device you're running from. If you do, the system will not be able to find the ility Programs Manual - Patch 17 Jul 81 28. Patch Patch allows you to examine and modify the Shell. - 33 - PERQ Utility Programs  contents of a disk file. To run it, type: PATCH The program identifies itself and asks you what file you Manual - ODTPRQ 17 Jul 81 26. ODTPRQ ODTPRQ is a simple debugger for microcode and new opera want to look at. Type the name of the file. It prompts with: Patch Version# File: filename Last Bloting systems. ODTPRQ runs on a PERQ other than the one that is being debugged. It communicates through a Link board that isck: 5. Current Block: 0. Type "Help" for help Read Block [0]? Type return to look at the block number in brackets o - 32 - PERQ Utility Programs Manual - M plugged into the I/O option slot in the card cage. ODTPRQ has an online help facility. The ODTPRQ command line is: ount 17 Jul 81 25. Mount The Mount command is used to attach devices to the filesystem. ODTPRQ[ StateFileName] where StateFileName is the name of a State File.  Devices must be mounted before files on them can be accessed by the fileSystem. The two mount commands are: MOUNT  - 34 - PERQ Utility Programs Manual - ParHARDDISK and MOUNT FLOPPY Note that these are the forms to use no matter what the name devices were given when ptition 17 Jul 81 27. Partition Partition creates new partitions on a device (such as hard disk artitioned. The device that was booted from is mounted automatically by the system. _____ __ _____ ___ _________ Notes or floppy). It can also be used to modify the names and sizes of existing partitions. Creating a new partition destroyon Mount and Dismount: __________ 1. It is imperative that you dismount FileSystem (as opps all old data in the area where the partition is made. The device should first be formatted before using Partition. After osed to PLX) floppies before you remove them from the floppy drive. If you fail to do this, the next floppy put iformatting, Partition is the first program to run. Its command line is: PARTITION The program is self-prnto the drive may be overwritten and the fileSystem floppy is also likely to be corrupted. 2. Floppies wrompting. Refer to "Partitions and the Partition Program" in PERQ File System Utilities Manual before using it. itten with the PLX program cannot be mounted or dismounted. 3. A device may be mounted more than once.  - 35 - PERQ Ut2  MA := Addr, Fetch; (t3) ... (t0) ...  MDO := Data2; (t2) MDO := Data3; (t3) 2, the first word must be read at t2, and the second word must be read at t3. The address for a Fetch4 must be quad-wo (t1) Data := MDI; (t2) Fetch2: MA := Addr, Fetch2; (t3) rd aligned. If it is not quad-word aligned, the two low-order bits are ignored. After the Fetch4, the first word must b ... (t0) ... (t1) De read at t2, and the succeeding words must be read at t3, t0, and t1. Any address may be used with a Store. Theata0 := MDI; (t2) Data1 := MDI; (t3) Fetch4: MA := Addr, Fetch4; address and Store command are given in a t2 cycle and the data to be written is supplied on R in the following t3.  (t3) ... (t0) ... (t1)  The address for a Store2 must be even (double-word aligned). If it is odd, the low-order bit of the address is igno Data0 := MDI; (t2) Data1 := MDI; (t3) Data2red. The address and Store2 are given in a t3 cycle, and the data is supplied on R in the following t0 and t1.  := MDI; (t0) Data3 := MDI; (t1) Fetch4R: MA := Addr, Fetch4R;  - 8 - PERQ Micro-Programmer's Guide 19 Jul 81 The addre (t3) ... (t0) ... (t1) ss for a Store4 must be quad-word aligned. If it is not quad-word aligned, the two low-order bits are ignored. The ad Data3 := MDI; (t2) Data2 := MDI; (t3) Data1 := dress and Store4 are given in a t3 cycle, and the data is supplied in the next four cycles (t0, t1, t2 and t3). The FeMDI; (t0) Data0 := MDI; (t1) Store: MA := Addr, Store; (t2tch4R and Store4R types are identical to the Fetch4 and Store4 references except that word 3 of the quad word is received or ) MDO := Data; (t3) Store2: MA := Addr, Store2; (t3) sent first and word 0 last. (This is generally only useful for RasterOp so that it can do left to right as well as right MDO := Data0; (t0) MDO := Data1; (t1) Store4: MA := Add to left transfers.) Here are examples of each type of reference and how they are coded: Fetch: r, Store4; (t3) MDO := Data0; (t0) MDO := Data1; (t1) 3  SetSearch below). New files are created in this directory if a different one is not specified. The Path command changtation for each PERQ operating system is a file called PERQ.Files which describes all the files in the system and states whes the current directory. The command line is: PATH[ DirectoryName] Path does not affect the search list. If Pich part of the system they are in. The PERQ.Files program is used to list portions of the PERQ.Files text file and to makath is called without an argument, it prints the current path. A new path can then be typed or Carriage Return to exit withe command files. Run the program by typing: PERQ.Files and type "Help" when you are prompted. The progout changing the path. The final ">" of a directory name is optional for the path command so "Path Foo" changes the path toram types out a comprehensive description on how to use the program.  the directory foo.Dr. Path will print an error message if you try to Path to a nonexistant directory. If you attempt - 39 - PERQ Utility Programs Manual - PLX  to set a Path from which the Shell cannot be accessed (which can happen if you change the SearchList), Path requires confir 17 Jul 81 32. PLX PLX reads and writes RT-11 format floppy disks. It is useful for transferring files betma- tion. - 37 - ween the hard disk and floppy. The command line is: PLX[ command] The program prompts with PLX> . You may r type a new block number. You can also type HELP for some online documentation that describes the commands you can use.  PERQ Utility Programs Manual - Pause 17 Jul 81 30. Pause Pause can be used to suspend the ex When you ask to read a block, Patch displays it byte by byte on your screen in a 32-row, 16-column array. You can refereecution of a command file and wait for user confirmation before proceeding. It takes a message as a parameter, prints it nce each byte with the indices 0 to 511. Patch permits you to make temporary or permanent changes to your file. on the screen, and then waits for a carriage return on the keyboard before continuing. This command can be given by the user - 36 - PERQ Utility Programs Man, but it is most useful in command files when some user action is required before proceeding, e.g., changing floppies. ual - Path 17 Jul 81 29. Path Your "path" is the directory you are currently using. To find - 38  named files, the system will first look in this directory and then in directories specified in your search list. (See- PERQ Utility Programs Manual - PERQ.Files 17 Jul 81 31. PERQ.Files Part of the documen3 ype reference until you have taken all the data. 2) Never start a memory reference during the four instructions ollowing t1 (four full cycles). For Fetch2, Fetch4, and Fetch4R, each MDI is valid for a single microcycle.  which follow a store type request. The full rules are complicated, but to achieve high-performance you need to con Following these rules, we can construct many interesting overlapped memory requests. Note that in the following esider them. The following rules define the way the memory controller treats memory requests. 1) After a Fetch or Fetchxamples, Hold is always asserted in a t2. A Fetch ... Store sequence is an exception--you need not use Hold, but it doesn2 (in t3), any memory reference in t0 or t1 is ignored. A Store specified in the t3 will start immediately't hurt performance, so we assert it for consistency. Indirect fetches: MA := Addr, Fetch; (t3)  - 9 - PERQ Micro-Programmer's Guide 19 Jul 81 Store4R: , but all others will abort until the correct time. 2) Fetch4 and Fetch4R follow the rules for Fetch and Fetch2 with  MA := Addr, Store4R; (t3) MDO := Data3; (t0) MDO := Data2;  the exception that a Store4 (in the same direction--forward or reverse) can be specified in t1, but this is only u (t1) MDO := Data1; (t2) MDO := Data0; (t3) sed for RasterOp. 3) After a Store (in t2), any memory reference in t3 or t0 is ignored. References sta The IO system can request memory cycles at any time. The memory system gives priority to the IO system so that rted in t1 are aborted until the correct cycle. 4) After a Store2, Store4 or Store4R (in t3), any memory referenif both the processor and the IO system make memory requests, the IO is served first while the processor is delayed. The ce in t0 through t3 is ignored. Memory references started in t0 are aborted until the correct cycle. 5) To Hold bit, if set, locks out IO requests while it is set. To be effective, Hold must be asserted in a t2. This is nbe effective, Hold must be asserted in a t2. You must be careful about aborts caused by using MDI in the wrong cycle-ecessary only when doing overlapped memory references. See the high performance rules below. Combinations of memory re- you may be aborted past the t2, causing the Hold to be ignored. You may not specify Hold too often--you musferences are tricky. There are a few rules which, if followed, will never let you go wrong, but they may preclude some clevt allow an IO reference at least once in every 3 memory cycles. - 10 - PEer twist of microcoding to save some cycles. The simple rules are: 1) Never start a memory reference after a fetch tRQ Micro-Programmer's Guide 19 Jul 81 6) After a Fetch, MDI is valid from t2 through the f4  from the tablet while using PLX. Some PLX commands require confirmation. This confirmation comes from the keyboard evted once it starts. DATE: Allows the user to specify the current date or see the date PLX en if a command file is in use. If you use the FAST command, (see below) no confirmation is required. While PLX is processiis using. DELETE: Deletes a file on the floppy. Wildcards are allowed. DIRECTORYng a file, a "hand" cursor moves down the right margin of the screen. When it has reached the bottom, your transfer is comple: The directory command takes zero, one, or two arguments. If there are no arguments, te. (for small files, the marker does not go all the way to the bottom). PLX's wild card handling is much more restrictiv then all the files on the floppy are listed. If there is one argument, then e than the operating system's. It can only handle wild cards for the DELETE and DIRECTORY commands (see below).  only the files on the floppy that match that pattern are listed. If there is a  In addition, the only wild card available is "*" and it can only be used by itself in either the name or extension part o second argument, then the listing is sent to a disk file with that name and nothing f a file (or both). - 40 - PERQ Utility Program is displayed on the screen. "DIRECTORY/L" (Long), the default, prints the full list- s Manual - PLX 17 Jul 81 Current PLX commands are: COMPRESS: This moves files s ing, and "DIRECTORY/S" (Short) prints only the file names. FAST: Turns ofo that all the unused blocks are at the end of the floppy. COMPRESS has a switf requests for confirmation for all subsequent commands. This is only a good idea ich which turns on or off verification. The default is VERIFY; if this is on, COMPn command files. GET: Transfers a floppy file to the disk. If the file on the disk aspecify a command while calling PLX. An example of this would be: PLX GET FileSpecification One command mRESS checks every transfer to assure there are no errors. To use Compress in veay go on the command line. After the command has been executed control returns to Shell. Typing "Help" displays some onlirify mode, type "Compress/v" or "Compress". For no verify, use "Com- press/nov". ne documentation describing the commands that can be used. It is a good idea to have the BitPad pen unplugged or well away ____ NOTE: This command takes a long time and cannot be interrup4 ction or Nop; (t1) must be explicit instruction, Hold; (t2) MA := MDI, Fetch;  MA := MDI, Store, Hold; (t2, t3) any except Store MDO := Data; (t0) ...  (t3) any type of fetch ... Data := MDI; (t2) ... Again Hold is asserted in t2 so that IO requests do not pre-empt the processor. The instruction "MA := MDI, S, Hold is asserted in t2. Note that this differs from the previous example in that the Hold and Fetch tore, Hold;" first tries to execute in t2, but is aborted until t3 because it contains a store. The M are not done in the same instruction. These two examples show that for indirect fetches, the two fetches DI is still valid because MDI is valid from t2 to the following t1 after a Fetch. MA := Admay be separated by two or three other instructions. Indirect stores: MA := Addr, Fetch; dr, Fetch; (t3) instruction or Nop; (t0) must be explicit instruction or Nop; (t3) instruction or Nop; (t0) must be explicit instruction or Nop; (t1) must be expl (t1) must be explicit instruction, Hold; (t2) MA := MDI, Store; (t3) any tyicit MA := MDI, Store, Hold; (t2) MDO := Data; (t3) In this case, the pe except Store MDO := Data; (t0) ... Again, Hold is asserted in t2. Note instruction or Nop; (t0) must be explicit instruction or Nop; (t1) must be explicit MDI, the Store, and the Hold all execute in t2. - 11 - PERQ Micro- MA := MDI, Fetch, Hold; (t2, t3) any type of fetch ... Data := MDI; (t2) Programmer's Guide 19 Jul 81 MA := Addr, Fetch2; (t3) instruction ... Hold is asserted in t2 so that IO requests do not pre-empt the processor. The instruc or Nop; (t0) must be explicit instruction or Nop; (t1) must be explicit MA := MDI, tion "MA := MDI, Fetch, Hold;" first tries to execute in t2, but is aborted until t3 because it cStore, Hold; (t2) MDO := MDI; (t3) In this case, the first fetched word is used ontains a fetch. The MDI is still valid because MDI is valid from t2 to the following t1 after a Fetch. as an address, and the second is used as data to be stored. MA := Addr, Fetch; (t3)  MA := Addr, Fetch; (t3) instruction or Nop; (t0) must be explicit instru instruction or Nop; (t0) must be explicit instruction or Nop; (t1) must be explicit 5 lready exists, GET requests confirmation before overwriting it (if you are not i VERIFY: This command takes a disk file and a floppy file (in that order) and ensures that n FAST mode). Like COMPRESS, GET takes the VERIFY and NOVERIFY switches. Default all bytes are identical. It prints a message for every block that contains a differis VERIFY. HELP: Provides some online documentation. PUT: Transfers a file from the disk ence. ZERO: This destroys the current contents of the floppy and creates a new direct to the floppy. PUT requires confirmation before overwriting an existing file, andory. Use this after formatting a floppy (which is done using the Floppy program) a takes the VERIFY and NOVERIFY switches like GET. QUIT: Exits PLX. nd whenever the current contents of a floppy are to be destroyed. This command ask - 41 - PERQ Utility Programs Manual - PLX 17 Jul 81 RENAME: Chas whether the directory should use both sides or just one (it asks even if SIDES has nges the name of a floppy file. There is no checking to make sure that a file wpreviously been used). NOTE: ZEROING A FLOPPY WILL DESTROY ITS CURRENT CONTENTS. ith the same name does not already exist; therefore it is possible to have two dif-  - 42 - PERQ Utility Programs Manual - Print  ferent files with the same name. It is recommended that you avoid this situation. SAFE:  17 Jul 81 33. Print Print prints files to a GPIB printer. Its command line is:  (The default--Opposite of FAST). This as- sures that confirmation be required on  PRINT[ FileSpecification] If the FileSpecification is omitted, you will be prompted for one.  subsequent commands. Even if a command file is in use, confirmation still comes  - 43 - PERQ Utility from the keyboard. SIDES: Tells PLX how many sides the floppy has. TYPE: Types a floppy Programs Manual - PRQMic 17 Jul 81 34.PRQMic PRQMic is the PERQ microcode assembler. I file on the screen. The "hand" cursor tells how much of file has been typed. t takes a microcode source program (whose extension is .MICRO), and produces output that can be used as input to the mi5  or Nop; (t0) must be explicit instruction or Nop; (t1) must be explicit MA := Addr2ial function LoadOp must be executed in the t1 after the Fetch4 to cause the Op file to be loaded with the data coming on MDI., Store, Hold; (t2) MDO := MDI; (t3) A word is copied from one memory locatio Refill must then jump back to the instruction which needed the byte so that instruction may be re-executed. The in to another. Unfortunately, two or four word copies are not possible because the times when data musnstruction which executes NextOp must be capable of being executed twice (once when BPC overflowed and again when it t be read and written are different for the fetches and stores. is re-executed after Refill). This precludes instructions such as "R := NextOp + R". In order for Refill to get b- 12 - PERQ Micro-Programmer's Guide 19 Jul 81 _______ ___ ________ Opcodes anack to the instruction which needs to be re-executed, the address of the failed NextOp is saved in a hardware register (Vicd operands The OP file contains a 4-word sequence of instruction bytes. A quad-word address is contained in a XY registim) if NextOp is executed when BCP[3] is set. The last instruction in Refill is coded with ReviveVictim (JMP=2, H=1), whicter (UPC), and the 8 bytes pointed to by UPC are loaded into the OP file. The lower 3 bits of the byte address (byte wh sends control back to the "failed" NextOp. BPC can be set without re-loading the OP file, and so the current quithin the quad word) are kept in BPC, a hardware register. BPC addresses the OP file to choose a byte. BPC is actualad word can be re-read without fetching it from memory a second time. The NextInst jump enables a byte of the Oly a 4-bit counter. It is incremented after each a byte is taken out of the OP file by NextInst (JMP=6, H=0) or NextOp (P file (which is inverted for NextInst) into the Addr input of the micro-sequencer. The inverted byte is shifted left by A=1). The 4th bit of BPC (BPC[3]), which is the "overflow" of the counter, is testable via a jump condition and indicates th2 bits and OR-ed with ZAddr, sending control to address ZAddr + (OP' * 4). If BPC[3] is true, OP is forced to 377, sen that this differs from the previous example in that the Hold and Store are not done in the same at all bytes in OP have been used. The NextOp function (A=1) gets the next byte out of the instruction byte instruction. These two examples show that for indirect stores, the Fetch and the Store may be separastream for use as an operand. The assembler automatically adds an "If BPC[3] GoTo(Refill)" jump clause. If BPC overfloted by two or three other instructions. Copy operations: MA := Addr1, Fetch; (t3) instructionws, then control will go to Refill which increments UPC by 4, set BPC to 0, and starts a Fetch4 to the OP file. The spec6  file must have been compiled.) You needn't specify .Seg but must specify extension if it is anything else. In this case, Rename finds all files in the directory which match the source pattern. For these files, the part of  3. Next, you are prompted for an output file. The default is CONSOLE: . 4. QDis displays a list othe source file name that matched each wild card is used to replace the corresponding wild card in the destination. As anf the program's routines and the following information about each: Routine number  example, for the command: RENAME foo*.abc# anotherdir>*baz.rmn#z The input file "FOOZAP.ABCD" would be rcroplacer, PRQPlace. The PERQ Microprogrammers Guide has details on how to write microprograms and how to use PRQMic.  Lexical level Parameter size Result + Parameter size Local + Temporary siz - 4e Entry address Exit address 5. QDis next will ask you which routine you'd like to4 - PERQ Utility Programs Manual - PRQPlace 17 Jul 81 35.PRQPlace PRQPlace is the PERQ micr see disassembled. Type in a routine number; the program then types a listing of that routine's ocode placer. It takes the output from the microassembler, PRQMic, and produces a file (with extension .BIN) that can be l Q-code translation. Step 5 can be repeated indefinitely. oaded into the PERQ microstore. The PERQ Microprogram- mers Guide has details on the use of PRQPlace.  - 46 - PERQ Utility Programs Manual - Rename 17 Jul 81 37. Rename Typing the  - 45 - PERQ Ucommand line: RENAME SourceFile DestinationFile will change the name of SourceFile to DestinationFile. You tility Programs Manual - QDis 17 Jul 81 36. QDis QDis is a disassembler for Q-Code. It decare allowed to rename a file from one directory to another (move the file) as long as both directories are in the same parodes a .Seg file into Q-code. The command line: QDIS causes the following sequence: 1. The ptition. You may rename a .Run file, but if you rename a .Seg file you must re-link the programs which use it. The sourcrogram identifies itself as QCode Disassembler. 2. You are then prompted for an input file. Type the name e file for Rename can have wild cards in it (for a description of the wild cards, see the "PERQ Introductory Use of the program or module you want disassembled. (Since the input to QDis is a .Seg file, the input r Manual"). If the source has wild cards in it, the destination must then have the same wild cards in the same order. 6 ding control to location ZAddr, which is another version of Refill. This version of Refill also does the Fetch4 to the OPield starting at bit 0-2 0-1,16 15 bit field starting at bit 0-1 0-17,17 Left shift 0-15  file, zeroes BPC, increments UPC by 4, and does the LoadOp, but then repeats the NextInst instead of returning via Revi 10-17,16 Rotate Right 8-15 10-17,15 Rotate Right 0-7 0-17,17-0 RightShift 0veVictim. To speed up the execution of Refill, the LoadOp Special Function loads all 4 words via hardware. The-15 The item to be shifted is placed on R, and the shifted and masked result can be read via SHIFT (A = 0) on the next i LoadOp should be given in the tl following the Fetch4. The instruction which follows the LoadOp can go back to the NextInsnstruction. The shift control logic keeps the last value loaded so that the shifter can shift a succession of words witht/NextOp since the first byte is quaranteed to be in. The three remaining words arrive and are placed in OP by hardwout respecifying the shift control function. The shift outputs always have the shifted value of what was last on R. are without further microcode assistance. If BPC is set to a non-zero value (to start reading in the middle of the quad  ________ ShiftOnR The ShiftOnR special function allows a shift function to be a variable. The shift cword), the Refill code must wait until the correct byte is in the OP file. - 13 - ontrol is obtained from the R bus and thus can be a data item. The usage sequence is: 1) Put the shift control (univerted PERQ Micro-Programmer's Guide 19 Jul 81 _____ _______ Shift Control The PE) on R and execute ShiftOnR, 2) Put the item to be shifted on R, and 3) Read the shifted result on SHIFT. ____RQ shifter can rotate a 16 bit item 0 to 15 places and apply a mask to the shifter outputs. To use the shift hardware, the ______ _____ Expression Stack The expression stack is used to evaluate expressions. Items are pushed on theZ field of the instruction can be coded with the type of shift to be done with the F field set to F = 2. Coding of the shif stack by placing them on R and using the Push special function: "TOS := Data, Push". Items can be popped off the stack wt control uses two 4 bit nibbles (shift control is inverted in the Z field): _____ _______ _____ Shift ith the Pop special function. The top of the stack can be written without pushing or popping with the "TOS := Data" speciControl Shift 0-17,0 1 bit field starting at bit 0-15 0-16,1 2 bit field starting al function. The value on the top of the stack can be read at any time from TOS (A = 7). The stack is 16 levels deep. The at bit 0-14 0-15,2 3 bit field starting at bit 0-13 ... 0-2,15 14 bit fstack can be reset (no items on the stack) by the StackReset special function. Stack empty can be read as a bit in USTATE7  - 47 - PERQ Utility Programs Manual - Run 17 Jul 81 you answer "Yes", then you can see the data or code that is stored in the screen area. The memory manager is told that the m 38. Run Run is simply a way to invoke the default file remembered by the Shell. If you have been editing, compilemory is free, but the IO package still thinks it should be displayed. The screen package will not let you create a winding and linking the default file, simply typing: RUN executes that default file. It you type: ow or write into that area (unless a program calls RasterOp or Line directly). The default for this parameter is TRUE unle RUN program arg1 arg2 that is identical to invoking the program the normal way: program arg1 arg2 except tss an entry in the user profile has changed it (see Login above). The final parameter requested by ScreenSize is "Complemehat the program name is now remembered as the default file name. nted." This only affects the part of the screen that is released. If complemen- ted is true, the area is set to the opposi - 48 - PERQ Utility Programs Manual - ScreenSize 17 Jul te color from the usable part of the screen. If complemented is false, it is set to be the same color. This is true whetenamed into a new file named "anotherdir>ZAPbaz.rmnDz". If wild cards are used, Rename asks for verification of each file81 39. ScreenSize The display on the PERQ screen is stored in memory and requires 48K words (192 blocks). Someti renamed. This can be disabled with the switch "/NOVERIFY" or enabled with the switch "/VERIFY." The default is enablemes it is advisable to give up some of the screen and allow this memory to be used for storing data or programs. For d. Wild cards are not allowed in the directory part of the source file. If the the destination file already exists, Renamexample, the Scavenger runs with swapping off so it shrinks the screen to allow its data and code to fit into memory. Evee requests confir- mation before deleting. This can be disabled by using the switch "/FAST" or enabled using the switn when swapping is enabled, some programs, such as the compiler, want to trade speed for screen size. The ScreenSize commach "/SAFE". /FAST also sets /NOVERIFY. If an error is discovered and wild cards were used, Rename asks the user whetnd prompts for the number of scan lines used in the display for the next program run. The screen expands to full size afther to continue processing the rest of the files that match the input. This confirmation is required no matter what switches er that program has completed. The full screen has 1024 lines in it. The number you supply must be greater than zero, leswere specified. A final switch is "/HELP" which describes the function of Rename and the various switches. s than or equal to 1024, and a multiple of 128 (e.g. 128, 512, 768, etc.). ScreenSize next prompts for "Screen On." If 7 and SF). Other sources for jump addresses are: 1) The S register (which is internal to the micro-sequencer), 2) A five leor to serve IO devices. There are (a maximum of) 8 interrupt requests which are assigned priorities by the hardware. vel call stack (also internal to the micro-sequencer) which is pushed for a Call and popped for a Return, 3) The current When any of the interrupt requests is asserted, the branch condition IntrPend will succeed. The intended usage of this  instruction address plus 1, and 4) The Victim register. There are three jumps which are multi-way branches. The thre feature is that at convenient places in the microcode an instruction which has "If IntrPend Call(VecSrv)" is used. If any int. - 14 - PERQ Micro-Programmer's Guide 19 Jul 81 e are: 1) NextInst, which is a 256-way branch based on a byte from the OP file; 2) Dispatch, which is a 16 way (or fewer)  ____________ ___ Input/Output Bus IOB is the input/output bus for PERQ. The IOB is a 16-bit bi-directbranch on the lower 4 bits of the SHIFT outputs; and 3) Vector, which branches to 1 of 8 micro-interrupt service routines. Fional data bus plus a 7-bit address bus. The addresses are supplied on the Z Field. The eighth bit of the Z field indicateor all of these branches, the Z field of the micro-instruction supplies the other bits of the address. For NextInst, the ress the direction of transfer (1=write, 0=read). To read an IO register, set SF = 1 and F = 0 or 3. The IO register iulting address is: O O O O O O O O Z Z P P P P P P P P Z Z 7 6 7 6 5 4 3 2 1 0 1 0 which ress latched in the processor such that a succeeding microinstruction can read it from IOD (A = 2). IO registers can be writults is a 256 way branch with a spacing of 4 instructions. For Dispatch, the address is: Z Z Z Z Z Z S S S S Z Z ten by putting a data value on R, putting the appropriate address in Z, and coding the IOB special function (SF = 1, F = 0 7 6 5 4 3 2 3 2 1 0 1 0 which also results in a spacing of 4 instructions. The Vector jump uses the outputs of th or 3). _____ Jumps A jump needing an address normally gets it from the Z field. Since Z is onle micro-interrupt priority encoder (V), which determines the highest priority micro-interrupt condition. The address isy 8 bits wide and the control store is 4K, another 4 bits of address are needed. Short jumps branch to a location on the same: - 15 - PERQ Micro-Programmer's Guide 19 Jul 81  256-word page as the current microinstruction (CIA). To go to an arbitrary location, the F field can specify long jump ( Z Z Z Z Z Z - V V V Z Z 7 6 5 4 3 2 0 2 1 0 1 0 which also has a spacing of four instructions. F = 3) which uses the SF field for the upper 4 bits of address. The address for jumps might not come from the Z ( __________ Interrupts The hardware implements a microlevel interrupt which is used to allow the microprocess8  The Scavenger checks the filesystem's structures and fixes any errors found. It can be called any time you suspect tics about the performance of the swapper. This information is printed out if statistics are turned on using "STATISTI a filesystem problem or whenever you need to reconstruct a directory. It is self-prompting. Its command line is: CS +". After each program is executed, the Shell prints the Statistics for that program in the following format: Load SCAVENGE For more details on this program, see the section "Scavenger Program" in the PERQ File System  1.6 secs. Exec 3.6 secs. IO 0.8 secs. Swap 0.1 secs. Move 0.0 secs. Duty Utilities Manual.  97.2 percent. Load is the time spent loading the program and its modules into memory. Exec is the total time spent ex - 50 - PERQ Utility Programs Manual - SetSearch 17 Jul 81 41. SetSearch SetSearch ecuting including IO, Swap and Move times. IO is the time spent doing Unit-level IO not including IO time spent swap allows you to add and remove paths to search lists and to change their order. Its command line is: SETSEARCH{ coping. Swap is the amount of time spent swapping. Move is the amount of time spent moving segments from one place in memory mmand} If no command is specified you'll be prompted for one. If the command is a file name, SetSearch pushes that name oto another to try to find room for new allocation. Duty factor is the proportion of time spent in actual work. It is compnto the search list; if it is a hyphen (-), the first item on the list is popped off. The current search list is 5 itemuted in the following way: 100 * (Exec - Swap - Move) / Exec s deep with the first and last slots reserved. SetSearch gives you a warning if you attempt to push something onto t - 52 - PERQ Utility Programs Manual - Swap 17 Jul 81 43. her the area is visible or not. The default for this parameter is FALSE unless an entry in the user profile has changed he first slot or pop something off the last. In addition, when you try to exit, SetSearch checks to make sure that the it (see Login above). The Shell shrinks the screen automatically for certain programs. If you explicitly call ScreenSize beShell can be found with the new search list and path. If not, you are asked for confirmation before exiting. fore these programs are run, then the Shell will not override your settings.  - 51 - PERQ Utility Programs M - 49 - PERQ Utility Programs Manual - Scavenger 17 Jul 81 40. Scavenger anual - Statistics 17 Jul 81 42. Statistics The operating system is constantly collecting statis8  of bit 15) V Overflow (ALU overflow occured) SE ESTK Empty (inverted data -- 0 = empty) BMUX 19= 'Define' '(' name ',' constant ')' | 'Constant' '(' name ',' constant ')' | 'Opcode' '(' con:16 Upper 4 Bits of BMUX, used to read bits 19:16 a register (inverted data). Do it this way: stant ')' | 'Loc' '(' constant ')' | 'Binary' | 'Octal' | 'D not UState(Register), Field(14,4); Result := Shift; ! Result[3:0] := Recimal' | 'Nop' | 'Case' '(' constant ',' constant ')' | 'Place' '(' constantegister[19:16] - 16 - PERQ Micro-Programmer's Guide  ',' constant ')' . PascalStyleConstant = name '=' constant . - 17 -  19 Jul 81 ______ __ ______________ Syntax of Micro-Programs This describes the syntax of Perq PERQ Micro-Programmer's Guide 19 Jul 81 Result = register | SpecialResult .  micro-programs recognized by the PrqMic assembler. The syntax is described with a meta-language called EBNF (extended BNF) SpecialResult = 'TOS' | 'MA' | 'MDO' | 'BPC' | 'SrcRasterOp' | 'DstRasterOp' errupts are pending, control will pass to VecSrv which should contain a Vector jump to send control to ZAddr + Vector*4 in t. The following meta-symbols are used. ' ' - surround literal text. | - separate he control store. The address of the interrupted instruction is on the call stack, and the interrupt microcode can serve thealternatives. [ ] - surround optional parts. { } - surround parts which may be repeate device and return like a subrou- tine would. ______ USTATE The USTATE register contains variousd zero or more times. ( ) - are used for grouping. . - en interesting items packed in a single word. The USTATE register (A=5) looks like: 19 16 15 12 11 9 ds a description. name = letter {letter | digit} . number = ['2#' | '8#' | '10#' | '#' ] digit {digit} . consta8 7 6 5 4 3 0 +-----------+-----------+--------+--+--+--+--+--+-----------+ | 0 | BMUX 19:16| nt = name | number . register = name . label = name . empty = . MicroProgram = {Insunused |SE| N| C| Z| V| BPC | +-----------+-----------+--------+--+--+--+--+--+-----------+ BPC Byte Ptruction ';'} 'end' ';' . Instruction = {label ':'} Field {',' Field} . Field = empty | Pseudo rogram Counter N Negative (ALU result < 0) Z Zero (ALU result = 0) C Carry (ALU carry out | PascalStyleConstant | {Result ':='} ALU | Jump | Special . Pseudo 9 f, and swaps all active segments into memory. "SWAP +" turns swapping on. In this case, you may specify a partition to usly necessary to type FOO. The extensions that type knows about, in order tried, are: Pas, Micro, Cmd, Dfs, and Doc. If e for the swap files. For example, SWAP + Sys:Boot> enables swapping to the Sys:Boot> partition. When booting from no filename is supplied on the command line, TypeFile will display the default file name. This is the same default file the hard disk, swapping is initially enabled in the partition containing the boot file. If you simply specify SWAP + with no used by the Editor, Linker, Run, etc. Unlike these programs, however, TypeFile does not change the default file name.  partition name, this default partition is used. When booting from the floppy, swapping is initially disabled. We disc - 54 - PERQ Utility Programs ourage swapping to a floppy disk because floppies have a small capacity, are slow, and may be dismounted at any time. Manual - UserControl 17 Jul 81 45. UserControl UserControl is used to maintain the System.Users fil - 53 - PERQ Ue which contains information about valid users and their passwords, group identi- fiers, and user profiles. This informattility Programs Manual - TypeFile 17 Jul 81 44. TypeFile Type displays any file on the console. Tion is used by the Login program (see above). The System.Users file must be in the root directory (top level) of thehe command line: TYPEFILE FileSpecification displays the file on the console. It moves very quickly, but y partition where the boot file is. Its command line takes the form: USERCONTROL It has the following valid coou can type ^S to stop it and ^Q to start it from time to time. If you want to read a file more slowly, use the Editor programmands: HELP provides online documentation. ADDUSER adds a user to the user file. CHm (see above). The TypeFile command waits when it finds a formfeed character (^L) in the file so that the user can read thECKUSER checks a password for validity. NEWFILE creates a new System.Users file. LISTUSERS types a lie page before the screen is erased and the next page is displayed. To continue, type ^Q. This waiting can be disabled by ust of all of the valid users. REMOVEUSER Delete a user from the file. QUIT exits the program. sing the /NOWAIT switch. The /WAIT switch, which is the default, causes the waiting to happen. The final switch ava - 55 - Contents and Qui Swap The Swap command enables or disables the virtual memory system. The command "SWAP -" turns virtual memory ofilable is /HELP. TypeFile does extension completion on the file name specified. If the file to print is FOO.PAS, it is on9  Op = 'and' | 'or' | 'xor' | 'nand' | 'nor' | 'xnor' . Jump = [Test] Goto ['(' Addr ') _____ __ ___ ______ Notes on the Syntax 1) Programs are typed in free format. That is, a single micro- i'] . Test = 'If' Condition . Condition = 'True' | 'False' | 'BPC[3]' nstruction may extend to as many lines as desired. Blank lines and lines consisting only of comments may be inserted any | 'C19' | 'IntrPend' | 'Odd' | 'ByteSign' | 'Eql' | 'Neq' | where. The exception to this rule is that a new micro-instruction begins with a new line, i.e. you may not plac'Gtr' | 'Geq' | 'Lss' | 'Leq' | 'Carry' | 'OverFlow' . Goto = 'Goto' | 'Call' | e more than one instruction per line. 2) Names may be any length, but only 10 characters are significant when tw'Return' | 'Next' | 'JumpZero' | 'LoadS' | 'GotoS' | 'CallS' | 'NextInst' | 'ReviveVico names are compared. 3) Comments may be indicated by an exclamation mark: '!'. The remainder of the line followitim' | 'PushLoad' | 'Vector' | 'Dispatch' | 'RepeatLoop' | 'Repeat' | 'JumpPop' | 'Loong the exclamation mark is ignored. Comments may also be enclosed in braces Pascal style: '{' and '}' or '(*' and '*)'. p' | 'ThreeWayBranch' . Addr = label | constant . Special = Nonary | Unary | B 4) Numeric constants preceded by a '#' are octal constants. 5) Constants may be defined Pascal style: name = vainary . Nonary = 'WCSlow' | 'WCSmid' | 'WCShi' | 'LoadOp' | 'Hold' | 'StackReset' | 'Push' lue; This allows including a file which contains constant definitions into both a Pascal program and a micro-program.| 'Pop' | 'Fetch' | 'Fetch2' | 'Fetch4' | 'Fetch4R' | 'Store' | 'Store2' | 'Store4' |  6) The following ALU functions are allowed by the syntax descrip- tion, but do not exist. The assembler disallows th | 'WidRasterOp' . ALU = ['not'] (Amux | Bmux) | Amux Op ['not'] Bmux 'Store4R' | 'LatchMA' | 'ShiftOnR' . Unary = UnaryName '(' constant ')' .  | Amux '+' Bmux ['+' 'OldCarry'] | Amux '-' Bmux ['-' 'OldCarry'] | Amux 'amux' Bmux  UnaryName = 'LeftShift' | 'RightShift' | 'Rotate' | 'IOB' | 'Cntl | Amux 'bmux` Bmux . Amux = register | 'Shift' | 'NextOp' | 'IOD' | 'MDI' |RasterOp' . - 18 - PERQ Micro-Programmer's Guide 19  'MDX' | 'TOS' | 'UState' ['(' register ')'] . Bmux = register | constant . Jul 81 Binary = BinaryName '(' constant ',' constant ')' . BinaryName = 'Field' . : reenSize 50 Scavenger 51 SetSearch{ command} 52 Statistics +/- 53 Swap + [Partition] | -oration will make every effort to keep customers apprised of all documentation changes as quickly as possible. T 54 TypeFile [FileSpecification][/switch] 55 UserControl he Reader's Comments card is distrib- uted with this document to request users' critical evalu- ation to assist us ck Guide to Command Lines 17 Jul 81 1 Preface: Notation Conventions. 2 Introduction  - iii -  3 Question Mark: ? 4 Append File1 File2 5 Bye[ Parameter] 6 Chatter 7 Comp Editor V1.9 Quick Guide John P. Sile [Destination=]SourceProgram{/switch} 8 Copy [SourceFile DestinationFile]{/switch} 9 The Preliminary Detrait This manual describes version 1.9 of the PERQ Text Editor. It includes a small amount ofbugger: Scrounge 13 Delete FileSpecification[/switch] 14 Details{ parameter} 15 Directory[ FileSpe overview and philosophy behind the Editor and contains a list of the commands available. The reader is expected tcification]{/switch} 17 DirTree [RootDirectory] 18 Dismount Device 19 Edit FileSpecification 21 o have a general grasp of computers and computerized editors. Some experience or familiarity with a similar editor ExpandTabs SourceFile DestinationFile 22 Floppy 23 Floppydup 24 FTP[ command] 26  is helpful. Copyright (C) 1981 Three Rivers Computer Corporation 720 Gross Street Pitts Help [Command] 27 Link [RunFile=]Source{,Source}{/switch} 29 Login[ UserName] 31 MakeBoot[ RunFiburgh, PA 15224 (412) 621-6250 Editor V1.9 Quick Guide 17 Jul 81 le] 32 MakeDir[ FileSpecification] 33 Mount Device 34 ODTPRQ[ StateFileName] 35 Partitio This document is not to be reproduced in any form or transmitted in whole or in part, without the prin 36 Patch 37 Path[ DirectoryName] 38 Pause[ message] 39 PERQ.Files 40 PLX[ coor written authorization of Three Rivers Computer Corporation. The information in this document is subject tmmand] 43 Print [FileSpecification] 44 PRQMic[ RootFileName] 45 PRQPlace[ RootFileName][ ListFileNo change without notice and should not be construed as a commitment by Three Rivers Computer Corporation. The Comame] 46 QDis 47 Rename [SourceFile DestinationFile]{/switch} 48 Run[ runFile args] 49 Scpany assumes no responsibility for any errors that may appear in this document. Three Rivers Computer Corp: xnor' Bmux) Amux 'xnor' 'not' Bmux (equivalent to Amuv 'xor' Bmux) 7) The syntax allows constructions which are  req ReviveVictim PushLoad opt req Vector optsemantically incorrect. In other words, there are many combinations of actions which cannot be represented in a sin req Dispatch opt req RepeatLoop Repeat gle instruction. For example, TOS := MA := 10; is valid, but TOS := BPC := 10;  req JumpPop opt req Loop opt ThreeWayBranch is invalid. The 'Micro Instruction Format' section shows which fields of a micro-instruction are used by a parti opt req _________ ________ Assembler Commands There are several commands which cular action. The rule is that a certain field may be used only once. Thus since 'TOS :=' and 'BPC :=' both use theare directives to the assem- bler and placer to perform special actions. Assembler commands are indicated by a '$' in colu SF (special function) field, they both may not be used in a single micro-instruction. mn 1. The entire line is considered to be an assembler command. You may not type other micro-instructions on the same line. - 19 - PERQ Micro-Programmer's Guide 19 Jul 81 8) Some goto types do not allow te '$Include' FileName The text in the named file is inserted into the micro- program as tsts (are unconditional), and for some the test is optional. Similarly, some do not allow addresses, some reqhough it were present in the original source file. Included files may not be nested. Only the orginal souire them, and for some the address field is optional. This table gives the rules. req - required, opt - optionaurce file may contain an Include command. '$Title' TitleString The TitleString is printed on the assembll, - not allowed ____ ____ ____ _______ Goto type test y listing on the first line of every page. The first Title command sets the main title which is print address Goto opt req Call opt req ed at the left of each page. Each subsequent Title command sets the subtitle which is printed at the rig Return opt Next JumpZero LoadS req GotoSht of each page. - 20 - PERQ Micro-Programmer's Guide em. Amux 'nand' 'not' Bmux Amux 'nor' 'not' Bmux Amux 'xor' 'not' Bmux (equivalent to Amux ' opt opt CallS opt opt NextInst ; g is done on the tablet using either a BitPad pen or a four-button puck. Your PERQ probably has a Summagraphics BitPad ta move the pointer until it points at the left margin line. One press here selects the entire line. Once you haveblet. The BitPad pen contains a switch in the point of the pen. When you press the pen on the tablet, it closes the swi selected some text, you can extend the selection by moving the puck to another piece of text and then typing "E" or pressitch. Throughout this document we describe the use of the puck which has cross-hairs and four buttons: yellow, whitng the blue button. The selection is extended to a character, word, or line boundary, depending on the type of your e, green and blue. This description also applies to the use of the pen with one qualification: the pen switch actslast selection. Commands that change the selection (other than Extend) set the type to character. You can make the selec like the yellow button of the puck. In this manual, the term "press" means to press one of the switches on the puck or prtion larger with Extend, but you cannot make it smaller. To make the selection - 1 in preparing future documentation. PERQ is a trademark of Three Rivers Computer Corporation. ess the pen on the tablet. When you move the puck on the tablet, the pointer (cursor) moves on the screen to follo - ii - Editor V1.9 Quick Guide w the puck. The pointer changes shape depending on where it is on the screen. It may be a up-and-left pointing arrow,  17 Jul 81 ____________ Introduction It is a good idea to sit down at a PERQ and try out the Ean up-pointing arrow, a down-pointing arrow, or a circle. These different shapes indicate that different things will happditor as you are reading. A good file to edit when you are experimenting with the Editor is the Editor's HELP file. This enen when you press. Pointing at text (also called selecting text) is done by pressing on the tablet when the poables you to read the HELP file while you are editing. Copy it to a scratch file so that you won't have to worry about inter is an up-and-left-pointing arrow. If you move the pointer to some character and then press the yellow button, the chaaccidentally changing it. Do this with the system "Copy" command: Copy Editor.Help Scratch.File Now ask the Editor racter is selected by underlining it. Press the white button, and a word is selected by an underline. If you press the to edit this new scratch file: Edit Scratch.File The PERQ Text Editor is a "point, act" editor. This means thatgreen button, the entire line is selected. You can also select a word by pressing twice in the same place with the yellow  to perform an editing action, you first "point" to a piece of text in the file and then perform some action on it. Pointinbutton. If you press the yellow button three times, the entire line is selected. Another way to select an entire line is to ; List file name? -or- PrqPlace place without listing: ry Control 13 Opcodes and Operands 14 Shift Control 14 ShiftOnR 14 Expression Stack 15 PrqPlace Root file name? List file name? -or-  Input/Output Bus 15 Jumps 16 Interrupts 16 USTATE 17 Syntax of Micro-Programs 19 19 Jul 81 '$NoList' The listing is turned off until a List command is encountered. T PrqPlace Once a micro-program has been assembled and placed, you can use it in one of these wayshis command has an effect only if a listing is requested when the placer is executed. '$List' The listing i: a. Load it into another Perq with OdtPrq. b. Load it into the same Perq with the ControlStore module. c. Write s resumed if it was turned off by a NoList command. This command has an effect only if a listing is requit into a boot file with MakeBoot. - 22 - PERQ Micro-Programmer's Guide ested when the placer is executed.  19 Jul 81 ______ Quirks As of 12/1/80, the following quirks are known: - The Z  - 21 - PERQ Micro-Programmer's Guide 19 Jul 81  field is inverted for Shift functions (assembler fixes this). - The Op file is inverted on NextInst (assembler Opco________ ____________ Assembly Instructions Before a micro-program can be run it must be assembled with PrqMicde does it). - The Z field is inverted for all addresses (assembler fixes it). - IOB functions are executed  and then placed with PrqPlace. PrqMic translates the program into binary machine language, and PrqPlace assigns physical mitwice if an abort occurs. - C19 will not be valid if an abort occurs on the test. - C19 test is inverted sense (i.e. jucro- store locations to those instructions which are not assigned by the micro-programmer. The following shows how tmp if no carry out of bit 19). - USTATE 15:12 (the upper BMUX bits) are inverted. o assemble and place a micro-program. A micro-program source file name has the form .MICRO. is called the root nam - 23 - PERQ Micro-Programmer's Guide e. assemble: PrqMic Root file name? -or-  19 Jul 81 _____ __ ________ Table of Contents 1 Introduction to the Hardw PrqMic place with listing: PrqPlace Root file name? are 3 Micro Instruction Format 6 Constants 7 OldCarry 7 Condition Codes 8 Memo< s signalled by typing the INS key. Rejection is signalled by typing the DEL key. When typing text to the Edito - 2 - Editor V1.9 Quick Guide 17 Jul 81 E - Extend the selection to the currr, BACK SPACE deletes the most recently typed character, control-BACK SPACE deletes the most recently typed word, anent position of the pointer. F - Find a character string starting at the beginning of the selected text. Whend control-OOPS deletes the most recently typed line up to and including the carriage return. The RETURN key (carriage retu you type "F", the top line shows the prompt Find: enter target string Type the string you want to search forrn) is used to mark the end of each line in your file. The Editor does automatic indenting for you by supplying leading bl and then accept or reject the string. Rejecting aborts the Find command. If you accept immediately after typing anks on the new line to match those on the previous line. You may BACK SPACE over them or type more. When the first li"F", the previous target string (shown in the 'F' line at the top of the screen) is used. Lower case letters in tne of text is showing on the screen, it is indicated by a " " in the left margin--this is the beginning-of-text marker. Whe target will match either upper or lower case letters in the text. Upper case target characters will match onhen the last character of the file is showing on the screen, it is followed by a " "--this is the end-of-text marker.ly upper case text characters. If the target string is found, it becomes the selected text. Note that the target string You may select this character, but try as you may, you cannot delete it. ______ ________ Editor Commands  is shown at the top of the screen inside of F{ ... } . A Find command can be done in the revers- Editor V1.9 Quick Guide 17 Jul 81 smaller, you must start over by selecting a ch A - Append text after the selection. Type text until you are done, then either accept or reject the insertion. Iaracter, word, or line with the tablet. After selecting text, you can perform some action on it. You can insert bf you accept immediately after typing "A", the most recently inserted or deleted text is inserted. If you acceefore or after the selected text, delete the selected text, search for a character string starting at the beginning of the sept, the text you have just typed is displayed at the top of the screen inside of I{ ... } . D - Delelection, or any of the other Editor actions. The top line of the screen shows the command prompt, error messages, and promptste the selected text. If you delete text, it is displayed at the top of the screen inside of D{ ... }  within commands. Most Editor commands require termination by either accepting or rejecting the action. Acceptance i. The character which immediately follows the deleted text is selected. <  | |---------------------------------------------------------------| |  | | 3RCC PERQ SYSTEM D.5 BINARY DISTRIBUTION FLOPPY | | Copyright (C)  | | PRQ-SFT-BSD-5 | | 3RCC PERQ SYSTEM D.Three Rivers Computer Corporation, 1981 | | single density, double sided D.5 | | 5 SOURCE DISTRIBUTION FLOPPY | | Copyright (C) Three Rivers Computer Corporation, 1981 | | single densit | | Group name Command file | | y, double sided D.5 | | | | Group n | | OS.BINARY BIN.CMD LINK.CMD | | ame Command file | | | | O OS.MISCELLANEOUS MISC.CMD | |  Notes on the Syntax 20 Assembler Commands 22 Assembly Instructions 23 Quirks S.SOURCE SRC.CMD | | | | - iii - ---------------------------------------------------------------| |  | | PRQ-SFT-CSD-5 | | 3RCC PERQ SYSTEM D.5 IO SOURCE DISTRIBUTION FLOPPY | | Copyright (C) Three Rivers Computer Corporation, 1981 | | single density, double sided D.5  Labels for Source Systems Page 1/4 |------------------------------------------------------ | | | | Group name Command fil---------| | | | PRQ-SFT-ABD-5 e | | | | OS.IO.SOURCE SRC.C | | 3RCC PERQ SYSTEM D.5 BOOT FLOPPY | | Copyright (C) Three Rivers Computer CMD | | | |-------------------------------orporation, 1981 | | single density, double sided D.5 | | --------------------------------| | | | PRQ-SFT-DBD-5 = h a number. See the section "Repeat Count for Find and Replace" in this manual. I - Insert text before the selectionrol-C before writing the new file or type "E" to exit without updating, your file will remain unchanged regard- les. Type text until you are done, then either accept or reject the insertion. If you accept immediately after tys of any changes you made with the Editor. R - Replace occurrences of a character string with another character stringping "I", the most recently inserted or deleted text is inserted. If you accept, the text you have just typed is inside the selected text. Typing "R" causes the prompt Replace: enter target string at the top of the scre displayed at the top of the screen inside of I{ ... } . Q - Quit from the Editor. When you type "Q", then. Type in a string and then accept or reject. Note that the target string is displayed inside of F{ ...e screen is erased, and a list of options is presented. U to update W to write  } just as though you were using the the Find command. Lower case letters in the target will match either uppeto another file E to exit without updating R to return to the Editor : Type one of r or lower case letters in the text. Upper case target characters will match only upper case text characters. these letters followed by the RETURN key. You may change your mind and select another letter before typing RETURN. If you accept, the prompt Replace: enter replacement string is shown at the top of the screen. Now you can tIf you update or write to a file that already exists, the Editor saves the old version of the file by adding a "$" to the eype in the new string which will replace occurrences of the target string. If you accept before typing any charand of its name. This allows you to get the old version back if you decide you made a mistake. You can safely edicters of the replacement string, the previous replacement string is used. This means that to replace with notht the backup file since it has a different name than the new version of the file. -ing, you must first type a character and then delete it with the BACK SPACE key. In the absence of a repeat count, 3 - Editor V1.9 Quick Guide 17 Jul 81 While it is never a good idea to type  all occurrences within the selection are replaced. If a repeat count is typed immediately before the "R", a se direction (toward the beginning of the file). See the section "Direction of Find and Replace" in this manual. Youcontrol-C while you're in the Editor, you should not type it while the Editor is writing the new copy of your fi can ask the Editor to search for a certain number of occurrences of the target string by preceding the command witle. You will lose the new version of your file, and the old version will be in the backup file. If you type cont= SRC.CMD | | | |-------------------------- | |---------------------------------------------------------------| | -------------------------------------| Labels for Source Systems Page 2/4 |------------ | | PRQ-SFT-HSD-5 | | ---------------------------------------------------| | | | P 3RCC PERQ PASCAL COMPILER SOURCE DISTRIBUTION FLOPPY | | Copyright (C) Three Rivers Computer Corporation, 1981 RQ-SFT-FSD-5 | | 3RCC PERQ FILE UTILITY PROGRAM SOURCE DISTRIBUTION FLOPPY | | | | single density, double sided D.5 | |  Copyright (C) Three Rivers Computer Corporation, 1981 | | single density, double sided D.5  | | Group name Command file | |  | | | | Group name Command file  | | PASCAL.SOURCE SRC.CMD | |  | | | | UTILITY.FILE.SOURCE SRC.CMD  | |---------------------------------------------------------------| |  | | | |------------------------------------------- | | PRQ-SFT-SSD-5 | | 3RCC PERQ MORE PASCAL COMPI | |---------------------------------------------------------------| | --------------------| | | | PRQ-SFT-GBD-5  | | PRQ-SFT-ESD-5 | | 3RCC PERQ UTILITY PROGRAM SOURCE DISTRIBUTION | | 3RCC PERQ UTILITY PROGRAM BINARY DISTRIBUTION FLOPPY | | Copyright (C) Three Rivers FLOPPY | | Copyright (C) Three Rivers Computer Corporation, 1981 | | single density, double sided D.5  Computer Corporation, 1981 | | single density, double sided D.5 | |  | | | | Group name Comman | | Group name Command file | | d file | | | | UTILITY.SOURCE  | | UTILITY.BINARY BIN.CMD LINK.CMD | | > at if you type "S" when you means to type "R", you may accidentally delete a large portion of your file and have no wae online help facility. - 5 - Editor V1.9 Quick Guide pecified number of occurrences are replaced, starting at the beginning of the selection. See the section "Repeat Couny of getting it back. V - Toggle Verify mode. When you type "V", Verify mode is turned on or off, depending on wht for Find and Replace" in this manual. The direction can be changed in the same way as for the Find command.ether it was off or on before. When Verify mode is on, a "V" is displayed in the upper, right-hand corner of the  See the section "Direction of Find and Replace" in this manual. S - Substitute new text for the selected text. Tscreen. In Verify mode the Replace command gives you the option of replacing, not replacing, or aborting at each occhis command is similar to the sequence "Insert, Delete". Type the desired text, then either accept or reject turrence of the target string. The prompt Replace: INS replaces, doesn't, DEL aborts is displayed fhe insertion. If you accept immediately after typing "S", the most recently inserted or deleted text is insertedor each occurrence of the target string. The target string is indicated by a double underline and by the curs. If you accept, the text you have just typed is displayed at the top of the screen as the most recently inserted texor arrow (if you keep the puck away from the tablet). This double underline is difficult to see, but it's there. You mt inside of I{ ... } and the text you have just deleted is displayed at the top of the screen insay now accept the replacement with INS, you may skip over this occurrence by typing the space-bar, or abort the ride of D{ ... } . - 4 - Editor V1.9 Quick Guide eplace command with DEL. X - Redraw the screen. Use this command if you think the text shown on the screen is no 17 Jul 81 After substituting, the character immediately following the deleted text is select what is really in your file. If it comes up wrong again, you lose. * - Select the entire file from beginning to eted. Be careful with this command. It is easy to confuse Substitute with Replace. There is no way to "undo" a nd. INS - Repeat the last command. Typing the INS key at command level repeats the last command. Only certain commaSubstitute command because you cannot re-insert the deleted text. Attempting to re-insert the most recently insert- nds may be repeated this way, since it is unnecessary to repeat some commands (e.g., "*", "E"). The "A", "D", "F", "I ed or deleted text will merely re-insert the text you just typed in. The deleted text is gone forever. This means th", "R", and "S" commands may be repeated this way. HELP - Get help. Typing the HELP key at command level enters th>  Command file | | | | PASCAL.MO | | MICROCODE.SOURCE SRC.CMD RESOURCE SRC.CMD | | | |-------- | | | |---------------------------------------------------------------------------------------------------------------| | | | -------| | | | PRQ-SFT-KSD-5  PRQ-SFT-IBD-5 | | 3RCC PERQ PASCAL COMPILER BINARY DISTRIBUTION FLOPPY  | | 3RCC PERQ MICROCODE SUPPORT SOURCE DISTRIBUTION FLOPPY | | Copyright (C) Three Rivers Computer Cor| | Copyright (C) Three Rivers Computer Corporation, 1981 | | single density, double sided D.5 poration, 1981 | | single density, double sided D.5 | |  | | | | Group name Command file  | | Group name Command file | |  | | | | PASCAL.BINARY BIN.CMD L | | MICROCODE.SUPPORT.SOURCE SRC.CMD | | INK.CMD | | | |--------------------------------------- | |---------------------------------------------------------------| | ------------------------| Labels for Source Systems Page 3/4 |------------------------- | | PRQ-SFT-LBD-5 | | 3RCC PERQ--------------------------------------| | | | PRQ-SFT-JBD-5  MICROCODE BINARY DISTRIBUTION FLOPPY | | Copyright (C) Three Rivers Computer Corporation, 1981 | | sin | | 3RCC PERQ MICROCODE SOURCE DISTRIBUTION FLOPPY | | Copyrighgle density, double sided D.5 | | | | LER SOURCE DISTRIBUTION FLOPPY | | Copyright (C) Three Rivers Computer Corporation, 1981 | | single density, doublt (C) Three Rivers Computer Corporation, 1981 | | single density, double sided D.5 | | e sided D.5 | | | | Group name  | | Group name Command file | | ?  "," and "-" are synonyms for this command. Note that when you type one of these, a "<" is displayed in the upper, left your file. The left end of the bar represents the beginning of your file. Special characters are used to represent other -hand corner of the screen. This always shows the current direction. ___ ______ ___ The Scroll Bar interesting parts of your file. - Represents the end of the file. S - Represents the position of the beThe area to the left of the left-margin line is called the "scroll bar". If you move the pointer into this bar, it chginning of the selection. ( - Represents the position of the beginning of the displayed texanges into an up-pointing arrow at the left side and a down-pointing arrow at the right side. If you press the yellow button t. ) - Represents the position of the end of the displayed text. The thumb bar is used to rapidly m 17 Jul 81 ______ _____ ___ ____ ___ _______ Repeat Count for Find and Replace when the arrow is pointing up, the line that the pointer is next to is scrolled to the top of the screen. If you press when t Typing a 1- to 4-digit number before a Find or Replace command specifies the number of occurrences of the target string the arrow is pointing down, the top line of the screen is scrolled down to the line that the pointer is next to. Thus, hat you want to find or replace. This number is displayed in the top, right-hand corner of the screen after the letteif you put the pointer near the top of the screen, by pressing repeatedly, you can scroll slowly through the file. If yr "R" (which stands for "repeat count"). The number of occurrences actually found or replaced is displayed in the same ou put the pointer near the bottom of the screen, you can move through the file in large jumps of pages. If you put the poicorner following the letter "C" (which stands for "count"). This number increments as the Find or Replace command executes.nter near the middle of the screen, you can move through the file in half-page jumps. When using the puck in the scroll _________ __ ____ ___ _______ Direction of Find and Replace Typing a ">" sets the forward direction bar, you need not worry about whether the arrow points up or down. The white button always scrolls up, and the green  (toward the end of the file) for Find and Replace commands. "." and "+" are synonyms for this command. Note that whenbutton always scrolls down. - 6 - Editor V1.9 Quick Guide  you type one of these, a ">" is displayed in the upper, left-hand corner of the screen. This always shows the current dir 17 Jul 81 ___ _____ ___ The Thumb Bar The top-margin line is called the "thumb bar"ection. Typing a "<" sets the reverse direction (toward the beginning of the file) for Find and Replace commands.. When you move the pointer to this line, it changes into a circle. Think of the thumb bar as a linear representation of?  | Group name Command file | |  | | | | TEST.BINARY BIN.CMD Group name Command file | |  | | DOCUMENTATION.POS DOC.CMD | | | | MICROCODE.BINARY BIN.CMD | | MICROCODE.SUPPORT.BINARY SUPBIN.CMD SUPLNK.CMD  | |---------------------------------------------------------------| Labels for Source Systems  | | | |--------------------------------------------------- Page 4/4 |---------------------------------------------------------------| | ------------| | | | PRQ-SFT-MBD-5  | | PRQ-SFT-OSD-5 | | 3RCC PERQ TEST PROGRA | | 3RCC PERQ DOCUMENTATION DISTRIBUTION FLOPPY | | Copyright (C) Three Rivers ComputeM SOURCE DISTRIBUTION FLOPPY | | Copyright (C) Three Rivers Computer Corporation, 1981 | | single density,r Corporation, 1981 | | single density, double sided D.5 | |  double sided D.5 | | | | Group nam | | Group name Command file | | e Command file | | | | TES | | DOCUMENTATION DOC.CMD | | T.SOURCE SRC.CMD | | | |-- | |---------------------------------------------------------------| | -------------------------------------------------------------| |  | | PRQ-SFT-NBD-5 | | 3RCC| | PRQ-SFT-PBD-5 | | 3RCC PERQ TEST PROGRAM BINARY DISTRIBUTION FLOPPY  PERQ POS INTERFACE DOCUMENTATION DISTRIBUTION FLOPPY | | Copyright (C) Three Rivers Computer Corporation, 1981 | |  | | Copyright (C) Three Rivers Computer Corporation, 1981 | | single density, double sided D.5  single density, double sided D.5 | | | | | | | Group name Command file @ e file. - 7 - Editor V1.9 Quick Guide ranscript file whenever: 1) A carriage-return is typed in Insert mode. 2) A command which changes the text is succ 17 Jul 81 _______ __________ Special Characters ______ _________ essfully completed. 3) The transcript buffer is filled. If an old transcript file exists, it is destroyed the  _________ Action Character Alternate End-of-line RETURN control-M,contfirst time the buffer is flushed. This means that you can re-enter the Editor without destroying the old transcript file rol-J -or- control-M,LF Erase character BACK SPACE control-H Erase as long as you do not do something that causes the buffer to be flushed. Keep in mind that presses count against the 256-worword control-BACK SPACE control-W Erase line control-OOPS control-U Accept INS d buffer. If you do not want to destroy the old transcript file, do not type any commands, do not press more than a few  control-Y Reject DEL control-N Quote control-" -none- times, and exit the Editor by typing control-shift-C. - 8 - Editor V1.9 Qui Since these special keys are pre-defined, in order to insert them into your file you must type control-" (the Edck Guide 17 Jul 81 To replay a transcript, type "Editor/Replay". The Editor ove around in your file, but it is not very precise. When you put the pointer on the thumb bar and press down, the portionitor quote character) followed by the special key. When you type control-", the insert cursor changes from "_" to " " to  of the file represented by that portion of the bar is displayed on the screen. When you press at the left end of the bar indicate you typed the quote character. _________________ Transcript/Replay The Editor writes a trthe beginning of the file is shown, when you press the " " the end of the file is shown, and when you press the "S" the beganscript file during every edit session. The transcript is a file which contains a description of every keystroke and pinning of the selection is shown. The thumb bar can also be used to extend the selection. When you type "E" or pruck or pen press performed during an edit session. This transcript is written to the file ">Editor.Transcript". The traess the blue button while the pointer is on the thumb bar, the selection is extended to the position in the file which isnscript may be replayed later. This feature is intended for use when the Editor or the PERQ crashes during an edit session or represented by that particular portion of the thumb bar. This is only useful for extending to the beginning or end of th if you make some disasterous error with the Editor. The Editor saves keystrokes and presses and writes them to the t@ TION FLOPPY| | Copyright (C) Three Rivers Computer Corporation, 1981 | | single density, double sided D.5 mand file | | | | OS.SOURCE  | | | | Group name Command  SRC.CMD | | | |-----------------------file | | | | DEMO.BINARY BI----------------------------------------| | | | PRQ-SFT-CND-N.CMD LINK.CMD | | DEMO.SIGGRAPH.BINARY SIGBIN.CMD SIGLNK.CMD | | 5 | | 3RCC PERQ SYSTEM D.5 IO SOURCE DISTRIBUTION FLOPPY | | Copyri LINK.CMD | | | |--------------------------------- | |---------------------------------------------------------------| Labels for Non-Sour------------------------------| | | | PRQ-SFT-QSD-5 ce Systems Page 1/3 |---------------------------------------------------------------| |  | | 3RCC PERQ DEMONSTRATION PROGRAM SOURCE DISTRIBUTION FLOPPY| | Copyright (C) Th | | PRQ-SFT-ABD-5 | | ree Rivers Computer Corporation, 1981 | | single density, double sided D.5 | |  3RCC PERQ SYSTEM D.5 BOOT FLOPPY | | Copyright (C) Three Rivers Computer Corporation, 1981 |  | | Group name Command file | |  | single density, double sided D.5 | |  | | DEMO.SOURCE SRC.CMD | |  | |---------------------------------------------------------------| |  DEMO.SIGGRAPH.SOURCE SIGSRC.CMD | | | | | PRQ-SFT-BND-5 | | 3RCC PERQ SYSTEM D.5 SOURCE DISTRIBUTION F |---------------------------------------------------------------| | LOPPY | | Copyright (C) Three Rivers Computer Corporation, 1981 | | single density, double sided D.5  | | PRQ-SFT-RBD-5 | | 3RCC PERQ DEMONSTRATION PROGRAM BINARY DISTRIBU | | | | Group name ComA mmand. INS begin replaying and stop when one of the above keys is typed. DEL exit replay mode PERQ Pascal Extensions Miles Barel . If no DEL key is typed, the Editor automatically exits from replay mode when the end of the transcript is reach June 25, 1981 PERQ Pascal is an upward-compatible exted. Once you have exited replay mode you can begin editing normally, but we suggest that you Quit-Update as soon as pension of the standard programming language PASCAL. This document describes only the ossible. - 9 extensions to PASCAL. Copyright (C) 1981 Three Rivers Computer Corporation 720 Gr- Editor V1.9 Quick Guide 17 Jul 81 _____ __ ________ Table of Contents oss Street Pittsburgh, PA 15224 (412) 621-6250 This document is not to be  1 Introduction 2 Editor Commands 2 A - Append Text After the Selection 2 D - Delete th reproduced in any form or transmitted, in whole or in part, without the prior written authorization of Three Rive Selected Text 3 E - Extend the Selection 3 F - Find a Character String 3 I - Insert Text Before ers Computer Corporation. The information in this document is subject to change without notice and should nthe Selection 3 Q - Quit from the Editor 4 R - Replace Occurrences of One String with Another 4 S ot be construed as a commitment by Three Rivers Computer Corporation. The Company assumes no responsibility for - Substitute New Text for the Selected Text 5 V - Toggle Verify Mode 5 X - Redraw the Screen 5 * -any errors that may appear in this document. Three Rivers Computer Corporation will make every effort to keep Select the Entire File 5 INS - Repeat the Last Command 5 HELP - Get Help 6 Repeat Count for Find  customers apprised of all documentation changes as quickly as possible. The Reader's Comments card is  replays the previous edit session and stops just before the first command. You can control the replay by typing one of theand Replace 6 Direction of Find and Replace 6 The Scroll Bar 7 The Thumb Bar 8 Special C following keys: SPACE stop replaying after the next character or puck press. CR stop replaying after a haracters 8 Transcript/Replay carriage return in I command or after next command if not in I command. LF stop replaying after next co - iii - A orporation, 1981 | | single density, double sided D.5 | | Rivers Computer Corporation, 1981 | | single density, double sided D.5 | |  | | Group name Command file | |  | | Group name Command file | |  | | OS.BINARY BIN.CMD LINK.CMD | | OS.MISCELLANEOUS  | | PASCAL.BINARY BIN.CMD LINK.CMD | |  MISC.CMD | | | |------------------ | |---------------------------------------------------------------| | ---------------------------------------------| | | | PRQ-SFT | | PRQ-SFT-JBD-5 -GBD-5 | | 3RCC PERQ UTILITY PROGRAM BINARY DISTRIBUTION FLOPPY | | C | | 3RCC PERQ MICROCODE SOURCE DISTRIBUTION FLOPPY | | Copyright (C) Three Rivers Computer Corporation, 19opyright (C) Three Rivers Computer Corporation, 1981 | | single density, double sided D.5 | |81 | | single density, double sided D.5 | | ght (C) Three Rivers Computer Corporation, 1981 | | single density, double sided D.5 | |  | | Group name Command file  | | Group name Command file |  | | | | UTILITY.BINARY BIN.CMD LINK.CMD | | | OS.IO.SOURCE SRC.CMD  | | | |------------------------------------------------- | | | |--------------------------------------------------------------------| Labels for Non-Source Systems Page 2/3 |----------------------------------------------| | | | PRQ-SFT-DBD-5 --------------------------| | | | PRQ-SFT-IBD-5  | | 3RCC PERQ SYSTEM D.5 BINARY DISTRIBUTION FLOPPY | | Copyright (C) Three Rivers Computer C | | 3RCC PERQ PASCAL COMPILER BINARY DISTRIBUTION FLOPPY | | Copyright (C) Three B distributed with this document to request users' critical evaluation to assist us in preparing future documentation. s 17.1 StartIO 17.2 Raster-Op 17.3 WordSize 17.4 MakePtr 17.5 MakeVRD 17.6 InLineByte 17.7  PERQ is a trademark of Three Rivers Computer Corporation.  InLineWord 17.8 InLineAWord 17.9 LoadExpr 17.10 LoadAdr 17.11 StorExpr 18. Command Line and Co - ii - Table of Contents 1. Introduction 2. Declarations mpiler Switches 18.1 Command Line 18.2 Compiler Switches 18.2.1 File Inclusion 18.2.2 List Switch 18.2.2.1 Identifiers 2.2 Declaration Relaxation 2.3 Files 3. Extended Constants 3.1 Unsigned Octal3 Range Checking 18.2.4 Quiet Switch 18.2.5 Symbols Switch 18.2.6 Automatic RESET/REWRITE 18.2.7 Pr Integers 3.2 Constant Expressions 4. Type Compatibility 4.1 Type Coercion - RECAST 5. Extended Caocedure/Function Names 18.2.8 Version Switch 18.2.9 Comment Switch 18.2.10 Message Switch 18.2.11 Conditiose Statement 6. Control Structures 6.1 GOTO Statement 6.2 EXIT Statement 7. Sets 8. Recordnal Compilation 19. Quirks and Other Oddities 20. References Index  Comparisons 9. Strings 9.1 Length Function 10. Generic Types 10.1 Generic Pointers 10.2 Gener - iv - PERQ Pascal Extensions 19 Jul 81 1. Introduction ic Files 11. Procedure/Function Parameter Types 11.1 Parameter Lists 11.2 Function Result Type 11.3 Pro PERQ Pascal is an upward-compatible extension of the programming ______ ____ ______ ___ ______ lcedures and Functions as Parameters 12. Modules 12.1 IMPORTS Declaration 12.2 EXPORTS Declaration Section anguage Pascal defined in PASCAL User Manual and Report [JW74]. This 13. Exceptions 14. Dynamic Space Allocation and Deallocation 14.1 New 14.2 Dispose 15. Integer Log ______ document describes only the extensions to Pascal. Refer to PASCAL ____ ______ ___ ______ User Manual andical Operations 15.1 And 15.2 Inclusive Or 15.3 Not - iii -  Report for a fundamental definition of Pascal. This ______ ____ ______ ___ ______ doc Table of Contents 15.4 Exclusive Or 15.5 Shift 15.6 Rotate 16. Input/Output Iument uses the BNF notation used in PASCAL User Manual and Report. The existing BNF is not repeated but is used in the syntaxntrinsics 16.1 REWRITE 16.2 RESET 16.3 READ/READLN 16.4 WRITE/WRITELN 17. Miscellaneous Intrinsic definition of the extensions. The semantics are defined informally. These extensions are designed to support the B  | | PRQ-SFT-LBD-5 | | 3RCC PERQ MICROCODE BTERFACE DOCUMENTATION DISTRIBUTION FLOPPY | | Copyright (C) Three Rivers Computer Corporation, 1981 | | single denINARY DISTRIBUTION FLOPPY | | Copyright (C) Three Rivers Computer Corporation, 1981 | | single density,sity, double sided D.5 | | | | Grou double sided D.5 | | | | Group namp name Command file | | | | e Command file | | | | MIC DOCUMENTATION.POS DOC.CMD | | |ROCODE.BINARY BIN.CMD | | MICROCODE.SUPPORT.BINARY SUPBIN.CMD SUPLNK.CMD | |  |---------------------------------------------------------------| Labels for Non-Source Systems  | |---------------------------------------------------------------Page 3/3 |---------------------------------------------------------------| | | | | | PRQ-SFT-MBD-5  | | PRQ-SFT-PBD-5 | | 3RCC PERQ TEST PROGRAM BINARY DISTR | | 3RCC PERQ DOCUMENTATION DISTRIBUTION FLOPPY | | Copyright (C) Three Rivers Computer CorporatioIBUTION FLOPPY | | Copyright (C) Three Rivers Computer Corporation, 1981 | | single density, double sided n, 1981 | | single density, double sided D.5 | |  D.5 | | | | Group name  | | Group name Command file | |  Command file | | | | TEST.BINARY  | | Group name Command file | |  | | DOCUMENTATION DOC.CMD | |  | | MICROCODE.SOURCE SRC.CMD | |  | |---------------------------------------------------------------| |  | |---------------------------------------------------------------| |  | | PRQ-SFT-NBD-5 | | 3RCC PERQ POS INC  declaration occurs within the same type-definition-part, and 2)Procedures and functions may be predeclared sions which may be evaluated at compile-time. Constant expressions support the use of the arithmetic operators +, -, with a forward declaration. The new syntax for the declaration section is: ::= ::= | ::= | |