//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
// PLEASE DO NOT EDIT WITHOUT THE EXPLICIT CONSENT OF THE AUTHOR! \\
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\

package hlt.language.design.instructions;

/**
 * @version     Last modified on Wed Jun 20 14:29:51 2012 by hak
 * @author      <a href="mailto:hak@acm.org">Hassan A&iuml;t-Kaci</a>
 * @copyright   &copy; <a href="http://www.hassan-ait-kaci.net/">by the author</a>
 */

import hlt.language.design.backend.Runtime;

public class MakeIntArray extends Instruction
{
  public MakeIntArray ()
    {
      setName("MAKE_ARRAY_I");
    }

  public final void execute (Runtime r)
    {
      int size = r.popInt();
      int[] array = new int[size];
      for (int i=0; i<size; i++)
        array[i] = r.popInt();
      r.pushObject(array);
      r.incIP();
    }
}
