title: Compiler Code Generation: Address Descriptors and Arrays
body: <p>I´m building a simple Compiler from the DECAF language to MIPS assembly. Right now I´m able to generate three address code and I´m starting with the code generation phase.</p>
  
  <p>On the several books the structure of Register Descriptors and Address Descriptors are used. <img src="https://i.stack.imgur.com/6DNZJ.jpg" alt="enter image description here"></p>
  
  <p>The problem I´m facing it that I don´t know how to save data on the address descriptor for an array access since my three address code usually has a temporary saving the offset of the index of the array and this temporary may change during runtime.</p>
  
  <p>For example:</p>
  
  <pre><code>y := b[$t1], x
  </code></pre>
  
  <p>On the cases of simple variables it´s easy because I have the identifier and even an integer that corresponds to the memory locaction of the variable. How can I manage the cases of arrays to get the address descriptor working in my compiler?</p>
  
  <p>Thank you</p>