Bug in TASM5? 
Author Message
 Bug in TASM5?

I just bought TASM5 and came across the following bug, which produces
a "General error" and system error in tlink32. What is wrong with this
code?
Does there exist a newer version of tlink32?


----------------- Put this into file "a1"

        .386
        .model flat,stdcall
        .data

        db ?
class   db 0
        db offset class

        .code

MAIN    LABEL NEAR

        ret

        END MAIN

------------------ Put this into file "a2"

        .386
        .model flat,stdcall
        .data

        db 0

        END

------------------- Run this batch file

tasm32 a1+a2
tlink32 /m/Tpe/aa/c a1 a2

------------------- Gives this output

tasm32 a1+a2
Turbo Assembler  Version 5.0  Copyright (c) 1988, 1996 Borland
International

Assembling file:   a1.ASM
Error messages:    None
Warning messages:  None
Passes:            1

Assembling file:   a2.ASM
Error messages:    None
Warning messages:  None
Passes:            1

Files assembled:  2   Fatal errors:  0   Errors:  0   Warnings:  0
tlink32 /m/Tpe/aa/c a1 a2
Turbo Link  Version 1.6.71.0 Copyright (c) 1993,1996 Borland
International
Fatal: General error in module a1.ASM



Tue, 17 Aug 1999 03:00:00 GMT  
 Bug in TASM5?

Quote:

>         .386
>         .model flat,stdcall
>         .data

>         db ?
> class   db 0
>         db offset class

          ^^^^^^^^^^^^^^^^
Err...Hmm...this goes into a fixup record. Tlink32
is supposed to puke about an 8 bit address fixup since
there is no possibilty to do this in the fixup section
of a PE image. Tasm sees no need to complain since it
does not know you want to create a PE executable from
the .obj later on.

Regards
Wuschel



Tue, 17 Aug 1999 03:00:00 GMT  
 Bug in TASM5?


Quote:
>I just bought TASM5 and came across the following bug, which produces
>a "General error" and system error in tlink32. What is wrong with this
>code?
>Does there exist a newer version of tlink32?


>----------------- Put this into file "a1"

>        .386
>        .model flat,stdcall
>        .data

>        db ?
>class   db 0
>        db offset class

>        .code

>MAIN    LABEL NEAR

>        ret

>        END MAIN

>------------------ Put this into file "a2"

>        .386
>        .model flat,stdcall
>        .data

>        db 0

>        END

>------------------- Run this batch file

>tasm32 a1+a2
>tlink32 /m/Tpe/aa/c a1 a2

>------------------- Gives this output

>tasm32 a1+a2
>Turbo Assembler  Version 5.0  Copyright (c) 1988, 1996 Borland
>International

>Assembling file:   a1.ASM
>Error messages:    None
>Warning messages:  None
>Passes:            1

>Assembling file:   a2.ASM
>Error messages:    None
>Warning messages:  None
>Passes:            1

>Files assembled:  2   Fatal errors:  0   Errors:  0   Warnings:  0
>tlink32 /m/Tpe/aa/c a1 a2
>Turbo Link  Version 1.6.71.0 Copyright (c) 1993,1996 Borland
>International
>Fatal: General error in module a1.ASM

I have also had tlink32 crash, though not in quite the same circumstances.  
One thing that does take it out is if you emit some data into the
data segment, and then forget to specify 'codeseg' before you emit code.  No
warnings from tasm, but it crashes the linker.

This illustrates the problem:

ideal
p586
model flat,stdcall

dataseg

x   db 0

proc f
    ret
endp

end

I also have lots of trouble getting td32 to load a symbol table.  I found that
it does not see any symbols unless you declare a lot of external procedures.  
If you ever have this problem, the best fix is to add all the extrn proc
declarations from the wap32 example to your program.

Paul Bates



Sat, 28 Aug 1999 03:00:00 GMT  
 Bug in TASM5?

I thought I already responded to that. Well, lets be a
little more comprehensive.

Quote:

> >I just bought TASM5 and came across the following bug, which produces
> >a "General error" and system error in tlink32. What is wrong with this
> >code?
> >Does there exist a newer version of tlink32?



[...]

Quote:
> >        .386
> >        .model flat,stdcall
> >        .data

> >        db ?
> >class   db 0
> >        db offset class

           ^^

Try:

           db 100h dup (0)
   class   db 0
           db offset class

and TASM _will_ complain, I guess ;-)

With your code, the following happens:

a1.obj:

0000A9 LEDATA  Segment: _TEXT          Offset: 0000  Length: 0001
    0000: C3                                                 .
0000B1 LEDATA  Segment: _DATA          Offset: 0001  Length: 0002
    0000: 00 01                                              ..
0000BA FIXUPP
    FixUp: 001  Mode: Seg  Loc: LoByte8     Frame: GI[1]   Target: SI[2]
                                ^^^^^^^^

The 8 bit fixup is obviously supported in the .obj, hence
there's no reason for TASM32 to complain.

AFAIR, the NE executable format for instance, does support
8 bit fixup types ( I supports "millions" of fixup types, BTW)

But you attempted to get a PE executable from that. So let's
have a look at what the PE file format says about fixup types:

TYPE MEANING

0    ABSOLUTE (ignored by the loader)

1    HIGH (target considered beeing the high 16 bits of a dword)

2    LOW (target considered beeing the low 16 bits of a dword)

3    HIGHLOW (target considered beeing a dword)

4    HIGHADJUST (basically a 16 bit fixup, more complex)

all others fixup types are either undefined or for use with
different CPUs (not x86).

So which of the above TLINK32 should use for an 8 bit fixup?

No TLINK32 update needed, just replace the questionable "db"
with "dd" ( has been a typo, maybe... ). Data alignment is
another issue...

Regards
Wuschel



Sat, 28 Aug 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. tasm5+WD bug ?

2. BUGS, BUGS, BUGS, BUGS, C4 BUGS

3. TASM5

4. TASM5.0 - turning off certain optimiz..

5. HELP ! Corrupted cmd32.pak in TASM5.0 installation

6. i need TASM5 !!!

7. TASM5 IDE?

8. Prblem with TASM5 (32 bit)

9. TASM5

10. HELP ! Corrupted cmd32.pak in TASM5.0 installation

11. Link? problem with TASM5

12. ATTN: All tasm5.0 owner

 

 
Powered by phpBB® Forum Software