Elmo HARSFEN0602, HARmonica EOL End Of Line, Foritr for Loop Iteration, Algorithm itr iterator

Models: HARmonica HARSFEN0602

1 220
Download 220 pages 51.63 Kb
Page 79
Image 79

HARSFEN0602ElmoHARmonicaSoftwareManual

 

PRELIMINARYDRAFT

 

 

 

 

 

 

 

 

flags

 

Addressing modes

Absent

 

 

 

Promotion

Int / Float

 

 

 

 

Executes as

 

 

 

 

(float) Int / Float

 

 

Output type

Int / Int Int

 

 

 

Int / Float

Float

 

 

 

Float / Float

Float

 

 

Imposes end of line

No

 

 

 

7.7.5EOL – End Of Line

Purpose:

 

 

Indicate this is end of line to the Harmonica environment.

 

Algorithm:

 

Zeroes line execution flag.

 

Attributes:

→→

 

Attribute

Value

Comment

Op code

 

May change in future

 

 

versions

Number of arguments

None

 

Argument types

N.A.

 

Addressing modes

N.A.

 

Promotion

N.A.

 

Output type

N.A.

 

Imposes end of line

No

 

7.7.6FORITR – FOR Loop Iteration

Purpose:

Handle FOR loop – check condition, if true update iterator and execute loop body otherwise break loop and continue program.

Algorithm: itr – (iterator)

(SP-2) itr (set iterator with start value)

(SP-1) step

(SP)

target (final value, to which itr is tested)

if (step > 0)

if (itr > target) free top three entries at the stack and jump end of loop else if (step < 0)

if (itr < target) free top three entries at the stack and jump end of loop else

error (step = 0 , meaning infinite loop)

(SP-2) + step

(SP-2) ( increment iterator by step)

Attributes(PC isincremented and loop body is executed)

Attribute

 

Value

Comment

Op code

 

 

May change in future

 

 

 

versions

Number of arguments

2

 

Argument Type1

Signed short integer

 

Argument Type2

Signed short integer

 

 

 

 

Addressing mode1

Immediate2

Jump address to the end of

77

Page 79
Image 79
Elmo HARSFEN0602, HARmonica software manual EOL End Of Line, Foritr for Loop Iteration, Algorithm itr iterator