linking Tasm obj's or lib's to (ugh, I know) Pascal 
Author Message
 linking Tasm obj's or lib's to (ugh, I know) Pascal

I need to know this because i'm using Pascal at school, but it uses
TPU's instead of libs.  are these the same things?  if not, how do you
convert?  It is v5.0 of tasm(mine) and a version from 1993 of turbo
pascal(school's).  Please e-mail me if you can.  I added the PASCAL
directive to the model of the asm file.

attn pascal lovers:  do not flame me for liking c better than pascal,
                     but please help.



Mon, 23 Aug 1999 03:00:00 GMT  
 linking Tasm obj's or lib's to (ugh, I know) Pascal


Quote:

> I need to know this because i'm using pascal at school, but it uses
> TPU's instead of libs.  are these the same things?  if not, how do you
> convert?  It is v5.0 of tasm(mine) and a version from 1993 of turbo
> pascal(school's).  Please e-mail me if you can.  I added the PASCAL
> directive to the model of the asm file.

Isn't there a newsgroup for Pascal?

Anyway, they're completely different, LIB's and TPU's, totally unrelated
animals, but there is a way to include an OBJ into Pascal code.

I'll check the X00 docs, since it has an example for including its OBJ file
into a Pascal program.

In the Pascal code, you have to do this (example taken from X00 TPHLLAPI
docs):

PROCEDURE Bypass; EXTERNAL;
PROCEDURE TPX00( VAR Regs : REGISTERS ); EXTERNAL;
{The above two lines declare the OBJ's public procedures}
{$L TPX00.OBJ}
{The above line actually instructs TP to link in the OBJ file}

In the ASM code, you have to set it up like this (example taken from
Mastering Turbo Assembler, so it's in IDEAL mode, convert to MASM mode if you
wish):

IDEAL
;above line puts TASM in IDEAL mode
MODEL TPASCAL
;.MODEL TPASCAL
;in MASM mode

Note that TPASCAL is a special memory model supported by TASM that should be
used when writing code to be included in Turbo Pascal.  In the TPASCAL memory
model, you can use the simplified CODESEG and DATASEG directives instead of
declaring named segments, TASM automatically prepares and restores the BP
register for you, paramaters on the stack are precalculated, allowing you to
address the parameters by name rather than computing stack offsets, and the
correct immediate value is automatically added to the ret instruction to
remove paramater bytes from the stack.  For arguments, you can use ARG in the
ASM code, like this:

PROC ThisProc NEAR
     ARG MyNumber:WORD, MyOtherNum:WORD
; In the book, I see no MASM equivalent to ARG above, you may need to use
; IDEAL mode to do it this way.
mov ax, [MyNumber]
; would be the same as:
;mov ax, [word bp + 4]

If this doesn't help, email me and I'll send you some example Pascal and ASM
code to show you exactly what I'm talking about.



Mon, 23 Aug 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. link ASM files (TASM) to Turbo Pascal (I know Pascal sux)

2. Need help linking NASM .obj's to C++ obj's

3. Linking MF copiled obj's with Turbo C++ obj's

4. TASM BC++ linking obj linking probs

5. tasm's ".OBJ" structure

6. Need TASM's .OBJ file format description...

7. TASM TLINK32 support for Msoft OBJ's???

8. Linking C++ OBJ's

9. Need more help Linking NASM .obj's

10. Linking masm obj's to Borland c++

11. linking obj's with Borland TLINK

12. Linking MF copiled obj's with Turbo C++

 

 
Powered by phpBB® Forum Software