Elmo HARSFEN0602, HARmonica software manual Op code structure and addressing modes, Short reference

Models: HARmonica HARSFEN0602

1 220
Download 220 pages 51.63 Kb
Page 75
Image 75

HARSFEN0602ElmoHARmonicaSoftwareManual

PRELIMINARYDRAFT

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.

73

7.5Op 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.6Short 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.

Page 75
Image 75
Elmo HARSFEN0602, HARmonica software manual Op code structure and addressing modes, Short reference