org.mythsim.core
Class MythSim

java.lang.Object
  |
  +--org.mythsim.core.MythSim
Direct Known Subclasses:
MythSimConsole, MythSimSwing

public class MythSim
extends Object

The CPU Simulator.


Field Summary
static int A_BUS
          Bus: ALU (Arithmetic Logic Unit) Input A Bus.
static int A_SEL
          Control Signal: Places the value in register n(0-7) on the a_bus.
static int A_SEL_SET
           
static int ADDRESS
          Control Signal: (not used) .
static int ADDRESS_FALSE
          Control Signal: .
static int ADDRESS_FALSE_SET
           
static int ADDRESS_SET
           
static int ADDRESS_TRUE
          Control Signal:.
static int ADDRESS_TRUE_SET
           
static int ALU_ADD
          ALU Operation: ADD.
static int ALU_ADDA
          ALU Operation: ADDA.
static int ALU_AND
          ALU Operation: AND.
static int ALU_BUS
          Bus: ALU (Arithmetic Logic Unit) Output Bus.
static int ALU_NOT
          ALU Operation: NOT.
static int ALU_OR
          ALU Operation: OR.
static int ALU_SEL
          Control Signal: Sets the ALU operation.
static int ALU_SEL_SET
           
static int ALU_SUB
          ALU Operation: SUB.
static int ALU_SUBA
          ALU Operation: SUBA.
static int ALU_XOR
          ALU Operation: XOR.
static String[] aluFuncs
           
static int B_BUS
          Bus: ALU (Arithmetic Logic Unit) Input B Bus.
static int B_SEL
          Control Signal: Places the value in register n(0-7) on the b_bus.
static int B_SEL_SET
           
static int C_IN
          Control Signal: Sets the c_in to 1 for use by ALU operations.
static int C_IN_SET
           
static int C_OUT
          Status Signal: Carry bit from the ALU.
static int CLOCK
          The system clock.
static int COND
          Control Signal: Select the argument for the if statement.
static int COND_C_OUT
          Cond Option: Uses carry bit from the alu_bus.
static int COND_M7
          Cond Option: Uses most significant bit from alu_bus.
static int COND_SET
           
static int COND_V
          Cond Option: Uses overflow bit from ALU.
static int COND_WAIT
          Cond Option: Uses wait signal from Main Memory.
static int CONTROL_WORD_END
           
static int CONTROL_WORD_LENGTH
           
static int CONTROL_WORD_START
           
static int CURRENT_ADDRESS
           
static int INDEX_SEL
          Control Signal: Add the opcode to the next address.
static int INDEX_SEL_SET
           
static int INVALID_FILES_MODE
           
static int IR_0
          Register: Instruction Register 0.
static int IR_1
          Register: Instruction Register 1.
static int IR0_SEL
          Control Signal: Sets Instruction Register 0 (ir_0).
static int IR0_SEL_SET
           
static int IR1_SEL
          Control Signal: Sets Instruction Register 1 (ir_1).
static int IR1_SEL_SET
           
static int LENGTH
           
static int LOCKED
           
static int M_7
          Status Signal: Most significant bit from alu_bus.
static int MAIN_MEMORY
           
static int MAR
          Register: Memory Address Register.
static int MAR_SEL
          Control Signal: Sets Memory Address Register (MDR).
static int MAR_SEL_SET
           
static int MDR
          Register: Memory Data Register.
static int MDR_SEL
          Control Signal: Sets Memory Data Register (MAR).
static int MDR_SEL_SET
           
static int MEMORY_BUS
          Bus: Memory Bus.
protected  int mode
           
static int NO_FILES_MODE
           
static String[] opcodeTags
           
static int R_0
          Register: 0.
static int R_1
          Register: 1.
static int R_2
          Register: 2.
static int R_3
          Register: 3.
static int R_4
          Register: 4.
static int R_5
          Register: 5.
static int R_6
          Register: 6.
static int R_7
          Register: 7.
static int R0_WRITE
          Control Signal: Stores the result_bus value into r_0.
static int R0_WRITE_SET
           
static int R1_WRITE
          Control Signal: Stores the result_bus value into r_1.
