Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

problem with tlink32

216 views
Skip to first unread message

Stefan Bischof

unread,
Sep 27, 2000, 3:00:00 AM9/27/00
to
I want to make a simple "Hello World"-programm

After succesfully assembling i wanted to link the file with tlink32
but the answer of tlink32 was:
Fatal: 16 bit segments not supported in module hello.asm

Could anybody tell me what the problem is?
(I know my english isn't very good)
thanks


Bob Gonder

unread,
Sep 27, 2000, 3:00:00 AM9/27/00
to
Stefan Bischof <stef...@gmx.at> wrote:
>I want to make a simple "Hello World"-programm
>
>After succesfully assembling i wanted to link the file with tlink32
>but the answer of tlink32 was:
>Fatal: 16 bit segments not supported in module hello.asm
>
You have assmebled a 16 bit module instead of 32.
My code starts as follows (may be inefficient, but it works):

.386
_TEXT32 SEGMENT PARA USE32 PUBLIC 'DATA'
ASSUME CS: _TEXT32, DS: _TEXT32, SS: _TEXT32, ES: _TEXT32
_TEXT32 ENDS
_TEXT32 SEGMENT PARA USE32

your code here

Most important, is to get the .386 on the first line, _before_ any
other commands.
If you still have problems, post your code (cut and paste into the
message).


Stefan Bischof

unread,
Oct 2, 2000, 3:00:00 AM10/2/00
to
Bob Gonder schrieb:

There ist just the same error.
I only wanted to write a "Hello World"-program.
A friend gave me this code:

DATEN SEGMENT
text db "test"
db "$"
DATEN ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATEN
mov ax,DATEN
mov ds,ax
mov dx,offset text
mov ah,9
int 21h
mov ah,4ch
int 21h
CODE ENDS
END

could anybody send me a version that's "linkable"?

Thank you!
Stefan Bischof

Remy Lebeau

unread,
Oct 2, 2000, 3:00:00 AM10/2/00
to
When I do that in my test program, TASM32 no longer compiles, complaining of
an error in using a 32-bit pointer. So I was guessing that TASM32 only
compiles 16-bit while TLINK32 links 32-bit?


Gambit

"Bob Gonder" <no...@notmindspring.com> wrote in message
news:umr4tsguhgqpi0ue9...@4ax.com...

Bob Gonder

unread,
Oct 2, 2000, 3:00:00 AM10/2/00
to
Stefan Bischof <stef...@gmx.at> wrote:

>Bob Gonder schrieb:
>
>> Stefan Bischof <stef...@gmx.at> wrote:
>> >I want to make a simple "Hello World"-programm
>> >
>> >After succesfully assembling i wanted to link the file with tlink32
>> >but the answer of tlink32 was:
>> >Fatal: 16 bit segments not supported in module hello.asm
>> >
>> You have assmebled a 16 bit module instead of 32.
>> My code starts as follows (may be inefficient, but it works):
>>
>> .386
>> _TEXT32 SEGMENT PARA USE32 PUBLIC 'DATA'
>> ASSUME CS: _TEXT32, DS: _TEXT32, SS: _TEXT32, ES: _TEXT32
>> _TEXT32 ENDS
>> _TEXT32 SEGMENT PARA USE32
>>
>> your code here
>>

>> Most important, is to get the .386 on the first line, _before_ any
>> other commands.

>> If you still have problems, post your code (cut and paste into the
>> message).
>
>There ist just the same error.
>I only wanted to write a "Hello World"-program.
>A friend gave me this code:
>

.model compact
.386
.data
>;;;;;;;DATEN SEGMENT


>text db "test"
> db "$"
>;;;;;;;DATEN ENDS

.code
public main
main:
>;;;;;;;;CODE SEGMENT
>ASSUME CS:CODE,DS:DATA
>mov ax,DATA


>mov ds,ax
>mov dx,offset text
>mov ah,9
>int 21h
>mov ah,4ch
>int 21h
>;;;;;;;;;CODE ENDS

ends

Bob Gonder

unread,
Oct 2, 2000, 3:00:00 AM10/2/00
to
"Remy Lebeau" <gamb...@gte.net> wrote:

>When I do that in my test program, TASM32 no longer compiles, complaining of
>an error in using a 32-bit pointer. So I was guessing that TASM32 only
>compiles 16-bit while TLINK32 links 32-bit?
>

I dont have TASM32 (yet). I still use TASM (3.1).
Since the old TASM compiles 16 and 32 bits fine, I would
expect TASM32 to do an even better job of compiling 32 bits.

You are trying to do a 32bit program?

my 32bit compiler: TASM = k:\TASM /MX /z /m5 /p
my 16bit compiter: TASM = k:TASMx /m5 /MX

(TASMx is a protected mode version, for more memory. Maybe I'll start
using that for my 32 bit stuff as well.)

My first include in all *.asm Note that the 16 bit startup has
been commented out. Hmmm there's no model statement in 32bit.
If you want 16bits, reverse the comments.

;;;.model farstack small
;;;.386
;;; include truefals.h86
;;;SEGMENT seg_system PARA PUBLIC 'FAR_DATA' USE16
;;;ENDS
;;;ASSUME GS:_DATA
;;;ASSUME FS:seg_system


.386
_TEXT32 SEGMENT PARA USE32 PUBLIC 'DATA'
ASSUME CS: _TEXT32, DS: _TEXT32, SS: _TEXT32, ES: _TEXT32
_TEXT32 ENDS
_TEXT32 SEGMENT PARA USE32

include truefalse.h86

Remy Lebeau

unread,
Oct 2, 2000, 3:00:00 AM10/2/00
to

"Bob Gonder" <no...@notmindspring.com> wrote in message
news:sknitss84s71kk1tb...@4ax.com...

> I dont have TASM32 (yet). I still use TASM (3.1).

I'm using TASM32 v5.3 that comes with C++ Builder

> You are trying to do a 32bit program?

I was just trying to get ANYTHING to work, 16- or 32-bit

> My first include in all *.asm Note that the 16 bit startup has
> been commented out. Hmmm there's no model statement in 32bit.
> If you want 16bits, reverse the comments.

I finally had a friend show me how he uses TASM32 for his stuff, here's an
example of the code I now use:


.386
.MODEL FLAT,STDCALL
.CODE
START:
MOV DL,7 ;Character to be output. ASCII 7 is the DOS beep.
MOV AH,2 ;Putting 2 in register AH will call function 2
INT 21 ;Execute interrupt 21h function 2 to output character to CON.
RET ;Return to DOS
END START

Compiles and links without errors, as do other code samples my friend gave
me. So now I have the basics I was looking for before to get programs to
compile and link


Gambit

Remy Lebeau

unread,
Oct 3, 2000, 3:00:00 AM10/3/00
to
Yes, it does


Gambit

"Manuel Algora" <m...@encomix.es> wrote in message
news:rloktsci8tkdborqk...@4ax.com...

> Excuse me, but does it run?


Remy Lebeau

unread,
Oct 3, 2000, 3:00:00 AM10/3/00
to
No, it doesn't, afterall. Looks like I was still running the original .com
file I made with DEBUG. I just tried the .exe file and I got a BSOD


Gambit
"Remy Lebeau" <gamb...@gte.net> wrote in message
news:8re3m9$h5...@bornews.borland.com...
> Yes, it does


Manuel Algora

unread,
Oct 4, 2000, 3:00:00 AM10/4/00
to
On Mon, 2 Oct 2000 22:09:07 -0700, "Remy Lebeau" <gamb...@gte.net>
wrote:

>.386
>.MODEL FLAT,STDCALL
>.CODE
>START:
>MOV DL,7 ;Character to be output. ASCII 7 is the DOS beep.
>MOV AH,2 ;Putting 2 in register AH will call function 2
>INT 21 ;Execute interrupt 21h function 2 to output character to CON.
>RET ;Return to DOS
>END START
>
>Compiles and links without errors

Excuse me, but does it run?

Manuel Algora
m...@encomix.es

Manuel Algora

unread,
Oct 4, 2000, 3:00:00 AM10/4/00
to
On Tue, 3 Oct 2000 19:22:19 -0700, "Remy Lebeau" <gamb...@gte.net>
wrote:

>No, it doesn't, afterall.
I guessed that. You are trying to call DOS interrupts from a 32-bit
Flat program. That is a no-no.

Manuel Algora
m...@encomix.es

Epidemi

unread,
Oct 10, 2000, 3:00:00 AM10/10/00
to

Try this code:

.model tiny
.radix 16
.286

cseg segment byte public 'code'
assume cs:cseg,ds:cseg,es:cseg,ss:cseg

org 100h

Main proc nearextrn _cproc
mov ah, 09
mov dx, offset msg
int 21h
int 20h
msg: db "Hello world!$"
Cseg ends
End Main

compile with TASM <file.asm>
link with LINK /TINY <file.asm>
a .COM file will be created for you :)

