- Files to copy:
- Copy PrintIns.java
and TestIns.java
to a directory X\duckMachine\operatingSystem.
- Copy the remaining files in the instructions
lab to a directory X\duckMachine\architecture.
- Copy the files in the processor
and IO
unit labs to the directory X\duckMachine\architecture.
- Make sure your ALU and Memory labs (including help files and
solutions) are also in the directory X\duckMachine\architecture.
- Your job is to write two files (both will go in
the architecture directory):
- The first file must be called Processor.java and must contain a
class called "Processor" that implements the interface ProcessorI.
Hint: Among the instance variables you should have one for
the instruction register. Assume this variable is called "ir". A
reasonable initial value for "ir" is "new HaltIns()" (a halt
instruction).
- The second file must be called ioUnit.java and must contain
a class called "ioUnit" that implements the interface ioUnitI.
Hint: Make sure you flush the output stream after every
"writeData" operation.
- Read the notes for details; Read Section 3.3 in Lewis and Loftus
book about IO; Read the API for the java.io package (specially the
StreamTokenizer class).
- To compile your code, go to directory X and type:
X> javac duckMachine\architecture\*.java
X> javac duckMachine\operatingSystem\*.java
- To test your implementation of the Processor, go to directory X and type:
X> java duckMachine.architecture.TestProc
- To test your implementation of the ioUnit, go to directory X and type:
X> java duckMachine.architecture.TestIO