• Keine Ergebnisse gefunden

EXPLICIT EXECUTIVE COMMANDS

Im Dokument first title (Seite 64-76)

3) READY 3.2 POWER-ON

4.1 THE MOOS EXECUTIVE

4.1.5 EXPLICIT EXECUTIVE COMMANDS

Command syntax for each of the MOOS explicit commands ;s illustrated in this section with the aid of the following notation:

[ ] Option brackets. Any parameters enclosed between brackets are optional.

< > Symbol brackets. This space should be replaced by the item described.

4.1.5.1 THE CaMP COMMAND

COMP <start addr. blockl> <end addr. b1ock1> <start addr. b1ock2>

The COMP command compares two blocks of memory and displays address locations that do not compare and the data at those locations. Example:

>COMP 5000 50~F 5010 5004 01 09 5014

The block of memory from 5000 to 500F is compared "'ith the block of memory from 5010 to 501F~ One location fails to compare. Location 5004 contains 01 while the corresponding location, 5014, in the second block contains 09.

4.1.5.2 THE DUMP COMMAND

DUMP <start addr.>[<end addr.>]

The DUMP command outputs to the system console a formatted hex display of the contents of a block of memory. Sequential memory locations are shown 16 to a line with the memory address at the left margin. If the optional end address parameter i,s not entered, only one byte is dlsp1ayed. Example:

>DUMP 50210 5011

5000 50 C0 27 77 4F 33 4F CD 70 9E 98 00 6A FD 82 90 5010 77 28

4.1.5.3 THE ENTR COMMAND ENTR <start addr.>

4-4

Rev. 8 9/78

\

The ENTR command allows data to be entered into memory directly from the console device. Example:

>ENTR 7000

>78 89

6~

Three bytes were entered starting at location 7000 hex. These were 78 at 7000. 89 at 7001. and 6F at location 7002.

Typing in an ENTR command places the executive in a special enter mode.

While in the enter mode each line of values that is typed is entered into memory when the RETURN key ;s pressed. Until the RETURN key is pressed the standard backspacing and CNTL/X tools are available for line correction.

The last value on the last line must be followed by a slash (I) to properly terminate the enter mode. Entry of a illegal hex value in any line will also cause termination of the enter mode with the message SYNTAX ERROR.

4.1.5.4 THE FILL COMMAND

FILL <start addr.> <end addr.> <byte>

The FILL command fills a block of memory with a specified byte.

Example: .

>FILL 7000 8000 9

Each byte of memory in the block from 7000 to 8000 is changed to a 09 by this command.

4.1.5.5 THE MOVE COMMAND

MOVE <source addr. start> <source addr. end> <dest. addr. start>

The MOVE command copies the source block of memory to the destination block. The source block is not changed. The destination block is changed to be an exact copy of the source block. Example:

>MOVE 3000 4000 7000

Each byte in the memory block from 3000 to 4000 ;s copied into the corresponding position in the memory block from 7000 to 8000.

4.1.5.6 THE SEAR COMMAND

SEAR <start addr.> <end addr.> <byte>

The SEAR command searches a block of memory for all occurrences of the specified byte and displays all locations with a match. Example:

>SEAR 3000 3020 9F 3004 9F

3018 9F

The block of memory from 3000 to 3020 ;s searched for all occurrences of a 9F. location 3004 and location 3018 both contain 9F. No other

locations in the block contain 9F.

4-5 Rev. 7 3/78

4.1.5.7 THE SEARN COMMAND

SEARN <start addr.> <end addr.> <byte>

The SEARN command searches a block of mel'lory for all non-occurrences of a specified byte and displays all locations that do not match. Example:

>SEARN 30~0 3010 67 3002 09 67

3006 76 67

The block of memory from 3000 to 3010 is searched for all non-matches with the mask 67. Location 3002 contained a 9 rather than a 67, and 3~06

contained a 76 rather than a 67.

4.1.5.8 THE CREATE COMMAND

CREATE "[unit:]<filename>" [<file type>]

The CREATE command creates a new file in the directory of the diskette in the specified unit and allocates the initial track for the file. If no unit is specified, unit 0 ;s assumed. The second parameter optionally gives the file a TYPE designation. If no type is specified the type is defaulted to 0.

4.1.5.9 THE DISP COMMAND

DISP l[unit:]<fi1ename>" [<record number>]

