Previous Topic: LU2()Next Topic: MLWTO()


MEMORY()

This function fetches or stores memory contents.

Note: If you are not using the appropriate address space ID and storage protection key, the MEMORY() function fails.

Syntax

Form 1:

result = MEMORY({Fetch|FetchN|FetchNX|FetchX},loc,bytes)

Form 2:

MEMORY(STORE,loc,bytes,value,[verify])

Parameters

result

Returned data (on a successful fetch operation), null string (on a successful store operation), or error text.

FETCH

Retrieves a character string from memory. No data conversion is performed. Can be abbreviated to F.

FETCHX

Retrieves a character string from memory with the high-order bit always turned off. Use FETCHX to access a hexadecimal address. Can be abbreviated to FX.

FETCHN

Retrieves a value from memory and converts it to a decimal value. This value is positive or negative, depending upon the high-order bit in the source string. Can be abbreviated to FN.

FETCHNX

Retrieves a value from memory, discards the high-order bit, and returns the remaining positive value as a decimal number. Can be abbreviated to FNX.

STORE

Stores the specified string in memory. The stored string is not converted but is stored as is.

loc

Memory address of the storage area to be accessed.

bytes

Number of bytes to retrieve or store. The maximum number is 256 for a binary string (no conversion). FETCHX, FETCHN, and FETCHNX have a limit of 8 bytes.

value

Value to replace the current storage contents. The length must be the same as specified by the bytes argument. No type conversion is performed; value is assumed to specify data in the same format that it is stored.

verify

The current binary value for the memory location. If the value you specify does not match the actual value, the store operation is not carried out.

Return Codes

101 - 109

ARG n MISSING OR INVALID

124

VERIFY FAILED

125

FETCHN INVALID FOR SPECIFIED LENGTH

126

EXCESS ARGUMENTS

Example

memory('f',16,4)  == '80FD7508'x    /* A data string, no 
                                       conversion */
memory('fx',16,4) == '00FD7508'x    /* A data string, high bit
                                       off */
memory('fn',16,4) == '-2164094216'  /* A signed decimal
                                       conversion */
memory('fnx',16,4)== '16610568'     /* Decimal conversion, high
                                     bit off*/