static int R1_WRITE_SET
           
static int R2_WRITE
          Control Signal: Stores the result_bus value into r_2.
static int R2_WRITE_SET
           
static int R3_WRITE
          Control Signal: Stores the result_bus value into r_3.
static int R3_WRITE_SET
           
static int R4_WRITE
          Control Signal: Stores the result_bus value into r_4.
static int R4_WRITE_SET
           
static int R5_WRITE
          Control Signal: Stores the result_bus value into r_5.
static int R5_WRITE_SET
           
static int R6_WRITE
          Control Signal: Stores the result_bus value into r_6.
static int R6_WRITE_SET
           
static int R7_WRITE
          Control Signal: Stores the result_bus value into r_7.
static int R7_WRITE_SET
           
static int READ
          Control Signal: Read from memory.
static int READ_SET
           
static int RESULT_ALU
          Result Option: Place the alu_bus value on the result_bus.
static int RESULT_BUS
          Bus: Result Bus.
static int RESULT_IR_CONST4
          Result Option: Place the ir_const4 value on the result_bus.
static int RESULT_IR_CONST8
          Result Option: Place the ir_const8 value on the result_bus.
static int RESULT_MDR
          Result Option: Place the MDR value on the result_bus.
static int RESULT_SEL
          Control Signal: Selects value for result_bus.
static int RESULT_SEL_SET
           
static int RI_SEL
          Control Signal: Stores result_bus value in the register defined in ir_ri.
static int RI_SEL_SET
           
static int RJ_SEL
          Control Signal: Places the value in register defined by ir_rj on the a_bus.
static int RJ_SEL_SET
           
static int RK_SEL
          Control Signal: Places the value in register defined by ir_rk on the a_bus.
static int RK_SEL_SET
           
static int STATUS_ARRAY_LENGTH
           
static int V
          Status Signal: Overflow.
static int VA_SEL_BUS
          Virtual Bus: Places the value in register n(0-7) on the a_bus.
static int VALID_FILES_MODE
           
static int VB_SEL_BUS
          Virtual Bus: Places the value in register n(0-7) on the b_bus.
static String version_title
          The curent name and version number.
static int VR0_WRITE_BUS
          Virtual Control Signal: Stores the result_bus value into r_0.
static int VR1_WRITE_BUS
          Virtual Control Signal: Stores the result_bus value into r_1.
static int VR2_WRITE_BUS
          Virtual Control Signal: Stores the result_bus value into r_2.
static int VR3_WRITE_BUS
          Virtual Control Signal: Stores the result_bus value into r_3.
static int WAIT
          Status Signal: Wait.
static int WRITE
          Control Signal: Write to memory.
static int WRITE_BUS
          Bus: Write Bus.
static int WRITE_SET
           
 
Constructor Summary
MythSim()
          Creates a MythSim simulator.
 
Method Summary
static boolean AND(boolean a, boolean b)
           
static int and(int x, int y)
           
static int bit2int(boolean[] a)
           
 void boot()
          Boots comptuer.
static int carry(int x, int y)
           
static int carry(int alu_sel, int a_bus, int b_bus, int c_in)
           
static int[] empty()
           
static int fix(int x)
           
static String funcName(int i)
           
 Object[][] getMemory()
           
 File getMemoryFile()
           
 String getMemoryFileName()
           
 String getMemoryFilePath()
           
 String getMemorySource()
           
 File getMicrocodeFile()
           
 String getMicrocodeFileName()
           
 String getMicrocodeFilePath()
           
 String getMicrocodeSource()
           
 int[] getPreviousStatus()
           
 int getRegA()
           
 int getRegB()
           
 int[] getStatus()
           
 int getStatus(int index)
           
 Object[][] getUcode()
           
 Object[][] getUstore()
           
static boolean[] int2bit(int a)
           
 void last()
          Steps backward to last opcode.
static int lownibble(int a)
           
static int m7(int a)
           
static String name(int i)
           
 void next()
          Steps forward to next opcode.
static int normal(int a)
           
static int normal2tc(int a)
           
static boolean NOT(boolean a)
           
