6.09 Direct Memory Access

Lynplex supports direct memory access using the GETAT and PUTAT functions.

GETAT Function

Description:

Returns the data at a specified memory address.

Syntax:

GETAT(datatype, addr[, offset])
GETAT(datatype, addr[index])
datatype
The type of data to be returned. This gives the implicit length of the data.
addr
The storage address of the data to be retrieved.
offset
An offset from addr to the data.
index
An index to a logical array of date of type datatype. This value is multiplied by the length of the data type to give an offset from addr.

Example:

x = GETAT(sint32, aa)  // stores a signed integer in x

PUTAT Function

Description:

Writes data at a specified memory address.

Syntax:

PUTAT(datatype, addr[, offset]) = value
PUTAT(datatype, addr[index]) = value
datatype
The type of data to be written. This gives the implicit length of the data.
addr
The storage address of the data to be written.
offset
An offset from addr to the data.
index
An index to a logical array of date of type datatype. This value is multiplied by the length of the data type to give an offset from addr.

Example:

PUTAT(sint32, aa) = x  // stores a signed integer in at location aa

PEEK/POKE

For users who are familiar with Basic the words PEEK and POKE may be used as synonyms.

Implementation Status

LynPlex Interpreter
To be implemented
Currently there is no support for direct memory access.
LynPlexC Compiler
To be implemented
Currently supports a version of PEEK and POKE.
LynPlexS Compiler
To be implemented
Currently supports a range of functions that are type specific.

lynplex/lp0609.txt · Last modified: 2011/09/08 16:07 (external edit)