Greetz

Stefan Bischof <stef...@gmx.at> wrote:
>Bob Gonder schrieb:
>
>> Stefan Bischof <stef...@gmx.at> wrote:
>> >I want to make a simple "Hello World"-programm
>> >
>> >After succesfully assembling i wanted to link the file with tlink32
>> >but the answer of tlink32 was:
>> >Fatal: 16 bit segments not supported in module hello.asm
>> >
>> You have assmebled a 16 bit module instead of 32.
>> My code starts as follows (may be inefficient, but it works):
>>

>> .386
>> _TEXT32 SEGMENT PARA USE32 PUBLIC 'DATA'
>> ASSUME CS: _TEXT32, DS: _TEXT32, SS: _TEXT32, ES: _TEXT32
>> _TEXT32 ENDS
>> _TEXT32 SEGMENT PARA USE32
>>

>> your code here
>>
>> Most important, is to get the .386 on the first line, _before_ any
>> other commands.
>> If you still have problems, post your code (cut and paste into the
>> message).
>
>There ist just the same error.
>I only wanted to write a "Hello World"-program.
>A friend gave me this code:
>

>DATEN SEGMENT
>text db "test"
> db "$"
>DATEN ENDS

>CODE SEGMENT
>ASSUME CS:CODE,DS:DATEN
>mov ax,DATEN