static int not(int x)
           
static int opcode(int a)
           
static boolean OR(boolean a, boolean b)
           
static int or(int x, int y)
           
static int overflow(int x)
           
 void parse()
          Parse ucode and mem files.
static int ri(int a)
           
static int rj(int a)
           
static int rk(int a)
           
 void run()
          Runs comptuer.
 void setFileMemory(File file)
          Sets the Memory File
 void setFileMicrocode(File file)
          Sets the Microcode File
 void step()
          Step One Clock Cycle
 void step(int a)
          Step forward N time to next opcode
static int tc2normal(int a)
           
 boolean ucodeZero()
           
static boolean XOR(boolean a, boolean b)
           
static int xor(int x, int y)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version_title

public static final String version_title
The curent name and version number.

See Also:
Constant Field Values

R_0

public static final int R_0
Register: 0.

Location in the status array for the value in Register 0.

See Also:
Constant Field Values

R_1

public static final int R_1
Register: 1.

Location in the status array for the value in Register 1.

See Also:
Constant Field Values

R_2

public static final int R_2
Register: 2.

Location in the status array for the value in Register 2.

See Also:
Constant Field Values

R_3

public static final int R_3
Register: 3.

Location in the status array for the value in Register 3.

See Also:
Constant Field Values

R_4

public static final int R_4
Register: 4.

Location in the status array for the value in Register 4.

See Also:
Constant Field Values

R_5

public static final int R_5
Register: 5.

Location in the status array for the value in Register 5.

See Also:
Constant Field Values

R_6

public static final int R_6
Register: 6.

Location in the status array for the value in Register 6.

See Also:
Constant Field Values

R_7

public static final int R_7
Register: 7.

Location in the status array for the value in Register 7.

See Also:
Constant Field Values

IR_0

public static final int IR_0
Register: Instruction Register 0.

Location in the status array for the value in Instruction Register 0.

See Also:
Constant Field Values

IR_1

public static final int IR_1
Register: Instruction Register 1.

Location in the status array for the value in Instruction Register 1.

See Also:
Constant Field Values

MDR

public static final int MDR
Register: Memory Data Register.

Location in the status array for the value in Memory Data Register.

See Also:
Constant Field Values

MAR

public static final int MAR
Register: Memory Address Register.

Location in the status array for the value in Memory Address Register.

See Also:
Constant Field Values

ALU_BUS

public static final int ALU_BUS
Bus: ALU (Arithmetic Logic Unit) Output Bus.

Location in the status array for the value in alu_bus. Register.

See Also:
Constant Field Values

A_BUS

public static final int A_BUS
Bus: ALU (Arithmetic Logic Unit) Input A Bus.

Location in the status array for the value in a_bus. Register.

See Also:
Constant Field Values

B_BUS

public static final int B_BUS
Bus: ALU (Arithmetic Logic Unit) Input B Bus.

Location in the status array for the value in b_bus. Register.

See Also:
Constant Field Values

RESULT_BUS

public static final int RESULT_BUS
Bus: Result Bus.

Location in the status array for the value in result_bus. Register.

See Also:
Constant Field Values

WRITE_BUS

public static final int WRITE_BUS
Bus: Write Bus.

Location in the status array for the value in write_bus. Register.

See Also:
Constant Field Values

MEMORY_BUS

public static final int MEMORY_BUS
Bus: Memory Bus.

Location in the status array for the value in mem_bus. Register.

See Also:
Constant Field Values

R0_WRITE

public static final int R0_WRITE
Control Signal: Stores the result_bus value into r_0.

Stores the index of this control signal.

See Also:
Constant Field Values

R1_WRITE

public static final int R1_WRITE
Control Signal: Stores the result_bus value into r_1.

Stores the index of this control signal.

See Also:
Constant Field Values

R2_WRITE

public static final int R2_WRITE
Control Signal: Stores the result_bus value into r_2.

Stores the index of this control signal.

See Also:
Constant Field Values

R3_WRITE

public static final int R3_WRITE
Control Signal: Stores the result_bus value into r_3.

Stores the index of this control signal.

See Also:
Constant Field Values

R4_WRITE

