autohit.vm
Class VMInstruction

java.lang.Object
  |
  +--autohit.vm.VMInstruction
Direct Known Subclasses:
VMIAdd, VMICrc, VMIExec, VMIFor, VMIGet, VMIHeader, VMIIf, VMIJump, VMINop, VMINV, VMIRScope, VMIScope, VMISeek, VMISet, VMIVerify, VMIWait, VMIWhile

public class VMInstruction
extends java.lang.Object
implements java.io.Serializable

A Virtual Machine instruction base class. All vm instructions extend this class. This class also defines the static/final tokens and related constants used by both the vm and the compiler.

We will implement Serializable with this base class, so all final instruction classes will inherit it,

I thought about making this an interface, but since this IS a vm, it seem like a needless slowdown of a class that is going to get banged around enough as it is.

This class defines the numeric token for all instructions. So, if you create a new instruction, be sure to add a token for it in this class... and recompile ALL of the packages.

All derived-class constructors must set the numeric token.

See Also:
Serialized Form

Field Summary
static int ADD
           
static int CRC
           
static int EXEC
           
static int FOR
           
static int GET
           
static int HEADER
           
static int IF
           
 boolean iv
          Detected imbedded variable.
static char IVToken
          Imbedded variable text token.
static int JUMP
           
static int NOP
          Numeric token values.
 int nToken
          Numeric token.
static int NV
           
static int RSCOPE
           
static int SCOPE
           
static int SEEK
           
static int SET
           
static int VERIFY
           
static int WAIT
           
static int WHILE
           
 
Constructor Summary
VMInstruction()
          Default constructor
 
Method Summary
 void orIV(boolean tap)
          OR the IV with tap.
 java.lang.String toString()
          Dump this Instruction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NOP

public static final int NOP
Numeric token values. This is used as an optimization so we can do an OpCode switch(nToken) in the VM...

GET

public static final int GET

FOR

public static final int FOR

WHILE

public static final int WHILE

SET

public static final int SET

WAIT

public static final int WAIT

SCOPE

public static final int SCOPE

RSCOPE

public static final int RSCOPE

HEADER

public static final int HEADER

IF

public static final int IF

NV

public static final int NV

JUMP

public static final int JUMP

ADD

public static final int ADD

VERIFY

public static final int VERIFY

CRC

public static final int CRC

SEEK

public static final int SEEK

EXEC

public static final int EXEC

IVToken

public static final char IVToken
Imbedded variable text token. You may NOT imbed a variable in another variable "name" (though, the reverse is possible).

nToken

public int nToken
Numeric token.

iv

public boolean iv
Detected imbedded variable. An optimization,
Constructor Detail

VMInstruction

public VMInstruction()
Default constructor
Method Detail

orIV

public void orIV(boolean tap)
OR the IV with tap.
  iv    tap  | new iv
  T     T    | T
  T     F    | T
  F     T    | T
  F     F    | F
  
Parameters:
tap - value to OR against.

toString

public java.lang.String toString()
Dump this Instruction. Mostly for debugging. Subclasses should override thise
Returns:
a String containing the dump.
Overrides:
toString in class java.lang.Object