The DISP command outputs a formatted hex display of the data contents of a file to the system console. The unit number indicates the disk drive _ on which the file is to be found. If no unit is specified, unit 0 is

assumed. The optional record number indicates on which record in the file the display is to begin. If no record number is specified, record 1 is assumed.

Each record is displayed with a header line that contains the record number, the address in memory where the record is to be loaded, and the number of data bytes in the record. Data lines follow the record header.

Each data line has up to sixteen data bytes preceded by the index position in the record of the first data byte on that line.

>DISP "l :TEST" 29 0029 3C00 0022

00 12 2A BD 76 8F ED 54 41 89 00 00 82 BC CC 76 89 10 78 88 3B BS 88 54 58 56 90 88 32 31 30 00 00 00 20 89 SS

002A 3C80 0003 00 FF FF FF 002S 3F00 0009

00 45 43 4B 4C 31 37 38 00 00 002C 2800 0000

END-FILE

Rev. 8 9/78 4-6

The first line of the display shows the record number 29, the load address 3C~~, and the length of the record 22 bytes (all in hex). The

header line is followed by three lines which display the data in record 29. Each data line starts with the index position of the first byte in the line. It is followed by two spaces and then the data.

The next header is for record 2A which has a load address of 3C8~ and contains 03 bytes of data.

Record 2B has a load address 3F00 and contains ~9 bytes of data.

The last header is for record 2C which has a load address of 2B~ and a record length of 0. If the file is an executable object file (like ASSM for example), the address in the zero length sector is the execution address of the file. LOADing stops when the zero length sector is read.

If the file is a run type which is being implicitly loaded and run, program control is transferred to the execution address.

4-6.1 Rev. 8 9/78

4.1.5.10 THE FILES COMMAND FILES [<unit>]

The FILES command outputs a formatted display of the file information in a diskette directory to the system console. The unit number

indicates which disk drive directory ;s to be displayed. If no unit is specified, unit 0 is assumed. Example:

>FILES 1 RES DIR MOOS LINEEDIT ASSM SYMSAVE FILECOPY DISKCOPY BASIC

03 0000 03 0013 9lF 9l9l1C 15 000C 15 0010 15 0003 15 0003 0F 0009 0F 004B

The files on drive one are displayed on the console. The left column contains the filename, the second column ;s the file type, and the third column contains the number of sectors the file uses. All numbers are in hex.

4.1.5.11 THE FREE COMMAND FREE [<unit>]

The FREE command outputs to the system console the number of tracks left unallocated (free) on a diskette. The unit number indicates which disk drive. If no unit is specified, unit 0 is assumed. Example:

>FREE 1 003B

The diskette on drive one has 3B tracks available to be allocated.

4.1.5.12 THE SCRATCH COMMAND SCRATCH "[unit:]<fi1ename>"

The SCRATCH command removes a named file from the directory of a diskette and returns its allocated tracks to available status. Disk drive III is assumed if no unit is specified.

Note: Some files cannot be SCRATCHed without first changing the file TYPE (see 4.1.5.9 and 4.2.3).

4-7

Rev. 7 3/78

4.1.5.13 THE LOAD COMMAND

The LOAD command loads (reads) a named fil~ from a diskette into the computers memory and then returns control to the MOOS executive. If no unit number

is specified, the file is expected to be found on unit 0.

The LOAD command can be used in conjunction with two categories of files, OBJECT files and DATA files. The specific nature of the load that is performed depends on the category of the specified file to be loaded. The process of LOADing an OSJECT file is described in 4.1.5.13.1. The process of LOADing a DATA file is described in 4.1.5.13.2.

The LOAD command can NOT be used to load a file in the OVERLAY category.

An OVERLAY file ;s defined as any file with a file type value in the range 0C - 0F hex (see Section 4.2.3). An attempt to LOAD an OVERLAY file results in the message WRONG FILE TYPE. OVERLAY files are not LOADable because

they generally imply the replacement of the MOOS module and require immediate execution. Control cannot be returned to the MOOS executive and must be transferred immediately to the newly overlayed program module. If there is a necessity to LOAD an OVERLAY file into a memory area which does not conflict with MOOS, this can be done by changing the file type to an OBJECT type and then using an offset load per Section 4.1.5.13.1.

4.1.5.13.1 THE LOAD COMMAND FOR OBJECT FILES

An OBJECT file is defined as any file with a file type value in the range 08 - 0B hex or 14 - lBhex. These ranges include ASSM object files, BASIC

