• Keine Ergebnisse gefunden

Pre-KS10 Input-Output Instructions

Im Dokument UPDATE NOTICE (Seite 191-196)

In the KLlO and earlier processors, the input-output instructions control the movement of information to and from the peripheral equipment and perform many system-oriented operations within the processor, i.e. man- agement of the internal devices, which in the KLlO are connected to the E bus.

User Operations 2-131

An instruction in the in-out class is designated by 111 in bits O-2, i.e.

its left octal digit is 7. In this section these instructions are shown like this,

7 D I I x Y

0 2 3 9 10 12 13 14 17 18 35

where bits lo-12 are given as a 2-digit octal number to select one of eight IO instructions, which are described here in terms of their general effects for handling external devices, and D addresses the device that is to respond to the instruction. The format thus allows for 128 device codes, of which the KLlO uses the first six (000-024) for internal devices (the KIlO uses the first three, the KAlO the first two). In instruction descriptions for individ- ual devices, the instruction and device codes are combined into a single 5- digit code for bits O-12. Codes for the internal devices are included in the tables in Appendix A, but all information about external devices - device codes, individual instruction descriptions, etc. - is given in the device doc- umentation.3g Bits 13-35 are the same as in all other instructions: they are the I, X, and Y parts, which are used to calculate an effective address, set of conditions, or mask to be used in the execution of the instruction.

NOTE

Ordinarily the user has no use whatever for the instructions described in this section. In almost all cases, input and out- put is handled by the Monitor in response to user requests employing MUUOs and various software formats. For infor- mation on user procedures vis-a-vis Monitor handling of user IO requirements, the reader should refer to the appropriate Monitor Calls manual.

Programmers who do use these instructions should note that unless otherwise specified, all instructions described in the remainder of this manual are in-out instructions, which are affected by the timeshare instruction restrictions. Except in the KAlO, in-out instructions using device codes 740 and above are not restricted. But an instruction using a device code under 740 (or given in a KAlO) cannot be performed by a user program unless User In-out is set and cannot be per- formed in supervisor mode at all (in-out is normally handled in kernel mode). Any in-out instruction that violates these restrictions does not perform the functions given for it in the instruction description. Instead it executes as an MUUO.

These restrictions will not be mentioned in the instruc- tion descriptions, as they apply to all instructions from this point on.

--

3g Electrical and logical specifications of the IO bus are given in the interface manual.

2-132 User Operations

CON0 Conditions Out

7 D 2OI x Y 1

0 2 3 Y IO I2 13 14 17 18 35

Set up device D with the effective initial conditions JY.~O The number of condition bits in E that are actually used depends on the device.

CONI Conditions In

7 D 24 I X Y I

0 2 3 Y IO I2 I3 I4 I7 I8 3s

Read the input conditions from device D and store them in location E. The number of condition bits stored depends on the device; the remaining bits in location E are cleared.

DATA0 Data Out

7 D 141 x Y

0 23 Y IO I2 I3 14 I7 I8 3s

Send the contents of location E to the data buffer in device D, and perform whatever control operations are appropriate to the device.

The amount of data actually accepted by the device depends on the size of its buffer, its mode of operation, etc. The original contents of location E are unaffected.

DATAI Data In

7 D 041 x Y

0 23 Y IO I2 I3 I4 I7 I8 35

Move the contents of the data buffer in device D to location E, and perform whatever control operations are appropriate to the device.

The number of data bits stored depends on the size of the device buffer, its mode of operation, etc. Bits in location E that do not receive data are cleared.

Jo E will always be regarded as being bits 18-35, even though it is actually placed on both halves of the bus and many devices receive the information from the left half.

User Operations 2-133

CONSZ Conditions In and Skip if Zero

7 D 301 x Y

0 23 Y IO 12 13 14 17 18 35

Test the input conditions from device D against the effective mask E. If all condition bits selected by 1s in E are OS, skip the next instruction in se- quence.

