hicosim.components.backend.io
Class ObjectfileReader

java.lang.Object
  extended by hicosim.components.backend.io.ObjectfileReader

public class ObjectfileReader
extends java.lang.Object

ObjectFileReader - Class for reading in and interpreting an objectfile assembled with the scotchas assembler. comment-, info-, register-, breakpoint, and linesection are ignored.

Author:
Michael Wager, 16th May 2009

Constructor Summary
ObjectfileReader(IMemory memory)
          Instanciate a vector for start-/ endAddresses of hicovec code section.
 
Method Summary
 void closeStreams()
          close the streams
 Labels getLabels()
          This method returns the read in labels.
 int getProgramCounter()
          This method returns the read in programCounter.
 void readUnsignedBytes()
          This method reads in byte per byte and fills the "instructionRegister" with the 32 bit instructions which are needed to simulate the HiCoVec processor.
 void readUnsignedShortsAndGetMemory()
          This method reads in short per short(a 16 bit), calls getMemoryAndCalculateAddresses() and returns the read in memory.
 int setUp(java.lang.String pathToFile)
          set up a new DataInputStream
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectfileReader

public ObjectfileReader(IMemory memory)
Instanciate a vector for start-/ endAddresses of hicovec code section.

Method Detail

setUp

public int setUp(java.lang.String pathToFile)
          throws java.lang.Exception
set up a new DataInputStream

Parameters:
pathToFile -
Throws:
java.lang.Exception

closeStreams

public void closeStreams()
close the streams


readUnsignedBytes

public void readUnsignedBytes()
This method reads in byte per byte and fills the "instructionRegister" with the 32 bit instructions which are needed to simulate the HiCoVec processor. It also checks the labels and the programCounter.


readUnsignedShortsAndGetMemory

public void readUnsignedShortsAndGetMemory()
This method reads in short per short(a 16 bit), calls getMemoryAndCalculateAddresses() and returns the read in memory.


getProgramCounter

public int getProgramCounter()
This method returns the read in programCounter.

Returns:
int programCounter

getLabels

public Labels getLabels()
This method returns the read in labels.

Returns: