Argument stack, Control stack – Rockwell Automation 1771-DB Basic Module User Manual - Series A User Manual

Page 42

Advertising
background image

Operating Functions

Chapter 5

5–5

The argument stack (A-stack) stores all constants that the BASIC Module
is currently using. Operations such as add, subtract,

multiply and divide

always operate

on the first two numbers on the argument stack and

return

the result to the stack. The argument stack is 203 bytes long.

Each floating point

number placed on the stack requires 6 bytes of

storage. The argument stack can hold up to 33 floating

point numbers

before

overflowing.

The control stack (C-stack)

stores all information associated with loop

control (i.e. DO-WHILE, DO-UNTIL,

FOR-NEXT, BASIC subroutines

and “PUSHed” or “POPed” values). The control

stack is 157 bytes long.

DO-WHILE and

DO-UNTIL loops use 3 bytes of control stack.

FOR-NEXT loops

use 17 bytes. The control stack contains enough

space

for up to 9 nestings of control loops.

5.2.12
Argument Stack

5.2.13
Control Stack

Advertising