public static final int R4_WRITE
Control Signal: Stores the result_bus value into r_4.

Stores the index of this control signal.

See Also:
Constant Field Values

R5_WRITE

public static final int R5_WRITE
Control Signal: Stores the result_bus value into r_5.

Stores the index of this control signal.

See Also:
Constant Field Values

R6_WRITE

public static final int R6_WRITE
Control Signal: Stores the result_bus value into r_6.

Stores the index of this control signal.

See Also:
Constant Field Values

R7_WRITE

public static final int R7_WRITE
Control Signal: Stores the result_bus value into r_7.

Stores the index of this control signal.

See Also:
Constant Field Values

A_SEL

public static final int A_SEL
Control Signal: Places the value in register n(0-7) on the a_bus.

Stores the index of this control signal.

See Also:
Constant Field Values

B_SEL

public static final int B_SEL
Control Signal: Places the value in register n(0-7) on the b_bus.

Stores the index of this control signal.

See Also:
Constant Field Values

RI_SEL

public static final int RI_SEL
Control Signal: Stores result_bus value in the register defined in ir_ri.

Stores the index of this control signal.

See Also:
Constant Field Values

RJ_SEL

public static final int RJ_SEL
Control Signal: Places the value in register defined by ir_rj on the a_bus.

Stores the index of this control signal.

See Also:
Constant Field Values

RK_SEL

public static final int RK_SEL
Control Signal: Places the value in register defined by ir_rk on the a_bus.

Stores the index of this control signal.

See Also:
Constant Field Values

C_IN

public static final int C_IN
Control Signal: Sets the c_in to 1 for use by ALU operations.

Stores the status array index of this control signal.

See Also:
Constant Field Values

ALU_SEL

public static final int ALU_SEL
Control Signal: Sets the ALU operation.

Stores the status array index of this control signal.

See Also:
ALU_NOT, ALU_OR, ALU_AND, ALU_XOR, ALU_ADD, ALU_SUB, ALU_ADDA, ALU_SUBA, Constant Field Values

MDR_SEL

public static final int MDR_SEL
Control Signal: Sets Memory Data Register (MAR).

Stores the status array index of this control signal.

See Also:
MDR, Constant Field Values

MAR_SEL

public static final int MAR_SEL
Control Signal: Sets Memory Address Register (MDR).

Stores the status array index of this control signal.

See Also:
MAR, Constant Field Values

RESULT_SEL

public static final int RESULT_SEL
Control Signal: Selects value for result_bus.

Stores the status array index of this control signal.

See Also:
RESULT_ALU, RESULT_MDR, RESULT_IR_CONST4, RESULT_IR_CONST8, Constant Field Values

IR0_SEL

public static final int IR0_SEL
Control Signal: Sets Instruction Register 0 (ir_0).

Stores the status array index of this control signal.

See Also:
IR_0, Constant Field Values

IR1_SEL

public static final int IR1_SEL
Control Signal: Sets Instruction Register 1 (ir_1).

Wires: 1
Values: 0 to 1

Stores the status array index of this control signal.

See Also:
IR_1, Constant Field Values

READ

public static final int READ
Control Signal: Read from memory.

Wires: 1
Values: 0 to 1

Stores the status array index of this control signal.

See Also:
Constant Field Values

WRITE

public static final int WRITE
Control Signal: Write to memory.

Wires: 1
Values: 0 to 1

Stores the status array index of this control signal.

See Also:
Constant Field Values

INDEX_SEL

public static final int INDEX_SEL
Control Signal: Add the opcode to the next address.

Wires: 1
Values: 0 to 1

Stores the status array index of this control signal.

See Also:
Constant Field Values

COND

public static final int COND
Control Signal: Select the argument for the if statement.

Wires: 2
Values: 0 to 3

Stores the status array index of this control signal.

See Also:
COND_M7, COND_C_OUT, COND_V, COND_WAIT, Constant Field Values

ADDRESS_TRUE

public static final int ADDRESS_TRUE
Control Signal:.

Stores the status array index of this control signal.

See Also:
Constant Field Values

ADDRESS_FALSE

