IBM System/360 architecture: Difference between revisions

Content deleted Content added
m fix a couple more
convert to efn
Line 359:
Memory (''storage'') in System/360 is addressed in terms of [[8-bit]] bytes. Various instructions operate on larger units called ''halfword'' (2 bytes), ''fullword'' (4 bytes), ''doubleword'' (8 bytes), ''quad word'' (16 bytes) and 2048 byte storage block, specifying the leftmost (lowest address) of the unit. Within a halfword, fullword, doubleword or quadword, low numbered bytes are more significant than high numbered bytes; this is sometimes referred to as [[big-endian]]. Many uses for these units require aligning them on the corresponding boundaries. Within this article the unqualified term ''word'' refers to a ''fullword''.
 
The original architecture of System/360 provided for up to 2<sup>24</sup>&nbsp;= 16,777,216 bytes of memory. The later [[IBM System/360 Model 67|Model 67]] extended the architecture to allow up to 2<sup>32</sup>&nbsp;= 4,294,967,296<ref group=NB>{{efn|Twice the size of the later System/370</ref>}} bytes of virtual memory.
 
==Addressing==
Line 369:
| publisher = Sperry Rand Corporation
}}
</ref> That means that instructions do not contain complete addresses, but rather specify a base register and a positive offset from the addresses in the base registers. In the case of System/360 the base address is contained in one of 15<ref group=NB>{{efn|A specification of general register 0 yield a base address of zero rather than the register content.</ref>}} general registers. In some instructions, for example shifts, the same computations are performed for 32-bit quantities that are not addresses.
 
