{"id":183,"date":"2013-02-11T08:51:00","date_gmt":"2013-02-11T14:51:00","guid":{"rendered":"http:\/\/tommysprinkle.com\/mvssp\/?p=183"},"modified":"2013-06-21T10:05:39","modified_gmt":"2013-06-21T15:05:39","slug":"reading-count-key-and-data","status":"publish","type":"post","link":"https:\/\/tommysprinkle.com\/mvssp\/2013\/02\/11\/reading-count-key-and-data\/","title":{"rendered":"Reading Count, Key and Data"},"content":{"rendered":"<h2>Read Count<\/h2>\n<p>Now we will take a quick look at some of the other read commands.\u00a0 First is the Read Count (X&#8217;12&#8217;) which reads the 8-byte count area (CCHHRKDL).\u00a0 CCHHR is the 5-byte cylinder, head, record address of the record, K is the one-btye key length, and DL is the 2-byte record data length.\u00a0 If we repace the X&#8217;06&#8217; Read Data with X&#8217;12&#8217; Read Count we get the following results.<\/p>\n<pre>I\/O REQUEST                                                          \r\n   COMPLETION CODE = 7F                                              \r\n   CSW = 095B10 DEV STAT = 0C CHAN STAT = 00 RESIDUAL = 7FF8 (32,760)\r\n   --- DEVICE STATUS  = CE DE                                        \r\n   --- CHANNEL STATUS =                                              \r\n   SENSE = 0000                                                      \r\n   SEEK = 00000000D5000001                                           \r\n   BYTES READ = 0008 (     8)                                        \r\n\r\n----- READ COUNT -----                                               \r\n0000 <span style=\"color: #ff0000;\">00D50000 02080100<\/span><\/pre>\n<p>We have dumped the contents of the contents of I\/O buffer containing the count area just read.\u00a0 CCHHR = 00D5000002 KL = 08 DL = 0100.\u00a0 The first thing to note is our Seek Address was for record one but we read the count area for record two.\u00a0 This is because the count area for record one has already passed the r\/w heads (during the Search Command) so the next count area available to be read is for record 2.\u00a0 We also see that the data block is 256 bytes long with an 8-byte key (you may recognize this as the format for a PDS directory block).<\/p>\n<h2>Read Key and Data<\/h2>\n<p>Next we will issue a Read Key and Data (X&#8217;0E&#8217;).\u00a0 Here are the results.<\/p>\n<pre>I\/O REQUEST                                                          \r\n   COMPLETION CODE = 7F                                              \r\n   CSW = 095B10 DEV STAT = 0C CHAN STAT = 00 RESIDUAL = 7EF8 (32,504)\r\n   --- DEVICE STATUS  = CE DE                                        \r\n   --- CHANNEL STATUS =                                              \r\n   SENSE = 0000                                                      \r\n   SEEK = 00000000D5000001                                           \r\n   BYTES READ = 0108 (   264)                                        \r\n\r\n----- READ KEY AND DATA -----                                        \r\n0000 <span style=\"color: #008000;\">C1C8D3E6 E6D9C9E3<\/span> 00FEC1C3 C3D6E4D5  E34000FA 1B2C00FA 21000000 0000C2E2\r\n0020 00105810 58000000 88000001 0000C1C8  D3C3E6D9 C9E300A2 042C00A2 0A000000\r\n0040 000002E2 0020A820 A8000000 88000001  0100C1C8 D3C7E3C6 4040009F 042C00A0\r\n0060 01000000 000002E2 005AC043 38000000  88000001 0100C1C8 D3C9E6D9 C9E300A1\r\n0080 172C00A2 01000000 000002E2 001A681A  68000000 88000001 0100C1C8 D3E3D4D6\r\n00A0 D54000A1 0E2C00A1 14000000 000002E2  000A380A 38000000 88000001 0100C1C8\r\n00C0 D3E6E3C1 E2D200A1 052C00A1 0B000000  000002E2 000C400C 40000000 88000001\r\n00E0 0100C1C8 D3E6E6D9 C9E300A2 0D2C00A3  05000000 000002E2 00222022 20000000\r\n0100 88000001 01000000<\/pre>\n<p>Here we read 264 bytes ( 8 bytes of Key + 256 bytes of Data).\u00a0 It is our responsibility to know how many bytes are for the key and how many for the data.<\/p>\n<h2>Read Count, Key and Data<\/h2>\n<p>Now for the Read Count, Key and Data (X&#8217;1E&#8217;).\u00a0 Here are the results.<\/p>\n<pre>I\/O REQUEST\r\n   COMPLETION CODE = 7F\r\n   CSW = 095B10 DEV STAT = 0C CHAN STAT = 00 RESIDUAL = 7EF0 (32,496)\r\n   --- DEVICE STATUS  = CE DE\r\n   --- CHANNEL STATUS =\r\n   SENSE = 0000\r\n   SEEK = 00000000D5000001\r\n   BYTES READ = 0110 (   272)\r\n----- READ COUNT KEY AND DATA -----\r\n0000 <span style=\"color: #ff0000;\">00D50000 02080100<\/span> <span style=\"color: #008000;\">C1D4C4D7 D9C3E5E3<\/span>  00EEC1D4 C1D7E3C6 D3C50009 082E0009\r\n0020 0D000000 000002E2 00212018 00000000  98000000 31970585 0100C1D4 C1D7E3C6\r\n0040 F0F10009 122E000A 01000000 000002E2  000E680E 68000000 98000000 31970593\r\n0060 0100C1D4 C1D7E3C6 F0F2000A 042E000A  09000000 000002E2 00020002 00000000\r\n0080 98000000 31991261 0100C1D4 C1E2D7E9  C1D7000E 082E000F 01000000 000002E2\r\n00A0 00357814 90000000 98000000 01960105  0101C1D4 C2D3C9E2 E34000CD 032C00CE\r\n00C0 01000000 0000C2E2 00952043 B0000000  88000001 0000C1D4 C4D7D9C3 E5E30010\r\n00E0 152E0010 1B000000 000002E2 0012000D  20000000 98000000 82150403 01000000\r\n0100 00000000 00000000 00000000 00000000<\/pre>\n<p>Thsi time we read 272 bytes (8 bytes of count, 8 bytes of\u00a0 key, and 256 bytes of data).\u00a0 Also note that just like Read Count, the Read Count Key and Data command returned the next record following the record located with our Search Command.<\/p>\n<h2>Read Multiple Count Key and Data<\/h2>\n<p>This is a favorite or mine.\u00a0 The Read Multiple Count Key and Data command can be used to read an entire track without knowing in advance the size or number of records on the track.\u00a0 Because this is a Read Count type of command we need to Search to Record Zero.<\/p>\n<pre>I\/O REQUEST                                                          \r\n   COMPLETION CODE = 7F                                              \r\n   CSW = 095B10 DEV STAT = 0C CHAN STAT = 00 RESIDUAL = 3FE0 (16,352)\r\n   --- DEVICE STATUS  = CE DE                                        \r\n   --- CHANNEL STATUS =                                              \r\n   SENSE = 0000                                                      \r\n   SEEK = 00000001AE000000                                           \r\n   BYTES READ = 4020 (16,416)                                        \r\n\r\n----- READ MULTIPLE COUNT KEY AND DATA -----\r\n0000 <span style=\"color: #ff0000;\">01AE0000 01001000<\/span> C1C2C3C4 C5C6C7C8  00000000 00000000 00000000 00000000\r\n0020 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000\r\n              LINES 00096040-00096FE0 SAME AS ABOVE                          \r\n1000 00000000 00000000 <span style=\"color: #ff0000;\">01AE0000 02001000<\/span>  40C2C3C4 C5C6C7C8 00000000 00000000\r\n1020 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000\r\n              LINES 00097040-00097FE0 SAME AS ABOVE                          \r\n2000 00000000 00000000 00000000 00000000  <span style=\"color: #ff0000;\">01AE0000 03001000<\/span> 4040C3C4 C5C6C7C8\r\n2020 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000\r\n              LINES 00098040-00098FE0 SAME AS ABOVE                          \r\n3000 00000000 00000000 00000000 00000000  00000000 00000000 <span style=\"color: #ff0000;\">01AE0000 04001000<\/span>\r\n3020 404040C4 C5C6C7C8 00000000 00000000  00000000 00000000 00000000 00000000\r\n3040 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000\r\n              LINES 00099060-00099FE0 SAME AS ABOVE                          \r\n4000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000<\/pre>\n<p>Here I am reading a track containing four 4K blocks.\u00a0 We see the buffer begins with the count area for record 1.\u00a0 The key (if any) begins immediately following the count.\u00a0 The data begins immediately following the key.\u00a0 We determine the start of the next record by adding the Count length (8) to the Key length and the Data length.\u00a0 Record 1 begins at offset 0.\u00a0 It has no key and the data is 4096 (X&#8217;1000&#8242;) bytes.\u00a0 Record 2 should then start at offset X&#8217;1008&#8242;.<\/p>\n<p>This is a great way to read an entire track when the blocks are not all the same size and we don&#8217;t know how many blocks are on the track.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Read Count Now we will take a quick look at some of the other read commands.\u00a0 First is the Read Count (X&#8217;12&#8217;) which reads the 8-byte count area (CCHHRKDL).\u00a0 CCHHR is the 5-byte cylinder, head, record address of the record, K is the one-btye key length, and DL is the 2-byte record data length.\u00a0 If &#8230;<\/p>\n<p><a href=\"https:\/\/tommysprinkle.com\/mvssp\/2013\/02\/11\/reading-count-key-and-data\/\" class=\"more-link\">Continue reading &lsquo;Reading Count, Key and Data&rsquo; &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","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":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[33],"tags":[],"class_list":["post-183","post","type-post","status-publish","format-standard","hentry","category-reading-count-key-and-data"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3x7AW-2X","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tommysprinkle.com\/mvssp\/wp-json\/wp\/v2\/posts\/183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tommysprinkle.com\/mvssp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tommysprinkle.com\/mvssp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tommysprinkle.com\/mvssp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tommysprinkle.com\/mvssp\/wp-json\/wp\/v2\/comments?post=183"}],"version-history":[{"count":6,"href":"https:\/\/tommysprinkle.com\/mvssp\/wp-json\/wp\/v2\/posts\/183\/revisions"}],"predecessor-version":[{"id":194,"href":"https:\/\/tommysprinkle.com\/mvssp\/wp-json\/wp\/v2\/posts\/183\/revisions\/194"}],"wp:attachment":[{"href":"https:\/\/tommysprinkle.com\/mvssp\/wp-json\/wp\/v2\/media?parent=183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tommysprinkle.com\/mvssp\/wp-json\/wp\/v2\/categories?post=183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tommysprinkle.com\/mvssp\/wp-json\/wp\/v2\/tags?post=183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}