Echelon Neuron User Manual
Page 111

POPPUSH (Pop from Data Stack and Push onto
Return Stack)
The POPPUSH instruction pops TOS from the data stack and pushes the value
onto the return stack. The POPPUSH instruction uses the implicit addressing
mode.
See PUSHPOP (Pop from Return Stack and Push onto Data Stack) for the
inverse operation.
The POPPUSH instruction applies to Series 3100, 5000, and 6000 devices.
Syntax:
The POPPUSH instruction requires no operands:
POPPUSH
Table 40 describes the attributes of the POPPUSH instruction.
Table 40. POPPUSH Instruction
Instruction
Hexadecimal
Opcode
Instruction
Size (Bytes)
CPU Cycles
Required
Affect on
Carry Flag
POPPUSH
E7
1
5
None
Example:
The following example calls a function named do_it repeatedly, until the value n
on the return stack is zero. Thus, this example implements a do until loop
construct. This example assumes that the called function resides at a high
memory address or is a system function.
Example APEXP ; ( n -- )
poppush ; ( ) R(n)
loop_body ; ( ) R(n)
callf do_it ; ( ) R(n)
dbrnz loop_body ; ( ) R({n})
ret ; ( ) R( )
Neuron Assembly Language Reference
101