public static final int ADDRESS_FALSE
Control Signal: .

Stores the status array index of this control signal.

See Also:
Constant Field Values

ADDRESS

public static final int ADDRESS
Control Signal: (not used) .

Use CURRENT_ADDESS

See Also:
Constant Field Values

R0_WRITE_SET

public static final int R0_WRITE_SET
See Also:
Constant Field Values

R1_WRITE_SET

public static final int R1_WRITE_SET
See Also:
Constant Field Values

R2_WRITE_SET

public static final int R2_WRITE_SET
See Also:
Constant Field Values

R3_WRITE_SET

public static final int R3_WRITE_SET
See Also:
Constant Field Values

R4_WRITE_SET

public static final int R4_WRITE_SET
See Also:
Constant Field Values

R5_WRITE_SET

public static final int R5_WRITE_SET
See Also:
Constant Field Values

R6_WRITE_SET

public static final int R6_WRITE_SET
See Also:
Constant Field Values

R7_WRITE_SET

public static final int R7_WRITE_SET
See Also:
Constant Field Values

A_SEL_SET

public static final int A_SEL_SET
See Also:
Constant Field Values

B_SEL_SET

public static final int B_SEL_SET
See Also:
Constant Field Values

RI_SEL_SET

public static final int RI_SEL_SET
See Also:
Constant Field Values

RJ_SEL_SET

public static final int RJ_SEL_SET
See Also:
Constant Field Values

RK_SEL_SET

public static final int RK_SEL_SET
See Also:
Constant Field Values

C_IN_SET

public static final int C_IN_SET
See Also:
Constant Field Values

ALU_SEL_SET

public static final int ALU_SEL_SET
See Also:
Constant Field Values

MDR_SEL_SET

public static final int MDR_SEL_SET
See Also:
Constant Field Values

MAR_SEL_SET

public static final int MAR_SEL_SET
See Also:
Constant Field Values

RESULT_SEL_SET

public static final int RESULT_SEL_SET
See Also:
Constant Field Values

IR0_SEL_SET

public static final int IR0_SEL_SET
See Also:
Constant Field Values

IR1_SEL_SET

public static final int IR1_SEL_SET
See Also:
Constant Field Values

READ_SET

public static final int READ_SET
See Also:
Constant Field Values

WRITE_SET

public static final int WRITE_SET
See Also:
Constant Field Values

INDEX_SEL_SET

public static final int INDEX_SEL_SET
See Also:
Constant Field Values

COND_SET

public static final int COND_SET
See Also:
Constant Field Values

ADDRESS_TRUE_SET

public static final int ADDRESS_TRUE_SET
See Also:
Constant Field Values

ADDRESS_FALSE_SET

public static final int ADDRESS_FALSE_SET
See Also:
Constant Field Values

ADDRESS_SET

public static final int ADDRESS_SET
See Also:
Constant Field Values

C_OUT

public static final int C_OUT
Status Signal: Carry bit from the ALU.

Stores the status array index of this status signal.

See Also:
Constant Field Values

M_7

public static final int M_7
Status Signal: Most significant bit from alu_bus.

Stores the status array index of this status signal.

See Also:
Constant Field Values

V

public static final int V
Status Signal: Overflow.

Stores the status array index of this status signal.

See Also:
Constant Field Values

WAIT

public static final int WAIT
Status Signal: Wait.

Stores the status array index of this status signal.

See Also:
Constant Field Values

CURRENT_ADDRESS

public static final int CURRENT_ADDRESS
See Also:
Constant Field Values

CLOCK

public static final int CLOCK
The system clock.

See Also:
Constant Field Values

LOCKED

public static final int LOCKED
See Also:
Constant Field Values

VA_SEL_BUS

public static final int VA_SEL_BUS
Virtual Bus: Places the value in register n(0-7) on the a_bus.

Wires: 3
Values: 0 to 7

Stores the status array index of this control signal.

See Also:
Constant Field Values

VB_SEL_BUS

public static final int VB_SEL_BUS
Virtual Bus: Places the value in register n(0-7) on the b_bus.

Wires: 3
Values: 0 to 7

Stores the status array index of this control signal.

