Basic programming guide – Remote Processing BASIC for the CX-10 Modbus User Manual

Page 54

Advertising
background image

BASIC PROGRAMMING GUIDE

2-45

PUSH

Syntax:

PUSH expr1 [,expr2,...]
Where:

expr is a numeric value

Function:

Puts the value of expr to the argument stack. The first value PUSHed and is the last POPped.

Mode:

Command, run

Use:

PUSH X,Y

DESCRIPTION

PUSH and POP instructions pass values to Basic subroutines. The last value pushed is the last expression in
the PUSH instruction, and is also the first popped off the stack. Multiple expressions can be pushed onto the
argument stack by separating the expressions with commas.

The PUSH and POP instructions alleviate some of the problems of global variables in Basic. They eliminate
the need to equate subroutine variables to global variables used by the program which called the subroutine.

RELATED

POP, LD@, ST@

ERROR

A-STACK Attempt to push too many values on the argument stack. Typically no more than 32 values may

be PUSHed onto the stack before it is full.

EXAMPLE

Please refer to the POP example.

Advertising