22.02.2015 Views

HLASM Language Reference

HLASM Language Reference

HLASM Language Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

SETAF Instruction<br />

Alternative Statement Format: You can use the alternative statement format for<br />

extended SETx statements. The above coding could then be written as follows:<br />

&LIST(3) SETA 5, THIS IS X<br />

1,, AN ARRAY X<br />

2,25,3<br />

SPECIFICATION<br />

SETAF Instruction<br />

Use the SETAF instruction to call an external function to assign any number of<br />

arithmetic values to a SETA symbol. You can assign a large number of<br />

parameters—the exact number depending on factors such as the size of the<br />

program and of virtual storage—to pass to the external function routine.<br />

The SETAF instruction can be used anywhere that a SETA instruction can be used.<br />

►►──variable_symbol──SETAF──'function─name'<br />

──┬─────────────────┬───►◄<br />

│ ┌<br />

─────────────┐<br />

│<br />

└── ▼ ─,expression─┴─┘<br />

variable symbol<br />

is a variable symbol.<br />

A global variable symbol in the name field must have been previously declared<br />

as a SETA symbol in a GBLA instruction. Local SETA symbols need not be<br />

declared in a LCLA instruction. The assembler considers any undeclared<br />

variable symbol found in the name field of a SETA instruction as a local SET<br />

symbol.<br />

The variable symbol is assigned a type attribute value of N.<br />

function_name<br />

the name of an external function load module. The name must be specified as<br />

a character expression, and must evaluate to a valid module name no longer<br />

than 8 bytes.<br />

Refer to Chapter 5, “Providing External Functions for Conditional Assembly” in<br />

the <strong>HLASM</strong> Programmer's Guide for information about external function load<br />

modules.<br />

expression<br />

is an arithmetic expression evaluated as a signed 32-bit arithmetic value. The<br />

minimum and maximum allowable values of the expression are −2 31 and<br />

+2 31 −1, respectively.<br />

See “SETA Instruction” on page 347 for further information about setting SETA<br />

symbols, and ways to specify arithmetic expressions.<br />

The function name must be enclosed in single quotes. For example:<br />

&MAX_VAL SETAF 'MAX',7,4 Calls the external function X<br />

MAX, passing values 7 and X<br />

4 as operands.<br />

388 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!