QB 4.5 and CALL ABSOLUTE 
Author Message
 QB 4.5 and CALL ABSOLUTE

Hello,

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 ?

greetings,

Hans-Jrgen Frevel



Sun, 26 Nov 2000 03:00:00 GMT  
 QB 4.5 and CALL ABSOLUTE


|>
|> 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 ----



Sun, 26 Nov 2000 03:00:00 GMT  
 QB 4.5 and CALL ABSOLUTE

Quote:

> 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.

The code which I call by CALL ABSOLUTE is in a library I have to link
with the Basic-program. So I don't have the source code.
The Basic program was compiled with the very old Microsoft Basic
Compiler 5.35. I want to use the QB 4.5 for debugging reasons.

H.-J. Frevel



Mon, 27 Nov 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. QB 4.5 Call Absolute Prob

2. QB 4.5 Call Absolute Problem

3. Calling .asm from QB 4.5 and sending text-strings

4. CALL ABSOLETE() DOESN"T WORK IN QB 4.5

5. CALLING A QB 4.5 PROGRAM by phone?...

6. QB 4.0 Docs/QB 4.5 Wanted

7. want QB 4.5 QB 7.1 FOR FREE!!!

8. Where's QB.LIB in QB 4.5?

9. QB 4.5: reading 16 bit from a port

10. QB 4.5 - Expression too complex

11. Incorporating non-QBasic graphics into QB 4.5 programs

12. WTB: QB 4.5 Book!

 

 
Powered by phpBB® Forum Software