>mov ds,ax
>mov dx,offset text
>mov ah,9
>int 21h
>mov ah,4ch
>int 21h
>CODE ENDS

Remy Lebeau

unread,
Oct 10, 2000, 3:00:00 AM10/10/00
to
That code is for TLINK, but this thread is about using TLINK32, which your
code won't link under because it's 16-bit code and TLINK32 is for 32-bit
code.


Gambit

"Epidemi" <ti...@bigfoot.com> wrote in message news:39e32a87$1_1@dnews...
>
> Try this code:


Olivier Fernandez

unread,
Nov 4, 2000, 3:00:00 AM11/4/00
to
Hi,
I have also a problem with tlink32.
I can not open tlink32 under windows 95/98.
I have all the time a error du to the protection memory.

Does exist a patch to solve this problem.

Olivier.

"Epidemi" <ti...@bigfoot.com> a écrit dans le message news:
39e32a87$1_1@dnews...
>
> Try this code:
>

Heiko Vogel

unread,
Nov 24, 2000, 6:26:15 PM11/24/00
to
"Olivier Fernandez" <ofr...@icor.fr> schrieb im Newsbeitrag
news:3a050e62_2@dnews...

> Hi,
> I have also a problem with tlink32.
> I can not open tlink32 under windows 95/98.
> I have all the time a error du to the protection memory.
>
> Does exist a patch to solve this problem.

Preface:
I go around in circles since 1995 to get an real answer to that Question...

Reality:
The TLINK32 (from the TASM4 Package) don't work under Win9x. On my system,
he crash every time with two access violations. It seems to be a normal bug.
To avoid the crash, you must simply shut down to DOS Mode (not only the
Dosbox), build your 32-Bit EXE or DLL and after that, launch Win again.
That's all - but it waste a lot of time.

(My privat) Resolution:
If you're a Community Member, you can download the BCC5.5 for free (8.7MB).
Install it and then try to link your TASM32 Objectfiles with the BCC Linker
ILINK32. That works fine (with the same old Commandline-Switches, like /Tpe
/aa ), but not in all cases. Some constructs go to trash now.
The first things I've found during my short Tests of ILINK32 are:

.code
[... some Code...]
db 100 dup (90h) ; 100 NOP's for Example

Your Application will be crash, because there are 100 Zeros (add [eax],al
under 32-Bit conditions) inside of your code and not the wanted nops. The
ALIGN - Statement is infected too.

... the Code-Flow (cpu runs over the align)
ALIGN 16
; filled normaly with nops or other 'do nothing' codes
; like xchg ebx,ebx to the next 16-Byte Boundary.
; (better use 'align 32' to get the next Cacheline)
My_aligned_Label:
(do something inside the quick loop)
jnz My_aligned_Label

