65
2002
LDD 2,X
2004
ADD #10
2007
STD 2,X
2009
PULX
2010
PULA
2011
RTS
Program Remarks:
When program execution branches to the assembly language routine, the
TYPE of <argument> is stored in the accumulator A, and the memory ad-
dress where the argument is stored is input to the index register X. The value
of the argument is stored in the accumulator D, to whose contents &H10 will
be added. The result of the addition is written to the address of <argument>.
VARPTR Function
Purpose:
Returns the memory address of the variable argument
Format:
<x> = VARPTR(<variable>)
<variable> is a number, string, or array variable.
Example:
B = VARPTR (A)
Remarks:
The VARPTR function returns the address of the first byte of data identified
with the variable. A value must be assigned to the variable prior to the call to
VARPTR or an error will result. Any type variable name may be used (numer-
ic, string, array).
Note that all simple variables should be assigned before calling VARPTR for
an array because addresses of arrays change whenever a new simple vari-
able is assigned.
VARPTR is used to obtain the address of a variable or array so that it may be
passed to an assembly language subroutine. A function call of the form
VARPTR(A(0)) is specified when passing an array, so that the lowest ad-
dressed element of the array is returned.
The following figure illustrates the relationship between the variable type and
the address indicated by VARPTR.
BASIC Language
Section 4-2
Summary of Contents for SYSMAC C200H-ASC02
Page 1: ...Cat No W165 E1 04 ASCII Unit SYSMAC C200H ASC02 ...
Page 2: ...C200H ASC02 ASCII Unit Operation Manual Revised September 2002 ...
Page 3: ...iv ...
Page 5: ...vi ...
Page 7: ...TABLE OF CONTENTS viii Glossary 159 Index 163 Revision History 165 ...
Page 122: ...Appendix B Specifications 115 130 35 100 5 ...
Page 168: ...Cat No W165 E1 04 C200H ASC02 ASCII Unit OPERATION MANUAL ...