If the device supplies more than 18 condition bits, only the right 18 are tested.41

CONS0 Conditions In and Skip if One

7 D 341 x Y

0 23 Y IO 12 13 14 I7 IX 3s

Test the input conditions from device D against the effective mask E. If any condition bit selected by a 1 in E is 1, skip the next instruction in sequence.

If the device supplies more than 18 condition bits, only the right 18 are tested.41

BLKO Block Out

7 D IO/ x ?

0 23 Y IO I2 13 I4 I7 IH .3 5

BLKI Block In

7 D 00 I x Y

0 23 Y IO I2 I3 I4 I7 18 3 5

Add one to each half of a pointer 42 in location E, and place the result back in E. Then perform a data IO instruction in the same direction as the block IO instruction, using the right half of the incremented pointer as the effec- tive address. If the given instruction is a BLKO, perform a DATAO; if a BLKI, perform a DATAI.

The remaining actions taken by this instruction depend on whether it is executed as a priority interrupt instruction.

Not as an Interrupt Instruction. If the addition has caused the count in the left half of the pointer to reach zero, go on to the next instruction in sequence. Otherwise skip the next instruction.

41 Condition bits in the left half word can be tested by reading using a test instruction (02.7).

them with a CON1 and then

42 In the KAlO incrementing both halves of the pointer is effected by adding 1OOOOO1s to the entire register (and a carry can therefore go from the right half into the left).

._

.-

2-134 User Operations

-

As an Interrupt Instruction. If the addition has caused the count in the left half of the pointer to reach zero, execute the instruction in the second interrupt location for the level. Otherwise dismiss the interrupt and return to the interrupted program.

It is not expected that block instructions will be of any use in a DECSYSTEM-20. For compatibility however, the address supplied by the pointer is taken to be in the local section.

Notes. A block IO instruction is effectively a whole in-out data han- dling subroutine. It keeps track of the block location, transfers each data word, and determines when the block is finished.

Initially the left half of the pointer contains the negative of the number of words in the block, the right half contains an address one less than that of the first word in the block.

The above eight instructions differ from one another in their total ef- fect, but they are not all different with respect to any given device. A BLKO acts on a device in exactly the same way as a DATA0 - the two differ only in counting and other operations carried out within the processor and mem- ory. Similarly, no device can distinguish between a BLKI and a DATAI;

and a device always supplies the same input conditions during a CONI, CONSZ or CONS0 whether the program tests them or simply stores them.

Hence the eight instructions may be categorized as of four types, repre- sented by the first four instructions described above. Moreover, a complete treatment of the programming of any external device can be given in terms of these four instructions, two of which are for input and two for output.43 The four exhaust the types of information transfer that occur in the IO system.

Every device requires initial conditions; these are sent by a CONO, which can supply up to eighteen bits of control information to the device control register. The program can determine the status of the device from up to thirty-six bits of input conditions that can be read by a CON1 (but only the right eighteen can be tested by a CONSZ or CONSO). Some input bits simply reflect initial conditions sent by a previous CONO; others are set up by output conditions but are subject to subsequent adjustment by the device; and still others may have no direct connection with output condi- tions.

Data is moved in and out in bytes of various sizes or in full 36-bit words. Each program transfer between memory and a device data buffer requires a single DATA1 or DATAO. Every device has a CON0 and CONI, but it may have only one data instruction unless it is capable of both input and output. A DATA1 that addresses an output-only device simply clears location E. On the other hand a DATA0 that addresses an input-only de-

43 The word “input” used without qualification always refers to the transfer of data from the peripheral equipment into the processor; ‘toutput” refers to the transfer in the opposite direction.

User Operations 2-135

vice is a no-op. When the device code is undefined or the addressed device is

The preceding sections define the machine language characteristics of the system from a user point of view. But efficient and effective use of the circumstances, as explained in $2.9. JRST functions for handling interrupts are legal when IO is legal.

Im Dokument UPDATE NOTICE (Seite 191-196)