Elmo HARSFEN0602 Alphabetic reference, Bitwise and Operator, Purpose, Algorithm, Attributes

Models: HARmonica HARSFEN0602

1 220
Download 220 pages 51.63 Kb
Page 77
Image 77

HARSFEN0602ElmoHARmonicaSoftwareManual

PRELIMINARYDRAFT

 

 

 

 

 

function table is given as an argument

 

 

GET_COMM

Call to function service of a ‘get’ command whose index in the

 

 

function table is given as an argument

 

 

SYSSUBJ

Call to system function whose index in function table is

given as

 

 

an argument

 

 

USRSUBJ

Call to user subroutine whose index in the symbol function table is

 

 

given as

argument (push relevant function data to stack)

 

 

USRSUBRT

Return from user subroutine – restore stack to its state before function

 

 

call, save output arguments in stack and jump to return address

 

FORITR

Handle FOR loop – check condition, if true iterate and execute loop

 

 

body. Otherwise, break loop and continue program

 

 

EOL

Indicate this is end of line

 

 

FREEVAC

Stop program execution

 

 

LINK

Increase stack pointer with the value given as an argument and zeroes

 

 

the new entries to stack

 

 

JMP_LABEL

Unconditional jump to the label (entry point)

 

 

Table 7-1Harmonica op codes

7.7Alphabetic reference

This section details the Harmonica virtual assembly commands.

7.7.1ADD - ADDITION

Purpose:

Addition 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

 

 

 

 

 

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.2

AND – Bitwise AND Operator

Purpose:

Bitwise AND operator – top two entries at the stack.

Algorithm:

 

(SP-1) & (SP)

(SP-1)

 

SP SP - 1

 

75

Page 77
Image 77
Elmo HARSFEN0602, HARmonica software manual Alphabetic reference, Bitwise and Operator, Purpose, Algorithm, Attributes