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.
Form 1:
result = MEMORY({Fetch|FetchN|FetchNX|FetchX},loc,bytes)
Form 2:
MEMORY(STORE,loc,bytes,value,[verify])
Parameters
Returned data (on a successful fetch operation), null string (on a successful store operation), or error text.
Retrieves a character string from memory. No data conversion is performed. Can be abbreviated to F.
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.
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.
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.
Stores the specified string in memory. The stored string is not converted but is stored as is.
Memory address of the storage area to be accessed.
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 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.
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.
ARG n MISSING OR INVALID
VERIFY FAILED
FETCHN INVALID FOR SPECIFIED LENGTH
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*/
Copyright © 2014 CA Technologies.
All rights reserved.
|
|