- throw new MicroInstructionMemoryParseException(e.getCause());
- }
- }
-
- public static void write(MicroInstructionMemory memory, String outputPath) throws IOException
- {
- try (OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(outputPath)))
- {
- write(memory, writer);
- }
- }
-
- public static void write(MicroInstructionMemory memory, String machineName, String outputPath) throws IOException
- {
- try (OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(outputPath)))
- {
- write(memory, machineName, writer);
- }
- }
-
- public static void write(MicroInstructionMemory memory, OutputStreamWriter output) throws IOException
- {
- MemoryDefinition def = memory.getDefinition();
- long min = def.getMinimalAddress(), max = def.getMaximalAddress() + 1;
- for (long i = min; i < max; i++)
- {
- output.write(toCSV(memory.getCell(i)) + lineSeparator);
- }
- }
-
- public static void write(MicroInstructionMemory memory, String machineName, OutputStreamWriter output) throws IOException
- {
- output.write(machineName + lineSeparator);
- MemoryDefinition def = memory.getDefinition();
- long min = def.getMinimalAddress(), max = def.getMaximalAddress() + 1;
- for (long i = min; i < max; i++)
- {
- output.write(toCSV(memory.getCell(i)) + lineSeparator);