Updated June 2012; see History
xcall GETADR, var, varaddr {, varsize}
GETADR.SBR retrieves the memory address, and optionally the size, of the variable specified as the first parameter. This technique was used in the so called "Speed Optimized Interface" of INFLD under AMOS, and is preserved here just for backward compatibility. The so called interface is a misnomer under A-Shell, where it actually requires more overhead, and thus is not recommended for new programming. Getting the address and size of a variable might have some other exotic application, but we are not sure what.
Parameters
var [in]
can be any arbitrary variable.
varaddr [out]
can be any numeric type.
varsize [out]
if specified, must be a 2 byte binary. Note that if var is an array element, the size and address will be for that element, not for the entire array. You can get the starting address of the array by specifying the first element, but the only way to get the total size of the array would be to map an unformatted variable on top of the array with the appropriate size specified in the MAP statement.
Comments
Note that iIf the address parameter specified in argument 2 is an X,8 variable, then it is assumed to be formatted as a pair of B,4 variables as in the structure above. This will allow for a transition to 64 bit mode should it ever occur, without the application having to be aware of it.
History
2012 June, A-Shell 6.1.1307: Add X,8 / B,4 relationship described in Comments above.