See Also:
Constant Field Values

VR0_WRITE_BUS

public static final int VR0_WRITE_BUS
Virtual Control Signal: Stores the result_bus value into r_0.

Wires: 1
Values: 0 or 1

Stores the status array index of this control signal.

See Also:
Constant Field Values

VR1_WRITE_BUS

public static final int VR1_WRITE_BUS
Virtual Control Signal: Stores the result_bus value into r_1.

Wires: 1
Values: 0 or 1

Stores the status array index of this control signal.

See Also:
Constant Field Values

VR2_WRITE_BUS

public static final int VR2_WRITE_BUS
Virtual Control Signal: Stores the result_bus value into r_2.

Wires: 1
Values: 0 or 1

Stores the status array index of this control signal.

See Also:
Constant Field Values

VR3_WRITE_BUS

public static final int VR3_WRITE_BUS
Virtual Control Signal: Stores the result_bus value into r_3.

Wires: 1
Values: 0 or 1

Stores the status array index of this control signal.

See Also:
Constant Field Values

STATUS_ARRAY_LENGTH

public static final int STATUS_ARRAY_LENGTH
See Also:
Constant Field Values

MAIN_MEMORY

public static final int MAIN_MEMORY
See Also:
Constant Field Values

LENGTH

public static final int LENGTH
See Also:
Constant Field Values

CONTROL_WORD_START

public static final int CONTROL_WORD_START
See Also:
Constant Field Values

CONTROL_WORD_END

public static final int CONTROL_WORD_END
See Also:
Constant Field Values

CONTROL_WORD_LENGTH

public static final int CONTROL_WORD_LENGTH
See Also:
Constant Field Values

NO_FILES_MODE

public static final int NO_FILES_MODE
See Also:
Constant Field Values

INVALID_FILES_MODE

public static final int INVALID_FILES_MODE
See Also:
Constant Field Values

VALID_FILES_MODE

public static final int VALID_FILES_MODE
See Also:
Constant Field Values

mode

protected int mode

aluFuncs

public static final String[] aluFuncs

ALU_NOT

public static final int ALU_NOT
ALU Operation: NOT.

NOT(a_bus) => alu_bus

See Also:
ALU_SEL, Constant Field Values

ALU_OR

public static final int ALU_OR
ALU Operation: OR.

OR(a_bus,b_bus) => alu_bus

See Also:
ALU_SEL, Constant Field Values

ALU_AND

public static final int ALU_AND
ALU Operation: AND.

AND(a_bus,b_bus) => alu_bus

See Also:
ALU_SEL, Constant Field Values

ALU_XOR

public static final int ALU_XOR
ALU Operation: XOR.

XOR(a_bus,b_bus) => alu_bus

See Also:
ALU_SEL, Constant Field Values

ALU_ADD

public static final int ALU_ADD
ALU Operation: ADD.

a_bus + b_bus + c_in => alu_bus

See Also:
ALU_SEL, Constant Field Values

ALU_SUB

public static final int ALU_SUB
ALU Operation: SUB.

a_bus + NOT(b_bus) + c_in => alu_bus

See Also:
ALU_SEL, Constant Field Values

ALU_ADDA

public static final int ALU_ADDA
ALU Operation: ADDA.

a_bus + c_in => alu_bus

See Also:
ALU_SEL, Constant Field Values

ALU_SUBA

public static final int ALU_SUBA
ALU Operation: SUBA.

a_bus - 1 + c_in => alu_bus

See Also:
ALU_SEL, Constant Field Values

RESULT_ALU

public static final int RESULT_ALU
Result Option: Place the alu_bus value on the result_bus.

See Also:
RESULT_SEL, Constant Field Values

RESULT_MDR

public static final int RESULT_MDR
Result Option: Place the MDR value on the result_bus.

See Also:
RESULT_SEL, Constant Field Values

RESULT_IR_CONST4

public static final int RESULT_IR_CONST4
Result Option: Place the ir_const4 value on the result_bus.

See Also:
RESULT_SEL, Constant Field Values

RESULT_IR_CONST8

public static final int RESULT_IR_CONST8
Result Option: Place the ir_const8 value on the result_bus.

