picmicrocontroller
Class Instruction

java.lang.Object
  extended by picmicrocontroller.Instruction

public abstract class Instruction
extends java.lang.Object

This class holds all the instructions of a PIC16F877. Each instruction class simulates the interior behavior of the PIC.


Field Summary
protected  int b
           
protected  ConsolePane console
           
protected  int d
           
protected  boolean detail
           
protected  int f
           
protected  int k
           
protected  PIC pic
           
 
Constructor Summary
Instruction()
           
 
Method Summary
 void adjustCarry(int res)
          Sets the carry flag to the appropriate value according to the result
 void adjustDigitCarry(int res)
          Sets the digit flag to the appropriate value according to the result
 void adjustZeroFlag(int res)
          Sets the zero flag to the appropriate value according to the result
 void setDetail(boolean value)
           
abstract  void simulate()
          Simulate the instruction by changing registers of PIC data memory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pic

protected PIC pic

f

protected int f

d

protected int d

b

protected int b

k

protected int k

detail

protected boolean detail

console

protected ConsolePane console
Constructor Detail

Instruction

public Instruction()
Method Detail

simulate

public abstract void simulate()
Simulate the instruction by changing registers of PIC data memory.


setDetail

public void setDetail(boolean value)

adjustZeroFlag

public void adjustZeroFlag(int res)
Sets the zero flag to the appropriate value according to the result

Parameters:
res - result of an instruction

adjustCarry

public void adjustCarry(int res)
Sets the carry flag to the appropriate value according to the result

Parameters:
res - result of an instruction

adjustDigitCarry

public void adjustDigitCarry(int res)
Sets the digit flag to the appropriate value according to the result

Parameters:
res - result of an instruction