fi.hu.cs.titokone
Class Loader

java.lang.Object
  extended byfi.hu.cs.titokone.Loader

public class Loader
extends java.lang.Object

This class can load a TTK91Application. It changes the processor state accordingly. Everything is loaded when loadApplication is called. Function returns the state of memory after loading. If it runs out of memory it throws a TTK91AddressOutOfBounds exception.


Field Summary
private  Application application
          This variable holds the current application to be loaded.
private  BinaryInterpreter binInterpreter
           
private  Processor processor
           
 
Constructor Summary
Loader(Processor processor)
           
 
Method Summary
 LoadInfo loadApplication()
          Loads an application to memory.
 void setApplicationToLoad(Application application)
          You can set the file to load.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

application

private Application application
This variable holds the current application to be loaded.


processor

private Processor processor

binInterpreter

private BinaryInterpreter binInterpreter
Constructor Detail

Loader

public Loader(Processor processor)
Method Detail

setApplicationToLoad

public void setApplicationToLoad(Application application)
You can set the file to load. Each time an application is set to load, the counter is set to one.


loadApplication

public LoadInfo loadApplication()
                         throws TTK91AddressOutOfBounds
Loads an application to memory. LoadInfo contains all the needed information about the process.

Returns:
Info from the load procedure, null if no application has been set for loading.
Throws:
TTK91AddressOutOfBounds