28.11.2012 Views

Table of Contents - TG Drives

Table of Contents - TG Drives

Table of Contents - TG Drives

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

EXTENDED REGISTER GROUPS<br />

STACK HANDLING<br />

Group Group<br />

No.<br />

Description<br />

Stack handling<br />

Stack 1 The register bank, Stack, is a circular stack that can<br />

accommodate 64 register values, 32 bits wide. Since<br />

the stack is circular, there is no error trap when<br />

pushing the 65th number on the stack; however, the<br />

1st number is overwritten.<br />

GENERAL<br />

The stack group consists <strong>of</strong> 64 registers (32 bit) that can be used by the application<br />

program for temporary storage <strong>of</strong> data. The function is circular when data is taken<br />

(poped) from the stack and linear when data is pushed onto the stack. The system<br />

uses the stack for temporary storage <strong>of</strong> interrupt masks when Int.Mode = 1.<br />

FUNCTION<br />

Data is placed onto the stack with the PUSH statement where the argument can be<br />

a register or a constant. Data is taken from the stack with the POP statement<br />

where the argument must be a register.<br />

The value in Stack.63 is lost when a PUSH statement is executed.<br />

Reset status: After one<br />

entry:<br />

(PUSH Data1)<br />

After two<br />

entries:<br />

(PUSH Data2)<br />

Stack.63 0 0 0 Data2<br />

. . . . .<br />

Stack.5 0 0 0 0<br />

Stack.4 0 0 0 0<br />

Stack.3 0 0 0 0<br />

Stack.2 0 0 0 0<br />

Stack.1 0 0 Data 1 0<br />

Stack.0 0 Data 1 Data 2 Data 1<br />

RELATED ITEMS<br />

PUSH or <br />

PUSH or <br />

POP <br />

Int.Mode = 1 See Group number 10 (Int) for information.<br />

EXAMPLE USAGE<br />

Transfer data to a subroutine for conversion.<br />

After one<br />

recall:<br />

(POP )<br />

User's Manual 5.1 Inmotion Technologies AB<br />

Doc. No.9032 0027 01 (B), Rev. 11.07.2001<br />

55

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!