|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--physis.core.virtualmachine.VirtualMachine
|
+--physis.core.virtualmachine.PhysisVirtualMachine
|
+--mar.virtualmachine.MarVM
Simple stack machine with one stack and one register.
| Field Summary | |
(package private) static short |
add
|
(package private) static short |
allocate
|
(package private) static short |
copy
|
(package private) static short |
count_b
|
(package private) static short |
count_f
|
(package private) static short |
dec
|
(package private) static short |
divide
|
static int |
EMPTY
|
static int |
FULL
|
(package private) static short |
get
|
(package private) static short |
if_less
|
(package private) static short |
if_n_equ
|
(package private) static short |
inc
|
private int |
IP
instruction pointer |
(package private) static short |
jump_b
|
(package private) static short |
jump_f
|
(package private) static short |
label_b
|
(package private) static short |
label_f
|
(package private) static short |
nand
|
(package private) static short |
nop
|
(package private) static short |
pop
|
(package private) static short |
push
|
(package private) static short |
put
|
private int |
register
|
(package private) static short |
rotate_b
|
(package private) static short |
rotate_f
|
(package private) static short |
rotate_rand
|
(package private) static short |
shift_l
|
(package private) static short |
shift_r
|
protected int |
SP
stack_pointer, it points to the next available element, also equals with stacksize |
protected int[] |
stack
|
static int |
STACK_SIZE
Size of the internal stack. |
(package private) static short |
sub
|
(package private) static short |
swap
|
(package private) static short |
top2reg
|
(package private) static short |
zero
|
| Fields inherited from class physis.core.virtualmachine.PhysisVirtualMachine |
alien, bearer, blank, counter, gestation_time, GESTATION_TIME_INVALID, tape |
| Constructor Summary | |
MarVM()
|
|
| Method Summary | |
(package private) void |
add()
|
protected void |
allocate()
|
protected void |
copy()
|
(package private) void |
count_b()
|
(package private) void |
count_f()
|
(package private) void |
dec()
|
protected void |
divide()
|
void |
execute()
Executes the next instruction. |
void |
execute(int n)
Calling this method forces te VM to execute the next N instructions. |
(package private) void |
get()
|
Genome |
getGenome()
Returns the genetic information. |
int |
getGenomeSize()
Returns the size of the genome. |
java.lang.String |
getState()
Returns the String representation of the current state of the virtualmachine including all stacks registers in the architecture and the instruction point by the instructionpointer: etc. |
(package private) void |
if_n_equ()
If the top of the stack is less than the registercontent executes the next instruction, otherwise skips it. |
(package private) void |
ifless()
If the top of the stack is less than the registercontent executes the next instruction, otherwise skips it. |
(package private) void |
inc()
|
(package private) void |
incrementIP(int value)
The instruction pointer-register is incremented. |
(package private) void |
jump_b()
|
(package private) void |
jump_f()
|
(package private) void |
nand()
|
(package private) void |
pop()
|
(package private) void |
push()
|
(package private) void |
put()
|
void |
reset()
Brings the machine into the base-state. |
void |
restart()
Brings the machine into base-state but doesn't change the gestation time. |
(package private) void |
rotate_b()
|
(package private) void |
rotate_f()
|
(package private) void |
rotate_rand()
|
(package private) void |
setIP(int value)
|
(package private) void |
shift_l()
|
(package private) void |
shift_r()
|
(package private) void |
stackClear()
|
(package private) boolean |
stackEmpty()
|
(package private) boolean |
stackFull()
|
(package private) int |
stackPop()
|
(package private) void |
stackPush(int val)
|
(package private) int |
stackTop()
|
(package private) void |
sub()
|
(package private) void |
swap()
|
(package private) void |
top2reg()
|
(package private) void |
zero()
|
| Methods inherited from class physis.core.virtualmachine.PhysisVirtualMachine |
getBearer, getEffectiveLength, getGestationTime, loadCodeTape, setBearer |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public static final int STACK_SIZE
protected int[] stack
public static final int EMPTY
public static final int FULL
protected int SP
private int register
private int IP
static final short label_f
static final short label_b
static final short if_less
static final short if_n_equ
static final short jump_f
static final short jump_b
static final short shift_r
static final short shift_l
static final short inc
static final short dec
static final short add
static final short sub
static final short nand
static final short swap
static final short copy
static final short allocate
static final short divide
static final short get
static final short put
static final short count_f
static final short count_b
static final short top2reg
static final short push
static final short pop
static final short zero
static final short rotate_f
static final short rotate_b
static final short rotate_rand
static final short nop
| Constructor Detail |
public MarVM()
| Method Detail |
public void execute()
execute in class VirtualMachinepublic void execute(int n)
VirtualMachineexecute in class VirtualMachinephysis.core.virtualmachine.VirtualMachinenumber_of_instructions - The exact number of the instructions to be executed.public void reset()
reset in class VirtualMachinepublic void restart()
restart in class PhysisVirtualMachinepublic Genome getGenome()
PhysisVirtualMachinegetGenome in class PhysisVirtualMachinepublic int getGenomeSize()
PhysisVirtualMachinegetGenomeSize in class PhysisVirtualMachinepublic java.lang.String getState()
VirtualMachinegetState in class VirtualMachinevoid incrementIP(int value)
value - the amount of incrementationvoid setIP(int value)
void ifless()
void if_n_equ()
void jump_f()
void jump_b()
void shift_r()
void shift_l()
void inc()
void dec()
void add()
void sub()
void nand()
void swap()
protected void copy()
protected void allocate()
protected void divide()
void put()
void get()
void count_f()
void count_b()
void top2reg()
void push()
void pop()
void rotate_f()
void rotate_b()
void rotate_rand()
void zero()
void stackPush(int val)
int stackPop()
int stackTop()
boolean stackEmpty()
boolean stackFull()
void stackClear()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||