예제 #1
0
 public static void log(File logFile, ArrayList<AssemblyStatement> instructions) {
   PrintWriter out;
   try {
     out = new PrintWriter(logFile);
     // log instructions
     for (AssemblyStatement s : instructions) {
       out.write(s.mAddress + " : " + s + "\n");
     }
     out.close();
   } catch (Exception e) {
     Compiler.ioError(e);
   }
 }
예제 #2
0
 public static void write(File outFile, ArrayList<AssemblyStatement> instructions) {
   DataOutputStream out;
   try {
     if (!outFile.exists()) {
       outFile.createNewFile();
     }
     out = new DataOutputStream(new FileOutputStream(outFile));
     // write instructions
     for (AssemblyStatement s : instructions) {
       out.writeLong(s.emit());
     }
     out.close();
   } catch (Exception e) {
     Compiler.ioError(e);
   }
 }