Elmo HARmonica, HARSFEN0602 Rsltand Logical and Operator, Rsltb Relational Operator, Sp Sp

Models: HARmonica HARSFEN0602

1 220
Download 220 pages 51.63 Kb
Page 88
Image 88

HARSFEN0602ElmoHARmonicaSoftwareManual

PRELIMINARYDRAFT

7.7.25RSLTAND – Logical AND Operator (&&)

Purpose:

If both numbers are non-zero condition is true. Otherwise it is false (numbers are at top two entries of 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 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.26

RSLTB – Relational Operator (<)

Purpose:

Compare two numbers, if the first number is smaller condition is true otherwise it’s false (numbers are at top two entries of the stack) .

Algorithm:

 

 

((SP-1) < (SP))

(SP)

 

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

 

 

flags

Addressing modes

Absent

 

 

Promotion

 

N.A.

 

 

Output type

 

Int

 

Compare result is always

 

 

 

 

integer

Imposes end of line

No

 

 

86

7.7.27RSLTBE – Relational Operator (<=)

Purpose:

Compare two numbers, if the first number is smaller or they are equal condition is true otherwise it’s false (numbers are at top two entries of the stack) .

Algorithm:

 

((SP-1) <=

(SP))

(SP)

SP SP -

1

Attributes

Page 88
Image 88
Elmo HARmonica, HARSFEN0602 Rsltand Logical and Operator, Rsltb Relational Operator, Rsltbe Relational Operator =, Sp Sp