    <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
     <channel>
        <title>ACCU  :: The Wall</title>
        <link>https://members.accu.org/index.php/journals/1026</link>
        <description>Professionalism in Programming</description>
        <dc:language>en-us</dc:language> 
        <dc:creator>Administrator</dc:creator> 
        <admin:generatorAgent rdf:resource="http://www.xaraya.org" /> 
        <admin:errorReportsTo rdf:resource="mailto:webeditor@accu.org" />
       <sy:updatePeriod>hourly</sy:updatePeriod>
       <sy:updateFrequency>1</sy:updateFrequency>
       <docs>http://backend.userland.com/rss</docs>


        <h2>Journal Articles</h2>


<div class="xar-mod-head"><span class="xar-mod-title">CVu Journal Vol 12, #4 - Jul 2000 + Letters to the Editor</span></div>

<table border="0" cellpadding="1" cellspacing="0">
    <tbody>
    <tr>
        <td valign="top">
            Browse in :
       </td>
       <td valign="top">

                                            <a href="https://members.accu.org/index.php/journals/">All</a>

                     &gt;                         <a href="https://members.accu.org/index.php/journals/c76/">Journals</a>

                     &gt;                         <a href="https://members.accu.org/index.php/journals/c77/">CVu</a>

                     &gt;                         <a href="https://members.accu.org/index.php/journals/c125/">124</a>
                    (22)
<br />

                                            <a href="https://members.accu.org/index.php/journals/">All</a>

                     &gt;                         <a href="https://members.accu.org/index.php/journals/c184/">Journal Columns</a>

                     &gt;                         <a href="https://members.accu.org/index.php/journals/c186/">LettersEditor</a>
                    (132)
<br />

                                            <a href="https://members.accu.org/index.php/journals/c125-186/">Any of these categories</a>

                    -                        <a href="https://members.accu.org/index.php/journals/c125+186/">All of these categories</a>
<br />
</td>
   </tr>
   </tbody>
</table>




<div class="xar-error">
   <p>
 <strong>Note:</strong> when you create a new publication type,
the articles module will automatically use the templates
<em>user-display-[publicationtype].xt</em>
and <em>user-summary-[publicationtype].xt</em>.
If those templates do not exist when you try to preview or display a new article,
you'll get this warning :-)  Please place your own templates in themes/<em>yourtheme</em>/modules/articles . The templates will get the extension .xt there. </p>
</div>
<div class="xar-norm xar-standard-box-padding">
   <h1><strong>Title:</strong>&nbsp;The Wall</h1>
