Communication Between BASIC and Assembly Language 125 4. Load register B with the address of the parameter declaration. 5. Call the utility. Exit Conditions: There are no error exits from the utility, so it always returns to the instruction following the call. For example - T~insfer 10 characters Substring storage area 1st character (ignore length) ISOURCE Parameter: STR Other info already saved In this example, Value is the storage area containing the string to be transferred.
Since 2 has already been generated and stored in the first word, and 10 in the second, the first 10 bytes of string are numbered starting with 0, and bytes 0 and 1 contain th~ length of the string (see the string are changed. Why was the value 2 stored as the byte number? Because bytes in a "Data Structures" in Chapter 3). UTILITY: Put_ elem _bytes This utility changes a substring of an element in a string array which has been passed as an General Procedure: This is a combination of the "Put-element" and "Put-bytes" utilities. argument. The utility is given the starting byte and the number of bytes to be transferred. Special Requirements:
The bytes to be transferred are preceded by two words in the storage area. The two words contain the starting byte for the substring and the number of bytes to be transferred. The array information for the array must be retrieved with the "Get_info" utility before calling this utility. The offset of the element in the array must be correct in the array information for the array element is dependent upon the number of dimensions in the array and the length of each. A calculation may be ne~essary to arrive at the offset when accessing mUltiple-dimension (word 16 returned by "Get_info"). It should be remembered that the offset of the arrays. The offset is in terms of number of elements.