Blind" Parameters - HP 9835A Programming Manual

35 series desktop computer assembly development rom
Table of Contents

Advertisement

112
Communication Between BASIC and Assembly Language
"Blind" Parameters
With explicit parameter declarations, an error occurs if a different type of variable or expression
is passed. In many cases, the error is desirable - you do not want different types of arguments
corresponding to a single parameter declaration. But in other cases, the error might not be as
desirable. Take the example of a sort. You might want the sort to have the capability of sorting
any type of array. You have two choices in that case - you can make different routines, each
with the appropriate declarations, or you can use a single entry point and the ANY parameter
declaration.
The ANY declaration -
is "blind" to the type of the corresponding argument in the ICALL statement. When used, it
accepts any type of argument as valid - string, full-precision, short-precision, integer, file
number, array. The descriptor for the argument is stored in the three words set aside, just as in
the other declarations.
Now, if your entry looks like -
ISCD~:E
SUB
ISOURCE
ANY
IS(DRCE
REl
"!"
:"!
i
~.(.
r
::;C)("t:;
L..Ilfi
then any of the following calls would be valid -
~HLL
Srn~t(Test$(*),
100)
I
r' :
~::li!
::; c:t-·
t
<
'r
i::':;:. t :::
.~:.
::::: :t i?
ij
::=
ICAll
SQrt(#l,l~~)
When using the ANY declaration, it becomes the responsibility of your assembly language
routine to determine what is a valid parameter and what is not. You lose the automatic type-
checking available with explicit declarations. Techniques for doing this are discussed in the
next section.

Advertisement

Table of Contents
loading

Table of Contents