See Also:
RESULT_SEL, Constant Field Values

COND_M7

public static final int COND_M7
Cond Option: Uses most significant bit from alu_bus.

See Also:
COND, Constant Field Values

COND_C_OUT

public static final int COND_C_OUT
Cond Option: Uses carry bit from the alu_bus.

See Also:
COND, C_OUT, Constant Field Values

COND_V

public static final int COND_V
Cond Option: Uses overflow bit from ALU.

See Also:
COND, Constant Field Values

COND_WAIT

public static final int COND_WAIT
Cond Option: Uses wait signal from Main Memory.

See Also:
COND, Constant Field Values

opcodeTags

public static String[] opcodeTags
Constructor Detail

MythSim

public MythSim()
Creates a MythSim simulator.

Method Detail

setFileMicrocode

public void setFileMicrocode(File file)
                      throws FileNotFoundException
Sets the Microcode File

FileNotFoundException

setFileMemory

public void setFileMemory(File file)
                   throws FileNotFoundException
Sets the Memory File

FileNotFoundException

getMemorySource

public String getMemorySource()
Returns:
memory source file in string

getMicrocodeSource

public String getMicrocodeSource()
Returns:
microcode source file in string

getMemoryFile

public File getMemoryFile()
Returns:
memory source file path

getMicrocodeFile

public File getMicrocodeFile()
Returns:
microcode source file path

getMemoryFilePath

public String getMemoryFilePath()
Returns:
memory source file path

getMicrocodeFilePath

public String getMicrocodeFilePath()
Returns:
microcode source file path

getMemoryFileName

public String getMemoryFileName()
Returns:
memory source file name

getMicrocodeFileName

public String getMicrocodeFileName()
Returns:
microcode source file name

getStatus

public int[] getStatus()
Returns:
the current status array

getPreviousStatus

public int[] getPreviousStatus()
Returns:
the current status array

getStatus

public int getStatus(int index)
Returns:
the current status array element n

name

public static String name(int i)
Returns:
the diplay name of status array element n

funcName

public static String funcName(int i)
Returns:
the official name of status array element n

ucodeZero

public boolean ucodeZero()
Returns:
true when current_address is zero

getRegA

public int getRegA()

getRegB

public int getRegB()

parse

public void parse()
           throws Exception
Parse ucode and mem files.

Exception

step

public void step(int a)
          throws MythError
Step forward N time to next opcode

MythError

next

public void next()
          throws MythError
Steps forward to next opcode.

MythError

last

public void last()
          throws MythError
Steps backward to last opcode.

MythError

run

public void run()
         throws MythError
Runs comptuer.

MythError

boot

public void boot()
          throws MythError
Boots comptuer.

MythError

step

public void step()
          throws MythError
Step One Clock Cycle

MythError

NOT

public static boolean NOT(boolean a)

AND

public static boolean AND(boolean a,
                          boolean b)

OR

public static boolean OR(boolean a,
                         boolean b)

XOR

public static boolean XOR(boolean a,
                          boolean b)

int2bit

public static boolean[] int2bit(int a)

bit2int

public static int bit2int(boolean[] a)

tc2normal

public static int tc2normal(int a)

normal2tc

public static int normal2tc(int a)

ri

public static int ri(int a)

rj

public static int rj(int a)

rk

public static int rk(int a)

opcode

public static int opcode(int a)

lownibble

public static int lownibble(int a)

m7

public static int m7(int a)

normal

public static int normal(int a)

not

public static int not(int x)

or

public static int or(int x,
                     int y)

and

public static int and(int x,
                      int y)

xor

public static int xor(int x,
                      int y)

overflow

public static int overflow(int x)

fix

public static int fix(int x)

carry

public static int carry(int x,
                        int y)

carry

public static int carry(int alu_sel,
                        int a_bus,
                        int b_bus,
                        int c_in)

empty

public static int[] empty()

getUstore

public Object[][] getUstore()

getUcode

public Object[][] getUcode()

getMemory

public Object[][] getMemory()


Copyright © 2002-2004 Jason Vroustouris. All Rights Reserved.