You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
730 B
28 lines
730 B
package generic;
|
|
|
|
import java.io.FileInputStream;
|
|
import generic.Operand.OperandType;
|
|
|
|
|
|
public class Simulator {
|
|
|
|
static FileInputStream inputcodeStream = null;
|
|
|
|
public static void setupSimulation(String assemblyProgramFile)
|
|
{
|
|
int firstCodeAddress = ParsedProgram.parseDataSection(assemblyProgramFile);
|
|
ParsedProgram.parseCodeSection(assemblyProgramFile, firstCodeAddress);
|
|
ParsedProgram.printState();
|
|
}
|
|
|
|
public static void assemble(String objectProgramFile)
|
|
{
|
|
//TODO your assembler code
|
|
//1. open the objectProgramFile in binary mode
|
|
//2. write the firstCodeAddress to the file
|
|
//3. write the data to the file
|
|
//4. assemble one instruction at a time, and write to the file
|
|
//5. close the file
|
|
}
|
|
|
|
}
|
|
|