If you're out of luck and 'My_aligned_Label' don't stay on a address that
ends with a xxxxxxx0h, your Align 16 was now filled with ZERO to the next
Boundary. ;-(

Any Suggestions?

bfn heiko
(Sorry about my english)


Manuel Algora

unread,
Nov 26, 2000, 6:29:39 PM11/26/00
to
On Sat, 25 Nov 2000 00:26:15 +0100, "Heiko Vogel" <hevo...@gmx.de>
wrote:

>The TLINK32 (from the TASM4 Package) don't work under Win9x.

But the one from the Tasm5 package does. It is version 1.6.71.0. Which
one comes with Tasm4?

Manuel Algora
m...@encomix.es

Olivier Fernandez

unread,
Nov 26, 2000, 6:43:06 PM11/26/00
to
The TLINK32 (from the TASM4 Package) don't work under Win9x but it works
with windows NT.
I am very surprise.

olivier FERNANDEZ
ofer...@icor.fr

"Manuel Algora" <m...@encomix.es> a écrit dans le message news:
5d432t8aufcp77tt4...@4ax.com...

Heiko Vogel

unread,
Nov 29, 2000, 3:00:00 AM11/29/00
to
> "Manuel Algora" <m...@encomix.es> a écrit dans le message news:
> 5d432t8aufcp77tt4...@4ax.com...
> > On Sat, 25 Nov 2000 00:26:15 +0100, "Heiko Vogel" <hevo...@gmx.de>
> > wrote:
> >
> > >The TLINK32 (from the TASM4 Package) don't work under Win9x.
> >
> > But the one from the Tasm5 package does. It is version 1.6.71.0.
Yes I know. I've asked some People about TLINK32 in the last time. A 'happy'
TASM5 User don't have any problem with this Program under Win9x.

> > Which one comes with Tasm4?

TLINK32 says: Version 1.00 from December 1993
This TASM4 package is still available in Germany on a CD-ROM called
'Borland - Turbo Assembler 4.0' (ISBN-3-7723-9442-6). The CD contains the
TASM 3.2 - Reference in PDF-Format, a lot of (16Bit) Sourcecode and - very
important - the complete Win32s-Subsystem for Win3.1, if anybody need this
to run the 32Bit Tools today. ;-)

I like the good old TASM. Thats why I've tested the TASM4 Assembler with
ILINK32, shortly. But we all know, there is absolutely no need to fight with
(or against) TLINK32. 'Pure & Simple' is the better choice...

bfn heiko

Randolf Richardson

unread,
Nov 30, 2000, 3:00:00 AM11/30/00
to
[Snip]

> > > Which one comes with Tasm4?
> TLINK32 says: Version 1.00 from December 1993
> This TASM4 package is still available in Germany on a CD-ROM called
> 'Borland - Turbo Assembler 4.0' (ISBN-3-7723-9442-6). The CD contains the
> TASM 3.2 - Reference in PDF-Format, a lot of (16Bit) Sourcecode and - very
> important - the complete Win32s-Subsystem for Win3.1, if anybody need this
> to run the 32Bit Tools today. ;-)

Actually, according to Microsoft when Windows 3.1 was released "Windows
3.1 is a true 32-bit multitasking Operating System, unlike Windows
2.x." Since it does require an 80386 to run, as do most of the
applications that run under it, plus one generally worked with the 80386
instruction set when developing Windows 3.x applications, I'd say that
Windows 3.x applications are generally 32-bit.

Note that applications designed to take advantage of the Win32s
subsystem in Windows 3.x aren't compatible with Windows 95/98/ME/NT/2k
-- just try and run the "FreeCell.Exe 32-bit example application" that
comes bundled with the Win32s update for Windows 3.x under Windows 95/98
and you'll see what I mean (it won't run). Microsoft changed the
so-called "32-bit APIs" when Windows 95 was first released back in
December 1995, and I remember many MANY developers complaining about
this (I was glad that I was doing very little Windows development back
then).

> I like the good old TASM. Thats why I've tested the TASM4 Assembler with
> ILINK32, shortly. But we all know, there is absolutely no need to fight with
> (or against) TLINK32. 'Pure & Simple' is the better choice...

I find Borland's linker to be stable. I also prefer TASM because it
doesn't have all the quirks and doesn't add extra instructions behind
the scenes.

--
Randolf Richardson - ran...@inter-corporate.com
Inter-Corporate Computer & Network Services, Inc.
Vancouver, British Columbia, Canada
http://www.inter-corporate.com/

Free NLM library for C/C++ developers - includes ICE_PlaySound()
http://www.inter-corporate.com/products/freeware/icelib/
--- New release --- ICELIB.NLM v1.07c --- Download it today! ---

Ralf Quint

unread,
Nov 30, 2000, 3:00:00 AM11/30/00
to
On Thu, 30 Nov 2000 09:27:33 -0800, Randolf Richardson
<ran...@inter-corporate.com> wrote:

>[Snip]


>> > > Which one comes with Tasm4?

