Elmo HARmonica, HARSFEN0602 software manual CMP Compare, DIV Divide

Models: HARmonica HARSFEN0602

1 220
Download 220 pages 51.63 Kb
Page 78
Image 78

HARSFEN0602ElmoHARmonicaSoftwareManual

 

PRELIMINARYDRAFT

Attributes

 

 

 

 

Attribute

Value

 

Comment

 

Op code

 

 

May change in future

 

 

 

 

versions

 

Number of arguments

None

 

 

 

Argument types

N.A.

 

Both arguments types must

 

 

 

 

be integer (set according to

 

 

 

 

stack members flags)

 

Addressing modes

Absent

 

 

 

Promotion

N.A.

 

 

 

Output type

Int & Int

Int

 

 

Imposes end of line

No

 

 

 

7.7.3CMP – Compare

Purpose:

Compare two values (they can be global/local variables, constants or from stack), if they are equal condition is true otherwise it is false.

Algorithm:

 

 

(Op1 == Op2 ) (SP)

 

SP

SP + 1

 

 

 

 

 

 

 

Attributes:

 

 

 

Attribute

 

Value

Comment

Op code

 

 

May change in future

 

 

 

 

versions

Number of arguments

2

 

Argument type1

Int or Float

If argument is from stack,

 

 

 

type is set according to stack

 

 

 

member flag

Argument type2

Int or Float

 

Addressing mode1

Absent , Immediate, Mem_Direct ,

 

 

 

 

Stack Immediate, BP_Relative

 

Addressing mode2

Absent , Immediate, Mem_Direct ,

 

 

 

 

Stack Immediate, BP_Relative

 

Promotion

 

N.A.

 

Output type

 

Int

Compare result is always

 

 

 

 

integer

Imposes end of line

No

 

7.7.4DIV – Divide

Purpose:

 

 

 

Division of two numbers (top two entries at the stack).

 

Algorithm:

 

 

 

(SP-1) / (SP)

(SP-1)

 

 

SP SP-1

 

 

 

Attributes:

 

 

 

Attribute

 

Value

Comment

Op code

 

 

May change in future

 

 

 

versions

Number of arguments

None

 

Argument types

N.A.

Both arguments types are set

 

according to stack members

76

Page 78
Image 78
Elmo HARmonica, HARSFEN0602 software manual CMP Compare, DIV Divide