fi.hu.cs.titokone
Class LoadInfo

java.lang.Object
  extended byfi.hu.cs.titokone.DebugInfo
      extended byfi.hu.cs.titokone.LoadInfo

public class LoadInfo
extends DebugInfo

This class provides info about the loading of a program. It has the code area and the data area as a MemoryLine array. The code is in its numeric form as well as a list of symbolic operation codes with comments and symbols in place, if known. LoadInfo also stores the values of FP and SP.


Field Summary
private  MemoryLine[] codeArea
          This field contains the contents of the code area after the loading is complete.
private  MemoryLine[] dataArea
          This field contains the contents of the data area after the loading is complete.
private  int initFP
          This field contains the value to be stored to the FP register.
private  int initSP
          This field contains the value to be stored to the SP register.
private  SymbolTable symbolTable
          This field contains the symbotable
 
Fields inherited from class fi.hu.cs.titokone.DebugInfo
 
Constructor Summary
LoadInfo(MemoryLine[] codeArea, MemoryLine[] dataArea, SymbolTable symbolTable, int initSP, int initFP, java.lang.String statusMessage)
           
 
Method Summary
 int[] getBinaryCommands()
           
 int[] getData()
           
 java.lang.String[] getDataAreaSymbolic()
           
 java.lang.String[] getDataSymbolic()
           
 int getFP()
           
 int getSP()
           
 java.lang.String[] getSymbolicCommands()
           
 java.lang.String[][] getSymbolTable()
           
 
Methods inherited from class fi.hu.cs.titokone.DebugInfo
getComments, getStatusMessage, setComments, setStatusMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

codeArea

private MemoryLine[] codeArea
This field contains the contents of the code area after the loading is complete.


symbolTable

private SymbolTable symbolTable
This field contains the symbotable


dataArea

private MemoryLine[] dataArea
This field contains the contents of the data area after the loading is complete.


initSP

private int initSP
This field contains the value to be stored to the SP register.


initFP

private int initFP
This field contains the value to be stored to the FP register.

Constructor Detail

LoadInfo

public LoadInfo(MemoryLine[] codeArea,
                MemoryLine[] dataArea,
                SymbolTable symbolTable,
                int initSP,
                int initFP,
                java.lang.String statusMessage)
Parameters:
codeArea - Has the opcodes as MemoryLine array.
dataArea - Has the data part as MemoryLine array.
symbolTable - Contains the symboltable.
initSP - The initial value of SP.
initFP - The initial value of FP.
statusMessage - Message to GUI to be displayed at the status bar.
Method Detail

getSymbolicCommands

public java.lang.String[] getSymbolicCommands()
Returns:
String array that contains the symbolic operation codes.

getBinaryCommands

public int[] getBinaryCommands()
Returns:
Int array that contains operation codes in their numeric form.

getData

public int[] getData()
Returns:
Int array that contains the data segment of a program in memory.

getDataSymbolic

public java.lang.String[] getDataSymbolic()
Returns:
String array that contains the initial data segment of a program in memory as symbolic commands.

getDataAreaSymbolic

public java.lang.String[] getDataAreaSymbolic()
Returns:
A string arary containing only the initial data area of the program. getDataSymbolic returns the entire memory minus the code area. The length is max{initSP - initFP, 0}.

getSymbolTable

public java.lang.String[][] getSymbolTable()

getSP

public int getSP()
Returns:
The value of the Stack pointer (SP) after the program is loaded into memory.

getFP

public int getFP()
Returns:
The value of the Frame pointer (FP) after the program is loaded into memory.