<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    oops forgot to fill in the Top of stack pointer in the table :-(<br>
    <br>
    On 21/04/2011 2:45 PM, Mike Brookes wrote:
    <blockquote cite="mid:4DAFB66B.4070900@tpg.com.au" type="cite">
      <meta content="text/html; charset=windows-1252"
        http-equiv="Content-Type">
      <title></title>
      Hi Mark et Al<br>
      <br>
      For the question to make sense one has to make the assumption that
      the stack positions start at the bottom with position zero and go
      up to position 4 which is the top of the stack. At the start the
      bottom two (in bold on the PDF) are valid, hence the top of stack
      pointer showing 1. <br>
      <br>
      Below is the completed table and the stack at the start and after
      each step:<br>
      <table width="817" border="0" cellpadding="0" cellspacing="0">
        <col style="width: 26pt;" width="35"> <col style="width: 68pt;"
          width="91"> <col style="width: 23pt;" width="30"> <col
          style="width: 93pt;" width="124"> <col style="width: 22pt;"
          width="29"> <col style="width: 23pt;" width="30" span="2"> <col
          style="width: 48pt;" width="64" span="7"> <tbody>
          <tr style="height: 15.75pt;" height="21">
            <td style="height: 15.75pt; width: 26pt;" width="35"
              height="21"><br>
            </td>
            <td style="width: 68pt;" width="91"><br>
            </td>
            <td class="xl63" style="width: 23pt;" width="30"><br>
            </td>
            <td style="width: 93pt;" width="124"><br>
            </td>
            <td style="width: 22pt;" width="29"><br>
            </td>
            <td style="width: 23pt;" width="30"><br>
            </td>
            <td style="width: 23pt;" width="30"><br>
            </td>
            <td style="width: 48pt;" width="64"><br>
            </td>
            <td style="width: 48pt;" width="64"><br>
            </td>
            <td style="width: 48pt;" width="64"><br>
            </td>
            <td style="width: 48pt;" width="64"><br>
            </td>
            <td style="width: 48pt;" width="64"><br>
            </td>
            <td style="width: 48pt;" width="64"><br>
            </td>
            <td style="width: 48pt;" width="64"><br>
            </td>
          </tr>
          <tr style="height: 15.75pt;" height="21">
            <td style="height: 15.75pt;" height="21"><br>
            </td>
            <td><br>
            </td>
            <td class="xl63"><br>
            </td>
            <td><br>
            </td>
            <td><br>
            </td>
            <td><br>
            </td>
            <td><br>
            </td>
            <td colspan="7" class="xl80" style="border-right: 1pt solid
              black;">Stack at start and after each step</td>
          </tr>
          <tr style="height: 15.75pt;" height="21">
            <td class="xl64" style="height: 15.75pt;" height="21">Step</td>
            <td class="xl65" style="border-left: medium none;">Function</td>
            <td class="xl66" style="border-left: medium none;">Top</td>
            <td class="xl67" style="border-left: medium none;">Output</td>
            <td><br>
            </td>
            <td><br>
            </td>
            <td><br>
            </td>
            <td class="xl64" style="border-top: medium none;">Start</td>
            <td class="xl65" style="border-top: medium none;
              border-left: medium none;">Step 1</td>
            <td class="xl65" style="border-top: medium none;
              border-left: medium none;">Step 2</td>
            <td class="xl65" style="border-top: medium none;
              border-left: medium none;">Step 3</td>
            <td class="xl65" style="border-top: medium none;
              border-left: medium none;">Step 4</td>
            <td class="xl65" style="border-top: medium none;
              border-left: medium none;">Step 5</td>
            <td class="xl67" style="border-top: medium none;
              border-left: medium none;">Step 6</td>
          </tr>
          <tr style="height: 15pt;" height="20">
            <td class="xl68" style="height: 15pt; border-top: medium
              none;" height="20">1</td>
            <td class="xl69" style="border-top: medium none;
              border-left: medium none;">Push (23)</td>
            <td class="xl70" style="border-top: medium none;
              border-left: medium none;">2</td>
            <td class="xl71" style="border-top: medium none;
              border-left: medium none;">Item added (23)</td>
            <td><br>
            </td>
            <td rowspan="5" class="xl92" style="border-bottom: 1pt solid
              black;">Stack position</td>
            <td class="xl71" style="border-left: medium none;"
              align="right">4</td>
            <td class="xl82" style="border-top: medium none;
              border-left: medium none;" align="right">92</td>
            <td class="xl69" style="border-top: medium none;
              border-left: medium none;" align="right">92</td>
            <td class="xl69" style="border-top: medium none;
              border-left: medium none;" align="right">92</td>
            <td class="xl69" style="border-top: medium none;
              border-left: medium none;" align="right">92</td>
            <td class="xl69" style="border-top: medium none;
              border-left: medium none;" align="right">92</td>
            <td class="xl83" style="border-top: medium none;
              border-left: medium none;" align="right">92</td>
            <td class="xl84" style="border-top: medium none;
              border-left: medium none;" align="right">92</td>
          </tr>
          <tr style="height: 15pt;" height="20">
            <td class="xl72" style="height: 15pt; border-top: medium
              none;" height="20">2</td>
            <td class="xl73" style="border-top: medium none;
              border-left: medium none;">Push (18)</td>
            <td class="xl74" style="border-top: medium none;
              border-left: medium none;"> 3</td>
            <td class="xl75" style="border-top: medium none;
              border-left: medium none;">Item added (18)</td>
            <td><br>
            </td>
            <td class="xl75" style="border-top: medium none;
              border-left: medium none;" align="right">3</td>
            <td class="xl85" style="border-top: medium none;
              border-left: medium none;" align="right">75</td>
            <td class="xl73" style="border-top: medium none;
              border-left: medium none;" align="right">75</td>
            <td class="xl86" style="border-top: medium none;
              border-left: medium none;" align="right">18</td>
            <td class="xl73" style="border-top: medium none;
              border-left: medium none;" align="right">18</td>
            <td class="xl86" style="border-top: medium none;
              border-left: medium none;" align="right">75</td>
            <td class="xl86" style="border-top: medium none;
              border-left: medium none;" align="right">75</td>
            <td class="xl87" style="border-top: medium none;
              border-left: medium none;" align="right">75</td>
          </tr>
          <tr style="height: 15pt;" height="20">
            <td class="xl72" style="height: 15pt; border-top: medium
              none;" height="20">3</td>
            <td class="xl73" style="border-top: medium none;
              border-left: medium none;">Pop</td>
            <td class="xl74" style="border-top: medium none;
              border-left: medium none;">2</td>
            <td class="xl75" style="border-top: medium none;
              border-left: medium none;">Item removed (18)</td>
            <td><br>
            </td>
            <td class="xl75" style="border-top: medium none;
              border-left: medium none;" align="right">2</td>
            <td class="xl85" style="border-top: medium none;
              border-left: medium none;" align="right">23</td>
            <td class="xl86" style="border-top: medium none;
              border-left: medium none;" align="right">23</td>
            <td class="xl86" style="border-top: medium none;
              border-left: medium none;" align="right">23</td>
            <td class="xl86" style="border-top: medium none;
              border-left: medium none;" align="right">23</td>
            <td class="xl86" style="border-top: medium none;
              border-left: medium none;" align="right">23</td>
            <td class="xl86" style="border-top: medium none;
              border-left: medium none;" align="right">23</td>
            <td class="xl87" style="border-top: medium none;
              border-left: medium none;" align="right">23</td>
          </tr>
          <tr style="height: 15pt;" height="20">
            <td class="xl72" style="height: 15pt; border-top: medium
              none;" height="20">4</td>
            <td class="xl73" style="border-top: medium none;
              border-left: medium none;">Push (75)</td>
            <td class="xl74" style="border-top: medium none;
              border-left: medium none;"> 3</td>
            <td class="xl75" style="border-top: medium none;
              border-left: medium none;">Item added (75)</td>
            <td><br>
            </td>
            <td class="xl75" style="border-top: medium none;
              border-left: medium none;" align="right">1</td>
            <td class="xl88" style="border-top: medium none;
              border-left: medium none;" align="right">83</td>
            <td class="xl86" style="border-top: medium none;
              border-left: medium none;" align="right">83</td>
            <td class="xl86" style="border-top: medium none;
              border-left: medium none;" align="right">83</td>
            <td class="xl86" style="border-top: medium none;
              border-left: medium none;" align="right">83</td>
            <td class="xl86" style="border-top: medium none;
              border-left: medium none;" align="right">83</td>
            <td class="xl86" style="border-top: medium none;
              border-left: medium none;" align="right">83</td>
            <td class="xl87" style="border-top: medium none;
              border-left: medium none;" align="right">83</td>
          </tr>
          <tr style="height: 15.75pt;" height="21">
            <td class="xl72" style="height: 15.75pt; border-top: medium
              none;" height="21">5</td>
            <td class="xl73" style="border-top: medium none;
              border-left: medium none;">Push (92)</td>
            <td class="xl74" style="border-top: medium none;
              border-left: medium none;">4</td>
            <td class="xl75" style="border-top: medium none;
              border-left: medium none;">Item added (92)</td>
            <td><br>
            </td>
            <td class="xl79" style="border-top: medium none;
              border-left: medium none;" align="right">0</td>
            <td class="xl89" style="border-top: medium none;
              border-left: medium none;" align="right">52</td>
            <td class="xl90" style="border-top: medium none;
              border-left: medium none;" align="right">52</td>
            <td class="xl90" style="border-top: medium none;
              border-left: medium none;" align="right">52</td>
            <td class="xl90" style="border-top: medium none;
              border-left: medium none;" align="right">52</td>
            <td class="xl90" style="border-top: medium none;
              border-left: medium none;" align="right">52</td>
            <td class="xl90" style="border-top: medium none;
              border-left: medium none;" align="right">52</td>
            <td class="xl91" style="border-top: medium none;
              border-left: medium none;" align="right">52</td>
          </tr>
          <tr style="height: 15.75pt;" height="21">
            <td class="xl76" style="height: 15.75pt; border-top: medium
              none;" height="21">6</td>
            <td class="xl77" style="border-top: medium none;
              border-left: medium none;">Push (47)</td>
            <td class="xl78" style="border-top: medium none;
              border-left: medium none;"> 4</td>
            <td class="xl79" style="border-top: medium none;
              border-left: medium none;">Stack full</td>
            <td><br>
            </td>
            <td><br>
            </td>
            <td><br>
            </td>
            <td><br>
            </td>
            <td><br>
            </td>
            <td><br>
            </td>
            <td><br>
            </td>
            <td><br>
            </td>
            <td><br>
            </td>
            <td><br>
            </td>
          </tr>
          <tr style="height: 15.75pt;" height="21">
            <td style="height: 15.75pt;" height="21"><br>
            </td>
            <td><br>
            </td>
            <td class="xl63"><br>
            </td>
            <td><br>
            </td>
            <td><br>
            </td>
            <td><br>
            </td>
            <td class="xl64">Top</td>
            <td class="xl65" style="border-left: medium none;"
              align="right">1</td>
            <td class="xl65" style="border-left: medium none;"
              align="right">2</td>
            <td class="xl95" style="border-left: medium none;"
              align="right">3</td>
            <td class="xl95" style="border-left: medium none;"
              align="right">2</td>
            <td class="xl95" style="border-left: medium none;"
              align="right">3</td>
            <td class="xl95" style="border-left: medium none;"
              align="right">4</td>
            <td class="xl96" style="border-left: medium none;"
              align="right">4</td>
          </tr>
        </tbody>
      </table>
      <br>
      Mike Brookes <br>
      Semi retired gentleman from Copperfield College<br>
    </blockquote>
    <br>
  </body>
</html>