|>
|> I want to call an old assembler routine, from which I don't have the
|> code. I have to submit a string variable. The assembler program awaits
|> three bytes as parameter for the string variable (as in GW-Basic): Byte
|> 0 has to be the length of the string, Bytes 1 and 2 has to be the
|> address of the string variable. How can I construct the parameter ?
In your subject line, you mention CALL ABSOLUTE. I assume that
the assembler program is called by CALL ABSOLUTE. Because of that,
in a very real way you do have the source code for the routine.
It probably appears as a set of DATA statements that are loaded
into a string. These DATA statements represent a set of machine
code instructions.
Probably the best thing to do is to find the instruction that
pulls the length byte off the stack and loads it into a register.
Just rewrite the instruction to pull two bytes off the stack.
This should be among the first 5 or six instructions.
QB45 passes a string as a four-byte descriptor:
Bytes 0-1 = length of string
Bytes 2-3 = offset of string in DGroup segment
Alternatively, you might experiment with a fixed length string:
DIM ThreeBytes AS STRING * 3
If it works, who cares if it is a kludge?
--
Brian McLaughlin, Technical Writer |"Thanks to the Internet, misinformation
Integrated Measurement Systems, Inc.| now travels faster than ever before!"
Beaverton, OR, USA | ---- Standard disclaimer applies ----