TASM to NASM and/or NASM to TASM 
Author Message
 TASM to NASM and/or NASM to TASM

I know there is a way to have TASM assemble to NASM object code or for
NASM to assemble to TASM object code, because the raw source code for
those two assemblers is completely different.

What I want to do is use NASM to compile an assembly language source
code file, to TASM object code. Is there a compiler switch or
something that I can set to do this?



Sat, 02 Oct 2004 01:21:21 GMT  
 TASM to NASM and/or NASM to TASM

Quote:

> I know there is a way to have TASM assemble to NASM object code or for
> NASM to assemble to TASM object code, because the raw source code for
> those two assemblers is completely different.

> What I want to do is use NASM to compile an assembly language source
> code file, to TASM object code. Is there a compiler switch or
> something that I can set to do this?

Nasm uses the "-f" switch to set output format. "-f obj" sets OMF
format, which is what Borland uses (for 32-bit code, MS wants "-f
win32"). AFAIK, there's no special "Tasm object code", and Nasm will
produce several different object code formats.

Trying to link Nasm-generated code with Tasm- or bcc- generated code may
produce a complaint from Tlink about a missing ".def" file. I don't know
what that is - an example would be welcome! I *think* you can get around
it by making the names and attributes of the sections you give Nasm
match the ones Tasm/bcc uses. Something like:

section CODE public align 16 use32 code
section DATA public align 16 use32 data

I'm not sure that's exactly right (might be "_CODE"). Maybe Tdump would
give up what Tasm's using (?). There was an example on the "Nasm forum",
but in yet another web-site upheaval, that stuff's gone missing. Poking
around with Nasm's allowable attributes, and looking at what Borland's
calling things should come up with a workable combination.

As far as assembling Tasm *source* code - newer (experimental!) versions
of Nasm have the "-t" switch, which combined with "scitech.mac" is
supposed to assemble some sub-set of Tasm code. I really don't know what
it's capabilities are.

Best,
Frank



Sat, 02 Oct 2004 10:56:04 GMT  
 TASM to NASM and/or NASM to TASM
Quote:
----- Original Message -----

Newsgroups: comp.lang.asm.x86
Sent: Monday, April 15, 2002 21:21
Subject: TASM to NASM and/or NASM to TASM

> I know there is a way to have TASM assemble to NASM object code or for
> NASM to assemble to TASM object code, because the raw source code for
> those two assemblers is completely different.

Not completely, but to some degree. Even AT&T syntax of AS/GAS isn't
completely different, less than 100% anyway :) But yes, you just can't feed
source for NASM to TASM and vice versa. So, plz, if you know one of the two,
find how to do the same kind of things with the other. The idea of ASM is
the same, no matter if it's NASM, TASM, MASM or something else. It simply is
a bit different form. Find how to express same things in two forms and
you're done.

> What I want to do is use NASM to compile an assembly language source
> code file, to TASM object code. Is there a compiler switch or
> something that I can set to do this?

"-f obj" Just see the manual (NASMDOC.*), it's there.

Good Luck.
Alexei A. Frounze
http://alexfru.narod.ru
http://www.members.tripod.com/protected_mode/



Sat, 02 Oct 2004 12:56:03 GMT  
 TASM to NASM and/or NASM to TASM
Frankie says:

Quote:
> Trying to link Nasm-generated code with Tasm- or bcc- generated code
may
> produce a complaint from Tlink about a missing ".def" file. I don't
know
> what that is - an example would be welcome!

A ".def" file is a "module definition file"...it's a bit of a relic
these days and note that the complaint is only a warning and it says
"using defaults"...basically, the ".def" file provides TLINK (and MS's
stuff also understands DEF files...because, as far as I'm aware, the
whole thing was their idea in the first place :)...

As you want an example, here's one:

---------- 8< ------------

Name          ProgName
Description   'ProgName Imaginery Program (C)2K2 Elisabeth Stone'
EXEType       Windows

Imports
Exports

---------- >8 ------------

This file would stop it complaining but would still use the
defaults...the directives are quite simple..."NAME" specifies the
program name, "DESCRIPTION" is a simple description string, "EXETYPE"
is meant to specify what type of executable to generate but only
"Windows" as far as I know has ever been defined..."IMPORTS" and
"EXPORTS" lists the imports and exports of the program...there are
also directives to specify whether the "CODE" or "DATA" segment is
MOVEABLE, DISCARDABLE, etc., etc....about how big to make the
"STACK"...that sort of thing...