• save memory' files, executable system files, and executable user files (see Section 4.2.3).

The format of the LOAD command for OBJECT files is:

LOAD lI[unit:] <filename>1I [<start addr.>]

OBJECT files are LOADed by using the address and length information in the header of each record of the file (see Section 4.2.4). This is called a

'scatter load' because it permits records in the file to be loaded into non-contiguous portions of memory depending on the associated addresses.

The LOAD is terminated when the first 0 length record in the file is encountered.

If the optional start address is not specified in the LOAD command, then the load of an OBJECT file proceeds according to the following example.

The OBJECT fi 1 e to be loaded is "TEST".

DrS? IITEST"

0000 2B00 0005 00 31 32 33 34 35 0001 2C00 0004 00 54 45 53 54 0002 2B00 0000 END-FILE

Rev. 8 9/78 4-8

Typing LOAD "TEST" loads two text strings into memory. The string "12345"

in record 0 is loaded starting at 2800 hex for five bytes. The test string

"TEST" in record 1 is loaded starting at 2C~0 hex for four bytes. The last record contains a zero length ~ector which terminates the load of an OBJECT type file. For an executable file the zero length sector contains the run address which in this case is 2800 hex. This file. however. could not be a run file as it stands as there is no executable code.

If the loa'd address of the first record is less than 2B00 hex. the message LOAD ADDRESS ERROR is displayed because file may not be loaded beneath the MOOS application area.

If the optional start-address is specified in the LOAD command. then the first record of the file is loaded starting at the specified address. The load address in the record header of the first record is subtracted from the start-address to produce an offset. Hhen the records following the first record of the file are loaded. the calculated offset is added to the load address in the record header and the record is loaded starting at the calculated address. This is called an loffset scatter load l .

Using the file TEST in the example above, typing LOAD IITESTII 5000 loads the string 111234511 starting at memory location 5000 hex for five bytes. The

offset is calculated by subtracting the load address in the header of the first record from the start-address. 5000-2B00=2500 hex. The string "TESTu is

loaded starting at 5100 hex for four bytes. The load address in the header of the second record, 2C~0 has the offset 25~0 hex added to it and the result

is the offset-load address.

If the optional start-address is less than 2800 the message LOAD ADDRESS ERROR is displayed.

4.1.5.13.2 THE LOAD COMMAND FOR DATA FILES

Any file which is not an OBJECT file and not an OVERLAY file is treated as a DATA file by the LOAD command. DATA files thereby include file type values

in the ranges

0-7,

10-13 hex, and 1C-FF hex. These ranges cover MOOS and BAS.IC DATA files, ASSM and LINEEDIT source files, BASIC program files and all of the unassigned file types (see Section 4.2.3).

The format of the LOAD command for DATA files is:

LOAD U[unit:] <filename>1I <start addr.>

The start address parameter is mandatory.

a SYNTAX ERROR message will be displayed.

2B00 HEX a LOAD ADDRESS ERROR will result.

tion of the operating system.

4-8.1 Rev. 8 9/78

If a start address is not specified If the start address is less than

This prevents accidental

destruc-Data is loaded starting at the sDecified address and continuing until the number of records in the file as shown in the directory have been loaded.

The data is loaded into memory sequentially and contiguously. Only the number of data bytes in each record are loaded. The LOAD comMand does not pad records of less than 256 bytes. If a file were loaded at location 3000 and the first record had only 4 data bytes in it, then the first data byte from the next record would be loaded at location 3004. Records with zero length are skipped over. The load address in the sector header (see Section 4.2.4) has no meaning when doing a data LOAD.

4.1.4.14 THE SAVE COMMAND

SAVE "[unit:]<filename>" <start addr.> <end addr.> [<file type>]

[<exec. addr.>]

The SAVE command saves (writes) a new file to a diskette from a block of memory. The file is written sequentially from the memory start

address through the memory end address into full sequential records. If no unit number is specified, the file is written to unit 0. If a file type is not specified the file type will be zero. If an execution address is not specified. the execution address of the file will be set to the start address of the memory block. Note that the type and execution

address parame°i:.ers are position dependent such that if an execution address is specified then a file type must also be present. Example:

>SAVE ill:NEWFlLEiI 2B"~ 3700 0 30021

A file is created on the diskette in drive one with the name NEWFILE and the memory block from 2B0~ to 3700 is written to that file. The file

is given a type of " and the execution address saved with the file is 30210. If no execution address had been specified then 2B00 would be saved as the execution address.

