package rebelsky.pal;

/**
 * The PAL instruction to move output to the next line.
 *
 * @author Samuel A. Rebelsky
 * @version 1.0 of November 2002.
 */
public class NewLine
  implements Instruction
{

  // +--------------+------------------------------------------------------
  // | Constructors |
  // +--------------+

  /** 
   * Create a new instruction to move output to the next line.
   */
  public NewLine()
  {
  } // NewLine()


  // +---------+-----------------------------------------------------------
  // | Methods |
  // +---------+

  /** 
   * Execute the instruction on a machine. 
   * 
   * @exception Exception
   *   If the memory location is invalid.
   */
  public void execute(Computer hal)
    throws Exception
  {
    hal.out.println();
  } // execute(Computer)

  /** Convert the instruction to a string (usually for printing). */
  public String toString()
  {
    return "  NEWLINE";
  } // toString()

} // class NewLine

