News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Newbie need errmsg explanation

Started by Opiumdreamer, January 30, 2007, 09:04:52 AM

Previous topic - Next topic

Opiumdreamer

Good day, everyone!

I hope that my post will be accepted in here (or Campus it should have been, I suppose)

It has been qite a few years since I was struggling and actually did a bit of real coding there, after a while. But now, I have picked up my good fourth edition of Mazidi's superbible (according to me but Berry Breys programming the blambla and bla is a nice one too) and so, I have picked up my will to dive back into assembler again. "It" hated me, but I deeply loved "it" and this time I will try to treat her a little better so we can get married one day :)

I was always using TASM back then. My question now is, just a gutfeeling, of a somewhat trivial nature.

My problem here do concern MASM. Yesterday i downloaded Hutch's version 9 of MASM32. Didn't patch it or anything. No even the simplest, empty shell would pass through the linker without it shouting back at me.

Before I paste the error messages I think it is of relevance that I mention that I do not write fancy GUI apps, just plain old-school DOS apps that does funny things, and I am doing this on a WinXP system. That is what I have always ending up doing since I started. Anyhow, TASM and TLINK works just fine with any of the source files that LINK won't eat.

I tried the most basic (almost anyway) assembly EXE-shell possible and you can find it at here at pastebin.ca

first, Here is the output of TASM 4.1 and TLINK 7.1.30.1:
F:\>tasm src\shell.asm
Turbo Assembler  Version 4.1  Copyright (c) 1988, 1996 Borland International

Assembling file:   src\shell.asm  to  shell.OBJ
Error messages:    None
Warning messages:  None
Passes:            1
Remaining memory:  412k


F:\>tlink SHELL.OBJ
Turbo Link  Version 7.1.30.1. Copyright (c) 1987, 1996 Borland International


Here is the MASM + LINK output
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

F:\>ml src\shell.asm
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

Assembling: src\shell.asm
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

/z2
"shell.obj"
"shell.exe"
NUL
LINK : warning LNK4044: unrecognized option "z2"; ignored
LINK : error : Segment reference in fixup record
shell.obj : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

F:\>link shell.obj
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

LINK : error : Segment reference in fixup record
shell.obj : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt


I really appologize for my ignorance - you must probably laugh quite a bit, but I give you that, my friends. I simply had to bloat myself a bit here to get inot the MASM world too even though any old assembler would handle my piece of work, so...

Anyhow. Please guide me through this little step, would you? I'd certainly appreciate it a great deal!

PS. It seems as MASM has the assembler and linker put together in one executable so that linking an .obj file after running ml.exe would be doing it twice, am i right? I also read something about a link563 that should replace the existing one when linking 16.bit DOS apps but I'm unsure there. And also, would you suggest installing the service pack 2 for masm 9?

Cheers!

Kind regards,
Markus

Opiumdreamer

As I said, a few of you probably giggles while some think viciously that a guy like this should keep his fingers off the keyboard and maybe so.

It never strtuck me that I always assemble 1-bit code and not even the name MASM32 implied enough, I suppose hehe. Anyway. Got meself a nice version 5.10 which does what I wanna even though there supposedly are ways to use the contents of MASM32 v9 too. THAT, however would be very nice of you to let me know if there are. And which and where I can read more about usage. There is such an amount to read.

When someone says - "read then manual" they don't want me to switch to MASM 'ciz I'll go straight back to TASM when getting lost in all the, at the time, "unnnessessary" information. So when one points out what one should look for, I call help :)

Cheers again!

I know some kind sould probably would have pointed out my fatal mistake sooner or later.

Kind regards,
Markus

ChrisLeslie

Unlike the 16 bit days you have to compile as a COFF and link seperately. Take a look in the batch files in the MASM32 package bin folder and you will see the sequences and switches. "bldallc.bat" is probably the one you will be interested in. However, the easiest way is to compose/edit you source using Qeditor and then compile using the menu option "project/console assemble and link" as this will run the batch automatically. Then use the menu option to run the progam as well. :U

Chris

hutch--

Markus,

If you want to write code in TASM fine but MASM is a different animal and to write code with MASM you need to learn how it works. MASM32 will not build TASM files as it is built around the capacity of MASM, not TASM so if you want to use functionality like the code and macros in masm32, you will have to write your own.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

raymond

QuoteI do not write fancy GUI apps, just plain old-school DOS apps that does funny things, and I am doing this on a WinXP system.

I also used to write only DOS apps up until 6-7 years ago. And most of those DOS apps will execute under WinXP; so, that is not your problem.

However, if you want to continue writing only DOS apps, you will NOT be able to use the MASM32 package and all its goodies. That package is only for 32-bit assembly and cannot handle any of the INTs you are used to with DOS. Switching from DOS to 32-bit assembly is not that difficult. And, it has numerous advantages such as not having to worry about segments; you have up to 4Gb to play with. The main disadvantage is that you will have to learn which Windows functions are needed to replace the INT functions, and how to use them.

Raymond
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com

mike_s

I read everything is this post and it answered a lot of questions on why I've spent the whole weekend with my face in the computer and I have nothing to show for it.  I am also child of the 16 bit era.  But I'm ready to move up, first where can I find an explanation of the error codes.  I've been into the HELP section, but I didn't see a list of errors.