{"id":34,"date":"2011-06-13T10:22:49","date_gmt":"2011-06-13T15:22:49","guid":{"rendered":"http:\/\/tommysprinkle.com\/txxos\/?p=34"},"modified":"2021-04-17T18:32:24","modified_gmt":"2021-04-17T23:32:24","slug":"program-status-word","status":"publish","type":"post","link":"https:\/\/tommysprinkle.com\/txxos\/?p=34","title":{"rendered":"Program Status Word"},"content":{"rendered":"<p>The Program Status Word (PSW) contains information about the current execution state of the processor. \u00a0Certain actions cause the complete PSW to be stored or loaded. \u00a0Others operate on only a portion of the PSW.<\/p>\n<p>The Load PSW instruction (LPSW) will load a new value into the PSW and replace the old contents. \u00a0Interrupts cause the current PSW contents to be stored at a specific location and a new PSW to be loaded. \u00a0The locations for storing the old PSW and fetching the new PSW are defined in low storage with the actual address depending on the specific interrupt.<\/p>\n<p>In 370 mode there are two different forms of the PSW &#8211; Basic Control (BC) and Extended Control (EC). \u00a0The BC PSW is essentially the same format as initially introduced on the System 360. \u00a0When bit 12 of the PSW is zero the PSW is in BC mode. \u00a0For now we will only concern ourselves with the BC PSW.<\/p>\n<p>The BC PSW consists of 64 bits (8 bytes or 2 words) with the following layout:<\/p>\n<pre>Bits 0-5        Channel Masks 0-5<\/pre>\n<pre>Bit  6          Input\/Output Mask (IO)<\/pre>\n<pre>Bit  7          External Mask (E)<\/pre>\n<pre>Bits 8-11       Protection Key<\/pre>\n<pre>Bit  12         BC\/EC Control<\/pre>\n<pre>Bit  13         Machine Check Mask (M)<\/pre>\n<pre>Bit  14         Wait State (W)<\/pre>\n<pre>Bit  15         Problem State (P)<\/pre>\n<pre>Bits 16-31      Interruption Code<\/pre>\n<pre>Bits 32-33      Instruction Length Code (ILC)<\/pre>\n<pre>Bits 34-35      Condition Code (CC)<\/pre>\n<pre>Bits 36-39      Program Mask<\/pre>\n<pre>Bits 40-63      Instruction Address<\/pre>\n<p><strong>Channel Masks 0-5 <\/strong>(Bits 0-5) Control whether the CPU \u00a0is enabled for I\/O interruptions from channels 0-5. \u00a0When the bit is zero the corresponding channel cannot cause an I\/O interruption. \u00a0When the bit is one an interruption can occur.<\/p>\n<p><strong>Input\/Output Mask (IO) <\/strong>(Bit 6) Controls\u00a0whether\u00a0the CPU is enabled for I\/O interruptions from channels 6 and higher. \u00a0When the bit is zero these channels cannot cause an I\/O interruption. \u00a0When the bit is one interruptions may occur if the channel interruption is enabled in control register (CR) 2. \u00a0Setting the I\/O mask bit in the PSW to zero has the same effect as setting all the bits in CR 2 to zero. \u00a0Initially CR 2 contains a value of one in all bits therefore enabling all\u00a0interrupts\u00a0on channels 6 and higher when the IO Mask bit is set to one.<\/p>\n<p><strong>External Mask (E)<\/strong> (Bit 7) Controls whether the CPU is enabled for external interruptions. \u00a0When set to one interruptions are enabled.<\/p>\n<p><strong>Protection Key<\/strong> (Bits 8-11) The protection key is compared to the page storage key when storing to memory or when fetching and the page is protected against fetching. \u00a0A PSW protection key of zero can access any page.<\/p>\n<p><strong>Extended Control Mode<\/strong> (Bit 12) Indicates the format of the PSW and the mode of operation of the CPU. \u00a0For Basic Control (BC) the bit is set to zero, for Extended Control (EC) the bit is set to one.<\/p>\n<p><strong>Machine Check Mask (M)<\/strong> (Bit 13) Controls whether the CPU is enabled for machine check interruptions. \u00a0When set to one interruptions are enabled.<\/p>\n<p><strong>Wait State (W)<\/strong> (Bit 14) When the Wait bit is set to one the CPU is in the wait state and no instructions are executed. \u00a0When set to zero it is in running state.<\/p>\n<p><strong>Problem State (P)<\/strong> (Bit 15) When set to one the CPU is in problem state and any attempt to execute a\u00a0privileged\u00a0instruction will fail. \u00a0When set to zero the CPU is in supervisor state.<\/p>\n<p><strong>Interruption Code<\/strong> (Bits 16-31) When an old PSW is stored as a result of a program, supervisor call, external or I\/O interruption these bits identify the cause of the interruption. \u00a0These bits are ignored when a new PSW is loaded.<\/p>\n<p><strong>Instruction Length Code (ILC) <\/strong>(Bits 32-33) Indicates the length of the last executed instruction when a program or supervisor call interruption occurs or when a Branch And Link is executed. \u00a0The contents of these bits are ignored when a new PSW is loaded.<\/p>\n<p><strong>Condition\u00a0Code (CC) <\/strong>(Bits 34-35) Condition code.<\/p>\n<p><strong>Program Mask<\/strong> (Bits 36-39) Each bit is associated with a program\u00a0exception\u00a0interruption. When the bit is zero an interruption will not occur. \u00a0Bit 36: Fixed-point overflow. Bit 37: Decimal overflow. Bit 38: Exponent underflow. Bit 39: Significance.<\/p>\n<p><strong>Instruction Address<\/strong> (Bits 40-63) Contains the address of the next instruction to be executed.<\/p>\n<p><a title=\"Interruptions\" href=\"http:\/\/tommysprinkle.com\/txxos\/?p=37\">[ Next &#8211; Interruptions ]<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Program Status Word (PSW) contains information about the current execution state of the processor. \u00a0Certain actions cause the complete PSW to be stored or loaded. \u00a0Others operate on only a portion of the PSW. The Load PSW instruction (LPSW) &hellip; <a href=\"https:\/\/tommysprinkle.com\/txxos\/?p=34\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"template-page-builder-no-sidebar.php","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-34","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1CPQT-y","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/posts\/34","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=34"}],"version-history":[{"count":6,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/posts\/34\/revisions"}],"predecessor-version":[{"id":36,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/posts\/34\/revisions\/36"}],"wp:attachment":[{"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=34"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=34"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=34"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}