>> TLINK32 says: Version 1.00 from December 1993
>> This TASM4 package is still available in Germany on a CD-ROM called
>> 'Borland - Turbo Assembler 4.0' (ISBN-3-7723-9442-6). The CD contains the
>> TASM 3.2 - Reference in PDF-Format, a lot of (16Bit) Sourcecode and - very
>> important - the complete Win32s-Subsystem for Win3.1, if anybody need this
>> to run the 32Bit Tools today. ;-)
>
> Actually, according to Microsoft when Windows 3.1 was released "Windows
>3.1 is a true 32-bit multitasking Operating System, unlike Windows
>2.x." Since it does require an 80386 to run, as do most of the
>applications that run under it, plus one generally worked with the 80386
>instruction set when developing Windows 3.x applications, I'd say that
>Windows 3.x applications are generally 32-bit.
>

That is not quite right, to use real 32bit code, you would have to use
Win32s, which is an add-on for Windows 3.1x and not part of the
standard distribution. The statement that Windows 3.x applications are
GENERALLY 32bit is definitely wrong. Any part of the standard Windows
3.1x distribution works find in standard more too.....


Antoine Leca

unread,
Dec 1, 2000, 3:00:00 AM12/1/00
to
Randolf Richardson wrote in: 3A268E05...@inter-corporate.com...

> Actually, according to Microsoft when Windows 3.1 was released "Windows
> 3.1 is a true 32-bit multitasking Operating System, unlike Windows
> 2.x."

Surely it refers to Windows NT...

Even if Windows OT (Old Technology ;-)) 3.1 in enhanced mode
had a 32-bit core OS (the evolution of Windows/386 v.2.03 ;-)),
applications still were 16-bit (only .386 were 32 bit programs).
And Microsoft never try to disguise this (but they tried when
W95 was issued).


> Note that applications designed to take advantage of the Win32s
> subsystem in Windows 3.x aren't compatible with Windows 95/98/ME/NT/2k

Wrong. They can be incompatible (for example, MSVCRT.DLL is
definitively not compatible), but they also can be designed
to be compatible. I ran the same copy of FileMaker 3 for a while
under both OSes, for example.

> Microsoft changed the so-called "32-bit APIs" when Windows 95

Wrong. They added some new APIs (as always), but the core remained.

> was first released back in December 1995,

It was in August.

> and I remember many MANY developers complaining about this

Only the persons that are affected will complain.
Many developpers were perfectly happy with W95 compatibility
with both NT3.x and Win32s.
OTOH, many developpers were unhappy with the lack of
stability of Win32s. !-)


Antoine


Randolf Richardson

unread,
Dec 3, 2000, 3:00:00 AM12/3/00
to
[Snip]

> > > and I remember many MANY developers complaining about this
> >
> > Only the persons that are affected will complain.
>
> Since the middle of the 90's Microsoft says: 'WinNT will be the codebase of
> our future releases. DOS and the whole Win9x-Productline will die,
> someday...'
[Snip]

How many times has Microsoft changed their mind? Too many for me to
consider their platforms as truly stable for development. Backwards
compatibility is very important, and they promised that software
designed for the Win32 interface for Windows 3.x would be fully
compatible with Windows 95, but it wasn't.

Also, "Windows NT" (or "WinNT" as you put it) no longer exists -- it's
now Windows 2000, and all that legacy domain stuff isn't supported
anymore. The alternative is MAD (Microsoft Active Directory), which is
still in the beta phase, plus the common recommendation is to wait until
at least service pack 4 before you can count on most of the 63,000 bugs
being resolved.

Definitely not stable. I have great respect for other platforms which
support backward compatibility properly, such as Unix, OS/2, NetWare,
MacOS, PalmOS, and many others. As soon as Microsoft stops abandoning
things and make backward compatibility a priority, then I'll consider
them as a stable platform for development again.

Heiko Vogel

unread,
Dec 3, 2000, 6:14:15 PM12/3/00
to

I'm afraid we are running out of Theme...

"Antoine Leca" <Antoin...@renault.fr> schrieb im Newsbeitrag
news:3a278721_2@dnews...

> Wrong. They can be incompatible (for example, MSVCRT.DLL is
> definitively not compatible), but they also can be designed
> to be compatible.

You're right, but it isn't easy for a Program, which would like to do
something more than open a 'Hello World' MessageBox. ;-))

> > and I remember many MANY developers complaining about this
>
> Only the persons that are affected will complain.

Since the middle of the 90's Microsoft says: 'WinNT will be the codebase of
our future releases. DOS and the whole Win9x-Productline will die,
someday...'

This is only a question of time. Take a look at Windows Me and you'll see.
Grandmother DOS ist still there, but you can't reach her directly. What you
can't see every day - you'll forget...

This simply means: Avoid all undocumented or nonportable Things in your
Programs.

bfn heiko


0 new messages