jmce - 1_02

jmce
Class Monitor

java.lang.Object
  extended by jmce.sim.AbstractHardware
      extended by jmce.Monitor
All Implemented Interfaces:
java.lang.Runnable, Console, ExceptionListener, Hardware, TraceListener

public class Monitor
extends AbstractHardware
implements ExceptionListener, TraceListener, java.lang.Runnable, Console

Debug monitor for JMCE CPU.

Version:
1.01
Author:
Mario Viara

Constructor Summary
Monitor()
           
 
Method Summary
 void addCommand(Command cmd)
           
 void error(java.lang.String s)
           
 void exceptionEvent(ExceptionEvent ev)
           
 int getch()
           
 Command getCommandAt(int i)
           
 int getCommandCount()
           
 CPU getCPU()
           
 void getLine(java.lang.String prompt, java.lang.StringBuffer line)
           
 Tape getTape()
           
 void init(Hardware parent)
          Initialize the hardware.
 void print(java.lang.Object o)
           
 void println()
           
 void println(java.lang.Object o)
           
 void printStatusLine(int n, java.lang.String s)
           
 void putchar(int c)
           
 void reset()
          Reset the the device to the initial state.
 void run()
           
 void selectCPU(CPU cpu)
           
 void setConsole(Device<java.lang.Integer> c)
          Set the Terminal / Console used bye the monitor.
 void showCpu()
           
 void trace(java.lang.String s)
          When the cpu execute one istruction trace the execution and send to this listener the String with the description with the executed code.
 
Methods inherited from class jmce.sim.AbstractHardware
addHardware, createFrame, destroy, getHardware, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareForName, getHardwareInstances, getHardwareTree, getName, getParent, initSwing, removeHardware, removeHardware, setHardware, setHardware, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Monitor

public Monitor()
Method Detail

getCPU

public CPU getCPU()

addCommand

public void addCommand(Command cmd)

getCommandCount

public int getCommandCount()

getCommandAt

public Command getCommandAt(int i)

getch

public int getch()
          throws java.lang.Exception
Throws:
java.lang.Exception

printStatusLine

public void printStatusLine(int n,
                            java.lang.String s)

println

public void println()
Specified by:
println in interface Console

println

public void println(java.lang.Object o)
Specified by:
println in interface Console

print

public void print(java.lang.Object o)
Specified by:
print in interface Console

putchar

public void putchar(int c)
Specified by:
putchar in interface Console

getLine

public void getLine(java.lang.String prompt,
                    java.lang.StringBuffer line)
             throws java.lang.Exception
Throws:
java.lang.Exception

run

public void run()
Specified by:
run in interface java.lang.Runnable

error

public void error(java.lang.String s)
           throws java.lang.Exception
Throws:
java.lang.Exception

setConsole

public void setConsole(Device<java.lang.Integer> c)
Set the Terminal / Console used bye the monitor.

Since:
1.01

init

public void init(Hardware parent)
          throws SIMException
Description copied from interface: Hardware
Initialize the hardware. This method must be called before any use of the interface. Only set ... / get ... method are allowed to be called before the intialization.

Specified by:
init in interface Hardware
Overrides:
init in class AbstractHardware
Parameters:
parent - Parent of this hardware.
Throws:
SIMException

reset

public void reset()
           throws SIMException
Description copied from interface: Hardware
Reset the the device to the initial state. This method will be called after init.

Specified by:
reset in interface Hardware
Overrides:
reset in class AbstractHardware
Throws:
SIMException

getTape

public Tape getTape()
             throws java.lang.Exception
Throws:
java.lang.Exception

selectCPU

public void selectCPU(CPU cpu)

trace

public void trace(java.lang.String s)
           throws SIMException
Description copied from interface: TraceListener
When the cpu execute one istruction trace the execution and send to this listener the String with the description with the executed code. One istruction can generated one or more line of trace.

Specified by:
trace in interface TraceListener
Parameters:
s - - String with code executed.
Throws:
SIMException

exceptionEvent

public void exceptionEvent(ExceptionEvent ev)
Specified by:
exceptionEvent in interface ExceptionListener

showCpu

public void showCpu()
             throws java.lang.Exception
Throws:
java.lang.Exception

jmce - 1_02