beautypg.com

10 getting stack entries, 11 setting the stack, Getting stack entries -32 – ElmoMC SimplIQ Software Manual User Manual

Page 94: Setting the stack -32

background image

SimplIQ

Software Manual

Program Development and Execution

MAN-SIMSW (Ver. 1.4)

6-32

ƒ

Run to the nearest end of line.

ƒ

Compare the current base pointer with the saved base pointer.

ƒ

If the current base pointer is less than the saved base pointer, the step is out: jump to the
end of the loop. Otherwise, go to the start of the loop.

ƒ

End of loop.

When the nearest end of line is reached and the current base pointer is less than the saved
base pointer, the VAC machine enters a halt state. Otherwise, it simply runs and does not
enter the halt state.

6.7.10 Getting Stack Entries

The DB##GS command returns relevant entries of the stack.

Syntax:
DB##GS[N]=N1,N2
where:
N is a handle of a specified VAC machine whose stack is queried.
N1 is an index of the first stack entry.
N2 is an index of the last stack entry (not inclusive).

The command returns a string containing hexadecimal binary data with a sequence of stack
entries from N1 to N2. If a single stack entry is of interest, then N2 = N1+1.

The command, which is very useful during debugging, returns a string in the hexadecimal
binary format. Every stack entry contains the following fields:


Name


Meaning


Data Type

Size
in Bytes

1 value

Stack entry value

Float or long,
depending on type

4

2 type

Type of stack entry: 0 for long, 1 for float

Signed short

2

3 unused Offset for alignment

Signed short

2

6.7.11 Setting the Stack

The DB##ST command sets a stack entry, which must be a local variable or an input/output
argument of the function.

Syntax:
DB##ST[N]=N1,N2
where:
N is a handle of a specified VAC machine (2 bytes, signed short).
N1 is a stack pointer (2 bytes, signed short).
N2 is a new variable value (4 bytes, long or float).

In order to change a value of a local variable, DB##SS sets a new value to the relevant stack
entry for a specified VAC machine. The type of stack entry is set according to the type of
value that is sent.