==Data formats==
Line 404:
| align=center valign=top | 0-7
| valign=top style="align:left;" | {{anchor|System_Mask}}System Mask
| valign=top | bits 0-5: enable channels 0-5, bit 6: enable all remaining channels,{{#tag:refefn|On a processor that complies with the S/360 architecture, the highest channel number is 6. Eleven bits are sufficient to identify the cuu, and seven bits are sufficient to provide masking of I/O interruptions. However, on a 360/67-2 with two 2846 channel controllers, channels are numbered 0-6 and 8-14;<ref name=GA27-2719/>{{rp|page=15}} similarly, the 360/195 had an extended channel feature<ref name=A22-6943/>{{rp|page=21}} but numbered the channels 0 through 13.<ref name=A22-6943/>{{rp|page=25}} I/O interruptions for Channel Controller 1 on the 360/67-2 were masked using control registers, and the 360/195 used bit 7 (Channel 6) of the System Mask as a summary mask bit for channels 6 and up. ''Interruptions from More than Seven Channels''{{sfn|PoOps|p=121.4}} describes the summary masking for additional channels, but other text in Principles of Operation still refers to a limit of 7 channels. Standard software supported channels 0-F.|group=NB|name=ChanNum}} bit 7: enable External interruptions (timer, interrupt key, and external signal{{sfn|PoOps|page=71}}
|-
| align=center valign=top | 8-11
Line 412:
| align=center valign=top | 12{{anchor|AMWP}}
| valign=top | ASCII mode
| enable ASCII mode for packed decimal instructions, never used by IBM software<ref group=NB>{{efn|Because the design of the S/360 occurred simultaneously with the development of ASCII, IBM's ASCII support did not match the standard that was ultimately adopted.</ref>}}
|-
| align=center valign=top | 13
Line 451:
 
==Interruption system==
The architecture<ref name=A22-6821-7/>{{rp|pages=77–83}} defines 5 classes of [[interrupt]]ion. An interruption is a mechanism for automatically changing the program state; it is used for both synchronous<ref group=NB>{{efn|The S/360 literature does not use the terms fault or [[Trap (computing)|trap]]</ref>}} and [[asynchrony (computing)|asynchronous]] events.
 
{| class="wikitable collapsible"
Line 477:
 
===Program interruption===
A Program interruption<ref name=A22-6821-7/>{{rp|pages=16,79–80.1}} occurs when an instruction encounters one{{#tag:refefn|On the 360/91,<ref name=A22-6907/>{{rp|page=15}} 360/95 and 360/195<ref name=A22-6943/>{{rp|page=14}} a Program interruption may occur for multiple imprecise exceptions. The ILC in the Program Old PSW is 0, bits 26-31 are 0 and bits 16-27 are a mask indicating which exceptions occurred; there is no provision for reporting multiple occurrences of the same exception. Reporting of multiple imprecise exceptions is not part of the S/360 architecture.|group=NB|name=multimpr}} of 15{{#tag:refefn|There are 17 possible exceptions on the 360/67,<ref name=GA27-2719/>{{rp|page=17}} but page exception and segment exception are not part of the S/360 architecture; similarly, interruption code 18 ('0012'X) on a 360/65 multiprocessor is not part of the S/360 architecture.|group=NB|name=NotArchExc}} exceptions; however, if the [[#Program Mask|Program Mask]] bit corresponding to an exception is 0 then there is no interruption for that exception.
On 360/65,<ref name=A22-6884/>{{rp|page=12}} 360/67<ref name=GA27-2719/>{{rp|page=46}} and 360/85<ref name=A22-6916/>{{rp|page=12}} the Protection Exception and Addressing Exception interruptions can be imprecise, in which case they store an Instruction Length Code of 0.
The Interruption code may be any of
Line 491:
| align=right valign=top | 0
|
Imprecise interruption<ref group=NB {{efn|name=multimpr/>}} on 360/91,<ref name=A22-6907/>{{rp|page=15}} 360/95 or 360/195<ref name=A22-6943/>{{rp|page=14}}
{| class="wikitable collapsible collapsed"
|+ {{nowrap|Old PSW bits for multiple imprecise interruption codes}}
Line 505:
|-
| 18
| Specification<ref group=NB>{{efn|The Specification bit is not used for imprecise interruptions on the 360/195</ref>}}
|-
| 19
Line 529:
|-
| 26
| Decimal Overflow<ref group=NB {{efn|name=NoDec>|Not Used on 360/91</ref>}}
|-
| 27
| Decimal Divide<ref group=NB {{efn|name=NoDec/>}}
|}
|-
Line 598:
| align=right | 16
|
Segment Translation<ref name=GA27-2719/>{{rp|page=17}}<ref group=NB {{efn|name=NotArchExc/>}}
|-
| align=right | 11
| align=right | 17
|
Page Translation<ref name=GA27-2719/>{{rp|page=17}}<ref group=NB {{efn|name=NotArchExc/>}}
|-
| align=right | 12
| align=right | 18
|
SSM Exception<ref name=A22-6884/><ref group=NB {{efn|name=NotArchExc/>}}
|}
 
Line 614:
* A '''privileged operation exception'''{{sfn|PoOps|p=79}} is recognized when a program attempts to execute a privileged instruction when the problem state bit in the PSW is 1.
* An '''execute exception'''{{sfn|PoOps|p=79}} is recognized when the operand of an [[Execute instruction|EXECUTE instruction (EX)]] is another EXECUTE instruction.
* A '''protection exception'''{{sfn|PoOps|p=79}} is recognized when a program attempts to store into a ___location whose storage protect key does not match<ref group=NB>{{efn|A PSW key of 0 matches any storage key.</ref>}} the PSW key, or to fetch from a fetch protected ___location whose storage protect key does not match the PSW key.
* An '''addressing exception'''{{sfn|PoOps|pp=79–80}} is recognized when a program attempts to access a storage ___location that is not currently available. This normally occurs with an address beyond the capacity of the machine, but it may also occur on machines that allow blocks of storage to be taken offline.
*A '''specification exception'''{{sfn|PoOps|p=80}} is recognized when an instruction has a length or register field with values not permitted by the operation, or when it has an operand address that does not satisfy the alignment requirements of the opcode, e.g., a LH instruction with an odd operand address on a machine without the byte alignment feature.
Line 631:
 
===External interruption===
An External{{sfn|PoOps|p=81}}<ref group=NB>{{efn|Even though a timer expiration is an internal event, it causes an External interruption and for this reason, this interruption is usually referred to as a timer/external interruption.</ref>}} interruption occurs as the result of certain asynchronous events. Bits 16-24 of the External Old PSW are set to 0 and one or more of bits 24-31 is set to 1
 
{| class="wikitable collapsible"
Line 697:
Conceptually peripheral equipment is attached to a S/360 through ''control units'', which in turn are attached through channels. However, the architecture does not require that control units be physically distinct, and in practice they are sometimes integrated with the devices that they control. Similarly, the architecture does not require the channels to be physically distinct from the processor, and the smaller S/360 models (through 360/50) have integrated channels that [[Cycle stealing|steal cycles]] from the processor.
 
Peripheral devices are addressed with 16-bit<ref group=NB>{{efn|Because of the limits on the channel number, S/360 and early S/370 software only used 12 bits to store device addresses.</ref>}} addresses.,<ref name=A22-6821-7/>{{rp|page=89}} referred to as ''cua'' or ''cuu''; this article will use the term ''cuu''. The high 8 bits identify a channel, numbered from 0 to 6,<ref group=NB {{efn|name=ChanNum/>}} while the low 8 bits identify a device on that channel. A device may have multiple ''cuu'' addresses.
 
Control units are assigned an address "capture" range. For example, a CU might be assigned range 20-2F or 40-7F. The purpose of this is to assist with the connection and prioritization of multiple control units to a channel. For example, a channel might have three disk control units at 20-2F, 50-5F, and 80-8F. Not all of the captured addresses need to have an assigned physical device. Each control unit is also marked as High or Low priority on the channel.
Line 706:
* initializing the '''CAW''' with the storage key and the address of the first CCW
* issuing a ''Start I/O'' ('''SIO''') instruction that specifies the ''cuu'' for the operation
* waiting<ref group=NB>{{efn|But continuing with unrelated work.</ref>}} for an I/O interruption
* handling any unusual conditions indicated in the ''Channel Status Word'' ('''CSW''')
 
Line 735:
These conditions are presented to the channel by the control unit or device.{{sfn|PoOps|pp=113–116}} In some cases they are handled by the channel and in other cases they are indicated in the [[#Channel Status Word|CSW]]. There is no distinction between conditions detected by the control unit and conditions detected by the device.
 
* {{Anchor|Attention}}'''[[#CSW_Attention|Attention]]'''{{sfn|PoOps|p=113}} indicates an unusual condition not associated with an ongoing channel program. It often indicates some sort of operator action like requesting input, in which case the CPU would respond by issuing a read-type command, most often a sense command (04h) from which additional information could be deduced. Attention is a special condition, and requires specific operating system support, and for which the operating system has a special attention table<ref group=NB>{{efn|The OS uses the attention index in a [[Unit Control Block]] (UCB) as an index into the attention table.</ref>}} with a necessarily limited number of entries.
* {{Anchor|Status modifier|SM}}'''[[#CSW_Status_modifier|Status modifier]]'''{{sfn|PoOps|pp=113–114}} (SM) indicates one of three unusual conditions
** A Test I/O instruction was issued to a device that does not support it.
Line 828:
|-
| align=right valign=top | 34
| valign=top | {{anchor|CCW-SLI}}SLI<ref group=NB>{{efn|Also known as Suppress Incorrect Length Indication (SILI)</ref>}}
| valign=top | {{anchor|CCW-SuppressLengthindication}}Suppress-Length-Indication
| Continue channel program after count mis-match.{{sfn|PoOps|pp=99–100}}
Line 971:
* '''{{anchor|Initial_Program_Load}}Initial Program Load''' (IPL){{sfn|PoOps|p=123}} is a process for loading a program when there isn't a loader available in storage, usually because the machine was just powered on or to load an alternative operating system.<ref name=A22-6821-7/>{{rp|page=123}} This process is sometimes known as [[Booting]].
 
:: As part of the IPL facility the operator has a means of specifying a 12-bit<ref group=NB {{efn|name=ChanNum/>}} device address, typically with three dials as shown in the operator controls drawing. When the operator<ref group=NB>{{efn|Or an equivalent automated facility.</ref>}} selects the ''Load'' function, the system performs a ''System Reset'', sends a Read IPL<ref group=NB>{{efn|Read with all modifier bits zero</ref>}} channel command to the selected device in order to read 24 bytes into locations 0-23 and causes the channel to begin fetching ''CCW''s at ___location 8; the effect is as if the channel had fetched a CCW with a length of 24, and address of 0 and the flags containing Command Chaining + Suppress Length Indication. At the completion of the operation, the system stores the I/O address in the halfword at ___location 2 and loads the PSW from ___location 0.
 
:: Initial program loading is typically done from a tape, a card reader, or a disk drive. Generally, the operating system was loaded from a disk drive; IPL from tape or cards was used only for diagnostics or for installing an operating system on a new computer.
Line 1,046:
 
==Notes==
{{Reflist|group=NB}}
{{notelist}}