IMD 1.18: 21/01/2023 18:36:15 PRQ-SFT-SND-6 3RCC PERQ OPERATING SYSTEM SOURCE DISTRIBUTION FLOPPY Copyright (C) Three Rivers Computer Corporation, 1982 single density, double sided D.6 Group name Command file OS.SYSTEM.SOURCE OS.PROGRAMS.SOURCE SRC.CMD OS.IO.SOURCE  for XSPutChr Add new procedure for window change  number of chars printed on line to 255; Version 3.0 to full size. Fixed bug when ask for current window  18-feb-81 Brad A. Myers Added Window relative RasterOp and Line routines; change size. Fixed bug in SSetSize. Version 3.8 23-May-81 John d windows to be a list rather that record; P. Strait Use IOKeyDisable in ChangeTitle. Version 3.7 13-May-81 Brad A. Myers Added new exceptions Version 3.6 17-M changed module name; added extra scan line to title and margin below; ar-81 Brad A. Myers Changed SClearChar and SBackSpace to take a char; made name co changed to separate CR-LF Version 2.2 9-Feb-81 Brad A. Myers fixed broken screen size; mpatible Version 3.5 3-Mar-81 Brad A. Myers Removed BS special char and added make screen export SScreenP and SScreenW Version 2.1 14-Jan-81 Brad A. Myers  SBackSpace and SClearChar procedures Removed SRasterOp fixed cursor bug Version 1.0 1-Jul-80 Miles A. Barel started ------------------------------------------------------------------------------------------------} {---------------------------------------------------------------- Change Log:  and SLine and SIsCurOn; SCursorOn vble exported Version 3.4 24 Version 3.12 20-Jan-82 Brad A. Myers Fix title line to quote characters Fixed cu-feb-81 Brad A. Myers Added return param to GetWindowParms to tell HasTitle; VersorOutside exception from ChangeTitle after SSetSize. rsion 3.3 24-feb-81 Brad A. Myers Added param to SSetSize to leave screen displa Fixed SBackSpace comment. Version 3.11 13-Aug-81 Brad A. Myers Raise an exception if SSetCursor yed Version 3.2 20-feb-81 Brad A. Myers Changed to have a fixed number of win outside a window Version 3.10 26-Jun-81 Brad A. Myers Export the Window Table Versidows; added refresh command and SIsCurOn; fixed dot in lower-right on 3.9 26-Jun-81 Brad A. Myers Export all internal procedures used by SPutChr  corner Version 3.1 19-feb-81 Brad A. Myers BS to previous line added; restrict  º 0,<^;d È  @~;d  ¯x;d 0 Ì:d;d @;d x &ß;d P{7F;d" öQ;d X   hh"/";d4 #Ô! À#Ô!;d x ô&k;d Xô&å;d (ô&é  NOTE: There are still bugs in VarWin true} Type FontPtr = ^Font; Font = Packed Recorifc VarWin then} winNext: WindowP; {$endc} end; {$ifc VarWin then} Const Mad { Contains character sets } Height:integer; { Height of the KSet } Base: integer; { distxWIndx = 32767; {$elsec} Const MaxWIndx = 17; {$endc} Type WinRange = 0..MaxWIndx; LineStyle = (Drawance from top of characters to base-line } Index: Array [0..#177] of { Index into character patterns } Line,EraseLine,XorLine); LS = String[255]; Procedure ScreenInit; { CALL THIS ONCE AT BOOT } Pro Packed Record case boolean of true: (Offset: 0..767; { position of character in patterns } cedure ScreenReset; { This procedure de-allocates storage for all windows and sets u Line: 0..63; { Line of patterns containing char } Width: integer); { Width op the default window. } Procedure SPutChr(CH:char); { put character CH out to current position } f the character } false:(Loc:integer; Widd: integer) end; Filler:  { on the screen. Chars FF, CR, and LF } { have special meanings unless #200 bit set: } array[0..1] of integer; Pat: Array [0..0] of integer; { patterns go here }  { FF - clear screen { CR - move lef { We turn off range checking to } { access patterns, hence allowing } t to margine { LF - move vertically down one { BS { KSets of different sizes } end; {$ifc VarWin then} WindowP = ^WindowType;  - erase previous character } Procedure SSetCursor(X,Y: integer); { Set Cursor Position to X,Y } Procedure SReadCursor(v{$endc} WindowType = Packed Record {$ifc VarWin then} winNumber: Integer; {this window number} ar X,Y: integer);{ Read Cursor Position } Procedure SCurOn; { Enable display of Cursor } Procedure SCurO-----} Exports Imports Raster from Raster; Const ScreenVersion = 'V3.12'; VarWin = false; {if true then ca {$endc} winBY, winTY, winLX, winRX, { Limits of window area } winHX, winHY, wn have an arbitrary number of windows and storage for them has to be allocated off a heap. inMX, winMY, { Limits of useable area } winCurX, winCurY, winFunc: integer; wi If false then there are 17 windows max, and storage is in screens global data. nKSet: FontPtr; winCrsChr: char; winHasTitle, winCursorOn, defined: boolean; {$ ;d 8 ”Tz~;d ;dfM;d 0ÚdLm;d ( f€};d 8hfÌ;d ¸ hfÀ…;d @hfÃ…;d (ßfô&;d ¶pe;d ð»pÚ};d H  q °Iq©;d ˜ IqÚ;d IqL;d À˜sBÓ;d Ø ÖsIq;d Ös™’;d Jw ;d °Jwa;d Pòyu;d% Ð »zÕ};d À»zÎ;d ˆ=†s;d €i†’M;d ðô&Q";d xô&y";d 0 ô&œ";d xœ,u~;d   I.€ ;d (˜:;d  :]s;d ¸:_s;d `úŠI€;d èTŒ @™’Ú};d “yÌŠ €;dIq;dj X xàL:d½* ` d¸¼Íó3Íó;d ˆ¡:üX;d §:E~;d x¨:þq;d( °­:üX;d ¸oL35;d è YMÚ;d H R©`;d# ˜ ®SM!;d 8 ”Tz~;d ;dfM;d 0ÚdLm;d ( f€};d 8hfÌ;d ¸ hfÀ…;d @hfÃ…;d (ßfô&;d ¶pe;d ð»pÚ};d H  q °Iq©;d ˜ IqÚ;d IqL;d À˜sBÓ;d Ø ÖsIq;d Ös™’;d Jw ;d °Jwa;d Pòyu;d% Ð »zÕ};d À»zÎ;d ˆ=†s;d €i†’M;d `úŠI€;d èTŒ @™’Ú};d “yÌŠ €;dIq;dj X xàL:d½* ` d¸¼Íó3Íó*é¸~:d9Š ØŠ  @~;d  ¯x;d 0 Ì:d;d @;d x &ß;d P{7F;d" öQ;d X   hh"/";d4 #Ô! À#Ô!;d x ô&k;d Xô&å;d (ô&é;d ðô&Q";d xô&y";d 0 ô&œ";d xœ,u~;d   I.€ ;d (˜:;d  :]s;d ¸:_s;d ˆ¡:üX;d §:E~;d x¨:þq;d( °­:üX;d ¸oL35;d è YMÚ;d H R©`;d# ˜ ®SM! ff; { Disable display of Cursor } Procedure SCurChr(C: char); { Set cursor character } Proced---------- Abstract: Raised if the lines parameter to SSetSize is not a multiple of 128 or is <=0. Also raised ifure SChrFunc(F: integer); { Set raster-op function for SPutChr } Procedure SSetSize(Lines: integer; complemented, scree a window is totally below area to release so will disappear then if window # 0 or is the current windownOff: Boolean); { Set Screen Size; lines must be a , then Raises WBadSize. -----------------------------------------------------------------------------} Exception BadWNum; { multiple of 128; screenOff if true turns off display in part below lines indx is invalid} {----------------------------------------------------------------------------- Abstract: Raised if a window  in which case, complemented describes off partnumber parameter is illegal (not defined or out of range. --------------------------------------------------------- of screen } Procedure CreateWindow(WIndx: WinRange; OrgX, OrgY, Width, Height: integer; Title: string)--------------------} Exception WTooBig; {----------------------------------------------------------------------------- Ab; Procedure ChangeWindow(WIndx: WinRange); Procedure GetWindowParms(var WIndx: WinRange; var OrgX, OrgY, Width, Heistract: Raised if parameters for new window specify an area that would extend off screen. ------------------------ght: integer; var hasTitle: Boolean); Procedure ChangeTitle(Title: string); Procedure SetFont(NewFont: FontPtr); Function Get-----------------------------------------------------} Procedure StartLine; Procedure ToggleCursor; Procedure NewLine; ProFont: FontPtr; Procedure SClearChar(c: Char; funct: Integer); {delete prev char} { c cedure SaveLineEnd(x: Integer); Procedure SFullWindow; Const SScreenW = 48; {for use when want Screen in RasterOp or LBETTER NOT be CR or LF} Procedure Line(Style: LineStyle; X1, Y1, X2, Y2: integer; Origin: RasterPtr); Procedure SBackSpace(c: ine} Var SScreenP: RasterPtr; {for use when want Screen in RasterOp or Line} SCursorOn: boolean; SFunc: integerChar); {move back over last char of curLine} { c BETTER NOT be CR or LF} Procedure Refr; { Raster-op function for SPutChr } {$ifc VarWin then} FirstWindp, { first window's pointer; better eshWindow(WIndx: WinRange); {redraws window outline and title area. DOES NOT REDRAWnot be NIL } CurWindp: WindowP; { current window's pointer } {$elsec} CurWind: WinRange; WinTable: Ar TITLE} Exception WBadSize; {parameter to SSetSize bad} {-------------------------------------------------------------------ray[WinRange] of WindowType; {$endc} Exception CursOutSide; {-------------------------------------------------------------- ack. The general form of an ACB { is as follows. { { +0 Static link - address of the ACB of the surrounding pr maximum E-stack } ACBLength = 26; { largest ACB } ocedure. { +1 Local pointer - address of the current local variables. { +2 Dynamic link - address of the previous ACB on the stack. { +3 Global link - address of the previous routine's global data. { +4 Top link - address of the previous top-of-stack. { +5 Return segment - segment number of the previous procedure. { +6 Return address - offset within the return segment. { +7 Return routine number - previous routine number. { +8 Exceptionmodule AllocDisk; {-------------------------------------------------------------------------- {AllocDisk: Module to handle all pointer - pointer to list of exception enable blocks. { +9 E-Stack size - number of save words of expression stack. {ocating and freeing of pages off disk {Written by CMU-people {Copyright (C) 1980 Three Rivers Computer Corporation { { {Abs +10..+n+9 E-stack image - previous expression stack. { {-----------------------------------------------------------------------------} { 14 Mar 81 1.1 J. P. Strait. { Add ACBEP for exceptions. { } { 21 Nov 80 1.0 J. P. Strait. { Start file. { } ACBSL = 0; { static link } ACBLP = 1; { local pointer }  ACBDL = 2; { dynamic link } ACBGL = 3; { global link } ACBTL = 4; { ACB Definitions. {----------------------------------------------------------------------------- { { ACB.Dfs - Activat{ top link } ACBRS = 5; { return segment } ACBRA = 6; { return address } ion control block definitions. { J. P. Strait 21 Nov 80. { Copyright (c) Three Rivers Computer Corporation, 1980ACBRR = 7; { return routine number } ACBEP = 8; { exception pointer } ACBStackSize. { { Abstract: { This file defines offsets within the Activation Control Blocks { (ACB's) in the Perq memory st = 9; { E-stack size } ACBSaveStack = 10; { saved E-stack } ACBReserve = 26; { ACB size +  Myers 1-May-1981 Copyright (C) 1981 Three Rivers Computer Corporation. -------------------------------------------------1 V0.5 John P. Strait Change call to StreamKeyBoardReset. 20-May-81 V0.4 Brad A. Myers New stream reset procedure ----------------------------} {---------------------------------------------------------------------------- Versions:  Compiler switch for run info at top Proceed command  11 Dec 81 V0.14 WJHansen Change to set InCmdFile False instead of clos 12-May-81 V0.3 Brad A. Myers Use new IO modules; new exceptions 6-May-81 V0.2 Brad A. Myers No procedure name--------------- Abstract: Raised if try to set the cursor outside of the current window. Resume: Allowed. If resume, then ing CmdFile Brad A. Myers enable keyboard at start of Scrounge 3 Dec-81 Vcursor is NOT moved (same effect as if signal is caught but not resumed). ----------------------------------------0.13 Brad Myers ChangeWindow(0). Help exception. -------------------------------------} Private  Command for showing exception parameters. Command to dereference pointers. 26-Oct-81 V0.12 John P. Strait Change to agree with V2.11 Memory. 30-Jun-81 V0.11 Brad A. Myers Increase screen size for default window Set ^S Pending to false Fix ^Shift-D while ^Shift-D Remove n command (NIY anyway) 5-Jun-81 V0.10 Brad A. Myers Fixed ^C hanModule Scrounge; {----------------------------------------------------------------------------- Title: PERQ Pascal Prelimindling More information when Scrounge aborts 4-Jun-81 V0.9 Brad A. Myers Catch FSary debugger. Abstract: This module contains the procedure Scrounge which allows a small amount of debugging. SiNotFnd for lookups Clear IO buffer for CleanUp. 1-Jun-81 V0.8 Brad A. Myers Fixence there are no symbol tables or micro-- code support for breakpoints, you can look at the stack trace and d bugs in recursive invocation. 28-May-81 V0.7 Brad A. Myers Made safer for recursive invocation.  examine vbles by offsets. The types of the variables have to be specified by the user. Written by: Brad A. Add all handlers 23-May-81 V0.6 John P. Strait Enable keyboard interrupts before reading. 22-May-8 cluding its partion names, locations and sizes. { It also contains a table used to locate boot segments { { A disk can be 'mNextAdr pointers are chased to find the { real end of the Free List. { {-----------------------------------------------------ounted' which means that its root partition is known { to the system as an entry in the DiskTable. { { A Partition Informati---------------------} {-------------------------------------------------------------------------- Versions: V2.8 3on Block (PartInfoBlock or PIB) contains all of the { fixed information about a partition, { { A partition can also be 'moun-Dec-81 Brad Myers Changed definition of FlushFail V2.7 15-Jul-81 John Strait Fixed bug in DeallocChain: increment ted', and this is usually done as part of { mounting the disk itself. Partitions mounted are entries in the PartTable { {  PartNumOps by the length of the deallocated chain. Change oWithin a partition, segments are allocated as doubly linked lists of pages { { The Free List of a segment is a doubly linked rder of operations in AllocDisk routine to reduce probability list of free pages { { This module maintains this list, as well as the DeviceTable and PartTable { It contains procedures for of creating an inconsistent free list. V2.6 23-Jun-81 Brad Myers Changed UpdatePartInfo to only write PartInfo  mounting and dismounting disks and partitions, { as well as allocating and deallocating space within a partition. { When a if changed so can boot from write-protected floppies. V2.5llocating pages, the module updates the PartInfoBlock every { MaxAllocs calls on AllocDisk { { Since the system may crash som 1-Jun-81 Brad Myers Made UpdatePartInfo more fail-safe. V2.4 12-May-81 Brad Myers New exceptions; no Write statemene time between updates, the pointers { and free list size may not be accurate. { { When a partition is mounted, the pointers ts. Changed addresses to print in unsigned decimal V2.3 20-Apr-81 John Strait Use DiskStract: { Allocdisk allocates and deallocates disk pages. { { The partition has some number of contiguous pages on it. { are checked to see if they { point to free pages. If not, the head of the pointer is found by { looking at the "filler" word The number of pages in a partition is specified { when the partition is created (using the Partition program). { Segments caof the block the free head does point to { (which presumably was allocated after the last update of PartInfoBlock). { The filln be created within a partition, e.g. segments may not { span partitions. { The entire disk can be thought of as a partitioner word has a short pointer to the next "free" page, and forms { a linked list to the real free list header. Likewise, if the  (the Root Partition) { { A DiskInformationBlock (DiskInfoBlock or DIB) contains all the fixed { information about a disk, inFree tail { does not have a next pointer of 0, a deallocate is presumed to have been done { since a PartInfoBlock update, and  user programs, but rather the { compiler generates calls to these routines when a Reset, { Rewrite, Get, or Put is 1) Remove reverse video control character code. 2) Fixed bug in FullLn.  encountered. Higher-level character { I/O functions (Read and Write) are implemented by the two { modules Reader 3) Made EofCh (^Z) echo at Console. V1.9 JPS 4 Jun 81 Add Virgil headers and comments. V1.8 and Writer. { { In this module, the term "file buffer variable" refers to F^ for { a file variable F. { {----- JPS 22 May 81 Make StreamKeyBoardReset accept a Text parameter. V1.7 BAM 19 May 81 StreamKeyBoardReset tur------------------------------------------------------------------------} {-------------------------------------------------n cursor off. V1.6 JPS 12 May 81 Use exceptions instead of StreamError. Fix bug w---------------------------- { Change log: V1.20 BAM 27 Jan 82 Turn RSX back on. V1.19a SLB 26 Jan 82hen EofCh is typed at console. Use new control-C exceptions. V1.5 BAM 19 Mar 81 P Add exception definition NotReal. V1.18 SLB 07 Jan 82 Add exception definition RealWriteError. V1.17 SLB ERQ_String V1.4 BAM 17 Mar 81 1) Change to use FSIsFSDev on open 2) Change to uses for system modules until debug since takes too long 1-May-81 V0.1 Brad A. Mye30 Dec 81 Add an exception definition LargeReal, and change exception definition SmallNumber to Smrs Started by reworking PMD -----------------------------------------------------------------------------} {////////////allReal. V1.16 BAM 17 Dec 81 Turn off RSX switch. Make////////////} EXPORTS {\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\} Procedure Scrounge(ES, ER, PStart, PEnd, ExcSeg, RaiseAP: Integer);  regular OOPs work. V1.15 SLB 24 Nov 81 Add an exception definition SmallNumber. V1.14 JPS 25 S {////////////////////////} PRIVATE {\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\} ep 81 Fix bug in control-BS for keyboard input. V1.13 JPS 27 Jul 81 1) Export the keyboard buffer variables. module Stream; {----------------------------------------------------------------------------- { { Stream - Perq Pas 2) Change line editing to be like the Editor. 3) Make Readln work for fcal stream package. { John Strait ca. Jan 80. { Copyright (C) Three Rivers Computer Corporation, 1980iles with no Eol before the Eof. V1.12 BAM 6 Jul 81 Check for IOECBF as well as IOEI. { { { Abstract: { This module implements the low-level Pascal I/O. It is not { intended for use directly by OB in RS: output V1.11 BAM 1 Jul 81 Changed IO Screen output device name to ScreenOut V1.10 JPS 24 Jun 81   "root partition" in display partitions ForgetAll at end DeviceDismount V2.1 27-Maone since last update of PartInfoBlock} PartNumFree : FSBitr-81 Brad Myers Fixed bug in FindPartition for missing device and added comments V2.0 32; {HINT of how many free pages} PartInUse : boolean; {this entry in PartTable is valid}  19-Mar-81 Brad Myers Combined previous changes V1.3 ?-Mar-81 ?? Fixed GetPartName V1.2 10-Mar-81 Brad PartMounted : boolean; {this partition is mounted} PartDevice : integer; {which disk this par Myers Bit32 => FSBit32; fixed for new FS syntax V1.0 ??-???-?? CMU people written -----------------------------------tition is in} PartStart : DiskAddr; {Disk Address of 1st page} PartEnd : DiskA---------------------------------------} { {******************} exports {***************************} imports Arith fromddr; {Disk Address of last page} PartKind : PartitionType; {Root or Leaf} PartName Arith; imports ReadDisk from ReadDisk; const MAXDISKS = 2; {Floppy and HardDisk} MAXPARTITIONS = 10; {Maximum : PartString {name of this partition} end; var DiskTable : array [0..MAXDISKS-1] of DeviceRec number of mounted partitions} MAXPARTCHARS = 8; {how many characters in a partition name} type PartString = strord; PartTable : array [1..MAXPARTITIONS] of PartRecord; procedure InitAlloc; {initialize the AllocDisk module, caling[MAXPARTCHARS]; DeviceRecord = record {entry in the DeviceTable} InfoBlk: DiskAddr;led during boot} procedure DeviceMount(disk: integer); {mount a disk} procedure DeviceDismount(disk : integer); {dismoun {where the DiskInfoBlock is} InUse : boolean; {this DeviceTable entry is valid} Rt a disk} function MountPartition(name : string) : integer; {mount a partion, ootPartition: PartString {name of this disk} end; PartRecord = record {entry in  return PartTable index} procedure DismountPartition(name : string); {dismount a partition} function FindPartitithe PartTable} PartHeadFree : DiskAddr; {pointer to Head of Free List} PartTailFree : on(name : string) : integer; {given a partion name, look for it in PartTable, retDiskAddr; {pointer to tail of Free List} PartInfoBlk : DiskAddr; {pointer to PartInfoBlock} urn index} function AllocDisk(partition : integer) : DiskAddr; {allocate a free page egment for allocation. V2.2 14-Apr-81 Brad Myers Changed to report "device name" instead of  PartRootDir : DiskAddr; {pointer to Root Directory} PartNumOps : integer; {how many operations d  Shrink the error routine. V1.2 DCF 11 Feb 81 Conforms to new PString; compatable with  programs to unconditionally concatenate extensions onto filenames typed by the  new System and Compiler. V1.1 JPS 6 Nov 80 1) user (e.g. Console:.Map, RSX:.List). 4) Clean up control character processing som Add RSX: as an output device, RSX:FileName generates ^e. 5) Make RSX: optional at compile time. See the CompileRSX constQPip FileName=TI: For each character: a) Flush RS232 input bufant. -----------------------------------------------------------------------------} exports imports FileDefs from Filefer. b) Send RS232 character. c) Wait for RS232 echo--in theDefs; const StreamVersion = '1.20'; IdentLength = 8; { significant characters in an identifier } ty case of sending a carriage return, wait for a line fepe pStreamBuffer = ^StreamBuffer; StreamBuffer = record case integer of { element size: } 0: (W: array[0..255] oed. Send ^Z at end of file. 2) Add RSX: as an input device, RSX:Filf integer); { 1 or more words, or > 8 bits } 1: (B1: packed array[0..0] of 0..1); { 1 bit } 2: (B2: packeeName generates ^QPip TI:=FileName d array[0..0] of 0..3); { 2 bits } 3: (B3: packed array[0..0] of 0..7); { 3 bits } 4: (B4: packed array[0..0 ^S For each line of RS232 input: a) Send ] of 0..15); { 4 bits } 5: (B5: packed array[0..0] of 0..31); { 5 bits } 6: (B6: packed array[0..0] of 0..63); new Screen ClearChar routine V1.3 JPS 16 Feb 81 1) Implement FullLn predicate which tells you if a ^Q. b) Read from RS232 until end of line. c) Send a ^S.  there is a full line in the keyboard input buffer.  End of file is indicated by a '>' after an end of line, and the ^S 2) Fix bug in reporting "file opened to $ is not a text file" error.  is not sent after the end of file is received. 3) In Reset and Rew 3) Import the new Loader module. 4) Move $R- to private part. 5)rite allow filenames of the form :. This allows dumb   some files should be deleted and then the Scavenger should be run. Parameters: partName is the full partition  ( Lsw : integer; Msw : integer ); 2:  -------------------------------------------------------} {******************} private {***************************}  ( Ptr : FSBit32 ); 3: (  from a partition} procedure DeallocDisk(addr : DiskAddr); {return a page to the free list} procedure DeallocChain(firstaddr,lastaddr : DiskAddr; numblks : integer); {return a bunch of pages to free module Arith; {---------------------------------------------------------------------------- Implements interim Double precisilist} function WhichPartition(addr : DiskAddr) : integer; {given a Disk Address, on arithmetic package Needed until Pascal compiler supports type long. Copyright (C) 1980 Carnegie-Mellon University - figure out which partition it is in} procedure DisplayPartitions; {print the PartTable} Ex---------------------------------------------------------------------------} {-------------------------------------------------ception NoFreePartitions; {----------------------------------------------------- Abstract: Raised when too many partitions a--------------------------- Versions: 1-Jun-81 Brad Myers V2.2 Added comments 14-Apr-81 George Robertson V2.1 Fre accessed at one time. The limit is MAXPARTITIONS. -------------------------------------------------------} ixed bug in IntDouble 12-Apr-81 George Robertson V2.0 Converted to use microcode support 19-Mar-81 Brad Myers V1.3 Exception BadPart(msg, partName: String); {----------------------------------------------------- Abstract: Raised when the Fixed to import FileDefs 2-Feb-81 George Robertson at Carnegie-Mellon University V1.0 Fixedre is something wrong with a partition. This means that the Scavenger should be run. Parameters: msg is the prob DoubleInt to handle negative integers. Fixed DoubleMul to handle lem and partName is the partition name. Print error message as: WriteLn('** ',msg,' for ',partName); ---------- multiplicands > 2^15 by using Knuth's algorithm on p.233 of Knuth ---------------------------------------------} Exception PartFull(partName: String); {-------------------------------------- vol.2. ----------------------------------------------------------------------------} exports imports Fi--------------- Abstract: Raised when there are no free blocks in a partition to be allocated. This means thatleDefs from FileDefs; { to get FSBitnn } type MyDouble = packed record case integer of 1:  } 9: (C: packed array[0..255] of char); { for character structured } end; ControlChar = 0..#37; acked files } Length : integer; { length of buffer in words for un-  { ordinal of an ASCII control character } FileKind = (BlockSt packed files, in elements for packed files } ructured, CharacterStructured); FileType = { file of Thing } packed record Flag: packed record case integ BlockNumber : integer; { next logical block number } Buffer : pStreamBuffer;{ I/O buffer } Leer of 0: (CharReady : boolean; { character is in file window } FEoln : boolean; ngthInBlocks: integer; { file length in blocks } LastBlockLength:integer; { last block length in bits } { end of line flag } FEof : boolean; { end of file } FNotReset : boolean; { SizeInWords : integer; { element size in words, 0 means packed file } S false if a Reset has been performed on this file } FNotOpen : booizeInBits : 0..16; { element size in bits for packed files } ElsPerWorlean; { false if file is open } FNotRewrite: boolean; { set false if a Rewrite has been d : 0..16; { elements per word for packed files } Element: { Thing } record case integer of {The File window performed on this file } FExternal : boolean; { not used - will } 1: (C: char); 2: (W: array[0..0] of integer) end end; ChArray = packed array[1.be permanent/temp file flag } FBusy : boolean; { IO i.1] of char; {For read/write character array} Identifier = string[IdentLength]; IdentTable = array[0..1] of Idens in progress } FKind : FileKind); 1: (skip1 : 0..3; ReadError : 0..7); 2: tifier; var StreamSegment: integer; { Segment buffer for I/O buffers } KeyBuffer: packed a(skip2 : 0..15; WriteError: 0..3) end; EolCh, EofCh, EraseCh, NoiseCh: ControlChar; {self explrray[0..255] of char; KeyNext, KeyLength: integer; procedure StreamInit( var F: FileType; WordSize, Bitanatory} OmitCh : set of ControlChar; FileNum : integer; { POS file number } Index Size: integer; CharFile: boolean ); procedure StreamOpen( var F: FileType; var Name: PathName;  { 6 bits } 7: (B7: packed array[0..0] of 0..127); { 7 bits } 8: (B8: packed array[0..0] of 0..255); { 8 bits  : integer; { current word in buffer for un-packed files, current element for p module Clock; {----------------------------------------------------------------------------- { { Clock - Perq clock rou---------------------------------------------------} exports imports GetTimeStamp from GetTimeStamp; contines. { J. P. Strait 1 Feb 81. { Copyright (C) Three Rivers Computer Corporation, 1981. { { Abstract: { st ClockVersion = '1.6'; type TimeString = String; procedure SetTStamp( Stamp: TimeStamp ); procedure SetTString( Str Clock implements the Perq human-time clock. Times are represented { internally by a TimeStamp record which has numing: TimeString); procedure GetTString( var String: TimeString ); procedure StampToString( Stamp: TimeStamp; var String: TimeSeric fields for Year, { Month, Day, Hour, Minute, and Second. Times may also be expressed { by a string of the fotring ); procedure StringToStamp( String: TimeString; var Stamp: TimeStamp); Exception BadTime; {--------------------------rm YY MMM DD HH:MM:SS where MMM is a three (or { more) letter month name and HH:MM:SS is time of day on a 24 hour { -------------------------- Abstract: Raised when a string passed does not represent a valid time ---------------------------- Byte0 : FSBit8; Byte1 : FSBit8; Byte2 : FSBit8; Byte3 : FSBit8 clock. { { The clock module exports routines for setting and reading the current { time as either a TimeStamp o ) end; function DoubleAdd(a,b : FSBit32) : FSBit32; function DoubleSub(a,b : Fr a character string, and exports routines { for converting between TimeStamps and strings. { {-----------------SBit32) : FSBit32; function DoubleNeg(a : FSBit32) : FSBit32; function DoubleMul(a,b : FSBit32) : FSBit32; function DoubleD------------------------------------------------------------} {-------------------------------------------------------------iv(a,b : FSBit32) : FSBit32; function DoubleInt(a : integer) : FSBit32; function IntDouble(a : FSBit32) : integer; functi---------------- { Change Log: { { V1.6 17 Dec 81 WJHansen { Set Past.Lower in SetTStamp { { V1.5 12 May 81 Brad Myeon DoubleBetween(a,start,stop : FSBit32) : boolean; function DoubleMod(a,b : FSBit32) : FSBit32; function DoubleAbs(a : FSrs. { If invalid time string then raise a signal. { } { V1.4 19 Mar 81 Brad Myers. { PERQ_String. { } { V1.3 2 MarBit32) : FSBit32; function DblEql(a,b : FSBit32) : boolean; function DblNeq(a,b : FSBit32) : boolean; function DblLeq(a,b : 81 John Strait. { Don't export IO from Clock and GetTimeStamp. { } { V1.2 2 Mar 81 John Strait. { Add title, copyrigh FSBit32) : boolean; function DblLes(a,b : FSBit32) : boolean; function DblGeq(a,b : FSBit32) : boolean; function DblGtr(a,b t, and abstract. { Add version number. { Add retroactive change history. { } { V1.1 28 Feb 81 Brian Rosen. { Check for : FSBit32) : boolean; private invalid month numbers in StampToString. { } { V1.0 1 Feb 81 John Strait. { Start file. { } {-------------------------- ----------------------} exception NotTextFile( FileName: PathName ); {--------------------------------------------------- when an attempt is made to read past the end of the file. { { Parameters: { FileName - name of the file or device. { -------------------------- { { Abstract: { Raised when an attempt is made to open a non-text file to a { charact {-----------------------------------------------------------------------------} exception UnitIOError( FileName: PathName WordSize, BitSize: integer; CharFile: boolean; OpenWrite: boolean ); procedure Streamer-structured device. { { Parameters: { FileName - name of the device. { {-------------------------------------------Close( var F: FileType ); procedure GetB( var F: Filetype ); procedure PutB( var F: Filetype ); procedure GetC( var F: Fil----------------------------------} exception NotOpen; {-----------------------------------------------------------------etype ); procedure PutC( var F: FileType ); procedure PReadln( var F: Filetype ); procedure PWriteln( var F: Filetype ); ------------ { { Abstract: { Raised when an attempt is made to use a file which is not open. { {--------------------- procedure InitStream; function StreamName( var F: FileType ): PathName; function FullLn( var F: Text ): Boolean; procedur--------------------------------------------------------} exception NotReset( FileName: PathName ); {--------------------e StreamKeyBoardReset( var F: Text ); exception ResetError( FileName: PathName ); {----------------------------------------------------------------------------------------------- { { Abstract: { Raised when an attempt is made to read a file--------------------------------------- { { Abstract: { Raised when unable to reset a file--usually file not found but  which is open but { has not been reset. { { Parameters: { FileName - name of the file or device. { {--------- { also could be ill-formatted name or bad device name. { { Parameters: { FileName - name of the file or device. --------------------------------------------------------------------} exception NotRewrite( FileName: PathName ); {------ { {-----------------------------------------------------------------------------} exception RewriteError( FileName: Path----------------------------------------------------------------------- { { Abstract: { Raised when an attempt is made Name ); {----------------------------------------------------------------------------- { { Abstract: { Raised when unato write a file which is open but { has not been { rewritten. { { Parameters: { FileName - name of the fible to rewrite a file--usually file unknown device { or partition but also could be ill-formatted name or bad device namele or device. { {-----------------------------------------------------------------------------} exception PastEof( FileN. { { Parameters: { FileName - name of the file or device. { {-------------------------------------------------------ame: PathName ); {----------------------------------------------------------------------------- { { Abstract: { Raised ------------------------------------- { Change Log: { { Date: 26 Jan-82 V3.6 Brad Myers { New procedure NextString like Nex{ } {------------------------------------------------------------------} {********************} Exports {****************tID only doesn't remove final character. { } { Date: 5 Jan-82 V3.5 Brad Myers { Fixed ParseStringArgs so inputs and outpu****} Const CmdPVersion = '3.5'; MaxCmds = 30; MaxCString = 255; CCR = Chr(13); {same as standard CR} ts correctly set to NIL if error. { Additional error message from ParseStringArgs for , in outputs. { } { Date: 29 Dec-81  CmdChar = Chr(24); CmdFileChar = Chr(26); Type CString = String[MaxCString]; CmdArray = Array[1..MaxV3.4 Brad Myers { No period after ErAnyError message. { New error message: ErBadQuote. { Changed so err set to '' if no errorCmds] Of String; Procedure CnvUpper(Var Str:CString); {*** USE ConvUpper IN PERQ_String***} Function UniqueCmdIndex(Cmd:CSt (to avoid StringTooLong abort) { } { Date: 28 Dec-81 V3.3 Brad Myers { New procedure for removing quotes. { New procedring; Var CmdTable: CmdArray; NumCmds:Integer): Integer; Procedure RemDelimiters(Var Src:CString; Deliure for reporting errors. { Renamed destroy procedures to Dstry... due to name conflicts { } { Date: 18 Dec-81 V3.2 Bradmiters:CString; Var BrkChar:CString); Procedure GetSymbol(Var Src,Symbol:CString; Delimiters:CString;  Myers { Allow quoting of special characters for NextID. { } { { Date: 27 Nov-81 V3.1 Brad Myers { New procedure: Destro Var BrkChar:CString); Function NextID(var id: CString; var isSwitch: Boolean): Char; Function NextIDStryCmdFiles. { } { Date: 13 Nov-81 V3.0 Brad Myers { Add new commands to make parsing easier. Also don't require importining(var s, id: CString;var isSwitch: Boolean): Char; Type pArgRec = ^ArgRec; ArgRec = RECORD name: CSt------------------------} private g { system for UsrCmdLine. { } { Date: 13-May-81 V2.0 John Strait { Change length of most strings to be 255 characters in length. The strings { in CmdArrays are left as 80 characters because 255 character strings take { a lot of space and wModule CmdParse; {--------------------------------------------------------------- { Abstract: { This module provides a nume figure that no command names will be longer than { 80 characters. { } { Date: 19-Mar-81 Brad Myers { PERQ_String. { ber of routines to help with command parsing. { { Written by Don Scelza April 30, 1980 { { Copyright (C) 1980 - Three Riv} { Date: 12-Feb-81 Diana Forgy { Module is now compatable with new PString, System, and Compiler. { } { Date: 23-Sep-8ers Computer Corporation {---------------------------------------------------------------} {-----------------------------0 Miles Barel { Incremented MaxCmds to 30. Added the version number. { } { Date: 30-Apr-80 Don Scelza { Create CmdParse  y referencing a file which has { never been opened. { {--------------------------------------------------------------------------------------------------------------} exception IdNotDefined( FileName: PathName; Id: Identifier ); {-----------------------} exception NotIdentifier( FileName: PathName ); {----------------------------------------------------------------------------------------------------------------------------- { { Abstract: { Raised when an undefined identifier------------------- { { Abstract: { Raised when an identifier is expected on a file, but something { else is enc is read. { { Parameters: { FileName - name of the file or device. { Id - the identifier which was read. { {--ountered. { { Parameters: { FileName - name of the file or device. { {--------------------------------------------------------------------------------------------------------------------------} exception NotNumber( FileName: PathName ); {------------------------------} exception NotBoolean( FileName: PathName ); {------------------------------------------------------------------------------------------------------------------------- { { Abstract: { Raised when a number is e ); {----------------------------------------------------------------------------- { { Abstract: { Raised when IOCRead--------------------------------- { { Abstract: { Raised when a boolean is expected on a file, but something { e or IOCWrite returns an error status. { { Parameters: { FileName - name of the device. { {---------------------------lse is encountered. { { Parameters: { FileName - name of the file or device. { {---------------------------------------------------------------------------------------} exception TimeOutError( FileName: PathName ); {--------------------------------------------------------------} exception BadIdTable( FileName: PathName ); {----------------------------------------------------------------------------------------- { { Abstract: { Raised when a device times out. { { Parameter------------------------------------------- { { Abstract: { Raised by ReadIdentifier when the identifier table is bad. s: { FileName - name of the device. { {-----------------------------------------------------------------------------}  { { Parameters: { FileName - name of the file or device. { {--------------------------------------------------------- exception UndfDevice; {----------------------------------------------------------------------------- { { Abstract: { --------------------} exception IdNotUnique( FileName: PathName; Id: Identifier ); {------------------------------------- Raised when an attempt is made to reference a file which is open { to a character-structured device, but the device n---------------------------------------- { { Abstract: { Raised when non-unique identifier is read. { { Parameters: umber is bad. { In the current system (lacking automatic initialization of file { variables), this may be caused b{ FileName - name of the file or device. { Id - the identifier which was read. { {-------------------------------  xt: pSwitchRec; END; Function ParseCmdArgs(var inputs, outputs: pArgRec; var switches: pSwitchRec;  var err: String): boolean; Function ParseStringArgs(s: CString; var inputs, outputs: pArgRec; module Code; {----------------------------------------------------------------------------- { { Code.Pas - Common def var switches: pSwitchRec; var err: String): boolean; Procedure DstryArgRec(var a: pArgRec); Procedure DstrySwitchRec(var initions for the Linker and Loader. { J. P. Strait 10 Feb 81. Rewritten as a module. { Copyright (C) Threa: pSwitchRec); Type pCmdList = ^CmdListRec; CmdListRec = RECORD cmdFile: Text; e Rivers Computer Corporation, 1981. { { Abstract: { { Code.Pas defines constants and types shared by the Linker and t isCharDevice: Boolean; next: pCmdList; seg: Integer; END; Prohe { Loader. These include definitions of the run file and of offsets in the { stack segment. { { Design: { When thecedure InitCmdFile(var inF: pCmdList; seg: Integer); Function DoCmdFile(line: CString; var inF: pCmdList; var err: String): boo format of run files is changed, the constant RFileFormat { must also be changed. This is necessary to prevent the procedures lean; Procedure ExitCmdFile(var inF: pCmdList); Procedure ExitAllCmdFiles(var inF: pCmdList); Procedure DstryCmdFiles(var inFwhich { read run files from failing. { {-----------------------------------------------------------------------------} : pCmdList); Function RemoveQuotes(var s: CString): boolean; Type ErrorType = (ErBadSwitch, ErBadCmd, ErNoSwParam, ErNoCmd{ 6 Jan 82 1.8 Brad Myers { Changed qcode version number to 3. { } { 6 Jan 82 1.7 Brad Myers { Fixed definition of SParam, ErSwParam, ErCmdParam, ErSwNotUnique, ErCmdNotUnique, ErNoOutFile, ErOneInput, ErOnegBlock to include Version and Copyright strings. { } { 21 Jul 81 1.6 John Strait { Add Hints to the segment information eOutput, ErFileNotFound, ErDirNotFound, ErIllCharAfter, ErCannotCreate, ErAnyError, ErBadQuote); node. { } { 18 May 81 1.5 Brad Myers { Increment Q-Code version number. { } { 9 Apr 81 1.4 John Strait { Change R Procedure StdError(err: ErrorType; param: CString; leaveProg: Boolean); Function NextString(var s, id: CString; var isunInfo to be a record that just contains the header information { and define a pointer to it. { Change node definitions in ordring; next: pArgRec; END; pSwitchRec = ^SwitchRec; SwitchRec = RECORD Switch: Boolean): Char; {********************} Private {********************}  switch: CString; arg: CString; correspondingArg: pArgRec; ne  ---------------------------------------------------------------------- { { Abstract: { Raised when a real number is rea----------------------------- { { Abstract: { Raised when a real number is expected on a file, but something { ed from a file, but it is too small. { { Parameters: { FileName - name of the file or device. { {---------------------lse is encountered. { { Parameters: { FileName - name of the file or device. { {---------------------------------------------------------------------------------------------} exception BadBase( FileName: PathName; Base: Integer ); {----------------------------------------------} private ----------------------------------------------------------------------- { { Abstract: { Raised when an attempt is made to read a number with a numeric base { that is not in the range 2..36. { { Parameters: { FileName - name of the Program System; {------------------------------------------------------------ { System - POS main program. { Perq Soffile or device. { Base - numeric base (which is not in the range 2..36). { {-------------------------------------------tware Group. { Copyright (C) Three Rivers Computer Corporation, 1980, 1981. { { Abstract: { Initialize POS { ----------------------------------} exception LargeReal( FileName: PathName ); {----------------------------------------- and go into loop alternately running Shell and user program {------------------------------------------------------------} ------------------------------------ { { Abstract: { Raised when a real number is read from a file, but it is too large {------------------------------------------------------------ { Change Log: { { 21 Jan 82 V2.2 BAM Add new varxpected on a file, but something { else is encountered. { { Parameters: { FileName - name of the file or device.. { { Parameters: { FileName - name of the file or device. { {------------------------------------------------------- { {-----------------------------------------------------------------------------} exception LargeNumber( FileName: Path----------------------} exception RealWriteError( FileName: PathName ); {------------------------------------------------Name ); {----------------------------------------------------------------------------- { { Abstract: { Raised when a n----------------------------- { { Abstract: { Raised when an attempt is made to write a real number which is { umber is read from a file, but it is too large. { { Parameters: { FileName - name of the file or device. { {---------invalid. { { Parameters: { FileName - name of the file or device. { {--------------------------------------------------------------------------------------------------------------------} exception SmallReal( FileName: PathName ); {------------------------------------} exception NotReal( FileName: PathName ); {------------------------------------------------   CommentLen = 80; { the length of comment and version str in seg} type SNArray = packed arra ImpNode = record SId : SNArray; { name of imported segment } er to implement RunFiles module. { } { 8 Apr 81 1.3 John Strait { Add "ProgramSN" to RunHeader. This is the ISN of the y[1..SegLength] of Char; { segment name } pFNString = ^FNString; FNString = String[FileLength]; program segment. { } { 19 Mar 81 1.2 Miles A. Barel { Increased size of SEG and RUN file names and added QCode Version st{ file name } QVerRange = 0..255; { range of QCode version numbers } SegHint = recoruff { } { 23 Feb 81 1.1 Don Scelza { Changed the name Header to RunHeader. There was a name { conflict with the C-MU fd case Integer of 1: (Fid : Integer; { file id } Update: TimeStamp); { upile system. { } { 10 Feb 81 1.0 John Strait { Start file. { } exports imports GetTimeStamp from GetTimeStamp;date time } 2: (Word1 : Integer; Word2 : Integer; Word3 : const CodeVersion = '1.7'; RFileFormat = 2; QCodeVersion = 3; { Current QCode Version Number Integer) end; pSegNode = ^SegNode; pImpNode = ^ImpNode;  } FileLength = 100; { max chars in a file name } SegLength = 8; { max chars in a segment name  { Segment information record:} SegNode = record SegId : SNArray; { segment name} StackLeader = 2; { number of leader words in stack before } { XSTs (must be e } RootNam : pFNString; { file name without .Pas or .Seg } Hint : SegHint; { ven) } { Currently contains initial TP and GP } DefStackSize = #2hint to the segment file } GDBSize : integer; { size of this segment's GDB } XSTSiz0; { default stack segment size (in blocks) } DefHeapSize = #4; { default heap segment size (in blocks) } e : integer; { size of this segment's XST } GDBOff : integer; { StackBase offset to GDB }  DefIncStack = #4; { default stack size increment (in blocks) } DefIncHeap = #4; { default heap size  ISN : integer; { segment number inside Linker } CodeSize : integer; { number of blincrement (in blocks) } FudgeStack = #2000; { fudge space between system and user GDB's } ocks in .Seg file } SSN : integer; UsageCnt : integer; ImpList  { this must hold all loader variables at } { maximum configuration in LoadStack }  : pImpNode; Next : pSegNode end; { Import information record }   add TimeFID { remove CmdFile { rearrange definit to CtlCAbort. { 13-May-81 BAM Remove old comments about stand alone { Add vble fions of variables { change xxTime variables to Long { move StreamKeyor default cursor function (screen { color) that can be set by login from profile { BoardReset to Shell { 1-Dec-81 BAM Added the new exception HELPKey and a default {  Add comments to some exceptions { 13-May-81 JPS 1. Add exceptions and default handlers for  handler. { Added default handler for Flush Fail that works { { control-C. { 2. Add procedures to enable and disable { like diskFailure. { Make ^C^C clear ^S. { 05-NOV-81 DAS Added calls to EtherInit.  control-C processing. { 3. Add exception to ExitProgram. {  { 13-Aug-81 BAM Add new vbles to hold pointers for the shell. { 30-Jun-81 BAM Add new vbles for  4. Remove vestiges of old system: standard error { procedures. { 12-May-8DefScrOff and Comp and demo. { 25-Jun-81 BAM Change to window 0 before error type out. { 25-Jun-81 JPS 1 BAM Add default handlers for many exceptions { Use new IO { 6-Apr-81 JPS  Turn tablet off in command loop. { 23-Jun-81 BAM Address for DiskFailure printed in unsigned {  Retrofit changes for exceptions to version of { system that diverged after 15-Mar-81. {  decimal { 1-Jun-81 BAM Do automatic re-enable of swapping if turned off {  Virtual memory and timing statistics. { Get rid of "System" conditional c by Shell (i.e. for Scavenger) { 28-May-81 BAM Handler for Stream Reset error { 23-May-81 ompile. { Change main version from C to D. { 15-Mar-81 JPS Put in stuff for exceptJPS Replace enable/disable of control-c processing { (exported by System) with enable/disions. { 28-Mar-81 BAM Changed length of UsrCmdLine to 255. { 19-Mar-81 BAM PERQ_String. { iables isFloppy, PopAllowed. { 6 Jan 82 V2.1 WJH Use smaller screen for floppy booted on 1/4 MB { { 4 Dec 81able of { KeyBoard interrupts (exported by IO_Others). { 22-May-81 JPS Fix control V2.0 WJH Change to ShellCtrl from three vars { add UseCmd, UserPtr, and UserInt { -c processing. { 18-May-81 JPS Use StreamKeyBoardReset. { Change TwoCtlC exception  definition } { first block: } true: (ProgramSegment: boolean; 981. { { Abstract: { The ControlStore module exports types defining the format of PERQ { micro-instructions and proce SegBlkFiller : 0..127; QVersion : QVerRange; ModuleName : Sdures to load and call routines in the { control-store. { {------------------------------------------------------------------NArray; FileName : FNString; NumSeg : integer; -----------} {------------------------------------- { Change Log: { { 9 Dec 81 V1.2 WJHansen { Remove close comment ImportBlock : integer; GDBSize : integer; Version bracket from inside comment { { 3 Jun 81 V1.1 John Strait. { Add Virgil headers and comments. { } { ca. Jul 81 V1.0  FilN : pFNString; { file name of imported segment } XGP : integer; { global pointer of i : String[CommentLen]; Comment : String[CommentLen]); false:(Block:mport } XSN : integer; { internal number of import } Seg : pSegNode;  array[0..255] of integer) end; CImpInfo = record case boolean of { Import List Info - Next : pImpNode end; { Run file: } RunElement = (RunHeade as generated } { by the compiler } true: ( ModuleName: SNr,SysSegment,UserSegment,Import,SegFileNames); RunInfo = record { run header } RFileForArray; { module identifier } FileName: FNString { file name } mat:integer; Version: integer; System: boolean; InitialGP: i ); false:( Ary: array [0..0] of integer) end; Snteger; CurOffset: integer; StackSize: integer; StackIncr: integeegFileType = file of SegBlock; private r; HeapSize: integer; HeapIncr: integer; ProgramSN: integer;  SegCount: integer end; RunFileType = file of Integer; { Segment module ControlStore; {----------------------------------------------------------------------------- { { ControlStore - Load afile: } pSegBlock = ^SegBlock; SegBlock = packed record case boolean of { .SEG file nd call routines in the PERQ control-store. { J. P. Strait ca. July 80. { Copyright (C) Three Rivers Computer Corporation, 1  tring. { { { 17-Nov-80 Don Scelza Added the code for LastFileName. { .255; {Groupid of current user} CurUserName, {LogIn name of current user} CurPFile: String; 17-Mar-81 BAM Set time when come up so Login LookUp faster. { 3-Mar-81 DAS Added variables for Login. This will allow a user to supply the { name of a file once for the Editor, Compiler,  Added { InCmdFile for Shell. { 25-Feb-81 DAS Added FlushAll call in command. { { and Linker. { 14-Nov-80 Don Scelza Added conditional compile for stand {  24-Feb-81 JPS Add code to shrink and expand the screen. { *** Caution *** The Shell alone programs { 10 Oct 80 JPS Add support for the diagnostic display (DDS). { 23 Sep 80  must never be loaded { when the screen is small, because it might { JPS and DAS Add PAUSE command. { Announce 12 or 24 MByte disk. {} {********************} allocate a buffer for a command file. This { buffer will hang around after the Shell returns {  Exports {********************} Const MainVersion = 'D'; DebugSystemInit = False; FirstDDS = 199; ShellC to the system. { 23-Feb-81 RFR Added SysDisk, SysBootChar definitions. { onst = 'Shell.'; LogConst = 'LogIn.'; PFileConst = 'Default.Profile'; SysTiming = True; { Gather Added call to FSSetupSystem. { 19-Feb-81 John Strait Incorporate system version number into the {  System timing statistics. If this constant is changed, IO, Loader, Memory, Movemem, System,  name of the LogIn run file. { 17-Feb-81 Don Scelza Removed the include file for SysVers. { and Shell should be re-compiled, and the System should be re-linked. }  Put the code inline in System. { 16-Feb-81 John Strait Removed the Loader to a separate mo Type Sys9s = String[10]; Var UsrCmdLine: String[255]; {Command line entered by user} UseCmd: Boolean; dule. { 16-Feb-81 Don Scelza Changed System to use Perq.String and { changed MainVersion  {Set True to tell shell to execute UsrCmdLine} InCmdFile: Boolean; {True if shell commands from file} LastFito C. { 11-Feb-81 Diana Forgy Took out command interpreter and made { most of it program SleName, {Name of file to use if none given} RFileName, {Name of next program to run} Shhell. { { This program is compatable with the { new Compiler and PSellName: String; {Name of Shell} CurUserID, {Index of user in System.Users} CurGroupID: 0.   SFF: 0..63; ALU0: 0..1; ALU1: 0..1; ALU23: 0..3) end; lements the basic low level operations to disk devices. {It services the Hard Disk and the Floppy. When dealing with the flopp MicroBinary = { The format of a micro-instruction and its address as produced by the micro-assembler. y {here, the structures on the hard disk are mapped to the structures {on the floppy. {--------------------------------------} record Adrs: integer; MI: MicroInstruction end; TransMicro = { The forma------------------------------------} {--------------------------------------------------------------------------- Change ht of a micro-instruction as needed by the WCS QCode. } packed record case integer of 0: (istory. 12 Jan 82 BAM V3.13 Fix bug in FloppyIO failure so deallocates storage. 24 Jun 81 BAM V3.12 Fix to preventWord1: integer; Word2: integer; Word3: integer); 1: (ALU23: 0..3; ALU0: 0.. retry if floppy write and device not writable. 28 May 81 BAM V3.11 Fix bug in floppy header die1; W: 0..1; ALU1: 0..1; A: 0..7; Z: 0..255; S-On-error. Add Recalibrate light to floppy New light definitions 26 May 81 FF: 0..63; H: 0..1; B: 0..1; JmpCnd:0..255) end; Mic JPS V3.10 Use new Lights module. 19 May 81 BAM V3.9 Fixed position of Reset light 12 May 81 BAM V3.8 Removed printJohn Strait. { Started file. { } {-----------------------------------------------------------------------------} exports roFile = file of MicroBinary; { A file of micro-instructions. } procedure LoadControlStore( var F: MicroFile ) type MicroInstruction = { The format of a micro-instruction as produced by the micro-assembler. ; procedure LoadMicroInstruction( Adrs: integer; MI: MicroInstruction ); procedure JumpControlStore( Adrs: integer ); } packed record case integer of 0: (Word1: integer; Word2: integer; Word3: integer private ); 1: (Jmp: 0..15; Cnd: 0..15; Z: 0..255; SF: 0..15; F: 0..3; ALU: 0..15; H: 0..1; W: 0..1; B: 0..1; A: 0..7; Y: 0..255; X: 0..255); 2: (JmpCnd: 0..255; Fill1: 0..255; module DiskIO; {--------------------------------------------------------------------------- { {Abstract: { {This module imp  tem version number} SystemInitialized: Boolean; {True after system initialized} DDS: Integer; {Keeps curyou should clear { CtrlCPending in your handler. If you are catching control-c's to { try to prevent aborts, you srent diagnostic display value} ShouldReEnableSwapping: Boolean; {True if swapping must be reenabled} SavedSwapId: Inthould enable CtlCAbort also, since the { Stream package will raise it when the control-c is read. { {------------------eger; {Save id of where to swap to} {$ifc SysTiming then} LoadTime, OldLoadTime: long; ExecuteTime, OldEx-----------------------------------------------------------} Const ErrCtlCAbort = 5; {******} Exception CtlCAbort; {-------ecuteTime: long; SwapTime, OldSwapTime: long; MoveTime, OldMoveTime: long; IOTime, OldIOTime: long; PrintSta---------------------------------------------------------------------- { { Abstract: { CtlCAbort is raised by the KeyBo {Name of current profile file} UserMode: Boolean; {True while executing user program} CtrlCPending: tistics: Boolean; {$endc} UserPtr: pointer; {A pointer variable for use between user Boolean; {True if one control-C typed} NextSSize: Integer; {Screen size for next program} NextSCompleme programs. (Use IncRefCount to keep segment)} UserInt: integer; {May be a segment number for Unted: Boolean; {Whether to complement bottom for next pgm} NextSOff: Boolean; {Whether bottom should display data serPtr} DemoInt: Integer; {reserved for Demo system} isFloppy: Boolean; {true if booted frobits} DefCursFunct: Integer; {What to set curs func to after each prog} DefScrComp: Boolean; {Default valum floppy, else false} pointAllowed: Boolean; {true if should use pointing device} {*** WARNING!! IF YOU CHANGEe for NextSComplemented} DefScrOff: Boolean; {Default value for NextSOff} ShellCtrl: pointer; {Point THE EXPORTED PROCEDURES AND EXCEPTIONS, MAKE {*** SURE THE NUMBERS FOR THE FOLLOWING EXCEPTIONS ARE UPDATED {*** er to information record for Shell} TimeFID: integer; {File ID of file holding current time} CmdSegment: Int AND RECOMPILE SCROUNGE IF CHANGED !!!!! *****} {*** WARNING!! DO NOT CHANGE THE ORDER OF THE ^C EXCEPTIONS !!!!! *eger; {SegmentNumber of seg holding command files} InPmd: Boolean; {True if in Scrounge (PostMortemDum****} Procedure Command; Procedure SetDDS( Display: Integer ); Procedure SysVers( n: integer; var S: string ); Const Errp)} SysDisk: Integer; {Number of the disk booted from} SysBootChar: Integer; {Ord(char held down to boCtlC = 4; {******} Exception CtlC; {----------------------------------------------------------------------------- { { Abstraot)} StrVersion: string; {System version number as a string} SystemVersion: Integer; {Integer giving sysct: { CtlC is raised by the KeyBoard interrupt routine when a control-c { is typed. If you handle this exception  f the SetCylinder StartIO. 20 Apr 81 JPS V3.6 Use DiskSegment consistently. -------------------------------} {******************} exports {***************************} imports Arith from Arith; imp Set DiskSegment as UnSwappable for virtual memory. 9 Apr 81 BAM V3.5 Fix Retry so no recal on last time; DiskError orts FileDefs from FileDefs; imports IOErrors from IOErrors; const HARDNUMBER = 0; {device code oftell op. Fixed bug in DoDiskIO exit 30 Mar 81 BAM V3.4 Added Retry count to TryDisk and Const Nu Shugart Disk} FLOPPYNUMBER = 1; {device code of FloppyDisk} {a Disk Address can be distinguishedmTries. 27 Mar 81 BAM V3.3 Added comments and WriteLn to DiskError. 19 Mar 81 BAM V3.2 Combined JPS+GGR and BAM's ch from a Segment Address by the upper two bits (in 32 bits). These bits have a nonzero code to which disk the addranges. 17 Mar 81 GGR V3.1 Removed WinchDebug and FloppyDebug. 17 Mar 81 JPS V3.0 Changed MapAddr and UnMapAddr to haess is part of} RECORDIOBITS = #140000; {VirtualAddress upper 16 bits of disk} DISKBITS = REndle 24 Mbyte drives. Changed harddisk interlace factor to one. CORDIOBITS + (HARDNUMBER*(#20000)); FLOPBITS = RECORDIOBITS + (FLOPPYNUMBER*(#20000)); {The following def Removed partition kind 'node'. Added TryDiskIO, and changed DiskError printout. initions tell how many entries there are in the three pieces of the random index. The first piece (Direct) are bloc Changed FirstDiskBlock for harddisks and LastDiskBlock for 24 Mbyte disks. ks whose DiskAddresses are actually contained in the Random Index (which is part of the FileInformationBlock). The s Improved retry and retry messages from DiskIO and FloppyIO. 16 Mar 81 BAM V2.2 Chanecond section has a list of blocks each of which contain 128 Disk Addresses of blocks in the file, forming a one level indged directory to have extra bits 5 Mar 81 BR V2.1 Added comments 5 Mar 81 BAM V2.0 Changed Definitions and importirect addressing scheme. For very large files, the third section (DblInd) has DiskAddresses of blocks which po out for DiskErrors; more accurate print out of errors when happen; blink "light" during  FileDefs. 3 Mar 81 JPS V1.4 Fix DiskReset to agree with IO V4.4. 1 Mar 81 BR V1.3 Change FileDate to TimeStamp.  IOReset. Added new Exceptions DiskFailure and BadDevice; Remove 1 Mar 81 JPS V1.2 Export the DiskReset routine. 28 Feb 81 JPS V1.1 Get rid of the LogMapping parameter to MapAddr bd Procedure DiskError; Use new IO 6 May 81 JPS V3.7 Fix bug in DiskReset by using the new form oy teaching UnitIO not to fool with a hard disk address. --------------------------------------------   to and clear Stream's line editing buffer. { {-----------------------------------------------------------------------------}  Sys9s); {----------------------------------------------------------------------------- { { Abstract: { HelpKey is rai Const ErrCtlShftC = 6; {******} Exception CtlShftC; {----------------------------------------------------------------------sed when the HELP key is hit. { { Parameters: { retStr - the set of characters to put into the input stream. This { ------- { { Abstract: { CtlShftC is raised by the KeyBoard interrupt routine when a control- { shift-c is typed. should be set by the handler if it continues from the { exception. Likely values are "/Help" and chr(7) { (the current value returned). The key board interupt routine { sets retStr to yBoard interrupt routine, the KeyBoard { type-ahead buffer is cleared. You cannot prevent this. { { If your prog'' before raising this exception so if not set, { and the handler resumes, nothing will be put into the input {ram uses a Text file and you want to clear the line editing { buffer for that file, you should call the Stream routine { stream. { Resume: { Allowed. Should set retStr first. {--------------------------------------------- StreamKeyBoardReset(F) (assuming F is the name of the file). If F { is a Text file which is attached to the conso--------------------------------} type DoubleWord = ^integer; {should use Long instead} {********************} Private ard interrupt routine when the second { of two adjacent control-c's is typed. It is also raised by the { Stream ple, this will get rid { of the character F^ points to and clear Stream's line editing buffer. { {----------------------ackage when a control-c is read. If you handle this exception { you should clear CtrlCPending in your handler. { { -------------------------------------------------------} Const ErrExitProgram = 7; {******} Exception ExitProgram; {------- When this is raised by the KeyBoard interrupt routine, the KeyBoard { type-ahead buffer is cleared. If you want to pr---------------------------------------------------------------------- { { Abstract: { ExitProgram is raised to abort (event this, you must { catch CtlC also. { { If your program uses a Text file and you want to clear the line editior exit) a program. The default { handler for CtlCAbort and Scrounge raise this exception. { { WARNING: No one bng { buffer for that file, you should call the Stream routine { StreamKeyBoardReset(F) (assuming F is the name of ut System and Loader should Handle this exception. { Anyone may raise it to exit a program. { {---------------the file). If F { is a Text file which is attached to the console, this will get rid { of the character F^ points--------------------------------------------------------------} Const ErrHelpKey = 8; {******} Exception HelpKey(var retStr: int to other blocks which contain 128 DiskAddresses of blocks in the file, forming a two level indirect scheme.} DI { A directory is an ordinary file which contains SegIDs of files along with their names. DirectoriRECTSIZE = 64; { Entries in FIB of blocks directly accessable } INDSIZE = 32; { Entries in FIB of 1 es are hash coded by file name to make lookup fast. They are often sparse files (ie contain unallocated blocks belevel indirect blocks } DBLINDSIZE = 2; { Entries in FIB of 2 level indirect blocks } FILESPERDIRBLK tween allocated blocks). The file name is a SimpleName, since a directory can only contain entries for files with = 16; { 256 / SizeOf(DirEntry) } NUMTRIES = 15; { number of tries at transfer before aborting } type in the partition (and thus device) where the directory itself is located } DirEntry = packed record  {Temporary segments go away when processes are destroyed, Permanent segments persist until explicitly destroyed  InUse : boolean; {true if this DirEntry is valid} Deleted : boolean; {true if entry deleted butBad Segments are not well formed segments which are not readable by the Segment system} SpiceSegKind = (Temporary, not expunged} Archived : boolean; {true if entry is on backup tape} UnUsed : 0..#1777 Permanent, Bad); PartitionType = (Root, UnUsed, Leaf); {A Root Partition is a device} DeviceType = (Winch12, Winch7; {reserved for later use} ID : SegID; Filename : SimpleName 24, FloppySingle, FloppyDouble, UnUsed1, UnUsed2); MyDble = Array [0..1] of integer; Disend; DiskBuffer = packed record case integer of 1: ( kCheatType = record case integer of 1: ( Addr : Addr : array [0..(DISKBUFSIZE div 2)-1] of DiskAddr ); 2: (  DiskAddr ); 2: ( Dbl : MyDble { should b IntData : array [0..DISKBUFSIZE-1] of FSBit16 ); 3: ( e IO.Double but don't import IO in export section }  ByteData : packed array [0..DISKBUFSIZE*2-1] of FSBit8 ); {4 is format of  ); 3: ( Seg : SegID ); the FileInformationBlock; the FIB has Logical Block -1 } 4: (  4: ( Lng : FSBit32 ) end;  FSData : FSDataEntry; {The Random Index is a hint of the DiskAddresses  module UserPass; {------------------------------------------------------------------------- { { Abstract: { This moduleModule SystemDefs; {----------------------------------------------------------------------------- { { SystemDefs -  provides facilities for dealing with the password { and accounts file for PERQ. The login and protection facilities { Common system definitions. { John P. Strait 13 May 81. { Copyright (C) Three Rivers Computer Corporation, 1981. for Perq provide a very simple user validification. This system { is NOT completly secure. { { Written by: Don Scelza { { { Abstract: { SystemDefs exports common system Const and Type definitions. The { intent is that SystemDefs sho { Copyright (C) Three Rivers Computer Corporation, 1981. { {----------------------------------------------------------------uld not export Procedures or Vars since { these require a Seg file. It is also intended that SystemDefs be { reas---------} { 6-Jun-81 V1.3 Brad Myers { Fixed so System.Users always in root directory: >System.Users { } { 29-Apronably short so that it doesn't take long to import. { {-----------------------------------------------------------------------81 V1.2 Son Scelza { Added code and types for profile and remove user. { } { 9-Mar-81 V1.1 Don Scelza { Changed the -------} {---------------------------------------------------------------------------- { { Change log: { { 1 Dec 81 max number of users. This will allow the entire { file to fit into a single disk block. { } { 5-Mar-81 V1.0 Don Scelza  V1.2 Brad Myers { Set Ether10MBaud to false. { 04 Nov 81 V1.1 Don Scelza { Set Ether10MBaud to true. { {- { Created UserPass { } {********************} Exports {********************} type IDType = 0..255; PassType =----------------------------------------------------------------------------} exports const Ether3MBaud = False;  ^Integer; { a two word value } UserRecord = packed record InUse: boolean;  { no support for 3 MBaud EtherNet } Ether10MBaud = True; { no support for 10 MBaud EtherNet } typ{ is this entry in use. } Name: String[31]; { Name of the user } UserID: IDType; {********************} e Double = array[0..1] of Integer; private   NumBlksInUse says how many data blocks are actually {when booting, the boot character is indexed into the following tables to find where code to be  used by the segment} LastBlk : FSBit16; {Logi boot loaded is found } BootTable : array [0..25] of DiskAddr; {qcode} cal Block Number of largest block allocated} Last InterpTable: array [0..25] of DiskAddr; {microcode} PartName : packed arra of the blocks that form the file. It has three parts as noted above. Notice Addr : DiskAddr; {DiskAddr of LastBlk } LastNegBlk : FSBit16; {Logical Block Number of  that all three parts are always there, so that even in a very large file, the f largest pointer block allocated} irst DIRECTSIZE blocks can be located quickly The blocks in the Random i LastNegAddr: DiskAddr {Block number of LastNegBlk} ); {5 is the format of thendex have logical block numbers that are negative. The logical block nu DiskInformationBlock} 5: ( {The Free List is a chmber of Indirect[0] is -2 (the FIB is -1) the last possible block's number is ain of free blocks linked by their headers } FreeHead : DiskAddr; {Hin -(INDSIZE+DBLINBDSIZE+1)} Direct : array [0..DIRECTSIZE-1] of DiskAddr; t of Block Number of the head of the free list} Fr Indirect : array [0..INDSIZE-1] of DiskAddr; DblInd : array [0..DBLINDSIZE-1] of eeTail : DiskAddr; {Hint of Block Number of the tail of the free list} DiskAddr; SegKind : SpiceSegKind;  NumFree : FSBit32; {Hint of how many blocks are on NumBlksInUse : integer; {segments can have gaps, block n  the free list} RootDirID : SegID; {where to find the Root may exist when block n-1 has never been allocated.  Directory} BadSegID : SegID; {where the bad segment is}   { The user ID of the user. } GroupID: IDType; { The group ID of the user. } Encry{ Normal progress ignore window boundary. { Use time to initialize Busy. { } { 6 Jan 82 1.15 Brad Myers { Keep busy ptPass: PassType; { The encrypted password. } Profile: String; { Path name of the profile filcursor in window. { } { 29-Dec-81 1.14 Brad Myers { Add busy procedures for when busy but don't know how long until donee. } end; function FindUser(UserName: String; var UserRec: UserRecord): Boolean; function ValidUser( UserName, P. { } { 2-Dec-81 1.13 John Strait { 1) Use type Long instead of FSBit32 from Arith. { 2) Reset default cursor in Quitassword: String; var UserRec: UserRecord): Boolean; function AddUser(UserName, Password: String; Group: IDType; Progress. { } { 28-Sep-81 1.12 John Strait { Use long arithmetic in a new routine so that when the number of steps { i ProPath: String): Boolean; procedure NewUserFile; procedure ListUsers; function RemoveUser(UserName: String): boolean;s larger than 1024 we can show finer grain. { } { 31-Aug-81 1.11 John Strait { Show finer grain for Stream files. This  const PassFile = '>System.Users'; const MaxUsers = 10; type Users = array[0..MaxUsers] of UserRecord; {******means that UtilProgress now { uses long arithmetic. { } { 31-Aug-81 1.10 John Strait { Add stuff to show progress read**************} Private {********************} ing Stream files. { } { 19-May-81 1.9 Brad Myers { New IO module name. { } { 9-Mar-81 1.8 Don Scelza { Changed module name and added code to { allow the user to specify the number of scan lines. { } { 20-Feb-81 1.7 Brad A. Myers { New cursor { } { 2-Jan-81 1.6 Miles A. Barel { Initial Creation { } Exports Procedure LoadCurs; Procedure ShowProgress(NumLines: Integer); Procedure QuitProgress; Procedure StreamProgress( var F: File ); Procedure ComModule UtilProgress; {----------------------------------- { { Progress Reporting Routines { Copyright (C) 1981 Three RiversputeProgress( Current, Max: Integer ); Procedure LoadBusy; Private  Computer Corporation { { Abstract: { Routines to show progress of utilities. { {------------------------------------}  { 18 Jan 82 1.16 Brad Myers { Busy cursor bounce off borders. { Start progress at top. { QuitProgress set function.   hint to a candidate for the FreeHead} PrevAdr : DiskAddr; {Dis significant bits for the 12 or 24 megabyte dk Address of the next block in this segment} NextAdr : DiskAddrisks. The lower byte of the lower word ; {Disk Address of the previous block in this segment} end;  is always zero (since a disk address is a page address, ptrHeader = ^Header; DiskCommand= (DskRead, DskWrite, DskFirstWrite, DskReset, DskHdrRead, Ds which is 256 words } funkHdrWrite); {last ones for error reporting} var DiskSegment : integer; {a memory segment for DiskIO} ction FieldToAddr(disk: integer; fld : integer) : DiskAddr; { Makes a DiskAdd procedure InitDiskIO; {initialize DiskIO, called at boot time} procedure ZeroBuffer(ptr : ptrDiskBuffer)r out of a short address and a disk y [1..8] of char; PartStart : DiskAddr; PartEnd : DiskAddr; ; {write zeroes in all words of the buffer. When reading an unallocated  SubParts : array [0..63] of DiskAddr; PartRoot : DiskAddr;  block, Zeros are returned in the buffer} func PartKind : PartitionType; PartDevice : DeviceType ); {6 is the fortion WhichDisk(addr : DiskAddr) : integer; {Tells you which disk number a Dismat of a block of a Directory} 6: ( Entry : array [0..FILESPERDIRBLK-1] ofkAddr is on} function AddrToField(addr : DiskAddr) : integer; {gives you a one word short  DirEntry ) end; ptrDiskBuffer = ^DiskBuffer; He address by taking the lower byte of the upper word and ader = packed record {format of a block header} SerialNum : DiskAddr; {Actually has the SegID  the upper byte of the lower of the file} LogBlock : integer; {logical block number} Filler : integer; {holds a word. The upper byte of the upper word can't have any   Fix bug where MMFirst was getting trashed by SwapIn. { } { 28 May 81 V2.3 BAM { New light. { } { 26 May 81 V2.2 JP character used in booting). { } { 18 Feb 81 V1.5 JPS { Define fields in the SIT to remember names of boot loaded segmentS { Show swapping with a "light". { } { 21 May 81 V2.1 JPS { Fix various serious bugs in SwapIn procedure. { Delete sevs. { Remove most of InitMemory since it is done now by MakeBoot. Make IOSeg { a constant. { } { 17 Feb 81 V1.4 DAS { Reral unused variables in various procedures. { } { 12 May 81 V2.0 JPS { 1) Split Memory into two modules: Memory (user caemoved the include file SegNumbers. Placed the segment number { definitions inline. { } { 16 Feb 81 V1.3 DAS { Changed module Virtual; {----------------------------------------------------------------------------- { { Virtual - Perq virtullable routines, swappable) { and Virtual (system callable routines, unswappable). { 2) Move FileIdToSegId and SegIdToFileIal memory manager. { J. P. Strait 1 Jan 80. { Copyright (C) Three Rivers Computer Corporation, 1980. { { d into Virtual. { 3) Use exceptions rather than MemoryError. { } { 24 Mar 81 V1.9 JPS { Begin adding stuff for virtual mAbstract: { Virtual is the Perq virtual memory manager. It supervises the { segment tables and exports proceduresemory. { } { 23 Mar 81 V1.8 JPS { Convert to standard documentation form. { Delete DEBUG stuff. { Delete OutputF. { Ad for swapping memory segments. { Virtual is the portion of the Perq memory manager which must remain { memory resid "MM" to the beginning of names which are exported but are not needed by { programs which import the memory manager. { Removedent at all times. { Perq physical memory is segmented into separately swappable items { (called segments) which m Concat call from MemoryError. { Remove import of Perq.String. { } { 24 Feb 81 V1.7 JPS { 1) Allow the ScreenSeg to chanay contain either code or data. { { Design: { See the Q-Code reference manual. { {-----------------------------------ge sizes. To allow this, the memory { manager must prevent system segments (those with RefCount > 1) from { being moved------------------------------------------} {-----------------------------------------------------------------------------  into the area of memory which might be used for the { screen. This is a hack which guarantees that the system can expand { Change Log: { { 13 Jan 82 V2.8 Brad Myers (found by JPS) { Handler for XStackOverflow in SwapIn and SwapOut { 10 D{ the screen to its original size after returning from a user program. { This change was originally made by RFR, but had ec 81 V2.7 WJHansen { change to use long arithmetic for xxTime; remove Arith { 25 Oct 81 V2.6 JPS { Changes to agreto be converted for { memory manager version 1.5 and greater. { 2) Remove PrintTable and PrintFreeList. { } { 23 Feb 81e with V2.11 Memory. { } { 24 Sep 81 V2.5 WJH { When delete a segment, make it swappable. { } { 3 Jul 81 V2.4 JPS { V1.6 RFR { Added DK and CH to system boot record (they will be filled by the boot { microcode with the disk number and boot } function LogAddrToPhysAddr(addr : DiskAddr) : DiskAddr; {translate a Logical Disk  if error occurred } Exception DiskFailure(msg: String; operation: DiskCAddress (used throughout the system) to and from a ommand; addr: DiskAddr; softStat: integer); Exception DiskError(msg: String); Exception BadDevice;  physical Disk Address (the kind the disk contoller sees) Logical Disk Addresses  Var ErrorCnt : Array[IOEFirstError..IOELastError] of integer; {******************} private {***************************} use a sequential numbering system Physical Disk Addre sses have a Cylinder-Head-Sector system This routine  calls MapAddr (a private routine which does the translation) Map Addr  implements interlace algorithm} function PhysAddrToLogAddr(disk : integer; addr : DiskAddr) : DiskAddr; function LastDiskAddr(DevType : DeviceType) : DiskAddr; {Gets the Disk Address module Dynamic; {----------------------------------------------------------------------------- { { Dynamic - Perq dynam of the last possible page on the device} functiic memory allocation and de-allocation. { J. P. Strait 1 Jan 80. { Copyright (C) Three Rivers Computer Corpor number } procedure DiskIO(addr : DiskAddr; ptr : ptrDiskBuon NumberPages(DevType : DeviceType) : FSBit32; {Return the number of ffer; hptr : ptrHeader; dskcommand : DiskCommand); {Do a disk pages on a device} procedure DiskReset; {Reset the disk controller and recalibrate the actuater} function TryDiskIO(add operation, if errors occur, r : DiskAddr; ptr : ptrDiskBuffer; hptr : ptrHeader; dskcommand : DiskCommand; numTrie exits via DiskErrors: integer) : boolean; {Try a disk operation, but, return false  edure MakeEdge( var E: MMEdge; S: SegmentNumber ); procedure DeleteSegment( var S: SegmentNumber ); procedure SwapOut( var E: MMEdge ); procedure SwapIn( E: MMEdge; S: SegmentNumber; P: MMPosition ); procedure Compact; procedure KeepSegments; procedure FindHole( Fsize: MMIntSize; ForUserSegment: Boolean ); procedure IncIOCount( S: SegmentNumber ); procedure DecIOCoumodule Writer; {----------------------------------------------------------------------------- { { Writer - Stream pnt( S: SegmentNumber ); procedure SwapSegmentsIn( S1, S2, S3, S4: SegmentNumber ); var ScreenLast: Integer; Keep1ackage output conversion routines. { J. P. Strait ca. 1 Jan 81. { Copyright (C) Three Rivers Computer Corporatio, Keep2, Keep3, Keep4: SegmentNumber; Kludge: record case Integer of 1: (A: DiskAddress); 2: (Dn, 1981. { { Abstract: { Writer is the character output module of the Stream package. It { is called by code ge: Double) end; BlockHeader: IOHeadPtr; BlockAddress: Double; BlockSId: SegId; Status: IOStatPtnerated by the Pascal compiler in response to { a Write or Writeln. It is one level above Module Stream and uses { to use Perq_String from Perq.String { } { 11 Feb 81 DCF { Changed calls to PString to conform to new PString. This r; BootSerialNum: Double; BootSegId: SegId; SwapSId: SegId; private module is { compatable with the new System and Compiler. { } { 13 Jan 81 V1.2 JPS { 1) Allocate the IOSeg in memory mana{ VRD Definitions. {----------------------------------------------------------------------------- { { VRD.Dfs - Variablger initialization as a locked { segment at the high end of memory. Use the last block in memory (the { Krnl no longer e routine descriptor definitions. { J. P. Strait 10 Dec 80. { Copyright (c) Three Rivers Computer Corporation, 1needs it). { 2) Move $R- to private part. { } { 10 Oct 80 V1.1 JPS { Add support for the diagnostic display (DDS). { } 980. { { Abstract: { This file defines offsets within Variable Routine Descriptors (VRD's). { {---------------------- {-----------------------------------------------------------------------------} exports const VirtualVersion = '2.8'; -------------------------------------------------------} { 10 Dec 80 1.0 J. P. Strait. { Start file. { } VRD imports Memory from Memory; imports IO_Unit from IO_Unit; imports DiskIO from DiskIO; function ReturnSegSN = 0; { segment number } VRDGP = 1; { global pointer } VRDRN = 2; { routine number } VRment: SegmentNumber; procedure ReleaseSegmentNumber( Seg: SegmentNumber ); function NewSegmentNumber: SegmentNumber; procDSL = 3; { static link } VRDSize = 4; { size of a VRD }   of a given size with a given alignment may be allocated from { any data segment. If the data segment is full (doesn't c{ EEB Definitions. {----------------------------------------------------------------------------- { { EEB.Dfs - Exceptiontain { enough free memory to allocate), the segment is increased in { multiples of the segment's increment size on enable block definitions. { J. P. Strait 10 Dec 80. { Copyright (c) Three Rivers Computer Corporation, 1980. until there is enough { free memory to allocate. Similarly, memory that was once allocated { may be deallocated.  { { Abstract: { This file defines offsets within the Exception Enable Blocks { (EEB's) in the Perq memory stack. { { Design: { Free memory within each segment is linked into a circular freelist { in order of address. Each fr Only the routine number of the { handler is required (not a full variable routine descriptor) { because the handee node is at least two words long and { is of the form { { record Next: Integer; { Length: Integler is guaranteed to be nested immediately { inside of the routine which enabled it. The handler's segment { number; { Rest: 2*Length - 2 words { end; { { Where Next*2 is the address of the next free noder is the same as the enabler's segment number, the handler's { static link is the enabler's activation pointer, and the e and Length*2 is the { number of free words. { {---------------------------------------------------------------------- { handler's global pointer is the same as the enabler's global { pointer. { {------------------------------------------} { 26 Oct 81 V1.4 JPS { Make certain that the segment passed to NewP and DisposeP is a data segment. { } { ------------------------------------------} { 10 Dec 80 1.0 J. P. Strait. { Start file. { } EEBES = 0; 12 May 81 V1.3 JPS { Use exceptions rather than MemoryError. { } { 23 Mar 81 V1.2 JPS { Convert to standard documentat { exception segment number } EEBER = 1; { exception routine number } EEBHR = 2; { handler routineion form. { } { 13 Jan 81 V1.1 JPS { Fix assignment of nil in New and Dispose. { Change bad constant #200000 to #100000. number } EEBNE = 3; { next exception pointer } EEBLength = 4; { size of an EEB }  { Move $R- to private part. { } exports const DynamicVersion = '1.4'; imports Memory from Memory; procedure NewP( S: SegmentNumber; A: integer; var P: MMPointer; L: integer ); procedure DisposeP( var P: MMPointer; L: integer ); ation, 1980, 1981,1982. { { Abstract: { Dynamic implements Pascal dynamic allocation - New and Dispose. { Memory private  teCh( Var F: FileType; X: char; Field: integer ); procedure WriteChArray( var F: FileType; var X: ChArray; Max, Field: integerHERS.PAS Get IOPRIV.PAS IO_PRIVATE.PAS Get IOUNIT.PAS IO_UNIT.PAS Get LIGHTS.PAS LIGHTS.PAS Ge ); procedure WriteIdentifier( var F: FileType; X: integer; var IT: IdentTable; L, Field: integet LOADER.PAS LOADER.PAS Get MEMORY.PAS MEMORY.PAS Get MOVEME.PAS MOVEMEM.PAS Get MULTIR.PAS r ); procedure WriteInteger( var F: FileType; X: integer; Field: integer ); procedure WriteString( var F: FileType; var X: S MULTIREAD.PAS Get PASLON.PAS PASLONG.PAS Get PASREA.PAS PASREAL.PAS Get PERQST.PAS PERQ_tring; Field: integer ); procedure WriteX( var F: FileType; X, Field, B: integer ); private STRING.PAS Get PMATCH.PAS PMATCH.PAS Get POPCMD.PAS POPCMDPARSE.PAS Get POPUP.PAS POPUP.PAS GSides 2 Density SINGLE Fast ! OS.NOSOURCE.SOURCE - OPERATING SYSTEM NONSOURCE FILES ! Created 12 Feb 82 14:14:01 Getet POPUPC.PAS POPUPCURS.PAS Get PROFILE.PAS PROFILE.PAS Get RANDOM.PAS RANDOMNUMBERS.PAS Get RAS ACB.DFS ACB.DFS Get ALLOCD.PAS ALLOCDISK.PAS Get ARITH.PAS ARITH.PAS Get CLOCK.PAS TER.PAS RASTER.PAS Get RD.DFS RD.DFS Get READDI.PAS READDISK.PAS Get READER.PAS R CLOCK.PAS Get CMDPAR.PAS CMDPARSE.PAS Get CODE.PAS CODE.PAS Get CONTRO.PAS CONTROLSTORE.PEADER.PAS Get REALFU.PAS REALFUNCTIONS.PAS Get RS232B.PAS RS232BAUD.PAS Get RUNREA.PAS RUNREAD.AS Get DISKIO.PAS DISKIO.PAS Get DYNAMI.PAS DYNAMIC.PAS Get EEB.DFS EEB.DFS Get EDITK.PAR PAS Get RUNWRI.PAS RUNWRITE.PAS Get SCREEN.PAS SCREEN.PAS Get SCROUN.PAS SCROUNGE.PAS Get SHEL EDITORK.PARAS Get ETHER1.PAS ETHER10IO.PAS Get EXCEPT.PAS EXCEPT.PAS Get EXCEPT.DFS EL.PAR SHELL.PARAS Get STREAM.PAS STREAM.PAS Get SYSTEM.PAS SYSTEM.PAS Get SYSDEF.PAS  Stream's output routines. { {-----------------------------------------------------------------------------} { 4 Jun 81XCEPT.DFS Get FILEAC.PAS FILEACCESS.PAS Get FILEDE.PAS FILEDEFS.PAS Get FILEDI.PAS FILEDIR.PAS  V2.2 John Strait. { Add Virgil headers and comments. { } { 19 May 81 V2.1 Brad Myers. { Turn off Range checking so pr Get FILESY.PAS FILESYSTEM.PAS Get FILETY.PAS FILETYPES.PAS Get FILEUT.PAS FILEUTILS.PAS Get GEinting of chArrays will work. { } { 12 May 81 V2.0 John Strait. { Use exceptions rather than StreamError. { } exportTTIM.PAS GETTIMESTAMP.PAS Get GPIB.PAS GPIB.PAS Get IO.PAS IO.PAS Get IOERRO.PAS s imports Stream from Stream; procedure WriteBoolean( var F: FileType; X: Boolean; Field: integer ); procedure Wri IOERRORS.PAS Get IOERRM.PAS IOERRMESSAGES.PAS Get IOINIT.PAS IO_INIT.PAS Get IOOTHE.PAS IO_OT  the definitions from { the program TestEther. { {------------------------------------------------------------------------- Receive completes the { next Receive in the chain is started. { { Command information for the Ethernet driver is provided in} {********************} Exports {********************} {----------------------------------------------------- an { Ethernet Device Control Block, DCB. All data areas referenced by { pointers in the DCB as well as the DCB itself must bmodule Ether10IO; {------------------------------------------------------------------------ { { Abstract: { This module ------------------ { { This module provides the raw I/O interface to the Three Rivers Computer { Ethernet system. The procedprovides the client interface to the 10 Mbaud Ethernet { microcode. { { Written by: Don Scelza { { Copyright (C) Three Riures in this module allow the client to { send and receive packets on the net. { { For details of the Physical and Data Linkvers Computer Corporation, 1981 { {-------------------------------------------------------------------------} {------- layers of the network { see the document: { { The Ethernet { A Local Area Network { Data Link Layer and Physical La------------------------------------------------------------------- { { Change History: { { 28 jan 82 Version 1.8 Sayer Specifications { { DEC - Intel - XEROX { { For details on the Three Rivers hardware interface to the network see: { ndeep Johar { Etherheaders aligned at 8 word boundaries. { { 30 dec 81 Version 1.7 Don Scelza { Made changes to { Ethernet Interface Programmers Guide { { Pradeep Reddy { { For details on the interface presented, to this module, by allow for Back-off on transmit. { { 17 Nov 81 Version 1.6 Don Scelza { Added the exception E10ReceiveDone. Georgethe { Ethernet microcode see the file: { { Ether10.Micro { { Donald A. Scelza { { Following is some general informati R. needed this to implement { IP/TCP { { 09 Nov 81 Version 1.5 Don Scelza { Made some changed in the IO routineon about the client interface { presented by the Ethernet microcode and this module: { { It is possible to always have a rece. Changed the way that { DCBs are linked. { { 05 Nov 81 Version 1.4 Don Scelza { Changed to look at the constaive pending. If a send command { is executed while a receive is pending the internal state of the { interface is saved in a rnt UseSys. { { 04 Nov 81 Version 1.3 Don Scelza { Took out some code to create the module EtherInterrupt. { { 02egister save area in memory. This is { done by saving the VA of the DCB for the receive. After the { send has completed the r Nov 81 Version 1.2 Don Scelza { Implemented the changes from the design review. { { 29 Oct 81 Version 1.1 eceive state is reloaded and the receive is { restarted. { { In addition to the ability to do a Receive followed by a Send, Don Scelza { Started to add code to the module. { { 02 Oct 81 Version 1.0 Don Scelza { Created the module. Tookit is { also possible to do multiple Receives. The Receives are linked using { the NextDCB field of the Ethernet DCB. When a UAL.PAS Get VRD.DFS VRD.DFS Get WRITER.PAS WRITER.PAS Shell Copyright 1982, 3RCC Commands and keywords $FileUtmodule PasReal; {----------------------------------------------------------------------------- { { PasReal - Scott L. ilities - Index of information on using files $Program - Index of how to write and run programs $Devices - Index oBrown Created: 25-Nov-81 { Copyright (C) 1981 - Three Rivers Computer Corporation { { Abstract: { { PasReal if information on using various devices $Microcode - Index on nitty-gritty %Notation Conventions %Introduction %? - Ss an extra character input module of the Stream package. { Its routines are called by code generated by the Pascal compilerhow command names %Bye - Stop using Perq %Details - Show details of system environment %Editor - Edit a text file %FindStrin { in response to variations on Read, Readln, Write and Writeln { statements. It is one level above Module Stream ang - Search multiple files for a given string %Help - Give explanations of programs or keywords %Login - Start using Perq %Pd uses Stream's { lower-level input routines. { {------------------------------------------------------------------------ause - Stop execution until RETURN %Perq.Files - Software Index maintenance program %ScreenSize - Shrink screen for next execu-----} {----------------------------------------------------------------------------- { { ChangeLog: { { 26-jan-82 V0tion %SetTime - Change current time %Statistics - Turn on or off the display of execution statistics %UserControl - Maintain .1a Scott L. Brown { Modified to raise the exception NotReal instead of NotNumber (in ReadR). { { 25-Nov-81 V0.0 Scott L.the list of users allowed on the Perq FileUtilities>FileUtilities.Index File Utilities Commands and keywords Brown { Creation of real read and write routines ReadR and WriteR. { {------------------------------------------------------ %Append - Add one file to the end of another %Copy - Copy a file to another name %Delete - Remove a file %Directory - Sho-----------------------} exports imports Stream from Stream; procedure ReadR(var F: FileType; w what files exist %DirTree - Show directory structure as a tree %Dismount - Discontinue use of device %ExpandTabs - Change T var value: real); procedure WriteR(var F: FileType; e: real; TotalWidth: inABs to multiple spaces %MakeDir - Create a new directory %Mount - Start using device %Partition - Reorganize disk %Patch - Mteger; FracDigits: integer; format: integer); private odify a disk block %Path - Change to another directory %Rename - Change the name of a file %Scavenger - Recover disk if file  SYSTEMDEFS.PAS Get USERPA.PAS USERPASS.PAS Get UTILPR.PAS UTILPROGRESS.PAS Get VIRTUA.PAS VIRT  { bits that were received. To translate this into the number of data { bytes you must perform a number of operations. First { 0 - receive has finished. 1 for trans. } Busy: boolean; { The interface is bust. } UnU divide it by 8. { This will give the number of bytes that were received. If the number { is not evenly divisible by 8 then tsed4: boolean; ClockOver: boolean; { The microsecond clock overflowed. } PIP: boolean; here was a transmissintializeon error. { After the division you must subtract the number of bytes in the { header and the CRC. { There is a Packet In Progress. } Carrier: boolean; { There is traffic on the net. } RetryTime:  There is a total of 20 bytes in these two portions { of the packet. { {----------------------------------------------------0..15; UnUsed12: boolean; UnUsed13: boolean; SendError: boolean; { Could not send packet --------------------} imports SystemDefs from SystemDefs; imports System from System; { { Define the types and variafter 16 tries. } CmdInProg: boolean; { There is a command pending. } BitsRecv: integer; { Ne LOCKED in { memory until the request has completed. They can NOT be moved. { The best way to do this is to mark the segmentables used by the Network stuff. { } type { { These are the valid commands for the Ethernet interface.  that the buffers are { allocated from as UnMovable. This will allow the memory manager to { place the buffers in a convient { } EtherCommand = (EReset, EReceive, EPromiscuousReceive, ESend); { { An Ethernet address is 48 bits long. place in memory before they are { locked down. { { The Ethernet driver needs to have a four (4) word area of memory in which It is made up of 6 { octets or in our case 3 words. { } EtherAddress = packed record { An address on the net  { it can save registers. A pointer to this area of memory is provided { by the BuffPtr when a Reset command is executed. Oncis 48 bits } High: integer; Mid: integer; Low: integer; end; { { This recoe the Reset { command has been processed this register save area can NOT be moved. { To change the register save area another rd defines an Ethernet status block. The first { 15 bits of the block are defined by the hardware interface. { The 16Reset command must be { executed. { { The Ethernet DCB must be unmovable while the command is pending. { { To wait for theth bit of the first word and the second word are defined by the { Ethernet microcode. { { Alignment: Double wo completion of a command it is possible to spin on the { Command-In-Progress bit in the status block. This bit will be clearedrd. { Locked: Yes. { } EtherStatus = packed record { The status record. } CRCError: boolea { when the requested command has been completed. { { { After a receive the Bits field of the status block has the number ofn; { There was a CRC error.} Collision: boolean; { There was a collision } RecvTrans: boolean; escriptions of the commands given in this manual observe the following notational conventions: o Lowercase text iribes the action the system performs or the name of the utility that performs the action. When submitting a command thandicates a variable whose actual value is determined when the command is entered o Square brackets ([]) indit is implemented in the Shell, you need not type the entire command name; you can abbreviate the command name to the structures damaged %SetSearch - Change list of directories to search for files %TypeFile - Rapidly display a file Program>Prcate optional entries in a command line. Note that when an option is used, the brackets are not part of the sogram.Index Creating and running programs Commands and Keywords %Compile - Run the PASCAL cyntax. o The circumflex (^^) indicates the control key o CR indicates carriage return o SHIFT iompiler %Debugger - The preliminary debugger %Linker - Combine compiler outputs for execution %ReRun - Use new arguments and ndicates the shift key Introduction Introduction This manual describes the PERQ Utility Programs and explains their re-execute last program run %Run - Execute a program Devices>Devices.Index Using Various devices Co use. As required, the manual references online or other Three Rivers Computer Corporation publications. Most of thmmands and Keywords %Chatter - Talk over RS232 line %Floppy - Do file operations on floppy disks %FTP - Transfer files to ae commands described in this manual are implemented as Pascal files, but some are implemented directly by the Shell. To isnother computer %Print - Print a file to GPIB or RS232 %SetBaud - Change baud rate on RS232 MicroCode>MicroCode.Index Microsue a command, type a command line in response to the default PERQ prompt. You can also use a pop-up menu, as described iCode Commands and Keywords %MakeBoot - Enable booting a new system %ODTPRQ - Debug microcode across a Link %Pn the PERQ Introductory User Manual, to issue Shell commands. If you elect to use a pop-up menu, the menu displays all oRQMic - Microcode assembler %PRQPlace - Combine microcode and assign addresses %QDis - Display the QCodes in a compiled .SEG ff the valid commands. Use the pointing tablet to specify the selection. The FLOPPY and FTP utilities also permit youile %Swap - Turn swapping on or off Notation Notation Conventions. This manual describes the PERQ Utility Program to enter their respective commands through pop-up menus; a press of the pointing tablet in response to either of the s and commands to the Shell. The command descriptions are in alphabetical order regard- less of whether the command is imprompts for these utilities displays a menu for the utility commands. If you type a command line, the line consists oplemented as a Pascal file or through the Shell directly (The Introductory User Manual describes the Shell.) The df a command name, input and output arguments as needed, optional switches, and a line terminator. The command name desc . { } pEtherStatus = ^EtherStatus; pEtherBuffer = ^EtherBuffer; pEtherHeader = ^EtherHeader; pEtherD UnUsed0: boolean; UnUsed1: boolean; UnUsed2: boolean; UnUsed3: boolean; UnCB = ^EtherDCB; { { This is the definition of an Ethernet Device Control Block. { { Alignment: Quad woUsed4: boolean; UnUsed5: boolean; UnUsed6: boolean; UnUsed7: boolean; UnUsed8: boord. { Locked: Yes. { } EtherDCB = packed record HeadPtr: pEtherHeader; BuffPtr: lean; UnUsed9: boolean; UnUsed10: boolean; UnUsed11: boolean; UnUsed12: boolean;  pEtherBuffer; StatPtr: pEtherStatus; Cmd: EtherCommand; BitCnt: Integer; { UnUsed13: boolean; UnUsed14: boolean; CmdInProg: boolean; end; puSClkDCB = ^uSClkDCB;  Total bits in buffer and header } NextDCB: pEtherDCB; end; { { This is the definition that is  { { Define the constants for the address block supplied to Three Rivers by { Xerox. { { High 16 bits (2 octets) are used to create the register save { area. { { Alignment: Double word. { Locked: Yes. { } 02 1C (Hex). { Next 8 bits (1 octet) is 7C (Hex). { { The low order byte of the second PERQ word as well as the third PERQ wo EtherRegSave = record RecvDCB: pEtherDCB; SendDcb: pEtherDCB; end; pEtherRegSrd { are Three Rivers defined. Currently the low order byte of the second word { is used to define the type of interface. Thave = ^EtherRegSave; { { Following are the definitions that are used to deal with the { micro-second cle valid values are: { { 0 - Interface is on an IO option board. { 1 - Interface is on the IO board { } conumber of bits that were received. } end; { { This record defines the header for an Ethernet transfer. ock. { } { { The microsecond clock takes a two word combined control and { status block. The first word o { { Alignment: 8 word. { Locked: Yes. { } EtherHeader = packed record Dest: Etf the block gives the number { of microseconds to be loaded into the clock. { The second word provides the status infoherAddress; Src: EtherAddress; EType: Integer; { Type field defined by XEROX } enrmation from the { clock. Once a clock command has been started it is { possible to spin on the CmdInProgress bit in d; { { This record provides the definition of an EtherBuffer. { { Alignment: 1k word. { Locked: the control { block. When the bit is cleared the specified number of { micro-seconds has elapsed. { { Align Yes. { } EtherBuffer = array [0..749] of integer; { { Define all of the pointers that we needment: Double word. { Locked: Yes. { } type uSClkDCB = packed record uSeconds: integer; he above command is: RENAME OLDFILE ~ NEWFILE or RENAME OLDFILE NEWFILE You can mix formats;itch (either type /HELP or press the HELP key); when specified before the command, the Help switch supplies gener the utility prompts for whatever you omit. For example: RENAME OLDFILE Rename OLDFILE to: NEWFILE There al information and when specified after a command, the Help switch provides specific information. Switches always are no defaults for prompts. You must supply a response. However, your response to the prompt can request help (type /HELP start with a slash (/) and are generally optional. If a switch accepts a parameter, specify the parameter after the or press the HELP key). If you request HELP, the utility displays specific information and then exits to the Shell.  switch, but preceded by an equal sign (=). For example: /switch=parameter The effect of a switch is global; regardIf you neglect to supply an argument to a utility that uses the default file (for example, the Editor or Linker), tless of where the switch appears on the command line, it has the same effect. A switch applies to every argument. number of letters unique to other command names. For example, the Mount command can be abbreviated M because it is the onlhe utility appends the default file name to your command. For example, if the default file is sys:user>myfile, typing the coy command within the Shell beginning with that character. You can abbreviate the Path command to Pat, but not Pa because thmmand: EDIT is the same as typing: Edit sys:user>myfile If a command requires an input and an outpe Shell includes the Pause command. The question mark command (see section 3) lists all commands. You can modify the listut argument, you can specify the arguments as either INPUT~OUTPUT or INPUT OUTPUT You can separ by changing your profile file. Input and output arguments further define the command action. The input and output argate the input and output arguments with multiple spaces; only the initial space delimiter is relevant. However, if uments are usually file specifiers. Some commands require arguments as part of the command line. Other commands ua command accepts multiple input or output arguments, you must separate like arguments with commas (,) and distinguish inse the default file as the argument if you do not supply one. If you neglect to supply a required argument, the utility put from output with the tilda character (~). For example: input1,input2,...inputn ~ output1.output2,...outputn If prompts with a few words indicating the general nature of the missing argument. For example, the Rename command perfora command accepts multiple input arguments and no output arguments, you must separate the arguments with a comma (,). ms as follows: >RENAME File to rename: OLDFILE Rename OLDFILE to: NEWFILE The single line format for t Switches modify the action of the command and therefore must follow the command specification. An exception is the Help sw the I/O board. } { { These are some other useful constants. { } const MinDataBytes = 46; { Smallest nu---------------------------------- { { Abstract: { This exception is raised if a byte count passed to this { interface mber of data bytes in a packet. } MaxDataBytes = 1500; { Largest number of data bytes in a packet. } NumDCBs = is not in the valid range. The number of data bytes { in an Ethernet packet must be in the range 46 <-> 1500, { (MinDataB16; { The number of DCBs, commands, possible at } { a single time } { { Theytes <-> MaxDataBytes). { {----------------------------------------------------------------} exception E10DByteError; {-se are the procedures exported by this module. { } procedure E10Init; procedure E10IO(Cmd: EtherCommand; Header: pEtherHea------------------------------------------------------------- { { Abstract: { This exception is raised if the number of Bitder; Buff: pEtherBuff; Stat: pEtherStatus; Bytes: Integer); procedure E10Wait(Stat: pEtherStatus); proces passed to { E10DataBytes does not form a valid packet. { {---------------------------------------------------------------dure E10Reset(MyAdr: EtherAddress); function E10DataBytes(RecvBits: Integer): Integer; function E10GetAdr: EtherAddress; pr} exception E10BadCommand; {--------------------------------------------------------------- { { Abstract: { This exceocedure E10State(var NumSend, NumReceive: Integer); procedure E10WIO(Cmd: EtherCommand; Header: pEtherHeader; ption is raised if a bad command is given to any { of the routines in this package. { {------------------------------------ Buff: pEtherBuff; Stat: pEtherStatus; Bytes: Integer); { { These are the exceptions that may be raised by thi---------------------------} exception E10TooMany; {---------------------------------------------------------------- { { s module. { } exception E10NInited; {--------------------------------------------------------------- { { Abstract: { Abstract: { This exception is raised if more than NumDCBs commands are { executed at any time. { {---------------------- This exception will be raised if any procedures in this package { are called before E10Init. { {---------------------------------------------------------------------} exception E10STooMany; {-------------------------------------------------------------------------------------------} exception E10NReset; {---------------------------------------------------------------------- { { Abstract: { This exception is raised if more the client tries to execute more { than one send. { {-----st TRCCAdrMid = 31744; { 7C hex in the high order 8 bits. } TRCCAdrHigh = 540; { 02 1C hex. } ---- { { Abstract: { This exception will be raised if any transfer commands are executed { before a E10Reset is done. {EBoardOption = 0; { The interface is on an I/O Option board. } EBoardIO = 1; { The interface is on  {---------------------------------------------------------------} exception E10ByteCount; {----------------------------- the utility displays specific help and then exits. Carriage return is the line terminator for all commands. Rather than tere on a line in a user command file, but remember that the system ignores all characters after the exclamation mark. ? yping a command line to initiate and direct a utility, you can use a user command file. A user command file is a text file co? - Show command names The question mark command lists all the commands implemented in the Shell. Additionally, the containing a series of commands interpretable by the various utilities. A user command file is a sequential file cmmand provides some information on what each command does and how it is called. FileUtilities>Append Append Append copontaining a list of utility specific commands. Rather than typing commonly used command sequences, you can type the sequenies one or more files to the end of an existing file. The command accepts a list of input files, separated by commas, and putsce once and store it in a file. The user command file is specified in place of the command line(s) normally submitted to  each file on the end of the first. For example, the command line: APPEND file1,file2 puts file2 on to the endthe utility. To inititate user command files, replace the command line for a utility with a file specifier, preced of file1. The append operation is successive. For example, the command line: APPEND file1,file2,file3 first ped by an at sign (@). The utility requesting input then accesses the specified file and starts to read and respond to thuts file2 on to the end of file1 and then puts file3 on to the end of file1. Bye Bye - Stop using Perq Bye logs yoe commands contained within it. For example, to initiate a file of FLOPPY commands, type the following in response to theu off the PERQ. Type: BYE and it types your name, the date, and time of logoff. Login then loads and you orIf a command accepts multiple input or output arguments, no switch applies to one and not another argument. Some switches ar FLOPPY prompt: FLOPPY>@FLOPPY.CMD The FLOPPY utility accesses the file and then executes the commands contained wie mutually exclusive (for example, /ASK and /NOASK). If you specify a switch that conflicts with a previously specified switthin the file FLOPPY.CMD. The default file type for user command files is .CMD. Thus the above command line could also ch, the last occurence has precedence. Likewise, if you change parameters by specifying a switch multiple times, only thbe typed as follows: FLOPPY>@FLOPPY You can nest user command files by simply specifying @file within the user e last occurence has an effect. All of the commands and utilities described in this manual accept the /HELP switch (ecommand file. Also, the last line of a user command file can invoke another command file and recursive use is permitted. Toither type /HELP or press the HELP key) to provide general information. Note that /HELP overrides all other switches;  comment a user command file, start the comment line with an exclamation mark (!). The exclamation mark can appear anywh  { This procedure is used to initialize the Ethernet module. { It must be called before any other procedure in this packaget: { This procedure is used to start an Ethernet I/O operation and return. { { Parameters: { Cmd is the command that is -----------------------------------------------------------} exception E10ReceiveDone(Stat: pEtherStatus); {---------------- are used. { { Side Effects: { This procedure will allocate any memory used by this module. { {---------------------------------------------------------------------------- { { Abstract: { This exception is raised when a receive command has fini------------------------------------------------} var SegSize, I: Integer; begin { if Init = InitVal then exit(E1shed. It { is raised by the Pascal level interrupt routine for the net. { { Parameters: { Stat will be set to the statu0Init); } SetDDS(961); {$ifc UseStartIO then} {$message StartIO Version not implemented.} {$s pointer of the command that finished. { {-------------------------------------------------------------------} elsec} LoadExpr(Lor(Shift(EInitLoc,8),Shift(EInitLoc,-8))); InLineByte( #277 {JCS} ); {$endc}  {********************} Private {********************} imports Memory from Memory; imports IO_Unit from IO_Unit; var  SetDDS(962); SegSize := ((NumDCBs * WordSize(EtherDCB)) + WordSize(EtherStatus) + WordSize HeadPtr: pEtherHeader; StatPtr: pEtherStatus; ClkDCBPtr: puSClkDCB; SavePtr: pEtherRegSave; EtherSeg: In(EtherHeader) + WordSize(Double) + WordSize(uSClkDCB) + 256) div 256; CreateSeg(EtherSeg, SegSize, 1, SegSteger; Init: Integer; IsReset: Boolean; ThisMachine: EtherAddress; const EtherLoc = #7000; { Theize); SetDDS(963); for I := 1 to NumDCBs do new(EtherSeg, 4, DCBStack[I]); new(EtherSeg, 8, HeadPtr); ne location of the start of the code. } EInitLoc = #7010; { Location of real initialization code. } ClkLoc = #70w(EtherSeg, 2, StatPtr); new(EtherSeg, 2, SavePtr); new(EtherSeg, 2, ClkDCBPtr); SetDDS(964); SetMobilit20; { Location of the clock code. } type pDouble = ^Double; var DoublePtr: pDouble; const InitVal = y(EtherSeg, UnMovable); SetDDS(965); SendsPosted := 0; RecvsPosted := 0; StackPointer := NumDCBs;  #125252; { 1010101010101010. Special initalized value. } const UseStartIO = false; {$ifc UseStartIO then}  RListHead := nil; RListTail := nil; SListHead := nil; IsReset := false; Init := InitVal; Set {$Message StartIO version} {$elsec} {$Message JCS version} {$endc} imports EtherInterrupt from EtherIDDS(966); end; procedure E10IO(Cmd: EtherCommand; Header: pEtherHeader; Buff: pEtherBuff; nterrupt; procedure E10Init; {-------------------------------------------------------------------------- { { Abstract:  Stat: pEtherStatus; Bytes: Integer); {------------------------------------------------------------------------- { { Abstrac ome special microcode which should be available on your machine. If not, Bye will log off and request that you power down t This doesn't log off or disconnect the remote host. This menu will appear at the very top of your screen he machine by hand. In this case, ^^C will cause Login to run. The command BYE WAIT logs you off the mato prompt you after you've typed ^^R. While in Chatter, if you find that the characters you type are not being echoed prochine and sends the hard disk heads to the center of the disk (the highest disk address). Bye then prints a message and waperly, one of two things may be wrong: the baud rate may be inappropriate or your RS232 cable might not be connected propits for power down or ^^C. When shipping a PERQ, always type BYE WAIT to position the disk heads at the center of the disk. erly. Chatter cannot be used as a half duplex terminal since it does not echo characters locally. Program>Compile Compi The command BYE HELP describes the options available for Bye. You can specify all of the options (OFF, WAIT, le - Invoke the PASCAL compiler The PERQ Pascal compiler translates your Pascal source program into a .Seg file that caand HELP) as switches. It is very important to log off using BYE before powering down the machine. If you do not, certainn be linked and run. There are several ways to invoke the compiler and several options that you can use with it. The comma temporary disk files will not be deleted and they will stay around using disk space until you run the Scavenger (see belownd line takes the form: COMPILE [inputfile] [~] [outputfile] [/switch(es)] Examples of legitimate compiler calls incl). Devices>Chatter Chatter - Talk over RS232 line Chatter allows a PERQ to act as a terminal, using an RS232 line for ude: COMPILE Program.pas COM ProgramX (Note that the .pas extension is icommunication. It is invoked by typing: CHATTER While in Chatter, some special functions can be invoked mplicit; if ProgramX does not exist, the compiler looks for ProgramX.PAS.) by typing ^^R, the function's code letter, and CR. These include S to save everything that comes from the  COMP Program2~Program1 (creates the output file Program1.SEG) COM  remote computer in a file. T to transmit a file across RS232, as if it were being  (compiles the default file) COM /symbol=32 (compiles the default file with 32 symbol  some other authorized user can log back on. The command BYE OFF logs you off and turns off your machine. OFF typed at the keyboard. C to close a file after doing a Save. B to change the RS232 baud rate may be disabled on your PERQ; if so, call Three Rivers Computer Corporation for details on reenabling it. OFF requires s. The default when Chatter comes up is 4800 baud. Q to quit Chatter and return to the Shell.  > EPromiscuousReceive) then raise E10BadCommand; if (SendsPosted + RecvsPosted) = NumDCBs then raise E10TooMany; i end else begin RListTail^.NextDCB := DCBPtr; RListTail := DCBPtr; f (Cmd = ESend) and (SListHead <> nil) then raise E10STooMany; { { Set up the common parts of the DCBs. { After that is don end; end; end; procedure E10Wait(Stat: pEtherStatus); {-----------------------------------------e go into the command specific code. { If we are doing a receive build the linked list of DCBs. { We only have to start the mi------------------------------ { { Abstract: { This procedure will wait for the completion of some Ethernet request. { { crocode if there are no receives { pending. { } DCBPtr := PopDCB; DCBPtr^.HeadPtr := Header; DCBPtr^.BuffParameters: { Stat is the pointer to the EtherStatus that was provided when the { command was initiated. { { Exceptions:to be executed. { { Header is a pointer to an Ethernet header block. The client must fill { in all fields of this headerPtr := Buff; DCBPtr^.StatPtr := Stat; Stat^.CmdInProgress := true; DCBPtr^.Cmd := Cmd; DCBPtr^.NextDCB := ni. { { Buff is a pointer to the buffer that is to be sent or filled. { { Stat is a pointer to a status block for use duril; if (Cmd = ESend) then begin DCBPtr^.BitCnt := (Bytes + 16) * 8; SendsPosted := SendsPosted ng this command. { { Bytes is the number of data bytes that are to be transferred. { This value must be between 46 and 15+ 1; Stat^.RetryTime := 0; SListHead := DCBPtr; DevTab^[Ether10].CtlPtr := recast(DCBPtr, IOBufPtr);00 { { Exceptions: { E10NInited: Raised if this procedure is called before EtherInit. { { E10NReset: Raised if this pr {$ifc UseStartIO then} {$message StartIO not implemented.} {$elsec} LoadExpr(Lor(Shocedure is called before EReset. { { E10ByteCount: Raised if Bytes is not in the valid range. { { E10BadCommand: This isift(EtherLoc,8),Shift(EtherLoc,-8))); InLineByte( #277 {JCS} ); {$endc} end else  raised if the command passed is not { Send, Receive or PromisciousReceive. { { E10TooMany: is raised if too many commandbegin DCBPtr^.BitCnt := 0; RecvsPosted := RecvsPosted + 1; if RListHead = nil then begins are executed at a given { time. { { E10STooMany: is raised if more than one send command is executed. { {------------ DevTab^[Ether10].CtlPtr := recast(DCBPtr, IOBufPtr); RListHead := DCBPtr; RListTail := R------------------------------------------------------------} var DCBPtr: pEtherDCB; begin if Init <> InitVal thListHead; {$ifc UseStartIO then} {$message StartIO not implemented.} {$elsec} en raise E10nInited; if not IsReset then raise E10NReset; if (Cmd <> ESend) and (Cmd <> EReceive) and (Cmd < LoadExpr(Lor(Shift(EtherLoc,8),Shift(EtherLoc,-8))); InLineByte( #277 {JCS} ); {$endc}   input file "FOOZAP.ABCD" would be copied into a new file named "anotherdir>ZAPbaz.rmnDz". If wild cards are used, Cot is hard to specify, the Copy program requires confirmation before creating a file with wild cards in the name. Copy table blocks) If you want to compile a program immediately after editing it, you need not specify its npy asks for verification of each file copied. This can be disabled with the switch "/NOASK" or enabled with "/ASK". Theame since the Shell remembers the last file edited, compiled, linked, or run. Certain switches may be included in th latter is the default. Copy also requests confirmation before overwriting an existing file. You can override this ae source program text. See the PERQ Pascal Extensions Manual for more detailed information on switches and other compiler fction with the /NOCONFIRM switch. (Note that the /NOCONFIRM switch implies the /NOASK switch.) Wild cards are not allowed eatures. FileUtilities>Copy Copy - Copy a file to another name Copy creates a new file identical to the specifiedin the directory part of the source file. However, Copy uses the search list to try to find the source. Note that this is di source. Its command syntax is: COPY SourceFile[~]DestinationFile Copying works across devices and partitfferent from Rename and Delete which always look in only one directory. When the source file name contains no wild cardions (see the PERQ Introduc- tory User Manual for details on devices and partitions). You can also specify the non-file-ss, the destination file name may contain, at most, one occurance of the wild card "*". In this case, the non-directory part tructured devices CONSOLE: and RS:. If you copy a file to the RS232 interface, by default the interface is driven at 9600 of the source replaces the "*" in the destination. For example, COPY sys:Boot>newOS>myprog.Pas dir3>new.* wbaud. To change the baud rate, run the SetBaud program (see below). The source file for Copy may contain wild cardsould copy the file "sys:Boot>newOS>myprog.Pas" into a new file named "dir3>new.myProg.Pas". This is most useful when yo (for a description of the wild cards, see the PERQ Introductory User Manual). If the source contains wild cards, the deu want to copy a file from one directory to another with the same name. For example, COPY dir1>prog.Pas * stination must contain the same wild cards in the same order. In this case, Copy matches all files in the directory with th copies prog.pas from the directory "dir1" into the current directo- ry. If there are no wild cards in the source, an attee source pattern. For each match, the part of the source file name that matches each wild card replaces the correspondingmpt to include in the destination name other wild card characters, besides the single "*" discussed above, may lead to prob wild card in the destination. As an example, for the command: COPY foo*.abc# anotherdir>*baz.rmn#z thelems later. These extra wild cards will be treated as simple literal characters. Because a file name with wild cards in i be received by the network { interface. If there are no Receives pending then the packet { will be dumped. { { Exceptioameters: { RecvBits is the number of bits that were in the packet. This { value will come from the BitsRecv field of the ns: { E10NInited: Raised if this procedure is called before EtherInit. { {------------------------------------------------status block. { { Results: { This function will return the number of data bytes that were in { the packet. { { Excepti-----------------------} var DCBPtr: pEtherDCB; begin if Init <> InitVal then raise E10NInited; HeadPtr^.Sons: { E10NInited: Raised if this procedure is called before EtherInit. { { E10NReset: Raised if this procedure is callerc := MyAdr; { { Clear all current DCBs. { } while RListHead <> nil do begin PushDCB(RListHead); d before EReset. { { E10DByteError: Raised if the numebr of bits in the packet was { not a multiple of 8 or if the number RListHead := RListHead^.NextDCB; end; while SListHead <> nil do begin PushDCB(SlistHea of data bytes was less than { MinDataBytes. { {------------------------------------------------------------------------} d); SListHead := SListHead^.NextDCB; end; { { Set up the DCB. { } DCBPtr := PopDCB; DCBPtr^ Var Tmp1: Integer; begin if Init <> InitVal then raise E10nInited; if not IsReset then raise E10NReset; .Headptr := HeadPtr; DCBPtr^.BuffPtr := recast(SavePtr, pEtherBuffer); DCBPtr^.StatPtr := StatPtr; DCBPtr^.Cmd := Tmp1 := RecvBits div 8; if (Tmp1 * 8) <> RecvBits then raise E10DByteError; Tmp1 := Tmp1 - 20; if (Tmp1 < MinD { E10NInited: Raised if this procedure is called before E10Init. { { E10NReset: Raised if this procedure is called befo EReset; DCBPtr^.BitCnt := 0; DCBPtr^.NextDCB := nil; DevTab^[Ether10].CtlPtr := recast(DCBPtr, IOBufPtr); { re EReset. { {-----------------------------------------------------------------------} begin if Init <> InitVal the { Do the reset. { } {$ifc UseStartIO then } {$message StartIO not implemented} {$elsec} LoadExprn raise E10nInited; if not IsReset then raise E10NReset; while Stat^.CmdInProg do ; end; procedure E10Res(Lor(Shift(EtherLoc,8),Shift(EtherLoc,-8))); InLineByte( #277 {JCS} ); {$endc} PushDCB(DCBPtr); SendsPet(MyAdr: EtherAddress); {------------------------------------------------------------------------- { { Abstract: { This posted := 0; RecvsPosted := 0; ThisMachine := MyAdr; IsReset := true; end; function E10DataByterocedure is used to reset the Ethernet interface. { { Parameters: { MyAdr is an Ethernet address block that contains the ads(RecvBits: Integer): Integer; {------------------------------------------------------------------------ { { Abstract: { Tdress of this { this interface. Once this address is set any packets that have a { Source field that matches MyAdr will his procedure is used to obtain the number of data bytes that are { in a packet that was received over the network. { { Par r. When the user types ^^SHIFT-D or an uncaught exception is discovered, a dump of the user stack is shown. This has themodule. If the Seg file found is not the one that was loaded, the procedure names will be wrong. The procedure numbers w form: Control-shift-D dump Debug at 108 in routine 7 in IO_PRIVA. Called from 214 in routine RANDOMWI (8) in WIPEWIN.ill always be correct, however. For the procedure names of system modules, the system run file is checked to find the  Called from 395 in routine WIPEWIN (0) in WIPEWIN. Called from 149 in routine 0 in LOADER. Called from 222 in routine 1 iSeg file name. This Seg file is used to get the procedure names. If the system run file or the system Seg files are not accen SYSTEM. Called from 520 in routine 0 in SYSTEM. First, the reason for taking the dump is shown. Next is a trace of allssible, the debugger will not be able to print the procedure names for system routines. After the dump is printed, you will  is a useful command if you'd like to edit your own copy of a file without changing the original one. (The Editor provid the procedures on the stack. Each line shows the location in the code, the routine that location is in, and the modulees you with the ability to do this too, but copying can give you an additional safeguard against unintentional changes which contains that routine. The location is the QCode offset from the beginning of the procedure. You can use QDis to  to the source.) The names of SourceFile and DestinationFile may be identical; however if they are identical a new fi try to associate this with the corresponding place in the source. When the debugger can find the procedure name, it is prle will not be created. If you want two files you should use nonidentical names. If the file you are copying to ainted followed by the procedure number. At other times, only the routine number will be printed. You can count the procedulready exists, Copy requests confirmation before overwriting it. This can be disabled by using the switch "/NOCONFIRM" re (and exception and function) headers in the module source file to determine which procedure it is. When counting proceor enabled using the switch "/CONFIRM". NOCONFIRM also sets NOASK. If an error is discovered and wild cards were used, Codures, start with one for programs and zero for modules. The main body of a program is its procedure zero. Exported py asks the user whether to continue processing the rest of the files that match the input. This confirmation is req and forward procedures are counted only once, where the name first appears. Internal (nested) procedures are counteuired no matter what switches were specified. A final switch is "/HELP" which describes the function of Copy and the variod exactly like other procedures. A note about procedure names: These names are always us switches. Program>Debugger Debugger - The preliminary debugger The current operating system includes a simple debuggetruncated to eight characters and converted to all uppercase. To get the names, the debugger examines the Seg file for the  . { { E10NReset: Raised if this procedure is called before EReset. { {---------------------------------------------------be sent or filled. { { Stat is a pointer to a status block for use during this command. { { Bytes is the number of data --------------------} begin if Init <> InitVal then raise E10nInited; if not IsReset then raise E10NReset; bytes that are to be transfered. { This value must be between 46 and 1500 { { Exceptions: { E10NInited: Raised if this p E10GetAdr := ThisMachine; end; procedure E10State(var NumSend, NumReceive: integer); {-----------------------------rocedure is called before E10Init. { { E10NReset: Raised if this procedure is called before EReset. { { E10ByteCount: R------------------------------------------- { { Abstract: { This procedure is used to return the internal state of the { aised if Bytes is not in the valid range. { { E10BadCommand: This is raised if the command passed is not { Send, Receiv Ethernet interface. { { Parameters: { NumSend will be set to the number of Sends that are pending. { { NumReceive wille or PromisciousReceive. { { E10TooMany: is raised if too many commands are executed at a given { time. { { E10STooMa be set to the number of receives that are pending. { { Exceptions: { E10NInited: Raised if this procedure is called beforeny: is raised if more than one send command is executed. { {------------------------------------------------------------------ E10Init. { { E10NReset: Raised if this procedure is called before EReset. { {-------------------------------------------------} begin E10IO(Cmd, Header, Buff, Stat, Bytes); E10Wait(Stat); end. ----------------------------} begin if Init <> InitVal then raise E10nInited; if not IsReset then raise E10NReset; NumSend := SendsPosted; NumReceive := RecvsPosted; end; procedure E10WIO(Cmd: EtherCommand; Header: pEtherHeader; Buff: pEtherBuff; Stat: pEtherStatus; Bytes: Integer); {----------------------------------ataBytes) or (Tmp1 > MaxDataBytes) then raise E10DByteError; E10DataBytes := Tmp1; end; function E10--------------------------------------- { { Abstract: { This procedure is used to start an Ethernet I/O operation and wait GetAdr: EtherAddress; {----------------------------------------------------------------------- { { Abstract: { This functifor it { to complete. { { Parameters: { Cmd is the command that is to be executed. { { Header is a pointer to an Ethon will return the address of this machine. { { Exceptions: { E10NInited: Raised if this procedure is called before E10Initernet header block. The client must fill { in all fields of this header. { { Buff is a pointer to the buffer that is to   does not know the types or sizes of variables, but it does know the number of words allocated for locals, arguments and s the second one, etc. This does not hold for procedure parameters, however, where the variables are always stored in exactlresults. Note that the compiler may generate temporary variables which are included in the local count. When a debuggey the order declared. The debugger's commands are: ? Print a list of all the commands. x Set the radix. All inr command is invoked which takes an offset, you can type a number which is the offset of the word to print. Zero is the firstegers are normally printed in signed decimal. With this command, you can specify any radix from 2 to 36. Ift word. If you type -1, all the words in the current context will be printed. For example, to an "a" command, all the arg the radix is negative then all output will be unsigned. If it is positive then output will be signed. Note uments will be printed for -1. If you type -2, the debugger will request the first and the last offsets to print. In this  that this radix is only for output; all input is still in signed decimal. > Up level. Move up one level manner, a range of values can be printed. No checking is done to make sure that the offsets typed are in range; if a numbein the stack towards the top of the stack. To investigate the variables of a procedure, move up or down the star is out of range, some random data will be printed. Data is printed in the form: [ 7] ( 5053^^) = 6 where 7 is tck until that procedure is reached and then it can be investigated. < Down level. Move down one level towards thbe asked if you want to debug. (If a dump is printed due to a ^^SHIFT-C, no debugging will be allowed). If you answehe offset in the current procedure, 5053 is the offset from the bottom of the entire stack and 6 is the value in that lor no, the program will be continued if it was called from ^^SHIFT-D, otherwise it will be aborted and control will go back tocation. A note on counting variables: Imagine that your procedure was defined w the Shell. If you decide to debug, the debugger will print something like: Scrounge, V0.10 Now at routine KEYINTRith the following variables: var a,b,c: Integer; d: Char; When a list of variables are defined in the same statem (7) in IO_PRIVA There are 5 local words, 0 argument words, and 0 result words Debug> Now you can use the debugger's coent, they are allocated in reverse order so the first word is the variable "c". The second word is "b", the third "a" and mmands to investigate your program. Notice that the debugger goes to more effort to find the procedure names than the orithe fourth is "d". This is true for local and global variables and for records. Note that if you had declared the variablginal dump, so that if a procedure name was not printed at first, going into the debugger may get it displayed. The debuggeres as: var a: Integer; b: Integer; c: Integer; d: Char; then "a" would be the first word, "b" i { Exception Definitions. {----------------------------------------------------------------------------- { { Except.Dfs ndex out of range } ErrStrLong = 9; { string to be assigned is too long } ErrInxCase = 10; { arra- Exception number definitions. { J. P. Strait 10 Dec 80. { Copyright (c) Three Rivers Computer Corporation, 19y index or case expression out of range } ErrSTLATE = 11; { parameter in STLATE instruction is too large } 80. { { Abstract: { This file defines exception numbers used by the Perq Q-code { interpreter microcode, the deb ErrUndfQcd = 12; { execution of an undefined Q-code } ErrUndfInt = 13; { undefined device interrupt detugger, the exception handler, and { the post-mortem dumper. These must agree with the corresponding { routine numected } ErrIOSFlt = 14; { segment fault detected during I/O } ErrMParity = 15; { memory parity erbers in Except.Pas. { {-----------------------------------------------------------------------------} {-------------------ror } ErrEStk = 16; { E-stack not empty at INCDDS } ErrOvflLI = 17; { overflow during convert ---------------------------------------------------------- { Change Log: { { 28 Dec 81 1.4 Michael R. Kristofic { Add ErrRefrom long to integer } ErrOvrReal = 18; { floating point overflow } ErrUnderReal = 19; { floating poalDivZero and ErrRtoIOvfl. { { 20 Dec 81 1.3 Michael R. Kristofic { Add ErrOvrReal and ErrUnderReal. { { 18 May 81 1.2 Jint underflow } ErrRealDivZero = 20; { floating point division by zero } ErrRtoIOvfl = 21; { floating pohn Strait { Add ErrOvflLI. { } { 14 Mar 81 1.1 John Strait { Add ErrEStk. { } { 10 Dec 80 1.0 John Strait { Staroint to integer overflow } ErrLast = 21; { last exception number } t file. { } {-----------------------------------------------------------------------------} RNRaise = 0;  { routine number of Raise } RNInitException = 1; { routine number of InitException } ErrFirst = 2; { first exception number } ErrAbort = 2; { user abort } ErrDump = 3; { user dump }  ErrSegmentFault = 4; { segment fault } ErrStackOverflow = 5; { stack overflow } ErrDivZero = 6; module Except; {----------------------------------------------------------------------------- { { Except - Perq Pascal Except { division by zero } ErrMulOvfl = 7; { overflow in multiplication } ErrStrIndx = 8; { string iion Routines. { J. P. Strait 10 Dec 80. { Copyright (C) Three Rivers Computer Corporation, 1980. { { Abstract: { M  Top of Stack. Move to the top of the stack. b Bottom of Stack. Move to the bottom of the stack. c Current. Showthe current mode and asks for a new one. If you type "?" at this point, a list of the options is printeds number of words for arguments, returns and locals for the current procedure. d Display Stack. This command r. They are: i=integer, s=string, c=char, B=Boolean, b=byte. Notice the case sensitivity of the arguments. When eprints the original dump. Some additional procedure names may be printed. In addition, the procedure where y the mode is string, the debugger cannot print a range or all data since it cannot know how much memory was allou are debugging is marked with "<**>". l Local. Examine the local data. The debugger reprints the number oocated to hold the first string. In this case, if the -1 argument is given, the offset is assumed to be f local words. You can type the offset of the word you want to see. a Argument. Examine the arguments to a pro zero. When printing strings, the length is printed first. When printing bytes, the radix specified still hocedure or function. e Exception. Examine the arguments (parameters) to an excep- tion. r Returns. Examilds (although they will always be unsigned). For bytes and characters, offsets are still in terms of words;ne the return values from a procedure. g Globals. Examine the globals for the module or program that the proced the debugger prints both bytes in the word specified. s Stack. This command permits display of words anywhere ure is in. When the g command is given, the module or program name is printed. If it is a program, the debugger on the program stack. Detailed knowledge of the compiler's memory allocation is necessary to utilize this  asks if you want to skip input and output. These are the two file variables that are defined for every program and tcommand so it is generally not useful. q Quit. Exits the debugger and aborts the program that was ake up space at the top. If you answer yes to this question, you do not have to worry about the space for running. This returns control back to the Shell. It requires confirmation. p Proceed. Exits the debugger and rese bottom of the stack. When entering the debugger, the current procedure is set at the top so this command hthem when counting variables. Unfortunately, there is no way to examine data in modules that do not have proceduas to be used first. ^^ Dereference. Dereference any pointer in memory. This takes a segment number and an ores on the stack. m Mode. The debugger cannot know the type of data, but if you know, you can tell the debuggerffset. For a variable parameter or pointer variable, the offset is first and then the segment number. t. The mode command lets you specify the output mode for data. When you type the Mode command, it prints  t change when new exceptions are defined. This { means that new exceptions may be defined without requiring that the { dure RaiseP( ES, ER, PStart, PEnd: Integer ); procedure InitExceptions; exception Abort( Message: String ); exception Dump( operating system be re-linked. { {-----------------------------------------------------------------------------} {-- Message: String ); exception XSegmentFault( S1,S2,S3,S4: Integer ); { segment fault } exception XStackOverflow; --------------------------------------------------------------------------- { Change Log: { { 28 Dec 81 V2.9 Michael R. Kri { stack overflow } exception DivZero; { division by zero } exception MulOvfl; { overflow in multiplication } odule Except provides the following things: { { 1) Definitions of the microcode generated exceptions. { { 2) A pstofic { Define RealDiv0 and Real2Int { { 23 Dec 81 V2.8 Brad Myers { Fixed handler reraise bug { { 20 Dec 81 V2.7 Microcedure to tell the microcode which segment number these { exceptions are defined in. { { 3) The default handhael R. Kristofic { Define OverReal and UndeReal { { 3 Dec 81 V2.6 Brad Myers. { Export ExcSeg. { Make Handle All not hler of all exceptions. The compiler enables { this handler in every main program. { { 4) A Pascal routine to andle Stack Overflow or SegFault. { } { 28 May 81 V2.5 Brad Myers. { Change name of STLate exception (so no conflict withsearch the stack in when an exception is { raised. { { Design: { The file Except.Dfs is included into Perq.Mi Qcodes.dfs { } { 28 May 81 V2.4 John Strait. { Take out special test for InPmd (exception raised while in Scrounge). { cro as well { as into this module. It defines routine numbers for the exceptions { generated by the microcode. NThis will be replaced by a handler of All exceptions in Scrounge. { } { 23 May 81 V2.3 John Strait. { Allow StackOverflowote that there must be agreement { between these constants and the routine numbers of the exception { definitions. while in Scrounge (just like SegmentFault). { } { 18 May 81 V2.2 John Strait. { New exception for Long Integer overflow. No program checks these--if you add or remove { exception definitions you must be sure to update Except.Dfs { in { } { 12 May 81 V2.1 Brad A. Myers. { New IO imports. { } { 5 May 81 V2.0 Brad A. Myers. { Added preliminary deb the appropriate way. { { The routine number of RaiseP is also defined in Except.Dfs { as 0. Since the microcodeugger. { } { 23 Mar 81 V1.2 J. P. Strait. { Add support for virtual memory. { } { 14 Mar 81 V1.1 J. P. Strait. { A must know this, it is strongly { suggested that it not be modified. { { The routine number of InitExceptions is dd PMD and try to get it working. { } { 10 Dec 80 V1.0 J. P. Strait. { Start module as part of a proposal. { } {-------not needed by the compiler { or Perq.Micro, but it has been assigned routine number 1 so that { its number will no----------------------------------------------------------------------} exports const ExceptVersion = '2.9'; proce umes the program executing. Note that this command allows you to resume from uncaught exceptions but this ocumentation. Delete also allows you to select the files you want to delete by using a PopUp menu (see the section ois not recommended. In this case, confirmation is required. If the debugger was entered through ^^SHIFT-D, n "PopUp Menus" in the PERQ Introductory Users Manual). To get a PopUp menu, type Delete followed by a carriage retthen no confirmation is required. If an exception is raised inside the debugger, the debugger aborts immediately and exitsurn (no arguments). Delete will prompt with File to delete or press for Menu: at this point you can simply press t to the Shell. In the debugger, ^^C and ^^SHIFT-C both cause immediate exit to the Shell also. ^^SHIFT-D is disablhe pen or puck for a menu. You can also type a file name followed by switches. For example, you might type ed while inside the debugger. Also, the HELP key does not work while in the debugger; use the debugger question mark :boot>myDir>*.TMP/confirm and then press down on the pen or puck. You should not type a carriage return before pre (?) command. FileUtilities>Delete Delete - Remove a file The command: DELETE FileSpecification[,filessing. The menu displayed when you press contains the files that match the file pattern. If no pattern is typed, all the f2,...filen][/switch] irrevocably destroys the specified file(s). It deletes the file's name from the directory and pliles in the current directory are listed. Simply select in the menu the files that should be deleted. Unlike the menu aces the blocks it occupied on the free list, thus making those blocks available for use by other files. Wildcards mfor the Shell, the Delete menu allows you to select multiple files. All selected files are marked by reverse-video. Theseay be used in the file specification, but not in a directory part. See the section entitled "Specifying a file name"  are the files that will be deleted. You can de-select a selected file by simply pressing on it again. Since the number oin the PERQ Introductory User Manual for details on PERQ wildcard conventions. The valid switches for Delete are: f files that can be displayed is limited, scrolling is provided when the the number of files matching the file specifica-  /CONFIRM asks for verification before deleting a file. It's the default when you use tion is large. Use of the scrolling feature is described in the PERQ Introductory Users Manual. Once you have select a wildcard unless you use a PopUp menu (see below). /NOCONFIRM is the defaed all the files you wish to delete, move the cursor to the lower right corner of the menu to the spot with the "x" in itult when you specify only a filename without a wildcard. /HELP provides some online d. The cursor should change to a large exclamation point. When you press here, all the deletes will take place. If, however,  ; procedure ReadSpiceSegment(id : SegID; firstblk,numblks : integer; ptr : ptrDiskBuffer); procedmodule FileAccess; {--------------------------------------------------------------------------- { { Abstract: { Module to haure WriteSpiceSegment(id : SegID; firstblk,numblks : integer; ptr : ptrDiskBuffer); procedure Indendle reading, writing, entering and deleting files independant { from the directory structure. { { Written by the CMU Spice Gx(logblk : integer; var indblk,indoff : integer); Exception BadLength(len: integer); {--------------------------------------roup ---------------------------------------------------------------------------} {----------------------------------------------------------------------------- Abstract: Raised if try to truncate file to a length < 0 Parameters: len is bad length----------------------------------- Change history. 28 May 81 V1.7 BAM Changes to Lights module. 26 May 81 V1.6  ---------------------------------------------------------------------------} Exception NotAFile(id: SegID); {-------------JPS Use new Lights module. 19 May 81 V1.5 BAM Fix position of scavenge light. 12 May 81 V1.4 BAM Prevent scavenge f-------------------------------------------------------------- Abstract: Raised when an operation is attempted and the SegID pexception StrIndx; { string index out of range } exception StrLong; { string to be assigned is too long } exception InxCasrom being recursive. 7 Mar 81 V1.3 JPS Use DiskSegment for memory allocation. 30 Mar 81 V1.2 BAM Renamed from Spicee; { array index or case expression out of range } exception STLATETooDeep; { parameter in STLATE instruction is too large } Seg 27 Mar 81 V1.1 BAM Added comments; fixed truncate 19 Mar 81 V1.0 BAM Changed Bit32 to FSBit32; add FBLANKSIZE to exception UndfQcd; { execution of an undefined Q-code } exception UndfInt; { undefined device interrupt detected } except Index 17 Mar 81 V0.2 GGR Fixed bug in SegAddr checking for logical block inconsistency. 6 ion IOSFlt; { segment fault detected during I/O } exception MParity; { memory parity error } exception EStack; { E-staMar 81 V0.1 JPS Export the Index procedure. ? ??? ?? V0.0 CMU-Spice Group Started ------------------------------------ck wasn't empty at INCDDS } exception OvflLI; { Overflow in conversion to integer from Long Integer } exception OverReal; ---------------------------------------} {******************} exports {***************************} imports Arith from { floating point overflow } exception UndeReal; { floating point underflow } exception RealDiv0; { floating point division bArith; imports DiskIO from DiskIO; imports AllocDisk from AllocDisk; function CreateSpiceSegment(partition : integer; kindy zero } exception Real2Int; { floating point real to integer overflow } var ExcSeg: Integer; private  : SpiceSegKind) : SegID; procedure DestroySpiceSegment(id : SegID); procedure TruncateSpiceSegment(id : SegID; len : integer) OFILE Profile information that is cached in memory /SEARCH Printsry - Show what files exist The Directory command provides an alphabetical list of files in a directory. You can di the current search list. /SHELLNAME Name of current Shell runfile /SHELLINFO Shell splay the directory listing at your terminal or you can specify that the Directory command write the listing to a file. The fspecific information /DISKSIZE Size of hard disk /TIME Gives current date and orm for the command line is: DIRECTORY [dirSpec>][fileSpec]{/switch}[~][outputfile] If it is invoked withou you press outside of the menu before pressing here, no deletes will take place and the program aborts. When using a PopUp time /PATH Gives current path, default partition name and default menu for deletion, the default is NOVERIFY. Thus all selected files are deleted when you press the exclamation point. For add device name /LASTFILE Default file for Edit and Compile /BOOTed safety, you can still specify the /VERIFY switch (as shown above) to cause the system to ask for confirmation on each of CHAR Character used for booting /BOOTS Valid boot characters /SWAP the selected files before deleting it. Details Details - Show details of system environment The Details command provides  Whether swapping is enabled or not and to where /IOERRORS A count of h some information about the current state of your PERQ. Typing DETAILS /HELP will get you online documentation. Tow many times each of the IO errors occurred since the last bohe Details command line is of the form: DETAILS [/switch] Valid switches are: /USERNAME ot /ALL Displays all of the above informa- tion /HELP For online docum Name of current user /USERID ID of current user /MEMORYSIZE The size of memory entation These may be abbreviated to as many characters as are unique. If you don't specify a switch, a selection of the /PARITYERRORS Parity error information /PROFILENAME Name of profile file for the  available information is typed. If you specify *, all information is typed. "Details /Partition" is very useful since  current user /PARTITION Names of all devices and partitions it tells how much free space there is in all the partitions. See the PERQ Introductory User Manual and the PERQ File S known (includes the number of free blocks in each partition) /LOADEDPRystem Utilities Manual for details on Partitions, Search lists, Shell, Path, and Boots. FileUtilities>Directory Directo en by: Brad A. Myers 3-Mar-81 { {Copyright (C) 1981 Three Rivers Computer Corporation -------------------------------------- FileSparse : Boolean; {true if can be sparse} FileOpenHow : FSOpenTyp--------------------------------------} {---------------------------------------------------------------------------- Verse; {howOpen} FileCreateDate : TimeStamp; FileWriteDate : TimeStamp; ions: V1.2 16-Mar-81 Brad A. Myers Changed openType V1.1 11-Mar-81 Brad A. Myers Added sparse and OpenHow bits to FileAccessDate : TimeStamp; FileType : integer; {see FileType.pas}  FSData V1.0 5-Mar-81 Brad A. Myers Created by copying text from Arith and DiskIO  FileRights : integer; {protection code} FileOwner : FSBit8; {UserId of file ow----------------------------------------------------------------------------} EXPORTS Imports GetTimeStamp from GetTimeStaner} FileGroup : FSBit8; {GroupId} Filename : PartialPathName; mp; {Using TimeStamp} const DBLZERO = nil; {a two word 0} type FSBit8 = 0..255; FSBit16 end; ptrFSDataEntry = ^FSDataEntry; PRIVATE  = integer; FSBit32 = ^integer; {will be a long when compiler knows about 'em} Const DISKBUFSIZE = 256; {defined by hardware, 256 words per sec} type SegID = FSBit32; {In SpiceSeg, the virtual address of the  -1 block of a file} DiskAddr = FSBit32; {The virtual address of a DiskBlock} assed does not seem to be the id for a valid file Parameters: id is the bad id --------------------------------- SimpleName = string[25]; {only the filename in the directory} PathName = string[100]; {------------------------------------------} {******************} private {***************************} full name of file with partition and dev} PartialPathName = string[80]; {file name including all directories} FSOpenModule FileDefs; {----------------------------------------------------------------------------- { {Abstract: { { Defines soType = (FSNotOpen, FSOpenRead, FSOpenWrite, FSOpenExecute); FSDataEntry = packed record FileBlme constants and types needed by various people so FileSystem { doesn't need to import DiskIO in its export section { {Writtocks : integer; {Size of file in blocks} FileBits : 0..4096; {Number of bits in last blk}  Boot partition for all the run files in directories whose names start with "x" and writes all of these irSpec even if they do not contain any matches for fileSpec. /ONECOLUMN names into the file "run.list". DIRECTORY Program* tells you what files beginning with "Pr tells Direct to print all files in one column. This is the default when the ogram" are in the current directory, e.g., Program.pas, Program.seg, Program.run. DIRECT *zing*  output goes to a file. /MULTICOLUMN tells Direct to print files in four  lists all files with "zing" in their names. DIR Program*/SIZE lists files beginning with "Progra columns. This is the default when doing a FAST directory to the screen. This m" and tells how much disk space each occupies. The following are the switches available for use with this progra switch does nothing if SIZE or ALL is specified. /DELIMITER m: /HELP types online documentation. /FAST prints a sh when used in conjunction with an output file specification, writes filenames as t a switch, all files in the current directory will be listed. To write the output of a Directory listing to a fiort directory. This is the default. /SIZE tells you how many blocksle, specify an output filename. If there are wild cards, the dirSpec part is matched against all directories and the fil and bits are in each file. /ALL provides the following information eSpec part is matched against all files in the directories that matched dirSpec. Wild cards are described in the sectionabout each file: Number of Blocks Number of Bits  "Specifying a file name" in the PERQ Introductory User Manual. Wild cards are not allowed in partition or device names.  Kind of file Creation date Last Update date Examples of usage include: DIR lists every file in the current directory DIR *>*  Last Access date /LISTDIRECTORIES When doing a multi-directory  shows all files in all directories starting with the current directory and including all subdirectories.  listing, only the directories that have valid matches for the fileSpec  DIR/HELP gives online documentation DIRECTORY :BOOT>x*>*.run~run.list looks in theare printed. This switch tells Direct to print all directories that match the d ory structure for PERQ FileSystem { Written by: CMU Spice Group {------------------------------------------------------------***************************} -----------------} {----------------------------------------------------------------------------- Versions: V2.6  20-Apr-81 John Strait Use DiskSegment for allocation. V2.5 3-Apr-81 Brad Myers Fixed bug when creating file with nammodule FileSystem; {-------------------------------------------------------------------- { { Abstract: { { { Spice Interime that contains .. V2.4 30-Mar-81 Brad Myers Changed name from SpiceDir  File System. Written by: Richard F. Rashid Date : February 24, 1981 Copyright (C) 1981 - Carnegie-Mellon Universit Changed length of Default strings V2.3 26-Mar-81 Brad Myers Added comments V2.2 19-Mar-y --------------------------------------------------------------------} {--------------------------------------------------81 Brad Myers PERQ_String V2.1 11-Mar-81 Brad Myers Fixed Get- Put-InDir so don't read filename ------------------ Change history 4 Jan 82 BAM V7.3 New exception for closing a directory. 3 Dec 81 BAM V7.2  if not inuse V2.0 9-Mar-81 Brad Myers Changed directory syntax to dev:part>dir>fn V1.1 1-Mar-81 New version of FlushFail. 12 May 81 BAM V7.1 Fixed to allow FlushFail on open. 12 May 81 BAM V7.0 Added Excep Brad Myers Changed to smaller HASHFRAMESIZE and smaller entry size V1.0 ??-???-??tions for FSLookUp and FSEnter. Catch string too long from FixFileName 9 Apr 81 BAM V6.7 FSC CMU people Started -----------------------------------------------------------------------------} {*********************lose no longer sets any dates (set by open/enter). 3 Apr 81 BAM V6.6 Fixed bug in entering filename with .. in it. 27***}Exports{**********************************} imports FileDefs from FileDefs; function GetFileID(name : PathName) : Seg Mar 81 BAM V6.5 Fixed Close to do Trucate. 26 Mar 81 BAM V6.4 Added comments. 19 Mar 81 BAM V6.3 import PID; function PutFileID(var name : PathName; id : SegID) : boolean; function DeleteFileID(name : PathName) : SegID; functionERQ_String not PERQ.String. 17 Mar 81 BAM V6.2 Added new procedure FSIsFSDev. 10 Mar 81 BAM V6.1 Changed FixFile GetDisk(var name : PathName; var partition : integer) : boolean; var DefaultPartitionName : SimpleName; {includes deviceName to create a full file spec; removed self-init from FixFileName 9 Mar 81 BAM V6.0 changModule FileDir; {----------------------------------------------------------------------------- { { Abstract: { { The direct name and ends in a ">" } DefaultDeviceName : SimpleName; {ends in a colon} {************************}Private{******* t sort the directory. In this case, all the files are listed in essentially rando all the subdirectories, etc. Lines are drawn from each directory to its parent. If a directory is supplied, DirTree sm order. This switch is useful when swapping is turned off and Direct does not haimply starts the search from that directory. If the specified, or default, root directory contains the current directory,ve enough memory to sort the file (for example, when running from the floppy). N DirTree highlights the current directory with reverse video. You can then change the path by moving the cursor to theAME - sort by the name of the file. This is the default. SIZE - sort by file si desired directory and pressing the pen or puck. This is equivalent to issuing a Path command; DirTree permits you toze. This operation lists files in decreasing order, with the largest file first.  change your current directory. Typing any character or pressing in an area that does not contain a directory exits DirTre CREATEDATE - sort by creation date. The most recent file is listed first. e. If the directory is too deep to fit on the screen, DirTree puts an asterisk (*) on the right of the parent. You can r ACCESSDATE - sort by last access. For this function, access is defined as the last reinvoke DirTree with this directory as the root to see more of the tree structure. DirTree accepts three switches: /WAIT, tead operation performed on the file. UPDATEDATE - sort by last update. For thishe default, enables pressing to select a new path; /NOWAIT disables pressing to select a new path (DirTree simply displays t switch, update is defined as the last write operation performed on the file. Fihe tree structure); and /HELP for online documentation. FileUtilities>Dismount Dismount - Discontinue use of device T name | name into a file. This is useful for creating command files. leUtilities>DirTree DirTree - Show directory structure as a tree DirTree gives a graphic representation of the filesy /PARTITIONS gives information about all partitions after the files are stem's tree structure. It erases the screen and then displays a tree of all the directories starting from the root direclisted. /SORT=option specifies the method in which the directory is tory on the left. Any directory can be specified as the root of the tree. The default starting place is the defaultsorted and displayed. This switch accepts the following options: NOSORT - do no device. In this case, DirTree displays all the partitions, and then all the directories in each partition, and then  ot } { area is 128 blocks (32K). } StartBlk =BootLength;{ The block number of the FIBlk ofure FSClose(UserFile:FileID; Blks,Bits:Integer); procedure FSBlkRead(UserFile:FileID; Block:BlkNumbers; Buff:PDirBlk); procedu the first} { user file. } SysFile = -1; { File ID of the system area on disk. } re FSBlkWrite(UserFile:FileID; Block:BlkNumbers; Buff:PDirBlk); procedure FSInit; procedure FSMount(disk : integer); procedured syntax of directories 5 Mar 81 BAM V5.0 Removed many procedures into FileUtils; removed SEARCHSIZELIST = 5; { Max number of directories on search list. } type DirBlk= RecoImport of DiskIO from export; changed size of FileName strings; improved Scan; 3 Mar 81 BR andrd { Record for reading disk blocks } Case Integer Of 2: ( Buffer JPS Improve setting of dates in FSEnter/FSClose/FSLookUp. V4.2 Set FileType in FSEnter. :Array[0..255] Of Integer ); 3: ( ByteBuffer: Packed Array [0..511] of FSBit8  Make Id a Var parameter ro FSScan as it should be. 1 Mar 81 BR V4.1 Set Dates in FSEnter/FSClose. 2 ) End; PDirBlk= ^DirBlk; FileID = integer; BlkNumbers = integer; S6 Feb 81 DAS and JPS Added FSRename. Exported FixFileName. V4.0 ----------------------------------------earchList = array[1..SEARCHSIZELIST] of PathName; ptrSearchList = ^SearchList; var FSDirPrefi----------------------------} {********************} Exports {********************} imports FileDefs from FileDefs; cox:PathName; {current default directory including device and part} FSSysSearchList: SearchList; function FSLookUp(FileNamenst FSVersion = '7.3'; { File system version number } BlksPerFile =#077777; { Max blocks in each file } Firs:PathName;Var BlkInFile,BitsInLBlk: Integer): FileID; {uses current system search list} function FSLotBlk =0; { Block number of the first data block } { in a file } LastBlk =#077calLookUp(FileName:PathName; Var BlkInFile,BitsInLBlk: Integer): FileID; {doesn't use any search lists} funct776; { Block number of the last data block } { in a file. } FIBlk =-1; { Block ion FSSearch(var slist : SearchList; var FileName : PathName; var BlkInFile, BitsInLBlk: integer) : FileID;number of the File Information Block } BootLength = 60 + 128; { Size of the bootstrap area on disk--the }  {uses specified search list instead of system one; is var so no copying; chang { first n blocks on the disk. the microcode } { boot area is 60 blocks, the Pascal boes FileName to be full filename actually used} function FSEnter(FileName:PathName): FileID; proced  hat these names are used no matter what name the device was given when it was partitioned. Once a device has been disle. The screen is cleared to give you a blank page to write on. Type I to insert the text that you wanmounted, it can no longer be accessed until it has been mounted again. It is very important to Dismount filesystem floppiest to type in. When you're finished, i. Press the INS key (upper lefthand corner of keyboard before removing them from the drive. See the section on "Mount" for more information. Editor Editor - Edit a text file ). This is important; it's the only way that what you typed in will be saved. ii. Type Q. The sc The Editor is used to create or alter any text file on the PERQ. You will probably use it very frequently, so it's a green is cleared again and you are prompted with a list of alternatives. See the Editor documeood idea to become familiar with it as soon as you can. It has its own online documentation (run Edit and press the HELPntation for details on these. 2. To make changes to an existing file: Invoke the editor with the nam key) and manual (The Editor User's Guide), so this description is brief. Three common uses of the editor are discussee of an existing file. Work with the Editor User's Guide at your side until you're comfortable with td here. The command line for Edit is: EDITOR FileSpecification or EDITOR/replay If the he functions available. If you find that you've made changes to a file that isn't yours or that you'veswitch is left out Edit will assume that you want to edit the default file name remembered by the Shell. The /REPLAY switch  done irreparable damage to one that is, don't panic - if, after typing Q you type E, all of the ch is useful when disaster occurs during an edit session; you specify the switch, redo the edit session, and stop just before anges you've made will be ignored. If you'd like to save your changes but don't want to al the disaster. Refer to the Editor User's Guide for details. The Editor does extension completion on the file name specifieter the source file, you can type W after Q to make a new file. 3. To read a file at your leisure: youd. If the file to edit is FOO.PAS, it is only necessary to type FOO. The extensions that the Editor knows about, in orde can EDIT it, reading and scrolling at your own pace. To safeguard against your having made any accider tried, are: Pas, Micro, Cmd, and Dfs. The Editor signals the end of a file with a solid, left pointing triangle. Tntal changes to the file, type E after Q. FileUtilities>ExpandTabs ExpandTabs - Change TABs to multiple spaces he Dismount command detaches devices from the filesystem. The argument to Dismount is HARDDISK (H) or FLOPPY (F). Note three common uses of the Editor are: 1. To create a new file: Invoke the editor with the name of your new fi! -------------------------------------------------------- Abstract: Raised if file entered is illegal because: e exports the Types put in the FileType field of File FIBs. The types are stored as integers. Three Rivers reserves the firs1) the device or partition specified is not valid 2) a directory name specified does not exist 3) t 512 types for their use. Customers are encouraged to choose numbers > 512 if they invent new file types Written by Bthe length of the simpleName is > 25 characters If this exception is not handled by the client, the Enter will rad A. Myers Feb. 2, 1981 Copyright (C) 1980 Three Rivers Computer Corporation {----------------------------------------- return zero Parameters: name is the name that is illegal ---------------------------------------------------------------------------------------------} {----------------------------------------------------------------------------- Vers-----------} Function FSInternalLookUp(FileName:PathName; Var BlkInFile,BitsInLBlk:Integer): FileID; Exceions: V1.2 1-May-81 Brad Myers Added SwapFile and BadFile Changed name of BootFile FSDismount(disk : integer); procedure FSSetPrefix(prefixname : PathName); {FSSetPrefix just assigns the ption FSDirClose; {-------------------------------------------------------------------- Abstract: Raised if attempt to FSClo vble; use FileUtils.FSSetPath to do processing ose a directory file. This is usually a bad idea since directories are spare files with an invalid lenn new path} procedure FSGetPrefix(var prefixname : PathName); function FileIDtoSegID(id : FileID) : SegID; function SegIDgth field. RESUME: Allowed. Will close the file as if nothing had happened. ----------------------------------------------toFileID(id : SegID) : FileID; procedure FSSetupSystem(bootchar: integer); procedure FixFilename(var filename : PathName; null----------------------} const FSDebug = false; {********************} Private {********************} iserror : boolean); Function FSIsFSDev(name: PathName; var devName: String): integer; Exception FSNotFnd(name: PathName); {-------------------------------------------------------------------- Abstract: Raised if file looked up is not found. If this exception is not handled by client, the lookup or search will return zero Parameters: name is the name not found --------------------------------------------------------------------} Exception FSBadName(name: PathName); {------------Module FileTypes; {----------------------------------------------------------------------------- { { Abstract: This modul! can also specify a switch to show context, ignore upper and lower case, or request help. Thus, an example command line isis processing a command, a "hand" cursor moves down the right margin of the screen. When it has reached the bottom, your o: FindString screen, :boot>os>*.pas~screen.users/nocontext The above command directs FindString to search all files wperation is complete. (With small files, the cursor does not reach the bottom of the screen.) The wild card handling in ExpandTabs simulates tabs in every 8th column by replacing tabs in the input file with the correct number of spacith a .PAS extension in the OS directory of the BOOT partition for an occurrence of the string screen. FindString wes. ExpandTabs is used when the input file was written for another system and put onto a PERQ, which does not support tabrites the output to the file "screen.users". By default, case is not significant (in the example above, Screen matches s. Its command line takes the form: EXPANDTABS SourceFile DestinationFile Note that the ExpandTabs commanscreen). You can force FindString to match upper case characters by specifying the /CASESENSITIVE switch. FindString ald does not accept the Help switch. FindString FindString - Search multiple files for a given string The FindString comso accepts the /HELP switch. Devices>Floppy Floppy - Do file operations on floppy disks The FLOPPY utility formats, temand searches through a number of files for a particular string. There are two modes: /CONTEXT; and /NOCONTEXT. In /COsts, reads, and writes RT-11 format and filesystem floppy disks. FLOPPY can also format filesystem floppies. You canNTEXT mode, FindString prints leading and trailing characters for each occurrence of the specified string. In /NOCONTEXT m use FLOPPY to transfer files between the hard disk and the floppy disk. The command line is: FLOPPY [commaode, FindString prints only the first occurrence of the specified string and does not print leading or trailing characters. nd][/switch(es)] To execute a single FLOPPY command and return control to the Shell, enter a command on the command line. The default mode is to print leading and trailing characters for each occurrence (/CONTEXT). The first argument to  To execute multiple FLOPPY functions, type FLOPPY and press return. In this case, the utility prompts with FLOPPY>. You caFindString is the string to search for. If you want to include a space, comma (,), or slash (/) in the search string, you n then enter commands or use the pop-up menu. Some FLOPPY commands require confirmation. This confirmation comes from the must precede it with a single quote ('). The next argument is the file pattern to match files against. The remaining a keyboard even if a user command file is in use. If you use the FAST command (see below), no confirmation is required. The Zerguments are optional. You can direct FindString to write the occurrence(s) to a file by specifying an output file. You ro and Format commands, however, require an explicit /NOCONFIRM switch to override the confirmation request. While FLOPPY " de output} MicroFile = 11; ComFile = 12; RelFile = 13; IncludeFile = 14; {included in a pas file} 1 BAM V1.4 Added exceptions; 16 Apr 81 BAM V1.3 Fixed so Rename xx to y>..>y works; 28 Mar 81 BAM V1.2 Rem SBootFile = 15; {system part of boot file} MBootFile = 16; {microcode part} SwapFile = 17; {a file used for soved SetPath routine (is in shell); Changed Push and Pop to take SearchList as argument. wapping by compiler or editor; length not set} BadFile = 18; {created by the scavenger}  Added AddToTitleLine procedure so programs will display the current path 26 Mar 81  {\\\\\\\\\\\\\\\\\\\\\\\\\\} PRIVATE {/////////////////////////}  BAM V1.1 Changed MakeDirectory so doesn't uppercase the name; checks to see if file exists; and changes the arg to be the full path name of the new directory Added hmodule FileUtils; {---------------------------------------------------------------------- {Abstract: { { Filesystem utilitieaders; 19 Mar 81 BAM V1.0 PERQ_String; 17 Mar 81 BAM V0.3 New procedures FSPushSearchItem and Pop; 16 Mar 81 es not needed by the system Written by Brad Myers. March 5, 1981. --------------------------------------------------- BAM V0.2 Fixed MakeDirectory to do more error checking; 5 Mar 81 BAM V0.1 Created this module by breaking off fro-------------------} {---------------------------------------------------------------------- Change log: 2 Dec 81 BAm FileSystem; Also Made FSScan faster; added FSMakeDirectory --------------------------------------e to SBootFile to remove name conflict V1.1 31-Mar-81 Brad Myers Added BootFile M V1.10 Rename to its original name changes capitalization. 30 Nov 81 BAM V1.9 Rename of a file to its original nameand MBootFile V1.0 2-Feb-81 Brad Myers Started --------------------------------------------------------------------- works. Exception for renaming a directory. New routine FSRemoveDots. 23--------} {\\\\\\\\\\\\\\\\\\\\\\\\\\} EXPORTS {/////////////////////////} Const UnknownFile = 0; SegFile =  Jun 81 BAM V1.8 Fixed so rename when couldn't enter file leaves it in old directory 1 Jun 1; PasFile = 2; DirFile = 3; ExDirFile = 4; FontFile = 5; RunFile = 6; TextFile = 7; 81 BAM V1.7 Added Get and Set FSData procedures 27 May 81 BAM V1.6 Added new exception to rename to handle file ex {for non-Pas text files} CursorFile = 8; {cursor bin files} BinaryFile = 9; BinFile = 10; {microcoists 19 May 81 BAM V1.5 Added new procedure for Extension lookup written by JPS; 12 May 8" h, since /VERIFY is the default. The /NOVERIFY switch overrides the default. NOTE: DUPLICATE: This command copies the contents of one floppy onto another. The command creat This command takes a long time and cannot be interrupted once it starts. DELETE: This ces a set of scratch files on the hard disk, copies the scratch files back to tommand deletes a file or multiple files on the floppy. To delete multiple fileshe new floppy, and then deletes the scratch files from the hard disk. To retain the, you must separate the filenames with a comma (,). By default, the DELETE com- man scratch files on the hard disk, specify the /NODE- LETE switch. By default, thed requests confirmation before deleting a file. You can override this by specify- i Duplicate command creates a double-sided floppy. To override this and create a  FLOPPY is more restrictive than the operating system's. FLOPPY only accepts wildcards for the DELETE and DIRECTORY cng the /NOCONFIRM switch. Wildcards are allowed. DIRECTORY: This command lists the files conommands (see the respective command descriptions). In addition, the only wild card available is the asterisk (*) and it can tained on a floppy and optionally writes the directory listing to a file. If you only be used by itself in either the filename or extension part of a file specification (or both). Current FLOPPY commands a specify the DIRECTORY command with no arguments, it lists all the files containend their switches are: COMPRESS: Coalesce free space on the floppy. This moves files d on the flop- py. If you specify an input argument, DIRECTORY lists those file so that all the unused blocks are at the end of the floppy. COMPRESS does not as that match the specified filename. If you specify an output argument, DIRECTOccept input or output arguments, but has a switch which turns verification on or ofRY writes the list- ing to a disk file with that name, but does not display the filenaf. The default is verify; if this is on, COMPRESS checks every transfer to assure mes on the screen. By default, the DIRECTORY command prints (or writes) a full there are no errors. To COMPRESS in verify mode, you need not specify the switclisting. To override this and print only the file names, specify the /SHORT switch.#  Blk : DiskAddr; Entry : Integer; DirName : PathName; e already exists 2) dirName cannot be entered (bad subdir part) 3) dirName is empty 4) end; Procedure FSDelete(filename: PathName); Function FSScan(scanptr : ptrScanRecord; var nam dirName is ROOT.DR (reserved directory name) Parameters: msg explains problem with makedir attempt; dirNamee : SimpleName; var id : FileID) : boolean; Procedure FSRename(SrcName, DestName: PathName); Function FSMake is name attempted to use. Use "WriteLn('** ',msg,dirName);" ---------------------------------------------------Directory(var DirName: PathName): FileID; Procedure FSSetSearchList(sList: SearchList); Procedure FSPopSearchItem(var sList: S-------------------} Exception SrchWarn(fileName: PathName); {--------------------------------------------------------------earchList); Procedure FSPushSearchItem(name: PathName; var sList: SearchList); Procedure FSAddToTitleLine(msg: String); {adds -------- Abstract: Raised if try to Pop last item or push into last hole of the Search List Parameters: 'as much of msg as possible to title line after the current path} Exception DelError(' if Pop; name of item trying to push if Push Resume: ALLOWED; if resume then does the operation anyway -------------------FileName: PathName); {---------------------------------------------------------------------- Abstract: Raised when can't del---------------------------------------------------} Exception SrchErr(fileName: PathName); {-------------------------------ete file (because not there) Parameters: FileName is file that can't delete --------------------------------------------------------------------------------------- Abstract: Raised if try to Pop empty list or push onto full list for the ----------------------} Exception RenError(msg: String; FileName: PathName); {---------------------------------------------- Search List Parameters: '' if Pop; name of item trying to push if Push Resume: NOT allowed --------------------------------------------------- Abstract: Raised when can't rename file Parameters: msg is reason can't rename and fileName is fi-------------------------------------------} Function FSExtSearch(var SList : SearchList; Extensions: String; le with the problem. To print message, use "WriteLn('** ',msg,filename);" ------------------------------------ var FileName : PathName; var BlksInFile, BitsInLBlkInLBlk: Integer) : FileID; --------------------------------} {********************} Exports {********************} imports FileSystem from FileSys----------------------------------} Exception MkDirErr(msg: String; dirName: PathName); {-----------------------------------tem; type ptrScanRecord = ^ScanRecord; ScanRecord = record InitialCall : boolean; ----------------------------------- Abstract: Raised when can't make a directory because 1) a file named dirNam# s command copies the disk files created by Floppyget onto a floppy disk. By de- f before overwrit- ing it. Other forms of the command permit you to name the harault, Floppyput deletes the disk files after copying them to the floppy. You can d disk file. For example: GET floppyfile~harddiskfile  specify the /NODELETE switch to override this action. For single-sided floppies,  To specify multiple files, use the follow- ing construct: GET f1,f2,...f you must use the /SINGLESIDED switch. FAST: When issued as a command, FAST turns off n~h1,h2,...hn Like the COMPRESS command, GET takes the /VERIFY and /NOVERIF requests for confirmation for all subse- quent commands except Format and Zero. Use Y switches. The de- fault is /VERIFY. The GET command requires confirmation be-  the FAST command only in conjunction with command files. FORMAT: This command formats  fore overwriting a file on the hard disk. You can specify the /NOCONFIRM switch t a floppy disk and destroys its current contents. The FORMAT command accepts the o override this action. HELP: When issued as a command, HELP provides following switches: /DblDensity=Yes or No (default is no) /Noconfirm (over general information for the FLOPPY utility. You can get specific help by using the single-sided floppy, you must specify the /SINGLESIDED switch. Remember that the bride request) /Singlesided=Yes or No (default is no) /Test=Yes or No (defaullank floppy to be duplicated must have been formatted prior to invoking Duplicatet is no) GET: This command copies one or more floppy files to the hard disk. In i. FLOPPYGET: This command copies the contents of a floppy disk to the hard disk. You can optiots simplest form, you specify only an input filename to copy from the floppy to the hnally specify a hard disk file name. The Floppy- get command accepts the /SINGLESIDEDard disk. GET then copies the floppy file to the hard disk using the same fil switch to permit you to specify a single-sided floppy. FLOPPYPUT: Thiename. If the filename already exists on the hard disk, GET requests confirmation$  { Abstract: { GetTimeStamp implements the read-time-as-TimeStamp function for the { Clock module. See the Clock  Exception RenToExist(fileName: PathName); {-----------------------------------------------------------module for more details. { { Design: { GetTimeStamp is a separate module so that it may be imported into the { r----------- Abstract: Raised when try to rename to a file that already exists. Not raised if renaming a file tesident system without importing all the other Clock routines. Once { virtual memory is implemented, GetTimeStamp and Clo its own name (no-op). Parameters: fileName - new name that already exists Resume: ALLOWED; If you wish to rename anyway;ock should be merged { into a single module. { {----------------------------------------------------------------------- just continue and FSRename will delete the DestName; In this case; you should be prepared to accept Del------} { V1.4 1 Jun 81 Brad Myers. { Add comments. { } { V1.3 18 May 81 Brad Myers. { Change IO to IO_Others. {Error; ----------------------------------------------------------------------} Exception RenDir(fileName: PathName); {----- } { V1.2 2 Mar 81 John Strait. { Don't export IO. { } { V1.1 2 Mar 81 John Strait. { Add title, copyright, abstr----------------------------------------------------------------- Abstract: Raised when try to rename a directory. Parametact. { Add version number. { Add change history retroactively. { } { V1.0 1 Feb 81 John Strait. { Start file. { } ers: fileName - name of the source directory. Resume: ALLOWED; If you wish to rename anyway; just continue and FSRename  {/////////////////////////} Exports {\\\\\\\\\\\\\\\\\\\\\\\\} const GetTSVersion = '1.4'; type TimeStamp = packed re will do the operation. RenToExist etc. may still be raised. -----------------------------------------------------------cord { the fields in this record are ordered this way to optimize bits } Hour: 0..23; Day: 1..31; -----------} Procedure FSGetFSData(id: FileID; pData: ptrFSDataEntry); Procedure FSSetFSData(id: FileID; pData: ptrFSDataEnt Second: 0..59; Minute: 0..59; Month: 1..12; Year: 0..63; { year since 1980 } end; ry); Procedure FSRemoveDots(var fname: PathName); {********************} Private {********************}  TimeReference = record Lower: Integer; Upper: Integer module GetTimeStamp; {----------------------------------------------------------------------------- { { GetTimeStamp -  end; procedure GetTStamp( var Stamp: TimeStamp ); var PastStamp: TimeStamp; Past: TimeReference; {///////////Perq get time routine. { J. P. Strait 1 Feb 81. { Copyright (C) Three Rivers Computer Corporation, 1981. { //////////////} Private {\\\\\\\\\\\\\\\\\\\\\\\\} $ ls the GET command, but transfers a file or files from the hard disk to the floppy end of the file. COMPARE: This command takes a disk file and a floppy file (i disk. PUT also requires confirmation before overwriting an existing file on the fn that order) and ensures that all bytes are identical. You can specify multiloppy (override this with /NOCONFIRM) and, like GET, accepts the /VERIFY and /Nple disk files (input argu- ments) and multiple floppy files (output arguments) OVERIFY switches. QUIT: Exits the FLOPPY utility. RENAME: Changes the name of a floppy file. Ifor the comparison. If you specify multiple arguments, you must sepa- rate likef the new filename already exists, RENAME asks for confirmation before overwriti arguments by a comma (,) and delimit input form output arguments with an equal sng it. You can override this with the /NOCONFIRM switch. DENSITY: Tign (=). COMPARE prints a message for every block that contains a difference. ZERO: Thishis command tells the user whether the floppy is single or double density. TYPE: This co command creates a new directory on the floppy. By default, the directory matches thmmand types a floppy file on the screen. The "hand" cursor tells how much of fie number of sides on the floppy. You can override this by specifying the /SINGLE- le has been typed. When the Type command finds a formfeed character (^^L) in thSIDED switch. The Zero command always requests confirmation before creating the e file, it waits after displaying a screenful of text. This enables the user  directory. You can override this only by specifying the /NOCONFIRM switch. In the to read the page before the screen is erased and the next page displayed. To  process of creating the new directory, the ZERO command destroys the contents of the  /HELP switch. Note that HELP and /HELP override any other commands or switches;  continue reading, type ^^Q. You can disable this wait feature by specifying the /NOWAIT  FLOPPY displays the requested help and then reprompts. PUT: This command paralle switch. The Type command displays a solid, left pointing triangle when it reaches the % conflicts (especially get) } exports const GpibVersion = '1.3'; gpBufSize = 32; gpBufMax = 31; {gpBufSizf} gphdfa, {Holdoff all data} gphdfe, {Holdoff on End} e - 1} { the following codes are the IEE488-1975 Controller Command Codes they are issued by the Controller-In-Charge whil gpnbaf, {Set NewByteAVailable false} gpfget, {Force Group Executee asserting ATN } gpacg = #000; {addressed group command} gpdcl = #024; {device clear} gpget = #010; {gr Trigger} gprtl, {Return to Local} gpfeoi, {force End or Idoup execute trigger} gpgtl = #001; {go to local} gplag = #040; {listen address group} gpllo = #021; {locentify} gplon, {Listen Only} gpton, {Talk Only} module gpib; {----------------------------------------------------------- { { Abstract: { Support routines for PERQ GPIB al lockout} gpmla = #040; {my listen address} gpmta = #100; {my talk address} gpmsa = #140; {my secondardevices. The package maintains a { buffer (gpCommandBuffer) which holds either data bytes (sent with { procedure gpPutBy address} gpppc = #005; {parallel poll configure} gpppe = #140; {parallel poll enable} gpppd = #160; {pyte) or Auxiliary commands (sent with gpAuxCommand). { The buffer is sent to the 9914 when full, or when gpFlushBuffer is {arallel poll disable} gpppu = #025; {parallel poll unconfigure} gpscg = #140; {secondary copmmand group}  called. If the buffdr has data bytes when gpAuxCommand is called, { it will do a gpFlushBuffer. Similarly, when gpPutB gpsdc = #004; {selected device clear} gpspd = #061; {serial poll disable} gpspe = #060; {serial poll enable} yte is called, { it will flush the buffer, if auxiliary commands are in { gpCommandBuffer. { { writen by Brian Rosen  gptct = #011; {take control} gptag = #100; {tahk address group} gpuag = #020; {universal address group}  Copyright(C) 1980, Three Rivers Computer Corporation {------------------------------------------------------------ gpunl = #077; {unlisten} gpunt = #137; {untalk} type { these commands are the major state change control comman---- { { Change log: { 27 Jan 82 V1.3 WJH added GPIBerror added first test of gpBufPtr in gpds of the TMS9914 chip which forms the interface to the GPIB Consult the TI documentation on the TMS9914 forAuxCommand 15-Jun-81 V1.2 DAS Changed to compiler under POS D. 2-Jan-81 V1.1 BR fixed names of Con more information} {These definitions are order dependent} gpAuxiliaryCommands = (gpswrst, {Chip Resetroller Command Codes and apAuxiliaryCommands to have "gp" prefix to avoid name t} gpdacr, {Release DAC holdoff} gprhdf, {Release RFD holdof% s passive. They'll follow this script: PERQ #2: Runs FTP PERQ #1: Runs FTP and then issues s switches to the GET or PUT commands. For example: FTP GET file/Mode=PDP-11/BAUD=1200/DEVICE=RS232 The F current floppy. Use the ZERO command after formatting a floppy (see the FLOPPY FORMAT the next command PERQ #1: PUT SourceFile[~][DestinationFile] Both PERQs: #!#!#!#!#!...#!#!  command description in this section) or whenever you wish to destroy the current  (this appears on the screen as the file is being transferred a content of a floppy. Note that when you issue the ZERO command, you irrevnd a "hand cursor" moves from top to bottom to show percentage complete. Whocably destroy the current con- tents. Devices>FTP FTP - Transfer files to another computer Then the hand cursor reaches the bottom, the transfer is complete.) 2.e FTP utility copies files across either the RS232 link or the parallel line LINK to another PERQ or any other comput PERQ #2 has the active role: PERQ #1: Runs FTP PERQ #2: Runs FTP and then issues the next command er that supports the FTP protocol. You can also use FTP to transfer files across an ETHERNET connection. The command line PERQ #2: GET DestinationFile[~][SourceFile] Both PERQs: #!#!#!#!...#! (same a is: FTP [command][/switch(es)] To use the RS232 line, the two machines must be connected by an RS232 cs above) The passive PERQ polls implicitly while the active machine processes the transfer. The valid commands for FTP arable, which goes into their RS232 ports (located between the cables for the display and keyboard in the lower lefthand corner e: GET SourceFile[~][DestinationFile] PUT SourceFile[~][DestinationFile] MODE mode (can of the back of the PERQ). To use the parallel line, the two machines must be connected by a LINK cable, which plugs into thbe PERQ, VAX-11, or PDP-11; default is PERQ) BAUD baud rate (initially set to 9600) e I/O option board on a PERQ. Once the connection is established, each machine must run the FTP program. Its prompt i DEVICE line (either RS232, LINK, or ETHERNET) You can specify HELP whenever FTP requests input. You can call FTP wits FTP>. You can enter commands directly to FTP or use the pop-up menu. The transfer may be performed with either machih one command line. For example, you can specify: FTP GET DestinationFile Control is returned to the commanne taking the active role; the alternate scenarios are described below: 1. PERQ #1 takes the active role and PERQ #2 id interpreter Shell after that one command is executed. Additionally, you can specify the MODE, BAUD, and DEVICE commands a& pParmType = (gpOff, gpOn, gpDontCare); {parameters for Aux Commands} gpByte = 0..255; {Data byte for gpib transactio { Set TMS9914 to be a Talker, set a device to be a listener This procedure takes control of the bus, unlins} gpRange = 0..gpBufSize; gpDeviceAddress = 0..31; {legal addresses for devices on GPIB} gpBufstens and untalks all devices (including itself), and sets a listener with MyListenAddress then setsfer = packed array [gpRange] of gpByte; gppBuffer = ^gpBuffer; var gpCommandBuffer: gppBuffer; {place to put co TMS9914 to be the talker with TalkONly } procedure gpITalkHeListens(gpAddr: gpDeviceAddress); { Set TMS9914 tommands} gpBufPtr: 0..gpBufSize; {pointer to gpCommandBuffer} gpHaveDataBytes, gpHaveAuxiliaryCommands:  be a Listener, set a device to be a talker This procedure takes control of the bus, unlistens and untalks boolean;{true if buffer in use} { The package maintains a buffer (gpCommandBuffer) which holds either Data byte all devices (including itself), and sets a talker with MyTalkAddress then sets TMS9914 to be the listener ws (sent with proceedure gpPutByte) or Auxialiary Commands (sent with gpAuxCommand) The buffer is sent to the 9914 whenith ListenONly} procedure gpHeTalksIListen(gpAddr: gpDeviceAddress); { turn the BitPad (device addres #10) off } full, or when ghForceBuffer is called. If the buffer has data bytes when gpAuxilairyCommand is called, it will do a  procedure gpTbltOn; { turn the BitPad back on again } procedure gpTbltOff; { Send a buffer of user  gpgts, {GoTo Standby} gptca, {Take Control Asynchronously} gpForceBuffer. Similarly, when gpPutByte is called, it will force the buffer if auxiliary commands are in gpCommandBu gptcs, {Take Control Synchronously} gprpp, {Request Parallel Poll} ffer } { Initialze GPIB package, called once only, turns off tablet } procedure gpInit; { Sen gpsic, {Set Interface Clear} gpsre, {Set Remote Enable} d an auxiliary command to TMS9914 some commands require a parameter (gpOff/gpOn) } procedure gpAuxCommand(gpCmd: gprqc, {Request Control} gprlc, {Release Control}  gpAuxiliaryCommands; gpParm:gpParmType); { Put a data byte or a Control byte out on the data bus T gpdai, {Disable All Interrupts} gppts, {Pass Through next Secondary}MS9914 must be in Controller Actives State if the byte is a controller command byte. Must be in Talk Only if a da gpstdl, {Set T1 Delay} gpshdw); {Shadow Handshake} gta byte } procedure gpPutByte(gpData: integer); { Sends all bytes in buffer } procedure gpFlushBuffer; & ases the screen and then prints a list of all commands for which help exists. Type one of these names (or use the pop-upents of the program as well as other linkage details. Thus, map files are useful  menu to specify one). The specific help is then printed for that command. Program>Linker Linker - Combine compiler outputs in debugging user pro- grams. /USER -this is the default. It specifies that the  for execution The Linker takes compiler-generated .Seg files as its input and produces a runfile with a .Run extensi program being linked is a user program. The opposite is /SYSTEM. /VERBOSE -lion. The runfile is created by linking together all of the separately compiled modules that make up a program. The command lists the imports of each module as the module is being processed. /SYSTEM -specifies that TP command also accepts a switch that permits you to specify whether or not the file to transfer is a text file; specify /ne takes the form: LINK Source{,Source}[~runfile]{/switch} Examples of valid command lines include TEXT for text files and /NOTEXT for other files. Sometimes the BitPad and pen can cause problems with file transfers. If yo LINK Program where Program.Seg is the output of a compilation LINK Program1, Program2 u encounter any problems, unplug the pen or move it away from the BitPad. If an FTP transfer fails, the current transfer a where Program1.seg and Program2.seg are compiler output files. The output will be Program1.Run. borts and FTP waits for another command (or exits if invoked with a command line). However, if FTP was invoked from LINK Program1, Program2~Program0/VERBOSE where Program1.Seg and Program2.Seg are com- piled  a command file and the transfer fails, it restarts the transfer and repeatedly tries again until it succeeds. Help Help - .Seg files and ProgramO.run is to be the runfile. The VERBOSE switch specifies that the name of  Give explanations of programs or keywords The Help command is used to display helpful information about other commands aeach import module is to be listed. Any number of source files can be listed separated by commas. The switches currently nd the PERQ operating system. When issued without an argument, a message describing the PERQ and the use of PopUp menusavailable are: /MAP=name -creates a map file. If you don't specify a name after the equal  is displayed. When an argument is included, information about the program specified by the argument will be displayed. sign, the MAP file will have the same name as the runfile with a .Map extension. AThe HELP key or the Help command without an argument gets you to the help utility, if available. The help utility er map file contains a listing showing placement and size of the code and data segm'  {Abstract: { Raised when GPIB encounters an error indication in softstatus from { UnitIO or IOCRead. The condition should81 JPS V4.8 Split IO into several modules. 6-May-81 JPS V4.7 1. Use new form of the SetCylinder StartIO.  be corrected and the operation { retried. { The most likely error is a timeout: IOETIM (See IOErrors). {------------------ 2. Don't bother doing 10 trys in FindSize since only the last result was believed re-----------------------} private gardless of success or failure. 3. Hang if we cannot figure out the size of the disk. 11-Apr-81 JPS V4.6 Changes for virtual memory. 19-Mar-81 BAM V4.5 Changed name of included modules to IO_Init and IO_Proc 3-Mar-81 JPS V4.4 1) Fix LocateDskHeads and FindSize to agree with V4.3. Module IO; {-------------------------------------------} { { Abstract: { { PERQ Raw IO Drivers - Compatibility file. { Wri 2) Teach the HardDisk timeout code about multi-sector operations. 28-Feb-81 JPS V4.3 Ntten by: Miles A. Barel { Copyright (C) 1980 { Three Rivers Computer Corporation { { The IO module has been split into fouo longer do conversions on Disk Physical block numbers (reinstating changes made in V4.0). 25-Feb-r modules: IO_Init, IO>Unit, { IO_Others, and IO_Private. This module is provided for { compatibility. It imports the 81 GGR V4.2 Added setting/reading of DskFill1 in UnitIO. Moved new/dispose of CB from UnitIO to IO.Ifirst three modules in its exports { section. IO_Private is not exported because it provides definitions { which were prinit. 16-Feb-81 BAM V4.1 Put back in conversions on Disk Physical block numbers; fixed botCursF vate in the old IO module and is used only by the { new IO modules. { { Design: { 1) Interrupt routines must *never*bug. Del XXX procedures; Changed to use new screen 9-Feb-81 BAM V4.0 No longer does conversdata to the 9914 } procedure gpSend(var gpBuf: gppBuffer; gpCount: gpRange); {Get a buffer of data from the 9914 ( cause segment faults. { 2) UnitIO must increment and decrement the IOCount of the segments { which are involveNot implemented yet) } procedure gpReceive(var gpBuf: gppBuffer; gpCount: gpRange); { Get a byte of data from the d in IO. { 3) Segment faults must *never* happen while interrupts are off. { {-----------------------------------------GPIB } function gpGetByte: gpByte; exception GPIBerror(SoftStatus: integer); {--------------------------------------------} {*******************************} Exports {*****************************} Const IOVersion = '4.8'; { 11-May-' in critical system runfiles: Link, Shell, Login, and System (e.g. Login.5.run). When you link a file, it looks up the sysas a profile, it is read to find parameters to set up the PERQ for the user. The Login command line may include switches.tem run file based on the version in use. If no version is specified, it uses the current system version (which is displ You can also include Login switches in a #Login section of your profile. The following describes the valid Login switchesayed at the top of the screen when in the Shell). If a version is specified, a system run file with that number is: /PATH=pathname Sets the default path to pathname. The /PATH s used to resolve references to system routines. If the /SYSTEM switch is used, however, no run file is looked for siwitch is not cumulative, if you specify the switch multiple times, only thnce a new system run file is created. The syntax for creating a system run file is: LINK SYSTEM~SYSTEM.NewNumber/SYe last one has an effect. /SETSEARCH=pathname Pushes pathname onto the search list. STEM/VERSION=NewNumber where the /VERSION switch is optional. To create runfiles for a new system, you link using the The effect of this switch is cumulative; if you specify the switch multiple times VERSION switch after making the system runfile. It's done like this: LINK FileSpecification/VERSION=NewNumber Login Log, you add additional items to the search list. If the argument is a minusthis is a system program. /VERSION=nn -links the program with the version of the system specifiin - Start using Perq Login initiates a user's session at a PERQ. It is called automatic- ally when the PERQ is booteed by "nn". If the run file name ends in a number (e.g., "LOGIN.42"), then the Lind or when a user logs off using the BYE command. It can also be called explicitly by a user. At boot time, Login asks foker uses the number as the version number. This can be overridden by using /VERr the date, time, your name, and password. When you invoke Login, it asks for your name and password. Login pSION=nn switch. A word about versions. Every system has a version number. When you create a new system, you also shorompts you with the format it wants these in. It can be called explicitly with the command line: LOGIN [UserNamuld use a new system version number. You then have to relink all the runfiles. This insures that the programs executee][/switch(es)] and will prompt you with the information it wants. Login searches the System.Users file for the given u correctly with the new system. In order to prevent confusion, we have put the system version number into the name of certaser-name and validates the password. The UserControl program (see below) main- tains the System.Users file. If the user h( ions on Disk Physical block numbers; fixed CursorUpdate to allow partial screen ----------------------------------- Versions: 13-May-81 Brad A. Myers V1.1 Added Ether3MBaud Ethernet message 12-Ma display and added procedure IOScreenSize to set a new size. 13-Jan-81 JPS V3.3 Move creatiy-81 Brad A. Myers V1.0 Created ------------------------------------------------------------} {/////////////////////////on of the IOSeg to memory manager init. Move $R- to private part. 20-Nov-80 JPS V3.2 Initialize/} EXPORTS {\\\\\\\\\\\\\\\\\\\\\\\} Function IOErrString(err: integer): String; {//////////////////////////} PRIVATE {\\\ TabFifoInx in InitTablet. 17-Nov-80 JPS V3.1 Export the interrupt table. Check SystemInitial\\\\\\\\\\\\\\\\\\\\} ized for control-C abort. 16-Nov-80 BAM V3.0 Radically changed Cursor and Tablet interface. New  time procedures. Split into another include file. 10-Oct-80 JPS V2.2 Added support for the diagnostic display (DDModule IOErrors; {---------------------------------------------------------------- { { Abstract: { { I/O System Error Code S). 27-Sep-80 DAS V2.1 Added timeout code to UnitIO for the hard disk. 19-Sep-80 DAS Definitions Copyright (C) 1981,1982 - The Three Rivers Computer Corporation ----------------------------------------------- V2.0 Added code for 24 MByte disks. } Imports IO_Init from IO_Init; Imports IO_Unit from IO_Unit; Imports IO_Others f-----------------} {---------------------------------------------------------------- Versions: V1.2 13-May-81 Brad A. rom IO_Others; {*******************************} Private {*****************************} Myers Added new error for Ether3MBaud errors V1.1 12-May-81 Brad A. Myers Added new errors and First and last V1.0 ??-???-?? ?? Started ----------------------------------------------------------------} Exports Imports SysModule IOErrMessages; {------------------------------------------------------------ { { Abstract: { { This module exports atemDefs from SystemDefs; {using Ether3MBaud} Const IOEIOC = 1; { IO Complete } IOEIOB = 0; { I procedure to return an error string for a disk error Written by : Brad A. Myers May 12, 1981 Copyright (C) 1981 - O Busy } IOEBUN = -1; { Bad Unit Number } IOENBD = -2; { Raw Block IO to this device is not implemenThree Rivers Computer Corporation {------------------------------------------------------------} {-------------------------ted } IOEWRF = -3; { Write Failure } IOEBSE = -4; { BlockSize Error } IOEILC = -5; { I( nction. Since the cursor function determines the screen color also, this s BLACK - bottom is opposite color of background /COMMAND=string witch can be used to set the default screen color. Valid cursor function Execute the specified string as the first Shell command after login s are the integers 0 through 7 inclusive. The integers signify the followi and before accepting commands from the keyboard. /SHELL=filename ng: 0 - screen is all white 1 - only cursor displays  Specify an alternate command interpreter to run instead of the Shell.  2 - white on black, cursor is large square 3 - black on white, cursor is large square  This is an aid in debugging a new or user written command line interpreter. /PROFI 4 - black on white, black cursor hides image 5 - wLE=filename Specifies a file (filename) to execute as the profile file. hite on black, white cursor hides image 6 - black on white, cursor inv /HELP Displays a brief explanation of the Login Utility. A samperts 7 - white on black, cursor inverts If you like white letters on a ble profile for login might be: #Login /Path=Sys:User>MyName> /SetSearch=Sys:Boot>Library> lack background, use CURSORFUNCTION 5. The default value is 4.  /SetSearch=Sys:Part3>Alt7> /CursorFunction=4 Note that the command names in the profile can be abbrevi /SCREENBOTTOM=option Sets the default parameters for the bottom of the scated. Additional documentation for Login can be found in the section "Turning on the PERQ" in the PERQ Introductory User sign (-), the last path is popped from the list. Note that the last itemreen when you change the screen size with a ScreenSize command (see below) specified is the head of the searchlist and the first item specified is t. Valid options for this command are: ON - displays bits stored in arehe end of the list. /CURSORFUNCTION=n Sets the default cursor fua OFF - bottom is all one color WHITE - bottom matches background )  { Disk recalibrate done } IOET0 = -30; { Can't find track zero } {$ifc Ether3MBaud then} IOEPTL = -31y-81 JPS V5.4 Initialize new KeyEnable flag. 16-Apr-81 GGR V5.3 Add 3MHz Ethernet Drivers (JEB). 1-Apr-81 ; { Ether3 - received packet too large } IOEFirstError = -31; {$elsec} IOEFirstError = -30; {$endc} GGR V5.2 Moved time base to video refresh (clock is no longer turned on in io_init). 31-Mar-81 IOELastError = 0; Private  GGR V5.1 Added 4-button mouse support. 11-May-81 JPS V5.0 Split IO into several modules. 6-May-81 JPS V4.7llegal Command for this device } IOENHP = -6; { Nil Header Pointer } IOEADR = -7; { Address Error }  IOEPHC = -8; { Physical Header CRC Error } IOELHC = -9; { Logical Header CRC Error } IOEDAC = -10; { Data CRC Error } IOEDNI = -11; { Device Not Idle } IOEUDE = -12; { Undefined Error! }  IOENCD = -13; { Device is not a character device } IOECBF = -14; { Circular Buffer Full } IOELHModule IO_Init; {----------------------------------------------------------------------------- { { IO_Init - Initialize the IS = -15; { Logical Header SerialNum Mismatch } IOELHB = -16; { Logical Header Logical Block Number Mismatch } O system. { Miles A. Barel ca. 1 Jan 80. { Copyright (C) 1980, Three Rivers Computer Corporation { { Abstract: { IO_ IOECOR = -17; { Cylinder Out of Range } IOEDNR = -18; { Device not ready } IOEMDA = -19; {Init initializes the Interrupt Vector Table, the Device Table and { associated buffers, the Screen Package, the tablet an Missing data address mark } IOEMHA = -20; { Missing header address mark } IOEDNW = -21; { Device not d cursor, and { the Z80. { {-----------------------------------------------------------------------------} { 1writable } IOECMM = -22; { Cylinder mis-match } IOESNF = -23; { Sector not found } IOEOVR = -6-Nov-81 DAS V5.9 (JPS) Put in John's code for Megabyte memory. 4-Nov-81 DAS V5.8 Added code for the 10 MBaud Ether24; { Overrun } IOEUEF = -25; { Undetermined equipment fault } IOESOR = -26; { Sector out of rangenet. 1-Jul-81 BAM V5.7 Changed name of Screen to ScreenOut 25-Jun-81 JPS V5.6 Change EnableTablet to InitGPIB a } IOETIM = -27; { Time out error } IOEFRS = -28; { Floppy recalibrate done } IOEDRS = -29; nd do not enable the tablet. 3-Jun-81 JPS V5.5 Add Virgil headers and commands. 23-Ma)  Manual. MicroCode>MakeBoot MakeBoot - Enable booting a new system MakeBoot writes boot files onto hard disk and fl FileSystem (as opposed to FLOPPY) floppies before you remove them from the floppy drive. If you fail to do thioppy disk. It is self-prompting. Its command line is: MAKEBOOT [RunFile] See the section "Booting the Macs, the next floppy put into the drive may be overwritten and the fileSystem floppy is also likely to be corrupted.hine" in the PERQ Introductory User Manual for more details on booting. The manual How to Make a New System gives complet 2. Floppies written with the FLOPPY program cannot be mounted or dismounted. 3. A device may be moue description of the MakeBoot program. FileUtilities>MakeDir MakeDir - Create a new directory MakeDir creates a new emnted more than once. 4. It's a bad idea to dismount the device you're running from. If you do, the system will pty directory. Its command line is: MAKEDIR [FileSpecification] where FileSpecification is the name for the newnot be able to find the Shell. MicroCode>ODTPRQ ODTPRQ - Debug microcode across a Link ODTPRQ is a simple deb directory. If you do not specify the name you will be prompted for it. All directories have a .Dr extension; Mugger for microcode and new operating systems. ODTPRQ runs on a PERQ other than the one that is being debugged. It communicatakeDir will provide this automat- ically if you do not specify it. MakeDir will not accept as its parameter the name ROOT es through a Link board that is plugged into the I/O option slot in the card cage. ODTPRQ has an online help facility.or the name of any extant file that has a .Dr extension; it will print an error message if you pass it such a name. See t The ODTPRQ command line is: ODTPRQ [StateFileName] where StateFileName is the name of a State File. FileUhe PERQ Introductory User Manual for more information on files and directories. FileUtilities>Mount Mount - Start using devitilities>Partition Partition - Reorganize disk Partition creates new partitions on a device (such as hard disk or floce The Mount command is used to attach devices to the filesystem. Devices must be mounted before files on them cappy). It can also be used to modify the names and sizes of existing partitions. Creating a new partition destroys all on be accessed by the fileSystem. The two Mount commands are: MOUNT H[ARDDISK] and MOUNT F[LOPPY] Note ld data in the area where the partition is made. The device should first be formatted before using Partition. After formathat these are the forms to use no matter what the name devices were given when partitioned. The device that was booted frtting, Partition is the first program to run. Its command line is: PARTITION The program is self-promptingom is mounted automatically by the system. Notes on Mount and Dismount: 1. It is imperative that you dismount . Refer to "Partitions and the Partition Program" in PERQ File System Utilities Manual before using it. FileUtilities>*  Moved new/dispose of CB from UnitIO to IO.Init. 16-Feb-81 BAM V4.1 Put back in conversions on Disk Physical block numbers; fixed botCursF bug. Del XXX procedures; Changed to use new screen 9-Feb-81 BAM V4.0 No longer does conversions on Disk Physical block numbers; fixed CursoModule IO_Others; {----------------------------------------------------------------------------- { { IO_Others - MiscellaneourUpdate to allow partial screen display and added procedure IOScreenSize to set a s IO routines. { Miles A. Barel ca. 1 Jan 80. { Copyright (C) 1980, Three Rivers Computer Corporation { { Abstract: {  new size. 13-Jan-81 JPS V3.3 Move creation of the IOSeg to memory manager init. Move $R- IO_Others exports routines for the Cursor, Table, Screen, Time, and { Keyboard. { {---------------------------------- to private part. 20-Nov-80 JPS V3.2 Initialize TabFifoInx in InitTablet. 17-Nov-80 JPS V3.1 Export the interr-------------------------------------------} {-----------------------------------------------------------------------------  1. Use new form of the SetCylinder StartIO. 2. Don't bother doing 10 trys in FindSize since only upt table. Check SystemInitialized for control-C abort. 16-Nov-80 BAM V3.0 Radically changed  the last result was believed regardless of success or failure. Cursor and Tablet interface. New time procedures. Split into another include file. 10-Oct-80  3. Hang if we cannot figure out the size of the disk. 11-Apr-81 JPS V4.6 Changes for virtual memory. JPS V2.2 Added support for the diagnostic display (DDS). 27-Sep-80 DAS V2.1 Added timeout code to UnitIO for the  19-Mar-81 BAM V4.5 Changed name of included modules to IO_Init and IO_Proc 3-Mar-81 JPS V4.4 1) Fix LocateDskHea hard disk. 19-Sep-80 DAS V2.0 Added code for 24 MByte disks. } {**************************ds and FindSize to agree with V4.3. 2) Teach the HardDisk timeout code about multi-sector *****} Exports {*****************************} Procedure InitIO; {*******************************} Private  operations. 28-Feb-81 JPS V4.3 No longer do conversions on Disk Physical block n {*****************************} umbers (reinstating changes made in V4.0). 25-Feb-81 GGR V4.2 Added setting/reading of DskFill1 in UnitIO. * s: PATH [pathname] Path does not affect the search list. If Path is called without an argument, it prints the S232 Print prints files to a GPIB printer. Its command line is: PRINT [FileSpecification] If the Ficurrent path. A new path can then be typed or Carriage Return to exit without changing the path. The final ">" of a directoleSpecification is omitted, you will be prompted for one. If the printer is connected to the RS232 port, Print requires Z8ry name is optional for the path command so "Path Foo" changes the path to the directory foo.Dr. Path will print an error 0 PROMs version 8.5 (or higher) for proper operation. These two PROMs are located on the "IO" board (red color-coded) and arePatch Patch - Modify a disk block Patch allows you to examine and modify the contents of a disk file. To run it, type:message if you try to Path to a nonexistant directory. If you attempt to set a Path from which the Shell cannot be acces PATCH [filename] If you have not specified a filename or if the specified file does not exist, PATCH promsed (which can happen if you change the SearchList), Path requires confirma- tion. Pause Pause - Stop execution until REpts for the filename. When it has a valid file, it prompts with: Read Block [0]? Type return to lookTURN Pause can be used to suspend the execution of a command file and wait for user confirmation before proceeding.  at the block number in brackets or type a new block number. You can also type HELP for some online documentation that descr It takes a message as a parameter, prints it on the screen, and then waits for a carriage return on the keyboard before contibes the commands you can use. When you ask to read a block, Patch displays it byte by byte or word by word on your screen iinuing. This command can be given by the user, but it is most useful in command files when some user action is required befn 32-rows. You can reference each byte with the indices 0 to 511. Patch permits you to make temporary or permanent chore proceeding, e.g., changing floppies. Perq.Files.Help Perq.Files - Software Index maintenance program Part of the danges to your file. To access all hard disk blocks, you can patch the SYS: file. FileUtilities>Path Path - Change to anothocumentation for each PERQ operating system is a file called PERQ.Files which describes all the files in the system and ser directory Your "path" is the directory you are currently using. To find named files, the system will first looktates which part of the system they are in. The PERQ.Files program is used to list portions of the PERQ.Files text file an in this directory and then in directories specified in your search list. (See SetSearch below). New files are created id to make command files. Run the program by typing: PERQ.Files and type "Help" when you are prompted. The n this directory if a different one is not specified. The Path command changes the current directory. The command line i program types out a comprehensive description on how to use the program. Devices>Print Print - Print a file to GPIB or R+  and reading the cursor pattern must use IncIOCount to ensure that the client' Put back in conversions on Disk Physical block numbers; fixed botCursF bug. Del XXX procedures; s segment is swapped in. 4-Jun-81 JPS V5.4 Export new IOKeyClear procedure. 3-Jun-81 JPS V5.3 Add Virgil heade Changed to use new screen 9-Feb-81 BAM V4.0 No longer does conversions on Disk Physical block rs and comments. 23-May-81 JPS V5.2 Replace enable/disable of control-c processing (exported by numbers; fixed CursorUpdate to allow partial screen display and added procedure  System) with enable/disable of KeyBoard interrupts (exported by IO_Others). 31-Mar-81 GGR V5.IOScreenSize to set a new size. 13-Jan-81 JPS V3.3 Move creation of the IOSeg to memory mana1 Added 4-button mouse support. 11-May-81 JPS V5.0 Split IO into several modules. Removed IOSeger init. Move $R- to private part. 20-Nov-80 JPS V3.2 Initialize TabFifoInx in InitTablet. tTime procedure 6-May-81 JPS V4.7 1. Use new form of the SetCylinder StartIO. 2. Don't bothe 17-Nov-80 JPS V3.1 Export the interrupt table. Check SystemInitialized for control-C abort. r doing 10 trys in FindSize since only the last result was believed regardless of success  16-Nov-80 BAM V3.0 Radically changed Cursor and Tablet interface. New time procedures. Split in or failure. 3. Hang if we cannot figure out the size of the disk. 11-Apr-81 Jto another include file. 10-Oct-80 JPS V2.2 Added support for the diagnostic display (DDS). 27-Sep-80 DAS V2.1PS V4.6 Changes for virtual memory. 19-Mar-81 BAM V4.5 Changed name of included modules to IO_Init and IO_Proc  Added timeout code to UnitIO for the hard disk. 19-Sep-80 DAS V2.0 Added code for 24 MByte { Change Log: { 28 Jan 82 WJH V5.7 increment ErrorCnt in IOSetModeTablet 22 Dec 81 WJH V5.6 fix IOGetTime for c 3-Mar-81 JPS V4.4 1) Fix LocateDskHeads and FindSize to agree with V4.3. 2) Teach the HardDisk tialls while booting 25-Jun-81 JPS V5.5 Add new TabletMode: offTablet which disables the tabletmeout code about multi-sector operations. 28-Feb-81 JPS V4.3 No longer do conversions on Dis. Make all other TabletModes enable it. Get rid of EnTabUpdate and EnCurUpdate--go back to k Physical block numbers (reinstating changes made in V4.0). 25-Feb-81 GGR V4.2 Added setting/r disabling and enabling interrupts during tablet and cursor code. This means that loadingeading of DskFill1 in UnitIO. Moved new/dispose of CB from UnitIO to IO.Init. 16-Feb-81 BAM V4.1+ can be loaded into the PERQ microstore. The PERQ Microprogram- mers Guide has details on the use of PRQPlace. MicroCode>QDis DestinationFile. You can rename a file from one directory to another (move the file) as long as both directories are in the QDis - Display the QCodes in a compiled .SEG file QDis is a disassembler for Q-Code. It decodes a .Seg file into  same partition. Rename prompts for any missing arguments. You may rename a .Run file, but if you rename a .Seg file you Q-code. The command line: QDIS causes the following sequence: 1. The program identifies itself a must re-link the programs which use it. The source file for Rename may contain wild cards (for a description of the wild cs QCode Disassembler. 2. You are then prompted for an input file. Type the name of the program or moduards, see the "PERQ Introductory User Manual"). If the source contains wild cards, the destination must contain the same wle you want disassembled. (Since the input to QDis is a .Seg file, the input file must have been compiild cards in the same order. In this case, Rename finds all files in the directory which match the source pattern. For thesled.) You needn't specify .Seg but must specify extension if it is anything else. 3. Next, you are prome files, the part of the source file name that matched each wild card is used to replace the corresponding wild card in the  labeled with the version number. The PROM versions are not relevant if the printer is connected to the GPIB (IEEE-pted for an output file. The default is CONSOLE: . 4. QDis displays a list of the program's routines a488) port; Print operates correctly. Contact Three Rivers field service department to ex- change earlier PROM versions. nd the following information about each: Routine name Routine number  Print expects to find the printer at GPIB address one (1). MicroCode>PRQMic PRQMic - Microcode assembler PRQMic is  Lexical level Parameter size Result + Parameter size Local + Temporary the PERQ microcode assembler. It takes a microcode source program (whose extension is .MICRO), and produces output that  size Entry address Exit address 5. QDis next will ask you which routine you'd lik can be used as input to the microplacer, PRQPlace. The PERQ Microprogrammers Guide has details on how to write micrope to see disassembled. Type in a routine number; the program then types a listing of that routine's rograms and how to use PRQMic. MicroCode>PRQPlace PRQPlace - Combine microcode and assign addresses PRQPlace is the P Q-code translation. Step 5 can be repeated indefinitely. FileUtilities>Rename Rename - Change the name of a fiERQ microcode placer. It takes the output from the microassembler, PRQMic, and produces a file (with extension .BIN) that le Typing the command line: RENAME SourceFile[~]DestinationFile will change the name of SourceFile to,  Exports {*****************************} Imports SystemDefs from SystemDefs; { tablet/cursor procedures }  Tablet coordinates are copied every 1/60th Type CursFunction = (CTWhite, CTCursorOnly, CTBlackHole, CTInvBlackHole, CTNormal, CTInvert, CTCursC second into the cursor position. if indep, then coordinates are changed ompl, CTInvCursCompl); TabletMode = (relTablet, scrAbsTablet, tabAbsTablet, offTablet); CursMode = (OffCursor, only by user. If off, then no cursor displ TrackCursor, IndepCursor); CursorPattern = array[0..63,0..3] of integer; CurPatPtr = ^CursorPattern; Varayed } Procedure IOSetCursorPos(x,y: Integer); { if trackCursor is false, then sets  TabRelX, TabRelY: integer; { tablet relative coordinates } TabAbsX, TabAbsY: integer; { tablet absolute  cursor x and y pos. If tracking, then sets both tablet and cursor. } Procedure IOcoordinates } TabFinger: boolean; { finger on tablet } TabSwitch: boolean; { switch puSetTabPos (x,y: Integer); { if trackCursor is false, then sets tablet x and y pos. Ished down } TabWhite : boolean; { True if white button down } TabGreen : boolean; { True if grf tracking, then sets both tablet and cursor } een button down } TabBlue : boolean; { True if blue button down } TabYellow : boolean; { True  Procedure IOReadCursPicture(pat: CurPatPtr; var px, py: integer); { copies currentif yellow button down } TabMouse : integer; { Actual output from mouse } DefaultCursor: CurPatPtr;  cursor picture into pat and sets px and py with the  { default cursor pattern } Procedure IOLoadCursor(Pat: CurPatPtr; pX, pY: integer);  offsets for the current cursor } Procedure IOGetTime(var t: double); { Get the double word 60 Hertz time }  { load user cursor pattern } Procedure IOReadTablet(var tabX, tabY: integer); { read tablet coordinates } Proce {Procedure to change screen size} Procedure IOScreenSize(newSize: integer; complement: Boolean); dure IOSetFunction(f: CursFunction); Procedure IOSetModeTablet(m: TabletMode); { set the mode to tell what kind of  { newSize is number of scan lines in new screen; must be a disks. {-----------------------------------------------------------------------------} {*******************************} tablet is currently in use } Procedure IOCursorMode (m: CursMode); { if track is true, then, o wild cards, the destination file name may contain, at most, one occurance of the wild card "*". In this case, the non-direa convenient method to reexecute the default file remember- ed by the Shell and supply new arguments to the runfile. Thctory part of the source replaces the "*" in the destination. For example, RENAME sys:Boot>newOS>myprog.Pas die command line is: ReRun arguments The ReRun command is most useful when the default file has an especially r3>new.* would rename the file "sys:Boot>newOS>myprog.Pas" to a new file named "dir3>new.myProg.Pas". This is most u long name. For example, if "Programwithlongname" is the default file, the command: ReRun A b 3 is the same as typiseful when you want to rename a file from one directory to another with the same name. For example, RENAMng: Programwithlongname A b 3 Program>Run Run - Execute a program Run is another way to invoke the default fE dir1>prog.Pas * moves prog.pas from the directory "dir1" into the current directory. If there are no wild cards in the sile remembered by the Shell. If you have been editing, compiling and linking the default file, simply typing: ource, an attempt to include in the destination name other wild card characters, besides the single "*" discussed above, ma RUN executes that default file. The Run command sets the default file to the specified runfile. For example, the comy lead to problems later. These extra wild cards will be treated as simple literal characters. Because a file name with wmand: RUN Foo arg1 arg2 is the same as typing: Foo arg1 arg2 except that the first commandild cards in it is hard to specify, Rename requires confirmation before creating a file with wild cards in the name. I (Run Foo arg1 arg2) sets the default file to Foo. ScreenSize ScreenSize - Shrink screen for next execution The displf the the destination file already exists, Rename requests confir- mation before deleting. This can be disabled by using thay on the PERQ screen is stored in memory and requires 48K words (192 blocks). Sometimes it is advisable to give up some odestination. As an example, for the command: RENAME foo*.abc# anotherdir>*baz.rmn#z The input file e switch "/NOCONFIRM" or enabled using the switch "/CONFIRM". /NOCONFIRM also sets /NOASK. If an error is discovered a"FOOZAP.ABCD" would be renamed to the new file "anotherdir>ZAPbaz.rmnDz". If wild cards are used, Rename asks for verifind wild cards were used, Rename asks the user whether to continue processing the rest of the files that match the input. cation of each file renamed. This can be disabled with the switch "/NOASK" or enabled with the switch "/ASK." The defaul This confirmation is required no matter what switches were specified. A final switch is "/HELP" which describes the functiot is enabled. Wild cards are not allowed in the directory part of the source file. When the source file name contains nn of Rename and the various switches. Program>ReRun ReRun - Use new arguments and re-execute last program run ReRun is - hich make up the IO system. { { Design: { Interrupt routines must *never* cause segment faults. { {------------------ 1) Fix LocateDskHeads and FindSize to agree with V4.3. 2) Teach the HardDisk timeout code about multi------------------------------------------------------------} { 2 Dec-81 BAM V5.9 Added Help switch. 16-Nov-81 DAsector operations. 28-Feb-81 JPS V4.3 No longer do conversions on Disk Physical block  multiple of 128. Complement tells whether the S V5.8 (JPS) Put in John's changes for megabyte memory. 4-Nov-81 DAS V5.8 Fixed for 10 MBaud Ethernet. 25-Jun-81 rest of the screen should be the opposite color from the displayed  JPS V5.7 Get rid of EnTabUpdate and EnCurUpdate since they didn't work anyway. 4-Jun-81 JPS  part } { disable/enable keyboard interrupts } Procedure IOKeyDisable( var OldKeyEnable: Bo V5.6 Fix Beep when type ahead too far (for the last time I hope). 3-Jun-81 JPS V5.5 Add Virgolean ); Procedure IOKeyEnable( OldKeyEnable: Boolean ); { clear the IO type-ahead buffer } Procedure IOKeyClear; il headers and comments. 23-May-81 JPS V5.4 Use new IOKeyDisable/IOKeyEnable in place of old Di{*******************************} Private {*****************************} sCtlC/EnaCtlC. Reinstate Beep when type ahead too far. 22-May-81 JPS V5.3 Fix control-c processing. Remove Beep when type ahead too far. 16-Apr-81 GGR V5.2 Add 3MHz Ethernet Drivers (JEB) 31-Mar-81 GGR V5.1 Added 4-button mouse support. 11-May-81 JPS V5.0 Split IO into several modules.  6-May-81 JPS V4.7 1. Use new form of the SetCylinder StartIO. 2. Don't bother doing 10 trys in FindModule IO_Private; {----------------------------------------------------------------------------- { { IO_Private - IO system Size since only the last result was believed regardless of success or faprivate definitions and interrupt routines. { Miles A. Barel ca. 1 Jan 80. { Copyright (C) 1980, Three Rivers Computer Corporilure. 3. Hang if we cannot figure out the size of the disk. 11-Apr-81 JPS V4.6 Changes for vation { { Abstract: { IO_Private exports interrupt routines and definitions which are private { to the modules wirtual memory. 19-Mar-81 BAM V4.5 Changed name of included modules to IO_Init and IO_Proc 3-Mar-81 JPS V4.4 - ing off so it shrinks the screen to allow its data and code to fit into memory. Even when swapping is enabled, some prograr. /WHITE This switch forces the bottom of the screen area to the same color as tms, such as the compiler, want to trade speed for screen size. The ScreenSize command prompts for the number of scan lines uhe usable part of the screen. /BLACK This switch forces the bottom of the screen area to sed in the display for the next program run. The screen expands to full size after that program has completed. The full the opposite color of the general background. The Shell shrinks the screen automatically for certain programs. If  screen has 1024 lines in it. The number you supply must be greater than zero, less than or equal to 1024, and a multiple you explicitly call ScreenSize before these programs are run, then the Shell will not override your settings. FileUtilitie of 128 (e.g. 128, 512, 768, etc.). You can specify a number in the range 1 through 8 and ScreenSize will multiply s>Scavenger Scavenger - Recover disk if file structures damaged The Scavenger checks the filesystem's structures athe number by 128. For example, if you specify the value 4, ScreenSize multiplies 4 by 128 and uses 512 as the number ofnd fixes any errors found. It can be called any time you suspect a filesystem problem or whenever you need to reconst scan lines (512 is half of the screen). ScreenSize accepts four switches to permit you to control the bottom portion of theruct a directory. It is self-prompting. Its command line is: SCAVENGE For more details on this program display. The switches are: /ON This switch permits you to see the data or code , see the section "Scavenger Program" in the PERQ File System Utilities Manual. Devices>SetBaud SetBaud - Change baud rthat is stored in the screen area. The memory manager is told that the memory is free, but the Iate on RS232 SetBaud allows you to specify the baud rate to the RS232 line. Valid baud rates are: 110; 150; 300; O package still thinks it should be displayed. The screen package will not let you create a win600; 1200; 2400; 4800; and 9600. The command syntax is: SetBaud 4800 FileUtilities>SetSearch SetSearch - Changedow or write into that area (unless a program calls RasterOp or Line directly).  list of directories to search for files SetSearch allows you to add and remove paths to search lists and to change theThis switch is the default condition, unless an entry in the user profile has changed it (see Loir order. Its command line is: SETSEARCH [pathname][,pathname] If you do not specify a pathname, SetSearch dif the screen and allow this memory to be used for storing data or programs. For example, the Scavenger runs with swappgin above). /OFF This switch forces the bottom of the screen area to a solid colo.  Radically changed Cursor and Tablet interface. New time procedures. Split into another include fileal Codes } PSGPIB = 0; PSZ80Monitor = #11; PSTablet = 6; PSKeyBoard = 7; PSRS232 = . 10-Oct-80 JPS V2.2 Added support for the diagnostic display (DDS). 27-Sep-80 DAS V2.1 Added timeout code to5; PSClock = #12; GSFloppy = #40; { Get Status Special Codes } GSGPIB = #100;  UnitIO for the hard disk. 19-Sep-80 DAS V2.0 Added code for 24 MByte disks. } {******* GSZ80Monitor = #10; GSTablet = #2; GSKeyBoard = #4; GSRS232 = #1; GSClock = #20; ************************} Exports {*****************************} Imports SystemDefs from SystemDefs; Imports IO_U DisCst0 = #1154; { consts to terminate Display List; add in funct } DisCst1 = #1351; MinCurYnit from IO_Unit; Imports IO_Others from IO_Others; Imports Raster from Raster; Const CirBufSize = # = 0; { Minimum Y value for cursor } MaxCurY = 1023; { Maximum Y value for cursor } SegSize = numbers (reinstating changes made in V4.0). 25-Feb-81 GGR V4.2 Added setting/reading of DskFill1 in U100-3; { size of circular buffers - made so that } { total size of CirularBuffer = #100 } nitIO. Moved new/dispose of CB from UnitIO to IO.Init. 16-Feb-81 BAM V4.1 Put back in conversio DskBlockSize = 512; { block sizes for fixed block size devices } FlpBlockSize = 128; { Size isns on Disk Physical block numbers; fixed botCursF bug. Del XXX procedures; Ch in BYTES } SpkBlockSize = 128; TabBlockSize = 8; Z80BlockSize = 20; GPIBBlockSize = 1; anged to use new screen 9-Feb-81 BAM V4.0 No longer does conversions on Disk Physical block  Last12Sector = 202 * 4 * 30 -1; {Tracks * Heads * Sectors. 0 start } DskPriority = 0; { interruptnumbers; fixed CursorUpdate to allow partial screen display and added procedure IOScreenSize to set a  priorities } FlpPriority = 3; SpkPriority = 2; {$ifc Ether3MBaud then} Ether3Priority = 12; {$else new size. 13-Jan-81 JPS V3.3 Move creation of the IOSeg to memory manager init. c} {$ifc Ether10MBaud then} Ether10Priority = 12; {$endc} {$endc} GPIBInPriority = 11; GPIBOutPrio Move $R- to private part. 20-Nov-80 JPS V3.2 Initialize TabFifoInx in InitTablet. 17-Nov-80 JPS V3.rity = 1; TabPriority = 10; KeyPriority = 5; RSIPriority = 6; RSOPriority = 7; Z80P1 Export the interrupt table. Check SystemInitialized for control-C abort. 16-Nov-80 BAM V3.0riority = 8; PutPriority = 9; GetPriority = 4; PSFloppy = #14; { Put Status Speci. S Yes To end the display, type the command: STATISTICS No After each program is executed, the Shell prints the Sta are slow, and may be dismounted at any time. FileUtilities>TypeFile TypeFile - Rapidly display a file Type displays antistics for that program in the following format: Load 1.6 secs. Exec 3.6 secs. IO 0.8 secs.y file or files on the console. The command line: TYPEFILE FileSpecification displays a single file on the cosplays the current search list and then permits you to change it or simply exit. If you specify a file name, SetSearc Swap 0.1 secs. Move 0.0 secs. Duty 97.2 percent. Load is the time spent loading the prograh pushes that name onto the search list; if it is a hyphen (-), the first item on the list is popped off. The current m and its modules into memory. Exec is the total time spent executing including IO, Swap and Move times. IO is the tsearch list is 5 items deep with the first and last slots reserved. SetSearch gives you a warning if you attempt to puime spent doing Unit-level IO not including IO time spent swapping. Swap is the amount of time spent swapping. Move is thesh something onto the first slot or pop something off the last. In addition, when you try to exit, SetSearch checks to ma amount of time spent moving segments from one place in memory to another to try to find room for new allocation. Duty factke sure that the Shell can be found with the new search list and path. If not, you are asked for confirmation before exitior is the proportion of time spent in actual work. It is computed in the following way: 100 * (Exec - Swap - Move) /ng. SetTime SetTime - Change current time The SetTime command allows you to specify the date and time. Specif Exec MicroCode>Swap Swap - Turn swapping on or off The Swap command enables or disables the virtual memory system. Ty the time and date as follows: DD MMM YY HH:MM:SS The time notation uses a 24 hour clock and the seconds are optionhe command "SWAP NO" turns virtual memory off, and swaps all active segments into memory. "SWAP YES" turns swapping on. al. An example command line which sets the date to June 3, 1955 and the time to 3:30 PM folllows: SetTime 3 Jun 55 1In this case, you may specify a partition to use for the swap files. For example, SWAP YES Sys:Boot> enables swapp5:30 SetTime permits you to change only the time; if you omit the date, you correct the time. Statistics Statistics - Ting to the Sys:Boot> partition. When booting from the hard disk, swapping is initially enabled in the partition containing turn on or off the display of execution statistics The operating system constantly collects statistics about the phe boot file. If you simply specify SWAP YES with no partition name, this default partition is used. When booting from therformance of the swapper. To display the statistics after each execution completes, specify the command: STATISTICe floppy, swapping is initially disabled. We discourage swapping to a floppy disk because floppies have a small capacity,/ IntEnable = #4; { Ether3 constants } E3TDone = #2000; E3TError = #4000; E3TGo = #10; E3Re=modem change } RSIParErr: boolean; { true=parity error } RIntEnable = #1; E3RDone = #400; E3RPromiscuous = #20; E3RError = #1000; E3RGo = #2; SIOverrun: boolean; { true=overrun error } RSIError: boolean); { OR of all error bits  E3XmtMask = E3TDone + E3TError + E3TGo; E3XmtSucc = E3TDone + E3TGo; E3RecMask = E3RDone + E3RError + E3RGo; } RSOType: (RSOUnused: 0..255); StdType: (StdHiByte: 0..255) end;  E3RecSucc = E3RDone + E3RGo; PackBuffLen = 511; E3RecCount = PackBuffLen - 4; MAXE CircularBuffer = packed record { circular buffer used for character } 3RECERRS = 20; {$endc} Type IOPtrKludge = record case integer of 1: (Buffer: IOBuf { devices, SpGetCir and SpPutCir } Length: integer; { # chars in the buffer } Ptr); 2: (Offset: Integer; Segment: Integer) end; RdPtr: integer; { where to get chrs out } WrPtr: integer; { where to put them in }  {$ifc Ether3MBaud then} EtherBuff = array [0..PackBuffLen] of integer; pEtherBuff  Buffer: packed array[0..CirBufSize-1] of CirBufItem { last, the buffer } = ^EtherBuff; {$endc} CirBufPtr = ^ CircularBuffer; CBType = (KDBType, RSIType, RSOType, StdType);{ end; TabBufPtr = ^TabletBuffer; TabletBuffer = packed record { buffer used for tablet, clock and }  128; { # lines / display segment } CrsHeight = 64; { Height of the cursor } CrsConst0 = #370;  types of circular bufs } CirBufItem = packed record { what we put in circular buffers } ch: char { constants to compute funny X position } VisOnly = #2000; { mode bits - Visual screen only } VisAn; { the character } case CBType of { and device specific condition bits } dCur = #2400; { visual screen and cursor } Map = #100000; { cursor map function }  KDBType: (KDBUnused: 0..63; KDBOverrun: boolean; { true = overrun }  CtrlC = chr(#3); CtrlS = chr(#23); CtrlQ = chr(#21); BlamCh = Chr(#303); { untranslated shif KDBError: boolean); { OR of all error bits } RSIType: (RSIUnused: 0..7; t-control-C } DumpCh = Chr(#304); { untranslated shift-control-D } {$ifc Ether3MBaud then} E3T RSIBreak: boolean; { true=break received } RSIModem: boolean; { tru/ ypeFile will display the default file name. This is the same default file used by the Editor, Linker, Run, etc. Unlike tchange his password or enters a password for a new user. Note that when you specify hese programs, however, TypeFile does not change the default file name. UserControl UserControl - Maintain the list of usethe /PASS switch, UserControl prompts for the password. You can enter any printing rs allowed on the Perq UserControl is used to maintain the System.Users file which contains information about valid usercharacter except blanks, spaces, equal signs (=), commas (,), or slashes (/). The ms and their passwords, group identi- fiers, and user profiles. This information is used by the Login program (see aboaximum number of characters is 31. You can also respond to the password prompt withve). The System.Users file must be in the root directory (top level) of the partition where the boot file is. Its comm CR. This causes a null password to be entered for the user. If you omit the switnsole. To display multiple files, sequentially, separate the file specifications with a comma (,). When the TypeFile cand line takes the form: USERCONTROL [command][/switch(es)] If you include a command, UserControl executes the command finds a formfeed character (^^L) in the file or when it gets to the bottom of the screen, it waits after displayinommand and then exits to the Shell. If you do not include a command, UserControl prompts with: UC> and wag a screenful of text. This permits the user to read the page before the screen is erased and the next page is displayed. Tits for input. The following are valid commands: HELP Provides online documentation. o continue, type ^^Q. This waiting can be disabled by using the /NOWAIT switch. The /WAIT switch, which is the defaul ADDUSER [username][/switch(es)] Adds a new user to the user file or, updates t, causes the waiting to happen. The final switch available is /HELP, which displays online documentation. The Type the information for an existing user. If you omit a username, the command prompts for File command displays a solid, left pointing triangle when it reaches the end of the file. TypeFile does extension compl one. Any printing character except blanks, spaces, equal signs (=), commetion on the file name specified. If the file to print is FOO.PAS, it is only necessary to type FOO. The extensions that tas (,), or slashes (/) are valid usernames. The maximum number of characters is 31.ype knows about, in order tried, are: Pas, Micro, Cmd, Dfs, and Doc. If no filename is supplied on the command line, T The command accepts the following switches: /PASS - permits an existing user to 0  DispPtr = ^DisplayFile; DisplayFile = array[0..11] of packed record case boolean of  TabIgnore = 2; { number of points to ignore when finger is } { picked up or p true: (int: integer); false:(LineCount: 0..127; StartOver: boolean; ut down } TabFifoLen = TabAverage + TabIgnore; TabFifoMax = TabFifoLen - 1; GPIBxFudge = 38; { ShowCursor: boolean; VerticalRetrace: boolean;  actual range in X and Y for BitPad: 0..2200 } GPIByFudge = 1061; { of TX and TY: 0..1100 } ShowScreen: boolean; DisableMicroInterrupt: boolean; WriteBadParity: boo { of TabAbsX: 0..1100 } { of TabAbsY: 0..1100 } { olean; Map: (CursOnly, CCursOnly, Compl, ComplInv, Normal, Invert, f TabRelX: -38..1062 limited to 0..767 } { of TabRelY: 1061..-39 limited to 1023..0 } CursComp, InvCursCompl)) end; ScrCtlPtr = ^ ScrCtlBlock; ScrCtlBlock = packed recor STopY = 0; SLeftX = 0; SRightX = 767; Type DskCmds = (DskIdle, DskRdCheck, DskDiagRed Cmd: DispPtr; ScreenBase: Integer; CursorBase: Integer; Unad, DskWrCheck, DskWrFirst, DskFormat, DskSeek, DskClear); {$ifc Ether3MBaud then} used1: Integer; Unused2: Integer; CursX: integer; filler: integer  Ether3Cmds = (E3Rset, E3Status, E3Receive, E3PromiscReceive, E3Transmit); {$endc} FlpCm end; Const DskSPC = 30; { Sectors Per Cynlinder } DskHds = 8; { Max numberds = (FlpUnUsed, FlpRead, FlpWrite, FlpFormat, FlpSeek, FlpReset); GPIBCmds = (GPIBNop, GPIBWrite, GPIBWrEOI, of dsk heads } DskExHds = 0; { Extra heads not in use } DskCyls = 202; { Number of cylinde GPIBCntl); { Types of block devices } IOCBType = (DskType, FlpType, SpkType, GPIBType, rs } FlpUnits = 4; { 0 is the only valid unit } FlpSPC = 26; { numbered 1 to 26 } {$ifc Ether3MBaud then} Ether3Type, {$endc} GenT TabX: 0..#77777; { Z80 Monitor Info } TabSwitch: boolean; TabY: 0..#777 FlpHds = 2; { numbered 0 to 1 } FlpCyls = 77; { numbered 0 to 77, 0 should not be used } 77; Fill: 0..1; ClkTime: double; Z80Mon: Z80Readings end;  TabAverage = 4; { number of tablet points to average } { this MUST be 4 } 0 . For an existing user, group id is unchanged if the switch is omitted.  to pointer %Replay - Play back the most recent edit %I - Insert before selection %A - Append after selection %Keys /PROF=[profile] - specifies the complete path for the user's profile file.  - special Keys during insertion %S - Substitute for selection %Accept - (Use INS) to do A,I,S,R,F %D - Delete the sel If you omit the switch for a new user, the default is SYS:USER>name>PROFILE. For an ected text %Reject - (Use DEL) to abort A,I,S,R,F,G %F - Find a string in file %R - Replace occurrences of string %Poin existing user, the profile is unchanged if you omit the switch. CHECKUSER [username]ter - to select text %V - Set Verify mode for R %Scroll - see adjacent view %* - Select entire file  Validates a username and password. If you omit the username, the command promp %Thumb - see remote views %< > - Set direction for F,R,G,L,W %digits - Set repetition count %INS - Repeat last A,ts for one. NEWFILE Destroys the existing System.Users file and creI,S,R,D,F,G $KeyCommands - Index of keyboard commands for selecting text REPLAY Transcript/Replay ates a new System.Users file. LISTUSERS Displays a list of all of the valid users.  ----------------- The Editor writes a transcript file during every edit session. The transcript is a file REMOVEUSER [username] Delete a user from the file. If you omit the usern which contains a description of every keystroke and puck or pen press performed during an edit session. This transcriptch for a new user, the password defaults to null. For an existing user, the passworame, the command prompts for one. QUIT Exits the program. You can also specify the /Hd is unchanged if the switch /GROUP=[group id] - permits an existing user to changELP switch (type /HELP or press the HELP key) with any command or in response to any prompt to display specific help ine the group id or enters a group id for a new user. The value for group id can be aformation. ny integer from 0 to 255 inclusive. If you do not specify a group id, you are prompEditor V2.0 Help Copyright (C)1981, 3RCC %Q - Quit (leave the editor) %HELP - Hted for a value. If you omit the switch for a new user, the group id defaults to 1ow to use this Help information %Introduction - general instructions %E - Extend selection1 ro: boolean; DskWriteFault: boolean; DskSeekComplete: boolean;  Ether3Delay: integer; Ether3WdCnt: integer; Ether3Status: integer; ype); IOCBPtr = ^IOCB; IOCB = packed record { IOCBs must be 8 word aligned } Buffer: IOBu DskDriveRead: boolean; DskNextIOCB: IOCBPtr); FlpType: fPtr; { data buffer for transaction } case IOCBType of DskType: ( D ( FlpUnit: 0..FlpUnits-1; FlpHead: 0..FlpHds-1; FlpFill1: 0..31; skCommand: 0..255; DskNumSect: 0..255; (* NEW FS [*) D FlpCylinder: 0..255 { 0..FlpCyls-1 }; FlpSector: 0..255 { 1..FlpSPC }; skAddr: Integer; (* NEW FS *) (* OLD FS [) DskSector: 0 FlpCommand: 0..255 { FlpCmds }; FlpByteCnt: integer { 0..256 }; Flp..DskSPC-1; DskHead: 0..DskHds+DskExHds-1; DskCylinder: 0..DskCyls-1; Fill2: array [4..11] of integer; FlpResult: integer; { Not yet defined } F (* OLD FS *) DskSerialNum: double; DskLogBlk: integer; lpNextIOCB: IOCBPtr); SpkType: ( SpkFill0: 0..255; SpkNumBu DskFill1: integer; DskNextAdr: double; DskPrevAdr: double; fs: 0..255; SpkFill1: array[3..11] of integer; SpkFill2: 0..16383;  DskCntlError: ( OK, AddrsErr, { address error }  SpkAddrErr: boolean; SpkError: boolean; SpkNextIOCB: IOCBPtr);  PHCRC, { Physical Header CRC } LHSer,  GPIBType: (GPIBCommand: GPIBCmds; GPIBF0: 0..63;  { Logical Serial Wrong } LHLB, { Logical Block Wrong }  GPIBNumBufs: 0..255; GPIBByteCount: 0..255; GPIBF1: array [4.. LHCRC, { Logical Header CRC } DaCRC, { Data CRC }11] of integer; GPIBResult: integer; {Not Implemented} GPIBNextIOCB: IOCBPtr); Busy); DskFill2: boolean; DskTrackZe {$ifc Ether3MBaud then} Ether3Type: ( Ether3Cmd: integer; 1 r saves keystrokes and presses and writes them to the transcript file whenever: 1) A carriage-return is typed in Inserl you are done, then either Accept or Reject the insertion. If you Accept immediately after typing "A", tht mode. 2) A command which changes the text is successfully completed. 3) The transcript buffer is filled. Ie most recently inserted or deleted text is inserted. If you Accept, the text you have just typed is displayed f an old transcript file exists, it is destroyed the first time the buffer is flushed. This means that you can re-enter at the top of the screen inside of I{ ... } . D D - Delete the selected text. If you delete text, it is the Editor without destroying the old transcript file as long as you do not do something that causes the buffer to be flushe displayed at the top of the screen inside of D{ ... } . The character which immediately followd. Keep in mind that presses count against the 256-word buffer. If you do not want to destroy the old transcript file, do ns the deleted text is selected. E E - Extend the selection Once you have selected some text, you can ot type any commands, do not press more than a few times, and exit the Editor by typing control-shift-C. To extend the selection by moving the pen to another piece of text and then typing "E". The selection is extreplay a transcript, type "Editor/Replay". The Editor replays the previous edit session and stops just before the firended to a character, word, or line boundary, depending on the type of your last selection. Commands that change the selst command. You can control the replay by typing one of the following keys: SPACE stop replaying after the next chection (other than Extend) set the type to character. Unfortunately, you can make the selection larger with aracter or puck press. CR stop replaying after a carriage return in I command or after next command ifExtend, but you cannot make it smaller. In order to make the selection smaller, you must start over by selec not in I command. LF stop replaying after next command. INS begin replaying and stop when one of the aboveting a character, word, or line. F F - Find a character string starting at the beginning of the selected text.  keys is typed. DEL exit replay mode. If no DEL key is typed, the Editor automatically exit When you type "F", the top line shows the prompt Find: enter target string Type the string  is written to the file ">Editor.Transcript". The transcript may be replayed later. This feature is intended for use whens from replay mode when the end of the transcript is reached. Once you have exited replay mode you can begin editin the Editor or the PERQ crashes during an edit session or if you make some disasterous error with the Editor. The Editog normally, but we suggest that you Quit-Update as soon as possible. A A - Append text after the selection. Type text unti2 ointX, PointY: integer; { the point of the cursor } TabFifo: array[0..TabFifoMax] of record Xs] of record { NO Fake Units Included Here! } SSN: integer,Y: integer end; { fifo of tablet points } TabFifoInx: integer; { index into tablet fifo } TabCoun; GPtr: integer; Rtn: 0..255; SLink: intet: integer; { counter for ignoring tablet points } SumX, SumY: integer; { sum of 4 points for ager end; Var IntTab: IntTabPtr; { pointer to interrupt vector table } veraging } FlpLastCylinder: integer; { last cylinder referenced } FlpLastHead: integer; { last IOPriv1Unused: boolean; { ***** Unused ***** } IOPriv2Unused: boolean; { ***** Unused ***** }  Ether3NextIOCB: IOCBPtr ); {$endc} GenType: { General Purpose entry }  head referenced } GPIBTabletState: integer; { GPIB tablet current state } GPIBxTablet, GPIByTablet: int ( GenCmd: 0..255; NumBlks: 0..255; GenFill0: array[3..11] of integer; eger; { GPIB tablet coordinates } GPIBInBuf: CirBufPtr; { GPIB input buffer } StanleyTablet: boolea Result: integer; NextIOCB: IOCBPtr) end { IOCB }; n; { if Stanley tablet is enabled } CurDskHds: integer; { number of heads on this disk. 4 or 8}  Var KRBuf, { Keyboard Raw Buffer } KTBuf, { Keyboard transl CursF: integer; { function currently in use} BotCursF: integer; { function for areaated buffer } RSIBuf, { RS-232 In Buffer } RSOBuf: CirBufPtr; { RS-232 Ou below used area} BotComplemented: boolean; { whether bot is complemented or not} SBottomY: integer; t Buffer } TabBuf: TabBufPtr; { Tablet/Clock Buffer } ScrBuf: ScrCtlPtr; { Screen co { bottom of displayed area } TabMode: TabletMode; { Current mode of the tablet } CCursModntrol blocks } DisFile0,DisFile1: DispPtr; { Screen Display lists - double bufrs } OldCurY, e: CursMode; { Current mode of cursor } newFunct: Boolean; { Tells when have a new function to  { previous Cursor Y position } OldCurX: integer; { previous Cursor X position MOD 8 } C insure that cursor redisplayed } CB : IOCBPtr; { Pursor: CurPatPtr; { Cursor Pattern } CursorX, CursorY: integer; { new cursor coordinates } Pointer to IOCB used by UnitIO } Type IntTabPtr = ^IntVecTable; IntVecTable = array [0..MaxUnit-FakeUnit2 o return to the Editor : Type one of these letters followed by RETURN. The RETURN is required so replace occurrences of the target string. If you Accept before typing any characters of the replacement stringyou want to search for and then Accept or Reject. Rejecting aborts the Find command. If you Accept immediathat you get a chance to change your mind before it's too late. If you update or write to a file that alrtely after typing "F", the previous target string is used. Lower case letters in the target string will match any eady exists, the Editor saves the old version of the file by adding a "$" to the end of its name. This allows you letter in the text, but upper case letters in the target string will only match upper case letters in the text. I to get the old version back if you decide you made a mistake. You can safely edit the backup file since it hf the target string is found, it becomes the selected text. Note that the target string is shown at the top of tas a different name than the new version of the file. While it is never a good idea to type control-C while you'rehe screen inside of F{ ... } . A Find command can be done in the reverse direction (toward the  in the Editor, you should not type it while the Editor is writing the new copy of your file. You will lose the nbeginning of the file). See the section "Reverse Direction". You can ask the Editor to search for a specified nuew version of your file, and the old version will be in the backup file. If you type control-C before writing thmber of occurrences of the target string by preceding the command with a number. See the section "Repeat Coue new file or type "E" to exit without updating, your file will remain unchanged regard- less of any changes you nt". I I - Insert text before the selection. Type text until you are done, then either Accept or Reject the insermade with the Editor. R R - Replace occurrences of a character string with another character string inside the selectedtion. If you Accept immediately after typing "I", the most recently inserted or deleted text is inserted.  text. Typing "R" causes the prompt Replace: enter target string at the top of the screen. Type in a stIf you Accept, the text you have just typed is displayed at the top of the screen inside of I{ ... } . ring and then Accept or Reject. Note that the target string is displayed inside of F{ ... } just Q Q - Quit from the Editor. When you type "Q", the screen is erased, and a list of options is presented.  as though you were using the the Find command. Capital- ization is ignored. If you Accept, the prompt Re U to update W to write to another file E to exit without updating R tplace: enter replacement string is shown at the top of the screen. Now you can type in the new string which will 3 re Z80Intr; { Z80 monitor } Procedure KeyIntr; { keyboard } Procedure RSIIntr; { RS232 in } Proced (especially GPIB and RS232) { 4-Nov-81 DAS V6.0 Fixed to work with 10 megabuad ethernet. ure RSOIntr; { RS232 out } Procedure PutIntr; { PutStatus completion } Procedure GetIntr; { GetStatus c 1-Jul-81 BAM V5.4 Change Screen name to ScreenOut. 3-Jun-81 JPS V5.3 Add Virgil headers and comments. 23-Mompletion } {$ifc Ether3MBaud then} Procedure Ether3Intr; { 3 MBaud EtherNet completion } Function E3Reset: integer; ay-81 JPS V5.2 Use new IOKeyDisable/IOKeyEnable in place of old DisCtlC/EnaCtlC. 16-Apr-81 G Procedure E3RecStart; {$endc} {*******************************} Private {*****************************} GR V5.1 Add 3MHz Ethernet Drivers (JEB). 11-May-81 JPS V5.0 Split IO into several modules. 6-May-81 JPS V4.7 1. Use new form of the SetCylinder StartIO. 2. Don't bother doing 10 trys in FindSize since only  the last result was believed regardless of success or failure. Module IO_Unit; {----------------------------------------------------------------------------- { { IO_Unit - Unit IO routines 3. Hang if we cannot figure out the size of the disk. 11-Apr-81 JPS V4.6 Changes for virtual memory.  KeyEnable: boolean; { if keyboard interrupts are enabled } {$ifc Ether3MBaud then} Var etherCB: IOCBPtr; . { Miles A. Barel ca. 1 Jan 80. { Copyright (C) 1980, Three Rivers Computer Corporation { { Abstract: { IO_Unit exp { Pointer to IOCB used by Ethernet } pEBuff: IOBufPtr; { Pointer to Ethernet IO buffer } orts procedures to perform IO on the various IO Units { (devices). { { Design: { 1) UnitIO must increment and de E3Restart, { Ether3 state } E3IsPromiscuous, E3InProgress, E3Iscrement the IOCount of the segments { which are involved in IO. { 2) Segment faults must *never* happen while iReceiving: boolean; E3RecErrs: integer; {$endc} { interrupt routines: } Procedure DiskIntr; { hardnterrupts are off. { {-----------------------------------------------------------------------------} {-------------------- disk } Procedure FloppyIntr; { floppy disk } Procedure SpeechIntr; { speech out } Procedure GPIBOutIntr; { --------------------------------------------------------- { Change Log: { { 29 Jan 82 WJHansen V6.2 made time out 300000 {GPIB out } Procedure GPIBInIntr; { GPIB in } Procedure TabIntr; { tablet (actually video retrace } Procedu { 10 Dec 81 WJHansen V6.1 removed Arith; use long for Time { add timeout for all other devices {3  and the text you have just deleted is displayed at the top of the screen inside of D{ ... } . he replace command with DEL. Verify mode is turned off after execution of most commands including the Re After substituting, the character immediately following the deleted text is selected. Be careful with this commandplace command. * * - Select the entire file from beginning to end. Accept Accept and Reject Many Editor commands requir. It is easy to confuse Substitute with Replace. There is no way to "undo" a Substitute command because you cae that the change be Accepted or Rejected. Acceptance is signalled by typing the INS key. Rejection is signalled by typing nnot re-insert the deleted text. Attempting to re-insert the most recently inserted or deleted text will mthe DEL key; in this case the change is not made. Reject Accept and Reject Many Editor commands require that the change be, the previous replacement string is used. This means that to replace with nothing, you must first type a character erely re-insert the text you just typed in. The deleted text is gone forever. This means that if you type "S and then delete it with the BACK SPACE key. In the absence of a repeat count, all occurrences within the sel" when you means to type "R", you may accidentally delete a large portion of your file and have no way of ection are replaced. If a repeat count is typed immediately before the "R", a specified number of occurrences agetting it back. V V - Toggle Verify mode. When you type "V", Verify mode is turned on or off, depending on whethere replaced, starting at the beginning of the selection. See the section "Repeat Count for Find and Replace".r it was off or on before. When Verify mode is on, a "V" is displayed in the upper, right-hand corner of the scree The direction can be changed in the same way as for the Find command. See the section "Direction of Fin. In Verify mode the Replace command gives you the option of replacing, not replacing, or aborting at each occurrend and Replace". S S - Substitute new text for the selected text. This command is similar to the sequence "Insernce of the target string. The prompt Replace: INS replaces, doesn't, DEL aborts is displayed fort, Delete". Type text until you are done, then either Accept or Reject the insertion. If you Accept immediately  each occurrence of the target string. The target string is indicated by a double underline and by the cursorafter typing "S", the most recently inserted or deleted text is inserted. If you Accept, the text you have just t arrow (if you keep the pen away from the tablet). This double underline is difficult to see, but it's there. You may yped is displayed at the top of the screen as the most recently inserted text inside of I{ ... }  now Accept the replacement with INS, you may skip over this occurrence by typing the space-bar, or abort t4  numbers (reinstating changes made in V4.0). 25-Feb-81 GGR V4.2 Added setting/reading of DskFill1 in UnitIO.  { highest legal device code } FakeUnits = 2; { Number of units which don't have StartIO's } IOStart Moved new/dispose of CB from UnitIO to IO.Init. 16-Feb-81 BAM V4.1 Put back in conversions on Disk Physica = 0; { Master Z-80 control } HardDisk = 1; {$ifc Ether3MBaud then} Ether3 = 2; {$elsec} {$ifc El block numbers; fixed botCursF bug. Del XXX procedures; Changed to use new sther10MBaud then} Ether10 = 2; {$endc} {$endc} Floppy = 3; Speech = 4; GPIBIn = 11; creen 9-Feb-81 BAM V4.0 No longer does conversions on Disk Physical block numbers; fixed Cur GPIBOut = 5; Z80Monitor = 6; Tablet = 7; KeyBoard = 8; RS232In = 9; RS232Out =sorUpdate to allow partial screen display and added procedure IOScreenSize to set a  10; SpPutSts = 12; { Put/Get Status } SpGetSts = 13; SpPutCir = 14; { Put/Get from new size. 13-Jan-81 JPS V3.3 Move creation of the IOSeg to memory manager init. Move $ Circular Buffer } SpGetCir = 15; { Fake Units Begin Here } TransKey = 16; { Translated KeybR- to private part. 20-Nov-80 JPS V3.2 Initialize TabFifoInx in InitTablet. 17-Nov-80 JPS V3.1 Export the inteoard } ScreenOut = 17; { Screen Display } Clock = 18; { Used only for Put/Get Status } rrupt table. Check SystemInitialized for control-C abort. 16-Nov-80 BAM V3.0 Radically change LastUnit = Clock; { for unit validity checking } Type IOBufPtr = ^IOBuffer; IOBuffer = array[0.d Cursor and Tablet interface. New time procedures. Split into another include file. 10-Oct-80.0] of integer; CBufPtr = ^CBufr; CBufr = packed array[0..0] of char; { same as Memory, except f JPS V2.2 Added support for the diagnostic display (DDS). 27-Sep-80 DAS V2.1 Added timeout code to UnitIO for the or } { character buffers } BigStr = String[255]; { A 19-Mar-81 BAM V4.5 Changed name of included modules to IO_Init and IO_Proc 3-Mar-81 JPS V4.4 1) Fix LocateDskH hard disk. 19-Sep-80 DAS V2.0 Added code for 24 MByte disks. {---------------------------eads and FindSize to agree with V4.3. 2) Teach the HardDisk timeout code about multi-sector --------------------------------------------------} {*******************************} Exports {************************* operations. 28-Feb-81 JPS V4.3 No longer do conversions on Disk Physical block ****} Imports SystemDefs from SystemDefs; Const { Device Code Assignments } MaxUnit = 18; 4 onyms. The current direction is displayed as an arrow in the upper left corner of the screen. INS INS - Repeat th Bar -------------- The area to the left of the left-margin line is called the "scroll bar". If you move the last command. Typing the INS key at command level repeats the last command. Only certain commands may be e pointer into this bar, it changes into an up-pointing arrow at the left side and a down-pointing arrow at the right side repeated this way, since it is kind of silly to repeat some commands (e.g. "*", "E"). The "A", "D", "F", "I", "R". If you press down on the pen when the arrow is pointing up, the line that the pointer is next to is scrolled to the top o, and "S" commands may be repeated this way. HELP HELP - Get explanations Type the HELP key (or DEL HELP if nef the screen. If you press when the arrow is pointing down, the top line of the screen is scrolled down to the line thacessary) to get to this set of explanations. Each time the help subsystem prompts, you can type one of the lettert the pointer is next to. Thus if you put the pointer near the top of the screen, by pressing repeatedly, you can scroll ss or words that appears before a dash in the index above. You need not type more of the name than is needed tolowly through the file. If you put the pointer near the bottom of the screen, you can move through the file in large ju distinguish it from all other names. To exit this Help, just press the RETURN key. For a general intrmps of pages. If you put the pointer near the middle of the screen, you can move through the file in half-page jumps. Thumb Accepted or Rejected. Acceptance is signalled by typing the INS key. Rejection is signalled by typing the DEL key; in thisoduction to the editor, type the word introduction followed by a RETURN. digits Repeat case the change is not made. < < > - Reverse direction. These keys control the Reverse Direction flag. The Reverse Di Count ------------ Typing a 1- to 4-digit number before pressing a command tells how many times it is to be dorection flag causes most commands to work toward the front of the file instead of the end. Commands affected are C, W, L, F,ne. For Find and Replace, the number specifies the number of occurrences of the target string that you want to find or r G. The flag is turned off by all other commands except M, E, V, N. It is also turned off by F, but the old direction is remeeplace. This number is displayed in the top, right-hand corner of the screen after the letter "R" (which stands for "mbered if the F is repeated with INS. Typing a ">" sets the forward direction (toward the end of the file) for Find repeat count"). The number of occurrences actually found or replaced is displayed in the same corner following the letteand Replace commands. "." and "+" are synonyms for this command. "<" sets the reverse direction; "," and "-" are syn- r "C" (which stands for "count"). This number increments as the Find or Replace command executes. Scroll The Scroll5  big String } UnitRng = 0..MaxUnit; IOStatPtr = ^IOStatus; IOStatus = record code for GetStatus } Name: packed array[0..3] of char end; Const { RS-232 Speeds }  HardStatus: integer; { hardware status return } SoftStatus: integer; { devic RS9600 = 1; RS4800 = 2; RS2400 = 4; RS1200 = 8; RS600 = 16; RS300 = 32; e independent status } BytesTransfered: integer end; IOHeadPtr = ^IOHeader; RS150 = 64; RS110 = 87; Type Z80Readings = packed record { Z80 Voltage/Temp Monitor Read IOHeader = record { Hard disk header record } SerialNum: Double; {ings } Ground: integer; Volts5: integer; Volts12: integer; M Serial number of the file } LogBlock: integer; { The logical block number } inus12: integer; VRef: integer; Net: integer; CRTemp: integer;  Filler: integer; NextAdr: Double; { Address of next block in the file}  BaseTemp: integer; Volts55: integer; Volts24: integer end;  PrevAdr: Double { Address of previous block } end; DevTabPtr = ^DeviceTable;  Z80Settings = packed record { Z80 Voltage/Temp Monitor Settings } MinGround: integer;  DeviceTable = array [UnitRng] of packed record CtlPtr: IOBufPtr; { actually pointer to ChrCntlMaxGround: integer; Min5: integer; Max5: integer; Min12: integer; Blk or IOCB, } { but we'll coerce later } BlockSize: integer;  Max12: integer; MinMinus12: integer; MaxMinus12: integer; MinVRef: inte { 0 = variable size } { 1 = character device (uses circ buf) } ger; MaxVRef: integer; MinNet: integer; MaxNet: integer; Min { >1 = fixed blocksize (= blocksize ) } IntrMask: integer; CRTemp: integer; MaxCRTemp: integer; MinBaseTemp: integer; MaxBaseTemp: integ { interrupt mask bits } IntrPriority: integer; { decoded iterrupt priority (0..14) } er; Min55: integer; Max55: integer; Min24: integer; Max24: i PSCode: 0..255; { Special code for PutStatus } GSCode: 0..255; { Special nteger end; DevStatusBlock = packed record ByteCnt: integer; 5  ^K - Represents the end of the file. S - Represents the position of the beginning of the selentrol-" -none- Since these special keys are pre-defined, in order to insert them into your file you ction. ( - Represents the position of the beginning of the displayed text. ) - Represents the  must type control-" (the Editor quote character) followed by the special key. When you type control-", the insert curs position of the end of the displayed text. The thumb bar is used to rapidly move around in your file, but or changes from "_" to "^@" to indicate you typed the quote character. Pointer Pointer The PERQ text Editor is a "poinit is not very precise. When you put the pointer on the thumb bar and press down, the portion of the file represented by that, act" Editor. This means that to perform an editing action, you first "point" to a piece of text in the file and then pert portion of the bar is displayed on the screen. When you press at the left end of the bar the beginning of the file is shform some action on it. Pointing is done with the tablet. Your PERQ probably has a Summagraphics BitPad tablet. Wheown, when you press the "^K" the end of the file is shown, and when you press the "S" the beginning of the selection is shon you move the pen on the tablet, the pointer (cursor) moves to follow the pen. The pointer changes shape depending on wn. The thumb bar can also be used to extend the selection. When you type "E" while in the thumb bar, the selectiwhere it is on the screen. It may be a up-and-left pointing arrow, an up-pointing arrow, a down-pointing arrow, or a circon is extended to the position in the file which is represented by that particular portion of the thumb bar. This is usuale. These different shapes indicate that different things will happen when you press down. Pointing at text (alsolly only useful for extending to the beginning or end of the file. Keys Special Characters ------------------  called selecting text) is done by pressing the pen down on the tablet when the pointer is an up-and-left-pointinAction Character Alternate ------ --------- --------- End-of-line RETURNg arrow. If you move the pointer until it points at some character and then press down, the character is "selected" by und The Thumb Bar ------------- The top-margin line is called the "thumb bar". When you move the pointer to control-M,control-J -or- control-M,LF Erase character BACK SPACE  this line, it changes into a circle. Think of the thumb bar as a linear representation of your file. The left end of th control-H Erase word control-BACK SPACE control-W Erase line control-OOPS control-U e bar represents the beginning of your file. Special characters are used to represent other interesting parts of your file.  Accept INS control-Y Reject DEL control-N Quote co6  PutLimits: Z80Settings )); Floppy: (ca 0..255; FlpSectorByte: 0..255; FlpSizeSectorBse integer of { Get or Put } 1: ( { Get Status } Flpyte: 0..255 ); 2 {IOSeek}: Unit: 0..3; FlpHead: 0..1; FlpNotReady: boolean;  (FlpPresentCylinder: 0..255 ) ); { # of status bytes } case UnitRng of KeyBoard, Tablet, {$ifc Ether3 FlpEquipChk: boolean; FlpSeekEnd: boolean; MBaud then} Ether3, {$endc} Clock: (DevEnable: boolean);  FlpIntrCode: 0..3; case integer of 1 {IORead, IO RS232In, RS232Out: (RSRcvEnable: boolean; RSFill: 0..127; Write, IOFormat}: (FlpMissAddr: boolean; { in data or header }  RSSpeed: 0..255; RSParity: (NoParity, OddParity, IllegParity,  FlpNotWritable: boolean; FlpNoData: boolean; F EvenParity); RSStopBits: (Syncr,Stop1,Stop1x5,Stop2); lpFill1: 0..1; FlpOverrun: boolean; FlpDataError: bool RSXmitBits: (Send5,Send7,Send6,Send8); RSRcvBits: (Rcv5,Rcv7,Rcv6,Rean; { in data or header } FlpFill2: 0..1; FlpEndCylincv8)); Z80Monitor: (Z80Enable: boolean; Z80Fill: 0..32767; der: boolean; FlpDataMissAddr: boolean; { in data } Fl case boolean of { Get or Put; true = Get } true: ( { Get Status } pBadCylinder: boolean; FlpFill3: 0..3; FlpWrongCylinde GetRead: Z80Readings; GetLimits: Z80Settinr: boolean; FlpDataDataError: boolean; { in data } Flpgs ); false:( { Put Status } Fill4: 0..3; FlpCylinderByte: 0..255; FlpHeadByte: 6 erlining it. If you press twice in the same place, a word is selected by underlining the entire word. If you press three timng text) is done by pressing the pen down on the tablet when the pointer is an up-and-left-pointing arrow. If you es, the entire line is selected. You cannot move the pen between presses if you want to select a word or line. Anothemove the pointer until it points at some character and then press down, the character is "selected" by underlining it. If r way to select an entire line is to move the pointer until it points at the left margin line. One press here selects the you press twice in the same place, a word is selected by underlining the entire word. If you press three times, the entire entire line. Introduction Introduction ------------ It is probably a good idea to sit down at a PERQ an line is selected. You cannot move the pen between presses if you want to select a word or line. Another way to select d try out the Editor as you are reading. A good file to edit when you are first trying out the Editor is the Editor's helan entire line is to move the pointer until it points at the left margin line. One press here selects the entire line. p file. This way you can read the help file while you are editing. You should copy it to a scratch file so that you won't Once you have selected some text, you can extend the selection by moving the pen to another piece of text and then typing  have to worry about accidentally changing it. Do this with the system "Copy" command: Copy EditorK.Paras Scratch.File"E". The selection is extended to a character, word, or line boundary, depending on the type of your last selection.  Now ask the Editor to edit this new file: Edit Scratch.File The PERQ text Editor is a "point, act" Editor.  Commands that change the selection (other than Extend) set the type to character. Unfortunately, you can make the This means that to perform an editing action, you first "point" to a piece of text in the file and then perform some action selection larger with Extend, but you cannot make it smaller. In order to make the selection smaller, you must start over by on it. Pointing is done with the tablet. Your PERQ probably has a Summagraphics BitPad tablet. When you move the peselecting a character, word, or line with the tablet. After selecting text, you can perform some action on it. You n on the tablet, the pointer (cursor) moves to follow the pen. The pointer changes shape depending on where it is on thcan insert before or after the selected text, delete the selected text, search for a character string starting at the beginne screen. It may be a up-and-left pointing arrow, an up-pointing arrow, a down-pointing arrow, or a circle. These diffeing of the selection, or any of the other Editor actions. The top line of the screen shows the command prompt, error messagerent shapes indicate that different things will happen when you press down. Pointing at text (also called selectis, and prompts within commands. Many Editor commands require termination by either Accepting or Rejecting the action.7  (IOReset, IORead, IOWrite, IOSeek, IOFormat, IODiagRead, IOWriteFirst, IOIdle, IOWriteEOI, IOConfigure);  not complete } Procedure IOPutStatus(Unit: UnitRng; var StatBlk: DevStatusBlock);  Var DevTab: DevTabPtr; { pointer to system device table } CtrlSPending: boolean; { if  { Set status on device Unit } Procedure IOGetStatus(Unit: UnitRng; var StatBlk: DevStatusBlock); ^S has halted screen output } IOInProgress: boolean; { false when speech is active } IO24MByte: boole { Reads status on device Unit } Procedure IOBeep; { You guessed it, BEEP! } {$ifan; { true if the disk is 24 MBytes } Function IOCRead(Unit: UnitRng; var Ch: char): integer; c Ether3MBaud then} Function Ether3Transmit(Buff: IOBufPtr; WdCnt: integer) : integer; Function Ether3Receive(Buff: IOBufPtr { read a character from a } { character devic; var WdCnt: integer; timeout: integer) : integer; Function Ether3Start(Promiscuous, Restart: boolean)e and return } { status: IOB no char available }  : integer; {$endc} {*******************************} Private {*****************************}  2: ( { Put Status } FlpDensity: 0..255; { single = 0,  { IOC character returned } Function IOCWrite(Unit: UnitRng; Ch: char): integer;  double = #100 } FlpHeads: 0..255; { 1 or 2 heads } { write Ch to character device } { and return status: }  FlpEnable: boolean ); 3: (  { IOB buffer full } {  { Byte access } FlpByte1: 0..255; FlpByte2: 0..2 IOC character sent } Procedure UnitIO(Unit: UnitRng; { IO to block structured } 55; FlpByte3: 0..255; FlpByte4: 0..255;  Bufr: IOBufPtr; { devices } Command: IOCommands; ByteCnt: int FlpByte5: 0..255; FlpByte6: 0..255; FlpByeger; LogAdr: double; HdPtr: IOHeadPtr; StsPtr: IOStatPtr); Procedure Ite7: 0..255 ) ) end; Type IOCommands =OWait(var Stats: IOStatus); { hang until I/O completes } Function IOBusy(var Stats: IOStatus): boolean; { true if I/O7 rd select %N - Note current view %L - Line select %X - Keyboard Thumb Bar %G - Go to aeither letters or non-letters; Shift-W chooses words delimited by blank-space.) KeyCommands>L L - Change the current  character %LF - Keyboard Scroll %M - Turn More mode on/off %T - Top (redisplay selection) selection to be a line. If the previous selec- tion was a line, the selection advances to the next in the text (but %B - Bottom (similarly) KeyCommands>N N - Note The current screen display is noted and an  see the discussion of Reverse Direction). If the previous selection is smaller than a line, the new selection is an Acceptance is signalled by typing the INS key. Rejection is signalled by typing the DEL key. When typing text tN is placed in the Thumb Bar. The thumb bar may be used to return to this current display by selecting the N.o the Editor, BACK SPACE deletes the most recently typed character, control-BACK SPACE deletes the most recently typ KeyCommands>LF LF, Control-LF - Scroll LF repositions the screen window so it displays text starting wited word, and control-OOPS deletes the most recently typed line up to and including the carriage return. The RETURN key h the 37th line of the previous display. Control-LF scrolls in the other direction so the previous top of the screen i(carriage return) is used to mark the end of each line in your file. The Editor does automatic indenting for you by supplyins near the new bottom. KeyCommands>B B - Bottom The line containing the end of the current selection is moved tg leading blanks on the new line to match those on the previous line. You may BACK SPACE over them or type more. Wheo the screen. If already there, it is moved to the bottom. KeyCommands>T T - Top The line containing the currn the first line of text is showing on the screen, it is indicated by a "^J" in the left margin--this is the beginning-of-tent selection is moved to the screen. If already there, it is moved to the top. KeyCommands>W w, W - Change the cext marker. When the last character of the file is showing on the screen, it is followed by a "^K"--this is the endurrent selection to be a word. If the previous selection was a word, the selection advances to the next (but -of-text marker. You may select this character, but try as you may, you cannot delete it. KeyCommands>KeyCommands.Index Key see the discussion of Reverse Direction). If the previous sel- ection is smaller than a word, the new selection Commands.Index for Editor version V1.15K and beyond C 1981, 3RCC These commands change the selection or the v is an extension of the previous. If the previous selection is larger, the first word is chosen from the previiew without use of the BitPad. %Space - Space, RETURN, BACKSPACE, TAB: select next or previous character %W - Woous selection. This command uses the repeat count and Direction Flag. (Unshift-w chooses words that are 8 s module defines the screen coordinates and size of the { Perq "lights". These are portions of the screen that are {  inverted during tedious operations such as recalibrating the { disk and scavenging files (in FileAccess). { { Desigmodule Loader; {----------------------------------------------------------------------------- { { Loader - Perq systen: { The lights must *not* extend below the 128th line of the screen. { The Y + Size must be less than or equal tom loader. { J. P. Strait 10 Feb 81. rewritten as a module. { Copyright (C) Three Rivers Computer Corporation,  256. { It is a good idea for the lights to be totally inside of the title { line. { The current lights 1981. { { Abstract: { This module implements the Perq POS system loader. Given a run-file { name as input, it loads astart at the left leave lots of room for new { lights to the right of the current one. There is room for { nd executes that program. When the program { terminates (normally or abnormally) it returns to the loader which returns { to 10 lights all together { {-----------------------------------------------------------------------------} {----------------its caller. { {-----------------------------------------------------------------------------} {---------------------------------------------------------------------------------------- { Versions: { 20-Jan 82 Brad A. Myers V1.2 New light for the-------------------------------------------------- { Change Log: { { 6 Jan 82 V2.7 Brad Myers { Fixed bug in reporting Qc compiler { 28-may-81 Brad A. Myers V1.1 Changed size and spacing of lights and { made ode version incompatibility if hint succeeds { { 10 Dec 81 V2.6 WJHansen { changes to use type long (xxTime, stretch(0), dothem non-square { 26-May-81 John Strait V1.0 Started {------------------------------------------------------------------n't use Arith) { { 25 Oct 81 V2.5 John Strait { Changes to agree with Memory V2.11. { } { 21 Jul 81 V2.4 John Strait ---------} exports const LightUsed = TRUE; {whether should use the lights at all} LightY  = 3; LightHeight = 14; LightWidth = 18; LightSpacing = 3*LightWidth; module Lights; {----------------------------------------------------------------------------- { { Lights - Perq LightLightRecalibrate = LightSpacing; LightScavenge = LightRecalibrate + LightWidth + LightSpacing; LightSwap s. { J. P. Strait 26 May 81. { Copyright (C) Three Rivers Computer Corporation, 1981 { { Abstract: { Thi = LightScavenge + LightWidth + LightSpacing; LightCompiler = LightSwap + LightWidth + LightSpacing; private 8 ion to shrink at that end. In this mode, they do not select a single character, nor do they change the directionr Selection Space, BackSpace, Return, Tab, and a few other keys behave as if the selection line were a cursor f flag. The mode is extinguished by any one of the commands: A, I, S, R, D, *, M, E, Q. (Thus M is a toggle.) Keor insert. These selection commands move to a character related to the current selection. They all use the yCommands>X X - Thumb bar (X-Coordinate selection) The thumb bar cursor is placed on the thumb bar line at the top repeat count. None are affected by the direction flag. All reset that flag unless the More flag is set. When  of the screen. The following characters are active: INS - Display the part of file corresponding to curr the More flag is set, these commands still move in their usual direction; thus they can be used to reduce the selectioent position of thumb bar cursor. DEL - Aborts the thumb bar. Current selection is unaffected. n. SPACE - Move to the character following the previous selection. BACKSPACE - TAB - Moves five character positions to the right. control-TAB - Moves five positions to the left. SPACE - Mo Go to the character preceding the previous selection. Control-H is synonymous with this command.  extension of the previous. If the previous selection is larger, the first line is chosen from the previous ves one position to the right. BACKSPACE - Moves one position to the left. RETURN - Moves to end of file posit selection. This command uses the repeat count and Direction Flag. KeyCommands>G G - Go to character After ion. Control-RETURN - Moves to beginning of file position. Digits - Set repeat count for TAB's and SPACE's. typing "G", one more character is typed. The editor searches the rest of the screen for the character. If found, S - Move to the S marker on thumb line. This marker indicates the location of the current selection.  it becomes the current selection. G uses the repeat count and direction flag. If the More Flag is se O - Move to O marker on line. This marker indicates the text that was displayed prior to the last thumb bar st, the selection is extended to the found character. KeyCommands>M M - More in selection Turns on More Flag, soelection. N - Move to the N marker on the line. This marker is set by the N command. The curren all selection commands extend the current selection rather than change it. The selection grows only at the end int selection is unchanged. However, if any keyselection commands (C, W, L, G, space, ...) are used, the operation is dicated by the Direction Flag. The character motion commands (SPACE, BACKSPACE, RETURN, etc.) can cause the select treated as though the first character of the screen had been previously selected. KeyCommands>space Characte9 . This means that in some { sense the loader becomes part of the memory manager. { Add Hints. { } { 4 Jun 81 V2.3 John= '2.7'; procedure Load( RunFileName: String ); private  Strait { Add Virgil headers and comments. { } { 23 May 81 V2.2 John Strait { Use new IOKeyDisable/IOKeyEnable in place of old DisCtlC/EnaCtlC. { } { 18 May 81 V2.1 Brad Myers { Import IO_Unit and IO_Others instead of IO. { Added ** to ermodule Memory; {----------------------------------------------------------------------------- { { Memory - Perq memory ror messages { } { 13 May 81 V2.0 John Strait { Use exceptions. { } { 13 Apr 81 V1.9 John Strait { Fix bug in multmanager. { J. P. Strait 1 Jan 80. { Copyright (C) Three Rivers Computer Corporation, 1980. { { Abstract: i-sector read code. { } { 10 Apr 81 V1.8 John Strait { Use new RunRead module. { } { 6 Apr 81 V1.7 John Strait {  { Memory is the Perq memory manager. It supervises the segment tables { and exports procedures for manipulating m1) Fix bug in Q-code version processing. { 2) Stuff for virtual memory. { 3) Make use of new ProgramSN in RunHeader. { } {emory segments. { Perq physical memory is segmented into separately addressable items { (called segments) which ma 30 Mar 81 V1.6 Brad Myers. { Use local lookup for seg file names. { } { 25 Mar 81 V1.5 John Strait. { Improved retriey contain either code or data. { { Design: { See the Q-Code reference manual. { {------------------------------------s and messages from retry mechanism. { } { 25 Mar 81 V1.5 John Strait. { Improved retries and messages from retry mechani-----------------------------------------} { 16 Nov 81 V2.13 DAS { Fixed to work with ten MBaud ethernet. { } { 25 Ocsm. { } { 20 Mar 81 V1.4 Miles A. Barel { Added QCode Version Checks and long file names { } { 3 Mar 81 V1.3 John St 81 V2.12 JPS { Enlarge segment table to 512 entries when more than 1/4 MByte. { } { 25 Oct 81 V2.11 JPS { Implementrait. { Improve retry mechanism to immediately do a recalibrate after an { address error. { } { 1 Mar 81 V1.2 John Strat full hints in Memory. { 1) The two added words (for the UpdateTime) are overlayed on the two { words of Increment, Maximuit. { Speed up the loader by using multi-sector reads from the hard disk. { If errors, abort loading before loading the stack m, and FreeList which are not used for { Code segments. { 2) ChangeSize and NewP now check to be sure the segment is a Datasegment. { } { 23 Feb 81 V1.1 RFR. { Changed <= to = FSLookup test. { } { 10 Feb 81 V1.0 John Strait. { Start file segment. { 3) FindCodeSegment compares hints. { } { 6 Oct 81 V2.10 JPS { Fix bug in CreateSegment: It cannot call Ch { Change the loader to add segments to the segment table (marked as swapped- { out) rather than actually load them into memory. { } {-----------------------------------------------------------------------------} exports const LoaderVersion 9 st character of line following the previous selection. Control-U is synonymous with this command. Control-RETURN - Go back to first preceding non-blank that follows a CRLF. Control-OOPS is synonymous to this command.  TAB - Advance five characters from end of previous selection. Control-TAB - Go back five characters from beginning of previous selection. Control BACKSPACE - Go to the beginning of the word preceding the current selection. Control-w and Control-W are synonymous with this command; shift-control-W treats a word as any consecutive string of printable characters. RETURN - Move to fir: e not needed by { programs which import the memory manager. { Remove Concat call from MemoryError. { Remove import of Perq.Stt 80 V1.1 JPS { Add support for the diagnostic display (DDS). { } exports const MemoryVersion = '2.13'; importring. { } { 24 Feb 81 V1.7 JPS { 1) Allow the ScreenSeg to change sizes. To allow this, the memory { manager must prs SystemDefs from SystemDefs; imports Code from Code; const SATSeg = 1; { SAT segment } SITSeg = 2; angeSize to shorten a hole { because the new size may be larger than 256 blocks. ChangeSize would { raise BadSize exception. event system segments (those with RefCount > 1) from { being moved into the area of memory which might be used for the {  { } { 4 Oct 81 V2.9 JPS { Change InitMemory to figure out how much physical memory the machine has. { } { 18 Sep 81 screen. This is a hack which guarantees that the system can expand { the screen to its original size after returning from  V2.8 WJH { Set Mobility to Swappable in CreateSegment. { } { 26 Jul 81 V2.7 JPS { Fix bug in order of operations in a user program. { This change was originally made by RFR, but had to be converted for { memory manager version 1.5 and gCreateSegment. { } { 21 Jul 81 V2.6 JPS { Don't use MaxSegment anywhere. { } { 29 Jun 81 V2.5 JPS { Destroy swappireater. { 2) Remove PrintTable and PrintFreeList. { } { 23 Feb 81 V1.6 RFR { Added DK and CH to system boot record (theyng files when swapping is disabled. { } { 4 Jun 81 V2.4 JPS { Add Virgil headers for exceptions. { } { 26 May 81 V2. will be filled by the boot { microcode with the disk number and boot character used in booting). { } { 18 Feb 81 V1.5 JP3 JPS { Add CurrentSegment function. { Prevent Memory from being swapped during FindHole calls. { } { 21 may 81 V2.2 JPS { Define fields in the SIT to remember names of boot loaded segments. { Remove most of InitMemory since it is done now by MaS { Initialize BootSegId in EnableSwapping. { } { 14 May 81 V2.1 GGR { Add support for 3 MBaud EtherNet. { } { 12 MakeBoot. Make IOSeg { a constant. { } { 17 Feb 81 V1.4 DAS { Removed the include file SegNumbers. Placed the segment nuy 81 V2.0 JPS { 1) Split Memory into two modules: Memory (user callable routines, swappable) { and Virtual (system callabmber { definitions inline. { } { 16 Feb 81 V1.3 DAS { Changed to use Perq_String from Perq.String { } { 11 Feb 81 le routines, unswappable). { 2) Move FileIdToSegId and SegIdToFileId into Memory. { 3) Use exceptions and get rid of MemoryErr DCF { Changed calls to PString to conform to new PString. This module is { compatable with the new System and Compiler. or. { } { 24 Mar 81 V1.9 JPS { Begin adding stuff for virtual memory. { } { 23 Mar 81 V1.8 JPS { Convert to standa { } { 13 Jan 81 V1.2 JPS { 1) Allocate the IOSeg in memory manager initialization as a locked { segment at the high erd documentation form. { Delete DEBUG stuff. { Delete OutputF. { Add "MM" to the beginning of names which are exported but arnd of memory. Use the last block in memory (the { Krnl no longer needs it). { 2) Move $R- to private part. { } { 10 Oc: ;  type MMBit4 = 0..#17; MMBit8 = 0..#377; MMBit12 = 0..#7777; MMIntSize = 0..MMMaxIntSize; MMExt* ENTRIES MUST BE EIGHT WORDS LONG **** } 1: { real SIT entry } (NextSeg : SegmentNumber; RefCounSize = 1..MMMaxExtSize; MMAddress = integer; MMPosition = (MMLowPos, MMHighPos); SegmentNumber = integer; t : 0..MMMaxCount; IOCount : 0..MMMaxCount; Mobility : SegmentMobility; BootLoaded : Boo SegmentKind = (CodeSegment, DataSegment); SegmentMobility = (UnMovable, UnSwappable, LessSwappable, Swappablelean; SwapInfo : record case {BootLoaded:} Boolean of True: (BootLowerAddress: Integer; ); MMFreeNode = record N: MMAddress; L: integer end; MMBlockArray = array[0..0] of ar BootUpperAddress: Integer; BootLogBlock: Integer); ray[0..127] of integer; pMMBlockArray = ^MMBlockArray; MMArray = record case Integer of 1: False: (DiskLowerAddress: Integer; DiskUpperAddress: Integer;  { SIT segement } FontSeg = 3; { font segment } ScreenSeg = 4; { screen segment }  (m: array[0..0] of MMFreeNode); 2: (w: array[0..0] of Integer) end; pMMArray = ^MMArr CursorSeg = 5; { cursor segment } IOSeg = 6; { IO segment } SysNameSeg = 7; ay; MMPointer = record case integer of 1: (P: ^integer); 2: (B: pMMBlockArray); 3: (M: pMMArray);  { system segment names } BootedMemoryInBlocks = #1000; { memory in blocks at boot time } MaxSegment = 4: (Offset: MMAddress; Segmen: SegmentNumber) end; SATentry = packed record { Segment Address Ta #137; { should be 2**16 - 1 } SetStkBase = #60; SetStkLimit = #120; {$ifc Ether3MBaud then} IOSble } { **** ENTRIES MUST BE TWO WORDS LONG **** } NotResident : boolean; { 001 } Moving : egSize = 6; { number of blocks in the IOSeg } {$elsec} {$ifc Ether10MBaud then} IOSegSize = 3; { nuboolean; { 002 } RecentlyUsed: boolean; { 004 } Sharable : boolean; { 010 } mber of blocks in the IOSeg } {$elsec} IOSegSize = 3; { number of blocks in the IOSeg } {$endc} {$endc}  Kind : SegmentKind; { 020 } Full : boolean; { 040 } InUse : boolean;  SysSegLength = 8; { length of name of a boot-loaded segment } MMMaxBlocks = #400; { maximum numbe { 100 } Lost : boolean; { *** } { 200 } BaseLower : MMBit8; BaseUpper : MMBit4; r of blocks in a segment } MMMaxCount = #377; MMMaxIntSize = MMMaxBlocks-1; MMMaxExtSize = MMMaxBlocks;  Size : MMBit12 end; SITentry = packed record case integer of { Segment Information Table } { ***; <  { first free segment number } FC: SegmentNumber; { first system code segment } DK: integer; umber ); {----------------------------------------------------------------------------- { { Abstract: { UnusedSegment  { disk system was booted from } CH: integer { char used in booting } end) end; is raised when the memory manager encounters a segment { number which references a segment which is not in use. This may SATarray = array[0..0] of SATentry; SITarray = array[0..0] of SITentry; pSAT = ^SATarray; pSIT =  mean { that a bad segment number was passed to some memory manager routine { or that a bad address was de-referen^SITarray; MMEdge = record H: SegmentNumber; { Head } T: SegmentNumber { Tail } ced. { { Parameters: { S - Segment number of the unused segment. { {------------------------------------------------- end; SysSegName = packed array[1..SysSegLength] of Char; pSysNames = ^SysNameArray; SysNa----------------------------} exception NotDataSegment( S: SegmentNumber ); {--------------------------------------------meArray = array[0..0] of SysSegName; procedure InitMemory; procedure DataSeg( var S: SegmentNumber ); --------------------------------- { { Abstract: { NotDataSegment is raised when the number of a code segment is passed  procedure CodeOrDataSeg( var S: SegmentNumber ); procedure ChangeSize( S: SegmentNumber; Fsize: MMExtSize ); procedure Cre { to some memory manager routine that requires the number of a data { segment. { { Parameters: { S - SegmateSegment( var S: SegmentNumber; Fsize, Fincrement, Fmaximum: MMExtSize ); procedure IncRefCount( ent number of the code segment. { {-----------------------------------------------------------------------------} except DiskId: Integer) end; case SegmentKind of DataSegment: (IncS: SegmentNumber ); procedure SetMobility( S: SegmentNumber; M: SegmentMobility ); procedure DecRefCount( S: SegmentNumber )rement : MMIntSize; Maximum : MMIntSize; Freelist : MMAddress); ; procedure SetIncrement( S: SegmentNumber; V: MMExtSize ); procedure SetMaximum( S: SegmentNumber; V: MMExtSize ); proced CodeSegment: (Update : TimeStamp) ); 2: { boot time information } (BootBlock: record ure SetSharable( S: SegmentNumber; V: boolean ); procedure SetKind( S: SegmentNumber; V: SegmentKind ); procedure MarkMemory CS: SegmentNumber; { initial code segment } SS: SegmentNumber; { initial stack segment } ; procedure CleanUpMemory; procedure FindCodeSegment( var S: SegmentNumber; Hint: SegHint ); procedure EnableSwapping( Whe XX: Integer; { unused } VN: Integer; { system version number } FF: SegmentNumber; re: Integer ); procedure DisableSwapping; function CurrentSegment: SegmentNumber; exception UnusedSegment( S: SegmentN< = ly means that the size passed to { CreateSegment or ChangeSize is greater than the maximum size or { less than one----------------------------------------------------------------------} exception CantMoveSegment( S: SegmentNumber ); {-. { { Parameters: { Fsize - The bad Size value. { {---------------------------------------------------------------------------------------------------------------------------------------------- { { Abstract: { CantMoveSegment is raised -----------} exception BadIncrement( S: SegmentNumber; Fincrement: Integer ); {------------------------------------------when the memory manager attempts to move { a segment which is UnMovable or has a non-zero IO count. { { Parameters: { ----------------------------------- { { Abstract: { BadIncrement is raised when a bad Increment value is passed to some S - The number of the segment which cannot be moved. { {---------------------------------------------------------------- { memory manager routine. This usually means that the increment passed { to CreateSegment is greater than 256 or-------------} exception PartNotMounted; {-----------------------------------------------------------------------------  less than one. { { Parameters: { Fincrement - The bad Increment value. { {------------------------------------------{ { Abstract: { PartNotMounted is raised when { 1) the memory manager attempts to swap a data segment out-----------------------------------} exception BadMaximum( S: SegmentNumber; Fmaximum: Integer ); {---------------------- for { the first time { and 2) the partition which is to be used for swapping is no longer { ------------------------------------------------------- { { Abstract: { BadMaximum is raised when a bad Maximum value i mounted. { {-----------------------------------------------------------------------------} exception SwapInFs passed to some memory { manager routine. This usually means that the maximum passed to { CreateSegment is greatailure( S: SegmentNumber ); {----------------------------------------------------------------------------- { { Abstract: { er than 256 or less than one. { { Parameters: { Fmaximum - The bad Maximum value. { {-------------------------------- SwapInFailure is raised when the swap file cannot be found for a { segment which is marked as swapped out. This is ---------------------------------------------} exception FullMemory; {---------------------------------------------------an error which { should never happen in a debugged system. It usually means that { there is a bug in the memory mion BadSize( S: SegmentNumber; Fsize: Integer ); {------------------------------------------------------------------------------------------------------- { { Abstract: { FullMemory is raised when there is not enough physical memory to { sa { { Abstract: { BadSize is raised when a bad Size value is passed to some memory { manager routine. This usualtisfy some memory manager request. This is raised only after { swapping segments out and compacting memory. { {-------= > t discovers that there is not { enough room to allocate and the segment cannot be enlarged (its { size has reachedanager or that the segment tables { have been clobbered. { { Parameters: { S - The number of the segment which c its maximum). { {-----------------------------------------------------------------------------} exception NoFreeSegmentould not be swapped in. { {-----------------------------------------------------------------------------} exception Edges; {----------------------------------------------------------------------------- { { Abstract: { NoFreeSegments is raFailure; {----------------------------------------------------------------------------- { { Abstract: { EdgeFailure isised when the memory manager discovers that all { of the segment numbers are in use and it needs another one. This {  raised by MakeEdge when it discovers that the SIT { entries are not linked together into a circular list. This is an { is equivalent to "Segment table full". { {-----------------------------------------------------------------------------}  error which should never happen in a debugged system. It usually { means that there is a bug in the memory manage exception SwapError; {----------------------------------------------------------------------------- { { Abstract: { r or that the segment { tables have been clobbered. { {---------------------------------------------------------------- SwapError is raised if the one of the memory managers swapping { routines is called when swapping is disabled. This i-------------} exception NilPointer; {----------------------------------------------------------------------------- { {s an error which { should never happen in a debugged system. It usually means that { there is a bug in the memory Abstract: { NilPointer is raised when a Nil pointer is used or passed to Dispose. { {--------------------------------- manager. { {-----------------------------------------------------------------------------} var SAT: pSAT; SIT:--------------------------------------------} exception BadPointer; {---------------------------------------------------- pSIT; MMFirst, MMFree, MMLast, MMHeap: SegmentNumber; MMHole: MMEdge; MMState: (MMScan1, MMScan2, MMScan3, MMSca------------------------- { { Abstract: { BadPointer is raised when a bad pointer is passed to Dispose. { { Parametern4, MMScan5, MMScan6, MMScan7, MMScan8, MMScan9, MMScan10, MMScan11, MMNotFound, MMs: { {-----------------------------------------------------------------------------} exception FullSegment; {----------Found); StackSegment: SegmentNumber; FirstSystemSeg: SegmentNumber; BootFileId: Integer; SwappingAllowed: Bo------------------------------------------------------------------- { { Abstract: { FullSegment is raised by New when iolean; SwapId: Integer; MemoryInBlocks: Integer; { amount of memory on this machine } private > ? 1 JPS { Set R- in private part. { } {-----------------------------------------------------------------------------} exports imports Memory from Memory; procedure CopySegment( SrcSeg, DstSeg: SegmentNumber; NewDstBase: Integer ); private module PasLong; {----------------------------------------------------------------------------- { { PasLong - Extra Module MultiRead; {----------------------------------------------------------------------------- MultiRead - Module to Multstream package input conversion routines. { J. P. Strait & Michael R. Kristofic ca. 15 Sep 81. { Copyright (C) Thmodule MoveMem; {----------------------------------------------------------------------------- { { MoveMem - Move memori-sector read a file into memory. Written by Brad Myers 24 Jul 81. Copyright (C) Three Rivers Computer Corporatioy. { J. P. Strait ca. 1 Jan 80. { Copyright (C) Three Rivers Computer Corporation, 1980, 1981. { { Abstract: n, 1981. Abstract: This Module exports a procedure to read a file very quickly into memory. The memory for { MoveMem is used to move a segment from one location to another in { physical memory. The two locations may overlthe blocks of the file to be read must be allocated contiguously before the call is made. Typically, this will ap. { {-----------------------------------------------------------------------------} {---------------------------------be done by using CreateSegment. -----------------------------------------------------------------------------} {----------------------------------------------------- { Change Log: { { 7 Jan 82 V1.8 Brad Myers { Change IOKeyDisable ... to I-------------------------------------------------------------------- Change Log: 24-Jul-81 V1.0 Brad Myers ntOn off. { { 4 Jan 82 V1.7 WJHansen { Don't call IOGetTime or IOKeyXXXAble if system not initialized { { 10 Dec 81 V Created by modifying code in the Loader -----------------------------------------------------------------------------} 1.6 WJHansen { change DoubleWORD AND xxTime to long; remove Arith { { 9 Jul 81 V1.5 JPS { Use IOKeyDisable and IOKeyEn {//////////////////////////} EXPORTS {\\\\\\\\\\\\\\\\\\\\\\\\\\} Imports FileSystem from FileSystem; Procedure MultiReaable rather than INTOFF and INTON. { } { 18 May 81 V1.4 BAM { Change import from IO to IO_Others. { } { 18 Apr 81 V1d(fid: FileID; addr: pDirBlk; firstBlock,numBlocks: integer); {//////////////////////////} PRIVATE {\\\\\\\\\\\\\\\\\\\\\\\\\.3 JPS { Gather statistics. { } { 24 Mar 81 V1.2 JPS { Convert to standard documentation form. { } { 17 Feb 81 V1.\} ? @ g; Field, B: integer ); private  { } { Date: 16-Dec-80 V2.0 { Who: Brad A. Myers { Added New procedures: PosC, AppendString, AppendChar, UpperCase, ConvUpper. { } { 27-Nov-80 1.1 Don Scelza { Fixed a bug in SubStr. Added calls to UserError for errors. { (Not released) { } { Date: 30-Apr-80 { Who: Don Scelza { Changed ConCat and SubStr to use temp strings for their hacking. { This will allow a use to pass the same string as input and result { parameters. { } { Date: 8-Apr-80 { Who: Don Scelza { Created the striModule PERQ_String; {----------------------------------------------------------------------------- { { PERQ String manipulating hacking module. { } {------------------------------------------------------------------------} {-------------------on routines. { Written by: Donald Scelza { Copyright (C) 1980 { Three Rivers Computer Corporastion { { Abstract: { This------------------------------------------------------ { { Strings in PERQ Pascal are stored a single character per byte with  module implements the string manipulation routines for the { Three Rivers PERQ Pascal. { { Strings in PERQPascal are s { the byte indexed by 0 being the length of the string. When the routines { in this module must access the length byte they mree Rivers Computer Corporation, 1981. { { Abstract: { PasLong is the extra character input module of the Stream packatored a single character per byte with { the byte indexed by 0 being the length of the string. When the { routines in tge. { Its routines are called by code generated by the Pascal compiler { in response to variations on Read, Readlhis module must access the length byte, they must turn { off range checking. { {------------------------------------------n, Write and Writeln { statements. It is one level above Module Stream and uses Stream's { lower-level input rout---------------------------------} {----------------------------------------------------------------------------- { Chanines. { {-----------------------------------------------------------------------------} { 15 Sep 81 V2.2 John Strait ange Log: { { Date: 27 Jan 82 V2.4 { Who: Brad Myers { Fixed some comments { } { Date: 20 May 81 V2.3 { Who: JE Ball d Mike Kristofic. { Creation - Double precision read and write routine ReadD and WriteD. { } exports imports Strea(CMU) and Brad Myers { Rewrote copy loop in Insert { Added new function: RevPosC { } { Date: 13-May-81 V2.2 { Who: John m from Stream; procedure ReadD( var F: FileType; var X: long; B: integer ); procedure WriteD( var F: FileType; X : lonStrait { Use exceptions. { } { Date: 19-Jan-81 V2.1 { Who: Diana Connan Forgy { Changed ConCat and SubStr to functions. @ A ---------------------------------------------------------------------} {********************} Exports {********************module PMatch; {-------------------------------------------------------------- { { Abstract: { Does pattern matching o} Const MaxPStringSize=255; { Length of strings} Type PString = String[MaxPStringSize]; Procedure Adjust(Var Sn strings { { Patterns accepted are as follows: { { { "*" matches 0 or more characters. { { TR:PString; LEN:Integer); Function Concat(Str1,Str2:PString):PString; Function Substr(Source:PString; Index,Size: Integer):P "&" matches 1 or more characters. { { "#" matches exactly 1 character. { { "'0" matches anString; Procedure Delete(Var Str:PString; Index,Size:Integer); Procedure Insert(Var Source,Dest:PString; Index:Integer); Funy digit. { { "'A" matches any alphabetic (capitals only unless casefold). { { "'a" matches any alpction Pos(Source,Mask:PString): Integer; FUNCTION PosC(s: PString; c: Char): Integer; PROCEDURE AppendString(var s1: PStringhabetic(lower case only unless 'casefold'). { { "'@" matches any non-alphanumeric. { { "'*" matche; s2: PString); PROCEDURE AppendChar(var s: PString; c: Char); FUNCTION UpperCase(c: Char): Char; PROCEDURE ConvUpper(Var s: s '*', other patterns chars can be quoted also. { { Written by: Gene Ball at CMU {------------------------------PString); Exception StrBadParm; {------------------------------------------------------------------------- Abstract: Raise--------------------------------} {-------------------------------------------------------------- Change log: 28-Decd when bad index or length parameters passed to procedures or sometimes when string will be too long (other times, S-81 Brad Myers V2.5 Removed IsPattern removal of ' if not pattern. 1-Dec-81 Brad Myers V2.4 Changed length of files ctrLong is raised in this case -------------------------------------------------------------------------} Functioompared to 255 1-Dec-81 Brad Myers V2.3 Fixed so IsPattern removes ' if not pattern 13-Aug-81 Brad Myers V2.2 Fn RevPosC(s: PString; c: char): integer; {********************} Private {********************} ixed exit in IsPattern so didn't exit from PattMatch so no crash if string ends in "'" ust turn off range { checking. The effective definition of strings is: { Type String = RECORD { length: 0..255; { chars: PACKED ARRAY[1..MaxLength] of Char; { END; { Note that the characters are packed and that the first index is 1. { See the PERQ Pascal Extensions manual for more information on strings. { {---A B 15-May-81 Brad Myers V2.1 Added new exception and changed module name Use the PERQ_String function uppercase Added comments in 3RCC style ??-Apr-81 Gene Ball V2.0 Fixed bugs in Module PopCmdParse; {--------------------------------------------------------------- { { Abstract: { This module providesPattMatch and added new procedures PattMap and IsPattern 13-Mar-81 Brad Myers V1.1 Fi procedures to help with PopUp menus. See { the module PopUp for the definition of pNameDesc and for some { useful procxed a small bug and changed import from PERQ.String to PERQ_String ??-Feb-81 Gene Baledures for creating and destroying pNameDescs. { { Written by Brad Myers Nov 18, 1981 { { Copyright (C) 1981 Three Riversl V1.0 Started --------------------------------------------------------------} {/////////////////////////////} Exports { Computer Corperation { {---------------------------------------------------------------} {-----------------------------\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\} Type pms255 = String[255]; Function PattMatch(var str,pattern: pms255; fold: boolean): bo------------------------------------- { Change Log: { { Date: 26 Jan-82 V1.8 Brad Myers { Only character illegal after a coolean; Function PattMap(var str,inpatt,outpatt,outstr:pms255; fold:boolean): boolean; Procedure PattDebug(v: boolean); Functimmand is "=" in IGetCmdLine. { Extra blank input at the end of command files. { Use PointAllowed. { Date: 21 Jan-82 V1.7on IsPattern(var str: pms255): boolean; Exception BadPatterns; {------------------------------------------------------------ Brad Myers { No popup if isFloppy { { Date: 8 Jan-82 V1.6 Brad Myers { Fixed Type ahead bug if in a command file. { Fi--- Abstract: Raised if outPatt and inPatt do not have the same patterns in the same order for PattMap ---------xed PopUniqueCmdIndex to find a command if it equals another even if it { is shorter. Eg. in table are "p" and "path". "p"------------------------------------------------------} {/////////////////////////////} Private {\\\\\\\\\\\\\\\\\\\\\\\\\\\ will get "p" even { though is not unique. { Help on PopUp menus. { Date: 5 Jan-82 V1.5 Brad Myers { No beep if Pop n\\\\} ot OK for GetCmdLine and GetConfirm. { Date: 4 Jan-82 V1.4 Brad Myers { Fixed bug in CmdFile prompt character in GetCmdLine. { Re-instated IdleProc. { Date: 30 Dec-81 V1.3 Brad Myers { Fixed Destroy ==> Dstry for new CmdParse. { Added NullIdleProc. { Date: 30 Nov-81 V1.1 Brad Myers { Moved alloc and destroy Name desc to popUp. { Change GetConfirm to take prompt aB C  This program produces pop up windows that replace the screen area at a specified cursor location. The cursor is th---------------------------------------------} {-*-*-*-*-*-*-*-*-*-*-*-*-*-*-} EXPORTS {-*-*-*-*-*-*-*-*-*-*-*-*-*-*-} en changed and PopUp waits for a press. Whenever the cursor is inside the window, the command at thatEXCEPTION BadMenu; {----------------------------------------------------------------------------- Abstract: Raised when parame point is highlighted. If a press is done inside the window, the highlighted command is selected. The ters are illegal. -----------------------------------------------------------------------------} EXCEPTION Outside; {------nd default. { } { Date: 19 Nov-81 V1.0 Brad Myers { Started. { } {-------------------------------------------------- user can control whether one or more than one command should be selected before window is removed. If a press ou----------------} {********************} Exports {********************} Imports CmdParse from CmdParse; Imports PopUp tside outside, no command is executed. In any case, the window is erased and the original contents offrom PopUp; Function PopUniqueCmdIndex(Cmd: CString; Var names: pNameDesc): Integer; Function GetCmdLine(Procedure IdlePro that area is returned Copyright (C) 1981 - The Three Rivers Computer Corporation -----------------------------------------c; prompt: String; var line, cmd: CString; var inF: pCmdList; var names: pNameDesc; va------------------------------------} {---------------------------------------------------------------------------- Chanr firstPress: boolean; popOK: boolean): integer; Function GetShellCmdLine(var cmd: CString; var inF: pCmge Log: 19 Jan 82 Brad A. Myers V2.4 Handle the exception HelpKey. 17 Sep-81 Brad A. Myers V2.3 fixed commentsdList; var names: pNameDesc): integer; Function GetConfirm(Procedure IdleProc; popOK: boolean; . Made so will work with any current font. 28-Aug-81 Brad A. Myers V2.2 Fixed hi prompt: String; def: integer; var switches: pSwitchRec): integer; Procedure NullIdleProc; sterises for bottom command. Made it harder to select the bottom {********************} Private {********************}  command when trying to hit the scroll bar. 22-Jul-81 Brad A. Myer(****) Module PopUp; (*****) (***** Program PopUp(input, output); (******) {--------------------------------------------s V2.1 Handlers for ^C and ^Shift-C. 22-Jul-81 Brad A. Myers V2.0 removed interface to TheFront. 20-Nov-80 Bra-------------------------------- PopUp displays "popUp" menu windows Written by Brad A. Myers 16-Nov-80 Abstract:d A. Myers V1.1 Changed interface to TheFront. 16-Nov-80 Brad A. Myers V1.0 Started. --------------------------------C D ameDesc); PROCEDURE DestroyNameDesc(Var names: pNameDesc); {-*-*-*-*-*-*-*-*-*-*-*-*-*-*-} PRIVATE {-*-*-*-*-*-*-*-*-*-*-*-*-*-*-} module Profile; {---------------------------------------------------------------------- { { Abstract: { This module is MODULE PopUpCurs; {---------------------------------------------------------------------------- Abstract: This module sets uused to get information from the user profile { file. { { Written by: Don Scelza { { Copyright (C) Three Rivers Computerp and sets the various cursors used by PopUp. Written by Brad A. Myers Copyright (C) 1981 - Three Rivers Computer Corporatio Corperation, 1981 { {-----------------------------------------------------------------------} { 28 Dec-81 V1.1 Brad n ----------------------------------------------------------------------------} {-------------------------------------------Myers { Fixed so PFileEntry only returns a blank line when no more inputs. { Changed length of strings returned to be 255!! {----------------------------------------------------------------------- Abstract: raised when press outside of menu. ------------------------------------------ Change log: 17-Aug-81 V2.1 Brad Myers fixed comments and picture for Scroll Bar --------------------------------------------------------------------} Type s25 = String[25]; NameAr = Array[1..1] of s2 22-Jul-81 V2.0 Brad Myers fixed for POS version D 14-Nov-80 V0.1 Brad Myers started. -----------------------------5; pNameAr = ^NameAr; NameDesc = Record header: s25; numCommands: integer; -----------------------------------------------} {-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-} EXPORTS {-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* commands: NameAr; End; pNameDesc = ^NameDesc; ResRes = ^ResArray; ResAr-*-} Type CursType = (Default, Select, Scroll, DoIt, Bar); FootAr = ARRAY [0..8] of ARRAY [0..3] of Integer; pFooray = Record numIndices: integer; indices: Array[1..1] of integer; End; tAr = ^FootAr; PROCEDURE InitCurs; PROCEDURE DestroyCurs; PROCEDURE SetCurs(t: CursType); PROCEDURE InitFooter(VAPROCEDURE Menu(names: pNameDesc; isList: boolean; first, last, curX, curY, maxYsize: integer; VAR res: ResRes); R scrollP: pFootAr; VAR spotP: pFootAr; VAR footW: integer); {-*-*-*-*-*- PROCEDURE InitPopUp; PROCEDURE DestroyRes(var res: ResRes); PROCEDURE AllocNameDesc(numNames, seg: Integer; Var names: pN*-*-*-*-*-*-*-*-*-*-*-} PRIVATE {-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-} D E  { #--- { { The base unit of the file is a text line. The function that provides { values from the pmber generator. J. P. Strait 15 Sep 80. Copyright (C) Three Rivers Computer Corporation, 1980. rofile file will return a line of text each time that it { is called. All text line between the # and the next Module RandomNumbers contains two routines: InitRandom - initializes the random number generator.  { # are assumed to be assoicated with the first subsystem. { Successive calles to PFileEntry will return the  Random - a function which returns a new random number each time it is referenced. next line of text for the { current subsystem. { {----------------------------------------------------------------------}  There is currently no way to seed the generator. Random is a feedback shift-register pseudo-random numException PNotFound(FileName: String); {------------------------------------------------------------------------ Abstract: Rber generator. The algorithm used is one described in the article: 'Generalized Feedback Shift Registaised when profile file cannot be found Parameters: fileName is profile not found ------------------------------------------er Pseudorandom Number Generator' T. G. Lewis and W. H. Payne JACM Vol. 20, No. 3, Jul------------------------------} Exception PNotInited; {---------------------------------------------------------------------y 1973, pp. 456-468. Random produces multidimensional pseudo-random numbers equally distributed in th--- Abstract: Raised when a profile procedure is used but PFileInit not called first ------------------------e interval -32768..32767 and has a period of 2^98. ---------------------------------------------------------------------------------------------------------------------} Type ProfStr = String[255]; procedure PFileInit(PFileName, SubSystem: Pr---} {------------------------------------------------------------------------ Change log: 1 Jun 81 BAM  } { 30-Apr-81 V1.0 Don Scelza { Created the module. { } {********************} Exports {********************} {ofStr); function PFileEntry: ProfStr; {*******************} Private {*********************} --------------------------------------------------------------------- { { This module provides facilities that will allow a program to get { information from the user profile. { { The profile file is a text file that has the form: { { # { { - { - { -module RandomNumbers; {------------------------------------------------------------------------ RandomNumbers - Random nuE F --------------------------} {////////////////////////////} exports {\\\\\\\\\\\\\\\\\\\\\\\\\} procedure InitRandom; func{ RD Definitions. {----------------------------------------------------------------------------- { { RD.Dfs - Routine dtion Random: integer; {////////////////////////////} private {\\\\\\\\\\\\\\\\\\\\\\\\\} ictionary definitions. { Horst Mauersberg, Brian Rosen, Miles Barel ca. 1 Jan 80. { J. P. Strait  rewritten 21 Nov 80. { Copyright (c) Three Rivers Computer Corporation, 1980. { { Abstract: { This file defines offsets within routine dictionary entries. { {-----------------------------------------------------------------------------} { 6 Jun 80 1.1 Brad Myers { Corrected errors in comments: RDPS is the parameter size. { } { 21 Nov 80 MODULE Raster; {-------------------------------------------------------------- Support definitions for RasterOp Copyw 1.0 John Strait { Start file. { } RDPS = 0; { Parameter Size - number of words of parameters } RDRPSrite (C) 1980 - The Three Rivers Computer Corporation --------------------------------------------------------------} {----- = 1; { Result + Parameter Size - RDPS + words of result } RDLTS = 2; { Local + Temporary Size - total words --------------------------------------------------------- Versions: 2-Jun-81 Brad Myers Added comments ??-???-80 ??of locals } RDEntry = 3; { Entry point address - byte offset from code base } RDExit = 4; { Exit point ad Started --------------------------------------------------------------} EXPORTS Const RRpl = 0; { Rdress - byte offset from code base } RDLL = 5; { Lexical Level } RDFree6 = 6; { unused } RDFree7aster Op function codes } RNot = 1; RAnd = 2; RAndNot = 3; ROr = 4; ROrNo = 7; { unused } t = 5; RXor = 6; RXNor = 7; Type RasterPtr = ^RasterArray; {a pointer that can be used as RasterOp or Line source and destination } RasterArray = Array[0..0] of integer;  V1.2 Add comments. 17 Sep 80 JPS V1.1 Correct an error in the table. ----------------------------------------------PRIVATE F G geDisk(addr : DiskAddr) : ptrDiskBuffer; function ReadHeader(addr : DiskAddr) : ptrHeader; function ChangeHeader(addr : module Reader; {----------------------------------------------------------------------------- { { Reader - Stream pDiskAddr) : ptrHeader; procedure FlushDisk(addr : DiskAddr); procedure WriteDisk(addr : DiskAddr; ptr : ptrDiskBuffer; hdptr :ackage input conversion routines. { J. P. Strait ca. 1 Jan 81. { Copyright (C) Three Rivers Computer CorporationModule ReadDisk; {-------------------------------------------------------------------------- { { Abstract: { { Module to  ptrHeader); procedure WriteHeader(addr : DiskAddr; ptr : ptrDiskBuffer; hdptr : ptrHeader); procedure InitBuffers; functioRead and write to the disk using a buffer system Written by the CMU Spice Group -----------------------------------------n FindDiskBuffer(dskaddr : DiskAddr; alwaysfind : boolean) : integer; procedure ReleaseBuffer(indx : integer); procedure Flus---------------------------------} {-------------------------------------------------------------------------- Versions: hBuffer(indx : integer); procedure FlushAll; procedure ChangeBuffer(indx : integer); procedure ChgHdr(indx : integer); proce 12 Jan 82 BAM V1.5 Fixed FlushFail bugs in FlushAll, ForgetAll. 3 Dec 81 BAM V1.4 Change FlushFail to produre UseBuffer(indx,numtimes : integer); function BufferPointer(indx : integer) : ptrDiskBuffer; function HeaderPointer(indxvide more information. Change FlushBuffer to get the info. 12 May 81 BAM V1.3 Add excep : integer) : ptrHeader; function ReadAhead(addr : DiskAddr) : ptrDiskBuffer; procedure ForgetAll; Exception FlushFailtion for Flush failure 20 Apr 81 JPS V1.2 Make ReadDisk use its own segment (BufferSegment) (msg: String; operation: DiskCommand; addr: DiskAddr; softStat: integer); {---------------------------- rather than DiskIO's (DiskSegment). Set the BufferSegment and UnSwappable for virtual ---------------------------------------------- Abstract: Raised when the system is unable to flush out a buffer. The buffer  memory. 14 Apr 81 BAM V1.1 Fixed ForgetAll to set Flags to false. 19 Mar 81 BAM V1.0 Chan is marked as flushed out, however, so the error will not repeat the next time a buffer needs to be fluged Bit32 to FSBit32. 17 Mar 81 GGR V0.1 Changed number of buffers from 4 to 8. ?? ??? ?? CMU Spice Group V0.0shed Parameters: Same as DiskFailure (in DiskIO) Resume: ALLOWED, but has no effect (procedure will return normally as if  Started --------------------------------------------------------------------------} {******************} exports {***** flush had been successful) --------------------------------------------------------------------------} {******************************} imports DiskIO from DiskIO; function ReadDisk(addr : DiskAddr) : ptrDiskBuffer; function Chan**********} private {***************************} G H e; var X: integer ); procedure ReadString( var F: FileType; var X: String; Max, Len: integer ); procedure ReadX( var F: Fileguarantees are made as to the accuracy or correctness of the { functions. Validation of the functions must be done, but Type; var X: integer; B: integer ); private at { some later date. { { Design: { AdX, IntXp, SetXp, and Reduce are implemented as Pascal { functions. module RealFunctions; {----------------------------------------------------------------------------- { { RealFunctions - Stan It is clear that replacing the calls with in-line { code (perhaps through a macro expansion) would improve the { dard functions for reals. { J. Strait 27 Nov 81. { Copyright (C) Three Rivers Computer Corporation, 1981. { { Abstract: {efficiency. { { Many temporary variables are used. Elimination of unnecessary { temporaries would also improve t RealFunctions implements many of the standard functions whose { domain and/or range is the set of real numbers. The efficiency. { { Many limit constants have been chosen conservatively, thus { trading a small loss in range for, 1981. { { Abstract: { Reader is the character input module of the Stream package. It is { called by code genhe { implementation of these functions was guided by the book { { Software Manual for the Elementary Functions, erated by the Pascal compiler in response to Read { or Readln. It is one level above Module Stream and uses Stream's { { William J. Cody, Jr. and William Waite, { (C) 1980 by Prentice-Hall, Inc. { { The domain (inputs) and r lower-level input routines. { {-----------------------------------------------------------------------------} { 4 ange (outputs) of the functions are { given in their abstract. The following notation is used. { Parentheses () aJun 81 V2.1 John Strait. { Add Virgil headers and comments. { } { 12 May 81 V2.0 John Strait. { 1. Use exceptions rathre used for open intervals (those that do not { include the endpoints), and brackets [] are used for closed { inteer than StreamError. { 2. Fix bug in read routines caused by not clearing CharReady. { } exports imports Stream fromrvals (those that do include their endpoints). The closed { interval [RealMLargest, RealPLargest] is used to mean all re Stream; procedure ReadBoolean( var F: FileType; var X: boolean ); procedure ReadCh( var F: FileType; var X: char; Fieal { numbers, and the closed interval [-32768, 32767] is used to { mean all integer numbers. { { Currentlyld: integer ); procedure ReadChArray( var F: FileType; var X: ChArray; Max, Len: integer ); procedure ReadIdentifier( var F: all functions described by Cody and Waite are { implemented with the exception of the hyperbolic functions { (Sin FileType; var X: integer; var IT: IdentTable; L: integer ); procedure ReadInteger( var F: FileTypH, CosH, TanH). { { DISCLAIMER: { { Only the most cursory testing of these functions has been done. { No H I  { now are the ones recommended by Cody and Waite. It seems that { Indefinite values (NaNs in the IEEE terminology--------------------------------------- { { Abstract: { SqrtNeg is raised when Sqrt is passed a negative argument. { ) might make { more sense in some cases. { {--------------------------------------------------------------------------- You may resume from this exception, in which case Sqrt returns { Sqrt(Abs(X)). { { Parameters: { X - Argume--} {----------------------------------------------------------------------------- { { Change history: { { 27 Nov 81 V1nt of Sqrt. { {-----------------------------------------------------------------------------} exception ExpLarge( X: .0 J. Strait { Start module. { {-----------------------------------------------------------------------------} exports Real ); {----------------------------------------------------------------------------- { { Abstract: { ExpLarge is rai const RealPInfinity = Recast(#17740000000,Real); { 1.0 / 0.0 } RealMInfinity = Recast(#37740000000,Real); { sed when Exp is passed an argument which is too { large. You may resume from this exception, in which case Exp { -1.0 / 0.0 } RealPIndefinite = Recast(#00000000001,Real); { 0.0 / 0.0 } RealMIndefinite = Recast(#20000000001,Rreturns RealPInfinity. { { Parameters: { X - Argument of Exp. { {----------------------------------------------------eal); { -0.0 / 0.0 } RealPLargest = Recast(#17737777777,Real); { largest positive } RealMLargest = Recas-------------------------} exception ExpSmall( X: Real ); {-----------------------------------------------------------t(#37737777777,Real); { largest negative } RealPSmallest = Recast(#00040000000,Real); { smallest positive } ------------------ { { Abstract: { ExpLarge is raised when Exp is passed an argument which is too { small. You  a guarantee of correctness. { The choice of these limits should be re-evaluated by someone { with a better undersRealMSmallest = Recast(#20040000000,Real); { smallest negative } function Sqrt( X: Real ): Real; function Exp( X: Realtanding of the issues. { { Some constants are expressed in decimal (thus losing the { guarantee of precision). O ): Real; function Ln( X: Real ): Real; function Log10( X: Real ): Real; function Power( X, Y: Real ): Real; function PowerIthers are expressed as Sign, { Exponent, and Significand and are formed at execution time. { Converting these two ( X: Real; Y: Integer ): Real; function Sin( X: Real ): Real; function Cos( X: Real ): Real; function Tan( X: Real ): Real; 32-bit constants which are Recast into { real numbers would improve the correctness and efficiency. { { More thoufunction CoTan( X: Real ): Real; function ArcSin( X: Real ): Real; function ArcCos( X: Real ): Real; function ArcTan( X: Realght needs to be given to the values which are returned { after resuming from an exception. The values that are returned  ): Real; function ArcTan2( Y, X: Real ): Real; exception SqrtNeg( X: Real ); {--------------------------------------I J ------------------------------------------------------------------- { { Abstract: { LogSmall is raise when Ln or Log10  exception PowerBig( X, Y: Real ); {----------------------------------------------------------------------------- { { Ais passed an argument which { is too small. You may resume from this exception in which case { Ln or Log10 returnbstract: { PowerBig is raised when Power or PowerI is called with X and Y { for which X raised to the Y power is ts RealMInfinity if X is zero or the log of { Abs(X) if X is non-zero. { { Parameters: { X - Argument of Ln or Looo large to be represented. { You may resume from this exception in which case Power or PowerI { returns RealPInfig10. { {-----------------------------------------------------------------------------} exception PowerZero( X, Y: Reanity. { { Parameters: { X - Argument of Power or PowerI. { Y - Argument of Power or PowerI. { {---------------l ); {----------------------------------------------------------------------------- { { Abstract: { PowerZero is raise--------------------------------------------------------------} exception PowerSmall( X, Y: Real ); {-----------------d when Power or PowerI is called with X = 0.0 { and Y = 0.0. You may resume from this exception in which case { P------------------------------------------------------------ { { Abstract: { PowerSmall is raised when Power or PowerI ower or PowerI returns RealPInfinity. { { Parameters: { X - Argument of Power or PowerI. { Y - Argument of Poweris called with X and Y { for which X raised to the Y is too close to zero to be represented. { You may resume from or PowerI. { {-----------------------------------------------------------------------------} exception PowerNeg( X,  this exception in which case Power or PowerI { returns 0.0. { { Parameters: { X - Argument of Power or PowerI. Y: Real ); {----------------------------------------------------------------------------- { { Abstract: { PowerNeg is  { Y - Argument of Power or PowerI. { {-----------------------------------------------------------------------------} raised when Power is called with X < 0.0 or with { X = 0.0 and Y < 0.0, or PowerI is called with X = 0.0 and { Y < exception SinLarge( X: Real ); {----------------------------------------------------------------------------- { { Abst 0. You may resume from this exception in which case Power { or PowerI returns Power(Abs(X),Y) in the case of X < 0.0 orract: { SinLarge is raised when Sin is called with an argument which is { too large. You may resume from this excmay resume from this exception, in which case Exp { returns 0.0. { { Parameters: { X - Argument of Exp. { {--- { returns RealPInfinity in the case of X = 0.0 and Y < 0.0. { { Parameters: { X - Argument of Power or PowerI. --------------------------------------------------------------------------} exception LogSmall( X: Real ); {---------- { Y - Argument of Power or PowerI. { {-----------------------------------------------------------------------------} J K ----} exception ArcCosLarge( X: Real ); {--------------------------------------------------------------------------------------} exports procedure SetBaud(Baud: String; Enable: Boolean); Exception BadBaudRate; {------------------------eption in which case { Sin returns 0.0. { { Parameters: { X - Argument of Sin. { {---------------------------- { { Abstract: { ArcCosLarge is raised when ArcCos is called with an argument { which is too large. You may res-------------------------------------------------} exception CosLarge( X: Real ); {-----------------------------------ume from this exception in which { case ArcCos returns RealPInfinity. { { Parameters: { X - Argument of ArcCos. ------------------------------------------ { { Abstract: { CosLarge is raised when Cos is called with an argument which { {-----------------------------------------------------------------------------} exception ArcTan2Zero( Y, X: Real ) is { too large. You may resume from this exception in which case { Cos returns 0.0. { { Parameters: { X; {----------------------------------------------------------------------------- { { Abstract: { ArcTan2Zero is raised - Argument of Cos. { {-----------------------------------------------------------------------------} exception TanLa when ArcTan2 is called with both X and Y { equal to zero. You may resume from this exception in which { case Arcrge( X: Real ); {----------------------------------------------------------------------------- { { Abstract: { CosLargTan2 returns RealPInfinity. { { Parameters: { Y - Argument of ArcTan2. { X - Argument of ArcTan2. { {---------e is raised when Tan or CoTan is called with an argument { which is too large. You may resume from this exception in whi--------------------------------------------------------------------} private ch { case Tan or CoTan returns 0.0. { { Parameters: { X - Argument of Tan or CoTan. { {-----------------------module RS232Baud; {---------------------------------------------------------------------- { { Abstract: { { RS232Baud -------------------------------------------------------} exception ArcSinLarge( X: Real ); {--------------------------- set RS232 baud rate with optional input enable. J. P. Strait 21 Aug 80. Copyright (-------------------------------------------------- { { Abstract: { ArcSinLarge is raised when ArcSin is called with an c) Three Rivers Computer Corporation 1980. ----------------------------------------------------------------------} {-------argument { which is too large. You may resume from this exception in which { case ArcSin returns RealPInfinity. --------------------------------------------------------------- Versions 13-May-81 Brad A. Myers V1.1 Changed to use e{ { Parameters: { X - Argument of ArcSin. { {-------------------------------------------------------------------------xceptions and new IO 21-Aug-80 John Strait V1.0 Created -------------------------------------------------------------K L  var Header: RunInfo; var FirstSeg, FirstUserSeg, LastSeg: pSegNode; Module Screen; {---------------------------------------------------------------} { Perq Screen Driver  ImportsWanted: Boolean ); procedure ReadSegNames( var RunFile: RunFileType; Seg: Integer; First } { Written By: Miles A. Barel July 1, 1980 } { Three Rivers Computer CorUserSeg: pSegNode ); private poration } { Pittsburgh, PA 15213 } { Abstract: Provides the interface to the PERQ screen including } { rudimentary support for multiple windows } {------------------------------------------------------------------------ Abstract: Raised if string is not a valid baud rate ----------------------------------------------------------------------} private module RunWrite; {----------------------------------------------------------------------------- { { RunWrite - Module tmodule RunRead; {----------------------------------------------------------------------------- { { RunRead - Module to o write run files. { John P Strait 9 Apr 81. { CopyRight (C) Three Rivers Computer Corporation, 1981. { { Abstread run files. { John P Strait 9 Apr 81. { CopyRight (C) Three Rivers Computer Corporation, 1981. { { Abstracract: { RunWrite exports procedures to write run files. { { Design: { If and when the format of run files is chat: { RunRead exports procedures to read and write run files. { { Design: { If and when the format of run files inged, the constant { RFileFormat in module Code must be changed. This is necessary { so that the procedures to res changed, the constant { RFileFormat in module Code must be changed. This is necessary { so that the procedures ad run files will not crap out. { {-----------------------------------------------------------------------------} { 21 Jto read run files will not crap out. { {-----------------------------------------------------------------------------} {ul 81 V1.1 John Strait { Add Hints. { } { 9 Apr 81 V1.0 John Strait { Start file. { } exports const RunWrit 21 Jul 81 V1.1 John Strait { Add Hints. { } { 9 Apr 81 V1.0 John Strait { Start file. { } exports const RueVersion = '1.1'; imports Code from Code; procedure WriteRunFile( var RunFile: RunFileType; Header: RunInfo; nReadVersion = '1.1'; imports Code from Code; procedure ReadRunFile( var RunFile: RunFileType; Seg: Integer;  FirstSeg, FirstUserSeg: pSegNode ); private L