<p><strong>Author:</strong>&nbsp;</p>
<p>
<strong>Date:</strong> 08 July 2000 13:15:38 +01:00 or Sat, 08 July 2000 13:15:38 +01:00</p>
<p><strong>Summary:</strong>&nbsp;</p>
<p><strong>Body:</strong>&nbsp;<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e22" id="d0e22"></a>Errata</h2>
</div>
<p>Dear Colin,</p>
<p>Thank you for copying me into your e-mail to Francis. I've just
looked at the code and realised that there was an error in the
algorithm which will be provoked by the EBCDIC character set, but
is also susceptible to other character selections.</p>
<p>The line</p>
<pre class="programlisting">
map[*these &gt;&gt; 5] |= (1 &lt;&lt; (*these &amp; 7));
</pre>
<p>should be replaced with</p>
<pre class="programlisting">
map[*these &gt;&gt; 3] |= (1 &lt;&lt; (*these &amp; 7));
</pre>
<p>and</p>
<pre class="programlisting">
map[*src &gt;&gt; 5] &amp; (1 &lt;&lt; (*src &amp; 7)) src++;
</pre>
<p>should be replaced with</p>
<pre class="programlisting">
map[*src &gt;&gt; 3] &amp; (1 &lt;&lt; (*src &amp; 7)) src++;
</pre>
<p>I believe this should fix the problems you have seen. My thanks
for your feedback.</p>
<p>Catriona O'Connell</p>
<p>Dear Paul,</p>
<p>Oh dear. I am now very confused. I checked the published code
and it is correct. I was looking at a previous version of the code
on another server (dark mutterings about version control inserted
here...). As far as I can tell the algorithm maps each value of a
char to a unique bit in the array of 32 bytes. Unfortunately I do
not have a C compiler on the mainframes I have available to me, so
I cannot reproduce your results. It would be useful if you could
produce some diagnostics - for example a dump of which bits are set
by a selection of characters.</p>
<p>Catriona O'Connell</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e59" id="d0e59"></a>And a
response</h2>
</div>
<p>Dear Catriona,</p>
<p>Just sent you an email and shortly thereafter saw you sent me
another one earlier today before I replied. That you don't have
access to a compiler on a machine which uses EBCDIC shouldn't
really matter: a text file is attached (its contents replicated
below your email) which lists the codes in EBCDIC for characters
common to EBCDIC and (strict seven bit) ASCII. There are one
hundred and twenty nine lines (excluding extra blank lines at the
end): the first contains a C comment and the rest just a code and a
newline character. They are ordered in ASCII numbering, so the last
code is the last character in ASCII expressed in its EBCDIC code
etc. I am not going to be very reachable by email for a few
weeks.</p>
<p>Colin Paul Gloster <tt class="email">&lt;<a href=
"mailto:colin_paul_gloster@ACM.org">colin_paul_gloster@ACM.org</a>&gt;</tt></p>
<p class="c3"><span class="remark">For obvious reasons I am not
going to publish 128 single character lines, but the following (top
of next column) is Paul's list of EBCDIC codes (in hex) equivalent
to the ASCII 7-bit coding. FG.</span></p>
<p class="c3"><span class="remark">/*ASCII from zero to 127 in
EBCDIC*/</span></p>
<pre class="literallayout c4">
<span class=
"remark">00 01 02 03 37 2D 2E 2F 16 05 25 0B 0C 0D 0E 0F 
10 11 12 13 3C 3D 32 26 18 19 3F 27 1C 1D 1E 1F 
40 4F 7F 7B 5B 6C 50 7D 4D 5D 5C 4E 6B 60 4B 61 
F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 7A 5E 4C 7E 6E 6F 
7C C1 C2 C3 C4 C5 C6 C7 C8 C9 D1 D2 D3 D4 D5 D6 
D7 D8 D9 E2 E3 E4 E5 E6 E7 E8 E9 4A E0 5A 5F 6D 
79 81 82 83 84 85 86 87 88 89 91 92 93 94 95 96 
97 98 99 A2 A3 A4 A5 A6 A7 A8 A9 C0 6A D0 A1 07</span>
</pre></div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e79" id="d0e79"></a>Days Later</h2>
</div>
<p>Dear Paul and Francis,</p>
<p>I have a suspicion that the effect we are seeing with <tt class=
"function">eliminate()</tt> is a result of a char to int
conversion. When a char is converted to an int, the standard does
not specify if type char is signed or unsigned, so it may be
possible to create what looks like a negative integer as a bit
pattern.</p>
<p>However according to K+R p44, &quot; the standard requires that any
character in the machines standard printing character set will
never be negative&quot;, but the goes on to say &quot;But arbitrary bit
patterns stored in character variables may appear to be negative on
some machines, yet positive on others&quot;.</p>
<p>A right-shift of an unsigned quantity always fills vacated bits
with zero, whereas right-shifting a signed quantity will fill with
sign bits. Given that all the alphameric characters in EBCDIC have
the highest value bit set, this may be being interpreted as a sign
bit. If this is the case, I would expect to see storage beyond the
map[32] array being accessed - giving rise to the spurious effects
you reported. The offset is quite small, so it probably falls
either in the program storage or within a 4K page allocated by the
program (hence no Abend 0C4).</p>
<p>The following code changes should resolve the problem:</p>
<pre class="programlisting">
map[*these &gt;&gt; 3] |= (1 &lt;&lt; (*these &amp; 7));
</pre>
<p>becomes</p>
<pre class="programlisting">
map[(*these &gt;&gt; 3) &amp; ~(~0 &lt;&lt; 5)] |= 
                    (1 &lt;&lt; (*these &amp; 7));
</pre>
<p>and</p>
<pre class="programlisting">
if (map[*src &gt;&gt; 3 ] &amp; (1 &lt;&lt; (*src &amp; 7)))
</pre>
<p>becomes</p>
<pre class="programlisting">
if (map[(*src &gt;&gt; 3) &amp; ~(~0 &lt;&lt; 5) ] &amp; 
                     (1 &lt;&lt; (*src &amp; 7)))
</pre>
<p>Could you let me know if this resolves the problem?</p>
<p>Catriona O'Connell</p>
<p class="c3"><span class="remark">And that is as far as the story
goes. On a system where the normal character set includes 8-bit
codes with the high bit set, char must be either unsigned or more
than 8bits. However, there will be a problem if you write code and
compile it for an ASCII system and then read an EBCDIC coded file.
FG.</span></p>
</div>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
