NASM => Is it possible to override linker usage ?

Programming, for all ages and all languages.
Locked
User avatar
osdevkid
Member
Member
Posts: 72
Joined: Sun Nov 21, 2010 11:15 am
Location: India, Chennai

NASM => Is it possible to override linker usage ?

Post by osdevkid »

Hi all,

Is it possible to override linker usage in NASM.

I mean, is it possible to specify data, code segment alignment and address in NASM itself.
Hangin10
Member
Member
Posts: 162
Joined: Wed Feb 27, 2008 12:40 am

Re: NASM => Is it possible to override linker usage ?

Post by Hangin10 »

If you are not using a linker, why insist on using segments?
Just use the align directive before labels.

If you are using a linker, then no, that's the whole point of a linker.
User avatar
osdevkid
Member
Member
Posts: 72
Joined: Sun Nov 21, 2010 11:15 am
Location: India, Chennai

Re: NASM => Is it possible to override linker usage ?

Post by osdevkid »

At first, thanks to your reply.

leave about segment.

I want to load all my data in memory location "X", and I want to load and run my code from memory location "Y", how to do it in NASM without linker.

My advance thanks for those who post some simple example for this.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: NASM => Is it possible to override linker usage ?

Post by Solar »

osdevkid wrote:I want to load all my data in memory location "X", and I want to load and run my code from memory location "Y", how to do it in NASM without linker.
The question is, why would you want to do that without a linker?

Could it be because you don't understand linkers and are afraid of them?

If your X and Y are adjacent to each other in memory, it should be blatantly obvious how to do it.

If they are seperate in memory, you could hack your way around it in source, but all you'd do is mimic what the linker does for you anyway (meaning, you would have to understand what they do first, anyway).
My advance thanks for those who post some simple example for this.
Usually posting source is the worst way "explaining" something.
Every good solution is obvious once you've found it.
User avatar
osdevkid
Member
Member
Posts: 72
Joined: Sun Nov 21, 2010 11:15 am
Location: India, Chennai

Re: NASM => Is it possible to override linker usage ?

Post by osdevkid »

Solar wrote: Could it be because you don't understand linkers and are afraid of them?
Hi Solar,

Can you please recommend some good tutorial about Linker.
User avatar
f2
Member
Member
Posts: 311
Joined: Mon Jun 15, 2009 10:01 am
Location: France

Re: NASM => Is it possible to override linker usage ?

Post by f2 »

osdevkid wrote:Can you please recommend some good tutorial about Linker.
Maybe you need to read carefully the NASM manual to know if you can do that...
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: NASM => Is it possible to override linker usage ?

Post by Combuster »

osdevkid wrote:Can you please recommend some good tutorial about Linker.
Please, learn to STFW.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Locked