News:

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

A beginner's question!

Started by srod, November 07, 2006, 08:35:53 PM

Previous topic - Next topic

srod

Hi,

my first question (first of many no doubt!) in my quest to learn Win asm.

You'll have to excuse this dumb ass question, but I'm new to all this low level stuff!

If I create an object file which I intend to link with another object file to create an executable, must I use the export command on all code labels which I wish the other object file to be able to reference or is all this done automatically?

I'm okay with the process of linking with dll's, but I'm not clear on this aspect of linking with static objects etc.

Thanks in advance, and thanks for the excellent GoAsm tools.

Stephen.

**EDIT:  whoops!  Found the answer in the help manual!  :red

jorgon

Hi Stephen

Welcome to the forum anyway.
Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

srod

Thanks Jeremy.

I have another question now anyhow!  :8)

If I declare a label within a data section, is this public by default and if so, does this mean that 2 object files being linked within the same project must therfore not use the same names for their data labels?

Thanks in advance.

donkey

Hi srod,

Welcome to GoAsm and the forum, and ask as many questions as you like !!

To answer your second question, yes all "unique" or Global labels are public across modules, the manual has this to say...

Quote from: GoAsm.chmUnique labels
A unique label is one which can only be used once in your source script and in linked object files. It is a label with "global" scope, that is to say, at link-time it can be accessed by other object files.

Donkey
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

srod

Thanks for the reply donkey.  :8)

So is there no way to reference a label within the data section which is not made public across all object files in the application?

1rDirEctoALgran0

QuoteSo is there no way to reference a label within the data section which is not made public across all object files in the application?

I think you are right. :thumbu


Patrick.

jorgon

QuoteSo is there no way to reference a label within the data section which is not made public across all object files in the application?

This is correct, although local data labels can be re-used since their scope is limited to the FRAME...ENDF in which they are used (or referenced using USEDATA).

Code labels are also unique unless they are in one of the re-usable forms eg. letter+digit (or all digit), or beginning with a dot.
Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

srod

I understand.

Thanks for the replies.