122 Communication Between BASIC and Assembly Language Changing the Value of an Argument At some point during the execution of your assembly language routine, you might want to accomplish the other half of this method of communication with BASIC - namely, changing the value of a BASIC variable which is used as an argument, in effect changing the value of a BASIC variable from the assembly language routine. As with retrieving a value, there are a number of utilities available for changing a value. The one to use is dependent upon the type of argument passed.
The utilities available are - Name U~dFm Put value Simple variables and individual elements of arrays passed as arguments Put element Elements (from arrays passed as arguments) Put_bytes Substrings of strings passed as arguments either as simple variables or as individual elements of arrays passed as arguments. Put_ elem _bytes Substrings of elements (from string arrays passed as arguments) How each of these utilities is used is described in the immediately following pages. UTILITY: Put value General Procedure: The utility is given the address of the parameter declaration and the address of the value. It changes the value of the BASIC variable associated with the parameter.
It works only on simple variables and individual elements of arrays (passed as arguments), of any type. Special Requirements: The value must have the appropriate data structure for the data type of the argument (see "Data Structures" in Chapter 3) . • An actual argument must have been passed by the ICALL for the utility to work properly. Calling Procedure: 1. Load register A with the address of the storage area of the value. 2. Load register B with the address of the parameter declaration. 3. Call the utility.