This, as I say, is a relic from Windows 16-bit where this information
was useful and only available from these ".def" files...but they've
become mostly redundent now...as most compilers allow imports and
exports to be defined in the source code itself with "_import" and
"_export" or something like that...and the flags for segments like
"DISCARDABLE" don't apply any more because Win32 does all the memory
management in a completely different way (with paging and virtual
memory, all segments are "discardable" and "load on demand", whether
you like it or not...hehehe ;)...and the "NAME", "DESCRIPTION" and
"EXETYPE" things are basically ignored, anyway...give it a different
"NAME" and it still uses the filename you provide on the command
line...the "description" is ignored by definition because it's
basically just a comment...and the "EXETYPE" - from what I've read -
can only ever be "WINDOWS" anyway...so that's pointless too...

Why TLINK still insists on this crap, I don't know...MS - who invented
it - have long since realised its pointless and ceased using it...but,
there we are, that's what ".def" files are all about...if you really
want to know more, then the Win3.x help files document it fully
(because, as I say, this was what they were used for...to specify the
Windows-specific extras to TLINK like imports / exports and special
options for the code / data segments in the program :)...

Mind you, I hate seeing even warnings show up when I compile...so, I
tend to actually create one of these files in Borland C++ anyway, just
to shut the linker up...plus, anyway, the use of things like "_export"
inside the source code is actually a compiler-specific thing and,
thus, for portable code, the ".def" file might have its uses (say, for
instance, in trying to keep code ANSI compliant...although, if you're
creating Windows code you're going to have trouble with that...the
usual Windows header files aren't ANSI compliant and spew a ton of
errors and warnings...but, at least in principle, that could be a use
for the ".def" file to keep non-ANSI stuff out of Windows code :)...

Basically, it's safe to ignore...or, better yet, try the "/w-def"
switch on the command line...that should shut TLINK up for you as the
warning is an optional thing :)...

Beth:)



Thu, 07 Oct 2004 12:56:09 GMT  
 TASM to NASM and/or NASM to TASM

Quote:

> Frankie says:
> > Trying to link Nasm-generated code with Tasm- or bcc- generated code
> may
> > produce a complaint from Tlink about a missing ".def" file. I don't
> know
> > what that is - an example would be welcome!

> A ".def" file is a "module definition file"...it's a bit of a relic
> these days and note that the complaint is only a warning and it says
> "using defaults"...basically, the ".def" file provides TLINK (and MS's
> stuff also understands DEF files...because, as far as I'm aware, the
> whole thing was their idea in the first place :)...

> As you want an example, here's one:

> ---------- 8< ------------

> Name          ProgName
> Description   'ProgName Imaginery Program (C)2K2 Elisabeth Stone'
> EXEType       Windows

> Imports
> Exports

> ---------- >8 ------------

Thanks, Beth! I confess I can't remember exactly what I was trying to do
when I got that message, and I don't seem to be able to reproduce it
right now :) I've saved your message to refer to when I encounter it
again - then all I'll need to do is remember what I named your example
:)

Quote:
> This, as I say, is a relic from Windows 16-bit where this information
> was useful and only available from these ".def" files...but they've

I may well have been trying to do 16-bit code... tho probably not
Windows... I may not have made this clear to tlink :)

Best,
Frank



Thu, 07 Oct 2004 18:56:03 GMT  
 TASM to NASM and/or NASM to TASM
Frankie say:

Quote:
> Thanks, Beth! I confess I can't remember exactly what I was trying
to do
> when I got that message, and I don't seem to be able to reproduce it
> right now :) I've saved your message to refer to when I encounter it
> again - then all I'll need to do is remember what I named your
example
>:)

Happens to the best of us, Frank...although, seeing as my advice was
basically "ignore it" then that's probably what you did do,
anyway...just thought I'd clarify what the mysterious ".def" file was
all about...so that when you ignore it, you at least know why you're
ignoring it...hehehe :)...

Quote:

> > This, as I say, is a relic from Windows 16-bit where this
information
> > was useful and only available from these ".def" files...but
they've

> I may well have been trying to do 16-bit code... tho probably not
> Windows... I may not have made this clear to tlink :)

Not necessarily so...the 32-bit TLINK is also capable of processing
".def" files and still issues the warning "no .def file"...so, doing
32-bit code can still trigger the error...though, it really shouldn't
turn up if you're not doing Windows code...that is strange and
probably a case of forgetting to tell the linker exactly what you were
trying to do :)...

Beth:)



Wed, 13 Oct 2004 05:56:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. nasm, tasm, masm, hla

2. .... to [NASM Bootloader to TASM Bootloader] to ....

3. MASM/TASM to NASM Converter?

4. Tasm or Nasm?

5. TASM to NASM

6. tasm masm nasm dazm ...

7. Compiling TASM program with NASM.

8. porting TASM to NASM

9. +/- of TASM, MASM, NASM

10. VLA's tutorial -- TASM -> NASM

11. .... to [NASM Bootloader to TASM Bootloader] to ....

12. tasm to nasm conversion problem

 

 
Powered by phpBB® Forum Software