4.1.5.15 THE RENAME COM~AND

RENAME "[unit:]<filename>" "<new name>"

The RENAME command changes the name of a diskette file to a specified new name. If no unit number is specified, the file to be renamed is expected to be found on unit 0. Example:

>RENAME "l:OLDFILE" "NEWFILE"

The file named OLDFILE on the diskette in drive one is changed to NEWFILE on the diskette in drive one. The file type is unchanged by the renaming

process.

Rev. 8 9/78 4-3.2

4.1.5.16 THE TYPE COMMAND

TYPE "[un it: ]<fil ename>" <type>

The TYPE command changes the type designation of a specified file. The type designation is a single hex byte. A definition of file types is given in Section 4.2. Example:

>TYPE "1 :PROGRAMX" 15

The type of the file PROGRAMX one disk drive one is changed to a value of 15.

4.1.5.17 THE APP COMr~AND

APP ["<ASCII>" "<ASCII>" ... "<ASCII>"] [<hex> <hex> ... <hex>]

The APP command transfers program control from the MOOS executive to the start of the MOOS applications area at 2B00 hex. It expects a valid executable program to be in the applications area with its entry point at the beginning. Up to four ASCII parameters and four hex parameters can be passed to the program. For example, if you are doing several

assemblies, the assembler need only be read into memory once from diskette as it does not change itself in the process of assembling a program.

After it is once in memory the APP command can be used to communicate with the assembler. Example:

>APP "1: SOURCE" "0BJ.ECT" "P"

If the assembler were already in memory, the above example would transfer control and the necessary parameters to the program and the assembler would assemble the source file called SOURCE from drive one; produce an object file on drive zero called OBJECT; and output a paginated listing on the print device.

The APP command functions like the EXEC command in that it PUSHes the address of the operating systems warm start entry point onto the system stack. Therefore if the program in the applications area does not provide its own stack, a RET would return control to the operating system.

4.1.5.18 THE ASSIGN COMMAND

ASSIGN <device #> <logical stream mask> [<width> <null count>]

The ASSI~~ command is a dual purpose command which provides the ability to specify the connections of physical output print devices to logical output streams and the values for carriage width and nullcount of the referenced physical device. The physical device number must be 1 or 2.

The logical stream mask must be a 0,1,2, or 3. The device width and nullcount must be numeric values in the range 1 to FF hex. The width and null count parameters are optional. If width or nullcount are not included, the values corresponding to the referenced physical device

4-9

Rev. 8 9/78

are not changed. If only the device width is included, then the

nullcount is left unchanged. However. if a nullcount is specified then the width must be present as a place holder even if it is the same. If the ASSIGN command contains only three parameters the third is always the width.

Logical output stream number one consists of all output generated by system messages, keyboard echoing and the output from any eXDlicit executive command. Logical output stream number two consists of all output generated by LISTP and PRI~TP commands in the line editor, and by all listings in the assembler. The logical stream mask can be set to a three to represent both logical output streams one and two, or to a zero indicating that the device is to receive no output.

Physical device number one represents the display element of the keyboard display device that is configured as the system console (see Section 2.2.4.1 on terminal configuration). PhYSical device number two represents the hard copy print device which is configured as the system printer (see Section 2.2.4.3).

The output of a logical stream is directed to all physical devices which are assigned to it. A physical device may be assigned to one, both, or no logical streams. The ASSIGN command cancels any previous assignment of the specified device.

In its initialized state the terminal is aSSigned to stream one only, and the printer is assigned to stream two only. This state can be restored by executing:

>ASSIGN 1 1 .>ASSIGN 2 2

When the console and printer devices are configured, each device has a carriage width and nullcount parameter associated with it. These values may be changed by specifying optional third and fourth parameters in an appropriate ASSIGN command. The width parameter determines the maximum number of characters on each line for the given device. When a line is output that is longer than this value an autowrap feature is activated and a carriage return and line feed is inserted at the appropriate point so that the logical line is continued on the next device line. The

width can be changed on a given device by repeating the current assignment with the new width parameter. For example. if the console were currently assigned to stream one with a width of 80 characters (decimal). it could be changed to a width of 72 characters {decimal} as follows:

>ASSIGN 1 1 48

72 decimal is 48 hex. This width assignment will stay in effect until

72 decimal is 48 hex. This width assignment will stay in effect until

Im Dokument first title (Seite 64-76)