import java.io.PrintWriter; import Instruction; /** * The standard "Move" instruction for AAAL, the amazingly abstract * assembly language. * * @author Samuel A. Rebelsky * @version 1.0 of April 2001 */ public class Move implements Instruction { // +--------+------------------------------------------------------------ // | Fields | // +--------+ /** The source of the move command. Where data comes from. */ protected Location source; /** The destination of the move command. Where data goes to. */ protected Location destination; // +--------------+------------------------------------------------------ // | Constructors | // +--------------+ /** * Build a new instruction with specified source and destination. */ public Move(Location source, Location destination) { this.source = source; this.destination = destination; } // Move(Location, Location); // +---------------------+----------------------------------------------- // | Instruction Methods | // +---------------------+ /** * Print the instruction. */ public void print(PrintWriter out) { out.print(" MOV "); this.source.print(out); out.print(" to "); this.destination.print(out); out.println(); } // print(PrintWriter) } // class Move