Once you have the name loaded into OP1 you can call _FindSym to get the TI86 to return all the information and locations of the variable whose name is in OP1. Before calling _FindSym, you need to have OP1 containing the variable name you want to find (case is sensitive) in Variable Name Format. Once called, it will return: carry flag set if variable by that name doesn't exist, carry flag reset if variable exists, a is variable type, OP1 will still contain the variable in Variable Name Format, bde will be an Absolute Address Pointer to variable data, and hl will point to the address of the VAT entry of the variable.
Description Finds the variable with the name stored in OP1.
Input OP1 - case sensitive variable name in Variable Name Format. Note: You can leave out the variable type byte, _FindSym ignores it and just finds a variable with the same name.
There is a call that will copy 10 bytes starting at hl into OP1: _Mov10toOP1. This is even shortened more by just putting rst 20h instead of call _Mov10toOP1. So the above code would be 22 bytes (I'm counting opcodes) whereas the below code, doing exactly the same thing, would only be 13 bytes.
Remember that _FindSym ignores the type byte that the first byte of OP1 is holding. We can put some trash in there...anything you want. This can be to our advantage because we can have our routine copy the byte before our 'variable' storage area as the type; but we need to account for that when we're loading hl with the address of the name to be sure that it's copying starting one byte ahead of this label. This is really confusing so try to think through our new optimized routine.