HPlogo MPE/iX Intrinsics Reference Manual > Chapter 10 Command Definitions (QUIT-ZSIZE)

SWITCHDB

MPE documents

Complete PDF
Table of Contents
Index

Edition 7 E0701 ♥
Edition 7 E0300
Edition 6 E0195

CM callable only.

Switches the DB register pointer. Privileged mode (PM) capability is required.

Syntax



  U16         O-P       U16V
  logindex := SWITCHDB (index);

Functional Return


logindex

16-bit unsigned integer (assigned functional return)

Returns the logical index of the data segment indicated by the previous DB register setting, allowing this setting to be restored later. If the previous DB setting indicated the stack, a zero is returned.

Parameters


index

16-bit unsigned integer by value (required)

Passes the logical index of the data segment where the DB register is to be switched (obtained through the GETDSEG intrinsic). The value specified is checked to ensure that the process has acquired access to the segment previously. For an extra data segment, a positive, nonzero integer must be specified. To switch to the stack segment, a zero must be specified.

Condition Codes


CCE (2)Request granted.
CCG (0)Not returned.
CCL (1)Request denied. An illegal data segment was specified.

Related Information


Intrinsics ALTDSEG, DMOVIN, DMOVOUT, FREEDSEG, GETDSEG
Manuals Introduction to MPE XL for MPE V Programmers




SUSPEND


TERMINATE