HARSFEN0602ElmoHARmonicaSoftwareManual

PRELIMINARYDRAFT

If the current base pointer is less than the saved base pointer, the step is out - jump to the

end the loop, otherwise go to the start of the loop. End of the loop

When the nearest end of line is reached and the current base pointer is less than the saved base pointer, then the VAC machine enters to the halted state. Otherwise it just runs and does not enter halted state.

6.5.8Getting 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 inquired, N1 is an index of the first stack entry and

N2 is an index of the last stack entry (not including).

The command returns a string containing hex binary data with sequence of stack entries from N1 to N2. If we are interested in the only stack entry, then N2 = N1 + 1.

The command returns a string in the hex binary format. Every stack entry is a structure contains the next fields:

 

Name

Meaning

Type

Size in

 

 

 

 

bytes

1

value

Stack entry value

float or long

4

 

 

 

depending on type

 

2

type

Type of the stack entry: 0 for long,

signed short

2

 

 

1 for float

 

 

3

unused

Offset for alignment

signed short

2

This command is very useful during debugging.

6.5.9Setting stack

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

Syntax:

DB##ST[N]=N1,N2

where N is a handle of a specified VAC machine (signed short –2 bytes), N1 is stack pointer (signed short – 2 bytes) and

N2 is new variable value (long or float – 4 bytes)

A user may want to change a value of the local variable. The command DB##SS sets new value to the relevant stack entry for a specified VAC machine.

The type of the stack entry will be set according to the type of the sent value.

6.5.10Getting call stack

There is no direct command to get call stack. In order to reduce complexity of the

Dama, the IDE Manager will execute the all debug analysis.

Consider stack during function call (for more details see 8.2).

Stack pointer

Meaning

Remark

relatively to the

 

 

base pointer

 

 

BP-5

Saved previous BP

For the first called

 

 

function BP is 0

68

Page 70
Image 70
Elmo HARmonica, HARSFEN0602 software manual Getting stack entries, Setting stack, Getting call stack