Elmo HARSFEN0602 Network Hardware User Manual


 
HARSFEN0602
The virtual machine supports the following data types:
- INTEGER: 32 BIT SIGNED INTEGER
- Float: 32 bit IEEE floating point number (24 bit mantissa, 8 bit sign)
Logical operators yield Boolean results – True or False.
True is equivalent to the integer 1.
False is equivalent to the integer 0.
7.5 Op code structure and addressing modes
Op code it’s a bit filed (16 bits) which give us information about the VAC (Virtual Assembly Code) and it’s
operands, more details in table below.
Each operand has an addressing mode indicates the location of the operand (stack, data segment, immediate).
Op code bit field:
Bits Description Meaning
0 ChangeStack Flag shows whether SP should change (increase/decrease) after
an execution of a VAC. This flag is ignored by some of the
commands. 1 – change stack, 0 – don’t change.
1-7 CodeIndex Index of VAC in table
8 OperType1 Data type of first operand . 1 – Float, 0 – Integer
9 OperType2 Data type of second operand
10-12 AddrMode1 Addressing mode of first operand (destination)
12-15 AddrMode2 Addressing mode of second operand (source)
Addressing Modes:
Addressing Mode
MEANING
ABSENT Lack operand after command code. Usually Operand is at
the top of stack.
IMMEDIATE1 Operand is char integer and stated immediately after
command code
IMMEDIATE2 Operand is short integer and stated immediately after
command code
IMMEDIATE4 Operand is long integer or float and stated immediately
after command code
MEM_DIRECT Operand is at the memory address (ram) which stated after
command code.
STACK_IMMEDIATELY Operand stated at stack member which placed after
command
BP_RELATIVE Operand is placed in the stack relatively to the base
pointer. Exact location in the stack is base pointer +
operand stated after command code.
7.6 Short reference
A concise reference is given in the table below.
OP code Meaning
MLT Multiply the top of stack with the number below.
SUB Subtract the top of stack from the number below.
ADD Add the top of stack to the number below.
DIV Divide the number below top of stack by the top of stack.