beautypg.com

Echelon Neuron User Manual

Page 198

background image


Example:
This example does the equivalent of a POP [DSP][-9].

; (a, b, c, d, …, h, i, j, k)

pushs #7 ; (7, a, b, c, d, …, j, k)

call _pop1 ; (b, c, d, …, h, i, j, a)

_popd (Pop from TOS and NEXT, Push to Offset,

16 Bit)

This function is used to write a 16-bit value onto a location on the stack. It is

similar to the _pop function, but writes two bytes rather than one. The offset is

two less than what would be used in the POP instruction.

Stack Transformation: (offset, value(2) -- …, value(2), …)
Location: Far
Registers Affected: None

Example:
This example does the equivalent of two POP [DSP][-3] instructions.

; (a, b, c, d, e, f)

push #@lb(-d’5) ; (-d’5, a, b, c, d, e, f)

callf _popd ; (c, d, a, b)

_popd1 (Pop from TOS and NEXT, Push Short to

Offset, 16 Bit)

This function is the same as _popd, except that –d’18 is added to the offset before

storing. This allows the caller to use a PUSHS instruction to load the offset.

Stack Transformation: (offset, value(2) -- …, value(2), …)
Location: Far
Registers Affected: None

Example:
This example does the equivalent of two POP [DSP][-9] instructions.

; (a, b, c, d, …, i, j, k, l)

pushs #7 ; (7, a, b, c, …, i, j, k, l)

callf _popd1 ; (c, d, e, f, …, i, j, a, b)

188

System-Provided Functions