-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssemblyTester.java
More file actions
24 lines (22 loc) · 934 Bytes
/
AssemblyTester.java
File metadata and controls
24 lines (22 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class AssemblyTester {
public static void main(String[] args) throws FileNotFoundException{
File fileToRead = new File("AssemblyAdd.txt");
String code = "";
Scanner fileReader = new Scanner(fileToRead);
while(fileReader.hasNextLine()){
code = code.concat(fileReader.nextLine() + "\n");
}
fileReader.close();
System.out.println("Before execution:\n");
LMCAssemblyParser.getInstance().loadProgram(code);
LMCAssemblyParser.getInstance().showLabels();
LMCAssemblyParser.getInstance().showMemory(90, 100);
LMCAssemblyParser.getInstance().fetchDecodeExecute(1);
System.out.println("After execution:\n");
LMCAssemblyParser.getInstance().showMemory(90, 100);
LMCAssemblyParser.getInstance().showRegisters();
}
}